Skip to main content

endpoint_sec/event/
event_setregid.rs

1//! [`EventSetregid`]
2
3use endpoint_sec_sys::{es_event_setregid_t, uid_t};
4
5/// A process has called `setregid()`.
6#[doc(alias = "es_event_setregid_t")]
7pub struct EventSetregid<'a> {
8    /// Raw event
9    pub(crate) raw: &'a es_event_setregid_t,
10}
11
12impl EventSetregid<'_> {
13    /// `egid` argument to the `setregid()` call.
14    #[inline(always)]
15    pub fn egid(&self) -> uid_t {
16        self.raw.egid
17    }
18
19    /// `ruid` argument to the `setregid()` call.
20    #[inline(always)]
21    pub fn ruid(&self) -> uid_t {
22        self.raw.rgid
23    }
24}
25
26// Safety: safe to send across threads: does not contain any interior mutability nor depend on current thread state
27unsafe impl Send for EventSetregid<'_> {}
28// Safety: safe to share across threads: does not contain any interior mutability nor depend on current thread state
29unsafe impl Sync for EventSetregid<'_> {}
30
31impl_debug_eq_hash_with_functions!(EventSetregid<'a>; egid, ruid);