This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Cc: fortran at gcc dot gnu dot org
- Date: Thu, 11 Apr 2013 21:52:00 +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> <51670B6B dot 3000503 at net-b dot de>
- Reply-to: cygwin at cygwin dot com, fortran at gcc dot gnu dot org
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