From ce8214bb16c7cedb3707fbf82c88fd603b9a41af Mon Sep 17 00:00:00 2001 From: Patrick Quist Date: Mon, 30 Sep 2024 07:25:58 +0200 Subject: [PATCH] getpagesize() was removed from OSX (and posix) (#177) --- src/from_current.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/from_current.cpp b/src/from_current.cpp index 308735f..47610fb 100644 --- a/src/from_current.cpp +++ b/src/from_current.cpp @@ -107,7 +107,11 @@ namespace cpptrace { } #else int get_page_size() { - return getpagesize(); + #if defined(_SC_PAGESIZE) + return sysconf(_SC_PAGESIZE); + #else + return getpagesize(); + #endif } constexpr auto memory_readonly = PROT_READ; constexpr auto memory_readwrite = PROT_READ | PROT_WRITE;