eventfd2 on x64
create a file descriptor for event notification
sys_eventfd2(unsigned int count, int flags)
| number | 290 (0x122) |
|---|---|
| abi | common |
| kconfig | CONFIG_EVENTFD |
| entry point | sys_eventfd2 |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | eventfd2(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 290, the syscall number |
rdi | unsigned int count |
rsi | int flags |
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 328
- arm64 19
- arm 356
- riscv64 19
- ia32 328
- x32 1073742114
- loongarch64 19
- ppc64 314
- ppc 314
- s390x 323
- mips64 5284
- mipsn32 6288
- mipso32 4325
- alpha 485
- arc 19
- blackfin 361, removed in 4.17
- cris 328, removed in 4.17
- csky 19
- frv 328, removed in 4.17
- hexagon 19
- ia64 1314, removed in 6.7
- m68k 324
- metag 19, removed in 4.17
- microblaze 340
- mn10300 329, removed in 4.17
- nds32 19, removed in 5.18
- nios2 19
- openrisc 19
- parisc 310
- score 19, removed in 4.17
- sh 328
- sparc 318
- sparc64 318
- tilegx 19, removed in 4.17
- tilepro 19, removed in 4.17
- xtensa 316
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/eventfd2