1Jan 70 -- FreeBSD 5.0-RELEASE + Current
Dag-Erling Smorgrav
des at ofug.org
Wed Apr 23 18:02:31 PDT 2003
Tim Kientzle <kientzle at acm.org> writes:
> This has been discussed on this list several
> times: those processes are all started
> before the kernel has initialized the time.
>
> Because FreeBSD has to read the disk
> before it can know whether the hardware clock
> is in UTC or local time, it's hard to really
> do much better than this. (I suppose you
> could edit 'ps' to display such times
> as '-'; that might be less misleading.)
You guys have no imagination...
Index: kern_proc.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_proc.c,v
retrieving revision 1.179
diff -u -r1.179 kern_proc.c
--- kern_proc.c 18 Apr 2003 20:17:05 -0000 1.179
+++ kern_proc.c 24 Apr 2003 01:01:37 -0000
@@ -673,6 +673,8 @@
}
if ((p->p_sflag & PS_INMEM) && p->p_stats) {
kp->ki_start = p->p_stats->p_start;
+ if (kp->ki_start == 0)
+ 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;
Took me all of thirty seconds.
DES
--
Dag-Erling Smorgrav - des at ofug.org
More information about the freebsd-current
mailing list