Fix filesystem read/write accounting on OpenBSD

https://bugzilla.gnome.org/show_bug.cgi?id=652980
This commit is contained in:
Jasper Lievisse Adriaanse
2011-06-22 17:24:37 +02:00
parent cecf53394b
commit 93829c8cbb
2 changed files with 13 additions and 4 deletions

View File

@@ -149,6 +149,15 @@ _glibtop_freebsd_get_fsusage_read_write(glibtop *server,
#define _glibtop_get_fsusage_read_write(S, B, P) \
_glibtop_freebsd_get_fsusage_read_write(S, B, P)
#elif defined(__OpenBSD__)
void
_glibtop_openbsd_get_fsusage_read_write(glibtop *server,
glibtop_fsusage *buf,
const char *path);
#define _glibtop_get_fsusage_read_write(S, B, P) \
_glibtop_openbsd_get_fsusage_read_write(S, B, P)
#else /* default fallback */
#warning glibtop_get_fsusage .read .write are not implemented.
static inline void
@@ -270,7 +279,7 @@ glibtop_get_fsusage_s (glibtop *server, glibtop_fsusage *buf,
return;
#if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)) \
|| defined(__FreeBSD__)
|| defined(__FreeBSD__) || defined(__OpenBSD__)
/* Solaris but not SunOS and FreeBSD */
buf->block_size = fsd.f_frsize;
#else

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: fsusage.c,v 1.3 2011/05/23 19:35:53 jasper Exp $ */
/* $OpenBSD: fsusage.c,v 1.4 2011/05/31 19:25:31 jasper Exp $ */
#include <config.h>
@@ -31,12 +31,12 @@
#include <stdlib.h>
void
_glibtop_bsd_get_fsusage_read_write(glibtop *server,
_glibtop_openbsd_get_fsusage_read_write(glibtop *server,
glibtop_fsusage *buf,
const char *path);
void
_glibtop_bsd_get_fsusage_read_write(glibtop *server,
_glibtop_openbsd_get_fsusage_read_write(glibtop *server,
glibtop_fsusage *buf,
const char *path)
{