OSDN Git Service

306f1624c3a4ee99575e565552f51a095ec5e6a4
[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-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 ATTRIBUTES
94 .SS Multithreading (see pthreads(7))
95 The
96 .BR pthread_sigqueue ()
97 function is thread-safe.
98 .SH CONFORMING TO
99 This function is a GNU extension.
100 .SH SEE ALSO
101 .BR rt_tgsigqueueinfo (2),
102 .BR sigaction (2),
103 .BR pthread_sigmask (3),
104 .BR sigqueue (3),
105 .BR sigwait (3),
106 .BR pthreads (7),
107 .BR signal (7)
108 .SH COLOPHON
109 This page is part of release 3.67 of the Linux
110 .I man-pages
111 project.
112 A description of the project,
113 information about reporting bugs,
114 and the latest version of this page,
115 can be found at
116 \%http://www.kernel.org/doc/man\-pages/.