2 ms·
This happens due to POSIX. Nothing stops people from using direct system calls but they would rather use a C library for portability reasons. I'd even say the
by matheusmoreira 7y ago
This happens due to POSIX. Nothing stops people from using direct system calls but they would rather use a C library for portability reasons.
I'd even say the Linux system call interface is better than the POSIX one. Well documented, no errno. I wrote a liblinux in C and Rust and it's been useful for accessing newer system calls with no libc stubs. The more subtle problem: standard C libraries are incompatible with direct system calls. They maintain a lot of global state which will be invalidated if the program calls the kernel directly. For example, clone() cannot be used with glibc.
The ideal solution is to start from scratch and build a new user space without using C at all.