Re: Header files and the kernel ABI

H. Peter Anvin
2002-07-25T16:27:30Z

Andreas Dilger wrote:
>
> That brings up the question - how do you tie a particular
> <linux/abi/*.h> to a particular kernel? Should there be a bunch of
> directories <linux/abi-2.4/*.h> and/or <linux/abi-2.4.12/*.h> and/or
> <linux/abi-`uname -r`/*.h> or what? While there are efforts to keep
> the ABI constant for major stable releases, this is not always true,
> so abi-2.4 will certainly not be enough. Maybe linux/abi is a symlink
> to the abi directory of currently running kernel?
>

Well... I guess that depends on what kind of changes we make. In
general, I belive linux/abi should be cumulative, i.e. it should
describe "sys_stat" as well as "sys_oldstat" or whatever it is called.
ABI changes are hard to deal with regardless; you never really know what
you're breaking, and you probably have to deal with it on a case-by-case
basis. People should at least understand that they're breaking the ABI,
which I'm not sure they currently are.

In general I believe linux/abi should come from the current kernel, but
for obvious reasons that doesn't mean it's the kernel that's running
when the application is actually being executed. This sort of things
apply to all ABI changes, inherently, which is why
non-backwards-compatible ABI changes must be avoided. Ultimately,
though, it's up to the person who changes it to do the appropriate thing.

-hpa