Re: [RFC] Splitting kernel headers and deprecating __KERNEL__

From: H. Peter Anvin
Date: Wed Dec 01 2004 - 00:51:53 EST


Followup to: <Pine.LNX.4.58.0411301243000.22796@xxxxxxxxxxxxxxx>
By author: Linus Torvalds <torvalds@xxxxxxxx>
In newsgroup: linux.dev.kernel
>
> But claiming that __KERNEL__ doesn't work is clearly a bunch of crapola.
> As is the notion that you can somehow do it all. We do it in small pieces.
>

IMNSHO, based on my experience with klibc, the problem is not #ifdef
__KERNEL__, the *specific* problems are:

- The kernel exporting libc4/5 internals, which are neither what the
kernel nor any kind of modern userspace wants. This should be
possible to get rid of easily enough.

- The kernel exporting things into the userspace namespace. The
kernel's definition of "struct stat" isn't usable -- the one that is
useful is called "struct stat64" on most, but not all,
architectures, but because it's a structure tag it can't be pulled
from the exported kernel ABI in such a way that what userspace calls
"struct stat" is what the kernel currently calls "struct stat64" if
that exists.

This one is a bit uglier, since it probably needs something like:

#ifdef __KERNEL__
#define __kabi_stat64 stat64
#endif

struct __kabi_stat64 { ... };

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/