OSDN Git Service

520b3be655cf9170ac1e514898d505992b4623dd
[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-03-22 04:26+0900\n"
10 "PO-Revision-Date: 2012-03-22 20:52+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:36
183 #: build/C/man3/pthread_attr_setaffinity_np.3:39
184 #: build/C/man3/pthread_attr_setdetachstate.3:38
185 #: build/C/man3/pthread_attr_setguardsize.3:38
186 #: build/C/man3/pthread_attr_setinheritsched.3:38
187 #: build/C/man3/pthread_attr_setschedparam.3:38
188 #: build/C/man3/pthread_attr_setschedpolicy.3:38
189 #: build/C/man3/pthread_attr_setscope.3:38
190 #: build/C/man3/pthread_attr_setstack.3:52
191 #: build/C/man3/pthread_attr_setstackaddr.3:38
192 #: build/C/man3/pthread_attr_setstacksize.3:38
193 #: build/C/man3/pthread_cancel.3:34 build/C/man3/pthread_cleanup_push.3:37
194 #: build/C/man3/pthread_cleanup_push_defer_np.3:37
195 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
196 #: build/C/man3/pthread_equal.3:34 build/C/man3/pthread_exit.3:34
197 #: build/C/man3/pthread_getattr_np.3:35
198 #: build/C/man3/pthread_getcpuclockid.3:35 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:34 build/C/man3/pthread_setaffinity_np.3:39
202 #: build/C/man3/pthread_setcancelstate.3:36
203 #: build/C/man3/pthread_setconcurrency.3:35
204 #: build/C/man3/pthread_setschedparam.3:38
205 #: build/C/man3/pthread_setschedprio.3:34 build/C/man3/pthread_sigmask.3:36
206 #: build/C/man3/pthread_sigqueue.3:43 build/C/man3/pthread_testcancel.3:34
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:65
342 #: build/C/man3/pthread_attr_setaffinity_np.3:73
343 #: build/C/man3/pthread_attr_setdetachstate.3:74
344 #: build/C/man3/pthread_attr_setguardsize.3:87
345 #: build/C/man3/pthread_attr_setinheritsched.3:81
346 #: build/C/man3/pthread_attr_setschedparam.3:71
347 #: build/C/man3/pthread_attr_setschedpolicy.3:69
348 #: build/C/man3/pthread_attr_setscope.3:88
349 #: build/C/man3/pthread_attr_setstack.3:83
350 #: build/C/man3/pthread_attr_setstackaddr.3:71
351 #: build/C/man3/pthread_attr_setstacksize.3:58
352 #: build/C/man3/pthread_cancel.3:106 build/C/man3/pthread_cleanup_push.3:116
353 #: build/C/man3/pthread_create.3:113 build/C/man3/pthread_detach.3:47
354 #: build/C/man3/pthread_equal.3:38 build/C/man3/pthread_exit.3:68
355 #: build/C/man3/pthread_getattr_np.3:70
356 #: build/C/man3/pthread_getcpuclockid.3:43 build/C/man3/pthread_join.3:68
357 #: build/C/man3/pthread_kill.3:50 build/C/man3/pthread_self.3:43
358 #: build/C/man3/pthread_setaffinity_np.3:74
359 #: build/C/man3/pthread_setcancelstate.3:89
360 #: build/C/man3/pthread_setconcurrency.3:53
361 #: build/C/man3/pthread_setschedparam.3:101
362 #: build/C/man3/pthread_setschedprio.3:50 build/C/man3/pthread_sigmask.3:47
363 #: build/C/man3/pthread_sigqueue.3:63 build/C/man3/pthread_testcancel.3:47
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:68
381 #: build/C/man3/pthread_attr_setaffinity_np.3:76
382 #: build/C/man3/pthread_attr_setdetachstate.3:77
383 #: build/C/man3/pthread_attr_setguardsize.3:90
384 #: build/C/man3/pthread_attr_setinheritsched.3:84
385 #: build/C/man3/pthread_attr_setschedparam.3:74
386 #: build/C/man3/pthread_attr_setschedpolicy.3:72
387 #: build/C/man3/pthread_attr_setscope.3:91
388 #: build/C/man3/pthread_attr_setstack.3:86
389 #: build/C/man3/pthread_attr_setstackaddr.3:74
390 #: build/C/man3/pthread_attr_setstacksize.3:61
391 #: build/C/man3/pthread_cancel.3:111 build/C/man3/pthread_cleanup_push.3:118
392 #: build/C/man3/pthread_create.3:120 build/C/man3/pthread_detach.3:52
393 #: build/C/man3/pthread_equal.3:42 build/C/man3/pthread_exit.3:70
394 #: build/C/man3/pthread_getattr_np.3:73
395 #: build/C/man3/pthread_getcpuclockid.3:46 build/C/man3/pthread_join.3:73
396 #: build/C/man3/pthread_kill.3:55 build/C/man3/pthread_self.3:45
397 #: build/C/man3/pthread_setaffinity_np.3:77
398 #: build/C/man3/pthread_setcancelstate.3:92
399 #: build/C/man3/pthread_setconcurrency.3:65
400 #: build/C/man3/pthread_setschedparam.3:109
401 #: build/C/man3/pthread_setschedprio.3:58 build/C/man3/pthread_sigmask.3:52
402 #: build/C/man3/pthread_sigqueue.3:68 build/C/man3/pthread_testcancel.3:51
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:76
416 #: build/C/man3/pthread_attr_setaffinity_np.3:105
417 #: build/C/man3/pthread_attr_setdetachstate.3:84
418 #: build/C/man3/pthread_attr_setguardsize.3:103
419 #: build/C/man3/pthread_attr_setinheritsched.3:98
420 #: build/C/man3/pthread_attr_setschedparam.3:86
421 #: build/C/man3/pthread_attr_setschedpolicy.3:86
422 #: build/C/man3/pthread_attr_setscope.3:104
423 #: build/C/man3/pthread_attr_setstack.3:110
424 #: build/C/man3/pthread_attr_setstackaddr.3:80
425 #: build/C/man3/pthread_attr_setstacksize.3:80
426 #: build/C/man3/pthread_cancel.3:119 build/C/man3/pthread_cleanup_push.3:122
427 #: build/C/man3/pthread_cleanup_push_defer_np.3:98
428 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:62
429 #: build/C/man3/pthread_equal.3:44 build/C/man3/pthread_exit.3:72
430 #: build/C/man3/pthread_getattr_np.3:95
431 #: build/C/man3/pthread_getcpuclockid.3:62 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:47 build/C/man3/pthread_setaffinity_np.3:118
435 #: build/C/man3/pthread_setcancelstate.3:110
436 #: build/C/man3/pthread_setconcurrency.3:80
437 #: build/C/man3/pthread_setschedparam.3:138
438 #: build/C/man3/pthread_setschedprio.3:80 build/C/man3/pthread_sigmask.3:55
439 #: build/C/man3/pthread_sigqueue.3:91 build/C/man3/pthread_testcancel.3:55
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:78
459 #: build/C/man3/pthread_attr_setaffinity_np.3:108
460 #: build/C/man3/pthread_attr_setdetachstate.3:86
461 #: build/C/man3/pthread_attr_setguardsize.3:105
462 #: build/C/man3/pthread_attr_setschedparam.3:91
463 #: build/C/man3/pthread_attr_setscope.3:106
464 #: build/C/man3/pthread_attr_setstack.3:112
465 #: build/C/man3/pthread_attr_setstackaddr.3:83
466 #: build/C/man3/pthread_attr_setstacksize.3:85
467 #: build/C/man3/pthread_cancel.3:121 build/C/man3/pthread_cleanup_push.3:124
468 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
469 #: build/C/man3/pthread_equal.3:46 build/C/man3/pthread_exit.3:74
470 #: build/C/man3/pthread_getcpuclockid.3:64 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:49 build/C/man3/pthread_setaffinity_np.3:121
474 #: build/C/man3/pthread_setcancelstate.3:112
475 #: build/C/man3/pthread_setconcurrency.3:82
476 #: build/C/man3/pthread_setschedparam.3:140
477 #: build/C/man3/pthread_setschedprio.3:82 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:294
520 #: build/C/man3/pthread_attr_setaffinity_np.3:115
521 #: build/C/man3/pthread_attr_setdetachstate.3:108
522 #: build/C/man3/pthread_attr_setguardsize.3:155
523 #: build/C/man3/pthread_attr_setinheritsched.3:119
524 #: build/C/man3/pthread_attr_setschedparam.3:95
525 #: build/C/man3/pthread_attr_setschedpolicy.3:91
526 #: build/C/man3/pthread_attr_setscope.3:117
527 #: build/C/man3/pthread_attr_setstack.3:154
528 #: build/C/man3/pthread_attr_setstackaddr.3:107
529 #: build/C/man3/pthread_attr_setstacksize.3:108
530 #: build/C/man3/pthread_cancel.3:220 build/C/man3/pthread_cleanup_push.3:308
531 #: build/C/man3/pthread_cleanup_push_defer_np.3:101
532 #: build/C/man3/pthread_create.3:367 build/C/man3/pthread_detach.3:95
533 #: build/C/man3/pthread_equal.3:53 build/C/man3/pthread_exit.3:102
534 #: build/C/man3/pthread_getattr_np.3:342
535 #: build/C/man3/pthread_getcpuclockid.3:166 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:73 build/C/man3/pthread_setaffinity_np.3:203
539 #: build/C/man3/pthread_setcancelstate.3:174
540 #: build/C/man3/pthread_setconcurrency.3:97
541 #: build/C/man3/pthread_setschedparam.3:428
542 #: build/C/man3/pthread_setschedprio.3:88 build/C/man3/pthread_sigmask.3:133
543 #: build/C/man3/pthread_sigqueue.3:93 build/C/man3/pthread_testcancel.3:60
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:308
562 #: build/C/man3/pthread_attr_setaffinity_np.3:121
563 #: build/C/man3/pthread_attr_setdetachstate.3:114
564 #: build/C/man3/pthread_attr_setguardsize.3:163
565 #: build/C/man3/pthread_attr_setinheritsched.3:128
566 #: build/C/man3/pthread_attr_setschedparam.3:105
567 #: build/C/man3/pthread_attr_setschedpolicy.3:100
568 #: build/C/man3/pthread_attr_setscope.3:125
569 #: build/C/man3/pthread_attr_setstack.3:164
570 #: build/C/man3/pthread_attr_setstackaddr.3:113
571 #: build/C/man3/pthread_attr_setstacksize.3:115
572 #: build/C/man3/pthread_cancel.3:230 build/C/man3/pthread_cleanup_push.3:314
573 #: build/C/man3/pthread_cleanup_push_defer_np.3:107
574 #: build/C/man3/pthread_create.3:378 build/C/man3/pthread_detach.3:102
575 #: build/C/man3/pthread_equal.3:57 build/C/man3/pthread_exit.3:106
576 #: build/C/man3/pthread_getattr_np.3:356
577 #: build/C/man3/pthread_getcpuclockid.3:174 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:77 build/C/man3/pthread_setaffinity_np.3:211
581 #: build/C/man3/pthread_setcancelstate.3:179
582 #: build/C/man3/pthread_setconcurrency.3:100
583 #: build/C/man3/pthread_setschedparam.3:440
584 #: build/C/man3/pthread_setschedprio.3:100 build/C/man3/pthread_sigmask.3:142
585 #: build/C/man3/pthread_sigqueue.3:101 build/C/man3/pthread_testcancel.3:65
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:315
595 #: build/C/man3/pthread_attr_setaffinity_np.3:128
596 #: build/C/man3/pthread_attr_setdetachstate.3:121
597 #: build/C/man3/pthread_attr_setguardsize.3:170
598 #: build/C/man3/pthread_attr_setinheritsched.3:135
599 #: build/C/man3/pthread_attr_setschedparam.3:112
600 #: build/C/man3/pthread_attr_setschedpolicy.3:107
601 #: build/C/man3/pthread_attr_setscope.3:132
602 #: build/C/man3/pthread_attr_setstack.3:171
603 #: build/C/man3/pthread_attr_setstackaddr.3:120
604 #: build/C/man3/pthread_attr_setstacksize.3:122
605 #: build/C/man3/pthread_cancel.3:237 build/C/man3/pthread_cleanup_push.3:321
606 #: build/C/man3/pthread_cleanup_push_defer_np.3:114
607 #: build/C/man3/pthread_create.3:385 build/C/man3/pthread_detach.3:109
608 #: build/C/man3/pthread_equal.3:64 build/C/man3/pthread_exit.3:113
609 #: build/C/man3/pthread_getattr_np.3:363
610 #: build/C/man3/pthread_getcpuclockid.3:181 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:84 build/C/man3/pthread_setaffinity_np.3:218
614 #: build/C/man3/pthread_setcancelstate.3:186
615 #: build/C/man3/pthread_setconcurrency.3:107
616 #: build/C/man3/pthread_setschedparam.3:447
617 #: build/C/man3/pthread_setschedprio.3:107 build/C/man3/pthread_sigmask.3:149
618 #: build/C/man3/pthread_sigqueue.3:108 build/C/man3/pthread_testcancel.3:72
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.37 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
627 #. type: TH
628 #: build/C/man3/makecontext.3:25
629 #, no-wrap
630 msgid "MAKECONTEXT"
631 msgstr "MAKECONTEXT"
632
633 #. type: TH
634 #: build/C/man3/makecontext.3:25
635 #, no-wrap
636 msgid "2009-03-31"
637 msgstr "2009-03-31"
638
639 #. type: TH
640 #: build/C/man3/makecontext.3:25
641 #, no-wrap
642 msgid "GNU"
643 msgstr "GNU"
644
645 #. type: Plain text
646 #: build/C/man3/makecontext.3:28
647 msgid "makecontext, swapcontext - manipulate user context"
648 msgstr "makecontext, swapcontext - ユーザコンテキストを操作する"
649
650 #. type: Plain text
651 #: build/C/man3/makecontext.3:33
652 msgid ""
653 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
654 ">I<argc>B<, ...);>"
655 msgstr ""
656 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
657 ">I<argc>B<, ...);>"
658
659 #. type: Plain text
660 #: build/C/man3/makecontext.3:35
661 msgid "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
662 msgstr "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
663
664 #. type: Plain text
665 #: build/C/man3/makecontext.3:46
666 msgid ""
667 "In a System V-like environment, one has the type I<ucontext_t> defined in "
668 "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(2), "
669 "B<setcontext>(2), B<makecontext>()  and B<swapcontext>()  that allow user-"
670 "level context switching between multiple threads of control within a process."
671 msgstr ""
672 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
673 "と、 B<getcontext>(2), B<setcontext>(2), B<makecontext>(), B<swapcontext>()  "
674 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
675 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
676 "ようになっている。"
677
678 #. type: Plain text
679 #: build/C/man3/makecontext.3:49
680 msgid "For the type and the first two functions, see B<getcontext>(2)."
681 msgstr ""
682 "これらの型と、最初の 2 つの関数については、 B<getcontext>(2)  を参照のこと。"
683
684 #. type: Plain text
685 #: build/C/man3/makecontext.3:61
686 msgid ""
687 "The B<makecontext>()  function modifies the context pointed to by I<ucp> "
688 "(which was obtained from a call to B<getcontext>(2)).  Before invoking "
689 "B<makecontext>(), the caller must allocate a new stack for this context and "
690 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
691 "and assign its address to I<ucp-E<gt>uc_link>."
692 msgstr ""
693 "B<makecontext>()  関数は、ポインタ I<ucp> が指すコンテキストを変更する "
694 "(I<ucp> は以前の B<getcontext>(2)  呼び出しで得られたものである)。 "
695 "B<makecontext>()  を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
696 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
697 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
698 "らない。"
699
700 #. type: Plain text
701 #: build/C/man3/makecontext.3:75
702 msgid ""
703 "When this context is later activated (using B<setcontext>(2)  or "
704 "B<swapcontext>())  the function I<func> is called, and passed the series of "
705 "integer (I<int>)  arguments that follow I<argc>; the caller must specify the "
706 "number of these arguments in I<argc>.  When this function returns, the "
707 "successor context is activated.  If the successor context pointer is NULL, "
708 "the thread exits."
709 msgstr ""
710 "このコンテキストが将来 (B<setcontext>(2)  または B<swapcontext>()  によっ"
711 "て)  有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 "
712 "(I<int>)  引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数"
713 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
714 "る。 後継コンテキストのポインタが NULL の場合、そのスレッドが終了する。"
715
716 #. type: Plain text
717 #: build/C/man3/makecontext.3:81
718 msgid ""
719 "The B<swapcontext>()  function saves the current context in the structure "
720 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
721 msgstr ""
722 "B<swapcontext>()  関数は現在のコンテキストを ポインタ I<oucp> が指す構造体に"
723 "保存し、 ポインタ I<ucp> が指すコンテキストを有効にする。"
724
725 #. type: Plain text
726 #: build/C/man3/makecontext.3:93
727 msgid ""
728 "When successful, B<swapcontext>()  does not return.  (But we may return "
729 "later, in case I<oucp> is activated, in which case it looks like "
730 "B<swapcontext>()  returns 0.)  On error, B<swapcontext>()  returns -1 and "
731 "sets I<errno> appropriately."
732 msgstr ""
733 "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった"
734 "場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見え"
735 "る。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じ"
736 "て設定する。"
737
738 #. type: TP
739 #: build/C/man3/makecontext.3:94 build/C/man3/pthread_attr_setaffinity_np.3:99
740 #: build/C/man3/pthread_getattr_np.3:74
741 #, no-wrap
742 msgid "B<ENOMEM>"
743 msgstr "B<ENOMEM>"
744
745 #. type: Plain text
746 #: build/C/man3/makecontext.3:97
747 msgid "Insufficient stack space left."
748 msgstr "スタックに割り当てる空間が残っていない。"
749
750 #. type: SH
751 #: build/C/man3/makecontext.3:97
752 #: build/C/man3/pthread_attr_setaffinity_np.3:103
753 #: build/C/man3/pthread_attr_setguardsize.3:101
754 #: build/C/man3/pthread_attr_setstack.3:108
755 #: build/C/man3/pthread_attr_setstackaddr.3:78
756 #: build/C/man3/pthread_attr_setstacksize.3:78
757 #: build/C/man3/pthread_getattr_np.3:93
758 #: build/C/man3/pthread_getcpuclockid.3:60
759 #: build/C/man3/pthread_setaffinity_np.3:116
760 #: build/C/man3/pthread_setconcurrency.3:78
761 #: build/C/man3/pthread_setschedprio.3:78 build/C/man3/pthread_sigqueue.3:87
762 #: build/C/man3/pthread_tryjoin_np.3:108
763 #, no-wrap
764 msgid "VERSIONS"
765 msgstr "バージョン"
766
767 #. type: Plain text
768 #: build/C/man3/makecontext.3:102
769 msgid ""
770 "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version "
771 "2.1."
772 msgstr ""
773 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
774 "されている。"
775
776 #. type: Plain text
777 #: build/C/man3/makecontext.3:110
778 msgid ""
779 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specifications of "
780 "B<makecontext>()  and B<swapcontext>(), citing portability issues, and "
781 "recommending that applications be rewritten to use POSIX threads instead."
782 msgstr ""
783 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  "
784 "と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを "
785 "POSIX スレッドを使って書き直すことが 推奨されている。"
786
787 #. type: Plain text
788 #: build/C/man3/makecontext.3:118
789 msgid ""
790 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
791 "namely, this struct contains the start and length of a memory area to be "
792 "used as the stack, regardless of the direction of growth of the stack.  "
793 "Thus, it is not necessary for the user program to worry about this direction."
794 msgstr ""
795 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわ"
796 "ちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含"
797 "まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
798 "て、ユーザプログラムはこの件については心配しなくてよい。"
799
800 #. type: Plain text
801 #: build/C/man3/makecontext.3:134
802 msgid ""
803 "On architectures where I<int> and pointer types are the same size (e.g., "
804 "x86-32, where both types are 32 bits), you may be able to get away with "
805 "passing pointers as arguments to B<makecontext>()  following I<argc>.  "
806 "However, doing this is not guaranteed to be portable, is undefined according "
807 "to the standards, and won't work on architectures where pointers are larger "
808 "than I<int>s.  Nevertheless, starting with version 2.8, glibc makes some "
809 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
810 "g., x86-64)."
811 msgstr ""
812 "I<int> とポインタ型が同じ大きさであるアーキテクチャでは (x86-32 はその例であ"
813 "り、両方の型とも 32 ビットである)、 B<makecontext>()  の I<argc> 以降の引き数"
814 "としてポインタを渡してもうまく動くかもしれない。 しかしながら、このようにする"
815 "と、移植性は保証されず、 標準に従えば動作は未定義であり、ポインタが I<int> よ"
816 "りも大きいアーキテクチャでは正しく動作しないことだろう。 それにも関わらず、"
817 "バージョン 2.8 以降の glibc では、 B<makecontext>()  に変更が行われ、(x86-64 "
818 "などの) いくつかの 64 ビットアーキテクチャで 引き数としてポインタを渡すことが"
819 "できるようになっている。"
820
821 #. type: SH
822 #: build/C/man3/makecontext.3:134 build/C/man3/pthread_attr_init.3:84
823 #: build/C/man3/pthread_attr_setdetachstate.3:105
824 #: build/C/man3/pthread_attr_setguardsize.3:152
825 #: build/C/man3/pthread_attr_setinheritsched.3:100
826 #: build/C/man3/pthread_attr_setschedparam.3:88
827 #: build/C/man3/pthread_attr_setschedpolicy.3:88
828 #: build/C/man3/pthread_attr_setstack.3:151
829 #: build/C/man3/pthread_attr_setstacksize.3:82
830 #: build/C/man3/pthread_cancel.3:129 build/C/man3/pthread_cleanup_push.3:148
831 #: build/C/man3/pthread_create.3:194 build/C/man3/pthread_detach.3:91
832 #: build/C/man3/pthread_getattr_np.3:98
833 #: build/C/man3/pthread_getcpuclockid.3:75 build/C/man3/pthread_join.3:122
834 #: build/C/man3/pthread_setaffinity_np.3:151
835 #: build/C/man3/pthread_setcancelstate.3:171
836 #: build/C/man3/pthread_setschedparam.3:146 build/C/man3/pthread_sigmask.3:59
837 #: build/C/man3/pthread_testcancel.3:57 build/C/man3/pthread_tryjoin_np.3:113
838 #, no-wrap
839 msgid "EXAMPLE"
840 msgstr "例"
841
842 #. type: Plain text
843 #: build/C/man3/makecontext.3:142
844 msgid ""
845 "The example program below demonstrates the use of B<getcontext>(2), "
846 "B<makecontext>(), and B<swapcontext>().  Running the program produces the "
847 "following output:"
848 msgstr ""
849 "以下のサンプル・プログラムは、 B<getcontext>(2), B<makecontext>(), "
850 "B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行する"
851 "と、以下のような出力が得られる:"
852
853 #. type: Plain text
854 #: build/C/man3/makecontext.3:154
855 #, no-wrap
856 msgid ""
857 "$B< ./a.out>\n"
858 "main: swapcontext(&uctx_main, &uctx_func2)\n"
859 "func2: started\n"
860 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
861 "func1: started\n"
862 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
863 "func2: returning\n"
864 "func1: returning\n"
865 "main: exiting\n"
866 msgstr ""
867 "$B< ./a.out>\n"
868 "main: swapcontext(&uctx_main, &uctx_func2)\n"
869 "func2: started\n"
870 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
871 "func1: started\n"
872 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
873 "func2: returning\n"
874 "func1: returning\n"
875 "main: exiting\n"
876
877 #. type: SS
878 #: build/C/man3/makecontext.3:156 build/C/man3/pthread_attr_init.3:145
879 #: build/C/man3/pthread_cancel.3:145 build/C/man3/pthread_cleanup_push.3:224
880 #: build/C/man3/pthread_create.3:233 build/C/man3/pthread_getattr_np.3:176
881 #: build/C/man3/pthread_getcpuclockid.3:92
882 #: build/C/man3/pthread_setschedparam.3:221 build/C/man3/pthread_sigmask.3:77
883 #, no-wrap
884 msgid "Program source"
885 msgstr "プログラムのソース"
886
887 #. type: Plain text
888 #: build/C/man3/makecontext.3:162
889 #, no-wrap
890 msgid ""
891 "#include E<lt>ucontext.hE<gt>\n"
892 "#include E<lt>stdio.hE<gt>\n"
893 "#include E<lt>stdlib.hE<gt>\n"
894 msgstr ""
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
899 #. type: Plain text
900 #: build/C/man3/makecontext.3:164
901 #, no-wrap
902 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
903 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
904
905 #. type: Plain text
906 #: build/C/man3/makecontext.3:167
907 #, no-wrap
908 msgid ""
909 "#define handle_error(msg) \\e\n"
910 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
911 msgstr ""
912 "#define handle_error(msg) \\e\n"
913 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
914
915 #. type: Plain text
916 #: build/C/man3/makecontext.3:177
917 #, no-wrap
918 msgid ""
919 "static void\n"
920 "func1(void)\n"
921 "{\n"
922 "    printf(\"func1: started\\en\");\n"
923 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
924 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
925 "        handle_error(\"swapcontext\");\n"
926 "    printf(\"func1: returning\\en\");\n"
927 "}\n"
928 msgstr ""
929 "static void\n"
930 "func1(void)\n"
931 "{\n"
932 "    printf(\"func1: started\\en\");\n"
933 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
934 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
935 "        handle_error(\"swapcontext\");\n"
936 "    printf(\"func1: returning\\en\");\n"
937 "}\n"
938
939 #. type: Plain text
940 #: build/C/man3/makecontext.3:187
941 #, no-wrap
942 msgid ""
943 "static void\n"
944 "func2(void)\n"
945 "{\n"
946 "    printf(\"func2: started\\en\");\n"
947 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
948 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
949 "        handle_error(\"swapcontext\");\n"
950 "    printf(\"func2: returning\\en\");\n"
951 "}\n"
952 msgstr ""
953 "static void\n"
954 "func2(void)\n"
955 "{\n"
956 "    printf(\"func2: started\\en\");\n"
957 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
958 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
959 "        handle_error(\"swapcontext\");\n"
960 "    printf(\"func2: returning\\en\");\n"
961 "}\n"
962
963 #. type: Plain text
964 #: build/C/man3/makecontext.3:193
965 #, no-wrap
966 msgid ""
967 "int\n"
968 "main(int argc, char *argv[])\n"
969 "{\n"
970 "    char func1_stack[16384];\n"
971 "    char func2_stack[16384];\n"
972 msgstr ""
973 "int\n"
974 "main(int argc, char *argv[])\n"
975 "{\n"
976 "    char func1_stack[16384];\n"
977 "    char func2_stack[16384];\n"
978
979 #. type: Plain text
980 #: build/C/man3/makecontext.3:200
981 #, no-wrap
982 msgid ""
983 "    if (getcontext(&uctx_func1) == -1)\n"
984 "        handle_error(\"getcontext\");\n"
985 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
986 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
987 "    uctx_func1.uc_link = &uctx_main;\n"
988 "    makecontext(&uctx_func1, func1, 0);\n"
989 msgstr ""
990 "    if (getcontext(&uctx_func1) == -1)\n"
991 "        handle_error(\"getcontext\");\n"
992 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
993 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
994 "    uctx_func1.uc_link = &uctx_main;\n"
995 "    makecontext(&uctx_func1, func1, 0);\n"
996
997 #. type: Plain text
998 #: build/C/man3/makecontext.3:208
999 #, no-wrap
1000 msgid ""
1001 "    if (getcontext(&uctx_func2) == -1)\n"
1002 "        handle_error(\"getcontext\");\n"
1003 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1004 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1005 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1006 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1007 "    makecontext(&uctx_func2, func2, 0);\n"
1008 msgstr ""
1009 "    if (getcontext(&uctx_func2) == -1)\n"
1010 "        handle_error(\"getcontext\");\n"
1011 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1012 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1013 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1014 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1015 "    makecontext(&uctx_func2, func2, 0);\n"
1016
1017 #. type: Plain text
1018 #: build/C/man3/makecontext.3:212
1019 #, no-wrap
1020 msgid ""
1021 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1022 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1023 "        handle_error(\"swapcontext\");\n"
1024 msgstr ""
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
1029 #. type: Plain text
1030 #: build/C/man3/makecontext.3:216
1031 #, no-wrap
1032 msgid ""
1033 "    printf(\"main: exiting\\en\");\n"
1034 "    exit(EXIT_SUCCESS);\n"
1035 "}\n"
1036 msgstr ""
1037 "    printf(\"main: exiting\\en\");\n"
1038 "    exit(EXIT_SUCCESS);\n"
1039 "}\n"
1040
1041 #. type: Plain text
1042 #: build/C/man3/makecontext.3:223
1043 msgid ""
1044 "B<getcontext>(2), B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), "
1045 "B<sigsetjmp>(3)"
1046 msgstr ""
1047 "B<getcontext>(2), B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), "
1048 "B<sigsetjmp>(3)"
1049
1050 #. type: TH
1051 #: build/C/man3/pthread_attr_init.3:24
1052 #, no-wrap
1053 msgid "PTHREAD_ATTR_INIT"
1054 msgstr "PTHREAD_ATTR_INIT"
1055
1056 #. type: TH
1057 #: build/C/man3/pthread_attr_init.3:24 build/C/man3/pthread_create.3:24
1058 #, no-wrap
1059 msgid "2008-11-11"
1060 msgstr "2008-11-11"
1061
1062 #. type: Plain text
1063 #: build/C/man3/pthread_attr_init.3:28
1064 msgid ""
1065 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1066 "attributes object"
1067 msgstr ""
1068
1069 #. type: Plain text
1070 #: build/C/man3/pthread_attr_init.3:31
1071 #: build/C/man3/pthread_attr_setdetachstate.3:31
1072 #: build/C/man3/pthread_attr_setguardsize.3:31
1073 #: build/C/man3/pthread_attr_setinheritsched.3:31
1074 #: build/C/man3/pthread_attr_setschedparam.3:31
1075 #: build/C/man3/pthread_attr_setschedpolicy.3:31
1076 #: build/C/man3/pthread_attr_setscope.3:31
1077 #: build/C/man3/pthread_attr_setstack.3:31
1078 #: build/C/man3/pthread_attr_setstackaddr.3:31
1079 #: build/C/man3/pthread_attr_setstacksize.3:31
1080 #: build/C/man3/pthread_cancel.3:30 build/C/man3/pthread_cleanup_push.3:31
1081 #: build/C/man3/pthread_cleanup_push_defer_np.3:31
1082 #: build/C/man3/pthread_create.3:30 build/C/man3/pthread_detach.3:30
1083 #: build/C/man3/pthread_equal.3:30 build/C/man3/pthread_exit.3:30
1084 #: build/C/man3/pthread_join.3:30
1085 #: build/C/man3/pthread_kill_other_threads_np.3:30
1086 #: build/C/man3/pthread_self.3:30 build/C/man3/pthread_setcancelstate.3:31
1087 #: build/C/man3/pthread_setconcurrency.3:30
1088 #: build/C/man3/pthread_setschedparam.3:31
1089 #: build/C/man3/pthread_setschedprio.3:30 build/C/man3/pthread_sigqueue.3:29
1090 #: build/C/man3/pthread_testcancel.3:30 build/C/man3/pthread_yield.3:29
1091 #, no-wrap
1092 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1093 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1094
1095 #. type: Plain text
1096 #: build/C/man3/pthread_attr_init.3:34
1097 #, no-wrap
1098 msgid ""
1099 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1100 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1101 msgstr ""
1102 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1103 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1104
1105 #. type: Plain text
1106 #: build/C/man3/pthread_attr_init.3:36
1107 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1108 #: build/C/man3/pthread_attr_setdetachstate.3:38
1109 #: build/C/man3/pthread_attr_setguardsize.3:38
1110 #: build/C/man3/pthread_attr_setinheritsched.3:38
1111 #: build/C/man3/pthread_attr_setschedparam.3:38
1112 #: build/C/man3/pthread_attr_setschedpolicy.3:38
1113 #: build/C/man3/pthread_attr_setscope.3:38
1114 #: build/C/man3/pthread_attr_setstack.3:38
1115 #: build/C/man3/pthread_attr_setstackaddr.3:38
1116 #: build/C/man3/pthread_attr_setstacksize.3:38
1117 #: build/C/man3/pthread_cancel.3:34 build/C/man3/pthread_cleanup_push.3:37
1118 #: build/C/man3/pthread_cleanup_push_defer_np.3:37
1119 #: build/C/man3/pthread_equal.3:34 build/C/man3/pthread_exit.3:34
1120 #: build/C/man3/pthread_getattr_np.3:35
1121 #: build/C/man3/pthread_getcpuclockid.3:35 build/C/man3/pthread_self.3:34
1122 #: build/C/man3/pthread_setaffinity_np.3:39
1123 #: build/C/man3/pthread_setcancelstate.3:36
1124 #: build/C/man3/pthread_setconcurrency.3:35
1125 #: build/C/man3/pthread_setschedparam.3:38
1126 #: build/C/man3/pthread_setschedprio.3:34 build/C/man3/pthread_testcancel.3:34
1127 #, no-wrap
1128 msgid "Compile and link with I<-pthread>.\n"
1129 msgstr ""
1130
1131 #. type: Plain text
1132 #: build/C/man3/pthread_attr_init.3:47
1133 msgid ""
1134 "The B<pthread_attr_init>()  function initializes the thread attributes "
1135 "object pointed to by I<attr> with default attribute values.  After this "
1136 "call, individual attributes of the object can be set using various related "
1137 "functions (listed under SEE ALSO), and then the object can be used in one or "
1138 "more B<pthread_create>(3)  calls that create threads."
1139 msgstr ""
1140
1141 #. type: Plain text
1142 #: build/C/man3/pthread_attr_init.3:52
1143 msgid ""
1144 "Calling B<pthread_attr_init>()  on a thread attributes object that has "
1145 "already been initialized results in undefined behavior."
1146 msgstr ""
1147
1148 #. type: Plain text
1149 #: build/C/man3/pthread_attr_init.3:59
1150 msgid ""
1151 "When a thread attributes object is no longer required, it should be "
1152 "destroyed using the B<pthread_attr_destroy>()  function.  Destroying a "
1153 "thread attributes object has no effect on threads that were created using "
1154 "that object."
1155 msgstr ""
1156
1157 #. type: Plain text
1158 #: build/C/man3/pthread_attr_init.3:65
1159 msgid ""
1160 "Once a thread attributes object has been destroyed, it can be reinitialized "
1161 "using B<pthread_attr_init>().  Any other use of a destroyed thread "
1162 "attributes object has undefined results."
1163 msgstr ""
1164
1165 #. type: Plain text
1166 #: build/C/man3/pthread_attr_init.3:68
1167 #: build/C/man3/pthread_attr_setaffinity_np.3:76
1168 #: build/C/man3/pthread_attr_setdetachstate.3:77
1169 #: build/C/man3/pthread_attr_setguardsize.3:90
1170 #: build/C/man3/pthread_attr_setinheritsched.3:84
1171 #: build/C/man3/pthread_attr_setschedparam.3:74
1172 #: build/C/man3/pthread_attr_setschedpolicy.3:72
1173 #: build/C/man3/pthread_attr_setscope.3:91
1174 #: build/C/man3/pthread_attr_setstack.3:86
1175 #: build/C/man3/pthread_attr_setstackaddr.3:74
1176 #: build/C/man3/pthread_attr_setstacksize.3:61
1177 #: build/C/man3/pthread_setaffinity_np.3:77
1178 #: build/C/man3/pthread_setcancelstate.3:92
1179 msgid ""
1180 "On success, these functions return 0; on error, they return a nonzero error "
1181 "number."
1182 msgstr ""
1183
1184 #. type: Plain text
1185 #: build/C/man3/pthread_attr_init.3:76
1186 msgid ""
1187 "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on "
1188 "Linux these functions always succeed (but portable and future-proof "
1189 "applications should nevertheless handle a possible error return)."
1190 msgstr ""
1191
1192 #. type: Plain text
1193 #: build/C/man3/pthread_attr_init.3:78
1194 #: build/C/man3/pthread_attr_setdetachstate.3:86
1195 #: build/C/man3/pthread_attr_setguardsize.3:105
1196 #: build/C/man3/pthread_attr_setinheritsched.3:100
1197 #: build/C/man3/pthread_attr_setschedparam.3:88
1198 #: build/C/man3/pthread_attr_setschedpolicy.3:88
1199 #: build/C/man3/pthread_attr_setscope.3:106
1200 #: build/C/man3/pthread_attr_setstack.3:112
1201 #: build/C/man3/pthread_attr_setstacksize.3:82
1202 #: build/C/man3/pthread_cancel.3:121 build/C/man3/pthread_cleanup_push.3:124
1203 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
1204 #: build/C/man3/pthread_equal.3:46 build/C/man3/pthread_exit.3:74
1205 #: build/C/man3/pthread_getcpuclockid.3:64 build/C/man3/pthread_join.3:98
1206 #: build/C/man3/pthread_kill.3:66 build/C/man3/pthread_self.3:49
1207 #: build/C/man3/pthread_setcancelstate.3:112
1208 #: build/C/man3/pthread_setconcurrency.3:82
1209 #: build/C/man3/pthread_setschedparam.3:140
1210 #: build/C/man3/pthread_setschedprio.3:82 build/C/man3/pthread_sigmask.3:57
1211 #: build/C/man3/pthread_testcancel.3:57
1212 msgid "POSIX.1-2001."
1213 msgstr ""
1214
1215 #. type: Plain text
1216 #: build/C/man3/pthread_attr_init.3:84
1217 msgid ""
1218 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1219 "object other than via pthreads functions is nonportable and produces "
1220 "undefined results."
1221 msgstr ""
1222
1223 #. type: Plain text
1224 #: build/C/man3/pthread_attr_init.3:93
1225 msgid ""
1226 "The program below optionally makes use of B<pthread_attr_init>()  and "
1227 "various related functions to initialize a thread attributes object that is "
1228 "used to create a single thread.  Once created, the thread uses the "
1229 "B<pthread_getattr_np>(3)  function (a nonstandard GNU extension) to retrieve "
1230 "the thread's attributes, and then displays those attributes."
1231 msgstr ""
1232
1233 #. type: Plain text
1234 #: build/C/man3/pthread_attr_init.3:102
1235 msgid ""
1236 "If the program is run with no command-line argument, then it passes NULL as "
1237 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1238 "with default attributes.  Running the program on Linux/x86-32 with the NPTL "
1239 "threading implementation, we see the following:"
1240 msgstr ""
1241
1242 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1243 #. type: Plain text
1244 #: build/C/man3/pthread_attr_init.3:118
1245 #, no-wrap
1246 msgid ""
1247 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1248 "unlimited\n"
1249 "$B< ./a.out>\n"
1250 "Thread attributes:\n"
1251 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1252 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1253 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1254 "        Scheduling policy   = SCHED_OTHER\n"
1255 "        Scheduling priority = 0\n"
1256 "        Guard size          = 4096 bytes\n"
1257 "        Stack address       = 0x40196000\n"
1258 "        Stack size          = 0x201000 bytes\n"
1259 msgstr ""
1260 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1261 "unlimited\n"
1262 "$B< ./a.out>\n"
1263 "Thread attributes:\n"
1264 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1265 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1266 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1267 "        Scheduling policy   = SCHED_OTHER\n"
1268 "        Scheduling priority = 0\n"
1269 "        Guard size          = 4096 bytes\n"
1270 "        Stack address       = 0x40196000\n"
1271 "        Stack size          = 0x201000 bytes\n"
1272
1273 #. type: Plain text
1274 #: build/C/man3/pthread_attr_init.3:128
1275 msgid ""
1276 "When we supply a stack size as a command-line argument, the program "
1277 "initializes a thread attributes object, sets various attributes in that "
1278 "object, and passes a pointer to the object in the call to B<pthread_create>"
1279 "(3).  Running the program on Linux/x86-32 with the NPTL threading "
1280 "implementation, we see the following:"
1281 msgstr ""
1282
1283 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1284 #. type: Plain text
1285 #: build/C/man3/pthread_attr_init.3:143
1286 #, no-wrap
1287 msgid ""
1288 "$B< ./a.out 0x3000000>\n"
1289 "posix_memalign() allocated at 0x40197000\n"
1290 "Thread attributes:\n"
1291 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1292 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1293 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1294 "        Scheduling policy   = SCHED_OTHER\n"
1295 "        Scheduling priority = 0\n"
1296 "        Guard size          = 0 bytes\n"
1297 "        Stack address       = 0x40197000\n"
1298 "        Stack size          = 0x3000000 bytes\n"
1299 msgstr ""
1300 "$B< ./a.out 0x3000000>\n"
1301 "posix_memalign() allocated at 0x40197000\n"
1302 "Thread attributes:\n"
1303 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1304 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1305 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1306 "        Scheduling policy   = SCHED_OTHER\n"
1307 "        Scheduling priority = 0\n"
1308 "        Guard size          = 0 bytes\n"
1309 "        Stack address       = 0x40197000\n"
1310 "        Stack size          = 0x3000000 bytes\n"
1311
1312 #. type: Plain text
1313 #: build/C/man3/pthread_attr_init.3:154 build/C/man3/pthread_getattr_np.3:185
1314 #, no-wrap
1315 msgid ""
1316 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1317 "#include E<lt>pthread.hE<gt>\n"
1318 "#include E<lt>stdio.hE<gt>\n"
1319 "#include E<lt>stdlib.hE<gt>\n"
1320 "#include E<lt>unistd.hE<gt>\n"
1321 "#include E<lt>errno.hE<gt>\n"
1322 msgstr ""
1323 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1324 "#include E<lt>pthread.hE<gt>\n"
1325 "#include E<lt>stdio.hE<gt>\n"
1326 "#include E<lt>stdlib.hE<gt>\n"
1327 "#include E<lt>unistd.hE<gt>\n"
1328 "#include E<lt>errno.hE<gt>\n"
1329
1330 #. type: Plain text
1331 #: build/C/man3/pthread_attr_init.3:157 build/C/man3/pthread_cancel.3:156
1332 #: build/C/man3/pthread_cleanup_push.3:236 build/C/man3/pthread_create.3:246
1333 #: build/C/man3/pthread_getattr_np.3:188
1334 #: build/C/man3/pthread_getcpuclockid.3:110
1335 #: build/C/man3/pthread_setaffinity_np.3:169
1336 #: build/C/man3/pthread_setschedparam.3:234 build/C/man3/pthread_sigmask.3:91
1337 #, no-wrap
1338 msgid ""
1339 "#define handle_error_en(en, msg) \\e\n"
1340 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1341 msgstr ""
1342 "#define handle_error_en(en, msg) \\e\n"
1343 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1344
1345 #. type: Plain text
1346 #: build/C/man3/pthread_attr_init.3:165
1347 #, no-wrap
1348 msgid ""
1349 "static void\n"
1350 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1351 "{\n"
1352 "    int s, i;\n"
1353 "    size_t v;\n"
1354 "    void *stkaddr;\n"
1355 "    struct sched_param sp;\n"
1356 msgstr ""
1357 "static void\n"
1358 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1359 "{\n"
1360 "    int s, i;\n"
1361 "    size_t v;\n"
1362 "    void *stkaddr;\n"
1363 "    struct sched_param sp;\n"
1364
1365 #. type: Plain text
1366 #: build/C/man3/pthread_attr_init.3:173
1367 #, no-wrap
1368 msgid ""
1369 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1370 "    if (s != 0)\n"
1371 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1372 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1373 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1374 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1375 "            \"???\");\n"
1376 msgstr ""
1377 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1378 "    if (s != 0)\n"
1379 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1380 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1381 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1382 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1383 "            \"???\");\n"
1384
1385 #. type: Plain text
1386 #: build/C/man3/pthread_attr_init.3:181
1387 #, no-wrap
1388 msgid ""
1389 "    s = pthread_attr_getscope(attr, &i);\n"
1390 "    if (s != 0)\n"
1391 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1392 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1393 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1394 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1395 "            \"???\");\n"
1396 msgstr ""
1397 "    s = pthread_attr_getscope(attr, &i);\n"
1398 "    if (s != 0)\n"
1399 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1400 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1401 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1402 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1403 "            \"???\");\n"
1404
1405 #. type: Plain text
1406 #: build/C/man3/pthread_attr_init.3:189
1407 #, no-wrap
1408 msgid ""
1409 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1410 "    if (s != 0)\n"
1411 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1412 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1413 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1414 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1415 "            \"???\");\n"
1416 msgstr ""
1417 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1418 "    if (s != 0)\n"
1419 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1420 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1421 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1422 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1423 "            \"???\");\n"
1424
1425 #. type: Plain text
1426 #: build/C/man3/pthread_attr_init.3:198
1427 #, no-wrap
1428 msgid ""
1429 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1430 "    if (s != 0)\n"
1431 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1432 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1433 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1434 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1435 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1436 "            \"???\");\n"
1437 msgstr ""
1438 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1439 "    if (s != 0)\n"
1440 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1441 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1442 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1443 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1444 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1445 "            \"???\");\n"
1446
1447 #. type: Plain text
1448 #: build/C/man3/pthread_attr_init.3:203
1449 #, no-wrap
1450 msgid ""
1451 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1452 "    if (s != 0)\n"
1453 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1454 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1455 msgstr ""
1456 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1457 "    if (s != 0)\n"
1458 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1459 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1460
1461 #. type: Plain text
1462 #: build/C/man3/pthread_attr_init.3:208
1463 #, no-wrap
1464 msgid ""
1465 "    s = pthread_attr_getguardsize(attr, &v);\n"
1466 "    if (s != 0)\n"
1467 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1468 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1469 msgstr ""
1470 "    s = pthread_attr_getguardsize(attr, &v);\n"
1471 "    if (s != 0)\n"
1472 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1473 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1474
1475 #. type: Plain text
1476 #: build/C/man3/pthread_attr_init.3:215
1477 #, no-wrap
1478 msgid ""
1479 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1480 "    if (s != 0)\n"
1481 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1482 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1483 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1484 "}\n"
1485 msgstr ""
1486 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1487 "    if (s != 0)\n"
1488 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1489 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1490 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1491 "}\n"
1492
1493 #. type: Plain text
1494 #: build/C/man3/pthread_attr_init.3:221
1495 #, no-wrap
1496 msgid ""
1497 "static void *\n"
1498 "thread_start(void *arg)\n"
1499 "{\n"
1500 "    int s;\n"
1501 "    pthread_attr_t gattr;\n"
1502 msgstr ""
1503 "static void *\n"
1504 "thread_start(void *arg)\n"
1505 "{\n"
1506 "    int s;\n"
1507 "    pthread_attr_t gattr;\n"
1508
1509 #. type: Plain text
1510 #: build/C/man3/pthread_attr_init.3:225
1511 #, no-wrap
1512 msgid ""
1513 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1514 "       retrieves the attributes of the thread specified in its\n"
1515 "       first argument */\n"
1516 msgstr ""
1517 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1518 "       retrieves the attributes of the thread specified in its\n"
1519 "       first argument */\n"
1520
1521 #. type: Plain text
1522 #: build/C/man3/pthread_attr_init.3:229
1523 #, no-wrap
1524 msgid ""
1525 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1526 "    if (s != 0)\n"
1527 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1528 msgstr ""
1529 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1530 "    if (s != 0)\n"
1531 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1532
1533 #. type: Plain text
1534 #: build/C/man3/pthread_attr_init.3:232
1535 #, no-wrap
1536 msgid ""
1537 "    printf(\"Thread attributes:\\en\");\n"
1538 "    display_pthread_attr(&gattr, \"\\et\");\n"
1539 msgstr ""
1540 "    printf(\"Thread attributes:\\en\");\n"
1541 "    display_pthread_attr(&gattr, \"\\et\");\n"
1542
1543 #. type: Plain text
1544 #: build/C/man3/pthread_attr_init.3:235 build/C/man3/pthread_getattr_np.3:237
1545 #, no-wrap
1546 msgid ""
1547 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1548 "}\n"
1549 msgstr ""
1550 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1551 "}\n"
1552
1553 #. type: Plain text
1554 #: build/C/man3/pthread_attr_init.3:243
1555 #, no-wrap
1556 msgid ""
1557 "int\n"
1558 "main(int argc, char *argv[])\n"
1559 "{\n"
1560 "    pthread_t thr;\n"
1561 "    pthread_attr_t attr;\n"
1562 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1563 "    int s;\n"
1564 msgstr ""
1565 "int\n"
1566 "main(int argc, char *argv[])\n"
1567 "{\n"
1568 "    pthread_t thr;\n"
1569 "    pthread_attr_t attr;\n"
1570 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1571 "    int s;\n"
1572
1573 #. type: Plain text
1574 #: build/C/man3/pthread_attr_init.3:245
1575 #: build/C/man3/pthread_setschedparam.3:352
1576 #, no-wrap
1577 msgid "    attrp = NULL;\n"
1578 msgstr "    attrp = NULL;\n"
1579
1580 #. type: Plain text
1581 #: build/C/man3/pthread_attr_init.3:249
1582 #, no-wrap
1583 msgid ""
1584 "    /* If a command-line argument was supplied, use it to set the\n"
1585 "       stack-size attribute and set a few other thread attributes,\n"
1586 "       and set attrp pointing to thread attributes object */\n"
1587 msgstr ""
1588 "    /* If a command-line argument was supplied, use it to set the\n"
1589 "       stack-size attribute and set a few other thread attributes,\n"
1590 "       and set attrp pointing to thread attributes object */\n"
1591
1592 #. type: Plain text
1593 #: build/C/man3/pthread_attr_init.3:253
1594 #, no-wrap
1595 msgid ""
1596 "    if (argc E<gt> 1) {\n"
1597 "        int stack_size;\n"
1598 "        void *sp;\n"
1599 msgstr ""
1600 "    if (argc E<gt> 1) {\n"
1601 "        int stack_size;\n"
1602 "        void *sp;\n"
1603
1604 #. type: Plain text
1605 #: build/C/man3/pthread_attr_init.3:255
1606 #, no-wrap
1607 msgid "        attrp = &attr;\n"
1608 msgstr "        attrp = &attr;\n"
1609
1610 #. type: Plain text
1611 #: build/C/man3/pthread_attr_init.3:259
1612 #, no-wrap
1613 msgid ""
1614 "        s = pthread_attr_init(&attr);\n"
1615 "        if (s != 0)\n"
1616 "            handle_error_en(s, \"pthread_attr_init\");\n"
1617 msgstr ""
1618 "        s = pthread_attr_init(&attr);\n"
1619 "        if (s != 0)\n"
1620 "            handle_error_en(s, \"pthread_attr_init\");\n"
1621
1622 #. type: Plain text
1623 #: build/C/man3/pthread_attr_init.3:263
1624 #, no-wrap
1625 msgid ""
1626 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1627 "        if (s != 0)\n"
1628 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1629 msgstr ""
1630 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1631 "        if (s != 0)\n"
1632 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1633
1634 #. type: Plain text
1635 #: build/C/man3/pthread_attr_init.3:267
1636 #, no-wrap
1637 msgid ""
1638 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1639 "        if (s != 0)\n"
1640 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1641 msgstr ""
1642 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1643 "        if (s != 0)\n"
1644 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1645
1646 #. type: Plain text
1647 #: build/C/man3/pthread_attr_init.3:269
1648 #, no-wrap
1649 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1650 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
1651
1652 #. type: Plain text
1653 #: build/C/man3/pthread_attr_init.3:273
1654 #, no-wrap
1655 msgid ""
1656 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1657 "        if (s != 0)\n"
1658 "            handle_error_en(s, \"posix_memalign\");\n"
1659 msgstr ""
1660 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1661 "        if (s != 0)\n"
1662 "            handle_error_en(s, \"posix_memalign\");\n"
1663
1664 #. type: Plain text
1665 #: build/C/man3/pthread_attr_init.3:275
1666 #, no-wrap
1667 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1668 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1669
1670 #. type: Plain text
1671 #: build/C/man3/pthread_attr_init.3:280
1672 #, no-wrap
1673 msgid ""
1674 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1675 "        if (s != 0)\n"
1676 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1677 "    }\n"
1678 msgstr ""
1679 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1680 "        if (s != 0)\n"
1681 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1682 "    }\n"
1683
1684 #. type: Plain text
1685 #: build/C/man3/pthread_attr_init.3:284 build/C/man3/pthread_getattr_np.3:332
1686 #, no-wrap
1687 msgid ""
1688 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1689 "    if (s != 0)\n"
1690 "        handle_error_en(s, \"pthread_create\");\n"
1691 msgstr ""
1692 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1693 "    if (s != 0)\n"
1694 "        handle_error_en(s, \"pthread_create\");\n"
1695
1696 #. type: Plain text
1697 #: build/C/man3/pthread_attr_init.3:290 build/C/man3/pthread_getattr_np.3:338
1698 #, no-wrap
1699 msgid ""
1700 "    if (attrp != NULL) {\n"
1701 "        s = pthread_attr_destroy(attrp);\n"
1702 "        if (s != 0)\n"
1703 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1704 "    }\n"
1705 msgstr ""
1706 "    if (attrp != NULL) {\n"
1707 "        s = pthread_attr_destroy(attrp);\n"
1708 "        if (s != 0)\n"
1709 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1710 "    }\n"
1711
1712 #. type: Plain text
1713 #: build/C/man3/pthread_attr_init.3:293 build/C/man3/pthread_getattr_np.3:341
1714 #, no-wrap
1715 msgid ""
1716 "    pause();    /* Terminates when other thread calls exit() */\n"
1717 "}\n"
1718 msgstr ""
1719 "    pause();    /* Terminates when other thread calls exit() */\n"
1720 "}\n"
1721
1722 #. type: Plain text
1723 #: build/C/man3/pthread_attr_init.3:308
1724 msgid ""
1725 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1726 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1727 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1728 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1729 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1730 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1731 msgstr "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1732
1733 #. type: TH
1734 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1735 #, no-wrap
1736 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1737 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1738
1739 #. type: TH
1740 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1741 #: build/C/man3/pthread_getattr_np.3:24
1742 #: build/C/man3/pthread_setaffinity_np.3:24
1743 #: build/C/man3/pthread_tryjoin_np.3:24
1744 #, no-wrap
1745 msgid "2010-09-10"
1746 msgstr "2010-09-10"
1747
1748 #. type: Plain text
1749 #: build/C/man3/pthread_attr_setaffinity_np.3:28
1750 msgid ""
1751 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1752 "affinity attribute in thread attributes object"
1753 msgstr ""
1754
1755 #. type: Plain text
1756 #: build/C/man3/pthread_attr_setaffinity_np.3:32
1757 #: build/C/man3/pthread_getattr_np.3:31
1758 #: build/C/man3/pthread_setaffinity_np.3:32
1759 #: build/C/man3/pthread_tryjoin_np.3:32
1760 #, no-wrap
1761 msgid ""
1762 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1763 "B<#include E<lt>pthread.hE<gt>>\n"
1764 msgstr ""
1765 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1766 "B<#include E<lt>pthread.hE<gt>>\n"
1767
1768 #. type: Plain text
1769 #: build/C/man3/pthread_attr_setaffinity_np.3:37
1770 #, no-wrap
1771 msgid ""
1772 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1773 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1774 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1775 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1776 msgstr ""
1777 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1778 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1779 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1780 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1781
1782 #. type: Plain text
1783 #: build/C/man3/pthread_attr_setaffinity_np.3:51
1784 msgid ""
1785 "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask "
1786 "attribute of the thread attributes object referred to by I<attr> to the "
1787 "value specified in I<cpuset>.  This attribute determines the CPU affinity "
1788 "mask of a thread created using the thread attributes object I<attr>."
1789 msgstr ""
1790
1791 #. type: Plain text
1792 #: build/C/man3/pthread_attr_setaffinity_np.3:60
1793 msgid ""
1794 "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask "
1795 "attribute of the thread attributes object referred to by I<attr> in the "
1796 "buffer pointed to by I<cpuset>."
1797 msgstr ""
1798
1799 #. type: Plain text
1800 #: build/C/man3/pthread_attr_setaffinity_np.3:67
1801 msgid ""
1802 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1803 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
1804 "(cpu_set_t)>."
1805 msgstr ""
1806
1807 #. type: Plain text
1808 #: build/C/man3/pthread_attr_setaffinity_np.3:73
1809 #: build/C/man3/pthread_setaffinity_np.3:64
1810 msgid ""
1811 "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a "
1812 "description of a set of macros that can be used to manipulate and inspect "
1813 "CPU sets, see B<CPU_SET>(3)."
1814 msgstr ""
1815
1816 #. type: TP
1817 #: build/C/man3/pthread_attr_setaffinity_np.3:77
1818 #: build/C/man3/pthread_attr_setaffinity_np.3:89
1819 #: build/C/man3/pthread_attr_setdetachstate.3:80
1820 #: build/C/man3/pthread_attr_setinheritsched.3:87
1821 #: build/C/man3/pthread_attr_setschedpolicy.3:75
1822 #: build/C/man3/pthread_attr_setscope.3:94
1823 #: build/C/man3/pthread_attr_setstack.3:89
1824 #: build/C/man3/pthread_attr_setstacksize.3:64
1825 #: build/C/man3/pthread_create.3:135 build/C/man3/pthread_detach.3:53
1826 #: build/C/man3/pthread_join.3:83 build/C/man3/pthread_join.3:87
1827 #: build/C/man3/pthread_kill.3:56 build/C/man3/pthread_setaffinity_np.3:81
1828 #: build/C/man3/pthread_setaffinity_np.3:90
1829 #: build/C/man3/pthread_setaffinity_np.3:106
1830 #: build/C/man3/pthread_setcancelstate.3:96
1831 #: build/C/man3/pthread_setcancelstate.3:104
1832 #: build/C/man3/pthread_setconcurrency.3:68
1833 #: build/C/man3/pthread_setschedparam.3:119
1834 #: build/C/man3/pthread_setschedprio.3:59 build/C/man3/pthread_sigqueue.3:75
1835 #, no-wrap
1836 msgid "B<EINVAL>"
1837 msgstr "B<EINVAL>"
1838
1839 #.  cpumask_t
1840 #.  The raw sched_getaffinity() system call returns the size (in bytes)
1841 #.  of the cpumask_t type.
1842 #. type: Plain text
1843 #: build/C/man3/pthread_attr_setaffinity_np.3:89
1844 msgid ""
1845 "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was "
1846 "outside the set supported by the kernel.  (The kernel configuration option "
1847 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
1848 "type used to represent CPU sets.)"
1849 msgstr ""
1850
1851 #. type: Plain text
1852 #: build/C/man3/pthread_attr_setaffinity_np.3:99
1853 msgid ""
1854 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
1855 "attributes object referred to by I<attr> lies outside the range specified by "
1856 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
1857 msgstr ""
1858
1859 #. type: Plain text
1860 #: build/C/man3/pthread_attr_setaffinity_np.3:103
1861 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
1862 msgstr ""
1863
1864 #. type: Plain text
1865 #: build/C/man3/pthread_attr_setaffinity_np.3:105
1866 #: build/C/man3/pthread_setaffinity_np.3:118
1867 msgid "These functions are provided by glibc since version 2.3.4."
1868 msgstr ""
1869
1870 #. type: Plain text
1871 #: build/C/man3/pthread_attr_setaffinity_np.3:108
1872 #: build/C/man3/pthread_cleanup_push_defer_np.3:101
1873 #: build/C/man3/pthread_setaffinity_np.3:121
1874 #: build/C/man3/pthread_tryjoin_np.3:113
1875 msgid ""
1876 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
1877 "\" (nonportable) in the names."
1878 msgstr ""
1879
1880 #. type: Plain text
1881 #: build/C/man3/pthread_attr_setaffinity_np.3:115
1882 #: build/C/man3/pthread_setaffinity_np.3:147
1883 msgid ""
1884 "In glibc 2.3.3 only, versions of these functions were provided that did not "
1885 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
1886 "underlying system calls was always I<sizeof(cpu_set_t)>."
1887 msgstr ""
1888
1889 #. type: Plain text
1890 #: build/C/man3/pthread_attr_setaffinity_np.3:121
1891 msgid ""
1892 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1893 "(3), B<cpuset>(7), B<pthreads>(7)"
1894 msgstr "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
1895
1896 #. type: TH
1897 #: build/C/man3/pthread_attr_setdetachstate.3:24
1898 #, no-wrap
1899 msgid "PTHREAD_ATTR_SETDETACHSTATE"
1900 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
1901
1902 #. type: TH
1903 #: build/C/man3/pthread_attr_setdetachstate.3:24
1904 #: build/C/man3/pthread_attr_setschedparam.3:24
1905 #: build/C/man3/pthread_attr_setschedpolicy.3:24
1906 #, no-wrap
1907 msgid "2010-02-03"
1908 msgstr "2010-02-03"
1909
1910 #. type: Plain text
1911 #: build/C/man3/pthread_attr_setdetachstate.3:28
1912 msgid ""
1913 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
1914 "state attribute in thread attributes object"
1915 msgstr ""
1916
1917 #. type: Plain text
1918 #: build/C/man3/pthread_attr_setdetachstate.3:36
1919 #, no-wrap
1920 msgid ""
1921 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
1922 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
1923 msgstr ""
1924 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
1925 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
1926
1927 #. type: Plain text
1928 #: build/C/man3/pthread_attr_setdetachstate.3:50
1929 msgid ""
1930 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
1931 "attribute of the thread attributes object referred to by I<attr> to the "
1932 "value specified in I<detachstate>.  The detach state attribute determines "
1933 "whether a thread created using the thread attributes object I<attr> will be "
1934 "created in a joinable or a detached state."
1935 msgstr ""
1936
1937 #. type: Plain text
1938 #: build/C/man3/pthread_attr_setdetachstate.3:53
1939 msgid "The following values may be specified in I<detachstate>:"
1940 msgstr ""
1941
1942 #. type: TP
1943 #: build/C/man3/pthread_attr_setdetachstate.3:53
1944 #, no-wrap
1945 msgid "B<PTHREAD_CREATE_DETACHED>"
1946 msgstr "B<PTHREAD_CREATE_DETACHED>"
1947
1948 #. type: Plain text
1949 #: build/C/man3/pthread_attr_setdetachstate.3:58
1950 msgid ""
1951 "Threads that are created using I<attr> will be created in a detached state."
1952 msgstr ""
1953
1954 #. type: TP
1955 #: build/C/man3/pthread_attr_setdetachstate.3:58
1956 #, no-wrap
1957 msgid "B<PTHREAD_CREATE_JOINABLE>"
1958 msgstr "B<PTHREAD_CREATE_JOINABLE>"
1959
1960 #. type: Plain text
1961 #: build/C/man3/pthread_attr_setdetachstate.3:63
1962 msgid ""
1963 "Threads that are created using I<attr> will be created in a joinable state."
1964 msgstr ""
1965
1966 #. type: Plain text
1967 #: build/C/man3/pthread_attr_setdetachstate.3:67
1968 msgid ""
1969 "The default setting of the detach state attribute in a newly initialized "
1970 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
1971 msgstr ""
1972
1973 #. type: Plain text
1974 #: build/C/man3/pthread_attr_setdetachstate.3:74
1975 msgid ""
1976 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
1977 "the thread attributes object I<attr> in the buffer pointed to by "
1978 "I<detachstate>."
1979 msgstr ""
1980
1981 #. type: Plain text
1982 #: build/C/man3/pthread_attr_setdetachstate.3:80
1983 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
1984 msgstr ""
1985
1986 #. type: Plain text
1987 #: build/C/man3/pthread_attr_setdetachstate.3:84
1988 msgid "An invalid value was specified in I<detachstate>."
1989 msgstr ""
1990
1991 #. type: Plain text
1992 #: build/C/man3/pthread_attr_setdetachstate.3:90
1993 msgid ""
1994 "See B<pthread_create>(3)  for more details on detached and joinable threads."
1995 msgstr ""
1996
1997 #. type: Plain text
1998 #: build/C/man3/pthread_attr_setdetachstate.3:98
1999 msgid ""
2000 "A thread that is created in a joinable state should eventually either be "
2001 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
2002 "B<pthread_create>(3)."
2003 msgstr ""
2004
2005 #. type: Plain text
2006 #: build/C/man3/pthread_attr_setdetachstate.3:105
2007 msgid ""
2008 "It is an error to specify the thread ID of a thread that was created in a "
2009 "detached state in a later call to B<pthread_detach>(3)  or B<pthread_join>"
2010 "(3)."
2011 msgstr ""
2012
2013 #. type: Plain text
2014 #: build/C/man3/pthread_attr_setdetachstate.3:108
2015 #: build/C/man3/pthread_attr_setstack.3:154
2016 msgid "See B<pthread_attr_init>(3)."
2017 msgstr ""
2018
2019 #. type: Plain text
2020 #: build/C/man3/pthread_attr_setdetachstate.3:114
2021 msgid ""
2022 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2023 "B<pthread_join>(3), B<pthreads>(7)"
2024 msgstr "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), B<pthread_join>(3), B<pthreads>(7)"
2025
2026 #. type: TH
2027 #: build/C/man3/pthread_attr_setguardsize.3:24
2028 #, no-wrap
2029 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2030 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2031
2032 #. type: TH
2033 #: build/C/man3/pthread_attr_setguardsize.3:24
2034 #: build/C/man3/pthread_attr_setscope.3:24
2035 #: build/C/man3/pthread_attr_setstack.3:24
2036 #: build/C/man3/pthread_attr_setstackaddr.3:24 build/C/man3/pthread_self.3:24
2037 #, no-wrap
2038 msgid "2008-10-24"
2039 msgstr "2008-10-24"
2040
2041 #. type: Plain text
2042 #: build/C/man3/pthread_attr_setguardsize.3:28
2043 msgid ""
2044 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2045 "attribute in thread attributes object"
2046 msgstr ""
2047
2048 #. type: Plain text
2049 #: build/C/man3/pthread_attr_setguardsize.3:36
2050 #, no-wrap
2051 msgid ""
2052 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2053 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2054 msgstr ""
2055 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2056 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2057
2058 #. type: Plain text
2059 #: build/C/man3/pthread_attr_setguardsize.3:46
2060 msgid ""
2061 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
2062 "of the thread attributes object referred to by I<attr> to the value "
2063 "specified in I<guardsize>."
2064 msgstr ""
2065
2066 #. type: Plain text
2067 #: build/C/man3/pthread_attr_setguardsize.3:56
2068 msgid ""
2069 "If I<guardsize> is greater than 0, then for each new thread created using "
2070 "I<attr> the system allocates an additional region of at least I<guardsize> "
2071 "bytes at the end of the thread's stack to act as the guard area for the "
2072 "stack (but see BUGS)."
2073 msgstr ""
2074
2075 #. type: Plain text
2076 #: build/C/man3/pthread_attr_setguardsize.3:62
2077 msgid ""
2078 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2079 "guard area."
2080 msgstr ""
2081
2082 #. type: Plain text
2083 #: build/C/man3/pthread_attr_setguardsize.3:64
2084 msgid "The default guard size is the same as the system page size."
2085 msgstr ""
2086
2087 #. type: Plain text
2088 #: build/C/man3/pthread_attr_setguardsize.3:79
2089 msgid ""
2090 "If the stack address attribute has been set in I<attr> (using "
2091 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
2092 "that the caller is allocating the thread's stack, then the guard size "
2093 "attribute is ignored (i.e., no guard area is created by the system): it is "
2094 "the application's responsibility to handle stack overflow (perhaps by using "
2095 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
2096 "it has allocated)."
2097 msgstr ""
2098
2099 #. type: Plain text
2100 #: build/C/man3/pthread_attr_setguardsize.3:87
2101 msgid ""
2102 "The B<pthread_attr_getguardsize>()  function returns the guard size "
2103 "attribute of the thread attributes object referred to by I<attr> in the "
2104 "buffer pointed to by I<guardsize>."
2105 msgstr ""
2106
2107 #. type: Plain text
2108 #: build/C/man3/pthread_attr_setguardsize.3:101
2109 msgid ""
2110 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2111 "invalid.  On Linux these functions always succeed (but portable and future-"
2112 "proof applications should nevertheless handle a possible error return)."
2113 msgstr ""
2114
2115 #. type: Plain text
2116 #: build/C/man3/pthread_attr_setguardsize.3:103
2117 #: build/C/man3/pthread_attr_setstackaddr.3:80
2118 #: build/C/man3/pthread_attr_setstacksize.3:80
2119 msgid "These functions are provided by glibc since version 2.1."
2120 msgstr ""
2121
2122 #. type: Plain text
2123 #: build/C/man3/pthread_attr_setguardsize.3:119
2124 msgid ""
2125 "A guard area consists of virtual memory pages that are protected to prevent "
2126 "read and write access.  If a thread overflows its stack into the guard area, "
2127 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2128 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
2129 "guard size is internally rounded up to the system page size when creating a "
2130 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
2131 "size that was set by B<pthread_attr_setguardsize>().)"
2132 msgstr ""
2133
2134 #. type: Plain text
2135 #: build/C/man3/pthread_attr_setguardsize.3:123
2136 msgid ""
2137 "Setting a guard size of 0 may be useful to save memory in an application "
2138 "that creates many threads and knows that stack overflow can never occur."
2139 msgstr ""
2140
2141 #. type: Plain text
2142 #: build/C/man3/pthread_attr_setguardsize.3:127
2143 msgid ""
2144 "Choosing a guard size larger than the default size may be necessary for "
2145 "detecting stack overflows if a thread allocates large data structures on the "
2146 "stack."
2147 msgstr ""
2148
2149 #. type: SH
2150 #: build/C/man3/pthread_attr_setguardsize.3:127
2151 #: build/C/man3/pthread_attr_setinheritsched.3:103
2152 #: build/C/man3/pthread_attr_setstacksize.3:96
2153 #: build/C/man3/pthread_create.3:361 build/C/man3/pthread_exit.3:90
2154 #, no-wrap
2155 msgid "BUGS"
2156 msgstr "バグ"
2157
2158 #. type: Plain text
2159 #: build/C/man3/pthread_attr_setguardsize.3:138
2160 msgid ""
2161 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2162 "within the stack size allocation, rather than allocating extra space at the "
2163 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2164 "error from B<pthread_create>(3)  if the guard size value is too large, "
2165 "leaving no space for the actual stack.)"
2166 msgstr ""
2167
2168 #.  glibc includes the guardsize within the allocated stack size,
2169 #.  which looks pretty clearly to be in violation of POSIX.
2170 #.  Filed bug, 22 Oct 2008:
2171 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2172 #.  Older reports:
2173 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2174 #.  Reportedly, LinuxThreads did the right thing, allocating
2175 #.  extra space at the end of the stack:
2176 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2177 #. type: Plain text
2178 #: build/C/man3/pthread_attr_setguardsize.3:152
2179 msgid ""
2180 "The obsolete LinuxThreads implementation did the right thing, allocating "
2181 "extra space at the end of the stack for the guard area."
2182 msgstr ""
2183
2184 #. type: Plain text
2185 #: build/C/man3/pthread_attr_setguardsize.3:155
2186 msgid "See B<pthread_getattr_np>(3)."
2187 msgstr ""
2188
2189 #. type: Plain text
2190 #: build/C/man3/pthread_attr_setguardsize.3:163
2191 msgid ""
2192 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2193 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2194 msgstr "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2195
2196 #. type: TH
2197 #: build/C/man3/pthread_attr_setinheritsched.3:24
2198 #, no-wrap
2199 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2200 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2201
2202 #. type: TH
2203 #: build/C/man3/pthread_attr_setinheritsched.3:24
2204 #, no-wrap
2205 msgid "2008-11-10"
2206 msgstr "2008-11-10"
2207
2208 #. type: Plain text
2209 #: build/C/man3/pthread_attr_setinheritsched.3:28
2210 msgid ""
2211 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit "
2212 "scheduler attribute in thread attributes object"
2213 msgstr ""
2214
2215 #. type: Plain text
2216 #: build/C/man3/pthread_attr_setinheritsched.3:36
2217 #, no-wrap
2218 msgid ""
2219 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2220 "B<                                 int >I<inheritsched>B<);>\n"
2221 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2222 "B<                                 int *>I<inheritsched>B<);>\n"
2223 msgstr ""
2224 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2225 "B<                                 int >I<inheritsched>B<);>\n"
2226 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2227 "B<                                 int *>I<inheritsched>B<);>\n"
2228
2229 #. type: Plain text
2230 #: build/C/man3/pthread_attr_setinheritsched.3:52
2231 msgid ""
2232 "The B<pthread_attr_setinheritsched>()  function sets the inherit scheduler "
2233 "attribute of the thread attributes object referred to by I<attr> to the "
2234 "value specified in I<inheritsched>.  The inherit scheduler attribute "
2235 "determines whether a thread created using the thread attributes object "
2236 "I<attr> will inherit its scheduling attributes from the calling thread or "
2237 "whether it will take them from I<attr>."
2238 msgstr ""
2239
2240 #. type: Plain text
2241 #: build/C/man3/pthread_attr_setinheritsched.3:55
2242 msgid "The following values may be specified in I<inheritsched>:"
2243 msgstr ""
2244
2245 #. type: TP
2246 #: build/C/man3/pthread_attr_setinheritsched.3:55
2247 #, no-wrap
2248 msgid "B<PTHREAD_INHERIT_SCHED>"
2249 msgstr "B<PTHREAD_INHERIT_SCHED>"
2250
2251 #. type: Plain text
2252 #: build/C/man3/pthread_attr_setinheritsched.3:63
2253 msgid ""
2254 "Threads that are created using I<attr> inherit scheduling attributes from "
2255 "the creating thread; the scheduling attributes in I<attr> are ignored."
2256 msgstr ""
2257
2258 #. type: TP
2259 #: build/C/man3/pthread_attr_setinheritsched.3:63
2260 #, no-wrap
2261 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2262 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2263
2264 #.  FIXME what are the defaults for scheduler settings?
2265 #. type: Plain text
2266 #: build/C/man3/pthread_attr_setinheritsched.3:70
2267 msgid ""
2268 "Threads that are created using I<attr> take their scheduling attributes from "
2269 "the values specified by the attributes object."
2270 msgstr ""
2271
2272 #. type: Plain text
2273 #: build/C/man3/pthread_attr_setinheritsched.3:74
2274 msgid ""
2275 "The default setting of the inherit scheduler attribute in a newly "
2276 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2277 msgstr ""
2278
2279 #. type: Plain text
2280 #: build/C/man3/pthread_attr_setinheritsched.3:81
2281 msgid ""
2282 "The B<pthread_attr_getinheritsched>()  returns the inherit scheduler "
2283 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2284 "by I<inheritsched>."
2285 msgstr ""
2286
2287 #. type: Plain text
2288 #: build/C/man3/pthread_attr_setinheritsched.3:87
2289 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2290 msgstr ""
2291
2292 #. type: Plain text
2293 #: build/C/man3/pthread_attr_setinheritsched.3:91
2294 msgid "Invalid value in I<inheritsched>."
2295 msgstr ""
2296
2297 #.  .SH VERSIONS
2298 #.  Available since glibc 2.0.
2299 #. type: Plain text
2300 #: build/C/man3/pthread_attr_setinheritsched.3:98
2301 msgid ""
2302 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2303 "to set the attribute to an unsupported value\") for "
2304 "B<pthread_attr_setinheritsched>()."
2305 msgstr ""
2306
2307 #. type: Plain text
2308 #: build/C/man3/pthread_attr_setinheritsched.3:103
2309 #: build/C/man3/pthread_attr_setschedparam.3:91
2310 #: build/C/man3/pthread_attr_setschedpolicy.3:91
2311 msgid "See B<pthread_setschedparam>(3)."
2312 msgstr ""
2313
2314 #.  FIXME . Track status of the following bug:
2315 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2316 #. type: Plain text
2317 #: build/C/man3/pthread_attr_setinheritsched.3:119
2318 msgid ""
2319 "As at glibc 2.8, if a thread attributes object is initialized using "
2320 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2321 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2322 "if the inherit scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2323 "then a thread created using the attribute object wrongly inherits its "
2324 "scheduling attributes from the creating thread.  This bug does not occur if "
2325 "either the scheduling policy or scheduling priority attribute is explicitly "
2326 "set in the thread attributes object before calling B<pthread_create>(3)."
2327 msgstr ""
2328
2329 #. type: Plain text
2330 #: build/C/man3/pthread_attr_setinheritsched.3:128
2331 msgid ""
2332 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2333 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2334 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2335 "(3), B<pthreads>(7)"
2336 msgstr "B<sched_setscheduler>(2), B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7)"
2337
2338 #. type: TH
2339 #: build/C/man3/pthread_attr_setschedparam.3:24
2340 #, no-wrap
2341 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2342 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2343
2344 #. type: Plain text
2345 #: build/C/man3/pthread_attr_setschedparam.3:28
2346 msgid ""
2347 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2348 "parameter attributes in thread attributes object"
2349 msgstr ""
2350
2351 #. type: Plain text
2352 #: build/C/man3/pthread_attr_setschedparam.3:36
2353 #, no-wrap
2354 msgid ""
2355 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2356 "B<                               const struct sched_param *>I<param>B<);>\n"
2357 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2358 "B<                               struct sched_param *>I<param>B<);>\n"
2359 msgstr ""
2360 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2361 "B<                               const struct sched_param *>I<param>B<);>\n"
2362 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2363 "B<                               struct sched_param *>I<param>B<);>\n"
2364
2365 #. type: Plain text
2366 #: build/C/man3/pthread_attr_setschedparam.3:49
2367 msgid ""
2368 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2369 "attributes of the thread attributes object referred to by I<attr> to the "
2370 "values specified in the buffer pointed to by I<param>.  These attributes "
2371 "determine the scheduling parameters of a thread created using the thread "
2372 "attributes object I<attr>."
2373 msgstr ""
2374
2375 #. type: Plain text
2376 #: build/C/man3/pthread_attr_setschedparam.3:56
2377 msgid ""
2378 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2379 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2380 "by I<param>."
2381 msgstr ""
2382
2383 #. type: Plain text
2384 #: build/C/man3/pthread_attr_setschedparam.3:58
2385 msgid "Scheduling parameters are maintained in the following structure:"
2386 msgstr ""
2387
2388 #. type: Plain text
2389 #: build/C/man3/pthread_attr_setschedparam.3:64
2390 #: build/C/man3/pthread_setschedparam.3:66
2391 #, no-wrap
2392 msgid ""
2393 "struct sched_param {\n"
2394 "    int sched_priority;     /* Scheduling priority */\n"
2395 "};\n"
2396 msgstr ""
2397 "struct sched_param {\n"
2398 "    int sched_priority;     /* Scheduling priority */\n"
2399 "};\n"
2400
2401 #. type: Plain text
2402 #: build/C/man3/pthread_attr_setschedparam.3:71
2403 #: build/C/man3/pthread_setschedparam.3:73
2404 msgid ""
2405 "As can be seen, only one scheduling parameter is supported.  For details of "
2406 "the permitted ranges for scheduling priorities in each scheduling policy, "
2407 "see B<sched_setscheduler>(2)."
2408 msgstr ""
2409
2410 #.  .SH VERSIONS
2411 #.  Available since glibc 2.0.
2412 #. type: Plain text
2413 #: build/C/man3/pthread_attr_setschedparam.3:86
2414 msgid ""
2415 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2416 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2417 "(but portable and future-proof applications should nevertheless handle a "
2418 "possible error return)."
2419 msgstr ""
2420
2421 #. type: Plain text
2422 #: build/C/man3/pthread_attr_setschedparam.3:95
2423 msgid ""
2424 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2425 "policies supported on Linux."
2426 msgstr ""
2427
2428 #. type: Plain text
2429 #: build/C/man3/pthread_attr_setschedparam.3:105
2430 msgid ""
2431 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2432 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2433 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2434 "(3), B<pthreads>(7)"
2435 msgstr "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7)"
2436
2437 #. type: TH
2438 #: build/C/man3/pthread_attr_setschedpolicy.3:24
2439 #, no-wrap
2440 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2441 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2442
2443 #. type: Plain text
2444 #: build/C/man3/pthread_attr_setschedpolicy.3:28
2445 msgid ""
2446 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2447 "scheduling policy attribute in thread attributes object"
2448 msgstr ""
2449
2450 #. type: Plain text
2451 #: build/C/man3/pthread_attr_setschedpolicy.3:36
2452 #, no-wrap
2453 msgid ""
2454 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2455 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2456 msgstr ""
2457 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2458 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2459
2460 #. type: Plain text
2461 #: build/C/man3/pthread_attr_setschedpolicy.3:49
2462 msgid ""
2463 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2464 "attribute of the thread attributes object referred to by I<attr> to the "
2465 "value specified in I<policy>.  This attribute determines the scheduling "
2466 "policy of a thread created using the thread attributes object I<attr>."
2467 msgstr ""
2468
2469 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2470 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2471 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2472 #. type: Plain text
2473 #: build/C/man3/pthread_attr_setschedpolicy.3:62
2474 msgid ""
2475 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2476 "B<SCHED_OTHER>, with the semantics described in B<sched_setscheduler>(2)."
2477 msgstr ""
2478
2479 #. type: Plain text
2480 #: build/C/man3/pthread_attr_setschedpolicy.3:69
2481 msgid ""
2482 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2483 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2484 "by I<policy>."
2485 msgstr ""
2486
2487 #. type: Plain text
2488 #: build/C/man3/pthread_attr_setschedpolicy.3:75
2489 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2490 msgstr ""
2491
2492 #. type: Plain text
2493 #: build/C/man3/pthread_attr_setschedpolicy.3:79
2494 msgid "Invalid value in I<policy>."
2495 msgstr ""
2496
2497 #.  .SH VERSIONS
2498 #.  Available since glibc 2.0.
2499 #. type: Plain text
2500 #: build/C/man3/pthread_attr_setschedpolicy.3:86
2501 msgid ""
2502 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2503 "to set the attribute to an unsupported value\") for "
2504 "B<pthread_attr_setschedpolicy>()."
2505 msgstr ""
2506
2507 #. type: Plain text
2508 #: build/C/man3/pthread_attr_setschedpolicy.3:100
2509 msgid ""
2510 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2511 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2512 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2513 "(3), B<pthreads>(7)"
2514 msgstr "B<sched_setscheduler>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7)"
2515
2516 #. type: TH
2517 #: build/C/man3/pthread_attr_setscope.3:24
2518 #, no-wrap
2519 msgid "PTHREAD_ATTR_SETSCOPE"
2520 msgstr "PTHREAD_ATTR_SETSCOPE"
2521
2522 #. type: Plain text
2523 #: build/C/man3/pthread_attr_setscope.3:28
2524 msgid ""
2525 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2526 "attribute in thread attributes object"
2527 msgstr ""
2528
2529 #. type: Plain text
2530 #: build/C/man3/pthread_attr_setscope.3:36
2531 #, no-wrap
2532 msgid ""
2533 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2534 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2535 msgstr ""
2536 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2537 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2538
2539 #. type: Plain text
2540 #: build/C/man3/pthread_attr_setscope.3:50
2541 msgid ""
2542 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2543 "of the thread attributes object referred to by I<attr> to the value "
2544 "specified in I<scope>.  The contention scope attribute defines the set of "
2545 "threads against which a thread competes for resources such as the CPU.  "
2546 "POSIX.1-2001 specifies two possible values for I<scope>:"
2547 msgstr ""
2548
2549 #. type: TP
2550 #: build/C/man3/pthread_attr_setscope.3:50
2551 #, no-wrap
2552 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2553 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2554
2555 #. type: Plain text
2556 #: build/C/man3/pthread_attr_setscope.3:58
2557 msgid ""
2558 "The thread competes for resources with all other threads in all processes on "
2559 "the system that are in the same scheduling allocation domain (a group of one "
2560 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2561 "to one another according to their scheduling policy and priority."
2562 msgstr ""
2563
2564 #. type: TP
2565 #: build/C/man3/pthread_attr_setscope.3:58
2566 #, no-wrap
2567 msgid "B<PTHREAD_SCOPE_PROCESS>"
2568 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2569
2570 #. type: Plain text
2571 #: build/C/man3/pthread_attr_setscope.3:73
2572 msgid ""
2573 "The thread competes for resources with all other threads in the same process "
2574 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
2575 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2576 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
2577 "leaves it unspecified how these threads contend with other threads in other "
2578 "process on the system or with other threads in the same process that were "
2579 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
2580 msgstr ""
2581
2582 #. type: Plain text
2583 #: build/C/man3/pthread_attr_setscope.3:80
2584 msgid ""
2585 "POSIX.1-2001 only requires that an implementation support one of these "
2586 "contention scopes, but permits both to be supported.  Linux supports "
2587 "B<PTHREAD_SCOPE_SYSTEM>, but not B<PTHREAD_SCOPE_PROCESS>."
2588 msgstr ""
2589
2590 #. type: Plain text
2591 #: build/C/man3/pthread_attr_setscope.3:88
2592 msgid ""
2593 "The B<pthread_attr_getscope>()  function returns the contention scope "
2594 "attribute of the thread attributes object referred to by I<attr> in the "
2595 "buffer pointed to by I<scope>."
2596 msgstr ""
2597
2598 #. type: Plain text
2599 #: build/C/man3/pthread_attr_setscope.3:94
2600 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
2601 msgstr ""
2602
2603 #. type: Plain text
2604 #: build/C/man3/pthread_attr_setscope.3:98
2605 msgid "An invalid value was specified in I<scope>."
2606 msgstr ""
2607
2608 #. type: TP
2609 #: build/C/man3/pthread_attr_setscope.3:98
2610 #, no-wrap
2611 msgid "B<ENOTSUP>"
2612 msgstr "B<ENOTSUP>"
2613
2614 #. type: Plain text
2615 #: build/C/man3/pthread_attr_setscope.3:104
2616 msgid ""
2617 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
2618 "supported on Linux."
2619 msgstr ""
2620
2621 #. type: Plain text
2622 #: build/C/man3/pthread_attr_setscope.3:114
2623 msgid ""
2624 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a "
2625 "userspace thread is bound directly to a single kernel-scheduling entity.  "
2626 "This is the case on Linux for the obsolete LinuxThreads implementation and "
2627 "the modern NPTL implementation, which are both 1:1 threading implementations."
2628 msgstr ""
2629
2630 #. type: Plain text
2631 #: build/C/man3/pthread_attr_setscope.3:117
2632 msgid ""
2633 "POSIX.1-2001 specifies that the default contention scope is implementation-"
2634 "defined."
2635 msgstr ""
2636
2637 #. type: Plain text
2638 #: build/C/man3/pthread_attr_setscope.3:125
2639 msgid ""
2640 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2641 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2642 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2643 msgstr "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2644
2645 #. type: TH
2646 #: build/C/man3/pthread_attr_setstack.3:24
2647 #, no-wrap
2648 msgid "PTHREAD_ATTR_SETSTACK"
2649 msgstr "PTHREAD_ATTR_SETSTACK"
2650
2651 #. type: Plain text
2652 #: build/C/man3/pthread_attr_setstack.3:28
2653 msgid ""
2654 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
2655 "thread attributes object"
2656 msgstr ""
2657
2658 #. type: Plain text
2659 #: build/C/man3/pthread_attr_setstack.3:36
2660 #, no-wrap
2661 msgid ""
2662 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2663 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2664 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2665 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2666 msgstr ""
2667 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2668 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2669 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2670 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2671
2672 #. type: Plain text
2673 #: build/C/man3/pthread_attr_setstack.3:43 build/C/man3/pthread_sigqueue.3:39
2674 msgid ""
2675 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
2676 msgstr ""
2677
2678 #. type: Plain text
2679 #: build/C/man3/pthread_attr_setstack.3:48
2680 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2681 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2682
2683 #. type: Plain text
2684 #: build/C/man3/pthread_attr_setstack.3:50
2685 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2686 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2687
2688 #. type: Plain text
2689 #: build/C/man3/pthread_attr_setstack.3:66
2690 msgid ""
2691 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
2692 "size attributes of the thread attributes object referred to by I<attr> to "
2693 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
2694 "attributes specify the location and size of the stack that should be used by "
2695 "a thread that is created using the thread attributes object I<attr>."
2696 msgstr ""
2697
2698 #. type: Plain text
2699 #: build/C/man3/pthread_attr_setstack.3:72
2700 msgid ""
2701 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
2702 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
2703 "allocated buffer should be both readable and writable."
2704 msgstr ""
2705
2706 #. type: Plain text
2707 #: build/C/man3/pthread_attr_setstack.3:83
2708 msgid ""
2709 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
2710 "size attributes of the thread attributes object referred to by I<attr> in "
2711 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
2712 msgstr ""
2713
2714 #. type: Plain text
2715 #: build/C/man3/pthread_attr_setstack.3:89
2716 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
2717 msgstr ""
2718
2719 #. type: Plain text
2720 #: build/C/man3/pthread_attr_setstack.3:100
2721 msgid ""
2722 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
2723 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
2724 "stacksize> is not suitably aligned."
2725 msgstr ""
2726
2727 #. type: Plain text
2728 #: build/C/man3/pthread_attr_setstack.3:108
2729 msgid ""
2730 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
2731 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
2732 "caller."
2733 msgstr ""
2734
2735 #. type: Plain text
2736 #: build/C/man3/pthread_attr_setstack.3:110
2737 msgid "These functions are provided by glibc since version 2.2."
2738 msgstr ""
2739
2740 #. type: Plain text
2741 #: build/C/man3/pthread_attr_setstack.3:120
2742 msgid ""
2743 "These functions are provided for applications that must ensure that a "
2744 "thread's stack is placed in a particular location.  For most applications, "
2745 "this is not necessary, and the use of these functions should be avoided.  "
2746 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
2747 "stack size other than the default.)"
2748 msgstr ""
2749
2750 #. type: Plain text
2751 #: build/C/man3/pthread_attr_setstack.3:131
2752 msgid ""
2753 "When an application employs B<pthread_attr_setstack>(), it takes over the "
2754 "responsibility of allocating the stack.  Any guard size value that was set "
2755 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
2756 "is the application's responsibility to allocate a guard area (one or more "
2757 "pages protected against reading and writing)  to handle the possibility of "
2758 "stack overflow."
2759 msgstr ""
2760
2761 #. type: Plain text
2762 #: build/C/man3/pthread_attr_setstack.3:142
2763 msgid ""
2764 "The address specified in I<stackaddr> should be suitably aligned: for full "
2765 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
2766 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
2767 "should also be a multiple of the system page size."
2768 msgstr ""
2769
2770 #. type: Plain text
2771 #: build/C/man3/pthread_attr_setstack.3:151
2772 msgid ""
2773 "If I<attr> is used to create multiple threads, then the caller must change "
2774 "the stack address attribute between calls to B<pthread_create>(3); "
2775 "otherwise, the threads will attempt to use the same memory area for their "
2776 "stacks, and chaos will ensue."
2777 msgstr ""
2778
2779 #. type: Plain text
2780 #: build/C/man3/pthread_attr_setstack.3:164
2781 msgid ""
2782 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
2783 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
2784 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2785 msgstr "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2786
2787 #. type: TH
2788 #: build/C/man3/pthread_attr_setstackaddr.3:24
2789 #, no-wrap
2790 msgid "PTHREAD_ATTR_SETSTACKADDR"
2791 msgstr "PTHREAD_ATTR_SETSTACKADDR"
2792
2793 #. type: Plain text
2794 #: build/C/man3/pthread_attr_setstackaddr.3:28
2795 msgid ""
2796 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
2797 "attribute in thread attributes object"
2798 msgstr ""
2799
2800 #. type: Plain text
2801 #: build/C/man3/pthread_attr_setstackaddr.3:36
2802 #, no-wrap
2803 msgid ""
2804 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
2805 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
2806 msgstr ""
2807 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
2808 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
2809
2810 #. type: Plain text
2811 #: build/C/man3/pthread_attr_setstackaddr.3:46
2812 msgid ""
2813 "These functions are obsolete: B<do not use them.> Use "
2814 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
2815 msgstr ""
2816
2817 #. type: Plain text
2818 #: build/C/man3/pthread_attr_setstackaddr.3:57
2819 msgid ""
2820 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
2821 "attribute of the thread attributes object referred to by I<attr> to the "
2822 "value specified in I<stackaddr>.  This attribute specifies the location of "
2823 "the stack that should be used by a thread that is created using the thread "
2824 "attributes object I<attr>."
2825 msgstr ""
2826
2827 #. type: Plain text
2828 #: build/C/man3/pthread_attr_setstackaddr.3:63
2829 msgid ""
2830 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
2831 "that was allocated by the caller.  The pages of the allocated buffer should "
2832 "be both readable and writable."
2833 msgstr ""
2834
2835 #. type: Plain text
2836 #: build/C/man3/pthread_attr_setstackaddr.3:71
2837 msgid ""
2838 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
2839 "attribute of the thread attributes object referred to by I<attr> in the "
2840 "buffer pointed to by I<stackaddr>."
2841 msgstr ""
2842
2843 #. type: Plain text
2844 #: build/C/man3/pthread_attr_setstackaddr.3:78
2845 msgid ""
2846 "No errors are defined (but applications should nevertheless handle a "
2847 "possible error return)."
2848 msgstr ""
2849
2850 #. type: Plain text
2851 #: build/C/man3/pthread_attr_setstackaddr.3:83
2852 msgid ""
2853 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
2854 "POSIX.1-2008 removes the specification of these functions."
2855 msgstr ""
2856
2857 #. type: Plain text
2858 #: build/C/man3/pthread_attr_setstackaddr.3:107
2859 msgid ""
2860 "I<Do not use these functions!> They cannot be portably used, since they "
2861 "provide no way of specifying the direction of growth or the range of the "
2862 "stack.  For example, on architectures with a stack that grows downward, "
2863 "I<stackaddr> specifies the next address past the I<highest> address of the "
2864 "allocated stack area.  However, on architectures with a stack that grows "
2865 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
2866 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
2867 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
2868 "in the allocated stack area (and the I<stacksize> argument specifies the "
2869 "range of the stack)."
2870 msgstr ""
2871
2872 #. type: Plain text
2873 #: build/C/man3/pthread_attr_setstackaddr.3:113
2874 msgid ""
2875 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
2876 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2877 msgstr "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2878
2879 #. type: TH
2880 #: build/C/man3/pthread_attr_setstacksize.3:24
2881 #, no-wrap
2882 msgid "PTHREAD_ATTR_SETSTACKSIZE"
2883 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
2884
2885 #. type: TH
2886 #: build/C/man3/pthread_attr_setstacksize.3:24
2887 #, no-wrap
2888 msgid "2008-11-05"
2889 msgstr "2008-11-05"
2890
2891 #. type: Plain text
2892 #: build/C/man3/pthread_attr_setstacksize.3:28
2893 msgid ""
2894 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
2895 "attribute in thread attributes object"
2896 msgstr ""
2897
2898 #. type: Plain text
2899 #: build/C/man3/pthread_attr_setstacksize.3:36
2900 #, no-wrap
2901 msgid ""
2902 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
2903 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
2904 msgstr ""
2905 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
2906 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
2907
2908 #. type: Plain text
2909 #: build/C/man3/pthread_attr_setstacksize.3:46
2910 msgid ""
2911 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
2912 "of the thread attributes object referred to by I<attr> to the value "
2913 "specified in I<stacksize>."
2914 msgstr ""
2915
2916 #. type: Plain text
2917 #: build/C/man3/pthread_attr_setstacksize.3:50
2918 msgid ""
2919 "The stack size attribute determines the minimum size (in bytes) that will be "
2920 "allocated for threads created using the thread attributes object I<attr>."
2921 msgstr ""
2922
2923 #. type: Plain text
2924 #: build/C/man3/pthread_attr_setstacksize.3:58
2925 msgid ""
2926 "The B<pthread_attr_getstacksize>()  function returns the stack size "
2927 "attribute of the thread attributes object referred to by I<attr> in the "
2928 "buffer pointed to by I<stacksize>."
2929 msgstr ""
2930
2931 #. type: Plain text
2932 #: build/C/man3/pthread_attr_setstacksize.3:64
2933 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
2934 msgstr ""
2935
2936 #. type: Plain text
2937 #: build/C/man3/pthread_attr_setstacksize.3:69
2938 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
2939 msgstr ""
2940
2941 #.  e.g., MacOS
2942 #. type: Plain text
2943 #: build/C/man3/pthread_attr_setstacksize.3:78
2944 msgid ""
2945 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
2946 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
2947 msgstr ""
2948
2949 #. type: Plain text
2950 #: build/C/man3/pthread_attr_setstacksize.3:85 build/C/man3/pthread_join.3:125
2951 msgid "See B<pthread_create>(3)."
2952 msgstr ""
2953
2954 #. type: Plain text
2955 #: build/C/man3/pthread_attr_setstacksize.3:88
2956 msgid ""
2957 "For details on the default stack size of new threads, see B<pthread_create>"
2958 "(3)."
2959 msgstr ""
2960
2961 #. type: Plain text
2962 #: build/C/man3/pthread_attr_setstacksize.3:91
2963 msgid ""
2964 "A thread's stack size is fixed at the time of thread creation.  Only the "
2965 "main thread can dynamically grow its stack."
2966 msgstr ""
2967
2968 #. type: Plain text
2969 #: build/C/man3/pthread_attr_setstacksize.3:96
2970 msgid ""
2971 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
2972 "the size and location of a caller-allocated stack that is to be used by a "
2973 "thread."
2974 msgstr ""
2975
2976 #. type: Plain text
2977 #: build/C/man3/pthread_attr_setstacksize.3:108
2978 msgid ""
2979 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
2980 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
2981 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
2982 "stack will be at least I<stacksize> bytes."
2983 msgstr ""
2984
2985 #. type: Plain text
2986 #: build/C/man3/pthread_attr_setstacksize.3:115
2987 msgid ""
2988 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
2989 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
2990 msgstr "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
2991
2992 #. type: TH
2993 #: build/C/man3/pthread_cancel.3:24
2994 #, no-wrap
2995 msgid "PTHREAD_CANCEL"
2996 msgstr "PTHREAD_CANCEL"
2997
2998 #. type: TH
2999 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_setschedparam.3:24
3000 #: build/C/man3/pthread_testcancel.3:24
3001 #, no-wrap
3002 msgid "2008-11-17"
3003 msgstr "2008-11-17"
3004
3005 #. type: Plain text
3006 #: build/C/man3/pthread_cancel.3:27
3007 msgid "pthread_cancel - send a cancellation request to a thread"
3008 msgstr ""
3009
3010 #. type: Plain text
3011 #: build/C/man3/pthread_cancel.3:32
3012 #, no-wrap
3013 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3014 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3015
3016 #. type: Plain text
3017 #: build/C/man3/pthread_cancel.3:43
3018 msgid ""
3019 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
3020 "I<thread>.  Whether and when the target thread reacts to the cancellation "
3021 "request depends on two attributes that are under the control of that thread: "
3022 "its cancelability I<state> and I<type>."
3023 msgstr ""
3024
3025 #. type: Plain text
3026 #: build/C/man3/pthread_cancel.3:55
3027 msgid ""
3028 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
3029 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
3030 "has disabled cancellation, then a cancellation request remains queued until "
3031 "the thread enables cancellation.  If a thread has enabled cancellation, then "
3032 "its cancelability type determines when cancellation occurs."
3033 msgstr ""
3034
3035 #. type: Plain text
3036 #: build/C/man3/pthread_cancel.3:71
3037 msgid ""
3038 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3039 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
3040 "Asynchronous cancelability means that the thread can be canceled at any time "
3041 "(usually immediately, but the system does not guarantee this).  Deferred "
3042 "cancelability means that cancellation will be delayed until the thread next "
3043 "calls a function that is a I<cancellation point>.  A list of functions that "
3044 "are or may be cancellation points is provided in I<pthreads>(7)."
3045 msgstr ""
3046
3047 #. type: Plain text
3048 #: build/C/man3/pthread_cancel.3:75
3049 msgid ""
3050 "When a cancellation requested is acted on, the following steps occur for "
3051 "I<thread> (in this order):"
3052 msgstr ""
3053
3054 #. type: IP
3055 #: build/C/man3/pthread_cancel.3:75 build/C/man3/pthread_cleanup_push.3:66
3056 #, no-wrap
3057 msgid "1."
3058 msgstr "1."
3059
3060 #. type: Plain text
3061 #: build/C/man3/pthread_cancel.3:80
3062 msgid ""
3063 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3064 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
3065 msgstr ""
3066
3067 #. type: IP
3068 #: build/C/man3/pthread_cancel.3:80 build/C/man3/pthread_cleanup_push.3:70
3069 #, no-wrap
3070 msgid "2."
3071 msgstr "2."
3072
3073 #. type: Plain text
3074 #: build/C/man3/pthread_cancel.3:85
3075 msgid ""
3076 "Thread-specific data destructors are called, in an unspecified order.  (See "
3077 "B<pthread_key_create>(3).)"
3078 msgstr ""
3079
3080 #. type: IP
3081 #: build/C/man3/pthread_cancel.3:85 build/C/man3/pthread_cleanup_push.3:78
3082 #, no-wrap
3083 msgid "3."
3084 msgstr "3."
3085
3086 #. type: Plain text
3087 #: build/C/man3/pthread_cancel.3:89
3088 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3089 msgstr ""
3090
3091 #. type: Plain text
3092 #: build/C/man3/pthread_cancel.3:97
3093 msgid ""
3094 "The above steps happen asynchronously with respect to the B<pthread_cancel>"
3095 "()  call; the return status of B<pthread_cancel>()  merely informs the "
3096 "caller whether the cancellation request was successfully queued."
3097 msgstr ""
3098
3099 #. type: Plain text
3100 #: build/C/man3/pthread_cancel.3:106
3101 msgid ""
3102 "After a canceled thread has terminated, a join with that thread using "
3103 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
3104 "status.  (Joining with a thread is the only way to know that cancellation "
3105 "has completed.)"
3106 msgstr ""
3107
3108 #. type: Plain text
3109 #: build/C/man3/pthread_cancel.3:111
3110 msgid ""
3111 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
3112 "error number."
3113 msgstr ""
3114
3115 #. type: TP
3116 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_detach.3:57
3117 #: build/C/man3/pthread_getcpuclockid.3:55 build/C/man3/pthread_join.3:91
3118 #: build/C/man3/pthread_kill.3:59 build/C/man3/pthread_setaffinity_np.3:111
3119 #: build/C/man3/pthread_setschedparam.3:111
3120 #: build/C/man3/pthread_setschedprio.3:67 build/C/man3/pthread_sigqueue.3:83
3121 #, no-wrap
3122 msgid "B<ESRCH>"
3123 msgstr "B<ESRCH>"
3124
3125 #. type: Plain text
3126 #: build/C/man3/pthread_cancel.3:119 build/C/man3/pthread_detach.3:62
3127 #: build/C/man3/pthread_getcpuclockid.3:60 build/C/man3/pthread_join.3:96
3128 #: build/C/man3/pthread_kill.3:64 build/C/man3/pthread_setaffinity_np.3:116
3129 #: build/C/man3/pthread_setschedparam.3:116
3130 #: build/C/man3/pthread_setschedprio.3:72
3131 msgid "No thread with the ID I<thread> could be found."
3132 msgstr ""
3133
3134 #. type: Plain text
3135 #: build/C/man3/pthread_cancel.3:129
3136 msgid ""
3137 "On Linux, cancellation is implemented using signals.  Under the NPTL "
3138 "threading implementation, the first real-time signal (i.e., signal 32) is "
3139 "used for this purpose.  On LinuxThreads, the second real-time signal is "
3140 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3141 msgstr ""
3142
3143 #. type: Plain text
3144 #: build/C/man3/pthread_cancel.3:135
3145 msgid ""
3146 "The program below creates a thread and then cancels it.  The main thread "
3147 "joins with the canceled thread to check that its exit status was "
3148 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
3149 "run the program:"
3150 msgstr ""
3151
3152 #. type: Plain text
3153 #: build/C/man3/pthread_cancel.3:143
3154 #, no-wrap
3155 msgid ""
3156 "$ ./a.out\n"
3157 "thread_func(): started; cancellation disabled\n"
3158 "main(): sending cancellation request\n"
3159 "thread_func(): about to enable cancellation\n"
3160 "main(): thread was canceled\n"
3161 msgstr ""
3162 "$ ./a.out\n"
3163 "thread_func(): started; cancellation disabled\n"
3164 "main(): sending cancellation request\n"
3165 "thread_func(): about to enable cancellation\n"
3166 "main(): thread was canceled\n"
3167
3168 #. type: Plain text
3169 #: build/C/man3/pthread_cancel.3:153
3170 #, no-wrap
3171 msgid ""
3172 "#include E<lt>pthread.hE<gt>\n"
3173 "#include E<lt>stdio.hE<gt>\n"
3174 "#include E<lt>errno.hE<gt>\n"
3175 "#include E<lt>stdlib.hE<gt>\n"
3176 "#include E<lt>unistd.hE<gt>\n"
3177 msgstr ""
3178 "#include E<lt>pthread.hE<gt>\n"
3179 "#include E<lt>stdio.hE<gt>\n"
3180 "#include E<lt>errno.hE<gt>\n"
3181 "#include E<lt>stdlib.hE<gt>\n"
3182 "#include E<lt>unistd.hE<gt>\n"
3183
3184 #. type: Plain text
3185 #: build/C/man3/pthread_cancel.3:161
3186 #, no-wrap
3187 msgid ""
3188 "static void *\n"
3189 "thread_func(void *ignored_argument)\n"
3190 "{\n"
3191 "    int s;\n"
3192 msgstr ""
3193 "static void *\n"
3194 "thread_func(void *ignored_argument)\n"
3195 "{\n"
3196 "    int s;\n"
3197
3198 #. type: Plain text
3199 #: build/C/man3/pthread_cancel.3:164
3200 #, no-wrap
3201 msgid ""
3202 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3203 "       immediately react to a cancellation request */\n"
3204 msgstr ""
3205 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3206 "       immediately react to a cancellation request */\n"
3207
3208 #. type: Plain text
3209 #: build/C/man3/pthread_cancel.3:168
3210 #, no-wrap
3211 msgid ""
3212 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3213 "    if (s != 0)\n"
3214 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3215 msgstr ""
3216 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3217 "    if (s != 0)\n"
3218 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3219
3220 #. type: Plain text
3221 #: build/C/man3/pthread_cancel.3:172
3222 #, no-wrap
3223 msgid ""
3224 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3225 "    sleep(5);\n"
3226 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3227 msgstr ""
3228 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3229 "    sleep(5);\n"
3230 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3231
3232 #. type: Plain text
3233 #: build/C/man3/pthread_cancel.3:176
3234 #, no-wrap
3235 msgid ""
3236 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3237 "    if (s != 0)\n"
3238 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3239 msgstr ""
3240 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3241 "    if (s != 0)\n"
3242 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3243
3244 #. type: Plain text
3245 #: build/C/man3/pthread_cancel.3:178
3246 #, no-wrap
3247 msgid "    /* sleep() is a cancellation point */\n"
3248 msgstr "    /* sleep() is a cancellation point */\n"
3249
3250 #. type: Plain text
3251 #: build/C/man3/pthread_cancel.3:180
3252 #, no-wrap
3253 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3254 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3255
3256 #. type: Plain text
3257 #: build/C/man3/pthread_cancel.3:182
3258 #, no-wrap
3259 msgid "    /* Should never get here */\n"
3260 msgstr "    /* Should never get here */\n"
3261
3262 #. type: Plain text
3263 #: build/C/man3/pthread_cancel.3:186
3264 #, no-wrap
3265 msgid ""
3266 "    printf(\"thread_func(): not canceled!\\en\");\n"
3267 "    return NULL;\n"
3268 "}\n"
3269 msgstr ""
3270 "    printf(\"thread_func(): not canceled!\\en\");\n"
3271 "    return NULL;\n"
3272 "}\n"
3273
3274 #. type: Plain text
3275 #: build/C/man3/pthread_cancel.3:193
3276 #, no-wrap
3277 msgid ""
3278 "int\n"
3279 "main(void)\n"
3280 "{\n"
3281 "    pthread_t thr;\n"
3282 "    void *res;\n"
3283 "    int s;\n"
3284 msgstr ""
3285 "int\n"
3286 "main(void)\n"
3287 "{\n"
3288 "    pthread_t thr;\n"
3289 "    void *res;\n"
3290 "    int s;\n"
3291
3292 #. type: Plain text
3293 #: build/C/man3/pthread_cancel.3:195
3294 #, no-wrap
3295 msgid "    /* Start a thread and then send it a cancellation request */\n"
3296 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3297
3298 #. type: Plain text
3299 #: build/C/man3/pthread_cancel.3:199
3300 #, no-wrap
3301 msgid ""
3302 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3303 "    if (s != 0)\n"
3304 "        handle_error_en(s, \"pthread_create\");\n"
3305 msgstr ""
3306 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3307 "    if (s != 0)\n"
3308 "        handle_error_en(s, \"pthread_create\");\n"
3309
3310 #. type: Plain text
3311 #: build/C/man3/pthread_cancel.3:201
3312 #, no-wrap
3313 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3314 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3315
3316 #. type: Plain text
3317 #: build/C/man3/pthread_cancel.3:206
3318 #, no-wrap
3319 msgid ""
3320 "    printf(\"main(): sending cancellation request\\en\");\n"
3321 "    s = pthread_cancel(thr);\n"
3322 "    if (s != 0)\n"
3323 "        handle_error_en(s, \"pthread_cancel\");\n"
3324 msgstr ""
3325 "    printf(\"main(): sending cancellation request\\en\");\n"
3326 "    s = pthread_cancel(thr);\n"
3327 "    if (s != 0)\n"
3328 "        handle_error_en(s, \"pthread_cancel\");\n"
3329
3330 #. type: Plain text
3331 #: build/C/man3/pthread_cancel.3:208
3332 #, no-wrap
3333 msgid "    /* Join with thread to see what its exit status was */\n"
3334 msgstr "    /* Join with thread to see what its exit status was */\n"
3335
3336 #. type: Plain text
3337 #: build/C/man3/pthread_cancel.3:212 build/C/man3/pthread_cleanup_push.3:300
3338 #, no-wrap
3339 msgid ""
3340 "    s = pthread_join(thr, &res);\n"
3341 "    if (s != 0)\n"
3342 "        handle_error_en(s, \"pthread_join\");\n"
3343 msgstr ""
3344 "    s = pthread_join(thr, &res);\n"
3345 "    if (s != 0)\n"
3346 "        handle_error_en(s, \"pthread_join\");\n"
3347
3348 #. type: Plain text
3349 #: build/C/man3/pthread_cancel.3:219
3350 #, no-wrap
3351 msgid ""
3352 "    if (res == PTHREAD_CANCELED)\n"
3353 "        printf(\"main(): thread was canceled\\en\");\n"
3354 "    else\n"
3355 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3356 "    exit(EXIT_SUCCESS);\n"
3357 "}\n"
3358 msgstr ""
3359 "    if (res == PTHREAD_CANCELED)\n"
3360 "        printf(\"main(): thread was canceled\\en\");\n"
3361 "    else\n"
3362 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3363 "    exit(EXIT_SUCCESS);\n"
3364 "}\n"
3365
3366 #. type: Plain text
3367 #: build/C/man3/pthread_cancel.3:230
3368 msgid ""
3369 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3370 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3371 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3372 msgstr "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3373
3374 #. type: TH
3375 #: build/C/man3/pthread_cleanup_push.3:24
3376 #, no-wrap
3377 msgid "PTHREAD_CLEANUP_PUSH"
3378 msgstr "PTHREAD_CLEANUP_PUSH"
3379
3380 #. type: TH
3381 #: build/C/man3/pthread_cleanup_push.3:24
3382 #: build/C/man3/pthread_setcancelstate.3:24
3383 #, no-wrap
3384 msgid "2008-11-24"
3385 msgstr "2008-11-24"
3386
3387 #. type: Plain text
3388 #: build/C/man3/pthread_cleanup_push.3:28
3389 msgid ""
3390 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
3391 "clean-up handlers"
3392 msgstr ""
3393
3394 #. type: Plain text
3395 #: build/C/man3/pthread_cleanup_push.3:35
3396 #, no-wrap
3397 msgid ""
3398 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3399 "B<                          void *>I<arg>B<);>\n"
3400 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3401 msgstr ""
3402 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3403 "B<                          void *>I<arg>B<);>\n"
3404 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3405
3406 #. type: Plain text
3407 #: build/C/man3/pthread_cleanup_push.3:45
3408 msgid ""
3409 "These functions manipulate the calling thread's stack of thread-cancellation "
3410 "clean-up handlers.  A clean-up handler is a function that is automatically "
3411 "executed when a thread is canceled (or in various other circumstances "
3412 "described below); it might, for example, unlock a mutex so that it becomes "
3413 "available to other threads in the process."
3414 msgstr ""
3415
3416 #. type: Plain text
3417 #: build/C/man3/pthread_cleanup_push.3:56
3418 msgid ""
3419 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
3420 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
3421 "be given I<arg> as its argument."
3422 msgstr ""
3423
3424 #. type: Plain text
3425 #: build/C/man3/pthread_cleanup_push.3:63
3426 msgid ""
3427 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
3428 "stack of clean-up handlers, and optionally executes it if I<execute> is "
3429 "nonzero."
3430 msgstr ""
3431
3432 #. type: Plain text
3433 #: build/C/man3/pthread_cleanup_push.3:66
3434 msgid ""
3435 "A cancellation clean-up handler is popped from the stack and executed in the "
3436 "following circumstances:"
3437 msgstr ""
3438
3439 #. type: Plain text
3440 #: build/C/man3/pthread_cleanup_push.3:70
3441 msgid ""
3442 "When a thread is canceled, all of the stacked clean-up handlers are popped "
3443 "and executed in the reverse of the order in which they were pushed onto the "
3444 "stack."
3445 msgstr ""
3446
3447 #. type: Plain text
3448 #: build/C/man3/pthread_cleanup_push.3:78
3449 msgid ""
3450 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
3451 "handlers are executed as described in the preceding point.  (Clean-up "
3452 "handlers are I<not> called if the thread terminates by performing a "
3453 "I<return> from the thread start function.)"
3454 msgstr ""
3455
3456 #. type: Plain text
3457 #: build/C/man3/pthread_cleanup_push.3:84
3458 msgid ""
3459 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
3460 "argument, the top-most clean-up handler is popped and executed."
3461 msgstr ""
3462
3463 #. type: Plain text
3464 #: build/C/man3/pthread_cleanup_push.3:96
3465 msgid ""
3466 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
3467 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
3468 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
3469 "calls to these functions are paired within the same function, and at the "
3470 "same lexical nesting level.  (In other words, a clean-up handler is only "
3471 "established during the execution of a specified section of code.)"
3472 msgstr ""
3473
3474 #. type: Plain text
3475 #: build/C/man3/pthread_cleanup_push.3:116
3476 msgid ""
3477 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
3478 "call has been made to B<pthread_cleanup_push>()  or B<pthread_cleanup_pop>"
3479 "()  without the matching call of the pair since the jump buffer was filled "
3480 "by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, calling B<longjmp>(3)  "
3481 "(B<siglongjmp>(3))  from inside a clean-up handler produces undefined "
3482 "results unless the jump buffer was also filled by B<setjmp>(3)  (B<sigsetjmp>"
3483 "(3))  inside the handler."
3484 msgstr ""
3485
3486 #. type: Plain text
3487 #: build/C/man3/pthread_cleanup_push.3:118
3488 msgid "These functions do not return a value."
3489 msgstr ""
3490
3491 #.  SH VERSIONS
3492 #.  Available since glibc 2.0
3493 #. type: Plain text
3494 #: build/C/man3/pthread_cleanup_push.3:122
3495 msgid "There are no errors."
3496 msgstr ""
3497
3498 #. type: Plain text
3499 #: build/C/man3/pthread_cleanup_push.3:133
3500 msgid ""
3501 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
3502 "functions I<are> implemented as macros that expand to text containing \\(aqB<"
3503 "{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
3504 "declared within the scope of paired calls to these functions will only be "
3505 "visible within that scope."
3506 msgstr ""
3507
3508 #.  The text was actually added in the 2004 TC2
3509 #. type: Plain text
3510 #: build/C/man3/pthread_cleanup_push.3:148
3511 msgid ""
3512 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
3513 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
3514 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
3515 "avoid doing this."
3516 msgstr ""
3517
3518 #. type: Plain text
3519 #: build/C/man3/pthread_cleanup_push.3:163
3520 msgid ""
3521 "The program below provides a simple example of the use of the functions "
3522 "described in this page.  The program creates a thread that executes a loop "
3523 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
3524 "loop increments a global variable, I<cnt>, once each second.  Depending on "
3525 "what command-line arguments are supplied, the main thread sends the other "
3526 "thread a cancellation request, or sets a global variable that causes the "
3527 "other thread to exit its loop and terminate normally (by doing a I<return>)."
3528 msgstr ""
3529
3530 #. type: Plain text
3531 #: build/C/man3/pthread_cleanup_push.3:166
3532 msgid ""
3533 "In the following shell session, the main thread sends a cancellation request "
3534 "to the other thread:"
3535 msgstr ""
3536
3537 #. type: Plain text
3538 #: build/C/man3/pthread_cleanup_push.3:176
3539 #, no-wrap
3540 msgid ""
3541 "$ B<./a.out>\n"
3542 "New thread started\n"
3543 "cnt = 0\n"
3544 "cnt = 1\n"
3545 "Canceling thread\n"
3546 "Called clean-up handler\n"
3547 "Thread was canceled; cnt = 0\n"
3548 msgstr ""
3549 "$ B<./a.out>\n"
3550 "New thread started\n"
3551 "cnt = 0\n"
3552 "cnt = 1\n"
3553 "Canceling thread\n"
3554 "Called clean-up handler\n"
3555 "Thread was canceled; cnt = 0\n"
3556
3557 #. type: Plain text
3558 #: build/C/man3/pthread_cleanup_push.3:184
3559 msgid ""
3560 "From the above, we see that the thread was canceled, and that the "
3561 "cancellation clean-up handler was called and it reset the value of the "
3562 "global variable I<cnt> to 0."
3563 msgstr ""
3564
3565 #. type: Plain text
3566 #: build/C/man3/pthread_cleanup_push.3:187
3567 msgid ""
3568 "In the next run, the main program sets a global variable that causes other "
3569 "thread to terminate normally:"
3570 msgstr ""
3571
3572 #. type: Plain text
3573 #: build/C/man3/pthread_cleanup_push.3:195
3574 #, no-wrap
3575 msgid ""
3576 "$ B<./a.out x>\n"
3577 "New thread started\n"
3578 "cnt = 0\n"
3579 "cnt = 1\n"
3580 "Thread terminated normally; cnt = 2\n"
3581 msgstr ""
3582 "$ B<./a.out x>\n"
3583 "New thread started\n"
3584 "cnt = 0\n"
3585 "cnt = 1\n"
3586 "Thread terminated normally; cnt = 2\n"
3587
3588 #. type: Plain text
3589 #: build/C/man3/pthread_cleanup_push.3:203
3590 msgid ""
3591 "From the above, we see that the clean-up handler was not executed (because "
3592 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
3593 msgstr ""
3594
3595 #. type: Plain text
3596 #: build/C/man3/pthread_cleanup_push.3:208
3597 msgid ""
3598 "In the next run, the main program sets a global variable that causes the "
3599 "other thread to terminate normally, and supplies a nonzero value for "
3600 "I<cleanup_pop_arg>:"
3601 msgstr ""
3602
3603 #. type: Plain text
3604 #: build/C/man3/pthread_cleanup_push.3:217
3605 #, no-wrap
3606 msgid ""
3607 "$ B<./a.out x 1>\n"
3608 "New thread started\n"
3609 "cnt = 0\n"
3610 "cnt = 1\n"
3611 "Called clean-up handler\n"
3612 "Thread terminated normally; cnt = 0\n"
3613 msgstr ""
3614 "$ B<./a.out x 1>\n"
3615 "New thread started\n"
3616 "cnt = 0\n"
3617 "cnt = 1\n"
3618 "Called clean-up handler\n"
3619 "Thread terminated normally; cnt = 0\n"
3620
3621 #. type: Plain text
3622 #: build/C/man3/pthread_cleanup_push.3:224
3623 msgid ""
3624 "In the above, we see that although the thread was not canceled, the clean-up "
3625 "handler was executed, because the argument given to B<pthread_cleanup_pop>"
3626 "()  was nonzero."
3627 msgstr ""
3628
3629 #. type: Plain text
3630 #: build/C/man3/pthread_cleanup_push.3:233
3631 #, no-wrap
3632 msgid ""
3633 "#include E<lt>pthread.hE<gt>\n"
3634 "#include E<lt>sys/types.hE<gt>\n"
3635 "#include E<lt>stdio.hE<gt>\n"
3636 "#include E<lt>stdlib.hE<gt>\n"
3637 "#include E<lt>unistd.hE<gt>\n"
3638 "#include E<lt>errno.hE<gt>\n"
3639 msgstr ""
3640 "#include E<lt>pthread.hE<gt>\n"
3641 "#include E<lt>sys/types.hE<gt>\n"
3642 "#include E<lt>stdio.hE<gt>\n"
3643 "#include E<lt>stdlib.hE<gt>\n"
3644 "#include E<lt>unistd.hE<gt>\n"
3645 "#include E<lt>errno.hE<gt>\n"
3646
3647 #. type: Plain text
3648 #: build/C/man3/pthread_cleanup_push.3:240
3649 #, no-wrap
3650 msgid ""
3651 "static int done = 0;\n"
3652 "static int cleanup_pop_arg = 0;\n"
3653 "static int cnt = 0;\n"
3654 msgstr ""
3655 "static int done = 0;\n"
3656 "static int cleanup_pop_arg = 0;\n"
3657 "static int cnt = 0;\n"
3658
3659 #. type: Plain text
3660 #: build/C/man3/pthread_cleanup_push.3:247
3661 #, no-wrap
3662 msgid ""
3663 "static void\n"
3664 "cleanup_handler(void *arg)\n"
3665 "{\n"
3666 "    printf(\"Called clean-up handler\\en\");\n"
3667 "    cnt = 0;\n"
3668 "}\n"
3669 msgstr ""
3670 "static void\n"
3671 "cleanup_handler(void *arg)\n"
3672 "{\n"
3673 "    printf(\"Called clean-up handler\\en\");\n"
3674 "    cnt = 0;\n"
3675 "}\n"
3676
3677 #. type: Plain text
3678 #: build/C/man3/pthread_cleanup_push.3:252
3679 #, no-wrap
3680 msgid ""
3681 "static void *\n"
3682 "thread_start(void *arg)\n"
3683 "{\n"
3684 "    time_t start, curr;\n"
3685 msgstr ""
3686 "static void *\n"
3687 "thread_start(void *arg)\n"
3688 "{\n"
3689 "    time_t start, curr;\n"
3690
3691 #. type: Plain text
3692 #: build/C/man3/pthread_cleanup_push.3:254
3693 #, no-wrap
3694 msgid "    printf(\"New thread started\\en\");\n"
3695 msgstr "    printf(\"New thread started\\en\");\n"
3696
3697 #. type: Plain text
3698 #: build/C/man3/pthread_cleanup_push.3:256
3699 #, no-wrap
3700 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
3701 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
3702
3703 #. type: Plain text
3704 #: build/C/man3/pthread_cleanup_push.3:258
3705 #, no-wrap
3706 msgid "    curr = start = time(NULL);\n"
3707 msgstr "    curr = start = time(NULL);\n"
3708
3709 #. type: Plain text
3710 #: build/C/man3/pthread_cleanup_push.3:267
3711 #, no-wrap
3712 msgid ""
3713 "    while (!done) {\n"
3714 "        pthread_testcancel();           /* A cancellation point */\n"
3715 "        if (curr E<lt> time(NULL)) {\n"
3716 "            curr = time(NULL);\n"
3717 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
3718 "            cnt++;\n"
3719 "        }\n"
3720 "    }\n"
3721 msgstr ""
3722 "    while (!done) {\n"
3723 "        pthread_testcancel();           /* A cancellation point */\n"
3724 "        if (curr E<lt> time(NULL)) {\n"
3725 "            curr = time(NULL);\n"
3726 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
3727 "            cnt++;\n"
3728 "        }\n"
3729 "    }\n"
3730
3731 #. type: Plain text
3732 #: build/C/man3/pthread_cleanup_push.3:271
3733 #, no-wrap
3734 msgid ""
3735 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
3736 "    return NULL;\n"
3737 "}\n"
3738 msgstr ""
3739 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
3740 "    return NULL;\n"
3741 "}\n"
3742
3743 #. type: Plain text
3744 #: build/C/man3/pthread_cleanup_push.3:278
3745 #, no-wrap
3746 msgid ""
3747 "int\n"
3748 "main(int argc, char *argv[])\n"
3749 "{\n"
3750 "    pthread_t thr;\n"
3751 "    int s;\n"
3752 "    void *res;\n"
3753 msgstr ""
3754 "int\n"
3755 "main(int argc, char *argv[])\n"
3756 "{\n"
3757 "    pthread_t thr;\n"
3758 "    int s;\n"
3759 "    void *res;\n"
3760
3761 #. type: Plain text
3762 #: build/C/man3/pthread_cleanup_push.3:282
3763 #, no-wrap
3764 msgid ""
3765 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
3766 "    if (s != 0)\n"
3767 "        handle_error_en(s, \"pthread_create\");\n"
3768 msgstr ""
3769 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
3770 "    if (s != 0)\n"
3771 "        handle_error_en(s, \"pthread_create\");\n"
3772
3773 #. type: Plain text
3774 #: build/C/man3/pthread_cleanup_push.3:284
3775 #, no-wrap
3776 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
3777 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
3778
3779 #. type: Plain text
3780 #: build/C/man3/pthread_cleanup_push.3:289
3781 #, no-wrap
3782 msgid ""
3783 "    if (argc E<gt> 1) {\n"
3784 "        if (argc E<gt> 2)\n"
3785 "            cleanup_pop_arg = atoi(argv[2]);\n"
3786 "        done = 1;\n"
3787 msgstr ""
3788 "    if (argc E<gt> 1) {\n"
3789 "        if (argc E<gt> 2)\n"
3790 "            cleanup_pop_arg = atoi(argv[2]);\n"
3791 "        done = 1;\n"
3792
3793 #. type: Plain text
3794 #: build/C/man3/pthread_cleanup_push.3:296
3795 #, no-wrap
3796 msgid ""
3797 "    } else {\n"
3798 "        printf(\"Canceling thread\\en\");\n"
3799 "        s = pthread_cancel(thr);\n"
3800 "        if (s != 0)\n"
3801 "            handle_error_en(s, \"pthread_cancel\");\n"
3802 "    }\n"
3803 msgstr ""
3804 "    } else {\n"
3805 "        printf(\"Canceling thread\\en\");\n"
3806 "        s = pthread_cancel(thr);\n"
3807 "        if (s != 0)\n"
3808 "            handle_error_en(s, \"pthread_cancel\");\n"
3809 "    }\n"
3810
3811 #. type: Plain text
3812 #: build/C/man3/pthread_cleanup_push.3:307
3813 #, no-wrap
3814 msgid ""
3815 "    if (res == PTHREAD_CANCELED)\n"
3816 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
3817 "    else\n"
3818 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
3819 "    exit(EXIT_SUCCESS);\n"
3820 "}\n"
3821 msgstr ""
3822 "    if (res == PTHREAD_CANCELED)\n"
3823 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
3824 "    else\n"
3825 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
3826 "    exit(EXIT_SUCCESS);\n"
3827 "}\n"
3828
3829 #. type: Plain text
3830 #: build/C/man3/pthread_cleanup_push.3:314
3831 msgid ""
3832 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
3833 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3834 msgstr "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3835
3836 #. type: TH
3837 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
3838 #, no-wrap
3839 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
3840 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
3841
3842 #. type: TH
3843 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
3844 #, no-wrap
3845 msgid "2008-12-04"
3846 msgstr "2008-12-04"
3847
3848 #. type: Plain text
3849 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
3850 msgid ""
3851 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
3852 "thread cancellation clean-up handlers while saving cancelability type"
3853 msgstr ""
3854
3855 #. type: Plain text
3856 #: build/C/man3/pthread_cleanup_push_defer_np.3:35
3857 #, no-wrap
3858 msgid ""
3859 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
3860 "B<                                   void *>I<arg>B<);>\n"
3861 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
3862 msgstr ""
3863 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
3864 "B<                                   void *>I<arg>B<);>\n"
3865 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
3866
3867 #. type: Plain text
3868 #: build/C/man3/pthread_cleanup_push_defer_np.3:43
3869 msgid ""
3870 "These functions are the same as B<pthread_cleanup_push>(3)  and "
3871 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
3872 msgstr ""
3873
3874 #. type: Plain text
3875 #: build/C/man3/pthread_cleanup_push_defer_np.3:56
3876 msgid ""
3877 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
3878 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
3879 "addition, it also saves the thread's current cancelability type, and sets "
3880 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
3881 "this ensures that cancellation clean-up will occur even if the thread's "
3882 "cancelability type was \"asynchronous\" before the the call."
3883 msgstr ""
3884
3885 #. type: Plain text
3886 #: build/C/man3/pthread_cleanup_push_defer_np.3:65
3887 msgid ""
3888 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
3889 "the top-most clean-up handler from the thread's stack of cancellation clean-"
3890 "up handlers.  In addition, it restores the thread's cancelability type to "
3891 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
3892 msgstr ""
3893
3894 #. type: Plain text
3895 #: build/C/man3/pthread_cleanup_push_defer_np.3:71
3896 msgid ""
3897 "The caller must ensure that calls to these functions are paired within the "
3898 "same function, and at the same lexical nesting level.  Other restrictions "
3899 "apply, as described in B<pthread_cleanup_push>(3)."
3900 msgstr ""
3901
3902 #. type: Plain text
3903 #: build/C/man3/pthread_cleanup_push_defer_np.3:73
3904 msgid "This sequence of calls:"
3905 msgstr ""
3906
3907 #. type: Plain text
3908 #: build/C/man3/pthread_cleanup_push_defer_np.3:78
3909 #, no-wrap
3910 msgid ""
3911 "pthread_cleanup_push_defer_np(routine, arg);\n"
3912 "pthread_cleanup_pop_restore_np(execute);\n"
3913 msgstr ""
3914
3915 #. type: Plain text
3916 #: build/C/man3/pthread_cleanup_push_defer_np.3:82
3917 msgid "is equivalent to (but shorter and more efficient than):"
3918 msgstr ""
3919
3920 #. type: Plain text
3921 #: build/C/man3/pthread_cleanup_push_defer_np.3:88
3922 #, no-wrap
3923 msgid "int oldtype;\n"
3924 msgstr "int oldtype;\n"
3925
3926 #. type: Plain text
3927 #: build/C/man3/pthread_cleanup_push_defer_np.3:94
3928 #, no-wrap
3929 msgid ""
3930 "pthread_cleanup_push(routine, arg);\n"
3931 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
3932 "\\&...\n"
3933 "pthread_setcanceltype(oldtype, NULL);\n"
3934 "pthread_cleanup_pop(execute);\n"
3935 msgstr ""
3936 "pthread_cleanup_push(routine, arg);\n"
3937 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
3938 "\\&...\n"
3939 "pthread_setcanceltype(oldtype, NULL);\n"
3940 "pthread_cleanup_pop(execute);\n"
3941
3942 #. type: Plain text
3943 #: build/C/man3/pthread_cleanup_push_defer_np.3:107
3944 msgid ""
3945 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
3946 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3947 msgstr "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3948
3949 #. type: TH
3950 #: build/C/man3/pthread_create.3:24
3951 #, no-wrap
3952 msgid "PTHREAD_CREATE"
3953 msgstr "PTHREAD_CREATE"
3954
3955 #. type: Plain text
3956 #: build/C/man3/pthread_create.3:27
3957 msgid "pthread_create - create a new thread"
3958 msgstr ""
3959
3960 #. type: Plain text
3961 #: build/C/man3/pthread_create.3:33
3962 #, no-wrap
3963 msgid ""
3964 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
3965 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
3966 msgstr ""
3967 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
3968 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
3969
3970 #. type: Plain text
3971 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
3972 #: build/C/man3/pthread_join.3:35 build/C/man3/pthread_kill.3:35
3973 #: build/C/man3/pthread_sigmask.3:36 build/C/man3/pthread_sigqueue.3:35
3974 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
3975 msgid "Compile and link with I<-pthread>."
3976 msgstr ""
3977
3978 #. type: Plain text
3979 #: build/C/man3/pthread_create.3:45
3980 msgid ""
3981 "The B<pthread_create>()  function starts a new thread in the calling "
3982 "process.  The new thread starts execution by invoking I<start_routine>(); "
3983 "I<arg> is passed as the sole argument of I<start_routine>()."
3984 msgstr ""
3985
3986 #. type: Plain text
3987 #: build/C/man3/pthread_create.3:47
3988 msgid "The new thread terminates in one of the following ways:"
3989 msgstr ""
3990
3991 #. type: IP
3992 #: build/C/man3/pthread_create.3:47 build/C/man3/pthread_create.3:53
3993 #: build/C/man3/pthread_create.3:61 build/C/man3/pthread_create.3:64
3994 #: build/C/man3/pthread_getattr_np.3:49 build/C/man3/pthread_getattr_np.3:52
3995 #: build/C/man3/pthread_getattr_np.3:55
3996 #, no-wrap
3997 msgid "*"
3998 msgstr "*"
3999
4000 #. type: Plain text
4001 #: build/C/man3/pthread_create.3:53
4002 msgid ""
4003 "It calls B<pthread_exit>(3), specifying an exit status value that is "
4004 "available to another thread in the same process that calls B<pthread_join>"
4005 "(3)."
4006 msgstr ""
4007
4008 #. type: Plain text
4009 #: build/C/man3/pthread_create.3:61
4010 msgid ""
4011 "It returns from I<start_routine>().  This is equivalent to calling "
4012 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
4013 msgstr ""
4014
4015 #. type: Plain text
4016 #: build/C/man3/pthread_create.3:64
4017 msgid "It is canceled (see B<pthread_cancel>(3))."
4018 msgstr ""
4019
4020 #. type: Plain text
4021 #: build/C/man3/pthread_create.3:70
4022 msgid ""
4023 "Any of the threads in the process calls B<exit>(3), or the main thread "
4024 "performs a return from I<main>().  This causes the termination of all "
4025 "threads in the process."
4026 msgstr ""
4027
4028 #. type: Plain text
4029 #: build/C/man3/pthread_create.3:84
4030 msgid ""
4031 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4032 "are used at thread creation time to determine attributes for the new thread; "
4033 "this structure is initialized using B<pthread_attr_init>(3)  and related "
4034 "functions.  If I<attr> is NULL, then the thread is created with default "
4035 "attributes."
4036 msgstr ""
4037
4038 #. type: Plain text
4039 #: build/C/man3/pthread_create.3:91
4040 msgid ""
4041 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
4042 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4043 "used to refer to the thread in subsequent calls to other pthreads functions."
4044 msgstr ""
4045
4046 #. type: Plain text
4047 #: build/C/man3/pthread_create.3:99
4048 msgid ""
4049 "The new thread inherits a copy of the creating thread's signal mask "
4050 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
4051 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
4052 "thread's alternate signal stack (B<sigaltstack>(2))."
4053 msgstr ""
4054
4055 #. type: Plain text
4056 #: build/C/man3/pthread_create.3:102
4057 msgid ""
4058 "The new thread inherits the calling thread's floating-point environment "
4059 "(B<fenv>(3))."
4060 msgstr ""
4061
4062 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4063 #. type: Plain text
4064 #: build/C/man3/pthread_create.3:107
4065 msgid ""
4066 "The initial value of the new thread's CPU-time clock is 0 (see "
4067 "B<pthread_getcpuclockid>(3))."
4068 msgstr ""
4069
4070 #. type: SS
4071 #: build/C/man3/pthread_create.3:107
4072 #, no-wrap
4073 msgid "Linux-specific details"
4074 msgstr ""
4075
4076 #. type: Plain text
4077 #: build/C/man3/pthread_create.3:113
4078 msgid ""
4079 "The new thread inherits copies of the calling thread's capability sets (see "
4080 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4081 msgstr ""
4082
4083 #. type: Plain text
4084 #: build/C/man3/pthread_create.3:120
4085 msgid ""
4086 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
4087 "number, and the contents of I<*thread> are undefined."
4088 msgstr ""
4089
4090 #. type: TP
4091 #: build/C/man3/pthread_create.3:121 build/C/man3/pthread_sigqueue.3:69
4092 #, no-wrap
4093 msgid "B<EAGAIN>"
4094 msgstr "B<EAGAIN>"
4095
4096 #. type: Plain text
4097 #: build/C/man3/pthread_create.3:135
4098 msgid ""
4099 "Insufficient resources to create another thread, or a system-imposed limit "
4100 "on the number of threads was encountered.  The latter case may occur in two "
4101 "ways: the B<RLIMIT_NPROC> soft resource limit (set via B<setrlimit>(2)), "
4102 "which limits the number of process for a real user ID, was reached; or the "
4103 "kernel's system-wide limit on the number of threads, I</proc/sys/kernel/"
4104 "threads-max>, was reached."
4105 msgstr ""
4106
4107 #. type: Plain text
4108 #: build/C/man3/pthread_create.3:139
4109 msgid "Invalid settings in I<attr>."
4110 msgstr ""
4111
4112 #. type: TP
4113 #: build/C/man3/pthread_create.3:139 build/C/man3/pthread_setschedparam.3:126
4114 #: build/C/man3/pthread_setschedprio.3:63
4115 #, no-wrap
4116 msgid "B<EPERM>"
4117 msgstr "B<EPERM>"
4118
4119 #. type: Plain text
4120 #: build/C/man3/pthread_create.3:144
4121 msgid ""
4122 "No permission to set the scheduling policy and parameters specified in "
4123 "I<attr>."
4124 msgstr ""
4125
4126 #. type: Plain text
4127 #: build/C/man3/pthread_create.3:158
4128 msgid ""
4129 "See B<pthread_self>(3)  for further information on the thread ID returned in "
4130 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
4131 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4132 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4133 msgstr ""
4134
4135 #. type: Plain text
4136 #: build/C/man3/pthread_create.3:178
4137 msgid ""
4138 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
4139 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
4140 "terminate and fetch its exit status.  Only when a terminated joinable thread "
4141 "has been joined are the last of its resources released back to the system.  "
4142 "When a detached thread terminates, its resources are automatically released "
4143 "back to the system: it is not possible to join with the thread in order to "
4144 "obtain its exit status.  Making a thread detached is useful for some types "
4145 "of daemon threads whose exit status the application does not need to care "
4146 "about.  By default, a new thread is created in a joinable state, unless "
4147 "I<attr> was set to create the thread in a detached state (using "
4148 "B<pthread_attr_setdetachstate>(3))."
4149 msgstr ""
4150
4151 #.  FIXME . Perhaps some of the following detail should be in
4152 #.  a future pthread_attr_setstacksize(3) page.
4153 #. type: Plain text
4154 #: build/C/man3/pthread_create.3:194
4155 msgid ""
4156 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
4157 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
4158 "resource limit I<at the time the program started> has any value other than "
4159 "\"unlimited\", then it determines the default stack size of new threads.  "
4160 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
4161 "explicitly set in the I<attr> argument used to create a thread, in order to "
4162 "obtain a stack size other than the default."
4163 msgstr ""
4164
4165 #. type: Plain text
4166 #: build/C/man3/pthread_create.3:198
4167 msgid ""
4168 "The program below demonstrates the use of B<pthread_create>(), as well as a "
4169 "number of other functions in the pthreads API."
4170 msgstr ""
4171
4172 #. type: Plain text
4173 #: build/C/man3/pthread_create.3:203
4174 msgid ""
4175 "In the following run, on a system providing the NPTL threading "
4176 "implementation, the stack size defaults to the value given by the \"stack "
4177 "size\" resource limit:"
4178 msgstr ""
4179
4180 #. type: Plain text
4181 #: build/C/man3/pthread_create.3:215
4182 #, no-wrap
4183 msgid ""
4184 "$B< ulimit -s>\n"
4185 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
4186 "$B< ./a.out hola salut servus>\n"
4187 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4188 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4189 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4190 "Joined with thread 1; returned value was HOLA\n"
4191 "Joined with thread 2; returned value was SALUT\n"
4192 "Joined with thread 3; returned value was SERVUS\n"
4193 msgstr ""
4194 "$B< ulimit -s>\n"
4195 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
4196 "$B< ./a.out hola salut servus>\n"
4197 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4198 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4199 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4200 "Joined with thread 1; returned value was HOLA\n"
4201 "Joined with thread 2; returned value was SALUT\n"
4202 "Joined with thread 3; returned value was SERVUS\n"
4203
4204 #. type: Plain text
4205 #: build/C/man3/pthread_create.3:221
4206 msgid ""
4207 "In the next run, the program explicitly sets a stack size of 1MB (using "
4208 "B<pthread_attr_setstacksize>(3))  for the created threads:"
4209 msgstr ""
4210
4211 #. type: Plain text
4212 #: build/C/man3/pthread_create.3:231
4213 #, no-wrap
4214 msgid ""
4215 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4216 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4217 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4218 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4219 "Joined with thread 1; returned value was HOLA\n"
4220 "Joined with thread 2; returned value was SALUT\n"
4221 "Joined with thread 3; returned value was SERVUS\n"
4222 msgstr ""
4223 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4224 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4225 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4226 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4227 "Joined with thread 1; returned value was HOLA\n"
4228 "Joined with thread 2; returned value was SALUT\n"
4229 "Joined with thread 3; returned value was SERVUS\n"
4230
4231 #. type: Plain text
4232 #: build/C/man3/pthread_create.3:243
4233 #, no-wrap
4234 msgid ""
4235 "#include E<lt>pthread.hE<gt>\n"
4236 "#include E<lt>string.hE<gt>\n"
4237 "#include E<lt>stdio.hE<gt>\n"
4238 "#include E<lt>stdlib.hE<gt>\n"
4239 "#include E<lt>unistd.hE<gt>\n"
4240 "#include E<lt>errno.hE<gt>\n"
4241 "#include E<lt>ctype.hE<gt>\n"
4242 msgstr ""
4243 "#include E<lt>pthread.hE<gt>\n"
4244 "#include E<lt>string.hE<gt>\n"
4245 "#include E<lt>stdio.hE<gt>\n"
4246 "#include E<lt>stdlib.hE<gt>\n"
4247 "#include E<lt>unistd.hE<gt>\n"
4248 "#include E<lt>errno.hE<gt>\n"
4249 "#include E<lt>ctype.hE<gt>\n"
4250
4251 #. type: Plain text
4252 #: build/C/man3/pthread_create.3:249 build/C/man3/pthread_getcpuclockid.3:107
4253 #, no-wrap
4254 msgid ""
4255 "#define handle_error(msg) \\e\n"
4256 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4257 msgstr ""
4258 "#define handle_error(msg) \\e\n"
4259 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4260
4261 #. type: Plain text
4262 #: build/C/man3/pthread_create.3:255
4263 #, no-wrap
4264 msgid ""
4265 "struct thread_info {    /* Used as argument to thread_start() */\n"
4266 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4267 "    int       thread_num;       /* Application-defined thread # */\n"
4268 "    char     *argv_string;      /* From command-line argument */\n"
4269 "};\n"
4270 msgstr ""
4271 "struct thread_info {    /* Used as argument to thread_start() */\n"
4272 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4273 "    int       thread_num;       /* Application-defined thread # */\n"
4274 "    char     *argv_string;      /* From command-line argument */\n"
4275 "};\n"
4276
4277 #. type: Plain text
4278 #: build/C/man3/pthread_create.3:258
4279 #, no-wrap
4280 msgid ""
4281 "/* Thread start function: display address near top of our stack,\n"
4282 "   and return upper-cased copy of argv_string */\n"
4283 msgstr ""
4284 "/* Thread start function: display address near top of our stack,\n"
4285 "   and return upper-cased copy of argv_string */\n"
4286
4287 #. type: Plain text
4288 #: build/C/man3/pthread_create.3:264
4289 #, no-wrap
4290 msgid ""
4291 "static void *\n"
4292 "thread_start(void *arg)\n"
4293 "{\n"
4294 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
4295 "    char *uargv, *p;\n"
4296 msgstr ""
4297 "static void *\n"
4298 "thread_start(void *arg)\n"
4299 "{\n"
4300 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
4301 "    char *uargv, *p;\n"
4302
4303 #. type: Plain text
4304 #: build/C/man3/pthread_create.3:267
4305 #, no-wrap
4306 msgid ""
4307 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4308 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4309 msgstr ""
4310 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4311 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4312
4313 #. type: Plain text
4314 #: build/C/man3/pthread_create.3:271
4315 #, no-wrap
4316 msgid ""
4317 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4318 "    if (uargv == NULL)\n"
4319 "        handle_error(\"strdup\");\n"
4320 msgstr ""
4321 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4322 "    if (uargv == NULL)\n"
4323 "        handle_error(\"strdup\");\n"
4324
4325 #. type: Plain text
4326 #: build/C/man3/pthread_create.3:274
4327 #, no-wrap
4328 msgid ""
4329 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4330 "        *p = toupper(*p);\n"
4331 msgstr ""
4332 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4333 "        *p = toupper(*p);\n"
4334
4335 #. type: Plain text
4336 #: build/C/man3/pthread_create.3:277
4337 #, no-wrap
4338 msgid ""
4339 "    return uargv;\n"
4340 "}\n"
4341 msgstr ""
4342 "    return uargv;\n"
4343 "}\n"
4344
4345 #. type: Plain text
4346 #: build/C/man3/pthread_create.3:286
4347 #, no-wrap
4348 msgid ""
4349 "int\n"
4350 "main(int argc, char *argv[])\n"
4351 "{\n"
4352 "    int s, tnum, opt, num_threads;\n"
4353 "    struct thread_info *tinfo;\n"
4354 "    pthread_attr_t attr;\n"
4355 "    int stack_size;\n"
4356 "    void *res;\n"
4357 msgstr ""
4358 "int\n"
4359 "main(int argc, char *argv[])\n"
4360 "{\n"
4361 "    int s, tnum, opt, num_threads;\n"
4362 "    struct thread_info *tinfo;\n"
4363 "    pthread_attr_t attr;\n"
4364 "    int stack_size;\n"
4365 "    void *res;\n"
4366
4367 #. type: Plain text
4368 #: build/C/man3/pthread_create.3:288
4369 #, no-wrap
4370 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
4371 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
4372
4373 #. type: Plain text
4374 #: build/C/man3/pthread_create.3:295
4375 #, no-wrap
4376 msgid ""
4377 "    stack_size = -1;\n"
4378 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4379 "        switch (opt) {\n"
4380 "        case \\(aqs\\(aq:\n"
4381 "            stack_size = strtoul(optarg, NULL, 0);\n"
4382 "            break;\n"
4383 msgstr ""
4384 "    stack_size = -1;\n"
4385 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4386 "        switch (opt) {\n"
4387 "        case \\(aqs\\(aq:\n"
4388 "            stack_size = strtoul(optarg, NULL, 0);\n"
4389 "            break;\n"
4390
4391 #. type: Plain text
4392 #: build/C/man3/pthread_create.3:302
4393 #, no-wrap
4394 msgid ""
4395 "        default:\n"
4396 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4397 "                    argv[0]);\n"
4398 "            exit(EXIT_FAILURE);\n"
4399 "        }\n"
4400 "    }\n"
4401 msgstr ""
4402 "        default:\n"
4403 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4404 "                    argv[0]);\n"
4405 "            exit(EXIT_FAILURE);\n"
4406 "        }\n"
4407 "    }\n"
4408
4409 #. type: Plain text
4410 #: build/C/man3/pthread_create.3:304
4411 #, no-wrap
4412 msgid "    num_threads = argc - optind;\n"
4413 msgstr "    num_threads = argc - optind;\n"
4414
4415 #. type: Plain text
4416 #: build/C/man3/pthread_create.3:306
4417 #, no-wrap
4418 msgid "    /* Initialize thread creation attributes */\n"
4419 msgstr "    /* Initialize thread creation attributes */\n"
4420
4421 #. type: Plain text
4422 #: build/C/man3/pthread_create.3:310
4423 #, no-wrap
4424 msgid ""
4425 "    s = pthread_attr_init(&attr);\n"
4426 "    if (s != 0)\n"
4427 "        handle_error_en(s, \"pthread_attr_init\");\n"
4428 msgstr ""
4429 "    s = pthread_attr_init(&attr);\n"
4430 "    if (s != 0)\n"
4431 "        handle_error_en(s, \"pthread_attr_init\");\n"
4432
4433 #. type: Plain text
4434 #: build/C/man3/pthread_create.3:316
4435 #, no-wrap
4436 msgid ""
4437 "    if (stack_size E<gt> 0) {\n"
4438 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4439 "        if (s != 0)\n"
4440 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4441 "    }\n"
4442 msgstr ""
4443 "    if (stack_size E<gt> 0) {\n"
4444 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4445 "        if (s != 0)\n"
4446 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4447 "    }\n"
4448
4449 #. type: Plain text
4450 #: build/C/man3/pthread_create.3:318
4451 #, no-wrap
4452 msgid "    /* Allocate memory for pthread_create() arguments */\n"
4453 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
4454
4455 #. type: Plain text
4456 #: build/C/man3/pthread_create.3:322
4457 #, no-wrap
4458 msgid ""
4459 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4460 "    if (tinfo == NULL)\n"
4461 "        handle_error(\"calloc\");\n"
4462 msgstr ""
4463 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4464 "    if (tinfo == NULL)\n"
4465 "        handle_error(\"calloc\");\n"
4466
4467 #. type: Plain text
4468 #: build/C/man3/pthread_create.3:324
4469 #, no-wrap
4470 msgid "    /* Create one thread for each command-line argument */\n"
4471 msgstr "    /* Create one thread for each command-line argument */\n"
4472
4473 #. type: Plain text
4474 #: build/C/man3/pthread_create.3:328
4475 #, no-wrap
4476 msgid ""
4477 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4478 "        tinfo[tnum].thread_num = tnum + 1;\n"
4479 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4480 msgstr ""
4481 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4482 "        tinfo[tnum].thread_num = tnum + 1;\n"
4483 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4484
4485 #. type: Plain text
4486 #: build/C/man3/pthread_create.3:331
4487 #, no-wrap
4488 msgid ""
4489 "        /* The pthread_create() call stores the thread ID into\n"
4490 "           corresponding element of tinfo[] */\n"
4491 msgstr ""
4492 "        /* The pthread_create() call stores the thread ID into\n"
4493 "           corresponding element of tinfo[] */\n"
4494
4495 #. type: Plain text
4496 #: build/C/man3/pthread_create.3:337
4497 #, no-wrap
4498 msgid ""
4499 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4500 "                           &thread_start, &tinfo[tnum]);\n"
4501 "        if (s != 0)\n"
4502 "            handle_error_en(s, \"pthread_create\");\n"
4503 "    }\n"
4504 msgstr ""
4505 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4506 "                           &thread_start, &tinfo[tnum]);\n"
4507 "        if (s != 0)\n"
4508 "            handle_error_en(s, \"pthread_create\");\n"
4509 "    }\n"
4510
4511 #. type: Plain text
4512 #: build/C/man3/pthread_create.3:340
4513 #, no-wrap
4514 msgid ""
4515 "    /* Destroy the thread attributes object, since it is no\n"
4516 "       longer needed */\n"
4517 msgstr ""
4518 "    /* Destroy the thread attributes object, since it is no\n"
4519 "       longer needed */\n"
4520
4521 #. type: Plain text
4522 #: build/C/man3/pthread_create.3:344 build/C/man3/pthread_setschedparam.3:420
4523 #, no-wrap
4524 msgid ""
4525 "    s = pthread_attr_destroy(&attr);\n"
4526 "    if (s != 0)\n"
4527 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4528 msgstr ""
4529 "    s = pthread_attr_destroy(&attr);\n"
4530 "    if (s != 0)\n"
4531 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4532
4533 #. type: Plain text
4534 #: build/C/man3/pthread_create.3:346
4535 #, no-wrap
4536 msgid "    /* Now join with each thread, and display its returned value */\n"
4537 msgstr "    /* Now join with each thread, and display its returned value */\n"
4538
4539 #. type: Plain text
4540 #: build/C/man3/pthread_create.3:351
4541 #, no-wrap
4542 msgid ""
4543 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4544 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4545 "        if (s != 0)\n"
4546 "            handle_error_en(s, \"pthread_join\");\n"
4547 msgstr ""
4548 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4549 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4550 "        if (s != 0)\n"
4551 "            handle_error_en(s, \"pthread_join\");\n"
4552
4553 #. type: Plain text
4554 #: build/C/man3/pthread_create.3:356
4555 #, no-wrap
4556 msgid ""
4557 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4558 "                tinfo[tnum].thread_num, (char *) res);\n"
4559 "        free(res);      /* Free memory allocated by thread */\n"
4560 "    }\n"
4561 msgstr ""
4562 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4563 "                tinfo[tnum].thread_num, (char *) res);\n"
4564 "        free(res);      /* Free memory allocated by thread */\n"
4565 "    }\n"
4566
4567 #. type: Plain text
4568 #: build/C/man3/pthread_create.3:360
4569 #, no-wrap
4570 msgid ""
4571 "    free(tinfo);\n"
4572 "    exit(EXIT_SUCCESS);\n"
4573 "}\n"
4574 msgstr ""
4575 "    free(tinfo);\n"
4576 "    exit(EXIT_SUCCESS);\n"
4577 "}\n"
4578
4579 #. type: Plain text
4580 #: build/C/man3/pthread_create.3:367
4581 msgid ""
4582 "In the obsolete LinuxThreads implementation, each of the threads in a "
4583 "process has a different process ID.  This is in violation of the POSIX "
4584 "threads specification, and is the source of many other nonconformances to "
4585 "the standard; see B<pthreads>(7)."
4586 msgstr ""
4587
4588 #. type: Plain text
4589 #: build/C/man3/pthread_create.3:378
4590 msgid ""
4591 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
4592 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
4593 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
4594 "(7)"
4595 msgstr "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>(7)"
4596
4597 #. type: TH
4598 #: build/C/man3/pthread_detach.3:24
4599 #, no-wrap
4600 msgid "PTHREAD_DETACH"
4601 msgstr "PTHREAD_DETACH"
4602
4603 #. type: TH
4604 #: build/C/man3/pthread_detach.3:24 build/C/man3/pthread_join.3:24
4605 #, no-wrap
4606 msgid "2008-11-27"
4607 msgstr "2008-11-27"
4608
4609 #. type: Plain text
4610 #: build/C/man3/pthread_detach.3:27
4611 msgid "pthread_detach - detach a thread"
4612 msgstr ""
4613
4614 #. type: Plain text
4615 #: build/C/man3/pthread_detach.3:32
4616 #, no-wrap
4617 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
4618 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
4619
4620 #. type: Plain text
4621 #: build/C/man3/pthread_detach.3:44
4622 msgid ""
4623 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
4624 "as detached.  When a detached thread terminates, its resources are "
4625 "automatically released back to the system without the need for another "
4626 "thread to join with the terminated thread."
4627 msgstr ""
4628
4629 #. type: Plain text
4630 #: build/C/man3/pthread_detach.3:47
4631 msgid ""
4632 "Attempting to detach an already detached thread results in unspecified "
4633 "behavior."
4634 msgstr ""
4635
4636 #. type: Plain text
4637 #: build/C/man3/pthread_detach.3:52
4638 msgid ""
4639 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
4640 "number."
4641 msgstr ""
4642
4643 #. type: Plain text
4644 #: build/C/man3/pthread_detach.3:57 build/C/man3/pthread_join.3:87
4645 msgid "I<thread> is not a joinable thread."
4646 msgstr ""
4647
4648 #. type: Plain text
4649 #: build/C/man3/pthread_detach.3:68
4650 msgid ""
4651 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
4652 "or be made joinable again."
4653 msgstr ""
4654
4655 #. type: Plain text
4656 #: build/C/man3/pthread_detach.3:75
4657 msgid ""
4658 "A new thread can be created in a detached state using "
4659 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
4660 "I<attr> argument of B<pthread_create>(3)."
4661 msgstr ""
4662
4663 #. type: Plain text
4664 #: build/C/man3/pthread_detach.3:82
4665 msgid ""
4666 "The detached attribute merely determines the behavior of the system when the "
4667 "thread terminates; it does not prevent the thread from being terminated if "
4668 "the process terminates using B<exit>(3)  (or equivalently, if the main "
4669 "thread returns)."
4670 msgstr ""
4671
4672 #. type: Plain text
4673 #: build/C/man3/pthread_detach.3:91
4674 msgid ""
4675 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
4676 "thread that an application creates, so that system resources for the thread "
4677 "can be released.  (But note that the resources of all threads are freed when "
4678 "the process terminates.)"
4679 msgstr ""
4680
4681 #. type: Plain text
4682 #: build/C/man3/pthread_detach.3:93
4683 msgid "The following statement detaches the calling thread:"
4684 msgstr ""
4685
4686 #. type: Plain text
4687 #: build/C/man3/pthread_detach.3:95
4688 #, no-wrap
4689 msgid "    pthread_detach(pthread_self());\n"
4690 msgstr "    pthread_detach(pthread_self());\n"
4691
4692 #. type: Plain text
4693 #: build/C/man3/pthread_detach.3:102
4694 msgid ""
4695 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
4696 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
4697 msgstr "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
4698
4699 #. type: TH
4700 #: build/C/man3/pthread_equal.3:24
4701 #, no-wrap
4702 msgid "PTHREAD_EQUAL"
4703 msgstr "PTHREAD_EQUAL"
4704
4705 #. type: TH
4706 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
4707 #, no-wrap
4708 msgid "2009-03-30"
4709 msgstr "2009-03-30"
4710
4711 #. type: Plain text
4712 #: build/C/man3/pthread_equal.3:27
4713 msgid "pthread_equal - compare thread IDs"
4714 msgstr ""
4715
4716 #. type: Plain text
4717 #: build/C/man3/pthread_equal.3:32
4718 #, no-wrap
4719 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
4720 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
4721
4722 #. type: Plain text
4723 #: build/C/man3/pthread_equal.3:38
4724 msgid "The B<pthread_equal>()  function compares two thread identifiers."
4725 msgstr ""
4726
4727 #. type: Plain text
4728 #: build/C/man3/pthread_equal.3:42
4729 msgid ""
4730 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
4731 "value; otherwise, it returns 0."
4732 msgstr ""
4733
4734 #.  SH VERSIONS
4735 #.  Available since glibc 2.0
4736 #. type: Plain text
4737 #: build/C/man3/pthread_equal.3:44 build/C/man3/pthread_exit.3:72
4738 #: build/C/man3/pthread_self.3:47 build/C/man3/pthread_testcancel.3:55
4739 msgid "This function always succeeds."
4740 msgstr ""
4741
4742 #. type: Plain text
4743 #: build/C/man3/pthread_equal.3:53
4744 msgid ""
4745 "The B<pthread_equal>()  function is necessary because thread IDs should be "
4746 "considered opaque: there is no portable way for applications to directly "
4747 "compare two I<pthread_t> values."
4748 msgstr ""
4749
4750 #. type: Plain text
4751 #: build/C/man3/pthread_equal.3:57
4752 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
4753 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
4754
4755 #. type: TH
4756 #: build/C/man3/pthread_exit.3:24
4757 #, no-wrap
4758 msgid "PTHREAD_EXIT"
4759 msgstr "PTHREAD_EXIT"
4760
4761 #. type: Plain text
4762 #: build/C/man3/pthread_exit.3:27
4763 msgid "pthread_exit - terminate calling thread"
4764 msgstr ""
4765
4766 #. type: Plain text
4767 #: build/C/man3/pthread_exit.3:32
4768 #, no-wrap
4769 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
4770 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
4771
4772 #. type: Plain text
4773 #: build/C/man3/pthread_exit.3:42
4774 msgid ""
4775 "The B<pthread_exit>()  function terminates the calling thread and returns a "
4776 "value via I<retval> that (if the thread is joinable)  is available to "
4777 "another thread in the same process that calls B<pthread_join>(3)."
4778 msgstr ""
4779
4780 #. type: Plain text
4781 #: build/C/man3/pthread_exit.3:52
4782 msgid ""
4783 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
4784 "not yet been popped, are popped (in the reverse of the order in which they "
4785 "were pushed)  and executed.  If the thread has any thread-specific data, "
4786 "then, after the clean-up handlers have been executed, the corresponding "
4787 "destructor functions are called, in an unspecified order."
4788 msgstr ""
4789
4790 #. type: Plain text
4791 #: build/C/man3/pthread_exit.3:59
4792 msgid ""
4793 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
4794 "variables, semaphores, and file descriptors) are not released, and functions "
4795 "registered using B<atexit>(3)  are not called."
4796 msgstr ""
4797
4798 #. type: Plain text
4799 #: build/C/man3/pthread_exit.3:68
4800 msgid ""
4801 "After the last thread in a process terminates, the process terminates as by "
4802 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
4803 "resources are released and functions registered using B<atexit>(3)  are "
4804 "called."
4805 msgstr ""
4806
4807 #. type: Plain text
4808 #: build/C/man3/pthread_exit.3:70
4809 msgid "This function does not return to the caller."
4810 msgstr ""
4811
4812 #. type: Plain text
4813 #: build/C/man3/pthread_exit.3:79
4814 msgid ""
4815 "Performing a return from the start function of any thread other than the "
4816 "main thread results in an implicit call to B<pthread_exit>(), using the "
4817 "function's return value as the thread's exit status."
4818 msgstr ""
4819
4820 #. type: Plain text
4821 #: build/C/man3/pthread_exit.3:85
4822 msgid ""
4823 "To allow other threads to continue execution, the main thread should "
4824 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
4825 msgstr ""
4826
4827 #. type: Plain text
4828 #: build/C/man3/pthread_exit.3:90
4829 msgid ""
4830 "The value pointed to by I<retval> should not be located on the calling "
4831 "thread's stack, since the contents of that stack are undefined after the "
4832 "thread terminates."
4833 msgstr ""
4834
4835 #.  Linux 2.6.27
4836 #.  FIXME . review a later kernel to see if this gets fixed
4837 #.  http://thread.gmane.org/gmane.linux.kernel/611611
4838 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
4839 #. type: Plain text
4840 #: build/C/man3/pthread_exit.3:102
4841 msgid ""
4842 "Currently, there are limitations in the kernel implementation logic for "
4843 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
4844 "This can manifest in problems such as a locked terminal if a stop signal is "
4845 "sent to a foreground process whose thread group leader has already called "
4846 "B<pthread_exit>()."
4847 msgstr ""
4848
4849 #. type: Plain text
4850 #: build/C/man3/pthread_exit.3:106
4851 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
4852 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
4853
4854 #. type: TH
4855 #: build/C/man3/pthread_getattr_np.3:24
4856 #, no-wrap
4857 msgid "PTHREAD_GETATTR_NP"
4858 msgstr "PTHREAD_GETATTR_NP"
4859
4860 #. type: Plain text
4861 #: build/C/man3/pthread_getattr_np.3:27
4862 msgid "pthread_getattr_np - get attributes of created thread"
4863 msgstr ""
4864
4865 #. type: Plain text
4866 #: build/C/man3/pthread_getattr_np.3:33
4867 #, no-wrap
4868 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
4869 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
4870
4871 #. type: Plain text
4872 #: build/C/man3/pthread_getattr_np.3:42
4873 msgid ""
4874 "The B<pthread_getattr_np>()  function initializes the thread attributes "
4875 "object referred to by I<attr> so that it contains actual attribute values "
4876 "describing the running thread I<thread>."
4877 msgstr ""
4878
4879 #. type: Plain text
4880 #: build/C/man3/pthread_getattr_np.3:49
4881 msgid ""
4882 "The returned attribute values may differ from the corresponding attribute "
4883 "values passed in the I<attr> object that was used to create the thread using "
4884 "B<pthread_create>(3).  In particular, the following attributes may differ:"
4885 msgstr ""
4886
4887 #. type: Plain text
4888 #: build/C/man3/pthread_getattr_np.3:52
4889 msgid ""
4890 "the detach state, since a joinable thread may have detached itself after "
4891 "creation;"
4892 msgstr ""
4893
4894 #. type: Plain text
4895 #: build/C/man3/pthread_getattr_np.3:55
4896 msgid ""
4897 "the stack size, which the implementation may align to a suitable boundary."
4898 msgstr ""
4899
4900 #. type: Plain text
4901 #: build/C/man3/pthread_getattr_np.3:60
4902 msgid ""
4903 "and the guard size, which the implementation may round upward to a multiple "
4904 "of the page size, or ignore (i.e., treat as 0), if the application is "
4905 "allocating its own stack."
4906 msgstr ""
4907
4908 #. type: Plain text
4909 #: build/C/man3/pthread_getattr_np.3:65
4910 msgid ""
4911 "Furthermore, if the stack address attribute was not set in the thread "
4912 "attributes object used to create the thread, then the returned thread "
4913 "attributes object will report the actual stack address that the "
4914 "implementation selected for the thread."
4915 msgstr ""
4916
4917 #. type: Plain text
4918 #: build/C/man3/pthread_getattr_np.3:70
4919 msgid ""
4920 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
4921 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
4922 msgstr ""
4923
4924 #. type: Plain text
4925 #: build/C/man3/pthread_getattr_np.3:73
4926 #: build/C/man3/pthread_getcpuclockid.3:46
4927 msgid ""
4928 "On success, this function returns 0; on error, it returns a nonzero error "
4929 "number."
4930 msgstr ""
4931
4932 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
4933 #. type: Plain text
4934 #: build/C/man3/pthread_getattr_np.3:78
4935 msgid "Insufficient memory."
4936 msgstr ""
4937
4938 #. type: Plain text
4939 #: build/C/man3/pthread_getattr_np.3:93
4940 msgid ""
4941 "In addition, if I<thread> refers to the main thread, then "
4942 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
4943 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and B<getrlimit>"
4944 "(2), if the B<RLIMIT_STACK> resource limit is not supported."
4945 msgstr ""
4946
4947 #. type: Plain text
4948 #: build/C/man3/pthread_getattr_np.3:95
4949 msgid "This function is available in glibc since version 2.2.3."
4950 msgstr ""
4951
4952 #. type: Plain text
4953 #: build/C/man3/pthread_getattr_np.3:98
4954 #: build/C/man3/pthread_kill_other_threads_np.3:48
4955 msgid ""
4956 "This function is a nonstandard GNU extension; hence the suffix \"_np"
4957 "\" (nonportable) in the name."
4958 msgstr ""
4959
4960 #. type: Plain text
4961 #: build/C/man3/pthread_getattr_np.3:108
4962 msgid ""
4963 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
4964 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
4965 "and display its guard size, stack address, and stack size attributes.  "
4966 "Command-line arguments can be used to set these attributes to values other "
4967 "than the default when creating the thread.  The shell sessions below "
4968 "demonstrate the use of the program."
4969 msgstr ""
4970
4971 #. type: Plain text
4972 #: build/C/man3/pthread_getattr_np.3:111
4973 msgid ""
4974 "In the first run, on an x86-32 system, a thread is created using default "
4975 "attributes:"
4976 msgstr ""
4977
4978 #. type: Plain text
4979 #: build/C/man3/pthread_getattr_np.3:121
4980 #, no-wrap
4981 msgid ""
4982 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
4983 "unlimited\n"
4984 "$B< ./a.out>\n"
4985 "Attributes of created thread:\n"
4986 "        Guard size          = 4096 bytes\n"
4987 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
4988 "        Stack size          = 0x201000 (2101248) bytes\n"
4989 msgstr ""
4990 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
4991 "unlimited\n"
4992 "$B< ./a.out>\n"
4993 "Attributes of created thread:\n"
4994 "        Guard size          = 4096 bytes\n"
4995 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
4996 "        Stack size          = 0x201000 (2101248) bytes\n"
4997
4998 #. type: Plain text
4999 #: build/C/man3/pthread_getattr_np.3:127
5000 msgid ""
5001 "In the following run, we see that if a guard size is specified, it is "
5002 "rounded up to the next multiple of the system page size (4096 bytes on "
5003 "x86-32):"
5004 msgstr ""
5005
5006 #. type: Plain text
5007 #: build/C/man3/pthread_getattr_np.3:135
5008 #, no-wrap
5009 msgid ""
5010 "$B< ./a.out -g 4097>\n"
5011 "Thread attributes object after initializations:\n"
5012 "        Guard size          = 4097 bytes\n"
5013 "        Stack address       = (nil)\n"
5014 "        Stack size          = 0x0 (0) bytes\n"
5015 msgstr ""
5016 "$B< ./a.out -g 4097>\n"
5017 "Thread attributes object after initializations:\n"
5018 "        Guard size          = 4097 bytes\n"
5019 "        Stack address       = (nil)\n"
5020 "        Stack size          = 0x0 (0) bytes\n"
5021
5022 #. type: Plain text
5023 #: build/C/man3/pthread_getattr_np.3:140
5024 #, no-wrap
5025 msgid ""
5026 "Attributes of created thread:\n"
5027 "        Guard size          = 8192 bytes\n"
5028 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5029 "        Stack size          = 0x201000 (2101248) bytes\n"
5030 msgstr ""
5031 "Attributes of created thread:\n"
5032 "        Guard size          = 8192 bytes\n"
5033 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5034 "        Stack size          = 0x201000 (2101248) bytes\n"
5035
5036 #. .in +4n
5037 #. .nf
5038 #. $ ./a.out \-s 0x8000
5039 #. Thread attributes object after initializations:
5040 #.         Guard size          = 4096 bytes
5041 #.         Stack address       = 0xffff8000 (EOS = (nil))
5042 #.         Stack size          = 0x8000 (32768) bytes
5043 #. Attributes of created thread:
5044 #.         Guard size          = 4096 bytes
5045 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
5046 #.         Stack size          = 0x8000 (32768) bytes
5047 #. .fi
5048 #. .in
5049 #. type: Plain text
5050 #: build/C/man3/pthread_getattr_np.3:159
5051 msgid ""
5052 "In the last run, the program manually allocates a stack for the thread.  In "
5053 "this case, the guard size attribute is ignored."
5054 msgstr ""
5055
5056 #. type: Plain text
5057 #: build/C/man3/pthread_getattr_np.3:164
5058 #, no-wrap
5059 msgid ""
5060 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5061 "Allocated thread stack at 0x804d000\n"
5062 msgstr ""
5063 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5064 "Allocated thread stack at 0x804d000\n"
5065
5066 #. type: Plain text
5067 #: build/C/man3/pthread_getattr_np.3:169
5068 #, no-wrap
5069 msgid ""
5070 "Thread attributes object after initializations:\n"
5071 "        Guard size          = 4096 bytes\n"
5072 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5073 "        Stack size          = 0x8000 (32768) bytes\n"
5074 msgstr ""
5075 "Thread attributes object after initializations:\n"
5076 "        Guard size          = 4096 bytes\n"
5077 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5078 "        Stack size          = 0x8000 (32768) bytes\n"
5079
5080 #. type: Plain text
5081 #: build/C/man3/pthread_getattr_np.3:174
5082 #, no-wrap
5083 msgid ""
5084 "Attributes of created thread:\n"
5085 "        Guard size          = 0 bytes\n"
5086 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5087 "        Stack size          = 0x8000 (32768) bytes\n"
5088 msgstr ""
5089 "Attributes of created thread:\n"
5090 "        Guard size          = 0 bytes\n"
5091 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5092 "        Stack size          = 0x8000 (32768) bytes\n"
5093
5094 #. type: Plain text
5095 #: build/C/man3/pthread_getattr_np.3:195
5096 #, no-wrap
5097 msgid ""
5098 "static void\n"
5099 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5100 "{\n"
5101 "    int s;\n"
5102 "    size_t stack_size, guard_size;\n"
5103 "    void *stack_addr;\n"
5104 msgstr ""
5105 "static void\n"
5106 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5107 "{\n"
5108 "    int s;\n"
5109 "    size_t stack_size, guard_size;\n"
5110 "    void *stack_addr;\n"
5111
5112 #. type: Plain text
5113 #: build/C/man3/pthread_getattr_np.3:200
5114 #, no-wrap
5115 msgid ""
5116 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5117 "    if (s != 0)\n"
5118 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5119 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5120 msgstr ""
5121 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5122 "    if (s != 0)\n"
5123 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5124 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5125
5126 #. type: Plain text
5127 #: build/C/man3/pthread_getattr_np.3:211
5128 #, no-wrap
5129 msgid ""
5130 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5131 "    if (s != 0)\n"
5132 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5133 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5134 "    if (stack_size E<gt> 0)\n"
5135 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5136 "    printf(\"\\en\");\n"
5137 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5138 "            prefix, stack_size, stack_size);\n"
5139 "}\n"
5140 msgstr ""
5141 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5142 "    if (s != 0)\n"
5143 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5144 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5145 "    if (stack_size E<gt> 0)\n"
5146 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5147 "    printf(\"\\en\");\n"
5148 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5149 "            prefix, stack_size, stack_size);\n"
5150 "}\n"
5151
5152 #. type: Plain text
5153 #: build/C/man3/pthread_getattr_np.3:217
5154 #, no-wrap
5155 msgid ""
5156 "static void\n"
5157 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5158 "{\n"
5159 "    int s;\n"
5160 "    pthread_attr_t attr;\n"
5161 msgstr ""
5162 "static void\n"
5163 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5164 "{\n"
5165 "    int s;\n"
5166 "    pthread_attr_t attr;\n"
5167
5168 #. type: Plain text
5169 #: build/C/man3/pthread_getattr_np.3:221
5170 #, no-wrap
5171 msgid ""
5172 "    s = pthread_getattr_np(thread, &attr);\n"
5173 "    if (s != 0)\n"
5174 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5175 msgstr ""
5176 "    s = pthread_getattr_np(thread, &attr);\n"
5177 "    if (s != 0)\n"
5178 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5179
5180 #. type: Plain text
5181 #: build/C/man3/pthread_getattr_np.3:223
5182 #, no-wrap
5183 msgid "    display_stack_related_attributes(&attr, prefix);\n"
5184 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
5185
5186 #. type: Plain text
5187 #: build/C/man3/pthread_getattr_np.3:228
5188 #, no-wrap
5189 msgid ""
5190 "    s = pthread_attr_destroy(&attr);\n"
5191 "    if (s != 0)\n"
5192 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5193 "}\n"
5194 msgstr ""
5195 "    s = pthread_attr_destroy(&attr);\n"
5196 "    if (s != 0)\n"
5197 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5198 "}\n"
5199
5200 #. type: Plain text
5201 #: build/C/man3/pthread_getattr_np.3:234
5202 #, no-wrap
5203 msgid ""
5204 "static void *           /* Start function for thread we create */\n"
5205 "thread_start(void *arg)\n"
5206 "{\n"
5207 "    printf(\"Attributes of created thread:\\en\");\n"
5208 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5209 msgstr ""
5210 "static void *           /* Start function for thread we create */\n"
5211 "thread_start(void *arg)\n"
5212 "{\n"
5213 "    printf(\"Attributes of created thread:\\en\");\n"
5214 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5215
5216 #. type: Plain text
5217 #: build/C/man3/pthread_getattr_np.3:248
5218 #, no-wrap
5219 msgid ""
5220 "static void\n"
5221 "usage(char *pname, char *msg)\n"
5222 "{\n"
5223 "    if (msg != NULL)\n"
5224 "        fputs(msg, stderr);\n"
5225 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5226 "            \" [-g guard-size]\\en\", pname);\n"
5227 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5228 "    exit(EXIT_FAILURE);\n"
5229 "}\n"
5230 msgstr ""
5231 "static void\n"
5232 "usage(char *pname, char *msg)\n"
5233 "{\n"
5234 "    if (msg != NULL)\n"
5235 "        fputs(msg, stderr);\n"
5236 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5237 "            \" [-g guard-size]\\en\", pname);\n"
5238 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5239 "    exit(EXIT_FAILURE);\n"
5240 "}\n"
5241
5242 #. type: Plain text
5243 #: build/C/man3/pthread_getattr_np.3:261
5244 #, no-wrap
5245 msgid ""
5246 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5247 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5248 "                              pthread_attr_t *attrp)\n"
5249 "{\n"
5250 "    int s, opt, allocate_stack;\n"
5251 "    long stack_size, guard_size;\n"
5252 "            void *stack_addr;\n"
5253 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
5254 "                                           a thread attributes object */\n"
5255 "    allocate_stack = 0;\n"
5256 "    stack_size = -1;\n"
5257 "    guard_size = -1;\n"
5258 msgstr ""
5259 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5260 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5261 "                              pthread_attr_t *attrp)\n"
5262 "{\n"
5263 "    int s, opt, allocate_stack;\n"
5264 "    long stack_size, guard_size;\n"
5265 "            void *stack_addr;\n"
5266 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
5267 "                                           a thread attributes object */\n"
5268 "    allocate_stack = 0;\n"
5269 "    stack_size = -1;\n"
5270 "    guard_size = -1;\n"
5271
5272 #. type: Plain text
5273 #: build/C/man3/pthread_getattr_np.3:270
5274 #, no-wrap
5275 msgid ""
5276 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5277 "        switch (opt) {\n"
5278 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
5279 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
5280 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
5281 "        default:    usage(argv[0], NULL);\n"
5282 "        }\n"
5283 "    }\n"
5284 msgstr ""
5285 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5286 "        switch (opt) {\n"
5287 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
5288 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
5289 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
5290 "        default:    usage(argv[0], NULL);\n"
5291 "        }\n"
5292 "    }\n"
5293
5294 #. type: Plain text
5295 #: build/C/man3/pthread_getattr_np.3:273
5296 #, no-wrap
5297 msgid ""
5298 "    if (allocate_stack && stack_size == -1)\n"
5299 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5300 msgstr ""
5301 "    if (allocate_stack && stack_size == -1)\n"
5302 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5303
5304 #. type: Plain text
5305 #: build/C/man3/pthread_getattr_np.3:276
5306 #, no-wrap
5307 msgid ""
5308 "    if (argc E<gt> optind)\n"
5309 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5310 msgstr ""
5311 "    if (argc E<gt> optind)\n"
5312 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5313
5314 #. type: Plain text
5315 #: build/C/man3/pthread_getattr_np.3:279
5316 #, no-wrap
5317 msgid ""
5318 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5319 "        ret_attrp = attrp;\n"
5320 msgstr ""
5321 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5322 "        ret_attrp = attrp;\n"
5323
5324 #. type: Plain text
5325 #: build/C/man3/pthread_getattr_np.3:284
5326 #, no-wrap
5327 msgid ""
5328 "        s = pthread_attr_init(attrp);\n"
5329 "        if (s != 0)\n"
5330 "            handle_error_en(s, \"pthread_attr_init\");\n"
5331 "    }\n"
5332 msgstr ""
5333 "        s = pthread_attr_init(attrp);\n"
5334 "        if (s != 0)\n"
5335 "            handle_error_en(s, \"pthread_attr_init\");\n"
5336 "    }\n"
5337
5338 #. type: Plain text
5339 #: build/C/man3/pthread_getattr_np.3:296
5340 #, no-wrap
5341 msgid ""
5342 "    if (stack_size E<gt>= 0) {\n"
5343 "        if (!allocate_stack) {\n"
5344 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
5345 "            if (s != 0)\n"
5346 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5347 "        } else {\n"
5348 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5349 "                               stack_size);\n"
5350 "            if (s != 0)\n"
5351 "                handle_error_en(s, \"posix_memalign\");\n"
5352 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5353 msgstr ""
5354 "    if (stack_size E<gt>= 0) {\n"
5355 "        if (!allocate_stack) {\n"
5356 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
5357 "            if (s != 0)\n"
5358 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5359 "        } else {\n"
5360 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5361 "                               stack_size);\n"
5362 "            if (s != 0)\n"
5363 "                handle_error_en(s, \"posix_memalign\");\n"
5364 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5365
5366 #. type: Plain text
5367 #: build/C/man3/pthread_getattr_np.3:302
5368 #, no-wrap
5369 msgid ""
5370 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5371 "            if (s != 0)\n"
5372 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5373 "        }\n"
5374 "    }\n"
5375 msgstr ""
5376 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5377 "            if (s != 0)\n"
5378 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5379 "        }\n"
5380 "    }\n"
5381
5382 #. type: Plain text
5383 #: build/C/man3/pthread_getattr_np.3:308
5384 #, no-wrap
5385 msgid ""
5386 "    if (guard_size E<gt>= 0) {\n"
5387 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
5388 "        if (s != 0)\n"
5389 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5390 "    }\n"
5391 msgstr ""
5392 "    if (guard_size E<gt>= 0) {\n"
5393 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
5394 "        if (s != 0)\n"
5395 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5396 "    }\n"
5397
5398 #. type: Plain text
5399 #: build/C/man3/pthread_getattr_np.3:311
5400 #, no-wrap
5401 msgid ""
5402 "    return ret_attrp;\n"
5403 "}\n"
5404 msgstr ""
5405 "    return ret_attrp;\n"
5406 "}\n"
5407
5408 #. type: Plain text
5409 #: build/C/man3/pthread_getattr_np.3:320
5410 #, no-wrap
5411 msgid ""
5412 "int\n"
5413 "main(int argc, char *argv[])\n"
5414 "{\n"
5415 "    int s;\n"
5416 "    pthread_t thr;\n"
5417 "    pthread_attr_t attr;\n"
5418 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
5419 "                                        a thread attributes object */\n"
5420 msgstr ""
5421 "int\n"
5422 "main(int argc, char *argv[])\n"
5423 "{\n"
5424 "    int s;\n"
5425 "    pthread_t thr;\n"
5426 "    pthread_attr_t attr;\n"
5427 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
5428 "                                        a thread attributes object */\n"
5429
5430 #. type: Plain text
5431 #: build/C/man3/pthread_getattr_np.3:322
5432 #, no-wrap
5433 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5434 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5435
5436 #. type: Plain text
5437 #: build/C/man3/pthread_getattr_np.3:328
5438 #, no-wrap
5439 msgid ""
5440 "    if (attrp != NULL) {\n"
5441 "        printf(\"Thread attributes object after initializations:\\en\");\n"
5442 "        display_stack_related_attributes(attrp, \"\\et\");\n"
5443 "        printf(\"\\en\");\n"
5444 "    }\n"
5445 msgstr ""
5446 "    if (attrp != NULL) {\n"
5447 "        printf(\"Thread attributes object after initializations:\\en\");\n"
5448 "        display_stack_related_attributes(attrp, \"\\et\");\n"
5449 "        printf(\"\\en\");\n"
5450 "    }\n"
5451
5452 #. type: Plain text
5453 #: build/C/man3/pthread_getattr_np.3:356
5454 msgid ""
5455 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
5456 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
5457 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
5458 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
5459 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
5460 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5461 msgstr "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5462
5463 #. type: TH
5464 #: build/C/man3/pthread_getcpuclockid.3:24
5465 #, no-wrap
5466 msgid "PTHREAD_GETCPUCLOCKID"
5467 msgstr "PTHREAD_GETCPUCLOCKID"
5468
5469 #. type: TH
5470 #: build/C/man3/pthread_getcpuclockid.3:24
5471 #, no-wrap
5472 msgid "2009-02-08"
5473 msgstr "2009-02-08"
5474
5475 #. type: Plain text
5476 #: build/C/man3/pthread_getcpuclockid.3:27
5477 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
5478 msgstr ""
5479
5480 #. type: Plain text
5481 #: build/C/man3/pthread_getcpuclockid.3:31
5482 #, no-wrap
5483 msgid ""
5484 "B<#include E<lt>pthread.hE<gt>>\n"
5485 "B<#include E<lt>time.hE<gt>>\n"
5486 msgstr ""
5487 "B<#include E<lt>pthread.hE<gt>>\n"
5488 "B<#include E<lt>time.hE<gt>>\n"
5489
5490 #. type: Plain text
5491 #: build/C/man3/pthread_getcpuclockid.3:33
5492 #, no-wrap
5493 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
5494 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
5495
5496 #.  The clockid is constructed as follows:
5497 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
5498 #.  where CLOCK_IDFIELD_SIZE is 3.
5499 #. type: Plain text
5500 #: build/C/man3/pthread_getcpuclockid.3:43
5501 msgid ""
5502 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
5503 "time clock of the thread I<thread>."
5504 msgstr ""
5505
5506 #. type: TP
5507 #: build/C/man3/pthread_getcpuclockid.3:47
5508 #, no-wrap
5509 msgid "B<ENOENT>"
5510 msgstr "B<ENOENT>"
5511
5512 #.  CLOCK_THREAD_CPUTIME_ID not defined
5513 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
5514 #.  be possible if kernel thread IDs took more than 29 bits (which
5515 #.  they currently cannot).
5516 #. type: Plain text
5517 #: build/C/man3/pthread_getcpuclockid.3:55
5518 msgid "Per-thread CPU time clocks are not supported by the system."
5519 msgstr ""
5520
5521 #. type: Plain text
5522 #: build/C/man3/pthread_getcpuclockid.3:62
5523 msgid "This function is available in glibc since version 2.2."
5524 msgstr ""
5525
5526 #. type: Plain text
5527 #: build/C/man3/pthread_getcpuclockid.3:75
5528 msgid ""
5529 "When I<thread> refers to the calling thread, this function returns an "
5530 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
5531 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
5532 msgstr ""
5533
5534 #. type: Plain text
5535 #: build/C/man3/pthread_getcpuclockid.3:81
5536 msgid ""
5537 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
5538 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
5539 "the two threads.  The following shell session shows an example run:"
5540 msgstr ""
5541
5542 #. type: Plain text
5543 #: build/C/man3/pthread_getcpuclockid.3:90
5544 #, no-wrap
5545 msgid ""
5546 "$ B<./a.out>\n"
5547 "Main thread sleeping\n"
5548 "Subthread starting infinite loop\n"
5549 "Main thread consuming some CPU time...\n"
5550 "Process total CPU time:    1.368\n"
5551 "Main thread CPU time:      0.376\n"
5552 "Subthread CPU time:        0.992\n"
5553 msgstr ""
5554 "$ B<./a.out>\n"
5555 "Main thread sleeping\n"
5556 "Subthread starting infinite loop\n"
5557 "Main thread consuming some CPU time...\n"
5558 "Process total CPU time:    1.368\n"
5559 "Main thread CPU time:      0.376\n"
5560 "Subthread CPU time:        0.992\n"
5561
5562 #. type: Plain text
5563 #: build/C/man3/pthread_getcpuclockid.3:96
5564 #, no-wrap
5565 msgid "/* Link with \"-lrt\" */\n"
5566 msgstr ""
5567
5568 #. type: Plain text
5569 #: build/C/man3/pthread_getcpuclockid.3:104
5570 #, no-wrap
5571 msgid ""
5572 "#include E<lt>time.hE<gt>\n"
5573 "#include E<lt>stdio.hE<gt>\n"
5574 "#include E<lt>stdlib.hE<gt>\n"
5575 "#include E<lt>unistd.hE<gt>\n"
5576 "#include E<lt>pthread.hE<gt>\n"
5577 "#include E<lt>string.hE<gt>\n"
5578 "#include E<lt>errno.hE<gt>\n"
5579 msgstr ""
5580 "#include E<lt>time.hE<gt>\n"
5581 "#include E<lt>stdio.hE<gt>\n"
5582 "#include E<lt>stdlib.hE<gt>\n"
5583 "#include E<lt>unistd.hE<gt>\n"
5584 "#include E<lt>pthread.hE<gt>\n"
5585 "#include E<lt>string.hE<gt>\n"
5586 "#include E<lt>errno.hE<gt>\n"
5587
5588 #. type: Plain text
5589 #: build/C/man3/pthread_getcpuclockid.3:118
5590 #, no-wrap
5591 msgid ""
5592 "static void *\n"
5593 "thread_start(void *arg)\n"
5594 "{\n"
5595 "    printf(\"Subthread starting infinite loop\\en\");\n"
5596 "    for (;;)\n"
5597 "        continue;\n"
5598 "}\n"
5599 msgstr ""
5600 "static void *\n"
5601 "thread_start(void *arg)\n"
5602 "{\n"
5603 "    printf(\"Subthread starting infinite loop\\en\");\n"
5604 "    for (;;)\n"
5605 "        continue;\n"
5606 "}\n"
5607
5608 #. type: Plain text
5609 #: build/C/man3/pthread_getcpuclockid.3:123
5610 #, no-wrap
5611 msgid ""
5612 "static void\n"
5613 "pclock(char *msg, clockid_t cid)\n"
5614 "{\n"
5615 "    struct timespec ts;\n"
5616 msgstr ""
5617 "static void\n"
5618 "pclock(char *msg, clockid_t cid)\n"
5619 "{\n"
5620 "    struct timespec ts;\n"
5621
5622 #. type: Plain text
5623 #: build/C/man3/pthread_getcpuclockid.3:129
5624 #, no-wrap
5625 msgid ""
5626 "    printf(\"%s\", msg);\n"
5627 "    if (clock_gettime(cid, &ts) == -1)\n"
5628 "        handle_error(\"clock_gettime\");\n"
5629 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
5630 "}\n"
5631 msgstr ""
5632 "    printf(\"%s\", msg);\n"
5633 "    if (clock_gettime(cid, &ts) == -1)\n"
5634 "        handle_error(\"clock_gettime\");\n"
5635 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
5636 "}\n"
5637
5638 #. type: Plain text
5639 #: build/C/man3/pthread_getcpuclockid.3:136
5640 #, no-wrap
5641 msgid ""
5642 "int\n"
5643 "main(int argc, char *argv[])\n"
5644 "{\n"
5645 "    pthread_t thread;\n"
5646 "    clockid_t cid;\n"
5647 "    int j, s;\n"
5648 msgstr ""
5649 "int\n"
5650 "main(int argc, char *argv[])\n"
5651 "{\n"
5652 "    pthread_t thread;\n"
5653 "    clockid_t cid;\n"
5654 "    int j, s;\n"
5655
5656 #. type: Plain text
5657 #: build/C/man3/pthread_getcpuclockid.3:140
5658 #, no-wrap
5659 msgid ""
5660 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
5661 "    if (s != 0)\n"
5662 "        handle_error_en(s, \"pthread_create\");\n"
5663 msgstr ""
5664 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
5665 "    if (s != 0)\n"
5666 "        handle_error_en(s, \"pthread_create\");\n"
5667
5668 #. type: Plain text
5669 #: build/C/man3/pthread_getcpuclockid.3:143
5670 #, no-wrap
5671 msgid ""
5672 "    printf(\"Main thread sleeping\\en\");\n"
5673 "    sleep(1);\n"
5674 msgstr ""
5675 "    printf(\"Main thread sleeping\\en\");\n"
5676 "    sleep(1);\n"
5677
5678 #. type: Plain text
5679 #: build/C/man3/pthread_getcpuclockid.3:147
5680 #, no-wrap
5681 msgid ""
5682 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
5683 "    for (j = 0; j E<lt> 2000000; j++)\n"
5684 "        getppid();\n"
5685 msgstr ""
5686 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
5687 "    for (j = 0; j E<lt> 2000000; j++)\n"
5688 "        getppid();\n"
5689
5690 #. type: Plain text
5691 #: build/C/man3/pthread_getcpuclockid.3:149
5692 #, no-wrap
5693 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
5694 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
5695
5696 #. type: Plain text
5697 #: build/C/man3/pthread_getcpuclockid.3:154
5698 #, no-wrap
5699 msgid ""
5700 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
5701 "    if (s != 0)\n"
5702 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5703 "    pclock(\"Main thread CPU time:   \", cid);\n"
5704 msgstr ""
5705 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
5706 "    if (s != 0)\n"
5707 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5708 "    pclock(\"Main thread CPU time:   \", cid);\n"
5709
5710 #. type: Plain text
5711 #: build/C/man3/pthread_getcpuclockid.3:157
5712 #, no-wrap
5713 msgid ""
5714 "    /* The preceding 4 lines of code could have been replaced by:\n"
5715 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
5716 msgstr ""
5717 "    /* The preceding 4 lines of code could have been replaced by:\n"
5718 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
5719
5720 #. type: Plain text
5721 #: build/C/man3/pthread_getcpuclockid.3:162
5722 #, no-wrap
5723 msgid ""
5724 "    s = pthread_getcpuclockid(thread, &cid);\n"
5725 "    if (s != 0)\n"
5726 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5727 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
5728 msgstr ""
5729 "    s = pthread_getcpuclockid(thread, &cid);\n"
5730 "    if (s != 0)\n"
5731 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5732 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
5733
5734 #. type: Plain text
5735 #: build/C/man3/pthread_getcpuclockid.3:165
5736 #, no-wrap
5737 msgid ""
5738 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
5739 "}\n"
5740 msgstr ""
5741 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
5742 "}\n"
5743
5744 #. type: Plain text
5745 #: build/C/man3/pthread_getcpuclockid.3:174
5746 msgid ""
5747 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
5748 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
5749 msgstr "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
5750
5751 #. type: TH
5752 #: build/C/man3/pthread_join.3:24
5753 #, no-wrap
5754 msgid "PTHREAD_JOIN"
5755 msgstr "PTHREAD_JOIN"
5756
5757 #. type: Plain text
5758 #: build/C/man3/pthread_join.3:27
5759 msgid "pthread_join - join with a terminated thread"
5760 msgstr ""
5761
5762 #. type: Plain text
5763 #: build/C/man3/pthread_join.3:32
5764 #, no-wrap
5765 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
5766 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
5767
5768 #. type: Plain text
5769 #: build/C/man3/pthread_join.3:47
5770 msgid ""
5771 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
5772 "to terminate.  If that thread has already terminated, then B<pthread_join>"
5773 "()  returns immediately.  The thread specified by I<thread> must be joinable."
5774 msgstr ""
5775
5776 #. type: Plain text
5777 #: build/C/man3/pthread_join.3:61
5778 msgid ""
5779 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
5780 "the target thread (i.e., the value that the target thread supplied to "
5781 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
5782 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
5783 msgstr ""
5784
5785 #. type: Plain text
5786 #: build/C/man3/pthread_join.3:68
5787 msgid ""
5788 "If multiple threads simultaneously try to join with the same thread, the "
5789 "results are undefined.  If the thread calling B<pthread_join>()  is "
5790 "canceled, then the target thread will remain joinable (i.e., it will not be "
5791 "detached)."
5792 msgstr ""
5793
5794 #. type: Plain text
5795 #: build/C/man3/pthread_join.3:73
5796 msgid ""
5797 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
5798 "number."
5799 msgstr ""
5800
5801 #. type: TP
5802 #: build/C/man3/pthread_join.3:74
5803 #, no-wrap
5804 msgid "B<EDEADLK>"
5805 msgstr "B<EDEADLK>"
5806
5807 #.  The following verified by testing on glibc 2.8/NPTL:
5808 #.  The following verified by testing on glibc 2.8/NPTL:
5809 #. type: Plain text
5810 #: build/C/man3/pthread_join.3:83
5811 msgid ""
5812 "A deadlock was detected (e.g., two threads tried to join with each other); "
5813 "or I<thread> specifies the calling thread."
5814 msgstr ""
5815
5816 #.  POSIX.1-2001 does not specify this error case.
5817 #. type: Plain text
5818 #: build/C/man3/pthread_join.3:91
5819 msgid "Another thread is already waiting to join with this thread."
5820 msgstr ""
5821
5822 #. type: Plain text
5823 #: build/C/man3/pthread_join.3:102
5824 msgid ""
5825 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
5826 "the target thread has terminated."
5827 msgstr ""
5828
5829 #. type: Plain text
5830 #: build/C/man3/pthread_join.3:105
5831 msgid ""
5832 "Joining with a thread that has previously been joined results in undefined "
5833 "behavior."
5834 msgstr ""
5835
5836 #. type: Plain text
5837 #: build/C/man3/pthread_join.3:113
5838 msgid ""
5839 "Failure to join with a thread that is joinable (i.e., one that is not "
5840 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
5841 "zombie thread consumes some system resources, and when enough zombie threads "
5842 "have accumulated, it will no longer be possible to create new threads (or "
5843 "processes)."
5844 msgstr ""
5845
5846 #. type: Plain text
5847 #: build/C/man3/pthread_join.3:119
5848 msgid ""
5849 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
5850 "\"join with any terminated thread\".  If you believe you need this "
5851 "functionality, you probably need to rethink your application design."
5852 msgstr ""
5853
5854 #. type: Plain text
5855 #: build/C/man3/pthread_join.3:122
5856 msgid ""
5857 "All of the threads in a process are peers: any thread can join with any "
5858 "other thread in the process."
5859 msgstr ""
5860
5861 #. type: Plain text
5862 #: build/C/man3/pthread_join.3:132
5863 msgid ""
5864 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
5865 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
5866 msgstr "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
5867
5868 #. type: TH
5869 #: build/C/man3/pthread_kill.3:24
5870 #, no-wrap
5871 msgid "PTHREAD_KILL"
5872 msgstr "PTHREAD_KILL"
5873
5874 #. type: TH
5875 #: build/C/man3/pthread_kill.3:24
5876 #, no-wrap
5877 msgid "2009-01-28"
5878 msgstr "2009-01-28"
5879
5880 #. type: Plain text
5881 #: build/C/man3/pthread_kill.3:27
5882 msgid "pthread_kill - send a signal to a thread"
5883 msgstr ""
5884
5885 #. type: Plain text
5886 #: build/C/man3/pthread_kill.3:30 build/C/man3/pthread_sigmask.3:30
5887 #, no-wrap
5888 msgid "B<#include E<lt>signal.hE<gt>>\n"
5889 msgstr "B<#include E<lt>signal.hE<gt>>\n"
5890
5891 #. type: Plain text
5892 #: build/C/man3/pthread_kill.3:32
5893 #, no-wrap
5894 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
5895 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
5896
5897 #. type: Plain text
5898 #: build/C/man3/pthread_kill.3:45
5899 msgid ""
5900 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, "
5901 "another thread in the same process as the caller.  The signal is "
5902 "asynchronously directed to I<thread>."
5903 msgstr ""
5904
5905 #. type: Plain text
5906 #: build/C/man3/pthread_kill.3:50
5907 msgid ""
5908 "If I<sig> is 0, then no signal is sent, but error checking is still "
5909 "performed; this can be used to check for the existence of a thread ID."
5910 msgstr ""
5911
5912 #. type: Plain text
5913 #: build/C/man3/pthread_kill.3:55
5914 msgid ""
5915 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
5916 "number, and no signal is sent."
5917 msgstr ""
5918
5919 #. type: Plain text
5920 #: build/C/man3/pthread_kill.3:59
5921 msgid "An invalid signal was specified."
5922 msgstr ""
5923
5924 #. type: Plain text
5925 #: build/C/man3/pthread_kill.3:73
5926 msgid ""
5927 "Signal dispositions are process-wide: if a signal handler is installed, the "
5928 "handler will be invoked in the thread I<thread>, but if the disposition of "
5929 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
5930 "affect the whole process."
5931 msgstr ""
5932
5933 #. type: Plain text
5934 #: build/C/man3/pthread_kill.3:82
5935 msgid ""
5936 "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
5937 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
5938 msgstr "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
5939
5940 #. type: TH
5941 #: build/C/man3/pthread_kill_other_threads_np.3:24
5942 #, no-wrap
5943 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
5944 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
5945
5946 #. type: TH
5947 #: build/C/man3/pthread_kill_other_threads_np.3:24
5948 #, no-wrap
5949 msgid "2010-09-09"
5950 msgstr "2010-09-09"
5951
5952 #. type: Plain text
5953 #: build/C/man3/pthread_kill_other_threads_np.3:27
5954 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
5955 msgstr ""
5956
5957 #. type: Plain text
5958 #: build/C/man3/pthread_kill_other_threads_np.3:32
5959 #, no-wrap
5960 msgid "B<void pthread_kill_other_threads_np(void);>\n"
5961 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
5962
5963 #.  .SH VERSIONS
5964 #.  Available since glibc 2.0
5965 #. type: Plain text
5966 #: build/C/man3/pthread_kill_other_threads_np.3:45
5967 msgid ""
5968 "B<pthread_kill_other_threads_np>()  only has an effect in the LinuxThreads "
5969 "threading implementation.  On that implementation, calling this function "
5970 "causes the immediate termination of all threads in the application, except "
5971 "the calling thread.  The cancellation state and cancellation type of the to-"
5972 "be-terminated threads are ignored, and the cleanup handlers are not called "
5973 "in those threads."
5974 msgstr ""
5975
5976 #. type: Plain text
5977 #: build/C/man3/pthread_kill_other_threads_np.3:57
5978 msgid ""
5979 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
5980 "thread calls B<execve>(2)  or a similar function.  This function is designed "
5981 "to address a limitation in the obsolete LinuxThreads implementation whereby "
5982 "the other threads of an application are not automatically terminated (as "
5983 "POSIX.1-2001 requires) during B<execve>(2)."
5984 msgstr ""
5985
5986 #. type: Plain text
5987 #: build/C/man3/pthread_kill_other_threads_np.3:64
5988 msgid ""
5989 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
5990 "exists, but does nothing.  (Nothing needs to be done, because the "
5991 "implementation does the right thing during an B<execve>(2).)"
5992 msgstr ""
5993
5994 #. type: Plain text
5995 #: build/C/man3/pthread_kill_other_threads_np.3:70
5996 msgid ""
5997 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
5998 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
5999 msgstr "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), B<pthreads>(7)"
6000
6001 #. type: TH
6002 #: build/C/man3/pthread_self.3:24
6003 #, no-wrap
6004 msgid "PTHREAD_SELF"
6005 msgstr "PTHREAD_SELF"
6006
6007 #. type: Plain text
6008 #: build/C/man3/pthread_self.3:27
6009 msgid "pthread_self - obtain ID of the calling thread"
6010 msgstr ""
6011
6012 #. type: Plain text
6013 #: build/C/man3/pthread_self.3:32
6014 #, no-wrap
6015 msgid "B<pthread_t pthread_self(void);>\n"
6016 msgstr "B<pthread_t pthread_self(void);>\n"
6017
6018 #. type: Plain text
6019 #: build/C/man3/pthread_self.3:43
6020 msgid ""
6021 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
6022 "is the same value that is returned in I<*thread> in the B<pthread_create>"
6023 "(3)  call that created this thread."
6024 msgstr ""
6025
6026 #. type: Plain text
6027 #: build/C/man3/pthread_self.3:45
6028 msgid "This function always succeeds, returning the calling thread's ID."
6029 msgstr ""
6030
6031 #. type: Plain text
6032 #: build/C/man3/pthread_self.3:60
6033 msgid ""
6034 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
6035 "represent a thread ID; for example, representation using either an "
6036 "arithmetic type or a structure is permitted.  Therefore, variables of type "
6037 "I<pthread_t> can't portably be compared using the C equality operator "
6038 "(B<==>); use B<pthread_equal>(3)  instead."
6039 msgstr ""
6040
6041 #. type: Plain text
6042 #: build/C/man3/pthread_self.3:64
6043 msgid ""
6044 "Thread identifiers should be considered opaque: any attempt to use a thread "
6045 "ID other than in pthreads calls is nonportable and can lead to unspecified "
6046 "results."
6047 msgstr ""
6048
6049 #. type: Plain text
6050 #: build/C/man3/pthread_self.3:68
6051 msgid ""
6052 "Thread IDs are only guaranteed to be unique within a process.  A thread ID "
6053 "may be reused after a terminated thread has been joined, or a detached "
6054 "thread has terminated."
6055 msgstr ""
6056
6057 #. type: Plain text
6058 #: build/C/man3/pthread_self.3:73
6059 msgid ""
6060 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
6061 "kernel thread ID returned by a call to B<gettid>(2)."
6062 msgstr ""
6063
6064 #. type: Plain text
6065 #: build/C/man3/pthread_self.3:77
6066 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6067 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6068
6069 #. type: TH
6070 #: build/C/man3/pthread_setaffinity_np.3:24
6071 #, no-wrap
6072 msgid "PTHREAD_SETAFFINITY_NP"
6073 msgstr "PTHREAD_SETAFFINITY_NP"
6074
6075 #. type: Plain text
6076 #: build/C/man3/pthread_setaffinity_np.3:28
6077 msgid ""
6078 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
6079 "thread"
6080 msgstr ""
6081
6082 #. type: Plain text
6083 #: build/C/man3/pthread_setaffinity_np.3:37
6084 #, no-wrap
6085 msgid ""
6086 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6087 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6088 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6089 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6090 msgstr ""
6091 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6092 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6093 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6094 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6095
6096 #. type: Plain text
6097 #: build/C/man3/pthread_setaffinity_np.3:51
6098 msgid ""
6099 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
6100 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
6101 "successful, and the thread is not currently running on one of the CPUs in "
6102 "I<cpuset>, then it is migrated to one of those CPUs."
6103 msgstr ""
6104
6105 #. type: Plain text
6106 #: build/C/man3/pthread_setaffinity_np.3:58
6107 msgid ""
6108 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
6109 "the thread I<thread> in the buffer pointed to by I<cpuset>."
6110 msgstr ""
6111
6112 #. type: Plain text
6113 #: build/C/man3/pthread_setaffinity_np.3:74
6114 msgid ""
6115 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
6116 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
6117 "(cpu_set_t)>.  (It may be some other value, if using the macros described in "
6118 "B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
6119 msgstr ""
6120
6121 #. type: TP
6122 #: build/C/man3/pthread_setaffinity_np.3:78
6123 #, no-wrap
6124 msgid "B<EFAULT>"
6125 msgstr "B<EFAULT>"
6126
6127 #. type: Plain text
6128 #: build/C/man3/pthread_setaffinity_np.3:81
6129 msgid "A supplied memory address was invalid."
6130 msgstr ""
6131
6132 #. type: Plain text
6133 #: build/C/man3/pthread_setaffinity_np.3:90
6134 msgid ""
6135 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
6136 "processors that are currently physically on the system and permitted to the "
6137 "thread according to any restrictions that may be imposed by the \"cpuset\" "
6138 "mechanism described in B<cpuset>(7)."
6139 msgstr ""
6140
6141 #.  FIXME . ?
6142 #.  Loic Domaigne commented: it seems that in the future the
6143 #.  kernel developers want to make cpumask_t dynamic, so
6144 #.  CONFIG_NR_CPUS might become obsolete in the future.
6145 #.  cpumask_t
6146 #.  The raw sched_getaffinity() system call returns the size (in bytes)
6147 #.  of the cpumask_t type.
6148 #. type: Plain text
6149 #: build/C/man3/pthread_setaffinity_np.3:106
6150 msgid ""
6151 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
6152 "the set supported by the kernel.  (The kernel configuration option "
6153 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
6154 "type used to represent CPU sets.)"
6155 msgstr ""
6156
6157 #. type: Plain text
6158 #: build/C/man3/pthread_setaffinity_np.3:111
6159 msgid ""
6160 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
6161 "affinity mask used by the kernel."
6162 msgstr ""
6163
6164 #. type: Plain text
6165 #: build/C/man3/pthread_setaffinity_np.3:134
6166 msgid ""
6167 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
6168 "thread will actually run is the intersection of the set specified in the "
6169 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
6170 "system may further restrict the set of CPUs on which the thread runs if the "
6171 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
6172 "restrictions on the actual set of CPUs on which the thread will run are "
6173 "silently imposed by the kernel."
6174 msgstr ""
6175
6176 #. type: Plain text
6177 #: build/C/man3/pthread_setaffinity_np.3:140
6178 msgid ""
6179 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
6180 "B<sched_getaffinity>(2)  system calls."
6181 msgstr ""
6182
6183 #. type: Plain text
6184 #: build/C/man3/pthread_setaffinity_np.3:151
6185 msgid ""
6186 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
6187 "creator's CPU affinity mask."
6188 msgstr ""
6189
6190 #. type: Plain text
6191 #: build/C/man3/pthread_setaffinity_np.3:159
6192 msgid ""
6193 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
6194 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
6195 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
6196 "check the resulting CPU affinity mask of the thread."
6197 msgstr ""
6198
6199 #. type: Plain text
6200 #: build/C/man3/pthread_setaffinity_np.3:166
6201 #, no-wrap
6202 msgid ""
6203 "#define _GNU_SOURCE\n"
6204 "#include E<lt>pthread.hE<gt>\n"
6205 "#include E<lt>stdio.hE<gt>\n"
6206 "#include E<lt>stdlib.hE<gt>\n"
6207 "#include E<lt>errno.hE<gt>\n"
6208 msgstr ""
6209 "#define _GNU_SOURCE\n"
6210 "#include E<lt>pthread.hE<gt>\n"
6211 "#include E<lt>stdio.hE<gt>\n"
6212 "#include E<lt>stdlib.hE<gt>\n"
6213 "#include E<lt>errno.hE<gt>\n"
6214
6215 #. type: Plain text
6216 #: build/C/man3/pthread_setaffinity_np.3:176
6217 #, no-wrap
6218 msgid ""
6219 "int\n"
6220 "main(int argc, char *argv[])\n"
6221 "{\n"
6222 "    int s, j;\n"
6223 "    cpu_set_t cpuset;\n"
6224 "    pthread_t thread;\n"
6225 msgstr ""
6226 "int\n"
6227 "main(int argc, char *argv[])\n"
6228 "{\n"
6229 "    int s, j;\n"
6230 "    cpu_set_t cpuset;\n"
6231 "    pthread_t thread;\n"
6232
6233 #. type: Plain text
6234 #: build/C/man3/pthread_setaffinity_np.3:178
6235 #, no-wrap
6236 msgid "    thread = pthread_self();\n"
6237 msgstr "    thread = pthread_self();\n"
6238
6239 #. type: Plain text
6240 #: build/C/man3/pthread_setaffinity_np.3:180
6241 #, no-wrap
6242 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
6243 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
6244
6245 #. type: Plain text
6246 #: build/C/man3/pthread_setaffinity_np.3:184
6247 #, no-wrap
6248 msgid ""
6249 "    CPU_ZERO(&cpuset);\n"
6250 "    for (j = 0; j E<lt> 8; j++)\n"
6251 "        CPU_SET(j, &cpuset);\n"
6252 msgstr ""
6253 "    CPU_ZERO(&cpuset);\n"
6254 "    for (j = 0; j E<lt> 8; j++)\n"
6255 "        CPU_SET(j, &cpuset);\n"
6256
6257 #. type: Plain text
6258 #: build/C/man3/pthread_setaffinity_np.3:188
6259 #, no-wrap
6260 msgid ""
6261 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6262 "    if (s != 0)\n"
6263 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
6264 msgstr ""
6265 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6266 "    if (s != 0)\n"
6267 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
6268
6269 #. type: Plain text
6270 #: build/C/man3/pthread_setaffinity_np.3:190
6271 #, no-wrap
6272 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
6273 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
6274
6275 #. type: Plain text
6276 #: build/C/man3/pthread_setaffinity_np.3:194
6277 #, no-wrap
6278 msgid ""
6279 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6280 "    if (s != 0)\n"
6281 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
6282 msgstr ""
6283 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6284 "    if (s != 0)\n"
6285 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
6286
6287 #. type: Plain text
6288 #: build/C/man3/pthread_setaffinity_np.3:199
6289 #, no-wrap
6290 msgid ""
6291 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6292 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6293 "        if (CPU_ISSET(j, &cpuset))\n"
6294 "            printf(\"    CPU %d\\en\", j);\n"
6295 msgstr ""
6296 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6297 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6298 "        if (CPU_ISSET(j, &cpuset))\n"
6299 "            printf(\"    CPU %d\\en\", j);\n"
6300
6301 #. type: Plain text
6302 #: build/C/man3/pthread_setaffinity_np.3:202
6303 #: build/C/man3/pthread_setschedparam.3:427
6304 #, no-wrap
6305 msgid ""
6306 "    exit(EXIT_SUCCESS);\n"
6307 "}\n"
6308 msgstr ""
6309 "    exit(EXIT_SUCCESS);\n"
6310 "}\n"
6311
6312 #. type: Plain text
6313 #: build/C/man3/pthread_setaffinity_np.3:211
6314 msgid ""
6315 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
6316 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
6317 "B<cpuset>(7), B<pthreads>(7)"
6318 msgstr "B<sched_setaffinity>(2), B<sched_setscheduler>(2), B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7)"
6319
6320 #. type: TH
6321 #: build/C/man3/pthread_setcancelstate.3:24
6322 #, no-wrap
6323 msgid "PTHREAD_SETCANCELSTATE"
6324 msgstr "PTHREAD_SETCANCELSTATE"
6325
6326 #. type: Plain text
6327 #: build/C/man3/pthread_setcancelstate.3:28
6328 msgid ""
6329 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
6330 "type"
6331 msgstr ""
6332
6333 #. type: Plain text
6334 #: build/C/man3/pthread_setcancelstate.3:34
6335 #, no-wrap
6336 msgid ""
6337 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6338 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6339 msgstr ""
6340 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6341 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6342
6343 #. type: Plain text
6344 #: build/C/man3/pthread_setcancelstate.3:48
6345 msgid ""
6346 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
6347 "thread to the value given in I<state>.  The previous cancelability state of "
6348 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
6349 "I<state> argument must have one of the following values:"
6350 msgstr ""
6351
6352 #. type: TP
6353 #: build/C/man3/pthread_setcancelstate.3:48
6354 #, no-wrap
6355 msgid "B<PTHREAD_CANCEL_ENABLE>"
6356 msgstr "B<PTHREAD_CANCEL_ENABLE>"
6357
6358 #. type: Plain text
6359 #: build/C/man3/pthread_setcancelstate.3:55
6360 msgid ""
6361 "The thread is cancelable.  This is the default cancelability state in all "
6362 "new threads, including the initial thread.  The thread's cancelability type "
6363 "determines when a cancelable thread will respond to a cancellation request."
6364 msgstr ""
6365
6366 #. type: TP
6367 #: build/C/man3/pthread_setcancelstate.3:55
6368 #, no-wrap
6369 msgid "B<PTHREAD_CANCEL_DISABLE>"
6370 msgstr "B<PTHREAD_CANCEL_DISABLE>"
6371
6372 #. type: Plain text
6373 #: build/C/man3/pthread_setcancelstate.3:60
6374 msgid ""
6375 "The thread is not cancelable.  If a cancellation request is received, it is "
6376 "blocked until cancelability is enabled."
6377 msgstr ""
6378
6379 #. type: Plain text
6380 #: build/C/man3/pthread_setcancelstate.3:72
6381 msgid ""
6382 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
6383 "thread to the value given in I<type>.  The previous cancelability type of "
6384 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
6385 "argument must have one of the following values:"
6386 msgstr ""
6387
6388 #. type: TP
6389 #: build/C/man3/pthread_setcancelstate.3:72
6390 #, no-wrap
6391 msgid "B<PTHREAD_CANCEL_DEFERRED>"
6392 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
6393
6394 #. type: Plain text
6395 #: build/C/man3/pthread_setcancelstate.3:79
6396 msgid ""
6397 "A cancellation request is deferred until the thread next calls a function "
6398 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
6399 "cancelability type in all new threads, including the initial thread."
6400 msgstr ""
6401
6402 #. type: TP
6403 #: build/C/man3/pthread_setcancelstate.3:79
6404 #, no-wrap
6405 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6406 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6407
6408 #. type: Plain text
6409 #: build/C/man3/pthread_setcancelstate.3:85
6410 msgid ""
6411 "The thread can be canceled at any time.  (Typically, it will be canceled "
6412 "immediately upon receiving a cancellation request, but the system doesn't "
6413 "guarantee this.)"
6414 msgstr ""
6415
6416 #. type: Plain text
6417 #: build/C/man3/pthread_setcancelstate.3:89
6418 msgid ""
6419 "The set-and-get operation performed by each of these functions is atomic "
6420 "with respect to other threads in the process calling the same function."
6421 msgstr ""
6422
6423 #. type: Plain text
6424 #: build/C/man3/pthread_setcancelstate.3:96
6425 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
6426 msgstr ""
6427
6428 #. type: Plain text
6429 #: build/C/man3/pthread_setcancelstate.3:100
6430 msgid "Invalid value for I<state>."
6431 msgstr ""
6432
6433 #. type: Plain text
6434 #: build/C/man3/pthread_setcancelstate.3:104
6435 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
6436 msgstr ""
6437
6438 #.  .SH VERSIONS
6439 #.  Available since glibc 2.0
6440 #. type: Plain text
6441 #: build/C/man3/pthread_setcancelstate.3:110
6442 msgid "Invalid value for I<type>."
6443 msgstr ""
6444
6445 #. type: Plain text
6446 #: build/C/man3/pthread_setcancelstate.3:115
6447 msgid ""
6448 "For details of what happens when a thread is canceled, see B<pthread_cancel>"
6449 "(3)."
6450 msgstr ""
6451
6452 #. type: Plain text
6453 #: build/C/man3/pthread_setcancelstate.3:122
6454 msgid ""
6455 "Briefly disabling cancelability is useful if a thread performs some critical "
6456 "action that must not be interrupted by a cancellation request.  Beware of "
6457 "disabling cancelability for long periods, or around operations that may "
6458 "block for long periods, since that will render the thread unresponsive to "
6459 "cancellation requests."
6460 msgstr ""
6461
6462 #. type: Plain text
6463 #: build/C/man3/pthread_setcancelstate.3:153
6464 msgid ""
6465 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
6466 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
6467 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
6468 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
6469 "because the application has no way of knowing what the state of these "
6470 "resources is when the thread is canceled; that is, did cancellation occur "
6471 "before the resources were reserved, while they were reserved, or after they "
6472 "were released? Furthermore, some internal data structures (e.g., the linked "
6473 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
6474 "left in an inconsistent state if cancellation occurs in the middle of the "
6475 "function call.  Consequently, clean-up handlers cease to be useful.  "
6476 "Functions that can be safely asynchronously canceled are called I<async-"
6477 "cancel-safe functions>.  POSIX.1-2001 only requires that B<pthread_cancel>"
6478 "(3), B<pthread_setcancelstate>(), and B<pthread_setcanceltype>()  be async-"
6479 "cancel-safe.  In general, other library functions can't be safely called "
6480 "from an asynchronously cancelable thread.  One of the few circumstances in "
6481 "which asynchronous cancelability is useful is for cancellation of a thread "
6482 "that is in a pure compute-bound loop."
6483 msgstr ""
6484
6485 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
6486 #. type: Plain text
6487 #: build/C/man3/pthread_setcancelstate.3:171
6488 msgid ""
6489 "The Linux threading implementations permit the I<oldstate> argument of "
6490 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
6491 "the previous cancelability state is not returned to the caller.  Many other "
6492 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
6493 "does not specify this point, so portable applications should always specify "
6494 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
6495 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
6496 msgstr ""
6497
6498 #. type: Plain text
6499 #: build/C/man3/pthread_setcancelstate.3:174
6500 msgid "See B<pthread_cancel>(3)."
6501 msgstr ""
6502
6503 #. type: Plain text
6504 #: build/C/man3/pthread_setcancelstate.3:179
6505 msgid ""
6506 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
6507 "B<pthreads>(7)"
6508 msgstr "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
6509
6510 #. type: TH
6511 #: build/C/man3/pthread_setconcurrency.3:23
6512 #, no-wrap
6513 msgid "PTHREAD_SETCONCURRENCY"
6514 msgstr "PTHREAD_SETCONCURRENCY"
6515
6516 #. type: TH
6517 #: build/C/man3/pthread_setconcurrency.3:23 build/C/man3/pthread_yield.3:23
6518 #, no-wrap
6519 msgid "2009-04-10"
6520 msgstr "2009-04-10"
6521
6522 #. type: Plain text
6523 #: build/C/man3/pthread_setconcurrency.3:27
6524 msgid ""
6525 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
6526 "level"
6527 msgstr ""
6528
6529 #. type: Plain text
6530 #: build/C/man3/pthread_setconcurrency.3:33
6531 #, no-wrap
6532 msgid ""
6533 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
6534 "B<int pthread_getconcurrency(void);>\n"
6535 msgstr ""
6536 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
6537 "B<int pthread_getconcurrency(void);>\n"
6538
6539 #. type: Plain text
6540 #: build/C/man3/pthread_setconcurrency.3:45
6541 msgid ""
6542 "The B<pthread_setconcurrency>()  function informs the implementation of the "
6543 "application's desired concurrency level, specified in I<new_level>.  The "
6544 "implementation only takes this as a hint: POSIX.1 does not specify the level "
6545 "of concurrency that should be provided as a result of calling "
6546 "B<pthread_setconcurrency>()."
6547 msgstr ""
6548
6549 #. type: Plain text
6550 #: build/C/man3/pthread_setconcurrency.3:50
6551 msgid ""
6552 "Specifying I<new_level> as 0 instructs the implementation to manage the "
6553 "concurrency level as it deems appropriate."
6554 msgstr ""
6555
6556 #. type: Plain text
6557 #: build/C/man3/pthread_setconcurrency.3:53
6558 msgid ""
6559 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
6560 "level for this process."
6561 msgstr ""
6562
6563 #. type: Plain text
6564 #: build/C/man3/pthread_setconcurrency.3:58
6565 msgid ""
6566 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
6567 "nonzero error number."
6568 msgstr ""
6569
6570 #. type: Plain text
6571 #: build/C/man3/pthread_setconcurrency.3:65
6572 msgid ""
6573 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
6574 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
6575 "B<pthread_setconcurrency>()  has not previously been called."
6576 msgstr ""
6577
6578 #. type: Plain text
6579 #: build/C/man3/pthread_setconcurrency.3:68
6580 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
6581 msgstr ""
6582
6583 #. type: Plain text
6584 #: build/C/man3/pthread_setconcurrency.3:72
6585 msgid "I<new_level> is negative."
6586 msgstr ""
6587
6588 #. type: Plain text
6589 #: build/C/man3/pthread_setconcurrency.3:78
6590 msgid ""
6591 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
6592 "I<new_level> would cause a system resource to be exceeded\")."
6593 msgstr ""
6594
6595 #. type: Plain text
6596 #: build/C/man3/pthread_setconcurrency.3:80
6597 msgid "These functions are available in glibc since version 2.1."
6598 msgstr ""
6599
6600 #. type: Plain text
6601 #: build/C/man3/pthread_setconcurrency.3:84
6602 msgid "The default concurrency level is 0."
6603 msgstr ""
6604
6605 #. type: Plain text
6606 #: build/C/man3/pthread_setconcurrency.3:91
6607 msgid ""
6608 "Concurrency levels are only meaningful for M:N threading implementations, "
6609 "where at any moment a subset of a process's set of user-level threads may be "
6610 "bound to a smaller number of kernel-scheduling entities.  Setting the "
6611 "concurrency level allows the application to give the system a hint as to the "
6612 "number of kernel-scheduling entities that should be provided for efficient "
6613 "execution of the application."
6614 msgstr ""
6615
6616 #. type: Plain text
6617 #: build/C/man3/pthread_setconcurrency.3:97
6618 msgid ""
6619 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
6620 "concurrency level has no meaning.  In other words, on Linux these functions "
6621 "merely exist for compatibility with other systems, and they have no effect "
6622 "on the execution of a program."
6623 msgstr ""
6624
6625 #. type: Plain text
6626 #: build/C/man3/pthread_setconcurrency.3:100
6627 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
6628 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
6629
6630 #. type: TH
6631 #: build/C/man3/pthread_setschedparam.3:24
6632 #, no-wrap
6633 msgid "PTHREAD_SETSCHEDPARAM"
6634 msgstr "PTHREAD_SETSCHEDPARAM"
6635
6636 #. type: Plain text
6637 #: build/C/man3/pthread_setschedparam.3:28
6638 msgid ""
6639 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
6640 "parameters of a thread"
6641 msgstr ""
6642
6643 #. type: Plain text
6644 #: build/C/man3/pthread_setschedparam.3:36
6645 #, no-wrap
6646 msgid ""
6647 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
6648 "B<                      const struct sched_param *>I<param>B<);>\n"
6649 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
6650 "B<                      struct sched_param *>I<param>B<);>\n"
6651 msgstr ""
6652 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
6653 "B<                      const struct sched_param *>I<param>B<);>\n"
6654 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
6655 "B<                      struct sched_param *>I<param>B<);>\n"
6656
6657 #. type: Plain text
6658 #: build/C/man3/pthread_setschedparam.3:43
6659 msgid ""
6660 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
6661 "parameters of the thread I<thread>."
6662 msgstr ""
6663
6664 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
6665 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
6666 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
6667 #. type: Plain text
6668 #: build/C/man3/pthread_setschedparam.3:54
6669 msgid ""
6670 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
6671 "values for I<policy>, and their semantics, are described in "
6672 "B<sched_setscheduler>(2)."
6673 msgstr ""
6674
6675 #. type: Plain text
6676 #: build/C/man3/pthread_setschedparam.3:60
6677 msgid ""
6678 "The structure pointed to by I<param> specifies the new scheduling parameters "
6679 "for I<thread>.  Scheduling parameters are maintained in the following "
6680 "structure:"
6681 msgstr ""
6682
6683 #.  FIXME . nptl/pthread_setschedparam.c has the following
6684 #.    /* If the thread should have higher priority because of some
6685 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
6686 #.  Eventually (perhaps after writing the mutexattr pages), we
6687 #.  may want to add something on the topic to this page.
6688 #. type: Plain text
6689 #: build/C/man3/pthread_setschedparam.3:101
6690 msgid ""
6691 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
6692 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
6693 "and I<param>, respectively.  The returned priority value is that set by the "
6694 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
6695 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
6696 "does not reflect any temporary priority adjustments as a result of calls to "
6697 "any priority inheritance or priority ceiling functions (see, for example, "
6698 "B<pthread_mutexattr_setprioceiling>(3)  and B<pthread_mutexattr_setprotocol>"
6699 "(3))."
6700 msgstr ""
6701
6702 #. type: Plain text
6703 #: build/C/man3/pthread_setschedparam.3:109
6704 msgid ""
6705 "On success, these functions return 0; on error, they return a nonzero error "
6706 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
6707 "parameters of I<thread> are not changed."
6708 msgstr ""
6709
6710 #. type: Plain text
6711 #: build/C/man3/pthread_setschedparam.3:111
6712 msgid "Both of these functions can fail with the following error:"
6713 msgstr ""
6714
6715 #. type: Plain text
6716 #: build/C/man3/pthread_setschedparam.3:119
6717 msgid ""
6718 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
6719 msgstr ""
6720
6721 #. type: Plain text
6722 #: build/C/man3/pthread_setschedparam.3:126
6723 msgid ""
6724 "I<policy> is not a recognized policy, or I<param> does not make sense for "
6725 "the I<policy>."
6726 msgstr ""
6727
6728 #. type: Plain text
6729 #: build/C/man3/pthread_setschedparam.3:130
6730 msgid ""
6731 "The caller does not have appropriate privileges to set the specified "
6732 "scheduling policy and parameters."
6733 msgstr ""
6734
6735 #.  .SH VERSIONS
6736 #.  Available since glibc 2.0
6737 #. type: Plain text
6738 #: build/C/man3/pthread_setschedparam.3:138
6739 msgid ""
6740 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
6741 "policy or scheduling parameters to an unsupported value\") error for "
6742 "B<pthread_setschedparam>()."
6743 msgstr ""
6744
6745 #. type: Plain text
6746 #: build/C/man3/pthread_setschedparam.3:146
6747 msgid ""
6748 "For a description of the permissions required to, and the effect of, "
6749 "changing a thread's scheduling policy and priority, and details of the "
6750 "permitted ranges for priorities in each scheduling policy, see "
6751 "B<sched_setscheduler>(2)."
6752 msgstr ""
6753
6754 #. type: Plain text
6755 #: build/C/man3/pthread_setschedparam.3:153
6756 msgid ""
6757 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
6758 "B<pthread_getschedparam>(), as well as the use of a number of other "
6759 "scheduling-related pthreads functions."
6760 msgstr ""
6761
6762 #. type: Plain text
6763 #: build/C/man3/pthread_setschedparam.3:169
6764 msgid ""
6765 "In the following run, the main thread sets its scheduling policy to "
6766 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
6767 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
6768 "priority attribute of 20.  The program then sets (using "
6769 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
6770 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
6771 "created using this attributes object should take their scheduling attributes "
6772 "from the thread attributes object.  The program then creates a thread using "
6773 "the thread attributes object, and that thread displays its scheduling policy "
6774 "and priority."
6775 msgstr ""
6776
6777 #. type: Plain text
6778 #: build/C/man3/pthread_setschedparam.3:177
6779 #, no-wrap
6780 msgid ""
6781 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
6782 "Password:\n"
6783 "# B<./a.out -mf10 -ar20 -i e>\n"
6784 "Scheduler settings of main thread\n"
6785 "    policy=SCHED_FIFO, priority=10\n"
6786 msgstr ""
6787 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
6788 "Password:\n"
6789 "# B<./a.out -mf10 -ar20 -i e>\n"
6790 "Scheduler settings of main thread\n"
6791 "    policy=SCHED_FIFO, priority=10\n"
6792
6793 #. type: Plain text
6794 #: build/C/man3/pthread_setschedparam.3:181
6795 #, no-wrap
6796 msgid ""
6797 "Scheduler settings in \\(aqattr\\(aq\n"
6798 "    policy=SCHED_RR, priority=20\n"
6799 "    inheritsched is EXPLICIT\n"
6800 msgstr ""
6801 "Scheduler settings in \\(aqattr\\(aq\n"
6802 "    policy=SCHED_RR, priority=20\n"
6803 "    inheritsched is EXPLICIT\n"
6804
6805 #. type: Plain text
6806 #: build/C/man3/pthread_setschedparam.3:184
6807 #, no-wrap
6808 msgid ""
6809 "Scheduler attributes of new thread\n"
6810 "    policy=SCHED_RR, priority=20\n"
6811 msgstr ""
6812 "Scheduler attributes of new thread\n"
6813 "    policy=SCHED_RR, priority=20\n"
6814
6815 #. type: Plain text
6816 #: build/C/man3/pthread_setschedparam.3:189
6817 msgid ""
6818 "In the above output, one can see that the scheduling policy and priority "
6819 "were taken from the values specified in the thread attributes object."
6820 msgstr ""
6821
6822 #. type: Plain text
6823 #: build/C/man3/pthread_setschedparam.3:196
6824 msgid ""
6825 "The next run is the same as the previous, except that the inherit scheduler "
6826 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
6827 "using the thread attributes object should ignore the scheduling attributes "
6828 "specified in the attributes object and instead take their scheduling "
6829 "attributes from the creating thread."
6830 msgstr ""
6831
6832 #. type: Plain text
6833 #: build/C/man3/pthread_setschedparam.3:202
6834 #, no-wrap
6835 msgid ""
6836 "# B<./a.out -mf10 -ar20 -i i>\n"
6837 "Scheduler settings of main thread\n"
6838 "    policy=SCHED_FIFO, priority=10\n"
6839 msgstr ""
6840 "# B<./a.out -mf10 -ar20 -i i>\n"
6841 "Scheduler settings of main thread\n"
6842 "    policy=SCHED_FIFO, priority=10\n"
6843
6844 #. type: Plain text
6845 #: build/C/man3/pthread_setschedparam.3:206
6846 #, no-wrap
6847 msgid ""
6848 "Scheduler settings in \\(aqattr\\(aq\n"
6849 "    policy=SCHED_RR, priority=20\n"
6850 "    inheritsched is INHERIT\n"
6851 msgstr ""
6852 "Scheduler settings in \\(aqattr\\(aq\n"
6853 "    policy=SCHED_RR, priority=20\n"
6854 "    inheritsched is INHERIT\n"
6855
6856 #. type: Plain text
6857 #: build/C/man3/pthread_setschedparam.3:209
6858 #, no-wrap
6859 msgid ""
6860 "Scheduler attributes of new thread\n"
6861 "    policy=SCHED_FIFO, priority=10\n"
6862 msgstr ""
6863 "Scheduler attributes of new thread\n"
6864 "    policy=SCHED_FIFO, priority=10\n"
6865
6866 #. type: Plain text
6867 #: build/C/man3/pthread_setschedparam.3:215
6868 msgid ""
6869 "In the above output, one can see that the scheduling policy and priority "
6870 "were taken from the creating thread, rather than the thread attributes "
6871 "object."
6872 msgstr ""
6873
6874 #. type: Plain text
6875 #: build/C/man3/pthread_setschedparam.3:221
6876 msgid ""
6877 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
6878 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
6879 "scheduler attribute."
6880 msgstr ""
6881
6882 #. type: Plain text
6883 #: build/C/man3/pthread_setschedparam.3:225
6884 #, no-wrap
6885 msgid "/* pthreads_sched_test.c */\n"
6886 msgstr "/* pthreads_sched_test.c */\n"
6887
6888 #. type: Plain text
6889 #: build/C/man3/pthread_setschedparam.3:231
6890 #, no-wrap
6891 msgid ""
6892 "#include E<lt>pthread.hE<gt>\n"
6893 "#include E<lt>stdio.hE<gt>\n"
6894 "#include E<lt>stdlib.hE<gt>\n"
6895 "#include E<lt>unistd.hE<gt>\n"
6896 "#include E<lt>errno.hE<gt>\n"
6897 msgstr ""
6898 "#include E<lt>pthread.hE<gt>\n"
6899 "#include E<lt>stdio.hE<gt>\n"
6900 "#include E<lt>stdlib.hE<gt>\n"
6901 "#include E<lt>unistd.hE<gt>\n"
6902 "#include E<lt>errno.hE<gt>\n"
6903
6904 #. type: Plain text
6905 #: build/C/man3/pthread_setschedparam.3:240
6906 #, no-wrap
6907 msgid ""
6908 "static void\n"
6909 "usage(char *prog_name, char *msg)\n"
6910 "{\n"
6911 "    if (msg != NULL)\n"
6912 "        fputs(msg, stderr);\n"
6913 msgstr ""
6914 "static void\n"
6915 "usage(char *prog_name, char *msg)\n"
6916 "{\n"
6917 "    if (msg != NULL)\n"
6918 "        fputs(msg, stderr);\n"
6919
6920 #. type: Plain text
6921 #: build/C/man3/pthread_setschedparam.3:257
6922 #, no-wrap
6923 msgid ""
6924 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
6925 "    fprintf(stderr, \"Options are:\\en\");\n"
6926 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
6927 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
6928 "    fpe(\"                 thread attributes object\\en\");\n"
6929 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
6930 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
6931 "    fpe(\"                     r  SCHED_RR\\en\");\n"
6932 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
6933 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
6934 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
6935 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
6936 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
6937 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
6938 "    exit(EXIT_FAILURE);\n"
6939 "}\n"
6940 msgstr ""
6941 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
6942 "    fprintf(stderr, \"Options are:\\en\");\n"
6943 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
6944 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
6945 "    fpe(\"                 thread attributes object\\en\");\n"
6946 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
6947 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
6948 "    fpe(\"                     r  SCHED_RR\\en\");\n"
6949 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
6950 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
6951 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
6952 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
6953 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
6954 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
6955 "    exit(EXIT_FAILURE);\n"
6956 "}\n"
6957
6958 #. type: Plain text
6959 #: build/C/man3/pthread_setschedparam.3:268
6960 #, no-wrap
6961 msgid ""
6962 "static int\n"
6963 "get_policy(char p, int *policy)\n"
6964 "{\n"
6965 "    switch (p) {\n"
6966 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
6967 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
6968 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
6969 "    default:  return 0;\n"
6970 "    }\n"
6971 "}\n"
6972 msgstr ""
6973 "static int\n"
6974 "get_policy(char p, int *policy)\n"
6975 "{\n"
6976 "    switch (p) {\n"
6977 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
6978 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
6979 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
6980 "    default:  return 0;\n"
6981 "    }\n"
6982 "}\n"
6983
6984 #. type: Plain text
6985 #: build/C/man3/pthread_setschedparam.3:279
6986 #, no-wrap
6987 msgid ""
6988 "static void\n"
6989 "display_sched_attr(int policy, struct sched_param *param)\n"
6990 "{\n"
6991 "    printf(\"    policy=%s, priority=%d\\en\",\n"
6992 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
6993 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
6994 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
6995 "            \"???\",\n"
6996 "            param-E<gt>sched_priority);\n"
6997 "}\n"
6998 msgstr ""
6999 "static void\n"
7000 "display_sched_attr(int policy, struct sched_param *param)\n"
7001 "{\n"
7002 "    printf(\"    policy=%s, priority=%d\\en\",\n"
7003 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
7004 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
7005 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
7006 "            \"???\",\n"
7007 "            param-E<gt>sched_priority);\n"
7008 "}\n"
7009
7010 #. type: Plain text
7011 #: build/C/man3/pthread_setschedparam.3:285
7012 #, no-wrap
7013 msgid ""
7014 "static void\n"
7015 "display_thread_sched_attr(char *msg)\n"
7016 "{\n"
7017 "    int policy, s;\n"
7018 "    struct sched_param param;\n"
7019 msgstr ""
7020 "static void\n"
7021 "display_thread_sched_attr(char *msg)\n"
7022 "{\n"
7023 "    int policy, s;\n"
7024 "    struct sched_param param;\n"
7025
7026 #. type: Plain text
7027 #: build/C/man3/pthread_setschedparam.3:289
7028 #, no-wrap
7029 msgid ""
7030 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
7031 "    if (s != 0)\n"
7032 "        handle_error_en(s, \"pthread_getschedparam\");\n"
7033 msgstr ""
7034 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
7035 "    if (s != 0)\n"
7036 "        handle_error_en(s, \"pthread_getschedparam\");\n"
7037
7038 #. type: Plain text
7039 #: build/C/man3/pthread_setschedparam.3:293
7040 #, no-wrap
7041 msgid ""
7042 "    printf(\"%s\\en\", msg);\n"
7043 "    display_sched_attr(policy, &param);\n"
7044 "}\n"
7045 msgstr ""
7046 "    printf(\"%s\\en\", msg);\n"
7047 "    display_sched_attr(policy, &param);\n"
7048 "}\n"
7049
7050 #. type: Plain text
7051 #: build/C/man3/pthread_setschedparam.3:298
7052 #, no-wrap
7053 msgid ""
7054 "static void *\n"
7055 "thread_start(void *arg)\n"
7056 "{\n"
7057 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7058 msgstr ""
7059 "static void *\n"
7060 "thread_start(void *arg)\n"
7061 "{\n"
7062 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7063
7064 #. type: Plain text
7065 #: build/C/man3/pthread_setschedparam.3:301
7066 #, no-wrap
7067 msgid ""
7068 "    return NULL;\n"
7069 "}\n"
7070 msgstr ""
7071 "    return NULL;\n"
7072 "}\n"
7073
7074 #. type: Plain text
7075 #: build/C/man3/pthread_setschedparam.3:311
7076 #, no-wrap
7077 msgid ""
7078 "int\n"
7079 "main(int argc, char *argv[])\n"
7080 "{\n"
7081 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
7082 "    pthread_t thread;\n"
7083 "    pthread_attr_t attr;\n"
7084 "    pthread_attr_t *attrp;\n"
7085 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7086 "    struct sched_param param;\n"
7087 msgstr ""
7088 "int\n"
7089 "main(int argc, char *argv[])\n"
7090 "{\n"
7091 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
7092 "    pthread_t thread;\n"
7093 "    pthread_attr_t attr;\n"
7094 "    pthread_attr_t *attrp;\n"
7095 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7096 "    struct sched_param param;\n"
7097
7098 #. type: Plain text
7099 #: build/C/man3/pthread_setschedparam.3:313
7100 #, no-wrap
7101 msgid "    /* Process command-line options */\n"
7102 msgstr "    /* Process command-line options */\n"
7103
7104 #. type: Plain text
7105 #: build/C/man3/pthread_setschedparam.3:318
7106 #, no-wrap
7107 msgid ""
7108 "    use_null_attrib = 0;\n"
7109 "    attr_sched_str = NULL;\n"
7110 "    main_sched_str = NULL;\n"
7111 "    inheritsched_str = NULL;\n"
7112 msgstr ""
7113 "    use_null_attrib = 0;\n"
7114 "    attr_sched_str = NULL;\n"
7115 "    main_sched_str = NULL;\n"
7116 "    inheritsched_str = NULL;\n"
7117
7118 #. type: Plain text
7119 #: build/C/man3/pthread_setschedparam.3:328
7120 #, no-wrap
7121 msgid ""
7122 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7123 "        switch (opt) {\n"
7124 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
7125 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
7126 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
7127 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
7128 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
7129 "        }\n"
7130 "    }\n"
7131 msgstr ""
7132 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7133 "        switch (opt) {\n"
7134 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
7135 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
7136 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
7137 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
7138 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
7139 "        }\n"
7140 "    }\n"
7141
7142 #. type: Plain text
7143 #: build/C/man3/pthread_setschedparam.3:332
7144 #, no-wrap
7145 msgid ""
7146 "    if (use_null_attrib &&\n"
7147 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7148 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7149 msgstr ""
7150 "    if (use_null_attrib &&\n"
7151 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7152 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7153
7154 #. type: Plain text
7155 #: build/C/man3/pthread_setschedparam.3:335
7156 #, no-wrap
7157 msgid ""
7158 "    /* Optionally set scheduling attributes of main thread,\n"
7159 "       and display the attributes */\n"
7160 msgstr ""
7161 "    /* Optionally set scheduling attributes of main thread,\n"
7162 "       and display the attributes */\n"
7163
7164 #. type: Plain text
7165 #: build/C/man3/pthread_setschedparam.3:340
7166 #, no-wrap
7167 msgid ""
7168 "    if (main_sched_str != NULL) {\n"
7169 "        if (!get_policy(main_sched_str[0], &policy))\n"
7170 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
7171 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7172 msgstr ""
7173 "    if (main_sched_str != NULL) {\n"
7174 "        if (!get_policy(main_sched_str[0], &policy))\n"
7175 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
7176 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7177
7178 #. type: Plain text
7179 #: build/C/man3/pthread_setschedparam.3:345
7180 #, no-wrap
7181 msgid ""
7182 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
7183 "        if (s != 0)\n"
7184 "            handle_error_en(s, \"pthread_setschedparam\");\n"
7185 "    }\n"
7186 msgstr ""
7187 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
7188 "        if (s != 0)\n"
7189 "            handle_error_en(s, \"pthread_setschedparam\");\n"
7190 "    }\n"
7191
7192 #. type: Plain text
7193 #: build/C/man3/pthread_setschedparam.3:348
7194 #, no-wrap
7195 msgid ""
7196 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7197 "    printf(\"\\en\");\n"
7198 msgstr ""
7199 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7200 "    printf(\"\\en\");\n"
7201
7202 #. type: Plain text
7203 #: build/C/man3/pthread_setschedparam.3:350
7204 #, no-wrap
7205 msgid "    /* Initialize thread attributes object according to options */\n"
7206 msgstr "    /* Initialize thread attributes object according to options */\n"
7207
7208 #. type: Plain text
7209 #: build/C/man3/pthread_setschedparam.3:359
7210 #, no-wrap
7211 msgid ""
7212 "    if (!use_null_attrib) {\n"
7213 "        s = pthread_attr_init(&attr);\n"
7214 "        if (s != 0)\n"
7215 "            handle_error_en(s, \"pthread_attr_init\");\n"
7216 "        attrp = &attr;\n"
7217 "    }\n"
7218 msgstr ""
7219 "    if (!use_null_attrib) {\n"
7220 "        s = pthread_attr_init(&attr);\n"
7221 "        if (s != 0)\n"
7222 "            handle_error_en(s, \"pthread_attr_init\");\n"
7223 "        attrp = &attr;\n"
7224 "    }\n"
7225
7226 #. type: Plain text
7227 #: build/C/man3/pthread_setschedparam.3:367
7228 #, no-wrap
7229 msgid ""
7230 "    if (inheritsched_str != NULL) {\n"
7231 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7232 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7233 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7234 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
7235 "        else\n"
7236 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7237 msgstr ""
7238 "    if (inheritsched_str != NULL) {\n"
7239 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7240 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7241 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7242 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
7243 "        else\n"
7244 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7245
7246 #. type: Plain text
7247 #: build/C/man3/pthread_setschedparam.3:372
7248 #, no-wrap
7249 msgid ""
7250 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7251 "        if (s != 0)\n"
7252 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7253 "    }\n"
7254 msgstr ""
7255 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7256 "        if (s != 0)\n"
7257 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7258 "    }\n"
7259
7260 #. type: Plain text
7261 #: build/C/man3/pthread_setschedparam.3:378
7262 #, no-wrap
7263 msgid ""
7264 "    if (attr_sched_str != NULL) {\n"
7265 "        if (!get_policy(attr_sched_str[0], &policy))\n"
7266 "            usage(argv[0],\n"
7267 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7268 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7269 msgstr ""
7270 "    if (attr_sched_str != NULL) {\n"
7271 "        if (!get_policy(attr_sched_str[0], &policy))\n"
7272 "            usage(argv[0],\n"
7273 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7274 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7275
7276 #. type: Plain text
7277 #: build/C/man3/pthread_setschedparam.3:386
7278 #, no-wrap
7279 msgid ""
7280 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
7281 "        if (s != 0)\n"
7282 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7283 "        s = pthread_attr_setschedparam(&attr, &param);\n"
7284 "        if (s != 0)\n"
7285 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7286 "    }\n"
7287 msgstr ""
7288 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
7289 "        if (s != 0)\n"
7290 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7291 "        s = pthread_attr_setschedparam(&attr, &param);\n"
7292 "        if (s != 0)\n"
7293 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7294 "    }\n"
7295
7296 #. type: Plain text
7297 #: build/C/man3/pthread_setschedparam.3:389
7298 #, no-wrap
7299 msgid ""
7300 "    /* If we initialized a thread attributes object, display\n"
7301 "       the scheduling attributes that were set in the object */\n"
7302 msgstr ""
7303 "    /* If we initialized a thread attributes object, display\n"
7304 "       the scheduling attributes that were set in the object */\n"
7305
7306 #. type: Plain text
7307 #: build/C/man3/pthread_setschedparam.3:397
7308 #, no-wrap
7309 msgid ""
7310 "    if (attrp != NULL) {\n"
7311 "        s = pthread_attr_getschedparam(&attr, &param);\n"
7312 "        if (s != 0)\n"
7313 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7314 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7315 "        if (s != 0)\n"
7316 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7317 msgstr ""
7318 "    if (attrp != NULL) {\n"
7319 "        s = pthread_attr_getschedparam(&attr, &param);\n"
7320 "        if (s != 0)\n"
7321 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7322 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7323 "        if (s != 0)\n"
7324 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7325
7326 #. type: Plain text
7327 #: build/C/man3/pthread_setschedparam.3:400
7328 #, no-wrap
7329 msgid ""
7330 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7331 "        display_sched_attr(policy, &param);\n"
7332 msgstr ""
7333 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7334 "        display_sched_attr(policy, &param);\n"
7335
7336 #. type: Plain text
7337 #: build/C/man3/pthread_setschedparam.3:408
7338 #, no-wrap
7339 msgid ""
7340 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7341 "        printf(\"    inheritsched is %s\\en\",\n"
7342 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
7343 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7344 "                \"???\");\n"
7345 "        printf(\"\\en\");\n"
7346 "    }\n"
7347 msgstr ""
7348 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7349 "        printf(\"    inheritsched is %s\\en\",\n"
7350 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
7351 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7352 "                \"???\");\n"
7353 "        printf(\"\\en\");\n"
7354 "    }\n"
7355
7356 #. type: Plain text
7357 #: build/C/man3/pthread_setschedparam.3:410
7358 #, no-wrap
7359 msgid "    /* Create a thread that will display its scheduling attributes */\n"
7360 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
7361
7362 #. type: Plain text
7363 #: build/C/man3/pthread_setschedparam.3:414
7364 #, no-wrap
7365 msgid ""
7366 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7367 "    if (s != 0)\n"
7368 "        handle_error_en(s, \"pthread_create\");\n"
7369 msgstr ""
7370 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7371 "    if (s != 0)\n"
7372 "        handle_error_en(s, \"pthread_create\");\n"
7373
7374 #. type: Plain text
7375 #: build/C/man3/pthread_setschedparam.3:416
7376 #, no-wrap
7377 msgid "    /* Destroy unneeded thread attributes object */\n"
7378 msgstr "    /* Destroy unneeded thread attributes object */\n"
7379
7380 #. type: Plain text
7381 #: build/C/man3/pthread_setschedparam.3:424
7382 #, no-wrap
7383 msgid ""
7384 "    s = pthread_join(thread, NULL);\n"
7385 "    if (s != 0)\n"
7386 "        handle_error_en(s, \"pthread_join\");\n"
7387 msgstr ""
7388 "    s = pthread_join(thread, NULL);\n"
7389 "    if (s != 0)\n"
7390 "        handle_error_en(s, \"pthread_join\");\n"
7391
7392 #. type: Plain text
7393 #: build/C/man3/pthread_setschedparam.3:440
7394 msgid ""
7395 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7396 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7397 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7398 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
7399 "B<pthreads>(7)"
7400 msgstr "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), B<pthreads>(7)"
7401
7402 #. type: TH
7403 #: build/C/man3/pthread_setschedprio.3:24
7404 #, no-wrap
7405 msgid "PTHREAD_SETSCHEDPRIO"
7406 msgstr "PTHREAD_SETSCHEDPRIO"
7407
7408 #. type: TH
7409 #: build/C/man3/pthread_setschedprio.3:24
7410 #, no-wrap
7411 msgid "2008-11-06"
7412 msgstr "2008-11-06"
7413
7414 #. type: Plain text
7415 #: build/C/man3/pthread_setschedprio.3:27
7416 msgid "pthread_setschedprio - set scheduling priority of a thread"
7417 msgstr ""
7418
7419 #. type: Plain text
7420 #: build/C/man3/pthread_setschedprio.3:32
7421 #, no-wrap
7422 msgid "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
7423 msgstr "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
7424
7425 #.  FIXME . nptl/pthread_setschedprio.c has the following
7426 #.    /* If the thread should have higher priority because of some
7427 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
7428 #.  Eventually (perhaps after writing the mutexattr pages), we
7429 #.  may want to add something on the topic to this page.
7430 #.  nptl/pthread_setschedparam.c has a similar case.
7431 #. type: Plain text
7432 #: build/C/man3/pthread_setschedprio.3:50
7433 msgid ""
7434 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
7435 "thread I<thread> to the value specified in I<prio>.  (By contrast "
7436 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
7437 "of a thread.)"
7438 msgstr ""
7439
7440 #. type: Plain text
7441 #: build/C/man3/pthread_setschedprio.3:58
7442 msgid ""
7443 "On success, this function returns 0; on error, it returns a nonzero error "
7444 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
7445 "I<thread> is not changed."
7446 msgstr ""
7447
7448 #. type: Plain text
7449 #: build/C/man3/pthread_setschedprio.3:63
7450 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
7451 msgstr ""
7452
7453 #. type: Plain text
7454 #: build/C/man3/pthread_setschedprio.3:67
7455 msgid ""
7456 "The caller does not have appropriate privileges to set the specified "
7457 "priority."
7458 msgstr ""
7459
7460 #. type: Plain text
7461 #: build/C/man3/pthread_setschedprio.3:78
7462 msgid ""
7463 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
7464 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
7465 msgstr ""
7466
7467 #. type: Plain text
7468 #: build/C/man3/pthread_setschedprio.3:80
7469 msgid "This function is available in glibc since version 2.3.4."
7470 msgstr ""
7471
7472 #. type: Plain text
7473 #: build/C/man3/pthread_setschedprio.3:88
7474 msgid ""
7475 "For a description of the permissions required to, and the effect of, "
7476 "changing a thread's scheduling priority, and details of the permitted ranges "
7477 "for priorities in each scheduling policy, see B<sched_setscheduler>(2)."
7478 msgstr ""
7479
7480 #. type: Plain text
7481 #: build/C/man3/pthread_setschedprio.3:100
7482 msgid ""
7483 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7484 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7485 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7486 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
7487 "B<pthreads>(7)"
7488 msgstr "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), B<pthreads>(7)"
7489
7490 #. type: TH
7491 #: build/C/man3/pthread_sigmask.3:24
7492 #, no-wrap
7493 msgid "PTHREAD_SIGMASK"
7494 msgstr "PTHREAD_SIGMASK"
7495
7496 #. type: TH
7497 #: build/C/man3/pthread_sigmask.3:24
7498 #, no-wrap
7499 msgid "2011-10-16"
7500 msgstr "2011-10-16"
7501
7502 #. type: Plain text
7503 #: build/C/man3/pthread_sigmask.3:27
7504 msgid "pthread_sigmask - examine and change mask of blocked signals"
7505 msgstr ""
7506
7507 #. type: Plain text
7508 #: build/C/man3/pthread_sigmask.3:33
7509 #, no-wrap
7510 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
7511 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
7512
7513 #. type: Plain text
7514 #: build/C/man3/pthread_sigmask.3:44
7515 msgid ""
7516 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
7517 "difference that its use in multithreaded programs is explicitly specified by "
7518 "POSIX.1-2001.  Other differences are noted in this page."
7519 msgstr ""
7520
7521 #. type: Plain text
7522 #: build/C/man3/pthread_sigmask.3:47
7523 msgid ""
7524 "For a description of the arguments and operation of this function, see "
7525 "B<sigprocmask>(2)."
7526 msgstr ""
7527
7528 #. type: Plain text
7529 #: build/C/man3/pthread_sigmask.3:52
7530 msgid ""
7531 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
7532 "number."
7533 msgstr ""
7534
7535 #. type: Plain text
7536 #: build/C/man3/pthread_sigmask.3:55
7537 msgid "See B<sigprocmask>(2)."
7538 msgstr ""
7539
7540 #. type: Plain text
7541 #: build/C/man3/pthread_sigmask.3:59
7542 msgid "A new thread inherits a copy of its creator's signal mask."
7543 msgstr ""
7544
7545 #. type: Plain text
7546 #: build/C/man3/pthread_sigmask.3:64
7547 msgid ""
7548 "The program below blocks some signals in the main thread, and then creates a "
7549 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
7550 "shell session demonstrates its use:"
7551 msgstr ""
7552
7553 #. type: Plain text
7554 #: build/C/man3/pthread_sigmask.3:75
7555 #, no-wrap
7556 msgid ""
7557 "$B< ./a.out &>\n"
7558 "[1] 5423\n"
7559 "$B< kill -QUIT %1>\n"
7560 "Signal handling thread got signal 3\n"
7561 "$B< kill -USR1 %1>\n"
7562 "Signal handling thread got signal 10\n"
7563 "$B< kill -TERM %1>\n"
7564 "[1]+  Terminated              ./a.out\n"
7565 msgstr ""
7566 "$B< ./a.out &>\n"
7567 "[1] 5423\n"
7568 "$B< kill -QUIT %1>\n"
7569 "Signal handling thread got signal 3\n"
7570 "$B< kill -USR1 %1>\n"
7571 "Signal handling thread got signal 10\n"
7572 "$B< kill -TERM %1>\n"
7573 "[1]+  Terminated              ./a.out\n"
7574
7575 #. type: Plain text
7576 #: build/C/man3/pthread_sigmask.3:86
7577 #, no-wrap
7578 msgid ""
7579 "#include E<lt>pthread.hE<gt>\n"
7580 "#include E<lt>stdio.hE<gt>\n"
7581 "#include E<lt>stdlib.hE<gt>\n"
7582 "#include E<lt>unistd.hE<gt>\n"
7583 "#include E<lt>signal.hE<gt>\n"
7584 "#include E<lt>errno.hE<gt>\n"
7585 msgstr ""
7586 "#include E<lt>pthread.hE<gt>\n"
7587 "#include E<lt>stdio.hE<gt>\n"
7588 "#include E<lt>stdlib.hE<gt>\n"
7589 "#include E<lt>unistd.hE<gt>\n"
7590 "#include E<lt>signal.hE<gt>\n"
7591 "#include E<lt>errno.hE<gt>\n"
7592
7593 #. type: Plain text
7594 #: build/C/man3/pthread_sigmask.3:88
7595 #, no-wrap
7596 msgid "/* Simple error handling functions */\n"
7597 msgstr "/* Simple error handling functions */\n"
7598
7599 #. type: Plain text
7600 #: build/C/man3/pthread_sigmask.3:97
7601 #, no-wrap
7602 msgid ""
7603 "static void *\n"
7604 "sig_thread(void *arg)\n"
7605 "{\n"
7606 "    sigset_t *set = (sigset_t *) arg;\n"
7607 "    int s, sig;\n"
7608 msgstr ""
7609 "static void *\n"
7610 "sig_thread(void *arg)\n"
7611 "{\n"
7612 "    sigset_t *set = (sigset_t *) arg;\n"
7613 "    int s, sig;\n"
7614
7615 #. type: Plain text
7616 #: build/C/man3/pthread_sigmask.3:105
7617 #, no-wrap
7618 msgid ""
7619 "    for (;;) {\n"
7620 "        s = sigwait(set, &sig);\n"
7621 "        if (s != 0)\n"
7622 "            handle_error_en(s, \"sigwait\");\n"
7623 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
7624 "    }\n"
7625 "}\n"
7626 msgstr ""
7627 "    for (;;) {\n"
7628 "        s = sigwait(set, &sig);\n"
7629 "        if (s != 0)\n"
7630 "            handle_error_en(s, \"sigwait\");\n"
7631 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
7632 "    }\n"
7633 "}\n"
7634
7635 #. type: Plain text
7636 #: build/C/man3/pthread_sigmask.3:112
7637 #, no-wrap
7638 msgid ""
7639 "int\n"
7640 "main(int argc, char *argv[])\n"
7641 "{\n"
7642 "    pthread_t thread;\n"
7643 "    sigset_t set;\n"
7644 "    int s;\n"
7645 msgstr ""
7646 "int\n"
7647 "main(int argc, char *argv[])\n"
7648 "{\n"
7649 "    pthread_t thread;\n"
7650 "    sigset_t set;\n"
7651 "    int s;\n"
7652
7653 #. type: Plain text
7654 #: build/C/man3/pthread_sigmask.3:115
7655 #, no-wrap
7656 msgid ""
7657 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
7658 "       will inherit a copy of the signal mask. */\n"
7659 msgstr ""
7660 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
7661 "       will inherit a copy of the signal mask. */\n"
7662
7663 #. type: Plain text
7664 #: build/C/man3/pthread_sigmask.3:122
7665 #, no-wrap
7666 msgid ""
7667 "    sigemptyset(&set);\n"
7668 "    sigaddset(&set, SIGQUIT);\n"
7669 "    sigaddset(&set, SIGUSR1);\n"
7670 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
7671 "    if (s != 0)\n"
7672 "        handle_error_en(s, \"pthread_sigmask\");\n"
7673 msgstr ""
7674 "    sigemptyset(&set);\n"
7675 "    sigaddset(&set, SIGQUIT);\n"
7676 "    sigaddset(&set, SIGUSR1);\n"
7677 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
7678 "    if (s != 0)\n"
7679 "        handle_error_en(s, \"pthread_sigmask\");\n"
7680
7681 #. type: Plain text
7682 #: build/C/man3/pthread_sigmask.3:126
7683 #, no-wrap
7684 msgid ""
7685 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
7686 "    if (s != 0)\n"
7687 "        handle_error_en(s, \"pthread_create\");\n"
7688 msgstr ""
7689 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
7690 "    if (s != 0)\n"
7691 "        handle_error_en(s, \"pthread_create\");\n"
7692
7693 #. type: Plain text
7694 #: build/C/man3/pthread_sigmask.3:129
7695 #, no-wrap
7696 msgid ""
7697 "    /* Main thread carries on to create other threads and/or do\n"
7698 "       other work */\n"
7699 msgstr ""
7700 "    /* Main thread carries on to create other threads and/or do\n"
7701 "       other work */\n"
7702
7703 #. type: Plain text
7704 #: build/C/man3/pthread_sigmask.3:132
7705 #, no-wrap
7706 msgid ""
7707 "    pause();            /* Dummy pause so we can test program */\n"
7708 "}\n"
7709 msgstr ""
7710 "    pause();            /* Dummy pause so we can test program */\n"
7711 "}\n"
7712
7713 #. type: Plain text
7714 #: build/C/man3/pthread_sigmask.3:142
7715 msgid ""
7716 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), "
7717 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
7718 msgstr "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
7719
7720 #. type: TH
7721 #: build/C/man3/pthread_sigqueue.3:23
7722 #, no-wrap
7723 msgid "PTHREAD_SIGQUEUE"
7724 msgstr "PTHREAD_SIGQUEUE"
7725
7726 #. type: TH
7727 #: build/C/man3/pthread_sigqueue.3:23
7728 #, no-wrap
7729 msgid "2011-09-23"
7730 msgstr "2011-09-23"
7731
7732 #. type: Plain text
7733 #: build/C/man3/pthread_sigqueue.3:26
7734 msgid "pthread_sigqueue - queue a signal and data to a thread"
7735 msgstr ""
7736
7737 #. type: Plain text
7738 #: build/C/man3/pthread_sigqueue.3:32
7739 #, no-wrap
7740 msgid ""
7741 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
7742 "B<                     const union sigval >I<value>B<);>\n"
7743 msgstr ""
7744 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
7745 "B<                     const union sigval >I<value>B<);>\n"
7746
7747 #. type: Plain text
7748 #: build/C/man3/pthread_sigqueue.3:43
7749 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
7750 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
7751
7752 #. type: Plain text
7753 #: build/C/man3/pthread_sigqueue.3:51
7754 msgid ""
7755 "The B<pthread_sigqueue>()  function performs a similar task to B<sigqueue>"
7756 "(3), but, rather than sending a signal to another process, it sends a signal "
7757 "to another thread in the same process as the calling thread."
7758 msgstr ""
7759
7760 #. type: Plain text
7761 #: build/C/man3/pthread_sigqueue.3:63
7762 msgid ""
7763 "The I<thread> argument is the ID of another thread in the same process as "
7764 "the caller.  The I<sig> argument specifies the signal to be sent.  The "
7765 "I<value> argument specifies data to accompany the signal; see B<sigqueue>"
7766 "(3)  for details."
7767 msgstr ""
7768
7769 #. type: Plain text
7770 #: build/C/man3/pthread_sigqueue.3:68
7771 msgid ""
7772 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
7773 "number."
7774 msgstr ""
7775
7776 #. type: Plain text
7777 #: build/C/man3/pthread_sigqueue.3:75
7778 msgid ""
7779 "The limit of signals which may be queued has been reached.  (See B<signal>"
7780 "(7)  for further information.)"
7781 msgstr ""
7782
7783 #. type: Plain text
7784 #: build/C/man3/pthread_sigqueue.3:79
7785 msgid "I<sig> was invalid."
7786 msgstr ""
7787
7788 #. type: TP
7789 #: build/C/man3/pthread_sigqueue.3:79
7790 #, no-wrap
7791 msgid "B<ENOSYS>"
7792 msgstr "B<ENOSYS>"
7793
7794 #. type: Plain text
7795 #: build/C/man3/pthread_sigqueue.3:83
7796 msgid "B<pthread_sigqueue>()  is not supported on this system."
7797 msgstr ""
7798
7799 #. type: Plain text
7800 #: build/C/man3/pthread_sigqueue.3:87
7801 msgid "I<thread> is not valid."
7802 msgstr ""
7803
7804 #. type: Plain text
7805 #: build/C/man3/pthread_sigqueue.3:91
7806 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
7807 msgstr ""
7808
7809 #. type: Plain text
7810 #: build/C/man3/pthread_sigqueue.3:93
7811 msgid "This function is a GNU extension."
7812 msgstr ""
7813
7814 #. type: Plain text
7815 #: build/C/man3/pthread_sigqueue.3:101
7816 msgid ""
7817 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<sigqueue>(3), B<sigwait>(3), "
7818 "B<pthread_sigmask>(3), B<pthreads>(7), B<signal>(7)"
7819 msgstr "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<sigqueue>(3), B<sigwait>(3), B<pthread_sigmask>(3), B<pthreads>(7), B<signal>(7)"
7820
7821 #. type: TH
7822 #: build/C/man3/pthread_testcancel.3:24
7823 #, no-wrap
7824 msgid "PTHREAD_TESTCANCEL"
7825 msgstr "PTHREAD_TESTCANCEL"
7826
7827 #. type: Plain text
7828 #: build/C/man3/pthread_testcancel.3:27
7829 msgid ""
7830 "pthread_testcancel - request delivery of any pending cancellation request"
7831 msgstr ""
7832
7833 #. type: Plain text
7834 #: build/C/man3/pthread_testcancel.3:32
7835 #, no-wrap
7836 msgid "B<void pthread_testcancel(void);>\n"
7837 msgstr "B<void pthread_testcancel(void);>\n"
7838
7839 #. type: Plain text
7840 #: build/C/man3/pthread_testcancel.3:40
7841 msgid ""
7842 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
7843 "calling thread, so that a thread that is otherwise executing code that "
7844 "contains no cancellation points will respond to a cancellation request."
7845 msgstr ""
7846
7847 #. type: Plain text
7848 #: build/C/man3/pthread_testcancel.3:47
7849 msgid ""
7850 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
7851 "cancellation request is pending, then a call to B<pthread_cancel>(3)  has no "
7852 "effect."
7853 msgstr ""
7854
7855 #. type: Plain text
7856 #: build/C/man3/pthread_testcancel.3:51
7857 msgid ""
7858 "This function does not return a value.  If the calling thread is canceled as "
7859 "a consequence of a call to this function, then the function does not return."
7860 msgstr ""
7861
7862 #. type: Plain text
7863 #: build/C/man3/pthread_testcancel.3:60
7864 msgid "See B<pthread_cleanup_push>(3)."
7865 msgstr ""
7866
7867 #. type: Plain text
7868 #: build/C/man3/pthread_testcancel.3:65
7869 msgid ""
7870 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
7871 "(3), B<pthreads>(7)"
7872 msgstr "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>(3), B<pthreads>(7)"
7873
7874 #. type: TH
7875 #: build/C/man3/pthread_tryjoin_np.3:24
7876 #, no-wrap
7877 msgid "PTHREAD_TRYJOIN_NP"
7878 msgstr "PTHREAD_TRYJOIN_NP"
7879
7880 #. type: Plain text
7881 #: build/C/man3/pthread_tryjoin_np.3:28
7882 msgid ""
7883 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
7884 "thread"
7885 msgstr ""
7886
7887 #. type: Plain text
7888 #: build/C/man3/pthread_tryjoin_np.3:34
7889 #, no-wrap
7890 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
7891 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
7892
7893 #. type: Plain text
7894 #: build/C/man3/pthread_tryjoin_np.3:37
7895 #, no-wrap
7896 msgid ""
7897 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
7898 "B<                         const struct timespec *>I<abstime>B<);>\n"
7899 msgstr ""
7900 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
7901 "B<                         const struct timespec *>I<abstime>B<);>\n"
7902
7903 #. type: Plain text
7904 #: build/C/man3/pthread_tryjoin_np.3:44
7905 msgid ""
7906 "These functions operate in the same way as B<pthread_join>(3), except for "
7907 "the differences described on this page."
7908 msgstr ""
7909
7910 #. type: Plain text
7911 #: build/C/man3/pthread_tryjoin_np.3:56
7912 msgid ""
7913 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
7914 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
7915 "I<thread> has not yet terminated, then instead of blocking, as is done by "
7916 "B<pthread_join>(3), the call returns an error."
7917 msgstr ""
7918
7919 #. type: Plain text
7920 #: build/C/man3/pthread_tryjoin_np.3:74
7921 msgid ""
7922 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
7923 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
7924 "specified in I<abstime>.  If the timeout expires before I<thread> "
7925 "terminates, the call returns an error.  The I<abstime> argument is a "
7926 "structure of the following form, specifying an absolute time measured since "
7927 "the Epoch (see B<time>(2)):"
7928 msgstr ""
7929
7930 #. type: Plain text
7931 #: build/C/man3/pthread_tryjoin_np.3:81
7932 #, no-wrap
7933 msgid ""
7934 "struct timespec {\n"
7935 "    time_t tv_sec;     /* seconds */\n"
7936 "    long   tv_nsec;    /* nanoseconds */\n"
7937 "};\n"
7938 msgstr ""
7939 "struct timespec {\n"
7940 "    time_t tv_sec;     /* seconds */\n"
7941 "    long   tv_nsec;    /* nanoseconds */\n"
7942 "};\n"
7943
7944 #. type: Plain text
7945 #: build/C/man3/pthread_tryjoin_np.3:87
7946 msgid ""
7947 "On success, these functions return 0; on error, they return an error number."
7948 msgstr ""
7949
7950 #. type: Plain text
7951 #: build/C/man3/pthread_tryjoin_np.3:92
7952 msgid ""
7953 "These functions can fail with the same errors as B<pthread_join>(3).  "
7954 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
7955 msgstr ""
7956
7957 #. type: TP
7958 #: build/C/man3/pthread_tryjoin_np.3:92
7959 #, no-wrap
7960 msgid "B<EBUSY>"
7961 msgstr "B<EBUSY>"
7962
7963 #. type: Plain text
7964 #: build/C/man3/pthread_tryjoin_np.3:96
7965 msgid "I<thread> had not yet terminated at the time of the call."
7966 msgstr ""
7967
7968 #. type: Plain text
7969 #: build/C/man3/pthread_tryjoin_np.3:99
7970 msgid ""
7971 "B<pthread_timedjoin_np>()  can in addition fail with the following error:"
7972 msgstr ""
7973
7974 #. type: TP
7975 #: build/C/man3/pthread_tryjoin_np.3:99
7976 #, no-wrap
7977 msgid "B<ETIMEDOUT>"
7978 msgstr "B<ETIMEDOUT>"
7979
7980 #. type: Plain text
7981 #: build/C/man3/pthread_tryjoin_np.3:104
7982 msgid "The call timed out before I<thread> terminated."
7983 msgstr ""
7984
7985 #. type: Plain text
7986 #: build/C/man3/pthread_tryjoin_np.3:108
7987 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
7988 msgstr ""
7989
7990 #. type: Plain text
7991 #: build/C/man3/pthread_tryjoin_np.3:110
7992 msgid "These functions first appeared in glibc in version 2.3.3."
7993 msgstr ""
7994
7995 #. type: Plain text
7996 #: build/C/man3/pthread_tryjoin_np.3:115
7997 msgid "The following code waits to join for up to 5 seconds:"
7998 msgstr ""
7999
8000 #. type: Plain text
8001 #: build/C/man3/pthread_tryjoin_np.3:119
8002 #, no-wrap
8003 msgid ""
8004 "    struct timespec ts;\n"
8005 "    int s;\n"
8006 msgstr ""
8007 "    struct timespec ts;\n"
8008 "    int s;\n"
8009
8010 #. type: Plain text
8011 #: build/C/man3/pthread_tryjoin_np.3:121
8012 #, no-wrap
8013 msgid "    ...\n"
8014 msgstr "    ...\n"
8015
8016 #. type: Plain text
8017 #: build/C/man3/pthread_tryjoin_np.3:125
8018 #, no-wrap
8019 msgid ""
8020 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8021 "\t/* Handle error */\n"
8022 "    }\n"
8023 msgstr ""
8024 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8025 "\t/* Handle error */\n"
8026 "    }\n"
8027
8028 #. type: Plain text
8029 #: build/C/man3/pthread_tryjoin_np.3:127
8030 #, no-wrap
8031 msgid "    ts.tv_sec += 5;\n"
8032 msgstr "    ts.tv_sec += 5;\n"
8033
8034 #. type: Plain text
8035 #: build/C/man3/pthread_tryjoin_np.3:132
8036 #, no-wrap
8037 msgid ""
8038 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8039 "    if (s != 0) {\n"
8040 "        /* Handle error */\n"
8041 "    }\n"
8042 msgstr ""
8043 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8044 "    if (s != 0) {\n"
8045 "        /* Handle error */\n"
8046 "    }\n"
8047
8048 #. type: Plain text
8049 #: build/C/man3/pthread_tryjoin_np.3:138
8050 msgid ""
8051 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8052 msgstr "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8053
8054 #. type: TH
8055 #: build/C/man3/pthread_yield.3:23
8056 #, no-wrap
8057 msgid "PTHREAD_YIELD"
8058 msgstr "PTHREAD_YIELD"
8059
8060 #. type: Plain text
8061 #: build/C/man3/pthread_yield.3:26
8062 msgid "pthread_yield - yield the processor"
8063 msgstr ""
8064
8065 #. type: Plain text
8066 #: build/C/man3/pthread_yield.3:31
8067 #, no-wrap
8068 msgid "B<int pthread_yield(void);>\n"
8069 msgstr "B<int pthread_yield(void);>\n"
8070
8071 #. type: Plain text
8072 #: build/C/man3/pthread_yield.3:41
8073 msgid ""
8074 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
8075 "thread is placed at the end of the run queue for its static priority and "
8076 "another thread is scheduled to run.  For further details, see B<sched_yield>"
8077 "(2)"
8078 msgstr ""
8079
8080 #. type: Plain text
8081 #: build/C/man3/pthread_yield.3:46
8082 msgid ""
8083 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
8084 "number."
8085 msgstr ""
8086
8087 #. type: Plain text
8088 #: build/C/man3/pthread_yield.3:50
8089 msgid ""
8090 "On Linux, this call always succeeds (but portable and future-proof "
8091 "applications should nevertheless handle a possible error return)."
8092 msgstr ""
8093
8094 #.  e.g., the BSDs, Tru64, AIX, and Irix.
8095 #. type: Plain text
8096 #: build/C/man3/pthread_yield.3:56
8097 msgid ""
8098 "This call is nonstandard, but present on several other systems.  Use the "
8099 "standardized B<sched_yield>(2)  instead."
8100 msgstr ""
8101
8102 #. type: Plain text
8103 #: build/C/man3/pthread_yield.3:59
8104 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
8105 msgstr ""
8106
8107 #. type: Plain text
8108 #: build/C/man3/pthread_yield.3:63
8109 msgid "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
8110 msgstr "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
8111
8112 #. type: TH
8113 #: build/C/man7/pthreads.7:24
8114 #, no-wrap
8115 msgid "PTHREADS"
8116 msgstr "PTHREADS"
8117
8118 #. type: TH
8119 #: build/C/man7/pthreads.7:24
8120 #, no-wrap
8121 msgid "2010-11-14"
8122 msgstr "2010-11-14"
8123
8124 #. type: Plain text
8125 #: build/C/man7/pthreads.7:27
8126 msgid "pthreads - POSIX threads"
8127 msgstr "pthreads - POSIX スレッド"
8128
8129 #. type: Plain text
8130 #: build/C/man7/pthreads.7:34
8131 msgid ""
8132 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
8133 "programming commonly known as POSIX threads, or Pthreads.  A single process "
8134 "can contain multiple threads, all of which are executing the same program.  "
8135 "These threads share the same global memory (data and heap segments), but "
8136 "each thread has its own stack (automatic variables)."
8137 msgstr ""
8138 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
8139 "ラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロ"
8140 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
8141 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
8142 "スレッドは自分専用のスタック (自動変数) を持つ。"
8143
8144 #. type: Plain text
8145 #: build/C/man7/pthreads.7:37
8146 msgid ""
8147 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
8148 "these attributes are process-wide rather than per-thread):"
8149 msgstr ""
8150 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
8151 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
8152
8153 #. type: IP
8154 #: build/C/man7/pthreads.7:37 build/C/man7/pthreads.7:39
8155 #: build/C/man7/pthreads.7:41 build/C/man7/pthreads.7:43
8156 #: build/C/man7/pthreads.7:45 build/C/man7/pthreads.7:47
8157 #: build/C/man7/pthreads.7:49 build/C/man7/pthreads.7:52
8158 #: build/C/man7/pthreads.7:54 build/C/man7/pthreads.7:57
8159 #: build/C/man7/pthreads.7:63 build/C/man7/pthreads.7:68
8160 #: build/C/man7/pthreads.7:71 build/C/man7/pthreads.7:74
8161 #: build/C/man7/pthreads.7:82 build/C/man7/pthreads.7:86
8162 #: build/C/man7/pthreads.7:89 build/C/man7/pthreads.7:93
8163 #: build/C/man7/pthreads.7:96 build/C/man7/pthreads.7:103
8164 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
8165 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
8166 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
8167 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
8168 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
8169 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
8170 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
8171 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
8172 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
8173 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
8174 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
8175 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
8176 #: build/C/man7/pthreads.7:833
8177 #, no-wrap
8178 msgid "-"
8179 msgstr "-"
8180
8181 #. type: Plain text
8182 #: build/C/man7/pthreads.7:39
8183 msgid "process ID"
8184 msgstr "プロセス ID"
8185
8186 #. type: Plain text
8187 #: build/C/man7/pthreads.7:41
8188 msgid "parent process ID"
8189 msgstr "親プロセス ID"
8190
8191 #. type: Plain text
8192 #: build/C/man7/pthreads.7:43
8193 msgid "process group ID and session ID"
8194 msgstr "プロセスグループ ID とセッション ID"
8195
8196 #. type: Plain text
8197 #: build/C/man7/pthreads.7:45
8198 msgid "controlling terminal"
8199 msgstr "制御端末"
8200
8201 #. type: Plain text
8202 #: build/C/man7/pthreads.7:47
8203 msgid "user and group IDs"
8204 msgstr "ユーザ ID とグループ ID"
8205
8206 #. type: Plain text
8207 #: build/C/man7/pthreads.7:49
8208 msgid "open file descriptors"
8209 msgstr "オープンするファイルディスクリプタ"
8210
8211 #. type: Plain text
8212 #: build/C/man7/pthreads.7:52
8213 msgid "record locks (see B<fcntl>(2))"
8214 msgstr "レコードのロック (B<fcntl>(3)  参照)"
8215
8216 #. type: Plain text
8217 #: build/C/man7/pthreads.7:54
8218 msgid "signal dispositions"
8219 msgstr "シグナルの配置"
8220
8221 #. type: Plain text
8222 #: build/C/man7/pthreads.7:57
8223 msgid "file mode creation mask (B<umask>(2))"
8224 msgstr "ファイルモード作成マスク (B<umask>(2))"
8225
8226 #. type: Plain text
8227 #: build/C/man7/pthreads.7:63
8228 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
8229 msgstr ""
8230 "カレント・ディレクトリ (B<chdir>(2))  とルート・ディレクトリ (B<chroot>(2))"
8231
8232 #. type: Plain text
8233 #: build/C/man7/pthreads.7:68
8234 msgid ""
8235 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
8236 msgstr ""
8237 "インターバル・タイマ (B<setitimer>(2))  と POSIX タイマ (B<timer_create>(2))"
8238
8239 #. type: Plain text
8240 #: build/C/man7/pthreads.7:71
8241 msgid "nice value (B<setpriority>(2))"
8242 msgstr "nice 値 (B<setpriority>(2))"
8243
8244 #. type: Plain text
8245 #: build/C/man7/pthreads.7:74
8246 msgid "resource limits (B<setrlimit>(2))"
8247 msgstr "リソース制限 (B<setrlimit>(2))"
8248
8249 #. type: Plain text
8250 #: build/C/man7/pthreads.7:79
8251 msgid ""
8252 "measurements of the consumption of CPU time (B<times>(2))  and resources "
8253 "(B<getrusage>(2))"
8254 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
8255
8256 #. type: Plain text
8257 #: build/C/man7/pthreads.7:82
8258 msgid ""
8259 "As well as the stack, POSIX.1 specifies that various other attributes are "
8260 "distinct for each thread, including:"
8261 msgstr ""
8262 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
8263 "るかを規定している:"
8264
8265 #. type: Plain text
8266 #: build/C/man7/pthreads.7:86
8267 msgid "thread ID (the I<pthread_t> data type)"
8268 msgstr "スレッド ID (B<pthread_t> データ型)"
8269
8270 #. type: Plain text
8271 #: build/C/man7/pthreads.7:89
8272 msgid "signal mask (B<pthread_sigmask>(3))"
8273 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
8274
8275 #. type: Plain text
8276 #: build/C/man7/pthreads.7:93
8277 msgid "the I<errno> variable"
8278 msgstr "I<errno> 変数"
8279
8280 #. type: Plain text
8281 #: build/C/man7/pthreads.7:96
8282 msgid "alternate signal stack (B<sigaltstack>(2))"
8283 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
8284
8285 #. type: Plain text
8286 #: build/C/man7/pthreads.7:101
8287 msgid ""
8288 "real-time scheduling policy and priority (B<sched_setscheduler>(2)  and "
8289 "B<sched_setparam>(2))"
8290 msgstr ""
8291 "リアルタイム・スケジューリングのポリシーと優先度 (B<sched_setscheduler>(2)  "
8292 "と B<sched_setparam>(2))"
8293
8294 #. type: Plain text
8295 #: build/C/man7/pthreads.7:103
8296 msgid "The following Linux-specific features are also per-thread:"
8297 msgstr "以下の Linux 特有の機能もスレッド単位である:"
8298
8299 #. type: Plain text
8300 #: build/C/man7/pthreads.7:106
8301 msgid "capabilities (see B<capabilities>(7))"
8302 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
8303
8304 #. type: Plain text
8305 #: build/C/man7/pthreads.7:109
8306 msgid "CPU affinity (B<sched_setaffinity>(2))"
8307 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
8308
8309 #. type: SS
8310 #: build/C/man7/pthreads.7:109
8311 #, no-wrap
8312 msgid "Pthreads function return values"
8313 msgstr "pthreads 関数の返り値"
8314
8315 #. type: Plain text
8316 #: build/C/man7/pthreads.7:116
8317 msgid ""
8318 "Most pthreads functions return 0 on success, and an error number of "
8319 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
8320 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
8321 "the function can never fail with the error B<EINTR>."
8322 msgstr ""
8323 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
8324 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
8325 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
8326 "は決してないと規定している。"
8327
8328 #. type: SS
8329 #: build/C/man7/pthreads.7:116
8330 #, no-wrap
8331 msgid "Thread IDs"
8332 msgstr "スレッド ID"
8333
8334 #. type: Plain text
8335 #: build/C/man7/pthreads.7:130
8336 msgid ""
8337 "Each of the threads in a process has a unique thread identifier (stored in "
8338 "the type I<pthread_t>).  This identifier is returned to the caller of "
8339 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
8340 "using B<pthread_self>(3).  Thread IDs are only guaranteed to be unique "
8341 "within a process.  A thread ID may be reused after a terminated thread has "
8342 "been joined, or a detached thread has terminated.  In all pthreads functions "
8343 "that accept a thread ID as an argument, that ID by definition refers to a "
8344 "thread in the same process as the caller."
8345 msgstr ""
8346 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
8347 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
8348 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
8349 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
8350 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
8351 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
8352 "じプロセス内の一つのスレッドを参照する。"
8353
8354 #. type: SS
8355 #: build/C/man7/pthreads.7:130
8356 #, no-wrap
8357 msgid "Thread-safe functions"
8358 msgstr "スレッドセーフな関数"
8359
8360 #. type: Plain text
8361 #: build/C/man7/pthreads.7:134
8362 msgid ""
8363 "A thread-safe function is one that can be safely (i.e., it will deliver the "
8364 "same results regardless of whether it is)  called from multiple threads at "
8365 "the same time."
8366 msgstr ""
8367 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
8368 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
8369
8370 #. type: Plain text
8371 #: build/C/man7/pthreads.7:138
8372 msgid ""
8373 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
8374 "standard shall be thread-safe, except for the following functions:"
8375 msgstr ""
8376 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
8377 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
8378
8379 #. type: Plain text
8380 #: build/C/man7/pthreads.7:232
8381 #, no-wrap
8382 msgid ""
8383 "asctime()\n"
8384 "basename()\n"
8385 "catgets()\n"
8386 "crypt()\n"
8387 "ctermid() if passed a non-NULL argument\n"
8388 "ctime()\n"
8389 "dbm_clearerr()\n"
8390 "dbm_close()\n"
8391 "dbm_delete()\n"
8392 "dbm_error()\n"
8393 "dbm_fetch()\n"
8394 "dbm_firstkey()\n"
8395 "dbm_nextkey()\n"
8396 "dbm_open()\n"
8397 "dbm_store()\n"
8398 "dirname()\n"
8399 "dlerror()\n"
8400 "drand48()\n"
8401 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8402 "encrypt()\n"
8403 "endgrent()\n"
8404 "endpwent()\n"
8405 "endutxent()\n"
8406 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8407 "ftw()\n"
8408 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8409 "getc_unlocked()\n"
8410 "getchar_unlocked()\n"
8411 "getdate()\n"
8412 "getenv()\n"
8413 "getgrent()\n"
8414 "getgrgid()\n"
8415 "getgrnam()\n"
8416 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8417 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8418 "gethostent()\n"
8419 "getlogin()\n"
8420 "getnetbyaddr()\n"
8421 "getnetbyname()\n"
8422 "getnetent()\n"
8423 "getopt()\n"
8424 "getprotobyname()\n"
8425 "getprotobynumber()\n"
8426 "getprotoent()\n"
8427 "getpwent()\n"
8428 "getpwnam()\n"
8429 "getpwuid()\n"
8430 "getservbyname()\n"
8431 "getservbyport()\n"
8432 "getservent()\n"
8433 "getutxent()\n"
8434 "getutxid()\n"
8435 "getutxline()\n"
8436 "gmtime()\n"
8437 "hcreate()\n"
8438 "hdestroy()\n"
8439 "hsearch()\n"
8440 "inet_ntoa()\n"
8441 "l64a()\n"
8442 "lgamma()\n"
8443 "lgammaf()\n"
8444 "lgammal()\n"
8445 "localeconv()\n"
8446 "localtime()\n"
8447 "lrand48()\n"
8448 "mrand48()\n"
8449 "nftw()\n"
8450 "nl_langinfo()\n"
8451 "ptsname()\n"
8452 "putc_unlocked()\n"
8453 "putchar_unlocked()\n"
8454 "putenv()\n"
8455 "pututxline()\n"
8456 "rand()\n"
8457 "readdir()\n"
8458 "setenv()\n"
8459 "setgrent()\n"
8460 "setkey()\n"
8461 "setpwent()\n"
8462 "setutxent()\n"
8463 "strerror()\n"
8464 "strsignal() [Added in POSIX.1-2008]\n"
8465 "strtok()\n"
8466 "system() [Added in POSIX.1-2008]\n"
8467 "tmpnam() if passed a non-NULL argument\n"
8468 "ttyname()\n"
8469 "unsetenv()\n"
8470 "wcrtomb() if its final argument is NULL\n"
8471 "wcsrtombs() if its final argument is NULL\n"
8472 "wcstombs()\n"
8473 "wctomb()\n"
8474 msgstr ""
8475 "asctime()\n"
8476 "basename()\n"
8477 "catgets()\n"
8478 "crypt()\n"
8479 "ctermid() (NULL でない引き数を渡された場合)\n"
8480 "ctime()\n"
8481 "dbm_clearerr()\n"
8482 "dbm_close()\n"
8483 "dbm_delete()\n"
8484 "dbm_error()\n"
8485 "dbm_fetch()\n"
8486 "dbm_firstkey()\n"
8487 "dbm_nextkey()\n"
8488 "dbm_open()\n"
8489 "dbm_store()\n"
8490 "dirname()\n"
8491 "dlerror()\n"
8492 "drand48()\n"
8493 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8494 "encrypt()\n"
8495 "endgrent()\n"
8496 "endpwent()\n"
8497 "endutxent()\n"
8498 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8499 "ftw()\n"
8500 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8501 "getc_unlocked()\n"
8502 "getchar_unlocked()\n"
8503 "getdate()\n"
8504 "getenv()\n"
8505 "getgrent()\n"
8506 "getgrgid()\n"
8507 "getgrnam()\n"
8508 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8509 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8510 "gethostent()\n"
8511 "getlogin()\n"
8512 "getnetbyaddr()\n"
8513 "getnetbyname()\n"
8514 "getnetent()\n"
8515 "getopt()\n"
8516 "getprotobyname()\n"
8517 "getprotobynumber()\n"
8518 "getprotoent()\n"
8519 "getpwent()\n"
8520 "getpwnam()\n"
8521 "getpwuid()\n"
8522 "getservbyname()\n"
8523 "getservbyport()\n"
8524 "getservent()\n"
8525 "getutxent()\n"
8526 "getutxid()\n"
8527 "getutxline()\n"
8528 "gmtime()\n"
8529 "hcreate()\n"
8530 "hdestroy()\n"
8531 "hsearch()\n"
8532 "inet_ntoa()\n"
8533 "l64a()\n"
8534 "lgamma()\n"
8535 "lgammaf()\n"
8536 "lgammal()\n"
8537 "localeconv()\n"
8538 "localtime()\n"
8539 "lrand48()\n"
8540 "mrand48()\n"
8541 "nftw()\n"
8542 "nl_langinfo()\n"
8543 "ptsname()\n"
8544 "putc_unlocked()\n"
8545 "putchar_unlocked()\n"
8546 "putenv()\n"
8547 "pututxline()\n"
8548 "rand()\n"
8549 "readdir()\n"
8550 "setenv()\n"
8551 "setgrent()\n"
8552 "setkey()\n"
8553 "setpwent()\n"
8554 "setutxent()\n"
8555 "strerror()\n"
8556 "strsignal() [POSIX.1-2008 で追加された]\n"
8557 "strtok()\n"
8558 "system() [POSIX.1-2008 で追加された]\n"
8559 "tmpnam() (NULL でない引き数を渡された場合)\n"
8560 "ttyname()\n"
8561 "unsetenv()\n"
8562 "wcrtomb() (最後の引き数が NULL の場合)\n"
8563 "wcsrtombs() (最後の引き数が NULL の場合)\n"
8564 "wcstombs()\n"
8565 "wctomb()\n"
8566
8567 #. type: SS
8568 #: build/C/man7/pthreads.7:234
8569 #, fuzzy, no-wrap
8570 #| msgid "Thread-safe functions"
8571 msgid "Async-cancel-safe functions"
8572 msgstr "スレッドセーフな関数"
8573
8574 #. type: Plain text
8575 #: build/C/man7/pthreads.7:238
8576 msgid ""
8577 "An async-cancel-safe function is one that can be safely called in an "
8578 "application where asynchronous cancelability is enabled (see "
8579 "B<pthread_setcancelstate>(3))."
8580 msgstr ""
8581
8582 #. type: Plain text
8583 #: build/C/man7/pthreads.7:241
8584 #, fuzzy
8585 #| msgid ""
8586 #| "The following functions are required to be cancellation points by "
8587 #| "POSIX.1-2001 and/or POSIX.1-2008:"
8588 msgid ""
8589 "Only the following functions are required to be async-cancel-safe by "
8590 "POSIX.1-2001 and POSIX.1-2008:"
8591 msgstr ""
8592 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
8593 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
8594
8595 #. type: Plain text
8596 #: build/C/man7/pthreads.7:247
8597 #, no-wrap
8598 msgid ""
8599 "pthread_cancel()\n"
8600 "pthread_setcancelstate()\n"
8601 "pthread_setcanceltype()\n"
8602 msgstr ""
8603 "pthread_cancel()\n"
8604 "pthread_setcancelstate()\n"
8605 "pthread_setcanceltype()\n"
8606
8607 #. type: SS
8608 #: build/C/man7/pthreads.7:249
8609 #, no-wrap
8610 msgid "Cancellation Points"
8611 msgstr "取り消しポイント (cancellation points)"
8612
8613 #. type: Plain text
8614 #: build/C/man7/pthreads.7:256
8615 msgid ""
8616 "POSIX.1 specifies that certain functions must, and certain other functions "
8617 "may, be cancellation points.  If a thread is cancelable, its cancelability "
8618 "type is deferred, and a cancellation request is pending for the thread, then "
8619 "the thread is canceled when it calls a function that is a cancellation point."
8620 msgstr ""
8621 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
8622 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
8623 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
8624 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
8625 "時点で、そのスレッドのキャンセルが 行われる。"
8626
8627 #. type: Plain text
8628 #: build/C/man7/pthreads.7:259
8629 msgid ""
8630 "The following functions are required to be cancellation points by "
8631 "POSIX.1-2001 and/or POSIX.1-2008:"
8632 msgstr ""
8633 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
8634 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
8635
8636 #. type: Plain text
8637 #: build/C/man7/pthreads.7:322
8638 #, no-wrap
8639 msgid ""
8640 "accept()\n"
8641 "aio_suspend()\n"
8642 "clock_nanosleep()\n"
8643 "close()\n"
8644 "connect()\n"
8645 "creat()\n"
8646 "fcntl() F_SETLKW\n"
8647 "fdatasync()\n"
8648 "fsync()\n"
8649 "getmsg()\n"
8650 "getpmsg()\n"
8651 "lockf() F_LOCK\n"
8652 "mq_receive()\n"
8653 "mq_send()\n"
8654 "mq_timedreceive()\n"
8655 "mq_timedsend()\n"
8656 "msgrcv()\n"
8657 "msgsnd()\n"
8658 "msync()\n"
8659 "nanosleep()\n"
8660 "open()\n"
8661 "openat() [Added in POSIX.1-2008]\n"
8662 "pause()\n"
8663 "poll()\n"
8664 "pread()\n"
8665 "pselect()\n"
8666 "pthread_cond_timedwait()\n"
8667 "pthread_cond_wait()\n"
8668 "pthread_join()\n"
8669 "pthread_testcancel()\n"
8670 "putmsg()\n"
8671 "putpmsg()\n"
8672 "pwrite()\n"
8673 "read()\n"
8674 "readv()\n"
8675 "recv()\n"
8676 "recvfrom()\n"
8677 "recvmsg()\n"
8678 "select()\n"
8679 "sem_timedwait()\n"
8680 "sem_wait()\n"
8681 "send()\n"
8682 "sendmsg()\n"
8683 "sendto()\n"
8684 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
8685 "sigsuspend()\n"
8686 "sigtimedwait()\n"
8687 "sigwait()\n"
8688 "sigwaitinfo()\n"
8689 "sleep()\n"
8690 "system()\n"
8691 "tcdrain()\n"
8692 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8693 "wait()\n"
8694 "waitid()\n"
8695 "waitpid()\n"
8696 "write()\n"
8697 "writev()\n"
8698 msgstr ""
8699 "accept()\n"
8700 "aio_suspend()\n"
8701 "clock_nanosleep()\n"
8702 "close()\n"
8703 "connect()\n"
8704 "creat()\n"
8705 "fcntl() F_SETLKW\n"
8706 "fdatasync()\n"
8707 "fsync()\n"
8708 "getmsg()\n"
8709 "getpmsg()\n"
8710 "lockf() F_LOCK\n"
8711 "mq_receive()\n"
8712 "mq_send()\n"
8713 "mq_timedreceive()\n"
8714 "mq_timedsend()\n"
8715 "msgrcv()\n"
8716 "msgsnd()\n"
8717 "msync()\n"
8718 "nanosleep()\n"
8719 "open()\n"
8720 "openat() [POSIX.1-2008 で追加された]\n"
8721 "pause()\n"
8722 "poll()\n"
8723 "pread()\n"
8724 "pselect()\n"
8725 "pthread_cond_timedwait()\n"
8726 "pthread_cond_wait()\n"
8727 "pthread_join()\n"
8728 "pthread_testcancel()\n"
8729 "putmsg()\n"
8730 "putpmsg()\n"
8731 "pwrite()\n"
8732 "read()\n"
8733 "readv()\n"
8734 "recv()\n"
8735 "recvfrom()\n"
8736 "recvmsg()\n"
8737 "select()\n"
8738 "sem_timedwait()\n"
8739 "sem_wait()\n"
8740 "send()\n"
8741 "sendmsg()\n"
8742 "sendto()\n"
8743 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
8744 "sigsuspend()\n"
8745 "sigtimedwait()\n"
8746 "sigwait()\n"
8747 "sigwaitinfo()\n"
8748 "sleep()\n"
8749 "system()\n"
8750 "tcdrain()\n"
8751 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8752 "wait()\n"
8753 "waitid()\n"
8754 "waitpid()\n"
8755 "write()\n"
8756 "writev()\n"
8757
8758 #. type: Plain text
8759 #: build/C/man7/pthreads.7:327
8760 msgid ""
8761 "The following functions may be cancellation points according to POSIX.1-2001 "
8762 "and/or POSIX.1-2008:"
8763 msgstr ""
8764 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
8765 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
8766
8767 #. type: Plain text
8768 #: build/C/man7/pthreads.7:555
8769 #, no-wrap
8770 msgid ""
8771 "access()\n"
8772 "asctime()\n"
8773 "asctime_r()\n"
8774 "catclose()\n"
8775 "catgets()\n"
8776 "catopen()\n"
8777 "chmod() [Added in POSIX.1-2008]\n"
8778 "chown() [Added in POSIX.1-2008]\n"
8779 "closedir()\n"
8780 "closelog()\n"
8781 "ctermid()\n"
8782 "ctime()\n"
8783 "ctime_r()\n"
8784 "dbm_close()\n"
8785 "dbm_delete()\n"
8786 "dbm_fetch()\n"
8787 "dbm_nextkey()\n"
8788 "dbm_open()\n"
8789 "dbm_store()\n"
8790 "dlclose()\n"
8791 "dlopen()\n"
8792 "dprintf() [Added in POSIX.1-2008]\n"
8793 "endgrent()\n"
8794 "endhostent()\n"
8795 "endnetent()\n"
8796 "endprotoent()\n"
8797 "endpwent()\n"
8798 "endservent()\n"
8799 "endutxent()\n"
8800 "faccessat() [Added in POSIX.1-2008]\n"
8801 "fchmod() [Added in POSIX.1-2008]\n"
8802 "fchmodat() [Added in POSIX.1-2008]\n"
8803 "fchown() [Added in POSIX.1-2008]\n"
8804 "fchownat() [Added in POSIX.1-2008]\n"
8805 "fclose()\n"
8806 "fcntl() (for any value of cmd argument)\n"
8807 "fflush()\n"
8808 "fgetc()\n"
8809 "fgetpos()\n"
8810 "fgets()\n"
8811 "fgetwc()\n"
8812 "fgetws()\n"
8813 "fmtmsg()\n"
8814 "fopen()\n"
8815 "fpathconf()\n"
8816 "fprintf()\n"
8817 "fputc()\n"
8818 "fputs()\n"
8819 "fputwc()\n"
8820 "fputws()\n"
8821 "fread()\n"
8822 "freopen()\n"
8823 "fscanf()\n"
8824 "fseek()\n"
8825 "fseeko()\n"
8826 "fsetpos()\n"
8827 "fstat()\n"
8828 "fstatat() [Added in POSIX.1-2008]\n"
8829 "ftell()\n"
8830 "ftello()\n"
8831 "ftw()\n"
8832 "futimens() [Added in POSIX.1-2008]\n"
8833 "fwprintf()\n"
8834 "fwrite()\n"
8835 "fwscanf()\n"
8836 "getaddrinfo()\n"
8837 "getc()\n"
8838 "getc_unlocked()\n"
8839 "getchar()\n"
8840 "getchar_unlocked()\n"
8841 "getcwd()\n"
8842 "getdate()\n"
8843 "getdelim() [Added in POSIX.1-2008]\n"
8844 "getgrent()\n"
8845 "getgrgid()\n"
8846 "getgrgid_r()\n"
8847 "getgrnam()\n"
8848 "getgrnam_r()\n"
8849 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
8850 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
8851 "gethostent()\n"
8852 "gethostid()\n"
8853 "gethostname()\n"
8854 "getline() [Added in POSIX.1-2008]\n"
8855 "getlogin()\n"
8856 "getlogin_r()\n"
8857 "getnameinfo()\n"
8858 "getnetbyaddr()\n"
8859 "getnetbyname()\n"
8860 "getnetent()\n"
8861 "getopt() (if opterr is nonzero)\n"
8862 "getprotobyname()\n"
8863 "getprotobynumber()\n"
8864 "getprotoent()\n"
8865 "getpwent()\n"
8866 "getpwnam()\n"
8867 "getpwnam_r()\n"
8868 "getpwuid()\n"
8869 "getpwuid_r()\n"
8870 "gets()\n"
8871 "getservbyname()\n"
8872 "getservbyport()\n"
8873 "getservent()\n"
8874 "getutxent()\n"
8875 "getutxid()\n"
8876 "getutxline()\n"
8877 "getwc()\n"
8878 "getwchar()\n"
8879 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
8880 "glob()\n"
8881 "iconv_close()\n"
8882 "iconv_open()\n"
8883 "ioctl()\n"
8884 "link()\n"
8885 "linkat() [Added in POSIX.1-2008]\n"
8886 "lio_listio() [Added in POSIX.1-2008]\n"
8887 "localtime()\n"
8888 "localtime_r()\n"
8889 "lockf() [Added in POSIX.1-2008]\n"
8890 "lseek()\n"
8891 "lstat()\n"
8892 "mkdir() [Added in POSIX.1-2008]\n"
8893 "mkdirat() [Added in POSIX.1-2008]\n"
8894 "mkdtemp() [Added in POSIX.1-2008]\n"
8895 "mkfifo() [Added in POSIX.1-2008]\n"
8896 "mkfifoat() [Added in POSIX.1-2008]\n"
8897 "mknod() [Added in POSIX.1-2008]\n"
8898 "mknodat() [Added in POSIX.1-2008]\n"
8899 "mkstemp()\n"
8900 "mktime()\n"
8901 "nftw()\n"
8902 "opendir()\n"
8903 "openlog()\n"
8904 "pathconf()\n"
8905 "pclose()\n"
8906 "perror()\n"
8907 "popen()\n"
8908 "posix_fadvise()\n"
8909 "posix_fallocate()\n"
8910 "posix_madvise()\n"
8911 "posix_openpt()\n"
8912 "posix_spawn()\n"
8913 "posix_spawnp()\n"
8914 "posix_trace_clear()\n"
8915 "posix_trace_close()\n"
8916 "posix_trace_create()\n"
8917 "posix_trace_create_withlog()\n"
8918 "posix_trace_eventtypelist_getnext_id()\n"
8919 "posix_trace_eventtypelist_rewind()\n"
8920 "posix_trace_flush()\n"
8921 "posix_trace_get_attr()\n"
8922 "posix_trace_get_filter()\n"
8923 "posix_trace_get_status()\n"
8924 "posix_trace_getnext_event()\n"
8925 "posix_trace_open()\n"
8926 "posix_trace_rewind()\n"
8927 "posix_trace_set_filter()\n"
8928 "posix_trace_shutdown()\n"
8929 "posix_trace_timedgetnext_event()\n"
8930 "posix_typed_mem_open()\n"
8931 "printf()\n"
8932 "psiginfo() [Added in POSIX.1-2008]\n"
8933 "psignal() [Added in POSIX.1-2008]\n"
8934 "pthread_rwlock_rdlock()\n"
8935 "pthread_rwlock_timedrdlock()\n"
8936 "pthread_rwlock_timedwrlock()\n"
8937 "pthread_rwlock_wrlock()\n"
8938 "putc()\n"
8939 "putc_unlocked()\n"
8940 "putchar()\n"
8941 "putchar_unlocked()\n"
8942 "puts()\n"
8943 "pututxline()\n"
8944 "putwc()\n"
8945 "putwchar()\n"
8946 "readdir()\n"
8947 "readdir_r()\n"
8948 "readlink() [Added in POSIX.1-2008]\n"
8949 "readlinkat() [Added in POSIX.1-2008]\n"
8950 "remove()\n"
8951 "rename()\n"
8952 "renameat() [Added in POSIX.1-2008]\n"
8953 "rewind()\n"
8954 "rewinddir()\n"
8955 "scandir() [Added in POSIX.1-2008]\n"
8956 "scanf()\n"
8957 "seekdir()\n"
8958 "semop()\n"
8959 "setgrent()\n"
8960 "sethostent()\n"
8961 "setnetent()\n"
8962 "setprotoent()\n"
8963 "setpwent()\n"
8964 "setservent()\n"
8965 "setutxent()\n"
8966 "sigpause() [Added in POSIX.1-2008]\n"
8967 "stat()\n"
8968 "strerror()\n"
8969 "strerror_r()\n"
8970 "strftime()\n"
8971 "symlink()\n"
8972 "symlinkat() [Added in POSIX.1-2008]\n"
8973 "sync()\n"
8974 "syslog()\n"
8975 "tmpfile()\n"
8976 "tmpnam()\n"
8977 "ttyname()\n"
8978 "ttyname_r()\n"
8979 "tzset()\n"
8980 "ungetc()\n"
8981 "ungetwc()\n"
8982 "unlink()\n"
8983 "unlinkat() [Added in POSIX.1-2008]\n"
8984 "utime() [Added in POSIX.1-2008]\n"
8985 "utimensat() [Added in POSIX.1-2008]\n"
8986 "utimes() [Added in POSIX.1-2008]\n"
8987 "vdprintf() [Added in POSIX.1-2008]\n"
8988 "vfprintf()\n"
8989 "vfwprintf()\n"
8990 "vprintf()\n"
8991 "vwprintf()\n"
8992 "wcsftime()\n"
8993 "wordexp()\n"
8994 "wprintf()\n"
8995 "wscanf()\n"
8996 msgstr ""
8997 "access()\n"
8998 "asctime()\n"
8999 "asctime_r()\n"
9000 "catclose()\n"
9001 "catgets()\n"
9002 "catopen()\n"
9003 "chmod() [POSIX.1-2008 で追加された]\n"
9004 "chown() [POSIX.1-2008 で追加された]\n"
9005 "closedir()\n"
9006 "closelog()\n"
9007 "ctermid()\n"
9008 "ctime()\n"
9009 "ctime_r()\n"
9010 "dbm_close()\n"
9011 "dbm_delete()\n"
9012 "dbm_fetch()\n"
9013 "dbm_nextkey()\n"
9014 "dbm_open()\n"
9015 "dbm_store()\n"
9016 "dlclose()\n"
9017 "dlopen()\n"
9018 "dprintf() [POSIX.1-2008 で追加された]\n"
9019 "endgrent()\n"
9020 "endhostent()\n"
9021 "endnetent()\n"
9022 "endprotoent()\n"
9023 "endpwent()\n"
9024 "endservent()\n"
9025 "endutxent()\n"
9026 "faccessat() [POSIX.1-2008 で追加された]\n"
9027 "fchmod() [POSIX.1-2008 で追加された]\n"
9028 "fchmodat() [POSIX.1-2008 で追加された]\n"
9029 "fchown() [POSIX.1-2008 で追加された]\n"
9030 "fchownat() [POSIX.1-2008 で追加された]\n"
9031 "fclose()\n"
9032 "fcntl() (cmd 引き数が何であっても)\n"
9033 "fflush()\n"
9034 "fgetc()\n"
9035 "fgetpos()\n"
9036 "fgets()\n"
9037 "fgetwc()\n"
9038 "fgetws()\n"
9039 "fmtmsg()\n"
9040 "fopen()\n"
9041 "fpathconf()\n"
9042 "fprintf()\n"
9043 "fputc()\n"
9044 "fputs()\n"
9045 "fputwc()\n"
9046 "fputws()\n"
9047 "fread()\n"
9048 "freopen()\n"
9049 "fscanf()\n"
9050 "fseek()\n"
9051 "fseeko()\n"
9052 "fsetpos()\n"
9053 "fstat()\n"
9054 "fstatat() [POSIX.1-2008 で追加された]\n"
9055 "ftell()\n"
9056 "ftello()\n"
9057 "ftw()\n"
9058 "futimens() [POSIX.1-2008 で追加された]\n"
9059 "fwprintf()\n"
9060 "fwrite()\n"
9061 "fwscanf()\n"
9062 "getaddrinfo()\n"
9063 "getc()\n"
9064 "getc_unlocked()\n"
9065 "getchar()\n"
9066 "getchar_unlocked()\n"
9067 "getcwd()\n"
9068 "getdate()\n"
9069 "getdelim() [POSIX.1-2008 で追加された]\n"
9070 "getgrent()\n"
9071 "getgrgid()\n"
9072 "getgrgid_r()\n"
9073 "getgrnam()\n"
9074 "getgrnam_r()\n"
9075 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9076 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9077 "gethostent()\n"
9078 "gethostid()\n"
9079 "gethostname()\n"
9080 "getline() [POSIX.1-2008 で追加された]\n"
9081 "getlogin()\n"
9082 "getlogin_r()\n"
9083 "getnameinfo()\n"
9084 "getnetbyaddr()\n"
9085 "getnetbyname()\n"
9086 "getnetent()\n"
9087 "getopt() (opterr が 0 以外の場合)\n"
9088 "getprotobyname()\n"
9089 "getprotobynumber()\n"
9090 "getprotoent()\n"
9091 "getpwent()\n"
9092 "getpwnam()\n"
9093 "getpwnam_r()\n"
9094 "getpwuid()\n"
9095 "getpwuid_r()\n"
9096 "gets()\n"
9097 "getservbyname()\n"
9098 "getservbyport()\n"
9099 "getservent()\n"
9100 "getutxent()\n"
9101 "getutxid()\n"
9102 "getutxline()\n"
9103 "getwc()\n"
9104 "getwchar()\n"
9105 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9106 "glob()\n"
9107 "iconv_close()\n"
9108 "iconv_open()\n"
9109 "ioctl()\n"
9110 "link()\n"
9111 "linkat() [POSIX.1-2008 で追加された]\n"
9112 "lio_listio() [POSIX.1-2008 で追加された]\n"
9113 "localtime()\n"
9114 "localtime_r()\n"
9115 "lockf() [POSIX.1-2008 で追加された]\n"
9116 "lseek()\n"
9117 "lstat()\n"
9118 "mkdir() [POSIX.1-2008 で追加された]\n"
9119 "mkdirat() [POSIX.1-2008 で追加された]\n"
9120 "mkdtemp() [POSIX.1-2008 で追加された]\n"
9121 "mkfifo() [POSIX.1-2008 で追加された]\n"
9122 "mkfifoat() [POSIX.1-2008 で追加された]\n"
9123 "mknod() [POSIX.1-2008 で追加された]\n"
9124 "mknodat() [POSIX.1-2008 で追加された]\n"
9125 "mkstemp()\n"
9126 "mktime()\n"
9127 "nftw()\n"
9128 "opendir()\n"
9129 "openlog()\n"
9130 "pathconf()\n"
9131 "pclose()\n"
9132 "perror()\n"
9133 "popen()\n"
9134 "posix_fadvise()\n"
9135 "posix_fallocate()\n"
9136 "posix_madvise()\n"
9137 "posix_openpt()\n"
9138 "posix_spawn()\n"
9139 "posix_spawnp()\n"
9140 "posix_trace_clear()\n"
9141 "posix_trace_close()\n"
9142 "posix_trace_create()\n"
9143 "posix_trace_create_withlog()\n"
9144 "posix_trace_eventtypelist_getnext_id()\n"
9145 "posix_trace_eventtypelist_rewind()\n"
9146 "posix_trace_flush()\n"
9147 "posix_trace_get_attr()\n"
9148 "posix_trace_get_filter()\n"
9149 "posix_trace_get_status()\n"
9150 "posix_trace_getnext_event()\n"
9151 "posix_trace_open()\n"
9152 "posix_trace_rewind()\n"
9153 "posix_trace_set_filter()\n"
9154 "posix_trace_shutdown()\n"
9155 "posix_trace_timedgetnext_event()\n"
9156 "posix_typed_mem_open()\n"
9157 "printf()\n"
9158 "psiginfo() [POSIX.1-2008 で追加された]\n"
9159 "psignal() [POSIX.1-2008 で追加された]\n"
9160 "pthread_rwlock_rdlock()\n"
9161 "pthread_rwlock_timedrdlock()\n"
9162 "pthread_rwlock_timedwrlock()\n"
9163 "pthread_rwlock_wrlock()\n"
9164 "putc()\n"
9165 "putc_unlocked()\n"
9166 "putchar()\n"
9167 "putchar_unlocked()\n"
9168 "puts()\n"
9169 "pututxline()\n"
9170 "putwc()\n"
9171 "putwchar()\n"
9172 "readdir()\n"
9173 "readdir_r()\n"
9174 "readlink() [POSIX.1-2008 で追加された]\n"
9175 "readlinkat() [POSIX.1-2008 で追加された]\n"
9176 "remove()\n"
9177 "rename()\n"
9178 "renameat() [POSIX.1-2008 で追加された]\n"
9179 "rewind()\n"
9180 "rewinddir()\n"
9181 "scandir() [POSIX.1-2008 で追加された]\n"
9182 "scanf()\n"
9183 "seekdir()\n"
9184 "semop()\n"
9185 "setgrent()\n"
9186 "sethostent()\n"
9187 "setnetent()\n"
9188 "setprotoent()\n"
9189 "setpwent()\n"
9190 "setservent()\n"
9191 "setutxent()\n"
9192 "sigpause() [POSIX.1-2008 で追加された]\n"
9193 "stat()\n"
9194 "strerror()\n"
9195 "strerror_r()\n"
9196 "strftime()\n"
9197 "symlink()\n"
9198 "symlinkat() [POSIX.1-2008 で追加された]\n"
9199 "sync()\n"
9200 "syslog()\n"
9201 "tmpfile()\n"
9202 "tmpnam()\n"
9203 "ttyname()\n"
9204 "ttyname_r()\n"
9205 "tzset()\n"
9206 "ungetc()\n"
9207 "ungetwc()\n"
9208 "unlink()\n"
9209 "unlinkat() [POSIX.1-2008 で追加された]\n"
9210 "utime() [POSIX.1-2008 で追加された]\n"
9211 "utimensat() [POSIX.1-2008 で追加された]\n"
9212 "utimes() [POSIX.1-2008 で追加された]\n"
9213 "vdprintf() [POSIX.1-2008 で追加された]\n"
9214 "vfprintf()\n"
9215 "vfwprintf()\n"
9216 "vprintf()\n"
9217 "vwprintf()\n"
9218 "wcsftime()\n"
9219 "wordexp()\n"
9220 "wprintf()\n"
9221 "wscanf()\n"
9222
9223 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
9224 #.  files, it looks as though at least the following nonstandard
9225 #.  functions are cancellation points:
9226 #.  endnetgrent
9227 #.  endspent
9228 #.  epoll_pwait
9229 #.  epoll_wait
9230 #.  fcloseall
9231 #.  fdopendir
9232 #.  fflush_unlocked
9233 #.  fgetc_unlocked
9234 #.  fgetgrent
9235 #.  fgetgrent_r
9236 #.  fgetpwent
9237 #.  fgetpwent_r
9238 #.  fgets_unlocked
9239 #.  fgetspent
9240 #.  fgetspent_r
9241 #.  fgetwc_unlocked
9242 #.  fgetws_unlocked
9243 #.  fputc_unlocked
9244 #.  fputs_unlocked
9245 #.  fputwc_unlocked
9246 #.  fputws_unlocked
9247 #.  fread_unlocked
9248 #.  fwrite_unlocked
9249 #.  gai_suspend
9250 #.  getaddrinfo_a
9251 #.  getdate_r
9252 #.  getgrent_r
9253 #.  getgrouplist
9254 #.  gethostbyaddr_r
9255 #.  gethostbyname2
9256 #.  gethostbyname2_r
9257 #.  gethostbyname_r
9258 #.  gethostent_r
9259 #.  getnetbyaddr_r
9260 #.  getnetbyname_r
9261 #.  getnetent_r
9262 #.  getnetgrent
9263 #.  getnetgrent_r
9264 #.  getprotobyname_r
9265 #.  getprotobynumber_r
9266 #.  getprotoent_r
9267 #.  getpw
9268 #.  getpwent_r
9269 #.  getservbyname_r
9270 #.  getservbyport_r
9271 #.  getservent_r
9272 #.  getspent
9273 #.  getspent_r
9274 #.  getspnam
9275 #.  getspnam_r
9276 #.  getutmp
9277 #.  getutmpx
9278 #.  getw
9279 #.  getwc_unlocked
9280 #.  getwchar_unlocked
9281 #.  initgroups
9282 #.  innetgr
9283 #.  mkostemp
9284 #.  mkostemp64
9285 #.  mkstemp64
9286 #.  ppoll
9287 #.  pthread_timedjoin_np
9288 #.  putgrent
9289 #.  putpwent
9290 #.  putspent
9291 #.  putw
9292 #.  putwc_unlocked
9293 #.  putwchar_unlocked
9294 #.  rcmd
9295 #.  rcmd_af
9296 #.  rexec
9297 #.  rexec_af
9298 #.  rresvport
9299 #.  rresvport_af
9300 #.  ruserok
9301 #.  ruserok_af
9302 #.  setnetgrent
9303 #.  setspent
9304 #.  sgetspent
9305 #.  sgetspent_r
9306 #.  updwtmpx
9307 #.  utmpxname
9308 #.  vfscanf
9309 #.  vfwscanf
9310 #.  vscanf
9311 #.  vsyslog
9312 #.  vwscanf
9313 #. type: Plain text
9314 #: build/C/man7/pthreads.7:653
9315 msgid ""
9316 "An implementation may also mark other functions not specified in the "
9317 "standard as cancellation points.  In particular, an implementation is likely "
9318 "to mark any nonstandard function that may block as a cancellation point.  "
9319 "(This includes most functions that can touch files.)"
9320 msgstr ""
9321 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
9322 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
9323 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
9324 "関数がこれに含まれる)。"
9325
9326 #. type: SS
9327 #: build/C/man7/pthreads.7:653
9328 #, no-wrap
9329 msgid "Compiling on Linux"
9330 msgstr "Linux でのコンパイル"
9331
9332 #. type: Plain text
9333 #: build/C/man7/pthreads.7:656
9334 msgid ""
9335 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
9336 "pthread>."
9337 msgstr ""
9338 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
9339 "きである。"
9340
9341 #. type: SS
9342 #: build/C/man7/pthreads.7:656
9343 #, no-wrap
9344 msgid "Linux Implementations of POSIX Threads"
9345 msgstr "POSIX スレッドの Linux での実装"
9346
9347 #. type: Plain text
9348 #: build/C/man7/pthreads.7:659
9349 msgid ""
9350 "Over time, two threading implementations have been provided by the GNU C "
9351 "library on Linux:"
9352 msgstr ""
9353 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
9354 "た。"
9355
9356 #. type: TP
9357 #: build/C/man7/pthreads.7:659
9358 #, no-wrap
9359 msgid "B<LinuxThreads>"
9360 msgstr "B<LinuxThreads>"
9361
9362 #. type: Plain text
9363 #: build/C/man7/pthreads.7:663
9364 msgid ""
9365 "This is the original Pthreads implementation.  Since glibc 2.4, this "
9366 "implementation is no longer supported."
9367 msgstr ""
9368 "最初の Pthreads の実装。 glibc 2.4 以降は、この実装はもはやサポートされていな"
9369 "い。"
9370
9371 #. type: TP
9372 #: build/C/man7/pthreads.7:663
9373 #, no-wrap
9374 msgid "B<NPTL> (Native POSIX Threads Library)"
9375 msgstr "B<NPTL> (Native POSIX Threads Library)"
9376
9377 #. type: Plain text
9378 #: build/C/man7/pthreads.7:671
9379 msgid ""
9380 "This is the modern Pthreads implementation.  By comparison with "
9381 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
9382 "POSIX.1 specification and better performance when creating large numbers of "
9383 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
9384 "are present in the Linux 2.6 kernel."
9385 msgstr ""
9386 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
9387 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
9388 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
9389 "装されている機能が必要である。"
9390
9391 #. type: Plain text
9392 #: build/C/man7/pthreads.7:681
9393 msgid ""
9394 "Both of these are so-called 1:1 implementations, meaning that each thread "
9395 "maps to a kernel scheduling entity.  Both threading implementations employ "
9396 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
9397 "primitives (mutexes, thread joining, etc.) are implemented using the Linux "
9398 "B<futex>(2)  system call."
9399 msgstr ""
9400 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
9401 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
9402 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
9403 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
9404 "使って実装されている。"
9405
9406 #. type: SS
9407 #: build/C/man7/pthreads.7:681
9408 #, no-wrap
9409 msgid "LinuxThreads"
9410 msgstr "LinuxThreads"
9411
9412 #. type: Plain text
9413 #: build/C/man7/pthreads.7:683
9414 msgid "The notable features of this implementation are the following:"
9415 msgstr "この実装の大きな特徴は以下の通りである:"
9416
9417 #. type: Plain text
9418 #: build/C/man7/pthreads.7:690
9419 msgid ""
9420 "In addition to the main (initial) thread, and the threads that the program "
9421 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
9422 "thread.  This thread handles thread creation and termination.  (Problems can "
9423 "result if this thread is inadvertently killed.)"
9424 msgstr ""
9425 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
9426 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
9427 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
9428 "kill されると、問題が起こることがある)。"
9429
9430 #. type: Plain text
9431 #: build/C/man7/pthreads.7:702
9432 msgid ""
9433 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
9434 "the first three real-time signals are used (see also B<signal>(7)).  On "
9435 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
9436 "avoid the use of whichever set of signals is employed by the implementation."
9437 msgstr ""
9438 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
9439 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
9440 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
9441 "用されているシグナルを どれも使わないようにしなければならない。"
9442
9443 #. type: Plain text
9444 #: build/C/man7/pthreads.7:709
9445 msgid ""
9446 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
9447 "implemented as processes which share more information than usual, but which "
9448 "do not share a common process ID.)  LinuxThreads threads (including the "
9449 "manager thread)  are visible as separate processes using B<ps>(1)."
9450 msgstr ""
9451 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
9452 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
9453 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
9454 "を使うと別のプロセスのように見える。"
9455
9456 #. type: Plain text
9457 #: build/C/man7/pthreads.7:712
9458 msgid ""
9459 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
9460 "number of ways, including the following:"
9461 msgstr ""
9462 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
9463 "示すような点がある:"
9464
9465 #. type: Plain text
9466 #: build/C/man7/pthreads.7:716
9467 msgid "Calls to B<getpid>(2)  return a different value in each thread."
9468 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
9469
9470 #. type: Plain text
9471 #: build/C/man7/pthreads.7:725
9472 msgid ""
9473 "Calls to B<getppid>(2)  in threads other than the main thread return the "
9474 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
9475 "should return the same value as B<getppid>(2)  in the main thread."
9476 msgstr ""
9477 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
9478 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
9479 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
9480
9481 #. type: Plain text
9482 #: build/C/man7/pthreads.7:735
9483 msgid ""
9484 "When one thread creates a new child process using B<fork>(2), any thread "
9485 "should be able to B<wait>(2)  on the child.  However, the implementation "
9486 "only allows the thread that created the child to B<wait>(2)  on it."
9487 msgstr ""
9488 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
9489 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
9490 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
9491 "る。"
9492
9493 #. type: Plain text
9494 #: build/C/man7/pthreads.7:742
9495 msgid ""
9496 "When a thread calls B<execve>(2), all other threads are terminated (as "
9497 "required by POSIX.1).  However, the resulting process has the same PID as "
9498 "the thread that called B<execve>(2): it should have the same PID as the main "
9499 "thread."
9500 msgstr ""
9501 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
9502 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
9503 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
9504 "る。"
9505
9506 #. type: Plain text
9507 #: build/C/man7/pthreads.7:749
9508 msgid ""
9509 "Threads do not share user and group IDs.  This can cause complications with "
9510 "set-user-ID programs and can cause failures in Pthreads functions if an "
9511 "application changes its credentials using B<seteuid>(2)  or similar."
9512 msgstr ""
9513 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
9514 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使っ"
9515 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
9516
9517 #. type: Plain text
9518 #: build/C/man7/pthreads.7:751
9519 msgid "Threads do not share a common session ID and process group ID."
9520 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
9521
9522 #. type: Plain text
9523 #: build/C/man7/pthreads.7:754
9524 msgid "Threads do not share record locks created using B<fcntl>(2)."
9525 msgstr ""
9526 "スレッド間で B<fcntl>(2)  を使って作成されるレコード・ロックを共有しない。"
9527
9528 #. type: Plain text
9529 #: build/C/man7/pthreads.7:760
9530 msgid ""
9531 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
9532 "rather than process-wide."
9533 msgstr ""
9534 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
9535 "単位の情報である。"
9536
9537 #. type: Plain text
9538 #: build/C/man7/pthreads.7:763
9539 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
9540 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
9541
9542 #. type: Plain text
9543 #: build/C/man7/pthreads.7:765
9544 msgid "Threads do not share interval timers."
9545 msgstr "スレッド間でインターバル・タイマを共有しない。"
9546
9547 #.  FIXME . bug report filed for NPTL nice nonconformance
9548 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
9549 #.  Sep 08: there is a patch by Denys Vlasenko to address this
9550 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
9551 #.  Monitor this to see if it makes it into mainline.
9552 #. type: Plain text
9553 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
9554 msgid "Threads do not share a common nice value."
9555 msgstr "スレッドは共通の nice 値を共有しない。"
9556
9557 #. type: Plain text
9558 #: build/C/man7/pthreads.7:777
9559 msgid ""
9560 "POSIX.1 distinguishes the notions of signals that are directed to the "
9561 "process as a whole and signals that are directed to individual threads.  "
9562 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
9563 "example) should be handled by a single, arbitrarily selected thread within "
9564 "the process.  LinuxThreads does not support the notion of process-directed "
9565 "signals: signals may only be sent to specific threads."
9566 msgstr ""
9567 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
9568 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
9569 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
9570 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
9571 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
9572 "ルは特定のスレッドにだけ送ることができる。"
9573
9574 #. type: Plain text
9575 #: build/C/man7/pthreads.7:786
9576 msgid ""
9577 "Threads have distinct alternate signal stack settings.  However, a new "
9578 "thread's alternate signal stack settings are copied from the thread that "
9579 "created it, so that the threads initially share an alternate signal stack.  "
9580 "(A new thread should start with no alternate signal stack defined.  If two "
9581 "threads handle signals on their shared alternate signal stack at the same "
9582 "time, unpredictable program failures are likely to occur.)"
9583 msgstr ""
9584 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
9585 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
9586 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
9587 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
9588 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
9589 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
9590
9591 #. type: SS
9592 #: build/C/man7/pthreads.7:786
9593 #, no-wrap
9594 msgid "NPTL"
9595 msgstr "NPTL"
9596
9597 #. type: Plain text
9598 #: build/C/man7/pthreads.7:795
9599 msgid ""
9600 "With NPTL, all of the threads in a process are placed in the same thread "
9601 "group; all members of a thread group share the same PID.  NPTL does not "
9602 "employ a manager thread.  NPTL makes internal use of the first two real-time "
9603 "signals (see also B<signal>(7)); these signals cannot be used in "
9604 "applications."
9605 msgstr ""
9606 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
9607 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
9608 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
9609 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
9610 "ションでは使用できない。"
9611
9612 #. type: Plain text
9613 #: build/C/man7/pthreads.7:797
9614 msgid "NPTL still has at least one nonconformance with POSIX.1:"
9615 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
9616
9617 #. type: Plain text
9618 #: build/C/man7/pthreads.7:806
9619 msgid "Some NPTL nonconformances only occur with older kernels:"
9620 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
9621
9622 #. type: Plain text
9623 #: build/C/man7/pthreads.7:812
9624 msgid ""
9625 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
9626 "rather than process-wide (fixed in kernel 2.6.9)."
9627 msgstr ""
9628 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
9629 "単位の情報である (カーネル 2.6.9 で修正された)。"
9630
9631 #. type: Plain text
9632 #: build/C/man7/pthreads.7:814
9633 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
9634 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
9635
9636 #. type: Plain text
9637 #: build/C/man7/pthreads.7:816
9638 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
9639 msgstr ""
9640 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
9641
9642 #. type: Plain text
9643 #: build/C/man7/pthreads.7:820
9644 msgid ""
9645 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
9646 "(fixed in kernel 2.6.16)."
9647 msgstr ""
9648 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
9649 "きる (カーネル 2.6.16 で修正された)。"
9650
9651 #. type: Plain text
9652 #: build/C/man7/pthreads.7:825
9653 msgid ""
9654 "Only the main thread is permitted to make the process into a process group "
9655 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
9656 msgstr ""
9657 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセス・グルー"
9658 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
9659
9660 #. type: Plain text
9661 #: build/C/man7/pthreads.7:831
9662 msgid ""
9663 "Threads have distinct alternate signal stack settings.  However, a new "
9664 "thread's alternate signal stack settings are copied from the thread that "
9665 "created it, so that the threads initially share an alternate signal stack "
9666 "(fixed in kernel 2.6.16)."
9667 msgstr ""
9668 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
9669 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
9670 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
9671 "ル 2.6.16 で修正された)。"
9672
9673 #. type: Plain text
9674 #: build/C/man7/pthreads.7:833
9675 msgid "Note the following further points about the NPTL implementation:"
9676 msgstr "NPTL の実装では以下の点についても注意すること:"
9677
9678 #. type: Plain text
9679 #: build/C/man7/pthreads.7:847
9680 msgid ""
9681 "If the stack size soft resource limit (see the description of "
9682 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
9683 "I<unlimited>, then this value defines the default stack size for new "
9684 "threads.  To be effective, this limit must be set before the program is "
9685 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
9686 "stacksize> in the C shell)."
9687 msgstr ""
9688 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2)  の "
9689 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
9690 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
9691 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
9692 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
9693 "は I<limit stacksize>)  を使って設定する。"
9694
9695 #. type: SS
9696 #: build/C/man7/pthreads.7:847
9697 #, no-wrap
9698 msgid "Determining the Threading Implementation"
9699 msgstr "スレッド実装の判定"
9700
9701 #. type: Plain text
9702 #: build/C/man7/pthreads.7:852
9703 msgid ""
9704 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
9705 "system's threading implementation, for example:"
9706 msgstr ""
9707 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
9708 "装を判定することができる。 以下に例を示す:"
9709
9710 #. type: Plain text
9711 #: build/C/man7/pthreads.7:857
9712 #, no-wrap
9713 msgid ""
9714 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
9715 "NPTL 2.3.4\n"
9716 msgstr ""
9717 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
9718 "NPTL 2.3.4\n"
9719
9720 #. type: Plain text
9721 #: build/C/man7/pthreads.7:862
9722 msgid ""
9723 "With older glibc versions, a command such as the following should be "
9724 "sufficient to determine the default threading implementation:"
9725 msgstr ""
9726 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
9727 "ド実装を判定することができる。"
9728
9729 #. type: Plain text
9730 #: build/C/man7/pthreads.7:868
9731 #, no-wrap
9732 msgid ""
9733 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
9734 "                egrep -i \\(aqthreads|nptl\\(aq\n"
9735 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
9736 msgstr ""
9737 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
9738 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
9739 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
9740
9741 #. type: SS
9742 #: build/C/man7/pthreads.7:870
9743 #, no-wrap
9744 msgid "Selecting the Threading Implementation: LD_ASSUME_KERNEL"
9745 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
9746
9747 #. type: Plain text
9748 #: build/C/man7/pthreads.7:885
9749 msgid ""
9750 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
9751 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
9752 "override the dynamic linker's default choice of threading implementation.  "
9753 "This variable tells the dynamic linker to assume that it is running on top "
9754 "of a particular kernel version.  By specifying a kernel version that does "
9755 "not provide the support required by NPTL, we can force the use of "
9756 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
9757 "application that depends on some nonconformant behavior in LinuxThreads.)  "
9758 "For example:"
9759 msgstr ""
9760 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
9761 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
9762 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
9763 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
9764 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
9765 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
9766 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
9767 "ン を動作させる場合だろう)。 以下に例を示す:"
9768
9769 #. type: Plain text
9770 #: build/C/man7/pthreads.7:891
9771 #, no-wrap
9772 msgid ""
9773 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
9774 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
9775 "        linuxthreads-0.10 by Xavier Leroy\n"
9776 msgstr ""
9777 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
9778 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
9779 "        linuxthreads-0.10 by Xavier Leroy\n"
9780
9781 #. type: Plain text
9782 #: build/C/man7/pthreads.7:903
9783 msgid ""
9784 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), B<sigevent>"
9785 "(7), B<signal>(7),"
9786 msgstr ""
9787 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
9788 "B<signal>(7),"
9789
9790 #. type: Plain text
9791 #: build/C/man7/pthreads.7:927
9792 #, fuzzy
9793 msgid ""
9794 "and various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
9795 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9796 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
9797 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
9798 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
9799 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>"
9800 "(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), "
9801 "B<pthread_sigmask>(3), B<pthread_sigqueue>(3), and B<pthread_testcancel>(3)"
9802 msgstr "および Pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3), B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3), and B<pthread_testcancel>(3)"
9803
9804 #~ msgid "2008-11-18"
9805 #~ msgstr "2008-11-18"