This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

mmap with __USE_FILE_OFFSET64



Looking at the usage of __USE_FILE_OFFSET64, I noticed a problem with
the mmap system call.

We should use __off64_t instead of just off_t and also use __REDIRECT
--- as we do in all other usages of __USE_FILE_OFFSET64.

I'm appending a patch for inclusion in glibc 2.2 and 2.1.3.

Andreas

1999-11-15  Andreas Jaeger  <aj@suse.de>

	* misc/sys/mman.h: Use __REDIRECT for mmap, correct prototype to
	use __off64_t.


============================================================
Index: misc/sys/mman.h
--- misc/sys/mman.h	1999/10/09 21:21:58	1.3
+++ misc/sys/mman.h	1999/11/15 16:23:45
@@ -44,9 +44,14 @@
 extern void *mmap (void *__addr, size_t __len, int __prot,
 		   int __flags, int __fd, __off_t __offset) __THROW;
 #else
-extern void *mmap (void *__addr, size_t __len, int __prot,
-		   int __flags, int __fd, __off_t __offset) __THROW
-     __asm__ ("mmap64");
+# ifdef __REDIRECT
+extern void * __REDIRECT (mmap,
+			  (void *__addr, size_t __len, int __prot,
+			   int __flags, int __fd, __off64_t __offset) __THROW,
+			  mmap64);
+# else
+#  define mmap mmap64
+# endif
 #endif
 #ifdef __USE_LARGEFILE64
 extern void *mmap64 (void *__addr, size_t __len, int __prot,

-- 
 Andreas Jaeger   
  SuSE Labs aj@suse.de	
   private aj@arthur.rhein-neckar.de

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