xref: /csrg-svn/lib/libc/sys/sigsuspend.2 (revision 69507)
161185Sbostic.\" Copyright (c) 1983, 1991, 1993
261185Sbostic.\"	The Regents of the University of California.  All rights reserved.
344870Skarels.\"
450487Scael.\" %sccs.include.redist.roff%
544870Skarels.\"
6*69507Smckusick.\"	@(#)sigsuspend.2	8.2 (Berkeley) 05/16/95
744870Skarels.\"
847208Scael.Dd
947208Scael.Dt SIGSUSPEND 2
1050487Scael.Os
1147208Scael.Sh NAME
1247208Scael.Nm sigsuspend
1347208Scael.Nd atomically release blocked signals and wait for interrupt
1447208Scael.Sh SYNOPSIS
1555757Sbostic.Fd #include <signal.h>
1647208Scael.Ft int
1747208Scael.Fn sigsuspend "const sigset_t *sigmask"
1847208Scael.Sh DESCRIPTION
1947208Scael.Fn Sigsuspend
2044870Skarelstemporarily changes the blocked signal mask to the set to which
2147208Scael.Fa sigmask
2244870Skarelspoints,
2344870Skarelsand then waits for a signal to arrive;
2444870Skarelson return the previous set of masked signals is restored.
2544870SkarelsThe signal mask set
2644870Skarelsis usually empty to indicate that all
2744870Skarelssignals are to be unblocked for the duration of the call.
2847208Scael.Pp
2944870SkarelsIn normal usage, a signal is blocked using
3047208Scael.Xr sigprocmask 2
3144870Skarelsto begin a critical section, variables modified on the occurrence
3244870Skarelsof the signal are examined to determine that there is no work
3344870Skarelsto be done, and the process pauses awaiting work by using
3447208Scael.Fn sigsuspend
3544870Skarelswith the previous mask returned by
3647208Scael.Xr sigprocmask .
3747208Scael.Sh RETURN VALUES
3847208ScaelThe
3947208Scael.Fn sigsuspend
4047208Scaelfunction
4147208Scaelalways terminates by being interrupted, returning -1 with
4247208Scael.Va errno
4347208Scaelset to
4447208Scael.Dv EINTR .
4547208Scael.Sh SEE ALSO
4647208Scael.Xr sigprocmask 2 ,
4747208Scael.Xr sigaction 2 ,
4847208Scael.Xr sigsetops 3
4947208Scael.Sh STANDARDS
5047208ScaelThe
51*69507Smckusick.Nm sigsuspend
5247208Scaelfunction call
5350487Scaelconforms to
5450487Scael.St -p1003.1-88 .
55