about summary refs log tree commit diff stats
path: root/src/custommem.c
diff options
context:
space:
mode:
authorRomain TISSERAND <romain.tisserand@gmail.com>2024-06-03 08:07:11 +0200
committerGitHub <noreply@github.com>2024-06-03 08:07:11 +0200
commit3d225ef9082fd4df12dd1c11ada54a3cd75b5132 (patch)
tree67e621b1b9ff15d873d86e487fd9b68b3bbbcca4 /src/custommem.c
parent1c9123637a2464023615598773ac46c87711fda9 (diff)
downloadbox64-3d225ef9082fd4df12dd1c11ada54a3cd75b5132.tar.gz
box64-3d225ef9082fd4df12dd1c11ada54a3cd75b5132.zip
Try to fix mmap64 already defined error in custommem.c (#1552)
Diffstat (limited to 'src/custommem.c')
-rw-r--r--src/custommem.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/custommem.c b/src/custommem.c
index 476a6837..e5cf2e46 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -66,7 +66,7 @@ rbtree* memprot = NULL;
 int have48bits = 0;
 static int inited = 0;
 
-static rbtree*  mapallmem = NULL;
+rbtree*  mapallmem = NULL;
 static rbtree*  mmapmem = NULL;
 
 typedef struct blocklist_s {
@@ -1713,28 +1713,3 @@ int internal_munmap(void* addr, unsigned long length)
     #endif
     return ret;
 }
-
-void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset);
-
-extern int running32bits;
-EXPORT void* mmap64(void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset)
-{
-    void* ret;
-    if(!addr && ((running32bits && box64_mmap32) || (flags&0x40)))
-        ret = my_mmap64(NULL, addr, length, prot, flags | 0x40, fd, offset);
-    else
-        ret = internal_mmap(addr, length, prot, flags, fd, offset);
-    if(ret!=MAP_FAILED && mapallmem)
-        setProtection((uintptr_t)ret, length, prot);
-    return ret;
-}
-EXPORT void* mmap(void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset) __attribute__((alias("mmap64")));
-
-EXPORT int munmap(void* addr, unsigned long length)
-{
-    int ret = internal_munmap(addr, length);
-    if(!ret && mapallmem) {
-        freeProtection((uintptr_t)addr, length);
-    }
-    return ret;
-}