summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c')
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c10
1 files changed, 5 insertions, 5 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..6d294a428e 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -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)