Back to index

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

Go to the source code of this file.

Functions

static void prepare (void)
static void parent (void)
static void child (void)
static void __attribute__ ((constructor))

Variables

int val

Function Documentation

static void __attribute__ ( (constructor)  ) [static]

Definition at line 47 of file tst-atfork2mod.c.

{
  extern void *__dso_handle;
  printf ("dsohandle = %p\n", __dso_handle);

  if (pthread_atfork (prepare, parent, child) != 0)
    {
      puts ("init: atfork failed");
      exit (1);
    }
}

Here is the call graph for this function:

static void child ( void  ) [static]

Definition at line 41 of file tst-atfork2mod.c.

{
  val *= 8;
}

Here is the caller graph for this function:

static void parent ( void  ) [static]

Definition at line 35 of file tst-atfork2mod.c.

{
  val *= 4;
}

Here is the caller graph for this function:

static void prepare ( void  ) [static]

Definition at line 29 of file tst-atfork2mod.c.

{
  ++val;
}

Here is the caller graph for this function:


Variable Documentation

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