pidfd_open on x64
obtain a file descriptor that refers to a task
sys_pidfd_open(pid_t pid, unsigned int flags)
| number | 434 (0x1b2) |
|---|---|
| abi | common |
| entry point | sys_pidfd_open |
| since | Linux 5.3 |
| man page | pidfd_open(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 434, the syscall number |
rdi | pid_t pid |
rsi | unsigned int flags |
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 434
- arm64 434
- arm 434
- riscv64 434
- ia32 434
- x32 1073742258
- loongarch64 434
- ppc64 434
- ppc 434
- s390x 434
- mips64 5434
- mipsn32 6434
- mipso32 4434
- alpha 544
- arc 434
- csky 434
- hexagon 434
- ia64 1458, removed in 6.7
- m68k 434
- microblaze 434
- nds32 434, removed in 5.18
- nios2 434
- openrisc 434
- parisc 434
- sh 434
- sparc 434
- sparc64 434
- xtensa 434
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/pidfd_open