/// Return a list of the currently mapped memory regions and their access permissions, based on
/// the `/proc/pid/maps` file.
Return a list of the currently mapped memory regions and their access permissions, based on
the `/proc/pid/maps` file.
Return a list of the currently mapped memory regions and their access permissions based on the ` / proc / pid / maps ` file .
pub fn maps(&self) -> ProcResult<Vec<MemoryMap>> {
        pub(crate) fn from_line(line: &str) -> ProcResult<MemoryMap> {
            let mut s = line.splitn(6, ' ');
            let address = expect!(s.next());
            let perms = expect!(s.next());
            let offset = expect!(s.next());
            let dev = expect!(s.next());
            let inode = expect!(s.next());
            let path = expect!(s.next());
            Ok(MemoryMap {
                address: split_into_num(address, '-', 16)?,
                perms: perms.to_string(),
                offset: from_str!(u64, offset, 16),
                dev: split_into_num(dev, ':', 16)?,
                inode: from_str!(u64, inode),
                pathname: MMapPath::from(path)?,
            })
        }
        let path = self.root.join("maps");
        let file = FileWrapper::open(&path)?;
        let reader = BufReader::new(file);
        let mut vec = Vec::new();
        for line in reader.lines() {
            let line = line.map_err(|_| ProcError::Incomplete(Some(path.clone())))?;
            vec.push(from_line(&line)?);
        }
        Ok(vec)
    }
pub fn maps ( & self ) -> ProcResult < Vec < MemoryMap > > { pub ( crate ) fn from_line ( line : & str ) -> ProcResult < MemoryMap > { let mut s = line . splitn ( 6 , ' ' ) ; let address = expect ! ( s next ( ) ) ; let perms = expect ! ( s next ( ) ) ; let offset = expect ! ( s next ( ) ) ; let dev = expect ! ( s next ( ) ) ; let inode = expect ! ( s next ( ) ) ; let path = expect ! ( s next ( ) ) ; Ok ( MemoryMap { address : split_into_num ( address , '-' , 16 ) ? , perms : perms . to_string ( ) , offset : from_str ! ( u64 offset 16 ) , dev : split_into_num ( dev , ':' , 16 ) ? , inode : from_str ! ( u64 inode ) , pathname : MMapPath :: from ( path ) ? , } ) } let path = self . root . join ( " " ) ; let file = FileWrapper :: open ( & path ) ? ; let reader = BufReader :: new ( file ) ; let mut vec = Vec :: new ( ) ; for line in reader . lines ( ) { let line = line . map_err ( | _ | ProcError :: Incomplete ( Some ( path . clone ( ) ) ) ) ? ; vec . push ( from_line ( & line ) ? ) ; } Ok ( vec ) }
Return a list of the currently mapped memory regions and their access permissions, based on
the `/proc/pid/maps` file.
Return a list of the currently mapped memory regions and their access permissions based on the ` / proc / pid / maps ` file .
&self