Skip to content

Commit 9aa1f95

Browse files
authored
they removed PAGE_SIZE from android btw
1 parent 36bbe35 commit 9aa1f95

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/target/PosixTarget.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ using namespace tulip::hook;
88
#if defined(TULIP_HOOK_POSIX)
99

1010
#include <sys/mman.h>
11+
#include <unistd.h>
1112

1213
geode::Result<> PosixTarget::allocatePage() {
1314
auto const protection = PROT_READ | PROT_WRITE | PROT_EXEC;
@@ -32,7 +33,7 @@ geode::Result<uint32_t> PosixTarget::getProtection(void* address) {
3233
}
3334

3435
geode::Result<> PosixTarget::protectMemory(void* address, size_t size, uint32_t protection) {
35-
auto const pageSize = PAGE_SIZE;
36+
auto const pageSize = getpagesize();
3637
auto const pageMask = pageSize - 1;
3738

3839
auto const ptr = reinterpret_cast<uintptr_t>(address);
@@ -65,4 +66,4 @@ uint32_t PosixTarget::getWritableProtection() {
6566
return PROT_READ | PROT_WRITE | PROT_EXEC;
6667
}
6768

68-
#endif
69+
#endif

0 commit comments

Comments
 (0)