pipe on x64
create pipe
sys_pipe(int *fildes)
| number | 22 (0x16) |
|---|---|
| abi | common |
| entry point | sys_pipe |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | pipe(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 22, the syscall number |
rdi | int *fildes |
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 42
- arm 42
- ia32 42
- x32 1073741846
- ppc64 42
- ppc 42
- s390x 42
- mips64 5021
- mipsn32 6021
- mipso32 4042
- alpha 42
- blackfin 42, removed in 4.17
- cris 42, removed in 4.17
- frv 42, removed in 4.17
- ia64 1058, removed in 6.7
- m32r 42, removed in 4.17
- m68k 42
- microblaze 42
- mn10300 42, removed in 4.17
- parisc 42
- score 1040, removed in 4.17
- sh 42
- sparc 42
- sparc64 42
- xtensa 37
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/pipe