about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBrunoSX <11407071+brunodev85@users.noreply.github.com>2025-10-06 17:14:22 -0300
committerGitHub <noreply@github.com>2025-10-06 22:14:22 +0200
commit73238883cbd0faa115c88722df94707089f81a8b (patch)
tree83352160d085c967daa17f3520b1357dca7f480f
parent73aed7fd0e3d32573e976d153b9752b2b264c7f9 (diff)
downloadbox64-73238883cbd0faa115c88722df94707089f81a8b.tar.gz
box64-73238883cbd0faa115c88722df94707089f81a8b.zip
Fixed mmap tracking with MAP_NORESERVE flag on Android (#3044)
-rw-r--r--src/wrapped/wrappedlibc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 31c2f2cd..280f5f7b 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -3071,7 +3071,11 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, size_t length, int prot, int f
             }
         }
         // hack to capture full size of the mmap done by wine
+#if defined(ANDROID) || defined(WINLATOR_GLIBC)
+        if(emu && (fd==-1) && (flags&(MAP_PRIVATE|MAP_ANON))==(MAP_PRIVATE|MAP_ANON) && !(flags&MAP_NORESERVE)) {
+#else
         if(emu && (fd==-1) && (flags&(MAP_PRIVATE|MAP_ANON))==(MAP_PRIVATE|MAP_ANON)) {
+#endif
             last_mmap_addr[last_mmap_idx] = ret;
             last_mmap_len[last_mmap_idx] = length;
         } else {