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