[libgtop] Some fields have moved in struct proc from timeval to timespec.



commit ff07ba102fb6a1bcb058a5e5429181981ce6fa2b
Author: Jasper Lievisse Adriaanse <jasper humppa nl>
Date:   Thu Jan 23 10:34:52 2014 +0100

    Some fields have moved in struct proc from timeval to timespec.

 sysdeps/openbsd/proctime.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/sysdeps/openbsd/proctime.c b/sysdeps/openbsd/proctime.c
index 905d623..d9638b6 100644
--- a/sysdeps/openbsd/proctime.c
+++ b/sysdeps/openbsd/proctime.c
@@ -71,7 +71,7 @@ calcru(struct proc *p, struct timeval *up, struct timeval *sp,
 {
        quad_t totusec;
        u_quad_t u, st, ut, it, tot;
-        long sec, usec;
+        long sec, nsec;
         struct timeval tv;
 
        st = p->p_sticks;
@@ -85,9 +85,9 @@ calcru(struct proc *p, struct timeval *up, struct timeval *sp,
        }
 
        sec = p->p_rtime.tv_sec;
-       usec = p->p_rtime.tv_usec;
+       nsec = p->p_rtime.tv_nsec;
 
-       totusec = (quad_t)sec * 1000000 + usec;
+       totusec = (quad_t)sec * 1000000 + nsec/1000;
 
        if (totusec < 0) {
                /* XXX no %qd in kernel.  Truncate. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]