Fix printf format bugs introduced in rev 1.34 for printing times.

quad_t cannot be printed with %lld on 64 bit systems.

Dont waste cpu to round user and system times up to long long, it is
highly improbable that a process will have accumulated 68 years of
user or system cpu time (not wall clock time) before a reboot or
process restart.
This commit is contained in:
Peter Wemm 2001-11-07 02:51:25 +00:00
parent 6a50ba658c
commit 4ff021c699

View File

@ -139,11 +139,11 @@ procfs_dostatus(curp, p, pfs, uio)
calcru(p, &ut, &st, (struct timeval *) NULL);
mtx_unlock_spin(&sched_lock);
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps,
" %lld,%ld %lld,%ld %lld,%ld",
(quad_t)p->p_stats->p_start.tv_sec,
" %lld,%ld %ld,%ld %ld,%ld",
(long long)p->p_stats->p_start.tv_sec,
p->p_stats->p_start.tv_usec,
(quad_t)ut.tv_sec, ut.tv_usec,
(quad_t)st.tv_sec, st.tv_usec);
(long)ut.tv_sec, ut.tv_usec,
(long)st.tv_sec, st.tv_usec);
} else {
mtx_unlock_spin(&sched_lock);
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps,