Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0
Corinna Vinschen
corinna-cygwin@cygwin.com
Thu Apr 11 20:35:00 GMT 2013
On Apr 11 21:13, Tobias Burnus wrote:
> Corinna Vinschen wrote:
> >Works fine for me with the current Cygwin 1.7.17, and the upcoming
> >Cygwin 1.7.18:
> > 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
> http://sourceware.org/cgi-bin/cvsweb.cgi/src/newlib/libc/sys/linux/clock_gettime.c?cvsroot=src
> 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.
Yes, for Cygwin it's
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/timer.cc?cvsroot=src
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list