diff --git a/ReactCommon/cxxreact/JSBigString.cpp b/ReactCommon/cxxreact/JSBigString.cpp index 57baa283399832..36a2e68d8eb793 100644 --- a/ReactCommon/cxxreact/JSBigString.cpp +++ b/ReactCommon/cxxreact/JSBigString.cpp @@ -5,14 +5,13 @@ #include "JSBigString.h" -#include -#include -#include - #include #include +#include #include +#include +#include #include namespace facebook { @@ -29,7 +28,7 @@ JSBigFileString::JSBigFileString(int fd, size_t size, off_t offset /*= 0*/) // of the offset within the page that we must alter the mmap pointer by to // get the final desired offset. if (offset != 0) { - const static auto ps = getpagesize(); + const static auto ps = sysconf(_SC_PAGESIZE); auto d = lldiv(offset, ps); m_mapOff = d.quot; @@ -82,7 +81,7 @@ static off_t maybeRemap(char *data, size_t size, int fd) { { // System page size must be at least as granular as the remapping. // TODO: Consider fallback that reads entire file into memory. - const size_t systemPS = getpagesize(); + const size_t systemPS = sysconf(_SC_PAGESIZE); CHECK(filePS >= systemPS) << "filePS: " << filePS << "systemPS: " << systemPS; diff --git a/ReactCommon/cxxreact/JSBigString.h b/ReactCommon/cxxreact/JSBigString.h index 3d07f1fda4da2f..d3f3e86fe86562 100644 --- a/ReactCommon/cxxreact/JSBigString.h +++ b/ReactCommon/cxxreact/JSBigString.h @@ -5,9 +5,6 @@ #pragma once -#include -#include - #include #ifndef RN_EXPORT