Asynchronous signal delivery under z/OS UNIX
Your z/OS® UNIX application program might require its active processes to be able to react and respond to events occurring in the system or resulting from the actions of other processes communicating with its processes. One way of accomplishing such interprocess communication is for you to code your application program to identify signal conditions and determine how to react or respond when a signal condition is received from another application process.
signal.h
header file will be located and available
to your application program. Your system programmer or the application
program's designer should provide this information.
signal.h
include file.A signal is a mechanism by which a process can be notified of, or affected by, an event occurring in the system. Examples of such events include hardware exceptions and specific actions by processes. The term signal also refers to an event itself.
The POSIX.1-defined sigaction()
function allows a calling application
process to examine a specific signal condition and specify the processing
action to be associated with it.
You can code your application program to use the sigaction()
function
in different ways. Two simplistic examples of using signals within z/OS UNIX C/C++
application programs follow:
- A process is forked but the process is aborted if the signal handler receives an incorrect value.
- A request is received from a client process to provide information from a database. The server process is a single point of access to the database.
If coded properly for handling and delivering interprocess signals, your application program can receive signals from other processes and interpret those signals such that the appropriate processing procedure occurs for each specific signal condition received. Your application program also can send signals and wait for responses to signal handling events from other application processes. Note that signals are not the best method of interprocess communication, because they can easily be lost if more than one is delivered at the same time. You may want to use other methods of interprocess communication, such as pipes, message queues, shared memory, or semaphores.