Back to index

glibc  2.9
Defines | Functions | Variables
bug-atexit2.c File Reference
#include <dlfcn.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "../test-skeleton.c"

Go to the source code of this file.

Defines

#define TEST_FUNCTION   do_test ()

Functions

static void f1 (void)
static void f2 (void)
static void f3 (void)
static int do_test (void)

Variables

static int next = 3

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 52 of file bug-atexit2.c.


Function Documentation

static int do_test ( void  ) [static]

Definition at line 35 of file bug-atexit2.c.

{
  atexit (f1);

  void *dso = dlopen ("$ORIGIN/bug-atexit2-lib.so", RTLD_NOW);
  void (*fn) (void) = (void (*) (void)) dlsym (dso, "foo");
  fn ();

  atexit (f2);

  dlclose (dso);

  atexit (f3);

  return 0;
}

Here is the call graph for this function:

static void f1 ( void  ) [static]

Definition at line 11 of file bug-atexit2.c.

{
  puts ("f1");
  if (next-- != 1)
    _exit (1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void f2 ( void  ) [static]

Definition at line 19 of file bug-atexit2.c.

{
  puts ("f2");
  if (next-- != 2)
    _exit (1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void f3 ( void  ) [static]

Definition at line 27 of file bug-atexit2.c.

{
  puts ("f3");
  if (next-- != 3)
    _exit (1);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int next = 3 [static]

Definition at line 8 of file bug-atexit2.c.