From 9f0af4479742386c4ce30d05ad20e2450bbd0d54 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 6 Jul 2018 02:23:22 +0200 Subject: Fix *decoding* of cmsgs and add `ScmCredentials`. --- src/unistd.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/unistd.rs') diff --git a/src/unistd.rs b/src/unistd.rs index 8022aa0b..32d0405e 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -48,6 +48,11 @@ impl Uid { pub fn is_root(&self) -> bool { *self == ROOT } + + /// Get the raw `uid_t` wrapped by `self`. + pub fn as_raw(&self) -> uid_t { + self.0 + } } impl From for uid_t { @@ -87,6 +92,11 @@ impl Gid { pub fn effective() -> Self { getegid() } + + /// Get the raw `gid_t` wrapped by `self`. + pub fn as_raw(&self) -> gid_t { + self.0 + } } impl From for gid_t { @@ -123,6 +133,11 @@ impl Pid { pub fn parent() -> Self { getppid() } + + /// Get the raw `pid_t` wrapped by `self`. + pub fn as_raw(&self) -> pid_t { + self.0 + } } impl From for pid_t { -- cgit v1.2.3