Signal APIs

Topics covered here include:

Signal Concepts

An X/Open specification defines a signal (1) as a mechanism by which a process may be notified of, or affected by, an event occurring in the system. The term signal is also used to refer to the event itself.

A signal is said to be generated when the event that causes the signal first occurs. Examples of such events include the following:

A synchronous signal is a signal that is generated by some action attributable to a program running within the thread, such as a system-detected error, raise(), or CEESGL. An asynchronous signal is a signal that is generated for the process by using the kill() function or by an asynchronous event such as terminal activity or an expired timer.

The signal action vector is a list of signal-handling actions for each defined signal. The signal action vector is maintained separately for each process and is inherited from the parent process. The signal action vector specifies the signal-handling actions for both synchronously and asynchronously generated signals.

A signal is said to be delivered to a process when the specified signal-handling action for the signal is taken. A signal is said to be accepted by a process when a signal is selected and returned by one of the sigwait functions.

Signals generated for a process are delivered to or accepted by one thread in the process.

A signal is said to be pending during the interval between the time the signal is generated and the time it is delivered or accepted. Ordinarily, this interval cannot be detected by an application. However, a signal can be blocked from being delivered to a thread. When a signal is blocked, the signal-handling action associated with the signal is not taken. If there are no threads in a call to a sigwait function selecting the signal and if all threads block delivery of the signal, the signal remains pending on the process. The signal remains pending until either a thread calls a sigwait function selecting the signal, a thread unblocks delivery of the signal, or the signal action associated with the signal is set to ignore the signal. The signal blocking mask defines the set of signals that are blocked from delivery to the thread. The signal blocking mask is maintained separately for each thread in the process and is inherited from the thread that created it.


Top | Signal APIs | UNIX-Type APIs
APIs by category

[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]