1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-17 12:41:05 +03:00
Files
gnulib/doc/posix-functions/sleep.texi
Eric Blake 6baa46639c 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>
2009-11-20 07:10:22 -07:00

30 lines
741 B
Plaintext

@node sleep
@section @code{sleep}
@findex sleep
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/sleep.html}
Gnulib module: sleep
Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on some platforms:
mingw (2005 or newer).
@item
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:
@itemize
@item
According to POSIX, the @code{sleep} function may interfere with the program's
use of the @code{SIGALRM} signal. On Linux, it doesn't; on other platforms,
it may.
@end itemize