Add mprotect

This commit is contained in:
Jeremy Soller
2018-12-31 21:04:45 -07:00
parent c514b0b705
commit 775ec444be
5 changed files with 22 additions and 12 deletions
+4
View File
@@ -298,6 +298,10 @@ impl Pal for Sys {
e(syscall!(MMAP, addr, len, prot, flags, fildes, off)) as *mut c_void
}
unsafe fn mprotect(addr: *mut c_void, len: usize, prot: c_int) -> c_int {
e(syscall!(MPROTECT, addr, len, prot)) as c_int
}
unsafe fn munmap(addr: *mut c_void, len: usize) -> c_int {
e(syscall!(MUNMAP, addr, len)) as c_int
}