3 ms·
I think competing products define their interface in terms of calling a provided C library, and leave the entirely of the system call mechanics as an implementa
by ben0x539 4y ago
I think competing products define their interface in terms of calling a provided C library, and leave the entirely of the system call mechanics as an implementation detail.
- jmillikin 4y agoFor context, this is how it worked in old-school UNIX. If you look at (for example) SunOS, the kernel ABI is undocumented and everything in userspace depends on libc. The OSes and userspace languages of the day were deeply coupled -- C was the language of UNIX. You can still see the remnants of this design in macOS, except instead of libc it's libSystem. Apple has decoupled their OS from C (in favor of Objective C, then Swift) but the idea of a userspace entry point to system functionality survived. Linux is different from traditional UNIX because it's a kernel-only OS. There's no "Linux libc", and third parties have written multiple implementations of the C standard library that run on Linux. The only way this structure can work is for the kernel itself to provide stable ABI, and the standard approach at the time (mid 90s) was numeric syscall codes with positional parameters.
- __turbobrew__ 4y agoOpenBSD does (did?) require all syscalls to originate from libc as well.
- ben0x539 4y agoYeah, and the particular old-school UNIX I had in mind was Win32. :)