commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd, commited] hurd: make mprotect translate KERN_PROTECTION_FAILURE t


From: Samuel Thibault
Subject: [hurd, commited] hurd: make mprotect translate KERN_PROTECTION_FAILURE to EACCESS
Date: Sun, 22 Dec 2024 11:41:25 +0100

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]