pub struct ProcessIdentity {
pub pid: u32,
pub start_key: u64,
}Expand description
A process identity that survives PID reuse.
start_key is an opaque, platform-supplied value derived from the process
start time. It is deliberately not a SystemTime: on Linux it comes from
field 22 of /proc/<pid>/stat in clock ticks since boot, and on macOS from
the kp_proc.p_starttime timeval. Both are stable for the life of the
process and change on reuse, which is the only property this type needs.
Two identities compare equal only when both the PID and the start key match,
which is what makes crate::model::ProcessIdentity safe to attach to a
pending signal (§6.2, §15.1).
Fields§
§pid: u32The OS process identifier.
start_key: u64An opaque platform value that changes when this PID is reused.
Implementations§
Source§impl ProcessIdentity
impl ProcessIdentity
Sourcepub const fn new(pid: u32, start_key: u64) -> Self
pub const fn new(pid: u32, start_key: u64) -> Self
Builds an identity from a PID and a platform start key.
Sourcepub const fn is_reuse_of(&self, other: &Self) -> bool
pub const fn is_reuse_of(&self, other: &Self) -> bool
Whether other is the same PID but a different process.
The signal path calls this after re-reading the live process table: a
true result means the PID was reused and the pending action must abort
rather than signal an unrelated process (§6.2).
Trait Implementations§
Source§impl Clone for ProcessIdentity
impl Clone for ProcessIdentity
Source§fn clone(&self) -> ProcessIdentity
fn clone(&self) -> ProcessIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more