rusl 0.5.0

Rust linux interface layer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::platform::PidT;
use sc::syscall;

/// Get the pid of the calling process
/// See [Linux docs for details](https://man7.org/linux/man-pages/man2/getpid.2.html)
/// Always successful
#[inline]
#[must_use]
#[expect(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
pub fn get_pid() -> PidT {
    let res = unsafe { syscall!(GETPID) };
    res as PidT
}