Make this compile again.
This commit is contained in:
parent
711838a579
commit
65ee1e9f17
2 changed files with 77 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
$NetBSD: distinfo,v 1.16 2006/03/14 15:48:01 rillig Exp $
|
||||
$NetBSD: distinfo,v 1.17 2006/06/05 02:35:30 christos Exp $
|
||||
|
||||
SHA1 (xosview-1.8.3.tar.gz) = 420fd0620ff9fb9ba83fc833eeb8b872414e377e
|
||||
RMD160 (xosview-1.8.3.tar.gz) = 595e812dee686ccaa5d95eb537782679d752271b
|
||||
Size (xosview-1.8.3.tar.gz) = 259793 bytes
|
||||
SHA1 (patch-aa) = 094b0fc6e27b8ea92bcd0e0040e7d211395ed97e
|
||||
|
|
75
sysutils/xosview/patches/patch-aa
Normal file
75
sysutils/xosview/patches/patch-aa
Normal file
|
@ -0,0 +1,75 @@
|
|||
$NetBSD: patch-aa,v 1.13 2006/06/05 02:35:30 christos Exp $
|
||||
|
||||
--- bsd/kernel.cc.orig 2006-06-04 22:19:00.000000000 -0400
|
||||
+++ bsd/kernel.cc 2006-06-04 22:31:47.000000000 -0400
|
||||
@@ -21,6 +21,8 @@
|
||||
/* NetBSD pulls in stdio.h via one of the other includes, but
|
||||
* the other BSDs don't. */
|
||||
# include <stdio.h>
|
||||
+#else
|
||||
+# define UVM
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
@@ -115,6 +117,13 @@
|
||||
// in __NetBSD_Version__ for us if needed.
|
||||
#if defined(XOSVIEW_NETBSD) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106010000)
|
||||
#define NETBSD_1_6A
|
||||
+#ifdef HW_DISKSTATS
|
||||
+static int dmib[3] = {CTL_HW, HW_DISKSTATS, sizeof(struct disk_sysctl)};
|
||||
+#endif
|
||||
+#ifdef HW_IOSTATS
|
||||
+static int dmib[3] = {CTL_HW, HW_IOSTATS, sizeof(struct io_sysctl)};
|
||||
+#include <sys/iostat.h>
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#include "general.h"
|
||||
@@ -773,13 +782,12 @@
|
||||
#ifdef NETBSD_1_6A
|
||||
// Do a sysctl with a NULL data pointer to get the size that would
|
||||
// have been returned, and use that to figure out # drives.
|
||||
- int mib[3] = {CTL_HW, HW_DISKSTATS, sizeof(struct disk_sysctl)};
|
||||
size_t size;
|
||||
- if (sysctl(mib, 3, NULL, &size, NULL, 0) < 0) {
|
||||
+ if (sysctl(dmib, 3, NULL, &size, NULL, 0) < 0) {
|
||||
warnx("!!! The DiskMeter sysctl failed. Disabling DiskMeter.");
|
||||
return 0;
|
||||
}
|
||||
- NetBSD_N_Drives = size / sizeof(struct disk_sysctl);
|
||||
+ NetBSD_N_Drives = size / dmib[2];
|
||||
return 1;
|
||||
#endif
|
||||
return ValidSymbol(DISKLIST_SYM_INDEX);
|
||||
@@ -816,19 +824,28 @@
|
||||
#else
|
||||
#if defined(NETBSD_1_6A)
|
||||
// Use the new sysctl to do this for us.
|
||||
- int mib[3] = {CTL_HW, HW_DISKSTATS, sizeof(struct disk_sysctl)};
|
||||
- size_t sysctl_sz = NetBSD_N_Drives * sizeof(struct disk_sysctl);
|
||||
+ size_t sysctl_sz = NetBSD_N_Drives * dmib[2];
|
||||
+#ifdef HW_DISKSTATS
|
||||
struct disk_sysctl drive_stats[NetBSD_N_Drives];
|
||||
+#endif
|
||||
+#ifdef HW_IOSTATS
|
||||
+ struct io_sysctl drive_stats[NetBSD_N_Drives];
|
||||
+#endif
|
||||
|
||||
// Do the sysctl.
|
||||
- if (sysctl(mib, 3, drive_stats, &sysctl_sz, NULL, 0) < 0) {
|
||||
+ if (sysctl(dmib, 3, drive_stats, &sysctl_sz, NULL, 0) < 0) {
|
||||
err(1, "sysctl hw.diskstats failed");
|
||||
}
|
||||
|
||||
// Now accumulate the total.
|
||||
unsigned long long xferred = 0;
|
||||
for (unsigned int i = 0; i < NetBSD_N_Drives; i++) {
|
||||
+#ifdef HW_DISKSTATS
|
||||
xferred += drive_stats[i].dk_rbytes + drive_stats[i].dk_wbytes;
|
||||
+#endif
|
||||
+#ifdef HW_IOSTATS
|
||||
+ xferred += drive_stats[i].rbytes + drive_stats[i].wbytes;
|
||||
+#endif
|
||||
}
|
||||
*bytesXferred = xferred;
|
||||
#else
|
Loading…
Reference in a new issue