setsid on x64
creates a session and sets the process group ID
sys_setsid(void)
| number | 112 (0x70) |
|---|---|
| abi | common |
| entry point | sys_setsid |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | setsid(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 112, 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 66
- arm64 157
- arm 66
- riscv64 157
- ia32 66
- x32 1073741936
- loongarch64 157
- ppc64 66
- ppc 66
- s390x 66
- mips64 5110
- mipsn32 6110
- mipso32 4066
- alpha 147
- arc 157
- blackfin 66, removed in 4.17
- cris 66, removed in 4.17
- csky 157
- frv 66, removed in 4.17
- hexagon 157
- ia64 1081, removed in 6.7
- m32r 66, removed in 4.17
- m68k 66
- metag 157, removed in 4.17
- microblaze 66
- mn10300 66, removed in 4.17
- nds32 157, removed in 5.18
- nios2 157
- openrisc 157
- parisc 66
- score 157, removed in 4.17
- sh 66
- sparc 175
- sparc64 175
- tilegx 157, removed in 4.17
- tilepro 157, removed in 4.17
- xtensa 128
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/setsid