Skip to content

v0.16.0

Compare
Choose a tag to compare
@eminence eminence released this 29 Oct 16:54
· 54 commits to master since this release

This release contains a fairly large internal restructuring, which has noticeable public API changes. A lot of core functionality has been brought into a new procfs-core crate that contains platform-independent data structures and parsing. This crate can be used on all platforms. The procfs crate now depends on procfs-core, and contains all of the Linux-specific code (and thus remains only usable on Linux).

Some procfs functions require information about the running system. For example, the rss_bytes() function needs to know the page size. These functions now have a more complicated API. See the docs for more information, but generally you now have to add a call to .get(), for example:

Old:

let prc = procfs::process::Process::myself().unwrap();
let stat = prc.stat().unwrap();
println!("RSS:   {} bytes", stat.rss_bytes());

New:

use procfs::prelude::*;  // to bring `WithCurrentSystemInfo` into scope

let prc = procfs::process::Process::myself().unwrap();
let stat = prc.stat().unwrap();
println!("RSS:   {} bytes", stat.rss_bytes().get());

We think this new complication is unavoidable, but if you have some thoughts on this, your ideas are welcome in a new issue or discussion thread

New Features

Bug Fixes

  • Don't hide process creation errors in all_processes by @tatref in #260
  • Fix O_PATH for old kernels by @tatref in #266

Full Changelog: v0.15.1...v0.16.0