exit_group on x64
exit all threads in a process
sys_exit_group(int error_code)
| number | 231 (0xe7) |
|---|---|
| abi | common |
| entry point | sys_exit_group |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | exit_group(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 231, the syscall number |
rdi | int error_code |
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 252
- arm64 94
- arm 248
- riscv64 94
- ia32 252
- x32 1073742055
- loongarch64 94
- ppc64 234
- ppc 234
- s390x 248
- mips64 5205
- mipsn32 6205
- mipso32 4246
- alpha 405
- arc 94
- blackfin 252, removed in 4.17
- cris 252, removed in 4.17
- csky 94
- frv 252, removed in 4.17
- hexagon 94
- ia64 1236, removed in 6.7
- m32r 252, removed in 4.17
- m68k 247
- metag 94, removed in 4.17
- microblaze 252
- mn10300 252, removed in 4.17
- nds32 94, removed in 5.18
- nios2 94
- openrisc 94
- parisc 222
- score 94, removed in 4.17
- sh 252
- sparc 188
- sparc64 188
- tilegx 94, removed in 4.17
- tilepro 94, removed in 4.17
- xtensa 119
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/exit_group