Why does /usr/include/linux/version.h define the kernel version as 2.4.20?

If it doesn't fit in another category, ask it here.
steven_rvbd
Posts: 2
Joined: 2009/08/20 18:16:00
Contact:

Why does /usr/include/linux/version.h define the kernel version as 2.4.20?

Postby steven_rvbd » 2009/08/20 18:26:14

This is causing issues building some packages. For instance boost::asio uses the kernel version defined in this file to choose between using select and epoll.

--Steven

User avatar
AlanBartlett
Forum Moderator
Posts: 9316
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Why does /usr/include/linux/version.h define the kernel vers

Postby AlanBartlett » 2009/08/21 10:56:15

Code: Select all

[ajb@nova9 linux]$ uname -rmi
2.6.9-78.0.22.plus.c4 x86_64 x86_64
[ajb@nova9 linux]$ cat version.h
#define UTS_RELEASE "2.4.20"
#define LINUX_VERSION_CODE 132116
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
[ajb@nova9 linux]$

I see UTS_RELEASE, not KERNEL_VERSION, defined as 2.4.20.

As CentOS 4 is binary compatible with RHEL 4 I can say, with confidence, that the /usr/include/linux/version.h file displayed above is identical to that distributed by TUV.

It might be worth looking to see exactly which parameter is being checked by the code you are compiling.

Three possible courses of action:

(1) edit the file so that UTS_RELEASE is defined to be the string "2.6.9" for the duration of your code compilation
(2) ask the provider of the code that you are attempting to compile why it uses UTS_RELEASE
(3) ask TUV

steven_rvbd
Posts: 2
Joined: 2009/08/20 18:16:00
Contact:

Re: Why does /usr/include/linux/version.h define the kernel version as 2.4.20?

Postby steven_rvbd » 2009/08/21 21:08:36

Boost is looking at LINUX_VERSION_CODE (not UTS_RELEASE), which indicates that the kernel is 2.4.20;

> #define LINUX_VERSION_CODE 132116

>>> "%x" % 132116
'20414'

> #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

Changing version.h does not seem like a good idea without knowing why it does not match the kernel that is running.

User avatar
AlanBartlett
Forum Moderator
Posts: 9316
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Why does /usr/include/linux/version.h define the kernel version as 2.4.20?

Postby AlanBartlett » 2009/08/22 13:50:58

Steven,

I'll reiterate -- CentOS is binary equivalent to RHEL. Any decision made by TUV is reproduced in CentOS.

As you require an answer to a question that only TUV can answer, I'll advise that you first check and then raise this query on the upstream bug tracker.

For future reference, please post the bz reference number you obtain here.