sigfillset() — Initialize a signal mask to include all signals

Standards

Standards / Extensions C or C++ Dependencies

POSIX.1
XPG4
XPG4.2
Single UNIX Specification, Version 3

both  

Format

#define _POSIX_SOURCE
#include <signal.h>

int sigfillset(sigset_t *set);

General description

Initializes a signal set set to the complete set of supported signals.

sigfillset() is part of a family of functions that manipulate signal sets. Signal sets are data objects that let a process keep track of groups of signals. For example, a process can create one 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()).

Returned value

If successful, sigfillset() returns 0.

There are no documented errno values.

Example

CELEBS18
⁄* CELEBS18

   This example initializes a set of signals to a complete set.

 *⁄
#define _POSIX_SOURCE
#include <stdio.h>
#include <signal.h>
#include <unistd.h>

main() {
  sigset_t sigset;

  sigfillset(&sigset);

  sigprocmask(SIG_SETMASK, &sigset, NULL);

  puts("before kill()");
  kill(getpid(), SIGSEGV);
  puts("after kill()");
}
Output
before kill()
after kill()

Related information