Expand description
This module provides a way to handle signals in a platform-independent way. It provides a way to convert signal names to their corresponding values and vice versa. It also provides a way to ignore the SIGINT signal and enable pipe errors.
Macros§
- init_
startup_ state_ capture - Initializes startup state capture. Call once at crate root level.
Statics§
- ALL_
SIGNALS - The list of all signals.
- DEFAULT_
SIGNAL - The default signal value.
Functions§
- capture_
startup_ ⚠state - Captures stdio and SIGPIPE state at process initialization, before main() runs.
- disable_
pipe_ errors - Ignores SIGPIPE signal (broken pipe errors are returned instead of terminating). Use this to override the default SIGPIPE handling when you need to handle broken pipe errors gracefully (e.g., tee with –output-error).
- enable_
pipe_ errors - Restores SIGPIPE to default behavior (process terminates on broken pipe).
- ensure_
stdout_ not_ broken - ignore_
interrupts - Ignores the SIGINT signal.
- install_
signal_ handler - Installs a signal handler. The handler must be async-signal-safe.
- is_
signal - Returns true if the given number is a valid signal number.
- signal_
by_ name_ or_ value - Returns the signal number for a given signal name or value.
- signal_
list_ name_ by_ value - Returns the signal name for list-style interfaces.
- signal_
list_ value_ by_ name_ or_ number - Returns the signal value for list-style interfaces.
- signal_
name_ by_ value - Returns the signal name for a given signal value.
- signal_
number_ upper_ bound - Returns the largest signal number that list-style interfaces should accept.
- sigpipe_
was_ ignored - Returns whether SIGPIPE was ignored at process startup.
- stderr_
was_ closed - stdin_
was_ closed - stdout_
was_ closed