dosfstools  4.2
About: dosfstools are utilities to create, check and label (MS-DOS) FAT filesystems.
  Fossies Dox: dosfstools-4.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

linux_version.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <sys/utsname.h>
3 
4 #include "linux_version.h"
5 
6 int get_linux_version (void)
7 {
8  static int kver = -1;
9  struct utsname uts;
10  int major = 0;
11  int minor = 0;
12  int teeny = 0;
13  int n;
14 
15  if (kver != -1)
16  return kver;
17  if (uname (&uts))
18  return kver = 0;
19 
20  n = sscanf(uts.release, "%d.%d.%d", &major, &minor, &teeny);
21  if (n < 1 || n > 3)
22  return kver = 0;
23 
24  return kver = KERNEL_VERSION(major, minor, teeny);
25 }
int get_linux_version(void)
Definition: linux_version.c:6
#define KERNEL_VERSION(a, b, c)
Definition: linux_version.h:9