summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/syscall-defs.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/arch/syscall-defs.h b/src/arch/syscall-defs.h
index f79f56a..1e8ae1b 100644
--- a/src/arch/syscall-defs.h
+++ b/src/arch/syscall-defs.h
@@ -6,8 +6,15 @@
static inline void *__sys_mmap(void *addr, size_t length, int prot, int flags,
int fd, off_t offset)
{
- return (void *) __do_syscall6(__NR_mmap, addr, length, prot, flags, fd,
- offset);
+ int nr;
+
+#if defined(__i386__)
+ nr = __NR_mmap2;
+ offset >>= 12;
+#else
+ nr = __NR_mmap;
+#endif
+ return (void *) __do_syscall6(nr, addr, length, prot, flags, fd, offset);
}
static inline int __sys_munmap(void *addr, size_t length)