diff options
Diffstat (limited to 'sysutils/xosview/patches/patch-ad')
-rw-r--r-- | sysutils/xosview/patches/patch-ad | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/sysutils/xosview/patches/patch-ad b/sysutils/xosview/patches/patch-ad deleted file mode 100644 index 871e6302e8c..00000000000 --- a/sysutils/xosview/patches/patch-ad +++ /dev/null @@ -1,85 +0,0 @@ -$NetBSD: patch-ad,v 1.6 2002/12/11 21:38:06 christos Exp $ - ---- bsd/kernel.cc.orig Tue Feb 16 09:09:21 1999 -+++ bsd/kernel.cc Wed Dec 11 16:34:46 2002 -@@ -30,6 +30,10 @@ - #include <errno.h> - #include <sys/dkstat.h> /* For CPUSTATES, which tells us how - many cpu states there are. */ -+#if defined(XOSVIEW_NETBSD) && !defined(CPUSTATES) -+#include <sys/sched.h> -+#endif -+ - #ifndef XOSVIEW_FREEBSD - #include <sys/disk.h> /* For disk statistics. */ - #endif -@@ -60,14 +64,22 @@ - #include <sys/malloc.h> - #include <sys/sysctl.h> - #include <sys/device.h> -+#if defined(__NetBSD_Version__) && __NetBSD_Version__ > 105010000 /* > 1.5A */ -+#include <uvm/uvm.h> -+#else - #include <vm/vm.h> /* XXX Is this needed? */ -+#endif - #else - #include <sys/vmmeter.h> /* For struct vmmeter. */ - #endif - - #ifdef HAVE_SWAPCTL - #include <unistd.h> /* For swapctl proto. */ --#include <vm/vm_swap.h> /* For swapent, SWAP_*. */ -+#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104000000 -+#include <sys/swap.h> /* For swapent, SWAP_*. */ -+#else -+#include <vm/vm_swap.h> -+#endif - #include <stdlib.h> /* For malloc(), free(). */ - #endif - -@@ -85,7 +97,11 @@ - // This struct has the list of all the symbols we want from the kernel. - static struct nlist nlst[] = - { -+#if defined(__NetBSD_Version__) && __NetBSD_Version__ > 104260000 /* > 1.4Z */ -+{ "_ifnet" }, /* XXX: LZ! Don't renumber */ -+#else - { "_cp_time" }, -+#endif - #define CP_TIME_SYM_INDEX 0 - { "_ifnet" }, - #define IFNET_SYM_INDEX 1 -@@ -293,7 +309,21 @@ - if (!timeArray) errx (-1, "BSDGetCPUTimes(): passed pointer was null!\n"); - if (CPUSTATES != 5) - errx (-1, "Error: xosview for *BSD expects 5 cpu states!\n"); -+#if defined(__NetBSD_Version__) && __NetBSD_Version__ > 104260000 /* > 1.4Z */ -+ int mib[2]; -+ struct schedstate_percpu ssp; -+ size_t size = sizeof(ssp.spc_cp_time); -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_CP_TIME; -+ if (sysctl(mib, 2, ssp.spc_cp_time, &size, NULL, 0) < 0) { -+ printf("can't get schedstate_percpu: %s\n", strerror(errno)); -+ memset(&ssp, 0, sizeof(ssp)); -+ } -+ for (size = 0; size < CPUSTATES; size++) -+ timeArray[size] = (long) ssp.spc_cp_time[size]; -+#else - safe_kvm_read_symbol (CP_TIME_SYM_INDEX, timeArray, sizeof (long) * CPUSTATES); -+#endif - } - - -@@ -651,7 +681,11 @@ - while (kvmdiskptr != NULL) { - safe_kvm_read ((u_long)kvmdiskptr, &kvmcurrdisk, sizeof(kvmcurrdisk)); - /* Add up the contribution from this disk. */ -+#if defined(__NetBSD_Version__) && __NetBSD_Version__ > 106070000 /* > 1.6G */ -+ *bytesXferred += kvmcurrdisk.dk_rbytes + kvmcurrdisk.dk_wbytes; -+#else - *bytesXferred += kvmcurrdisk.dk_bytes; -+#endif - #ifdef DEBUG - printf ("Got %#x (lower 32bits)\n", (int) (*bytesXferred & 0xffffffff)); - #endif |