Skip to content

CDRIVER-4505 Fix build on MacOS due to undeclared getpagesize #1136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/libmongoc/src/mongoc/mongoc-counters.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#ifdef BSON_OS_UNIX
#include <sys/mman.h>
#include <sys/shm.h>
#include <unistd.h>
#endif

#ifdef _MSC_VER
Expand Down Expand Up @@ -111,7 +112,7 @@ mongoc_counters_calc_size (void)
(n_cpu * n_groups * sizeof (mongoc_counter_slots_t)));

#ifdef BSON_OS_UNIX
return BSON_MAX (getpagesize (), size);
return BSON_MAX (sysconf (_SC_PAGESIZE), size);
#else
return size;
#endif
Expand Down