Contains the address of a notification routine that is invoked each time the sysconfig subroutine is called with the SYS_SETPARMS command.
int func (cmd, cur, new) int cmd; struct var *cur; struct var *new;
The cur and new var structures are both in the system address space.
The configuration notification control block contains the address of a notification routine. This structure is intended to be used as a list element in a list of similar control blocks maintained by the kernel.
Each control block has the following definition:
struct cfgncb { struct cfgncb *cbnext; /* next block on chain */ struct cfgncb *cbprev; /* prev control block on chain */ int (*func)(); /* notification function */ };
The cfgndel or cfgnadd kernel service can be used to add or delete a cfgncb control block from the cfgncb list. To use either of these kernel services, the calling routine must define the cfgncb control block. This definition can be done using the /usr/include/sys/sysconfig.h file.
Every time a SYS_SETPARMS sysconfig command is issued, the sysconfig subroutine iterates through the kernel list of cfgncb blocks, invoking each notification routine with a CFGV_PREPARE command. This call represents the first pass of what is for the notification routine a two-pass process.
On a CFGV_PREPARE command, the cfgncb.func notification routine should determine if any values of interest have changed. All changed values should be checked for validity. If the values are valid, a return code of 0 should be returned. Otherwise, a return value indicating the byte offset of the first field in error in the new var structure should be returned.
If all registered notification routines create a return code of 0, then no value errors have been detected during validity checking. In this case, the sysconfig subroutine issues its second pass call to the cfgncb.func routine and sends the same parameters, although the cmd parameter contains a value of CFGV_COMMIT. This indicates that the new values go into effect at the earliest opportunity.
An example of notification routine processing might be the following. Suppose the user wishes to increase the size of the block I/O buffer cache. On a CFGV_PREPARE command, the block I/O notification routine would verify that the proposed new size for the cache is legal. On a CFGV_COMMIT command, the notification routine would then make the additional buffers available to the user by chaining more buffers onto the existing list of buffers.
The cfgncb control block is part of Base Operating System (BOS) Runtime.
The cfgnadd kernel service, cfgndel kernel service.
The SYS_SETPARMS sysconfig operation.
Kernel Extension and Device Driver Management Kernel Services in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.