pub fn register_conditional_default(
    signal: c_int,
    condition: Arc<AtomicBool>
) -> Result<SigId, Error>
Expand description

Conditionally runs an emulation of the default action on the given signal.

If the provided condition is true at the time of invoking the signal handler, the equivalent of the default action of the given signal is run. It is a bit similar to register_conditional_shutdown, except that it doesn’t terminate for non-termination signals, it runs their default handler.

Panics

If the signal is one of the forbidden

Errors

Similarly to the emulate_default_handler function, this one looks the signal up in a table. If it is unknown, an error is returned.

Additionally to that, any errors that can be caused by a registration of a handler can happen too.