Eli Zaretskii wrote:
> While building the latest pretest of wget2, I saw that the Gnulib's
> detection of nanosleep fails to detect its presence in mingw.org's
> MinGW runtime. The test program used for that fails for unrelated
> reason: it uses SIGALRM, which is unavailable on MS-Windows.
>
>
While building the latest pretest of wget2, I saw that the Gnulib's
detection of nanosleep fails to detect its presence in mingw.org's
MinGW runtime. The test program used for that fails for unrelated
reason: it uses SIGALRM, which is unavailable on MS-Windows.
I'm guessing that SIGALRM is used
The current implementation of nanosleep is broken on mingw for several reasons:
1) It requires linking with -lws2_32, as evidenced by these error messages:
gcc-3 -mno-cygwin -g -O2 -L/usr/local/mingw/lib -o test-nanosleep.exe
test-nanosleep.o ../gllib/libgnu.a
Bruno Haible wrote:
...
So here is a proposed patch for implementing a Woe32 nanosleep with a
resolution of ca. 10 microseconds or higher.
2010-04-04 Bruno Haible br...@clisp.org
Implement nanosleep for native Windows.
* lib/nanosleep.c (nanosleep): New implementation for
Jim Meyering wrote:
You're welcome to commit that.
Committed. The only thing I'm worried about is that it's a compromise
between precision of the time interval and ues of CPU time:
Someone who invokes nanosleep with an argument of 0.3 seconds may complain
that 9.4 ms of busy-looping is not
nanosleep: Fix C++ test error on mingw.
* lib/nanosleep.c (nanosleep): Renamed from rpl_nanosleep.
* lib/time.in.h (nanosleep): Use modern idiom.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): When the system does not have a
nanosleep function, set HAVE_NANOSLEEP to 0
Bruno Haible br...@clisp.org
nanosleep: Fix C++ test error on mingw.
* lib/nanosleep.c (nanosleep): Renamed from rpl_nanosleep.
* lib/time.in.h (nanosleep): Use modern idiom.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): When the system does not have a
nanosleep function
Hi Jim,
Though note that the patches to modules/time and m4/time_h.m4
did not apply and I did them manually.
Yes, I was constantly changing the same parts of these two files.
Please apply.
Applied.
Bruno