rseq on x64
sys_rseq(struct rseq *rseq, uint32_t rseq_len, int flags, uint32_t sig)
| number | 334 (0x14e) |
|---|---|
| abi | common |
| kconfig | CONFIG_RSEQ |
| entry point | sys_rseq |
| since | Linux 4.18 |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 334, the syscall number |
rdi | struct rseq *rseq |
rsi | uint32_t rseq_len |
rdx | int flags |
r10 | uint32_t sig |
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 386
- arm64 293
- arm 398
- riscv64 293
- ia32 386
- x32 1073742158
- loongarch64 293
- ppc64 387
- ppc 387
- s390x 383
- mips64 5327
- mipsn32 6331
- mipso32 4367
- alpha 527
- arc 293
- csky 293
- hexagon 293
- ia64 1357, removed in 6.7
- m68k 384
- microblaze 400
- nds32 293, removed in 5.18
- nios2 293
- openrisc 293
- parisc 354
- sh 387
- sparc 365
- sparc64 365
- xtensa 352
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/rseq