CM_MANAGE(3)

FUNCTION
cm_manage - Register a function to manage a child process.

SYNOPSIS
#include <karma_cm.h>

flag cm_manage

( int pid, void (*stop_func) (), void (*term_func) (), void (*exit_func) () )

DESCRIPTION
This routine will manage a child process for state changes by registering callback routines.

pid The child process ID to manage.

stop_func
    This routine is called when the child is stopped (by a SIGTTIN, SIGTTOU, SIGTSTP, or SIGSTOP signal). If this is NULL, no callback routine is installed. The prototype function is <-cm_PROTO_stop_func->

term_func
    This routine is called when the child terminates due to a signal. If this is NULL, no callback routine is installed. The prototype function is <-cm_PROTO_term_func->.

exit_func
    This routine is called when the child exits due to a call to <<_exit>>. If this is NULL, no callback routine is installed. The prototype function is <-cm_PROTO_exit_func->.

RETURN VALUE
TRUE on success, else FALSE.

Multi-threading Level
Unsafe.

NOTE
If a child process is killed or exits, its callback routines are automatically removed. The <<term_func>> or <<exit_func>> MUST NOT unmanage the child process.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/