He meant GLibC function, not syscall...
He meant GLibC function, not syscall...
Posted Nov 30, 2010 22:56 UTC (Tue) by khim (subscriber, #9252)In reply to: ABI backward-compatibility is the trick... by madscientist
Parent article: The kernel and the C library as a single project
This is good example: sched_setaffinity(2) had two arguments before 2.3.4. If you'll take the old program which uses this version - you'll be unable to compile it today. BUT! If you'll take binary of old version of program compiled with old version of GLibC - it'll run with new one just fine because today GLibC offers two interfaces of sched_setaffinity(2) and selects them automatically depending on what the calling program expects.
GLibC maintains stable ABI - and it's very good at that (documented "undefined" behavior is exception, of course). Yet it does not maintain stable API! This experience is so alien compared to what other libraries are doing that it takes some time to wrap up the mind around the concept.
Posted Nov 30, 2010 23:21 UTC (Tue)
by madscientist (subscriber, #16861)
[Link]
API compatibility is a completely different animal: if you're going to use Linux-specific APIs then I suppose you just have to fix your code if they change in the future. If you don't want to do that, restrict yourself to POSIX and other standard APIs. I don't really worry about this, to be honest.
Posted Dec 1, 2010 10:57 UTC (Wed)
by Yorick (guest, #19241)
[Link]
Posted Dec 1, 2010 14:14 UTC (Wed)
by paulj (subscriber, #341)
[Link]
Further, even for the API, there are ways to offer multiple versions of those. You can categorise your APIs in various, including with levels. Applications can then *choose* to explicitly depend on certain APIs or they can choose not to and use whatever the default API is - some applications will do that through laziness or ignorance.
All boring and hard engineering work, but it's what widely deployed (in space and, especially, time) systems tend to have to acquire.
ABI == important; API == not so much...
As you note, the ABI stability only goes in one direction. Someone who wishes to distribute a binary that will work on systems of varying age will have to chose between:
He meant GLibC function, not syscall...
None of these solutions are perfect. In some ways, the Unix tradition of providing a "canonical" set of include and lib files in a prominent place, /usr, and a compiler that is configured to use these files by default, makes this harder than it would on a platform where development tools are installed separately and explicitly in a user-specified location.
He meant GLibC function, not syscall...