Skip to content

Commit ce8214b

Browse files
authored
getpagesize() was removed from OSX (and posix) (jeremy-rifkin#177)
1 parent 54a3e6f commit ce8214b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/from_current.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ namespace cpptrace {
107107
}
108108
#else
109109
int get_page_size() {
110-
return getpagesize();
110+
#if defined(_SC_PAGESIZE)
111+
return sysconf(_SC_PAGESIZE);
112+
#else
113+
return getpagesize();
114+
#endif
111115
}
112116
constexpr auto memory_readonly = PROT_READ;
113117
constexpr auto memory_readwrite = PROT_READ | PROT_WRITE;

0 commit comments

Comments
 (0)