summaryrefslogtreecommitdiffstats
path: root/devel/libgtop
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2008-09-30 02:38:04 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2008-09-30 02:38:04 +0800
commit43edb2d11b0377708a7c23ac5af6facafea351eb (patch)
tree8129bdf0f5c91fc97dc5d44776f905a0b44a64af /devel/libgtop
parentb5bbd617b219f1c94d3e21b2fc8284014cb61a40 (diff)
downloadmarcuscom-ports-43edb2d11b0377708a7c23ac5af6facafea351eb.tar
marcuscom-ports-43edb2d11b0377708a7c23ac5af6facafea351eb.tar.gz
marcuscom-ports-43edb2d11b0377708a7c23ac5af6facafea351eb.tar.bz2
marcuscom-ports-43edb2d11b0377708a7c23ac5af6facafea351eb.tar.lz
marcuscom-ports-43edb2d11b0377708a7c23ac5af6facafea351eb.tar.xz
marcuscom-ports-43edb2d11b0377708a7c23ac5af6facafea351eb.tar.zst
marcuscom-ports-43edb2d11b0377708a7c23ac5af6facafea351eb.zip
Correct CPU count determination. server->ncpu needs to be one less than
the total numbers of CPUs. Don't bump PORTREVISION yet, as more testing needs to be done. git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@11654 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'devel/libgtop')
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_open.c11
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_sysinfo.c6
2 files changed, 8 insertions, 9 deletions
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_open.c b/devel/libgtop/files/patch-sysdeps_freebsd_open.c
index eee11421d..fa22cc8cf 100644
--- a/devel/libgtop/files/patch-sysdeps_freebsd_open.c
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_open.c
@@ -1,5 +1,5 @@
---- sysdeps/freebsd/open.c.orig 2008-09-29 13:44:47.000000000 -0400
-+++ sysdeps/freebsd/open.c 2008-09-29 13:49:37.000000000 -0400
+--- sysdeps/freebsd/open.c.orig 2008-05-23 18:13:23.000000000 -0400
++++ sysdeps/freebsd/open.c 2008-09-29 14:34:51.000000000 -0400
@@ -20,11 +20,14 @@
*/
@@ -15,7 +15,7 @@
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
void
-@@ -53,11 +56,18 @@ glibtop_open_p (glibtop *server, const c
+@@ -53,11 +56,17 @@ glibtop_open_p (glibtop *server, const c
const unsigned long features,
const unsigned flags)
{
@@ -28,9 +28,8 @@
/* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */
+ len = sizeof (ncpus);
+ sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0);
-+ server->ncpu = ncpus;
-+ /* XXX We should detect HTT CPUs here. */
-+ server->real_ncpu = ncpus;
++ server->real_ncpu = ncpus - 1;
++ server->ncpu = MIN(GLIBTOP_NCPU - 1, server->real_ncpu);
server->machine.uid = getuid ();
server->machine.euid = geteuid ();
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_sysinfo.c b/devel/libgtop/files/patch-sysdeps_freebsd_sysinfo.c
index 3d6026e4c..5166a1a98 100644
--- a/devel/libgtop/files/patch-sysdeps_freebsd_sysinfo.c
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_sysinfo.c
@@ -1,12 +1,12 @@
---- sysdeps/freebsd/sysinfo.c.orig 2008-09-29 13:44:45.000000000 -0400
-+++ sysdeps/freebsd/sysinfo.c 2008-09-29 13:50:06.000000000 -0400
+--- stsdeps/freebsd/sysinfo.c.orig 2008-05-23 18:13:23.000000000 -0400
++++ stsdeps/freebsd/sysinfo.c 2008-09-29 14:35:25.000000000 -0400
@@ -45,8 +45,8 @@ init_sysinfo (glibtop *server)
glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0);
- len = sizeof (ncpus);
- sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0);
-+ ncpus = server->ncpu;
++ ncpus = server->ncpu + 1;
+
len = 0;
sysctlbyname ("hw.model", NULL, &len, NULL, 0);