timerfd_create on x64
timers that notify via file descriptors
sys_timerfd_create(int clockid, int flags)
| number | 283 (0x11b) |
|---|---|
| abi | common |
| kconfig | CONFIG_TIMERFD |
| entry point | sys_timerfd_create |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | timerfd_create(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 283, the syscall number |
rdi | int clockid |
rsi | int flags |
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 322
- arm64 85
- arm 350
- riscv64 85
- ia32 322
- x32 1073742107
- loongarch64 85
- ppc64 306
- ppc 306
- s390x 319
- mips64 5280
- mipsn32 6284
- mipso32 4321
- alpha 481
- arc 85
- blackfin 349, removed in 4.17
- cris 322, removed in 4.17
- csky 85
- frv 322, removed in 4.17
- hexagon 85
- ia64 1310, removed in 6.7
- m68k 318
- metag 85, removed in 4.17
- microblaze 322
- mn10300 323, removed in 4.17
- nds32 85, removed in 5.18
- nios2 85
- openrisc 85
- parisc 306
- score 85, removed in 4.17
- sh 322
- sparc 312
- sparc64 312
- tilegx 85, removed in 4.17
- tilepro 85, removed in 4.17
- xtensa 312
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/timerfd_create