]> Zhao Yanbai Git Server - minix.git/commitdiff
Kernel: fix getrusage microsecond computation
authorDavid van Moolenbroek <david@minix3.org>
Thu, 10 Jul 2014 11:35:08 +0000 (13:35 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:56 +0000 (17:05 +0200)
Change-Id: I5e443ddbed1bcd49ed81721afda3aa3c1880ad52

kernel/system/do_getinfo.c

index 9e75ef454351139e1927f182446a33540a33741c..6d8530a16400e1602bbd708b9eb359aa3c338672 100644 (file)
@@ -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;