Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Apr 11 20:15:00 GMT 2013


On Apr 11 21:09, Angelo Graziosi wrote:
> Hi mum [1],

:)

> Corinna Vinschen wrote:
> 
> >Works fine for me with the current Cygwin 1.7.17, and the upcoming
> >Cygwin 1.7.18:
> >
> >  $ cat > ct.c <<EOF
> 
> At each run, your test case almost always starts with the same value:
> 
> $ gcc -o ct ct.c
> [...]
> 
> I wonder if this is to be expected...

According to the Cygwin source code, yes.  According to the SUSv4
definition, no.  The timer used for the monotonic clock is inited
to 0 for each process, so while each process uses the same clock,
they all have their own monotonic value.  This is obviously not
how the monotonic system clock is supposed to work, so that's a bug
in Cygwin.

I fixed that in CVS.


Mum

-- 
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