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