[hurd, commited] hurd: make mprotect translate KERN_PROTECTION_FAILURE to EACCESS
Samuel Thibault
samuel.thibault@ens-lyon.org
Sun Dec 22 10:41:25 GMT 2024
Suggested-by: Sergey Bugaev <bugaevc@gmail.com>
---
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
More information about the Libc-alpha
mailing list