diff options
author | joerg <joerg> | 2007-01-29 16:42:52 +0000 |
---|---|---|
committer | joerg <joerg> | 2007-01-29 16:42:52 +0000 |
commit | 2d4bd35d013aeb733891c02d4331eeb12f273b07 (patch) | |
tree | c6fba39e774d0c44ba8bfebb54d362465cd61075 /sysutils | |
parent | cb0db45039cd9c02467017d1a90610835c6c55b1 (diff) | |
download | pkgsrc-2d4bd35d013aeb733891c02d4331eeb12f273b07.tar.gz |
Basic DragonFly support. Doesn't support swap infos, but forcing
kvm access for that is not justified unless someone else actually
wants to implement it.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/wmmemmon/Makefile | 5 | ||||
-rw-r--r-- | sysutils/wmmemmon/distinfo | 3 | ||||
-rw-r--r-- | sysutils/wmmemmon/files/mem_dragonfly.c | 42 | ||||
-rw-r--r-- | sysutils/wmmemmon/patches/patch-aa | 16 |
4 files changed, 64 insertions, 2 deletions
diff --git a/sysutils/wmmemmon/Makefile b/sysutils/wmmemmon/Makefile index c4fa391bdd5..512f2e55502 100644 --- a/sysutils/wmmemmon/Makefile +++ b/sysutils/wmmemmon/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2007/01/23 16:17:23 joerg Exp $ +# $NetBSD: Makefile,v 1.9 2007/01/29 16:42:52 joerg Exp $ # DISTNAME= wmmemmon-1.0.1 @@ -12,6 +12,9 @@ COMMENT= Dockapp to monitor memory and swap usages GNU_CONFIGURE= YES +post-extract: + ${CP} ${FILESDIR}/mem_dragonfly.c ${WRKSRC}/src + .include "../../x11/libXext/buildlink3.mk" .include "../../x11/libXpm/buildlink3.mk" .include "../../x11/xextproto/buildlink3.mk" diff --git a/sysutils/wmmemmon/distinfo b/sysutils/wmmemmon/distinfo index 78b852a280b..1ae89db118c 100644 --- a/sysutils/wmmemmon/distinfo +++ b/sysutils/wmmemmon/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.3 2005/02/24 13:40:59 agc Exp $ +$NetBSD: distinfo,v 1.4 2007/01/29 16:42:52 joerg Exp $ SHA1 (wmmemmon-1.0.1.tar.gz) = de394a55e3386f5e0c06524c4ddea79f51f8d17b RMD160 (wmmemmon-1.0.1.tar.gz) = 8e120a5f039cf206163abfc1cf4287f3f8413a60 Size (wmmemmon-1.0.1.tar.gz) = 145287 bytes +SHA1 (patch-aa) = 85098c03d12329cd1363bdee62b6d373152411f3 diff --git a/sysutils/wmmemmon/files/mem_dragonfly.c b/sysutils/wmmemmon/files/mem_dragonfly.c new file mode 100644 index 00000000000..8764d67444d --- /dev/null +++ b/sysutils/wmmemmon/files/mem_dragonfly.c @@ -0,0 +1,42 @@ +/* $Id: mem_dragonfly.c,v 1.1 2007/01/29 16:42:52 joerg Exp $ */ + +/* + * mem_dragonfly.c - module to get memory/swap usages in percent, for DragonFly + * + * Copyright(c) 2007 Joerg Sonnenenberger <joerg@leaf.dragonflybsd.org> + * + * licensed under the GPL + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mem.h" + +#include <kinfo.h> +#include <sys/vmmeter.h> + +/* initialize function */ +void mem_init(void) +{ +} + +void mem_getusage(int *per_mem, int *per_swap, const struct mem_options *opts) +{ + struct vmstats vms; + int vms_size = sizeof(vms); + unsigned long mused; + + if (sysctlbyname("vm.vmstats", &vms, &vms_size, NULL, 0)) + exit(1); + + mused = vms.v_active_count - vms.v_free_count; + if (opts->ignore_wired) + mused -= vms.v_wire_count; + if (opts->ignore_cached) + mused -= vms.v_cache_count; + + *per_mem = 100 * mused / vms.v_page_count; + *per_swap = 0; /* XXX Fill me in */ +} diff --git a/sysutils/wmmemmon/patches/patch-aa b/sysutils/wmmemmon/patches/patch-aa new file mode 100644 index 00000000000..e5e9c3ce617 --- /dev/null +++ b/sysutils/wmmemmon/patches/patch-aa @@ -0,0 +1,16 @@ +$NetBSD: patch-aa,v 1.1 2007/01/29 16:42:52 joerg Exp $ + +--- configure.orig 2003-09-15 06:43:50.000000000 +0000 ++++ configure +@@ -4296,6 +4296,11 @@ freebsd*) + LIBS="$LIBS -lkvm" + SETGID_FLAGS="-g kmem -m 2755 -o root" + ;; ++dragonfly*) ++ OS=dragonfly ++ ignore_wired=yes ++ ignore_cached=yes ++ ;; + openbsd*) + OS=openbsd + ;; |