2005-12-12 James Henstridge <james@jamesh.id.au> * doc/auto-macros.texi.in: remove unused file. * doc/libgtop2.texi: don't include auto-macros.texi. * doc/Makefile.am: don't build auto-macros.texi, since none of its macros are used in the documentation any more. * include/glibtop/global.h: don't include <config.h> from headers. * .../*.c: make sure <config.h> is the first thing included. * acinclude.m4: m4_include() libgtop-sysdeps.m4 rather than inlining it. * acinclude.m4, libgtop-sysdeps.m4: use third argument to AC_DEFINE() to set the comment. * configure.in: modernise a bit. * acconfig.h: remove file, since it is deprecated * autogen.sh: require automake 1.9 instead of 1.4.
43 lines
831 B
C
43 lines
831 B
C
#include <config.h>
|
|
#include <glibtop.h>
|
|
#include <glibtop/error.h>
|
|
#include <glibtop/fsusage.h>
|
|
|
|
#include <glibtop_suid.h>
|
|
|
|
#include <glib.h>
|
|
|
|
#include <unistd.h>
|
|
#include <sys/param.h>
|
|
#include <sys/mount.h>
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
void
|
|
G_GNUC_INTERNAL
|
|
_glibtop_freebsd_get_fsusage_read_write(glibtop *server,
|
|
glibtop_fsusage *buf,
|
|
const char *path);
|
|
|
|
void G_GNUC_INTERNAL
|
|
_glibtop_freebsd_get_fsusage_read_write(glibtop *server,
|
|
glibtop_fsusage *buf,
|
|
const char *path)
|
|
{
|
|
int result;
|
|
struct statfs sfs;
|
|
|
|
result = statfs (path, &sfs);
|
|
|
|
if (result == -1) {
|
|
return;
|
|
}
|
|
|
|
buf->read = sfs.f_syncreads + sfs.f_asyncreads;
|
|
buf->write = sfs.f_syncwrites + sfs.f_asyncwrites;
|
|
|
|
buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
|
|
}
|