$OpenBSD: patch-sysdeps_openbsd_proctime_c,v 1.10 2014/02/08 10:55:31 ajacoutot Exp $

RM at next release.

--- sysdeps/openbsd/proctime.c.orig	Sat Jul 27 14:40:23 2013
+++ sysdeps/openbsd/proctime.c	Sat Feb  8 11:26:32 2014
@@ -58,59 +58,6 @@ _glibtop_init_proc_time_p (glibtop *server)
 		_glibtop_sysdeps_proc_time_user;
 }
 
-/* Taken from /usr/src/sys/kern/kern_resource.c */
-
-/*
- * Transform the running time and tick information in proc p into user,
- * system, and interrupt time usage.
- */
-
-static void
-calcru(struct proc *p, struct timeval *up, struct timeval *sp,
-    struct timeval *ip)
-{
-	quad_t totusec;
-	u_quad_t u, st, ut, it, tot;
-        long sec, usec;
-        struct timeval tv;
-
-	st = p->p_sticks;
-	ut = p->p_uticks;
-	it = p->p_iticks;
-
-	tot = st + ut + it;
-	if (tot == 0) {
-		st = 1;
-		tot = 1;
-	}
-
-	sec = p->p_rtime.tv_sec;
-	usec = p->p_rtime.tv_usec;
-
-	totusec = (quad_t)sec * 1000000 + usec;
-
-	if (totusec < 0) {
-		/* XXX no %qd in kernel.  Truncate. */
-		fprintf (stderr, "calcru: negative time: %ld usec\n",
-			 (long)totusec);
-		totusec = 0;
-	}
-
-
-	u = totusec;
-	st = (u * st) / tot;
-	sp->tv_sec = st / 1000000;
-	sp->tv_usec = st % 1000000;
-	ut = (u * ut) / tot;
-	up->tv_sec = ut / 1000000;
-	up->tv_usec = ut % 1000000;
-	if (ip != NULL) {
-		it = (u * it) / tot;
-		ip->tv_sec = it / 1000000;
-		ip->tv_usec = it % 1000000;
-	}
-}
-
 /* Provides detailed information about a process. */
 
 void
@@ -131,7 +78,7 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc
 	/* Get the process information */
 	pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid,
 			      sizeof (*pinfo), &count);
-	if ((pinfo == NULL) || (count != 1)) {
+	if (pinfo == NULL) {
 		glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);
 		return;
 	}
