Processing Signals
The sender can use sigqueue
()
to send a signal together
with a small amount of information to a target process.
To queue subsequent occurrences of a pending signal, the target process must have the
SA_SIGINFO
bit set for the specified signal. For more
information,see the
sigaction
(2) man page.
The target process normally receive signals asynchronously. To receive signals synchronously,
block the signal and call either sigwaitinfo
()
or
sigtimedwait
()
. For more information, see the
sigprocmask
(2) man page. This procedure causes the signal to be
received synchronously. The value sent by the caller of sigqueue
()
is stored in the si_value
member of the
siginfo_t
argument. Leaving the signal unblocked causes the
signal to be delivered to the signal handler specified by
sigaction
(), with the value appearing in the
si_value
of the siginfo_t
argument to the
handler.
A specified number of signals with associated values can be sent by
a process and remain undelivered. Storage for {SIGQUEUE_MAX
}
signals is allocated at the first call to sigqueue
(). Thereafter,
a call to the command either successfully enqueues at the target process or
fails within a bounded amount of time.