[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

Process State-Change Notification Routine

Purpose

Allows kernel extensions to be notified of major process state transitions.

Syntax

void handler (term, type, pid)
struct proch *term;
int type;
pid_t pid;

Parameters

term Points to a proch structure used in the prochadd call.
type Defines the process's state transition: initialization, termination, swap in, or swap out. These four values, defined in the /usr/include/sys/proc.h file, are as follows:
PROCH_INITIALIZE Process is initializing.
PROCH_TERMINATE Process is terminating.
PROCH_SWAPIN Process has been swapped in.
PROCH_SWAPOUT Process is about to be swapped out.
pid Defines the process ID of the process.

Description

For process initialization, the process state-change notification routine is called in the execution environment of a parent process for the initialization of a newly created child process. For kernel processes, the notification routine is called when the initp kernel service is called to complete initialization.

For process termination, the notification routines are called before the kernel handles default termination procedures. They are called in a LIFO order. The routines must be written so as not to allocate any resources under the terminating process. The notification routine is called under the process image of the terminating process.

The notification routine is activated for a swap in when a process has just been swapped in and is about to be put on the ready-to-run queue. At the point of call to the notification routine, the process's u block has been pinned.

The notification routine is activated for a swap out when a process is about to be swapped out. At the point of call to the notification routine, the process u block has not yet been unpinned.

Implementation Specifics

This routine is part of Base Operating System (BOS) Runtime.

Related Information

The prochadd kernel service, prochdel kernel service.

Kernel Extension and Device Driver Management Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]