semtimedop on x64
System V semaphore operations
sys_semtimedop(int semid, struct sembuf *sops, unsigned nsops, const struct __kernel_timespec *timeout)
| number | 220 (0xdc) |
|---|---|
| abi | common |
| kconfig | CONFIG_SYSVIPC |
| family | sysvipc see the whole family on x64 |
| entry point | sys_semtimedop |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | semtimedop(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 220, the syscall number |
rdi | int semid |
rsi | struct sembuf *sops |
rdx | unsigned nsops |
r10 | const struct __kernel_timespec *timeout |
rax | the return value |
Then run syscall to enter the kernel.
The syscall instruction clobbers rcx (the return address lands in rcx) and r11 (the flags land in r11).
Since Linux 5.14 the kernel reads the syscall number from eax and ignores the upper 32 bits of rax. Older kernels fail with ENOSYS when those bits are not zero, and mov eax, N clears them, so it works on both.
Same syscall on other architectures
- arm64 192
- arm 312
- riscv64 192
- x32 1073742044
- loongarch64 192
- ppc64 392
- s390x 392
- mips64 5214
- mipsn32 6215
- alpha 423
- arc 192
- blackfin 357, removed in 4.17
- csky 192
- hexagon 192
- ia64 1247, removed in 6.7
- metag 192, removed in 4.17
- microblaze 325
- nds32 192, removed in 5.18
- nios2 192
- openrisc 192
- parisc 228
- score 192, removed in 4.17
- sparc64 392
- tilegx 192, removed in 4.17
- tilepro 192, removed in 4.17
- xtensa 161
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/semtimedop