pub fn read_memfd(memfd: &mfd::Memfd) -> Result<mmap::Mmap, Error> {
    // The file can be truncated; no safe memory mapping.
    verify_seal(&memfd, mfd::FileSeal::SealShrink)?;
    // The file can be written to; no safe references.
    verify_seal(&memfd, mfd::FileSeal::SealWrite)?;

    let r = unsafe { mmap::MmapOptions::new().map_copy_read_only(memfd.as_file()) }?;
    Ok(r)
}
/// Creates a memory map of a memfd. The memfd is sealed to be read only.
Creates a memory map of a memfd. The memfd is sealed to be read only.
Creates a memory map of a memfd . The memfd is sealed to be read only .
pub fn read_memfd(memfd: &mfd::Memfd) -> Result<mmap::Mmap, Error> {
    // The file can be truncated; no safe memory mapping.
    verify_seal(&memfd, mfd::FileSeal::SealShrink)?;
    // The file can be written to; no safe references.
    verify_seal(&memfd, mfd::FileSeal::SealWrite)?;
    let r = unsafe { mmap::MmapOptions::new().map_copy_read_only(memfd.as_file()) }?;
    Ok(r)
}
pub fn read_memfd ( memfd : & mfd :: Memfd ) -> Result < mmap :: Mmap , Error > { // The file can be truncated; no safe memory mapping. verify_seal ( & memfd , mfd :: FileSeal :: SealShrink ) ? ; // The file can be written to; no safe references. verify_seal ( & memfd , mfd :: FileSeal :: SealWrite ) ? ; let r = unsafe { mmap :: MmapOptions :: new ( ) . map_copy_read_only ( memfd . as_file ( ) ) } ? ; Ok ( r ) }
Creates a memory map of a memfd.
Creates a memory map of a memfd .
memfd
&mfd::Memfd
memfd
&mfd::Memfd