From 16816bb7b4bda33c9077f117a6f1a7588367ed38 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 17 Jan 2006 01:01:08 +0000 Subject: use the 6-arg version of mmap where available --- libc/sysdeps/linux/common/mmap.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libc/sysdeps/linux/common/mmap.c b/libc/sysdeps/linux/common/mmap.c index 29d78a712..6acb73980 100644 --- a/libc/sysdeps/linux/common/mmap.c +++ b/libc/sysdeps/linux/common/mmap.c @@ -15,7 +15,14 @@ libc_hidden_proto(mmap) -#define __NR__mmap __NR_mmap +#ifdef __UCLIBC_MMAP_HAS_6_ARGS__ + +_syscall6(void *, mmap, void *, start, size_t, length, + int, prot, int, flags, int, fd, off_t, offset); + +#else + +# define __NR__mmap __NR_mmap static inline _syscall1(__ptr_t, _mmap, unsigned long *, buffer); __ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) @@ -30,5 +37,8 @@ __ptr_t mmap(__ptr_t addr, size_t len, int prot, buffer[5] = (unsigned long) offset; return (__ptr_t) _mmap(buffer); } + +#endif + libc_hidden_def(mmap) #endif -- cgit v1.2.3