OSDN Git Service

(split) LDP: Translation snapshots.
[linuxjm/LDP_man-pages.git] / po4a / pthread / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2012-04-23 07:54+0900\n"
10 "PO-Revision-Date: 2012-04-25 05:03+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man2/getcontext.2:23
20 #, no-wrap
21 msgid "GETCONTEXT"
22 msgstr "GETCONTEXT"
23
24 #. type: TH
25 #: build/C/man2/getcontext.2:23
26 #, no-wrap
27 msgid "2009-03-15"
28 msgstr "2009-03-15"
29
30 #. type: TH
31 #: build/C/man2/getcontext.2:23 build/C/man3/pthread_attr_init.3:24
32 #: build/C/man3/pthread_attr_setaffinity_np.3:24
33 #: build/C/man3/pthread_attr_setdetachstate.3:24
34 #: build/C/man3/pthread_attr_setguardsize.3:24
35 #: build/C/man3/pthread_attr_setinheritsched.3:24
36 #: build/C/man3/pthread_attr_setschedparam.3:24
37 #: build/C/man3/pthread_attr_setschedpolicy.3:24
38 #: build/C/man3/pthread_attr_setscope.3:24
39 #: build/C/man3/pthread_attr_setstack.3:24
40 #: build/C/man3/pthread_attr_setstackaddr.3:24
41 #: build/C/man3/pthread_attr_setstacksize.3:24
42 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_cleanup_push.3:24
43 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
44 #: build/C/man3/pthread_create.3:24 build/C/man3/pthread_detach.3:24
45 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
46 #: build/C/man3/pthread_getattr_np.3:24
47 #: build/C/man3/pthread_getcpuclockid.3:24 build/C/man3/pthread_join.3:24
48 #: build/C/man3/pthread_kill.3:24
49 #: build/C/man3/pthread_kill_other_threads_np.3:24
50 #: build/C/man3/pthread_self.3:24 build/C/man3/pthread_setaffinity_np.3:24
51 #: build/C/man3/pthread_setcancelstate.3:24
52 #: build/C/man3/pthread_setconcurrency.3:23
53 #: build/C/man3/pthread_setschedparam.3:24
54 #: build/C/man3/pthread_setschedprio.3:24 build/C/man3/pthread_sigmask.3:24
55 #: build/C/man3/pthread_sigqueue.3:23 build/C/man3/pthread_testcancel.3:24
56 #: build/C/man3/pthread_tryjoin_np.3:24 build/C/man3/pthread_yield.3:23
57 #: build/C/man7/pthreads.7:24
58 #, no-wrap
59 msgid "Linux"
60 msgstr "Linux"
61
62 #. type: TH
63 #: build/C/man2/getcontext.2:23 build/C/man3/makecontext.3:25
64 #: build/C/man3/pthread_attr_init.3:24
65 #: build/C/man3/pthread_attr_setaffinity_np.3:24
66 #: build/C/man3/pthread_attr_setdetachstate.3:24
67 #: build/C/man3/pthread_attr_setguardsize.3:24
68 #: build/C/man3/pthread_attr_setinheritsched.3:24
69 #: build/C/man3/pthread_attr_setschedparam.3:24
70 #: build/C/man3/pthread_attr_setschedpolicy.3:24
71 #: build/C/man3/pthread_attr_setscope.3:24
72 #: build/C/man3/pthread_attr_setstack.3:24
73 #: build/C/man3/pthread_attr_setstackaddr.3:24
74 #: build/C/man3/pthread_attr_setstacksize.3:24
75 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_cleanup_push.3:24
76 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
77 #: build/C/man3/pthread_create.3:24 build/C/man3/pthread_detach.3:24
78 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
79 #: build/C/man3/pthread_getattr_np.3:24
80 #: build/C/man3/pthread_getcpuclockid.3:24 build/C/man3/pthread_join.3:24
81 #: build/C/man3/pthread_kill.3:24
82 #: build/C/man3/pthread_kill_other_threads_np.3:24
83 #: build/C/man3/pthread_self.3:24 build/C/man3/pthread_setaffinity_np.3:24
84 #: build/C/man3/pthread_setcancelstate.3:24
85 #: build/C/man3/pthread_setconcurrency.3:23
86 #: build/C/man3/pthread_setschedparam.3:24
87 #: build/C/man3/pthread_setschedprio.3:24 build/C/man3/pthread_sigmask.3:24
88 #: build/C/man3/pthread_sigqueue.3:23 build/C/man3/pthread_testcancel.3:24
89 #: build/C/man3/pthread_tryjoin_np.3:24 build/C/man3/pthread_yield.3:23
90 #: build/C/man7/pthreads.7:24
91 #, no-wrap
92 msgid "Linux Programmer's Manual"
93 msgstr "Linux Programmer's Manual"
94
95 #. type: SH
96 #: build/C/man2/getcontext.2:24 build/C/man3/makecontext.3:26
97 #: build/C/man3/pthread_attr_init.3:25
98 #: build/C/man3/pthread_attr_setaffinity_np.3:25
99 #: build/C/man3/pthread_attr_setdetachstate.3:25
100 #: build/C/man3/pthread_attr_setguardsize.3:25
101 #: build/C/man3/pthread_attr_setinheritsched.3:25
102 #: build/C/man3/pthread_attr_setschedparam.3:25
103 #: build/C/man3/pthread_attr_setschedpolicy.3:25
104 #: build/C/man3/pthread_attr_setscope.3:25
105 #: build/C/man3/pthread_attr_setstack.3:25
106 #: build/C/man3/pthread_attr_setstackaddr.3:25
107 #: build/C/man3/pthread_attr_setstacksize.3:25
108 #: build/C/man3/pthread_cancel.3:25 build/C/man3/pthread_cleanup_push.3:25
109 #: build/C/man3/pthread_cleanup_push_defer_np.3:25
110 #: build/C/man3/pthread_create.3:25 build/C/man3/pthread_detach.3:25
111 #: build/C/man3/pthread_equal.3:25 build/C/man3/pthread_exit.3:25
112 #: build/C/man3/pthread_getattr_np.3:25
113 #: build/C/man3/pthread_getcpuclockid.3:25 build/C/man3/pthread_join.3:25
114 #: build/C/man3/pthread_kill.3:25
115 #: build/C/man3/pthread_kill_other_threads_np.3:25
116 #: build/C/man3/pthread_self.3:25 build/C/man3/pthread_setaffinity_np.3:25
117 #: build/C/man3/pthread_setcancelstate.3:25
118 #: build/C/man3/pthread_setconcurrency.3:24
119 #: build/C/man3/pthread_setschedparam.3:25
120 #: build/C/man3/pthread_setschedprio.3:25 build/C/man3/pthread_sigmask.3:25
121 #: build/C/man3/pthread_sigqueue.3:24 build/C/man3/pthread_testcancel.3:25
122 #: build/C/man3/pthread_tryjoin_np.3:25 build/C/man3/pthread_yield.3:24
123 #: build/C/man7/pthreads.7:25
124 #, no-wrap
125 msgid "NAME"
126 msgstr "名前"
127
128 #. type: Plain text
129 #: build/C/man2/getcontext.2:26
130 msgid "getcontext, setcontext - get or set the user context"
131 msgstr "getcontext, setcontext - ユーザコンテキストを取得/設定する"
132
133 #. type: SH
134 #: build/C/man2/getcontext.2:26 build/C/man3/makecontext.3:28
135 #: build/C/man3/pthread_attr_init.3:28
136 #: build/C/man3/pthread_attr_setaffinity_np.3:28
137 #: build/C/man3/pthread_attr_setdetachstate.3:28
138 #: build/C/man3/pthread_attr_setguardsize.3:28
139 #: build/C/man3/pthread_attr_setinheritsched.3:28
140 #: build/C/man3/pthread_attr_setschedparam.3:28
141 #: build/C/man3/pthread_attr_setschedpolicy.3:28
142 #: build/C/man3/pthread_attr_setscope.3:28
143 #: build/C/man3/pthread_attr_setstack.3:28
144 #: build/C/man3/pthread_attr_setstackaddr.3:28
145 #: build/C/man3/pthread_attr_setstacksize.3:28
146 #: build/C/man3/pthread_cancel.3:27 build/C/man3/pthread_cleanup_push.3:28
147 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
148 #: build/C/man3/pthread_create.3:27 build/C/man3/pthread_detach.3:27
149 #: build/C/man3/pthread_equal.3:27 build/C/man3/pthread_exit.3:27
150 #: build/C/man3/pthread_getattr_np.3:27
151 #: build/C/man3/pthread_getcpuclockid.3:27 build/C/man3/pthread_join.3:27
152 #: build/C/man3/pthread_kill.3:27
153 #: build/C/man3/pthread_kill_other_threads_np.3:27
154 #: build/C/man3/pthread_self.3:27 build/C/man3/pthread_setaffinity_np.3:28
155 #: build/C/man3/pthread_setcancelstate.3:28
156 #: build/C/man3/pthread_setconcurrency.3:27
157 #: build/C/man3/pthread_setschedparam.3:28
158 #: build/C/man3/pthread_setschedprio.3:27 build/C/man3/pthread_sigmask.3:27
159 #: build/C/man3/pthread_sigqueue.3:26 build/C/man3/pthread_testcancel.3:27
160 #: build/C/man3/pthread_tryjoin_np.3:28 build/C/man3/pthread_yield.3:26
161 #, no-wrap
162 msgid "SYNOPSIS"
163 msgstr "書式"
164
165 #. type: Plain text
166 #: build/C/man2/getcontext.2:28 build/C/man3/makecontext.3:30
167 msgid "B<#include E<lt>ucontext.hE<gt>>"
168 msgstr "B<#include E<lt>ucontext.hE<gt>>"
169
170 #. type: Plain text
171 #: build/C/man2/getcontext.2:30
172 msgid "B<int getcontext(ucontext_t *>I<ucp>B<);>"
173 msgstr "B<int getcontext(ucontext_t *>I<ucp>B<);>"
174
175 #. type: Plain text
176 #: build/C/man2/getcontext.2:32
177 msgid "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
178 msgstr "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
179
180 #. type: SH
181 #: build/C/man2/getcontext.2:32 build/C/man3/makecontext.3:35
182 #: build/C/man3/pthread_attr_init.3:37
183 #: build/C/man3/pthread_attr_setaffinity_np.3:40
184 #: build/C/man3/pthread_attr_setdetachstate.3:39
185 #: build/C/man3/pthread_attr_setguardsize.3:39
186 #: build/C/man3/pthread_attr_setinheritsched.3:39
187 #: build/C/man3/pthread_attr_setschedparam.3:39
188 #: build/C/man3/pthread_attr_setschedpolicy.3:39
189 #: build/C/man3/pthread_attr_setscope.3:39
190 #: build/C/man3/pthread_attr_setstack.3:52
191 #: build/C/man3/pthread_attr_setstackaddr.3:39
192 #: build/C/man3/pthread_attr_setstacksize.3:39
193 #: build/C/man3/pthread_cancel.3:35 build/C/man3/pthread_cleanup_push.3:38
194 #: build/C/man3/pthread_cleanup_push_defer_np.3:38
195 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
196 #: build/C/man3/pthread_equal.3:35 build/C/man3/pthread_exit.3:35
197 #: build/C/man3/pthread_getattr_np.3:36
198 #: build/C/man3/pthread_getcpuclockid.3:36 build/C/man3/pthread_join.3:35
199 #: build/C/man3/pthread_kill.3:35
200 #: build/C/man3/pthread_kill_other_threads_np.3:33
201 #: build/C/man3/pthread_self.3:35 build/C/man3/pthread_setaffinity_np.3:40
202 #: build/C/man3/pthread_setcancelstate.3:37
203 #: build/C/man3/pthread_setconcurrency.3:36
204 #: build/C/man3/pthread_setschedparam.3:39
205 #: build/C/man3/pthread_setschedprio.3:35 build/C/man3/pthread_sigmask.3:36
206 #: build/C/man3/pthread_sigqueue.3:43 build/C/man3/pthread_testcancel.3:35
207 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
208 #: build/C/man7/pthreads.7:27
209 #, no-wrap
210 msgid "DESCRIPTION"
211 msgstr "説明"
212
213 #. type: Plain text
214 #: build/C/man2/getcontext.2:44
215 msgid ""
216 "In a System V-like environment, one has the two types I<mcontext_t> and "
217 "I<ucontext_t> defined in I<E<lt>ucontext.hE<gt>> and the four functions "
218 "B<getcontext>(), B<setcontext>(), B<makecontext>(3)  and B<swapcontext>(3)  "
219 "that allow user-level context switching between multiple threads of control "
220 "within a process."
221 msgstr ""
222 "System V 的な環境では、 I<mcontext_t> および I<ucontext_t> という 2 つの型"
223 "と、 B<getcontext>(), B<setcontext>(), B<makecontext>(3), B<swapcontext>(3)  "
224 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
225 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
226 "ようになっている。"
227
228 #. type: Plain text
229 #: build/C/man2/getcontext.2:48
230 msgid ""
231 "The I<mcontext_t> type is machine-dependent and opaque.  The I<ucontext_t> "
232 "type is a structure that has at least the following fields:"
233 msgstr ""
234 "I<mcontext_t> 型はマシン依存で、外部からは隠蔽されている。 I<ucontext_t> 型は"
235 "構造体で、少なくとも以下の 4 つのフィールドを持つ。"
236
237 #. type: Plain text
238 #: build/C/man2/getcontext.2:58
239 #, no-wrap
240 msgid ""
241 "typedef struct ucontext {\n"
242 "    struct ucontext *uc_link;\n"
243 "    sigset_t         uc_sigmask;\n"
244 "    stack_t          uc_stack;\n"
245 "    mcontext_t       uc_mcontext;\n"
246 "    ...\n"
247 "} ucontext_t;\n"
248 msgstr ""
249 "typedef struct ucontext {\n"
250 "    struct ucontext *uc_link;\n"
251 "    sigset_t         uc_sigmask;\n"
252 "    stack_t          uc_stack;\n"
253 "    mcontext_t       uc_mcontext;\n"
254 "    ...\n"
255 "} ucontext_t;\n"
256
257 #. type: Plain text
258 #: build/C/man2/getcontext.2:75
259 msgid ""
260 "with I<sigset_t> and I<stack_t> defined in I<E<lt>signal.hE<gt>>.  Here "
261 "I<uc_link> points to the context that will be resumed when the current "
262 "context terminates (in case the current context was created using "
263 "B<makecontext>(3)), I<uc_sigmask> is the set of signals blocked in this "
264 "context (see B<sigprocmask>(2)), I<uc_stack> is the stack used by this "
265 "context (see B<sigaltstack>(2)), and I<uc_mcontext> is the machine-specific "
266 "representation of the saved context, that includes the calling thread's "
267 "machine registers."
268 msgstr ""
269 "I<sigset_t> と I<stack_t> は I<E<lt>signal.hE<gt>> で定義されている。 ここで "
270 "I<uc_link> は、 現在のコンテキストが終了したとき、 続いて切り替わるコンテキス"
271 "トへのポインタである (現在のコンテキストが B<makecontext>(3)  で生成されたも"
272 "のの場合)。 I<uc_sigmask> はこのコンテキストでブロックされている シグナル群で"
273 "ある (B<sigprocmask>(2)  を見よ)。 I<uc_stack> はこのコンテキストが用いている"
274 "スタックである (B<signalstack>(2)  を見よ)。 I<uc_mcontext> は保存されている"
275 "コンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマシ"
276 "ンレジスタが格納される。"
277
278 #. type: Plain text
279 #: build/C/man2/getcontext.2:80
280 msgid ""
281 "The function B<getcontext>()  initializes the structure pointed at by I<ucp> "
282 "to the currently active context."
283 msgstr ""
284 "B<getcontext>()  関数は、 ポインタ I<ucp> が指す構造体を、 現在アクティブなコ"
285 "ンテキストに初期化する。"
286
287 #. type: Plain text
288 #: build/C/man2/getcontext.2:92
289 msgid ""
290 "The function B<setcontext>()  restores the user context pointed at by "
291 "I<ucp>.  A successful call does not return.  The context should have been "
292 "obtained by a call of B<getcontext>(), or B<makecontext>(3), or passed as "
293 "third argument to a signal handler."
294 msgstr ""
295 "B<setcontext>()  関数は、ポインタ I<ucp> が指すユーザコンテキストをリストアす"
296 "る。 呼び出しに成功すると返らない。 このコンテキストは、以前に B<getcontext>"
297 "()  または B<makecontext>(3)  で得られたものか、 あるいはシグナルの第三引数と"
298 "して与えられたものになる。"
299
300 #. type: Plain text
301 #: build/C/man2/getcontext.2:96
302 msgid ""
303 "If the context was obtained by a call of B<getcontext>(), program execution "
304 "continues as if this call just returned."
305 msgstr ""
306 "コンテキストが B<getcontext>()  の呼び出しによって得られていたものの場合は、 "
307 "プログラムはこの呼び出しから返った直後からのように実行を継続する。"
308
309 #. type: Plain text
310 #: build/C/man2/getcontext.2:107
311 msgid ""
312 "If the context was obtained by a call of B<makecontext>(3), program "
313 "execution continues by a call to the function I<func> specified as the "
314 "second argument of that call to B<makecontext>(3).  When the function "
315 "I<func> returns, we continue with the I<uc_link> member of the structure "
316 "I<ucp> specified as the first argument of that call to B<makecontext>(3).  "
317 "When this member is NULL, the thread exits."
318 msgstr ""
319 "コンテキストが B<makecontext>(3)  の呼び出しによって得られていたものの場合"
320 "は、 プログラムの実行はその B<makecontext>(3)  呼び出しの第二引数で指定された"
321 "関数 I<func> を呼び出すかたちで継続する。 I<func> から返ると、 B<makecontext>"
322 "(3)  呼び出しの第一引数で指定されていた I<ucp> 構造体の I<uc_link> メンバで継"
323 "続する。 このメンバが NULL だった場合は、そのスレッドは終了する。"
324
325 #. type: Plain text
326 #: build/C/man2/getcontext.2:114
327 msgid ""
328 "If the context was obtained by a call to a signal handler, then old standard "
329 "text says that \"program execution continues with the program instruction "
330 "following the instruction interrupted by the signal\".  However, this "
331 "sentence was removed in SUSv2, and the present verdict is \"the result is "
332 "unspecified\"."
333 msgstr ""
334 "コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 古"
335 "い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命令"
336 "から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結果"
337 "は定義されていない」である。"
338
339 #. type: SH
340 #: build/C/man2/getcontext.2:114 build/C/man3/makecontext.3:81
341 #: build/C/man3/pthread_attr_init.3:66
342 #: build/C/man3/pthread_attr_setaffinity_np.3:74
343 #: build/C/man3/pthread_attr_setdetachstate.3:75
344 #: build/C/man3/pthread_attr_setguardsize.3:88
345 #: build/C/man3/pthread_attr_setinheritsched.3:82
346 #: build/C/man3/pthread_attr_setschedparam.3:72
347 #: build/C/man3/pthread_attr_setschedpolicy.3:70
348 #: build/C/man3/pthread_attr_setscope.3:89
349 #: build/C/man3/pthread_attr_setstack.3:83
350 #: build/C/man3/pthread_attr_setstackaddr.3:72
351 #: build/C/man3/pthread_attr_setstacksize.3:59
352 #: build/C/man3/pthread_cancel.3:107 build/C/man3/pthread_cleanup_push.3:117
353 #: build/C/man3/pthread_create.3:113 build/C/man3/pthread_detach.3:47
354 #: build/C/man3/pthread_equal.3:39 build/C/man3/pthread_exit.3:69
355 #: build/C/man3/pthread_getattr_np.3:71
356 #: build/C/man3/pthread_getcpuclockid.3:44 build/C/man3/pthread_join.3:68
357 #: build/C/man3/pthread_kill.3:50 build/C/man3/pthread_self.3:44
358 #: build/C/man3/pthread_setaffinity_np.3:75
359 #: build/C/man3/pthread_setcancelstate.3:90
360 #: build/C/man3/pthread_setconcurrency.3:54
361 #: build/C/man3/pthread_setschedparam.3:102
362 #: build/C/man3/pthread_setschedprio.3:51 build/C/man3/pthread_sigmask.3:47
363 #: build/C/man3/pthread_sigqueue.3:63 build/C/man3/pthread_testcancel.3:48
364 #: build/C/man3/pthread_tryjoin_np.3:83 build/C/man3/pthread_yield.3:41
365 #, no-wrap
366 msgid "RETURN VALUE"
367 msgstr "返り値"
368
369 #. type: Plain text
370 #: build/C/man2/getcontext.2:122
371 msgid ""
372 "When successful, B<getcontext>()  returns 0 and B<setcontext>()  does not "
373 "return.  On error, both return -1 and set I<errno> appropriately."
374 msgstr ""
375 "成功すると、 B<getcontext>()  は 0 を返し、 B<setcontext>()  は返らない。 失"
376 "敗すると、両者とも -1 を返し、I<errno> をエラーに応じて設定する。"
377
378 #. type: SH
379 #: build/C/man2/getcontext.2:122 build/C/man3/makecontext.3:93
380 #: build/C/man3/pthread_attr_init.3:69
381 #: build/C/man3/pthread_attr_setaffinity_np.3:77
382 #: build/C/man3/pthread_attr_setdetachstate.3:78
383 #: build/C/man3/pthread_attr_setguardsize.3:91
384 #: build/C/man3/pthread_attr_setinheritsched.3:85
385 #: build/C/man3/pthread_attr_setschedparam.3:75
386 #: build/C/man3/pthread_attr_setschedpolicy.3:73
387 #: build/C/man3/pthread_attr_setscope.3:92
388 #: build/C/man3/pthread_attr_setstack.3:86
389 #: build/C/man3/pthread_attr_setstackaddr.3:75
390 #: build/C/man3/pthread_attr_setstacksize.3:62
391 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_cleanup_push.3:119
392 #: build/C/man3/pthread_create.3:120 build/C/man3/pthread_detach.3:52
393 #: build/C/man3/pthread_equal.3:43 build/C/man3/pthread_exit.3:71
394 #: build/C/man3/pthread_getattr_np.3:74
395 #: build/C/man3/pthread_getcpuclockid.3:47 build/C/man3/pthread_join.3:73
396 #: build/C/man3/pthread_kill.3:55 build/C/man3/pthread_self.3:46
397 #: build/C/man3/pthread_setaffinity_np.3:78
398 #: build/C/man3/pthread_setcancelstate.3:93
399 #: build/C/man3/pthread_setconcurrency.3:66
400 #: build/C/man3/pthread_setschedparam.3:110
401 #: build/C/man3/pthread_setschedprio.3:59 build/C/man3/pthread_sigmask.3:52
402 #: build/C/man3/pthread_sigqueue.3:68 build/C/man3/pthread_testcancel.3:52
403 #: build/C/man3/pthread_tryjoin_np.3:87 build/C/man3/pthread_yield.3:46
404 #, no-wrap
405 msgid "ERRORS"
406 msgstr "エラー"
407
408 #. type: Plain text
409 #: build/C/man2/getcontext.2:124
410 msgid "None defined."
411 msgstr "定義されていない。"
412
413 #. type: SH
414 #: build/C/man2/getcontext.2:124 build/C/man3/makecontext.3:102
415 #: build/C/man3/pthread_attr_init.3:77
416 #: build/C/man3/pthread_attr_setaffinity_np.3:106
417 #: build/C/man3/pthread_attr_setdetachstate.3:85
418 #: build/C/man3/pthread_attr_setguardsize.3:104
419 #: build/C/man3/pthread_attr_setinheritsched.3:99
420 #: build/C/man3/pthread_attr_setschedparam.3:87
421 #: build/C/man3/pthread_attr_setschedpolicy.3:87
422 #: build/C/man3/pthread_attr_setscope.3:105
423 #: build/C/man3/pthread_attr_setstack.3:110
424 #: build/C/man3/pthread_attr_setstackaddr.3:81
425 #: build/C/man3/pthread_attr_setstacksize.3:81
426 #: build/C/man3/pthread_cancel.3:120 build/C/man3/pthread_cleanup_push.3:123
427 #: build/C/man3/pthread_cleanup_push_defer_np.3:99
428 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:62
429 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
430 #: build/C/man3/pthread_getattr_np.3:96
431 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:96
432 #: build/C/man3/pthread_kill.3:64
433 #: build/C/man3/pthread_kill_other_threads_np.3:45
434 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_setaffinity_np.3:119
435 #: build/C/man3/pthread_setcancelstate.3:111
436 #: build/C/man3/pthread_setconcurrency.3:81
437 #: build/C/man3/pthread_setschedparam.3:139
438 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigmask.3:55
439 #: build/C/man3/pthread_sigqueue.3:91 build/C/man3/pthread_testcancel.3:56
440 #: build/C/man3/pthread_tryjoin_np.3:110 build/C/man3/pthread_yield.3:50
441 #, no-wrap
442 msgid "CONFORMING TO"
443 msgstr "準拠"
444
445 #. type: Plain text
446 #: build/C/man2/getcontext.2:130
447 msgid ""
448 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specification of B<getcontext>"
449 "(), citing portability issues, and recommending that applications be "
450 "rewritten to use POSIX threads instead."
451 msgstr ""
452 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<getcontext>()  の"
453 "仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直"
454 "すことが 推奨されている。"
455
456 #. type: SH
457 #: build/C/man2/getcontext.2:130 build/C/man3/makecontext.3:110
458 #: build/C/man3/pthread_attr_init.3:79
459 #: build/C/man3/pthread_attr_setaffinity_np.3:109
460 #: build/C/man3/pthread_attr_setdetachstate.3:87
461 #: build/C/man3/pthread_attr_setguardsize.3:106
462 #: build/C/man3/pthread_attr_setschedparam.3:89
463 #: build/C/man3/pthread_attr_setscope.3:107
464 #: build/C/man3/pthread_attr_setstack.3:112
465 #: build/C/man3/pthread_attr_setstackaddr.3:84
466 #: build/C/man3/pthread_attr_setstacksize.3:83
467 #: build/C/man3/pthread_cancel.3:122 build/C/man3/pthread_cleanup_push.3:125
468 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
469 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
470 #: build/C/man3/pthread_getcpuclockid.3:65 build/C/man3/pthread_join.3:98
471 #: build/C/man3/pthread_kill.3:66
472 #: build/C/man3/pthread_kill_other_threads_np.3:48
473 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_setaffinity_np.3:122
474 #: build/C/man3/pthread_setcancelstate.3:113
475 #: build/C/man3/pthread_setconcurrency.3:83
476 #: build/C/man3/pthread_setschedparam.3:141
477 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:57
478 #: build/C/man3/pthread_yield.3:56
479 #, no-wrap
480 msgid "NOTES"
481 msgstr "注意"
482
483 #. type: Plain text
484 #: build/C/man2/getcontext.2:147
485 msgid ""
486 "The earliest incarnation of this mechanism was the B<setjmp>(3)/B<longjmp>"
487 "(3)  mechanism.  Since that does not define the handling of the signal "
488 "context, the next stage was the B<sigsetjmp>(3)/B<siglongjmp>(3)  pair.  The "
489 "present mechanism gives much more control.  On the other hand, there is no "
490 "easy way to detect whether a return from B<getcontext>()  is from the first "
491 "call, or via a B<setcontext>()  call.  The user has to invent her own "
492 "bookkeeping device, and a register variable won't do since registers are "
493 "restored."
494 msgstr ""
495 "このメカニズムの最古の実装は、 B<setjmp>(3)/B<longjmp>(3)  機構であった。 こ"
496 "れらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階で"
497 "は B<sigsetjmp>(3)/B<siglongjmp>(3)  のペアが現われた。 現在の機構ではずっと"
498 "細かな制御ができる。 一方 B<getcontext>()  から返ったとき、 これが最初の呼び"
499 "出しであったか、 それとも B<setcontext>()  呼び出しからのものであるかを 区別"
500 "する容易な方法がなくなってしまった。 ユーザは「しおり」機構を自分で作らなけれ"
501 "ばならない。 レジスタ変数は (レジスタはリストアされてしまうので) これをやって"
502 "くれない。"
503
504 #. type: Plain text
505 #: build/C/man2/getcontext.2:158
506 msgid ""
507 "When a signal occurs, the current user context is saved and a new context is "
508 "created by the kernel for the signal handler.  Do not leave the handler "
509 "using B<longjmp>(3): it is undefined what would happen with contexts.  Use "
510 "B<siglongjmp>(3)  or B<setcontext>()  instead."
511 msgstr ""
512 "シグナルが発生すると、 現在のユーザコンテキストは保存され、 シグナルハンドラ"
513 "用のコンテキストがカーネルによって生成される。 今後はハンドラに B<longjmp>"
514 "(3)  を使わせないこと: この関数のコンテキスト下での動作は定義されていない。 "
515 "代わりに B<siglongjmp>(3)  か B<setcontext>()  を使うこと。"
516
517 #. type: SH
518 #: build/C/man2/getcontext.2:158 build/C/man3/makecontext.3:217
519 #: build/C/man3/pthread_attr_init.3:295
520 #: build/C/man3/pthread_attr_setaffinity_np.3:116
521 #: build/C/man3/pthread_attr_setdetachstate.3:109
522 #: build/C/man3/pthread_attr_setguardsize.3:156
523 #: build/C/man3/pthread_attr_setinheritsched.3:120
524 #: build/C/man3/pthread_attr_setschedparam.3:96
525 #: build/C/man3/pthread_attr_setschedpolicy.3:92
526 #: build/C/man3/pthread_attr_setscope.3:118
527 #: build/C/man3/pthread_attr_setstack.3:154
528 #: build/C/man3/pthread_attr_setstackaddr.3:108
529 #: build/C/man3/pthread_attr_setstacksize.3:109
530 #: build/C/man3/pthread_cancel.3:221 build/C/man3/pthread_cleanup_push.3:309
531 #: build/C/man3/pthread_cleanup_push_defer_np.3:102
532 #: build/C/man3/pthread_create.3:367 build/C/man3/pthread_detach.3:95
533 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:103
534 #: build/C/man3/pthread_getattr_np.3:343
535 #: build/C/man3/pthread_getcpuclockid.3:167 build/C/man3/pthread_join.3:125
536 #: build/C/man3/pthread_kill.3:73
537 #: build/C/man3/pthread_kill_other_threads_np.3:64
538 #: build/C/man3/pthread_self.3:74 build/C/man3/pthread_setaffinity_np.3:204
539 #: build/C/man3/pthread_setcancelstate.3:175
540 #: build/C/man3/pthread_setconcurrency.3:98
541 #: build/C/man3/pthread_setschedparam.3:429
542 #: build/C/man3/pthread_setschedprio.3:89 build/C/man3/pthread_sigmask.3:133
543 #: build/C/man3/pthread_sigqueue.3:93 build/C/man3/pthread_testcancel.3:61
544 #: build/C/man3/pthread_tryjoin_np.3:133 build/C/man3/pthread_yield.3:59
545 #: build/C/man7/pthreads.7:893
546 #, no-wrap
547 msgid "SEE ALSO"
548 msgstr "関連項目"
549
550 #. type: Plain text
551 #: build/C/man2/getcontext.2:165
552 msgid ""
553 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
554 "B<makecontext>(3), B<sigsetjmp>(3)"
555 msgstr ""
556 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
557 "B<makecontext>(3), B<sigsetjmp>(3)"
558
559 #. type: SH
560 #: build/C/man2/getcontext.2:165 build/C/man3/makecontext.3:223
561 #: build/C/man3/pthread_attr_init.3:309
562 #: build/C/man3/pthread_attr_setaffinity_np.3:122
563 #: build/C/man3/pthread_attr_setdetachstate.3:115
564 #: build/C/man3/pthread_attr_setguardsize.3:164
565 #: build/C/man3/pthread_attr_setinheritsched.3:129
566 #: build/C/man3/pthread_attr_setschedparam.3:106
567 #: build/C/man3/pthread_attr_setschedpolicy.3:101
568 #: build/C/man3/pthread_attr_setscope.3:126
569 #: build/C/man3/pthread_attr_setstack.3:164
570 #: build/C/man3/pthread_attr_setstackaddr.3:114
571 #: build/C/man3/pthread_attr_setstacksize.3:116
572 #: build/C/man3/pthread_cancel.3:231 build/C/man3/pthread_cleanup_push.3:315
573 #: build/C/man3/pthread_cleanup_push_defer_np.3:108
574 #: build/C/man3/pthread_create.3:378 build/C/man3/pthread_detach.3:102
575 #: build/C/man3/pthread_equal.3:58 build/C/man3/pthread_exit.3:107
576 #: build/C/man3/pthread_getattr_np.3:357
577 #: build/C/man3/pthread_getcpuclockid.3:175 build/C/man3/pthread_join.3:132
578 #: build/C/man3/pthread_kill.3:82
579 #: build/C/man3/pthread_kill_other_threads_np.3:70
580 #: build/C/man3/pthread_self.3:78 build/C/man3/pthread_setaffinity_np.3:212
581 #: build/C/man3/pthread_setcancelstate.3:180
582 #: build/C/man3/pthread_setconcurrency.3:101
583 #: build/C/man3/pthread_setschedparam.3:441
584 #: build/C/man3/pthread_setschedprio.3:101 build/C/man3/pthread_sigmask.3:142
585 #: build/C/man3/pthread_sigqueue.3:101 build/C/man3/pthread_testcancel.3:66
586 #: build/C/man3/pthread_tryjoin_np.3:138 build/C/man3/pthread_yield.3:63
587 #: build/C/man7/pthreads.7:927
588 #, no-wrap
589 msgid "COLOPHON"
590 msgstr "この文書について"
591
592 #. type: Plain text
593 #: build/C/man2/getcontext.2:172 build/C/man3/makecontext.3:230
594 #: build/C/man3/pthread_attr_init.3:316
595 #: build/C/man3/pthread_attr_setaffinity_np.3:129
596 #: build/C/man3/pthread_attr_setdetachstate.3:122
597 #: build/C/man3/pthread_attr_setguardsize.3:171
598 #: build/C/man3/pthread_attr_setinheritsched.3:136
599 #: build/C/man3/pthread_attr_setschedparam.3:113
600 #: build/C/man3/pthread_attr_setschedpolicy.3:108
601 #: build/C/man3/pthread_attr_setscope.3:133
602 #: build/C/man3/pthread_attr_setstack.3:171
603 #: build/C/man3/pthread_attr_setstackaddr.3:121
604 #: build/C/man3/pthread_attr_setstacksize.3:123
605 #: build/C/man3/pthread_cancel.3:238 build/C/man3/pthread_cleanup_push.3:322
606 #: build/C/man3/pthread_cleanup_push_defer_np.3:115
607 #: build/C/man3/pthread_create.3:385 build/C/man3/pthread_detach.3:109
608 #: build/C/man3/pthread_equal.3:65 build/C/man3/pthread_exit.3:114
609 #: build/C/man3/pthread_getattr_np.3:364
610 #: build/C/man3/pthread_getcpuclockid.3:182 build/C/man3/pthread_join.3:139
611 #: build/C/man3/pthread_kill.3:89
612 #: build/C/man3/pthread_kill_other_threads_np.3:77
613 #: build/C/man3/pthread_self.3:85 build/C/man3/pthread_setaffinity_np.3:219
614 #: build/C/man3/pthread_setcancelstate.3:187
615 #: build/C/man3/pthread_setconcurrency.3:108
616 #: build/C/man3/pthread_setschedparam.3:448
617 #: build/C/man3/pthread_setschedprio.3:108 build/C/man3/pthread_sigmask.3:149
618 #: build/C/man3/pthread_sigqueue.3:108 build/C/man3/pthread_testcancel.3:73
619 #: build/C/man3/pthread_tryjoin_np.3:145 build/C/man3/pthread_yield.3:70
620 #: build/C/man7/pthreads.7:934
621 msgid ""
622 "This page is part of release 3.38 of the Linux I<man-pages> project.  A "
623 "description of the project, and information about reporting bugs, can be "
624 "found at http://www.kernel.org/doc/man-pages/."
625 msgstr ""
626 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.38 の一部である。\n"
627 "プロジェクトの説明とバグ報告に関する情報は\n"
628 "http://www.kernel.org/doc/man-pages/ に書かれている。"
629
630 #. type: TH
631 #: build/C/man3/makecontext.3:25
632 #, no-wrap
633 msgid "MAKECONTEXT"
634 msgstr "MAKECONTEXT"
635
636 #. type: TH
637 #: build/C/man3/makecontext.3:25
638 #, no-wrap
639 msgid "2009-03-31"
640 msgstr "2009-03-31"
641
642 #. type: TH
643 #: build/C/man3/makecontext.3:25
644 #, no-wrap
645 msgid "GNU"
646 msgstr "GNU"
647
648 #. type: Plain text
649 #: build/C/man3/makecontext.3:28
650 msgid "makecontext, swapcontext - manipulate user context"
651 msgstr "makecontext, swapcontext - ユーザコンテキストを操作する"
652
653 #. type: Plain text
654 #: build/C/man3/makecontext.3:33
655 msgid ""
656 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
657 ">I<argc>B<, ...);>"
658 msgstr ""
659 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
660 ">I<argc>B<, ...);>"
661
662 #. type: Plain text
663 #: build/C/man3/makecontext.3:35
664 msgid "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
665 msgstr "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
666
667 #. type: Plain text
668 #: build/C/man3/makecontext.3:46
669 msgid ""
670 "In a System V-like environment, one has the type I<ucontext_t> defined in "
671 "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(2), "
672 "B<setcontext>(2), B<makecontext>()  and B<swapcontext>()  that allow user-"
673 "level context switching between multiple threads of control within a process."
674 msgstr ""
675 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
676 "と、 B<getcontext>(2), B<setcontext>(2), B<makecontext>(), B<swapcontext>()  "
677 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
678 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
679 "ようになっている。"
680
681 #. type: Plain text
682 #: build/C/man3/makecontext.3:49
683 msgid "For the type and the first two functions, see B<getcontext>(2)."
684 msgstr ""
685 "これらの型と、最初の 2 つの関数については、 B<getcontext>(2)  を参照のこと。"
686
687 #. type: Plain text
688 #: build/C/man3/makecontext.3:61
689 msgid ""
690 "The B<makecontext>()  function modifies the context pointed to by I<ucp> "
691 "(which was obtained from a call to B<getcontext>(2)).  Before invoking "
692 "B<makecontext>(), the caller must allocate a new stack for this context and "
693 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
694 "and assign its address to I<ucp-E<gt>uc_link>."
695 msgstr ""
696 "B<makecontext>()  関数は、ポインタ I<ucp> が指すコンテキストを変更する "
697 "(I<ucp> は以前の B<getcontext>(2)  呼び出しで得られたものである)。 "
698 "B<makecontext>()  を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
699 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
700 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
701 "らない。"
702
703 #. type: Plain text
704 #: build/C/man3/makecontext.3:75
705 msgid ""
706 "When this context is later activated (using B<setcontext>(2)  or "
707 "B<swapcontext>())  the function I<func> is called, and passed the series of "
708 "integer (I<int>)  arguments that follow I<argc>; the caller must specify the "
709 "number of these arguments in I<argc>.  When this function returns, the "
710 "successor context is activated.  If the successor context pointer is NULL, "
711 "the thread exits."
712 msgstr ""
713 "このコンテキストが将来 (B<setcontext>(2)  または B<swapcontext>()  によっ"
714 "て)  有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 "
715 "(I<int>)  引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数"
716 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
717 "る。 後継コンテキストのポインタが NULL の場合、そのスレッドが終了する。"
718
719 #. type: Plain text
720 #: build/C/man3/makecontext.3:81
721 msgid ""
722 "The B<swapcontext>()  function saves the current context in the structure "
723 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
724 msgstr ""
725 "B<swapcontext>()  関数は現在のコンテキストを ポインタ I<oucp> が指す構造体に"
726 "保存し、 ポインタ I<ucp> が指すコンテキストを有効にする。"
727
728 #. type: Plain text
729 #: build/C/man3/makecontext.3:93
730 msgid ""
731 "When successful, B<swapcontext>()  does not return.  (But we may return "
732 "later, in case I<oucp> is activated, in which case it looks like "
733 "B<swapcontext>()  returns 0.)  On error, B<swapcontext>()  returns -1 and "
734 "sets I<errno> appropriately."
735 msgstr ""
736 "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった"
737 "場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見え"
738 "る。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じ"
739 "て設定する。"
740
741 #. type: TP
742 #: build/C/man3/makecontext.3:94
743 #: build/C/man3/pthread_attr_setaffinity_np.3:100
744 #: build/C/man3/pthread_getattr_np.3:75
745 #, no-wrap
746 msgid "B<ENOMEM>"
747 msgstr "B<ENOMEM>"
748
749 #. type: Plain text
750 #: build/C/man3/makecontext.3:97
751 msgid "Insufficient stack space left."
752 msgstr "スタックに割り当てる空間が残っていない。"
753
754 #. type: SH
755 #: build/C/man3/makecontext.3:97
756 #: build/C/man3/pthread_attr_setaffinity_np.3:104
757 #: build/C/man3/pthread_attr_setguardsize.3:102
758 #: build/C/man3/pthread_attr_setstack.3:108
759 #: build/C/man3/pthread_attr_setstackaddr.3:79
760 #: build/C/man3/pthread_attr_setstacksize.3:79
761 #: build/C/man3/pthread_getattr_np.3:94
762 #: build/C/man3/pthread_getcpuclockid.3:61
763 #: build/C/man3/pthread_setaffinity_np.3:117
764 #: build/C/man3/pthread_setconcurrency.3:79
765 #: build/C/man3/pthread_setschedprio.3:79 build/C/man3/pthread_sigqueue.3:87
766 #: build/C/man3/pthread_tryjoin_np.3:108
767 #, no-wrap
768 msgid "VERSIONS"
769 msgstr "バージョン"
770
771 #. type: Plain text
772 #: build/C/man3/makecontext.3:102
773 msgid ""
774 "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version "
775 "2.1."
776 msgstr ""
777 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
778 "されている。"
779
780 #. type: Plain text
781 #: build/C/man3/makecontext.3:110
782 msgid ""
783 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specifications of "
784 "B<makecontext>()  and B<swapcontext>(), citing portability issues, and "
785 "recommending that applications be rewritten to use POSIX threads instead."
786 msgstr ""
787 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  "
788 "と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを "
789 "POSIX スレッドを使って書き直すことが 推奨されている。"
790
791 #. type: Plain text
792 #: build/C/man3/makecontext.3:118
793 msgid ""
794 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
795 "namely, this struct contains the start and length of a memory area to be "
796 "used as the stack, regardless of the direction of growth of the stack.  "
797 "Thus, it is not necessary for the user program to worry about this direction."
798 msgstr ""
799 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわ"
800 "ちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含"
801 "まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
802 "て、ユーザプログラムはこの件については心配しなくてよい。"
803
804 #. type: Plain text
805 #: build/C/man3/makecontext.3:134
806 msgid ""
807 "On architectures where I<int> and pointer types are the same size (e.g., "
808 "x86-32, where both types are 32 bits), you may be able to get away with "
809 "passing pointers as arguments to B<makecontext>()  following I<argc>.  "
810 "However, doing this is not guaranteed to be portable, is undefined according "
811 "to the standards, and won't work on architectures where pointers are larger "
812 "than I<int>s.  Nevertheless, starting with version 2.8, glibc makes some "
813 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
814 "g., x86-64)."
815 msgstr ""
816 "I<int> とポインタ型が同じ大きさであるアーキテクチャでは (x86-32 はその例であ"
817 "り、両方の型とも 32 ビットである)、 B<makecontext>()  の I<argc> 以降の引き数"
818 "としてポインタを渡してもうまく動くかもしれない。 しかしながら、このようにする"
819 "と、移植性は保証されず、 標準に従えば動作は未定義であり、ポインタが I<int> よ"
820 "りも大きいアーキテクチャでは正しく動作しないことだろう。 それにも関わらず、"
821 "バージョン 2.8 以降の glibc では、 B<makecontext>()  に変更が行われ、(x86-64 "
822 "などの) いくつかの 64 ビットアーキテクチャで 引き数としてポインタを渡すことが"
823 "できるようになっている。"
824
825 #. type: SH
826 #: build/C/man3/makecontext.3:134 build/C/man3/pthread_attr_init.3:85
827 #: build/C/man3/pthread_attr_setdetachstate.3:106
828 #: build/C/man3/pthread_attr_setguardsize.3:153
829 #: build/C/man3/pthread_attr_setinheritsched.3:117
830 #: build/C/man3/pthread_attr_setschedparam.3:93
831 #: build/C/man3/pthread_attr_setschedpolicy.3:89
832 #: build/C/man3/pthread_attr_setstack.3:151
833 #: build/C/man3/pthread_attr_setstacksize.3:106
834 #: build/C/man3/pthread_cancel.3:130 build/C/man3/pthread_cleanup_push.3:149
835 #: build/C/man3/pthread_create.3:200 build/C/man3/pthread_detach.3:91
836 #: build/C/man3/pthread_getattr_np.3:99
837 #: build/C/man3/pthread_getcpuclockid.3:76 build/C/man3/pthread_join.3:122
838 #: build/C/man3/pthread_setaffinity_np.3:152
839 #: build/C/man3/pthread_setcancelstate.3:172
840 #: build/C/man3/pthread_setschedparam.3:147 build/C/man3/pthread_sigmask.3:59
841 #: build/C/man3/pthread_testcancel.3:58 build/C/man3/pthread_tryjoin_np.3:113
842 #, no-wrap
843 msgid "EXAMPLE"
844 msgstr "例"
845
846 #. type: Plain text
847 #: build/C/man3/makecontext.3:142
848 msgid ""
849 "The example program below demonstrates the use of B<getcontext>(2), "
850 "B<makecontext>(), and B<swapcontext>().  Running the program produces the "
851 "following output:"
852 msgstr ""
853 "以下のサンプル・プログラムは、 B<getcontext>(2), B<makecontext>(), "
854 "B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行する"
855 "と、以下のような出力が得られる:"
856
857 #. type: Plain text
858 #: build/C/man3/makecontext.3:154
859 #, no-wrap
860 msgid ""
861 "$B< ./a.out>\n"
862 "main: swapcontext(&uctx_main, &uctx_func2)\n"
863 "func2: started\n"
864 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
865 "func1: started\n"
866 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
867 "func2: returning\n"
868 "func1: returning\n"
869 "main: exiting\n"
870 msgstr ""
871 "$B< ./a.out>\n"
872 "main: swapcontext(&uctx_main, &uctx_func2)\n"
873 "func2: started\n"
874 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
875 "func1: started\n"
876 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
877 "func2: returning\n"
878 "func1: returning\n"
879 "main: exiting\n"
880
881 #. type: SS
882 #: build/C/man3/makecontext.3:156 build/C/man3/pthread_attr_init.3:146
883 #: build/C/man3/pthread_cancel.3:146 build/C/man3/pthread_cleanup_push.3:225
884 #: build/C/man3/pthread_create.3:239 build/C/man3/pthread_getattr_np.3:177
885 #: build/C/man3/pthread_getcpuclockid.3:93
886 #: build/C/man3/pthread_setschedparam.3:222 build/C/man3/pthread_sigmask.3:77
887 #, no-wrap
888 msgid "Program source"
889 msgstr "プログラムのソース"
890
891 #. type: Plain text
892 #: build/C/man3/makecontext.3:162
893 #, no-wrap
894 msgid ""
895 "#include E<lt>ucontext.hE<gt>\n"
896 "#include E<lt>stdio.hE<gt>\n"
897 "#include E<lt>stdlib.hE<gt>\n"
898 msgstr ""
899 "#include E<lt>ucontext.hE<gt>\n"
900 "#include E<lt>stdio.hE<gt>\n"
901 "#include E<lt>stdlib.hE<gt>\n"
902
903 #. type: Plain text
904 #: build/C/man3/makecontext.3:164
905 #, no-wrap
906 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
907 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
908
909 #. type: Plain text
910 #: build/C/man3/makecontext.3:167
911 #, no-wrap
912 msgid ""
913 "#define handle_error(msg) \\e\n"
914 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
915 msgstr ""
916 "#define handle_error(msg) \\e\n"
917 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
918
919 #. type: Plain text
920 #: build/C/man3/makecontext.3:177
921 #, no-wrap
922 msgid ""
923 "static void\n"
924 "func1(void)\n"
925 "{\n"
926 "    printf(\"func1: started\\en\");\n"
927 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
928 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
929 "        handle_error(\"swapcontext\");\n"
930 "    printf(\"func1: returning\\en\");\n"
931 "}\n"
932 msgstr ""
933 "static void\n"
934 "func1(void)\n"
935 "{\n"
936 "    printf(\"func1: started\\en\");\n"
937 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
938 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
939 "        handle_error(\"swapcontext\");\n"
940 "    printf(\"func1: returning\\en\");\n"
941 "}\n"
942
943 #. type: Plain text
944 #: build/C/man3/makecontext.3:187
945 #, no-wrap
946 msgid ""
947 "static void\n"
948 "func2(void)\n"
949 "{\n"
950 "    printf(\"func2: started\\en\");\n"
951 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
952 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
953 "        handle_error(\"swapcontext\");\n"
954 "    printf(\"func2: returning\\en\");\n"
955 "}\n"
956 msgstr ""
957 "static void\n"
958 "func2(void)\n"
959 "{\n"
960 "    printf(\"func2: started\\en\");\n"
961 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
962 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
963 "        handle_error(\"swapcontext\");\n"
964 "    printf(\"func2: returning\\en\");\n"
965 "}\n"
966
967 #. type: Plain text
968 #: build/C/man3/makecontext.3:193
969 #, no-wrap
970 msgid ""
971 "int\n"
972 "main(int argc, char *argv[])\n"
973 "{\n"
974 "    char func1_stack[16384];\n"
975 "    char func2_stack[16384];\n"
976 msgstr ""
977 "int\n"
978 "main(int argc, char *argv[])\n"
979 "{\n"
980 "    char func1_stack[16384];\n"
981 "    char func2_stack[16384];\n"
982
983 #. type: Plain text
984 #: build/C/man3/makecontext.3:200
985 #, no-wrap
986 msgid ""
987 "    if (getcontext(&uctx_func1) == -1)\n"
988 "        handle_error(\"getcontext\");\n"
989 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
990 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
991 "    uctx_func1.uc_link = &uctx_main;\n"
992 "    makecontext(&uctx_func1, func1, 0);\n"
993 msgstr ""
994 "    if (getcontext(&uctx_func1) == -1)\n"
995 "        handle_error(\"getcontext\");\n"
996 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
997 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
998 "    uctx_func1.uc_link = &uctx_main;\n"
999 "    makecontext(&uctx_func1, func1, 0);\n"
1000
1001 #. type: Plain text
1002 #: build/C/man3/makecontext.3:208
1003 #, no-wrap
1004 msgid ""
1005 "    if (getcontext(&uctx_func2) == -1)\n"
1006 "        handle_error(\"getcontext\");\n"
1007 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1008 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1009 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1010 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1011 "    makecontext(&uctx_func2, func2, 0);\n"
1012 msgstr ""
1013 "    if (getcontext(&uctx_func2) == -1)\n"
1014 "        handle_error(\"getcontext\");\n"
1015 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1016 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1017 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1018 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1019 "    makecontext(&uctx_func2, func2, 0);\n"
1020
1021 #. type: Plain text
1022 #: build/C/man3/makecontext.3:212
1023 #, no-wrap
1024 msgid ""
1025 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1026 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1027 "        handle_error(\"swapcontext\");\n"
1028 msgstr ""
1029 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1030 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1031 "        handle_error(\"swapcontext\");\n"
1032
1033 #. type: Plain text
1034 #: build/C/man3/makecontext.3:216
1035 #, no-wrap
1036 msgid ""
1037 "    printf(\"main: exiting\\en\");\n"
1038 "    exit(EXIT_SUCCESS);\n"
1039 "}\n"
1040 msgstr ""
1041 "    printf(\"main: exiting\\en\");\n"
1042 "    exit(EXIT_SUCCESS);\n"
1043 "}\n"
1044
1045 #. type: Plain text
1046 #: build/C/man3/makecontext.3:223
1047 msgid ""
1048 "B<getcontext>(2), B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), "
1049 "B<sigsetjmp>(3)"
1050 msgstr ""
1051 "B<getcontext>(2), B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), "
1052 "B<sigsetjmp>(3)"
1053
1054 #. type: TH
1055 #: build/C/man3/pthread_attr_init.3:24
1056 #, no-wrap
1057 msgid "PTHREAD_ATTR_INIT"
1058 msgstr "PTHREAD_ATTR_INIT"
1059
1060 #. type: TH
1061 #: build/C/man3/pthread_attr_init.3:24
1062 #, no-wrap
1063 msgid "2008-11-11"
1064 msgstr "2008-11-11"
1065
1066 #. type: Plain text
1067 #: build/C/man3/pthread_attr_init.3:28
1068 msgid ""
1069 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1070 "attributes object"
1071 msgstr ""
1072
1073 #. type: Plain text
1074 #: build/C/man3/pthread_attr_init.3:31
1075 #: build/C/man3/pthread_attr_setdetachstate.3:31
1076 #: build/C/man3/pthread_attr_setguardsize.3:31
1077 #: build/C/man3/pthread_attr_setinheritsched.3:31
1078 #: build/C/man3/pthread_attr_setschedparam.3:31
1079 #: build/C/man3/pthread_attr_setschedpolicy.3:31
1080 #: build/C/man3/pthread_attr_setscope.3:31
1081 #: build/C/man3/pthread_attr_setstack.3:31
1082 #: build/C/man3/pthread_attr_setstackaddr.3:31
1083 #: build/C/man3/pthread_attr_setstacksize.3:31
1084 #: build/C/man3/pthread_cancel.3:30 build/C/man3/pthread_cleanup_push.3:31
1085 #: build/C/man3/pthread_cleanup_push_defer_np.3:31
1086 #: build/C/man3/pthread_create.3:30 build/C/man3/pthread_detach.3:30
1087 #: build/C/man3/pthread_equal.3:30 build/C/man3/pthread_exit.3:30
1088 #: build/C/man3/pthread_join.3:30
1089 #: build/C/man3/pthread_kill_other_threads_np.3:30
1090 #: build/C/man3/pthread_self.3:30 build/C/man3/pthread_setcancelstate.3:31
1091 #: build/C/man3/pthread_setconcurrency.3:30
1092 #: build/C/man3/pthread_setschedparam.3:31
1093 #: build/C/man3/pthread_setschedprio.3:30 build/C/man3/pthread_sigqueue.3:29
1094 #: build/C/man3/pthread_testcancel.3:30 build/C/man3/pthread_yield.3:29
1095 #, no-wrap
1096 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1097 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1098
1099 #. type: Plain text
1100 #: build/C/man3/pthread_attr_init.3:34
1101 #, no-wrap
1102 msgid ""
1103 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1104 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1105 msgstr ""
1106 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1107 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1108
1109 #. type: Plain text
1110 #: build/C/man3/pthread_attr_init.3:36
1111 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1112 #: build/C/man3/pthread_attr_setdetachstate.3:38
1113 #: build/C/man3/pthread_attr_setguardsize.3:38
1114 #: build/C/man3/pthread_attr_setinheritsched.3:38
1115 #: build/C/man3/pthread_attr_setschedparam.3:38
1116 #: build/C/man3/pthread_attr_setschedpolicy.3:38
1117 #: build/C/man3/pthread_attr_setscope.3:38
1118 #: build/C/man3/pthread_attr_setstack.3:38
1119 #: build/C/man3/pthread_attr_setstackaddr.3:38
1120 #: build/C/man3/pthread_attr_setstacksize.3:38
1121 #: build/C/man3/pthread_cancel.3:34 build/C/man3/pthread_cleanup_push.3:37
1122 #: build/C/man3/pthread_equal.3:34 build/C/man3/pthread_exit.3:34
1123 #: build/C/man3/pthread_getattr_np.3:35
1124 #: build/C/man3/pthread_getcpuclockid.3:35 build/C/man3/pthread_self.3:34
1125 #: build/C/man3/pthread_setaffinity_np.3:39
1126 #: build/C/man3/pthread_setcancelstate.3:36
1127 #: build/C/man3/pthread_setconcurrency.3:35
1128 #: build/C/man3/pthread_setschedparam.3:38
1129 #: build/C/man3/pthread_setschedprio.3:34 build/C/man3/pthread_testcancel.3:34
1130 #, no-wrap
1131 msgid "Compile and link with I<-pthread>.\n"
1132 msgstr ""
1133
1134 #. type: Plain text
1135 #: build/C/man3/pthread_attr_init.3:48
1136 msgid ""
1137 "The B<pthread_attr_init>()  function initializes the thread attributes "
1138 "object pointed to by I<attr> with default attribute values.  After this "
1139 "call, individual attributes of the object can be set using various related "
1140 "functions (listed under SEE ALSO), and then the object can be used in one or "
1141 "more B<pthread_create>(3)  calls that create threads."
1142 msgstr ""
1143
1144 #. type: Plain text
1145 #: build/C/man3/pthread_attr_init.3:53
1146 msgid ""
1147 "Calling B<pthread_attr_init>()  on a thread attributes object that has "
1148 "already been initialized results in undefined behavior."
1149 msgstr ""
1150
1151 #. type: Plain text
1152 #: build/C/man3/pthread_attr_init.3:60
1153 msgid ""
1154 "When a thread attributes object is no longer required, it should be "
1155 "destroyed using the B<pthread_attr_destroy>()  function.  Destroying a "
1156 "thread attributes object has no effect on threads that were created using "
1157 "that object."
1158 msgstr ""
1159
1160 #. type: Plain text
1161 #: build/C/man3/pthread_attr_init.3:66
1162 msgid ""
1163 "Once a thread attributes object has been destroyed, it can be reinitialized "
1164 "using B<pthread_attr_init>().  Any other use of a destroyed thread "
1165 "attributes object has undefined results."
1166 msgstr ""
1167
1168 #. type: Plain text
1169 #: build/C/man3/pthread_attr_init.3:69
1170 #: build/C/man3/pthread_attr_setaffinity_np.3:77
1171 #: build/C/man3/pthread_attr_setdetachstate.3:78
1172 #: build/C/man3/pthread_attr_setguardsize.3:91
1173 #: build/C/man3/pthread_attr_setinheritsched.3:85
1174 #: build/C/man3/pthread_attr_setschedparam.3:75
1175 #: build/C/man3/pthread_attr_setschedpolicy.3:73
1176 #: build/C/man3/pthread_attr_setscope.3:92
1177 #: build/C/man3/pthread_attr_setstack.3:86
1178 #: build/C/man3/pthread_attr_setstackaddr.3:75
1179 #: build/C/man3/pthread_attr_setstacksize.3:62
1180 #: build/C/man3/pthread_setaffinity_np.3:78
1181 #: build/C/man3/pthread_setcancelstate.3:93
1182 msgid ""
1183 "On success, these functions return 0; on error, they return a nonzero error "
1184 "number."
1185 msgstr ""
1186
1187 #. type: Plain text
1188 #: build/C/man3/pthread_attr_init.3:77
1189 msgid ""
1190 "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on "
1191 "Linux these functions always succeed (but portable and future-proof "
1192 "applications should nevertheless handle a possible error return)."
1193 msgstr ""
1194
1195 #. type: Plain text
1196 #: build/C/man3/pthread_attr_init.3:79
1197 #: build/C/man3/pthread_attr_setdetachstate.3:87
1198 #: build/C/man3/pthread_attr_setguardsize.3:106
1199 #: build/C/man3/pthread_attr_setinheritsched.3:101
1200 #: build/C/man3/pthread_attr_setschedparam.3:89
1201 #: build/C/man3/pthread_attr_setschedpolicy.3:89
1202 #: build/C/man3/pthread_attr_setscope.3:107
1203 #: build/C/man3/pthread_attr_setstack.3:112
1204 #: build/C/man3/pthread_attr_setstacksize.3:83
1205 #: build/C/man3/pthread_cancel.3:122 build/C/man3/pthread_cleanup_push.3:125
1206 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
1207 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
1208 #: build/C/man3/pthread_getcpuclockid.3:65 build/C/man3/pthread_join.3:98
1209 #: build/C/man3/pthread_kill.3:66 build/C/man3/pthread_self.3:50
1210 #: build/C/man3/pthread_setcancelstate.3:113
1211 #: build/C/man3/pthread_setconcurrency.3:83
1212 #: build/C/man3/pthread_setschedparam.3:141
1213 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:57
1214 #: build/C/man3/pthread_testcancel.3:58
1215 msgid "POSIX.1-2001."
1216 msgstr ""
1217
1218 #. type: Plain text
1219 #: build/C/man3/pthread_attr_init.3:85
1220 msgid ""
1221 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1222 "object other than via pthreads functions is nonportable and produces "
1223 "undefined results."
1224 msgstr ""
1225
1226 #. type: Plain text
1227 #: build/C/man3/pthread_attr_init.3:94
1228 msgid ""
1229 "The program below optionally makes use of B<pthread_attr_init>()  and "
1230 "various related functions to initialize a thread attributes object that is "
1231 "used to create a single thread.  Once created, the thread uses the "
1232 "B<pthread_getattr_np>(3)  function (a nonstandard GNU extension) to retrieve "
1233 "the thread's attributes, and then displays those attributes."
1234 msgstr ""
1235
1236 #. type: Plain text
1237 #: build/C/man3/pthread_attr_init.3:103
1238 msgid ""
1239 "If the program is run with no command-line argument, then it passes NULL as "
1240 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1241 "with default attributes.  Running the program on Linux/x86-32 with the NPTL "
1242 "threading implementation, we see the following:"
1243 msgstr ""
1244
1245 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1246 #. type: Plain text
1247 #: build/C/man3/pthread_attr_init.3:119
1248 #, no-wrap
1249 msgid ""
1250 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1251 "unlimited\n"
1252 "$B< ./a.out>\n"
1253 "Thread attributes:\n"
1254 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1255 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1256 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1257 "        Scheduling policy   = SCHED_OTHER\n"
1258 "        Scheduling priority = 0\n"
1259 "        Guard size          = 4096 bytes\n"
1260 "        Stack address       = 0x40196000\n"
1261 "        Stack size          = 0x201000 bytes\n"
1262 msgstr ""
1263 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1264 "unlimited\n"
1265 "$B< ./a.out>\n"
1266 "Thread attributes:\n"
1267 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1268 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1269 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1270 "        Scheduling policy   = SCHED_OTHER\n"
1271 "        Scheduling priority = 0\n"
1272 "        Guard size          = 4096 bytes\n"
1273 "        Stack address       = 0x40196000\n"
1274 "        Stack size          = 0x201000 bytes\n"
1275
1276 #. type: Plain text
1277 #: build/C/man3/pthread_attr_init.3:129
1278 msgid ""
1279 "When we supply a stack size as a command-line argument, the program "
1280 "initializes a thread attributes object, sets various attributes in that "
1281 "object, and passes a pointer to the object in the call to B<pthread_create>"
1282 "(3).  Running the program on Linux/x86-32 with the NPTL threading "
1283 "implementation, we see the following:"
1284 msgstr ""
1285
1286 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1287 #. type: Plain text
1288 #: build/C/man3/pthread_attr_init.3:144
1289 #, no-wrap
1290 msgid ""
1291 "$B< ./a.out 0x3000000>\n"
1292 "posix_memalign() allocated at 0x40197000\n"
1293 "Thread attributes:\n"
1294 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1295 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1296 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1297 "        Scheduling policy   = SCHED_OTHER\n"
1298 "        Scheduling priority = 0\n"
1299 "        Guard size          = 0 bytes\n"
1300 "        Stack address       = 0x40197000\n"
1301 "        Stack size          = 0x3000000 bytes\n"
1302 msgstr ""
1303 "$B< ./a.out 0x3000000>\n"
1304 "posix_memalign() allocated at 0x40197000\n"
1305 "Thread attributes:\n"
1306 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1307 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1308 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1309 "        Scheduling policy   = SCHED_OTHER\n"
1310 "        Scheduling priority = 0\n"
1311 "        Guard size          = 0 bytes\n"
1312 "        Stack address       = 0x40197000\n"
1313 "        Stack size          = 0x3000000 bytes\n"
1314
1315 #. type: Plain text
1316 #: build/C/man3/pthread_attr_init.3:155 build/C/man3/pthread_getattr_np.3:186
1317 #, no-wrap
1318 msgid ""
1319 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1320 "#include E<lt>pthread.hE<gt>\n"
1321 "#include E<lt>stdio.hE<gt>\n"
1322 "#include E<lt>stdlib.hE<gt>\n"
1323 "#include E<lt>unistd.hE<gt>\n"
1324 "#include E<lt>errno.hE<gt>\n"
1325 msgstr ""
1326 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1327 "#include E<lt>pthread.hE<gt>\n"
1328 "#include E<lt>stdio.hE<gt>\n"
1329 "#include E<lt>stdlib.hE<gt>\n"
1330 "#include E<lt>unistd.hE<gt>\n"
1331 "#include E<lt>errno.hE<gt>\n"
1332
1333 #. type: Plain text
1334 #: build/C/man3/pthread_attr_init.3:158 build/C/man3/pthread_cancel.3:157
1335 #: build/C/man3/pthread_cleanup_push.3:237 build/C/man3/pthread_create.3:252
1336 #: build/C/man3/pthread_getattr_np.3:189
1337 #: build/C/man3/pthread_getcpuclockid.3:111
1338 #: build/C/man3/pthread_setaffinity_np.3:170
1339 #: build/C/man3/pthread_setschedparam.3:235 build/C/man3/pthread_sigmask.3:91
1340 #, no-wrap
1341 msgid ""
1342 "#define handle_error_en(en, msg) \\e\n"
1343 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1344 msgstr ""
1345 "#define handle_error_en(en, msg) \\e\n"
1346 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1347
1348 #. type: Plain text
1349 #: build/C/man3/pthread_attr_init.3:166
1350 #, no-wrap
1351 msgid ""
1352 "static void\n"
1353 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1354 "{\n"
1355 "    int s, i;\n"
1356 "    size_t v;\n"
1357 "    void *stkaddr;\n"
1358 "    struct sched_param sp;\n"
1359 msgstr ""
1360 "static void\n"
1361 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1362 "{\n"
1363 "    int s, i;\n"
1364 "    size_t v;\n"
1365 "    void *stkaddr;\n"
1366 "    struct sched_param sp;\n"
1367
1368 #. type: Plain text
1369 #: build/C/man3/pthread_attr_init.3:174
1370 #, no-wrap
1371 msgid ""
1372 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1373 "    if (s != 0)\n"
1374 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1375 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1376 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1377 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1378 "            \"???\");\n"
1379 msgstr ""
1380 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1381 "    if (s != 0)\n"
1382 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1383 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1384 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1385 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1386 "            \"???\");\n"
1387
1388 #. type: Plain text
1389 #: build/C/man3/pthread_attr_init.3:182
1390 #, no-wrap
1391 msgid ""
1392 "    s = pthread_attr_getscope(attr, &i);\n"
1393 "    if (s != 0)\n"
1394 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1395 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1396 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1397 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1398 "            \"???\");\n"
1399 msgstr ""
1400 "    s = pthread_attr_getscope(attr, &i);\n"
1401 "    if (s != 0)\n"
1402 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1403 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1404 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1405 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1406 "            \"???\");\n"
1407
1408 #. type: Plain text
1409 #: build/C/man3/pthread_attr_init.3:190
1410 #, no-wrap
1411 msgid ""
1412 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1413 "    if (s != 0)\n"
1414 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1415 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1416 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1417 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1418 "            \"???\");\n"
1419 msgstr ""
1420 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1421 "    if (s != 0)\n"
1422 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1423 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1424 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1425 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1426 "            \"???\");\n"
1427
1428 #. type: Plain text
1429 #: build/C/man3/pthread_attr_init.3:199
1430 #, no-wrap
1431 msgid ""
1432 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1433 "    if (s != 0)\n"
1434 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1435 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1436 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1437 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1438 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1439 "            \"???\");\n"
1440 msgstr ""
1441 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1442 "    if (s != 0)\n"
1443 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1444 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1445 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1446 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1447 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1448 "            \"???\");\n"
1449
1450 #. type: Plain text
1451 #: build/C/man3/pthread_attr_init.3:204
1452 #, no-wrap
1453 msgid ""
1454 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1455 "    if (s != 0)\n"
1456 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1457 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1458 msgstr ""
1459 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1460 "    if (s != 0)\n"
1461 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1462 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1463
1464 #. type: Plain text
1465 #: build/C/man3/pthread_attr_init.3:209
1466 #, no-wrap
1467 msgid ""
1468 "    s = pthread_attr_getguardsize(attr, &v);\n"
1469 "    if (s != 0)\n"
1470 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1471 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1472 msgstr ""
1473 "    s = pthread_attr_getguardsize(attr, &v);\n"
1474 "    if (s != 0)\n"
1475 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1476 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1477
1478 #. type: Plain text
1479 #: build/C/man3/pthread_attr_init.3:216
1480 #, no-wrap
1481 msgid ""
1482 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1483 "    if (s != 0)\n"
1484 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1485 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1486 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1487 "}\n"
1488 msgstr ""
1489 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1490 "    if (s != 0)\n"
1491 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1492 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1493 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1494 "}\n"
1495
1496 #. type: Plain text
1497 #: build/C/man3/pthread_attr_init.3:222
1498 #, no-wrap
1499 msgid ""
1500 "static void *\n"
1501 "thread_start(void *arg)\n"
1502 "{\n"
1503 "    int s;\n"
1504 "    pthread_attr_t gattr;\n"
1505 msgstr ""
1506 "static void *\n"
1507 "thread_start(void *arg)\n"
1508 "{\n"
1509 "    int s;\n"
1510 "    pthread_attr_t gattr;\n"
1511
1512 #. type: Plain text
1513 #: build/C/man3/pthread_attr_init.3:226
1514 #, no-wrap
1515 msgid ""
1516 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1517 "       retrieves the attributes of the thread specified in its\n"
1518 "       first argument */\n"
1519 msgstr ""
1520 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1521 "       retrieves the attributes of the thread specified in its\n"
1522 "       first argument */\n"
1523
1524 #. type: Plain text
1525 #: build/C/man3/pthread_attr_init.3:230
1526 #, no-wrap
1527 msgid ""
1528 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1529 "    if (s != 0)\n"
1530 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1531 msgstr ""
1532 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1533 "    if (s != 0)\n"
1534 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1535
1536 #. type: Plain text
1537 #: build/C/man3/pthread_attr_init.3:233
1538 #, no-wrap
1539 msgid ""
1540 "    printf(\"Thread attributes:\\en\");\n"
1541 "    display_pthread_attr(&gattr, \"\\et\");\n"
1542 msgstr ""
1543 "    printf(\"Thread attributes:\\en\");\n"
1544 "    display_pthread_attr(&gattr, \"\\et\");\n"
1545
1546 #. type: Plain text
1547 #: build/C/man3/pthread_attr_init.3:236 build/C/man3/pthread_getattr_np.3:238
1548 #, no-wrap
1549 msgid ""
1550 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1551 "}\n"
1552 msgstr ""
1553 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1554 "}\n"
1555
1556 #. type: Plain text
1557 #: build/C/man3/pthread_attr_init.3:244
1558 #, no-wrap
1559 msgid ""
1560 "int\n"
1561 "main(int argc, char *argv[])\n"
1562 "{\n"
1563 "    pthread_t thr;\n"
1564 "    pthread_attr_t attr;\n"
1565 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1566 "    int s;\n"
1567 msgstr ""
1568 "int\n"
1569 "main(int argc, char *argv[])\n"
1570 "{\n"
1571 "    pthread_t thr;\n"
1572 "    pthread_attr_t attr;\n"
1573 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1574 "    int s;\n"
1575
1576 #. type: Plain text
1577 #: build/C/man3/pthread_attr_init.3:246
1578 #: build/C/man3/pthread_setschedparam.3:353
1579 #, no-wrap
1580 msgid "    attrp = NULL;\n"
1581 msgstr "    attrp = NULL;\n"
1582
1583 #. type: Plain text
1584 #: build/C/man3/pthread_attr_init.3:250
1585 #, no-wrap
1586 msgid ""
1587 "    /* If a command-line argument was supplied, use it to set the\n"
1588 "       stack-size attribute and set a few other thread attributes,\n"
1589 "       and set attrp pointing to thread attributes object */\n"
1590 msgstr ""
1591 "    /* If a command-line argument was supplied, use it to set the\n"
1592 "       stack-size attribute and set a few other thread attributes,\n"
1593 "       and set attrp pointing to thread attributes object */\n"
1594
1595 #. type: Plain text
1596 #: build/C/man3/pthread_attr_init.3:254
1597 #, no-wrap
1598 msgid ""
1599 "    if (argc E<gt> 1) {\n"
1600 "        int stack_size;\n"
1601 "        void *sp;\n"
1602 msgstr ""
1603 "    if (argc E<gt> 1) {\n"
1604 "        int stack_size;\n"
1605 "        void *sp;\n"
1606
1607 #. type: Plain text
1608 #: build/C/man3/pthread_attr_init.3:256
1609 #, no-wrap
1610 msgid "        attrp = &attr;\n"
1611 msgstr "        attrp = &attr;\n"
1612
1613 #. type: Plain text
1614 #: build/C/man3/pthread_attr_init.3:260
1615 #, no-wrap
1616 msgid ""
1617 "        s = pthread_attr_init(&attr);\n"
1618 "        if (s != 0)\n"
1619 "            handle_error_en(s, \"pthread_attr_init\");\n"
1620 msgstr ""
1621 "        s = pthread_attr_init(&attr);\n"
1622 "        if (s != 0)\n"
1623 "            handle_error_en(s, \"pthread_attr_init\");\n"
1624
1625 #. type: Plain text
1626 #: build/C/man3/pthread_attr_init.3:264
1627 #, no-wrap
1628 msgid ""
1629 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1630 "        if (s != 0)\n"
1631 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1632 msgstr ""
1633 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1634 "        if (s != 0)\n"
1635 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1636
1637 #. type: Plain text
1638 #: build/C/man3/pthread_attr_init.3:268
1639 #, no-wrap
1640 msgid ""
1641 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1642 "        if (s != 0)\n"
1643 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1644 msgstr ""
1645 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1646 "        if (s != 0)\n"
1647 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1648
1649 #. type: Plain text
1650 #: build/C/man3/pthread_attr_init.3:270
1651 #, no-wrap
1652 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1653 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
1654
1655 #. type: Plain text
1656 #: build/C/man3/pthread_attr_init.3:274
1657 #, no-wrap
1658 msgid ""
1659 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1660 "        if (s != 0)\n"
1661 "            handle_error_en(s, \"posix_memalign\");\n"
1662 msgstr ""
1663 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1664 "        if (s != 0)\n"
1665 "            handle_error_en(s, \"posix_memalign\");\n"
1666
1667 #. type: Plain text
1668 #: build/C/man3/pthread_attr_init.3:276
1669 #, no-wrap
1670 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1671 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1672
1673 #. type: Plain text
1674 #: build/C/man3/pthread_attr_init.3:281
1675 #, no-wrap
1676 msgid ""
1677 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1678 "        if (s != 0)\n"
1679 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1680 "    }\n"
1681 msgstr ""
1682 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1683 "        if (s != 0)\n"
1684 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1685 "    }\n"
1686
1687 #. type: Plain text
1688 #: build/C/man3/pthread_attr_init.3:285 build/C/man3/pthread_getattr_np.3:333
1689 #, no-wrap
1690 msgid ""
1691 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1692 "    if (s != 0)\n"
1693 "        handle_error_en(s, \"pthread_create\");\n"
1694 msgstr ""
1695 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1696 "    if (s != 0)\n"
1697 "        handle_error_en(s, \"pthread_create\");\n"
1698
1699 #. type: Plain text
1700 #: build/C/man3/pthread_attr_init.3:291 build/C/man3/pthread_getattr_np.3:339
1701 #, no-wrap
1702 msgid ""
1703 "    if (attrp != NULL) {\n"
1704 "        s = pthread_attr_destroy(attrp);\n"
1705 "        if (s != 0)\n"
1706 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1707 "    }\n"
1708 msgstr ""
1709 "    if (attrp != NULL) {\n"
1710 "        s = pthread_attr_destroy(attrp);\n"
1711 "        if (s != 0)\n"
1712 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1713 "    }\n"
1714
1715 #. type: Plain text
1716 #: build/C/man3/pthread_attr_init.3:294 build/C/man3/pthread_getattr_np.3:342
1717 #, no-wrap
1718 msgid ""
1719 "    pause();    /* Terminates when other thread calls exit() */\n"
1720 "}\n"
1721 msgstr ""
1722 "    pause();    /* Terminates when other thread calls exit() */\n"
1723 "}\n"
1724
1725 #. type: Plain text
1726 #: build/C/man3/pthread_attr_init.3:309
1727 msgid ""
1728 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1729 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1730 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1731 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1732 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1733 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1734 msgstr ""
1735 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1736 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1737 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1738 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1739 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1740 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1741
1742 #. type: TH
1743 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1744 #, no-wrap
1745 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1746 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1747
1748 #. type: TH
1749 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1750 #: build/C/man3/pthread_getattr_np.3:24
1751 #: build/C/man3/pthread_setaffinity_np.3:24
1752 #: build/C/man3/pthread_tryjoin_np.3:24
1753 #, no-wrap
1754 msgid "2010-09-10"
1755 msgstr "2010-09-10"
1756
1757 #. type: Plain text
1758 #: build/C/man3/pthread_attr_setaffinity_np.3:28
1759 msgid ""
1760 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1761 "affinity attribute in thread attributes object"
1762 msgstr ""
1763
1764 #. type: Plain text
1765 #: build/C/man3/pthread_attr_setaffinity_np.3:32
1766 #: build/C/man3/pthread_getattr_np.3:31
1767 #: build/C/man3/pthread_setaffinity_np.3:32
1768 #: build/C/man3/pthread_tryjoin_np.3:32
1769 #, no-wrap
1770 msgid ""
1771 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1772 "B<#include E<lt>pthread.hE<gt>>\n"
1773 msgstr ""
1774 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1775 "B<#include E<lt>pthread.hE<gt>>\n"
1776
1777 #. type: Plain text
1778 #: build/C/man3/pthread_attr_setaffinity_np.3:37
1779 #, no-wrap
1780 msgid ""
1781 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1782 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1783 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1784 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1785 msgstr ""
1786 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1787 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1788 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1789 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1790
1791 #. type: Plain text
1792 #: build/C/man3/pthread_attr_setaffinity_np.3:52
1793 msgid ""
1794 "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask "
1795 "attribute of the thread attributes object referred to by I<attr> to the "
1796 "value specified in I<cpuset>.  This attribute determines the CPU affinity "
1797 "mask of a thread created using the thread attributes object I<attr>."
1798 msgstr ""
1799
1800 #. type: Plain text
1801 #: build/C/man3/pthread_attr_setaffinity_np.3:61
1802 msgid ""
1803 "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask "
1804 "attribute of the thread attributes object referred to by I<attr> in the "
1805 "buffer pointed to by I<cpuset>."
1806 msgstr ""
1807
1808 #. type: Plain text
1809 #: build/C/man3/pthread_attr_setaffinity_np.3:68
1810 msgid ""
1811 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1812 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
1813 "(cpu_set_t)>."
1814 msgstr ""
1815
1816 #. type: Plain text
1817 #: build/C/man3/pthread_attr_setaffinity_np.3:74
1818 #: build/C/man3/pthread_setaffinity_np.3:65
1819 msgid ""
1820 "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a "
1821 "description of a set of macros that can be used to manipulate and inspect "
1822 "CPU sets, see B<CPU_SET>(3)."
1823 msgstr ""
1824
1825 #. type: TP
1826 #: build/C/man3/pthread_attr_setaffinity_np.3:78
1827 #: build/C/man3/pthread_attr_setaffinity_np.3:90
1828 #: build/C/man3/pthread_attr_setdetachstate.3:81
1829 #: build/C/man3/pthread_attr_setinheritsched.3:88
1830 #: build/C/man3/pthread_attr_setschedpolicy.3:76
1831 #: build/C/man3/pthread_attr_setscope.3:95
1832 #: build/C/man3/pthread_attr_setstack.3:89
1833 #: build/C/man3/pthread_attr_setstacksize.3:65
1834 #: build/C/man3/pthread_create.3:135 build/C/man3/pthread_detach.3:53
1835 #: build/C/man3/pthread_join.3:83 build/C/man3/pthread_join.3:87
1836 #: build/C/man3/pthread_kill.3:56 build/C/man3/pthread_setaffinity_np.3:82
1837 #: build/C/man3/pthread_setaffinity_np.3:91
1838 #: build/C/man3/pthread_setaffinity_np.3:107
1839 #: build/C/man3/pthread_setcancelstate.3:97
1840 #: build/C/man3/pthread_setcancelstate.3:105
1841 #: build/C/man3/pthread_setconcurrency.3:69
1842 #: build/C/man3/pthread_setschedparam.3:120
1843 #: build/C/man3/pthread_setschedprio.3:60 build/C/man3/pthread_sigqueue.3:75
1844 #, no-wrap
1845 msgid "B<EINVAL>"
1846 msgstr "B<EINVAL>"
1847
1848 #.  cpumask_t
1849 #.  The raw sched_getaffinity() system call returns the size (in bytes)
1850 #.  of the cpumask_t type.
1851 #. type: Plain text
1852 #: build/C/man3/pthread_attr_setaffinity_np.3:90
1853 msgid ""
1854 "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was "
1855 "outside the set supported by the kernel.  (The kernel configuration option "
1856 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
1857 "type used to represent CPU sets.)"
1858 msgstr ""
1859
1860 #. type: Plain text
1861 #: build/C/man3/pthread_attr_setaffinity_np.3:100
1862 msgid ""
1863 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
1864 "attributes object referred to by I<attr> lies outside the range specified by "
1865 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
1866 msgstr ""
1867
1868 #. type: Plain text
1869 #: build/C/man3/pthread_attr_setaffinity_np.3:104
1870 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
1871 msgstr ""
1872
1873 #. type: Plain text
1874 #: build/C/man3/pthread_attr_setaffinity_np.3:106
1875 #: build/C/man3/pthread_setaffinity_np.3:119
1876 msgid "These functions are provided by glibc since version 2.3.4."
1877 msgstr ""
1878
1879 #. type: Plain text
1880 #: build/C/man3/pthread_attr_setaffinity_np.3:109
1881 #: build/C/man3/pthread_cleanup_push_defer_np.3:102
1882 #: build/C/man3/pthread_setaffinity_np.3:122
1883 #: build/C/man3/pthread_tryjoin_np.3:113
1884 msgid ""
1885 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
1886 "\" (nonportable) in the names."
1887 msgstr ""
1888
1889 #. type: Plain text
1890 #: build/C/man3/pthread_attr_setaffinity_np.3:116
1891 #: build/C/man3/pthread_setaffinity_np.3:148
1892 msgid ""
1893 "In glibc 2.3.3 only, versions of these functions were provided that did not "
1894 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
1895 "underlying system calls was always I<sizeof(cpu_set_t)>."
1896 msgstr ""
1897
1898 #. type: Plain text
1899 #: build/C/man3/pthread_attr_setaffinity_np.3:122
1900 msgid ""
1901 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1902 "(3), B<cpuset>(7), B<pthreads>(7)"
1903 msgstr ""
1904 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1905 "(3), B<cpuset>(7), B<pthreads>(7)"
1906
1907 #. type: TH
1908 #: build/C/man3/pthread_attr_setdetachstate.3:24
1909 #, no-wrap
1910 msgid "PTHREAD_ATTR_SETDETACHSTATE"
1911 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
1912
1913 #. type: TH
1914 #: build/C/man3/pthread_attr_setdetachstate.3:24
1915 #: build/C/man3/pthread_attr_setschedpolicy.3:24
1916 #, no-wrap
1917 msgid "2010-02-03"
1918 msgstr "2010-02-03"
1919
1920 #. type: Plain text
1921 #: build/C/man3/pthread_attr_setdetachstate.3:28
1922 msgid ""
1923 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
1924 "state attribute in thread attributes object"
1925 msgstr ""
1926
1927 #. type: Plain text
1928 #: build/C/man3/pthread_attr_setdetachstate.3:36
1929 #, no-wrap
1930 msgid ""
1931 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
1932 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
1933 msgstr ""
1934 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
1935 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
1936
1937 #. type: Plain text
1938 #: build/C/man3/pthread_attr_setdetachstate.3:51
1939 msgid ""
1940 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
1941 "attribute of the thread attributes object referred to by I<attr> to the "
1942 "value specified in I<detachstate>.  The detach state attribute determines "
1943 "whether a thread created using the thread attributes object I<attr> will be "
1944 "created in a joinable or a detached state."
1945 msgstr ""
1946
1947 #. type: Plain text
1948 #: build/C/man3/pthread_attr_setdetachstate.3:54
1949 msgid "The following values may be specified in I<detachstate>:"
1950 msgstr ""
1951
1952 #. type: TP
1953 #: build/C/man3/pthread_attr_setdetachstate.3:54
1954 #, no-wrap
1955 msgid "B<PTHREAD_CREATE_DETACHED>"
1956 msgstr "B<PTHREAD_CREATE_DETACHED>"
1957
1958 #. type: Plain text
1959 #: build/C/man3/pthread_attr_setdetachstate.3:59
1960 msgid ""
1961 "Threads that are created using I<attr> will be created in a detached state."
1962 msgstr ""
1963
1964 #. type: TP
1965 #: build/C/man3/pthread_attr_setdetachstate.3:59
1966 #, no-wrap
1967 msgid "B<PTHREAD_CREATE_JOINABLE>"
1968 msgstr "B<PTHREAD_CREATE_JOINABLE>"
1969
1970 #. type: Plain text
1971 #: build/C/man3/pthread_attr_setdetachstate.3:64
1972 msgid ""
1973 "Threads that are created using I<attr> will be created in a joinable state."
1974 msgstr ""
1975
1976 #. type: Plain text
1977 #: build/C/man3/pthread_attr_setdetachstate.3:68
1978 msgid ""
1979 "The default setting of the detach state attribute in a newly initialized "
1980 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
1981 msgstr ""
1982
1983 #. type: Plain text
1984 #: build/C/man3/pthread_attr_setdetachstate.3:75
1985 msgid ""
1986 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
1987 "the thread attributes object I<attr> in the buffer pointed to by "
1988 "I<detachstate>."
1989 msgstr ""
1990
1991 #. type: Plain text
1992 #: build/C/man3/pthread_attr_setdetachstate.3:81
1993 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
1994 msgstr ""
1995
1996 #. type: Plain text
1997 #: build/C/man3/pthread_attr_setdetachstate.3:85
1998 msgid "An invalid value was specified in I<detachstate>."
1999 msgstr ""
2000
2001 #. type: Plain text
2002 #: build/C/man3/pthread_attr_setdetachstate.3:91
2003 msgid ""
2004 "See B<pthread_create>(3)  for more details on detached and joinable threads."
2005 msgstr ""
2006
2007 #. type: Plain text
2008 #: build/C/man3/pthread_attr_setdetachstate.3:99
2009 msgid ""
2010 "A thread that is created in a joinable state should eventually either be "
2011 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
2012 "B<pthread_create>(3)."
2013 msgstr ""
2014
2015 #. type: Plain text
2016 #: build/C/man3/pthread_attr_setdetachstate.3:106
2017 msgid ""
2018 "It is an error to specify the thread ID of a thread that was created in a "
2019 "detached state in a later call to B<pthread_detach>(3)  or B<pthread_join>"
2020 "(3)."
2021 msgstr ""
2022
2023 #. type: Plain text
2024 #: build/C/man3/pthread_attr_setdetachstate.3:109
2025 #: build/C/man3/pthread_attr_setstack.3:154
2026 msgid "See B<pthread_attr_init>(3)."
2027 msgstr ""
2028
2029 #. type: Plain text
2030 #: build/C/man3/pthread_attr_setdetachstate.3:115
2031 msgid ""
2032 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2033 "B<pthread_join>(3), B<pthreads>(7)"
2034 msgstr ""
2035 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2036 "B<pthread_join>(3), B<pthreads>(7)"
2037
2038 #. type: TH
2039 #: build/C/man3/pthread_attr_setguardsize.3:24
2040 #, no-wrap
2041 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2042 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2043
2044 #. type: TH
2045 #: build/C/man3/pthread_attr_setguardsize.3:24
2046 #: build/C/man3/pthread_attr_setscope.3:24
2047 #: build/C/man3/pthread_attr_setstack.3:24
2048 #: build/C/man3/pthread_attr_setstackaddr.3:24 build/C/man3/pthread_self.3:24
2049 #, no-wrap
2050 msgid "2008-10-24"
2051 msgstr "2008-10-24"
2052
2053 #. type: Plain text
2054 #: build/C/man3/pthread_attr_setguardsize.3:28
2055 msgid ""
2056 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2057 "attribute in thread attributes object"
2058 msgstr ""
2059
2060 #. type: Plain text
2061 #: build/C/man3/pthread_attr_setguardsize.3:36
2062 #, no-wrap
2063 msgid ""
2064 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2065 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2066 msgstr ""
2067 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2068 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2069
2070 #. type: Plain text
2071 #: build/C/man3/pthread_attr_setguardsize.3:47
2072 msgid ""
2073 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
2074 "of the thread attributes object referred to by I<attr> to the value "
2075 "specified in I<guardsize>."
2076 msgstr ""
2077
2078 #. type: Plain text
2079 #: build/C/man3/pthread_attr_setguardsize.3:57
2080 msgid ""
2081 "If I<guardsize> is greater than 0, then for each new thread created using "
2082 "I<attr> the system allocates an additional region of at least I<guardsize> "
2083 "bytes at the end of the thread's stack to act as the guard area for the "
2084 "stack (but see BUGS)."
2085 msgstr ""
2086
2087 #. type: Plain text
2088 #: build/C/man3/pthread_attr_setguardsize.3:63
2089 msgid ""
2090 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2091 "guard area."
2092 msgstr ""
2093
2094 #. type: Plain text
2095 #: build/C/man3/pthread_attr_setguardsize.3:65
2096 msgid "The default guard size is the same as the system page size."
2097 msgstr ""
2098
2099 #. type: Plain text
2100 #: build/C/man3/pthread_attr_setguardsize.3:80
2101 msgid ""
2102 "If the stack address attribute has been set in I<attr> (using "
2103 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
2104 "that the caller is allocating the thread's stack, then the guard size "
2105 "attribute is ignored (i.e., no guard area is created by the system): it is "
2106 "the application's responsibility to handle stack overflow (perhaps by using "
2107 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
2108 "it has allocated)."
2109 msgstr ""
2110
2111 #. type: Plain text
2112 #: build/C/man3/pthread_attr_setguardsize.3:88
2113 msgid ""
2114 "The B<pthread_attr_getguardsize>()  function returns the guard size "
2115 "attribute of the thread attributes object referred to by I<attr> in the "
2116 "buffer pointed to by I<guardsize>."
2117 msgstr ""
2118
2119 #. type: Plain text
2120 #: build/C/man3/pthread_attr_setguardsize.3:102
2121 msgid ""
2122 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2123 "invalid.  On Linux these functions always succeed (but portable and future-"
2124 "proof applications should nevertheless handle a possible error return)."
2125 msgstr ""
2126
2127 #. type: Plain text
2128 #: build/C/man3/pthread_attr_setguardsize.3:104
2129 #: build/C/man3/pthread_attr_setstackaddr.3:81
2130 #: build/C/man3/pthread_attr_setstacksize.3:81
2131 msgid "These functions are provided by glibc since version 2.1."
2132 msgstr ""
2133
2134 #. type: Plain text
2135 #: build/C/man3/pthread_attr_setguardsize.3:120
2136 msgid ""
2137 "A guard area consists of virtual memory pages that are protected to prevent "
2138 "read and write access.  If a thread overflows its stack into the guard area, "
2139 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2140 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
2141 "guard size is internally rounded up to the system page size when creating a "
2142 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
2143 "size that was set by B<pthread_attr_setguardsize>().)"
2144 msgstr ""
2145
2146 #. type: Plain text
2147 #: build/C/man3/pthread_attr_setguardsize.3:124
2148 msgid ""
2149 "Setting a guard size of 0 may be useful to save memory in an application "
2150 "that creates many threads and knows that stack overflow can never occur."
2151 msgstr ""
2152
2153 #. type: Plain text
2154 #: build/C/man3/pthread_attr_setguardsize.3:128
2155 msgid ""
2156 "Choosing a guard size larger than the default size may be necessary for "
2157 "detecting stack overflows if a thread allocates large data structures on the "
2158 "stack."
2159 msgstr ""
2160
2161 #. type: SH
2162 #: build/C/man3/pthread_attr_setguardsize.3:128
2163 #: build/C/man3/pthread_attr_setinheritsched.3:101
2164 #: build/C/man3/pthread_attr_setstacksize.3:94
2165 #: build/C/man3/pthread_create.3:194 build/C/man3/pthread_exit.3:91
2166 #, no-wrap
2167 msgid "BUGS"
2168 msgstr "バグ"
2169
2170 #. type: Plain text
2171 #: build/C/man3/pthread_attr_setguardsize.3:139
2172 msgid ""
2173 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2174 "within the stack size allocation, rather than allocating extra space at the "
2175 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2176 "error from B<pthread_create>(3)  if the guard size value is too large, "
2177 "leaving no space for the actual stack.)"
2178 msgstr ""
2179
2180 #.  glibc includes the guardsize within the allocated stack size,
2181 #.  which looks pretty clearly to be in violation of POSIX.
2182 #.  Filed bug, 22 Oct 2008:
2183 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2184 #.  Older reports:
2185 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2186 #.  Reportedly, LinuxThreads did the right thing, allocating
2187 #.  extra space at the end of the stack:
2188 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2189 #. type: Plain text
2190 #: build/C/man3/pthread_attr_setguardsize.3:153
2191 msgid ""
2192 "The obsolete LinuxThreads implementation did the right thing, allocating "
2193 "extra space at the end of the stack for the guard area."
2194 msgstr ""
2195
2196 #. type: Plain text
2197 #: build/C/man3/pthread_attr_setguardsize.3:156
2198 msgid "See B<pthread_getattr_np>(3)."
2199 msgstr ""
2200
2201 #. type: Plain text
2202 #: build/C/man3/pthread_attr_setguardsize.3:164
2203 msgid ""
2204 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2205 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2206 msgstr ""
2207 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2208 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2209
2210 #. type: TH
2211 #: build/C/man3/pthread_attr_setinheritsched.3:24
2212 #, no-wrap
2213 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2214 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2215
2216 #. type: TH
2217 #: build/C/man3/pthread_attr_setinheritsched.3:24
2218 #: build/C/man3/pthread_attr_setschedparam.3:24
2219 #: build/C/man3/pthread_attr_setstacksize.3:24
2220 #: build/C/man3/pthread_create.3:24
2221 #, no-wrap
2222 msgid "2012-03-15"
2223 msgstr "2012-03-15"
2224
2225 #. type: Plain text
2226 #: build/C/man3/pthread_attr_setinheritsched.3:28
2227 msgid ""
2228 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit "
2229 "scheduler attribute in thread attributes object"
2230 msgstr ""
2231
2232 #. type: Plain text
2233 #: build/C/man3/pthread_attr_setinheritsched.3:36
2234 #, no-wrap
2235 msgid ""
2236 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2237 "B<                                 int >I<inheritsched>B<);>\n"
2238 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2239 "B<                                 int *>I<inheritsched>B<);>\n"
2240 msgstr ""
2241 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2242 "B<                                 int >I<inheritsched>B<);>\n"
2243 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2244 "B<                                 int *>I<inheritsched>B<);>\n"
2245
2246 #. type: Plain text
2247 #: build/C/man3/pthread_attr_setinheritsched.3:53
2248 msgid ""
2249 "The B<pthread_attr_setinheritsched>()  function sets the inherit scheduler "
2250 "attribute of the thread attributes object referred to by I<attr> to the "
2251 "value specified in I<inheritsched>.  The inherit scheduler attribute "
2252 "determines whether a thread created using the thread attributes object "
2253 "I<attr> will inherit its scheduling attributes from the calling thread or "
2254 "whether it will take them from I<attr>."
2255 msgstr ""
2256
2257 #. type: Plain text
2258 #: build/C/man3/pthread_attr_setinheritsched.3:56
2259 msgid "The following values may be specified in I<inheritsched>:"
2260 msgstr ""
2261
2262 #. type: TP
2263 #: build/C/man3/pthread_attr_setinheritsched.3:56
2264 #, no-wrap
2265 msgid "B<PTHREAD_INHERIT_SCHED>"
2266 msgstr "B<PTHREAD_INHERIT_SCHED>"
2267
2268 #. type: Plain text
2269 #: build/C/man3/pthread_attr_setinheritsched.3:64
2270 msgid ""
2271 "Threads that are created using I<attr> inherit scheduling attributes from "
2272 "the creating thread; the scheduling attributes in I<attr> are ignored."
2273 msgstr ""
2274
2275 #. type: TP
2276 #: build/C/man3/pthread_attr_setinheritsched.3:64
2277 #, no-wrap
2278 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2279 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2280
2281 #.  FIXME what are the defaults for scheduler settings?
2282 #. type: Plain text
2283 #: build/C/man3/pthread_attr_setinheritsched.3:71
2284 msgid ""
2285 "Threads that are created using I<attr> take their scheduling attributes from "
2286 "the values specified by the attributes object."
2287 msgstr ""
2288
2289 #. type: Plain text
2290 #: build/C/man3/pthread_attr_setinheritsched.3:75
2291 msgid ""
2292 "The default setting of the inherit scheduler attribute in a newly "
2293 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2294 msgstr ""
2295
2296 #. type: Plain text
2297 #: build/C/man3/pthread_attr_setinheritsched.3:82
2298 msgid ""
2299 "The B<pthread_attr_getinheritsched>()  returns the inherit scheduler "
2300 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2301 "by I<inheritsched>."
2302 msgstr ""
2303
2304 #. type: Plain text
2305 #: build/C/man3/pthread_attr_setinheritsched.3:88
2306 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2307 msgstr ""
2308
2309 #. type: Plain text
2310 #: build/C/man3/pthread_attr_setinheritsched.3:92
2311 msgid "Invalid value in I<inheritsched>."
2312 msgstr ""
2313
2314 #.  .SH VERSIONS
2315 #.  Available since glibc 2.0.
2316 #. type: Plain text
2317 #: build/C/man3/pthread_attr_setinheritsched.3:99
2318 msgid ""
2319 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2320 "to set the attribute to an unsupported value\") for "
2321 "B<pthread_attr_setinheritsched>()."
2322 msgstr ""
2323
2324 #.  FIXME . Track status of the following bug:
2325 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2326 #. type: Plain text
2327 #: build/C/man3/pthread_attr_setinheritsched.3:117
2328 msgid ""
2329 "As at glibc 2.8, if a thread attributes object is initialized using "
2330 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2331 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2332 "if the inherit scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2333 "then a thread created using the attribute object wrongly inherits its "
2334 "scheduling attributes from the creating thread.  This bug does not occur if "
2335 "either the scheduling policy or scheduling priority attribute is explicitly "
2336 "set in the thread attributes object before calling B<pthread_create>(3)."
2337 msgstr ""
2338
2339 #. type: Plain text
2340 #: build/C/man3/pthread_attr_setinheritsched.3:120
2341 #: build/C/man3/pthread_attr_setschedparam.3:96
2342 #: build/C/man3/pthread_attr_setschedpolicy.3:92
2343 msgid "See B<pthread_setschedparam>(3)."
2344 msgstr ""
2345
2346 #. type: Plain text
2347 #: build/C/man3/pthread_attr_setinheritsched.3:129
2348 msgid ""
2349 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2350 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2351 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2352 "(3), B<pthreads>(7)"
2353 msgstr ""
2354 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2355 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2356 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2357 "(3), B<pthreads>(7)"
2358
2359 #. type: TH
2360 #: build/C/man3/pthread_attr_setschedparam.3:24
2361 #, no-wrap
2362 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2363 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2364
2365 #. type: Plain text
2366 #: build/C/man3/pthread_attr_setschedparam.3:28
2367 msgid ""
2368 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2369 "parameter attributes in thread attributes object"
2370 msgstr ""
2371
2372 #. type: Plain text
2373 #: build/C/man3/pthread_attr_setschedparam.3:36
2374 #, no-wrap
2375 msgid ""
2376 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2377 "B<                               const struct sched_param *>I<param>B<);>\n"
2378 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2379 "B<                               struct sched_param *>I<param>B<);>\n"
2380 msgstr ""
2381 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2382 "B<                               const struct sched_param *>I<param>B<);>\n"
2383 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2384 "B<                               struct sched_param *>I<param>B<);>\n"
2385
2386 #. type: Plain text
2387 #: build/C/man3/pthread_attr_setschedparam.3:50
2388 msgid ""
2389 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2390 "attributes of the thread attributes object referred to by I<attr> to the "
2391 "values specified in the buffer pointed to by I<param>.  These attributes "
2392 "determine the scheduling parameters of a thread created using the thread "
2393 "attributes object I<attr>."
2394 msgstr ""
2395
2396 #. type: Plain text
2397 #: build/C/man3/pthread_attr_setschedparam.3:57
2398 msgid ""
2399 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2400 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2401 "by I<param>."
2402 msgstr ""
2403
2404 #. type: Plain text
2405 #: build/C/man3/pthread_attr_setschedparam.3:59
2406 msgid "Scheduling parameters are maintained in the following structure:"
2407 msgstr ""
2408
2409 #. type: Plain text
2410 #: build/C/man3/pthread_attr_setschedparam.3:65
2411 #: build/C/man3/pthread_setschedparam.3:67
2412 #, no-wrap
2413 msgid ""
2414 "struct sched_param {\n"
2415 "    int sched_priority;     /* Scheduling priority */\n"
2416 "};\n"
2417 msgstr ""
2418 "struct sched_param {\n"
2419 "    int sched_priority;     /* Scheduling priority */\n"
2420 "};\n"
2421
2422 #. type: Plain text
2423 #: build/C/man3/pthread_attr_setschedparam.3:72
2424 #: build/C/man3/pthread_setschedparam.3:74
2425 msgid ""
2426 "As can be seen, only one scheduling parameter is supported.  For details of "
2427 "the permitted ranges for scheduling priorities in each scheduling policy, "
2428 "see B<sched_setscheduler>(2)."
2429 msgstr ""
2430
2431 #.  .SH VERSIONS
2432 #.  Available since glibc 2.0.
2433 #. type: Plain text
2434 #: build/C/man3/pthread_attr_setschedparam.3:87
2435 msgid ""
2436 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2437 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2438 "(but portable and future-proof applications should nevertheless handle a "
2439 "possible error return)."
2440 msgstr ""
2441
2442 #. type: Plain text
2443 #: build/C/man3/pthread_attr_setschedparam.3:93
2444 msgid ""
2445 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2446 "policies supported on Linux."
2447 msgstr ""
2448
2449 #. type: Plain text
2450 #: build/C/man3/pthread_attr_setschedparam.3:106
2451 msgid ""
2452 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2453 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2454 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2455 "(3), B<pthreads>(7)"
2456 msgstr ""
2457 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2458 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2459 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2460 "(3), B<pthreads>(7)"
2461
2462 #. type: TH
2463 #: build/C/man3/pthread_attr_setschedpolicy.3:24
2464 #, no-wrap
2465 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2466 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2467
2468 #. type: Plain text
2469 #: build/C/man3/pthread_attr_setschedpolicy.3:28
2470 msgid ""
2471 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2472 "scheduling policy attribute in thread attributes object"
2473 msgstr ""
2474
2475 #. type: Plain text
2476 #: build/C/man3/pthread_attr_setschedpolicy.3:36
2477 #, no-wrap
2478 msgid ""
2479 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2480 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2481 msgstr ""
2482 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2483 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2484
2485 #. type: Plain text
2486 #: build/C/man3/pthread_attr_setschedpolicy.3:50
2487 msgid ""
2488 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2489 "attribute of the thread attributes object referred to by I<attr> to the "
2490 "value specified in I<policy>.  This attribute determines the scheduling "
2491 "policy of a thread created using the thread attributes object I<attr>."
2492 msgstr ""
2493
2494 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2495 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2496 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2497 #. type: Plain text
2498 #: build/C/man3/pthread_attr_setschedpolicy.3:63
2499 msgid ""
2500 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2501 "B<SCHED_OTHER>, with the semantics described in B<sched_setscheduler>(2)."
2502 msgstr ""
2503
2504 #. type: Plain text
2505 #: build/C/man3/pthread_attr_setschedpolicy.3:70
2506 msgid ""
2507 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2508 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2509 "by I<policy>."
2510 msgstr ""
2511
2512 #. type: Plain text
2513 #: build/C/man3/pthread_attr_setschedpolicy.3:76
2514 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2515 msgstr ""
2516
2517 #. type: Plain text
2518 #: build/C/man3/pthread_attr_setschedpolicy.3:80
2519 msgid "Invalid value in I<policy>."
2520 msgstr ""
2521
2522 #.  .SH VERSIONS
2523 #.  Available since glibc 2.0.
2524 #. type: Plain text
2525 #: build/C/man3/pthread_attr_setschedpolicy.3:87
2526 msgid ""
2527 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2528 "to set the attribute to an unsupported value\") for "
2529 "B<pthread_attr_setschedpolicy>()."
2530 msgstr ""
2531
2532 #. type: Plain text
2533 #: build/C/man3/pthread_attr_setschedpolicy.3:101
2534 msgid ""
2535 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2536 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2537 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2538 "(3), B<pthreads>(7)"
2539 msgstr ""
2540 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2541 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2542 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2543 "(3), B<pthreads>(7)"
2544
2545 #. type: TH
2546 #: build/C/man3/pthread_attr_setscope.3:24
2547 #, no-wrap
2548 msgid "PTHREAD_ATTR_SETSCOPE"
2549 msgstr "PTHREAD_ATTR_SETSCOPE"
2550
2551 #. type: Plain text
2552 #: build/C/man3/pthread_attr_setscope.3:28
2553 msgid ""
2554 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2555 "attribute in thread attributes object"
2556 msgstr ""
2557
2558 #. type: Plain text
2559 #: build/C/man3/pthread_attr_setscope.3:36
2560 #, no-wrap
2561 msgid ""
2562 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2563 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2564 msgstr ""
2565 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2566 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2567
2568 #. type: Plain text
2569 #: build/C/man3/pthread_attr_setscope.3:51
2570 msgid ""
2571 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2572 "of the thread attributes object referred to by I<attr> to the value "
2573 "specified in I<scope>.  The contention scope attribute defines the set of "
2574 "threads against which a thread competes for resources such as the CPU.  "
2575 "POSIX.1-2001 specifies two possible values for I<scope>:"
2576 msgstr ""
2577
2578 #. type: TP
2579 #: build/C/man3/pthread_attr_setscope.3:51
2580 #, no-wrap
2581 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2582 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2583
2584 #. type: Plain text
2585 #: build/C/man3/pthread_attr_setscope.3:59
2586 msgid ""
2587 "The thread competes for resources with all other threads in all processes on "
2588 "the system that are in the same scheduling allocation domain (a group of one "
2589 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2590 "to one another according to their scheduling policy and priority."
2591 msgstr ""
2592
2593 #. type: TP
2594 #: build/C/man3/pthread_attr_setscope.3:59
2595 #, no-wrap
2596 msgid "B<PTHREAD_SCOPE_PROCESS>"
2597 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2598
2599 #. type: Plain text
2600 #: build/C/man3/pthread_attr_setscope.3:74
2601 msgid ""
2602 "The thread competes for resources with all other threads in the same process "
2603 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
2604 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2605 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
2606 "leaves it unspecified how these threads contend with other threads in other "
2607 "process on the system or with other threads in the same process that were "
2608 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
2609 msgstr ""
2610
2611 #. type: Plain text
2612 #: build/C/man3/pthread_attr_setscope.3:81
2613 msgid ""
2614 "POSIX.1-2001 only requires that an implementation support one of these "
2615 "contention scopes, but permits both to be supported.  Linux supports "
2616 "B<PTHREAD_SCOPE_SYSTEM>, but not B<PTHREAD_SCOPE_PROCESS>."
2617 msgstr ""
2618
2619 #. type: Plain text
2620 #: build/C/man3/pthread_attr_setscope.3:89
2621 msgid ""
2622 "The B<pthread_attr_getscope>()  function returns the contention scope "
2623 "attribute of the thread attributes object referred to by I<attr> in the "
2624 "buffer pointed to by I<scope>."
2625 msgstr ""
2626
2627 #. type: Plain text
2628 #: build/C/man3/pthread_attr_setscope.3:95
2629 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
2630 msgstr ""
2631
2632 #. type: Plain text
2633 #: build/C/man3/pthread_attr_setscope.3:99
2634 msgid "An invalid value was specified in I<scope>."
2635 msgstr ""
2636
2637 #. type: TP
2638 #: build/C/man3/pthread_attr_setscope.3:99
2639 #, no-wrap
2640 msgid "B<ENOTSUP>"
2641 msgstr "B<ENOTSUP>"
2642
2643 #. type: Plain text
2644 #: build/C/man3/pthread_attr_setscope.3:105
2645 msgid ""
2646 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
2647 "supported on Linux."
2648 msgstr ""
2649
2650 #. type: Plain text
2651 #: build/C/man3/pthread_attr_setscope.3:115
2652 msgid ""
2653 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a "
2654 "userspace thread is bound directly to a single kernel-scheduling entity.  "
2655 "This is the case on Linux for the obsolete LinuxThreads implementation and "
2656 "the modern NPTL implementation, which are both 1:1 threading implementations."
2657 msgstr ""
2658
2659 #. type: Plain text
2660 #: build/C/man3/pthread_attr_setscope.3:118
2661 msgid ""
2662 "POSIX.1-2001 specifies that the default contention scope is implementation-"
2663 "defined."
2664 msgstr ""
2665
2666 #. type: Plain text
2667 #: build/C/man3/pthread_attr_setscope.3:126
2668 msgid ""
2669 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2670 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2671 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2672 msgstr ""
2673 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2674 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2675 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2676
2677 #. type: TH
2678 #: build/C/man3/pthread_attr_setstack.3:24
2679 #, no-wrap
2680 msgid "PTHREAD_ATTR_SETSTACK"
2681 msgstr "PTHREAD_ATTR_SETSTACK"
2682
2683 #. type: Plain text
2684 #: build/C/man3/pthread_attr_setstack.3:28
2685 msgid ""
2686 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
2687 "thread attributes object"
2688 msgstr ""
2689
2690 #. type: Plain text
2691 #: build/C/man3/pthread_attr_setstack.3:36
2692 #, no-wrap
2693 msgid ""
2694 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2695 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2696 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2697 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2698 msgstr ""
2699 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2700 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2701 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2702 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2703
2704 #. type: Plain text
2705 #: build/C/man3/pthread_attr_setstack.3:43 build/C/man3/pthread_sigqueue.3:39
2706 msgid ""
2707 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
2708 msgstr ""
2709
2710 #. type: Plain text
2711 #: build/C/man3/pthread_attr_setstack.3:48
2712 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2713 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2714
2715 #. type: Plain text
2716 #: build/C/man3/pthread_attr_setstack.3:50
2717 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2718 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2719
2720 #. type: Plain text
2721 #: build/C/man3/pthread_attr_setstack.3:66
2722 msgid ""
2723 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
2724 "size attributes of the thread attributes object referred to by I<attr> to "
2725 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
2726 "attributes specify the location and size of the stack that should be used by "
2727 "a thread that is created using the thread attributes object I<attr>."
2728 msgstr ""
2729
2730 #. type: Plain text
2731 #: build/C/man3/pthread_attr_setstack.3:72
2732 msgid ""
2733 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
2734 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
2735 "allocated buffer should be both readable and writable."
2736 msgstr ""
2737
2738 #. type: Plain text
2739 #: build/C/man3/pthread_attr_setstack.3:83
2740 msgid ""
2741 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
2742 "size attributes of the thread attributes object referred to by I<attr> in "
2743 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
2744 msgstr ""
2745
2746 #. type: Plain text
2747 #: build/C/man3/pthread_attr_setstack.3:89
2748 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
2749 msgstr ""
2750
2751 #. type: Plain text
2752 #: build/C/man3/pthread_attr_setstack.3:100
2753 msgid ""
2754 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
2755 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
2756 "stacksize> is not suitably aligned."
2757 msgstr ""
2758
2759 #. type: Plain text
2760 #: build/C/man3/pthread_attr_setstack.3:108
2761 msgid ""
2762 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
2763 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
2764 "caller."
2765 msgstr ""
2766
2767 #. type: Plain text
2768 #: build/C/man3/pthread_attr_setstack.3:110
2769 msgid "These functions are provided by glibc since version 2.2."
2770 msgstr ""
2771
2772 #. type: Plain text
2773 #: build/C/man3/pthread_attr_setstack.3:120
2774 msgid ""
2775 "These functions are provided for applications that must ensure that a "
2776 "thread's stack is placed in a particular location.  For most applications, "
2777 "this is not necessary, and the use of these functions should be avoided.  "
2778 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
2779 "stack size other than the default.)"
2780 msgstr ""
2781
2782 #. type: Plain text
2783 #: build/C/man3/pthread_attr_setstack.3:131
2784 msgid ""
2785 "When an application employs B<pthread_attr_setstack>(), it takes over the "
2786 "responsibility of allocating the stack.  Any guard size value that was set "
2787 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
2788 "is the application's responsibility to allocate a guard area (one or more "
2789 "pages protected against reading and writing)  to handle the possibility of "
2790 "stack overflow."
2791 msgstr ""
2792
2793 #. type: Plain text
2794 #: build/C/man3/pthread_attr_setstack.3:142
2795 msgid ""
2796 "The address specified in I<stackaddr> should be suitably aligned: for full "
2797 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
2798 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
2799 "should also be a multiple of the system page size."
2800 msgstr ""
2801
2802 #. type: Plain text
2803 #: build/C/man3/pthread_attr_setstack.3:151
2804 msgid ""
2805 "If I<attr> is used to create multiple threads, then the caller must change "
2806 "the stack address attribute between calls to B<pthread_create>(3); "
2807 "otherwise, the threads will attempt to use the same memory area for their "
2808 "stacks, and chaos will ensue."
2809 msgstr ""
2810
2811 #. type: Plain text
2812 #: build/C/man3/pthread_attr_setstack.3:164
2813 msgid ""
2814 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
2815 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
2816 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2817 msgstr ""
2818 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
2819 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
2820 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2821
2822 #. type: TH
2823 #: build/C/man3/pthread_attr_setstackaddr.3:24
2824 #, no-wrap
2825 msgid "PTHREAD_ATTR_SETSTACKADDR"
2826 msgstr "PTHREAD_ATTR_SETSTACKADDR"
2827
2828 #. type: Plain text
2829 #: build/C/man3/pthread_attr_setstackaddr.3:28
2830 msgid ""
2831 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
2832 "attribute in thread attributes object"
2833 msgstr ""
2834
2835 #. type: Plain text
2836 #: build/C/man3/pthread_attr_setstackaddr.3:36
2837 #, no-wrap
2838 msgid ""
2839 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
2840 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
2841 msgstr ""
2842 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
2843 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
2844
2845 #. type: Plain text
2846 #: build/C/man3/pthread_attr_setstackaddr.3:47
2847 msgid ""
2848 "These functions are obsolete: B<do not use them.> Use "
2849 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
2850 msgstr ""
2851
2852 #. type: Plain text
2853 #: build/C/man3/pthread_attr_setstackaddr.3:58
2854 msgid ""
2855 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
2856 "attribute of the thread attributes object referred to by I<attr> to the "
2857 "value specified in I<stackaddr>.  This attribute specifies the location of "
2858 "the stack that should be used by a thread that is created using the thread "
2859 "attributes object I<attr>."
2860 msgstr ""
2861
2862 #. type: Plain text
2863 #: build/C/man3/pthread_attr_setstackaddr.3:64
2864 msgid ""
2865 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
2866 "that was allocated by the caller.  The pages of the allocated buffer should "
2867 "be both readable and writable."
2868 msgstr ""
2869
2870 #. type: Plain text
2871 #: build/C/man3/pthread_attr_setstackaddr.3:72
2872 msgid ""
2873 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
2874 "attribute of the thread attributes object referred to by I<attr> in the "
2875 "buffer pointed to by I<stackaddr>."
2876 msgstr ""
2877
2878 #. type: Plain text
2879 #: build/C/man3/pthread_attr_setstackaddr.3:79
2880 msgid ""
2881 "No errors are defined (but applications should nevertheless handle a "
2882 "possible error return)."
2883 msgstr ""
2884
2885 #. type: Plain text
2886 #: build/C/man3/pthread_attr_setstackaddr.3:84
2887 msgid ""
2888 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
2889 "POSIX.1-2008 removes the specification of these functions."
2890 msgstr ""
2891
2892 #. type: Plain text
2893 #: build/C/man3/pthread_attr_setstackaddr.3:108
2894 msgid ""
2895 "I<Do not use these functions!> They cannot be portably used, since they "
2896 "provide no way of specifying the direction of growth or the range of the "
2897 "stack.  For example, on architectures with a stack that grows downward, "
2898 "I<stackaddr> specifies the next address past the I<highest> address of the "
2899 "allocated stack area.  However, on architectures with a stack that grows "
2900 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
2901 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
2902 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
2903 "in the allocated stack area (and the I<stacksize> argument specifies the "
2904 "range of the stack)."
2905 msgstr ""
2906
2907 #. type: Plain text
2908 #: build/C/man3/pthread_attr_setstackaddr.3:114
2909 msgid ""
2910 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
2911 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2912 msgstr ""
2913 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
2914 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2915
2916 #. type: TH
2917 #: build/C/man3/pthread_attr_setstacksize.3:24
2918 #, no-wrap
2919 msgid "PTHREAD_ATTR_SETSTACKSIZE"
2920 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
2921
2922 #. type: Plain text
2923 #: build/C/man3/pthread_attr_setstacksize.3:28
2924 msgid ""
2925 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
2926 "attribute in thread attributes object"
2927 msgstr ""
2928
2929 #. type: Plain text
2930 #: build/C/man3/pthread_attr_setstacksize.3:36
2931 #, no-wrap
2932 msgid ""
2933 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
2934 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
2935 msgstr ""
2936 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
2937 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
2938
2939 #. type: Plain text
2940 #: build/C/man3/pthread_attr_setstacksize.3:47
2941 msgid ""
2942 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
2943 "of the thread attributes object referred to by I<attr> to the value "
2944 "specified in I<stacksize>."
2945 msgstr ""
2946
2947 #. type: Plain text
2948 #: build/C/man3/pthread_attr_setstacksize.3:51
2949 msgid ""
2950 "The stack size attribute determines the minimum size (in bytes) that will be "
2951 "allocated for threads created using the thread attributes object I<attr>."
2952 msgstr ""
2953
2954 #. type: Plain text
2955 #: build/C/man3/pthread_attr_setstacksize.3:59
2956 msgid ""
2957 "The B<pthread_attr_getstacksize>()  function returns the stack size "
2958 "attribute of the thread attributes object referred to by I<attr> in the "
2959 "buffer pointed to by I<stacksize>."
2960 msgstr ""
2961
2962 #. type: Plain text
2963 #: build/C/man3/pthread_attr_setstacksize.3:65
2964 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
2965 msgstr ""
2966
2967 #. type: Plain text
2968 #: build/C/man3/pthread_attr_setstacksize.3:70
2969 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
2970 msgstr ""
2971
2972 #.  e.g., MacOS
2973 #. type: Plain text
2974 #: build/C/man3/pthread_attr_setstacksize.3:79
2975 msgid ""
2976 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
2977 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
2978 msgstr ""
2979
2980 #. type: Plain text
2981 #: build/C/man3/pthread_attr_setstacksize.3:86
2982 msgid ""
2983 "For details on the default stack size of new threads, see B<pthread_create>"
2984 "(3)."
2985 msgstr ""
2986
2987 #. type: Plain text
2988 #: build/C/man3/pthread_attr_setstacksize.3:89
2989 msgid ""
2990 "A thread's stack size is fixed at the time of thread creation.  Only the "
2991 "main thread can dynamically grow its stack."
2992 msgstr ""
2993
2994 #. type: Plain text
2995 #: build/C/man3/pthread_attr_setstacksize.3:94
2996 msgid ""
2997 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
2998 "the size and location of a caller-allocated stack that is to be used by a "
2999 "thread."
3000 msgstr ""
3001
3002 #. type: Plain text
3003 #: build/C/man3/pthread_attr_setstacksize.3:106
3004 msgid ""
3005 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
3006 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
3007 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
3008 "stack will be at least I<stacksize> bytes."
3009 msgstr ""
3010
3011 #. type: Plain text
3012 #: build/C/man3/pthread_attr_setstacksize.3:109
3013 #: build/C/man3/pthread_join.3:125
3014 msgid "See B<pthread_create>(3)."
3015 msgstr ""
3016
3017 #. type: Plain text
3018 #: build/C/man3/pthread_attr_setstacksize.3:116
3019 msgid ""
3020 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3021 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3022 msgstr ""
3023 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3024 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3025
3026 #. type: TH
3027 #: build/C/man3/pthread_cancel.3:24
3028 #, no-wrap
3029 msgid "PTHREAD_CANCEL"
3030 msgstr "PTHREAD_CANCEL"
3031
3032 #. type: TH
3033 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_setschedparam.3:24
3034 #: build/C/man3/pthread_testcancel.3:24
3035 #, no-wrap
3036 msgid "2008-11-17"
3037 msgstr "2008-11-17"
3038
3039 #. type: Plain text
3040 #: build/C/man3/pthread_cancel.3:27
3041 msgid "pthread_cancel - send a cancellation request to a thread"
3042 msgstr ""
3043
3044 #. type: Plain text
3045 #: build/C/man3/pthread_cancel.3:32
3046 #, no-wrap
3047 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3048 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3049
3050 #. type: Plain text
3051 #: build/C/man3/pthread_cancel.3:44
3052 msgid ""
3053 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
3054 "I<thread>.  Whether and when the target thread reacts to the cancellation "
3055 "request depends on two attributes that are under the control of that thread: "
3056 "its cancelability I<state> and I<type>."
3057 msgstr ""
3058
3059 #. type: Plain text
3060 #: build/C/man3/pthread_cancel.3:56
3061 msgid ""
3062 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
3063 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
3064 "has disabled cancellation, then a cancellation request remains queued until "
3065 "the thread enables cancellation.  If a thread has enabled cancellation, then "
3066 "its cancelability type determines when cancellation occurs."
3067 msgstr ""
3068
3069 #. type: Plain text
3070 #: build/C/man3/pthread_cancel.3:72
3071 msgid ""
3072 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3073 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
3074 "Asynchronous cancelability means that the thread can be canceled at any time "
3075 "(usually immediately, but the system does not guarantee this).  Deferred "
3076 "cancelability means that cancellation will be delayed until the thread next "
3077 "calls a function that is a I<cancellation point>.  A list of functions that "
3078 "are or may be cancellation points is provided in I<pthreads>(7)."
3079 msgstr ""
3080
3081 #. type: Plain text
3082 #: build/C/man3/pthread_cancel.3:76
3083 msgid ""
3084 "When a cancellation requested is acted on, the following steps occur for "
3085 "I<thread> (in this order):"
3086 msgstr ""
3087
3088 #. type: IP
3089 #: build/C/man3/pthread_cancel.3:76 build/C/man3/pthread_cleanup_push.3:67
3090 #, no-wrap
3091 msgid "1."
3092 msgstr "1."
3093
3094 #. type: Plain text
3095 #: build/C/man3/pthread_cancel.3:81
3096 msgid ""
3097 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3098 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
3099 msgstr ""
3100
3101 #. type: IP
3102 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:71
3103 #, no-wrap
3104 msgid "2."
3105 msgstr "2."
3106
3107 #. type: Plain text
3108 #: build/C/man3/pthread_cancel.3:86
3109 msgid ""
3110 "Thread-specific data destructors are called, in an unspecified order.  (See "
3111 "B<pthread_key_create>(3).)"
3112 msgstr ""
3113
3114 #. type: IP
3115 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:79
3116 #, no-wrap
3117 msgid "3."
3118 msgstr "3."
3119
3120 #. type: Plain text
3121 #: build/C/man3/pthread_cancel.3:90
3122 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3123 msgstr ""
3124
3125 #. type: Plain text
3126 #: build/C/man3/pthread_cancel.3:98
3127 msgid ""
3128 "The above steps happen asynchronously with respect to the B<pthread_cancel>"
3129 "()  call; the return status of B<pthread_cancel>()  merely informs the "
3130 "caller whether the cancellation request was successfully queued."
3131 msgstr ""
3132
3133 #. type: Plain text
3134 #: build/C/man3/pthread_cancel.3:107
3135 msgid ""
3136 "After a canceled thread has terminated, a join with that thread using "
3137 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
3138 "status.  (Joining with a thread is the only way to know that cancellation "
3139 "has completed.)"
3140 msgstr ""
3141
3142 #. type: Plain text
3143 #: build/C/man3/pthread_cancel.3:112
3144 msgid ""
3145 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
3146 "error number."
3147 msgstr ""
3148
3149 #. type: TP
3150 #: build/C/man3/pthread_cancel.3:113 build/C/man3/pthread_detach.3:57
3151 #: build/C/man3/pthread_getcpuclockid.3:56 build/C/man3/pthread_join.3:91
3152 #: build/C/man3/pthread_kill.3:59 build/C/man3/pthread_setaffinity_np.3:112
3153 #: build/C/man3/pthread_setschedparam.3:112
3154 #: build/C/man3/pthread_setschedprio.3:68 build/C/man3/pthread_sigqueue.3:83
3155 #, no-wrap
3156 msgid "B<ESRCH>"
3157 msgstr "B<ESRCH>"
3158
3159 #. type: Plain text
3160 #: build/C/man3/pthread_cancel.3:120 build/C/man3/pthread_detach.3:62
3161 #: build/C/man3/pthread_getcpuclockid.3:61 build/C/man3/pthread_join.3:96
3162 #: build/C/man3/pthread_kill.3:64 build/C/man3/pthread_setaffinity_np.3:117
3163 #: build/C/man3/pthread_setschedparam.3:117
3164 #: build/C/man3/pthread_setschedprio.3:73
3165 msgid "No thread with the ID I<thread> could be found."
3166 msgstr ""
3167
3168 #. type: Plain text
3169 #: build/C/man3/pthread_cancel.3:130
3170 msgid ""
3171 "On Linux, cancellation is implemented using signals.  Under the NPTL "
3172 "threading implementation, the first real-time signal (i.e., signal 32) is "
3173 "used for this purpose.  On LinuxThreads, the second real-time signal is "
3174 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3175 msgstr ""
3176
3177 #. type: Plain text
3178 #: build/C/man3/pthread_cancel.3:136
3179 msgid ""
3180 "The program below creates a thread and then cancels it.  The main thread "
3181 "joins with the canceled thread to check that its exit status was "
3182 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
3183 "run the program:"
3184 msgstr ""
3185
3186 #. type: Plain text
3187 #: build/C/man3/pthread_cancel.3:144
3188 #, no-wrap
3189 msgid ""
3190 "$ ./a.out\n"
3191 "thread_func(): started; cancellation disabled\n"
3192 "main(): sending cancellation request\n"
3193 "thread_func(): about to enable cancellation\n"
3194 "main(): thread was canceled\n"
3195 msgstr ""
3196 "$ ./a.out\n"
3197 "thread_func(): started; cancellation disabled\n"
3198 "main(): sending cancellation request\n"
3199 "thread_func(): about to enable cancellation\n"
3200 "main(): thread was canceled\n"
3201
3202 #. type: Plain text
3203 #: build/C/man3/pthread_cancel.3:154
3204 #, no-wrap
3205 msgid ""
3206 "#include E<lt>pthread.hE<gt>\n"
3207 "#include E<lt>stdio.hE<gt>\n"
3208 "#include E<lt>errno.hE<gt>\n"
3209 "#include E<lt>stdlib.hE<gt>\n"
3210 "#include E<lt>unistd.hE<gt>\n"
3211 msgstr ""
3212 "#include E<lt>pthread.hE<gt>\n"
3213 "#include E<lt>stdio.hE<gt>\n"
3214 "#include E<lt>errno.hE<gt>\n"
3215 "#include E<lt>stdlib.hE<gt>\n"
3216 "#include E<lt>unistd.hE<gt>\n"
3217
3218 #. type: Plain text
3219 #: build/C/man3/pthread_cancel.3:162
3220 #, no-wrap
3221 msgid ""
3222 "static void *\n"
3223 "thread_func(void *ignored_argument)\n"
3224 "{\n"
3225 "    int s;\n"
3226 msgstr ""
3227 "static void *\n"
3228 "thread_func(void *ignored_argument)\n"
3229 "{\n"
3230 "    int s;\n"
3231
3232 #. type: Plain text
3233 #: build/C/man3/pthread_cancel.3:165
3234 #, no-wrap
3235 msgid ""
3236 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3237 "       immediately react to a cancellation request */\n"
3238 msgstr ""
3239 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3240 "       immediately react to a cancellation request */\n"
3241
3242 #. type: Plain text
3243 #: build/C/man3/pthread_cancel.3:169
3244 #, no-wrap
3245 msgid ""
3246 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3247 "    if (s != 0)\n"
3248 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3249 msgstr ""
3250 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3251 "    if (s != 0)\n"
3252 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3253
3254 #. type: Plain text
3255 #: build/C/man3/pthread_cancel.3:173
3256 #, no-wrap
3257 msgid ""
3258 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3259 "    sleep(5);\n"
3260 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3261 msgstr ""
3262 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3263 "    sleep(5);\n"
3264 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3265
3266 #. type: Plain text
3267 #: build/C/man3/pthread_cancel.3:177
3268 #, no-wrap
3269 msgid ""
3270 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3271 "    if (s != 0)\n"
3272 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3273 msgstr ""
3274 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3275 "    if (s != 0)\n"
3276 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3277
3278 #. type: Plain text
3279 #: build/C/man3/pthread_cancel.3:179
3280 #, no-wrap
3281 msgid "    /* sleep() is a cancellation point */\n"
3282 msgstr "    /* sleep() is a cancellation point */\n"
3283
3284 #. type: Plain text
3285 #: build/C/man3/pthread_cancel.3:181
3286 #, no-wrap
3287 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3288 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3289
3290 #. type: Plain text
3291 #: build/C/man3/pthread_cancel.3:183
3292 #, no-wrap
3293 msgid "    /* Should never get here */\n"
3294 msgstr "    /* Should never get here */\n"
3295
3296 #. type: Plain text
3297 #: build/C/man3/pthread_cancel.3:187
3298 #, no-wrap
3299 msgid ""
3300 "    printf(\"thread_func(): not canceled!\\en\");\n"
3301 "    return NULL;\n"
3302 "}\n"
3303 msgstr ""
3304 "    printf(\"thread_func(): not canceled!\\en\");\n"
3305 "    return NULL;\n"
3306 "}\n"
3307
3308 #. type: Plain text
3309 #: build/C/man3/pthread_cancel.3:194
3310 #, no-wrap
3311 msgid ""
3312 "int\n"
3313 "main(void)\n"
3314 "{\n"
3315 "    pthread_t thr;\n"
3316 "    void *res;\n"
3317 "    int s;\n"
3318 msgstr ""
3319 "int\n"
3320 "main(void)\n"
3321 "{\n"
3322 "    pthread_t thr;\n"
3323 "    void *res;\n"
3324 "    int s;\n"
3325
3326 #. type: Plain text
3327 #: build/C/man3/pthread_cancel.3:196
3328 #, no-wrap
3329 msgid "    /* Start a thread and then send it a cancellation request */\n"
3330 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3331
3332 #. type: Plain text
3333 #: build/C/man3/pthread_cancel.3:200
3334 #, no-wrap
3335 msgid ""
3336 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3337 "    if (s != 0)\n"
3338 "        handle_error_en(s, \"pthread_create\");\n"
3339 msgstr ""
3340 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3341 "    if (s != 0)\n"
3342 "        handle_error_en(s, \"pthread_create\");\n"
3343
3344 #. type: Plain text
3345 #: build/C/man3/pthread_cancel.3:202
3346 #, no-wrap
3347 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3348 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3349
3350 #. type: Plain text
3351 #: build/C/man3/pthread_cancel.3:207
3352 #, no-wrap
3353 msgid ""
3354 "    printf(\"main(): sending cancellation request\\en\");\n"
3355 "    s = pthread_cancel(thr);\n"
3356 "    if (s != 0)\n"
3357 "        handle_error_en(s, \"pthread_cancel\");\n"
3358 msgstr ""
3359 "    printf(\"main(): sending cancellation request\\en\");\n"
3360 "    s = pthread_cancel(thr);\n"
3361 "    if (s != 0)\n"
3362 "        handle_error_en(s, \"pthread_cancel\");\n"
3363
3364 #. type: Plain text
3365 #: build/C/man3/pthread_cancel.3:209
3366 #, no-wrap
3367 msgid "    /* Join with thread to see what its exit status was */\n"
3368 msgstr "    /* Join with thread to see what its exit status was */\n"
3369
3370 #. type: Plain text
3371 #: build/C/man3/pthread_cancel.3:213 build/C/man3/pthread_cleanup_push.3:301
3372 #, no-wrap
3373 msgid ""
3374 "    s = pthread_join(thr, &res);\n"
3375 "    if (s != 0)\n"
3376 "        handle_error_en(s, \"pthread_join\");\n"
3377 msgstr ""
3378 "    s = pthread_join(thr, &res);\n"
3379 "    if (s != 0)\n"
3380 "        handle_error_en(s, \"pthread_join\");\n"
3381
3382 #. type: Plain text
3383 #: build/C/man3/pthread_cancel.3:220
3384 #, no-wrap
3385 msgid ""
3386 "    if (res == PTHREAD_CANCELED)\n"
3387 "        printf(\"main(): thread was canceled\\en\");\n"
3388 "    else\n"
3389 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3390 "    exit(EXIT_SUCCESS);\n"
3391 "}\n"
3392 msgstr ""
3393 "    if (res == PTHREAD_CANCELED)\n"
3394 "        printf(\"main(): thread was canceled\\en\");\n"
3395 "    else\n"
3396 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3397 "    exit(EXIT_SUCCESS);\n"
3398 "}\n"
3399
3400 #. type: Plain text
3401 #: build/C/man3/pthread_cancel.3:231
3402 msgid ""
3403 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3404 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3405 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3406 msgstr ""
3407 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3408 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3409 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3410
3411 #. type: TH
3412 #: build/C/man3/pthread_cleanup_push.3:24
3413 #, no-wrap
3414 msgid "PTHREAD_CLEANUP_PUSH"
3415 msgstr "PTHREAD_CLEANUP_PUSH"
3416
3417 #. type: TH
3418 #: build/C/man3/pthread_cleanup_push.3:24
3419 #: build/C/man3/pthread_setcancelstate.3:24
3420 #, no-wrap
3421 msgid "2008-11-24"
3422 msgstr "2008-11-24"
3423
3424 #. type: Plain text
3425 #: build/C/man3/pthread_cleanup_push.3:28
3426 msgid ""
3427 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
3428 "clean-up handlers"
3429 msgstr ""
3430
3431 #. type: Plain text
3432 #: build/C/man3/pthread_cleanup_push.3:35
3433 #, no-wrap
3434 msgid ""
3435 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3436 "B<                          void *>I<arg>B<);>\n"
3437 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3438 msgstr ""
3439 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3440 "B<                          void *>I<arg>B<);>\n"
3441 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3442
3443 #. type: Plain text
3444 #: build/C/man3/pthread_cleanup_push.3:46
3445 msgid ""
3446 "These functions manipulate the calling thread's stack of thread-cancellation "
3447 "clean-up handlers.  A clean-up handler is a function that is automatically "
3448 "executed when a thread is canceled (or in various other circumstances "
3449 "described below); it might, for example, unlock a mutex so that it becomes "
3450 "available to other threads in the process."
3451 msgstr ""
3452
3453 #. type: Plain text
3454 #: build/C/man3/pthread_cleanup_push.3:57
3455 msgid ""
3456 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
3457 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
3458 "be given I<arg> as its argument."
3459 msgstr ""
3460
3461 #. type: Plain text
3462 #: build/C/man3/pthread_cleanup_push.3:64
3463 msgid ""
3464 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
3465 "stack of clean-up handlers, and optionally executes it if I<execute> is "
3466 "nonzero."
3467 msgstr ""
3468
3469 #. type: Plain text
3470 #: build/C/man3/pthread_cleanup_push.3:67
3471 msgid ""
3472 "A cancellation clean-up handler is popped from the stack and executed in the "
3473 "following circumstances:"
3474 msgstr ""
3475
3476 #. type: Plain text
3477 #: build/C/man3/pthread_cleanup_push.3:71
3478 msgid ""
3479 "When a thread is canceled, all of the stacked clean-up handlers are popped "
3480 "and executed in the reverse of the order in which they were pushed onto the "
3481 "stack."
3482 msgstr ""
3483
3484 #. type: Plain text
3485 #: build/C/man3/pthread_cleanup_push.3:79
3486 msgid ""
3487 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
3488 "handlers are executed as described in the preceding point.  (Clean-up "
3489 "handlers are I<not> called if the thread terminates by performing a "
3490 "I<return> from the thread start function.)"
3491 msgstr ""
3492
3493 #. type: Plain text
3494 #: build/C/man3/pthread_cleanup_push.3:85
3495 msgid ""
3496 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
3497 "argument, the top-most clean-up handler is popped and executed."
3498 msgstr ""
3499
3500 #. type: Plain text
3501 #: build/C/man3/pthread_cleanup_push.3:97
3502 msgid ""
3503 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
3504 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
3505 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
3506 "calls to these functions are paired within the same function, and at the "
3507 "same lexical nesting level.  (In other words, a clean-up handler is only "
3508 "established during the execution of a specified section of code.)"
3509 msgstr ""
3510
3511 #. type: Plain text
3512 #: build/C/man3/pthread_cleanup_push.3:117
3513 msgid ""
3514 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
3515 "call has been made to B<pthread_cleanup_push>()  or B<pthread_cleanup_pop>"
3516 "()  without the matching call of the pair since the jump buffer was filled "
3517 "by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, calling B<longjmp>(3)  "
3518 "(B<siglongjmp>(3))  from inside a clean-up handler produces undefined "
3519 "results unless the jump buffer was also filled by B<setjmp>(3)  (B<sigsetjmp>"
3520 "(3))  inside the handler."
3521 msgstr ""
3522
3523 #. type: Plain text
3524 #: build/C/man3/pthread_cleanup_push.3:119
3525 msgid "These functions do not return a value."
3526 msgstr ""
3527
3528 #.  SH VERSIONS
3529 #.  Available since glibc 2.0
3530 #. type: Plain text
3531 #: build/C/man3/pthread_cleanup_push.3:123
3532 msgid "There are no errors."
3533 msgstr ""
3534
3535 #. type: Plain text
3536 #: build/C/man3/pthread_cleanup_push.3:134
3537 msgid ""
3538 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
3539 "functions I<are> implemented as macros that expand to text containing \\(aqB<"
3540 "{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
3541 "declared within the scope of paired calls to these functions will only be "
3542 "visible within that scope."
3543 msgstr ""
3544
3545 #.  The text was actually added in the 2004 TC2
3546 #. type: Plain text
3547 #: build/C/man3/pthread_cleanup_push.3:149
3548 msgid ""
3549 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
3550 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
3551 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
3552 "avoid doing this."
3553 msgstr ""
3554
3555 #. type: Plain text
3556 #: build/C/man3/pthread_cleanup_push.3:164
3557 msgid ""
3558 "The program below provides a simple example of the use of the functions "
3559 "described in this page.  The program creates a thread that executes a loop "
3560 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
3561 "loop increments a global variable, I<cnt>, once each second.  Depending on "
3562 "what command-line arguments are supplied, the main thread sends the other "
3563 "thread a cancellation request, or sets a global variable that causes the "
3564 "other thread to exit its loop and terminate normally (by doing a I<return>)."
3565 msgstr ""
3566
3567 #. type: Plain text
3568 #: build/C/man3/pthread_cleanup_push.3:167
3569 msgid ""
3570 "In the following shell session, the main thread sends a cancellation request "
3571 "to the other thread:"
3572 msgstr ""
3573
3574 #. type: Plain text
3575 #: build/C/man3/pthread_cleanup_push.3:177
3576 #, no-wrap
3577 msgid ""
3578 "$ B<./a.out>\n"
3579 "New thread started\n"
3580 "cnt = 0\n"
3581 "cnt = 1\n"
3582 "Canceling thread\n"
3583 "Called clean-up handler\n"
3584 "Thread was canceled; cnt = 0\n"
3585 msgstr ""
3586 "$ B<./a.out>\n"
3587 "New thread started\n"
3588 "cnt = 0\n"
3589 "cnt = 1\n"
3590 "Canceling thread\n"
3591 "Called clean-up handler\n"
3592 "Thread was canceled; cnt = 0\n"
3593
3594 #. type: Plain text
3595 #: build/C/man3/pthread_cleanup_push.3:185
3596 msgid ""
3597 "From the above, we see that the thread was canceled, and that the "
3598 "cancellation clean-up handler was called and it reset the value of the "
3599 "global variable I<cnt> to 0."
3600 msgstr ""
3601
3602 #. type: Plain text
3603 #: build/C/man3/pthread_cleanup_push.3:188
3604 msgid ""
3605 "In the next run, the main program sets a global variable that causes other "
3606 "thread to terminate normally:"
3607 msgstr ""
3608
3609 #. type: Plain text
3610 #: build/C/man3/pthread_cleanup_push.3:196
3611 #, no-wrap
3612 msgid ""
3613 "$ B<./a.out x>\n"
3614 "New thread started\n"
3615 "cnt = 0\n"
3616 "cnt = 1\n"
3617 "Thread terminated normally; cnt = 2\n"
3618 msgstr ""
3619 "$ B<./a.out x>\n"
3620 "New thread started\n"
3621 "cnt = 0\n"
3622 "cnt = 1\n"
3623 "Thread terminated normally; cnt = 2\n"
3624
3625 #. type: Plain text
3626 #: build/C/man3/pthread_cleanup_push.3:204
3627 msgid ""
3628 "From the above, we see that the clean-up handler was not executed (because "
3629 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
3630 msgstr ""
3631
3632 #. type: Plain text
3633 #: build/C/man3/pthread_cleanup_push.3:209
3634 msgid ""
3635 "In the next run, the main program sets a global variable that causes the "
3636 "other thread to terminate normally, and supplies a nonzero value for "
3637 "I<cleanup_pop_arg>:"
3638 msgstr ""
3639
3640 #. type: Plain text
3641 #: build/C/man3/pthread_cleanup_push.3:218
3642 #, no-wrap
3643 msgid ""
3644 "$ B<./a.out x 1>\n"
3645 "New thread started\n"
3646 "cnt = 0\n"
3647 "cnt = 1\n"
3648 "Called clean-up handler\n"
3649 "Thread terminated normally; cnt = 0\n"
3650 msgstr ""
3651 "$ B<./a.out x 1>\n"
3652 "New thread started\n"
3653 "cnt = 0\n"
3654 "cnt = 1\n"
3655 "Called clean-up handler\n"
3656 "Thread terminated normally; cnt = 0\n"
3657
3658 #. type: Plain text
3659 #: build/C/man3/pthread_cleanup_push.3:225
3660 msgid ""
3661 "In the above, we see that although the thread was not canceled, the clean-up "
3662 "handler was executed, because the argument given to B<pthread_cleanup_pop>"
3663 "()  was nonzero."
3664 msgstr ""
3665
3666 #. type: Plain text
3667 #: build/C/man3/pthread_cleanup_push.3:234
3668 #, no-wrap
3669 msgid ""
3670 "#include E<lt>pthread.hE<gt>\n"
3671 "#include E<lt>sys/types.hE<gt>\n"
3672 "#include E<lt>stdio.hE<gt>\n"
3673 "#include E<lt>stdlib.hE<gt>\n"
3674 "#include E<lt>unistd.hE<gt>\n"
3675 "#include E<lt>errno.hE<gt>\n"
3676 msgstr ""
3677 "#include E<lt>pthread.hE<gt>\n"
3678 "#include E<lt>sys/types.hE<gt>\n"
3679 "#include E<lt>stdio.hE<gt>\n"
3680 "#include E<lt>stdlib.hE<gt>\n"
3681 "#include E<lt>unistd.hE<gt>\n"
3682 "#include E<lt>errno.hE<gt>\n"
3683
3684 #. type: Plain text
3685 #: build/C/man3/pthread_cleanup_push.3:241
3686 #, no-wrap
3687 msgid ""
3688 "static int done = 0;\n"
3689 "static int cleanup_pop_arg = 0;\n"
3690 "static int cnt = 0;\n"
3691 msgstr ""
3692 "static int done = 0;\n"
3693 "static int cleanup_pop_arg = 0;\n"
3694 "static int cnt = 0;\n"
3695
3696 #. type: Plain text
3697 #: build/C/man3/pthread_cleanup_push.3:248
3698 #, no-wrap
3699 msgid ""
3700 "static void\n"
3701 "cleanup_handler(void *arg)\n"
3702 "{\n"
3703 "    printf(\"Called clean-up handler\\en\");\n"
3704 "    cnt = 0;\n"
3705 "}\n"
3706 msgstr ""
3707 "static void\n"
3708 "cleanup_handler(void *arg)\n"
3709 "{\n"
3710 "    printf(\"Called clean-up handler\\en\");\n"
3711 "    cnt = 0;\n"
3712 "}\n"
3713
3714 #. type: Plain text
3715 #: build/C/man3/pthread_cleanup_push.3:253
3716 #, no-wrap
3717 msgid ""
3718 "static void *\n"
3719 "thread_start(void *arg)\n"
3720 "{\n"
3721 "    time_t start, curr;\n"
3722 msgstr ""
3723 "static void *\n"
3724 "thread_start(void *arg)\n"
3725 "{\n"
3726 "    time_t start, curr;\n"
3727
3728 #. type: Plain text
3729 #: build/C/man3/pthread_cleanup_push.3:255
3730 #, no-wrap
3731 msgid "    printf(\"New thread started\\en\");\n"
3732 msgstr "    printf(\"New thread started\\en\");\n"
3733
3734 #. type: Plain text
3735 #: build/C/man3/pthread_cleanup_push.3:257
3736 #, no-wrap
3737 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
3738 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
3739
3740 #. type: Plain text
3741 #: build/C/man3/pthread_cleanup_push.3:259
3742 #, no-wrap
3743 msgid "    curr = start = time(NULL);\n"
3744 msgstr "    curr = start = time(NULL);\n"
3745
3746 #. type: Plain text
3747 #: build/C/man3/pthread_cleanup_push.3:268
3748 #, no-wrap
3749 msgid ""
3750 "    while (!done) {\n"
3751 "        pthread_testcancel();           /* A cancellation point */\n"
3752 "        if (curr E<lt> time(NULL)) {\n"
3753 "            curr = time(NULL);\n"
3754 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
3755 "            cnt++;\n"
3756 "        }\n"
3757 "    }\n"
3758 msgstr ""
3759 "    while (!done) {\n"
3760 "        pthread_testcancel();           /* A cancellation point */\n"
3761 "        if (curr E<lt> time(NULL)) {\n"
3762 "            curr = time(NULL);\n"
3763 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
3764 "            cnt++;\n"
3765 "        }\n"
3766 "    }\n"
3767
3768 #. type: Plain text
3769 #: build/C/man3/pthread_cleanup_push.3:272
3770 #, no-wrap
3771 msgid ""
3772 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
3773 "    return NULL;\n"
3774 "}\n"
3775 msgstr ""
3776 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
3777 "    return NULL;\n"
3778 "}\n"
3779
3780 #. type: Plain text
3781 #: build/C/man3/pthread_cleanup_push.3:279
3782 #, no-wrap
3783 msgid ""
3784 "int\n"
3785 "main(int argc, char *argv[])\n"
3786 "{\n"
3787 "    pthread_t thr;\n"
3788 "    int s;\n"
3789 "    void *res;\n"
3790 msgstr ""
3791 "int\n"
3792 "main(int argc, char *argv[])\n"
3793 "{\n"
3794 "    pthread_t thr;\n"
3795 "    int s;\n"
3796 "    void *res;\n"
3797
3798 #. type: Plain text
3799 #: build/C/man3/pthread_cleanup_push.3:283
3800 #, no-wrap
3801 msgid ""
3802 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
3803 "    if (s != 0)\n"
3804 "        handle_error_en(s, \"pthread_create\");\n"
3805 msgstr ""
3806 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
3807 "    if (s != 0)\n"
3808 "        handle_error_en(s, \"pthread_create\");\n"
3809
3810 #. type: Plain text
3811 #: build/C/man3/pthread_cleanup_push.3:285
3812 #, no-wrap
3813 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
3814 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
3815
3816 #. type: Plain text
3817 #: build/C/man3/pthread_cleanup_push.3:290
3818 #, no-wrap
3819 msgid ""
3820 "    if (argc E<gt> 1) {\n"
3821 "        if (argc E<gt> 2)\n"
3822 "            cleanup_pop_arg = atoi(argv[2]);\n"
3823 "        done = 1;\n"
3824 msgstr ""
3825 "    if (argc E<gt> 1) {\n"
3826 "        if (argc E<gt> 2)\n"
3827 "            cleanup_pop_arg = atoi(argv[2]);\n"
3828 "        done = 1;\n"
3829
3830 #. type: Plain text
3831 #: build/C/man3/pthread_cleanup_push.3:297
3832 #, no-wrap
3833 msgid ""
3834 "    } else {\n"
3835 "        printf(\"Canceling thread\\en\");\n"
3836 "        s = pthread_cancel(thr);\n"
3837 "        if (s != 0)\n"
3838 "            handle_error_en(s, \"pthread_cancel\");\n"
3839 "    }\n"
3840 msgstr ""
3841 "    } else {\n"
3842 "        printf(\"Canceling thread\\en\");\n"
3843 "        s = pthread_cancel(thr);\n"
3844 "        if (s != 0)\n"
3845 "            handle_error_en(s, \"pthread_cancel\");\n"
3846 "    }\n"
3847
3848 #. type: Plain text
3849 #: build/C/man3/pthread_cleanup_push.3:308
3850 #, no-wrap
3851 msgid ""
3852 "    if (res == PTHREAD_CANCELED)\n"
3853 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
3854 "    else\n"
3855 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
3856 "    exit(EXIT_SUCCESS);\n"
3857 "}\n"
3858 msgstr ""
3859 "    if (res == PTHREAD_CANCELED)\n"
3860 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
3861 "    else\n"
3862 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
3863 "    exit(EXIT_SUCCESS);\n"
3864 "}\n"
3865
3866 #. type: Plain text
3867 #: build/C/man3/pthread_cleanup_push.3:315
3868 msgid ""
3869 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
3870 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3871 msgstr ""
3872 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
3873 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3874
3875 #. type: TH
3876 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
3877 #, no-wrap
3878 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
3879 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
3880
3881 #. type: TH
3882 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
3883 #, no-wrap
3884 msgid "2008-12-04"
3885 msgstr "2008-12-04"
3886
3887 #. type: Plain text
3888 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
3889 msgid ""
3890 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
3891 "thread cancellation clean-up handlers while saving cancelability type"
3892 msgstr ""
3893
3894 #. type: Plain text
3895 #: build/C/man3/pthread_cleanup_push_defer_np.3:35
3896 #, no-wrap
3897 msgid ""
3898 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
3899 "B<                                   void *>I<arg>B<);>\n"
3900 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
3901 msgstr ""
3902 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
3903 "B<                                   void *>I<arg>B<);>\n"
3904 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
3905
3906 #. type: Plain text
3907 #: build/C/man3/pthread_cleanup_push_defer_np.3:38
3908 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
3909 #: build/C/man3/pthread_join.3:35 build/C/man3/pthread_kill.3:35
3910 #: build/C/man3/pthread_sigmask.3:36 build/C/man3/pthread_sigqueue.3:35
3911 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
3912 msgid "Compile and link with I<-pthread>."
3913 msgstr ""
3914
3915 #. type: Plain text
3916 #: build/C/man3/pthread_cleanup_push_defer_np.3:44
3917 msgid ""
3918 "These functions are the same as B<pthread_cleanup_push>(3)  and "
3919 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
3920 msgstr ""
3921
3922 #. type: Plain text
3923 #: build/C/man3/pthread_cleanup_push_defer_np.3:57
3924 msgid ""
3925 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
3926 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
3927 "addition, it also saves the thread's current cancelability type, and sets "
3928 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
3929 "this ensures that cancellation clean-up will occur even if the thread's "
3930 "cancelability type was \"asynchronous\" before the call."
3931 msgstr ""
3932
3933 #. type: Plain text
3934 #: build/C/man3/pthread_cleanup_push_defer_np.3:66
3935 msgid ""
3936 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
3937 "the top-most clean-up handler from the thread's stack of cancellation clean-"
3938 "up handlers.  In addition, it restores the thread's cancelability type to "
3939 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
3940 msgstr ""
3941
3942 #. type: Plain text
3943 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
3944 msgid ""
3945 "The caller must ensure that calls to these functions are paired within the "
3946 "same function, and at the same lexical nesting level.  Other restrictions "
3947 "apply, as described in B<pthread_cleanup_push>(3)."
3948 msgstr ""
3949
3950 #. type: Plain text
3951 #: build/C/man3/pthread_cleanup_push_defer_np.3:74
3952 msgid "This sequence of calls:"
3953 msgstr ""
3954
3955 #. type: Plain text
3956 #: build/C/man3/pthread_cleanup_push_defer_np.3:79
3957 #, no-wrap
3958 msgid ""
3959 "pthread_cleanup_push_defer_np(routine, arg);\n"
3960 "pthread_cleanup_pop_restore_np(execute);\n"
3961 msgstr ""
3962
3963 #. type: Plain text
3964 #: build/C/man3/pthread_cleanup_push_defer_np.3:83
3965 msgid "is equivalent to (but shorter and more efficient than):"
3966 msgstr ""
3967
3968 #. type: Plain text
3969 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
3970 #, no-wrap
3971 msgid "int oldtype;\n"
3972 msgstr "int oldtype;\n"
3973
3974 #. type: Plain text
3975 #: build/C/man3/pthread_cleanup_push_defer_np.3:95
3976 #, no-wrap
3977 msgid ""
3978 "pthread_cleanup_push(routine, arg);\n"
3979 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
3980 "\\&...\n"
3981 "pthread_setcanceltype(oldtype, NULL);\n"
3982 "pthread_cleanup_pop(execute);\n"
3983 msgstr ""
3984 "pthread_cleanup_push(routine, arg);\n"
3985 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
3986 "\\&...\n"
3987 "pthread_setcanceltype(oldtype, NULL);\n"
3988 "pthread_cleanup_pop(execute);\n"
3989
3990 #. type: Plain text
3991 #: build/C/man3/pthread_cleanup_push_defer_np.3:108
3992 msgid ""
3993 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
3994 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3995 msgstr ""
3996 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
3997 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3998
3999 #. type: TH
4000 #: build/C/man3/pthread_create.3:24
4001 #, no-wrap
4002 msgid "PTHREAD_CREATE"
4003 msgstr "PTHREAD_CREATE"
4004
4005 #. type: Plain text
4006 #: build/C/man3/pthread_create.3:27
4007 msgid "pthread_create - create a new thread"
4008 msgstr ""
4009
4010 #. type: Plain text
4011 #: build/C/man3/pthread_create.3:33
4012 #, no-wrap
4013 msgid ""
4014 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4015 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4016 msgstr ""
4017 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4018 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4019
4020 #. type: Plain text
4021 #: build/C/man3/pthread_create.3:45
4022 msgid ""
4023 "The B<pthread_create>()  function starts a new thread in the calling "
4024 "process.  The new thread starts execution by invoking I<start_routine>(); "
4025 "I<arg> is passed as the sole argument of I<start_routine>()."
4026 msgstr ""
4027
4028 #. type: Plain text
4029 #: build/C/man3/pthread_create.3:47
4030 msgid "The new thread terminates in one of the following ways:"
4031 msgstr ""
4032
4033 #. type: IP
4034 #: build/C/man3/pthread_create.3:47 build/C/man3/pthread_create.3:53
4035 #: build/C/man3/pthread_create.3:61 build/C/man3/pthread_create.3:64
4036 #: build/C/man3/pthread_getattr_np.3:50 build/C/man3/pthread_getattr_np.3:53
4037 #: build/C/man3/pthread_getattr_np.3:56
4038 #, no-wrap
4039 msgid "*"
4040 msgstr "*"
4041
4042 #. type: Plain text
4043 #: build/C/man3/pthread_create.3:53
4044 msgid ""
4045 "It calls B<pthread_exit>(3), specifying an exit status value that is "
4046 "available to another thread in the same process that calls B<pthread_join>"
4047 "(3)."
4048 msgstr ""
4049
4050 #. type: Plain text
4051 #: build/C/man3/pthread_create.3:61
4052 msgid ""
4053 "It returns from I<start_routine>().  This is equivalent to calling "
4054 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
4055 msgstr ""
4056
4057 #. type: Plain text
4058 #: build/C/man3/pthread_create.3:64
4059 msgid "It is canceled (see B<pthread_cancel>(3))."
4060 msgstr ""
4061
4062 #. type: Plain text
4063 #: build/C/man3/pthread_create.3:70
4064 msgid ""
4065 "Any of the threads in the process calls B<exit>(3), or the main thread "
4066 "performs a return from I<main>().  This causes the termination of all "
4067 "threads in the process."
4068 msgstr ""
4069
4070 #. type: Plain text
4071 #: build/C/man3/pthread_create.3:84
4072 msgid ""
4073 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4074 "are used at thread creation time to determine attributes for the new thread; "
4075 "this structure is initialized using B<pthread_attr_init>(3)  and related "
4076 "functions.  If I<attr> is NULL, then the thread is created with default "
4077 "attributes."
4078 msgstr ""
4079
4080 #. type: Plain text
4081 #: build/C/man3/pthread_create.3:91
4082 msgid ""
4083 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
4084 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4085 "used to refer to the thread in subsequent calls to other pthreads functions."
4086 msgstr ""
4087
4088 #. type: Plain text
4089 #: build/C/man3/pthread_create.3:99
4090 msgid ""
4091 "The new thread inherits a copy of the creating thread's signal mask "
4092 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
4093 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
4094 "thread's alternate signal stack (B<sigaltstack>(2))."
4095 msgstr ""
4096
4097 #. type: Plain text
4098 #: build/C/man3/pthread_create.3:102
4099 msgid ""
4100 "The new thread inherits the calling thread's floating-point environment "
4101 "(B<fenv>(3))."
4102 msgstr ""
4103
4104 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4105 #. type: Plain text
4106 #: build/C/man3/pthread_create.3:107
4107 msgid ""
4108 "The initial value of the new thread's CPU-time clock is 0 (see "
4109 "B<pthread_getcpuclockid>(3))."
4110 msgstr ""
4111
4112 #. type: SS
4113 #: build/C/man3/pthread_create.3:107
4114 #, no-wrap
4115 msgid "Linux-specific details"
4116 msgstr ""
4117
4118 #. type: Plain text
4119 #: build/C/man3/pthread_create.3:113
4120 msgid ""
4121 "The new thread inherits copies of the calling thread's capability sets (see "
4122 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4123 msgstr ""
4124
4125 #. type: Plain text
4126 #: build/C/man3/pthread_create.3:120
4127 msgid ""
4128 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
4129 "number, and the contents of I<*thread> are undefined."
4130 msgstr ""
4131
4132 #. type: TP
4133 #: build/C/man3/pthread_create.3:121 build/C/man3/pthread_sigqueue.3:69
4134 #, no-wrap
4135 msgid "B<EAGAIN>"
4136 msgstr "B<EAGAIN>"
4137
4138 #. type: Plain text
4139 #: build/C/man3/pthread_create.3:135
4140 msgid ""
4141 "Insufficient resources to create another thread, or a system-imposed limit "
4142 "on the number of threads was encountered.  The latter case may occur in two "
4143 "ways: the B<RLIMIT_NPROC> soft resource limit (set via B<setrlimit>(2)), "
4144 "which limits the number of process for a real user ID, was reached; or the "
4145 "kernel's system-wide limit on the number of threads, I</proc/sys/kernel/"
4146 "threads-max>, was reached."
4147 msgstr ""
4148
4149 #. type: Plain text
4150 #: build/C/man3/pthread_create.3:139
4151 msgid "Invalid settings in I<attr>."
4152 msgstr ""
4153
4154 #. type: TP
4155 #: build/C/man3/pthread_create.3:139 build/C/man3/pthread_setschedparam.3:127
4156 #: build/C/man3/pthread_setschedprio.3:64
4157 #, no-wrap
4158 msgid "B<EPERM>"
4159 msgstr "B<EPERM>"
4160
4161 #. type: Plain text
4162 #: build/C/man3/pthread_create.3:144
4163 msgid ""
4164 "No permission to set the scheduling policy and parameters specified in "
4165 "I<attr>."
4166 msgstr ""
4167
4168 #. type: Plain text
4169 #: build/C/man3/pthread_create.3:158
4170 msgid ""
4171 "See B<pthread_self>(3)  for further information on the thread ID returned in "
4172 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
4173 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4174 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4175 msgstr ""
4176
4177 #. type: Plain text
4178 #: build/C/man3/pthread_create.3:178
4179 msgid ""
4180 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
4181 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
4182 "terminate and fetch its exit status.  Only when a terminated joinable thread "
4183 "has been joined are the last of its resources released back to the system.  "
4184 "When a detached thread terminates, its resources are automatically released "
4185 "back to the system: it is not possible to join with the thread in order to "
4186 "obtain its exit status.  Making a thread detached is useful for some types "
4187 "of daemon threads whose exit status the application does not need to care "
4188 "about.  By default, a new thread is created in a joinable state, unless "
4189 "I<attr> was set to create the thread in a detached state (using "
4190 "B<pthread_attr_setdetachstate>(3))."
4191 msgstr ""
4192
4193 #.  FIXME . Perhaps some of the following detail should be in
4194 #.  a future pthread_attr_setstacksize(3) page.
4195 #. type: Plain text
4196 #: build/C/man3/pthread_create.3:194
4197 msgid ""
4198 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
4199 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
4200 "resource limit I<at the time the program started> has any value other than "
4201 "\"unlimited\", then it determines the default stack size of new threads.  "
4202 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
4203 "explicitly set in the I<attr> argument used to create a thread, in order to "
4204 "obtain a stack size other than the default."
4205 msgstr ""
4206
4207 #. type: Plain text
4208 #: build/C/man3/pthread_create.3:200
4209 msgid ""
4210 "In the obsolete LinuxThreads implementation, each of the threads in a "
4211 "process has a different process ID.  This is in violation of the POSIX "
4212 "threads specification, and is the source of many other nonconformances to "
4213 "the standard; see B<pthreads>(7)."
4214 msgstr ""
4215
4216 #. type: Plain text
4217 #: build/C/man3/pthread_create.3:204
4218 msgid ""
4219 "The program below demonstrates the use of B<pthread_create>(), as well as a "
4220 "number of other functions in the pthreads API."
4221 msgstr ""
4222
4223 #. type: Plain text
4224 #: build/C/man3/pthread_create.3:209
4225 msgid ""
4226 "In the following run, on a system providing the NPTL threading "
4227 "implementation, the stack size defaults to the value given by the \"stack "
4228 "size\" resource limit:"
4229 msgstr ""
4230
4231 #. type: Plain text
4232 #: build/C/man3/pthread_create.3:221
4233 #, no-wrap
4234 msgid ""
4235 "$B< ulimit -s>\n"
4236 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
4237 "$B< ./a.out hola salut servus>\n"
4238 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4239 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4240 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4241 "Joined with thread 1; returned value was HOLA\n"
4242 "Joined with thread 2; returned value was SALUT\n"
4243 "Joined with thread 3; returned value was SERVUS\n"
4244 msgstr ""
4245 "$B< ulimit -s>\n"
4246 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
4247 "$B< ./a.out hola salut servus>\n"
4248 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4249 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4250 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4251 "Joined with thread 1; returned value was HOLA\n"
4252 "Joined with thread 2; returned value was SALUT\n"
4253 "Joined with thread 3; returned value was SERVUS\n"
4254
4255 #. type: Plain text
4256 #: build/C/man3/pthread_create.3:227
4257 msgid ""
4258 "In the next run, the program explicitly sets a stack size of 1MB (using "
4259 "B<pthread_attr_setstacksize>(3))  for the created threads:"
4260 msgstr ""
4261
4262 #. type: Plain text
4263 #: build/C/man3/pthread_create.3:237
4264 #, no-wrap
4265 msgid ""
4266 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4267 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4268 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4269 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4270 "Joined with thread 1; returned value was HOLA\n"
4271 "Joined with thread 2; returned value was SALUT\n"
4272 "Joined with thread 3; returned value was SERVUS\n"
4273 msgstr ""
4274 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4275 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4276 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4277 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4278 "Joined with thread 1; returned value was HOLA\n"
4279 "Joined with thread 2; returned value was SALUT\n"
4280 "Joined with thread 3; returned value was SERVUS\n"
4281
4282 #. type: Plain text
4283 #: build/C/man3/pthread_create.3:249
4284 #, no-wrap
4285 msgid ""
4286 "#include E<lt>pthread.hE<gt>\n"
4287 "#include E<lt>string.hE<gt>\n"
4288 "#include E<lt>stdio.hE<gt>\n"
4289 "#include E<lt>stdlib.hE<gt>\n"
4290 "#include E<lt>unistd.hE<gt>\n"
4291 "#include E<lt>errno.hE<gt>\n"
4292 "#include E<lt>ctype.hE<gt>\n"
4293 msgstr ""
4294 "#include E<lt>pthread.hE<gt>\n"
4295 "#include E<lt>string.hE<gt>\n"
4296 "#include E<lt>stdio.hE<gt>\n"
4297 "#include E<lt>stdlib.hE<gt>\n"
4298 "#include E<lt>unistd.hE<gt>\n"
4299 "#include E<lt>errno.hE<gt>\n"
4300 "#include E<lt>ctype.hE<gt>\n"
4301
4302 #. type: Plain text
4303 #: build/C/man3/pthread_create.3:255 build/C/man3/pthread_getcpuclockid.3:108
4304 #, no-wrap
4305 msgid ""
4306 "#define handle_error(msg) \\e\n"
4307 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4308 msgstr ""
4309 "#define handle_error(msg) \\e\n"
4310 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4311
4312 #. type: Plain text
4313 #: build/C/man3/pthread_create.3:261
4314 #, no-wrap
4315 msgid ""
4316 "struct thread_info {    /* Used as argument to thread_start() */\n"
4317 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4318 "    int       thread_num;       /* Application-defined thread # */\n"
4319 "    char     *argv_string;      /* From command-line argument */\n"
4320 "};\n"
4321 msgstr ""
4322 "struct thread_info {    /* Used as argument to thread_start() */\n"
4323 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4324 "    int       thread_num;       /* Application-defined thread # */\n"
4325 "    char     *argv_string;      /* From command-line argument */\n"
4326 "};\n"
4327
4328 #. type: Plain text
4329 #: build/C/man3/pthread_create.3:264
4330 #, no-wrap
4331 msgid ""
4332 "/* Thread start function: display address near top of our stack,\n"
4333 "   and return upper-cased copy of argv_string */\n"
4334 msgstr ""
4335 "/* Thread start function: display address near top of our stack,\n"
4336 "   and return upper-cased copy of argv_string */\n"
4337
4338 #. type: Plain text
4339 #: build/C/man3/pthread_create.3:270
4340 #, no-wrap
4341 msgid ""
4342 "static void *\n"
4343 "thread_start(void *arg)\n"
4344 "{\n"
4345 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
4346 "    char *uargv, *p;\n"
4347 msgstr ""
4348 "static void *\n"
4349 "thread_start(void *arg)\n"
4350 "{\n"
4351 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
4352 "    char *uargv, *p;\n"
4353
4354 #. type: Plain text
4355 #: build/C/man3/pthread_create.3:273
4356 #, no-wrap
4357 msgid ""
4358 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4359 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4360 msgstr ""
4361 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4362 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4363
4364 #. type: Plain text
4365 #: build/C/man3/pthread_create.3:277
4366 #, no-wrap
4367 msgid ""
4368 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4369 "    if (uargv == NULL)\n"
4370 "        handle_error(\"strdup\");\n"
4371 msgstr ""
4372 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4373 "    if (uargv == NULL)\n"
4374 "        handle_error(\"strdup\");\n"
4375
4376 #. type: Plain text
4377 #: build/C/man3/pthread_create.3:280
4378 #, no-wrap
4379 msgid ""
4380 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4381 "        *p = toupper(*p);\n"
4382 msgstr ""
4383 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4384 "        *p = toupper(*p);\n"
4385
4386 #. type: Plain text
4387 #: build/C/man3/pthread_create.3:283
4388 #, no-wrap
4389 msgid ""
4390 "    return uargv;\n"
4391 "}\n"
4392 msgstr ""
4393 "    return uargv;\n"
4394 "}\n"
4395
4396 #. type: Plain text
4397 #: build/C/man3/pthread_create.3:292
4398 #, no-wrap
4399 msgid ""
4400 "int\n"
4401 "main(int argc, char *argv[])\n"
4402 "{\n"
4403 "    int s, tnum, opt, num_threads;\n"
4404 "    struct thread_info *tinfo;\n"
4405 "    pthread_attr_t attr;\n"
4406 "    int stack_size;\n"
4407 "    void *res;\n"
4408 msgstr ""
4409 "int\n"
4410 "main(int argc, char *argv[])\n"
4411 "{\n"
4412 "    int s, tnum, opt, num_threads;\n"
4413 "    struct thread_info *tinfo;\n"
4414 "    pthread_attr_t attr;\n"
4415 "    int stack_size;\n"
4416 "    void *res;\n"
4417
4418 #. type: Plain text
4419 #: build/C/man3/pthread_create.3:294
4420 #, no-wrap
4421 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
4422 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
4423
4424 #. type: Plain text
4425 #: build/C/man3/pthread_create.3:301
4426 #, no-wrap
4427 msgid ""
4428 "    stack_size = -1;\n"
4429 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4430 "        switch (opt) {\n"
4431 "        case \\(aqs\\(aq:\n"
4432 "            stack_size = strtoul(optarg, NULL, 0);\n"
4433 "            break;\n"
4434 msgstr ""
4435 "    stack_size = -1;\n"
4436 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4437 "        switch (opt) {\n"
4438 "        case \\(aqs\\(aq:\n"
4439 "            stack_size = strtoul(optarg, NULL, 0);\n"
4440 "            break;\n"
4441
4442 #. type: Plain text
4443 #: build/C/man3/pthread_create.3:308
4444 #, no-wrap
4445 msgid ""
4446 "        default:\n"
4447 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4448 "                    argv[0]);\n"
4449 "            exit(EXIT_FAILURE);\n"
4450 "        }\n"
4451 "    }\n"
4452 msgstr ""
4453 "        default:\n"
4454 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4455 "                    argv[0]);\n"
4456 "            exit(EXIT_FAILURE);\n"
4457 "        }\n"
4458 "    }\n"
4459
4460 #. type: Plain text
4461 #: build/C/man3/pthread_create.3:310
4462 #, no-wrap
4463 msgid "    num_threads = argc - optind;\n"
4464 msgstr "    num_threads = argc - optind;\n"
4465
4466 #. type: Plain text
4467 #: build/C/man3/pthread_create.3:312
4468 #, no-wrap
4469 msgid "    /* Initialize thread creation attributes */\n"
4470 msgstr "    /* Initialize thread creation attributes */\n"
4471
4472 #. type: Plain text
4473 #: build/C/man3/pthread_create.3:316
4474 #, no-wrap
4475 msgid ""
4476 "    s = pthread_attr_init(&attr);\n"
4477 "    if (s != 0)\n"
4478 "        handle_error_en(s, \"pthread_attr_init\");\n"
4479 msgstr ""
4480 "    s = pthread_attr_init(&attr);\n"
4481 "    if (s != 0)\n"
4482 "        handle_error_en(s, \"pthread_attr_init\");\n"
4483
4484 #. type: Plain text
4485 #: build/C/man3/pthread_create.3:322
4486 #, no-wrap
4487 msgid ""
4488 "    if (stack_size E<gt> 0) {\n"
4489 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4490 "        if (s != 0)\n"
4491 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4492 "    }\n"
4493 msgstr ""
4494 "    if (stack_size E<gt> 0) {\n"
4495 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4496 "        if (s != 0)\n"
4497 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4498 "    }\n"
4499
4500 #. type: Plain text
4501 #: build/C/man3/pthread_create.3:324
4502 #, no-wrap
4503 msgid "    /* Allocate memory for pthread_create() arguments */\n"
4504 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
4505
4506 #. type: Plain text
4507 #: build/C/man3/pthread_create.3:328
4508 #, no-wrap
4509 msgid ""
4510 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4511 "    if (tinfo == NULL)\n"
4512 "        handle_error(\"calloc\");\n"
4513 msgstr ""
4514 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4515 "    if (tinfo == NULL)\n"
4516 "        handle_error(\"calloc\");\n"
4517
4518 #. type: Plain text
4519 #: build/C/man3/pthread_create.3:330
4520 #, no-wrap
4521 msgid "    /* Create one thread for each command-line argument */\n"
4522 msgstr "    /* Create one thread for each command-line argument */\n"
4523
4524 #. type: Plain text
4525 #: build/C/man3/pthread_create.3:334
4526 #, no-wrap
4527 msgid ""
4528 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4529 "        tinfo[tnum].thread_num = tnum + 1;\n"
4530 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4531 msgstr ""
4532 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4533 "        tinfo[tnum].thread_num = tnum + 1;\n"
4534 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4535
4536 #. type: Plain text
4537 #: build/C/man3/pthread_create.3:337
4538 #, no-wrap
4539 msgid ""
4540 "        /* The pthread_create() call stores the thread ID into\n"
4541 "           corresponding element of tinfo[] */\n"
4542 msgstr ""
4543 "        /* The pthread_create() call stores the thread ID into\n"
4544 "           corresponding element of tinfo[] */\n"
4545
4546 #. type: Plain text
4547 #: build/C/man3/pthread_create.3:343
4548 #, no-wrap
4549 msgid ""
4550 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4551 "                           &thread_start, &tinfo[tnum]);\n"
4552 "        if (s != 0)\n"
4553 "            handle_error_en(s, \"pthread_create\");\n"
4554 "    }\n"
4555 msgstr ""
4556 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4557 "                           &thread_start, &tinfo[tnum]);\n"
4558 "        if (s != 0)\n"
4559 "            handle_error_en(s, \"pthread_create\");\n"
4560 "    }\n"
4561
4562 #. type: Plain text
4563 #: build/C/man3/pthread_create.3:346
4564 #, no-wrap
4565 msgid ""
4566 "    /* Destroy the thread attributes object, since it is no\n"
4567 "       longer needed */\n"
4568 msgstr ""
4569 "    /* Destroy the thread attributes object, since it is no\n"
4570 "       longer needed */\n"
4571
4572 #. type: Plain text
4573 #: build/C/man3/pthread_create.3:350 build/C/man3/pthread_setschedparam.3:421
4574 #, no-wrap
4575 msgid ""
4576 "    s = pthread_attr_destroy(&attr);\n"
4577 "    if (s != 0)\n"
4578 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4579 msgstr ""
4580 "    s = pthread_attr_destroy(&attr);\n"
4581 "    if (s != 0)\n"
4582 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4583
4584 #. type: Plain text
4585 #: build/C/man3/pthread_create.3:352
4586 #, no-wrap
4587 msgid "    /* Now join with each thread, and display its returned value */\n"
4588 msgstr "    /* Now join with each thread, and display its returned value */\n"
4589
4590 #. type: Plain text
4591 #: build/C/man3/pthread_create.3:357
4592 #, no-wrap
4593 msgid ""
4594 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4595 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4596 "        if (s != 0)\n"
4597 "            handle_error_en(s, \"pthread_join\");\n"
4598 msgstr ""
4599 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4600 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4601 "        if (s != 0)\n"
4602 "            handle_error_en(s, \"pthread_join\");\n"
4603
4604 #. type: Plain text
4605 #: build/C/man3/pthread_create.3:362
4606 #, no-wrap
4607 msgid ""
4608 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4609 "                tinfo[tnum].thread_num, (char *) res);\n"
4610 "        free(res);      /* Free memory allocated by thread */\n"
4611 "    }\n"
4612 msgstr ""
4613 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4614 "                tinfo[tnum].thread_num, (char *) res);\n"
4615 "        free(res);      /* Free memory allocated by thread */\n"
4616 "    }\n"
4617
4618 #. type: Plain text
4619 #: build/C/man3/pthread_create.3:366
4620 #, no-wrap
4621 msgid ""
4622 "    free(tinfo);\n"
4623 "    exit(EXIT_SUCCESS);\n"
4624 "}\n"
4625 msgstr ""
4626 "    free(tinfo);\n"
4627 "    exit(EXIT_SUCCESS);\n"
4628 "}\n"
4629
4630 #. type: Plain text
4631 #: build/C/man3/pthread_create.3:378
4632 msgid ""
4633 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
4634 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
4635 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
4636 "(7)"
4637 msgstr ""
4638 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
4639 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
4640 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
4641 "(7)"
4642
4643 #. type: TH
4644 #: build/C/man3/pthread_detach.3:24
4645 #, no-wrap
4646 msgid "PTHREAD_DETACH"
4647 msgstr "PTHREAD_DETACH"
4648
4649 #. type: TH
4650 #: build/C/man3/pthread_detach.3:24 build/C/man3/pthread_join.3:24
4651 #, no-wrap
4652 msgid "2008-11-27"
4653 msgstr "2008-11-27"
4654
4655 #. type: Plain text
4656 #: build/C/man3/pthread_detach.3:27
4657 msgid "pthread_detach - detach a thread"
4658 msgstr ""
4659
4660 #. type: Plain text
4661 #: build/C/man3/pthread_detach.3:32
4662 #, no-wrap
4663 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
4664 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
4665
4666 #. type: Plain text
4667 #: build/C/man3/pthread_detach.3:44
4668 msgid ""
4669 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
4670 "as detached.  When a detached thread terminates, its resources are "
4671 "automatically released back to the system without the need for another "
4672 "thread to join with the terminated thread."
4673 msgstr ""
4674
4675 #. type: Plain text
4676 #: build/C/man3/pthread_detach.3:47
4677 msgid ""
4678 "Attempting to detach an already detached thread results in unspecified "
4679 "behavior."
4680 msgstr ""
4681
4682 #. type: Plain text
4683 #: build/C/man3/pthread_detach.3:52
4684 msgid ""
4685 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
4686 "number."
4687 msgstr ""
4688
4689 #. type: Plain text
4690 #: build/C/man3/pthread_detach.3:57 build/C/man3/pthread_join.3:87
4691 msgid "I<thread> is not a joinable thread."
4692 msgstr ""
4693
4694 #. type: Plain text
4695 #: build/C/man3/pthread_detach.3:68
4696 msgid ""
4697 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
4698 "or be made joinable again."
4699 msgstr ""
4700
4701 #. type: Plain text
4702 #: build/C/man3/pthread_detach.3:75
4703 msgid ""
4704 "A new thread can be created in a detached state using "
4705 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
4706 "I<attr> argument of B<pthread_create>(3)."
4707 msgstr ""
4708
4709 #. type: Plain text
4710 #: build/C/man3/pthread_detach.3:82
4711 msgid ""
4712 "The detached attribute merely determines the behavior of the system when the "
4713 "thread terminates; it does not prevent the thread from being terminated if "
4714 "the process terminates using B<exit>(3)  (or equivalently, if the main "
4715 "thread returns)."
4716 msgstr ""
4717
4718 #. type: Plain text
4719 #: build/C/man3/pthread_detach.3:91
4720 msgid ""
4721 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
4722 "thread that an application creates, so that system resources for the thread "
4723 "can be released.  (But note that the resources of all threads are freed when "
4724 "the process terminates.)"
4725 msgstr ""
4726
4727 #. type: Plain text
4728 #: build/C/man3/pthread_detach.3:93
4729 msgid "The following statement detaches the calling thread:"
4730 msgstr ""
4731
4732 #. type: Plain text
4733 #: build/C/man3/pthread_detach.3:95
4734 #, no-wrap
4735 msgid "    pthread_detach(pthread_self());\n"
4736 msgstr "    pthread_detach(pthread_self());\n"
4737
4738 #. type: Plain text
4739 #: build/C/man3/pthread_detach.3:102
4740 msgid ""
4741 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
4742 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
4743 msgstr ""
4744 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
4745 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
4746
4747 #. type: TH
4748 #: build/C/man3/pthread_equal.3:24
4749 #, no-wrap
4750 msgid "PTHREAD_EQUAL"
4751 msgstr "PTHREAD_EQUAL"
4752
4753 #. type: TH
4754 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
4755 #, no-wrap
4756 msgid "2009-03-30"
4757 msgstr "2009-03-30"
4758
4759 #. type: Plain text
4760 #: build/C/man3/pthread_equal.3:27
4761 msgid "pthread_equal - compare thread IDs"
4762 msgstr ""
4763
4764 #. type: Plain text
4765 #: build/C/man3/pthread_equal.3:32
4766 #, no-wrap
4767 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
4768 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
4769
4770 #. type: Plain text
4771 #: build/C/man3/pthread_equal.3:39
4772 msgid "The B<pthread_equal>()  function compares two thread identifiers."
4773 msgstr ""
4774
4775 #. type: Plain text
4776 #: build/C/man3/pthread_equal.3:43
4777 msgid ""
4778 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
4779 "value; otherwise, it returns 0."
4780 msgstr ""
4781
4782 #.  SH VERSIONS
4783 #.  Available since glibc 2.0
4784 #. type: Plain text
4785 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
4786 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_testcancel.3:56
4787 msgid "This function always succeeds."
4788 msgstr ""
4789
4790 #. type: Plain text
4791 #: build/C/man3/pthread_equal.3:54
4792 msgid ""
4793 "The B<pthread_equal>()  function is necessary because thread IDs should be "
4794 "considered opaque: there is no portable way for applications to directly "
4795 "compare two I<pthread_t> values."
4796 msgstr ""
4797
4798 #. type: Plain text
4799 #: build/C/man3/pthread_equal.3:58
4800 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
4801 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
4802
4803 #. type: TH
4804 #: build/C/man3/pthread_exit.3:24
4805 #, no-wrap
4806 msgid "PTHREAD_EXIT"
4807 msgstr "PTHREAD_EXIT"
4808
4809 #. type: Plain text
4810 #: build/C/man3/pthread_exit.3:27
4811 msgid "pthread_exit - terminate calling thread"
4812 msgstr ""
4813
4814 #. type: Plain text
4815 #: build/C/man3/pthread_exit.3:32
4816 #, no-wrap
4817 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
4818 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
4819
4820 #. type: Plain text
4821 #: build/C/man3/pthread_exit.3:43
4822 msgid ""
4823 "The B<pthread_exit>()  function terminates the calling thread and returns a "
4824 "value via I<retval> that (if the thread is joinable)  is available to "
4825 "another thread in the same process that calls B<pthread_join>(3)."
4826 msgstr ""
4827
4828 #. type: Plain text
4829 #: build/C/man3/pthread_exit.3:53
4830 msgid ""
4831 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
4832 "not yet been popped, are popped (in the reverse of the order in which they "
4833 "were pushed)  and executed.  If the thread has any thread-specific data, "
4834 "then, after the clean-up handlers have been executed, the corresponding "
4835 "destructor functions are called, in an unspecified order."
4836 msgstr ""
4837
4838 #. type: Plain text
4839 #: build/C/man3/pthread_exit.3:60
4840 msgid ""
4841 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
4842 "variables, semaphores, and file descriptors) are not released, and functions "
4843 "registered using B<atexit>(3)  are not called."
4844 msgstr ""
4845
4846 #. type: Plain text
4847 #: build/C/man3/pthread_exit.3:69
4848 msgid ""
4849 "After the last thread in a process terminates, the process terminates as by "
4850 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
4851 "resources are released and functions registered using B<atexit>(3)  are "
4852 "called."
4853 msgstr ""
4854
4855 #. type: Plain text
4856 #: build/C/man3/pthread_exit.3:71
4857 msgid "This function does not return to the caller."
4858 msgstr ""
4859
4860 #. type: Plain text
4861 #: build/C/man3/pthread_exit.3:80
4862 msgid ""
4863 "Performing a return from the start function of any thread other than the "
4864 "main thread results in an implicit call to B<pthread_exit>(), using the "
4865 "function's return value as the thread's exit status."
4866 msgstr ""
4867
4868 #. type: Plain text
4869 #: build/C/man3/pthread_exit.3:86
4870 msgid ""
4871 "To allow other threads to continue execution, the main thread should "
4872 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
4873 msgstr ""
4874
4875 #. type: Plain text
4876 #: build/C/man3/pthread_exit.3:91
4877 msgid ""
4878 "The value pointed to by I<retval> should not be located on the calling "
4879 "thread's stack, since the contents of that stack are undefined after the "
4880 "thread terminates."
4881 msgstr ""
4882
4883 #.  Linux 2.6.27
4884 #.  FIXME . review a later kernel to see if this gets fixed
4885 #.  http://thread.gmane.org/gmane.linux.kernel/611611
4886 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
4887 #. type: Plain text
4888 #: build/C/man3/pthread_exit.3:103
4889 msgid ""
4890 "Currently, there are limitations in the kernel implementation logic for "
4891 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
4892 "This can manifest in problems such as a locked terminal if a stop signal is "
4893 "sent to a foreground process whose thread group leader has already called "
4894 "B<pthread_exit>()."
4895 msgstr ""
4896
4897 #. type: Plain text
4898 #: build/C/man3/pthread_exit.3:107
4899 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
4900 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
4901
4902 #. type: TH
4903 #: build/C/man3/pthread_getattr_np.3:24
4904 #, no-wrap
4905 msgid "PTHREAD_GETATTR_NP"
4906 msgstr "PTHREAD_GETATTR_NP"
4907
4908 #. type: Plain text
4909 #: build/C/man3/pthread_getattr_np.3:27
4910 msgid "pthread_getattr_np - get attributes of created thread"
4911 msgstr ""
4912
4913 #. type: Plain text
4914 #: build/C/man3/pthread_getattr_np.3:33
4915 #, no-wrap
4916 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
4917 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
4918
4919 #. type: Plain text
4920 #: build/C/man3/pthread_getattr_np.3:43
4921 msgid ""
4922 "The B<pthread_getattr_np>()  function initializes the thread attributes "
4923 "object referred to by I<attr> so that it contains actual attribute values "
4924 "describing the running thread I<thread>."
4925 msgstr ""
4926
4927 #. type: Plain text
4928 #: build/C/man3/pthread_getattr_np.3:50
4929 msgid ""
4930 "The returned attribute values may differ from the corresponding attribute "
4931 "values passed in the I<attr> object that was used to create the thread using "
4932 "B<pthread_create>(3).  In particular, the following attributes may differ:"
4933 msgstr ""
4934
4935 #. type: Plain text
4936 #: build/C/man3/pthread_getattr_np.3:53
4937 msgid ""
4938 "the detach state, since a joinable thread may have detached itself after "
4939 "creation;"
4940 msgstr ""
4941
4942 #. type: Plain text
4943 #: build/C/man3/pthread_getattr_np.3:56
4944 msgid ""
4945 "the stack size, which the implementation may align to a suitable boundary."
4946 msgstr ""
4947
4948 #. type: Plain text
4949 #: build/C/man3/pthread_getattr_np.3:61
4950 msgid ""
4951 "and the guard size, which the implementation may round upward to a multiple "
4952 "of the page size, or ignore (i.e., treat as 0), if the application is "
4953 "allocating its own stack."
4954 msgstr ""
4955
4956 #. type: Plain text
4957 #: build/C/man3/pthread_getattr_np.3:66
4958 msgid ""
4959 "Furthermore, if the stack address attribute was not set in the thread "
4960 "attributes object used to create the thread, then the returned thread "
4961 "attributes object will report the actual stack address that the "
4962 "implementation selected for the thread."
4963 msgstr ""
4964
4965 #. type: Plain text
4966 #: build/C/man3/pthread_getattr_np.3:71
4967 msgid ""
4968 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
4969 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
4970 msgstr ""
4971
4972 #. type: Plain text
4973 #: build/C/man3/pthread_getattr_np.3:74
4974 #: build/C/man3/pthread_getcpuclockid.3:47
4975 msgid ""
4976 "On success, this function returns 0; on error, it returns a nonzero error "
4977 "number."
4978 msgstr ""
4979
4980 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
4981 #. type: Plain text
4982 #: build/C/man3/pthread_getattr_np.3:79
4983 msgid "Insufficient memory."
4984 msgstr ""
4985
4986 #. type: Plain text
4987 #: build/C/man3/pthread_getattr_np.3:94
4988 msgid ""
4989 "In addition, if I<thread> refers to the main thread, then "
4990 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
4991 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and B<getrlimit>"
4992 "(2), if the B<RLIMIT_STACK> resource limit is not supported."
4993 msgstr ""
4994
4995 #. type: Plain text
4996 #: build/C/man3/pthread_getattr_np.3:96
4997 msgid "This function is available in glibc since version 2.2.3."
4998 msgstr ""
4999
5000 #. type: Plain text
5001 #: build/C/man3/pthread_getattr_np.3:99
5002 #: build/C/man3/pthread_kill_other_threads_np.3:48
5003 msgid ""
5004 "This function is a nonstandard GNU extension; hence the suffix \"_np"
5005 "\" (nonportable) in the name."
5006 msgstr ""
5007
5008 #. type: Plain text
5009 #: build/C/man3/pthread_getattr_np.3:109
5010 msgid ""
5011 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
5012 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
5013 "and display its guard size, stack address, and stack size attributes.  "
5014 "Command-line arguments can be used to set these attributes to values other "
5015 "than the default when creating the thread.  The shell sessions below "
5016 "demonstrate the use of the program."
5017 msgstr ""
5018
5019 #. type: Plain text
5020 #: build/C/man3/pthread_getattr_np.3:112
5021 msgid ""
5022 "In the first run, on an x86-32 system, a thread is created using default "
5023 "attributes:"
5024 msgstr ""
5025
5026 #. type: Plain text
5027 #: build/C/man3/pthread_getattr_np.3:122
5028 #, no-wrap
5029 msgid ""
5030 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5031 "unlimited\n"
5032 "$B< ./a.out>\n"
5033 "Attributes of created thread:\n"
5034 "        Guard size          = 4096 bytes\n"
5035 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5036 "        Stack size          = 0x201000 (2101248) bytes\n"
5037 msgstr ""
5038 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5039 "unlimited\n"
5040 "$B< ./a.out>\n"
5041 "Attributes of created thread:\n"
5042 "        Guard size          = 4096 bytes\n"
5043 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5044 "        Stack size          = 0x201000 (2101248) bytes\n"
5045
5046 #. type: Plain text
5047 #: build/C/man3/pthread_getattr_np.3:128
5048 msgid ""
5049 "In the following run, we see that if a guard size is specified, it is "
5050 "rounded up to the next multiple of the system page size (4096 bytes on "
5051 "x86-32):"
5052 msgstr ""
5053
5054 #. type: Plain text
5055 #: build/C/man3/pthread_getattr_np.3:136
5056 #, no-wrap
5057 msgid ""
5058 "$B< ./a.out -g 4097>\n"
5059 "Thread attributes object after initializations:\n"
5060 "        Guard size          = 4097 bytes\n"
5061 "        Stack address       = (nil)\n"
5062 "        Stack size          = 0x0 (0) bytes\n"
5063 msgstr ""
5064 "$B< ./a.out -g 4097>\n"
5065 "Thread attributes object after initializations:\n"
5066 "        Guard size          = 4097 bytes\n"
5067 "        Stack address       = (nil)\n"
5068 "        Stack size          = 0x0 (0) bytes\n"
5069
5070 #. type: Plain text
5071 #: build/C/man3/pthread_getattr_np.3:141
5072 #, no-wrap
5073 msgid ""
5074 "Attributes of created thread:\n"
5075 "        Guard size          = 8192 bytes\n"
5076 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5077 "        Stack size          = 0x201000 (2101248) bytes\n"
5078 msgstr ""
5079 "Attributes of created thread:\n"
5080 "        Guard size          = 8192 bytes\n"
5081 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5082 "        Stack size          = 0x201000 (2101248) bytes\n"
5083
5084 #. .in +4n
5085 #. .nf
5086 #. $ ./a.out \-s 0x8000
5087 #. Thread attributes object after initializations:
5088 #.         Guard size          = 4096 bytes
5089 #.         Stack address       = 0xffff8000 (EOS = (nil))
5090 #.         Stack size          = 0x8000 (32768) bytes
5091 #. Attributes of created thread:
5092 #.         Guard size          = 4096 bytes
5093 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
5094 #.         Stack size          = 0x8000 (32768) bytes
5095 #. .fi
5096 #. .in
5097 #. type: Plain text
5098 #: build/C/man3/pthread_getattr_np.3:160
5099 msgid ""
5100 "In the last run, the program manually allocates a stack for the thread.  In "
5101 "this case, the guard size attribute is ignored."
5102 msgstr ""
5103
5104 #. type: Plain text
5105 #: build/C/man3/pthread_getattr_np.3:165
5106 #, no-wrap
5107 msgid ""
5108 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5109 "Allocated thread stack at 0x804d000\n"
5110 msgstr ""
5111 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5112 "Allocated thread stack at 0x804d000\n"
5113
5114 #. type: Plain text
5115 #: build/C/man3/pthread_getattr_np.3:170
5116 #, no-wrap
5117 msgid ""
5118 "Thread attributes object after initializations:\n"
5119 "        Guard size          = 4096 bytes\n"
5120 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5121 "        Stack size          = 0x8000 (32768) bytes\n"
5122 msgstr ""
5123 "Thread attributes object after initializations:\n"
5124 "        Guard size          = 4096 bytes\n"
5125 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5126 "        Stack size          = 0x8000 (32768) bytes\n"
5127
5128 #. type: Plain text
5129 #: build/C/man3/pthread_getattr_np.3:175
5130 #, no-wrap
5131 msgid ""
5132 "Attributes of created thread:\n"
5133 "        Guard size          = 0 bytes\n"
5134 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5135 "        Stack size          = 0x8000 (32768) bytes\n"
5136 msgstr ""
5137 "Attributes of created thread:\n"
5138 "        Guard size          = 0 bytes\n"
5139 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5140 "        Stack size          = 0x8000 (32768) bytes\n"
5141
5142 #. type: Plain text
5143 #: build/C/man3/pthread_getattr_np.3:196
5144 #, no-wrap
5145 msgid ""
5146 "static void\n"
5147 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5148 "{\n"
5149 "    int s;\n"
5150 "    size_t stack_size, guard_size;\n"
5151 "    void *stack_addr;\n"
5152 msgstr ""
5153 "static void\n"
5154 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5155 "{\n"
5156 "    int s;\n"
5157 "    size_t stack_size, guard_size;\n"
5158 "    void *stack_addr;\n"
5159
5160 #. type: Plain text
5161 #: build/C/man3/pthread_getattr_np.3:201
5162 #, no-wrap
5163 msgid ""
5164 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5165 "    if (s != 0)\n"
5166 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5167 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5168 msgstr ""
5169 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5170 "    if (s != 0)\n"
5171 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5172 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5173
5174 #. type: Plain text
5175 #: build/C/man3/pthread_getattr_np.3:212
5176 #, no-wrap
5177 msgid ""
5178 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5179 "    if (s != 0)\n"
5180 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5181 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5182 "    if (stack_size E<gt> 0)\n"
5183 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5184 "    printf(\"\\en\");\n"
5185 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5186 "            prefix, stack_size, stack_size);\n"
5187 "}\n"
5188 msgstr ""
5189 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5190 "    if (s != 0)\n"
5191 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5192 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5193 "    if (stack_size E<gt> 0)\n"
5194 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5195 "    printf(\"\\en\");\n"
5196 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5197 "            prefix, stack_size, stack_size);\n"
5198 "}\n"
5199
5200 #. type: Plain text
5201 #: build/C/man3/pthread_getattr_np.3:218
5202 #, no-wrap
5203 msgid ""
5204 "static void\n"
5205 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5206 "{\n"
5207 "    int s;\n"
5208 "    pthread_attr_t attr;\n"
5209 msgstr ""
5210 "static void\n"
5211 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5212 "{\n"
5213 "    int s;\n"
5214 "    pthread_attr_t attr;\n"
5215
5216 #. type: Plain text
5217 #: build/C/man3/pthread_getattr_np.3:222
5218 #, no-wrap
5219 msgid ""
5220 "    s = pthread_getattr_np(thread, &attr);\n"
5221 "    if (s != 0)\n"
5222 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5223 msgstr ""
5224 "    s = pthread_getattr_np(thread, &attr);\n"
5225 "    if (s != 0)\n"
5226 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5227
5228 #. type: Plain text
5229 #: build/C/man3/pthread_getattr_np.3:224
5230 #, no-wrap
5231 msgid "    display_stack_related_attributes(&attr, prefix);\n"
5232 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
5233
5234 #. type: Plain text
5235 #: build/C/man3/pthread_getattr_np.3:229
5236 #, no-wrap
5237 msgid ""
5238 "    s = pthread_attr_destroy(&attr);\n"
5239 "    if (s != 0)\n"
5240 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5241 "}\n"
5242 msgstr ""
5243 "    s = pthread_attr_destroy(&attr);\n"
5244 "    if (s != 0)\n"
5245 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5246 "}\n"
5247
5248 #. type: Plain text
5249 #: build/C/man3/pthread_getattr_np.3:235
5250 #, no-wrap
5251 msgid ""
5252 "static void *           /* Start function for thread we create */\n"
5253 "thread_start(void *arg)\n"
5254 "{\n"
5255 "    printf(\"Attributes of created thread:\\en\");\n"
5256 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5257 msgstr ""
5258 "static void *           /* Start function for thread we create */\n"
5259 "thread_start(void *arg)\n"
5260 "{\n"
5261 "    printf(\"Attributes of created thread:\\en\");\n"
5262 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5263
5264 #. type: Plain text
5265 #: build/C/man3/pthread_getattr_np.3:249
5266 #, no-wrap
5267 msgid ""
5268 "static void\n"
5269 "usage(char *pname, char *msg)\n"
5270 "{\n"
5271 "    if (msg != NULL)\n"
5272 "        fputs(msg, stderr);\n"
5273 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5274 "            \" [-g guard-size]\\en\", pname);\n"
5275 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5276 "    exit(EXIT_FAILURE);\n"
5277 "}\n"
5278 msgstr ""
5279 "static void\n"
5280 "usage(char *pname, char *msg)\n"
5281 "{\n"
5282 "    if (msg != NULL)\n"
5283 "        fputs(msg, stderr);\n"
5284 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5285 "            \" [-g guard-size]\\en\", pname);\n"
5286 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5287 "    exit(EXIT_FAILURE);\n"
5288 "}\n"
5289
5290 #. type: Plain text
5291 #: build/C/man3/pthread_getattr_np.3:262
5292 #, no-wrap
5293 msgid ""
5294 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5295 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5296 "                              pthread_attr_t *attrp)\n"
5297 "{\n"
5298 "    int s, opt, allocate_stack;\n"
5299 "    long stack_size, guard_size;\n"
5300 "            void *stack_addr;\n"
5301 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
5302 "                                           a thread attributes object */\n"
5303 "    allocate_stack = 0;\n"
5304 "    stack_size = -1;\n"
5305 "    guard_size = -1;\n"
5306 msgstr ""
5307 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5308 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5309 "                              pthread_attr_t *attrp)\n"
5310 "{\n"
5311 "    int s, opt, allocate_stack;\n"
5312 "    long stack_size, guard_size;\n"
5313 "            void *stack_addr;\n"
5314 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
5315 "                                           a thread attributes object */\n"
5316 "    allocate_stack = 0;\n"
5317 "    stack_size = -1;\n"
5318 "    guard_size = -1;\n"
5319
5320 #. type: Plain text
5321 #: build/C/man3/pthread_getattr_np.3:271
5322 #, no-wrap
5323 msgid ""
5324 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5325 "        switch (opt) {\n"
5326 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
5327 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
5328 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
5329 "        default:    usage(argv[0], NULL);\n"
5330 "        }\n"
5331 "    }\n"
5332 msgstr ""
5333 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5334 "        switch (opt) {\n"
5335 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
5336 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
5337 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
5338 "        default:    usage(argv[0], NULL);\n"
5339 "        }\n"
5340 "    }\n"
5341
5342 #. type: Plain text
5343 #: build/C/man3/pthread_getattr_np.3:274
5344 #, no-wrap
5345 msgid ""
5346 "    if (allocate_stack && stack_size == -1)\n"
5347 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5348 msgstr ""
5349 "    if (allocate_stack && stack_size == -1)\n"
5350 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5351
5352 #. type: Plain text
5353 #: build/C/man3/pthread_getattr_np.3:277
5354 #, no-wrap
5355 msgid ""
5356 "    if (argc E<gt> optind)\n"
5357 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5358 msgstr ""
5359 "    if (argc E<gt> optind)\n"
5360 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5361
5362 #. type: Plain text
5363 #: build/C/man3/pthread_getattr_np.3:280
5364 #, no-wrap
5365 msgid ""
5366 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5367 "        ret_attrp = attrp;\n"
5368 msgstr ""
5369 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5370 "        ret_attrp = attrp;\n"
5371
5372 #. type: Plain text
5373 #: build/C/man3/pthread_getattr_np.3:285
5374 #, no-wrap
5375 msgid ""
5376 "        s = pthread_attr_init(attrp);\n"
5377 "        if (s != 0)\n"
5378 "            handle_error_en(s, \"pthread_attr_init\");\n"
5379 "    }\n"
5380 msgstr ""
5381 "        s = pthread_attr_init(attrp);\n"
5382 "        if (s != 0)\n"
5383 "            handle_error_en(s, \"pthread_attr_init\");\n"
5384 "    }\n"
5385
5386 #. type: Plain text
5387 #: build/C/man3/pthread_getattr_np.3:297
5388 #, no-wrap
5389 msgid ""
5390 "    if (stack_size E<gt>= 0) {\n"
5391 "        if (!allocate_stack) {\n"
5392 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
5393 "            if (s != 0)\n"
5394 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5395 "        } else {\n"
5396 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5397 "                               stack_size);\n"
5398 "            if (s != 0)\n"
5399 "                handle_error_en(s, \"posix_memalign\");\n"
5400 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5401 msgstr ""
5402 "    if (stack_size E<gt>= 0) {\n"
5403 "        if (!allocate_stack) {\n"
5404 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
5405 "            if (s != 0)\n"
5406 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5407 "        } else {\n"
5408 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5409 "                               stack_size);\n"
5410 "            if (s != 0)\n"
5411 "                handle_error_en(s, \"posix_memalign\");\n"
5412 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5413
5414 #. type: Plain text
5415 #: build/C/man3/pthread_getattr_np.3:303
5416 #, no-wrap
5417 msgid ""
5418 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5419 "            if (s != 0)\n"
5420 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5421 "        }\n"
5422 "    }\n"
5423 msgstr ""
5424 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5425 "            if (s != 0)\n"
5426 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5427 "        }\n"
5428 "    }\n"
5429
5430 #. type: Plain text
5431 #: build/C/man3/pthread_getattr_np.3:309
5432 #, no-wrap
5433 msgid ""
5434 "    if (guard_size E<gt>= 0) {\n"
5435 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
5436 "        if (s != 0)\n"
5437 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5438 "    }\n"
5439 msgstr ""
5440 "    if (guard_size E<gt>= 0) {\n"
5441 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
5442 "        if (s != 0)\n"
5443 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5444 "    }\n"
5445
5446 #. type: Plain text
5447 #: build/C/man3/pthread_getattr_np.3:312
5448 #, no-wrap
5449 msgid ""
5450 "    return ret_attrp;\n"
5451 "}\n"
5452 msgstr ""
5453 "    return ret_attrp;\n"
5454 "}\n"
5455
5456 #. type: Plain text
5457 #: build/C/man3/pthread_getattr_np.3:321
5458 #, no-wrap
5459 msgid ""
5460 "int\n"
5461 "main(int argc, char *argv[])\n"
5462 "{\n"
5463 "    int s;\n"
5464 "    pthread_t thr;\n"
5465 "    pthread_attr_t attr;\n"
5466 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
5467 "                                        a thread attributes object */\n"
5468 msgstr ""
5469 "int\n"
5470 "main(int argc, char *argv[])\n"
5471 "{\n"
5472 "    int s;\n"
5473 "    pthread_t thr;\n"
5474 "    pthread_attr_t attr;\n"
5475 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
5476 "                                        a thread attributes object */\n"
5477
5478 #. type: Plain text
5479 #: build/C/man3/pthread_getattr_np.3:323
5480 #, no-wrap
5481 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5482 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5483
5484 #. type: Plain text
5485 #: build/C/man3/pthread_getattr_np.3:329
5486 #, no-wrap
5487 msgid ""
5488 "    if (attrp != NULL) {\n"
5489 "        printf(\"Thread attributes object after initializations:\\en\");\n"
5490 "        display_stack_related_attributes(attrp, \"\\et\");\n"
5491 "        printf(\"\\en\");\n"
5492 "    }\n"
5493 msgstr ""
5494 "    if (attrp != NULL) {\n"
5495 "        printf(\"Thread attributes object after initializations:\\en\");\n"
5496 "        display_stack_related_attributes(attrp, \"\\et\");\n"
5497 "        printf(\"\\en\");\n"
5498 "    }\n"
5499
5500 #. type: Plain text
5501 #: build/C/man3/pthread_getattr_np.3:357
5502 msgid ""
5503 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
5504 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
5505 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
5506 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
5507 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
5508 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5509 msgstr ""
5510 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
5511 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
5512 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
5513 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
5514 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
5515 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5516
5517 #. type: TH
5518 #: build/C/man3/pthread_getcpuclockid.3:24
5519 #, no-wrap
5520 msgid "PTHREAD_GETCPUCLOCKID"
5521 msgstr "PTHREAD_GETCPUCLOCKID"
5522
5523 #. type: TH
5524 #: build/C/man3/pthread_getcpuclockid.3:24
5525 #, no-wrap
5526 msgid "2009-02-08"
5527 msgstr "2009-02-08"
5528
5529 #. type: Plain text
5530 #: build/C/man3/pthread_getcpuclockid.3:27
5531 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
5532 msgstr ""
5533
5534 #. type: Plain text
5535 #: build/C/man3/pthread_getcpuclockid.3:31
5536 #, no-wrap
5537 msgid ""
5538 "B<#include E<lt>pthread.hE<gt>>\n"
5539 "B<#include E<lt>time.hE<gt>>\n"
5540 msgstr ""
5541 "B<#include E<lt>pthread.hE<gt>>\n"
5542 "B<#include E<lt>time.hE<gt>>\n"
5543
5544 #. type: Plain text
5545 #: build/C/man3/pthread_getcpuclockid.3:33
5546 #, no-wrap
5547 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
5548 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
5549
5550 #.  The clockid is constructed as follows:
5551 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
5552 #.  where CLOCK_IDFIELD_SIZE is 3.
5553 #. type: Plain text
5554 #: build/C/man3/pthread_getcpuclockid.3:44
5555 msgid ""
5556 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
5557 "time clock of the thread I<thread>."
5558 msgstr ""
5559
5560 #. type: TP
5561 #: build/C/man3/pthread_getcpuclockid.3:48
5562 #, no-wrap
5563 msgid "B<ENOENT>"
5564 msgstr "B<ENOENT>"
5565
5566 #.  CLOCK_THREAD_CPUTIME_ID not defined
5567 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
5568 #.  be possible if kernel thread IDs took more than 29 bits (which
5569 #.  they currently cannot).
5570 #. type: Plain text
5571 #: build/C/man3/pthread_getcpuclockid.3:56
5572 msgid "Per-thread CPU time clocks are not supported by the system."
5573 msgstr ""
5574
5575 #. type: Plain text
5576 #: build/C/man3/pthread_getcpuclockid.3:63
5577 msgid "This function is available in glibc since version 2.2."
5578 msgstr ""
5579
5580 #. type: Plain text
5581 #: build/C/man3/pthread_getcpuclockid.3:76
5582 msgid ""
5583 "When I<thread> refers to the calling thread, this function returns an "
5584 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
5585 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
5586 msgstr ""
5587
5588 #. type: Plain text
5589 #: build/C/man3/pthread_getcpuclockid.3:82
5590 msgid ""
5591 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
5592 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
5593 "the two threads.  The following shell session shows an example run:"
5594 msgstr ""
5595
5596 #. type: Plain text
5597 #: build/C/man3/pthread_getcpuclockid.3:91
5598 #, no-wrap
5599 msgid ""
5600 "$ B<./a.out>\n"
5601 "Main thread sleeping\n"
5602 "Subthread starting infinite loop\n"
5603 "Main thread consuming some CPU time...\n"
5604 "Process total CPU time:    1.368\n"
5605 "Main thread CPU time:      0.376\n"
5606 "Subthread CPU time:        0.992\n"
5607 msgstr ""
5608 "$ B<./a.out>\n"
5609 "Main thread sleeping\n"
5610 "Subthread starting infinite loop\n"
5611 "Main thread consuming some CPU time...\n"
5612 "Process total CPU time:    1.368\n"
5613 "Main thread CPU time:      0.376\n"
5614 "Subthread CPU time:        0.992\n"
5615
5616 #. type: Plain text
5617 #: build/C/man3/pthread_getcpuclockid.3:97
5618 #, no-wrap
5619 msgid "/* Link with \"-lrt\" */\n"
5620 msgstr ""
5621
5622 #. type: Plain text
5623 #: build/C/man3/pthread_getcpuclockid.3:105
5624 #, no-wrap
5625 msgid ""
5626 "#include E<lt>time.hE<gt>\n"
5627 "#include E<lt>stdio.hE<gt>\n"
5628 "#include E<lt>stdlib.hE<gt>\n"
5629 "#include E<lt>unistd.hE<gt>\n"
5630 "#include E<lt>pthread.hE<gt>\n"
5631 "#include E<lt>string.hE<gt>\n"
5632 "#include E<lt>errno.hE<gt>\n"
5633 msgstr ""
5634 "#include E<lt>time.hE<gt>\n"
5635 "#include E<lt>stdio.hE<gt>\n"
5636 "#include E<lt>stdlib.hE<gt>\n"
5637 "#include E<lt>unistd.hE<gt>\n"
5638 "#include E<lt>pthread.hE<gt>\n"
5639 "#include E<lt>string.hE<gt>\n"
5640 "#include E<lt>errno.hE<gt>\n"
5641
5642 #. type: Plain text
5643 #: build/C/man3/pthread_getcpuclockid.3:119
5644 #, no-wrap
5645 msgid ""
5646 "static void *\n"
5647 "thread_start(void *arg)\n"
5648 "{\n"
5649 "    printf(\"Subthread starting infinite loop\\en\");\n"
5650 "    for (;;)\n"
5651 "        continue;\n"
5652 "}\n"
5653 msgstr ""
5654 "static void *\n"
5655 "thread_start(void *arg)\n"
5656 "{\n"
5657 "    printf(\"Subthread starting infinite loop\\en\");\n"
5658 "    for (;;)\n"
5659 "        continue;\n"
5660 "}\n"
5661
5662 #. type: Plain text
5663 #: build/C/man3/pthread_getcpuclockid.3:124
5664 #, no-wrap
5665 msgid ""
5666 "static void\n"
5667 "pclock(char *msg, clockid_t cid)\n"
5668 "{\n"
5669 "    struct timespec ts;\n"
5670 msgstr ""
5671 "static void\n"
5672 "pclock(char *msg, clockid_t cid)\n"
5673 "{\n"
5674 "    struct timespec ts;\n"
5675
5676 #. type: Plain text
5677 #: build/C/man3/pthread_getcpuclockid.3:130
5678 #, no-wrap
5679 msgid ""
5680 "    printf(\"%s\", msg);\n"
5681 "    if (clock_gettime(cid, &ts) == -1)\n"
5682 "        handle_error(\"clock_gettime\");\n"
5683 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
5684 "}\n"
5685 msgstr ""
5686 "    printf(\"%s\", msg);\n"
5687 "    if (clock_gettime(cid, &ts) == -1)\n"
5688 "        handle_error(\"clock_gettime\");\n"
5689 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
5690 "}\n"
5691
5692 #. type: Plain text
5693 #: build/C/man3/pthread_getcpuclockid.3:137
5694 #, no-wrap
5695 msgid ""
5696 "int\n"
5697 "main(int argc, char *argv[])\n"
5698 "{\n"
5699 "    pthread_t thread;\n"
5700 "    clockid_t cid;\n"
5701 "    int j, s;\n"
5702 msgstr ""
5703 "int\n"
5704 "main(int argc, char *argv[])\n"
5705 "{\n"
5706 "    pthread_t thread;\n"
5707 "    clockid_t cid;\n"
5708 "    int j, s;\n"
5709
5710 #. type: Plain text
5711 #: build/C/man3/pthread_getcpuclockid.3:141
5712 #, no-wrap
5713 msgid ""
5714 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
5715 "    if (s != 0)\n"
5716 "        handle_error_en(s, \"pthread_create\");\n"
5717 msgstr ""
5718 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
5719 "    if (s != 0)\n"
5720 "        handle_error_en(s, \"pthread_create\");\n"
5721
5722 #. type: Plain text
5723 #: build/C/man3/pthread_getcpuclockid.3:144
5724 #, no-wrap
5725 msgid ""
5726 "    printf(\"Main thread sleeping\\en\");\n"
5727 "    sleep(1);\n"
5728 msgstr ""
5729 "    printf(\"Main thread sleeping\\en\");\n"
5730 "    sleep(1);\n"
5731
5732 #. type: Plain text
5733 #: build/C/man3/pthread_getcpuclockid.3:148
5734 #, no-wrap
5735 msgid ""
5736 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
5737 "    for (j = 0; j E<lt> 2000000; j++)\n"
5738 "        getppid();\n"
5739 msgstr ""
5740 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
5741 "    for (j = 0; j E<lt> 2000000; j++)\n"
5742 "        getppid();\n"
5743
5744 #. type: Plain text
5745 #: build/C/man3/pthread_getcpuclockid.3:150
5746 #, no-wrap
5747 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
5748 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
5749
5750 #. type: Plain text
5751 #: build/C/man3/pthread_getcpuclockid.3:155
5752 #, no-wrap
5753 msgid ""
5754 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
5755 "    if (s != 0)\n"
5756 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5757 "    pclock(\"Main thread CPU time:   \", cid);\n"
5758 msgstr ""
5759 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
5760 "    if (s != 0)\n"
5761 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5762 "    pclock(\"Main thread CPU time:   \", cid);\n"
5763
5764 #. type: Plain text
5765 #: build/C/man3/pthread_getcpuclockid.3:158
5766 #, no-wrap
5767 msgid ""
5768 "    /* The preceding 4 lines of code could have been replaced by:\n"
5769 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
5770 msgstr ""
5771 "    /* The preceding 4 lines of code could have been replaced by:\n"
5772 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
5773
5774 #. type: Plain text
5775 #: build/C/man3/pthread_getcpuclockid.3:163
5776 #, no-wrap
5777 msgid ""
5778 "    s = pthread_getcpuclockid(thread, &cid);\n"
5779 "    if (s != 0)\n"
5780 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5781 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
5782 msgstr ""
5783 "    s = pthread_getcpuclockid(thread, &cid);\n"
5784 "    if (s != 0)\n"
5785 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5786 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
5787
5788 #. type: Plain text
5789 #: build/C/man3/pthread_getcpuclockid.3:166
5790 #, no-wrap
5791 msgid ""
5792 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
5793 "}\n"
5794 msgstr ""
5795 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
5796 "}\n"
5797
5798 #. type: Plain text
5799 #: build/C/man3/pthread_getcpuclockid.3:175
5800 msgid ""
5801 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
5802 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
5803 msgstr ""
5804 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
5805 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
5806
5807 #. type: TH
5808 #: build/C/man3/pthread_join.3:24
5809 #, no-wrap
5810 msgid "PTHREAD_JOIN"
5811 msgstr "PTHREAD_JOIN"
5812
5813 #. type: Plain text
5814 #: build/C/man3/pthread_join.3:27
5815 msgid "pthread_join - join with a terminated thread"
5816 msgstr ""
5817
5818 #. type: Plain text
5819 #: build/C/man3/pthread_join.3:32
5820 #, no-wrap
5821 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
5822 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
5823
5824 #. type: Plain text
5825 #: build/C/man3/pthread_join.3:47
5826 msgid ""
5827 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
5828 "to terminate.  If that thread has already terminated, then B<pthread_join>"
5829 "()  returns immediately.  The thread specified by I<thread> must be joinable."
5830 msgstr ""
5831
5832 #. type: Plain text
5833 #: build/C/man3/pthread_join.3:61
5834 msgid ""
5835 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
5836 "the target thread (i.e., the value that the target thread supplied to "
5837 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
5838 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
5839 msgstr ""
5840
5841 #. type: Plain text
5842 #: build/C/man3/pthread_join.3:68
5843 msgid ""
5844 "If multiple threads simultaneously try to join with the same thread, the "
5845 "results are undefined.  If the thread calling B<pthread_join>()  is "
5846 "canceled, then the target thread will remain joinable (i.e., it will not be "
5847 "detached)."
5848 msgstr ""
5849
5850 #. type: Plain text
5851 #: build/C/man3/pthread_join.3:73
5852 msgid ""
5853 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
5854 "number."
5855 msgstr ""
5856
5857 #. type: TP
5858 #: build/C/man3/pthread_join.3:74
5859 #, no-wrap
5860 msgid "B<EDEADLK>"
5861 msgstr "B<EDEADLK>"
5862
5863 #.  The following verified by testing on glibc 2.8/NPTL:
5864 #.  The following verified by testing on glibc 2.8/NPTL:
5865 #. type: Plain text
5866 #: build/C/man3/pthread_join.3:83
5867 msgid ""
5868 "A deadlock was detected (e.g., two threads tried to join with each other); "
5869 "or I<thread> specifies the calling thread."
5870 msgstr ""
5871
5872 #.  POSIX.1-2001 does not specify this error case.
5873 #. type: Plain text
5874 #: build/C/man3/pthread_join.3:91
5875 msgid "Another thread is already waiting to join with this thread."
5876 msgstr ""
5877
5878 #. type: Plain text
5879 #: build/C/man3/pthread_join.3:102
5880 msgid ""
5881 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
5882 "the target thread has terminated."
5883 msgstr ""
5884
5885 #. type: Plain text
5886 #: build/C/man3/pthread_join.3:105
5887 msgid ""
5888 "Joining with a thread that has previously been joined results in undefined "
5889 "behavior."
5890 msgstr ""
5891
5892 #. type: Plain text
5893 #: build/C/man3/pthread_join.3:113
5894 msgid ""
5895 "Failure to join with a thread that is joinable (i.e., one that is not "
5896 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
5897 "zombie thread consumes some system resources, and when enough zombie threads "
5898 "have accumulated, it will no longer be possible to create new threads (or "
5899 "processes)."
5900 msgstr ""
5901
5902 #. type: Plain text
5903 #: build/C/man3/pthread_join.3:119
5904 msgid ""
5905 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
5906 "\"join with any terminated thread\".  If you believe you need this "
5907 "functionality, you probably need to rethink your application design."
5908 msgstr ""
5909
5910 #. type: Plain text
5911 #: build/C/man3/pthread_join.3:122
5912 msgid ""
5913 "All of the threads in a process are peers: any thread can join with any "
5914 "other thread in the process."
5915 msgstr ""
5916
5917 #. type: Plain text
5918 #: build/C/man3/pthread_join.3:132
5919 msgid ""
5920 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
5921 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
5922 msgstr ""
5923 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
5924 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
5925
5926 #. type: TH
5927 #: build/C/man3/pthread_kill.3:24
5928 #, no-wrap
5929 msgid "PTHREAD_KILL"
5930 msgstr "PTHREAD_KILL"
5931
5932 #. type: TH
5933 #: build/C/man3/pthread_kill.3:24
5934 #, no-wrap
5935 msgid "2009-01-28"
5936 msgstr "2009-01-28"
5937
5938 #. type: Plain text
5939 #: build/C/man3/pthread_kill.3:27
5940 msgid "pthread_kill - send a signal to a thread"
5941 msgstr ""
5942
5943 #. type: Plain text
5944 #: build/C/man3/pthread_kill.3:30 build/C/man3/pthread_sigmask.3:30
5945 #, no-wrap
5946 msgid "B<#include E<lt>signal.hE<gt>>\n"
5947 msgstr "B<#include E<lt>signal.hE<gt>>\n"
5948
5949 #. type: Plain text
5950 #: build/C/man3/pthread_kill.3:32
5951 #, no-wrap
5952 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
5953 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
5954
5955 #. type: Plain text
5956 #: build/C/man3/pthread_kill.3:45
5957 msgid ""
5958 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, "
5959 "another thread in the same process as the caller.  The signal is "
5960 "asynchronously directed to I<thread>."
5961 msgstr ""
5962
5963 #. type: Plain text
5964 #: build/C/man3/pthread_kill.3:50
5965 msgid ""
5966 "If I<sig> is 0, then no signal is sent, but error checking is still "
5967 "performed; this can be used to check for the existence of a thread ID."
5968 msgstr ""
5969
5970 #. type: Plain text
5971 #: build/C/man3/pthread_kill.3:55
5972 msgid ""
5973 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
5974 "number, and no signal is sent."
5975 msgstr ""
5976
5977 #. type: Plain text
5978 #: build/C/man3/pthread_kill.3:59
5979 msgid "An invalid signal was specified."
5980 msgstr ""
5981
5982 #. type: Plain text
5983 #: build/C/man3/pthread_kill.3:73
5984 msgid ""
5985 "Signal dispositions are process-wide: if a signal handler is installed, the "
5986 "handler will be invoked in the thread I<thread>, but if the disposition of "
5987 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
5988 "affect the whole process."
5989 msgstr ""
5990
5991 #. type: Plain text
5992 #: build/C/man3/pthread_kill.3:82
5993 msgid ""
5994 "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
5995 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
5996 msgstr ""
5997 "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
5998 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
5999
6000 #. type: TH
6001 #: build/C/man3/pthread_kill_other_threads_np.3:24
6002 #, no-wrap
6003 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
6004 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
6005
6006 #. type: TH
6007 #: build/C/man3/pthread_kill_other_threads_np.3:24
6008 #, no-wrap
6009 msgid "2010-09-09"
6010 msgstr "2010-09-09"
6011
6012 #. type: Plain text
6013 #: build/C/man3/pthread_kill_other_threads_np.3:27
6014 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
6015 msgstr ""
6016
6017 #. type: Plain text
6018 #: build/C/man3/pthread_kill_other_threads_np.3:32
6019 #, no-wrap
6020 msgid "B<void pthread_kill_other_threads_np(void);>\n"
6021 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
6022
6023 #.  .SH VERSIONS
6024 #.  Available since glibc 2.0
6025 #. type: Plain text
6026 #: build/C/man3/pthread_kill_other_threads_np.3:45
6027 msgid ""
6028 "B<pthread_kill_other_threads_np>()  only has an effect in the LinuxThreads "
6029 "threading implementation.  On that implementation, calling this function "
6030 "causes the immediate termination of all threads in the application, except "
6031 "the calling thread.  The cancellation state and cancellation type of the to-"
6032 "be-terminated threads are ignored, and the cleanup handlers are not called "
6033 "in those threads."
6034 msgstr ""
6035
6036 #. type: Plain text
6037 #: build/C/man3/pthread_kill_other_threads_np.3:57
6038 msgid ""
6039 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
6040 "thread calls B<execve>(2)  or a similar function.  This function is designed "
6041 "to address a limitation in the obsolete LinuxThreads implementation whereby "
6042 "the other threads of an application are not automatically terminated (as "
6043 "POSIX.1-2001 requires) during B<execve>(2)."
6044 msgstr ""
6045
6046 #. type: Plain text
6047 #: build/C/man3/pthread_kill_other_threads_np.3:64
6048 msgid ""
6049 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
6050 "exists, but does nothing.  (Nothing needs to be done, because the "
6051 "implementation does the right thing during an B<execve>(2).)"
6052 msgstr ""
6053
6054 #. type: Plain text
6055 #: build/C/man3/pthread_kill_other_threads_np.3:70
6056 msgid ""
6057 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
6058 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
6059 msgstr ""
6060 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
6061 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
6062
6063 #. type: TH
6064 #: build/C/man3/pthread_self.3:24
6065 #, no-wrap
6066 msgid "PTHREAD_SELF"
6067 msgstr "PTHREAD_SELF"
6068
6069 #. type: Plain text
6070 #: build/C/man3/pthread_self.3:27
6071 msgid "pthread_self - obtain ID of the calling thread"
6072 msgstr ""
6073
6074 #. type: Plain text
6075 #: build/C/man3/pthread_self.3:32
6076 #, no-wrap
6077 msgid "B<pthread_t pthread_self(void);>\n"
6078 msgstr "B<pthread_t pthread_self(void);>\n"
6079
6080 #. type: Plain text
6081 #: build/C/man3/pthread_self.3:44
6082 msgid ""
6083 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
6084 "is the same value that is returned in I<*thread> in the B<pthread_create>"
6085 "(3)  call that created this thread."
6086 msgstr ""
6087
6088 #. type: Plain text
6089 #: build/C/man3/pthread_self.3:46
6090 msgid "This function always succeeds, returning the calling thread's ID."
6091 msgstr ""
6092
6093 #. type: Plain text
6094 #: build/C/man3/pthread_self.3:61
6095 msgid ""
6096 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
6097 "represent a thread ID; for example, representation using either an "
6098 "arithmetic type or a structure is permitted.  Therefore, variables of type "
6099 "I<pthread_t> can't portably be compared using the C equality operator "
6100 "(B<==>); use B<pthread_equal>(3)  instead."
6101 msgstr ""
6102
6103 #. type: Plain text
6104 #: build/C/man3/pthread_self.3:65
6105 msgid ""
6106 "Thread identifiers should be considered opaque: any attempt to use a thread "
6107 "ID other than in pthreads calls is nonportable and can lead to unspecified "
6108 "results."
6109 msgstr ""
6110
6111 #. type: Plain text
6112 #: build/C/man3/pthread_self.3:69
6113 msgid ""
6114 "Thread IDs are only guaranteed to be unique within a process.  A thread ID "
6115 "may be reused after a terminated thread has been joined, or a detached "
6116 "thread has terminated."
6117 msgstr ""
6118
6119 #. type: Plain text
6120 #: build/C/man3/pthread_self.3:74
6121 msgid ""
6122 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
6123 "kernel thread ID returned by a call to B<gettid>(2)."
6124 msgstr ""
6125
6126 #. type: Plain text
6127 #: build/C/man3/pthread_self.3:78
6128 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6129 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6130
6131 #. type: TH
6132 #: build/C/man3/pthread_setaffinity_np.3:24
6133 #, no-wrap
6134 msgid "PTHREAD_SETAFFINITY_NP"
6135 msgstr "PTHREAD_SETAFFINITY_NP"
6136
6137 #. type: Plain text
6138 #: build/C/man3/pthread_setaffinity_np.3:28
6139 msgid ""
6140 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
6141 "thread"
6142 msgstr ""
6143
6144 #. type: Plain text
6145 #: build/C/man3/pthread_setaffinity_np.3:37
6146 #, no-wrap
6147 msgid ""
6148 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6149 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6150 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6151 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6152 msgstr ""
6153 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6154 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6155 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6156 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6157
6158 #. type: Plain text
6159 #: build/C/man3/pthread_setaffinity_np.3:52
6160 msgid ""
6161 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
6162 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
6163 "successful, and the thread is not currently running on one of the CPUs in "
6164 "I<cpuset>, then it is migrated to one of those CPUs."
6165 msgstr ""
6166
6167 #. type: Plain text
6168 #: build/C/man3/pthread_setaffinity_np.3:59
6169 msgid ""
6170 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
6171 "the thread I<thread> in the buffer pointed to by I<cpuset>."
6172 msgstr ""
6173
6174 #. type: Plain text
6175 #: build/C/man3/pthread_setaffinity_np.3:75
6176 msgid ""
6177 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
6178 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
6179 "(cpu_set_t)>.  (It may be some other value, if using the macros described in "
6180 "B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
6181 msgstr ""
6182
6183 #. type: TP
6184 #: build/C/man3/pthread_setaffinity_np.3:79
6185 #, no-wrap
6186 msgid "B<EFAULT>"
6187 msgstr "B<EFAULT>"
6188
6189 #. type: Plain text
6190 #: build/C/man3/pthread_setaffinity_np.3:82
6191 msgid "A supplied memory address was invalid."
6192 msgstr ""
6193
6194 #. type: Plain text
6195 #: build/C/man3/pthread_setaffinity_np.3:91
6196 msgid ""
6197 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
6198 "processors that are currently physically on the system and permitted to the "
6199 "thread according to any restrictions that may be imposed by the \"cpuset\" "
6200 "mechanism described in B<cpuset>(7)."
6201 msgstr ""
6202
6203 #.  FIXME . ?
6204 #.  Loic Domaigne commented: it seems that in the future the
6205 #.  kernel developers want to make cpumask_t dynamic, so
6206 #.  CONFIG_NR_CPUS might become obsolete in the future.
6207 #.  cpumask_t
6208 #.  The raw sched_getaffinity() system call returns the size (in bytes)
6209 #.  of the cpumask_t type.
6210 #. type: Plain text
6211 #: build/C/man3/pthread_setaffinity_np.3:107
6212 msgid ""
6213 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
6214 "the set supported by the kernel.  (The kernel configuration option "
6215 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
6216 "type used to represent CPU sets.)"
6217 msgstr ""
6218
6219 #. type: Plain text
6220 #: build/C/man3/pthread_setaffinity_np.3:112
6221 msgid ""
6222 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
6223 "affinity mask used by the kernel."
6224 msgstr ""
6225
6226 #. type: Plain text
6227 #: build/C/man3/pthread_setaffinity_np.3:135
6228 msgid ""
6229 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
6230 "thread will actually run is the intersection of the set specified in the "
6231 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
6232 "system may further restrict the set of CPUs on which the thread runs if the "
6233 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
6234 "restrictions on the actual set of CPUs on which the thread will run are "
6235 "silently imposed by the kernel."
6236 msgstr ""
6237
6238 #. type: Plain text
6239 #: build/C/man3/pthread_setaffinity_np.3:141
6240 msgid ""
6241 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
6242 "B<sched_getaffinity>(2)  system calls."
6243 msgstr ""
6244
6245 #. type: Plain text
6246 #: build/C/man3/pthread_setaffinity_np.3:152
6247 msgid ""
6248 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
6249 "creator's CPU affinity mask."
6250 msgstr ""
6251
6252 #. type: Plain text
6253 #: build/C/man3/pthread_setaffinity_np.3:160
6254 msgid ""
6255 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
6256 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
6257 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
6258 "check the resulting CPU affinity mask of the thread."
6259 msgstr ""
6260
6261 #. type: Plain text
6262 #: build/C/man3/pthread_setaffinity_np.3:167
6263 #, no-wrap
6264 msgid ""
6265 "#define _GNU_SOURCE\n"
6266 "#include E<lt>pthread.hE<gt>\n"
6267 "#include E<lt>stdio.hE<gt>\n"
6268 "#include E<lt>stdlib.hE<gt>\n"
6269 "#include E<lt>errno.hE<gt>\n"
6270 msgstr ""
6271 "#define _GNU_SOURCE\n"
6272 "#include E<lt>pthread.hE<gt>\n"
6273 "#include E<lt>stdio.hE<gt>\n"
6274 "#include E<lt>stdlib.hE<gt>\n"
6275 "#include E<lt>errno.hE<gt>\n"
6276
6277 #. type: Plain text
6278 #: build/C/man3/pthread_setaffinity_np.3:177
6279 #, no-wrap
6280 msgid ""
6281 "int\n"
6282 "main(int argc, char *argv[])\n"
6283 "{\n"
6284 "    int s, j;\n"
6285 "    cpu_set_t cpuset;\n"
6286 "    pthread_t thread;\n"
6287 msgstr ""
6288 "int\n"
6289 "main(int argc, char *argv[])\n"
6290 "{\n"
6291 "    int s, j;\n"
6292 "    cpu_set_t cpuset;\n"
6293 "    pthread_t thread;\n"
6294
6295 #. type: Plain text
6296 #: build/C/man3/pthread_setaffinity_np.3:179
6297 #, no-wrap
6298 msgid "    thread = pthread_self();\n"
6299 msgstr "    thread = pthread_self();\n"
6300
6301 #. type: Plain text
6302 #: build/C/man3/pthread_setaffinity_np.3:181
6303 #, no-wrap
6304 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
6305 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
6306
6307 #. type: Plain text
6308 #: build/C/man3/pthread_setaffinity_np.3:185
6309 #, no-wrap
6310 msgid ""
6311 "    CPU_ZERO(&cpuset);\n"
6312 "    for (j = 0; j E<lt> 8; j++)\n"
6313 "        CPU_SET(j, &cpuset);\n"
6314 msgstr ""
6315 "    CPU_ZERO(&cpuset);\n"
6316 "    for (j = 0; j E<lt> 8; j++)\n"
6317 "        CPU_SET(j, &cpuset);\n"
6318
6319 #. type: Plain text
6320 #: build/C/man3/pthread_setaffinity_np.3:189
6321 #, no-wrap
6322 msgid ""
6323 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6324 "    if (s != 0)\n"
6325 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
6326 msgstr ""
6327 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6328 "    if (s != 0)\n"
6329 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
6330
6331 #. type: Plain text
6332 #: build/C/man3/pthread_setaffinity_np.3:191
6333 #, no-wrap
6334 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
6335 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
6336
6337 #. type: Plain text
6338 #: build/C/man3/pthread_setaffinity_np.3:195
6339 #, no-wrap
6340 msgid ""
6341 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6342 "    if (s != 0)\n"
6343 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
6344 msgstr ""
6345 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6346 "    if (s != 0)\n"
6347 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
6348
6349 #. type: Plain text
6350 #: build/C/man3/pthread_setaffinity_np.3:200
6351 #, no-wrap
6352 msgid ""
6353 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6354 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6355 "        if (CPU_ISSET(j, &cpuset))\n"
6356 "            printf(\"    CPU %d\\en\", j);\n"
6357 msgstr ""
6358 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6359 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6360 "        if (CPU_ISSET(j, &cpuset))\n"
6361 "            printf(\"    CPU %d\\en\", j);\n"
6362
6363 #. type: Plain text
6364 #: build/C/man3/pthread_setaffinity_np.3:203
6365 #: build/C/man3/pthread_setschedparam.3:428
6366 #, no-wrap
6367 msgid ""
6368 "    exit(EXIT_SUCCESS);\n"
6369 "}\n"
6370 msgstr ""
6371 "    exit(EXIT_SUCCESS);\n"
6372 "}\n"
6373
6374 #. type: Plain text
6375 #: build/C/man3/pthread_setaffinity_np.3:212
6376 msgid ""
6377 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
6378 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
6379 "B<cpuset>(7), B<pthreads>(7)"
6380 msgstr ""
6381 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
6382 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
6383 "B<cpuset>(7), B<pthreads>(7)"
6384
6385 #. type: TH
6386 #: build/C/man3/pthread_setcancelstate.3:24
6387 #, no-wrap
6388 msgid "PTHREAD_SETCANCELSTATE"
6389 msgstr "PTHREAD_SETCANCELSTATE"
6390
6391 #. type: Plain text
6392 #: build/C/man3/pthread_setcancelstate.3:28
6393 msgid ""
6394 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
6395 "type"
6396 msgstr ""
6397
6398 #. type: Plain text
6399 #: build/C/man3/pthread_setcancelstate.3:34
6400 #, no-wrap
6401 msgid ""
6402 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6403 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6404 msgstr ""
6405 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6406 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6407
6408 #. type: Plain text
6409 #: build/C/man3/pthread_setcancelstate.3:49
6410 msgid ""
6411 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
6412 "thread to the value given in I<state>.  The previous cancelability state of "
6413 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
6414 "I<state> argument must have one of the following values:"
6415 msgstr ""
6416
6417 #. type: TP
6418 #: build/C/man3/pthread_setcancelstate.3:49
6419 #, no-wrap
6420 msgid "B<PTHREAD_CANCEL_ENABLE>"
6421 msgstr "B<PTHREAD_CANCEL_ENABLE>"
6422
6423 #. type: Plain text
6424 #: build/C/man3/pthread_setcancelstate.3:56
6425 msgid ""
6426 "The thread is cancelable.  This is the default cancelability state in all "
6427 "new threads, including the initial thread.  The thread's cancelability type "
6428 "determines when a cancelable thread will respond to a cancellation request."
6429 msgstr ""
6430
6431 #. type: TP
6432 #: build/C/man3/pthread_setcancelstate.3:56
6433 #, no-wrap
6434 msgid "B<PTHREAD_CANCEL_DISABLE>"
6435 msgstr "B<PTHREAD_CANCEL_DISABLE>"
6436
6437 #. type: Plain text
6438 #: build/C/man3/pthread_setcancelstate.3:61
6439 msgid ""
6440 "The thread is not cancelable.  If a cancellation request is received, it is "
6441 "blocked until cancelability is enabled."
6442 msgstr ""
6443
6444 #. type: Plain text
6445 #: build/C/man3/pthread_setcancelstate.3:73
6446 msgid ""
6447 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
6448 "thread to the value given in I<type>.  The previous cancelability type of "
6449 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
6450 "argument must have one of the following values:"
6451 msgstr ""
6452
6453 #. type: TP
6454 #: build/C/man3/pthread_setcancelstate.3:73
6455 #, no-wrap
6456 msgid "B<PTHREAD_CANCEL_DEFERRED>"
6457 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
6458
6459 #. type: Plain text
6460 #: build/C/man3/pthread_setcancelstate.3:80
6461 msgid ""
6462 "A cancellation request is deferred until the thread next calls a function "
6463 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
6464 "cancelability type in all new threads, including the initial thread."
6465 msgstr ""
6466
6467 #. type: TP
6468 #: build/C/man3/pthread_setcancelstate.3:80
6469 #, no-wrap
6470 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6471 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6472
6473 #. type: Plain text
6474 #: build/C/man3/pthread_setcancelstate.3:86
6475 msgid ""
6476 "The thread can be canceled at any time.  (Typically, it will be canceled "
6477 "immediately upon receiving a cancellation request, but the system doesn't "
6478 "guarantee this.)"
6479 msgstr ""
6480
6481 #. type: Plain text
6482 #: build/C/man3/pthread_setcancelstate.3:90
6483 msgid ""
6484 "The set-and-get operation performed by each of these functions is atomic "
6485 "with respect to other threads in the process calling the same function."
6486 msgstr ""
6487
6488 #. type: Plain text
6489 #: build/C/man3/pthread_setcancelstate.3:97
6490 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
6491 msgstr ""
6492
6493 #. type: Plain text
6494 #: build/C/man3/pthread_setcancelstate.3:101
6495 msgid "Invalid value for I<state>."
6496 msgstr ""
6497
6498 #. type: Plain text
6499 #: build/C/man3/pthread_setcancelstate.3:105
6500 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
6501 msgstr ""
6502
6503 #.  .SH VERSIONS
6504 #.  Available since glibc 2.0
6505 #. type: Plain text
6506 #: build/C/man3/pthread_setcancelstate.3:111
6507 msgid "Invalid value for I<type>."
6508 msgstr ""
6509
6510 #. type: Plain text
6511 #: build/C/man3/pthread_setcancelstate.3:116
6512 msgid ""
6513 "For details of what happens when a thread is canceled, see B<pthread_cancel>"
6514 "(3)."
6515 msgstr ""
6516
6517 #. type: Plain text
6518 #: build/C/man3/pthread_setcancelstate.3:123
6519 msgid ""
6520 "Briefly disabling cancelability is useful if a thread performs some critical "
6521 "action that must not be interrupted by a cancellation request.  Beware of "
6522 "disabling cancelability for long periods, or around operations that may "
6523 "block for long periods, since that will render the thread unresponsive to "
6524 "cancellation requests."
6525 msgstr ""
6526
6527 #. type: Plain text
6528 #: build/C/man3/pthread_setcancelstate.3:154
6529 msgid ""
6530 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
6531 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
6532 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
6533 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
6534 "because the application has no way of knowing what the state of these "
6535 "resources is when the thread is canceled; that is, did cancellation occur "
6536 "before the resources were reserved, while they were reserved, or after they "
6537 "were released? Furthermore, some internal data structures (e.g., the linked "
6538 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
6539 "left in an inconsistent state if cancellation occurs in the middle of the "
6540 "function call.  Consequently, clean-up handlers cease to be useful.  "
6541 "Functions that can be safely asynchronously canceled are called I<async-"
6542 "cancel-safe functions>.  POSIX.1-2001 only requires that B<pthread_cancel>"
6543 "(3), B<pthread_setcancelstate>(), and B<pthread_setcanceltype>()  be async-"
6544 "cancel-safe.  In general, other library functions can't be safely called "
6545 "from an asynchronously cancelable thread.  One of the few circumstances in "
6546 "which asynchronous cancelability is useful is for cancellation of a thread "
6547 "that is in a pure compute-bound loop."
6548 msgstr ""
6549
6550 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
6551 #. type: Plain text
6552 #: build/C/man3/pthread_setcancelstate.3:172
6553 msgid ""
6554 "The Linux threading implementations permit the I<oldstate> argument of "
6555 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
6556 "the previous cancelability state is not returned to the caller.  Many other "
6557 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
6558 "does not specify this point, so portable applications should always specify "
6559 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
6560 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
6561 msgstr ""
6562
6563 #. type: Plain text
6564 #: build/C/man3/pthread_setcancelstate.3:175
6565 msgid "See B<pthread_cancel>(3)."
6566 msgstr ""
6567
6568 #. type: Plain text
6569 #: build/C/man3/pthread_setcancelstate.3:180
6570 msgid ""
6571 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
6572 "B<pthreads>(7)"
6573 msgstr ""
6574 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
6575 "B<pthreads>(7)"
6576
6577 #. type: TH
6578 #: build/C/man3/pthread_setconcurrency.3:23
6579 #, no-wrap
6580 msgid "PTHREAD_SETCONCURRENCY"
6581 msgstr "PTHREAD_SETCONCURRENCY"
6582
6583 #. type: TH
6584 #: build/C/man3/pthread_setconcurrency.3:23 build/C/man3/pthread_yield.3:23
6585 #, no-wrap
6586 msgid "2009-04-10"
6587 msgstr "2009-04-10"
6588
6589 #. type: Plain text
6590 #: build/C/man3/pthread_setconcurrency.3:27
6591 msgid ""
6592 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
6593 "level"
6594 msgstr ""
6595
6596 #. type: Plain text
6597 #: build/C/man3/pthread_setconcurrency.3:33
6598 #, no-wrap
6599 msgid ""
6600 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
6601 "B<int pthread_getconcurrency(void);>\n"
6602 msgstr ""
6603 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
6604 "B<int pthread_getconcurrency(void);>\n"
6605
6606 #. type: Plain text
6607 #: build/C/man3/pthread_setconcurrency.3:46
6608 msgid ""
6609 "The B<pthread_setconcurrency>()  function informs the implementation of the "
6610 "application's desired concurrency level, specified in I<new_level>.  The "
6611 "implementation only takes this as a hint: POSIX.1 does not specify the level "
6612 "of concurrency that should be provided as a result of calling "
6613 "B<pthread_setconcurrency>()."
6614 msgstr ""
6615
6616 #. type: Plain text
6617 #: build/C/man3/pthread_setconcurrency.3:51
6618 msgid ""
6619 "Specifying I<new_level> as 0 instructs the implementation to manage the "
6620 "concurrency level as it deems appropriate."
6621 msgstr ""
6622
6623 #. type: Plain text
6624 #: build/C/man3/pthread_setconcurrency.3:54
6625 msgid ""
6626 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
6627 "level for this process."
6628 msgstr ""
6629
6630 #. type: Plain text
6631 #: build/C/man3/pthread_setconcurrency.3:59
6632 msgid ""
6633 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
6634 "nonzero error number."
6635 msgstr ""
6636
6637 #. type: Plain text
6638 #: build/C/man3/pthread_setconcurrency.3:66
6639 msgid ""
6640 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
6641 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
6642 "B<pthread_setconcurrency>()  has not previously been called."
6643 msgstr ""
6644
6645 #. type: Plain text
6646 #: build/C/man3/pthread_setconcurrency.3:69
6647 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
6648 msgstr ""
6649
6650 #. type: Plain text
6651 #: build/C/man3/pthread_setconcurrency.3:73
6652 msgid "I<new_level> is negative."
6653 msgstr ""
6654
6655 #. type: Plain text
6656 #: build/C/man3/pthread_setconcurrency.3:79
6657 msgid ""
6658 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
6659 "I<new_level> would cause a system resource to be exceeded\")."
6660 msgstr ""
6661
6662 #. type: Plain text
6663 #: build/C/man3/pthread_setconcurrency.3:81
6664 msgid "These functions are available in glibc since version 2.1."
6665 msgstr ""
6666
6667 #. type: Plain text
6668 #: build/C/man3/pthread_setconcurrency.3:85
6669 msgid "The default concurrency level is 0."
6670 msgstr ""
6671
6672 #. type: Plain text
6673 #: build/C/man3/pthread_setconcurrency.3:92
6674 msgid ""
6675 "Concurrency levels are only meaningful for M:N threading implementations, "
6676 "where at any moment a subset of a process's set of user-level threads may be "
6677 "bound to a smaller number of kernel-scheduling entities.  Setting the "
6678 "concurrency level allows the application to give the system a hint as to the "
6679 "number of kernel-scheduling entities that should be provided for efficient "
6680 "execution of the application."
6681 msgstr ""
6682
6683 #. type: Plain text
6684 #: build/C/man3/pthread_setconcurrency.3:98
6685 msgid ""
6686 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
6687 "concurrency level has no meaning.  In other words, on Linux these functions "
6688 "merely exist for compatibility with other systems, and they have no effect "
6689 "on the execution of a program."
6690 msgstr ""
6691
6692 #. type: Plain text
6693 #: build/C/man3/pthread_setconcurrency.3:101
6694 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
6695 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
6696
6697 #. type: TH
6698 #: build/C/man3/pthread_setschedparam.3:24
6699 #, no-wrap
6700 msgid "PTHREAD_SETSCHEDPARAM"
6701 msgstr "PTHREAD_SETSCHEDPARAM"
6702
6703 #. type: Plain text
6704 #: build/C/man3/pthread_setschedparam.3:28
6705 msgid ""
6706 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
6707 "parameters of a thread"
6708 msgstr ""
6709
6710 #. type: Plain text
6711 #: build/C/man3/pthread_setschedparam.3:36
6712 #, no-wrap
6713 msgid ""
6714 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
6715 "B<                      const struct sched_param *>I<param>B<);>\n"
6716 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
6717 "B<                      struct sched_param *>I<param>B<);>\n"
6718 msgstr ""
6719 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
6720 "B<                      const struct sched_param *>I<param>B<);>\n"
6721 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
6722 "B<                      struct sched_param *>I<param>B<);>\n"
6723
6724 #. type: Plain text
6725 #: build/C/man3/pthread_setschedparam.3:44
6726 msgid ""
6727 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
6728 "parameters of the thread I<thread>."
6729 msgstr ""
6730
6731 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
6732 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
6733 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
6734 #. type: Plain text
6735 #: build/C/man3/pthread_setschedparam.3:55
6736 msgid ""
6737 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
6738 "values for I<policy>, and their semantics, are described in "
6739 "B<sched_setscheduler>(2)."
6740 msgstr ""
6741
6742 #. type: Plain text
6743 #: build/C/man3/pthread_setschedparam.3:61
6744 msgid ""
6745 "The structure pointed to by I<param> specifies the new scheduling parameters "
6746 "for I<thread>.  Scheduling parameters are maintained in the following "
6747 "structure:"
6748 msgstr ""
6749
6750 #.  FIXME . nptl/pthread_setschedparam.c has the following
6751 #.    /* If the thread should have higher priority because of some
6752 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
6753 #.  Eventually (perhaps after writing the mutexattr pages), we
6754 #.  may want to add something on the topic to this page.
6755 #. type: Plain text
6756 #: build/C/man3/pthread_setschedparam.3:102
6757 msgid ""
6758 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
6759 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
6760 "and I<param>, respectively.  The returned priority value is that set by the "
6761 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
6762 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
6763 "does not reflect any temporary priority adjustments as a result of calls to "
6764 "any priority inheritance or priority ceiling functions (see, for example, "
6765 "B<pthread_mutexattr_setprioceiling>(3)  and B<pthread_mutexattr_setprotocol>"
6766 "(3))."
6767 msgstr ""
6768
6769 #. type: Plain text
6770 #: build/C/man3/pthread_setschedparam.3:110
6771 msgid ""
6772 "On success, these functions return 0; on error, they return a nonzero error "
6773 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
6774 "parameters of I<thread> are not changed."
6775 msgstr ""
6776
6777 #. type: Plain text
6778 #: build/C/man3/pthread_setschedparam.3:112
6779 msgid "Both of these functions can fail with the following error:"
6780 msgstr ""
6781
6782 #. type: Plain text
6783 #: build/C/man3/pthread_setschedparam.3:120
6784 msgid ""
6785 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
6786 msgstr ""
6787
6788 #. type: Plain text
6789 #: build/C/man3/pthread_setschedparam.3:127
6790 msgid ""
6791 "I<policy> is not a recognized policy, or I<param> does not make sense for "
6792 "the I<policy>."
6793 msgstr ""
6794
6795 #. type: Plain text
6796 #: build/C/man3/pthread_setschedparam.3:131
6797 msgid ""
6798 "The caller does not have appropriate privileges to set the specified "
6799 "scheduling policy and parameters."
6800 msgstr ""
6801
6802 #.  .SH VERSIONS
6803 #.  Available since glibc 2.0
6804 #. type: Plain text
6805 #: build/C/man3/pthread_setschedparam.3:139
6806 msgid ""
6807 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
6808 "policy or scheduling parameters to an unsupported value\") error for "
6809 "B<pthread_setschedparam>()."
6810 msgstr ""
6811
6812 #. type: Plain text
6813 #: build/C/man3/pthread_setschedparam.3:147
6814 msgid ""
6815 "For a description of the permissions required to, and the effect of, "
6816 "changing a thread's scheduling policy and priority, and details of the "
6817 "permitted ranges for priorities in each scheduling policy, see "
6818 "B<sched_setscheduler>(2)."
6819 msgstr ""
6820
6821 #. type: Plain text
6822 #: build/C/man3/pthread_setschedparam.3:154
6823 msgid ""
6824 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
6825 "B<pthread_getschedparam>(), as well as the use of a number of other "
6826 "scheduling-related pthreads functions."
6827 msgstr ""
6828
6829 #. type: Plain text
6830 #: build/C/man3/pthread_setschedparam.3:170
6831 msgid ""
6832 "In the following run, the main thread sets its scheduling policy to "
6833 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
6834 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
6835 "priority attribute of 20.  The program then sets (using "
6836 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
6837 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
6838 "created using this attributes object should take their scheduling attributes "
6839 "from the thread attributes object.  The program then creates a thread using "
6840 "the thread attributes object, and that thread displays its scheduling policy "
6841 "and priority."
6842 msgstr ""
6843
6844 #. type: Plain text
6845 #: build/C/man3/pthread_setschedparam.3:178
6846 #, no-wrap
6847 msgid ""
6848 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
6849 "Password:\n"
6850 "# B<./a.out -mf10 -ar20 -i e>\n"
6851 "Scheduler settings of main thread\n"
6852 "    policy=SCHED_FIFO, priority=10\n"
6853 msgstr ""
6854 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
6855 "Password:\n"
6856 "# B<./a.out -mf10 -ar20 -i e>\n"
6857 "Scheduler settings of main thread\n"
6858 "    policy=SCHED_FIFO, priority=10\n"
6859
6860 #. type: Plain text
6861 #: build/C/man3/pthread_setschedparam.3:182
6862 #, no-wrap
6863 msgid ""
6864 "Scheduler settings in \\(aqattr\\(aq\n"
6865 "    policy=SCHED_RR, priority=20\n"
6866 "    inheritsched is EXPLICIT\n"
6867 msgstr ""
6868 "Scheduler settings in \\(aqattr\\(aq\n"
6869 "    policy=SCHED_RR, priority=20\n"
6870 "    inheritsched is EXPLICIT\n"
6871
6872 #. type: Plain text
6873 #: build/C/man3/pthread_setschedparam.3:185
6874 #, no-wrap
6875 msgid ""
6876 "Scheduler attributes of new thread\n"
6877 "    policy=SCHED_RR, priority=20\n"
6878 msgstr ""
6879 "Scheduler attributes of new thread\n"
6880 "    policy=SCHED_RR, priority=20\n"
6881
6882 #. type: Plain text
6883 #: build/C/man3/pthread_setschedparam.3:190
6884 msgid ""
6885 "In the above output, one can see that the scheduling policy and priority "
6886 "were taken from the values specified in the thread attributes object."
6887 msgstr ""
6888
6889 #. type: Plain text
6890 #: build/C/man3/pthread_setschedparam.3:197
6891 msgid ""
6892 "The next run is the same as the previous, except that the inherit scheduler "
6893 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
6894 "using the thread attributes object should ignore the scheduling attributes "
6895 "specified in the attributes object and instead take their scheduling "
6896 "attributes from the creating thread."
6897 msgstr ""
6898
6899 #. type: Plain text
6900 #: build/C/man3/pthread_setschedparam.3:203
6901 #, no-wrap
6902 msgid ""
6903 "# B<./a.out -mf10 -ar20 -i i>\n"
6904 "Scheduler settings of main thread\n"
6905 "    policy=SCHED_FIFO, priority=10\n"
6906 msgstr ""
6907 "# B<./a.out -mf10 -ar20 -i i>\n"
6908 "Scheduler settings of main thread\n"
6909 "    policy=SCHED_FIFO, priority=10\n"
6910
6911 #. type: Plain text
6912 #: build/C/man3/pthread_setschedparam.3:207
6913 #, no-wrap
6914 msgid ""
6915 "Scheduler settings in \\(aqattr\\(aq\n"
6916 "    policy=SCHED_RR, priority=20\n"
6917 "    inheritsched is INHERIT\n"
6918 msgstr ""
6919 "Scheduler settings in \\(aqattr\\(aq\n"
6920 "    policy=SCHED_RR, priority=20\n"
6921 "    inheritsched is INHERIT\n"
6922
6923 #. type: Plain text
6924 #: build/C/man3/pthread_setschedparam.3:210
6925 #, no-wrap
6926 msgid ""
6927 "Scheduler attributes of new thread\n"
6928 "    policy=SCHED_FIFO, priority=10\n"
6929 msgstr ""
6930 "Scheduler attributes of new thread\n"
6931 "    policy=SCHED_FIFO, priority=10\n"
6932
6933 #. type: Plain text
6934 #: build/C/man3/pthread_setschedparam.3:216
6935 msgid ""
6936 "In the above output, one can see that the scheduling policy and priority "
6937 "were taken from the creating thread, rather than the thread attributes "
6938 "object."
6939 msgstr ""
6940
6941 #. type: Plain text
6942 #: build/C/man3/pthread_setschedparam.3:222
6943 msgid ""
6944 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
6945 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
6946 "scheduler attribute."
6947 msgstr ""
6948
6949 #. type: Plain text
6950 #: build/C/man3/pthread_setschedparam.3:226
6951 #, no-wrap
6952 msgid "/* pthreads_sched_test.c */\n"
6953 msgstr "/* pthreads_sched_test.c */\n"
6954
6955 #. type: Plain text
6956 #: build/C/man3/pthread_setschedparam.3:232
6957 #, no-wrap
6958 msgid ""
6959 "#include E<lt>pthread.hE<gt>\n"
6960 "#include E<lt>stdio.hE<gt>\n"
6961 "#include E<lt>stdlib.hE<gt>\n"
6962 "#include E<lt>unistd.hE<gt>\n"
6963 "#include E<lt>errno.hE<gt>\n"
6964 msgstr ""
6965 "#include E<lt>pthread.hE<gt>\n"
6966 "#include E<lt>stdio.hE<gt>\n"
6967 "#include E<lt>stdlib.hE<gt>\n"
6968 "#include E<lt>unistd.hE<gt>\n"
6969 "#include E<lt>errno.hE<gt>\n"
6970
6971 #. type: Plain text
6972 #: build/C/man3/pthread_setschedparam.3:241
6973 #, no-wrap
6974 msgid ""
6975 "static void\n"
6976 "usage(char *prog_name, char *msg)\n"
6977 "{\n"
6978 "    if (msg != NULL)\n"
6979 "        fputs(msg, stderr);\n"
6980 msgstr ""
6981 "static void\n"
6982 "usage(char *prog_name, char *msg)\n"
6983 "{\n"
6984 "    if (msg != NULL)\n"
6985 "        fputs(msg, stderr);\n"
6986
6987 #. type: Plain text
6988 #: build/C/man3/pthread_setschedparam.3:258
6989 #, no-wrap
6990 msgid ""
6991 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
6992 "    fprintf(stderr, \"Options are:\\en\");\n"
6993 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
6994 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
6995 "    fpe(\"                 thread attributes object\\en\");\n"
6996 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
6997 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
6998 "    fpe(\"                     r  SCHED_RR\\en\");\n"
6999 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
7000 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
7001 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
7002 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
7003 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
7004 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
7005 "    exit(EXIT_FAILURE);\n"
7006 "}\n"
7007 msgstr ""
7008 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
7009 "    fprintf(stderr, \"Options are:\\en\");\n"
7010 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
7011 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
7012 "    fpe(\"                 thread attributes object\\en\");\n"
7013 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
7014 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
7015 "    fpe(\"                     r  SCHED_RR\\en\");\n"
7016 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
7017 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
7018 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
7019 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
7020 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
7021 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
7022 "    exit(EXIT_FAILURE);\n"
7023 "}\n"
7024
7025 #. type: Plain text
7026 #: build/C/man3/pthread_setschedparam.3:269
7027 #, no-wrap
7028 msgid ""
7029 "static int\n"
7030 "get_policy(char p, int *policy)\n"
7031 "{\n"
7032 "    switch (p) {\n"
7033 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
7034 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
7035 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
7036 "    default:  return 0;\n"
7037 "    }\n"
7038 "}\n"
7039 msgstr ""
7040 "static int\n"
7041 "get_policy(char p, int *policy)\n"
7042 "{\n"
7043 "    switch (p) {\n"
7044 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
7045 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
7046 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
7047 "    default:  return 0;\n"
7048 "    }\n"
7049 "}\n"
7050
7051 #. type: Plain text
7052 #: build/C/man3/pthread_setschedparam.3:280
7053 #, no-wrap
7054 msgid ""
7055 "static void\n"
7056 "display_sched_attr(int policy, struct sched_param *param)\n"
7057 "{\n"
7058 "    printf(\"    policy=%s, priority=%d\\en\",\n"
7059 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
7060 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
7061 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
7062 "            \"???\",\n"
7063 "            param-E<gt>sched_priority);\n"
7064 "}\n"
7065 msgstr ""
7066 "static void\n"
7067 "display_sched_attr(int policy, struct sched_param *param)\n"
7068 "{\n"
7069 "    printf(\"    policy=%s, priority=%d\\en\",\n"
7070 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
7071 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
7072 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
7073 "            \"???\",\n"
7074 "            param-E<gt>sched_priority);\n"
7075 "}\n"
7076
7077 #. type: Plain text
7078 #: build/C/man3/pthread_setschedparam.3:286
7079 #, no-wrap
7080 msgid ""
7081 "static void\n"
7082 "display_thread_sched_attr(char *msg)\n"
7083 "{\n"
7084 "    int policy, s;\n"
7085 "    struct sched_param param;\n"
7086 msgstr ""
7087 "static void\n"
7088 "display_thread_sched_attr(char *msg)\n"
7089 "{\n"
7090 "    int policy, s;\n"
7091 "    struct sched_param param;\n"
7092
7093 #. type: Plain text
7094 #: build/C/man3/pthread_setschedparam.3:290
7095 #, no-wrap
7096 msgid ""
7097 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
7098 "    if (s != 0)\n"
7099 "        handle_error_en(s, \"pthread_getschedparam\");\n"
7100 msgstr ""
7101 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
7102 "    if (s != 0)\n"
7103 "        handle_error_en(s, \"pthread_getschedparam\");\n"
7104
7105 #. type: Plain text
7106 #: build/C/man3/pthread_setschedparam.3:294
7107 #, no-wrap
7108 msgid ""
7109 "    printf(\"%s\\en\", msg);\n"
7110 "    display_sched_attr(policy, &param);\n"
7111 "}\n"
7112 msgstr ""
7113 "    printf(\"%s\\en\", msg);\n"
7114 "    display_sched_attr(policy, &param);\n"
7115 "}\n"
7116
7117 #. type: Plain text
7118 #: build/C/man3/pthread_setschedparam.3:299
7119 #, no-wrap
7120 msgid ""
7121 "static void *\n"
7122 "thread_start(void *arg)\n"
7123 "{\n"
7124 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7125 msgstr ""
7126 "static void *\n"
7127 "thread_start(void *arg)\n"
7128 "{\n"
7129 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7130
7131 #. type: Plain text
7132 #: build/C/man3/pthread_setschedparam.3:302
7133 #, no-wrap
7134 msgid ""
7135 "    return NULL;\n"
7136 "}\n"
7137 msgstr ""
7138 "    return NULL;\n"
7139 "}\n"
7140
7141 #. type: Plain text
7142 #: build/C/man3/pthread_setschedparam.3:312
7143 #, no-wrap
7144 msgid ""
7145 "int\n"
7146 "main(int argc, char *argv[])\n"
7147 "{\n"
7148 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
7149 "    pthread_t thread;\n"
7150 "    pthread_attr_t attr;\n"
7151 "    pthread_attr_t *attrp;\n"
7152 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7153 "    struct sched_param param;\n"
7154 msgstr ""
7155 "int\n"
7156 "main(int argc, char *argv[])\n"
7157 "{\n"
7158 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
7159 "    pthread_t thread;\n"
7160 "    pthread_attr_t attr;\n"
7161 "    pthread_attr_t *attrp;\n"
7162 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7163 "    struct sched_param param;\n"
7164
7165 #. type: Plain text
7166 #: build/C/man3/pthread_setschedparam.3:314
7167 #, no-wrap
7168 msgid "    /* Process command-line options */\n"
7169 msgstr "    /* Process command-line options */\n"
7170
7171 #. type: Plain text
7172 #: build/C/man3/pthread_setschedparam.3:319
7173 #, no-wrap
7174 msgid ""
7175 "    use_null_attrib = 0;\n"
7176 "    attr_sched_str = NULL;\n"
7177 "    main_sched_str = NULL;\n"
7178 "    inheritsched_str = NULL;\n"
7179 msgstr ""
7180 "    use_null_attrib = 0;\n"
7181 "    attr_sched_str = NULL;\n"
7182 "    main_sched_str = NULL;\n"
7183 "    inheritsched_str = NULL;\n"
7184
7185 #. type: Plain text
7186 #: build/C/man3/pthread_setschedparam.3:329
7187 #, no-wrap
7188 msgid ""
7189 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7190 "        switch (opt) {\n"
7191 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
7192 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
7193 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
7194 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
7195 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
7196 "        }\n"
7197 "    }\n"
7198 msgstr ""
7199 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7200 "        switch (opt) {\n"
7201 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
7202 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
7203 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
7204 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
7205 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
7206 "        }\n"
7207 "    }\n"
7208
7209 #. type: Plain text
7210 #: build/C/man3/pthread_setschedparam.3:333
7211 #, no-wrap
7212 msgid ""
7213 "    if (use_null_attrib &&\n"
7214 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7215 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7216 msgstr ""
7217 "    if (use_null_attrib &&\n"
7218 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7219 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7220
7221 #. type: Plain text
7222 #: build/C/man3/pthread_setschedparam.3:336
7223 #, no-wrap
7224 msgid ""
7225 "    /* Optionally set scheduling attributes of main thread,\n"
7226 "       and display the attributes */\n"
7227 msgstr ""
7228 "    /* Optionally set scheduling attributes of main thread,\n"
7229 "       and display the attributes */\n"
7230
7231 #. type: Plain text
7232 #: build/C/man3/pthread_setschedparam.3:341
7233 #, no-wrap
7234 msgid ""
7235 "    if (main_sched_str != NULL) {\n"
7236 "        if (!get_policy(main_sched_str[0], &policy))\n"
7237 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
7238 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7239 msgstr ""
7240 "    if (main_sched_str != NULL) {\n"
7241 "        if (!get_policy(main_sched_str[0], &policy))\n"
7242 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
7243 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7244
7245 #. type: Plain text
7246 #: build/C/man3/pthread_setschedparam.3:346
7247 #, no-wrap
7248 msgid ""
7249 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
7250 "        if (s != 0)\n"
7251 "            handle_error_en(s, \"pthread_setschedparam\");\n"
7252 "    }\n"
7253 msgstr ""
7254 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
7255 "        if (s != 0)\n"
7256 "            handle_error_en(s, \"pthread_setschedparam\");\n"
7257 "    }\n"
7258
7259 #. type: Plain text
7260 #: build/C/man3/pthread_setschedparam.3:349
7261 #, no-wrap
7262 msgid ""
7263 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7264 "    printf(\"\\en\");\n"
7265 msgstr ""
7266 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7267 "    printf(\"\\en\");\n"
7268
7269 #. type: Plain text
7270 #: build/C/man3/pthread_setschedparam.3:351
7271 #, no-wrap
7272 msgid "    /* Initialize thread attributes object according to options */\n"
7273 msgstr "    /* Initialize thread attributes object according to options */\n"
7274
7275 #. type: Plain text
7276 #: build/C/man3/pthread_setschedparam.3:360
7277 #, no-wrap
7278 msgid ""
7279 "    if (!use_null_attrib) {\n"
7280 "        s = pthread_attr_init(&attr);\n"
7281 "        if (s != 0)\n"
7282 "            handle_error_en(s, \"pthread_attr_init\");\n"
7283 "        attrp = &attr;\n"
7284 "    }\n"
7285 msgstr ""
7286 "    if (!use_null_attrib) {\n"
7287 "        s = pthread_attr_init(&attr);\n"
7288 "        if (s != 0)\n"
7289 "            handle_error_en(s, \"pthread_attr_init\");\n"
7290 "        attrp = &attr;\n"
7291 "    }\n"
7292
7293 #. type: Plain text
7294 #: build/C/man3/pthread_setschedparam.3:368
7295 #, no-wrap
7296 msgid ""
7297 "    if (inheritsched_str != NULL) {\n"
7298 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7299 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7300 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7301 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
7302 "        else\n"
7303 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7304 msgstr ""
7305 "    if (inheritsched_str != NULL) {\n"
7306 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7307 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7308 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7309 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
7310 "        else\n"
7311 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7312
7313 #. type: Plain text
7314 #: build/C/man3/pthread_setschedparam.3:373
7315 #, no-wrap
7316 msgid ""
7317 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7318 "        if (s != 0)\n"
7319 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7320 "    }\n"
7321 msgstr ""
7322 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7323 "        if (s != 0)\n"
7324 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7325 "    }\n"
7326
7327 #. type: Plain text
7328 #: build/C/man3/pthread_setschedparam.3:379
7329 #, no-wrap
7330 msgid ""
7331 "    if (attr_sched_str != NULL) {\n"
7332 "        if (!get_policy(attr_sched_str[0], &policy))\n"
7333 "            usage(argv[0],\n"
7334 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7335 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7336 msgstr ""
7337 "    if (attr_sched_str != NULL) {\n"
7338 "        if (!get_policy(attr_sched_str[0], &policy))\n"
7339 "            usage(argv[0],\n"
7340 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7341 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7342
7343 #. type: Plain text
7344 #: build/C/man3/pthread_setschedparam.3:387
7345 #, no-wrap
7346 msgid ""
7347 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
7348 "        if (s != 0)\n"
7349 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7350 "        s = pthread_attr_setschedparam(&attr, &param);\n"
7351 "        if (s != 0)\n"
7352 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7353 "    }\n"
7354 msgstr ""
7355 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
7356 "        if (s != 0)\n"
7357 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7358 "        s = pthread_attr_setschedparam(&attr, &param);\n"
7359 "        if (s != 0)\n"
7360 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7361 "    }\n"
7362
7363 #. type: Plain text
7364 #: build/C/man3/pthread_setschedparam.3:390
7365 #, no-wrap
7366 msgid ""
7367 "    /* If we initialized a thread attributes object, display\n"
7368 "       the scheduling attributes that were set in the object */\n"
7369 msgstr ""
7370 "    /* If we initialized a thread attributes object, display\n"
7371 "       the scheduling attributes that were set in the object */\n"
7372
7373 #. type: Plain text
7374 #: build/C/man3/pthread_setschedparam.3:398
7375 #, no-wrap
7376 msgid ""
7377 "    if (attrp != NULL) {\n"
7378 "        s = pthread_attr_getschedparam(&attr, &param);\n"
7379 "        if (s != 0)\n"
7380 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7381 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7382 "        if (s != 0)\n"
7383 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7384 msgstr ""
7385 "    if (attrp != NULL) {\n"
7386 "        s = pthread_attr_getschedparam(&attr, &param);\n"
7387 "        if (s != 0)\n"
7388 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7389 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7390 "        if (s != 0)\n"
7391 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7392
7393 #. type: Plain text
7394 #: build/C/man3/pthread_setschedparam.3:401
7395 #, no-wrap
7396 msgid ""
7397 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7398 "        display_sched_attr(policy, &param);\n"
7399 msgstr ""
7400 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7401 "        display_sched_attr(policy, &param);\n"
7402
7403 #. type: Plain text
7404 #: build/C/man3/pthread_setschedparam.3:409
7405 #, no-wrap
7406 msgid ""
7407 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7408 "        printf(\"    inheritsched is %s\\en\",\n"
7409 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
7410 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7411 "                \"???\");\n"
7412 "        printf(\"\\en\");\n"
7413 "    }\n"
7414 msgstr ""
7415 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7416 "        printf(\"    inheritsched is %s\\en\",\n"
7417 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
7418 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7419 "                \"???\");\n"
7420 "        printf(\"\\en\");\n"
7421 "    }\n"
7422
7423 #. type: Plain text
7424 #: build/C/man3/pthread_setschedparam.3:411
7425 #, no-wrap
7426 msgid "    /* Create a thread that will display its scheduling attributes */\n"
7427 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
7428
7429 #. type: Plain text
7430 #: build/C/man3/pthread_setschedparam.3:415
7431 #, no-wrap
7432 msgid ""
7433 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7434 "    if (s != 0)\n"
7435 "        handle_error_en(s, \"pthread_create\");\n"
7436 msgstr ""
7437 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7438 "    if (s != 0)\n"
7439 "        handle_error_en(s, \"pthread_create\");\n"
7440
7441 #. type: Plain text
7442 #: build/C/man3/pthread_setschedparam.3:417
7443 #, no-wrap
7444 msgid "    /* Destroy unneeded thread attributes object */\n"
7445 msgstr "    /* Destroy unneeded thread attributes object */\n"
7446
7447 #. type: Plain text
7448 #: build/C/man3/pthread_setschedparam.3:425
7449 #, no-wrap
7450 msgid ""
7451 "    s = pthread_join(thread, NULL);\n"
7452 "    if (s != 0)\n"
7453 "        handle_error_en(s, \"pthread_join\");\n"
7454 msgstr ""
7455 "    s = pthread_join(thread, NULL);\n"
7456 "    if (s != 0)\n"
7457 "        handle_error_en(s, \"pthread_join\");\n"
7458
7459 #. type: Plain text
7460 #: build/C/man3/pthread_setschedparam.3:441
7461 msgid ""
7462 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7463 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7464 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7465 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
7466 "B<pthreads>(7)"
7467 msgstr ""
7468 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7469 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7470 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7471 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
7472 "B<pthreads>(7)"
7473
7474 #. type: TH
7475 #: build/C/man3/pthread_setschedprio.3:24
7476 #, no-wrap
7477 msgid "PTHREAD_SETSCHEDPRIO"
7478 msgstr "PTHREAD_SETSCHEDPRIO"
7479
7480 #. type: TH
7481 #: build/C/man3/pthread_setschedprio.3:24
7482 #, no-wrap
7483 msgid "2008-11-06"
7484 msgstr "2008-11-06"
7485
7486 #. type: Plain text
7487 #: build/C/man3/pthread_setschedprio.3:27
7488 msgid "pthread_setschedprio - set scheduling priority of a thread"
7489 msgstr ""
7490
7491 #. type: Plain text
7492 #: build/C/man3/pthread_setschedprio.3:32
7493 #, no-wrap
7494 msgid "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
7495 msgstr "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
7496
7497 #.  FIXME . nptl/pthread_setschedprio.c has the following
7498 #.    /* If the thread should have higher priority because of some
7499 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
7500 #.  Eventually (perhaps after writing the mutexattr pages), we
7501 #.  may want to add something on the topic to this page.
7502 #.  nptl/pthread_setschedparam.c has a similar case.
7503 #. type: Plain text
7504 #: build/C/man3/pthread_setschedprio.3:51
7505 msgid ""
7506 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
7507 "thread I<thread> to the value specified in I<prio>.  (By contrast "
7508 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
7509 "of a thread.)"
7510 msgstr ""
7511
7512 #. type: Plain text
7513 #: build/C/man3/pthread_setschedprio.3:59
7514 msgid ""
7515 "On success, this function returns 0; on error, it returns a nonzero error "
7516 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
7517 "I<thread> is not changed."
7518 msgstr ""
7519
7520 #. type: Plain text
7521 #: build/C/man3/pthread_setschedprio.3:64
7522 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
7523 msgstr ""
7524
7525 #. type: Plain text
7526 #: build/C/man3/pthread_setschedprio.3:68
7527 msgid ""
7528 "The caller does not have appropriate privileges to set the specified "
7529 "priority."
7530 msgstr ""
7531
7532 #. type: Plain text
7533 #: build/C/man3/pthread_setschedprio.3:79
7534 msgid ""
7535 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
7536 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
7537 msgstr ""
7538
7539 #. type: Plain text
7540 #: build/C/man3/pthread_setschedprio.3:81
7541 msgid "This function is available in glibc since version 2.3.4."
7542 msgstr ""
7543
7544 #. type: Plain text
7545 #: build/C/man3/pthread_setschedprio.3:89
7546 msgid ""
7547 "For a description of the permissions required to, and the effect of, "
7548 "changing a thread's scheduling priority, and details of the permitted ranges "
7549 "for priorities in each scheduling policy, see B<sched_setscheduler>(2)."
7550 msgstr ""
7551
7552 #. type: Plain text
7553 #: build/C/man3/pthread_setschedprio.3:101
7554 msgid ""
7555 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7556 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7557 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7558 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
7559 "B<pthreads>(7)"
7560 msgstr ""
7561 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7562 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7563 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7564 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
7565 "B<pthreads>(7)"
7566
7567 #. type: TH
7568 #: build/C/man3/pthread_sigmask.3:24
7569 #, no-wrap
7570 msgid "PTHREAD_SIGMASK"
7571 msgstr "PTHREAD_SIGMASK"
7572
7573 #. type: TH
7574 #: build/C/man3/pthread_sigmask.3:24
7575 #, no-wrap
7576 msgid "2011-10-16"
7577 msgstr "2011-10-16"
7578
7579 #. type: Plain text
7580 #: build/C/man3/pthread_sigmask.3:27
7581 msgid "pthread_sigmask - examine and change mask of blocked signals"
7582 msgstr ""
7583
7584 #. type: Plain text
7585 #: build/C/man3/pthread_sigmask.3:33
7586 #, no-wrap
7587 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
7588 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
7589
7590 #. type: Plain text
7591 #: build/C/man3/pthread_sigmask.3:44
7592 msgid ""
7593 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
7594 "difference that its use in multithreaded programs is explicitly specified by "
7595 "POSIX.1-2001.  Other differences are noted in this page."
7596 msgstr ""
7597
7598 #. type: Plain text
7599 #: build/C/man3/pthread_sigmask.3:47
7600 msgid ""
7601 "For a description of the arguments and operation of this function, see "
7602 "B<sigprocmask>(2)."
7603 msgstr ""
7604
7605 #. type: Plain text
7606 #: build/C/man3/pthread_sigmask.3:52
7607 msgid ""
7608 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
7609 "number."
7610 msgstr ""
7611
7612 #. type: Plain text
7613 #: build/C/man3/pthread_sigmask.3:55
7614 msgid "See B<sigprocmask>(2)."
7615 msgstr ""
7616
7617 #. type: Plain text
7618 #: build/C/man3/pthread_sigmask.3:59
7619 msgid "A new thread inherits a copy of its creator's signal mask."
7620 msgstr ""
7621
7622 #. type: Plain text
7623 #: build/C/man3/pthread_sigmask.3:64
7624 msgid ""
7625 "The program below blocks some signals in the main thread, and then creates a "
7626 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
7627 "shell session demonstrates its use:"
7628 msgstr ""
7629
7630 #. type: Plain text
7631 #: build/C/man3/pthread_sigmask.3:75
7632 #, no-wrap
7633 msgid ""
7634 "$B< ./a.out &>\n"
7635 "[1] 5423\n"
7636 "$B< kill -QUIT %1>\n"
7637 "Signal handling thread got signal 3\n"
7638 "$B< kill -USR1 %1>\n"
7639 "Signal handling thread got signal 10\n"
7640 "$B< kill -TERM %1>\n"
7641 "[1]+  Terminated              ./a.out\n"
7642 msgstr ""
7643 "$B< ./a.out &>\n"
7644 "[1] 5423\n"
7645 "$B< kill -QUIT %1>\n"
7646 "Signal handling thread got signal 3\n"
7647 "$B< kill -USR1 %1>\n"
7648 "Signal handling thread got signal 10\n"
7649 "$B< kill -TERM %1>\n"
7650 "[1]+  Terminated              ./a.out\n"
7651
7652 #. type: Plain text
7653 #: build/C/man3/pthread_sigmask.3:86
7654 #, no-wrap
7655 msgid ""
7656 "#include E<lt>pthread.hE<gt>\n"
7657 "#include E<lt>stdio.hE<gt>\n"
7658 "#include E<lt>stdlib.hE<gt>\n"
7659 "#include E<lt>unistd.hE<gt>\n"
7660 "#include E<lt>signal.hE<gt>\n"
7661 "#include E<lt>errno.hE<gt>\n"
7662 msgstr ""
7663 "#include E<lt>pthread.hE<gt>\n"
7664 "#include E<lt>stdio.hE<gt>\n"
7665 "#include E<lt>stdlib.hE<gt>\n"
7666 "#include E<lt>unistd.hE<gt>\n"
7667 "#include E<lt>signal.hE<gt>\n"
7668 "#include E<lt>errno.hE<gt>\n"
7669
7670 #. type: Plain text
7671 #: build/C/man3/pthread_sigmask.3:88
7672 #, no-wrap
7673 msgid "/* Simple error handling functions */\n"
7674 msgstr "/* Simple error handling functions */\n"
7675
7676 #. type: Plain text
7677 #: build/C/man3/pthread_sigmask.3:97
7678 #, no-wrap
7679 msgid ""
7680 "static void *\n"
7681 "sig_thread(void *arg)\n"
7682 "{\n"
7683 "    sigset_t *set = (sigset_t *) arg;\n"
7684 "    int s, sig;\n"
7685 msgstr ""
7686 "static void *\n"
7687 "sig_thread(void *arg)\n"
7688 "{\n"
7689 "    sigset_t *set = (sigset_t *) arg;\n"
7690 "    int s, sig;\n"
7691
7692 #. type: Plain text
7693 #: build/C/man3/pthread_sigmask.3:105
7694 #, no-wrap
7695 msgid ""
7696 "    for (;;) {\n"
7697 "        s = sigwait(set, &sig);\n"
7698 "        if (s != 0)\n"
7699 "            handle_error_en(s, \"sigwait\");\n"
7700 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
7701 "    }\n"
7702 "}\n"
7703 msgstr ""
7704 "    for (;;) {\n"
7705 "        s = sigwait(set, &sig);\n"
7706 "        if (s != 0)\n"
7707 "            handle_error_en(s, \"sigwait\");\n"
7708 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
7709 "    }\n"
7710 "}\n"
7711
7712 #. type: Plain text
7713 #: build/C/man3/pthread_sigmask.3:112
7714 #, no-wrap
7715 msgid ""
7716 "int\n"
7717 "main(int argc, char *argv[])\n"
7718 "{\n"
7719 "    pthread_t thread;\n"
7720 "    sigset_t set;\n"
7721 "    int s;\n"
7722 msgstr ""
7723 "int\n"
7724 "main(int argc, char *argv[])\n"
7725 "{\n"
7726 "    pthread_t thread;\n"
7727 "    sigset_t set;\n"
7728 "    int s;\n"
7729
7730 #. type: Plain text
7731 #: build/C/man3/pthread_sigmask.3:115
7732 #, no-wrap
7733 msgid ""
7734 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
7735 "       will inherit a copy of the signal mask. */\n"
7736 msgstr ""
7737 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
7738 "       will inherit a copy of the signal mask. */\n"
7739
7740 #. type: Plain text
7741 #: build/C/man3/pthread_sigmask.3:122
7742 #, no-wrap
7743 msgid ""
7744 "    sigemptyset(&set);\n"
7745 "    sigaddset(&set, SIGQUIT);\n"
7746 "    sigaddset(&set, SIGUSR1);\n"
7747 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
7748 "    if (s != 0)\n"
7749 "        handle_error_en(s, \"pthread_sigmask\");\n"
7750 msgstr ""
7751 "    sigemptyset(&set);\n"
7752 "    sigaddset(&set, SIGQUIT);\n"
7753 "    sigaddset(&set, SIGUSR1);\n"
7754 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
7755 "    if (s != 0)\n"
7756 "        handle_error_en(s, \"pthread_sigmask\");\n"
7757
7758 #. type: Plain text
7759 #: build/C/man3/pthread_sigmask.3:126
7760 #, no-wrap
7761 msgid ""
7762 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
7763 "    if (s != 0)\n"
7764 "        handle_error_en(s, \"pthread_create\");\n"
7765 msgstr ""
7766 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
7767 "    if (s != 0)\n"
7768 "        handle_error_en(s, \"pthread_create\");\n"
7769
7770 #. type: Plain text
7771 #: build/C/man3/pthread_sigmask.3:129
7772 #, no-wrap
7773 msgid ""
7774 "    /* Main thread carries on to create other threads and/or do\n"
7775 "       other work */\n"
7776 msgstr ""
7777 "    /* Main thread carries on to create other threads and/or do\n"
7778 "       other work */\n"
7779
7780 #. type: Plain text
7781 #: build/C/man3/pthread_sigmask.3:132
7782 #, no-wrap
7783 msgid ""
7784 "    pause();            /* Dummy pause so we can test program */\n"
7785 "}\n"
7786 msgstr ""
7787 "    pause();            /* Dummy pause so we can test program */\n"
7788 "}\n"
7789
7790 #. type: Plain text
7791 #: build/C/man3/pthread_sigmask.3:142
7792 msgid ""
7793 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), "
7794 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
7795 msgstr ""
7796 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), "
7797 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
7798
7799 #. type: TH
7800 #: build/C/man3/pthread_sigqueue.3:23
7801 #, no-wrap
7802 msgid "PTHREAD_SIGQUEUE"
7803 msgstr "PTHREAD_SIGQUEUE"
7804
7805 #. type: TH
7806 #: build/C/man3/pthread_sigqueue.3:23
7807 #, no-wrap
7808 msgid "2011-09-23"
7809 msgstr "2011-09-23"
7810
7811 #. type: Plain text
7812 #: build/C/man3/pthread_sigqueue.3:26
7813 msgid "pthread_sigqueue - queue a signal and data to a thread"
7814 msgstr ""
7815
7816 #. type: Plain text
7817 #: build/C/man3/pthread_sigqueue.3:32
7818 #, no-wrap
7819 msgid ""
7820 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
7821 "B<                     const union sigval >I<value>B<);>\n"
7822 msgstr ""
7823 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
7824 "B<                     const union sigval >I<value>B<);>\n"
7825
7826 #. type: Plain text
7827 #: build/C/man3/pthread_sigqueue.3:43
7828 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
7829 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
7830
7831 #. type: Plain text
7832 #: build/C/man3/pthread_sigqueue.3:51
7833 msgid ""
7834 "The B<pthread_sigqueue>()  function performs a similar task to B<sigqueue>"
7835 "(3), but, rather than sending a signal to another process, it sends a signal "
7836 "to another thread in the same process as the calling thread."
7837 msgstr ""
7838
7839 #. type: Plain text
7840 #: build/C/man3/pthread_sigqueue.3:63
7841 msgid ""
7842 "The I<thread> argument is the ID of another thread in the same process as "
7843 "the caller.  The I<sig> argument specifies the signal to be sent.  The "
7844 "I<value> argument specifies data to accompany the signal; see B<sigqueue>"
7845 "(3)  for details."
7846 msgstr ""
7847
7848 #. type: Plain text
7849 #: build/C/man3/pthread_sigqueue.3:68
7850 msgid ""
7851 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
7852 "number."
7853 msgstr ""
7854
7855 #. type: Plain text
7856 #: build/C/man3/pthread_sigqueue.3:75
7857 msgid ""
7858 "The limit of signals which may be queued has been reached.  (See B<signal>"
7859 "(7)  for further information.)"
7860 msgstr ""
7861
7862 #. type: Plain text
7863 #: build/C/man3/pthread_sigqueue.3:79
7864 msgid "I<sig> was invalid."
7865 msgstr ""
7866
7867 #. type: TP
7868 #: build/C/man3/pthread_sigqueue.3:79
7869 #, no-wrap
7870 msgid "B<ENOSYS>"
7871 msgstr "B<ENOSYS>"
7872
7873 #. type: Plain text
7874 #: build/C/man3/pthread_sigqueue.3:83
7875 msgid "B<pthread_sigqueue>()  is not supported on this system."
7876 msgstr ""
7877
7878 #. type: Plain text
7879 #: build/C/man3/pthread_sigqueue.3:87
7880 msgid "I<thread> is not valid."
7881 msgstr ""
7882
7883 #. type: Plain text
7884 #: build/C/man3/pthread_sigqueue.3:91
7885 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
7886 msgstr ""
7887
7888 #. type: Plain text
7889 #: build/C/man3/pthread_sigqueue.3:93
7890 msgid "This function is a GNU extension."
7891 msgstr ""
7892
7893 #. type: Plain text
7894 #: build/C/man3/pthread_sigqueue.3:101
7895 msgid ""
7896 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), B<sigqueue>"
7897 "(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
7898 msgstr ""
7899 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
7900 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
7901
7902 #. type: TH
7903 #: build/C/man3/pthread_testcancel.3:24
7904 #, no-wrap
7905 msgid "PTHREAD_TESTCANCEL"
7906 msgstr "PTHREAD_TESTCANCEL"
7907
7908 #. type: Plain text
7909 #: build/C/man3/pthread_testcancel.3:27
7910 msgid ""
7911 "pthread_testcancel - request delivery of any pending cancellation request"
7912 msgstr ""
7913
7914 #. type: Plain text
7915 #: build/C/man3/pthread_testcancel.3:32
7916 #, no-wrap
7917 msgid "B<void pthread_testcancel(void);>\n"
7918 msgstr "B<void pthread_testcancel(void);>\n"
7919
7920 #. type: Plain text
7921 #: build/C/man3/pthread_testcancel.3:41
7922 msgid ""
7923 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
7924 "calling thread, so that a thread that is otherwise executing code that "
7925 "contains no cancellation points will respond to a cancellation request."
7926 msgstr ""
7927
7928 #. type: Plain text
7929 #: build/C/man3/pthread_testcancel.3:48
7930 msgid ""
7931 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
7932 "cancellation request is pending, then a call to B<pthread_cancel>(3)  has no "
7933 "effect."
7934 msgstr ""
7935
7936 #. type: Plain text
7937 #: build/C/man3/pthread_testcancel.3:52
7938 msgid ""
7939 "This function does not return a value.  If the calling thread is canceled as "
7940 "a consequence of a call to this function, then the function does not return."
7941 msgstr ""
7942
7943 #. type: Plain text
7944 #: build/C/man3/pthread_testcancel.3:61
7945 msgid "See B<pthread_cleanup_push>(3)."
7946 msgstr ""
7947
7948 #. type: Plain text
7949 #: build/C/man3/pthread_testcancel.3:66
7950 msgid ""
7951 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
7952 "(3), B<pthreads>(7)"
7953 msgstr ""
7954 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
7955 "(3), B<pthreads>(7)"
7956
7957 #. type: TH
7958 #: build/C/man3/pthread_tryjoin_np.3:24
7959 #, no-wrap
7960 msgid "PTHREAD_TRYJOIN_NP"
7961 msgstr "PTHREAD_TRYJOIN_NP"
7962
7963 #. type: Plain text
7964 #: build/C/man3/pthread_tryjoin_np.3:28
7965 msgid ""
7966 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
7967 "thread"
7968 msgstr ""
7969
7970 #. type: Plain text
7971 #: build/C/man3/pthread_tryjoin_np.3:34
7972 #, no-wrap
7973 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
7974 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
7975
7976 #. type: Plain text
7977 #: build/C/man3/pthread_tryjoin_np.3:37
7978 #, no-wrap
7979 msgid ""
7980 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
7981 "B<                         const struct timespec *>I<abstime>B<);>\n"
7982 msgstr ""
7983 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
7984 "B<                         const struct timespec *>I<abstime>B<);>\n"
7985
7986 #. type: Plain text
7987 #: build/C/man3/pthread_tryjoin_np.3:44
7988 msgid ""
7989 "These functions operate in the same way as B<pthread_join>(3), except for "
7990 "the differences described on this page."
7991 msgstr ""
7992
7993 #. type: Plain text
7994 #: build/C/man3/pthread_tryjoin_np.3:56
7995 msgid ""
7996 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
7997 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
7998 "I<thread> has not yet terminated, then instead of blocking, as is done by "
7999 "B<pthread_join>(3), the call returns an error."
8000 msgstr ""
8001
8002 #. type: Plain text
8003 #: build/C/man3/pthread_tryjoin_np.3:74
8004 msgid ""
8005 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
8006 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
8007 "specified in I<abstime>.  If the timeout expires before I<thread> "
8008 "terminates, the call returns an error.  The I<abstime> argument is a "
8009 "structure of the following form, specifying an absolute time measured since "
8010 "the Epoch (see B<time>(2)):"
8011 msgstr ""
8012
8013 #. type: Plain text
8014 #: build/C/man3/pthread_tryjoin_np.3:81
8015 #, no-wrap
8016 msgid ""
8017 "struct timespec {\n"
8018 "    time_t tv_sec;     /* seconds */\n"
8019 "    long   tv_nsec;    /* nanoseconds */\n"
8020 "};\n"
8021 msgstr ""
8022 "struct timespec {\n"
8023 "    time_t tv_sec;     /* seconds */\n"
8024 "    long   tv_nsec;    /* nanoseconds */\n"
8025 "};\n"
8026
8027 #. type: Plain text
8028 #: build/C/man3/pthread_tryjoin_np.3:87
8029 msgid ""
8030 "On success, these functions return 0; on error, they return an error number."
8031 msgstr ""
8032
8033 #. type: Plain text
8034 #: build/C/man3/pthread_tryjoin_np.3:92
8035 msgid ""
8036 "These functions can fail with the same errors as B<pthread_join>(3).  "
8037 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
8038 msgstr ""
8039
8040 #. type: TP
8041 #: build/C/man3/pthread_tryjoin_np.3:92
8042 #, no-wrap
8043 msgid "B<EBUSY>"
8044 msgstr "B<EBUSY>"
8045
8046 #. type: Plain text
8047 #: build/C/man3/pthread_tryjoin_np.3:96
8048 msgid "I<thread> had not yet terminated at the time of the call."
8049 msgstr ""
8050
8051 #. type: Plain text
8052 #: build/C/man3/pthread_tryjoin_np.3:99
8053 msgid ""
8054 "B<pthread_timedjoin_np>()  can in addition fail with the following error:"
8055 msgstr ""
8056
8057 #. type: TP
8058 #: build/C/man3/pthread_tryjoin_np.3:99
8059 #, no-wrap
8060 msgid "B<ETIMEDOUT>"
8061 msgstr "B<ETIMEDOUT>"
8062
8063 #. type: Plain text
8064 #: build/C/man3/pthread_tryjoin_np.3:104
8065 msgid "The call timed out before I<thread> terminated."
8066 msgstr ""
8067
8068 #. type: Plain text
8069 #: build/C/man3/pthread_tryjoin_np.3:108
8070 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
8071 msgstr ""
8072
8073 #. type: Plain text
8074 #: build/C/man3/pthread_tryjoin_np.3:110
8075 msgid "These functions first appeared in glibc in version 2.3.3."
8076 msgstr ""
8077
8078 #. type: Plain text
8079 #: build/C/man3/pthread_tryjoin_np.3:115
8080 msgid "The following code waits to join for up to 5 seconds:"
8081 msgstr ""
8082
8083 #. type: Plain text
8084 #: build/C/man3/pthread_tryjoin_np.3:119
8085 #, no-wrap
8086 msgid ""
8087 "    struct timespec ts;\n"
8088 "    int s;\n"
8089 msgstr ""
8090 "    struct timespec ts;\n"
8091 "    int s;\n"
8092
8093 #. type: Plain text
8094 #: build/C/man3/pthread_tryjoin_np.3:121
8095 #, no-wrap
8096 msgid "    ...\n"
8097 msgstr "    ...\n"
8098
8099 #. type: Plain text
8100 #: build/C/man3/pthread_tryjoin_np.3:125
8101 #, no-wrap
8102 msgid ""
8103 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8104 "\t/* Handle error */\n"
8105 "    }\n"
8106 msgstr ""
8107 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8108 "\t/* Handle error */\n"
8109 "    }\n"
8110
8111 #. type: Plain text
8112 #: build/C/man3/pthread_tryjoin_np.3:127
8113 #, no-wrap
8114 msgid "    ts.tv_sec += 5;\n"
8115 msgstr "    ts.tv_sec += 5;\n"
8116
8117 #. type: Plain text
8118 #: build/C/man3/pthread_tryjoin_np.3:132
8119 #, no-wrap
8120 msgid ""
8121 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8122 "    if (s != 0) {\n"
8123 "        /* Handle error */\n"
8124 "    }\n"
8125 msgstr ""
8126 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8127 "    if (s != 0) {\n"
8128 "        /* Handle error */\n"
8129 "    }\n"
8130
8131 #. type: Plain text
8132 #: build/C/man3/pthread_tryjoin_np.3:138
8133 msgid ""
8134 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8135 msgstr ""
8136 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8137
8138 #. type: TH
8139 #: build/C/man3/pthread_yield.3:23
8140 #, no-wrap
8141 msgid "PTHREAD_YIELD"
8142 msgstr "PTHREAD_YIELD"
8143
8144 #. type: Plain text
8145 #: build/C/man3/pthread_yield.3:26
8146 msgid "pthread_yield - yield the processor"
8147 msgstr ""
8148
8149 #. type: Plain text
8150 #: build/C/man3/pthread_yield.3:31
8151 #, no-wrap
8152 msgid "B<int pthread_yield(void);>\n"
8153 msgstr "B<int pthread_yield(void);>\n"
8154
8155 #. type: Plain text
8156 #: build/C/man3/pthread_yield.3:41
8157 msgid ""
8158 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
8159 "thread is placed at the end of the run queue for its static priority and "
8160 "another thread is scheduled to run.  For further details, see B<sched_yield>"
8161 "(2)"
8162 msgstr ""
8163
8164 #. type: Plain text
8165 #: build/C/man3/pthread_yield.3:46
8166 msgid ""
8167 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
8168 "number."
8169 msgstr ""
8170
8171 #. type: Plain text
8172 #: build/C/man3/pthread_yield.3:50
8173 msgid ""
8174 "On Linux, this call always succeeds (but portable and future-proof "
8175 "applications should nevertheless handle a possible error return)."
8176 msgstr ""
8177
8178 #.  e.g., the BSDs, Tru64, AIX, and Irix.
8179 #. type: Plain text
8180 #: build/C/man3/pthread_yield.3:56
8181 msgid ""
8182 "This call is nonstandard, but present on several other systems.  Use the "
8183 "standardized B<sched_yield>(2)  instead."
8184 msgstr ""
8185
8186 #. type: Plain text
8187 #: build/C/man3/pthread_yield.3:59
8188 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
8189 msgstr ""
8190
8191 #. type: Plain text
8192 #: build/C/man3/pthread_yield.3:63
8193 msgid "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
8194 msgstr "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
8195
8196 #. type: TH
8197 #: build/C/man7/pthreads.7:24
8198 #, no-wrap
8199 msgid "PTHREADS"
8200 msgstr "PTHREADS"
8201
8202 #. type: TH
8203 #: build/C/man7/pthreads.7:24
8204 #, no-wrap
8205 msgid "2010-11-14"
8206 msgstr "2010-11-14"
8207
8208 #. type: Plain text
8209 #: build/C/man7/pthreads.7:27
8210 msgid "pthreads - POSIX threads"
8211 msgstr "pthreads - POSIX スレッド"
8212
8213 #. type: Plain text
8214 #: build/C/man7/pthreads.7:34
8215 msgid ""
8216 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
8217 "programming commonly known as POSIX threads, or Pthreads.  A single process "
8218 "can contain multiple threads, all of which are executing the same program.  "
8219 "These threads share the same global memory (data and heap segments), but "
8220 "each thread has its own stack (automatic variables)."
8221 msgstr ""
8222 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
8223 "ラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロ"
8224 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
8225 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
8226 "スレッドは自分専用のスタック (自動変数) を持つ。"
8227
8228 #. type: Plain text
8229 #: build/C/man7/pthreads.7:37
8230 msgid ""
8231 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
8232 "these attributes are process-wide rather than per-thread):"
8233 msgstr ""
8234 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
8235 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
8236
8237 #. type: IP
8238 #: build/C/man7/pthreads.7:37 build/C/man7/pthreads.7:39
8239 #: build/C/man7/pthreads.7:41 build/C/man7/pthreads.7:43
8240 #: build/C/man7/pthreads.7:45 build/C/man7/pthreads.7:47
8241 #: build/C/man7/pthreads.7:49 build/C/man7/pthreads.7:52
8242 #: build/C/man7/pthreads.7:54 build/C/man7/pthreads.7:57
8243 #: build/C/man7/pthreads.7:63 build/C/man7/pthreads.7:68
8244 #: build/C/man7/pthreads.7:71 build/C/man7/pthreads.7:74
8245 #: build/C/man7/pthreads.7:82 build/C/man7/pthreads.7:86
8246 #: build/C/man7/pthreads.7:89 build/C/man7/pthreads.7:93
8247 #: build/C/man7/pthreads.7:96 build/C/man7/pthreads.7:103
8248 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
8249 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
8250 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
8251 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
8252 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
8253 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
8254 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
8255 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
8256 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
8257 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
8258 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
8259 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
8260 #: build/C/man7/pthreads.7:833
8261 #, no-wrap
8262 msgid "-"
8263 msgstr "-"
8264
8265 #. type: Plain text
8266 #: build/C/man7/pthreads.7:39
8267 msgid "process ID"
8268 msgstr "プロセス ID"
8269
8270 #. type: Plain text
8271 #: build/C/man7/pthreads.7:41
8272 msgid "parent process ID"
8273 msgstr "親プロセス ID"
8274
8275 #. type: Plain text
8276 #: build/C/man7/pthreads.7:43
8277 msgid "process group ID and session ID"
8278 msgstr "プロセスグループ ID とセッション ID"
8279
8280 #. type: Plain text
8281 #: build/C/man7/pthreads.7:45
8282 msgid "controlling terminal"
8283 msgstr "制御端末"
8284
8285 #. type: Plain text
8286 #: build/C/man7/pthreads.7:47
8287 msgid "user and group IDs"
8288 msgstr "ユーザ ID とグループ ID"
8289
8290 #. type: Plain text
8291 #: build/C/man7/pthreads.7:49
8292 msgid "open file descriptors"
8293 msgstr "オープンするファイルディスクリプタ"
8294
8295 #. type: Plain text
8296 #: build/C/man7/pthreads.7:52
8297 msgid "record locks (see B<fcntl>(2))"
8298 msgstr "レコードのロック (B<fcntl>(3)  参照)"
8299
8300 #. type: Plain text
8301 #: build/C/man7/pthreads.7:54
8302 msgid "signal dispositions"
8303 msgstr "シグナルの配置"
8304
8305 #. type: Plain text
8306 #: build/C/man7/pthreads.7:57
8307 msgid "file mode creation mask (B<umask>(2))"
8308 msgstr "ファイルモード作成マスク (B<umask>(2))"
8309
8310 #. type: Plain text
8311 #: build/C/man7/pthreads.7:63
8312 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
8313 msgstr ""
8314 "カレント・ディレクトリ (B<chdir>(2))  とルート・ディレクトリ (B<chroot>(2))"
8315
8316 #. type: Plain text
8317 #: build/C/man7/pthreads.7:68
8318 msgid ""
8319 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
8320 msgstr ""
8321 "インターバル・タイマ (B<setitimer>(2))  と POSIX タイマ (B<timer_create>(2))"
8322
8323 #. type: Plain text
8324 #: build/C/man7/pthreads.7:71
8325 msgid "nice value (B<setpriority>(2))"
8326 msgstr "nice 値 (B<setpriority>(2))"
8327
8328 #. type: Plain text
8329 #: build/C/man7/pthreads.7:74
8330 msgid "resource limits (B<setrlimit>(2))"
8331 msgstr "リソース制限 (B<setrlimit>(2))"
8332
8333 #. type: Plain text
8334 #: build/C/man7/pthreads.7:79
8335 msgid ""
8336 "measurements of the consumption of CPU time (B<times>(2))  and resources "
8337 "(B<getrusage>(2))"
8338 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
8339
8340 #. type: Plain text
8341 #: build/C/man7/pthreads.7:82
8342 msgid ""
8343 "As well as the stack, POSIX.1 specifies that various other attributes are "
8344 "distinct for each thread, including:"
8345 msgstr ""
8346 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
8347 "るかを規定している:"
8348
8349 #. type: Plain text
8350 #: build/C/man7/pthreads.7:86
8351 msgid "thread ID (the I<pthread_t> data type)"
8352 msgstr "スレッド ID (B<pthread_t> データ型)"
8353
8354 #. type: Plain text
8355 #: build/C/man7/pthreads.7:89
8356 msgid "signal mask (B<pthread_sigmask>(3))"
8357 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
8358
8359 #. type: Plain text
8360 #: build/C/man7/pthreads.7:93
8361 msgid "the I<errno> variable"
8362 msgstr "I<errno> 変数"
8363
8364 #. type: Plain text
8365 #: build/C/man7/pthreads.7:96
8366 msgid "alternate signal stack (B<sigaltstack>(2))"
8367 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
8368
8369 #. type: Plain text
8370 #: build/C/man7/pthreads.7:101
8371 msgid ""
8372 "real-time scheduling policy and priority (B<sched_setscheduler>(2)  and "
8373 "B<sched_setparam>(2))"
8374 msgstr ""
8375 "リアルタイム・スケジューリングのポリシーと優先度 (B<sched_setscheduler>(2)  "
8376 "と B<sched_setparam>(2))"
8377
8378 #. type: Plain text
8379 #: build/C/man7/pthreads.7:103
8380 msgid "The following Linux-specific features are also per-thread:"
8381 msgstr "以下の Linux 特有の機能もスレッド単位である:"
8382
8383 #. type: Plain text
8384 #: build/C/man7/pthreads.7:106
8385 msgid "capabilities (see B<capabilities>(7))"
8386 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
8387
8388 #. type: Plain text
8389 #: build/C/man7/pthreads.7:109
8390 msgid "CPU affinity (B<sched_setaffinity>(2))"
8391 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
8392
8393 #. type: SS
8394 #: build/C/man7/pthreads.7:109
8395 #, no-wrap
8396 msgid "Pthreads function return values"
8397 msgstr "pthreads 関数の返り値"
8398
8399 #. type: Plain text
8400 #: build/C/man7/pthreads.7:116
8401 msgid ""
8402 "Most pthreads functions return 0 on success, and an error number of "
8403 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
8404 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
8405 "the function can never fail with the error B<EINTR>."
8406 msgstr ""
8407 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
8408 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
8409 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
8410 "は決してないと規定している。"
8411
8412 #. type: SS
8413 #: build/C/man7/pthreads.7:116
8414 #, no-wrap
8415 msgid "Thread IDs"
8416 msgstr "スレッド ID"
8417
8418 #. type: Plain text
8419 #: build/C/man7/pthreads.7:130
8420 msgid ""
8421 "Each of the threads in a process has a unique thread identifier (stored in "
8422 "the type I<pthread_t>).  This identifier is returned to the caller of "
8423 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
8424 "using B<pthread_self>(3).  Thread IDs are only guaranteed to be unique "
8425 "within a process.  A thread ID may be reused after a terminated thread has "
8426 "been joined, or a detached thread has terminated.  In all pthreads functions "
8427 "that accept a thread ID as an argument, that ID by definition refers to a "
8428 "thread in the same process as the caller."
8429 msgstr ""
8430 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
8431 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
8432 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
8433 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
8434 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
8435 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
8436 "じプロセス内の一つのスレッドを参照する。"
8437
8438 #. type: SS
8439 #: build/C/man7/pthreads.7:130
8440 #, no-wrap
8441 msgid "Thread-safe functions"
8442 msgstr "スレッドセーフな関数"
8443
8444 #. type: Plain text
8445 #: build/C/man7/pthreads.7:134
8446 msgid ""
8447 "A thread-safe function is one that can be safely (i.e., it will deliver the "
8448 "same results regardless of whether it is)  called from multiple threads at "
8449 "the same time."
8450 msgstr ""
8451 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
8452 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
8453
8454 #. type: Plain text
8455 #: build/C/man7/pthreads.7:138
8456 msgid ""
8457 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
8458 "standard shall be thread-safe, except for the following functions:"
8459 msgstr ""
8460 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
8461 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
8462
8463 #. type: Plain text
8464 #: build/C/man7/pthreads.7:232
8465 #, no-wrap
8466 msgid ""
8467 "asctime()\n"
8468 "basename()\n"
8469 "catgets()\n"
8470 "crypt()\n"
8471 "ctermid() if passed a non-NULL argument\n"
8472 "ctime()\n"
8473 "dbm_clearerr()\n"
8474 "dbm_close()\n"
8475 "dbm_delete()\n"
8476 "dbm_error()\n"
8477 "dbm_fetch()\n"
8478 "dbm_firstkey()\n"
8479 "dbm_nextkey()\n"
8480 "dbm_open()\n"
8481 "dbm_store()\n"
8482 "dirname()\n"
8483 "dlerror()\n"
8484 "drand48()\n"
8485 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8486 "encrypt()\n"
8487 "endgrent()\n"
8488 "endpwent()\n"
8489 "endutxent()\n"
8490 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8491 "ftw()\n"
8492 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8493 "getc_unlocked()\n"
8494 "getchar_unlocked()\n"
8495 "getdate()\n"
8496 "getenv()\n"
8497 "getgrent()\n"
8498 "getgrgid()\n"
8499 "getgrnam()\n"
8500 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8501 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8502 "gethostent()\n"
8503 "getlogin()\n"
8504 "getnetbyaddr()\n"
8505 "getnetbyname()\n"
8506 "getnetent()\n"
8507 "getopt()\n"
8508 "getprotobyname()\n"
8509 "getprotobynumber()\n"
8510 "getprotoent()\n"
8511 "getpwent()\n"
8512 "getpwnam()\n"
8513 "getpwuid()\n"
8514 "getservbyname()\n"
8515 "getservbyport()\n"
8516 "getservent()\n"
8517 "getutxent()\n"
8518 "getutxid()\n"
8519 "getutxline()\n"
8520 "gmtime()\n"
8521 "hcreate()\n"
8522 "hdestroy()\n"
8523 "hsearch()\n"
8524 "inet_ntoa()\n"
8525 "l64a()\n"
8526 "lgamma()\n"
8527 "lgammaf()\n"
8528 "lgammal()\n"
8529 "localeconv()\n"
8530 "localtime()\n"
8531 "lrand48()\n"
8532 "mrand48()\n"
8533 "nftw()\n"
8534 "nl_langinfo()\n"
8535 "ptsname()\n"
8536 "putc_unlocked()\n"
8537 "putchar_unlocked()\n"
8538 "putenv()\n"
8539 "pututxline()\n"
8540 "rand()\n"
8541 "readdir()\n"
8542 "setenv()\n"
8543 "setgrent()\n"
8544 "setkey()\n"
8545 "setpwent()\n"
8546 "setutxent()\n"
8547 "strerror()\n"
8548 "strsignal() [Added in POSIX.1-2008]\n"
8549 "strtok()\n"
8550 "system() [Added in POSIX.1-2008]\n"
8551 "tmpnam() if passed a non-NULL argument\n"
8552 "ttyname()\n"
8553 "unsetenv()\n"
8554 "wcrtomb() if its final argument is NULL\n"
8555 "wcsrtombs() if its final argument is NULL\n"
8556 "wcstombs()\n"
8557 "wctomb()\n"
8558 msgstr ""
8559 "asctime()\n"
8560 "basename()\n"
8561 "catgets()\n"
8562 "crypt()\n"
8563 "ctermid() (NULL でない引き数を渡された場合)\n"
8564 "ctime()\n"
8565 "dbm_clearerr()\n"
8566 "dbm_close()\n"
8567 "dbm_delete()\n"
8568 "dbm_error()\n"
8569 "dbm_fetch()\n"
8570 "dbm_firstkey()\n"
8571 "dbm_nextkey()\n"
8572 "dbm_open()\n"
8573 "dbm_store()\n"
8574 "dirname()\n"
8575 "dlerror()\n"
8576 "drand48()\n"
8577 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8578 "encrypt()\n"
8579 "endgrent()\n"
8580 "endpwent()\n"
8581 "endutxent()\n"
8582 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8583 "ftw()\n"
8584 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8585 "getc_unlocked()\n"
8586 "getchar_unlocked()\n"
8587 "getdate()\n"
8588 "getenv()\n"
8589 "getgrent()\n"
8590 "getgrgid()\n"
8591 "getgrnam()\n"
8592 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8593 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8594 "gethostent()\n"
8595 "getlogin()\n"
8596 "getnetbyaddr()\n"
8597 "getnetbyname()\n"
8598 "getnetent()\n"
8599 "getopt()\n"
8600 "getprotobyname()\n"
8601 "getprotobynumber()\n"
8602 "getprotoent()\n"
8603 "getpwent()\n"
8604 "getpwnam()\n"
8605 "getpwuid()\n"
8606 "getservbyname()\n"
8607 "getservbyport()\n"
8608 "getservent()\n"
8609 "getutxent()\n"
8610 "getutxid()\n"
8611 "getutxline()\n"
8612 "gmtime()\n"
8613 "hcreate()\n"
8614 "hdestroy()\n"
8615 "hsearch()\n"
8616 "inet_ntoa()\n"
8617 "l64a()\n"
8618 "lgamma()\n"
8619 "lgammaf()\n"
8620 "lgammal()\n"
8621 "localeconv()\n"
8622 "localtime()\n"
8623 "lrand48()\n"
8624 "mrand48()\n"
8625 "nftw()\n"
8626 "nl_langinfo()\n"
8627 "ptsname()\n"
8628 "putc_unlocked()\n"
8629 "putchar_unlocked()\n"
8630 "putenv()\n"
8631 "pututxline()\n"
8632 "rand()\n"
8633 "readdir()\n"
8634 "setenv()\n"
8635 "setgrent()\n"
8636 "setkey()\n"
8637 "setpwent()\n"
8638 "setutxent()\n"
8639 "strerror()\n"
8640 "strsignal() [POSIX.1-2008 で追加された]\n"
8641 "strtok()\n"
8642 "system() [POSIX.1-2008 で追加された]\n"
8643 "tmpnam() (NULL でない引き数を渡された場合)\n"
8644 "ttyname()\n"
8645 "unsetenv()\n"
8646 "wcrtomb() (最後の引き数が NULL の場合)\n"
8647 "wcsrtombs() (最後の引き数が NULL の場合)\n"
8648 "wcstombs()\n"
8649 "wctomb()\n"
8650
8651 #. type: SS
8652 #: build/C/man7/pthreads.7:234
8653 #, no-wrap
8654 msgid "Async-cancel-safe functions"
8655 msgstr "async-cancel-safe 関数"
8656
8657 #. type: Plain text
8658 #: build/C/man7/pthreads.7:238
8659 msgid ""
8660 "An async-cancel-safe function is one that can be safely called in an "
8661 "application where asynchronous cancelability is enabled (see "
8662 "B<pthread_setcancelstate>(3))."
8663 msgstr ""
8664 "async-cancel-safe 関数は、\n"
8665 "非同期キャンセル機能が有効になっているアプリケーションで\n"
8666 "安全に呼び出すことができる関数のことである\n"
8667 "(B<pthread_setcancelstate>(3) を参照)。"
8668
8669 #. type: Plain text
8670 #: build/C/man7/pthreads.7:241
8671 msgid ""
8672 "Only the following functions are required to be async-cancel-safe by "
8673 "POSIX.1-2001 and POSIX.1-2008:"
8674 msgstr ""
8675 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
8676 "なければならないとされている。"
8677
8678 #. type: Plain text
8679 #: build/C/man7/pthreads.7:247
8680 #, no-wrap
8681 msgid ""
8682 "pthread_cancel()\n"
8683 "pthread_setcancelstate()\n"
8684 "pthread_setcanceltype()\n"
8685 msgstr ""
8686 "pthread_cancel()\n"
8687 "pthread_setcancelstate()\n"
8688 "pthread_setcanceltype()\n"
8689
8690 #. type: SS
8691 #: build/C/man7/pthreads.7:249
8692 #, no-wrap
8693 msgid "Cancellation Points"
8694 msgstr "取り消しポイント (cancellation points)"
8695
8696 #. type: Plain text
8697 #: build/C/man7/pthreads.7:256
8698 msgid ""
8699 "POSIX.1 specifies that certain functions must, and certain other functions "
8700 "may, be cancellation points.  If a thread is cancelable, its cancelability "
8701 "type is deferred, and a cancellation request is pending for the thread, then "
8702 "the thread is canceled when it calls a function that is a cancellation point."
8703 msgstr ""
8704 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
8705 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
8706 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
8707 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
8708 "時点で、そのスレッドのキャンセルが 行われる。"
8709
8710 #. type: Plain text
8711 #: build/C/man7/pthreads.7:259
8712 msgid ""
8713 "The following functions are required to be cancellation points by "
8714 "POSIX.1-2001 and/or POSIX.1-2008:"
8715 msgstr ""
8716 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
8717 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
8718
8719 #. type: Plain text
8720 #: build/C/man7/pthreads.7:322
8721 #, no-wrap
8722 msgid ""
8723 "accept()\n"
8724 "aio_suspend()\n"
8725 "clock_nanosleep()\n"
8726 "close()\n"
8727 "connect()\n"
8728 "creat()\n"
8729 "fcntl() F_SETLKW\n"
8730 "fdatasync()\n"
8731 "fsync()\n"
8732 "getmsg()\n"
8733 "getpmsg()\n"
8734 "lockf() F_LOCK\n"
8735 "mq_receive()\n"
8736 "mq_send()\n"
8737 "mq_timedreceive()\n"
8738 "mq_timedsend()\n"
8739 "msgrcv()\n"
8740 "msgsnd()\n"
8741 "msync()\n"
8742 "nanosleep()\n"
8743 "open()\n"
8744 "openat() [Added in POSIX.1-2008]\n"
8745 "pause()\n"
8746 "poll()\n"
8747 "pread()\n"
8748 "pselect()\n"
8749 "pthread_cond_timedwait()\n"
8750 "pthread_cond_wait()\n"
8751 "pthread_join()\n"
8752 "pthread_testcancel()\n"
8753 "putmsg()\n"
8754 "putpmsg()\n"
8755 "pwrite()\n"
8756 "read()\n"
8757 "readv()\n"
8758 "recv()\n"
8759 "recvfrom()\n"
8760 "recvmsg()\n"
8761 "select()\n"
8762 "sem_timedwait()\n"
8763 "sem_wait()\n"
8764 "send()\n"
8765 "sendmsg()\n"
8766 "sendto()\n"
8767 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
8768 "sigsuspend()\n"
8769 "sigtimedwait()\n"
8770 "sigwait()\n"
8771 "sigwaitinfo()\n"
8772 "sleep()\n"
8773 "system()\n"
8774 "tcdrain()\n"
8775 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8776 "wait()\n"
8777 "waitid()\n"
8778 "waitpid()\n"
8779 "write()\n"
8780 "writev()\n"
8781 msgstr ""
8782 "accept()\n"
8783 "aio_suspend()\n"
8784 "clock_nanosleep()\n"
8785 "close()\n"
8786 "connect()\n"
8787 "creat()\n"
8788 "fcntl() F_SETLKW\n"
8789 "fdatasync()\n"
8790 "fsync()\n"
8791 "getmsg()\n"
8792 "getpmsg()\n"
8793 "lockf() F_LOCK\n"
8794 "mq_receive()\n"
8795 "mq_send()\n"
8796 "mq_timedreceive()\n"
8797 "mq_timedsend()\n"
8798 "msgrcv()\n"
8799 "msgsnd()\n"
8800 "msync()\n"
8801 "nanosleep()\n"
8802 "open()\n"
8803 "openat() [POSIX.1-2008 で追加された]\n"
8804 "pause()\n"
8805 "poll()\n"
8806 "pread()\n"
8807 "pselect()\n"
8808 "pthread_cond_timedwait()\n"
8809 "pthread_cond_wait()\n"
8810 "pthread_join()\n"
8811 "pthread_testcancel()\n"
8812 "putmsg()\n"
8813 "putpmsg()\n"
8814 "pwrite()\n"
8815 "read()\n"
8816 "readv()\n"
8817 "recv()\n"
8818 "recvfrom()\n"
8819 "recvmsg()\n"
8820 "select()\n"
8821 "sem_timedwait()\n"
8822 "sem_wait()\n"
8823 "send()\n"
8824 "sendmsg()\n"
8825 "sendto()\n"
8826 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
8827 "sigsuspend()\n"
8828 "sigtimedwait()\n"
8829 "sigwait()\n"
8830 "sigwaitinfo()\n"
8831 "sleep()\n"
8832 "system()\n"
8833 "tcdrain()\n"
8834 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8835 "wait()\n"
8836 "waitid()\n"
8837 "waitpid()\n"
8838 "write()\n"
8839 "writev()\n"
8840
8841 #. type: Plain text
8842 #: build/C/man7/pthreads.7:327
8843 msgid ""
8844 "The following functions may be cancellation points according to POSIX.1-2001 "
8845 "and/or POSIX.1-2008:"
8846 msgstr ""
8847 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
8848 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
8849
8850 #. type: Plain text
8851 #: build/C/man7/pthreads.7:555
8852 #, no-wrap
8853 msgid ""
8854 "access()\n"
8855 "asctime()\n"
8856 "asctime_r()\n"
8857 "catclose()\n"
8858 "catgets()\n"
8859 "catopen()\n"
8860 "chmod() [Added in POSIX.1-2008]\n"
8861 "chown() [Added in POSIX.1-2008]\n"
8862 "closedir()\n"
8863 "closelog()\n"
8864 "ctermid()\n"
8865 "ctime()\n"
8866 "ctime_r()\n"
8867 "dbm_close()\n"
8868 "dbm_delete()\n"
8869 "dbm_fetch()\n"
8870 "dbm_nextkey()\n"
8871 "dbm_open()\n"
8872 "dbm_store()\n"
8873 "dlclose()\n"
8874 "dlopen()\n"
8875 "dprintf() [Added in POSIX.1-2008]\n"
8876 "endgrent()\n"
8877 "endhostent()\n"
8878 "endnetent()\n"
8879 "endprotoent()\n"
8880 "endpwent()\n"
8881 "endservent()\n"
8882 "endutxent()\n"
8883 "faccessat() [Added in POSIX.1-2008]\n"
8884 "fchmod() [Added in POSIX.1-2008]\n"
8885 "fchmodat() [Added in POSIX.1-2008]\n"
8886 "fchown() [Added in POSIX.1-2008]\n"
8887 "fchownat() [Added in POSIX.1-2008]\n"
8888 "fclose()\n"
8889 "fcntl() (for any value of cmd argument)\n"
8890 "fflush()\n"
8891 "fgetc()\n"
8892 "fgetpos()\n"
8893 "fgets()\n"
8894 "fgetwc()\n"
8895 "fgetws()\n"
8896 "fmtmsg()\n"
8897 "fopen()\n"
8898 "fpathconf()\n"
8899 "fprintf()\n"
8900 "fputc()\n"
8901 "fputs()\n"
8902 "fputwc()\n"
8903 "fputws()\n"
8904 "fread()\n"
8905 "freopen()\n"
8906 "fscanf()\n"
8907 "fseek()\n"
8908 "fseeko()\n"
8909 "fsetpos()\n"
8910 "fstat()\n"
8911 "fstatat() [Added in POSIX.1-2008]\n"
8912 "ftell()\n"
8913 "ftello()\n"
8914 "ftw()\n"
8915 "futimens() [Added in POSIX.1-2008]\n"
8916 "fwprintf()\n"
8917 "fwrite()\n"
8918 "fwscanf()\n"
8919 "getaddrinfo()\n"
8920 "getc()\n"
8921 "getc_unlocked()\n"
8922 "getchar()\n"
8923 "getchar_unlocked()\n"
8924 "getcwd()\n"
8925 "getdate()\n"
8926 "getdelim() [Added in POSIX.1-2008]\n"
8927 "getgrent()\n"
8928 "getgrgid()\n"
8929 "getgrgid_r()\n"
8930 "getgrnam()\n"
8931 "getgrnam_r()\n"
8932 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
8933 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
8934 "gethostent()\n"
8935 "gethostid()\n"
8936 "gethostname()\n"
8937 "getline() [Added in POSIX.1-2008]\n"
8938 "getlogin()\n"
8939 "getlogin_r()\n"
8940 "getnameinfo()\n"
8941 "getnetbyaddr()\n"
8942 "getnetbyname()\n"
8943 "getnetent()\n"
8944 "getopt() (if opterr is nonzero)\n"
8945 "getprotobyname()\n"
8946 "getprotobynumber()\n"
8947 "getprotoent()\n"
8948 "getpwent()\n"
8949 "getpwnam()\n"
8950 "getpwnam_r()\n"
8951 "getpwuid()\n"
8952 "getpwuid_r()\n"
8953 "gets()\n"
8954 "getservbyname()\n"
8955 "getservbyport()\n"
8956 "getservent()\n"
8957 "getutxent()\n"
8958 "getutxid()\n"
8959 "getutxline()\n"
8960 "getwc()\n"
8961 "getwchar()\n"
8962 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
8963 "glob()\n"
8964 "iconv_close()\n"
8965 "iconv_open()\n"
8966 "ioctl()\n"
8967 "link()\n"
8968 "linkat() [Added in POSIX.1-2008]\n"
8969 "lio_listio() [Added in POSIX.1-2008]\n"
8970 "localtime()\n"
8971 "localtime_r()\n"
8972 "lockf() [Added in POSIX.1-2008]\n"
8973 "lseek()\n"
8974 "lstat()\n"
8975 "mkdir() [Added in POSIX.1-2008]\n"
8976 "mkdirat() [Added in POSIX.1-2008]\n"
8977 "mkdtemp() [Added in POSIX.1-2008]\n"
8978 "mkfifo() [Added in POSIX.1-2008]\n"
8979 "mkfifoat() [Added in POSIX.1-2008]\n"
8980 "mknod() [Added in POSIX.1-2008]\n"
8981 "mknodat() [Added in POSIX.1-2008]\n"
8982 "mkstemp()\n"
8983 "mktime()\n"
8984 "nftw()\n"
8985 "opendir()\n"
8986 "openlog()\n"
8987 "pathconf()\n"
8988 "pclose()\n"
8989 "perror()\n"
8990 "popen()\n"
8991 "posix_fadvise()\n"
8992 "posix_fallocate()\n"
8993 "posix_madvise()\n"
8994 "posix_openpt()\n"
8995 "posix_spawn()\n"
8996 "posix_spawnp()\n"
8997 "posix_trace_clear()\n"
8998 "posix_trace_close()\n"
8999 "posix_trace_create()\n"
9000 "posix_trace_create_withlog()\n"
9001 "posix_trace_eventtypelist_getnext_id()\n"
9002 "posix_trace_eventtypelist_rewind()\n"
9003 "posix_trace_flush()\n"
9004 "posix_trace_get_attr()\n"
9005 "posix_trace_get_filter()\n"
9006 "posix_trace_get_status()\n"
9007 "posix_trace_getnext_event()\n"
9008 "posix_trace_open()\n"
9009 "posix_trace_rewind()\n"
9010 "posix_trace_set_filter()\n"
9011 "posix_trace_shutdown()\n"
9012 "posix_trace_timedgetnext_event()\n"
9013 "posix_typed_mem_open()\n"
9014 "printf()\n"
9015 "psiginfo() [Added in POSIX.1-2008]\n"
9016 "psignal() [Added in POSIX.1-2008]\n"
9017 "pthread_rwlock_rdlock()\n"
9018 "pthread_rwlock_timedrdlock()\n"
9019 "pthread_rwlock_timedwrlock()\n"
9020 "pthread_rwlock_wrlock()\n"
9021 "putc()\n"
9022 "putc_unlocked()\n"
9023 "putchar()\n"
9024 "putchar_unlocked()\n"
9025 "puts()\n"
9026 "pututxline()\n"
9027 "putwc()\n"
9028 "putwchar()\n"
9029 "readdir()\n"
9030 "readdir_r()\n"
9031 "readlink() [Added in POSIX.1-2008]\n"
9032 "readlinkat() [Added in POSIX.1-2008]\n"
9033 "remove()\n"
9034 "rename()\n"
9035 "renameat() [Added in POSIX.1-2008]\n"
9036 "rewind()\n"
9037 "rewinddir()\n"
9038 "scandir() [Added in POSIX.1-2008]\n"
9039 "scanf()\n"
9040 "seekdir()\n"
9041 "semop()\n"
9042 "setgrent()\n"
9043 "sethostent()\n"
9044 "setnetent()\n"
9045 "setprotoent()\n"
9046 "setpwent()\n"
9047 "setservent()\n"
9048 "setutxent()\n"
9049 "sigpause() [Added in POSIX.1-2008]\n"
9050 "stat()\n"
9051 "strerror()\n"
9052 "strerror_r()\n"
9053 "strftime()\n"
9054 "symlink()\n"
9055 "symlinkat() [Added in POSIX.1-2008]\n"
9056 "sync()\n"
9057 "syslog()\n"
9058 "tmpfile()\n"
9059 "tmpnam()\n"
9060 "ttyname()\n"
9061 "ttyname_r()\n"
9062 "tzset()\n"
9063 "ungetc()\n"
9064 "ungetwc()\n"
9065 "unlink()\n"
9066 "unlinkat() [Added in POSIX.1-2008]\n"
9067 "utime() [Added in POSIX.1-2008]\n"
9068 "utimensat() [Added in POSIX.1-2008]\n"
9069 "utimes() [Added in POSIX.1-2008]\n"
9070 "vdprintf() [Added in POSIX.1-2008]\n"
9071 "vfprintf()\n"
9072 "vfwprintf()\n"
9073 "vprintf()\n"
9074 "vwprintf()\n"
9075 "wcsftime()\n"
9076 "wordexp()\n"
9077 "wprintf()\n"
9078 "wscanf()\n"
9079 msgstr ""
9080 "access()\n"
9081 "asctime()\n"
9082 "asctime_r()\n"
9083 "catclose()\n"
9084 "catgets()\n"
9085 "catopen()\n"
9086 "chmod() [POSIX.1-2008 で追加された]\n"
9087 "chown() [POSIX.1-2008 で追加された]\n"
9088 "closedir()\n"
9089 "closelog()\n"
9090 "ctermid()\n"
9091 "ctime()\n"
9092 "ctime_r()\n"
9093 "dbm_close()\n"
9094 "dbm_delete()\n"
9095 "dbm_fetch()\n"
9096 "dbm_nextkey()\n"
9097 "dbm_open()\n"
9098 "dbm_store()\n"
9099 "dlclose()\n"
9100 "dlopen()\n"
9101 "dprintf() [POSIX.1-2008 で追加された]\n"
9102 "endgrent()\n"
9103 "endhostent()\n"
9104 "endnetent()\n"
9105 "endprotoent()\n"
9106 "endpwent()\n"
9107 "endservent()\n"
9108 "endutxent()\n"
9109 "faccessat() [POSIX.1-2008 で追加された]\n"
9110 "fchmod() [POSIX.1-2008 で追加された]\n"
9111 "fchmodat() [POSIX.1-2008 で追加された]\n"
9112 "fchown() [POSIX.1-2008 で追加された]\n"
9113 "fchownat() [POSIX.1-2008 で追加された]\n"
9114 "fclose()\n"
9115 "fcntl() (cmd 引き数が何であっても)\n"
9116 "fflush()\n"
9117 "fgetc()\n"
9118 "fgetpos()\n"
9119 "fgets()\n"
9120 "fgetwc()\n"
9121 "fgetws()\n"
9122 "fmtmsg()\n"
9123 "fopen()\n"
9124 "fpathconf()\n"
9125 "fprintf()\n"
9126 "fputc()\n"
9127 "fputs()\n"
9128 "fputwc()\n"
9129 "fputws()\n"
9130 "fread()\n"
9131 "freopen()\n"
9132 "fscanf()\n"
9133 "fseek()\n"
9134 "fseeko()\n"
9135 "fsetpos()\n"
9136 "fstat()\n"
9137 "fstatat() [POSIX.1-2008 で追加された]\n"
9138 "ftell()\n"
9139 "ftello()\n"
9140 "ftw()\n"
9141 "futimens() [POSIX.1-2008 で追加された]\n"
9142 "fwprintf()\n"
9143 "fwrite()\n"
9144 "fwscanf()\n"
9145 "getaddrinfo()\n"
9146 "getc()\n"
9147 "getc_unlocked()\n"
9148 "getchar()\n"
9149 "getchar_unlocked()\n"
9150 "getcwd()\n"
9151 "getdate()\n"
9152 "getdelim() [POSIX.1-2008 で追加された]\n"
9153 "getgrent()\n"
9154 "getgrgid()\n"
9155 "getgrgid_r()\n"
9156 "getgrnam()\n"
9157 "getgrnam_r()\n"
9158 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9159 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9160 "gethostent()\n"
9161 "gethostid()\n"
9162 "gethostname()\n"
9163 "getline() [POSIX.1-2008 で追加された]\n"
9164 "getlogin()\n"
9165 "getlogin_r()\n"
9166 "getnameinfo()\n"
9167 "getnetbyaddr()\n"
9168 "getnetbyname()\n"
9169 "getnetent()\n"
9170 "getopt() (opterr が 0 以外の場合)\n"
9171 "getprotobyname()\n"
9172 "getprotobynumber()\n"
9173 "getprotoent()\n"
9174 "getpwent()\n"
9175 "getpwnam()\n"
9176 "getpwnam_r()\n"
9177 "getpwuid()\n"
9178 "getpwuid_r()\n"
9179 "gets()\n"
9180 "getservbyname()\n"
9181 "getservbyport()\n"
9182 "getservent()\n"
9183 "getutxent()\n"
9184 "getutxid()\n"
9185 "getutxline()\n"
9186 "getwc()\n"
9187 "getwchar()\n"
9188 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9189 "glob()\n"
9190 "iconv_close()\n"
9191 "iconv_open()\n"
9192 "ioctl()\n"
9193 "link()\n"
9194 "linkat() [POSIX.1-2008 で追加された]\n"
9195 "lio_listio() [POSIX.1-2008 で追加された]\n"
9196 "localtime()\n"
9197 "localtime_r()\n"
9198 "lockf() [POSIX.1-2008 で追加された]\n"
9199 "lseek()\n"
9200 "lstat()\n"
9201 "mkdir() [POSIX.1-2008 で追加された]\n"
9202 "mkdirat() [POSIX.1-2008 で追加された]\n"
9203 "mkdtemp() [POSIX.1-2008 で追加された]\n"
9204 "mkfifo() [POSIX.1-2008 で追加された]\n"
9205 "mkfifoat() [POSIX.1-2008 で追加された]\n"
9206 "mknod() [POSIX.1-2008 で追加された]\n"
9207 "mknodat() [POSIX.1-2008 で追加された]\n"
9208 "mkstemp()\n"
9209 "mktime()\n"
9210 "nftw()\n"
9211 "opendir()\n"
9212 "openlog()\n"
9213 "pathconf()\n"
9214 "pclose()\n"
9215 "perror()\n"
9216 "popen()\n"
9217 "posix_fadvise()\n"
9218 "posix_fallocate()\n"
9219 "posix_madvise()\n"
9220 "posix_openpt()\n"
9221 "posix_spawn()\n"
9222 "posix_spawnp()\n"
9223 "posix_trace_clear()\n"
9224 "posix_trace_close()\n"
9225 "posix_trace_create()\n"
9226 "posix_trace_create_withlog()\n"
9227 "posix_trace_eventtypelist_getnext_id()\n"
9228 "posix_trace_eventtypelist_rewind()\n"
9229 "posix_trace_flush()\n"
9230 "posix_trace_get_attr()\n"
9231 "posix_trace_get_filter()\n"
9232 "posix_trace_get_status()\n"
9233 "posix_trace_getnext_event()\n"
9234 "posix_trace_open()\n"
9235 "posix_trace_rewind()\n"
9236 "posix_trace_set_filter()\n"
9237 "posix_trace_shutdown()\n"
9238 "posix_trace_timedgetnext_event()\n"
9239 "posix_typed_mem_open()\n"
9240 "printf()\n"
9241 "psiginfo() [POSIX.1-2008 で追加された]\n"
9242 "psignal() [POSIX.1-2008 で追加された]\n"
9243 "pthread_rwlock_rdlock()\n"
9244 "pthread_rwlock_timedrdlock()\n"
9245 "pthread_rwlock_timedwrlock()\n"
9246 "pthread_rwlock_wrlock()\n"
9247 "putc()\n"
9248 "putc_unlocked()\n"
9249 "putchar()\n"
9250 "putchar_unlocked()\n"
9251 "puts()\n"
9252 "pututxline()\n"
9253 "putwc()\n"
9254 "putwchar()\n"
9255 "readdir()\n"
9256 "readdir_r()\n"
9257 "readlink() [POSIX.1-2008 で追加された]\n"
9258 "readlinkat() [POSIX.1-2008 で追加された]\n"
9259 "remove()\n"
9260 "rename()\n"
9261 "renameat() [POSIX.1-2008 で追加された]\n"
9262 "rewind()\n"
9263 "rewinddir()\n"
9264 "scandir() [POSIX.1-2008 で追加された]\n"
9265 "scanf()\n"
9266 "seekdir()\n"
9267 "semop()\n"
9268 "setgrent()\n"
9269 "sethostent()\n"
9270 "setnetent()\n"
9271 "setprotoent()\n"
9272 "setpwent()\n"
9273 "setservent()\n"
9274 "setutxent()\n"
9275 "sigpause() [POSIX.1-2008 で追加された]\n"
9276 "stat()\n"
9277 "strerror()\n"
9278 "strerror_r()\n"
9279 "strftime()\n"
9280 "symlink()\n"
9281 "symlinkat() [POSIX.1-2008 で追加された]\n"
9282 "sync()\n"
9283 "syslog()\n"
9284 "tmpfile()\n"
9285 "tmpnam()\n"
9286 "ttyname()\n"
9287 "ttyname_r()\n"
9288 "tzset()\n"
9289 "ungetc()\n"
9290 "ungetwc()\n"
9291 "unlink()\n"
9292 "unlinkat() [POSIX.1-2008 で追加された]\n"
9293 "utime() [POSIX.1-2008 で追加された]\n"
9294 "utimensat() [POSIX.1-2008 で追加された]\n"
9295 "utimes() [POSIX.1-2008 で追加された]\n"
9296 "vdprintf() [POSIX.1-2008 で追加された]\n"
9297 "vfprintf()\n"
9298 "vfwprintf()\n"
9299 "vprintf()\n"
9300 "vwprintf()\n"
9301 "wcsftime()\n"
9302 "wordexp()\n"
9303 "wprintf()\n"
9304 "wscanf()\n"
9305
9306 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
9307 #.  files, it looks as though at least the following nonstandard
9308 #.  functions are cancellation points:
9309 #.  endnetgrent
9310 #.  endspent
9311 #.  epoll_pwait
9312 #.  epoll_wait
9313 #.  fcloseall
9314 #.  fdopendir
9315 #.  fflush_unlocked
9316 #.  fgetc_unlocked
9317 #.  fgetgrent
9318 #.  fgetgrent_r
9319 #.  fgetpwent
9320 #.  fgetpwent_r
9321 #.  fgets_unlocked
9322 #.  fgetspent
9323 #.  fgetspent_r
9324 #.  fgetwc_unlocked
9325 #.  fgetws_unlocked
9326 #.  fputc_unlocked
9327 #.  fputs_unlocked
9328 #.  fputwc_unlocked
9329 #.  fputws_unlocked
9330 #.  fread_unlocked
9331 #.  fwrite_unlocked
9332 #.  gai_suspend
9333 #.  getaddrinfo_a
9334 #.  getdate_r
9335 #.  getgrent_r
9336 #.  getgrouplist
9337 #.  gethostbyaddr_r
9338 #.  gethostbyname2
9339 #.  gethostbyname2_r
9340 #.  gethostbyname_r
9341 #.  gethostent_r
9342 #.  getnetbyaddr_r
9343 #.  getnetbyname_r
9344 #.  getnetent_r
9345 #.  getnetgrent
9346 #.  getnetgrent_r
9347 #.  getprotobyname_r
9348 #.  getprotobynumber_r
9349 #.  getprotoent_r
9350 #.  getpw
9351 #.  getpwent_r
9352 #.  getservbyname_r
9353 #.  getservbyport_r
9354 #.  getservent_r
9355 #.  getspent
9356 #.  getspent_r
9357 #.  getspnam
9358 #.  getspnam_r
9359 #.  getutmp
9360 #.  getutmpx
9361 #.  getw
9362 #.  getwc_unlocked
9363 #.  getwchar_unlocked
9364 #.  initgroups
9365 #.  innetgr
9366 #.  mkostemp
9367 #.  mkostemp64
9368 #.  mkstemp64
9369 #.  ppoll
9370 #.  pthread_timedjoin_np
9371 #.  putgrent
9372 #.  putpwent
9373 #.  putspent
9374 #.  putw
9375 #.  putwc_unlocked
9376 #.  putwchar_unlocked
9377 #.  rcmd
9378 #.  rcmd_af
9379 #.  rexec
9380 #.  rexec_af
9381 #.  rresvport
9382 #.  rresvport_af
9383 #.  ruserok
9384 #.  ruserok_af
9385 #.  setnetgrent
9386 #.  setspent
9387 #.  sgetspent
9388 #.  sgetspent_r
9389 #.  updwtmpx
9390 #.  utmpxname
9391 #.  vfscanf
9392 #.  vfwscanf
9393 #.  vscanf
9394 #.  vsyslog
9395 #.  vwscanf
9396 #. type: Plain text
9397 #: build/C/man7/pthreads.7:653
9398 msgid ""
9399 "An implementation may also mark other functions not specified in the "
9400 "standard as cancellation points.  In particular, an implementation is likely "
9401 "to mark any nonstandard function that may block as a cancellation point.  "
9402 "(This includes most functions that can touch files.)"
9403 msgstr ""
9404 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
9405 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
9406 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
9407 "関数がこれに含まれる)。"
9408
9409 #. type: SS
9410 #: build/C/man7/pthreads.7:653
9411 #, no-wrap
9412 msgid "Compiling on Linux"
9413 msgstr "Linux でのコンパイル"
9414
9415 #. type: Plain text
9416 #: build/C/man7/pthreads.7:656
9417 msgid ""
9418 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
9419 "pthread>."
9420 msgstr ""
9421 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
9422 "きである。"
9423
9424 #. type: SS
9425 #: build/C/man7/pthreads.7:656
9426 #, no-wrap
9427 msgid "Linux Implementations of POSIX Threads"
9428 msgstr "POSIX スレッドの Linux での実装"
9429
9430 #. type: Plain text
9431 #: build/C/man7/pthreads.7:659
9432 msgid ""
9433 "Over time, two threading implementations have been provided by the GNU C "
9434 "library on Linux:"
9435 msgstr ""
9436 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
9437 "た。"
9438
9439 #. type: TP
9440 #: build/C/man7/pthreads.7:659
9441 #, no-wrap
9442 msgid "B<LinuxThreads>"
9443 msgstr "B<LinuxThreads>"
9444
9445 #. type: Plain text
9446 #: build/C/man7/pthreads.7:663
9447 msgid ""
9448 "This is the original Pthreads implementation.  Since glibc 2.4, this "
9449 "implementation is no longer supported."
9450 msgstr ""
9451 "最初の Pthreads の実装。 glibc 2.4 以降は、この実装はもはやサポートされていな"
9452 "い。"
9453
9454 #. type: TP
9455 #: build/C/man7/pthreads.7:663
9456 #, no-wrap
9457 msgid "B<NPTL> (Native POSIX Threads Library)"
9458 msgstr "B<NPTL> (Native POSIX Threads Library)"
9459
9460 #. type: Plain text
9461 #: build/C/man7/pthreads.7:671
9462 msgid ""
9463 "This is the modern Pthreads implementation.  By comparison with "
9464 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
9465 "POSIX.1 specification and better performance when creating large numbers of "
9466 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
9467 "are present in the Linux 2.6 kernel."
9468 msgstr ""
9469 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
9470 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
9471 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
9472 "装されている機能が必要である。"
9473
9474 #. type: Plain text
9475 #: build/C/man7/pthreads.7:681
9476 msgid ""
9477 "Both of these are so-called 1:1 implementations, meaning that each thread "
9478 "maps to a kernel scheduling entity.  Both threading implementations employ "
9479 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
9480 "primitives (mutexes, thread joining, etc.) are implemented using the Linux "
9481 "B<futex>(2)  system call."
9482 msgstr ""
9483 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
9484 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
9485 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
9486 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
9487 "使って実装されている。"
9488
9489 #. type: SS
9490 #: build/C/man7/pthreads.7:681
9491 #, no-wrap
9492 msgid "LinuxThreads"
9493 msgstr "LinuxThreads"
9494
9495 #. type: Plain text
9496 #: build/C/man7/pthreads.7:683
9497 msgid "The notable features of this implementation are the following:"
9498 msgstr "この実装の大きな特徴は以下の通りである:"
9499
9500 #. type: Plain text
9501 #: build/C/man7/pthreads.7:690
9502 msgid ""
9503 "In addition to the main (initial) thread, and the threads that the program "
9504 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
9505 "thread.  This thread handles thread creation and termination.  (Problems can "
9506 "result if this thread is inadvertently killed.)"
9507 msgstr ""
9508 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
9509 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
9510 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
9511 "kill されると、問題が起こることがある)。"
9512
9513 #. type: Plain text
9514 #: build/C/man7/pthreads.7:702
9515 msgid ""
9516 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
9517 "the first three real-time signals are used (see also B<signal>(7)).  On "
9518 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
9519 "avoid the use of whichever set of signals is employed by the implementation."
9520 msgstr ""
9521 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
9522 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
9523 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
9524 "用されているシグナルを どれも使わないようにしなければならない。"
9525
9526 #. type: Plain text
9527 #: build/C/man7/pthreads.7:709
9528 msgid ""
9529 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
9530 "implemented as processes which share more information than usual, but which "
9531 "do not share a common process ID.)  LinuxThreads threads (including the "
9532 "manager thread)  are visible as separate processes using B<ps>(1)."
9533 msgstr ""
9534 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
9535 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
9536 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
9537 "を使うと別のプロセスのように見える。"
9538
9539 #. type: Plain text
9540 #: build/C/man7/pthreads.7:712
9541 msgid ""
9542 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
9543 "number of ways, including the following:"
9544 msgstr ""
9545 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
9546 "示すような点がある:"
9547
9548 #. type: Plain text
9549 #: build/C/man7/pthreads.7:716
9550 msgid "Calls to B<getpid>(2)  return a different value in each thread."
9551 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
9552
9553 #. type: Plain text
9554 #: build/C/man7/pthreads.7:725
9555 msgid ""
9556 "Calls to B<getppid>(2)  in threads other than the main thread return the "
9557 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
9558 "should return the same value as B<getppid>(2)  in the main thread."
9559 msgstr ""
9560 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
9561 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
9562 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
9563
9564 #. type: Plain text
9565 #: build/C/man7/pthreads.7:735
9566 msgid ""
9567 "When one thread creates a new child process using B<fork>(2), any thread "
9568 "should be able to B<wait>(2)  on the child.  However, the implementation "
9569 "only allows the thread that created the child to B<wait>(2)  on it."
9570 msgstr ""
9571 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
9572 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
9573 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
9574 "る。"
9575
9576 #. type: Plain text
9577 #: build/C/man7/pthreads.7:742
9578 msgid ""
9579 "When a thread calls B<execve>(2), all other threads are terminated (as "
9580 "required by POSIX.1).  However, the resulting process has the same PID as "
9581 "the thread that called B<execve>(2): it should have the same PID as the main "
9582 "thread."
9583 msgstr ""
9584 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
9585 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
9586 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
9587 "る。"
9588
9589 #. type: Plain text
9590 #: build/C/man7/pthreads.7:749
9591 msgid ""
9592 "Threads do not share user and group IDs.  This can cause complications with "
9593 "set-user-ID programs and can cause failures in Pthreads functions if an "
9594 "application changes its credentials using B<seteuid>(2)  or similar."
9595 msgstr ""
9596 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
9597 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使っ"
9598 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
9599
9600 #. type: Plain text
9601 #: build/C/man7/pthreads.7:751
9602 msgid "Threads do not share a common session ID and process group ID."
9603 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
9604
9605 #. type: Plain text
9606 #: build/C/man7/pthreads.7:754
9607 msgid "Threads do not share record locks created using B<fcntl>(2)."
9608 msgstr ""
9609 "スレッド間で B<fcntl>(2)  を使って作成されるレコード・ロックを共有しない。"
9610
9611 #. type: Plain text
9612 #: build/C/man7/pthreads.7:760
9613 msgid ""
9614 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
9615 "rather than process-wide."
9616 msgstr ""
9617 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
9618 "単位の情報である。"
9619
9620 #. type: Plain text
9621 #: build/C/man7/pthreads.7:763
9622 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
9623 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
9624
9625 #. type: Plain text
9626 #: build/C/man7/pthreads.7:765
9627 msgid "Threads do not share interval timers."
9628 msgstr "スレッド間でインターバル・タイマを共有しない。"
9629
9630 #.  FIXME . bug report filed for NPTL nice nonconformance
9631 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
9632 #.  Sep 08: there is a patch by Denys Vlasenko to address this
9633 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
9634 #.  Monitor this to see if it makes it into mainline.
9635 #. type: Plain text
9636 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
9637 msgid "Threads do not share a common nice value."
9638 msgstr "スレッドは共通の nice 値を共有しない。"
9639
9640 #. type: Plain text
9641 #: build/C/man7/pthreads.7:777
9642 msgid ""
9643 "POSIX.1 distinguishes the notions of signals that are directed to the "
9644 "process as a whole and signals that are directed to individual threads.  "
9645 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
9646 "example) should be handled by a single, arbitrarily selected thread within "
9647 "the process.  LinuxThreads does not support the notion of process-directed "
9648 "signals: signals may only be sent to specific threads."
9649 msgstr ""
9650 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
9651 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
9652 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
9653 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
9654 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
9655 "ルは特定のスレッドにだけ送ることができる。"
9656
9657 #. type: Plain text
9658 #: build/C/man7/pthreads.7:786
9659 msgid ""
9660 "Threads have distinct alternate signal stack settings.  However, a new "
9661 "thread's alternate signal stack settings are copied from the thread that "
9662 "created it, so that the threads initially share an alternate signal stack.  "
9663 "(A new thread should start with no alternate signal stack defined.  If two "
9664 "threads handle signals on their shared alternate signal stack at the same "
9665 "time, unpredictable program failures are likely to occur.)"
9666 msgstr ""
9667 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
9668 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
9669 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
9670 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
9671 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
9672 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
9673
9674 #. type: SS
9675 #: build/C/man7/pthreads.7:786
9676 #, no-wrap
9677 msgid "NPTL"
9678 msgstr "NPTL"
9679
9680 #. type: Plain text
9681 #: build/C/man7/pthreads.7:795
9682 msgid ""
9683 "With NPTL, all of the threads in a process are placed in the same thread "
9684 "group; all members of a thread group share the same PID.  NPTL does not "
9685 "employ a manager thread.  NPTL makes internal use of the first two real-time "
9686 "signals (see also B<signal>(7)); these signals cannot be used in "
9687 "applications."
9688 msgstr ""
9689 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
9690 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
9691 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
9692 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
9693 "ションでは使用できない。"
9694
9695 #. type: Plain text
9696 #: build/C/man7/pthreads.7:797
9697 msgid "NPTL still has at least one nonconformance with POSIX.1:"
9698 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
9699
9700 #. type: Plain text
9701 #: build/C/man7/pthreads.7:806
9702 msgid "Some NPTL nonconformances only occur with older kernels:"
9703 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
9704
9705 #. type: Plain text
9706 #: build/C/man7/pthreads.7:812
9707 msgid ""
9708 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
9709 "rather than process-wide (fixed in kernel 2.6.9)."
9710 msgstr ""
9711 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
9712 "単位の情報である (カーネル 2.6.9 で修正された)。"
9713
9714 #. type: Plain text
9715 #: build/C/man7/pthreads.7:814
9716 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
9717 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
9718
9719 #. type: Plain text
9720 #: build/C/man7/pthreads.7:816
9721 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
9722 msgstr ""
9723 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
9724
9725 #. type: Plain text
9726 #: build/C/man7/pthreads.7:820
9727 msgid ""
9728 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
9729 "(fixed in kernel 2.6.16)."
9730 msgstr ""
9731 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
9732 "きる (カーネル 2.6.16 で修正された)。"
9733
9734 #. type: Plain text
9735 #: build/C/man7/pthreads.7:825
9736 msgid ""
9737 "Only the main thread is permitted to make the process into a process group "
9738 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
9739 msgstr ""
9740 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセス・グルー"
9741 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
9742
9743 #. type: Plain text
9744 #: build/C/man7/pthreads.7:831
9745 msgid ""
9746 "Threads have distinct alternate signal stack settings.  However, a new "
9747 "thread's alternate signal stack settings are copied from the thread that "
9748 "created it, so that the threads initially share an alternate signal stack "
9749 "(fixed in kernel 2.6.16)."
9750 msgstr ""
9751 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
9752 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
9753 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
9754 "ル 2.6.16 で修正された)。"
9755
9756 #. type: Plain text
9757 #: build/C/man7/pthreads.7:833
9758 msgid "Note the following further points about the NPTL implementation:"
9759 msgstr "NPTL の実装では以下の点についても注意すること:"
9760
9761 #. type: Plain text
9762 #: build/C/man7/pthreads.7:847
9763 msgid ""
9764 "If the stack size soft resource limit (see the description of "
9765 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
9766 "I<unlimited>, then this value defines the default stack size for new "
9767 "threads.  To be effective, this limit must be set before the program is "
9768 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
9769 "stacksize> in the C shell)."
9770 msgstr ""
9771 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2)  の "
9772 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
9773 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
9774 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
9775 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
9776 "は I<limit stacksize>)  を使って設定する。"
9777
9778 #. type: SS
9779 #: build/C/man7/pthreads.7:847
9780 #, no-wrap
9781 msgid "Determining the Threading Implementation"
9782 msgstr "スレッド実装の判定"
9783
9784 #. type: Plain text
9785 #: build/C/man7/pthreads.7:852
9786 msgid ""
9787 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
9788 "system's threading implementation, for example:"
9789 msgstr ""
9790 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
9791 "装を判定することができる。 以下に例を示す:"
9792
9793 #. type: Plain text
9794 #: build/C/man7/pthreads.7:857
9795 #, no-wrap
9796 msgid ""
9797 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
9798 "NPTL 2.3.4\n"
9799 msgstr ""
9800 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
9801 "NPTL 2.3.4\n"
9802
9803 #. type: Plain text
9804 #: build/C/man7/pthreads.7:862
9805 msgid ""
9806 "With older glibc versions, a command such as the following should be "
9807 "sufficient to determine the default threading implementation:"
9808 msgstr ""
9809 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
9810 "ド実装を判定することができる。"
9811
9812 #. type: Plain text
9813 #: build/C/man7/pthreads.7:868
9814 #, no-wrap
9815 msgid ""
9816 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
9817 "                egrep -i \\(aqthreads|nptl\\(aq\n"
9818 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
9819 msgstr ""
9820 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
9821 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
9822 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
9823
9824 #. type: SS
9825 #: build/C/man7/pthreads.7:870
9826 #, no-wrap
9827 msgid "Selecting the Threading Implementation: LD_ASSUME_KERNEL"
9828 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
9829
9830 #. type: Plain text
9831 #: build/C/man7/pthreads.7:885
9832 msgid ""
9833 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
9834 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
9835 "override the dynamic linker's default choice of threading implementation.  "
9836 "This variable tells the dynamic linker to assume that it is running on top "
9837 "of a particular kernel version.  By specifying a kernel version that does "
9838 "not provide the support required by NPTL, we can force the use of "
9839 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
9840 "application that depends on some nonconformant behavior in LinuxThreads.)  "
9841 "For example:"
9842 msgstr ""
9843 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
9844 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
9845 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
9846 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
9847 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
9848 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
9849 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
9850 "ン を動作させる場合だろう)。 以下に例を示す:"
9851
9852 #. type: Plain text
9853 #: build/C/man7/pthreads.7:891
9854 #, no-wrap
9855 msgid ""
9856 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
9857 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
9858 "        linuxthreads-0.10 by Xavier Leroy\n"
9859 msgstr ""
9860 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
9861 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
9862 "        linuxthreads-0.10 by Xavier Leroy\n"
9863
9864 #. type: Plain text
9865 #: build/C/man7/pthreads.7:903
9866 msgid ""
9867 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), B<sigevent>"
9868 "(7), B<signal>(7),"
9869 msgstr ""
9870 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
9871 "B<signal>(7),"
9872
9873 #. type: Plain text
9874 #: build/C/man7/pthreads.7:927
9875 msgid ""
9876 "and various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
9877 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9878 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
9879 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
9880 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
9881 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>"
9882 "(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), "
9883 "B<pthread_sigmask>(3), B<pthread_sigqueue>(3), and B<pthread_testcancel>(3)"
9884 msgstr ""
9885 "および Pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
9886 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
9887 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
9888 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
9889 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
9890 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
9891 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
9892 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
9893 "and B<pthread_testcancel>(3)"
9894
9895 #~ msgid "2008-11-10"
9896 #~ msgstr "2008-11-10"
9897
9898 #~ msgid "2008-11-05"
9899 #~ msgstr "2008-11-05"
9900
9901 #~ msgid "2008-11-18"
9902 #~ msgstr "2008-11-18"