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 Jeremy Rifkin
parent 7b2a994559
commit ae86a79f16
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4

View File

@ -105,7 +105,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;