diff options
Diffstat (limited to 'src/unistd.rs')
-rw-r--r-- | src/unistd.rs | 15 |
1 files changed, 15 insertions, 0 deletions
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<Uid> 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<Gid> 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<Pid> for pid_t { |