[Glibc-bsd-commits] r3128 - trunk/glibc-ports/kfreebsd

Aurelien Jarno aurel32 at alioth.debian.org
Fri Jul 30 20:15:57 UTC 2010


Author: aurel32
Date: 2010-07-30 20:15:55 +0000 (Fri, 30 Jul 2010)
New Revision: 3128

Modified:
   trunk/glibc-ports/kfreebsd/getsysstats.c
Log:
Fix _SC_PHYS_PAGES:
- return the number of pages, not the memory size in bytes
- return a value for > 4GB of memory on a 64-bit machine



Modified: trunk/glibc-ports/kfreebsd/getsysstats.c
===================================================================
--- trunk/glibc-ports/kfreebsd/getsysstats.c	2010-07-30 20:11:04 UTC (rev 3127)
+++ trunk/glibc-ports/kfreebsd/getsysstats.c	2010-07-30 20:15:55 UTC (rev 3128)
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <sys/sysctl.h>
+#include <unistd.h>
 #include <stddef.h>
 
 
@@ -26,14 +27,14 @@
 {
   /* Fetch sysctl value of "hw.ncpu".  */
   int request[2] = { CTL_HW, HW_NCPU };
-  int result;
+  long int result;
   size_t result_len = sizeof (result);
 
   if (__sysctl (request, 2, &result, &result_len, NULL, 0) < 0)
     /* Dummy result.  */
     return 1;
 
-  return result;
+  return result / __getpagesize();
 }
 
 weak_alias (__get_nprocs, get_nprocs)




More information about the Glibc-bsd-commits mailing list