Function nix::unistd::getpid

source ยท
pub fn getpid() -> Pid
Expand description

Get the pid of this process (see getpid(2)).

Since you are running code, there is always a pid to return, so there is no error case that needs to be handled.