From 89f0368396d9be966bb91608f912e1aa2b2f1ddb Mon Sep 17 00:00:00 2001 From: yar Date: Tue, 25 Jul 2006 22:39:57 +0000 Subject: Rev. 1.44 of this file didn't introduce a right solution, but we don't seem to have one yet, so just add an XXX comment on passing rux_runtime to bintime2timeval() wrongly. Spotted by: gcc(1) (warning) --- lib/libkvm/kvm_proc.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/libkvm') diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 250cb44..acf040c 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -374,6 +374,13 @@ nopgrp: kp->ki_lockname, LOCKNAMELEN); kp->ki_lockname[LOCKNAMELEN] = 0; } + /* + * XXX: This is plain wrong, rux_runtime has nothing + * to do with struct bintime, rux_runtime is just a 64-bit + * integer counter of cputicks. What we need here is a way + * to convert cputicks to usecs. The kernel does it in + * kern/kern_tc.c, but the function can't be just copied. + */ bintime2timeval(&proc.p_rux.rux_runtime, &tv); kp->ki_runtime = (u_int64_t)tv.tv_sec * 1000000 + tv.tv_usec; kp->ki_pid = proc.p_pid; -- cgit v1.1