When filling out a kinfo_proc structure, if we come across a process

whose p_stats->p_start has the magic value 1, replace it with boottime.
Some users were apparently confused by the fact that ps(1) reported a
start time in early 1970 for system processes.
This commit is contained in:
Dag-Erling Smørgrav 2003-04-24 03:37:59 +00:00
parent e63c419732
commit 1f7440d9f6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113954

View file

@ -673,6 +673,8 @@ fill_kinfo_proc(p, kp)
}
if ((p->p_sflag & PS_INMEM) && p->p_stats) {
kp->ki_start = p->p_stats->p_start;
if (kp->ki_start.tv_sec == 1)
kp->ki_start = boottime;
kp->ki_rusage = p->p_stats->p_ru;
kp->ki_childtime.tv_sec = p->p_stats->p_cru.ru_utime.tv_sec +
p->p_stats->p_cru.ru_stime.tv_sec;