OSDN Git Service

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