summaryrefslogtreecommitdiff
path: root/lib/libc/gen/sleep.c
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1997-08-10 12:16:13 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1997-08-10 12:16:13 +0000
commitac77b4810d30d6abbc7779fcd5716664978b927b (patch)
treee32d6c592882297a64780777c08cdcebe57b10e0 /lib/libc/gen/sleep.c
parent66319037c96501fdd4cefbb2d0789c3eceb42e42 (diff)
Notes
Diffstat (limited to 'lib/libc/gen/sleep.c')
-rw-r--r--lib/libc/gen/sleep.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c
index 36348bc3a465..6a40d934782c 100644
--- a/lib/libc/gen/sleep.c
+++ b/lib/libc/gen/sleep.c
@@ -60,6 +60,14 @@ sleep(seconds)
struct timespec time_remaining;
if (seconds != 0) {
+ /*
+ * XXX
+ * Hack to work around itimerfix(9) gratuitously limiting
+ * the acceptable range for a struct timeval.tv_sec to
+ * <= 100000000.
+ */
+ if (seconds > 100000000)
+ seconds = 100000000;
time_to_sleep.tv_sec = seconds;
time_to_sleep.tv_nsec = 0;
nanosleep(&time_to_sleep, &time_remaining);
@@ -75,6 +83,14 @@ sleep(seconds)
sigset_t mask, omask;
if (seconds != 0) {
+ /*
+ * XXX
+ * Hack to work around itimerfix(9) gratuitously limiting
+ * the acceptable range for a struct timeval.tv_sec to
+ * <= 100000000.
+ */
+ if (seconds > 100000000)
+ seconds = 100000000;
time_to_sleep.tv_sec = seconds;
time_to_sleep.tv_nsec = 0;