From 1c0c17a6fe97d67b098696d7ccddd1c8d1c254f3 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sun, 1 Dec 2024 14:57:54 +0200 Subject: [PATCH] more --- third_party/host_memory/host_memory.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/third_party/host_memory/host_memory.cpp b/third_party/host_memory/host_memory.cpp index b5c73aa85..4d9e9d097 100644 --- a/third_party/host_memory/host_memory.cpp +++ b/third_party/host_memory/host_memory.cpp @@ -32,8 +32,10 @@ #define MAP_NORESERVE 0 #endif -// On Android, include ioctl for the shared memory ioctls +// On Android, include ioctl for shared memory ioctls, dlfcn for loading libandroid and linux/ashmem for ashmem defines #ifdef __ANDROID__ +#include +#include #include #endif @@ -491,7 +493,7 @@ namespace Common { throw std::bad_alloc{}; } - backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAYBE_ANONYMOUS(MAP_SHARED), fd, 0)); + backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); if (backing_base == MAP_FAILED) { Helpers::warn("mmap failed: {}", strerror(errno)); @@ -535,7 +537,7 @@ namespace Common { } #endif - void* ret = mmap(virtual_base + virtual_offset, length, flags, MAYBE_ANONYMOUS(MAP_SHARED | MAP_FIXED), fd, host_offset); + void* ret = mmap(virtual_base + virtual_offset, length, flags, MAP_SHARED | MAP_FIXED, fd, host_offset); ASSERT_MSG(ret != MAP_FAILED, "mmap failed: {}", strerror(errno)); }