pub fn install_shutdown_flag(flag: &'static AtomicBool) -> Result<(), CoreError>Expand description
Install SIGINT and SIGTERM handlers that flip a shared shutdown flag.
This is intended for simple daemon shutdown loops that want a reusable
signal hook without direct sigaction(2) setup. The handlers are
process-global and remain installed until replaced by another install.
Use install_shutdown_flag_guard when the previous process-global
handlers must be restored automatically.
§Reactor Compatibility
This function uses standard Unix signal()/sigaction() handlers and is
not directly compatible with the Reactor. For event-loop based
applications, prefer using SignalRuntime::signalfd_new.
§Fork Safety
Signal handlers are inherited by the child. The shutdown flag pointer is also inherited. If the child process receives SIGINT/SIGTERM, it will attempt to flip the flag in its own address space at the same virtual address.
§Errors
EINVAL: Invalid signal number.