| KPAUSE(9) | Kernel Developer's Manual | KPAUSE(9) |
kpause — make the
calling LWP sleep
#include
<sys/proc.h>
int
kpause(const
char *wmesg, bool
intr, int timeo,
kmutex_t *mtx);
kpause()
makes the calling LWP sleep. It's similar to
cv_timedwait_sig(9)
without the corresponding
cv_signal(9).
kpause()
can wake up spontaneously. Callers should prepare to handle it.
kpause().
The kernel does not use this argument directly but makes it available for
utilities such as ps(1) to
display.kpause().
Zero means no timeout.
NULL, mtx will be released
once the LWP has prepared to sleep, and will be reacquired before
kpause()
returns.kpause() returns 0 when waking up
spontaneously. Otherwise, it returns an error number.
EINTR]kpause() returned due to other reasons. Typically
as a result of a signal without SA_RESTART
property.ERESTART]kpause() returned as a result of a signal with
SA_RESTART property.EWOULDBLOCK]sigaction(2), condvar(9), delay(9), errno(9), hz(9), mstohz(9)
| July 20, 2011 | NetBSD 11.0 |