Hacker News new | ask | show | jobs
by zzzcpan 3191 days ago
Linux doesn't guarantee syscall stability either. Just make sure your wrappers can use a syscall table chosen at runtime, depending on which kernel you are running.
3 comments

Yes it does, at least in the sense that syscalls which become officially public will never be removed from Linus' tree except in rare circumstances (i.e. proof that nobody is using it), nor will the arguments change. This is Linus' famous "never break user space" ABI mantra. While distributions may deprecate and remove them (e.g. sysctl(2)) they certainly won't be assigned new IDs. A table won't help in such cases.
Exactly. This is why, for example, the original 'mmap' system call entry point on x86 still exists, even though it is overwhelmingly likely that every program on your machine is actually going to use the 'mmap2' entry point.
I think you're confusing driver APIs and syscalls. Both are infamous for their respective lack of, or guarantee of stability.
if you're going to implement that kind of overhead why not just use libc?
I'm not sure what you mean by overhead. It's not that hard or expensive to choose a few function pointers on program start.