Earlier quoted context omitted.
System calls have not stability guarantee on macOS. You should use libc instead. In general the use of syscalls directly is fairly limited. Edit: for instance go broke once for macOS Sierra, when Apple changed the gettimeofday system call: https://github.com/golang/go/issues/16570
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.
Linux System Call Table
41–50 of 65 posts
Re: Linux System Call Table
#42Earlier quoted context omitted.
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.
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.
Re: Linux System Call Table
#43Re: Linux System Call Table
#44What is the use case for this? Is it for someone trying to write their own syscall wrappers?
Re: Linux System Call Table
#45Re: Linux System Call Table
#46Earlier quoted context omitted.
You might need that when you want to reimplement Linux, the Joyent team did that on their OS (derived from solaris) so that user can run linux binaries on a solaris kernel (so thay have dtrace, zfs, mdb, ...) Bryan Cantrill did a bunch of conferences on that (one here: https://youtu.be/TrfD3pC0VSs ) The idea behind is that Linux is only a list of syscalls, if you are able to reimplement them, you reimplement linux, y…
For that matter, this is how Widows's Linux compatibility layer works.
Re: Linux System Call Table
#47Actually, the syscall numbers are wrong! This reference seems better: http://blog.rchapman.org/posts/Linux_System_Call_Table_for_x... Consider simple C program: #define _GNU_SOURCE #include int main(){ syscall(276); } Strace'ing it shows the syscall used is tee, just as the reference I linked shows, and not pwritev as in OP's table.
Re: Linux System Call Table
#48x86: https://github.com/torvalds/linux/blob/master/arch/x86/entry...
x64: https://github.com/torvalds/linux/blob/master/arch/x86/entry...
Re: Linux System Call Table
#49What is the use case for this? Is it for someone trying to write their own syscall wrappers?
You might need that when you want to reimplement Linux, the Joyent team did that on their OS (derived from solaris) so that user can run linux binaries on a solaris kernel (so thay have dtrace, zfs, mdb, ...) Bryan Cantrill did a bunch of conferences on that (one here: https://youtu.be/TrfD3pC0VSs ) The idea behind is that Linux is only a list of syscalls, if you are able to reimplement them, you reimplement linux, y…
To clarify, what you're saying is that in BSD land, the syscall API is not considered stable, but libc is?
Re: Linux System Call Table
#50Earlier quoted context omitted.
System calls have not stability guarantee on macOS. You should use libc instead. In general the use of syscalls directly is fairly limited. Edit: for instance go broke once for macOS Sierra, when Apple changed the gettimeofday system call: https://github.com/golang/go/issues/16570
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.