From 2577b1bc16124d0690b9dd268a9f582f80bdcd67 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 21 Apr 2017 17:24:46 -0400 Subject: allow full-range file offsets to mmap on archs with 64-bit syscall args normally 32-bit archs use the mmap2 syscall and are limited to an offset of 2^32 pages. however some 32-bit archs (mainly ILP32-on-64 ones like x32) have 64-bit syscall argument slots and thus can accept the full range. don't artifically limit them. --- src/mman/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mman') diff --git a/src/mman/mmap.c b/src/mman/mmap.c index b85f25ca..19caadbd 100644 --- a/src/mman/mmap.c +++ b/src/mman/mmap.c @@ -10,7 +10,7 @@ static void dummy(void) { } weak_alias(dummy, __vm_wait); #define UNIT SYSCALL_MMAP2_UNIT -#define OFF_MASK ((-0x2000ULL << (8*sizeof(long)-1)) | (UNIT-1)) +#define OFF_MASK ((-0x2000ULL << (8*sizeof(syscall_arg_t)-1)) | (UNIT-1)) void *__mmap(void *start, size_t len, int prot, int flags, int fd, off_t off) { -- cgit v1.2.1