procfs 0.5.4

Interface to the linux procfs pseudo-filesystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate procfs;

fn main() {
    let pid = i32::from_str_radix(
        &std::env::args().nth(1).expect("no proc ID arg specified"),
        10,
    )
    .unwrap();

    println!("Info for pid={}", pid);
    let prc = procfs::Process::new(pid).unwrap();
    println!("{:#?}", prc);

    println!("State: {:?}", prc.stat.state());
    println!("RSS:   {} bytes", prc.stat.rss_bytes());
}