pkgsrc/sysutils/monit/patches/patch-ab

29 lines
1 KiB
Text

$NetBSD: patch-ab,v 1.4 2008/12/28 22:38:08 seb Exp $
--- process/sysdep_NETBSD.c.orig 2007-07-29 20:23:26.000000000 +0000
+++ process/sysdep_NETBSD.c
@@ -55,6 +55,8 @@
#include <sys/dkstat.h>
#endif
+#include <sys/param.h>
+
#include "monitor.h"
#include "process.h"
#include "process_sysdep.h"
@@ -171,9 +173,15 @@ int initprocesstree_sysdep(ProcessTree_T
{
pt[i].pid = pinfo[i].kp_proc.p_pid;
pt[i].ppid = pinfo[i].kp_eproc.e_ppid;
+#if defined(__NetBSD_Prereq__) && (499004400 <= __NetBSD_Version__)
+ pt[i].cputime = (long)((pinfo[i].kp_proc.p_rtime.sec << 4) +
+ (pinfo[i].kp_proc.p_rtime.frac >> 60)
+ );
+#else
pt[i].cputime = (long)((pinfo[i].kp_proc.p_rtime.tv_sec * 10) +
(pinfo[i].kp_proc.p_rtime.tv_usec / 100000)
);
+#endif
pt[i].mem_kbyte = (unsigned long)(pinfo[i].kp_eproc.e_vm.vm_rssize * pagesize_kbyte);
if(pinfo[i].kp_proc.p_stat == SZOMB)
{