[libgtop/wip/diskio] Add dummy proc_diskio implementation for FreeBSD.



commit c29d7de9a087ff781be5463f4d9efc9a8f6abbe4
Author: Benoit Dejean <bdejean gmail com>
Date:   Sat Feb 25 16:30:18 2017 +0100

    Add dummy proc_diskio implementation for FreeBSD.

 sysdeps/freebsd/Makefile.am      |    1 +
 sysdeps/freebsd/glibtop_server.h |    1 +
 sysdeps/freebsd/procdiskio.c     |   43 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/sysdeps/freebsd/Makefile.am b/sysdeps/freebsd/Makefile.am
index 6bd1589..5d92dc0 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 d9ea12d..6d6b73f 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 0000000..ed82586
--- /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));
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]