summaryrefslogtreecommitdiffstats
path: root/devel/libgtop/files
diff options
context:
space:
mode:
Diffstat (limited to 'devel/libgtop/files')
-rw-r--r--devel/libgtop/files/patch-src_daemon_server.c17
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_Makefile.in28
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c18
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_mountlist.c177
-rw-r--r--devel/libgtop/files/pkg-message13
5 files changed, 253 insertions, 0 deletions
diff --git a/devel/libgtop/files/patch-src_daemon_server.c b/devel/libgtop/files/patch-src_daemon_server.c
new file mode 100644
index 000000000..bf0bba5c7
--- /dev/null
+++ b/devel/libgtop/files/patch-src_daemon_server.c
@@ -0,0 +1,17 @@
+--- src/daemon/server.c.orig Mon Feb 17 15:22:19 2003
++++ src/daemon/server.c Mon Feb 17 15:23:31 2003
+@@ -88,11 +88,12 @@
+ if (strcmp (uts.sysname, LIBGTOP_COMPILE_SYSTEM) ||
+ strcmp (uts.release, LIBGTOP_COMPILE_RELEASE) ||
+ strcmp (uts.machine, LIBGTOP_COMPILE_MACHINE)) {
+- fprintf (stderr, "Can only run on %s %s %s\n",
++ fprintf (stderr, "This libgtop was compiled on %s %s %s\n",
+ LIBGTOP_COMPILE_SYSTEM,
+ LIBGTOP_COMPILE_RELEASE,
+ LIBGTOP_COMPILE_MACHINE);
+- _exit (1);
++ fprintf (stderr, "If you see strange problems caused by it,\n");
++ fprintf (stderr, "you should recompile libgtop and dependent applications\n");
+ }
+ #endif
+
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_Makefile.in b/devel/libgtop/files/patch-sysdeps_freebsd_Makefile.in
new file mode 100644
index 000000000..e8a6bd895
--- /dev/null
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_Makefile.in
@@ -0,0 +1,28 @@
+--- sysdeps/freebsd/Makefile.in.orig 2007-11-02 23:55:07.000000000 -0400
++++ sysdeps/freebsd/Makefile.in 2007-11-02 23:58:08.000000000 -0400
+@@ -54,7 +54,7 @@ libgtop_sysdeps_2_0_la_LIBADD =
+ am_libgtop_sysdeps_2_0_la_OBJECTS = nosuid.lo siglist.lo sysinfo.lo \
+ shm_limits.lo cpu.lo msg_limits.lo sem_limits.lo loadavg.lo \
+ uptime.lo netlist.lo fsusage.lo mem.lo procopenfiles.lo \
+- procwd.lo glibtop_private.lo
++ procwd.lo glibtop_private.lo mountlist.lo
+ libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS)
+ am__DEPENDENCIES_1 =
+ libgtop_sysdeps_suid_2_0_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+@@ -303,7 +303,7 @@ libgtop_sysdeps_2_0_la_SOURCES = nosuid.
+ cpu.c msg_limits.c sem_limits.c loadavg.c \
+ uptime.c netlist.c fsusage.c mem.c \
+ procopenfiles.c procwd.c \
+- glibtop_private.c
++ glibtop_private.c mountlist.c
+
+ libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
+ libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS) $(EXTRA_SYSDEPS_LIBS)
+@@ -374,6 +374,7 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Plo@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mountlist.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glibtop_private.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c b/devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c
new file mode 100644
index 000000000..3269c8dd4
--- /dev/null
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c
@@ -0,0 +1,18 @@
+--- sysdeps/freebsd/fsusage.c.orig 2007-11-03 00:00:42.000000000 -0400
++++ sysdeps/freebsd/fsusage.c 2007-11-03 00:03:44.000000000 -0400
+@@ -22,14 +22,7 @@
+ #include <stdlib.h>
+
+ void
+-_glibtop_freebsd_get_fsusage_read_write(glibtop *server,
+- glibtop_fsusage *buf,
+- const char *path);
+-
+-void
+-_glibtop_freebsd_get_fsusage_read_write(glibtop *server,
+- glibtop_fsusage *buf,
+- const char *path)
++glibtop_get_fsusage_s(glibtop *server, glibtop_fsusage *buf, const char *path)
+ {
+ int result;
+ struct statfs sfs;
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_mountlist.c b/devel/libgtop/files/patch-sysdeps_freebsd_mountlist.c
new file mode 100644
index 000000000..55f4f5ed5
--- /dev/null
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_mountlist.c
@@ -0,0 +1,177 @@
+--- sysdeps/freebsd/mountlist.c.orig 2007-11-02 23:52:58.000000000 -0400
++++ sysdeps/freebsd/mountlist.c 2007-11-02 23:52:50.000000000 -0400
+@@ -0,0 +1,174 @@
++/* mountlist.c -- return a list of mounted filesystems
++ Copyright (C) 1991, 1992 Free Software Foundation, Inc.
++
++ This program 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, or (at your option)
++ any later version.
++
++ This program 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 this program; if not, write to the Free Software Foundation,
++ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++
++#include <config.h>
++
++#include <glib.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/mount.h>
++
++#include <string.h>
++
++#include <glibtop.h>
++#include <glibtop/mountlist.h>
++
++/* A mount table entry. */
++struct mount_entry
++{
++ char *me_devname; /* Device node pathname, including "/dev/". */
++ char *me_mountdir; /* Mount point directory pathname. */
++ char *me_type; /* "nfs", "4.2", etc. */
++ dev_t me_dev; /* Device number of me_mountdir. */
++ struct mount_entry *me_next;
++};
++
++static struct mount_entry *read_filesystem_list (void);
++
++/* Return a list of the currently mounted filesystems, or NULL on error.
++ Add each entry to the tail of the list so that they stay in order.
++*/
++
++static struct mount_entry *
++read_filesystem_list (void)
++{
++ struct mount_entry *mount_list;
++ struct mount_entry *me;
++ struct mount_entry *mtail;
++
++ /* Start the list off with a dummy entry. */
++ me = g_new (struct mount_entry, 1);
++ me->me_next = NULL;
++ mount_list = mtail = me;
++ {
++ struct statfs *fsp;
++ int entries;
++
++ entries = getmntinfo (&fsp, MNT_NOWAIT);
++ if (entries < 0)
++ return NULL;
++ while (entries-- > 0)
++ {
++ me = (struct mount_entry *) g_malloc (sizeof (struct mount_entry));
++ me->me_devname = g_strdup (fsp->f_mntfromname);
++ me->me_mountdir = g_strdup (fsp->f_mntonname);
++ me->me_type = g_strdup (fsp->f_fstypename);
++ me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
++ me->me_next = NULL;
++
++ /* Add to the linked list. */
++ mtail->me_next = me;
++ mtail = me;
++ fsp++;
++ }
++ }
++
++ /* Free the dummy head. */
++ me = mount_list;
++ mount_list = mount_list->me_next;
++ g_free (me);
++ return mount_list;
++}
++
++static gboolean ignore_mount_entry(const struct mount_entry *me)
++{
++ /* keep sorted */
++ static const char ignored[][12] = {
++ "autofs",
++ "binfmt_misc",
++ "ctfs",
++ "devfs",
++ "devpts",
++ "fusectl",
++ "linprocfs",
++ "mfs",
++ "mntfs",
++ "mqueue",
++ "none",
++ "nsfd",
++ "objfs",
++ "openpromfs",
++ "proc",
++ "procfs",
++ "securityfs",
++ "supermount",
++ "sysfs",
++ "tmpfs",
++ "unknown",
++ "usbdevfs",
++ "usbfs"
++ };
++
++ typedef int (*Comparator)(const void*, const void*);
++
++ return bsearch(me->me_type,
++ ignored, G_N_ELEMENTS(ignored), sizeof ignored[0],
++ (Comparator) strcmp) != NULL;
++}
++
++
++glibtop_mountentry *
++glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs)
++{
++ struct mount_entry *entries, *cur, *next;
++
++ GArray *mount_array = g_array_new(FALSE, FALSE,
++ sizeof(glibtop_mountentry));
++
++ glibtop_init_r (&server, 0, 0);
++
++ memset (buf, 0, sizeof (glibtop_mountlist));
++
++ /* Read filesystem list. */
++
++ if((entries = read_filesystem_list ()) == NULL)
++ return NULL;
++
++ for (cur = &entries[0]; cur != NULL; cur = next) {
++
++ if(all_fs || !ignore_mount_entry(cur)) {
++ /* add a new glibtop_mountentry */
++ glibtop_mountentry e;
++
++ g_strlcpy(e.devname, cur->me_devname, sizeof e.devname);
++ g_strlcpy(e.mountdir, cur->me_mountdir, sizeof e.mountdir);
++ g_strlcpy(e.type, cur->me_type, sizeof e.type);
++ e.dev = cur->me_dev;
++
++ g_array_append_val(mount_array, e);
++ }
++
++ /* free current mount_entry and move to the next */
++ next = cur->me_next;
++ g_free(cur->me_devname);
++ g_free(cur->me_mountdir);
++ g_free(cur->me_type);
++ g_free(cur);
++ }
++
++ buf->size = sizeof (glibtop_mountentry);
++ buf->number = mount_array->len;
++ buf->total = buf->number * buf->size;
++
++ buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE)
++ | (1 << GLIBTOP_MOUNTLIST_NUMBER)
++ | (1 << GLIBTOP_MOUNTLIST_TOTAL);
++
++ return (glibtop_mountentry*) g_array_free(mount_array, FALSE);
++}
diff --git a/devel/libgtop/files/pkg-message b/devel/libgtop/files/pkg-message
new file mode 100644
index 000000000..dacaf62a9
--- /dev/null
+++ b/devel/libgtop/files/pkg-message
@@ -0,0 +1,13 @@
+===============================================================================
+
+In order to use the File System read/write monitor, you must chmod
+/dev/devstat so that all users can open it read-only. For example:
+
+# chmod 0444 /dev/devstat
+
+In order for this to persist across reboots, add the following to
+/etc/devfs.conf:
+
+perm devstat 0444
+
+===============================================================================