pub fn getpid() -> Pid
Available on crate feature
process
only.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.