1 .\" Copyright (c) 2002 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" added note on self-signaling, aeb, 2002-06-07
24 .\" added note on CAP_KILL, mtk, 2004-06-16
26 .TH SIGQUEUE 3 2011-09-18 "Linux" "Linux Programmer's Manual"
28 sigqueue, rt_sigqueueinfo \- queue a signal and data to a process
30 .B #include <signal.h>
32 .BI "int sigqueue(pid_t " pid ", int " sig ", const union sigval " value );
35 Feature Test Macro Requirements for glibc (see
36 .BR feature_test_macros (7)):
40 _POSIX_C_SOURCE\ >=\ 199309L
43 sends the signal specified in
45 to the process whose PID is given in
47 The permissions required to send a signal are the same as for
51 the null signal (0) can be used to check if a process with a given
56 argument is used to specify an accompanying item of data (either an integer
57 or a pointer value) to be sent with the signal, and has the following type:
68 If the receiving process has installed a handler for this signal using the
72 then it can obtain this data via the
76 structure passed as the second argument to the handler.
79 field of that structure will be set to
84 returns 0, indicating that the signal was successfully
85 queued to the receiving process.
86 Otherwise \-1 is returned and
88 is set to indicate the error.
92 The limit of signals which may be queued has been reached.
95 for further information.)
102 The process does not have permission to send the signal
103 to the receiving process.
104 For the required permissions, see
108 No process has a PID matching
111 This system call first appeared in Linux 2.2.
115 If this function results in the sending of a signal to the process
116 that invoked it, and that signal was not blocked by the calling thread,
117 and no other threads were willing to handle this signal (either by
118 having it unblocked, or by waiting for it using
120 then at least some signal must be delivered to this thread before this
123 On Linux, this function is implemented using the
124 .BR rt_sigqueueinfo (2)
126 The system call differs in its third argument, which is the
128 structure that will be supplied to the receiving process's
129 signal handler or returned by the receiving process's
134 wrapper, this argument,
136 is initialized as follows:
140 uinfo.si_signo = sig; /* argument supplied to sigqueue() */
141 uinfo.si_code = SI_QUEUE;
142 uinfo.si_pid = getpid(); /* Process ID of sender */
143 uinfo.si_uid = getuid(); /* Real UID of sender */
144 uinfo.si_value = val; /* argument supplied to sigqueue() */
149 .BR rt_sigqueueinfo (2),
152 .BR pthread_sigqueue (3),