Requesting notification of I/O configuration changes

If you have code that monitors or works with software I/O configuration, you can code authorized programs that track dynamic I/O configuration changes, and respond to requested and completed configuration changes.

You can use either the ENFREQ macro or the CONFCHG macro to request notification of I/O configuration changes. The ENFREQ macro is recommended because it is a general interface that allows authorized programs to listen for different types of system events. In contrast, CONFCHG can only be used to listen for I/O configuration changes.

Authorized programs can request the system to notify them of the following events:
  • A requested or rejected I/O configuration change that involves deleting either a device or a path to a device (event code=31 on the ENFREQ macro, or CHGREQ parameter on the CONFCHG macro). A program that pins UCBs might need to know when a configuration change is requested that involves a device whose UCB the program has pinned. The program can then unpin the UCB to allow the requested change to be made. If the request is subsequently rejected, the program can re-pin the device.
    Note: See Pinning and unpinning UCBs for more information on pinning and unpinning.
  • A successful configuration change (event code=32 on the ENFREQ macro, or CHGCOMPL parameter on the CONFCHG macro). Programs might need to know when a change completed successfully so they can keep track of devices that are added, deleted or modified.

A program that requests notification of dynamic I/O configuration changes must be authorized, unlocked, enabled, and in task mode.

To request notification of dynamic I/O configuration changes in your installation, do the following:
  • Code configuration change exit routines that will receive control for a particular notification. (See Coding a configuration change user exit routine.) Code a different configuration change exit routine for each type of notification.
  • Issue the ENFREQ or CONFCHG macro within your program for each notification you request. You must issue the macro separately for each type of notification.

The subtopics of this topic deal with how to use CONFCHG to request notification of I/O configuration changes. See Listening for system events for how to use ENFREQ to establish a listen request and code a listener user exit routine.