signalfd on x64
create a file descriptor for accepting signals
sys_signalfd(int ufd, sigset_t *user_mask, size_t sizemask)
| number | 282 (0x11a) |
|---|---|
| abi | common |
| kconfig | CONFIG_SIGNALFD |
| entry point | sys_signalfd |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | signalfd(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 282, the syscall number |
rdi | int ufd |
rsi | sigset_t *user_mask |
rdx | size_t sizemask |
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 321
- arm 349
- ia32 321
- x32 1073742106
- ppc64 305
- ppc 305
- s390x 316
- mips64 5276
- mipsn32 6280
- mipso32 4317
- alpha 476
- blackfin 348, removed in 4.17
- cris 321, removed in 4.17
- frv 321, removed in 4.17
- ia64 1307, removed in 6.7
- m32r 321, removed in 4.17
- m68k 317
- microblaze 321
- mn10300 322, removed in 4.17
- parisc 302
- score 1045, removed in 4.17
- sh 321
- sparc 311
- sparc64 311
- xtensa 304
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/signalfd