summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Dejean <bdejean@gmail.com>2017-02-25 16:30:18 +0100
committerBenoit Dejean <bdejean@gmail.com>2017-02-25 16:30:18 +0100
commitc29d7de9a087ff781be5463f4d9efc9a8f6abbe4 (patch)
treee17ebfdc7044fae590fe4d5810e70f4e36efa3f4
parent07abbd2dfe5c734cbeadc27e17196c4b1d3a7188 (diff)
downloadlibgtop-c29d7de9a087ff781be5463f4d9efc9a8f6abbe4.tar.gz
Add dummy proc_diskio implementation for FreeBSD.
-rw-r--r--sysdeps/freebsd/Makefile.am1
-rw-r--r--sysdeps/freebsd/glibtop_server.h1
-rw-r--r--sysdeps/freebsd/procdiskio.c43
3 files changed, 45 insertions, 0 deletions
diff --git a/sysdeps/freebsd/Makefile.am b/sysdeps/freebsd/Makefile.am
index 6bd15894..5d92dc0d 100644
--- a/sysdeps/freebsd/Makefile.am
+++ b/sysdeps/freebsd/Makefile.am
@@ -16,6 +16,7 @@ libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c close.c swap.c \
proclist.c procstate.c procuid.c \
proctime.c procmem.c procsignal.c \
prockernel.c procsegment.c procargs.c \
+ procdiskio.c \
procmap.c netload.c ppp.c
libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
diff --git a/sysdeps/freebsd/glibtop_server.h b/sysdeps/freebsd/glibtop_server.h
index d9ea12d6..6d6b73f9 100644
--- a/sysdeps/freebsd/glibtop_server.h
+++ b/sysdeps/freebsd/glibtop_server.h
@@ -47,6 +47,7 @@ G_BEGIN_DECLS
#define GLIBTOP_SUID_NETLIST 0
#define GLIBTOP_SUID_PROC_WD 0
#define GLIBTOP_SUID_PROC_AFFINITY 0
+#define GLIBTOP_SUID_PROC_DISKIO (1 << GLIBTOP_SYSDEPS_PROC_DISKIO)
G_END_DECLS
diff --git a/sysdeps/freebsd/procdiskio.c b/sysdeps/freebsd/procdiskio.c
new file mode 100644
index 00000000..ed825861
--- /dev/null
+++ b/sysdeps/freebsd/procdiskio.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2017 Robert Roth
+ This file is part of LibGTop.
+
+ Contributed by Robert Roth <robert.roth.off@gmail.com>, February 2017.
+
+ LibGTop is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ LibGTop is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with LibGTop; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <config.h>
+#include <glibtop.h>
+#include <glibtop/procdiskio.h>
+
+static const unsigned long _glibtop_sysdeps_proc_diskio = 0;
+
+/* Init function. */
+
+void
+_glibtop_init_proc_diskio_p (glibtop *server)
+{
+ server->sysdeps.proc_diskio = _glibtop_sysdeps_proc_diskio;
+}
+
+/* Provides detailed information about a process. */
+
+void
+glibtop_get_proc_diskio_p (glibtop *server, glibtop_proc_diskio *buf,
+ pid_t pid)
+{
+ memset (buf, 0, sizeof (glibtop_proc_diskio));
+}