getpgid on x64
set/get process group
sys_getpgid(pid_t pid)
| number | 121 (0x79) |
|---|---|
| abi | common |
| entry point | sys_getpgid |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | getpgid(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 121, the syscall number |
rdi | pid_t pid |
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 132
- arm64 155
- arm 132
- riscv64 155
- ia32 132
- x32 1073741945
- loongarch64 155
- ppc64 132
- ppc 132
- s390x 132
- mips64 5119
- mipsn32 6119
- mipso32 4132
- alpha 233
- arc 155
- blackfin 132, removed in 4.17
- cris 132, removed in 4.17
- csky 155
- frv 132, removed in 4.17
- hexagon 155
- ia64 1079, removed in 6.7
- m32r 132, removed in 4.17
- m68k 132
- metag 155, removed in 4.17
- microblaze 132
- mn10300 132, removed in 4.17
- nds32 155, removed in 5.18
- nios2 155
- openrisc 155
- parisc 132
- score 155, removed in 4.17
- sh 132
- sparc 224
- sparc64 224
- tilegx 155, removed in 4.17
- tilepro 155, removed in 4.17
- xtensa 149
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/getpgid