summaryrefslogtreecommitdiff
path: root/absl/base/internal/direct_mmap.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2018-11-19 08:14:58 -0800
committerGravatar Derek Mauro <dmauro@google.com>2018-11-19 15:11:12 -0500
commit3088e76c597e068479e82508b1770a7ad0c806b6 (patch)
tree02a478be2cc18263501f80599d3be8ee9abce51b /absl/base/internal/direct_mmap.h
parentf6ae816808cd913e0e2b3e2af14f328fa1071af0 (diff)
Export of internal Abseil changes.
-- 5278e56bd7d322ecf161eaf29fd7fa3941d7431b by Greg Falcon <gfalcon@google.com>: internal change PiperOrigin-RevId: 222078614 GitOrigin-RevId: 5278e56bd7d322ecf161eaf29fd7fa3941d7431b Change-Id: I1e86bef2e3733c81148a1a42dccd8182fe3f7fae
Diffstat (limited to 'absl/base/internal/direct_mmap.h')
-rw-r--r--absl/base/internal/direct_mmap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
index 3e5368db..654a6007 100644
--- a/absl/base/internal/direct_mmap.h
+++ b/absl/base/internal/direct_mmap.h
@@ -75,7 +75,11 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
// On these architectures, implement mmap with mmap2.
static int pagesize = 0;
if (pagesize == 0) {
+#if defined(__wasm__) || defined(__asmjs__)
+ pagesize = getpagesize();
+#else
pagesize = sysconf(_SC_PAGESIZE);
+#endif
}
if (offset < 0 || offset % pagesize != 0) {
errno = EINVAL;