getpagesize() was removed from OSX (and posix) (#177)

This commit is contained in:
Patrick Quist 2024-09-30 07:25:58 +02:00 committed by GitHub
parent 54a3e6fdf7
commit ce8214bb16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,7 +107,11 @@ namespace cpptrace {
} }
#else #else
int get_page_size() { 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_readonly = PROT_READ;
constexpr auto memory_readwrite = PROT_READ | PROT_WRITE; constexpr auto memory_readwrite = PROT_READ | PROT_WRITE;