Back to index

glibc  2.9
Defines | Functions
tst-sigset.c File Reference
#include <signal.h>
#include <stdio.h>
#include "../test-skeleton.c"

Go to the source code of this file.

Defines

#define TEST_FUNCTION   do_test ()
#define TRY(call)

Functions

static int do_test (void)

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 6 of file tst-sigset.c.

#define TRY (   call)
Value:
if (call)                                                            \
    {                                                                \
      printf ("%s (sig = %d): %m\n", #call, sig);                           \
      result = 1;                                                    \
    }                                                                \
  else

Function Documentation

static int do_test ( void  ) [static]

Definition at line 8 of file tst-sigset.c.

{
  int result = 0;
  int sig = -1;

#define TRY(call)                                                    \
  if (call)                                                          \
    {                                                                \
      printf ("%s (sig = %d): %m\n", #call, sig);                           \
      result = 1;                                                    \
    }                                                                \
  else


  sigset_t set;
  TRY (sigemptyset (&set) != 0);

#ifdef SIGRTMAX
  int max_sig = SIGRTMAX;
#else
  int max_sig = NSIG - 1;
#endif

  for (sig = 1; sig <= max_sig; ++sig)
    {
      TRY (sigismember (&set, sig) != 0);
      TRY (sigaddset (&set, sig) != 0);
      TRY (sigismember (&set, sig) == 0);
      TRY (sigdelset (&set, sig) != 0);
      TRY (sigismember (&set, sig) != 0);
    }

  return result;
}

Here is the call graph for this function: