Back to index

glibc  2.9
Functions
on_exit.c File Reference
#include <stdlib.h>
#include "exit.h"
#include <atomic.h>
#include <sysdep.h>

Go to the source code of this file.

Functions

int __on_exit (void(*func)(int status, void *arg), void *arg)

Function Documentation

int __on_exit ( void(*)(int status, void *arg func,
void *  arg 
)

Definition at line 26 of file on_exit.c.

{
  struct exit_function *new = __new_exitfn ();

  if (new == NULL)
    return -1;

#ifdef PTR_MANGLE
  PTR_MANGLE (func);
#endif
  new->func.on.fn = func;
  new->func.on.arg = arg;
  atomic_write_barrier ();
  new->flavor = ef_on;
  return 0;
}

Here is the call graph for this function: