sigemptyset()

Initialize a set to contain no signals

Synopsis:

#include <signal.h>

int sigemptyset( sigset_t *set );

Arguments:

set
A pointer to the sigset_t object that you want to initialize.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

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

Returns:

0
Success.
-1
An error occurred (errno is set).

Examples:

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

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" );
  }

int main( void )
  {
    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 );
    return EXIT_SUCCESS;
  }

Classification:

POSIX 1003.1

Safety:  
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes