This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Fix loadarchive.c for 32-bit arches
- From: Jakub Jelinek <jakub at redhat dot com>
- To: roland at redhat dot com, drepper at redhat dot com
- Cc: libc-alpha at sources dot redhat dot com
- Date: Thu, 15 Aug 2002 20:02:04 -0400
- Subject: [PATCH] Fix loadarchive.c for 32-bit arches
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
I've noticed on my 32-bit box libc mmaps the whole locale-archive while
it should mmap just 2MB...
2002-08-16 Jakub Jelinek <jakub@redhat.com>
* locale/programs/loadarchive.c (_nl_load_locale_from_archive): For
32-bit arches use MIN, not MAX.
--- libc/locale/programs/loadarchive.c.jj Thu Aug 15 18:18:41 2002
+++ libc/locale/programs/loadarchive.c Thu Aug 15 19:59:17 2002
@@ -206,7 +206,7 @@ _nl_load_locale_from_archive (int catego
just map the whole file and be sure everything is covered. */
mapsize = (sizeof (void *) > 4 ? archive_stat.st_size
- : MAX (archive_stat.st_size, ARCHIVE_MAPPING_WINDOW));
+ : MIN (archive_stat.st_size, ARCHIVE_MAPPING_WINDOW));
result = __mmap64 (NULL, mapsize, PROT_READ, MAP_SHARED, fd, 0);
if (result == MAP_FAILED)
Jakub