futex_wait on x64
sys_futex_wait(void *uaddr, unsigned long val, unsigned long mask, unsigned int flags, struct __kernel_timespec *timespec, clockid_t clockid)
| number | 455 (0x1c7) |
|---|---|
| abi | common |
| entry point | sys_futex_wait |
| since | Linux 6.7 |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 455, the syscall number |
rdi | void *uaddr |
rsi | unsigned long val |
rdx | unsigned long mask |
r10 | unsigned int flags |
r8 | struct __kernel_timespec *timespec |
r9 | clockid_t clockid |
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
- x86 455
- arm64 455
- arm 455
- riscv64 455
- ia32 455
- x32 1073742279
- loongarch64 455
- ppc64 455
- ppc 455
- s390x 455
- mips64 5455
- mipsn32 6455
- mipso32 4455
- alpha 565
- arc 455
- csky 455
- hexagon 455
- m68k 455
- microblaze 455
- nios2 455
- openrisc 455
- parisc 455
- sh 455
- sparc 455
- sparc64 455
- xtensa 455
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/futex_wait