#[repr(C)]pub struct sigaction(/* private fields */);
Expand description
§Invariants
sigaction
does not require or guarantee that its internal function
pointers, if any, are safe to call/dereference.
Implementations§
Source§impl sigaction
impl sigaction
Sourcepub fn new_raw(
handler: SignalHandler,
flags: SigActionFlags,
mask: sigset_t,
restorer: Option<unsafe extern "C" fn()>,
) -> Self
pub fn new_raw( handler: SignalHandler, flags: SigActionFlags, mask: sigset_t, restorer: Option<unsafe extern "C" fn()>, ) -> Self
Consider sigaction::new_with_default_restorer
instead, which takes
care of setting up a restorer.
panics if handler
is inconsistent with the presence or absence of the
SA_SIGINFO
flag.
Sourcepub fn new_with_default_restorer(
handler: SignalHandler,
flags: SigActionFlags,
mask: sigset_t,
) -> Self
pub fn new_with_default_restorer( handler: SignalHandler, flags: SigActionFlags, mask: sigset_t, ) -> Self
Creates a sigaction
with SA_RESTORER
set, and the internal
restorer
field set to sigaction_restorer
. The libc sigaction
function normally makes these changes to the provided struct sigaction
.
pub fn wrap(si: linux_sigaction) -> Self
pub fn wrap_ref(si: &linux_sigaction) -> &Self
pub fn wrap_mut(si: &mut linux_sigaction) -> &mut Self
Sourcepub unsafe fn peel(si: Self) -> linux_sigaction
pub unsafe fn peel(si: Self) -> linux_sigaction
§Safety
lsa_handler
is safe to dereference iff the lsa_handler
used to
construct Self
is.
pub fn flags(&self) -> Option<SigActionFlags>
pub fn flags_retain(&self) -> SigActionFlags
pub fn mask(&self) -> sigset_t
Sourcepub unsafe fn handler(&self) -> SignalHandler
pub unsafe fn handler(&self) -> SignalHandler
§Safety
The functions in SignalHandler::Action
or SignalHandler::Handler
are
safe to call iff the function pointer in the internal lsa_handler
is,
and is of the type specified in the internal lsa_flags
.