epoll_wait on x64
wait for an I/O event on an epoll file descriptor
sys_epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
| number | 232 (0xe8) |
|---|---|
| abi | common |
| kconfig | CONFIG_EPOLL |
| family | epoll see the whole family on x64 |
| entry point | sys_epoll_wait |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | epoll_wait(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 232, the syscall number |
rdi | int epfd |
rsi | struct epoll_event *events |
rdx | int maxevents |
r10 | int timeout |
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 256
- arm 252
- ia32 256
- x32 1073742056
- ppc64 238
- ppc 238
- s390x 251
- mips64 5209
- mipsn32 6209
- mipso32 4250
- alpha 409
- blackfin 257, removed in 4.17
- cris 256, removed in 4.17
- frv 256, removed in 4.17
- ia64 1245, removed in 6.7
- m32r 256, removed in 4.17
- m68k 251
- microblaze 256
- mn10300 256, removed in 4.17
- parisc 226
- score 1069, removed in 4.17
- sh 256
- sparc 195
- sparc64 195
- xtensa 18
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/epoll_wait