3 ms·
This is the correct answer. Don't use syscalls unless you know what you're doing, obviously. Take a look at how musl and glibc POSIX calls are implemented, some
by epilys 4y ago
This is the correct answer. Don't use syscalls unless you know what you're doing, obviously. Take a look at how musl and glibc POSIX calls are implemented, some have nuances you have to be aware of, and in others libc might do hidden stuff behind the curtain.
Example of small nuance that can ruin your day/week: the size of syscall(2) arguments is fixed, but for some syscalls the arguments must be smaller. Hence you have to pack and aline the values properly in the registers. This example is from the syscall(2) manpage.
- deleted 4y ago[deleted]
- eru 4y agoAnd even musl has quite a few bugs where it lags behind glibc a lot. I've recently been trying to fix some of them, but so far getting traction on their mailing list is a bit slow.