restart_syscall on x64
restart a system call after interruption by a stop signal
sys_restart_syscall(void)
| number | 219 (0xdb) |
|---|---|
| abi | common |
| entry point | sys_restart_syscall |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | restart_syscall(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 219, the syscall number |
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 0
- arm64 128
- arm 0
- riscv64 128
- ia32 0
- x32 1073742043
- loongarch64 128
- ppc64 0
- ppc 0
- s390x 7
- mips64 5213
- mipsn32 6214
- mipso32 4253
- alpha 412
- arc 128
- blackfin 0, removed in 4.17
- cris 0, removed in 4.17
- csky 128
- frv 0, removed in 4.17
- hexagon 128
- ia64 1246, removed in 6.7
- m32r 0, removed in 4.17
- m68k 0
- metag 128, removed in 4.17
- microblaze 0
- mn10300 0, removed in 4.17
- nds32 128, removed in 5.18
- nios2 128
- openrisc 128
- parisc 0
- score 128, removed in 4.17
- sh 0
- sparc 0
- sparc64 0
- tilegx 128, removed in 4.17
- tilepro 128, removed in 4.17
- xtensa 223
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/restart_syscall