Date: Thu, 24 Apr 2003 03:02:25 +0200 From: Dag-Erling Smorgrav <des@ofug.org> To: kientzle@acm.org Cc: current@freebsd.org Subject: Re: 1Jan 70 -- FreeBSD 5.0-RELEASE + Current Message-ID: <xzp65p4emhq.fsf@flood.ping.uio.no> In-Reply-To: <3EA72D85.4030205@acm.org> (Tim Kientzle's message of "Wed, 23 Apr 2003 17:19:17 -0700") References: <DCECJGCCEMJIDCEAHBEEIEOHCBAA.adrian@nu-earth.net> <200304231644.50685.cbiffle@safety.net> <3EA72D85.4030205@acm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Tim Kientzle <kientzle@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@ofug.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzp65p4emhq.fsf>
