Back to index

glibc  2.9
Functions | Variables
tst-fini1mod.c File Reference
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

Go to the source code of this file.

Functions

static void * tf (void *arg)
static void __attribute ((destructor))
void m (void)

Variables

static pthread_t th

Function Documentation

static void __attribute ( (destructor)  ) [static]

Definition at line 46 of file tst-fini1mod.c.

{
  if (pthread_cancel (th) != 0)
    {
      puts ("cancel failed");
      _exit (1);
    }
  void *r;
  if (pthread_join (th, &r) != 0)
    {
      puts ("join failed");
      _exit (1);
    }
  /* Exit successfully.  */
  _exit (0);
}

Here is the call graph for this function:

void m ( void  )

Definition at line 65 of file tst-fini1mod.c.

{
  if (pthread_create (&th, NULL, tf, NULL) != 0)
    {
      puts ("create failed");
      _exit (1);
    }
}

Here is the call graph for this function:

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

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

{
  int fds[2];
  if (pipe (fds) != 0)
    {
      puts ("pipe failed");
      exit (1);
    }

  char buf[10];
  read (fds[0], buf, sizeof (buf));

  puts ("read returned");
  exit (1);
}

Here is the call graph for this function:


Variable Documentation

pthread_t th [static]

Definition at line 43 of file tst-fini1mod.c.