Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ atfork(3) — HP-UX 10.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fork(2)

atfork(3)

NAME

atfork − Arranges for fork cleanup handling

SYNOPSIS

#include <pthread.h> void atfork void (*user_state, void (*pre_fork)(), void (*parent_fork)(),  void (*child_fork)());

PARAMETERS

user_statePointer to the user state that is passed to each routine. 

pre_forkRoutine to be called before performing the fork. 

parent_forkRoutine to be called in the parent after the fork. 

child_forkRoutine to be called in the child after the fork. 

DESCRIPTION

The atfork() routine allows you to register three routines to be executed at different times relative to a fork.  The different times and/or places are as follows:  Just prior to the fork in the parent process.  Just after the fork in the parent process.  Just after the fork in the created (child) process. Use these routines to clean up just prior to fork(), to set up after fork(), and to perform locking relative to fork().  You are allowed to provide one parameter to be used in conjunction with all the routines.  This parameter must be user_state.

RETURN VALUES

The atfork() routine does not return a value.  Instead, an exception is raised if there is insufficient table space to record the handler addresses.

RELATED INFORMATION

Functions: fork(2). 

Hewlett-Packard Company  —  OSF DCE 1.1/HP DCE 1.5

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026