summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/sleep.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1997-08-10 12:16:13 +0000
committerjoerg <joerg@FreeBSD.org>1997-08-10 12:16:13 +0000
commitd50ebd355c62e98b100d823a37ca58eb8a7a93c6 (patch)
treea14d9da283f9b65e5ecc36ab3578e1834380453b /lib/libc/gen/sleep.c
parent4f2ef246895297adb299bb0adff9ef75a41d46d4 (diff)
downloadFreeBSD-src-d50ebd355c62e98b100d823a37ca58eb8a7a93c6.zip
FreeBSD-src-d50ebd355c62e98b100d823a37ca58eb8a7a93c6.tar.gz
Hack^H^H^H^Hworkaround for itimerfix(9) gratuitously limiting the
acceptable range for tv_sec to the magic number 100000000 (which at least ought to be declared in a header file, and explained in the non-existing man page, as well as in the existing man pages for nanosleep(2) & Co.). PR: bin/4259
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 36348bc..6a40d93 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;
OpenPOWER on IntegriCloud