pkgsrc/devel/libstatgrab/patches/patch-ac

88 lines
2.1 KiB
Text
Raw Normal View History

$NetBSD: patch-ac,v 1.3 2010/08/24 06:33:11 sno Exp $
2006-06-12 18:30:33 +02:00
--- src/libstatgrab/disk_stats.c.orig 2009-12-04 22:09:30.000000000 +0000
2006-06-12 18:30:33 +02:00
+++ src/libstatgrab/disk_stats.c
@@ -64,7 +64,9 @@
#include <sys/mount.h>
#endif
#if defined(FREEBSD) || defined(DFBSD)
+#if !defined(DFBSD)
#include <sys/dkstat.h>
+#endif
#include <devstat.h>
#include <sys/param.h>
#include <sys/mount.h>
@@ -457,7 +459,11 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
Update libstatgrab to 0.16. Pkgsrc changes: * try to fix build failure on recent NetBSD, reported in PR 41178. * set LICENSE=gnu-gpl-v2 * marked as DESTDIR ready libstatgrab NEWS: libstatgrab 0.16 (13 March 2008) * Fix saidar build on Solaris with Sun's compiler. * Add support for FreeBSD 8.0. * Fix build on "armel" Debian port. (Thanks to Riku Voipio and Martin Guy) * Fix statgrab-make-mrtg-config on machines with no swap. (Thanks to Tom Carlson) libstatgrab 0.15 (14 July 2007) * Fix breakages in memory stats on OpenBSD that were introduced in the last release. (Thanks to David Love) * Update internal string functions and some related cleanups. (Thanks to David Love) * Fix compile warning on FreeBSD. libstatgrab 0.14 (08 January 2007) * Fix memory stats on OpenBSD. * Add colour support to saidar. (Thanks to Angelina Carlton) * Fix CPU stats on Solaris - swap and iowait were incorrectly reported. * Fix kstat related memory leaks on Solaris. (Thanks to Javier Donaire) * Fix network stats on some unusual Solaris setups. * Fix process time_spent on Linux. (Thanks to Fred Barnes) * Make interface up status check the link status as well. (Thanks to Michelangelo Vassallo) * Fix build on NetBSD 3. (Thanks to Wijnand Wiersma) * Rework curses detection code in the configure script. * Fix bug that caused saidar to crash when the window was rapidly resized. libstatgrab 0.13 (19 March 2006) * Fix build problems with recent linux kernels. * Make saidar truncate disk/inteface/mount names to fit in display. * Add WIN32 support using MINGW (not widely tested). * Fix network interface up/down status on Solaris. * Add extern "C" to header file to make linking with C++ code easier. * Fix statgrab to cope with filesystem paths containing dots. * Make NFS a legal filesystem type on all platforms. * A few minor build fixes.
2009-05-16 13:46:08 +02:00
struct devstat *dev_ptr;
#endif
#ifdef NETBSD
+#ifdef HW_DISKSTATS
struct disk_sysctl *stats;
+#else
+ struct io_sysctl *stats;
+#endif
#endif
#ifdef OPENBSD
int diskcount;
@@ -604,9 +610,15 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
Update libstatgrab to 0.16. Pkgsrc changes: * try to fix build failure on recent NetBSD, reported in PR 41178. * set LICENSE=gnu-gpl-v2 * marked as DESTDIR ready libstatgrab NEWS: libstatgrab 0.16 (13 March 2008) * Fix saidar build on Solaris with Sun's compiler. * Add support for FreeBSD 8.0. * Fix build on "armel" Debian port. (Thanks to Riku Voipio and Martin Guy) * Fix statgrab-make-mrtg-config on machines with no swap. (Thanks to Tom Carlson) libstatgrab 0.15 (14 July 2007) * Fix breakages in memory stats on OpenBSD that were introduced in the last release. (Thanks to David Love) * Update internal string functions and some related cleanups. (Thanks to David Love) * Fix compile warning on FreeBSD. libstatgrab 0.14 (08 January 2007) * Fix memory stats on OpenBSD. * Add colour support to saidar. (Thanks to Angelina Carlton) * Fix CPU stats on Solaris - swap and iowait were incorrectly reported. * Fix kstat related memory leaks on Solaris. (Thanks to Javier Donaire) * Fix network stats on some unusual Solaris setups. * Fix process time_spent on Linux. (Thanks to Fred Barnes) * Make interface up status check the link status as well. (Thanks to Michelangelo Vassallo) * Fix build on NetBSD 3. (Thanks to Wijnand Wiersma) * Rework curses detection code in the configure script. * Fix bug that caused saidar to crash when the window was rapidly resized. libstatgrab 0.13 (19 March 2006) * Fix build problems with recent linux kernels. * Make saidar truncate disk/inteface/mount names to fit in display. * Add WIN32 support using MINGW (not widely tested). * Fix network interface up/down status on Solaris. * Add extern "C" to header file to make linking with C++ code easier. * Fix statgrab to cope with filesystem paths containing dots. * Make NFS a legal filesystem type on all platforms. * A few minor build fixes.
2009-05-16 13:46:08 +02:00
#if defined(NETBSD) || defined(OPENBSD)
mib[0] = CTL_HW;
+#ifdef HW_DISKSTATS
mib[1] = HW_DISKSTATS;
+#endif
#ifdef NETBSD
+#ifdef HW_DISKSTATS
mib[2] = sizeof(struct disk_sysctl);
+#else
+ mib[2] = sizeof(struct io_sysctl);
+#endif
#endif
if (sysctl(mib, MIBSIZE, NULL, &size, NULL, 0) < 0) {
@@ -615,8 +627,12 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
Update libstatgrab to 0.16. Pkgsrc changes: * try to fix build failure on recent NetBSD, reported in PR 41178. * set LICENSE=gnu-gpl-v2 * marked as DESTDIR ready libstatgrab NEWS: libstatgrab 0.16 (13 March 2008) * Fix saidar build on Solaris with Sun's compiler. * Add support for FreeBSD 8.0. * Fix build on "armel" Debian port. (Thanks to Riku Voipio and Martin Guy) * Fix statgrab-make-mrtg-config on machines with no swap. (Thanks to Tom Carlson) libstatgrab 0.15 (14 July 2007) * Fix breakages in memory stats on OpenBSD that were introduced in the last release. (Thanks to David Love) * Update internal string functions and some related cleanups. (Thanks to David Love) * Fix compile warning on FreeBSD. libstatgrab 0.14 (08 January 2007) * Fix memory stats on OpenBSD. * Add colour support to saidar. (Thanks to Angelina Carlton) * Fix CPU stats on Solaris - swap and iowait were incorrectly reported. * Fix kstat related memory leaks on Solaris. (Thanks to Javier Donaire) * Fix network stats on some unusual Solaris setups. * Fix process time_spent on Linux. (Thanks to Fred Barnes) * Make interface up status check the link status as well. (Thanks to Michelangelo Vassallo) * Fix build on NetBSD 3. (Thanks to Wijnand Wiersma) * Rework curses detection code in the configure script. * Fix bug that caused saidar to crash when the window was rapidly resized. libstatgrab 0.13 (19 March 2006) * Fix build problems with recent linux kernels. * Make saidar truncate disk/inteface/mount names to fit in display. * Add WIN32 support using MINGW (not widely tested). * Fix network interface up/down status on Solaris. * Add extern "C" to header file to make linking with C++ code easier. * Fix statgrab to cope with filesystem paths containing dots. * Make NFS a legal filesystem type on all platforms. * A few minor build fixes.
2009-05-16 13:46:08 +02:00
}
#ifdef NETBSD
+#ifdef HW_DISKSTATS
num_disks = size / sizeof(struct disk_sysctl);
#else
+ num_disks = size / sizeof(struct io_sysctl);
+#endif
+#else
num_disks = size / sizeof(struct diskstats);
#endif
@@ -635,6 +651,7 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
Update libstatgrab to 0.16. Pkgsrc changes: * try to fix build failure on recent NetBSD, reported in PR 41178. * set LICENSE=gnu-gpl-v2 * marked as DESTDIR ready libstatgrab NEWS: libstatgrab 0.16 (13 March 2008) * Fix saidar build on Solaris with Sun's compiler. * Add support for FreeBSD 8.0. * Fix build on "armel" Debian port. (Thanks to Riku Voipio and Martin Guy) * Fix statgrab-make-mrtg-config on machines with no swap. (Thanks to Tom Carlson) libstatgrab 0.15 (14 July 2007) * Fix breakages in memory stats on OpenBSD that were introduced in the last release. (Thanks to David Love) * Update internal string functions and some related cleanups. (Thanks to David Love) * Fix compile warning on FreeBSD. libstatgrab 0.14 (08 January 2007) * Fix memory stats on OpenBSD. * Add colour support to saidar. (Thanks to Angelina Carlton) * Fix CPU stats on Solaris - swap and iowait were incorrectly reported. * Fix kstat related memory leaks on Solaris. (Thanks to Javier Donaire) * Fix network stats on some unusual Solaris setups. * Fix process time_spent on Linux. (Thanks to Fred Barnes) * Make interface up status check the link status as well. (Thanks to Michelangelo Vassallo) * Fix build on NetBSD 3. (Thanks to Wijnand Wiersma) * Rework curses detection code in the configure script. * Fix bug that caused saidar to crash when the window was rapidly resized. libstatgrab 0.13 (19 March 2006) * Fix build problems with recent linux kernels. * Make saidar truncate disk/inteface/mount names to fit in display. * Add WIN32 support using MINGW (not widely tested). * Fix network interface up/down status on Solaris. * Add extern "C" to header file to make linking with C++ code easier. * Fix statgrab to cope with filesystem paths containing dots. * Make NFS a legal filesystem type on all platforms. * A few minor build fixes.
2009-05-16 13:46:08 +02:00
u_int64_t rbytes, wbytes;
#ifdef NETBSD
+#ifdef HW_DISKSTATS
#ifdef HAVE_DK_RBYTES
rbytes = stats[i].dk_rbytes;
wbytes = stats[i].dk_wbytes;
@@ -643,6 +660,10 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
Update libstatgrab to 0.16. Pkgsrc changes: * try to fix build failure on recent NetBSD, reported in PR 41178. * set LICENSE=gnu-gpl-v2 * marked as DESTDIR ready libstatgrab NEWS: libstatgrab 0.16 (13 March 2008) * Fix saidar build on Solaris with Sun's compiler. * Add support for FreeBSD 8.0. * Fix build on "armel" Debian port. (Thanks to Riku Voipio and Martin Guy) * Fix statgrab-make-mrtg-config on machines with no swap. (Thanks to Tom Carlson) libstatgrab 0.15 (14 July 2007) * Fix breakages in memory stats on OpenBSD that were introduced in the last release. (Thanks to David Love) * Update internal string functions and some related cleanups. (Thanks to David Love) * Fix compile warning on FreeBSD. libstatgrab 0.14 (08 January 2007) * Fix memory stats on OpenBSD. * Add colour support to saidar. (Thanks to Angelina Carlton) * Fix CPU stats on Solaris - swap and iowait were incorrectly reported. * Fix kstat related memory leaks on Solaris. (Thanks to Javier Donaire) * Fix network stats on some unusual Solaris setups. * Fix process time_spent on Linux. (Thanks to Fred Barnes) * Make interface up status check the link status as well. (Thanks to Michelangelo Vassallo) * Fix build on NetBSD 3. (Thanks to Wijnand Wiersma) * Rework curses detection code in the configure script. * Fix bug that caused saidar to crash when the window was rapidly resized. libstatgrab 0.13 (19 March 2006) * Fix build problems with recent linux kernels. * Make saidar truncate disk/inteface/mount names to fit in display. * Add WIN32 support using MINGW (not widely tested). * Fix network interface up/down status on Solaris. * Add extern "C" to header file to make linking with C++ code easier. * Fix statgrab to cope with filesystem paths containing dots. * Make NFS a legal filesystem type on all platforms. * A few minor build fixes.
2009-05-16 13:46:08 +02:00
rbytes = wbytes = stats[i].dk_bytes;
#endif
#else
+ rbytes = stats[i].rbytes;
+ wbytes = stats[i].wbytes;
+#endif
+#else
#ifdef HAVE_DS_RBYTES
rbytes = stats[i].ds_rbytes;
wbytes = stats[i].ds_wbytes;
@@ -665,8 +686,12 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
Update libstatgrab to 0.16. Pkgsrc changes: * try to fix build failure on recent NetBSD, reported in PR 41178. * set LICENSE=gnu-gpl-v2 * marked as DESTDIR ready libstatgrab NEWS: libstatgrab 0.16 (13 March 2008) * Fix saidar build on Solaris with Sun's compiler. * Add support for FreeBSD 8.0. * Fix build on "armel" Debian port. (Thanks to Riku Voipio and Martin Guy) * Fix statgrab-make-mrtg-config on machines with no swap. (Thanks to Tom Carlson) libstatgrab 0.15 (14 July 2007) * Fix breakages in memory stats on OpenBSD that were introduced in the last release. (Thanks to David Love) * Update internal string functions and some related cleanups. (Thanks to David Love) * Fix compile warning on FreeBSD. libstatgrab 0.14 (08 January 2007) * Fix memory stats on OpenBSD. * Add colour support to saidar. (Thanks to Angelina Carlton) * Fix CPU stats on Solaris - swap and iowait were incorrectly reported. * Fix kstat related memory leaks on Solaris. (Thanks to Javier Donaire) * Fix network stats on some unusual Solaris setups. * Fix process time_spent on Linux. (Thanks to Fred Barnes) * Make interface up status check the link status as well. (Thanks to Michelangelo Vassallo) * Fix build on NetBSD 3. (Thanks to Wijnand Wiersma) * Rework curses detection code in the configure script. * Fix bug that caused saidar to crash when the window was rapidly resized. libstatgrab 0.13 (19 March 2006) * Fix build problems with recent linux kernels. * Make saidar truncate disk/inteface/mount names to fit in display. * Add WIN32 support using MINGW (not widely tested). * Fix network interface up/down status on Solaris. * Add extern "C" to header file to make linking with C++ code easier. * Fix statgrab to cope with filesystem paths containing dots. * Make NFS a legal filesystem type on all platforms. * A few minor build fixes.
2009-05-16 13:46:08 +02:00
diskio_stats_ptr->read_bytes = rbytes;
diskio_stats_ptr->write_bytes = wbytes;
#ifdef NETBSD
+#ifdef HAVE_DISKSTATS
name = stats[i].dk_name;
#else
+ name = stats[i].name;
+#endif
+#else
name = dk_name[i];
#endif
if (sg_update_string(&diskio_stats_ptr->disk_name, name) < 0) {