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]
Other format: [Raw text]

[PATCH] Fix loadarchive.c for 32-bit arches


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


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