From 353098857730fce409d995974ae8d26b78f379fa Mon Sep 17 00:00:00 2001 From: cheloha Date: Mon, 31 Dec 2018 18:54:00 +0000 Subject: nanosleep: loop tsleep(9) to ensure coverage of the full timeout range. tsleep(9)'s maximum timeout shrinks as HZ grows, so this ensures we do not return early from longer timeouts on alpha or on custom kernels. POSIX says you cannot return early unless a signal is delivered, so this makes us more compliant with the standard. While here, remove the 100 million second upper bound. It is an artifact from itimerfix() and it serves no discernible purpose. ok tedu@ visa@ --- lib/libc/sys/nanosleep.2 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/sys/nanosleep.2 b/lib/libc/sys/nanosleep.2 index 062597e4163..63e4e4e365b 100644 --- a/lib/libc/sys/nanosleep.2 +++ b/lib/libc/sys/nanosleep.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: nanosleep.2,v 1.15 2015/05/31 23:54:25 schwarze Exp $ +.\" $OpenBSD: nanosleep.2,v 1.16 2018/12/31 18:54:00 cheloha Exp $ .\" $NetBSD: nanosleep.2,v 1.1 1997/04/17 18:12:02 jtc Exp $ .\" .\" Copyright (c) 1986, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)sleep.3 8.1 (Berkeley) 6/4/93 .\" -.Dd $Mdocdate: May 31 2015 $ +.Dd $Mdocdate: December 31 2018 $ .Dt NANOSLEEP 2 .Os .Sh NAME @@ -76,8 +76,9 @@ to the corresponding value. was interrupted by the delivery of a signal. .It Bq Er EINVAL .Fa timeout -specified a nanosecond value less than zero or greater than 1000 million, -or a second value less than zero or greater than 100 million. +specified a nanosecond value less than zero or greater than or equal to +1000 million, +or a second value less than zero. .It Bq Er EFAULT Either .Fa timeout -- cgit v1.2.3-59-g8ed1b