pub struct siginfo_t(/* private fields */);
Expand description
Wrapper around linux_siginfo_t
.
§Invariants
The following invariants in the internal linux_siginfo_t
are ensured when
constructed through safe constructors:
lsi_code
,lsi_signo
, andlsi_errno
are initialized.- The parts of the
l_sifields
union are initialized thatsigaction(2)
specifies are initialized for the givenlsi_code
andlsi_signo
.
When constructing via one of the unsafe constructors that takes some form of
linux_siginfo_t
or the pieces of one, the above must also hold. However,
it is sufficient for all bytes to be initialized; any bit pattern is
acceptable as long as it is an initialized one. (Initializing from garbage data
may result in garbage pointers, but the safe methods of this type will never
dereference those itself). For example, unsafe { SigInfo::wrap_assume_initd(core::mem::zeroed()) }
is sound.
Implementations§
Source§impl siginfo_t
impl siginfo_t
Sourcepub unsafe fn wrap_assume_initd(si: linux_siginfo_t) -> Self
pub unsafe fn wrap_assume_initd(si: linux_siginfo_t) -> Self
Sourcepub unsafe fn wrap_ref_assume_initd(si: &linux_siginfo_t) -> &Self
pub unsafe fn wrap_ref_assume_initd(si: &linux_siginfo_t) -> &Self
Sourcepub unsafe fn wrap_mut_assume_initd(si: &mut linux_siginfo_t) -> &mut Self
pub unsafe fn wrap_mut_assume_initd(si: &mut linux_siginfo_t) -> &mut Self
Sourcepub unsafe fn peel(si: Self) -> linux_siginfo_t
pub unsafe fn peel(si: Self) -> linux_siginfo_t
§Safety
Pointers are safe to dereference iff those used to construct si
are.
pub fn signal(&self) -> Result<Signal, SignalFromI32Error>
pub fn code(&self) -> Result<SigInfoCode, SigInfoCodeFromRawError>
Sourcepub unsafe fn details(&self) -> Option<SigInfoDetails>
pub unsafe fn details(&self) -> Option<SigInfoDetails>
§Safety
Pointers are safe to dereference iff those used to construct self
(or set
via mutable methods) are.