Re: [RFC] Splitting kernel headers and deprecating __KERNEL__

Matt Mackall
2004-11-30T22:50:09Z

On Tue, Nov 30, 2004 at 10:21:52AM -0800, Linus Torvalds wrote:
>
>
> On Tue, 30 Nov 2004, David Woodhouse wrote:
> >
> > The idea in the proposal which David posted, which seemed perfectly
> > specific enough to me, was to move all the user-visible parts to
> > separate header files in a separate directory.
>
> You call _that_ specific?
>
> Hell no. You need to do it without breaking existing uses, as noted
> earlier, and it's not specific at all. "all user visible parts" is a big
> undertaking, if you can't make it smaller than that, then forget about it.

So we follow dhowell's plan with the following additions:

a) during the transition, include/linux/foo.h includes
include/user/foo.h if it exists and similarly for asm-*
b) when include/user is deemed sufficiently populated, a flag day is
declared and links from /usr/include are switched to them
c) #define __KERNEL__ is dropped from the compile
d) extraneous include/user/* includes are removed from include/linux
(though they'll often make perfect sense)

Step b) may be a long time in coming, but for interfaces where kernel
headers are frequently abused, we can start feeling benefits.

> Basic rule in kernel engineering: you don't just rewrite the world. You do
> it in incremental independent steps.

Even so, it's sometimes important for everyone to agree on a
destination before they set out..

--
Mathematics is the supreme nostalgia of our time.