Function nix::sys::signal::sigaction[][src]

pub unsafe fn sigaction(
    signal: Signal,
    sigaction: &SigAction
) -> Result<SigAction>

Changes the action taken by a process on receipt of a specific signal.

signal can be any signal except SIGKILL or SIGSTOP. On success, it returns the previous action for the given signal. If sigaction fails, no new signal handler is installed.

Safety

Signal handlers may be called at any point during execution, which limits what is safe to do in the body of the signal-catching function. Be certain to only make syscalls that are explicitly marked safe for signal handlers and only share global data using atomics.