eventfd on x64
create a file descriptor for event notification
sys_eventfd(unsigned int count)
| number | 284 (0x11c) |
|---|---|
| abi | common |
| kconfig | CONFIG_EVENTFD |
| entry point | sys_eventfd |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | eventfd(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 284, the syscall number |
rdi | unsigned int count |
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 323
- arm 351
- ia32 323
- x32 1073742108
- ppc64 307
- ppc 307
- s390x 318
- mips64 5278
- mipsn32 6282
- mipso32 4319
- alpha 478
- blackfin 350, removed in 4.17
- cris 323, removed in 4.17
- frv 323, removed in 4.17
- ia64 1309, removed in 6.7
- m32r 323, removed in 4.17
- m68k 319
- microblaze 323
- mn10300 324, removed in 4.17
- parisc 304
- score 1044, removed in 4.17
- sh 323
- sparc 313
- sparc64 313
- xtensa 306
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/eventfd