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