diff options
author | des <des@FreeBSD.org> | 2003-04-24 03:37:59 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2003-04-24 03:37:59 +0000 |
commit | 51f01cb3f731c451c22c07d8bb6a6e9ecffb72d1 (patch) | |
tree | aa0880418dd0b181284d021834c63204c560c5ac /sys | |
parent | 7dbf40d20d37617abb4126fde75722424d47ce50 (diff) | |
download | FreeBSD-src-51f01cb3f731c451c22c07d8bb6a6e9ecffb72d1.zip FreeBSD-src-51f01cb3f731c451c22c07d8bb6a6e9ecffb72d1.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_proc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 74653b3..03b6a81 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -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; |