[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Determining kernel version (2.2 or 2.4) from within module?
On Sat, Apr 28, 2001 at 02:29:45AM +0100, John Levon wrote:
> On Fri, 27 Apr 2001, Erik Mouw wrote:
>
> > > 2. Is there a way to check the kernel version number from within a module?
> >
> > Yes, but only after the module has been loaded, i.e.: too late.
>
> OK, I'm being dense - how ?
By using the variables version_string and/or system_utsname in
init/version.c. For examples, see version_read_proc() in
fs/proc/proc_misc.c, or rpc_create_client() in net/sunrpc/clnt.c.
Erik
--
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands
Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
-
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/