sigaltstack on x64
set and/or get signal stack context
sys_sigaltstack(const stack_t *uss, stack_t *uoss)
| number | 131 (0x83) |
|---|---|
| abi | 64 |
| entry point | sys_sigaltstack |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | sigaltstack(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 131, the syscall number |
rdi | const stack_t *uss |
rsi | stack_t *uoss |
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 186
- arm64 132
- arm 186
- riscv64 132
- ia32 186
- x32 1073742349
- loongarch64 132
- ppc64 185
- ppc 185
- s390x 186
- mips64 5129
- mipsn32 6129
- mipso32 4206
- alpha 235
- arc 132
- blackfin 186, removed in 4.17
- cris 186, removed in 4.17
- csky 132
- frv 186, removed in 4.17
- hexagon 132
- ia64 1176, removed in 6.7
- m32r 186, removed in 4.17
- m68k 186
- metag 132, removed in 4.17
- mn10300 186, removed in 4.17
- nds32 132, removed in 5.18
- nios2 132
- openrisc 132
- parisc 166
- score 132, removed in 4.17
- sh 186
- sparc 28
- sparc64 28
- tilegx 132, removed in 4.17
- tilepro 132, removed in 4.17
- xtensa 224
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/sigaltstack