timer_settime on x64
arm/disarm and fetch state of POSIX per-process timer
sys_timer_settime(timer_t timer_id, int flags, const struct __kernel_itimerspec *new_setting, struct __kernel_itimerspec *old_setting)
| number | 223 (0xdf) |
|---|---|
| abi | common |
| kconfig | CONFIG_POSIX_TIMERS |
| entry point | sys_timer_settime |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | timer_settime(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 223, the syscall number |
rdi | timer_t timer_id |
rsi | int flags |
rdx | const struct __kernel_itimerspec *new_setting |
r10 | struct __kernel_itimerspec *old_setting |
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 260
- arm64 110
- arm 258
- riscv64 110
- ia32 260
- x32 1073742047
- loongarch64 110
- ppc64 241
- ppc 241
- s390x 255
- mips64 5217
- mipsn32 6221
- mipso32 4258
- alpha 415
- arc 110
- blackfin 261, removed in 4.17
- cris 260, removed in 4.17
- csky 110
- frv 260, removed in 4.17
- hexagon 110
- ia64 1249, removed in 6.7
- m32r 260, removed in 4.17
- m68k 255
- metag 110, removed in 4.17
- microblaze 260
- mn10300 260, removed in 4.17
- nds32 110, removed in 5.18
- nios2 110
- openrisc 110
- parisc 251
- score 110, removed in 4.17
- sh 260
- sparc 262
- sparc64 262
- tilegx 110, removed in 4.17
- tilepro 110, removed in 4.17
- xtensa 250
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/timer_settime