$NetBSD: patch-ad,v 1.2 2005/03/27 11:18: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 +#endif + #include #include #include @@ -9,6 +13,9 @@ #include #include #include +#ifdef HAVE_SYS_STATVFS_H +#include +#endif #include #include @@ -26,16 +33,26 @@ _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; } +#ifdef HAVE_STATVFS_READS_COUNT buf->read = sfs.f_syncreads + sfs.f_asyncreads; + buf->flags |= (1 << GLIBTOP_FSUSAGE_READ); +#endif +#ifdef HAVE_STATVFS_WRITES_COUNT buf->write = sfs.f_syncwrites + sfs.f_asyncwrites; - - buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE); + buf->flags |= (1 << GLIBTOP_FSUSAGE_WRITE); +#endif }