Back to index

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

Go to the source code of this file.


#define TIMEOUT   1
#define TEST_FUNCTION   do_test ()


static void * tf (void *arg)
static int do_test (void)

Define Documentation


Definition at line 69 of file tst-eintr3.c.

#define TEST_FUNCTION   do_test ()

Definition at line 71 of file tst-eintr3.c.

#define TIMEOUT   1

Definition at line 70 of file tst-eintr3.c.

Function Documentation

static int do_test ( void  ) [static]

Definition at line 44 of file tst-eintr3.c.

  pthread_t self = pthread_self ();

  setup_eintr (SIGUSR1, &self);

  pthread_t th;
  char buf[100];
  int e = pthread_create (&th, NULL, tf, NULL);
  if (e != 0)
      printf ("main: pthread_create failed: %s\n",
             strerror_r (e, buf, sizeof (buf)));
      exit (1);

  /* This call must never return.  */
  e = pthread_join (th, NULL);

  if (e == EINTR)
    puts ("pthread_join returned with EINTR");

  return 0;

Here is the call graph for this function:

static void* tf ( void *  arg) [static]

Definition at line 31 of file tst-eintr3.c.

  pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
  pthread_mutex_lock (&m);
  /* This call must not return.  */
  pthread_mutex_lock (&m);

  puts ("tf: mutex_lock returned");
  exit (1);

Here is the call graph for this function: