Use statvfs(2) if available instead of statfs(2). The latter was replaced
2006-04-04 Julio M. Merino Vidal <jmmv@NetBSD.org> * sysdeps/freebsd/fsusage.c: Use statvfs(2) if available instead of statfs(2). The latter was replaced by the former and is no longer available under, e.g. NetBSD. Fixes bug #337235.
This commit is contained in:
committed by
Benoît Dejean
parent
26d85d02fb
commit
cead508eae
@@ -1,3 +1,12 @@
|
|||||||
|
2006-04-04 Julio M. Merino Vidal <jmmv@NetBSD.org>
|
||||||
|
|
||||||
|
* sysdeps/freebsd/fsusage.c:
|
||||||
|
|
||||||
|
Use statvfs(2) if available instead of statfs(2). The latter was
|
||||||
|
replaced by the former and is no longer available under, e.g. NetBSD.
|
||||||
|
|
||||||
|
Fixes bug #337235.
|
||||||
|
|
||||||
2006-04-04 Benoît Dejean <benoit@placenet.org>
|
2006-04-04 Benoît Dejean <benoit@placenet.org>
|
||||||
|
|
||||||
* sysinfo.c: (init_sysinfo):
|
* sysinfo.c: (init_sysinfo):
|
||||||
|
@@ -9,7 +9,11 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#if defined (HAVE_SYS_STATVFS_H)
|
||||||
|
#include <sys/statvfs.h>
|
||||||
|
#else
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -27,9 +31,17 @@ _glibtop_freebsd_get_fsusage_read_write(glibtop *server,
|
|||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
#if defined (STAT_STATVFS)
|
||||||
|
struct statvfs sfs;
|
||||||
|
#else
|
||||||
struct statfs sfs;
|
struct statfs sfs;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (STAT_STATVFS)
|
||||||
result = statfs (path, &sfs);
|
result = statfs (path, &sfs);
|
||||||
|
#else
|
||||||
|
result = statfs (path, &sfs);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (result == -1) {
|
if (result == -1) {
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user