⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module signalfd

Module signalfd 

Source
Expand description

signalfd – Signal notification file descriptor

Provides a file descriptor for receiving signals via read(2) instead of signal handlers. Integrable with epoll/poll for unified I/O event loops. Used by D-Bus daemon and systemd-compatible service managers.

§Syscall Interface

  • signalfd_create(fd, mask_ptr, mask_size, flags) -> fd (syscall 334)
  • Read via standard read(2) on returned fd

§Semantics

  • read: Returns one or more SignalfdSiginfo structs (128 bytes each) for pending signals in the mask. Signals consumed by signalfd are removed from the process’s pending set.
  • Creating with fd == -1 creates a new signalfd; passing an existing fd updates the signal mask.

Structs§

SigSet
Signal mask – a bitmask of signal numbers to monitor.
SignalFdNode
VfsNode wrapper around a signalfd instance.
SignalfdSiginfo
Signal information returned by read(2) on a signalfd. Matches Linux’s struct signalfd_siginfo layout (128 bytes).

Constants§

SFD_CLOEXEC
SFD_CLOEXEC: Set close-on-exec.
SFD_NONBLOCK
SFD_NONBLOCK: Return EAGAIN instead of blocking on empty read.

Functions§

deliver_signal
Deliver a signal to all signalfds of a given process that have the signal in their mask.
is_readable
Query whether a signalfd has pending signals. Used by epoll to check readiness without consuming data.
signalfd_close
Close (destroy) a signalfd instance.
signalfd_create
Create or update a signalfd.
signalfd_read
Read one pending signal from a signalfd.