sleep: work around cygwin bug
authorEric Blake <ebb9@byu.net>
Thu, 19 Nov 2009 03:07:44 +0000 (20:07 -0700)
committerEric Blake <ebb9@byu.net>
Fri, 20 Nov 2009 14:10:22 +0000 (07:10 -0700)
commit6baa46639c17d7fba1d6aa1a3dd8ed536b7b2dc9
treeeac303353244b06ab50ddff551f46ec8d2230c26
parent00b2f10b68593189be4eb1affd88de33a8e92fb3
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>
ChangeLog
doc/posix-functions/sleep.texi
lib/sleep.c
lib/unistd.in.h
m4/sleep.m4
m4/unistd_h.m4
modules/sleep
modules/sleep-tests
modules/unistd
tests/test-sleep.c