sigfillset()--Initialize and Fill Signal Set
Syntax
#include <signal.h> int sigfillset( sigset_t *set );
Service Program Name: QPOSSRV1
Default Public Authority: *USE
Threadsafe: Yes
The sigfillset() function is part of a family of functions that manipulate signal sets. Signal sets are data objects that let a thread keep track of groups of signals. For example, a thread might create a signal set to record which signals it is blocking, and another signal set to record which signals are pending. Signal sets are used to manipulate groups of signals used by other functions (such as sigprocmask()) or to examine signal sets returned by other functions (such as sigpending()).
sigfillset() initializes the signal set specified by set to a complete set. That is, the set includes all supported signals (see Control Signals Table).
Authorities and Locks
None.
Parameters
- *set
- (Input) A pointer to a signal set.
Return Value
0 | sigfillset() was successful. |
Error Conditions
The sigfillset() function does not return an error.
Related Information
- The <signal.h> file (see Header
Files for UNIX®-Type Functions)
- sigaction()--Examine and Change Signal Action
- sigaddset()--Add Signal to Signal Set
- sigdelset()--Delete Signal from Signal Set
- sigemptyset()--Initialize and Empty Signal
Set
- sigismember()--Test for Signal in Signal Set
- sigprocmask()--Examine and Change Blocked
Signals
- sigpending()--Examine Pending Signals
- sigsuspend()--Wait for Signal
- sigtimedwait()--Synchronously Accept a Signal for
Interval of Time
- sigwait()--Synchronously Accept a Signal
- sigwaitinfo()--Synchronously Accept a Signal and Signal Data
Example
The following example initializes a set of signals to the complete set.
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
#include <stdio.h> #include <unistd.h> #include <signal.h> int main( int argc, char *argv[] ) { sigset_t sigset; /* * Blocking all signals ensures that the signal * handling action for the signals in the set is * not taken until the signals are unblocked. */ sigfillset( &sigset ); sigprocmask( SIG_SETMASK, &sigset, NULL ); printf( "before kill()\n" ); kill( getpid(), SIGUSR2 ); printf( "after kill()\n" ); return( 0 ); }
Output:
before kill() after kill()
API introduced: V3R6