- problems, so check that the proper amount of time has actually
- elapsed. */
-
- struct timespec delay = *requested_delay;
- struct timespec t0;
- getnow (&t0);
-
- for (;;)
+ problems. The worst known case of this is cygwin 1.5.x, which
+ can't sleep more than 49.7 days (2**32 milliseconds). Solve this
+ by breaking the sleep up into smaller chunks. Verify that time_t
+ is large enough. */
+ verify (TYPE_MAXIMUM (time_t) / 49 / 24 / 60 / 60);
+ const time_t limit = 49 * 24 * 60 * 60;
+ time_t seconds = requested_delay->tv_sec;
+ struct timespec intermediate;
+ intermediate.tv_nsec = 0;
+
+ while (limit < seconds)