docs.rs crates.io license

The goal of this repo is to make retriving system informations reside in proc file system easier.

Example

``` use lpfs::proc::; use lpfs::pid::;

fn main() { // /proc/stat println!("{:?}", stat().unwrap());

//  /proc/1/stat
println!("{:?}", stat_of(1).unwrap());

} ```

Interface Design

eminence/procfs is a similar crate with different interface design.

Top-Level Files

Each file is retrived by a function reside in lpfs::proc with same name. For example, lpfs::proc::cmdline retrive from /proc/cmdline.

Process Directories

It's similar with top-level files, here is an example with stat.

| function | file | | --- | --- | | statof(pid) | /proc/[pid]/stat | | statself() | /proc/self/stat | | statoftask(pid, tid) | /proc/[pid]/task/[tid]/stat | | statselftask(tid) | /proc/self/task/[tid]/stat |

These functions reside in lpfs::pid

Minial Requirement

rust 2018 (rustc 1.31.0 +)

Supported

all linux distribution with 3.+ kernel version.

LICENSE

MIT