i5/OS PASE Signal Handling

i5/OS PASE Signals and ILE Signals

OS/PASE signals and POSIX/ILE signals are independent, so it is not possible to directly call a handler for one signal type by raising the other type of signal. However, the Post an i5/OS PASE Signal (Qp2SignalPase) API can be used as the handler for any ILE signal to post a corresponding i5/OS PASE signal. An i5/OS PASE program can also define handlers for i5/OS PASE signals that call ILE procedures to post equivalent ILE signals. Program QP2SHELL and the i5/OS PASE fork function always setup handlers to map every ILE signal to a corresponding i5/OS PASE signal.


i5/OS Messages and i5/OS PASE Programs

Many i5/OS applications and system functions report errors with exception messages sent to program call message queues. See Message Handling Terms and Concepts for information about exception messages and program call message queues.

The system only creates program call message queues for ILE procedures and OMI programs. Any machine exception caused by an operation inside an i5/OS PASE program (such as MCH0601 for a storage reference error) is sent to the program call message queue for an (internal) ILE procedure in service program QP2USER. This ILE procedure is also the apparent caller of any ILE procedure the i5/OS PASE program calls directly (using _ILECALLX or _ILECALL), so any i5/OS message the called procedure sends to its caller goes to the same message queue used for machine exceptions.


i5/OS Exceptions and i5/OS PASE Signals

The ILE procedure in service program QP2USER that runs i5/OS PASE programs handles any exception and converts it to an i5/OS PASE signal, the same way POSIX/ILE C runtime converts exceptions to ILE signals. The specific signal used depends on the i5/OS message identifier for the exception. i5/OS PASE and ILE use different signal numbers, but both map any specific message identifier to the same signal name (such as SIGSEGV). See the WebSphere Development Studio: ILE C/C++ Programmer's GuideLink to PDF for details.

An i5/OS PASE signal handler can determine whether a signal is associated with an exception message by inspecting field msgkey in the ucontext_t_os400 structure (declared in header file as400_types.h) that is passed as an argument to the handler. A non-zero value is the message reference key for the i5/OS message that caused the signal. Zero indicates the signal is not associated with an i5/OS message (which is always true for asynchronous signals). The i5/OS PASE program can use the message reference key to receive the exception message (see Receive Program Message for i5/OS PASE) for more details about the error.




Top | i5/OS PASE APIs | APIs by category