OSDN Git Service

6519237fe2f1944b26ac465f3b82089a2990898d
[linuxjm/LDP_man-pages.git] / original / man3 / pthread_sigqueue.3
1 .\" Copyright (c) 2010 Michael Kerrisk, <mtk.manpages@gmail.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
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.
23 .\" %%%LICENSE_END
24 .\"
25 .TH PTHREAD_SIGQUEUE 3 2012-08-19 "Linux" "Linux Programmer's Manual"
26 .SH NAME
27 pthread_sigqueue \- queue a signal and data to a thread
28 .SH SYNOPSIS
29 .nf
30 .B #include <pthread.h>
31
32 .BI "int pthread_sigqueue(pthread_t " thread ", int " sig ,
33 .BI "                     const union sigval " value );
34 .fi
35 .sp
36 Compile and link with \fI\-pthread\fP.
37 .sp
38 .in -4n
39 Feature Test Macro Requirements for glibc (see
40 .BR feature_test_macros (7)):
41 .in
42 .sp
43 .BR pthread_sigqueue ():
44 _GNU_SOURCE
45 .SH DESCRIPTION
46 The
47 .BR pthread_sigqueue ()
48 function performs a similar task to
49 .BR sigqueue (3),
50 but, rather than sending a signal to a process,
51 it sends a signal to a thread in the same process as the
52 calling thread.
53
54 The
55 .I thread
56 argument is the ID of a thread in the same process as the caller.
57 The
58 .I sig
59 argument specifies the signal to be sent.
60 The
61 .I value
62 argument specifies data to accompany the signal; see
63 .BR sigqueue (3)
64 for details.
65 .SH RETURN VALUE
66 On success,
67 .BR pthread_sigqueue ()
68 returns 0;
69 on error, it returns an error number.
70 .SH ERRORS
71 .TP
72 .B EAGAIN
73 The limit of signals which may be queued has been reached.
74 (See
75 .BR signal (7)
76 for further information.)
77 .TP
78 .B EINVAL
79 .I sig
80 was invalid.
81 .TP
82 .B ENOSYS
83 .BR pthread_sigqueue ()
84 is not supported on this system.
85 .TP
86 .B ESRCH
87 .I thread
88 is not valid.
89 .SH VERSIONS
90 The
91 .BR pthread_sigqueue ()
92 function first appeared in glibc 2.11.
93 .SH CONFORMING TO
94 This function is a GNU extension.
95 .SH SEE ALSO
96 .BR rt_tgsigqueueinfo (2),
97 .BR sigaction (2),
98 .BR pthread_sigmask (3),
99 .BR sigqueue (3),
100 .BR sigwait (3),
101 .BR pthreads (7),
102 .BR signal (7)
103 .SH COLOPHON
104 This page is part of release 3.64 of the Linux
105 .I man-pages
106 project.
107 A description of the project,
108 and information about reporting bugs,
109 can be found at
110 \%http://www.kernel.org/doc/man\-pages/.