summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-04-03 07:41:27 +0000
committerjoerg <joerg@FreeBSD.org>1996-04-03 07:41:27 +0000
commit3df8f69d632b4601015a3cac380832984cd2052d (patch)
tree0335bdc8ddcc41a6cbcbb523f9f7b986bea9768a
parent45af70879e3c0d3f34893352cbdfbd8e71b15794 (diff)
downloadFreeBSD-src-3df8f69d632b4601015a3cac380832984cd2052d.zip
FreeBSD-src-3df8f69d632b4601015a3cac380832984cd2052d.tar.gz
Populate this. :)
Add a man page for tsleep()/wakeup().
-rw-r--r--share/man/man9/Makefile6
-rw-r--r--share/man/man9/sleep.9112
2 files changed, 117 insertions, 1 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index b8960c7..759da53 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1,5 +1,9 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
-MAN9= devfs_add_devswf.9 devfs_link.9 intro.9 style.9
+MAN9= devfs_add_devswf.9 devfs_link.9 intro.9 sleep.9 style.9
+
+MLINKS+= \
+ sleep.9 tsleep.9 \
+ sleep.9 wakeup.9
.include <bsd.prog.mk>
diff --git a/share/man/man9/sleep.9 b/share/man/man9/sleep.9
new file mode 100644
index 0000000..d66c2b2
--- /dev/null
+++ b/share/man/man9/sleep.9
@@ -0,0 +1,112 @@
+.\"
+.\" Copyright (c) 1996 Joerg Wunsch
+.\"
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $Id$
+.\" "
+.Dd April 3, 1996
+.Os
+.Dt SLEEP 9
+.Sh NAME
+.Nm sleep
+.Nd wait for events
+.Sh SYNOPSIS
+.Fd #include <sys/param.h>
+.Fd #include <sys/systm.h>
+.Fd #include <sys/proc.h>
+.Fd #include <sys/errno.h>
+.Ft int
+.Fn tsleep "void *ident" "int priority" "char *wmesg" "int timo"
+.Ft void
+.Fn wakeup "void *ident"
+.Ft int
+.Fn sleep "void *ident" "int priority"
+.Sh DESCRIPTION
+The functions
+.Fn tsleep
+and
+.Fn wakeup
+handle event-based process blocking. If a process must wait for an
+external event, it is put on sleep by
+.Nm tsleep .
+The parameter
+.Ar ident
+is an arbitrary address that uniquely identifies the event on which
+the process is being asleep. All process sleeping on a single
+.Ar ident
+are woken up later by
+.Nm wakeup ,
+often called from inside an interrupt routine, to indicate that the
+resource the process was blocking on is available now.
+.Pp
+The parameter
+.Ar wmesg
+is a string describing the sleep condition for tools like
+.Xr ps 1 .
+Due to the limited space of those programs to display arbitrary strings,
+this message should not be longer than 6 characters.
+.Pp
+.Nm Tsleep
+is the general sleep call. Suspends the current process until a wakeup is
+performed on the specified identifier. The process will then be made
+runnable with the specified
+.Ar priority .
+Sleeps at most
+.Ar timo
+\&/ hz seconds (0 means no timeout). If
+.Ar pri
+includes the
+.Ql PCATCH
+flag, signals are checked before and after sleeping, else signals are
+not checked. Returns 0 if awakened,
+.Ql EWOULDBLOCK
+if the timeout expires. If
+.Ql PCATCH
+is set and a signal needs to be delivered,
+.Ql ERESTART
+is returned if the current system call should be restarted if
+possible, and
+.Ql EINTR
+is returned if the system call should be interrupted by the signal
+.Pq return Ql EINTR .
+.Pp
+.Nm Sleep
+is the traditional form. It doesn't let you specifiy a timeout nor a
+.Ar wmesg ,
+hence its use is deprecated.
+.Sh RETURN VALUES
+See above.
+.Sh SEE ALSO
+.Xr ps 1
+.Sh HISTORY
+The sleep/wakeup process synchronisation mechanism is very old. It
+appeared in a very early version of Unix.
+.Pp
+.Nm Tsleep
+appeared in
+.Bx 4.4 .
+.Sh AUTHORS
+This man page has been written by
+.ie t J\(:org Wunsch.
+.el Joerg Wunsch.
OpenPOWER on IntegriCloud