This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Fix mmap64 for PPC
- To: libc-alpha at sources dot redhat dot com
- Subject: [PATCH] Fix mmap64 for PPC
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Mon, 22 Jan 2001 00:31:46 +0100
Hi,
this is the nth try to get this routine right :-). With this change it works
OK for me and actually uses the mmap2 syscall.
Franz.
* sysdeps/unix/sysv/linux/powerpc/mmap64.c: Correctly mask offset.
Index: sysdeps/unix/sysv/linux/powerpc/mmap64.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/mmap64.c,v
retrieving revision 1.7
diff -u -p -r1.7 mmap64.c
--- sysdeps/unix/sysv/linux/powerpc/mmap64.c 2000/10/24 21:09:50 1.7
+++ sysdeps/unix/sysv/linux/powerpc/mmap64.c 2001/01/21 23:27:36
@@ -47,7 +47,7 @@ __mmap64 (__ptr_t addr, size_t len, int
# ifndef __ASSUME_MMAP2_SYSCALL
! have_no_mmap2 &&
# endif
- ! (offset & -(1 << (PAGE_SHIFT+1))))
+ ! (offset & ((1 << PAGE_SHIFT)-1)))
{
# ifndef __ASSUME_MMAP2_SYSCALL
int saved_errno = errno;