2 .\" Copyright (c) 2004 Hiten Pandya <hmp@dragonflybsd.org>
3 .\" Copyright (c) 1996 Joerg Wunsch
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
17 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 .\" $FreeBSD: src/share/man/man9/sleep.9,v 1.18.2.5 2001/12/17 11:30:19 ru Exp $
28 .\" $DragonFly: src/share/man/man9/sleep.9,v 1.3 2004/05/10 12:04:36 hmp Exp $
37 .Nd wait/sleep/block for events
43 .Fn tsleep "void *ident" "int flag" "const char *wmesg" "int timo"
45 .Fn wakeup "void *ident"
47 .Fn wakeup_one "void *ident"
53 handle event-based process blocking.
54 If a process must wait for an
55 external event, it is put on sleep by
59 is an arbitrary address that uniquely identifies the event on which
60 the process is being asleep.
61 All processes sleeping on a single
65 often called from inside an interrupt routine, to indicate that the
66 resource the process/thread was blocking on is available now.
70 is a string describing the sleep condition for tools like
72 Due to the limited space of those programs to display arbitrary strings,
73 this message should not be longer than 6 characters.
77 function is used to make the first process/thread in the queue that is
78 sleeping on the parameter
81 This can prevent the system from becoming saturated
82 when a large number of processes/threads are sleeping on the same address,
83 but only one of them can actually do any useful work when made
88 function is general in its use and suspends the current process/thread until a
89 wakeup is performed on the specified identifier.
90 The process/thread will then be made runnable.
91 The process/thread will sleep at most
93 \&/ hz seconds (0 means no timeout).
98 flag, signals are checked before and after sleeping, else signals are
100 .Sh IMPLEMENTATION NOTES
107 ignores priority information because it is not required by the
112 flag set are assumed to be disk-waits, otherwise they are
119 if awakened, otherwise an appropriate error code is returned.
123 The timeout will expire.
125 The signal needs to be delivered to the system call should and
126 it should be restarted if possible.
132 The system needs to be interrupted by the signal.
142 The sleep/wakeup process synchronization mechanism is very old.
143 It appeared in a very early version of Unix.
150 This manual page was written by
155 .An Hiten Pandya Aq hmp@dragonflybsd.org