From 618795fbfd64f2dd1fa4375ce704736c70725412 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 2 Sep 2005 20:01:37 +0000 Subject: Don't use mmap when _MUDFLAP is defined. --- src/strings.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/strings.c') diff --git a/src/strings.c b/src/strings.c index 40774e46..d9434c92 100644 --- a/src/strings.c +++ b/src/strings.c @@ -448,15 +448,22 @@ process_chunk (const char *fname, const unsigned char *buf, off64_t to, static void * map_file (int fd, off64_t start_off, off64_t fdlen, size_t *map_sizep) { +#if _MUDFLAP + (void) fd; + (void) start_off; + (void) fdlen; + (void) map_sizep; + return MAP_FAILED; +#else /* Maximum size we mmap. We use an #ifdef to avoid overflows on 32-bit machines. 64-bit machines these days do not have usable address spaces larger than about 43 bits. Not that any file should be that large. */ -#if SIZE_MAX > 0xffffffff +# if SIZE_MAX > 0xffffffff const size_t mmap_max = 0x4000000000lu; -#else +# else const size_t mmap_max = 0x40000000lu; -#endif +# endif /* Try to mmap the file. */ size_t map_size = MIN ((off64_t) mmap_max, fdlen); @@ -489,6 +496,7 @@ map_file (int fd, off64_t start_off, off64_t fdlen, size_t *map_sizep) *map_sizep = map_size; return mem; +#endif } -- cgit v1.2.3