[BusyBox] Replace uptime with time [PATCH]

Manuel Novoa III mjn3 at codepoet.org
Wed May 4 01:42:52 UTC 2005


On Tue, May 03, 2005 at 07:47:10PM -0400, Rob Landley wrote:
> On Tuesday 03 May 2005 06:45 pm, Larry Doolittle wrote:
> > Shaun -
> >
> > On Tue, May 03, 2005 at 03:02:20PM -0700, Shaun Jackman wrote:
> > > Replace uptime with time(NULL). time is more portable than uptime and
> > > eliminates the need to define uptime, reducing code size slightly.
> >
> > That doesn't sound good.  Time on any computer is subject to
> > administrative warpage, in particular to get the system phased
> > with external reference(s).  The uses listed are all internal
> > relative (elapsed) time, and would be needlessly confused (during
> > a time warp) if they used time() instead of uptime().  Unlike
> > time(), uptime is guaranteed monotonic.
> >
> > To address the portability argument, maybe uptime can fall back
> > to time(NULL) on systems that don't have a real uptime.
> >
> >    - Larry
> 
> Sigh.  I should start giving these patches a little more time to settle, I 
> think...
> 
> Could you guys work out amongst yourselves whether nor not I should revert 
> that and get back to me?  (I don't personally care either way, and am trying 
> to _avoid_ having to make this kind of judgement call.  Erik's the 
> maintainer,  not me.  I just liked this patch because it removed code...)

It needs to be reverted.  Shaun can either provide a compat functions to
use when building with newlib (as I recall) or, better still, add uptime()
to newlib.

Manuel



More information about the busybox mailing list