]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/rt_sigqueueinfo.2
785242528656c64b1aedce239c4a250234abed2f
[thirdparty/man-pages.git] / man2 / rt_sigqueueinfo.2
1 .\" Copyright (c) 2002, 2011 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .TH RT_SIGQUEUEINFO 2 2012-07-13 "Linux" "Linux Programmer's Manual"
24 .SH NAME
25 rt_sigqueueinfo, rt_tgsigqueueinfo \- queue a signal and data
26 .SH SYNOPSIS
27 .nf
28 .BI "int rt_sigqueueinfo(pid_t " tgid ", int " sig ", siginfo_t *" uinfo );
29 .sp
30 .BI "int rt_tgsigqueueinfo(pid_t " tgid ", pid_t " tid ", int " sig ,
31 .BI " siginfo_t *" uinfo );
32 .fi
33
34 .IR Note :
35 There are no glibc wrappers for these system calls; see NOTES.
36 .SH DESCRIPTION
37 The
38 .BR rt_sigqueueinfo ()
39 and
40 .BR rt_tgsigqueueinfo ()
41 system calls are the low-level interfaces used to send a signal plus data
42 to a process or thread.
43 The receiver of the signal can obtain the accompanying data
44 by establishing a signal handler with the
45 .BR sigaction (2)
46 .B SA_SIGINFO
47 flag.
48
49 These system calls are not intended for direct application use;
50 they are provided to allow the implementation of
51 .BR sigqueue (3)
52 and
53 .BR pthread_sigqueue (3).
54
55 The
56 .BR rt_sigqueueinfo ()
57 system call sends the signal
58 .I sig
59 to the thread group with the ID
60 .IR tgid .
61 (The term "thread group" is synonymous with "process", and
62 .I tid
63 corresponds to the traditional UNIX process ID.)
64 The signal will be delivered to an arbitrary member of the thread group
65 (i.e., one of the threads that is not currently blocking the signal).
66
67 The
68 .I uinfo
69 argument specifies the data to accompany the signal.
70 This argument is a pointer to a structure of type
71 .IR siginfo_t ,
72 described in
73 .BR sigaction (2)
74 (and defined by including
75 .IR <sigaction.h> ).
76 The caller should set the following fields in this structure:
77 .TP
78 .I si_code
79 This must be one of the
80 .B SI_*
81 codes in the kernel source file
82 .IR include/asm-generic/siginfo.h ,
83 with the restriction that the code must be negative
84 (i.e., cannot be
85 .BR SI_USER ,
86 which is used by the kernel to indicate a signal sent by
87 .BR kill (2))
88 and cannot (since Linux 2.6.39) be
89 .BR SI_TKILL
90 (which is used by the kernel to indicate a signal sent using
91 .\" tkill(2) or
92 .BR tgkill (2)).
93 .TP
94 .I si_pid
95 This should be set to a process ID,
96 typically the process ID of the sender.
97 .TP
98 .I si_uid
99 This should be set to a user ID,
100 typically the real user ID of the sender.
101 .TP
102 .I si_value
103 This field contains the user data to accompany the signal.
104 For more information, see the description of the last
105 .RI ( "union sigval" )
106 argument of
107 .BR sigqueue (3).
108 .PP
109 Internally, the kernel sets the
110 .I si_signo
111 field to the value specified in
112 .IR sig ,
113 so that the receiver of the signal can also obtain
114 the signal number via that field.
115
116 The
117 .BR rt_tgsigqueueinfo ()
118 system call is like
119 .BR rt_sigqueueinfo (),
120 but sends the signal and data to the single thread
121 specified by the combination of
122 .IR tgid ,
123 a thread group ID,
124 and
125 .IR tid ,
126 a thread in that thread group.
127 .SH "RETURN VALUE"
128 On success, these system calls return 0.
129 On error, they return \-1 and
130 .I errno
131 is set to indicate the error.
132 .SH ERRORS
133 .TP
134 .B EAGAIN
135 The limit of signals which may be queued has been reached.
136 (See
137 .BR signal (7)
138 for further information.)
139 .TP
140 .B EINVAL
141 .IR sig ,
142 .IR tgid ,
143 or
144 .IR tid
145 was invalid.
146 .TP
147 .B EPERM
148 The caller does not have permission to send the signal to the target.
149 For the required permissions, see
150 .BR kill (2).
151 Or:
152 .I uinfo->si_code
153 is invalid.
154 .TP
155 .B ESRCH
156 .BR rt_sigqueueinfo ():
157 No thread group matching
158 .I tgid
159 was found.
160 .br
161 .BR rt_tgsigqueinfo ():
162 No thread matching
163 .I tgid
164 and
165 .I tid
166 was found.
167 .SH VERSIONS
168 The
169 .BR rt_sigqueueinfo ()
170 system call was added to Linux in version 2.2.
171 The
172 .BR rt_tgsigqueueinfo ()
173 system call was added to Linux in version 2.6.31.
174 .SH "CONFORMING TO"
175 These system calls are Linux-specific.
176 .SH NOTES
177 Since these system calls are not intended for application use,
178 there are no glibc wrapper functions; use
179 .BR syscall (2)
180 in the unlikely case that you want to call them directly.
181
182 As with
183 .BR kill (2),
184 the null signal (0) can be used to check if the specified process
185 or thread exists.
186 .SH "SEE ALSO"
187 .BR kill (2),
188 .BR sigaction (2),
189 .BR sigprocmask (2),
190 .BR tgkill (2),
191 .BR pthread_sigqueue (3),
192 .BR sigqueue (3),
193 .BR signal (7)