This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Revised mmap64 patch
- To: libc-alpha@sourceware.cygnus.com, fsirl@kernel.crashing.org,dburkaw@terraplex.com
- Subject: Revised mmap64 patch
- From: Daniel Jacobowitz <drow@false.org>
- Date: Tue, 22 Jun 1999 16:28:41 -0400
The only oddity to this is the extra mmap64 entry in
powerpc/syscalls.list. That's simply in guard against the time when
it becomes a syscall, to cover for the differences in argument passing
with a 64 bit off_t.
Dan
/--------------------------------\ /--------------------------------\
| Daniel Jacobowitz |__| SCS Class of 2002 |
| Debian GNU/Linux Developer __ Carnegie Mellon University |
| dan@debian.org | | dmj+@andrew.cmu.edu |
\--------------------------------/ \--------------------------------/
diff -uNr orig/glibc-2.1.1/sysdeps/unix/sysv/linux/mmap64.c build/glibc-2.1.1/sysdeps/unix/sysv/linux/mmap64.c
--- orig/glibc-2.1.1/sysdeps/unix/sysv/linux/mmap64.c Sat Nov 14 02:19:41 1998
+++ build/glibc-2.1.1/sysdeps/unix/sysv/linux/mmap64.c Tue Jun 22 16:22:47 1999
@@ -1,3 +1,45 @@
-/* At least for now mmap64 is the same as mmap on all platforms.
- When/If the 32 bit platforms get a >32 bit VFS we'll have to
- change it for these platforms. */
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Daniel Jacobowitz <dan@debian.org>, 1999.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#include <sys/mman.h>
+
+__ptr_t
+__mmap64 (addr, len, prot, flags, fd, offset)
+ __ptr_t addr;
+ size_t len;
+ int prot;
+ int flags;
+ int fd;
+ off64_t offset;
+{
+ if(offset != (off_t)offset) {
+ errno = EINVAL;
+ return(MAP_FAILED);
+ }
+
+ return __mmap(addr, len, prot, flags, fd, (off_t)offset);
+}
+
+weak_alias (__mmap64, mmap64)
diff -uNr orig/glibc-2.1.1/sysdeps/unix/sysv/linux/powerpc/syscalls.list build/glibc-2.1.1/sysdeps/unix/sysv/linux/powerpc/syscalls.list
--- orig/glibc-2.1.1/sysdeps/unix/sysv/linux/powerpc/syscalls.list Wed Jan 13 12:57:10 1999
+++ build/glibc-2.1.1/sysdeps/unix/sysv/linux/powerpc/syscalls.list Tue Jun 22 16:03:29 1999
@@ -1,5 +1,8 @@
# File name Caller Syscall name # args Strong name Weak names
+mmap64 - mmap64 8 __mmap64 mmap64
+mmap - mmap 6 __mmap mmap
+
# System calls with wrappers.
s_ioctl ioctl ioctl 3 __syscall_ioctl
s_ipc msgget ipc 5 __syscall_ipc
diff -uNr orig/glibc-2.1.1/sysdeps/unix/sysv/linux/syscalls.list build/glibc-2.1.1/sysdeps/unix/sysv/linux/syscalls.list
--- orig/glibc-2.1.1/sysdeps/unix/sysv/linux/syscalls.list Wed Jan 13 14:24:20 1999
+++ build/glibc-2.1.1/sysdeps/unix/sysv/linux/syscalls.list Tue Jun 22 15:59:15 1999
@@ -23,7 +23,8 @@
lchown - lchown 3 __lchown lchown
mlock EXTRA mlock 2 __mlock mlock
mlockall EXTRA mlockall 1 __mlockall mlockall
-mmap - mmap 6 __mmap mmap mmap64
+mmap64 - mmap64 6 __mmap64 mmap64
+mmap - mmap 6 __mmap mmap
mount EXTRA mount 5 __mount mount
mremap EXTRA mremap 4 __mremap mremap
munlock EXTRA munlock 2 __munlock munlock