1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-09-11 11:50:52 +03:00

sleep: work around cygwin bug

On cygwin 1.5.x, sleep amounts larger than 49.7 days (2**32
milliseconds) failed instantly, but with a garbage return
value from uninitialized memory.

* lib/sleep.c (rpl_sleep): Work around the bug.
* m4/sleep.m4 (gl_FUNC_SLEEP): Detect the bug.
(gl_PREREQ_SLEEP): Delete unused macro.
* modules/sleep (Depends-on): Add verify.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add default.
* modules/unistd (Makefile.am): Substitute witness.
* lib/unistd.in.h (sleep): Update prototype.
* doc/posix-functions/sleep.texi (sleep): Document the bug.
* tests/test-sleep.c (main) [HAVE_DECL_ALARM]: Test it.
* modules/sleep-tests (Depends-on): Check for alarm.

Signed-off-by: Eric Blake <ebb9@byu.net>
This commit is contained in:
Eric Blake
2009-11-18 20:07:44 -07:00
parent 00b2f10b68
commit 6baa46639c
10 changed files with 120 additions and 21 deletions

View File

@@ -15,6 +15,9 @@ mingw (2005 or newer).
This function takes milliseconds as argument and returns @code{void} on some
platforms:
mingw (2005 and older).
@item
This function cannot sleep longer than 49.7 days on some platforms:
Cygwin 1.5.x.
@end itemize
Portability problems not fixed by Gnulib: