/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ // This file ensures that mman.h compatible functions are defined in the global // namespace for windows and posix environments. #pragma once #include #ifndef _WIN32 #include #include ET_INLINE size_t get_os_page_size() { return sysconf(_SC_PAGESIZE); } #else #define NOMINMAX #include #undef NOMINMAX #include #include ET_INLINE long get_os_page_size() { SYSTEM_INFO si; GetSystemInfo(&si); long pagesize = si.dwAllocationGranularity > si.dwPageSize ? si.dwAllocationGranularity : si.dwPageSize; return pagesize; } #endif