Debian Codegraph @

debian/rust-vendor/procfs/src/iomem.rs

raw
1 use super::ProcResult;
2 use crate::Current;
3 use procfs_core::{Iomem, PhysicalMemoryMap};
4
5 impl Current for Iomem {
6 const PATH: &'static str = "/proc/iomem";
7 }
8
9 /// Reads and parses the `/proc/iomem`, returning an error if there are problems.
10 ///
11 /// Requires root, otherwise every memory address will be zero.
12 pub fn iomem() -> ProcResult<Vec<(usize, PhysicalMemoryMap)>> {
13 Iomem::current().map(|v| v.0)
14 }