darwin_libproc

Function name

Source
pub fn name(pid: pid_t) -> Result<OsString>
Expand description

Fetch process name for pid provided.

Examples found in repository?
examples/processes.rs (line 10)
6
7
8
9
10
11
12
13
14
15
fn main() -> io::Result<()> {
    let pids = darwin_libproc::all_pids()?;
    for pid in pids {
        println!("PID: #{}", pid);
        println!("\tName: {:?}", darwin_libproc::name(pid)?);
        println!("\tPath: {:?}", darwin_libproc::pid_path(pid)?);
    }

    Ok(())
}