1SIGQUEUE(3P) POSIX Programmer's Manual SIGQUEUE(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 sigqueue — queue a signal to a process
13
15 #include <signal.h>
16
17 int sigqueue(pid_t pid, int signo, union sigval value);
18
20 The sigqueue() function shall cause the signal specified by signo to be
21 sent with the value specified by value to the process specified by pid.
22 If signo is zero (the null signal), error checking is performed but no
23 signal is actually sent. The null signal can be used to check the
24 validity of pid.
25
26 The conditions required for a process to have permission to queue a
27 signal to another process are the same as for the kill() function.
28
29 The sigqueue() function shall return immediately. If SA_SIGINFO is set
30 for signo and if the resources were available to queue the signal, the
31 signal shall be queued and sent to the receiving process. If SA_SIGINFO
32 is not set for signo, then signo shall be sent at least once to the
33 receiving process; it is unspecified whether value shall be sent to the
34 receiving process as a result of this call.
35
36 If the value of pid causes signo to be generated for the sending
37 process, and if signo is not blocked for the calling thread and if no
38 other thread has signo unblocked or is waiting in a sigwait() function
39 for signo, either signo or at least the pending, unblocked signal shall
40 be delivered to the calling thread before the sigqueue() function
41 returns. Should any multiple pending signals in the range SIGRTMIN to
42 SIGRTMAX be selected for delivery, it shall be the lowest numbered one.
43 The selection order between realtime and non-realtime signals, or
44 between multiple pending non-realtime signals, is unspecified.
45
47 Upon successful completion, the specified signal shall have been
48 queued, and the sigqueue() function shall return a value of zero. Oth‐
49 erwise, the function shall return a value of -1 and set errno to indi‐
50 cate the error.
51
53 The sigqueue() function shall fail if:
54
55 EAGAIN No resources are available to queue the signal. The process has
56 already queued {SIGQUEUE_MAX} signals that are still pending at
57 the receiver(s), or a system-wide resource limit has been
58 exceeded.
59
60 EINVAL The value of the signo argument is an invalid or unsupported
61 signal number.
62
63 EPERM The process does not have appropriate privileges to send the
64 signal to the receiving process.
65
66 ESRCH The process pid does not exist.
67
68 The following sections are informative.
69
71 None.
72