[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determining kernel version (2.2 or 2.4) from within module?



I have a module which compiles for both 2.2 and 2.4, using a couple #ifdef's
for the differences.  I want to be able to create a binary driver that loads on
both 2.2 or 2.4, detecting at run-time which version it is.  Two questions:

1. Can I use "insmod -f" to load a driver compiled for 2.2 under 2.4?
2. Is there a way to check the kernel version number from within a module?

Please do not tell me that I should just distribute the source code and let the
user compile, or anything along those lines.  That option is not available, and
I don't want to discuss it.  Please just answer my question without criticism.


-- 
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/