Back to index

glibc  2.9
Functions
unregister-atfork.c File Reference
#include <errno.h>
#include <stdlib.h>
#include "fork.h"

Go to the source code of this file.

Functions

void __unregister_atfork (void *dso_handle)

Function Documentation

void __unregister_atfork ( void *  dso_handle)

Definition at line 26 of file unregister-atfork.c.

{
  /* Get the lock to not conflict with running forks.  */
  __libc_lock_lock (__fork_block.lock);

  list_t *runp;
  list_t *prevp;

  list_for_each_prev_safe (runp, prevp, &__fork_block.prepare_list)
    if (list_entry (runp, struct fork_handler, list)->dso_handle == dso_handle)
      list_del (runp);

  list_for_each_prev_safe (runp, prevp, &__fork_block.parent_list)
    if (list_entry (runp, struct fork_handler, list)->dso_handle == dso_handle)
      list_del (runp);

  list_for_each_prev_safe (runp, prevp, &__fork_block.child_list)
    if (list_entry (runp, struct fork_handler, list)->dso_handle == dso_handle)
      list_del (runp);

  /* Release the lock.  */
  __libc_lock_unlock (__fork_block.lock);
}