getppid on x64
get process identification
sys_getppid(void)
| number | 110 (0x6e) |
|---|---|
| abi | common |
| entry point | sys_getppid |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | getppid(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 110, 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 64
- arm64 173
- arm 64
- riscv64 173
- ia32 64
- x32 1073741934
- loongarch64 173
- ppc64 64
- ppc 64
- s390x 64
- mips64 5108
- mipsn32 6108
- mipso32 4064
- alpha 532
- arc 173
- blackfin 64, removed in 4.17
- cris 64, removed in 4.17
- csky 173
- frv 64, removed in 4.17
- hexagon 173
- ia64 1042, removed in 6.7
- m32r 64, removed in 4.17
- m68k 64
- metag 173, removed in 4.17
- microblaze 64
- mn10300 64, removed in 4.17
- nds32 173, removed in 5.18
- nios2 173
- openrisc 173
- parisc 64
- score 173, removed in 4.17
- sh 64
- sparc 197
- sparc64 197
- tilegx 173, removed in 4.17
- tilepro 173, removed in 4.17
- xtensa 150
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/getppid