OSDN Git Service

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