Back to index

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

Go to the source code of this file.

Defines

#define RUN(test)
#define TEST_FUNCTION   do_test ()

Functions

static int do_test (void)

Define Documentation

#define RUN (   test)
Value:
errno = 0;                                                           \
  e = test;                                                          \
  if (e != -1)                                                              \
    {                                                                \
      printf ("%s returned %d\n", #test, e);                                \
      result = 1;                                                    \
    }                                                                \
  else if (errno != EINVAL)                                          \
    {                                                                \
      printf ("%s didn't set errno to EINVAL (%s instead)\n",               \
             #test, strerror (errno));                                      \
      result = 1;                                                    \
    }
#define TEST_FUNCTION   do_test ()

Definition at line 56 of file tst-sigsimple.c.


Function Documentation

static int do_test ( void  ) [static]

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

{
  int result = 0;
  int e;

#define RUN(test) \
  errno = 0;                                                         \
  e = test;                                                          \
  if (e != -1)                                                              \
    {                                                                \
      printf ("%s returned %d\n", #test, e);                                \
      result = 1;                                                    \
    }                                                                \
  else if (errno != EINVAL)                                          \
    {                                                                \
      printf ("%s didn't set errno to EINVAL (%s instead)\n",               \
             #test, strerror (errno));                                      \
      result = 1;                                                    \
    }

  RUN (sighold (-1));
  RUN (sighold (_NSIG + 100));

  RUN (sigrelse (-1));
  RUN (sigrelse (_NSIG + 100));

  return result;
}

Here is the call graph for this function: