From: David van Moolenbroek Date: Thu, 10 Jul 2014 11:35:08 +0000 (+0200) Subject: Kernel: fix getrusage microsecond computation X-Git-Tag: v3.3.0~173 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch02.html?a=commitdiff_plain;h=83a31a3592d3fcc78c7b4897cd7e19565f3d2253;p=minix.git Kernel: fix getrusage microsecond computation Change-Id: I5e443ddbed1bcd49ed81721afda3aa3c1880ad52 --- diff --git a/kernel/system/do_getinfo.c b/kernel/system/do_getinfo.c index 9e75ef454..6d8530a16 100644 --- a/kernel/system/do_getinfo.c +++ b/kernel/system/do_getinfo.c @@ -205,10 +205,10 @@ int do_getinfo(struct proc * caller, message * m_ptr) memset(&r_usage, 0, sizeof(r_usage)); usec = target->p_user_time * 1000000 / system_hz; r_usage.ru_utime.tv_sec = usec / 1000000; - r_usage.ru_utime.tv_usec = usec % 100000; + r_usage.ru_utime.tv_usec = usec % 1000000; usec = target->p_sys_time * 1000000 / system_hz; r_usage.ru_stime.tv_sec = usec / 1000000; - r_usage.ru_stime.tv_usec = usec % 100000; + r_usage.ru_stime.tv_usec = usec % 1000000; r_usage.ru_nsignals = target->p_signal_received; src_vir = (vir_bytes) &r_usage; break;