2 .\" Copyright (c) 2002 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" added note on self-signaling, aeb, 2002-06-07
7 .\" added note on CAP_KILL, mtk, 2004-06-16
9 .TH sigqueue 3 (date) "Linux man-pages (unreleased)"
11 sigqueue \- queue a signal and data to a process
14 .RI ( libc ", " \-lc )
17 .B #include <signal.h>
19 .BI "int sigqueue(pid_t " pid ", int " sig ", const union sigval " value );
23 Feature Test Macro Requirements for glibc (see
24 .BR feature_test_macros (7)):
29 _POSIX_C_SOURCE >= 199309L
33 sends the signal specified in
35 to the process whose PID is given in
37 The permissions required to send a signal are the same as for
41 the null signal (0) can be used to check if a process with a given
46 argument is used to specify an accompanying item of data (either an integer
47 or a pointer value) to be sent with the signal, and has the following type:
58 If the receiving process has installed a handler for this signal using the
62 then it can obtain this data via the
66 structure passed as the second argument to the handler.
69 field of that structure will be set to
74 returns 0, indicating that the signal was successfully
75 queued to the receiving process.
76 Otherwise, \-1 is returned and
78 is set to indicate the error.
82 The limit of signals which may be queued has been reached.
85 for further information.)
92 The process does not have permission to send the signal
93 to the receiving process.
94 For the required permissions, see
98 No process has a PID matching
101 For an explanation of the terms used in this section, see
107 Interface Attribute Value
112 T} Thread safety MT-Safe
115 .SS C library/kernel differences
118 is implemented using the
119 .BR rt_sigqueueinfo (2)
121 The system call differs in its third argument, which is the
123 structure that will be supplied to the receiving process's
124 signal handler or returned by the receiving process's
129 wrapper, this argument,
131 is initialized as follows:
135 uinfo.si_signo = sig; /* Argument supplied to sigqueue() */
136 uinfo.si_code = SI_QUEUE;
137 uinfo.si_pid = getpid(); /* Process ID of sender */
138 uinfo.si_uid = getuid(); /* Real UID of sender */
139 uinfo.si_value = val; /* Argument supplied to sigqueue() */
148 If this function results in the sending of a signal to the process
149 that invoked it, and that signal was not blocked by the calling thread,
150 and no other threads were willing to handle this signal (either by
151 having it unblocked, or by waiting for it using
153 then at least some signal must be delivered to this thread before this
157 .BR rt_sigqueueinfo (2),
160 .BR pthread_sigqueue (3),