[uClibc] clock() for long-running process

Manuel Novoa III mjn3 at codepoet.org
Sat May 8 06:18:49 UTC 2004


On Sat, May 01, 2004 at 08:58:02PM +0900, Atsushi Nemoto wrote:
> >>>>> On Fri, 30 Apr 2004 08:42:33 -0600, mjn3 at codepoet.org (Manuel Novoa III) said:
> >> How about this patch?
> 
> mjn3> Hmm... I don't think that's consistent.  If we want clock_t to
> mjn3> wrap, then we'd never want to return (clock_t)-1 unless the
> mjn3> value is not available.  I'll look into it later today or this
> mjn3> weekend.
> 
> Well, it might be better taking care of such case.  But glibc's clock
> just ignore it, JFYI.
> 
> Anyway, fortunately, it never returns (clock_t)-1 (if CLK_TCK=100)
> because 4294967295 is not a multiple of (1000000 / 100) :-)

Checked a new version of the time code into cvs, including a version
of clock() which does wrapping.

Manuel



More information about the uClibc mailing list