alarm on x64
set an alarm clock for delivery of a signal
sys_alarm(unsigned int seconds)
| number | 37 (0x25) |
|---|---|
| abi | common |
| kconfig | CONFIG_POSIX_TIMERS |
| entry point | sys_alarm |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | alarm(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 37, the syscall number |
rdi | unsigned int seconds |
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 27
- ia32 27
- x32 1073741861
- ppc64 27
- ppc 27
- s390x 27
- mips64 5037
- mipsn32 6037
- mipso32 4027
- blackfin 27, removed in 4.17
- cris 27, removed in 4.17
- frv 27, removed in 4.17
- m32r 27, removed in 4.17
- m68k 27
- microblaze 27
- mn10300 27, removed in 4.17
- parisc 27
- score 1059, removed in 4.17
- sh 27
- sparc 27
- sparc64 27
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/alarm