rsprocmaps

Crates.iorsprocmaps
lib.rsrsprocmaps
version0.3.2
sourcesrc
created_at2020-07-28 03:59:42.154276
updated_at2023-08-05 02:05:09.885223
descriptionA Rust library for handling memory maps in procfs
homepage
repositoryhttps://github.com/woodruffw/procmaps.rs
max_upload_size
id270302
size37,219
William Woodruff (woodruffw)

documentation

https://docs.rs/rsprocmaps/

README

procmaps.rs

CI Crates.io

procmaps.rs is a (very) small Rust library with one job: parsing the memory maps that Linux (and some other Unices) expose via /proc/<pid>/maps with a pleasant structure.

I wrote it before realizing that procmaps already exists. You should probably use that one instead, since it's nearly identical.

A quick sample:

let maps = rsprocmaps::from_pid(9001)?;

for map in maps {
  println!("{} executable? {}", map.address_range, map.permissions.executable);
}

Full documentation is available on docs.rs.

Goals

  • Parsing /proc/<pid>/maps correctly and into a clean structure

Anti-goals

  • Parsing other parts of /proc
  • Resolving fundamental ambiguities in the maps file format (e.g. newlines and deleted pathnames)
Commit count: 32

cargo fmt