nix::sys

Module signalfd

source
Expand description

Interface for the signalfd syscall.

§Signal discarding

When a signal can’t be delivered to a process (or thread), it will become a pending signal. Failure to deliver could happen if the signal is blocked by every thread in the process or if the signal handler is still handling a previous signal.

If a signal is sent to a process (or thread) that already has a pending signal of the same type, it will be discarded. This means that if signals of the same type are received faster than they are processed, some of those signals will be dropped. Because of this limitation, signalfd in itself cannot be used for reliable communication between processes or threads.

Once the signal is unblocked, or the signal handler is finished, and a signal is still pending (ie. not consumed from a signalfd) it will be delivered to the signal handler.

Please note that signal discarding is not specific to signalfd, but also happens with regular signal handlers.

Re-exports§

  • pub use crate::sys::signal;
  • pub use crate::sys::signal::SigSet;

Structs§

Constants§

Functions§

  • signalfdDeprecated
    Creates a new file descriptor for reading signals.