summaryrefslogtreecommitdiff
path: root/sysdeps/bsd
diff options
context:
space:
mode:
authorToMe25 <ToMe25@gmx.de>2021-04-24 14:58:33 +0200
committerToMe25 <ToMe25@gmx.de>2021-04-24 14:58:33 +0200
commit24555c48d05a1f0a84e5258a9afe86bd2dbdd441 (patch)
tree00d01e2f7c29774041511a03a72ed53ff8a15a87 /sysdeps/bsd
parentb51925dbd9fca8b7d570d16cab8565b2fd99127b (diff)
downloadlibgtop-24555c48d05a1f0a84e5258a9afe86bd2dbdd441.tar.gz
Copy stub sysdeps files to other OS impls to reduce compile errors.
Diffstat (limited to 'sysdeps/bsd')
-rw-r--r--sysdeps/bsd/Makefile.am2
-rw-r--r--sysdeps/bsd/disk.c42
-rw-r--r--sysdeps/bsd/glibtop_server.h3
-rw-r--r--sysdeps/bsd/procio.c43
4 files changed, 89 insertions, 1 deletions
diff --git a/sysdeps/bsd/Makefile.am b/sysdeps/bsd/Makefile.am
index a6692376..1b973987 100644
--- a/sysdeps/bsd/Makefile.am
+++ b/sysdeps/bsd/Makefile.am
@@ -10,7 +10,7 @@ libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS)
libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
uptime.c loadavg.c shm_limits.c msg_limits.c \
- sem_limits.c procaffinity.c \
+ sem_limits.c disk.c procaffinity.c procio.c \
proclist.c procstate.c procuid.c \
proctime.c procmem.c procsignal.c prockernel.c \
procsegment.c procargs.c procmap.c netlist.c \
diff --git a/sysdeps/bsd/disk.c b/sysdeps/bsd/disk.c
new file mode 100644
index 00000000..a946fdf5
--- /dev/null
+++ b/sysdeps/bsd/disk.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1998-99 Martin Baulig
+ This file is part of LibGTop 1.0.
+
+ Contributed by James Dominic P. Guana <guana.histark@gmail.com>, May 2020.
+
+ 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/disk.h>
+
+static const unsigned long _glibtop_sysdeps_disk = 0;
+
+/* Init function. */
+
+void
+_glibtop_init_disk_s (glibtop *server)
+{
+ server->sysdeps.disk = _glibtop_sysdeps_disk;
+}
+
+/* Provides information about disk usage. */
+
+void
+glibtop_get_disk_s (glibtop *server, glibtop_disk *buf)
+{
+ memset (buf, 0, sizeof (glibtop_disk));
+}
diff --git a/sysdeps/bsd/glibtop_server.h b/sysdeps/bsd/glibtop_server.h
index ca4dde05..4e5fe35e 100644
--- a/sysdeps/bsd/glibtop_server.h
+++ b/sysdeps/bsd/glibtop_server.h
@@ -25,6 +25,7 @@
G_BEGIN_DECLS
#define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU)
+#define GLIBTOP_SUID_DISK 0
#define GLIBTOP_SUID_MEM (1 << GLIBTOP_SYSDEPS_MEM)
#define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP)
#define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME)
@@ -47,6 +48,8 @@ G_BEGIN_DECLS
#define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP)
#define GLIBTOP_SUID_PROC_WD 0
#define GLIBTOP_SUID_PROC_AFFINITY 0
+#define GLIBTOP_SUID_PROC_OPEN_FILES 0
+#define GLIBTOP_SUID_PROC_IO 0
G_END_DECLS
diff --git a/sysdeps/bsd/procio.c b/sysdeps/bsd/procio.c
new file mode 100644
index 00000000..a4846aee
--- /dev/null
+++ b/sysdeps/bsd/procio.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/procio.h>
+
+static const unsigned long _glibtop_sysdeps_proc_io = 0;
+
+/* Init function. */
+
+void
+_glibtop_init_proc_io_s (glibtop *server)
+{
+ server->sysdeps.proc_io = _glibtop_sysdeps_proc_io;
+}
+
+/* Provides detailed information about a process. */
+
+void
+glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf,
+ pid_t pid)
+{
+ memset (buf, 0, sizeof (glibtop_proc_io));
+}