summaryrefslogtreecommitdiff
path: root/sysutils/libgtop/patches/patch-dn
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/libgtop/patches/patch-dn')
-rw-r--r--sysutils/libgtop/patches/patch-dn39
1 files changed, 39 insertions, 0 deletions
diff --git a/sysutils/libgtop/patches/patch-dn b/sysutils/libgtop/patches/patch-dn
new file mode 100644
index 00000000000..7593f7ccd88
--- /dev/null
+++ b/sysutils/libgtop/patches/patch-dn
@@ -0,0 +1,39 @@
+$NetBSD: patch-dn,v 1.1 2009/07/11 13:14:13 hasso Exp $
+
+--- sysdeps/freebsd/prockernel.c.orig 2009-07-11 14:07:07 +0300
++++ sysdeps/freebsd/prockernel.c 2009-07-11 14:11:59 +0300
+@@ -91,9 +91,13 @@ glibtop_get_proc_kernel_p (glibtop *serv
+
+ glibtop_suid_leave (server);
+
++#ifdef __DragonFly__
++#define PROC_WCHAN kp_lwp.kl_wchan
++#define PROC_WMESG kp_lwp.kl_wmesg
++#else
+ #define PROC_WCHAN ki_wchan
+ #define PROC_WMESG ki_wmesg
+-#define PROC_WMESG ki_wmesg
++#endif
+
+ buf->nwchan = (unsigned long) pinfo [0].PROC_WCHAN;
+
+@@ -107,6 +111,11 @@ glibtop_get_proc_kernel_p (glibtop *serv
+ buf->wchan [0] = 0;
+ }
+
++#ifdef __DragonFly__
++ buf->k_flags = (unsigned long) pinfo [0].kp_flags;
++ buf->min_flt = (unsigned long) pinfo [0].kp_ru.ru_minflt;
++ buf->maj_flt = (unsigned long) pinfo [0].kp_ru.ru_majflt;
++#else
+ buf->k_flags = (unsigned long) pinfo [0].ki_flag;
+ buf->min_flt = (unsigned long) pinfo [0].ki_rusage.ru_minflt;
+ buf->maj_flt = (unsigned long) pinfo [0].ki_rusage.ru_majflt;
+@@ -114,6 +123,7 @@ glibtop_get_proc_kernel_p (glibtop *serv
+ buf->cmin_flt = (unsigned long) buf->min_flt + pinfo [0].ki_rusage_ch.ru_minflt;
+ buf->cmaj_flt = (unsigned long) buf->maj_flt + pinfo [0].ki_rusage_ch.ru_majflt;
+ #endif
++#endif
+
+ buf->flags |= _glibtop_sysdeps_proc_kernel_pstats;
+