getpgrp on x64
set/get process group
sys_getpgrp(void)
| number | 111 (0x6f) |
|---|---|
| abi | common |
| entry point | sys_getpgrp |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | getpgrp(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 111, 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 65
- arm 65
- ia32 65
- x32 1073741935
- ppc64 65
- ppc 65
- s390x 65
- mips64 5109
- mipsn32 6109
- mipso32 4065
- alpha 63
- blackfin 65, removed in 4.17
- cris 65, removed in 4.17
- frv 65, removed in 4.17
- m32r 65, removed in 4.17
- m68k 65
- microblaze 65
- mn10300 65, removed in 4.17
- parisc 65
- score 1060, removed in 4.17
- sh 65
- sparc 81
- sparc64 81
- xtensa 151
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/getpgrp