timer_create on x64
create a POSIX per-process timer
sys_timer_create(clockid_t which_clock, struct sigevent *timer_event_spec, timer_t *created_timer_id)
| number | 222 (0xde) |
|---|---|
| abi | 64 |
| kconfig | CONFIG_POSIX_TIMERS |
| entry point | sys_timer_create |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | timer_create(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 222, the syscall number |
rdi | clockid_t which_clock |
rsi | struct sigevent *timer_event_spec |
rdx | timer_t *created_timer_id |
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 259
- arm64 107
- arm 257
- riscv64 107
- ia32 259
- x32 1073742350
- loongarch64 107
- ppc64 240
- ppc 240
- s390x 254
- mips64 5216
- mipsn32 6220
- mipso32 4257
- alpha 414
- arc 107
- blackfin 260, removed in 4.17
- cris 259, removed in 4.17
- csky 107
- frv 259, removed in 4.17
- hexagon 107
- ia64 1248, removed in 6.7
- m32r 259, removed in 4.17
- m68k 254
- metag 107, removed in 4.17
- microblaze 259
- mn10300 259, removed in 4.17
- nds32 107, removed in 5.18
- nios2 107
- openrisc 107
- parisc 250
- score 107, removed in 4.17
- sh 259
- sparc 266
- sparc64 266
- tilegx 107, removed in 4.17
- tilepro 107, removed in 4.17
- xtensa 248
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/timer_create