Debian Codegraph @

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

raw
1 //! libc syscalls for PIDs
2
3 use crate::backend::c;
4 use crate::pid::Pid;
5
6 #[cfg(not(target_os = "wasi"))]
7 #[inline]
8 #[must_use]
9 pub(crate) fn getpid() -> Pid {
10 unsafe {
11 let pid = c::getpid();
12 Pid::from_raw_unchecked(pid)
13 }
14 }