Re:C library system-call wrappers, or the lack thereof
by en4bz on Tuesday November 13, 2018 @09:46PM
(#18447032)
Lack of `gettid` and `futex` have always annoyed me.
[ Parent
| on HN ]
Re:C library system-call wrappers, or the lack thereof
by monocasa on Tuesday November 13, 2018 @11:18PM
(#18447448)
There's this sense that they're not for the consumption of mere mortals.
That being said, you can still at least always call syscall(2).
Re:C library system-call wrappers, or the lack thereof
by glandium on Wednesday November 14, 2018 @12:15AM
(#18447681)
One problem is that not all system calls take the same kinds of arguments on all platforms. Example: SYS_mmap takes a pointer to a struct containing all the arguments on s390. Even better, on Alpha, glibc's syscall cannot call system calls with 6 or more arguments (although maybe that was fixed in the past 8 years?).
Re:C library system-call wrappers, or the lack thereof
by murderfs on Wednesday November 14, 2018 @02:46AM
(#18448258)
> Even better, on Alpha, glibc's syscall cannot call system calls with 6 or more arguments
That's just generic kernel ABI: syscalls can have at most 6 arguments: https://elixir.bootlin.com/linux/latest/source/include/asm-g...
Re:C library system-call wrappers, or the lack thereof
by glandium on Wednesday November 14, 2018 @04:45AM
(#18448675)
Skip the "or more" part, then, but that doesn't make it less true: it wasn't possible to make a 6-argument system call with syscall on alpha 8 years ago. I don't know whether that's been fixed or not.
Re:C library system-call wrappers, or the lack thereof
by pm215 on Wednesday November 14, 2018 @07:20AM
(#18449306)
The syscall(5) manpage documents the Alpha syscall abi as passing arguments in a0,a1,a2,a3,a4,a5 which would suggest so. (MIPS o32 is the only listed one which is a bit oddball: you can only pass 4 args in registers and then use stack for 5 and 6.)