aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysdeps/mach/mprotect.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/mach/mprotect.c b/sysdeps/mach/mprotect.c
index d73d01a..f7ab6e7 100644
--- a/sysdeps/mach/mprotect.c
+++ b/sysdeps/mach/mprotect.c
@@ -42,6 +42,9 @@ __mprotect (void *addr, size_t len, int prot)
(vm_address_t) addr, (vm_size_t) len,
0, vmprot))
{
+ if (err == KERN_PROTECTION_FAILURE)
+ err = EACCES;
+
errno = err;
return -1;
}