getpid

Function getpid 

Source
pub fn getpid() -> pid_t
Expand description

Get the current process ID see getpid(2)

Returns the process ID of the calling process. This function is always successful.

ยงExample

use fork::getpid;

let my_pid = getpid();
println!("My process ID: {}", my_pid);