Function all_pids
Source pub fn all_pids() -> Result<Vec<pid_t>>
Expand description
Fetch pids for all processes running in system.
examples/processes.rs (
line 7)
6fn main() -> io::Result<()> {
7 let pids = darwin_libproc::all_pids()?;
8 for pid in pids {
9 println!("PID: #{}", pid);
10 println!("\tName: {:?}", darwin_libproc::name(pid)?);
11 println!("\tPath: {:?}", darwin_libproc::pid_path(pid)?);
12 }
13
14 Ok(())
15}