Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/sleep.9
Show First 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | |||||
value. | value. | ||||
When converting from | When converting from | ||||
.Fn wakeup | .Fn wakeup | ||||
to | to | ||||
.Fn wakeup_one , | .Fn wakeup_one , | ||||
pay particular attention to ensure that no other threads wait on the | pay particular attention to ensure that no other threads wait on the | ||||
same | same | ||||
.Fa chan . | .Fa chan . | ||||
.Pp | |||||
If the timeout given by | |||||
.Fa timo | |||||
or | |||||
.Fa sbt | |||||
is based on an absolute real-time clock value, | |||||
then the thread should copy the global | |||||
.Va rtc_generation | |||||
into its | |||||
.Va td_rtcgen | |||||
member before reading the RTC. | |||||
If the real-time clock is adjusted, these functions will set | |||||
.Va td_rtcgen | |||||
to zero and return zero. | |||||
The caller should reconsider its orientation with the new RTC value. | |||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
When awakened by a call to | When awakened by a call to | ||||
.Fn wakeup | .Fn wakeup | ||||
or | or | ||||
.Fn wakeup_one , | .Fn wakeup_one , | ||||
if a signal is pending and | if a signal is pending and | ||||
.Dv PCATCH | .Dv PCATCH | ||||
is specified, | is specified, | ||||
a non-zero error code is returned. | a non-zero error code is returned. | ||||
If the thread is awakened by a call to | If the thread is awakened by a call to | ||||
.Fn wakeup | .Fn wakeup | ||||
or | or | ||||
.Fn wakeup_one , | .Fn wakeup_one , | ||||
the | the | ||||
.Fn msleep , | .Fn msleep , | ||||
.Fn msleep_spin , | .Fn msleep_spin , | ||||
.Fn tsleep , | .Fn tsleep , | ||||
and locking primitive sleep functions return 0. | and locking primitive sleep functions return 0. | ||||
Zero can also be returned when the real-time clock is adjusted; | |||||
see above regarding | |||||
.Va td_rtcgen . | |||||
Otherwise, a non-zero error code is returned. | Otherwise, a non-zero error code is returned. | ||||
.Sh ERRORS | .Sh ERRORS | ||||
.Fn msleep , | .Fn msleep , | ||||
.Fn msleep_spin , | .Fn msleep_spin , | ||||
.Fn tsleep , | .Fn tsleep , | ||||
and the locking primitive sleep functions will fail if: | and the locking primitive sleep functions will fail if: | ||||
.Bl -tag -width Er | .Bl -tag -width Er | ||||
.It Bq Er EINTR | .It Bq Er EINTR | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |