Index: /trunk/psLib/src/types/psMetadataConfig.c
===================================================================
--- /trunk/psLib/src/types/psMetadataConfig.c	(revision 12886)
+++ /trunk/psLib/src/types/psMetadataConfig.c	(revision 12887)
@@ -11,6 +11,6 @@
 *  @author Joshua Hoblitt, University of Hawaii 2006-2007
 *
-*  @version $Revision: 1.133 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-03-22 00:32:18 $
+*  @version $Revision: 1.134 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2007-04-18 19:38:36 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1303,16 +1303,11 @@
     }
 
-    // determine the system page size
-    int pageSize = getpagesize();
-
-    // request one extra page.  even if st_size is an exact multiple of pageSize, this
-    // will guarantee we get a block of 0-valued bytes at the end of the file data.
-    int nPages = buf.st_size / pageSize + 1;
-
-    int nBytes = nPages * pageSize;
-
     // psMetadataConfigParse() is going to read the entire file into memory so
-    // we're trying to be nice by allowing the VM to flush the file out of
-    // memory if need be.
+    // lets use mmap() to allow the system to be cleverer about what gets read
+    //
+    // We're adding 1 to buf.st_size here in case st_size / system page size has
+    // a remainder of zero (otherwise there won't be any trailing \0s at the end
+    // of the page).
+    int nBytes = buf.st_size + 1;
 
     void *file = mmap(0, nBytes, PROT_READ, MAP_PRIVATE, fd, 0);
