Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-12 Thread Angelo Graziosi
Ciao Steve, Il 12/04/2013 1.59, Steve Kargl ha scritto: On Fri, Apr 12, 2013 at 01:17:07AM +0200, Angelo Graziosi wrote: Steve Kargl wrote My disagreemnet is predicated on the stupidity of using a 10 line example subroutine without actually inspecting what it does on whatever OS that one choo

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Andrey Repin
Greetings, Steve Kargl! >> >> * gfortran's example for random_see should be change to not use >> >> system_clock for the random seed. >> > >> >I disagree. The example is just that a short example >> >that demonstrates how to use random_seed. Anyone using >> >that example in his/her code without

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Steve Kargl
On Fri, Apr 12, 2013 at 01:17:07AM +0200, Angelo Graziosi wrote: > Steve Kargl wrote > > > My > > disagreemnet is predicated on the stupidity of using a 10 line > > example subroutine without actually inspecting what it does on > > whatever OS that one chooses to use. > > It is just because one h

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Angelo Graziosi
Steve Kargl wrote My disagreemnet is predicated on the stupidity of using a 10 line example subroutine without actually inspecting what it does on whatever OS that one chooses to use. It is just because one has tested that code that these problems came to light... :-) Ciao, Angelo. -- Pr

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Ryan Johnson
On 11/04/2013 7:00 PM, Steve Kargl wrote: On Thu, Apr 11, 2013 at 11:23:42PM +0100, N.M. Maclaren wrote: On Apr 11 2013, Steve Kargl wrote: On Thu, Apr 11, 2013 at 10:35:54PM +0200, Tobias Burnus wrote: * gfortran's example for random_see should be change to not use system_clock for the random

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Angelo Graziosi
Steve Kargl wrote: On Thu, Apr 11, 2013 at 10:35:54PM +0200, Tobias Burnus wrote: * gfortran's example for random_see should be change to not use system_clock for the random seed. I disagree. The example is just that a short example that demonstrates how to use random_seed. Anyone using t

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Steve Kargl
On Thu, Apr 11, 2013 at 11:23:42PM +0100, N.M. Maclaren wrote: > On Apr 11 2013, Steve Kargl wrote: > >On Thu, Apr 11, 2013 at 10:35:54PM +0200, Tobias Burnus wrote: > >> > >> * gfortran's example for random_see should be change to not use > >> system_clock for the random seed. > > > >I disagree.

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread N.M. Maclaren
On Apr 11 2013, Steve Kargl wrote: On Thu, Apr 11, 2013 at 10:35:54PM +0200, Tobias Burnus wrote: * gfortran's example for random_see should be change to not use system_clock for the random seed. I disagree. The example is just that a short example that demonstrates how to use random_seed.

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Steve Kargl
On Thu, Apr 11, 2013 at 10:35:54PM +0200, Tobias Burnus wrote: > > * gfortran's example for random_see should be change to not use > system_clock for the random seed. > I disagree. The example is just that a short example that demonstrates how to use random_seed. Anyone using that example in

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Larry Hall (Cygwin)
On 4/11/2013 4:48 PM, Angelo Graziosi wrote: Mum wrote: 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 Oh, thanks mum... I hope it will be fixed also in the next 1.7.18.. :) Yeah, that's pretty much the way

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Tobias Burnus
Tobias Burnus: b) Newlib is broken. For clock_gettime, CLOCK_MONOTONIC is not implemented. But both CLOCK_MONOTONIC and even _POSIX_MONOTONIC_CLOCK (with value 200112L) are defined. However, POSIX states: "If the Monotonic Clock option is supported, all implementations shall support a clock_id

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Angelo Graziosi
Mum wrote: 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 Oh, thanks mum... I hope it will be fixed also in the next 1.7.18.. :) Ciao, Angelo. PS. Corinna, your "Hi kiddies" has been irresistible... -- Pro

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Corinna Vinschen
On Apr 11 22:35, Tobias Burnus wrote: > Corinna Vinschen wrote: > >On Apr 11 21:13, Tobias Burnus wrote: > >>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/l

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Tobias Burnus
Corinna Vinschen wrote: On Apr 11 21:13, Tobias Burnus wrote: 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 ret

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Corinna Vinschen
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 =

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Corinna Vinschen
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 < > At each run, your test case almost always starts with the same value: > > $ gcc -o ct ct.c > [.

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Tobias Burnus
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 cod

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Angelo Graziosi
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 < At each run, your test case almost always starts with the same value: $ gcc -o ct ct.c $ ./ct tv_sec = 0, tv_nsec = 2793 tv_sec = 0, tv_nsec = 89104 tv_

Re: Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Corinna Vinschen
On Apr 11 15:37, Tobias Burnus wrote: > Please CC your reply to fort...@gcc.gnu.org Please don't CC me or cgf. We're subscribed to the Cygwin list anyway. > Dear all, > > using clock_gettime with CLOCK_MONOTONIC fails on Cygwin; it always > gives 0. That breaks code compiled with GCC's gfortran

Cygwin with clock_gettime and CLOCK_MONOTONIC - gives always 0

2013-04-11 Thread Tobias Burnus
Please CC your reply to fort...@gcc.gnu.org Dear all, using clock_gettime with CLOCK_MONOTONIC fails on Cygwin; it always gives 0. That breaks code compiled with GCC's gfortran which uses system_clock in libgfortran. libgfortran uses CLOCK_MONOTONIC if defined and otherwise it falls back to