Add RtSigInfo.

This commit is contained in:
4lDO2
2024-08-01 19:13:09 +02:00
parent b32e679437
commit 984f9cf714
+29
View File
@@ -358,3 +358,32 @@ impl DerefMut for SetSighandlerData {
}
}
pub use crate::sigabi::*;
#[derive(Copy, Clone, Debug, Default, PartialEq)]
#[repr(C)]
pub struct RtSigInfo {
pub arg: usize,
pub code: i32,
pub uid: u32,
pub pid: u32, // TODO: usize?
}
impl Deref for RtSigInfo {
type Target = [u8];
fn deref(&self) -> &[u8] {
unsafe {
slice::from_raw_parts(
self as *const RtSigInfo as *const u8,
mem::size_of::<RtSigInfo>(),
)
}
}
}
impl DerefMut for RtSigInfo {
fn deref_mut(&mut self) -> &mut [u8] {
unsafe {
slice::from_raw_parts_mut(self as *mut RtSigInfo as *mut u8, mem::size_of::<RtSigInfo>())
}
}
}