1*47208Scael.\" Copyright (c) 1983, 1991 The Regents of the University of California. 244870Skarels.\" All rights reserved. 344870Skarels.\" 444870Skarels.\" %sccs.include.redist.man% 544870Skarels.\" 6*47208Scael.\" @(#)sigsuspend.2 6.2 (Berkeley) 03/10/91 744870Skarels.\" 8*47208Scael.Dd 9*47208Scael.Dt SIGSUSPEND 2 10*47208Scael.Os BSD 4.4 11*47208Scael.Sh NAME 12*47208Scael.Nm sigsuspend 13*47208Scael.Nd atomically release blocked signals and wait for interrupt 14*47208Scael.Sh SYNOPSIS 15*47208Scael.Fd #include <sys/signal.h> 16*47208Scael.Ft int 17*47208Scael.Fn sigsuspend "const sigset_t *sigmask" 18*47208Scael.Sh DESCRIPTION 19*47208Scael.Fn Sigsuspend 2044870Skarelstemporarily changes the blocked signal mask to the set to which 21*47208Scael.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. 28*47208Scael.Pp 2944870SkarelsIn normal usage, a signal is blocked using 30*47208Scael.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 34*47208Scael.Fn sigsuspend 3544870Skarelswith the previous mask returned by 36*47208Scael.Xr sigprocmask . 37*47208Scael.Sh RETURN VALUES 38*47208ScaelThe 39*47208Scael.Fn sigsuspend 40*47208Scaelfunction 41*47208Scaelalways terminates by being interrupted, returning -1 with 42*47208Scael.Va errno 43*47208Scaelset to 44*47208Scael.Dv EINTR . 45*47208Scael.Sh SEE ALSO 46*47208Scael.Xr sigprocmask 2 , 47*47208Scael.Xr sigaction 2 , 48*47208Scael.Xr sigsetops 3 49*47208Scael.Sh STANDARDS 50*47208ScaelThe 51*47208Scael.Fn sigsupend 52*47208Scaelfunction call 53*47208Scaelconforms to IEEE Std 1003.1-1988 54*47208Scael.Pq Dq Tn POSIX . 55