about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-10-04 13:04:28 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-10-04 13:04:28 +0200
commit11f1c3c4ff30ddf97de052668e42f10185d47e31 (patch)
tree17045b9e7494cb2efaac703e5686231b3c520d90 /src
parent9f4eb36c99723f20e203bda0db07005284ae2eba (diff)
downloadbox64-11f1c3c4ff30ddf97de052668e42f10185d47e31.tar.gz
box64-11f1c3c4ff30ddf97de052668e42f10185d47e31.zip
Return the correct errno when mmap can't allocated hinted memory address
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/wrappedlibc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index abb4cd26..3c820289 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -3015,6 +3015,8 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, size_t length, int prot, int f
             setProtection_mmap((uintptr_t)ret, length, prot);
         else
             setProtection((uintptr_t)ret, length, prot);
+        if(old_addr && ret!=old_addr)
+            errno = EEXIST;
     }
     return ret;
 }