Skip to content
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

JSBigString: Fix building on Windows #26826

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
11 changes: 5 additions & 6 deletions ReactCommon/cxxreact/JSBigString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@

#include "JSBigString.h"

#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>

#include <glog/logging.h>

#include <folly/Memory.h>
#include <folly/portability/Fcntl.h>
#include <folly/portability/SysMman.h>
#include <folly/portability/SysStat.h>
#include <folly/portability/Unistd.h>
#include <folly/ScopeGuard.h>

namespace facebook {
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions ReactCommon/cxxreact/JSBigString.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

#pragma once

#include <fcntl.h>
#include <sys/mman.h>

#include <folly/Exception.h>

#ifndef RN_EXPORT
Expand Down