Splitting kernel headers and deprecating __KERNEL__
Quoted 2 lines · David Howells
We've been discussing splitting the kernel headers into userspace API headers and kernel internal headers and deprecating the
__KERNEL__macro.
Quoted 7 lines · Linus Torvalds
Quoted 5 lines · Alexandre Oliva
- Linux gets to define the ABI between kernel and userland, and userland must duplicate the contents of headers in which the kernel defines the kernel<->userland ABI, tracking changes in them in the hope that nothing falls through the cracks
Quoted 5 lines
This is unquestionably true. The kernel obviously _does_ define the ABI, and userland just lives with it. At some point you have to track things, just because new features etc just can't be sanely handled any other way.
That said, I think we can make the tracking _easier_.
Nice discussion, but nobody is discussing my main concern,
even if Linus come close to it.
On my box, I do have multiple kernels. Some 2.4.X, some 2.6.X,
I may even find some 2.2.X on some of my boxes. Depending on what I do, and the bug reports send to me, I boot one of these kernel or another. Because Linus is so productive, I update my kernel frequently, without changing the user space. I know that some distributions are also offering various kernel versions, and let the user choose.
So, which kernel ABI should be present on my system in/usr/include/linux and /usr/include/asm ? Should I use the ABI from 2.6.X, 2.4.X or 2.2.X ? Should I take the time to create a sanitised version of the kernel header every time I install a new kernel, even though I may revert back to the previous kernel ? Should I recompile applications using kernel headers at each kernel upgrade ?
Currently, it doesn't matter, as so few applications are using
those headers, and most changes are highly backward compatible. And the application that are deeply intimate with the kernel probably do run-time tracking of features already, so don't really need those headers...
However, I believe we need to at least ask this question, even
if I don't think we will come up with a good answer...
Have fun... Jean
Quoted 4 lines · Jean Tourrilhes
So, which kernel ABI should be present on my system in
/usr/include/linuxand/usr/include/asm? Should I use the ABI from 2.6.X, 2.4.X or 2.2.X ?
I have always felt (pretty strongly) that the /usr/include/xxx contents should not be kernel-dependent, but be linked to your glibc version. That's why the symlink from /usr/include/xxx to /usr/src/linux/include/ has been deprecated for the last, oh about ten years now..
Yes, there are some _very_ specific things which might care about system calls or ioctl's that have been added later, but let's face it, we don't actually do that very often. The kernel may change at a rapid pace, but user interfaces don't, and user interfaces that would bypass the C library change even less frequently.
Linus
Quoted 8 lines · Linus Torvalds
Quoted 3 lines · Jean Tourrilhes
So, which kernel ABI should be present on my system in
/usr/include/linuxand/usr/include/asm? Should I use the ABI from 2.6.X, 2.4.X or 2.2.X ?
Quoted 5 lines
I have always felt (pretty strongly) that the
/usr/include/xxxcontents should not be kernel-dependent, but be linked to your glibc version. That's why the symlink from/usr/include/xxxto/usr/src/linux/include/has been deprecated for the last, oh about ten years now..Yes, there are some _very_ specific things which might care about system calls or ioctl's that have been added later, but let's face it, we don't actually do that very often. The kernel may change at a rapid pace, but user interfaces don't, and user interfaces that would bypass the C library change even less frequently.
More to the point, though, is that they should be supersets of each other, which means you should be able to upgrade them to the latest version.
Most of the ABI changes, after all, are new structures needed for various things.
-hpa