How to Check kernel version in code?

Sreenivasa Honnur shonnur at chelsio.com
Tue Jun 3 15:42:05 UTC 2014


I want to enable some code based on FBSD kernel versions like below:

#ifdef FreeBSD_VERSION_10

#endif

#ifdef FreeBSD_VERSION_9.2

#endif


How can I do achieve this?

Thanks
Sreenivas


More information about the freebsd-hackers mailing list