Menu

[r5552]: / experimental / net-snmp / files / patch-disk.c  Maximize  Restore  History

Download this file

32 lines (31 with data), 892 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- agent/mibgroup/ucd-snmp/disk.c.orig 2008-07-05 22:11:22.366362753 +0900
+++ agent/mibgroup/ucd-snmp/disk.c 2008-07-06 00:32:19.611196878 +0900
@@ -73,6 +73,9 @@
#if HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
+#if defined(__FreeBSD__) && __FreeBSD_version >= 700055
+#include <sys/ucred.h>
+#endif
#if defined(HAVE_STATFS)
#if HAVE_SYS_MOUNT_H
#include <sys/mount.h>
@@ -491,6 +494,18 @@
dummy = 1;
}
endfsent(); /* close /etc/fstab */
+#if defined(__FreeBSD__) && __FreeBSD_version >= 700055
+ {
+ struct statfs *mntbuf;
+ size_t i, mntsize;
+ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
+ for (i = 0; i < mntsize; i++) {
+ if (strncmp(mntbuf[i].f_fstypename, "zfs", 3) == 0) {
+ add_device(mntbuf[i].f_mntonname, mntbuf[i].f_mntfromname, -1, minpercent, 0);
+ }
+ }
+ }
+#endif
if(dummy != 0) {
/*
* dummy clause for else below
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.