We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36bbe35 commit 9aa1f95Copy full SHA for 9aa1f95
src/target/PosixTarget.cpp
@@ -8,6 +8,7 @@ using namespace tulip::hook;
8
#if defined(TULIP_HOOK_POSIX)
9
10
#include <sys/mman.h>
11
+#include <unistd.h>
12
13
geode::Result<> PosixTarget::allocatePage() {
14
auto const protection = PROT_READ | PROT_WRITE | PROT_EXEC;
@@ -32,7 +33,7 @@ geode::Result<uint32_t> PosixTarget::getProtection(void* address) {
32
33
}
34
35
geode::Result<> PosixTarget::protectMemory(void* address, size_t size, uint32_t protection) {
- auto const pageSize = PAGE_SIZE;
36
+ auto const pageSize = getpagesize();
37
auto const pageMask = pageSize - 1;
38
39
auto const ptr = reinterpret_cast<uintptr_t>(address);
@@ -65,4 +66,4 @@ uint32_t PosixTarget::getWritableProtection() {
65
66
return PROT_READ | PROT_WRITE | PROT_EXEC;
67
68
-#endif
69
+#endif
0 commit comments