timerfd_settime on x64
timers that notify via file descriptors
sys_timerfd_settime(int ufd, int flags, const struct __kernel_itimerspec *utmr, struct __kernel_itimerspec *otmr)
| number | 286 (0x11e) |
|---|---|
| abi | common |
| kconfig | CONFIG_TIMERFD |
| entry point | sys_timerfd_settime |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | timerfd_settime(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 286, the syscall number |
rdi | int ufd |
rsi | int flags |
rdx | const struct __kernel_itimerspec *utmr |
r10 | struct __kernel_itimerspec *otmr |
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 325
- arm64 86
- arm 353
- riscv64 86
- ia32 325
- x32 1073742110
- loongarch64 86
- ppc64 311
- ppc 311
- s390x 320
- mips64 5282
- mipsn32 6286
- mipso32 4323
- alpha 482
- arc 86
- blackfin 358, removed in 4.17
- cris 325, removed in 4.17
- csky 86
- frv 325, removed in 4.17
- hexagon 86
- ia64 1311, removed in 6.7
- m68k 321
- metag 86, removed in 4.17
- microblaze 326
- mn10300 326, removed in 4.17
- nds32 86, removed in 5.18
- nios2 86
- openrisc 86
- parisc 307
- score 86, removed in 4.17
- sh 325
- sparc 315
- sparc64 315
- tilegx 86, removed in 4.17
- tilepro 86, removed in 4.17
- xtensa 313
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/timerfd_settime