Post by Irek SzczesniakDoes Linux have a cpp define which tells me the Linux kernel header version?
Irek
Hi,
you can test kernel version this way:
#include <linux/version.h>
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
...
#endif
------
linux/version.h has this macro:
#define LINUX_VERSION_CODE 199171
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
Btw, I don't know why you need it, but compile time test is much better
than just version check as linux distributions usually patch kernel a lot.
Michal