File: kernel-ver.c

package info (click to toggle)
sl-modem 2.9.11~20110321-11
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd
  • size: 3,448 kB
  • ctags: 2,972
  • sloc: ansic: 11,002; sh: 809; makefile: 232; python: 40; perl: 11
file content (21 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 *    kernel-ver.c - prints Linux kernel version to stdout and exit.
 *
 */

#include <stdio.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
#include <generated/utsrelease.h>
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
#include <linux/utsrelease.h>
#endif // KERNEL_VERSION(2,6,18)
#endif // KERNEL_VERSION(2,6,33)

int main()
{
        printf ("%s\n",UTS_RELEASE);
        return 0;
}