[Previous]
[Contents]
[Next]

sigemptyset()

initialize a set to contain no signals

Synopsis:

#include <signal.h>
int sigemptyset( sigset_t *set );

Description:

The sigemptyset() function initializes set to contain no signals.

Returns:

0
Success
-1
An error occurred. errno is set to indicate the error.

Examples:

#include <stdio.h>
#include <signal.h>

void main()
  {
    sigset_t set;

    sigemptyset( &set );
    print( set, SIGINT );

    sigfillset( &set );
    print( set, SIGINT );

    sigdelset( &set, SIGINT );
    print( set, SIGINT );

    sigaddset( &set, SIGINT );
    print( set, SIGINT );
  }

void print( sigset_t set, int signo )
  {

    printf( "Set %8.8lx. Signal %d is ", set, signo );
    if( sigismember( &set, signo ) )
      printf( "a member.\n" );
    else
      printf( "not a member.\n" );
  }

Classification:

POSIX 1003.1

Safety:
Interrupt handler Yes
Signal handler Yes, but modifies errno
Thread Yes

See also:

errno, kill(), raise(), sigaction(), sigaddset(), sigdelset(), sigfillset(), sigismember(), signal(), sigpending(), sigprocmask()


[Previous]
[Contents]
[Next]