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.
pub fn new_for_kill(signal: Signal, sender_pid: i32, sender_uid: u32) -> Self
pub fn new_for_tkill(signal: Signal, sender_pid: i32, sender_uid: u32) -> Self
pub fn new_for_timer(signal: Signal, timer_id: i32, overrun: i32) -> Self
pub fn new_for_mq( signal: Signal, sender_pid: i32, sender_uid: u32, sigval: linux_sigval, ) -> Self
pub fn new_for_sigchld_exited( exit_signal: Signal, child_pid: i32, child_uid: u32, child_exit_status: i32, child_utime: i64, child_stime: i64, ) -> Self
pub fn new_for_sigchld_killed( exit_signal: Signal, child_pid: i32, child_uid: u32, fatal_signal: Signal, child_utime: i64, child_stime: i64, ) -> Self
pub fn new_for_sigchld_dumped( exit_signal: Signal, child_pid: i32, child_uid: u32, fatal_signal: Signal, child_utime: i64, child_stime: i64, ) -> Self
pub fn new_for_sigchld_trapped( exit_signal: Signal, child_pid: i32, child_uid: u32, child_utime: i64, child_stime: i64, ) -> Self
pub fn new_for_sigchld_stopped( exit_signal: Signal, child_pid: i32, child_uid: u32, child_utime: i64, child_stime: i64, ) -> Self
pub fn new_for_sigchld_continued( exit_signal: Signal, child_pid: i32, child_uid: u32, child_utime: i64, child_stime: i64, ) -> Self
Trait Implementations§
impl Copy for siginfo_t
impl Pod for siginfo_t
impl Send for siginfo_t
Auto Trait Implementations§
impl Freeze for siginfo_t
impl RefUnwindSafe for siginfo_t
impl !Sync for siginfo_t
impl Unpin for siginfo_t
impl UnwindSafe for siginfo_t
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)