This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]