Method lrs::mem_map::MemMap::file

Creates an memory mapping of a file.

Syntax

impl MemMap {
    fn file<F>(file: &F, at: u64, len: usize, protection: MemProtFlags, shared: bool, flags: MemMapFlags) -> Result<MemMap, Errno>
        where F: FDContainer,
}

Arguments

NameDescription
file

The file that will be mapped.

at

The position in the file at which the mapping starts.

len

The size of the mapping.

protection

The protection of the mapped region.

shared

Whether this mapping can be shared with other processes.

flags

Flags to use when creating this mapping.

Remarks

The real size of the mapping can be larger than the len argument.

See also