summaryrefslogtreecommitdiff
path: root/sysutils/libgtop2/patches/patch-ad
blob: 8fd30adfccb922b2a7aebf0394e12c0a4fee72fa (plain)
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
32
33
34
35
36
37
38
$NetBSD: patch-ad,v 1.1 2005/03/22 16:03:37 jmmv Exp $

--- sysdeps/freebsd/fsusage.c.orig	2005-02-28 09:54:41.000000000 +0100
+++ sysdeps/freebsd/fsusage.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <glibtop.h>
 #include <glibtop/error.h>
 #include <glibtop/fsusage.h>
@@ -9,6 +13,9 @@
 #include <unistd.h>
 #include <sys/param.h>
 #include <sys/mount.h>
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
 
 #include <stdio.h>
 #include <string.h>
@@ -26,9 +33,15 @@ _glibtop_freebsd_get_fsusage_read_write(
 				      const char *path)
 {
 	int result;
+#ifdef STAT_STATVFS
+	struct statvfs sfs;
+
+	result = statvfs (path, &sfs);
+#else
 	struct statfs sfs;
 
 	result = statfs (path, &sfs);
+#endif
 
 	if (result == -1) {
 		return;