[PATCH] include/platform.h: Define KERNEL_VERSION unconditionally

Shaun Jackman sjackman at gmail.com
Thu Jun 1 15:48:05 UTC 2006


On 5/31/06, Robert P. J. Day <rpjday at mindspring.com> wrote:
> or conditionally define it to be something generically meaningless if
> the OS is *not* linux?

I thought of that, and initially thought, "What's the point", since
KERNEL_VERSION just assembles a constant anyways.
KERNEL_VERSION(2,6,0) is simply a pretty way of writing 0x20600. I
didn't think mucking with a macro that only defines a constant had any
benefit.

There is, however, an inherent problem with get_linux_version_code. It
returns the version of not only Linux, but any system that implements
uname. It seems some incorrect decisions could be made if busybox were
running on FreeBSD 6.1, and Busybox thought it were running on Linux
6.1.0, or possibly Linux 0.6.1. Looking at it now, it seems
get_linux_version_code would simply crash -- thou shalt not follow the
NULL pointer [1] -- if it were passed a version number with only two
digits.

My conclusion is that any branch on get_linux_version_code should
probably also specify which branch to take if it's *not* running on
Linux, but a generic POSIX/SUS system.

Cheers,
Shaun

[1] 2. Thou shalt not follow the NULL pointer, for chaos and madness
await thee at its end.

Clearly the holy scriptures were mis-transcribed here, as the words
should have been ``null pointer'', to minimize confusion between the
concept of null pointers and the macro NULL (of which more anon).
Otherwise, the meaning is plain. A null pointer points to regions
filled with dragons, demons, core dumps, and numberless other foul
creatures, all of which delight in frolicing in thy program if thou
disturb their sleep. A null pointer doth not point to a 0 of any type,
despite some blasphemous old code which impiously assumes this.



More information about the busybox mailing list