nx_signalfd.nx
buildroot/runtime/nx_signalfd.nx
about
nx_signalfd.nx -- Linux signalfd(2) wrapper.
signalfd lets the kernel deliver signals via file descriptor
reads instead of signal handlers. This is the modern way to
integrate signal handling with poll/epoll-driven event loops:
you add the signalfd to your poll set and react to signals
inline, no async-signal-safe constraints.
Linux RV64 syscall: 74 (signalfd4).
To receive a signal via signalfd, you ALSO need to mask the
signal in the process's normal signal mask via rt_sigprocmask
(otherwise the kernel still delivers it normally). We expose
nx_signalfd_install which does both steps.
Read returns one or more struct signalfd_siginfo records (128
bytes each); the first 4 bytes are the signal number (i32).
Pairs with nx_signal (constants + sigaction) + nx_poll
(consumer in event loops).
dependencies 2 imports · 0 importers
imports: syscalls.nxnx_signal.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 31 | const NX_SYS_SIGNALFD4: i64 = 74 |
| 32 | const NX_SYS_RT_SIGPROCMASK: i64 = 135 |
| 34 | const NX_SFD_NONBLOCK: i64 = 0x800 |
| 35 | const NX_SFD_CLOEXEC: i64 = 0x80000 |
| 38 | const NX_SIG_BLOCK: i64 = 0 |
| 39 | const NX_SIG_UNBLOCK: i64 = 1 |
| 40 | const NX_SIG_SETMASK: i64 = 2 |
| 43 | const NX_SSI_BYTES: i64 = 128 |
functions
| 48 | func nx_signalfd_mask_one(sig: i64) -> i64 |
| 55 | func nx_signalfd_block(sig: i64) -> i64 |
| 65 | func nx_signalfd_new(sig: i64, flags: i64) -> i64 |
| 74 | func nx_signalfd_install(sig: i64, flags: i64) -> i64 |
| 84 | func nx_signalfd_read_one(fd: i64, out: *u8) -> i64 calls 1: sys_read |
| 93 | func main() -> i64 |