Re: just how "sanitized" are the sanitized headers?

From: Robert P. J. Day
Date: Thu Nov 30 2006 - 04:59:55 EST

On Thu, 30 Nov 2006, Alexey Dobriyan wrote:

> On 11/30/06, Robert P. J. Day <rpjday@xxxxxxxxxxxxxx> wrote:
> > i noticed that, when i generate the sanitized headers with "make
> > headers_install", there are still a number of headers files that are
> > installed with variations on "#ifdef __KERNEL__".
> >
> > i always thought the fundamental property of sanitized headers was
> > to be compatible with glibc
> You were wrong.

ok, my fault, i worded that badly. i have a *general* idea of the
purpose of sanitized headers -- i've been using a pre-built set for
crosstool for quite some time, and i'm assuming that (theoretically) i
should be able to replace that pre-built set with what's generated by
"make headers_install", is that right?

(BTW, what is the proper description for the sanitized headers?
there's *nothing* in the kernel source tree documentation that
explains their creation.)

> > and have no traces of "KERNEL" content
> > left.
> That's correct.

good. at least *that* part i got right. :-)

> > so what's the purpose of leaving some header files with that
> > preprocessor content?
> When you see __KERNEL__ in sanitized headers, it's either due to
> a) unifdef bug, or
> b) header being listed in header-y when it should be listed in unifdef-y

a couple things going on here, actually. in the simple case, there
are three header files:


that can be fixed simply by adding "unifdef-y" entries for them to the
Kbuild file (i can submit a patch shortly). but there are a few other
cases which still contain compound preprocessor directives such as:

#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

having never worked with unifdef before, i guess i was being overly
optimistic in thinking that it, if i "unifdef"ed __KERNEL__, it might
at least simplify the expression. oh, well ... live and learn.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at