bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Return value of 'times' on MS-Windows is constant and overflows


From: Pádraig Brady
Subject: Re: Return value of 'times' on MS-Windows is constant and overflows
Date: Tue, 10 Jun 2014 00:42:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 06/08/2014 04:23 PM, Eli Zaretskii wrote:
> The gnulib implementation of 'times' for MS-Windows uses the process
> creation time returned by the GetProcessTimes API to construct the
> value that the function should return.
> 
> This has 2 problems:
> 
>   . The value is constant: every call to 'times' within the same
>     process returns the same value.  Callers generally expect the
>     value to change, since Posix says the value is the elapsed time
>     since some arbitrary point in time, and that point doesn't change
>     for function calls in the same process.  For example, Guile's test
>     suite includes a test that calls 'times', sleeps for a few
>     seconds, then calls 'times' again, and expects the return value to
>     change by approximately the number of seconds it slept.

This seems correct. I.E. times() should count up.
I'll merge this but with s/change by/change according to/ in the line above.

thanks!
Pádraig.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]