Re: Kernel version

Keith Rohrer (kwrohrer@uiuc.edu)
Tue, 25 Mar 1997 22:47:02 +0000 (GMT)


> Can someone tell me if there is an easy way to get the kernel release and
> the nodename from within a C program?
Do the equivalent of "cat /proc/version". Dunno what you mean by "nodename",
though; you might want to check the environment variables HOST or HOSTNAME,
or cat /etc/HOSTNAME, or even try gethostid()...I'm sure there's something
under /proc for this, too, but since a machine can have one IP number
per interface and more than one name per IP number, plus IP aliasing,
it can be hard to know which name you want.

Keith