Back to index

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

Go to the source code of this file.

Defines

#define TEST_FUNCTION   do_test ()

Functions

static int do_test (void)

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 59 of file tst-signal4.c.


Function Documentation

static int do_test ( void  ) [static]

Definition at line 27 of file tst-signal4.c.

{
  sigset_t ss;

  sigemptyset (&ss);

  int i;
  for (i = 0; i < 10000; ++i)
    {
      long int r = random ();

      if (r != SIG_BLOCK && r != SIG_SETMASK && r != SIG_UNBLOCK)
       {
         int e = pthread_sigmask (r, &ss, NULL);

         if (e == 0)
           {
             printf ("pthread_sigmask succeeded for how = %ld\n", r);
             exit (1);
           }

         if (e != EINVAL)
           {
             puts ("pthread_sigmask didn't return EINVAL");
             exit (1);
           }
       }
    }

  return 0;
}

Here is the call graph for this function: