epoll_ctl on x64
control interface for an epoll file descriptor
sys_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
| number | 233 (0xe9) |
|---|---|
| abi | common |
| kconfig | CONFIG_EPOLL |
| family | epoll see the whole family on x64 |
| entry point | sys_epoll_ctl |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | epoll_ctl(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 233, the syscall number |
rdi | int epfd |
rsi | int op |
rdx | int fd |
r10 | struct epoll_event *event |
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 255
- arm64 21
- arm 251
- riscv64 21
- ia32 255
- x32 1073742057
- loongarch64 21
- ppc64 237
- ppc 237
- s390x 250
- mips64 5208
- mipsn32 6208
- mipso32 4249
- alpha 408
- arc 21
- blackfin 256, removed in 4.17
- cris 255, removed in 4.17
- csky 21
- frv 255, removed in 4.17
- hexagon 21
- ia64 1244, removed in 6.7
- m32r 255, removed in 4.17
- m68k 250
- metag 21, removed in 4.17
- microblaze 255
- mn10300 255, removed in 4.17
- nds32 21, removed in 5.18
- nios2 21
- openrisc 21
- parisc 225
- score 21, removed in 4.17
- sh 255
- sparc 194
- sparc64 194
- tilegx 21, removed in 4.17
- tilepro 21, removed in 4.17
- xtensa 19
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/epoll_ctl