pub unsafe fn register_signal_handler(
    num: i32,
    handler: SignalHandler,
    for_vcpu: bool,
    flag: c_int,
) -> errno::Result<()> {
    let num = validate_signal_num(num, for_vcpu)?;
    let mut act: sigaction = handler.into();
    SignalHandler::set_flags(&mut act, flag);
    match sigaction(num, &act, null_mut()) {
        0 => Ok(()),
        _ => errno::errno_result(),
    }
}
/// Registers `handler` as the signal handler of signum `num`.
///
/// Uses `sigaction` to register the handler.
///
/// 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.
/// flags: SA_SIGINFO or SA_RESTART if wants to restart after signal received.
Registers `handler` as the signal handler of signum `num`.
Uses `sigaction` to register the handler.

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.
flags: SA_SIGINFO or SA_RESTART if wants to restart after signal received.
Registers ` handler ` as the signal handler of signum ` num ` . Uses ` sigaction ` to register the handler . 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 . flags : SA_SIGINFO or SA_RESTART if wants to restart after signal received .
pub unsafe fn register_signal_handler(
    num: i32,
    handler: SignalHandler,
    for_vcpu: bool,
    flag: c_int,
) -> errno::Result<()> {
    let num = validate_signal_num(num, for_vcpu)?;
    let mut act: sigaction = handler.into();
    SignalHandler::set_flags(&mut act, flag);
    match sigaction(num, &act, null_mut()) {
        0 => Ok(()),
        _ => errno::errno_result(),
    }
}
pub unsafe fn register_signal_handler ( num : i32 , handler : SignalHandler , for_vcpu : bool , flag : c_int , ) -> errno :: Result < ( ) > { let num = validate_signal_num ( num , for_vcpu ) ? ; let mut act : sigaction = handler . into ( ) ; SignalHandler :: set_flags ( & mut act , flag ) ; match sigaction ( num , & act , null_mut ( ) ) { 0 => Ok ( ( ) ) , _ => errno :: errno_result ( ) , } }
Registers `handler` as the signal handler of signum `num`.
Registers ` handler ` as the signal handler of signum ` num ` .
num
i32
handler
SignalHandler
for_vcpu
bool
flag
c_int
num
i32
handler
SignalHandler
for_vcpu
bool
flag
c_int