signalfd4 on x64
create a file descriptor for accepting signals
sys_signalfd4(int ufd, sigset_t *user_mask, size_t sizemask, int flags)
| number | 289 (0x121) |
|---|---|
| abi | common |
| kconfig | CONFIG_SIGNALFD |
| entry point | sys_signalfd4 |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | signalfd4(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 289, the syscall number |
rdi | int ufd |
rsi | sigset_t *user_mask |
rdx | size_t sizemask |
r10 | 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 327
- arm64 74
- arm 355
- riscv64 74
- ia32 327
- x32 1073742113
- loongarch64 74
- ppc64 313
- ppc 313
- s390x 322
- mips64 5283
- mipsn32 6287
- mipso32 4324
- alpha 484
- arc 74
- blackfin 360, removed in 4.17
- cris 327, removed in 4.17
- csky 74
- frv 327, removed in 4.17
- hexagon 74
- ia64 1313, removed in 6.7
- m68k 323
- metag 74, removed in 4.17
- microblaze 339
- mn10300 328, removed in 4.17
- nds32 74, removed in 5.18
- nios2 74
- openrisc 74
- parisc 309
- score 74, removed in 4.17
- sh 327
- sparc 317
- sparc64 317
- tilegx 74, removed in 4.17
- tilepro 74, removed in 4.17
- xtensa 309
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/signalfd4