rustix/backend/libc/pid/
syscalls.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! libc syscalls for PIDs

use crate::backend::c;
use crate::pid::Pid;

#[cfg(not(target_os = "wasi"))]
#[inline]
#[must_use]
pub(crate) fn getpid() -> Pid {
    unsafe {
        let pid = c::getpid();
        Pid::from_raw_unchecked(pid)
    }
}