times(2) misbehaviour

Julien Boibessot julien.boibessot at free.fr
Tue Feb 2 12:46:35 UTC 2010


Joakim Tjernlund a écrit :
>
> Oh yes, been there done that :)
> Most arch's has this bug in linux(ppc in recent 2.6 does not).
>   
>From my understanding all 32 bits arch that do not have Linux sys_call
error codes separated from return values.
> Not sure I like:
>   
>> +  /* Return value (clock_t) -1 signals an error to userspace, but if there
>> +     wasn't any, return 0 instead. */
>> +  if (ret == (clock_t) -1)
>> +    return (clock_t) 0;
>>     
> this will skip ahead a tick
>   
yes you will skip one tick once during your system lifetime. But with
current implementation 4096 ticks are skipped after 5 minutes of system
uptime ;-)
> Does the patch work for times(NULL) too? Perhaps EFAULT
> can not be returned in this case?
>   
times(NULL) returns a correct tick value with my patch. not good ?

Regards,
Julien


More information about the uClibc mailing list