sigqueue(3R) manual page
Table of Contents
sigqueue - queue a signal to a process
cc [ flag ... ] file ...
-lposix4 [ library ... ]
#include <signal.h>
int sigqueue(pid_t pid, int signo,
const union sigval value);
union sigval {
int sival_int; /* integer value */
void *sival_ptr; /* pointer value */
};
Async-Signal-Safe
sigqueue() causes the signal, signo
to be sent with the value, value to the process, pid. If signo is zero (the
null signal), error checking is performed, but no signal is actually sent.
The null signal can be used to check the validity of pid.
The conditions
required for a process to have permission to queue a signal to another
process are the same as for kill(2)
.
If resources were not available to
queue the signal, sigqueue() exits and returns immediately. If SA_SIGINFO
is set for signo in the receiving process, and if the resources were available,
the signal is left queued and pending. If SA_SIGINFO is not set for signo,
then signo is sent at least once to the receiving process.
If the value
of pid causes signo to be generated for the sending process, and if signo
is not blocked, either signo or at least the pending, unblocked signal
with the lowest number will be delivered to the sending process before
sigqueue() returns.
If successful, sigqueue() returns 0, and
queues the specified signal. Otherwise, sigqueue() returns -1 and sets errno
to indicate the error condition.
- EAGAIN
- No resources are available
to queue the signal. The process has already queued {SIGQUEUE_MAX} signals
that are still pending at the receiver(s), or a system wide resource limit
has been exceeded.
- EINVAL
- The value of signo is an invalid or unsupported
signal number.
- ENOSYS
- sigqueue() is not supported by this implementation.
- EPERM
- The process does not have the appropriate privilege to send the
signal to the receiving process.
- ESRCH
- The process pid does not exist.
kill(2)
, sigwaitinfo(3R)
, siginfo(5)
, signal(5)
Table of Contents