linux_api::mman

Function mmap

source
pub unsafe fn mmap(
    addr: *mut c_void,
    length: usize,
    prot: ProtFlags,
    flags: MapFlags,
    fd: RawFd,
    offset: usize,
) -> Result<*mut c_void, Errno>
Expand description

Make the mmap syscall, with a thin layer of type-safety over mmap_raw. See mmap(2).

ยงSafety

Can clobber existing memory. See mmap(2).