[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

prochadd Kernel Service

Purpose

Adds a system-wide process state-change notification routine.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/proc.h>


void prochadd ( term)
struct proch *term;

Parameters

term Points to a proch structure containing a notification routine to be added from the chain of systemwide notification routines.

Description

The prochadd kernel service allows kernel extensions to register for notification of major process state transitions. The prochadd service allows the caller to be notified when a process:

The complete list of callouts is:

Callout Description
PROCH_INITIALIZE Process (pid) created (initp, kforkx)
PROCH_TERMINATE Process (pid) terminated (kexitx)
PROCH_EXEC Process (pid) executing (execvex)
THREAD_INITIALIZE Thread (tid) created (kforkx, thread_create)
THREAD_TERMINATE Thread (tid) created (kexitx, thread_terminate)

The prochadd service is typically used to allow recovery or reassignment of resources when processes undergo major state changes.

The caller should allocate a proch structure and update the proch.handler field with the entry point of a caller-supplied notification routine before calling the prochadd kernel service. This notification routine is called once for each process in the system undergoing a major state change.

The proch structure has the following form:

struct proch
{
        struct proch *next
        void                  *handler ();
}

Execution Environment

The prochadd kernel service can be called from the process environment only.

Related Information

The prochdel kernel service.

The Process State-Change Notification Routine.

Kernel Extension and Driver Management Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]