child_nfy.c File Reference

Go to the source code of this file.

Functions

int hook_child_init (hook_child_init_t func)
int hook_child_term (hook_child_term_t func)

Function Documentation

int hook_child_init ( hook_child_init_t  func  ) 

Set a hook to be notified when new children get forked.

When the main server forks a child func will be called in the child context so it'll have the opportunity to initialize any one-per-process resources.

Note that a single child can (and probably will) handle more then one HTTP connection.

Pass a NULL pointer to disable a previously set hook.

Parameters:
func the function pointer
Returns:
0 on success, not zero on error

Definition at line 21 of file child_nfy.c.

int hook_child_term ( hook_child_term_t  func  ) 

Set a hook to be notified when a child is about to die.

This hook executes just before the child dies; you may use it to free resources allocated by the hook_child_init hook.

Pass a NULL pointer to disable a previously set hook.

Parameters:
func the function pointer
Returns:
0 on success, not zero on error

Definition at line 47 of file child_nfy.c.