nanosleep: work around cygwin bug
authorEric Blake <ebb9@byu.net>
Thu, 19 Nov 2009 03:10:42 +0000 (20:10 -0700)
committerEric Blake <ebb9@byu.net>
Fri, 20 Nov 2009 14:11:28 +0000 (07:11 -0700)
commita905b35027f406a031a844995b32b7b9291d0336
tree73d42af218ee4c2b7b17eb06f957dcc63b58eae0
parent6baa46639c17d7fba1d6aa1a3dd8ed536b7b2dc9
nanosleep: work around cygwin bug

Cygwin 1.5.x mistakenly failed with EINVAL for a duration longer
than 49.7 days (2**32 milliseconds).  Meanwhile, the existing
code for HAVE_BUG_BIG_NANOSLEEP would infloop, instead of return
failure, for invalid arguments.

* lib/nanosleep.c (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]:
Fix logic bug when nanosleep fails.  Work around cygwin 1.5.x
bug.
(getnow): Delete, not needed.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): No longer require
LIB_CLOCK_GETTIME.
* modules/nanosleep (Depends-on): Add intprops and verify.  Drop
clock-time, gettime.
* doc/posix-functions/nanosleep.texi (nanosleep): Document the
bug.
* modules/nanosleep-tests: New test.
* tests/test-nanosleep.c: New file.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/posix-functions/nanosleep.texi
lib/nanosleep.c
m4/nanosleep.m4
modules/nanosleep
modules/nanosleep-tests [new file with mode: 0644]
tests/test-nanosleep.c [new file with mode: 0644]