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
- Date: Thu, 11 Apr 2013 21:50:25 +0200
- Subject: Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0
- References: <51670A56 dot 6090701 at alice dot it>
- Reply-to: cygwin at cygwin dot com
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