This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Fix mmap64 for PPC


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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]