1.\" Copyright (c) 1983, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)sigsuspend.2 8.2 (Berkeley) 05/16/95 7.\" 8.Dd 9.Dt SIGSUSPEND 2 10.Os 11.Sh NAME 12.Nm sigsuspend 13.Nd atomically release blocked signals and wait for interrupt 14.Sh SYNOPSIS 15.Fd #include <signal.h> 16.Ft int 17.Fn sigsuspend "const sigset_t *sigmask" 18.Sh DESCRIPTION 19.Fn Sigsuspend 20temporarily changes the blocked signal mask to the set to which 21.Fa sigmask 22points, 23and then waits for a signal to arrive; 24on return the previous set of masked signals is restored. 25The signal mask set 26is usually empty to indicate that all 27signals are to be unblocked for the duration of the call. 28.Pp 29In normal usage, a signal is blocked using 30.Xr sigprocmask 2 31to begin a critical section, variables modified on the occurrence 32of the signal are examined to determine that there is no work 33to be done, and the process pauses awaiting work by using 34.Fn sigsuspend 35with the previous mask returned by 36.Xr sigprocmask . 37.Sh RETURN VALUES 38The 39.Fn sigsuspend 40function 41always terminates by being interrupted, returning -1 with 42.Va errno 43set to 44.Dv EINTR . 45.Sh SEE ALSO 46.Xr sigprocmask 2 , 47.Xr sigaction 2 , 48.Xr sigsetops 3 49.Sh STANDARDS 50The 51.Nm sigsuspend 52function call 53conforms to 54.St -p1003.1-88 . 55