nix::sys::mman

Function mmap

source
pub unsafe fn mmap<F: AsFd>(
    addr: Option<NonZeroUsize>,
    length: NonZeroUsize,
    prot: ProtFlags,
    flags: MapFlags,
    f: F,
    offset: off_t,
) -> Result<NonNull<c_void>>
Expand description

Allocate memory, or map files or devices into memory

For anonymous mappings (MAP_ANON/MAP_ANONYMOUS), see mmap_anonymous.

ยงSafety

See the mmap(2) man page for detailed requirements.