about summary refs log tree commit diff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c
index 24835ce9cc..75790f1996 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c
@@ -21,20 +21,20 @@
 #include <errno.h>
 #include <sysdep.h>
 
-#ifndef MMAP_PAGE_SHIFT
-#define MMAP_PAGE_SHIFT 12
+#ifndef MMAP_PAGE_UNIT
+# define MMAP_PAGE_UNIT 4096UL
 #endif
 
 __ptr_t
 __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
 {
-  if (offset & ((1 << MMAP_PAGE_SHIFT) - 1))
+  if (offset & (MMAP_PAGE_UNIT - 1))
     {
       __set_errno (EINVAL);
       return MAP_FAILED;
     }
   return (__ptr_t) INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, fd,
-                                   offset >> MMAP_PAGE_SHIFT);
+                                   offset / MMAP_PAGE_UNIT);
 }
 
 weak_alias (__mmap, mmap)