Debian Codegraph @

.cargo/vendor/rustix/src/backend/libc/ugid/syscalls.rs

raw
1 use crate::backend::c;
2 use crate::ugid::{Gid, Uid};
3
4 #[cfg(not(target_os = "wasi"))]
5 #[inline]
6 #[must_use]
7 pub(crate) fn getuid() -> Uid {
8 unsafe {
9 let uid = c::getuid();
10 Uid::from_raw(uid)
11 }
12 }
13
14 #[cfg(not(target_os = "wasi"))]
15 #[inline]
16 #[must_use]
17 pub(crate) fn geteuid() -> Uid {
18 unsafe {
19 let uid = c::geteuid();
20 Uid::from_raw(uid)
21 }
22 }
23
24 #[cfg(not(target_os = "wasi"))]
25 #[inline]
26 #[must_use]
27 pub(crate) fn getgid() -> Gid {
28 unsafe {
29 let gid = c::getgid();
30 Gid::from_raw(gid)
31 }
32 }
33
34 #[cfg(not(target_os = "wasi"))]
35 #[inline]
36 #[must_use]
37 pub(crate) fn getegid() -> Gid {
38 unsafe {
39 let gid = c::getegid();
40 Gid::from_raw(gid)
41 }
42 }