pub unsafe fn mmap(addr: *mut c_void, length: size_t, prot: ProtFlags, flags: MapFlags, fd: RawFd, offset: off_t) -> Result<*mut c_void> {
    let ret = libc::mmap(addr, length, prot.bits(), flags.bits(), fd, offset);

    if ret == libc::MAP_FAILED {
        Err(Error::Sys(Errno::last()))
    } else {
        Ok(ret)
    }
}
/// allocate memory, or map files or devices into memory
///
/// # Safety
///
/// See the `mmap(2)` man page for detailed requirements.
allocate memory, or map files or devices into memory
allocate memory or map files or devices into memory
pub unsafe fn mmap(addr: *mut c_void, length: size_t, prot: ProtFlags, flags: MapFlags, fd: RawFd, offset: off_t) -> Result<*mut c_void> {
    let ret = libc::mmap(addr, length, prot.bits(), flags.bits(), fd, offset);
    if ret == libc::MAP_FAILED {
        Err(Error::Sys(Errno::last()))
    } else {
        Ok(ret)
    }
}
pub unsafe fn mmap ( addr : * mut c_void , length : size_t , prot : ProtFlags , flags : MapFlags , fd : RawFd , offset : off_t ) -> Result < * mut c_void > { let ret = libc :: mmap ( addr , length , prot . bits ( ) , flags . bits ( ) , fd , offset ) ; if ret == libc :: MAP_FAILED { Err ( Error :: Sys ( Errno :: last ( ) ) ) } else { Ok ( ret ) } }
allocate memory, or map files or devices into memory
allocate memory or map files or devices into memory
addr
*mut c_void
length
size_t
prot
ProtFlags
flags
MapFlags
fd
RawFd
offset
off_t
addr
*mut c_void
length
size_t
prot
ProtFlags
flags
MapFlags
fd
RawFd
offset
off_t
safety
See the `mmap(2)` man page for detailed requirements.
See the ` mmap ( 2 ) ` man page for detailed requirements .