/// Changes the protection of a memory region allocated using `alloc`.
Changes the protection of a memory region allocated using `alloc`.
Changes the protection of a memory region allocated using ` alloc ` .
pub fn protect(addr: usize, bytes: usize, prot: Protection) -> Result<(), io::Error> {
    unsafe {
        if mprotect(addr as *mut _, bytes, self::prot(prot)) == 0 {
            Ok(())
        } else {
            Err(io::Error::last_os_error())
        }
    }
}
pub fn protect ( addr : usize , bytes : usize , prot : Protection ) -> Result < ( ) , io :: Error > { unsafe { if mprotect ( addr as * mut _ , bytes , self :: prot ( prot ) ) == 0 { Ok ( ( ) ) } else { Err ( io :: Error :: last_os_error ( ) ) } } }
Changes the protection of a memory region allocated using `alloc`.
Changes the protection of a memory region allocated using ` alloc ` .
addr
usize
bytes
usize
prot
Protection