summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/util.c b/util.c
index 7b2afdd..3a194e7 100644
--- a/util.c
+++ b/util.c
@@ -112,7 +112,11 @@ void *mem_chunk(off_t base, off_t len, const char *devmem)
return NULL;
#ifdef USE_MMAP
+#ifdef _SC_PAGESIZE
+ mmoffset=base%sysconf(_SC_PAGESIZE);
+#else
mmoffset=base%getpagesize();
+#endif /* _SC_PAGESIZE */
/*
* Please note that we don't use mmap() for performance reasons here,
* but to workaround problems many people encountered when trying