ppoll on x64
wait for some event on a file descriptor
sys_ppoll(struct pollfd *ufds, unsigned int nfds, struct __kernel_timespec *tsp, const sigset_t *sigmask, size_t sigsetsize)
| number | 271 (0x10f) |
|---|---|
| abi | common |
| entry point | sys_ppoll |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | ppoll(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 271, the syscall number |
rdi | struct pollfd *ufds |
rsi | unsigned int nfds |
rdx | struct __kernel_timespec *tsp |
r10 | const sigset_t *sigmask |
r8 | size_t sigsetsize |
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 309
- arm64 73
- arm 336
- riscv64 73
- ia32 309
- x32 1073742095
- loongarch64 73
- ppc64 281
- ppc 281
- s390x 302
- mips64 5261
- mipsn32 6265
- mipso32 4302
- alpha 464
- arc 73
- blackfin 309, removed in 4.17
- cris 309, removed in 4.17
- csky 73
- frv 309, removed in 4.17
- hexagon 73
- ia64 1295, removed in 6.7
- m32r 309, removed in 4.17
- m68k 302
- metag 73, removed in 4.17
- microblaze 309
- mn10300 310, removed in 4.17
- nds32 73, removed in 5.18
- nios2 73
- openrisc 73
- parisc 274
- score 73, removed in 4.17
- sh 309
- sparc 298
- sparc64 298
- tilegx 73, removed in 4.17
- tilepro 73, removed in 4.17
- xtensa 273
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/ppoll