5 ms·
Lack of `gettid` and `futex` have always annoyed me.
by en4bz 8y ago
Lack of `gettid` and `futex` have always annoyed me.
- monocasa 8y agoThere'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).
- glandium 8y agoOne 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?).
- murderfs 8y ago> 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-generic/syscall.h#L104 https://elixir.bootlin.com/linux/latest/source/include/asm-g...
- glandium 8y agoSkip 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.
- pm215 8y agoThe 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.)