From bb5fd2c384242f209a1df166c28f3622dd851cc9 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Wed, 15 May 1985 22:49:18 -0800 Subject: [PATCH] manual page distributed with 4.1BSD SCCS-vsn: old/man/sigset.3 4.1 SCCS-vsn: lib/libc/gen/sleep.3 4.1 --- usr/src/lib/libc/gen/sleep.3 | 31 ++++++++ usr/src/old/man/sigset.3 | 143 +++++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 usr/src/lib/libc/gen/sleep.3 create mode 100644 usr/src/old/man/sigset.3 diff --git a/usr/src/lib/libc/gen/sleep.3 b/usr/src/lib/libc/gen/sleep.3 new file mode 100644 index 0000000000..1745e931d6 --- /dev/null +++ b/usr/src/lib/libc/gen/sleep.3 @@ -0,0 +1,31 @@ +.\" Copyright (c) 1980 Regents of the University of California. +.\" All rights reserved. The Berkeley software License Agreement +.\" specifies the terms and conditions for redistribution. +.\" +.\" @(#)sleep.3 4.1 (Berkeley) %G% +.\" +.TH SLEEP 3 +.UC 4 +.SH NAME +sleep \- suspend execution for interval +.SH SYNOPSIS +.nf +.B sleep(seconds) +.B unsigned seconds; +.fi +.SH DESCRIPTION +The current process is suspended from execution for the number +of seconds specified by the argument. +The actual suspension time may be up to 1 second less than +that requested, because scheduled wakeups occur at fixed 1-second intervals, +and an arbitrary amount longer because of other activity +in the system. +.PP +The routine is implemented by setting an alarm clock signal +and pausing until it occurs. +The previous state of this signal is saved and restored. +If the sleep time exceeds the time to the alarm signal, +the process sleeps only until the signal would have occurred, and the +signal is sent 1 second later. +.SH "SEE ALSO" +alarm(2), pause(2) diff --git a/usr/src/old/man/sigset.3 b/usr/src/old/man/sigset.3 new file mode 100644 index 0000000000..5242d211d3 --- /dev/null +++ b/usr/src/old/man/sigset.3 @@ -0,0 +1,143 @@ +.\" Copyright (c) 1980 Regents of the University of California. +.\" All rights reserved. The Berkeley software License Agreement +.\" specifies the terms and conditions for redistribution. +.\" +.\" @(#)sigset.3 4.1 (Berkeley) %G% +.\" +.TH SIGSET 3 +.UC 4 +.SH NAME +sigset, signal, sighold, sigignore, sigrelse, sigpause \- manage signals +.SH SYNOPSIS +.nf +.B #include +.B void action(); +.B int sig; +.PP +.B sigset(sig, action) +.B signal(sig, action) +.PP +.B sighold(sig) +.B sigignore(sig) +.B sigrelse(sig) +.PP +.B sigpause(sig) +.PP +.fi +.B cc ... \-ljobs +.nf +.SH DESCRIPTION +This is a package of signal management functions to manage the signals +as described in +.IR sigsys (2). +These functions are available only in this version of UNIX, and should +not be used when the mechanisms of +.IR signal (2) +would suffice, as they would then impair portability. +These functions are contained in the \fIjobs\fR library, obtained by +specifying the loader option \fB\-ljobs\fR. +.PP +.I Sigset +is used to provide a default signal handler for signal +.I sig. +This function is remembered across subsequent calls to the other +functions, and need not be specified again. +After +.I sigset +instances of +.I sig +will cause an interrupt to be taken at +.I func, +with the signal then held so that recursive trapping due to +the signal will not occur. During normal return from +.I func, +the routines arrange for the signal action to be restored so that +subsequent signals will also trap to +.I func. +If a non-local exit is to be taken, then +.I sigrelse +must be called to un-hold the signal action, restoring the +original catch. +.I Func +may also be specified as +SIG_DFL, SIG_IGN or SIG_HOLD, as described in +.IR sigsys (2). +The value specified on the previous call to +.I sigset +is returned; if +.I sigset +has never been called, then the default action inherited from the +system is returned. +.PP +.I Signal +is like +.I sigset, +but the signal will not be held when the action routine is called; +rather it will have reverted to SIG_DFL. +This is generally unsafe, but is included for backwards compatibility +to the old signal mechanism. +It should not be used. +.PP +.I Sighold +and +.I sigrelse +may be used to block off +.I sig +in a piece of code where it cannot be tolerated. +After +.I sigrelse +the catch initially set with +.I sigset +will be restored. +.PP +.I Sigignore +can be used to temporarily set the action for +.I sig +to ignore the signal. If the signal had been held before +the call to +.I sigignore, +any pending instance of the signal will be discarded. +.PP +.I Sigpause +may be used by a routine which wishes to check for some condition +produced at interrupt level by the +.I sig +signal, and then to pause waiting for the condition to arise with +the catch of the signal enabled. +In correct usage it must be preceded by an instance of +.I sighold +to block the signal. +.I Sigpause +is like +.I pause +in that it will return after +.I any +signal is processed. +The usual thing to do then is to reenable the hold with +.I sighold, +check the condition +again, and +.I sigpause +again if the condition has not arisen. +.SH "SEE ALSO" +sigsys(2), signal(2), jobs(3), tty(4) +.SH BUGS +.I Sighold +and +.I sigrelse +do not nest; the first +.I sigrelse +restores the default catch. +.PP +These functions store information in data space. You thus +.B must +call +.IR sigsys (2) +rather than any of +.I sigset +or +.I signal +after a +.IR vfork (2) +in the child which is to then +.IR exec (2). -- 2.20.1