epoll_pwait on x64
wait for an I/O event on an epoll file descriptor
sys_epoll_pwait(int epfd, struct epoll_event *events, int maxevents, int timeout, const sigset_t *sigmask, size_t sigsetsize)
| number | 281 (0x119) |
|---|---|
| abi | common |
| kconfig | CONFIG_EPOLL |
| family | epoll see the whole family on x64 |
| entry point | sys_epoll_pwait |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | epoll_pwait(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 281, the syscall number |
rdi | int epfd |
rsi | struct epoll_event *events |
rdx | int maxevents |
r10 | int timeout |
r8 | const sigset_t *sigmask |
r9 | 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 319
- arm64 22
- arm 346
- riscv64 22
- ia32 319
- x32 1073742105
- loongarch64 22
- ppc64 303
- ppc 303
- s390x 312
- mips64 5272
- mipsn32 6276
- mipso32 4313
- alpha 474
- arc 22
- blackfin 346, removed in 4.17
- cris 319, removed in 4.17
- csky 22
- frv 319, removed in 4.17
- hexagon 22
- ia64 1305, removed in 6.7
- m32r 319, removed in 4.17
- m68k 315
- metag 22, removed in 4.17
- microblaze 319
- mn10300 320, removed in 4.17
- nds32 22, removed in 5.18
- nios2 22
- openrisc 22
- parisc 297
- score 22, removed in 4.17
- sh 319
- sparc 309
- sparc64 309
- tilegx 22, removed in 4.17
- tilepro 22, removed in 4.17
- xtensa 274
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/epoll_pwait