diff options
Diffstat (limited to 'sysutils/gkrellm/patches/patch-ab')
-rw-r--r-- | sysutils/gkrellm/patches/patch-ab | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/sysutils/gkrellm/patches/patch-ab b/sysutils/gkrellm/patches/patch-ab index a286ce9ef90..677aacae15a 100644 --- a/sysutils/gkrellm/patches/patch-ab +++ b/sysutils/gkrellm/patches/patch-ab @@ -1,8 +1,27 @@ -$NetBSD: patch-ab,v 1.12 2004/06/07 17:28:44 cube Exp $ +$NetBSD: patch-ab,v 1.13 2004/07/05 08:42:27 cube Exp $ --- src/sysdeps/netbsd.c.orig 2004-05-01 19:46:38.000000000 +0200 +++ src/sysdeps/netbsd.c -@@ -109,41 +109,35 @@ get_ncpus(void) +@@ -63,7 +63,8 @@ gkrellm_sys_cpu_read_data(void) + { + static int mib[] = { CTL_KERN, KERN_CP_TIME }; + u_int64_t cp_time[ncpus][CPUSTATES]; +- int len, n; ++ int n; ++ size_t len; + + if (ncpus > 1) { + len = sizeof(cp_time[0]); +@@ -94,7 +95,7 @@ get_ncpus(void) + { + static int mib[] = { CTL_HW, HW_NCPU }; + int ncpus; +- int len = sizeof(int); ++ size_t len = sizeof(int); + + if (sysctl(mib, 2, &ncpus, &len, NULL, 0) < 0) + return 1; +@@ -109,41 +110,35 @@ get_ncpus(void) #include <sys/proc.h> #include <sys/sysctl.h> #include <uvm/uvm_extern.h> @@ -30,16 +49,6 @@ $NetBSD: patch-ab,v 1.12 2004/06/07 17:28:44 cube Exp $ - - if (sysctl(mib, 3, NULL, &len, NULL, 0) >= 0) { - n_processes = len / sizeof(struct kinfo_proc); -- } -- -- /* get name list if it is not done yet */ -- if (kvmd == NULL) return; -- if (nl[0].n_type == 0) kvm_nlist(kvmd, nl); -- -- if (nl[0].n_type != 0) { -- uvmexp = (struct uvmexp *)nl[X_UVM_EXP].n_value; -- if (kvm_read(kvmd, (u_long)&uvmexp->forks, &i, sizeof(i)) == sizeof(i)) -- n_forks = i; + guint n_forks = 0, n_processes = 0; + struct uvmexp_sysctl uvmexp; + size_t size; @@ -54,17 +63,26 @@ $NetBSD: patch-ab,v 1.12 2004/06/07 17:28:44 cube Exp $ + n_processes = size / sizeof(struct kinfo_proc2); } +- /* get name list if it is not done yet */ +- if (kvmd == NULL) return; +- if (nl[0].n_type == 0) kvm_nlist(kvmd, nl); +- +- if (nl[0].n_type != 0) { +- uvmexp = (struct uvmexp *)nl[X_UVM_EXP].n_value; +- if (kvm_read(kvmd, (u_long)&uvmexp->forks, &i, sizeof(i)) == sizeof(i)) +- n_forks = i; + mib[0] = CTL_VM; + mib[1] = VM_UVMEXP2; + size = sizeof(uvmexp); + if (sysctl(mib, 2, &uvmexp, &size, NULL, 0) >= 0) { + n_forks = uvmexp.forks; -+ } + } +- + if (getloadavg(&avenrun, 1) <= 0) avenrun = 0; gkrellm_proc_assign_data(n_processes, 0, n_forks, avenrun); -@@ -183,6 +177,97 @@ gkrellm_sys_proc_init(void) +@@ -183,6 +178,97 @@ gkrellm_sys_proc_init(void) /* ===================================================================== */ @@ -162,7 +180,7 @@ $NetBSD: patch-ab,v 1.12 2004/06/07 17:28:44 cube Exp $ /* Sensor monitor interface */ /* Tables of voltage correction factors and offsets derived from the -@@ -295,7 +380,7 @@ gkrellm_sys_sensors_init(void) +@@ -295,7 +381,7 @@ gkrellm_sys_sensors_init(void) int fd; /* file desc. for /dev/sysmon */ int id = 0; /* incremented for each sensor */ int type; @@ -171,7 +189,7 @@ $NetBSD: patch-ab,v 1.12 2004/06/07 17:28:44 cube Exp $ gboolean found_sensors = FALSE; /* check if some sensor is configured */ -@@ -336,3 +421,68 @@ gkrellm_sys_sensors_init(void) +@@ -336,3 +422,68 @@ gkrellm_sys_sensors_init(void) return found_sensors; } |