This is the mail archive of the
mailing list for the Cygwin project.
Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0
- From: Tobias Burnus <burnus at net-b dot de>
- To: cygwin at cygwin dot com, fortran at gcc dot gnu dot org
- Date: Thu, 11 Apr 2013 21:13:47 +0200
- Subject: Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0
- References: <5166A0B3 dot 70801 at net-b dot de> <5166BCA1 dot 5040204 at net-b dot de> <20130411134835 dot GD18333 at calimero dot vinschen dot de>
Corinna Vinschen wrote:
Works fine for me with the current Cygwin 1.7.17, and the upcoming
if (!clock_gettime (CLOCK_MONOTONIC, &tp))
printf ("tv_sec = %ld, tv_nsec = %ld\n", tp.tv_sec, tp.tv_nsec);
tv_sec = 0, tv_nsec = 29920
Where is actually the source code of the clock_gettime, which Cygwin
uses? I thought that it was newlib. But looking at
the code should return -1 for "clock_gettime (CLOCK_MONOTONIC" as
CLOCK_MONOTONIC (= 4) is not handled, only CLOCK_REALTIME (= 1,
according to src/newlib/libc/include/time.h).
However, as both you and Angelo get a zero return value, I must look at
the wrong file.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple