Suggested-by: Sergey Bugaev <[email protected]> --- sysdeps/mach/mprotect.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/sysdeps/mach/mprotect.c b/sysdeps/mach/mprotect.c
index d73d01a661..f7ab6e7221 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;
}
--
2.45.2
