pub fn register_signal_handler(num: c_int, handler: SignalHandler) -> Result<()>Expand description
Register the signal handler of signum.
§Safety
This is considered unsafe because the given handler will be called asynchronously, interrupting whatever the thread was doing and therefore must only do async-signal-safe operations.
§Arguments
num: the signal number to be registered.handler: the signal handler function to register.
§Examples
extern crate vmm_sys_util;
use vmm_sys_util::signal::{register_signal_handler, SignalHandler};
extern "C" fn handle_signal(_: c_int, _: *mut siginfo_t, _: *mut c_void) {}
register_signal_handler(0, handle_signal);