diff --git a/src/data.rs b/src/data.rs index ae6bf91258..7775b2e938 100644 --- a/src/data.rs +++ b/src/data.rs @@ -231,6 +231,45 @@ impl DerefMut for TimeSpec { } } +/* +// ABI-UNSTABLE! +#[derive(Clone, Copy, Debug, Default)] +#[repr(C)] +pub struct ThreadEvent { + pub kind: u8, + pub _rsvd: [u8; size_of::() - 1], + pub payload: [usize; 3], +} +#[repr(u8)] +#[derive(Clone, Copy, Debug)] +pub enum ThreadEventKind { + Sigkill = 0, +} + +impl Deref for ThreadEvent { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts( + self as *const ThreadEvent as *const u8, + mem::size_of::(), + ) + } + } +} + +impl DerefMut for ThreadEvent { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut( + self as *mut ThreadEvent as *mut u8, + mem::size_of::(), + ) + } + } +} +*/ + #[derive(Clone, Copy, Debug, Default)] #[repr(C)] pub struct PtraceEvent { diff --git a/src/flag.rs b/src/flag.rs index 7c569008ed..0402f4b04f 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -170,6 +170,17 @@ pub const O_ACCMODE: usize = O_RDONLY | O_WRONLY | O_RDWR; // The top 48 bits of PTRACE_* are reserved, for now +// NOT ABI STABLE! +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[repr(usize)] +pub enum ContextStatus { + Runnable, + Blocked, + NotYetStarted, + Dead, + Other, // reserved +} + bitflags! { pub struct PtraceFlags: u64 { /// Stop before a syscall is handled. Send PTRACE_FLAG_IGNORE to not