OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.37.
[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 03:49+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
1261 #. type: Plain text
1262 #: build/C/man3/pthread_attr_init.3:128
1263 msgid ""
1264 "When we supply a stack size as a command-line argument, the program "
1265 "initializes a thread attributes object, sets various attributes in that "
1266 "object, and passes a pointer to the object in the call to B<pthread_create>"
1267 "(3).  Running the program on Linux/x86-32 with the NPTL threading "
1268 "implementation, we see the following:"
1269 msgstr ""
1270
1271 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1272 #. type: Plain text
1273 #: build/C/man3/pthread_attr_init.3:143
1274 #, no-wrap
1275 msgid ""
1276 "$B< ./a.out 0x3000000>\n"
1277 "posix_memalign() allocated at 0x40197000\n"
1278 "Thread attributes:\n"
1279 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1280 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1281 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1282 "        Scheduling policy   = SCHED_OTHER\n"
1283 "        Scheduling priority = 0\n"
1284 "        Guard size          = 0 bytes\n"
1285 "        Stack address       = 0x40197000\n"
1286 "        Stack size          = 0x3000000 bytes\n"
1287 msgstr ""
1288
1289 #. type: Plain text
1290 #: build/C/man3/pthread_attr_init.3:154 build/C/man3/pthread_getattr_np.3:185
1291 #, no-wrap
1292 msgid ""
1293 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1294 "#include E<lt>pthread.hE<gt>\n"
1295 "#include E<lt>stdio.hE<gt>\n"
1296 "#include E<lt>stdlib.hE<gt>\n"
1297 "#include E<lt>unistd.hE<gt>\n"
1298 "#include E<lt>errno.hE<gt>\n"
1299 msgstr ""
1300
1301 #. type: Plain text
1302 #: build/C/man3/pthread_attr_init.3:157 build/C/man3/pthread_cancel.3:156
1303 #: build/C/man3/pthread_cleanup_push.3:236 build/C/man3/pthread_create.3:246
1304 #: build/C/man3/pthread_getattr_np.3:188
1305 #: build/C/man3/pthread_getcpuclockid.3:110
1306 #: build/C/man3/pthread_setaffinity_np.3:169
1307 #: build/C/man3/pthread_setschedparam.3:234 build/C/man3/pthread_sigmask.3:91
1308 #, no-wrap
1309 msgid ""
1310 "#define handle_error_en(en, msg) \\e\n"
1311 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1312 msgstr ""
1313
1314 #. type: Plain text
1315 #: build/C/man3/pthread_attr_init.3:165
1316 #, no-wrap
1317 msgid ""
1318 "static void\n"
1319 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1320 "{\n"
1321 "    int s, i;\n"
1322 "    size_t v;\n"
1323 "    void *stkaddr;\n"
1324 "    struct sched_param sp;\n"
1325 msgstr ""
1326
1327 #. type: Plain text
1328 #: build/C/man3/pthread_attr_init.3:173
1329 #, no-wrap
1330 msgid ""
1331 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1332 "    if (s != 0)\n"
1333 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1334 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1335 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1336 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1337 "            \"???\");\n"
1338 msgstr ""
1339
1340 #. type: Plain text
1341 #: build/C/man3/pthread_attr_init.3:181
1342 #, no-wrap
1343 msgid ""
1344 "    s = pthread_attr_getscope(attr, &i);\n"
1345 "    if (s != 0)\n"
1346 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1347 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1348 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1349 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1350 "            \"???\");\n"
1351 msgstr ""
1352
1353 #. type: Plain text
1354 #: build/C/man3/pthread_attr_init.3:189
1355 #, no-wrap
1356 msgid ""
1357 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1358 "    if (s != 0)\n"
1359 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1360 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1361 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1362 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1363 "            \"???\");\n"
1364 msgstr ""
1365
1366 #. type: Plain text
1367 #: build/C/man3/pthread_attr_init.3:198
1368 #, no-wrap
1369 msgid ""
1370 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1371 "    if (s != 0)\n"
1372 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1373 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1374 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1375 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1376 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1377 "            \"???\");\n"
1378 msgstr ""
1379
1380 #. type: Plain text
1381 #: build/C/man3/pthread_attr_init.3:203
1382 #, no-wrap
1383 msgid ""
1384 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1385 "    if (s != 0)\n"
1386 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1387 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1388 msgstr ""
1389
1390 #. type: Plain text
1391 #: build/C/man3/pthread_attr_init.3:208
1392 #, no-wrap
1393 msgid ""
1394 "    s = pthread_attr_getguardsize(attr, &v);\n"
1395 "    if (s != 0)\n"
1396 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1397 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1398 msgstr ""
1399
1400 #. type: Plain text
1401 #: build/C/man3/pthread_attr_init.3:215
1402 #, no-wrap
1403 msgid ""
1404 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1405 "    if (s != 0)\n"
1406 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1407 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1408 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1409 "}\n"
1410 msgstr ""
1411
1412 #. type: Plain text
1413 #: build/C/man3/pthread_attr_init.3:221
1414 #, no-wrap
1415 msgid ""
1416 "static void *\n"
1417 "thread_start(void *arg)\n"
1418 "{\n"
1419 "    int s;\n"
1420 "    pthread_attr_t gattr;\n"
1421 msgstr ""
1422
1423 #. type: Plain text
1424 #: build/C/man3/pthread_attr_init.3:225
1425 #, no-wrap
1426 msgid ""
1427 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1428 "       retrieves the attributes of the thread specified in its\n"
1429 "       first argument */\n"
1430 msgstr ""
1431
1432 #. type: Plain text
1433 #: build/C/man3/pthread_attr_init.3:229
1434 #, no-wrap
1435 msgid ""
1436 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1437 "    if (s != 0)\n"
1438 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1439 msgstr ""
1440
1441 #. type: Plain text
1442 #: build/C/man3/pthread_attr_init.3:232
1443 #, no-wrap
1444 msgid ""
1445 "    printf(\"Thread attributes:\\en\");\n"
1446 "    display_pthread_attr(&gattr, \"\\et\");\n"
1447 msgstr ""
1448
1449 #. type: Plain text
1450 #: build/C/man3/pthread_attr_init.3:235 build/C/man3/pthread_getattr_np.3:237
1451 #, no-wrap
1452 msgid ""
1453 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1454 "}\n"
1455 msgstr ""
1456
1457 #. type: Plain text
1458 #: build/C/man3/pthread_attr_init.3:243
1459 #, no-wrap
1460 msgid ""
1461 "int\n"
1462 "main(int argc, char *argv[])\n"
1463 "{\n"
1464 "    pthread_t thr;\n"
1465 "    pthread_attr_t attr;\n"
1466 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1467 "    int s;\n"
1468 msgstr ""
1469
1470 #. type: Plain text
1471 #: build/C/man3/pthread_attr_init.3:245
1472 #: build/C/man3/pthread_setschedparam.3:352
1473 #, no-wrap
1474 msgid "    attrp = NULL;\n"
1475 msgstr ""
1476
1477 #. type: Plain text
1478 #: build/C/man3/pthread_attr_init.3:249
1479 #, no-wrap
1480 msgid ""
1481 "    /* If a command-line argument was supplied, use it to set the\n"
1482 "       stack-size attribute and set a few other thread attributes,\n"
1483 "       and set attrp pointing to thread attributes object */\n"
1484 msgstr ""
1485
1486 #. type: Plain text
1487 #: build/C/man3/pthread_attr_init.3:253
1488 #, no-wrap
1489 msgid ""
1490 "    if (argc E<gt> 1) {\n"
1491 "        int stack_size;\n"
1492 "        void *sp;\n"
1493 msgstr ""
1494
1495 #. type: Plain text
1496 #: build/C/man3/pthread_attr_init.3:255
1497 #, no-wrap
1498 msgid "        attrp = &attr;\n"
1499 msgstr ""
1500
1501 #. type: Plain text
1502 #: build/C/man3/pthread_attr_init.3:259
1503 #, no-wrap
1504 msgid ""
1505 "        s = pthread_attr_init(&attr);\n"
1506 "        if (s != 0)\n"
1507 "            handle_error_en(s, \"pthread_attr_init\");\n"
1508 msgstr ""
1509
1510 #. type: Plain text
1511 #: build/C/man3/pthread_attr_init.3:263
1512 #, no-wrap
1513 msgid ""
1514 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1515 "        if (s != 0)\n"
1516 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1517 msgstr ""
1518
1519 #. type: Plain text
1520 #: build/C/man3/pthread_attr_init.3:267
1521 #, no-wrap
1522 msgid ""
1523 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1524 "        if (s != 0)\n"
1525 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1526 msgstr ""
1527
1528 #. type: Plain text
1529 #: build/C/man3/pthread_attr_init.3:269
1530 #, no-wrap
1531 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1532 msgstr ""
1533
1534 #. type: Plain text
1535 #: build/C/man3/pthread_attr_init.3:273
1536 #, no-wrap
1537 msgid ""
1538 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1539 "        if (s != 0)\n"
1540 "            handle_error_en(s, \"posix_memalign\");\n"
1541 msgstr ""
1542
1543 #. type: Plain text
1544 #: build/C/man3/pthread_attr_init.3:275
1545 #, no-wrap
1546 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1547 msgstr ""
1548
1549 #. type: Plain text
1550 #: build/C/man3/pthread_attr_init.3:280
1551 #, no-wrap
1552 msgid ""
1553 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1554 "        if (s != 0)\n"
1555 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1556 "    }\n"
1557 msgstr ""
1558
1559 #. type: Plain text
1560 #: build/C/man3/pthread_attr_init.3:284 build/C/man3/pthread_getattr_np.3:332
1561 #, no-wrap
1562 msgid ""
1563 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1564 "    if (s != 0)\n"
1565 "        handle_error_en(s, \"pthread_create\");\n"
1566 msgstr ""
1567
1568 #. type: Plain text
1569 #: build/C/man3/pthread_attr_init.3:290 build/C/man3/pthread_getattr_np.3:338
1570 #, no-wrap
1571 msgid ""
1572 "    if (attrp != NULL) {\n"
1573 "        s = pthread_attr_destroy(attrp);\n"
1574 "        if (s != 0)\n"
1575 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1576 "    }\n"
1577 msgstr ""
1578
1579 #. type: Plain text
1580 #: build/C/man3/pthread_attr_init.3:293 build/C/man3/pthread_getattr_np.3:341
1581 #, no-wrap
1582 msgid ""
1583 "    pause();    /* Terminates when other thread calls exit() */\n"
1584 "}\n"
1585 msgstr ""
1586
1587 #. type: Plain text
1588 #: build/C/man3/pthread_attr_init.3:308
1589 msgid ""
1590 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1591 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1592 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1593 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1594 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1595 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1596 msgstr ""
1597
1598 #. type: TH
1599 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1600 #, no-wrap
1601 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1602 msgstr ""
1603
1604 #. type: TH
1605 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1606 #: build/C/man3/pthread_getattr_np.3:24
1607 #: build/C/man3/pthread_setaffinity_np.3:24
1608 #: build/C/man3/pthread_tryjoin_np.3:24
1609 #, no-wrap
1610 msgid "2010-09-10"
1611 msgstr ""
1612
1613 #. type: Plain text
1614 #: build/C/man3/pthread_attr_setaffinity_np.3:28
1615 msgid ""
1616 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1617 "affinity attribute in thread attributes object"
1618 msgstr ""
1619
1620 #. type: Plain text
1621 #: build/C/man3/pthread_attr_setaffinity_np.3:32
1622 #: build/C/man3/pthread_getattr_np.3:31
1623 #: build/C/man3/pthread_setaffinity_np.3:32
1624 #: build/C/man3/pthread_tryjoin_np.3:32
1625 #, no-wrap
1626 msgid ""
1627 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1628 "B<#include E<lt>pthread.hE<gt>>\n"
1629 msgstr ""
1630
1631 #. type: Plain text
1632 #: build/C/man3/pthread_attr_setaffinity_np.3:37
1633 #, no-wrap
1634 msgid ""
1635 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1636 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1637 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1638 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1639 msgstr ""
1640
1641 #. type: Plain text
1642 #: build/C/man3/pthread_attr_setaffinity_np.3:51
1643 msgid ""
1644 "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask "
1645 "attribute of the thread attributes object referred to by I<attr> to the "
1646 "value specified in I<cpuset>.  This attribute determines the CPU affinity "
1647 "mask of a thread created using the thread attributes object I<attr>."
1648 msgstr ""
1649
1650 #. type: Plain text
1651 #: build/C/man3/pthread_attr_setaffinity_np.3:60
1652 msgid ""
1653 "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask "
1654 "attribute of the thread attributes object referred to by I<attr> in the "
1655 "buffer pointed to by I<cpuset>."
1656 msgstr ""
1657
1658 #. type: Plain text
1659 #: build/C/man3/pthread_attr_setaffinity_np.3:67
1660 msgid ""
1661 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1662 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
1663 "(cpu_set_t)>."
1664 msgstr ""
1665
1666 #. type: Plain text
1667 #: build/C/man3/pthread_attr_setaffinity_np.3:73
1668 #: build/C/man3/pthread_setaffinity_np.3:64
1669 msgid ""
1670 "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a "
1671 "description of a set of macros that can be used to manipulate and inspect "
1672 "CPU sets, see B<CPU_SET>(3)."
1673 msgstr ""
1674
1675 #. type: TP
1676 #: build/C/man3/pthread_attr_setaffinity_np.3:77
1677 #: build/C/man3/pthread_attr_setaffinity_np.3:89
1678 #: build/C/man3/pthread_attr_setdetachstate.3:80
1679 #: build/C/man3/pthread_attr_setinheritsched.3:87
1680 #: build/C/man3/pthread_attr_setschedpolicy.3:75
1681 #: build/C/man3/pthread_attr_setscope.3:94
1682 #: build/C/man3/pthread_attr_setstack.3:89
1683 #: build/C/man3/pthread_attr_setstacksize.3:64
1684 #: build/C/man3/pthread_create.3:135 build/C/man3/pthread_detach.3:53
1685 #: build/C/man3/pthread_join.3:83 build/C/man3/pthread_join.3:87
1686 #: build/C/man3/pthread_kill.3:56 build/C/man3/pthread_setaffinity_np.3:81
1687 #: build/C/man3/pthread_setaffinity_np.3:90
1688 #: build/C/man3/pthread_setaffinity_np.3:106
1689 #: build/C/man3/pthread_setcancelstate.3:96
1690 #: build/C/man3/pthread_setcancelstate.3:104
1691 #: build/C/man3/pthread_setconcurrency.3:68
1692 #: build/C/man3/pthread_setschedparam.3:119
1693 #: build/C/man3/pthread_setschedprio.3:59 build/C/man3/pthread_sigqueue.3:75
1694 #, no-wrap
1695 msgid "B<EINVAL>"
1696 msgstr ""
1697
1698 #.  cpumask_t
1699 #.  The raw sched_getaffinity() system call returns the size (in bytes)
1700 #.  of the cpumask_t type.
1701 #. type: Plain text
1702 #: build/C/man3/pthread_attr_setaffinity_np.3:89
1703 msgid ""
1704 "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was "
1705 "outside the set supported by the kernel.  (The kernel configuration option "
1706 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
1707 "type used to represent CPU sets.)"
1708 msgstr ""
1709
1710 #. type: Plain text
1711 #: build/C/man3/pthread_attr_setaffinity_np.3:99
1712 msgid ""
1713 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
1714 "attributes object referred to by I<attr> lies outside the range specified by "
1715 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
1716 msgstr ""
1717
1718 #. type: Plain text
1719 #: build/C/man3/pthread_attr_setaffinity_np.3:103
1720 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
1721 msgstr ""
1722
1723 #. type: Plain text
1724 #: build/C/man3/pthread_attr_setaffinity_np.3:105
1725 #: build/C/man3/pthread_setaffinity_np.3:118
1726 msgid "These functions are provided by glibc since version 2.3.4."
1727 msgstr ""
1728
1729 #. type: Plain text
1730 #: build/C/man3/pthread_attr_setaffinity_np.3:108
1731 #: build/C/man3/pthread_cleanup_push_defer_np.3:101
1732 #: build/C/man3/pthread_setaffinity_np.3:121
1733 #: build/C/man3/pthread_tryjoin_np.3:113
1734 msgid ""
1735 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
1736 "\" (nonportable) in the names."
1737 msgstr ""
1738
1739 #. type: Plain text
1740 #: build/C/man3/pthread_attr_setaffinity_np.3:115
1741 #: build/C/man3/pthread_setaffinity_np.3:147
1742 msgid ""
1743 "In glibc 2.3.3 only, versions of these functions were provided that did not "
1744 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
1745 "underlying system calls was always I<sizeof(cpu_set_t)>."
1746 msgstr ""
1747
1748 #. type: Plain text
1749 #: build/C/man3/pthread_attr_setaffinity_np.3:121
1750 msgid ""
1751 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1752 "(3), B<cpuset>(7), B<pthreads>(7)"
1753 msgstr ""
1754
1755 #. type: TH
1756 #: build/C/man3/pthread_attr_setdetachstate.3:24
1757 #, no-wrap
1758 msgid "PTHREAD_ATTR_SETDETACHSTATE"
1759 msgstr ""
1760
1761 #. type: TH
1762 #: build/C/man3/pthread_attr_setdetachstate.3:24
1763 #: build/C/man3/pthread_attr_setschedparam.3:24
1764 #: build/C/man3/pthread_attr_setschedpolicy.3:24
1765 #, no-wrap
1766 msgid "2010-02-03"
1767 msgstr ""
1768
1769 #. type: Plain text
1770 #: build/C/man3/pthread_attr_setdetachstate.3:28
1771 msgid ""
1772 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
1773 "state attribute in thread attributes object"
1774 msgstr ""
1775
1776 #. type: Plain text
1777 #: build/C/man3/pthread_attr_setdetachstate.3:36
1778 #, no-wrap
1779 msgid ""
1780 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
1781 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
1782 msgstr ""
1783
1784 #. type: Plain text
1785 #: build/C/man3/pthread_attr_setdetachstate.3:50
1786 msgid ""
1787 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
1788 "attribute of the thread attributes object referred to by I<attr> to the "
1789 "value specified in I<detachstate>.  The detach state attribute determines "
1790 "whether a thread created using the thread attributes object I<attr> will be "
1791 "created in a joinable or a detached state."
1792 msgstr ""
1793
1794 #. type: Plain text
1795 #: build/C/man3/pthread_attr_setdetachstate.3:53
1796 msgid "The following values may be specified in I<detachstate>:"
1797 msgstr ""
1798
1799 #. type: TP
1800 #: build/C/man3/pthread_attr_setdetachstate.3:53
1801 #, no-wrap
1802 msgid "B<PTHREAD_CREATE_DETACHED>"
1803 msgstr ""
1804
1805 #. type: Plain text
1806 #: build/C/man3/pthread_attr_setdetachstate.3:58
1807 msgid ""
1808 "Threads that are created using I<attr> will be created in a detached state."
1809 msgstr ""
1810
1811 #. type: TP
1812 #: build/C/man3/pthread_attr_setdetachstate.3:58
1813 #, no-wrap
1814 msgid "B<PTHREAD_CREATE_JOINABLE>"
1815 msgstr ""
1816
1817 #. type: Plain text
1818 #: build/C/man3/pthread_attr_setdetachstate.3:63
1819 msgid ""
1820 "Threads that are created using I<attr> will be created in a joinable state."
1821 msgstr ""
1822
1823 #. type: Plain text
1824 #: build/C/man3/pthread_attr_setdetachstate.3:67
1825 msgid ""
1826 "The default setting of the detach state attribute in a newly initialized "
1827 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
1828 msgstr ""
1829
1830 #. type: Plain text
1831 #: build/C/man3/pthread_attr_setdetachstate.3:74
1832 msgid ""
1833 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
1834 "the thread attributes object I<attr> in the buffer pointed to by "
1835 "I<detachstate>."
1836 msgstr ""
1837
1838 #. type: Plain text
1839 #: build/C/man3/pthread_attr_setdetachstate.3:80
1840 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
1841 msgstr ""
1842
1843 #. type: Plain text
1844 #: build/C/man3/pthread_attr_setdetachstate.3:84
1845 msgid "An invalid value was specified in I<detachstate>."
1846 msgstr ""
1847
1848 #. type: Plain text
1849 #: build/C/man3/pthread_attr_setdetachstate.3:90
1850 msgid ""
1851 "See B<pthread_create>(3)  for more details on detached and joinable threads."
1852 msgstr ""
1853
1854 #. type: Plain text
1855 #: build/C/man3/pthread_attr_setdetachstate.3:98
1856 msgid ""
1857 "A thread that is created in a joinable state should eventually either be "
1858 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
1859 "B<pthread_create>(3)."
1860 msgstr ""
1861
1862 #. type: Plain text
1863 #: build/C/man3/pthread_attr_setdetachstate.3:105
1864 msgid ""
1865 "It is an error to specify the thread ID of a thread that was created in a "
1866 "detached state in a later call to B<pthread_detach>(3)  or B<pthread_join>"
1867 "(3)."
1868 msgstr ""
1869
1870 #. type: Plain text
1871 #: build/C/man3/pthread_attr_setdetachstate.3:108
1872 #: build/C/man3/pthread_attr_setstack.3:154
1873 msgid "See B<pthread_attr_init>(3)."
1874 msgstr ""
1875
1876 #. type: Plain text
1877 #: build/C/man3/pthread_attr_setdetachstate.3:114
1878 msgid ""
1879 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
1880 "B<pthread_join>(3), B<pthreads>(7)"
1881 msgstr ""
1882
1883 #. type: TH
1884 #: build/C/man3/pthread_attr_setguardsize.3:24
1885 #, no-wrap
1886 msgid "PTHREAD_ATTR_SETGUARDSIZE"
1887 msgstr ""
1888
1889 #. type: TH
1890 #: build/C/man3/pthread_attr_setguardsize.3:24
1891 #: build/C/man3/pthread_attr_setscope.3:24
1892 #: build/C/man3/pthread_attr_setstack.3:24
1893 #: build/C/man3/pthread_attr_setstackaddr.3:24 build/C/man3/pthread_self.3:24
1894 #, no-wrap
1895 msgid "2008-10-24"
1896 msgstr ""
1897
1898 #. type: Plain text
1899 #: build/C/man3/pthread_attr_setguardsize.3:28
1900 msgid ""
1901 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
1902 "attribute in thread attributes object"
1903 msgstr ""
1904
1905 #. type: Plain text
1906 #: build/C/man3/pthread_attr_setguardsize.3:36
1907 #, no-wrap
1908 msgid ""
1909 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
1910 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
1911 msgstr ""
1912
1913 #. type: Plain text
1914 #: build/C/man3/pthread_attr_setguardsize.3:46
1915 msgid ""
1916 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
1917 "of the thread attributes object referred to by I<attr> to the value "
1918 "specified in I<guardsize>."
1919 msgstr ""
1920
1921 #. type: Plain text
1922 #: build/C/man3/pthread_attr_setguardsize.3:56
1923 msgid ""
1924 "If I<guardsize> is greater than 0, then for each new thread created using "
1925 "I<attr> the system allocates an additional region of at least I<guardsize> "
1926 "bytes at the end of the thread's stack to act as the guard area for the "
1927 "stack (but see BUGS)."
1928 msgstr ""
1929
1930 #. type: Plain text
1931 #: build/C/man3/pthread_attr_setguardsize.3:62
1932 msgid ""
1933 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
1934 "guard area."
1935 msgstr ""
1936
1937 #. type: Plain text
1938 #: build/C/man3/pthread_attr_setguardsize.3:64
1939 msgid "The default guard size is the same as the system page size."
1940 msgstr ""
1941
1942 #. type: Plain text
1943 #: build/C/man3/pthread_attr_setguardsize.3:79
1944 msgid ""
1945 "If the stack address attribute has been set in I<attr> (using "
1946 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
1947 "that the caller is allocating the thread's stack, then the guard size "
1948 "attribute is ignored (i.e., no guard area is created by the system): it is "
1949 "the application's responsibility to handle stack overflow (perhaps by using "
1950 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
1951 "it has allocated)."
1952 msgstr ""
1953
1954 #. type: Plain text
1955 #: build/C/man3/pthread_attr_setguardsize.3:87
1956 msgid ""
1957 "The B<pthread_attr_getguardsize>()  function returns the guard size "
1958 "attribute of the thread attributes object referred to by I<attr> in the "
1959 "buffer pointed to by I<guardsize>."
1960 msgstr ""
1961
1962 #. type: Plain text
1963 #: build/C/man3/pthread_attr_setguardsize.3:101
1964 msgid ""
1965 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
1966 "invalid.  On Linux these functions always succeed (but portable and future-"
1967 "proof applications should nevertheless handle a possible error return)."
1968 msgstr ""
1969
1970 #. type: Plain text
1971 #: build/C/man3/pthread_attr_setguardsize.3:103
1972 #: build/C/man3/pthread_attr_setstackaddr.3:80
1973 #: build/C/man3/pthread_attr_setstacksize.3:80
1974 msgid "These functions are provided by glibc since version 2.1."
1975 msgstr ""
1976
1977 #. type: Plain text
1978 #: build/C/man3/pthread_attr_setguardsize.3:119
1979 msgid ""
1980 "A guard area consists of virtual memory pages that are protected to prevent "
1981 "read and write access.  If a thread overflows its stack into the guard area, "
1982 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
1983 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
1984 "guard size is internally rounded up to the system page size when creating a "
1985 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
1986 "size that was set by B<pthread_attr_setguardsize>().)"
1987 msgstr ""
1988
1989 #. type: Plain text
1990 #: build/C/man3/pthread_attr_setguardsize.3:123
1991 msgid ""
1992 "Setting a guard size of 0 may be useful to save memory in an application "
1993 "that creates many threads and knows that stack overflow can never occur."
1994 msgstr ""
1995
1996 #. type: Plain text
1997 #: build/C/man3/pthread_attr_setguardsize.3:127
1998 msgid ""
1999 "Choosing a guard size larger than the default size may be necessary for "
2000 "detecting stack overflows if a thread allocates large data structures on the "
2001 "stack."
2002 msgstr ""
2003
2004 #. type: SH
2005 #: build/C/man3/pthread_attr_setguardsize.3:127
2006 #: build/C/man3/pthread_attr_setinheritsched.3:103
2007 #: build/C/man3/pthread_attr_setstacksize.3:96
2008 #: build/C/man3/pthread_create.3:361 build/C/man3/pthread_exit.3:90
2009 #, no-wrap
2010 msgid "BUGS"
2011 msgstr ""
2012
2013 #. type: Plain text
2014 #: build/C/man3/pthread_attr_setguardsize.3:138
2015 msgid ""
2016 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2017 "within the stack size allocation, rather than allocating extra space at the "
2018 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2019 "error from B<pthread_create>(3)  if the guard size value is too large, "
2020 "leaving no space for the actual stack.)"
2021 msgstr ""
2022
2023 #.  glibc includes the guardsize within the allocated stack size,
2024 #.  which looks pretty clearly to be in violation of POSIX.
2025 #.  Filed bug, 22 Oct 2008:
2026 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2027 #.  Older reports:
2028 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2029 #.  Reportedly, LinuxThreads did the right thing, allocating
2030 #.  extra space at the end of the stack:
2031 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2032 #. type: Plain text
2033 #: build/C/man3/pthread_attr_setguardsize.3:152
2034 msgid ""
2035 "The obsolete LinuxThreads implementation did the right thing, allocating "
2036 "extra space at the end of the stack for the guard area."
2037 msgstr ""
2038
2039 #. type: Plain text
2040 #: build/C/man3/pthread_attr_setguardsize.3:155
2041 msgid "See B<pthread_getattr_np>(3)."
2042 msgstr ""
2043
2044 #. type: Plain text
2045 #: build/C/man3/pthread_attr_setguardsize.3:163
2046 msgid ""
2047 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2048 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2049 msgstr ""
2050
2051 #. type: TH
2052 #: build/C/man3/pthread_attr_setinheritsched.3:24
2053 #, no-wrap
2054 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2055 msgstr ""
2056
2057 #. type: TH
2058 #: build/C/man3/pthread_attr_setinheritsched.3:24
2059 #, no-wrap
2060 msgid "2008-11-10"
2061 msgstr ""
2062
2063 #. type: Plain text
2064 #: build/C/man3/pthread_attr_setinheritsched.3:28
2065 msgid ""
2066 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit "
2067 "scheduler attribute in thread attributes object"
2068 msgstr ""
2069
2070 #. type: Plain text
2071 #: build/C/man3/pthread_attr_setinheritsched.3:36
2072 #, no-wrap
2073 msgid ""
2074 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2075 "B<                                 int >I<inheritsched>B<);>\n"
2076 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2077 "B<                                 int *>I<inheritsched>B<);>\n"
2078 msgstr ""
2079
2080 #. type: Plain text
2081 #: build/C/man3/pthread_attr_setinheritsched.3:52
2082 msgid ""
2083 "The B<pthread_attr_setinheritsched>()  function sets the inherit scheduler "
2084 "attribute of the thread attributes object referred to by I<attr> to the "
2085 "value specified in I<inheritsched>.  The inherit scheduler attribute "
2086 "determines whether a thread created using the thread attributes object "
2087 "I<attr> will inherit its scheduling attributes from the calling thread or "
2088 "whether it will take them from I<attr>."
2089 msgstr ""
2090
2091 #. type: Plain text
2092 #: build/C/man3/pthread_attr_setinheritsched.3:55
2093 msgid "The following values may be specified in I<inheritsched>:"
2094 msgstr ""
2095
2096 #. type: TP
2097 #: build/C/man3/pthread_attr_setinheritsched.3:55
2098 #, no-wrap
2099 msgid "B<PTHREAD_INHERIT_SCHED>"
2100 msgstr ""
2101
2102 #. type: Plain text
2103 #: build/C/man3/pthread_attr_setinheritsched.3:63
2104 msgid ""
2105 "Threads that are created using I<attr> inherit scheduling attributes from "
2106 "the creating thread; the scheduling attributes in I<attr> are ignored."
2107 msgstr ""
2108
2109 #. type: TP
2110 #: build/C/man3/pthread_attr_setinheritsched.3:63
2111 #, no-wrap
2112 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2113 msgstr ""
2114
2115 #.  FIXME what are the defaults for scheduler settings?
2116 #. type: Plain text
2117 #: build/C/man3/pthread_attr_setinheritsched.3:70
2118 msgid ""
2119 "Threads that are created using I<attr> take their scheduling attributes from "
2120 "the values specified by the attributes object."
2121 msgstr ""
2122
2123 #. type: Plain text
2124 #: build/C/man3/pthread_attr_setinheritsched.3:74
2125 msgid ""
2126 "The default setting of the inherit scheduler attribute in a newly "
2127 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2128 msgstr ""
2129
2130 #. type: Plain text
2131 #: build/C/man3/pthread_attr_setinheritsched.3:81
2132 msgid ""
2133 "The B<pthread_attr_getinheritsched>()  returns the inherit scheduler "
2134 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2135 "by I<inheritsched>."
2136 msgstr ""
2137
2138 #. type: Plain text
2139 #: build/C/man3/pthread_attr_setinheritsched.3:87
2140 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2141 msgstr ""
2142
2143 #. type: Plain text
2144 #: build/C/man3/pthread_attr_setinheritsched.3:91
2145 msgid "Invalid value in I<inheritsched>."
2146 msgstr ""
2147
2148 #.  .SH VERSIONS
2149 #.  Available since glibc 2.0.
2150 #. type: Plain text
2151 #: build/C/man3/pthread_attr_setinheritsched.3:98
2152 msgid ""
2153 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2154 "to set the attribute to an unsupported value\") for "
2155 "B<pthread_attr_setinheritsched>()."
2156 msgstr ""
2157
2158 #. type: Plain text
2159 #: build/C/man3/pthread_attr_setinheritsched.3:103
2160 #: build/C/man3/pthread_attr_setschedparam.3:91
2161 #: build/C/man3/pthread_attr_setschedpolicy.3:91
2162 msgid "See B<pthread_setschedparam>(3)."
2163 msgstr ""
2164
2165 #.  FIXME . Track status of the following bug:
2166 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2167 #. type: Plain text
2168 #: build/C/man3/pthread_attr_setinheritsched.3:119
2169 msgid ""
2170 "As at glibc 2.8, if a thread attributes object is initialized using "
2171 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2172 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2173 "if the inherit scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2174 "then a thread created using the attribute object wrongly inherits its "
2175 "scheduling attributes from the creating thread.  This bug does not occur if "
2176 "either the scheduling policy or scheduling priority attribute is explicitly "
2177 "set in the thread attributes object before calling B<pthread_create>(3)."
2178 msgstr ""
2179
2180 #. type: Plain text
2181 #: build/C/man3/pthread_attr_setinheritsched.3:128
2182 msgid ""
2183 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2184 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2185 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2186 "(3), B<pthreads>(7)"
2187 msgstr ""
2188
2189 #. type: TH
2190 #: build/C/man3/pthread_attr_setschedparam.3:24
2191 #, no-wrap
2192 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2193 msgstr ""
2194
2195 #. type: Plain text
2196 #: build/C/man3/pthread_attr_setschedparam.3:28
2197 msgid ""
2198 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2199 "parameter attributes in thread attributes object"
2200 msgstr ""
2201
2202 #. type: Plain text
2203 #: build/C/man3/pthread_attr_setschedparam.3:36
2204 #, no-wrap
2205 msgid ""
2206 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2207 "B<                               const struct sched_param *>I<param>B<);>\n"
2208 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2209 "B<                               struct sched_param *>I<param>B<);>\n"
2210 msgstr ""
2211
2212 #. type: Plain text
2213 #: build/C/man3/pthread_attr_setschedparam.3:49
2214 msgid ""
2215 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2216 "attributes of the thread attributes object referred to by I<attr> to the "
2217 "values specified in the buffer pointed to by I<param>.  These attributes "
2218 "determine the scheduling parameters of a thread created using the thread "
2219 "attributes object I<attr>."
2220 msgstr ""
2221
2222 #. type: Plain text
2223 #: build/C/man3/pthread_attr_setschedparam.3:56
2224 msgid ""
2225 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2226 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2227 "by I<param>."
2228 msgstr ""
2229
2230 #. type: Plain text
2231 #: build/C/man3/pthread_attr_setschedparam.3:58
2232 msgid "Scheduling parameters are maintained in the following structure:"
2233 msgstr ""
2234
2235 #. type: Plain text
2236 #: build/C/man3/pthread_attr_setschedparam.3:64
2237 #: build/C/man3/pthread_setschedparam.3:66
2238 #, no-wrap
2239 msgid ""
2240 "struct sched_param {\n"
2241 "    int sched_priority;     /* Scheduling priority */\n"
2242 "};\n"
2243 msgstr ""
2244
2245 #. type: Plain text
2246 #: build/C/man3/pthread_attr_setschedparam.3:71
2247 #: build/C/man3/pthread_setschedparam.3:73
2248 msgid ""
2249 "As can be seen, only one scheduling parameter is supported.  For details of "
2250 "the permitted ranges for scheduling priorities in each scheduling policy, "
2251 "see B<sched_setscheduler>(2)."
2252 msgstr ""
2253
2254 #.  .SH VERSIONS
2255 #.  Available since glibc 2.0.
2256 #. type: Plain text
2257 #: build/C/man3/pthread_attr_setschedparam.3:86
2258 msgid ""
2259 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2260 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2261 "(but portable and future-proof applications should nevertheless handle a "
2262 "possible error return)."
2263 msgstr ""
2264
2265 #. type: Plain text
2266 #: build/C/man3/pthread_attr_setschedparam.3:95
2267 msgid ""
2268 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2269 "policies supported on Linux."
2270 msgstr ""
2271
2272 #. type: Plain text
2273 #: build/C/man3/pthread_attr_setschedparam.3:105
2274 msgid ""
2275 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2276 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2277 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2278 "(3), B<pthreads>(7)"
2279 msgstr ""
2280
2281 #. type: TH
2282 #: build/C/man3/pthread_attr_setschedpolicy.3:24
2283 #, no-wrap
2284 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2285 msgstr ""
2286
2287 #. type: Plain text
2288 #: build/C/man3/pthread_attr_setschedpolicy.3:28
2289 msgid ""
2290 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2291 "scheduling policy attribute in thread attributes object"
2292 msgstr ""
2293
2294 #. type: Plain text
2295 #: build/C/man3/pthread_attr_setschedpolicy.3:36
2296 #, no-wrap
2297 msgid ""
2298 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2299 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2300 msgstr ""
2301
2302 #. type: Plain text
2303 #: build/C/man3/pthread_attr_setschedpolicy.3:49
2304 msgid ""
2305 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2306 "attribute of the thread attributes object referred to by I<attr> to the "
2307 "value specified in I<policy>.  This attribute determines the scheduling "
2308 "policy of a thread created using the thread attributes object I<attr>."
2309 msgstr ""
2310
2311 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2312 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2313 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2314 #. type: Plain text
2315 #: build/C/man3/pthread_attr_setschedpolicy.3:62
2316 msgid ""
2317 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2318 "B<SCHED_OTHER>, with the semantics described in B<sched_setscheduler>(2)."
2319 msgstr ""
2320
2321 #. type: Plain text
2322 #: build/C/man3/pthread_attr_setschedpolicy.3:69
2323 msgid ""
2324 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2325 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2326 "by I<policy>."
2327 msgstr ""
2328
2329 #. type: Plain text
2330 #: build/C/man3/pthread_attr_setschedpolicy.3:75
2331 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2332 msgstr ""
2333
2334 #. type: Plain text
2335 #: build/C/man3/pthread_attr_setschedpolicy.3:79
2336 msgid "Invalid value in I<policy>."
2337 msgstr ""
2338
2339 #.  .SH VERSIONS
2340 #.  Available since glibc 2.0.
2341 #. type: Plain text
2342 #: build/C/man3/pthread_attr_setschedpolicy.3:86
2343 msgid ""
2344 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2345 "to set the attribute to an unsupported value\") for "
2346 "B<pthread_attr_setschedpolicy>()."
2347 msgstr ""
2348
2349 #. type: Plain text
2350 #: build/C/man3/pthread_attr_setschedpolicy.3:100
2351 msgid ""
2352 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2353 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2354 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2355 "(3), B<pthreads>(7)"
2356 msgstr ""
2357
2358 #. type: TH
2359 #: build/C/man3/pthread_attr_setscope.3:24
2360 #, no-wrap
2361 msgid "PTHREAD_ATTR_SETSCOPE"
2362 msgstr ""
2363
2364 #. type: Plain text
2365 #: build/C/man3/pthread_attr_setscope.3:28
2366 msgid ""
2367 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2368 "attribute in thread attributes object"
2369 msgstr ""
2370
2371 #. type: Plain text
2372 #: build/C/man3/pthread_attr_setscope.3:36
2373 #, no-wrap
2374 msgid ""
2375 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2376 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2377 msgstr ""
2378
2379 #. type: Plain text
2380 #: build/C/man3/pthread_attr_setscope.3:50
2381 msgid ""
2382 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2383 "of the thread attributes object referred to by I<attr> to the value "
2384 "specified in I<scope>.  The contention scope attribute defines the set of "
2385 "threads against which a thread competes for resources such as the CPU.  "
2386 "POSIX.1-2001 specifies two possible values for I<scope>:"
2387 msgstr ""
2388
2389 #. type: TP
2390 #: build/C/man3/pthread_attr_setscope.3:50
2391 #, no-wrap
2392 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2393 msgstr ""
2394
2395 #. type: Plain text
2396 #: build/C/man3/pthread_attr_setscope.3:58
2397 msgid ""
2398 "The thread competes for resources with all other threads in all processes on "
2399 "the system that are in the same scheduling allocation domain (a group of one "
2400 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2401 "to one another according to their scheduling policy and priority."
2402 msgstr ""
2403
2404 #. type: TP
2405 #: build/C/man3/pthread_attr_setscope.3:58
2406 #, no-wrap
2407 msgid "B<PTHREAD_SCOPE_PROCESS>"
2408 msgstr ""
2409
2410 #. type: Plain text
2411 #: build/C/man3/pthread_attr_setscope.3:73
2412 msgid ""
2413 "The thread competes for resources with all other threads in the same process "
2414 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
2415 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2416 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
2417 "leaves it unspecified how these threads contend with other threads in other "
2418 "process on the system or with other threads in the same process that were "
2419 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
2420 msgstr ""
2421
2422 #. type: Plain text
2423 #: build/C/man3/pthread_attr_setscope.3:80
2424 msgid ""
2425 "POSIX.1-2001 only requires that an implementation support one of these "
2426 "contention scopes, but permits both to be supported.  Linux supports "
2427 "B<PTHREAD_SCOPE_SYSTEM>, but not B<PTHREAD_SCOPE_PROCESS>."
2428 msgstr ""
2429
2430 #. type: Plain text
2431 #: build/C/man3/pthread_attr_setscope.3:88
2432 msgid ""
2433 "The B<pthread_attr_getscope>()  function returns the contention scope "
2434 "attribute of the thread attributes object referred to by I<attr> in the "
2435 "buffer pointed to by I<scope>."
2436 msgstr ""
2437
2438 #. type: Plain text
2439 #: build/C/man3/pthread_attr_setscope.3:94
2440 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
2441 msgstr ""
2442
2443 #. type: Plain text
2444 #: build/C/man3/pthread_attr_setscope.3:98
2445 msgid "An invalid value was specified in I<scope>."
2446 msgstr ""
2447
2448 #. type: TP
2449 #: build/C/man3/pthread_attr_setscope.3:98
2450 #, no-wrap
2451 msgid "B<ENOTSUP>"
2452 msgstr ""
2453
2454 #. type: Plain text
2455 #: build/C/man3/pthread_attr_setscope.3:104
2456 msgid ""
2457 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
2458 "supported on Linux."
2459 msgstr ""
2460
2461 #. type: Plain text
2462 #: build/C/man3/pthread_attr_setscope.3:114
2463 msgid ""
2464 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a "
2465 "userspace thread is bound directly to a single kernel-scheduling entity.  "
2466 "This is the case on Linux for the obsolete LinuxThreads implementation and "
2467 "the modern NPTL implementation, which are both 1:1 threading implementations."
2468 msgstr ""
2469
2470 #. type: Plain text
2471 #: build/C/man3/pthread_attr_setscope.3:117
2472 msgid ""
2473 "POSIX.1-2001 specifies that the default contention scope is implementation-"
2474 "defined."
2475 msgstr ""
2476
2477 #. type: Plain text
2478 #: build/C/man3/pthread_attr_setscope.3:125
2479 msgid ""
2480 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2481 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2482 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2483 msgstr ""
2484
2485 #. type: TH
2486 #: build/C/man3/pthread_attr_setstack.3:24
2487 #, no-wrap
2488 msgid "PTHREAD_ATTR_SETSTACK"
2489 msgstr ""
2490
2491 #. type: Plain text
2492 #: build/C/man3/pthread_attr_setstack.3:28
2493 msgid ""
2494 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
2495 "thread attributes object"
2496 msgstr ""
2497
2498 #. type: Plain text
2499 #: build/C/man3/pthread_attr_setstack.3:36
2500 #, no-wrap
2501 msgid ""
2502 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2503 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2504 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2505 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2506 msgstr ""
2507
2508 #. type: Plain text
2509 #: build/C/man3/pthread_attr_setstack.3:43 build/C/man3/pthread_sigqueue.3:39
2510 msgid ""
2511 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
2512 msgstr ""
2513
2514 #. type: Plain text
2515 #: build/C/man3/pthread_attr_setstack.3:48
2516 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2517 msgstr ""
2518
2519 #. type: Plain text
2520 #: build/C/man3/pthread_attr_setstack.3:50
2521 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2522 msgstr ""
2523
2524 #. type: Plain text
2525 #: build/C/man3/pthread_attr_setstack.3:66
2526 msgid ""
2527 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
2528 "size attributes of the thread attributes object referred to by I<attr> to "
2529 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
2530 "attributes specify the location and size of the stack that should be used by "
2531 "a thread that is created using the thread attributes object I<attr>."
2532 msgstr ""
2533
2534 #. type: Plain text
2535 #: build/C/man3/pthread_attr_setstack.3:72
2536 msgid ""
2537 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
2538 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
2539 "allocated buffer should be both readable and writable."
2540 msgstr ""
2541
2542 #. type: Plain text
2543 #: build/C/man3/pthread_attr_setstack.3:83
2544 msgid ""
2545 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
2546 "size attributes of the thread attributes object referred to by I<attr> in "
2547 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
2548 msgstr ""
2549
2550 #. type: Plain text
2551 #: build/C/man3/pthread_attr_setstack.3:89
2552 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
2553 msgstr ""
2554
2555 #. type: Plain text
2556 #: build/C/man3/pthread_attr_setstack.3:100
2557 msgid ""
2558 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
2559 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
2560 "stacksize> is not suitably aligned."
2561 msgstr ""
2562
2563 #. type: Plain text
2564 #: build/C/man3/pthread_attr_setstack.3:108
2565 msgid ""
2566 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
2567 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
2568 "caller."
2569 msgstr ""
2570
2571 #. type: Plain text
2572 #: build/C/man3/pthread_attr_setstack.3:110
2573 msgid "These functions are provided by glibc since version 2.2."
2574 msgstr ""
2575
2576 #. type: Plain text
2577 #: build/C/man3/pthread_attr_setstack.3:120
2578 msgid ""
2579 "These functions are provided for applications that must ensure that a "
2580 "thread's stack is placed in a particular location.  For most applications, "
2581 "this is not necessary, and the use of these functions should be avoided.  "
2582 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
2583 "stack size other than the default.)"
2584 msgstr ""
2585
2586 #. type: Plain text
2587 #: build/C/man3/pthread_attr_setstack.3:131
2588 msgid ""
2589 "When an application employs B<pthread_attr_setstack>(), it takes over the "
2590 "responsibility of allocating the stack.  Any guard size value that was set "
2591 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
2592 "is the application's responsibility to allocate a guard area (one or more "
2593 "pages protected against reading and writing)  to handle the possibility of "
2594 "stack overflow."
2595 msgstr ""
2596
2597 #. type: Plain text
2598 #: build/C/man3/pthread_attr_setstack.3:142
2599 msgid ""
2600 "The address specified in I<stackaddr> should be suitably aligned: for full "
2601 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
2602 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
2603 "should also be a multiple of the system page size."
2604 msgstr ""
2605
2606 #. type: Plain text
2607 #: build/C/man3/pthread_attr_setstack.3:151
2608 msgid ""
2609 "If I<attr> is used to create multiple threads, then the caller must change "
2610 "the stack address attribute between calls to B<pthread_create>(3); "
2611 "otherwise, the threads will attempt to use the same memory area for their "
2612 "stacks, and chaos will ensue."
2613 msgstr ""
2614
2615 #. type: Plain text
2616 #: build/C/man3/pthread_attr_setstack.3:164
2617 msgid ""
2618 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
2619 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
2620 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2621 msgstr ""
2622
2623 #. type: TH
2624 #: build/C/man3/pthread_attr_setstackaddr.3:24
2625 #, no-wrap
2626 msgid "PTHREAD_ATTR_SETSTACKADDR"
2627 msgstr ""
2628
2629 #. type: Plain text
2630 #: build/C/man3/pthread_attr_setstackaddr.3:28
2631 msgid ""
2632 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
2633 "attribute in thread attributes object"
2634 msgstr ""
2635
2636 #. type: Plain text
2637 #: build/C/man3/pthread_attr_setstackaddr.3:36
2638 #, no-wrap
2639 msgid ""
2640 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
2641 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
2642 msgstr ""
2643
2644 #. type: Plain text
2645 #: build/C/man3/pthread_attr_setstackaddr.3:46
2646 msgid ""
2647 "These functions are obsolete: B<do not use them.> Use "
2648 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
2649 msgstr ""
2650
2651 #. type: Plain text
2652 #: build/C/man3/pthread_attr_setstackaddr.3:57
2653 msgid ""
2654 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
2655 "attribute of the thread attributes object referred to by I<attr> to the "
2656 "value specified in I<stackaddr>.  This attribute specifies the location of "
2657 "the stack that should be used by a thread that is created using the thread "
2658 "attributes object I<attr>."
2659 msgstr ""
2660
2661 #. type: Plain text
2662 #: build/C/man3/pthread_attr_setstackaddr.3:63
2663 msgid ""
2664 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
2665 "that was allocated by the caller.  The pages of the allocated buffer should "
2666 "be both readable and writable."
2667 msgstr ""
2668
2669 #. type: Plain text
2670 #: build/C/man3/pthread_attr_setstackaddr.3:71
2671 msgid ""
2672 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
2673 "attribute of the thread attributes object referred to by I<attr> in the "
2674 "buffer pointed to by I<stackaddr>."
2675 msgstr ""
2676
2677 #. type: Plain text
2678 #: build/C/man3/pthread_attr_setstackaddr.3:78
2679 msgid ""
2680 "No errors are defined (but applications should nevertheless handle a "
2681 "possible error return)."
2682 msgstr ""
2683
2684 #. type: Plain text
2685 #: build/C/man3/pthread_attr_setstackaddr.3:83
2686 msgid ""
2687 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
2688 "POSIX.1-2008 removes the specification of these functions."
2689 msgstr ""
2690
2691 #. type: Plain text
2692 #: build/C/man3/pthread_attr_setstackaddr.3:107
2693 msgid ""
2694 "I<Do not use these functions!> They cannot be portably used, since they "
2695 "provide no way of specifying the direction of growth or the range of the "
2696 "stack.  For example, on architectures with a stack that grows downward, "
2697 "I<stackaddr> specifies the next address past the I<highest> address of the "
2698 "allocated stack area.  However, on architectures with a stack that grows "
2699 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
2700 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
2701 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
2702 "in the allocated stack area (and the I<stacksize> argument specifies the "
2703 "range of the stack)."
2704 msgstr ""
2705
2706 #. type: Plain text
2707 #: build/C/man3/pthread_attr_setstackaddr.3:113
2708 msgid ""
2709 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
2710 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2711 msgstr ""
2712
2713 #. type: TH
2714 #: build/C/man3/pthread_attr_setstacksize.3:24
2715 #, no-wrap
2716 msgid "PTHREAD_ATTR_SETSTACKSIZE"
2717 msgstr ""
2718
2719 #. type: TH
2720 #: build/C/man3/pthread_attr_setstacksize.3:24
2721 #, no-wrap
2722 msgid "2008-11-05"
2723 msgstr ""
2724
2725 #. type: Plain text
2726 #: build/C/man3/pthread_attr_setstacksize.3:28
2727 msgid ""
2728 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
2729 "attribute in thread attributes object"
2730 msgstr ""
2731
2732 #. type: Plain text
2733 #: build/C/man3/pthread_attr_setstacksize.3:36
2734 #, no-wrap
2735 msgid ""
2736 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
2737 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
2738 msgstr ""
2739
2740 #. type: Plain text
2741 #: build/C/man3/pthread_attr_setstacksize.3:46
2742 msgid ""
2743 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
2744 "of the thread attributes object referred to by I<attr> to the value "
2745 "specified in I<stacksize>."
2746 msgstr ""
2747
2748 #. type: Plain text
2749 #: build/C/man3/pthread_attr_setstacksize.3:50
2750 msgid ""
2751 "The stack size attribute determines the minimum size (in bytes) that will be "
2752 "allocated for threads created using the thread attributes object I<attr>."
2753 msgstr ""
2754
2755 #. type: Plain text
2756 #: build/C/man3/pthread_attr_setstacksize.3:58
2757 msgid ""
2758 "The B<pthread_attr_getstacksize>()  function returns the stack size "
2759 "attribute of the thread attributes object referred to by I<attr> in the "
2760 "buffer pointed to by I<stacksize>."
2761 msgstr ""
2762
2763 #. type: Plain text
2764 #: build/C/man3/pthread_attr_setstacksize.3:64
2765 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
2766 msgstr ""
2767
2768 #. type: Plain text
2769 #: build/C/man3/pthread_attr_setstacksize.3:69
2770 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
2771 msgstr ""
2772
2773 #.  e.g., MacOS
2774 #. type: Plain text
2775 #: build/C/man3/pthread_attr_setstacksize.3:78
2776 msgid ""
2777 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
2778 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
2779 msgstr ""
2780
2781 #. type: Plain text
2782 #: build/C/man3/pthread_attr_setstacksize.3:85 build/C/man3/pthread_join.3:125
2783 msgid "See B<pthread_create>(3)."
2784 msgstr ""
2785
2786 #. type: Plain text
2787 #: build/C/man3/pthread_attr_setstacksize.3:88
2788 msgid ""
2789 "For details on the default stack size of new threads, see B<pthread_create>"
2790 "(3)."
2791 msgstr ""
2792
2793 #. type: Plain text
2794 #: build/C/man3/pthread_attr_setstacksize.3:91
2795 msgid ""
2796 "A thread's stack size is fixed at the time of thread creation.  Only the "
2797 "main thread can dynamically grow its stack."
2798 msgstr ""
2799
2800 #. type: Plain text
2801 #: build/C/man3/pthread_attr_setstacksize.3:96
2802 msgid ""
2803 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
2804 "the size and location of a caller-allocated stack that is to be used by a "
2805 "thread."
2806 msgstr ""
2807
2808 #. type: Plain text
2809 #: build/C/man3/pthread_attr_setstacksize.3:108
2810 msgid ""
2811 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
2812 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
2813 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
2814 "stack will be at least I<stacksize> bytes."
2815 msgstr ""
2816
2817 #. type: Plain text
2818 #: build/C/man3/pthread_attr_setstacksize.3:115
2819 msgid ""
2820 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
2821 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
2822 msgstr ""
2823
2824 #. type: TH
2825 #: build/C/man3/pthread_cancel.3:24
2826 #, no-wrap
2827 msgid "PTHREAD_CANCEL"
2828 msgstr ""
2829
2830 #. type: TH
2831 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_setschedparam.3:24
2832 #: build/C/man3/pthread_testcancel.3:24
2833 #, no-wrap
2834 msgid "2008-11-17"
2835 msgstr ""
2836
2837 #. type: Plain text
2838 #: build/C/man3/pthread_cancel.3:27
2839 msgid "pthread_cancel - send a cancellation request to a thread"
2840 msgstr ""
2841
2842 #. type: Plain text
2843 #: build/C/man3/pthread_cancel.3:32
2844 #, no-wrap
2845 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
2846 msgstr ""
2847
2848 #. type: Plain text
2849 #: build/C/man3/pthread_cancel.3:43
2850 msgid ""
2851 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
2852 "I<thread>.  Whether and when the target thread reacts to the cancellation "
2853 "request depends on two attributes that are under the control of that thread: "
2854 "its cancelability I<state> and I<type>."
2855 msgstr ""
2856
2857 #. type: Plain text
2858 #: build/C/man3/pthread_cancel.3:55
2859 msgid ""
2860 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
2861 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
2862 "has disabled cancellation, then a cancellation request remains queued until "
2863 "the thread enables cancellation.  If a thread has enabled cancellation, then "
2864 "its cancelability type determines when cancellation occurs."
2865 msgstr ""
2866
2867 #. type: Plain text
2868 #: build/C/man3/pthread_cancel.3:71
2869 msgid ""
2870 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
2871 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
2872 "Asynchronous cancelability means that the thread can be canceled at any time "
2873 "(usually immediately, but the system does not guarantee this).  Deferred "
2874 "cancelability means that cancellation will be delayed until the thread next "
2875 "calls a function that is a I<cancellation point>.  A list of functions that "
2876 "are or may be cancellation points is provided in I<pthreads>(7)."
2877 msgstr ""
2878
2879 #. type: Plain text
2880 #: build/C/man3/pthread_cancel.3:75
2881 msgid ""
2882 "When a cancellation requested is acted on, the following steps occur for "
2883 "I<thread> (in this order):"
2884 msgstr ""
2885
2886 #. type: IP
2887 #: build/C/man3/pthread_cancel.3:75 build/C/man3/pthread_cleanup_push.3:66
2888 #, no-wrap
2889 msgid "1."
2890 msgstr ""
2891
2892 #. type: Plain text
2893 #: build/C/man3/pthread_cancel.3:80
2894 msgid ""
2895 "Cancellation clean-up handlers are popped (in the reverse of the order in "
2896 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
2897 msgstr ""
2898
2899 #. type: IP
2900 #: build/C/man3/pthread_cancel.3:80 build/C/man3/pthread_cleanup_push.3:70
2901 #, no-wrap
2902 msgid "2."
2903 msgstr ""
2904
2905 #. type: Plain text
2906 #: build/C/man3/pthread_cancel.3:85
2907 msgid ""
2908 "Thread-specific data destructors are called, in an unspecified order.  (See "
2909 "B<pthread_key_create>(3).)"
2910 msgstr ""
2911
2912 #. type: IP
2913 #: build/C/man3/pthread_cancel.3:85 build/C/man3/pthread_cleanup_push.3:78
2914 #, no-wrap
2915 msgid "3."
2916 msgstr ""
2917
2918 #. type: Plain text
2919 #: build/C/man3/pthread_cancel.3:89
2920 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
2921 msgstr ""
2922
2923 #. type: Plain text
2924 #: build/C/man3/pthread_cancel.3:97
2925 msgid ""
2926 "The above steps happen asynchronously with respect to the B<pthread_cancel>"
2927 "()  call; the return status of B<pthread_cancel>()  merely informs the "
2928 "caller whether the cancellation request was successfully queued."
2929 msgstr ""
2930
2931 #. type: Plain text
2932 #: build/C/man3/pthread_cancel.3:106
2933 msgid ""
2934 "After a canceled thread has terminated, a join with that thread using "
2935 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
2936 "status.  (Joining with a thread is the only way to know that cancellation "
2937 "has completed.)"
2938 msgstr ""
2939
2940 #. type: Plain text
2941 #: build/C/man3/pthread_cancel.3:111
2942 msgid ""
2943 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
2944 "error number."
2945 msgstr ""
2946
2947 #. type: TP
2948 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_detach.3:57
2949 #: build/C/man3/pthread_getcpuclockid.3:55 build/C/man3/pthread_join.3:91
2950 #: build/C/man3/pthread_kill.3:59 build/C/man3/pthread_setaffinity_np.3:111
2951 #: build/C/man3/pthread_setschedparam.3:111
2952 #: build/C/man3/pthread_setschedprio.3:67 build/C/man3/pthread_sigqueue.3:83
2953 #, no-wrap
2954 msgid "B<ESRCH>"
2955 msgstr ""
2956
2957 #. type: Plain text
2958 #: build/C/man3/pthread_cancel.3:119 build/C/man3/pthread_detach.3:62
2959 #: build/C/man3/pthread_getcpuclockid.3:60 build/C/man3/pthread_join.3:96
2960 #: build/C/man3/pthread_kill.3:64 build/C/man3/pthread_setaffinity_np.3:116
2961 #: build/C/man3/pthread_setschedparam.3:116
2962 #: build/C/man3/pthread_setschedprio.3:72
2963 msgid "No thread with the ID I<thread> could be found."
2964 msgstr ""
2965
2966 #. type: Plain text
2967 #: build/C/man3/pthread_cancel.3:129
2968 msgid ""
2969 "On Linux, cancellation is implemented using signals.  Under the NPTL "
2970 "threading implementation, the first real-time signal (i.e., signal 32) is "
2971 "used for this purpose.  On LinuxThreads, the second real-time signal is "
2972 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
2973 msgstr ""
2974
2975 #. type: Plain text
2976 #: build/C/man3/pthread_cancel.3:135
2977 msgid ""
2978 "The program below creates a thread and then cancels it.  The main thread "
2979 "joins with the canceled thread to check that its exit status was "
2980 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
2981 "run the program:"
2982 msgstr ""
2983
2984 #. type: Plain text
2985 #: build/C/man3/pthread_cancel.3:143
2986 #, no-wrap
2987 msgid ""
2988 "$ ./a.out\n"
2989 "thread_func(): started; cancellation disabled\n"
2990 "main(): sending cancellation request\n"
2991 "thread_func(): about to enable cancellation\n"
2992 "main(): thread was canceled\n"
2993 msgstr ""
2994
2995 #. type: Plain text
2996 #: build/C/man3/pthread_cancel.3:153
2997 #, no-wrap
2998 msgid ""
2999 "#include E<lt>pthread.hE<gt>\n"
3000 "#include E<lt>stdio.hE<gt>\n"
3001 "#include E<lt>errno.hE<gt>\n"
3002 "#include E<lt>stdlib.hE<gt>\n"
3003 "#include E<lt>unistd.hE<gt>\n"
3004 msgstr ""
3005
3006 #. type: Plain text
3007 #: build/C/man3/pthread_cancel.3:161
3008 #, no-wrap
3009 msgid ""
3010 "static void *\n"
3011 "thread_func(void *ignored_argument)\n"
3012 "{\n"
3013 "    int s;\n"
3014 msgstr ""
3015
3016 #. type: Plain text
3017 #: build/C/man3/pthread_cancel.3:164
3018 #, no-wrap
3019 msgid ""
3020 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3021 "       immediately react to a cancellation request */\n"
3022 msgstr ""
3023
3024 #. type: Plain text
3025 #: build/C/man3/pthread_cancel.3:168
3026 #, no-wrap
3027 msgid ""
3028 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3029 "    if (s != 0)\n"
3030 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3031 msgstr ""
3032
3033 #. type: Plain text
3034 #: build/C/man3/pthread_cancel.3:172
3035 #, no-wrap
3036 msgid ""
3037 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3038 "    sleep(5);\n"
3039 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3040 msgstr ""
3041
3042 #. type: Plain text
3043 #: build/C/man3/pthread_cancel.3:176
3044 #, no-wrap
3045 msgid ""
3046 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3047 "    if (s != 0)\n"
3048 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3049 msgstr ""
3050
3051 #. type: Plain text
3052 #: build/C/man3/pthread_cancel.3:178
3053 #, no-wrap
3054 msgid "    /* sleep() is a cancellation point */\n"
3055 msgstr ""
3056
3057 #. type: Plain text
3058 #: build/C/man3/pthread_cancel.3:180
3059 #, no-wrap
3060 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3061 msgstr ""
3062
3063 #. type: Plain text
3064 #: build/C/man3/pthread_cancel.3:182
3065 #, no-wrap
3066 msgid "    /* Should never get here */\n"
3067 msgstr ""
3068
3069 #. type: Plain text
3070 #: build/C/man3/pthread_cancel.3:186
3071 #, no-wrap
3072 msgid ""
3073 "    printf(\"thread_func(): not canceled!\\en\");\n"
3074 "    return NULL;\n"
3075 "}\n"
3076 msgstr ""
3077
3078 #. type: Plain text
3079 #: build/C/man3/pthread_cancel.3:193
3080 #, no-wrap
3081 msgid ""
3082 "int\n"
3083 "main(void)\n"
3084 "{\n"
3085 "    pthread_t thr;\n"
3086 "    void *res;\n"
3087 "    int s;\n"
3088 msgstr ""
3089
3090 #. type: Plain text
3091 #: build/C/man3/pthread_cancel.3:195
3092 #, no-wrap
3093 msgid "    /* Start a thread and then send it a cancellation request */\n"
3094 msgstr ""
3095
3096 #. type: Plain text
3097 #: build/C/man3/pthread_cancel.3:199
3098 #, no-wrap
3099 msgid ""
3100 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3101 "    if (s != 0)\n"
3102 "        handle_error_en(s, \"pthread_create\");\n"
3103 msgstr ""
3104
3105 #. type: Plain text
3106 #: build/C/man3/pthread_cancel.3:201
3107 #, no-wrap
3108 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3109 msgstr ""
3110
3111 #. type: Plain text
3112 #: build/C/man3/pthread_cancel.3:206
3113 #, no-wrap
3114 msgid ""
3115 "    printf(\"main(): sending cancellation request\\en\");\n"
3116 "    s = pthread_cancel(thr);\n"
3117 "    if (s != 0)\n"
3118 "        handle_error_en(s, \"pthread_cancel\");\n"
3119 msgstr ""
3120
3121 #. type: Plain text
3122 #: build/C/man3/pthread_cancel.3:208
3123 #, no-wrap
3124 msgid "    /* Join with thread to see what its exit status was */\n"
3125 msgstr ""
3126
3127 #. type: Plain text
3128 #: build/C/man3/pthread_cancel.3:212 build/C/man3/pthread_cleanup_push.3:300
3129 #, no-wrap
3130 msgid ""
3131 "    s = pthread_join(thr, &res);\n"
3132 "    if (s != 0)\n"
3133 "        handle_error_en(s, \"pthread_join\");\n"
3134 msgstr ""
3135
3136 #. type: Plain text
3137 #: build/C/man3/pthread_cancel.3:219
3138 #, no-wrap
3139 msgid ""
3140 "    if (res == PTHREAD_CANCELED)\n"
3141 "        printf(\"main(): thread was canceled\\en\");\n"
3142 "    else\n"
3143 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3144 "    exit(EXIT_SUCCESS);\n"
3145 "}\n"
3146 msgstr ""
3147
3148 #. type: Plain text
3149 #: build/C/man3/pthread_cancel.3:230
3150 msgid ""
3151 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3152 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3153 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3154 msgstr ""
3155
3156 #. type: TH
3157 #: build/C/man3/pthread_cleanup_push.3:24
3158 #, no-wrap
3159 msgid "PTHREAD_CLEANUP_PUSH"
3160 msgstr ""
3161
3162 #. type: TH
3163 #: build/C/man3/pthread_cleanup_push.3:24
3164 #: build/C/man3/pthread_setcancelstate.3:24
3165 #, no-wrap
3166 msgid "2008-11-24"
3167 msgstr ""
3168
3169 #. type: Plain text
3170 #: build/C/man3/pthread_cleanup_push.3:28
3171 msgid ""
3172 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
3173 "clean-up handlers"
3174 msgstr ""
3175
3176 #. type: Plain text
3177 #: build/C/man3/pthread_cleanup_push.3:35
3178 #, no-wrap
3179 msgid ""
3180 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3181 "B<                          void *>I<arg>B<);>\n"
3182 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3183 msgstr ""
3184
3185 #. type: Plain text
3186 #: build/C/man3/pthread_cleanup_push.3:45
3187 msgid ""
3188 "These functions manipulate the calling thread's stack of thread-cancellation "
3189 "clean-up handlers.  A clean-up handler is a function that is automatically "
3190 "executed when a thread is canceled (or in various other circumstances "
3191 "described below); it might, for example, unlock a mutex so that it becomes "
3192 "available to other threads in the process."
3193 msgstr ""
3194
3195 #. type: Plain text
3196 #: build/C/man3/pthread_cleanup_push.3:56
3197 msgid ""
3198 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
3199 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
3200 "be given I<arg> as its argument."
3201 msgstr ""
3202
3203 #. type: Plain text
3204 #: build/C/man3/pthread_cleanup_push.3:63
3205 msgid ""
3206 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
3207 "stack of clean-up handlers, and optionally executes it if I<execute> is "
3208 "nonzero."
3209 msgstr ""
3210
3211 #. type: Plain text
3212 #: build/C/man3/pthread_cleanup_push.3:66
3213 msgid ""
3214 "A cancellation clean-up handler is popped from the stack and executed in the "
3215 "following circumstances:"
3216 msgstr ""
3217
3218 #. type: Plain text
3219 #: build/C/man3/pthread_cleanup_push.3:70
3220 msgid ""
3221 "When a thread is canceled, all of the stacked clean-up handlers are popped "
3222 "and executed in the reverse of the order in which they were pushed onto the "
3223 "stack."
3224 msgstr ""
3225
3226 #. type: Plain text
3227 #: build/C/man3/pthread_cleanup_push.3:78
3228 msgid ""
3229 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
3230 "handlers are executed as described in the preceding point.  (Clean-up "
3231 "handlers are I<not> called if the thread terminates by performing a "
3232 "I<return> from the thread start function.)"
3233 msgstr ""
3234
3235 #. type: Plain text
3236 #: build/C/man3/pthread_cleanup_push.3:84
3237 msgid ""
3238 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
3239 "argument, the top-most clean-up handler is popped and executed."
3240 msgstr ""
3241
3242 #. type: Plain text
3243 #: build/C/man3/pthread_cleanup_push.3:96
3244 msgid ""
3245 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
3246 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
3247 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
3248 "calls to these functions are paired within the same function, and at the "
3249 "same lexical nesting level.  (In other words, a clean-up handler is only "
3250 "established during the execution of a specified section of code.)"
3251 msgstr ""
3252
3253 #. type: Plain text
3254 #: build/C/man3/pthread_cleanup_push.3:116
3255 msgid ""
3256 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
3257 "call has been made to B<pthread_cleanup_push>()  or B<pthread_cleanup_pop>"
3258 "()  without the matching call of the pair since the jump buffer was filled "
3259 "by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, calling B<longjmp>(3)  "
3260 "(B<siglongjmp>(3))  from inside a clean-up handler produces undefined "
3261 "results unless the jump buffer was also filled by B<setjmp>(3)  (B<sigsetjmp>"
3262 "(3))  inside the handler."
3263 msgstr ""
3264
3265 #. type: Plain text
3266 #: build/C/man3/pthread_cleanup_push.3:118
3267 msgid "These functions do not return a value."
3268 msgstr ""
3269
3270 #.  SH VERSIONS
3271 #.  Available since glibc 2.0
3272 #. type: Plain text
3273 #: build/C/man3/pthread_cleanup_push.3:122
3274 msgid "There are no errors."
3275 msgstr ""
3276
3277 #. type: Plain text
3278 #: build/C/man3/pthread_cleanup_push.3:133
3279 msgid ""
3280 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
3281 "functions I<are> implemented as macros that expand to text containing \\(aqB<"
3282 "{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
3283 "declared within the scope of paired calls to these functions will only be "
3284 "visible within that scope."
3285 msgstr ""
3286
3287 #.  The text was actually added in the 2004 TC2
3288 #. type: Plain text
3289 #: build/C/man3/pthread_cleanup_push.3:148
3290 msgid ""
3291 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
3292 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
3293 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
3294 "avoid doing this."
3295 msgstr ""
3296
3297 #. type: Plain text
3298 #: build/C/man3/pthread_cleanup_push.3:163
3299 msgid ""
3300 "The program below provides a simple example of the use of the functions "
3301 "described in this page.  The program creates a thread that executes a loop "
3302 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
3303 "loop increments a global variable, I<cnt>, once each second.  Depending on "
3304 "what command-line arguments are supplied, the main thread sends the other "
3305 "thread a cancellation request, or sets a global variable that causes the "
3306 "other thread to exit its loop and terminate normally (by doing a I<return>)."
3307 msgstr ""
3308
3309 #. type: Plain text
3310 #: build/C/man3/pthread_cleanup_push.3:166
3311 msgid ""
3312 "In the following shell session, the main thread sends a cancellation request "
3313 "to the other thread:"
3314 msgstr ""
3315
3316 #. type: Plain text
3317 #: build/C/man3/pthread_cleanup_push.3:176
3318 #, no-wrap
3319 msgid ""
3320 "$ B<./a.out>\n"
3321 "New thread started\n"
3322 "cnt = 0\n"
3323 "cnt = 1\n"
3324 "Canceling thread\n"
3325 "Called clean-up handler\n"
3326 "Thread was canceled; cnt = 0\n"
3327 msgstr ""
3328
3329 #. type: Plain text
3330 #: build/C/man3/pthread_cleanup_push.3:184
3331 msgid ""
3332 "From the above, we see that the thread was canceled, and that the "
3333 "cancellation clean-up handler was called and it reset the value of the "
3334 "global variable I<cnt> to 0."
3335 msgstr ""
3336
3337 #. type: Plain text
3338 #: build/C/man3/pthread_cleanup_push.3:187
3339 msgid ""
3340 "In the next run, the main program sets a global variable that causes other "
3341 "thread to terminate normally:"
3342 msgstr ""
3343
3344 #. type: Plain text
3345 #: build/C/man3/pthread_cleanup_push.3:195
3346 #, no-wrap
3347 msgid ""
3348 "$ B<./a.out x>\n"
3349 "New thread started\n"
3350 "cnt = 0\n"
3351 "cnt = 1\n"
3352 "Thread terminated normally; cnt = 2\n"
3353 msgstr ""
3354
3355 #. type: Plain text
3356 #: build/C/man3/pthread_cleanup_push.3:203
3357 msgid ""
3358 "From the above, we see that the clean-up handler was not executed (because "
3359 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
3360 msgstr ""
3361
3362 #. type: Plain text
3363 #: build/C/man3/pthread_cleanup_push.3:208
3364 msgid ""
3365 "In the next run, the main program sets a global variable that causes the "
3366 "other thread to terminate normally, and supplies a nonzero value for "
3367 "I<cleanup_pop_arg>:"
3368 msgstr ""
3369
3370 #. type: Plain text
3371 #: build/C/man3/pthread_cleanup_push.3:217
3372 #, no-wrap
3373 msgid ""
3374 "$ B<./a.out x 1>\n"
3375 "New thread started\n"
3376 "cnt = 0\n"
3377 "cnt = 1\n"
3378 "Called clean-up handler\n"
3379 "Thread terminated normally; cnt = 0\n"
3380 msgstr ""
3381
3382 #. type: Plain text
3383 #: build/C/man3/pthread_cleanup_push.3:224
3384 msgid ""
3385 "In the above, we see that although the thread was not canceled, the clean-up "
3386 "handler was executed, because the argument given to B<pthread_cleanup_pop>"
3387 "()  was nonzero."
3388 msgstr ""
3389
3390 #. type: Plain text
3391 #: build/C/man3/pthread_cleanup_push.3:233
3392 #, no-wrap
3393 msgid ""
3394 "#include E<lt>pthread.hE<gt>\n"
3395 "#include E<lt>sys/types.hE<gt>\n"
3396 "#include E<lt>stdio.hE<gt>\n"
3397 "#include E<lt>stdlib.hE<gt>\n"
3398 "#include E<lt>unistd.hE<gt>\n"
3399 "#include E<lt>errno.hE<gt>\n"
3400 msgstr ""
3401
3402 #. type: Plain text
3403 #: build/C/man3/pthread_cleanup_push.3:240
3404 #, no-wrap
3405 msgid ""
3406 "static int done = 0;\n"
3407 "static int cleanup_pop_arg = 0;\n"
3408 "static int cnt = 0;\n"
3409 msgstr ""
3410
3411 #. type: Plain text
3412 #: build/C/man3/pthread_cleanup_push.3:247
3413 #, no-wrap
3414 msgid ""
3415 "static void\n"
3416 "cleanup_handler(void *arg)\n"
3417 "{\n"
3418 "    printf(\"Called clean-up handler\\en\");\n"
3419 "    cnt = 0;\n"
3420 "}\n"
3421 msgstr ""
3422
3423 #. type: Plain text
3424 #: build/C/man3/pthread_cleanup_push.3:252
3425 #, no-wrap
3426 msgid ""
3427 "static void *\n"
3428 "thread_start(void *arg)\n"
3429 "{\n"
3430 "    time_t start, curr;\n"
3431 msgstr ""
3432
3433 #. type: Plain text
3434 #: build/C/man3/pthread_cleanup_push.3:254
3435 #, no-wrap
3436 msgid "    printf(\"New thread started\\en\");\n"
3437 msgstr ""
3438
3439 #. type: Plain text
3440 #: build/C/man3/pthread_cleanup_push.3:256
3441 #, no-wrap
3442 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
3443 msgstr ""
3444
3445 #. type: Plain text
3446 #: build/C/man3/pthread_cleanup_push.3:258
3447 #, no-wrap
3448 msgid "    curr = start = time(NULL);\n"
3449 msgstr ""
3450
3451 #. type: Plain text
3452 #: build/C/man3/pthread_cleanup_push.3:267
3453 #, no-wrap
3454 msgid ""
3455 "    while (!done) {\n"
3456 "        pthread_testcancel();           /* A cancellation point */\n"
3457 "        if (curr E<lt> time(NULL)) {\n"
3458 "            curr = time(NULL);\n"
3459 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
3460 "            cnt++;\n"
3461 "        }\n"
3462 "    }\n"
3463 msgstr ""
3464
3465 #. type: Plain text
3466 #: build/C/man3/pthread_cleanup_push.3:271
3467 #, no-wrap
3468 msgid ""
3469 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
3470 "    return NULL;\n"
3471 "}\n"
3472 msgstr ""
3473
3474 #. type: Plain text
3475 #: build/C/man3/pthread_cleanup_push.3:278
3476 #, no-wrap
3477 msgid ""
3478 "int\n"
3479 "main(int argc, char *argv[])\n"
3480 "{\n"
3481 "    pthread_t thr;\n"
3482 "    int s;\n"
3483 "    void *res;\n"
3484 msgstr ""
3485
3486 #. type: Plain text
3487 #: build/C/man3/pthread_cleanup_push.3:282
3488 #, no-wrap
3489 msgid ""
3490 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
3491 "    if (s != 0)\n"
3492 "        handle_error_en(s, \"pthread_create\");\n"
3493 msgstr ""
3494
3495 #. type: Plain text
3496 #: build/C/man3/pthread_cleanup_push.3:284
3497 #, no-wrap
3498 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
3499 msgstr ""
3500
3501 #. type: Plain text
3502 #: build/C/man3/pthread_cleanup_push.3:289
3503 #, no-wrap
3504 msgid ""
3505 "    if (argc E<gt> 1) {\n"
3506 "        if (argc E<gt> 2)\n"
3507 "            cleanup_pop_arg = atoi(argv[2]);\n"
3508 "        done = 1;\n"
3509 msgstr ""
3510
3511 #. type: Plain text
3512 #: build/C/man3/pthread_cleanup_push.3:296
3513 #, no-wrap
3514 msgid ""
3515 "    } else {\n"
3516 "        printf(\"Canceling thread\\en\");\n"
3517 "        s = pthread_cancel(thr);\n"
3518 "        if (s != 0)\n"
3519 "            handle_error_en(s, \"pthread_cancel\");\n"
3520 "    }\n"
3521 msgstr ""
3522
3523 #. type: Plain text
3524 #: build/C/man3/pthread_cleanup_push.3:307
3525 #, no-wrap
3526 msgid ""
3527 "    if (res == PTHREAD_CANCELED)\n"
3528 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
3529 "    else\n"
3530 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
3531 "    exit(EXIT_SUCCESS);\n"
3532 "}\n"
3533 msgstr ""
3534
3535 #. type: Plain text
3536 #: build/C/man3/pthread_cleanup_push.3:314
3537 msgid ""
3538 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
3539 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3540 msgstr ""
3541
3542 #. type: TH
3543 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
3544 #, no-wrap
3545 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
3546 msgstr ""
3547
3548 #. type: TH
3549 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
3550 #, no-wrap
3551 msgid "2008-12-04"
3552 msgstr ""
3553
3554 #. type: Plain text
3555 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
3556 msgid ""
3557 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
3558 "thread cancellation clean-up handlers while saving cancelability type"
3559 msgstr ""
3560
3561 #. type: Plain text
3562 #: build/C/man3/pthread_cleanup_push_defer_np.3:35
3563 #, no-wrap
3564 msgid ""
3565 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
3566 "B<                                   void *>I<arg>B<);>\n"
3567 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
3568 msgstr ""
3569
3570 #. type: Plain text
3571 #: build/C/man3/pthread_cleanup_push_defer_np.3:43
3572 msgid ""
3573 "These functions are the same as B<pthread_cleanup_push>(3)  and "
3574 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
3575 msgstr ""
3576
3577 #. type: Plain text
3578 #: build/C/man3/pthread_cleanup_push_defer_np.3:56
3579 msgid ""
3580 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
3581 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
3582 "addition, it also saves the thread's current cancelability type, and sets "
3583 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
3584 "this ensures that cancellation clean-up will occur even if the thread's "
3585 "cancelability type was \"asynchronous\" before the the call."
3586 msgstr ""
3587
3588 #. type: Plain text
3589 #: build/C/man3/pthread_cleanup_push_defer_np.3:65
3590 msgid ""
3591 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
3592 "the top-most clean-up handler from the thread's stack of cancellation clean-"
3593 "up handlers.  In addition, it restores the thread's cancelability type to "
3594 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
3595 msgstr ""
3596
3597 #. type: Plain text
3598 #: build/C/man3/pthread_cleanup_push_defer_np.3:71
3599 msgid ""
3600 "The caller must ensure that calls to these functions are paired within the "
3601 "same function, and at the same lexical nesting level.  Other restrictions "
3602 "apply, as described in B<pthread_cleanup_push>(3)."
3603 msgstr ""
3604
3605 #. type: Plain text
3606 #: build/C/man3/pthread_cleanup_push_defer_np.3:73
3607 msgid "This sequence of calls:"
3608 msgstr ""
3609
3610 #. type: Plain text
3611 #: build/C/man3/pthread_cleanup_push_defer_np.3:78
3612 #, no-wrap
3613 msgid ""
3614 "pthread_cleanup_push_defer_np(routine, arg);\n"
3615 "pthread_cleanup_pop_restore_np(execute);\n"
3616 msgstr ""
3617
3618 #. type: Plain text
3619 #: build/C/man3/pthread_cleanup_push_defer_np.3:82
3620 msgid "is equivalent to (but shorter and more efficient than):"
3621 msgstr ""
3622
3623 #. type: Plain text
3624 #: build/C/man3/pthread_cleanup_push_defer_np.3:88
3625 #, no-wrap
3626 msgid "int oldtype;\n"
3627 msgstr ""
3628
3629 #. type: Plain text
3630 #: build/C/man3/pthread_cleanup_push_defer_np.3:94
3631 #, no-wrap
3632 msgid ""
3633 "pthread_cleanup_push(routine, arg);\n"
3634 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
3635 "\\&...\n"
3636 "pthread_setcanceltype(oldtype, NULL);\n"
3637 "pthread_cleanup_pop(execute);\n"
3638 msgstr ""
3639
3640 #. type: Plain text
3641 #: build/C/man3/pthread_cleanup_push_defer_np.3:107
3642 msgid ""
3643 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
3644 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3645 msgstr ""
3646
3647 #. type: TH
3648 #: build/C/man3/pthread_create.3:24
3649 #, no-wrap
3650 msgid "PTHREAD_CREATE"
3651 msgstr ""
3652
3653 #. type: Plain text
3654 #: build/C/man3/pthread_create.3:27
3655 msgid "pthread_create - create a new thread"
3656 msgstr ""
3657
3658 #. type: Plain text
3659 #: build/C/man3/pthread_create.3:33
3660 #, no-wrap
3661 msgid ""
3662 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
3663 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
3664 msgstr ""
3665
3666 #. type: Plain text
3667 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
3668 #: build/C/man3/pthread_join.3:35 build/C/man3/pthread_kill.3:35
3669 #: build/C/man3/pthread_sigmask.3:36 build/C/man3/pthread_sigqueue.3:35
3670 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
3671 msgid "Compile and link with I<-pthread>."
3672 msgstr ""
3673
3674 #. type: Plain text
3675 #: build/C/man3/pthread_create.3:45
3676 msgid ""
3677 "The B<pthread_create>()  function starts a new thread in the calling "
3678 "process.  The new thread starts execution by invoking I<start_routine>(); "
3679 "I<arg> is passed as the sole argument of I<start_routine>()."
3680 msgstr ""
3681
3682 #. type: Plain text
3683 #: build/C/man3/pthread_create.3:47
3684 msgid "The new thread terminates in one of the following ways:"
3685 msgstr ""
3686
3687 #. type: IP
3688 #: build/C/man3/pthread_create.3:47 build/C/man3/pthread_create.3:53
3689 #: build/C/man3/pthread_create.3:61 build/C/man3/pthread_create.3:64
3690 #: build/C/man3/pthread_getattr_np.3:49 build/C/man3/pthread_getattr_np.3:52
3691 #: build/C/man3/pthread_getattr_np.3:55
3692 #, no-wrap
3693 msgid "*"
3694 msgstr ""
3695
3696 #. type: Plain text
3697 #: build/C/man3/pthread_create.3:53
3698 msgid ""
3699 "It calls B<pthread_exit>(3), specifying an exit status value that is "
3700 "available to another thread in the same process that calls B<pthread_join>"
3701 "(3)."
3702 msgstr ""
3703
3704 #. type: Plain text
3705 #: build/C/man3/pthread_create.3:61
3706 msgid ""
3707 "It returns from I<start_routine>().  This is equivalent to calling "
3708 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
3709 msgstr ""
3710
3711 #. type: Plain text
3712 #: build/C/man3/pthread_create.3:64
3713 msgid "It is canceled (see B<pthread_cancel>(3))."
3714 msgstr ""
3715
3716 #. type: Plain text
3717 #: build/C/man3/pthread_create.3:70
3718 msgid ""
3719 "Any of the threads in the process calls B<exit>(3), or the main thread "
3720 "performs a return from I<main>().  This causes the termination of all "
3721 "threads in the process."
3722 msgstr ""
3723
3724 #. type: Plain text
3725 #: build/C/man3/pthread_create.3:84
3726 msgid ""
3727 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
3728 "are used at thread creation time to determine attributes for the new thread; "
3729 "this structure is initialized using B<pthread_attr_init>(3)  and related "
3730 "functions.  If I<attr> is NULL, then the thread is created with default "
3731 "attributes."
3732 msgstr ""
3733
3734 #. type: Plain text
3735 #: build/C/man3/pthread_create.3:91
3736 msgid ""
3737 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
3738 "the new thread in the buffer pointed to by I<thread>; this identifier is "
3739 "used to refer to the thread in subsequent calls to other pthreads functions."
3740 msgstr ""
3741
3742 #. type: Plain text
3743 #: build/C/man3/pthread_create.3:99
3744 msgid ""
3745 "The new thread inherits a copy of the creating thread's signal mask "
3746 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
3747 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
3748 "thread's alternate signal stack (B<sigaltstack>(2))."
3749 msgstr ""
3750
3751 #. type: Plain text
3752 #: build/C/man3/pthread_create.3:102
3753 msgid ""
3754 "The new thread inherits the calling thread's floating-point environment "
3755 "(B<fenv>(3))."
3756 msgstr ""
3757
3758 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
3759 #. type: Plain text
3760 #: build/C/man3/pthread_create.3:107
3761 msgid ""
3762 "The initial value of the new thread's CPU-time clock is 0 (see "
3763 "B<pthread_getcpuclockid>(3))."
3764 msgstr ""
3765
3766 #. type: SS
3767 #: build/C/man3/pthread_create.3:107
3768 #, no-wrap
3769 msgid "Linux-specific details"
3770 msgstr ""
3771
3772 #. type: Plain text
3773 #: build/C/man3/pthread_create.3:113
3774 msgid ""
3775 "The new thread inherits copies of the calling thread's capability sets (see "
3776 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
3777 msgstr ""
3778
3779 #. type: Plain text
3780 #: build/C/man3/pthread_create.3:120
3781 msgid ""
3782 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
3783 "number, and the contents of I<*thread> are undefined."
3784 msgstr ""
3785
3786 #. type: TP
3787 #: build/C/man3/pthread_create.3:121 build/C/man3/pthread_sigqueue.3:69
3788 #, no-wrap
3789 msgid "B<EAGAIN>"
3790 msgstr ""
3791
3792 #. type: Plain text
3793 #: build/C/man3/pthread_create.3:135
3794 msgid ""
3795 "Insufficient resources to create another thread, or a system-imposed limit "
3796 "on the number of threads was encountered.  The latter case may occur in two "
3797 "ways: the B<RLIMIT_NPROC> soft resource limit (set via B<setrlimit>(2)), "
3798 "which limits the number of process for a real user ID, was reached; or the "
3799 "kernel's system-wide limit on the number of threads, I</proc/sys/kernel/"
3800 "threads-max>, was reached."
3801 msgstr ""
3802
3803 #. type: Plain text
3804 #: build/C/man3/pthread_create.3:139
3805 msgid "Invalid settings in I<attr>."
3806 msgstr ""
3807
3808 #. type: TP
3809 #: build/C/man3/pthread_create.3:139 build/C/man3/pthread_setschedparam.3:126
3810 #: build/C/man3/pthread_setschedprio.3:63
3811 #, no-wrap
3812 msgid "B<EPERM>"
3813 msgstr ""
3814
3815 #. type: Plain text
3816 #: build/C/man3/pthread_create.3:144
3817 msgid ""
3818 "No permission to set the scheduling policy and parameters specified in "
3819 "I<attr>."
3820 msgstr ""
3821
3822 #. type: Plain text
3823 #: build/C/man3/pthread_create.3:158
3824 msgid ""
3825 "See B<pthread_self>(3)  for further information on the thread ID returned in "
3826 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
3827 "being employed, after a call to B<pthread_create>(), it is indeterminate "
3828 "which thread\\(emthe caller or the new thread\\(emwill next execute."
3829 msgstr ""
3830
3831 #. type: Plain text
3832 #: build/C/man3/pthread_create.3:178
3833 msgid ""
3834 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
3835 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
3836 "terminate and fetch its exit status.  Only when a terminated joinable thread "
3837 "has been joined are the last of its resources released back to the system.  "
3838 "When a detached thread terminates, its resources are automatically released "
3839 "back to the system: it is not possible to join with the thread in order to "
3840 "obtain its exit status.  Making a thread detached is useful for some types "
3841 "of daemon threads whose exit status the application does not need to care "
3842 "about.  By default, a new thread is created in a joinable state, unless "
3843 "I<attr> was set to create the thread in a detached state (using "
3844 "B<pthread_attr_setdetachstate>(3))."
3845 msgstr ""
3846
3847 #.  FIXME . Perhaps some of the following detail should be in
3848 #.  a future pthread_attr_setstacksize(3) page.
3849 #. type: Plain text
3850 #: build/C/man3/pthread_create.3:194
3851 msgid ""
3852 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
3853 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
3854 "resource limit I<at the time the program started> has any value other than "
3855 "\"unlimited\", then it determines the default stack size of new threads.  "
3856 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
3857 "explicitly set in the I<attr> argument used to create a thread, in order to "
3858 "obtain a stack size other than the default."
3859 msgstr ""
3860
3861 #. type: Plain text
3862 #: build/C/man3/pthread_create.3:198
3863 msgid ""
3864 "The program below demonstrates the use of B<pthread_create>(), as well as a "
3865 "number of other functions in the pthreads API."
3866 msgstr ""
3867
3868 #. type: Plain text
3869 #: build/C/man3/pthread_create.3:203
3870 msgid ""
3871 "In the following run, on a system providing the NPTL threading "
3872 "implementation, the stack size defaults to the value given by the \"stack "
3873 "size\" resource limit:"
3874 msgstr ""
3875
3876 #. type: Plain text
3877 #: build/C/man3/pthread_create.3:215
3878 #, no-wrap
3879 msgid ""
3880 "$B< ulimit -s>\n"
3881 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
3882 "$B< ./a.out hola salut servus>\n"
3883 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
3884 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
3885 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
3886 "Joined with thread 1; returned value was HOLA\n"
3887 "Joined with thread 2; returned value was SALUT\n"
3888 "Joined with thread 3; returned value was SERVUS\n"
3889 msgstr ""
3890
3891 #. type: Plain text
3892 #: build/C/man3/pthread_create.3:221
3893 msgid ""
3894 "In the next run, the program explicitly sets a stack size of 1MB (using "
3895 "B<pthread_attr_setstacksize>(3))  for the created threads:"
3896 msgstr ""
3897
3898 #. type: Plain text
3899 #: build/C/man3/pthread_create.3:231
3900 #, no-wrap
3901 msgid ""
3902 "$B< ./a.out -s 0x100000 hola salut servus>\n"
3903 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
3904 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
3905 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
3906 "Joined with thread 1; returned value was HOLA\n"
3907 "Joined with thread 2; returned value was SALUT\n"
3908 "Joined with thread 3; returned value was SERVUS\n"
3909 msgstr ""
3910
3911 #. type: Plain text
3912 #: build/C/man3/pthread_create.3:243
3913 #, no-wrap
3914 msgid ""
3915 "#include E<lt>pthread.hE<gt>\n"
3916 "#include E<lt>string.hE<gt>\n"
3917 "#include E<lt>stdio.hE<gt>\n"
3918 "#include E<lt>stdlib.hE<gt>\n"
3919 "#include E<lt>unistd.hE<gt>\n"
3920 "#include E<lt>errno.hE<gt>\n"
3921 "#include E<lt>ctype.hE<gt>\n"
3922 msgstr ""
3923
3924 #. type: Plain text
3925 #: build/C/man3/pthread_create.3:249 build/C/man3/pthread_getcpuclockid.3:107
3926 #, no-wrap
3927 msgid ""
3928 "#define handle_error(msg) \\e\n"
3929 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
3930 msgstr ""
3931
3932 #. type: Plain text
3933 #: build/C/man3/pthread_create.3:255
3934 #, no-wrap
3935 msgid ""
3936 "struct thread_info {    /* Used as argument to thread_start() */\n"
3937 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
3938 "    int       thread_num;       /* Application-defined thread # */\n"
3939 "    char     *argv_string;      /* From command-line argument */\n"
3940 "};\n"
3941 msgstr ""
3942
3943 #. type: Plain text
3944 #: build/C/man3/pthread_create.3:258
3945 #, no-wrap
3946 msgid ""
3947 "/* Thread start function: display address near top of our stack,\n"
3948 "   and return upper-cased copy of argv_string */\n"
3949 msgstr ""
3950
3951 #. type: Plain text
3952 #: build/C/man3/pthread_create.3:264
3953 #, no-wrap
3954 msgid ""
3955 "static void *\n"
3956 "thread_start(void *arg)\n"
3957 "{\n"
3958 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
3959 "    char *uargv, *p;\n"
3960 msgstr ""
3961
3962 #. type: Plain text
3963 #: build/C/man3/pthread_create.3:267
3964 #, no-wrap
3965 msgid ""
3966 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
3967 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
3968 msgstr ""
3969
3970 #. type: Plain text
3971 #: build/C/man3/pthread_create.3:271
3972 #, no-wrap
3973 msgid ""
3974 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
3975 "    if (uargv == NULL)\n"
3976 "        handle_error(\"strdup\");\n"
3977 msgstr ""
3978
3979 #. type: Plain text
3980 #: build/C/man3/pthread_create.3:274
3981 #, no-wrap
3982 msgid ""
3983 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
3984 "        *p = toupper(*p);\n"
3985 msgstr ""
3986
3987 #. type: Plain text
3988 #: build/C/man3/pthread_create.3:277
3989 #, no-wrap
3990 msgid ""
3991 "    return uargv;\n"
3992 "}\n"
3993 msgstr ""
3994
3995 #. type: Plain text
3996 #: build/C/man3/pthread_create.3:286
3997 #, no-wrap
3998 msgid ""
3999 "int\n"
4000 "main(int argc, char *argv[])\n"
4001 "{\n"
4002 "    int s, tnum, opt, num_threads;\n"
4003 "    struct thread_info *tinfo;\n"
4004 "    pthread_attr_t attr;\n"
4005 "    int stack_size;\n"
4006 "    void *res;\n"
4007 msgstr ""
4008
4009 #. type: Plain text
4010 #: build/C/man3/pthread_create.3:288
4011 #, no-wrap
4012 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
4013 msgstr ""
4014
4015 #. type: Plain text
4016 #: build/C/man3/pthread_create.3:295
4017 #, no-wrap
4018 msgid ""
4019 "    stack_size = -1;\n"
4020 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4021 "        switch (opt) {\n"
4022 "        case \\(aqs\\(aq:\n"
4023 "            stack_size = strtoul(optarg, NULL, 0);\n"
4024 "            break;\n"
4025 msgstr ""
4026
4027 #. type: Plain text
4028 #: build/C/man3/pthread_create.3:302
4029 #, no-wrap
4030 msgid ""
4031 "        default:\n"
4032 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4033 "                    argv[0]);\n"
4034 "            exit(EXIT_FAILURE);\n"
4035 "        }\n"
4036 "    }\n"
4037 msgstr ""
4038
4039 #. type: Plain text
4040 #: build/C/man3/pthread_create.3:304
4041 #, no-wrap
4042 msgid "    num_threads = argc - optind;\n"
4043 msgstr ""
4044
4045 #. type: Plain text
4046 #: build/C/man3/pthread_create.3:306
4047 #, no-wrap
4048 msgid "    /* Initialize thread creation attributes */\n"
4049 msgstr ""
4050
4051 #. type: Plain text
4052 #: build/C/man3/pthread_create.3:310
4053 #, no-wrap
4054 msgid ""
4055 "    s = pthread_attr_init(&attr);\n"
4056 "    if (s != 0)\n"
4057 "        handle_error_en(s, \"pthread_attr_init\");\n"
4058 msgstr ""
4059
4060 #. type: Plain text
4061 #: build/C/man3/pthread_create.3:316
4062 #, no-wrap
4063 msgid ""
4064 "    if (stack_size E<gt> 0) {\n"
4065 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4066 "        if (s != 0)\n"
4067 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4068 "    }\n"
4069 msgstr ""
4070
4071 #. type: Plain text
4072 #: build/C/man3/pthread_create.3:318
4073 #, no-wrap
4074 msgid "    /* Allocate memory for pthread_create() arguments */\n"
4075 msgstr ""
4076
4077 #. type: Plain text
4078 #: build/C/man3/pthread_create.3:322
4079 #, no-wrap
4080 msgid ""
4081 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4082 "    if (tinfo == NULL)\n"
4083 "        handle_error(\"calloc\");\n"
4084 msgstr ""
4085
4086 #. type: Plain text
4087 #: build/C/man3/pthread_create.3:324
4088 #, no-wrap
4089 msgid "    /* Create one thread for each command-line argument */\n"
4090 msgstr ""
4091
4092 #. type: Plain text
4093 #: build/C/man3/pthread_create.3:328
4094 #, no-wrap
4095 msgid ""
4096 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4097 "        tinfo[tnum].thread_num = tnum + 1;\n"
4098 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4099 msgstr ""
4100
4101 #. type: Plain text
4102 #: build/C/man3/pthread_create.3:331
4103 #, no-wrap
4104 msgid ""
4105 "        /* The pthread_create() call stores the thread ID into\n"
4106 "           corresponding element of tinfo[] */\n"
4107 msgstr ""
4108
4109 #. type: Plain text
4110 #: build/C/man3/pthread_create.3:337
4111 #, no-wrap
4112 msgid ""
4113 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4114 "                           &thread_start, &tinfo[tnum]);\n"
4115 "        if (s != 0)\n"
4116 "            handle_error_en(s, \"pthread_create\");\n"
4117 "    }\n"
4118 msgstr ""
4119
4120 #. type: Plain text
4121 #: build/C/man3/pthread_create.3:340
4122 #, no-wrap
4123 msgid ""
4124 "    /* Destroy the thread attributes object, since it is no\n"
4125 "       longer needed */\n"
4126 msgstr ""
4127
4128 #. type: Plain text
4129 #: build/C/man3/pthread_create.3:344 build/C/man3/pthread_setschedparam.3:420
4130 #, no-wrap
4131 msgid ""
4132 "    s = pthread_attr_destroy(&attr);\n"
4133 "    if (s != 0)\n"
4134 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4135 msgstr ""
4136
4137 #. type: Plain text
4138 #: build/C/man3/pthread_create.3:346
4139 #, no-wrap
4140 msgid "    /* Now join with each thread, and display its returned value */\n"
4141 msgstr ""
4142
4143 #. type: Plain text
4144 #: build/C/man3/pthread_create.3:351
4145 #, no-wrap
4146 msgid ""
4147 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4148 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4149 "        if (s != 0)\n"
4150 "            handle_error_en(s, \"pthread_join\");\n"
4151 msgstr ""
4152
4153 #. type: Plain text
4154 #: build/C/man3/pthread_create.3:356
4155 #, no-wrap
4156 msgid ""
4157 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4158 "                tinfo[tnum].thread_num, (char *) res);\n"
4159 "        free(res);      /* Free memory allocated by thread */\n"
4160 "    }\n"
4161 msgstr ""
4162
4163 #. type: Plain text
4164 #: build/C/man3/pthread_create.3:360
4165 #, no-wrap
4166 msgid ""
4167 "    free(tinfo);\n"
4168 "    exit(EXIT_SUCCESS);\n"
4169 "}\n"
4170 msgstr ""
4171
4172 #. type: Plain text
4173 #: build/C/man3/pthread_create.3:367
4174 msgid ""
4175 "In the obsolete LinuxThreads implementation, each of the threads in a "
4176 "process has a different process ID.  This is in violation of the POSIX "
4177 "threads specification, and is the source of many other nonconformances to "
4178 "the standard; see B<pthreads>(7)."
4179 msgstr ""
4180
4181 #. type: Plain text
4182 #: build/C/man3/pthread_create.3:378
4183 msgid ""
4184 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
4185 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
4186 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
4187 "(7)"
4188 msgstr ""
4189
4190 #. type: TH
4191 #: build/C/man3/pthread_detach.3:24
4192 #, no-wrap
4193 msgid "PTHREAD_DETACH"
4194 msgstr ""
4195
4196 #. type: TH
4197 #: build/C/man3/pthread_detach.3:24 build/C/man3/pthread_join.3:24
4198 #, no-wrap
4199 msgid "2008-11-27"
4200 msgstr ""
4201
4202 #. type: Plain text
4203 #: build/C/man3/pthread_detach.3:27
4204 msgid "pthread_detach - detach a thread"
4205 msgstr ""
4206
4207 #. type: Plain text
4208 #: build/C/man3/pthread_detach.3:32
4209 #, no-wrap
4210 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
4211 msgstr ""
4212
4213 #. type: Plain text
4214 #: build/C/man3/pthread_detach.3:44
4215 msgid ""
4216 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
4217 "as detached.  When a detached thread terminates, its resources are "
4218 "automatically released back to the system without the need for another "
4219 "thread to join with the terminated thread."
4220 msgstr ""
4221
4222 #. type: Plain text
4223 #: build/C/man3/pthread_detach.3:47
4224 msgid ""
4225 "Attempting to detach an already detached thread results in unspecified "
4226 "behavior."
4227 msgstr ""
4228
4229 #. type: Plain text
4230 #: build/C/man3/pthread_detach.3:52
4231 msgid ""
4232 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
4233 "number."
4234 msgstr ""
4235
4236 #. type: Plain text
4237 #: build/C/man3/pthread_detach.3:57 build/C/man3/pthread_join.3:87
4238 msgid "I<thread> is not a joinable thread."
4239 msgstr ""
4240
4241 #. type: Plain text
4242 #: build/C/man3/pthread_detach.3:68
4243 msgid ""
4244 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
4245 "or be made joinable again."
4246 msgstr ""
4247
4248 #. type: Plain text
4249 #: build/C/man3/pthread_detach.3:75
4250 msgid ""
4251 "A new thread can be created in a detached state using "
4252 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
4253 "I<attr> argument of B<pthread_create>(3)."
4254 msgstr ""
4255
4256 #. type: Plain text
4257 #: build/C/man3/pthread_detach.3:82
4258 msgid ""
4259 "The detached attribute merely determines the behavior of the system when the "
4260 "thread terminates; it does not prevent the thread from being terminated if "
4261 "the process terminates using B<exit>(3)  (or equivalently, if the main "
4262 "thread returns)."
4263 msgstr ""
4264
4265 #. type: Plain text
4266 #: build/C/man3/pthread_detach.3:91
4267 msgid ""
4268 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
4269 "thread that an application creates, so that system resources for the thread "
4270 "can be released.  (But note that the resources of all threads are freed when "
4271 "the process terminates.)"
4272 msgstr ""
4273
4274 #. type: Plain text
4275 #: build/C/man3/pthread_detach.3:93
4276 msgid "The following statement detaches the calling thread:"
4277 msgstr ""
4278
4279 #. type: Plain text
4280 #: build/C/man3/pthread_detach.3:95
4281 #, no-wrap
4282 msgid "    pthread_detach(pthread_self());\n"
4283 msgstr ""
4284
4285 #. type: Plain text
4286 #: build/C/man3/pthread_detach.3:102
4287 msgid ""
4288 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
4289 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
4290 msgstr ""
4291
4292 #. type: TH
4293 #: build/C/man3/pthread_equal.3:24
4294 #, no-wrap
4295 msgid "PTHREAD_EQUAL"
4296 msgstr ""
4297
4298 #. type: TH
4299 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
4300 #, no-wrap
4301 msgid "2009-03-30"
4302 msgstr ""
4303
4304 #. type: Plain text
4305 #: build/C/man3/pthread_equal.3:27
4306 msgid "pthread_equal - compare thread IDs"
4307 msgstr ""
4308
4309 #. type: Plain text
4310 #: build/C/man3/pthread_equal.3:32
4311 #, no-wrap
4312 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
4313 msgstr ""
4314
4315 #. type: Plain text
4316 #: build/C/man3/pthread_equal.3:38
4317 msgid "The B<pthread_equal>()  function compares two thread identifiers."
4318 msgstr ""
4319
4320 #. type: Plain text
4321 #: build/C/man3/pthread_equal.3:42
4322 msgid ""
4323 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
4324 "value; otherwise, it returns 0."
4325 msgstr ""
4326
4327 #.  SH VERSIONS
4328 #.  Available since glibc 2.0
4329 #. type: Plain text
4330 #: build/C/man3/pthread_equal.3:44 build/C/man3/pthread_exit.3:72
4331 #: build/C/man3/pthread_self.3:47 build/C/man3/pthread_testcancel.3:55
4332 msgid "This function always succeeds."
4333 msgstr ""
4334
4335 #. type: Plain text
4336 #: build/C/man3/pthread_equal.3:53
4337 msgid ""
4338 "The B<pthread_equal>()  function is necessary because thread IDs should be "
4339 "considered opaque: there is no portable way for applications to directly "
4340 "compare two I<pthread_t> values."
4341 msgstr ""
4342
4343 #. type: Plain text
4344 #: build/C/man3/pthread_equal.3:57
4345 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
4346 msgstr ""
4347
4348 #. type: TH
4349 #: build/C/man3/pthread_exit.3:24
4350 #, no-wrap
4351 msgid "PTHREAD_EXIT"
4352 msgstr ""
4353
4354 #. type: Plain text
4355 #: build/C/man3/pthread_exit.3:27
4356 msgid "pthread_exit - terminate calling thread"
4357 msgstr ""
4358
4359 #. type: Plain text
4360 #: build/C/man3/pthread_exit.3:32
4361 #, no-wrap
4362 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
4363 msgstr ""
4364
4365 #. type: Plain text
4366 #: build/C/man3/pthread_exit.3:42
4367 msgid ""
4368 "The B<pthread_exit>()  function terminates the calling thread and returns a "
4369 "value via I<retval> that (if the thread is joinable)  is available to "
4370 "another thread in the same process that calls B<pthread_join>(3)."
4371 msgstr ""
4372
4373 #. type: Plain text
4374 #: build/C/man3/pthread_exit.3:52
4375 msgid ""
4376 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
4377 "not yet been popped, are popped (in the reverse of the order in which they "
4378 "were pushed)  and executed.  If the thread has any thread-specific data, "
4379 "then, after the clean-up handlers have been executed, the corresponding "
4380 "destructor functions are called, in an unspecified order."
4381 msgstr ""
4382
4383 #. type: Plain text
4384 #: build/C/man3/pthread_exit.3:59
4385 msgid ""
4386 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
4387 "variables, semaphores, and file descriptors) are not released, and functions "
4388 "registered using B<atexit>(3)  are not called."
4389 msgstr ""
4390
4391 #. type: Plain text
4392 #: build/C/man3/pthread_exit.3:68
4393 msgid ""
4394 "After the last thread in a process terminates, the process terminates as by "
4395 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
4396 "resources are released and functions registered using B<atexit>(3)  are "
4397 "called."
4398 msgstr ""
4399
4400 #. type: Plain text
4401 #: build/C/man3/pthread_exit.3:70
4402 msgid "This function does not return to the caller."
4403 msgstr ""
4404
4405 #. type: Plain text
4406 #: build/C/man3/pthread_exit.3:79
4407 msgid ""
4408 "Performing a return from the start function of any thread other than the "
4409 "main thread results in an implicit call to B<pthread_exit>(), using the "
4410 "function's return value as the thread's exit status."
4411 msgstr ""
4412
4413 #. type: Plain text
4414 #: build/C/man3/pthread_exit.3:85
4415 msgid ""
4416 "To allow other threads to continue execution, the main thread should "
4417 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
4418 msgstr ""
4419
4420 #. type: Plain text
4421 #: build/C/man3/pthread_exit.3:90
4422 msgid ""
4423 "The value pointed to by I<retval> should not be located on the calling "
4424 "thread's stack, since the contents of that stack are undefined after the "
4425 "thread terminates."
4426 msgstr ""
4427
4428 #.  Linux 2.6.27
4429 #.  FIXME . review a later kernel to see if this gets fixed
4430 #.  http://thread.gmane.org/gmane.linux.kernel/611611
4431 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
4432 #. type: Plain text
4433 #: build/C/man3/pthread_exit.3:102
4434 msgid ""
4435 "Currently, there are limitations in the kernel implementation logic for "
4436 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
4437 "This can manifest in problems such as a locked terminal if a stop signal is "
4438 "sent to a foreground process whose thread group leader has already called "
4439 "B<pthread_exit>()."
4440 msgstr ""
4441
4442 #. type: Plain text
4443 #: build/C/man3/pthread_exit.3:106
4444 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
4445 msgstr ""
4446
4447 #. type: TH
4448 #: build/C/man3/pthread_getattr_np.3:24
4449 #, no-wrap
4450 msgid "PTHREAD_GETATTR_NP"
4451 msgstr ""
4452
4453 #. type: Plain text
4454 #: build/C/man3/pthread_getattr_np.3:27
4455 msgid "pthread_getattr_np - get attributes of created thread"
4456 msgstr ""
4457
4458 #. type: Plain text
4459 #: build/C/man3/pthread_getattr_np.3:33
4460 #, no-wrap
4461 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
4462 msgstr ""
4463
4464 #. type: Plain text
4465 #: build/C/man3/pthread_getattr_np.3:42
4466 msgid ""
4467 "The B<pthread_getattr_np>()  function initializes the thread attributes "
4468 "object referred to by I<attr> so that it contains actual attribute values "
4469 "describing the running thread I<thread>."
4470 msgstr ""
4471
4472 #. type: Plain text
4473 #: build/C/man3/pthread_getattr_np.3:49
4474 msgid ""
4475 "The returned attribute values may differ from the corresponding attribute "
4476 "values passed in the I<attr> object that was used to create the thread using "
4477 "B<pthread_create>(3).  In particular, the following attributes may differ:"
4478 msgstr ""
4479
4480 #. type: Plain text
4481 #: build/C/man3/pthread_getattr_np.3:52
4482 msgid ""
4483 "the detach state, since a joinable thread may have detached itself after "
4484 "creation;"
4485 msgstr ""
4486
4487 #. type: Plain text
4488 #: build/C/man3/pthread_getattr_np.3:55
4489 msgid ""
4490 "the stack size, which the implementation may align to a suitable boundary."
4491 msgstr ""
4492
4493 #. type: Plain text
4494 #: build/C/man3/pthread_getattr_np.3:60
4495 msgid ""
4496 "and the guard size, which the implementation may round upward to a multiple "
4497 "of the page size, or ignore (i.e., treat as 0), if the application is "
4498 "allocating its own stack."
4499 msgstr ""
4500
4501 #. type: Plain text
4502 #: build/C/man3/pthread_getattr_np.3:65
4503 msgid ""
4504 "Furthermore, if the stack address attribute was not set in the thread "
4505 "attributes object used to create the thread, then the returned thread "
4506 "attributes object will report the actual stack address that the "
4507 "implementation selected for the thread."
4508 msgstr ""
4509
4510 #. type: Plain text
4511 #: build/C/man3/pthread_getattr_np.3:70
4512 msgid ""
4513 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
4514 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
4515 msgstr ""
4516
4517 #. type: Plain text
4518 #: build/C/man3/pthread_getattr_np.3:73
4519 #: build/C/man3/pthread_getcpuclockid.3:46
4520 msgid ""
4521 "On success, this function returns 0; on error, it returns a nonzero error "
4522 "number."
4523 msgstr ""
4524
4525 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
4526 #. type: Plain text
4527 #: build/C/man3/pthread_getattr_np.3:78
4528 msgid "Insufficient memory."
4529 msgstr ""
4530
4531 #. type: Plain text
4532 #: build/C/man3/pthread_getattr_np.3:93
4533 msgid ""
4534 "In addition, if I<thread> refers to the main thread, then "
4535 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
4536 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and B<getrlimit>"
4537 "(2), if the B<RLIMIT_STACK> resource limit is not supported."
4538 msgstr ""
4539
4540 #. type: Plain text
4541 #: build/C/man3/pthread_getattr_np.3:95
4542 msgid "This function is available in glibc since version 2.2.3."
4543 msgstr ""
4544
4545 #. type: Plain text
4546 #: build/C/man3/pthread_getattr_np.3:98
4547 #: build/C/man3/pthread_kill_other_threads_np.3:48
4548 msgid ""
4549 "This function is a nonstandard GNU extension; hence the suffix \"_np"
4550 "\" (nonportable) in the name."
4551 msgstr ""
4552
4553 #. type: Plain text
4554 #: build/C/man3/pthread_getattr_np.3:108
4555 msgid ""
4556 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
4557 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
4558 "and display its guard size, stack address, and stack size attributes.  "
4559 "Command-line arguments can be used to set these attributes to values other "
4560 "than the default when creating the thread.  The shell sessions below "
4561 "demonstrate the use of the program."
4562 msgstr ""
4563
4564 #. type: Plain text
4565 #: build/C/man3/pthread_getattr_np.3:111
4566 msgid ""
4567 "In the first run, on an x86-32 system, a thread is created using default "
4568 "attributes:"
4569 msgstr ""
4570
4571 #. type: Plain text
4572 #: build/C/man3/pthread_getattr_np.3:121
4573 #, no-wrap
4574 msgid ""
4575 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
4576 "unlimited\n"
4577 "$B< ./a.out>\n"
4578 "Attributes of created thread:\n"
4579 "        Guard size          = 4096 bytes\n"
4580 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
4581 "        Stack size          = 0x201000 (2101248) bytes\n"
4582 msgstr ""
4583
4584 #. type: Plain text
4585 #: build/C/man3/pthread_getattr_np.3:127
4586 msgid ""
4587 "In the following run, we see that if a guard size is specified, it is "
4588 "rounded up to the next multiple of the system page size (4096 bytes on "
4589 "x86-32):"
4590 msgstr ""
4591
4592 #. type: Plain text
4593 #: build/C/man3/pthread_getattr_np.3:135
4594 #, no-wrap
4595 msgid ""
4596 "$B< ./a.out -g 4097>\n"
4597 "Thread attributes object after initializations:\n"
4598 "        Guard size          = 4097 bytes\n"
4599 "        Stack address       = (nil)\n"
4600 "        Stack size          = 0x0 (0) bytes\n"
4601 msgstr ""
4602
4603 #. type: Plain text
4604 #: build/C/man3/pthread_getattr_np.3:140
4605 #, no-wrap
4606 msgid ""
4607 "Attributes of created thread:\n"
4608 "        Guard size          = 8192 bytes\n"
4609 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
4610 "        Stack size          = 0x201000 (2101248) bytes\n"
4611 msgstr ""
4612
4613 #. .in +4n
4614 #. .nf
4615 #. $ ./a.out \-s 0x8000
4616 #. Thread attributes object after initializations:
4617 #.         Guard size          = 4096 bytes
4618 #.         Stack address       = 0xffff8000 (EOS = (nil))
4619 #.         Stack size          = 0x8000 (32768) bytes
4620 #. Attributes of created thread:
4621 #.         Guard size          = 4096 bytes
4622 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
4623 #.         Stack size          = 0x8000 (32768) bytes
4624 #. .fi
4625 #. .in
4626 #. type: Plain text
4627 #: build/C/man3/pthread_getattr_np.3:159
4628 msgid ""
4629 "In the last run, the program manually allocates a stack for the thread.  In "
4630 "this case, the guard size attribute is ignored."
4631 msgstr ""
4632
4633 #. type: Plain text
4634 #: build/C/man3/pthread_getattr_np.3:164
4635 #, no-wrap
4636 msgid ""
4637 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
4638 "Allocated thread stack at 0x804d000\n"
4639 msgstr ""
4640
4641 #. type: Plain text
4642 #: build/C/man3/pthread_getattr_np.3:169
4643 #, no-wrap
4644 msgid ""
4645 "Thread attributes object after initializations:\n"
4646 "        Guard size          = 4096 bytes\n"
4647 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
4648 "        Stack size          = 0x8000 (32768) bytes\n"
4649 msgstr ""
4650
4651 #. type: Plain text
4652 #: build/C/man3/pthread_getattr_np.3:174
4653 #, no-wrap
4654 msgid ""
4655 "Attributes of created thread:\n"
4656 "        Guard size          = 0 bytes\n"
4657 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
4658 "        Stack size          = 0x8000 (32768) bytes\n"
4659 msgstr ""
4660
4661 #. type: Plain text
4662 #: build/C/man3/pthread_getattr_np.3:195
4663 #, no-wrap
4664 msgid ""
4665 "static void\n"
4666 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
4667 "{\n"
4668 "    int s;\n"
4669 "    size_t stack_size, guard_size;\n"
4670 "    void *stack_addr;\n"
4671 msgstr ""
4672
4673 #. type: Plain text
4674 #: build/C/man3/pthread_getattr_np.3:200
4675 #, no-wrap
4676 msgid ""
4677 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
4678 "    if (s != 0)\n"
4679 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
4680 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
4681 msgstr ""
4682
4683 #. type: Plain text
4684 #: build/C/man3/pthread_getattr_np.3:211
4685 #, no-wrap
4686 msgid ""
4687 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
4688 "    if (s != 0)\n"
4689 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
4690 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
4691 "    if (stack_size E<gt> 0)\n"
4692 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
4693 "    printf(\"\\en\");\n"
4694 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
4695 "            prefix, stack_size, stack_size);\n"
4696 "}\n"
4697 msgstr ""
4698
4699 #. type: Plain text
4700 #: build/C/man3/pthread_getattr_np.3:217
4701 #, no-wrap
4702 msgid ""
4703 "static void\n"
4704 "display_thread_attributes(pthread_t thread, char *prefix)\n"
4705 "{\n"
4706 "    int s;\n"
4707 "    pthread_attr_t attr;\n"
4708 msgstr ""
4709
4710 #. type: Plain text
4711 #: build/C/man3/pthread_getattr_np.3:221
4712 #, no-wrap
4713 msgid ""
4714 "    s = pthread_getattr_np(thread, &attr);\n"
4715 "    if (s != 0)\n"
4716 "        handle_error_en(s, \"pthread_getattr_np\");\n"
4717 msgstr ""
4718
4719 #. type: Plain text
4720 #: build/C/man3/pthread_getattr_np.3:223
4721 #, no-wrap
4722 msgid "    display_stack_related_attributes(&attr, prefix);\n"
4723 msgstr ""
4724
4725 #. type: Plain text
4726 #: build/C/man3/pthread_getattr_np.3:228
4727 #, no-wrap
4728 msgid ""
4729 "    s = pthread_attr_destroy(&attr);\n"
4730 "    if (s != 0)\n"
4731 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4732 "}\n"
4733 msgstr ""
4734
4735 #. type: Plain text
4736 #: build/C/man3/pthread_getattr_np.3:234
4737 #, no-wrap
4738 msgid ""
4739 "static void *           /* Start function for thread we create */\n"
4740 "thread_start(void *arg)\n"
4741 "{\n"
4742 "    printf(\"Attributes of created thread:\\en\");\n"
4743 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
4744 msgstr ""
4745
4746 #. type: Plain text
4747 #: build/C/man3/pthread_getattr_np.3:248
4748 #, no-wrap
4749 msgid ""
4750 "static void\n"
4751 "usage(char *pname, char *msg)\n"
4752 "{\n"
4753 "    if (msg != NULL)\n"
4754 "        fputs(msg, stderr);\n"
4755 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
4756 "            \" [-g guard-size]\\en\", pname);\n"
4757 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
4758 "    exit(EXIT_FAILURE);\n"
4759 "}\n"
4760 msgstr ""
4761
4762 #. type: Plain text
4763 #: build/C/man3/pthread_getattr_np.3:261
4764 #, no-wrap
4765 msgid ""
4766 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
4767 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
4768 "                              pthread_attr_t *attrp)\n"
4769 "{\n"
4770 "    int s, opt, allocate_stack;\n"
4771 "    long stack_size, guard_size;\n"
4772 "            void *stack_addr;\n"
4773 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
4774 "                                           a thread attributes object */\n"
4775 "    allocate_stack = 0;\n"
4776 "    stack_size = -1;\n"
4777 "    guard_size = -1;\n"
4778 msgstr ""
4779
4780 #. type: Plain text
4781 #: build/C/man3/pthread_getattr_np.3:270
4782 #, no-wrap
4783 msgid ""
4784 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
4785 "        switch (opt) {\n"
4786 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
4787 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
4788 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
4789 "        default:    usage(argv[0], NULL);\n"
4790 "        }\n"
4791 "    }\n"
4792 msgstr ""
4793
4794 #. type: Plain text
4795 #: build/C/man3/pthread_getattr_np.3:273
4796 #, no-wrap
4797 msgid ""
4798 "    if (allocate_stack && stack_size == -1)\n"
4799 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
4800 msgstr ""
4801
4802 #. type: Plain text
4803 #: build/C/man3/pthread_getattr_np.3:276
4804 #, no-wrap
4805 msgid ""
4806 "    if (argc E<gt> optind)\n"
4807 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
4808 msgstr ""
4809
4810 #. type: Plain text
4811 #: build/C/man3/pthread_getattr_np.3:279
4812 #, no-wrap
4813 msgid ""
4814 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
4815 "        ret_attrp = attrp;\n"
4816 msgstr ""
4817
4818 #. type: Plain text
4819 #: build/C/man3/pthread_getattr_np.3:284
4820 #, no-wrap
4821 msgid ""
4822 "        s = pthread_attr_init(attrp);\n"
4823 "        if (s != 0)\n"
4824 "            handle_error_en(s, \"pthread_attr_init\");\n"
4825 "    }\n"
4826 msgstr ""
4827
4828 #. type: Plain text
4829 #: build/C/man3/pthread_getattr_np.3:296
4830 #, no-wrap
4831 msgid ""
4832 "    if (stack_size E<gt>= 0) {\n"
4833 "        if (!allocate_stack) {\n"
4834 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
4835 "            if (s != 0)\n"
4836 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4837 "        } else {\n"
4838 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
4839 "                               stack_size);\n"
4840 "            if (s != 0)\n"
4841 "                handle_error_en(s, \"posix_memalign\");\n"
4842 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
4843 msgstr ""
4844
4845 #. type: Plain text
4846 #: build/C/man3/pthread_getattr_np.3:302
4847 #, no-wrap
4848 msgid ""
4849 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
4850 "            if (s != 0)\n"
4851 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4852 "        }\n"
4853 "    }\n"
4854 msgstr ""
4855
4856 #. type: Plain text
4857 #: build/C/man3/pthread_getattr_np.3:308
4858 #, no-wrap
4859 msgid ""
4860 "    if (guard_size E<gt>= 0) {\n"
4861 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
4862 "        if (s != 0)\n"
4863 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4864 "    }\n"
4865 msgstr ""
4866
4867 #. type: Plain text
4868 #: build/C/man3/pthread_getattr_np.3:311
4869 #, no-wrap
4870 msgid ""
4871 "    return ret_attrp;\n"
4872 "}\n"
4873 msgstr ""
4874
4875 #. type: Plain text
4876 #: build/C/man3/pthread_getattr_np.3:320
4877 #, no-wrap
4878 msgid ""
4879 "int\n"
4880 "main(int argc, char *argv[])\n"
4881 "{\n"
4882 "    int s;\n"
4883 "    pthread_t thr;\n"
4884 "    pthread_attr_t attr;\n"
4885 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
4886 "                                        a thread attributes object */\n"
4887 msgstr ""
4888
4889 #. type: Plain text
4890 #: build/C/man3/pthread_getattr_np.3:322
4891 #, no-wrap
4892 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
4893 msgstr ""
4894
4895 #. type: Plain text
4896 #: build/C/man3/pthread_getattr_np.3:328
4897 #, no-wrap
4898 msgid ""
4899 "    if (attrp != NULL) {\n"
4900 "        printf(\"Thread attributes object after initializations:\\en\");\n"
4901 "        display_stack_related_attributes(attrp, \"\\et\");\n"
4902 "        printf(\"\\en\");\n"
4903 "    }\n"
4904 msgstr ""
4905
4906 #. type: Plain text
4907 #: build/C/man3/pthread_getattr_np.3:356
4908 msgid ""
4909 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
4910 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
4911 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
4912 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
4913 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
4914 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
4915 msgstr ""
4916
4917 #. type: TH
4918 #: build/C/man3/pthread_getcpuclockid.3:24
4919 #, no-wrap
4920 msgid "PTHREAD_GETCPUCLOCKID"
4921 msgstr ""
4922
4923 #. type: TH
4924 #: build/C/man3/pthread_getcpuclockid.3:24
4925 #, no-wrap
4926 msgid "2009-02-08"
4927 msgstr ""
4928
4929 #. type: Plain text
4930 #: build/C/man3/pthread_getcpuclockid.3:27
4931 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
4932 msgstr ""
4933
4934 #. type: Plain text
4935 #: build/C/man3/pthread_getcpuclockid.3:31
4936 #, no-wrap
4937 msgid ""
4938 "B<#include E<lt>pthread.hE<gt>>\n"
4939 "B<#include E<lt>time.hE<gt>>\n"
4940 msgstr ""
4941
4942 #. type: Plain text
4943 #: build/C/man3/pthread_getcpuclockid.3:33
4944 #, no-wrap
4945 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
4946 msgstr ""
4947
4948 #.  The clockid is constructed as follows:
4949 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
4950 #.  where CLOCK_IDFIELD_SIZE is 3.
4951 #. type: Plain text
4952 #: build/C/man3/pthread_getcpuclockid.3:43
4953 msgid ""
4954 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
4955 "time clock of the thread I<thread>."
4956 msgstr ""
4957
4958 #. type: TP
4959 #: build/C/man3/pthread_getcpuclockid.3:47
4960 #, no-wrap
4961 msgid "B<ENOENT>"
4962 msgstr ""
4963
4964 #.  CLOCK_THREAD_CPUTIME_ID not defined
4965 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
4966 #.  be possible if kernel thread IDs took more than 29 bits (which
4967 #.  they currently cannot).
4968 #. type: Plain text
4969 #: build/C/man3/pthread_getcpuclockid.3:55
4970 msgid "Per-thread CPU time clocks are not supported by the system."
4971 msgstr ""
4972
4973 #. type: Plain text
4974 #: build/C/man3/pthread_getcpuclockid.3:62
4975 msgid "This function is available in glibc since version 2.2."
4976 msgstr ""
4977
4978 #. type: Plain text
4979 #: build/C/man3/pthread_getcpuclockid.3:75
4980 msgid ""
4981 "When I<thread> refers to the calling thread, this function returns an "
4982 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
4983 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
4984 msgstr ""
4985
4986 #. type: Plain text
4987 #: build/C/man3/pthread_getcpuclockid.3:81
4988 msgid ""
4989 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
4990 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
4991 "the two threads.  The following shell session shows an example run:"
4992 msgstr ""
4993
4994 #. type: Plain text
4995 #: build/C/man3/pthread_getcpuclockid.3:90
4996 #, no-wrap
4997 msgid ""
4998 "$ B<./a.out>\n"
4999 "Main thread sleeping\n"
5000 "Subthread starting infinite loop\n"
5001 "Main thread consuming some CPU time...\n"
5002 "Process total CPU time:    1.368\n"
5003 "Main thread CPU time:      0.376\n"
5004 "Subthread CPU time:        0.992\n"
5005 msgstr ""
5006
5007 #. type: Plain text
5008 #: build/C/man3/pthread_getcpuclockid.3:96
5009 #, no-wrap
5010 msgid "/* Link with \"-lrt\" */\n"
5011 msgstr ""
5012
5013 #. type: Plain text
5014 #: build/C/man3/pthread_getcpuclockid.3:104
5015 #, no-wrap
5016 msgid ""
5017 "#include E<lt>time.hE<gt>\n"
5018 "#include E<lt>stdio.hE<gt>\n"
5019 "#include E<lt>stdlib.hE<gt>\n"
5020 "#include E<lt>unistd.hE<gt>\n"
5021 "#include E<lt>pthread.hE<gt>\n"
5022 "#include E<lt>string.hE<gt>\n"
5023 "#include E<lt>errno.hE<gt>\n"
5024 msgstr ""
5025
5026 #. type: Plain text
5027 #: build/C/man3/pthread_getcpuclockid.3:118
5028 #, no-wrap
5029 msgid ""
5030 "static void *\n"
5031 "thread_start(void *arg)\n"
5032 "{\n"
5033 "    printf(\"Subthread starting infinite loop\\en\");\n"
5034 "    for (;;)\n"
5035 "        continue;\n"
5036 "}\n"
5037 msgstr ""
5038
5039 #. type: Plain text
5040 #: build/C/man3/pthread_getcpuclockid.3:123
5041 #, no-wrap
5042 msgid ""
5043 "static void\n"
5044 "pclock(char *msg, clockid_t cid)\n"
5045 "{\n"
5046 "    struct timespec ts;\n"
5047 msgstr ""
5048
5049 #. type: Plain text
5050 #: build/C/man3/pthread_getcpuclockid.3:129
5051 #, no-wrap
5052 msgid ""
5053 "    printf(\"%s\", msg);\n"
5054 "    if (clock_gettime(cid, &ts) == -1)\n"
5055 "        handle_error(\"clock_gettime\");\n"
5056 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
5057 "}\n"
5058 msgstr ""
5059
5060 #. type: Plain text
5061 #: build/C/man3/pthread_getcpuclockid.3:136
5062 #, no-wrap
5063 msgid ""
5064 "int\n"
5065 "main(int argc, char *argv[])\n"
5066 "{\n"
5067 "    pthread_t thread;\n"
5068 "    clockid_t cid;\n"
5069 "    int j, s;\n"
5070 msgstr ""
5071
5072 #. type: Plain text
5073 #: build/C/man3/pthread_getcpuclockid.3:140
5074 #, no-wrap
5075 msgid ""
5076 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
5077 "    if (s != 0)\n"
5078 "        handle_error_en(s, \"pthread_create\");\n"
5079 msgstr ""
5080
5081 #. type: Plain text
5082 #: build/C/man3/pthread_getcpuclockid.3:143
5083 #, no-wrap
5084 msgid ""
5085 "    printf(\"Main thread sleeping\\en\");\n"
5086 "    sleep(1);\n"
5087 msgstr ""
5088
5089 #. type: Plain text
5090 #: build/C/man3/pthread_getcpuclockid.3:147
5091 #, no-wrap
5092 msgid ""
5093 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
5094 "    for (j = 0; j E<lt> 2000000; j++)\n"
5095 "        getppid();\n"
5096 msgstr ""
5097
5098 #. type: Plain text
5099 #: build/C/man3/pthread_getcpuclockid.3:149
5100 #, no-wrap
5101 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
5102 msgstr ""
5103
5104 #. type: Plain text
5105 #: build/C/man3/pthread_getcpuclockid.3:154
5106 #, no-wrap
5107 msgid ""
5108 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
5109 "    if (s != 0)\n"
5110 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5111 "    pclock(\"Main thread CPU time:   \", cid);\n"
5112 msgstr ""
5113
5114 #. type: Plain text
5115 #: build/C/man3/pthread_getcpuclockid.3:157
5116 #, no-wrap
5117 msgid ""
5118 "    /* The preceding 4 lines of code could have been replaced by:\n"
5119 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
5120 msgstr ""
5121
5122 #. type: Plain text
5123 #: build/C/man3/pthread_getcpuclockid.3:162
5124 #, no-wrap
5125 msgid ""
5126 "    s = pthread_getcpuclockid(thread, &cid);\n"
5127 "    if (s != 0)\n"
5128 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5129 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
5130 msgstr ""
5131
5132 #. type: Plain text
5133 #: build/C/man3/pthread_getcpuclockid.3:165
5134 #, no-wrap
5135 msgid ""
5136 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
5137 "}\n"
5138 msgstr ""
5139
5140 #. type: Plain text
5141 #: build/C/man3/pthread_getcpuclockid.3:174
5142 msgid ""
5143 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
5144 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
5145 msgstr ""
5146
5147 #. type: TH
5148 #: build/C/man3/pthread_join.3:24
5149 #, no-wrap
5150 msgid "PTHREAD_JOIN"
5151 msgstr ""
5152
5153 #. type: Plain text
5154 #: build/C/man3/pthread_join.3:27
5155 msgid "pthread_join - join with a terminated thread"
5156 msgstr ""
5157
5158 #. type: Plain text
5159 #: build/C/man3/pthread_join.3:32
5160 #, no-wrap
5161 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
5162 msgstr ""
5163
5164 #. type: Plain text
5165 #: build/C/man3/pthread_join.3:47
5166 msgid ""
5167 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
5168 "to terminate.  If that thread has already terminated, then B<pthread_join>"
5169 "()  returns immediately.  The thread specified by I<thread> must be joinable."
5170 msgstr ""
5171
5172 #. type: Plain text
5173 #: build/C/man3/pthread_join.3:61
5174 msgid ""
5175 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
5176 "the target thread (i.e., the value that the target thread supplied to "
5177 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
5178 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
5179 msgstr ""
5180
5181 #. type: Plain text
5182 #: build/C/man3/pthread_join.3:68
5183 msgid ""
5184 "If multiple threads simultaneously try to join with the same thread, the "
5185 "results are undefined.  If the thread calling B<pthread_join>()  is "
5186 "canceled, then the target thread will remain joinable (i.e., it will not be "
5187 "detached)."
5188 msgstr ""
5189
5190 #. type: Plain text
5191 #: build/C/man3/pthread_join.3:73
5192 msgid ""
5193 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
5194 "number."
5195 msgstr ""
5196
5197 #. type: TP
5198 #: build/C/man3/pthread_join.3:74
5199 #, no-wrap
5200 msgid "B<EDEADLK>"
5201 msgstr ""
5202
5203 #.  The following verified by testing on glibc 2.8/NPTL:
5204 #.  The following verified by testing on glibc 2.8/NPTL:
5205 #. type: Plain text
5206 #: build/C/man3/pthread_join.3:83
5207 msgid ""
5208 "A deadlock was detected (e.g., two threads tried to join with each other); "
5209 "or I<thread> specifies the calling thread."
5210 msgstr ""
5211
5212 #.  POSIX.1-2001 does not specify this error case.
5213 #. type: Plain text
5214 #: build/C/man3/pthread_join.3:91
5215 msgid "Another thread is already waiting to join with this thread."
5216 msgstr ""
5217
5218 #. type: Plain text
5219 #: build/C/man3/pthread_join.3:102
5220 msgid ""
5221 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
5222 "the target thread has terminated."
5223 msgstr ""
5224
5225 #. type: Plain text
5226 #: build/C/man3/pthread_join.3:105
5227 msgid ""
5228 "Joining with a thread that has previously been joined results in undefined "
5229 "behavior."
5230 msgstr ""
5231
5232 #. type: Plain text
5233 #: build/C/man3/pthread_join.3:113
5234 msgid ""
5235 "Failure to join with a thread that is joinable (i.e., one that is not "
5236 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
5237 "zombie thread consumes some system resources, and when enough zombie threads "
5238 "have accumulated, it will no longer be possible to create new threads (or "
5239 "processes)."
5240 msgstr ""
5241
5242 #. type: Plain text
5243 #: build/C/man3/pthread_join.3:119
5244 msgid ""
5245 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
5246 "\"join with any terminated thread\".  If you believe you need this "
5247 "functionality, you probably need to rethink your application design."
5248 msgstr ""
5249
5250 #. type: Plain text
5251 #: build/C/man3/pthread_join.3:122
5252 msgid ""
5253 "All of the threads in a process are peers: any thread can join with any "
5254 "other thread in the process."
5255 msgstr ""
5256
5257 #. type: Plain text
5258 #: build/C/man3/pthread_join.3:132
5259 msgid ""
5260 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
5261 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
5262 msgstr ""
5263
5264 #. type: TH
5265 #: build/C/man3/pthread_kill.3:24
5266 #, no-wrap
5267 msgid "PTHREAD_KILL"
5268 msgstr ""
5269
5270 #. type: TH
5271 #: build/C/man3/pthread_kill.3:24
5272 #, no-wrap
5273 msgid "2009-01-28"
5274 msgstr ""
5275
5276 #. type: Plain text
5277 #: build/C/man3/pthread_kill.3:27
5278 msgid "pthread_kill - send a signal to a thread"
5279 msgstr ""
5280
5281 #. type: Plain text
5282 #: build/C/man3/pthread_kill.3:30 build/C/man3/pthread_sigmask.3:30
5283 #, no-wrap
5284 msgid "B<#include E<lt>signal.hE<gt>>\n"
5285 msgstr ""
5286
5287 #. type: Plain text
5288 #: build/C/man3/pthread_kill.3:32
5289 #, no-wrap
5290 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
5291 msgstr ""
5292
5293 #. type: Plain text
5294 #: build/C/man3/pthread_kill.3:45
5295 msgid ""
5296 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, "
5297 "another thread in the same process as the caller.  The signal is "
5298 "asynchronously directed to I<thread>."
5299 msgstr ""
5300
5301 #. type: Plain text
5302 #: build/C/man3/pthread_kill.3:50
5303 msgid ""
5304 "If I<sig> is 0, then no signal is sent, but error checking is still "
5305 "performed; this can be used to check for the existence of a thread ID."
5306 msgstr ""
5307
5308 #. type: Plain text
5309 #: build/C/man3/pthread_kill.3:55
5310 msgid ""
5311 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
5312 "number, and no signal is sent."
5313 msgstr ""
5314
5315 #. type: Plain text
5316 #: build/C/man3/pthread_kill.3:59
5317 msgid "An invalid signal was specified."
5318 msgstr ""
5319
5320 #. type: Plain text
5321 #: build/C/man3/pthread_kill.3:73
5322 msgid ""
5323 "Signal dispositions are process-wide: if a signal handler is installed, the "
5324 "handler will be invoked in the thread I<thread>, but if the disposition of "
5325 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
5326 "affect the whole process."
5327 msgstr ""
5328
5329 #. type: Plain text
5330 #: build/C/man3/pthread_kill.3:82
5331 msgid ""
5332 "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
5333 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
5334 msgstr ""
5335
5336 #. type: TH
5337 #: build/C/man3/pthread_kill_other_threads_np.3:24
5338 #, no-wrap
5339 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
5340 msgstr ""
5341
5342 #. type: TH
5343 #: build/C/man3/pthread_kill_other_threads_np.3:24
5344 #, no-wrap
5345 msgid "2010-09-09"
5346 msgstr ""
5347
5348 #. type: Plain text
5349 #: build/C/man3/pthread_kill_other_threads_np.3:27
5350 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
5351 msgstr ""
5352
5353 #. type: Plain text
5354 #: build/C/man3/pthread_kill_other_threads_np.3:32
5355 #, no-wrap
5356 msgid "B<void pthread_kill_other_threads_np(void);>\n"
5357 msgstr ""
5358
5359 #.  .SH VERSIONS
5360 #.  Available since glibc 2.0
5361 #. type: Plain text
5362 #: build/C/man3/pthread_kill_other_threads_np.3:45
5363 msgid ""
5364 "B<pthread_kill_other_threads_np>()  only has an effect in the LinuxThreads "
5365 "threading implementation.  On that implementation, calling this function "
5366 "causes the immediate termination of all threads in the application, except "
5367 "the calling thread.  The cancellation state and cancellation type of the to-"
5368 "be-terminated threads are ignored, and the cleanup handlers are not called "
5369 "in those threads."
5370 msgstr ""
5371
5372 #. type: Plain text
5373 #: build/C/man3/pthread_kill_other_threads_np.3:57
5374 msgid ""
5375 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
5376 "thread calls B<execve>(2)  or a similar function.  This function is designed "
5377 "to address a limitation in the obsolete LinuxThreads implementation whereby "
5378 "the other threads of an application are not automatically terminated (as "
5379 "POSIX.1-2001 requires) during B<execve>(2)."
5380 msgstr ""
5381
5382 #. type: Plain text
5383 #: build/C/man3/pthread_kill_other_threads_np.3:64
5384 msgid ""
5385 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
5386 "exists, but does nothing.  (Nothing needs to be done, because the "
5387 "implementation does the right thing during an B<execve>(2).)"
5388 msgstr ""
5389
5390 #. type: Plain text
5391 #: build/C/man3/pthread_kill_other_threads_np.3:70
5392 msgid ""
5393 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
5394 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
5395 msgstr ""
5396
5397 #. type: TH
5398 #: build/C/man3/pthread_self.3:24
5399 #, no-wrap
5400 msgid "PTHREAD_SELF"
5401 msgstr ""
5402
5403 #. type: Plain text
5404 #: build/C/man3/pthread_self.3:27
5405 msgid "pthread_self - obtain ID of the calling thread"
5406 msgstr ""
5407
5408 #. type: Plain text
5409 #: build/C/man3/pthread_self.3:32
5410 #, no-wrap
5411 msgid "B<pthread_t pthread_self(void);>\n"
5412 msgstr ""
5413
5414 #. type: Plain text
5415 #: build/C/man3/pthread_self.3:43
5416 msgid ""
5417 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
5418 "is the same value that is returned in I<*thread> in the B<pthread_create>"
5419 "(3)  call that created this thread."
5420 msgstr ""
5421
5422 #. type: Plain text
5423 #: build/C/man3/pthread_self.3:45
5424 msgid "This function always succeeds, returning the calling thread's ID."
5425 msgstr ""
5426
5427 #. type: Plain text
5428 #: build/C/man3/pthread_self.3:60
5429 msgid ""
5430 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
5431 "represent a thread ID; for example, representation using either an "
5432 "arithmetic type or a structure is permitted.  Therefore, variables of type "
5433 "I<pthread_t> can't portably be compared using the C equality operator "
5434 "(B<==>); use B<pthread_equal>(3)  instead."
5435 msgstr ""
5436
5437 #. type: Plain text
5438 #: build/C/man3/pthread_self.3:64
5439 msgid ""
5440 "Thread identifiers should be considered opaque: any attempt to use a thread "
5441 "ID other than in pthreads calls is nonportable and can lead to unspecified "
5442 "results."
5443 msgstr ""
5444
5445 #. type: Plain text
5446 #: build/C/man3/pthread_self.3:68
5447 msgid ""
5448 "Thread IDs are only guaranteed to be unique within a process.  A thread ID "
5449 "may be reused after a terminated thread has been joined, or a detached "
5450 "thread has terminated."
5451 msgstr ""
5452
5453 #. type: Plain text
5454 #: build/C/man3/pthread_self.3:73
5455 msgid ""
5456 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
5457 "kernel thread ID returned by a call to B<gettid>(2)."
5458 msgstr ""
5459
5460 #. type: Plain text
5461 #: build/C/man3/pthread_self.3:77
5462 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
5463 msgstr ""
5464
5465 #. type: TH
5466 #: build/C/man3/pthread_setaffinity_np.3:24
5467 #, no-wrap
5468 msgid "PTHREAD_SETAFFINITY_NP"
5469 msgstr ""
5470
5471 #. type: Plain text
5472 #: build/C/man3/pthread_setaffinity_np.3:28
5473 msgid ""
5474 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
5475 "thread"
5476 msgstr ""
5477
5478 #. type: Plain text
5479 #: build/C/man3/pthread_setaffinity_np.3:37
5480 #, no-wrap
5481 msgid ""
5482 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
5483 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
5484 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
5485 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
5486 msgstr ""
5487
5488 #. type: Plain text
5489 #: build/C/man3/pthread_setaffinity_np.3:51
5490 msgid ""
5491 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
5492 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
5493 "successful, and the thread is not currently running on one of the CPUs in "
5494 "I<cpuset>, then it is migrated to one of those CPUs."
5495 msgstr ""
5496
5497 #. type: Plain text
5498 #: build/C/man3/pthread_setaffinity_np.3:58
5499 msgid ""
5500 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
5501 "the thread I<thread> in the buffer pointed to by I<cpuset>."
5502 msgstr ""
5503
5504 #. type: Plain text
5505 #: build/C/man3/pthread_setaffinity_np.3:74
5506 msgid ""
5507 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
5508 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
5509 "(cpu_set_t)>.  (It may be some other value, if using the macros described in "
5510 "B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
5511 msgstr ""
5512
5513 #. type: TP
5514 #: build/C/man3/pthread_setaffinity_np.3:78
5515 #, no-wrap
5516 msgid "B<EFAULT>"
5517 msgstr ""
5518
5519 #. type: Plain text
5520 #: build/C/man3/pthread_setaffinity_np.3:81
5521 msgid "A supplied memory address was invalid."
5522 msgstr ""
5523
5524 #. type: Plain text
5525 #: build/C/man3/pthread_setaffinity_np.3:90
5526 msgid ""
5527 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
5528 "processors that are currently physically on the system and permitted to the "
5529 "thread according to any restrictions that may be imposed by the \"cpuset\" "
5530 "mechanism described in B<cpuset>(7)."
5531 msgstr ""
5532
5533 #.  FIXME . ?
5534 #.  Loic Domaigne commented: it seems that in the future the
5535 #.  kernel developers want to make cpumask_t dynamic, so
5536 #.  CONFIG_NR_CPUS might become obsolete in the future.
5537 #.  cpumask_t
5538 #.  The raw sched_getaffinity() system call returns the size (in bytes)
5539 #.  of the cpumask_t type.
5540 #. type: Plain text
5541 #: build/C/man3/pthread_setaffinity_np.3:106
5542 msgid ""
5543 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
5544 "the set supported by the kernel.  (The kernel configuration option "
5545 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
5546 "type used to represent CPU sets.)"
5547 msgstr ""
5548
5549 #. type: Plain text
5550 #: build/C/man3/pthread_setaffinity_np.3:111
5551 msgid ""
5552 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
5553 "affinity mask used by the kernel."
5554 msgstr ""
5555
5556 #. type: Plain text
5557 #: build/C/man3/pthread_setaffinity_np.3:134
5558 msgid ""
5559 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
5560 "thread will actually run is the intersection of the set specified in the "
5561 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
5562 "system may further restrict the set of CPUs on which the thread runs if the "
5563 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
5564 "restrictions on the actual set of CPUs on which the thread will run are "
5565 "silently imposed by the kernel."
5566 msgstr ""
5567
5568 #. type: Plain text
5569 #: build/C/man3/pthread_setaffinity_np.3:140
5570 msgid ""
5571 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
5572 "B<sched_getaffinity>(2)  system calls."
5573 msgstr ""
5574
5575 #. type: Plain text
5576 #: build/C/man3/pthread_setaffinity_np.3:151
5577 msgid ""
5578 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
5579 "creator's CPU affinity mask."
5580 msgstr ""
5581
5582 #. type: Plain text
5583 #: build/C/man3/pthread_setaffinity_np.3:159
5584 msgid ""
5585 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
5586 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
5587 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
5588 "check the resulting CPU affinity mask of the thread."
5589 msgstr ""
5590
5591 #. type: Plain text
5592 #: build/C/man3/pthread_setaffinity_np.3:166
5593 #, no-wrap
5594 msgid ""
5595 "#define _GNU_SOURCE\n"
5596 "#include E<lt>pthread.hE<gt>\n"
5597 "#include E<lt>stdio.hE<gt>\n"
5598 "#include E<lt>stdlib.hE<gt>\n"
5599 "#include E<lt>errno.hE<gt>\n"
5600 msgstr ""
5601
5602 #. type: Plain text
5603 #: build/C/man3/pthread_setaffinity_np.3:176
5604 #, no-wrap
5605 msgid ""
5606 "int\n"
5607 "main(int argc, char *argv[])\n"
5608 "{\n"
5609 "    int s, j;\n"
5610 "    cpu_set_t cpuset;\n"
5611 "    pthread_t thread;\n"
5612 msgstr ""
5613
5614 #. type: Plain text
5615 #: build/C/man3/pthread_setaffinity_np.3:178
5616 #, no-wrap
5617 msgid "    thread = pthread_self();\n"
5618 msgstr ""
5619
5620 #. type: Plain text
5621 #: build/C/man3/pthread_setaffinity_np.3:180
5622 #, no-wrap
5623 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
5624 msgstr ""
5625
5626 #. type: Plain text
5627 #: build/C/man3/pthread_setaffinity_np.3:184
5628 #, no-wrap
5629 msgid ""
5630 "    CPU_ZERO(&cpuset);\n"
5631 "    for (j = 0; j E<lt> 8; j++)\n"
5632 "        CPU_SET(j, &cpuset);\n"
5633 msgstr ""
5634
5635 #. type: Plain text
5636 #: build/C/man3/pthread_setaffinity_np.3:188
5637 #, no-wrap
5638 msgid ""
5639 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
5640 "    if (s != 0)\n"
5641 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
5642 msgstr ""
5643
5644 #. type: Plain text
5645 #: build/C/man3/pthread_setaffinity_np.3:190
5646 #, no-wrap
5647 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
5648 msgstr ""
5649
5650 #. type: Plain text
5651 #: build/C/man3/pthread_setaffinity_np.3:194
5652 #, no-wrap
5653 msgid ""
5654 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
5655 "    if (s != 0)\n"
5656 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
5657 msgstr ""
5658
5659 #. type: Plain text
5660 #: build/C/man3/pthread_setaffinity_np.3:199
5661 #, no-wrap
5662 msgid ""
5663 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
5664 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
5665 "        if (CPU_ISSET(j, &cpuset))\n"
5666 "            printf(\"    CPU %d\\en\", j);\n"
5667 msgstr ""
5668
5669 #. type: Plain text
5670 #: build/C/man3/pthread_setaffinity_np.3:202
5671 #: build/C/man3/pthread_setschedparam.3:427
5672 #, no-wrap
5673 msgid ""
5674 "    exit(EXIT_SUCCESS);\n"
5675 "}\n"
5676 msgstr ""
5677
5678 #. type: Plain text
5679 #: build/C/man3/pthread_setaffinity_np.3:211
5680 msgid ""
5681 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
5682 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
5683 "B<cpuset>(7), B<pthreads>(7)"
5684 msgstr ""
5685
5686 #. type: TH
5687 #: build/C/man3/pthread_setcancelstate.3:24
5688 #, no-wrap
5689 msgid "PTHREAD_SETCANCELSTATE"
5690 msgstr ""
5691
5692 #. type: Plain text
5693 #: build/C/man3/pthread_setcancelstate.3:28
5694 msgid ""
5695 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
5696 "type"
5697 msgstr ""
5698
5699 #. type: Plain text
5700 #: build/C/man3/pthread_setcancelstate.3:34
5701 #, no-wrap
5702 msgid ""
5703 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
5704 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
5705 msgstr ""
5706
5707 #. type: Plain text
5708 #: build/C/man3/pthread_setcancelstate.3:48
5709 msgid ""
5710 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
5711 "thread to the value given in I<state>.  The previous cancelability state of "
5712 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
5713 "I<state> argument must have one of the following values:"
5714 msgstr ""
5715
5716 #. type: TP
5717 #: build/C/man3/pthread_setcancelstate.3:48
5718 #, no-wrap
5719 msgid "B<PTHREAD_CANCEL_ENABLE>"
5720 msgstr ""
5721
5722 #. type: Plain text
5723 #: build/C/man3/pthread_setcancelstate.3:55
5724 msgid ""
5725 "The thread is cancelable.  This is the default cancelability state in all "
5726 "new threads, including the initial thread.  The thread's cancelability type "
5727 "determines when a cancelable thread will respond to a cancellation request."
5728 msgstr ""
5729
5730 #. type: TP
5731 #: build/C/man3/pthread_setcancelstate.3:55
5732 #, no-wrap
5733 msgid "B<PTHREAD_CANCEL_DISABLE>"
5734 msgstr ""
5735
5736 #. type: Plain text
5737 #: build/C/man3/pthread_setcancelstate.3:60
5738 msgid ""
5739 "The thread is not cancelable.  If a cancellation request is received, it is "
5740 "blocked until cancelability is enabled."
5741 msgstr ""
5742
5743 #. type: Plain text
5744 #: build/C/man3/pthread_setcancelstate.3:72
5745 msgid ""
5746 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
5747 "thread to the value given in I<type>.  The previous cancelability type of "
5748 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
5749 "argument must have one of the following values:"
5750 msgstr ""
5751
5752 #. type: TP
5753 #: build/C/man3/pthread_setcancelstate.3:72
5754 #, no-wrap
5755 msgid "B<PTHREAD_CANCEL_DEFERRED>"
5756 msgstr ""
5757
5758 #. type: Plain text
5759 #: build/C/man3/pthread_setcancelstate.3:79
5760 msgid ""
5761 "A cancellation request is deferred until the thread next calls a function "
5762 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
5763 "cancelability type in all new threads, including the initial thread."
5764 msgstr ""
5765
5766 #. type: TP
5767 #: build/C/man3/pthread_setcancelstate.3:79
5768 #, no-wrap
5769 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
5770 msgstr ""
5771
5772 #. type: Plain text
5773 #: build/C/man3/pthread_setcancelstate.3:85
5774 msgid ""
5775 "The thread can be canceled at any time.  (Typically, it will be canceled "
5776 "immediately upon receiving a cancellation request, but the system doesn't "
5777 "guarantee this.)"
5778 msgstr ""
5779
5780 #. type: Plain text
5781 #: build/C/man3/pthread_setcancelstate.3:89
5782 msgid ""
5783 "The set-and-get operation performed by each of these functions is atomic "
5784 "with respect to other threads in the process calling the same function."
5785 msgstr ""
5786
5787 #. type: Plain text
5788 #: build/C/man3/pthread_setcancelstate.3:96
5789 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
5790 msgstr ""
5791
5792 #. type: Plain text
5793 #: build/C/man3/pthread_setcancelstate.3:100
5794 msgid "Invalid value for I<state>."
5795 msgstr ""
5796
5797 #. type: Plain text
5798 #: build/C/man3/pthread_setcancelstate.3:104
5799 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
5800 msgstr ""
5801
5802 #.  .SH VERSIONS
5803 #.  Available since glibc 2.0
5804 #. type: Plain text
5805 #: build/C/man3/pthread_setcancelstate.3:110
5806 msgid "Invalid value for I<type>."
5807 msgstr ""
5808
5809 #. type: Plain text
5810 #: build/C/man3/pthread_setcancelstate.3:115
5811 msgid ""
5812 "For details of what happens when a thread is canceled, see B<pthread_cancel>"
5813 "(3)."
5814 msgstr ""
5815
5816 #. type: Plain text
5817 #: build/C/man3/pthread_setcancelstate.3:122
5818 msgid ""
5819 "Briefly disabling cancelability is useful if a thread performs some critical "
5820 "action that must not be interrupted by a cancellation request.  Beware of "
5821 "disabling cancelability for long periods, or around operations that may "
5822 "block for long periods, since that will render the thread unresponsive to "
5823 "cancellation requests."
5824 msgstr ""
5825
5826 #. type: Plain text
5827 #: build/C/man3/pthread_setcancelstate.3:153
5828 msgid ""
5829 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
5830 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
5831 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
5832 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
5833 "because the application has no way of knowing what the state of these "
5834 "resources is when the thread is canceled; that is, did cancellation occur "
5835 "before the resources were reserved, while they were reserved, or after they "
5836 "were released? Furthermore, some internal data structures (e.g., the linked "
5837 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
5838 "left in an inconsistent state if cancellation occurs in the middle of the "
5839 "function call.  Consequently, clean-up handlers cease to be useful.  "
5840 "Functions that can be safely asynchronously canceled are called I<async-"
5841 "cancel-safe functions>.  POSIX.1-2001 only requires that B<pthread_cancel>"
5842 "(3), B<pthread_setcancelstate>(), and B<pthread_setcanceltype>()  be async-"
5843 "cancel-safe.  In general, other library functions can't be safely called "
5844 "from an asynchronously cancelable thread.  One of the few circumstances in "
5845 "which asynchronous cancelability is useful is for cancellation of a thread "
5846 "that is in a pure compute-bound loop."
5847 msgstr ""
5848
5849 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
5850 #. type: Plain text
5851 #: build/C/man3/pthread_setcancelstate.3:171
5852 msgid ""
5853 "The Linux threading implementations permit the I<oldstate> argument of "
5854 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
5855 "the previous cancelability state is not returned to the caller.  Many other "
5856 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
5857 "does not specify this point, so portable applications should always specify "
5858 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
5859 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
5860 msgstr ""
5861
5862 #. type: Plain text
5863 #: build/C/man3/pthread_setcancelstate.3:174
5864 msgid "See B<pthread_cancel>(3)."
5865 msgstr ""
5866
5867 #. type: Plain text
5868 #: build/C/man3/pthread_setcancelstate.3:179
5869 msgid ""
5870 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
5871 "B<pthreads>(7)"
5872 msgstr ""
5873
5874 #. type: TH
5875 #: build/C/man3/pthread_setconcurrency.3:23
5876 #, no-wrap
5877 msgid "PTHREAD_SETCONCURRENCY"
5878 msgstr ""
5879
5880 #. type: TH
5881 #: build/C/man3/pthread_setconcurrency.3:23 build/C/man3/pthread_yield.3:23
5882 #, no-wrap
5883 msgid "2009-04-10"
5884 msgstr ""
5885
5886 #. type: Plain text
5887 #: build/C/man3/pthread_setconcurrency.3:27
5888 msgid ""
5889 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
5890 "level"
5891 msgstr ""
5892
5893 #. type: Plain text
5894 #: build/C/man3/pthread_setconcurrency.3:33
5895 #, no-wrap
5896 msgid ""
5897 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
5898 "B<int pthread_getconcurrency(void);>\n"
5899 msgstr ""
5900
5901 #. type: Plain text
5902 #: build/C/man3/pthread_setconcurrency.3:45
5903 msgid ""
5904 "The B<pthread_setconcurrency>()  function informs the implementation of the "
5905 "application's desired concurrency level, specified in I<new_level>.  The "
5906 "implementation only takes this as a hint: POSIX.1 does not specify the level "
5907 "of concurrency that should be provided as a result of calling "
5908 "B<pthread_setconcurrency>()."
5909 msgstr ""
5910
5911 #. type: Plain text
5912 #: build/C/man3/pthread_setconcurrency.3:50
5913 msgid ""
5914 "Specifying I<new_level> as 0 instructs the implementation to manage the "
5915 "concurrency level as it deems appropriate."
5916 msgstr ""
5917
5918 #. type: Plain text
5919 #: build/C/man3/pthread_setconcurrency.3:53
5920 msgid ""
5921 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
5922 "level for this process."
5923 msgstr ""
5924
5925 #. type: Plain text
5926 #: build/C/man3/pthread_setconcurrency.3:58
5927 msgid ""
5928 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
5929 "nonzero error number."
5930 msgstr ""
5931
5932 #. type: Plain text
5933 #: build/C/man3/pthread_setconcurrency.3:65
5934 msgid ""
5935 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
5936 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
5937 "B<pthread_setconcurrency>()  has not previously been called."
5938 msgstr ""
5939
5940 #. type: Plain text
5941 #: build/C/man3/pthread_setconcurrency.3:68
5942 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
5943 msgstr ""
5944
5945 #. type: Plain text
5946 #: build/C/man3/pthread_setconcurrency.3:72
5947 msgid "I<new_level> is negative."
5948 msgstr ""
5949
5950 #. type: Plain text
5951 #: build/C/man3/pthread_setconcurrency.3:78
5952 msgid ""
5953 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
5954 "I<new_level> would cause a system resource to be exceeded\")."
5955 msgstr ""
5956
5957 #. type: Plain text
5958 #: build/C/man3/pthread_setconcurrency.3:80
5959 msgid "These functions are available in glibc since version 2.1."
5960 msgstr ""
5961
5962 #. type: Plain text
5963 #: build/C/man3/pthread_setconcurrency.3:84
5964 msgid "The default concurrency level is 0."
5965 msgstr ""
5966
5967 #. type: Plain text
5968 #: build/C/man3/pthread_setconcurrency.3:91
5969 msgid ""
5970 "Concurrency levels are only meaningful for M:N threading implementations, "
5971 "where at any moment a subset of a process's set of user-level threads may be "
5972 "bound to a smaller number of kernel-scheduling entities.  Setting the "
5973 "concurrency level allows the application to give the system a hint as to the "
5974 "number of kernel-scheduling entities that should be provided for efficient "
5975 "execution of the application."
5976 msgstr ""
5977
5978 #. type: Plain text
5979 #: build/C/man3/pthread_setconcurrency.3:97
5980 msgid ""
5981 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
5982 "concurrency level has no meaning.  In other words, on Linux these functions "
5983 "merely exist for compatibility with other systems, and they have no effect "
5984 "on the execution of a program."
5985 msgstr ""
5986
5987 #. type: Plain text
5988 #: build/C/man3/pthread_setconcurrency.3:100
5989 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
5990 msgstr ""
5991
5992 #. type: TH
5993 #: build/C/man3/pthread_setschedparam.3:24
5994 #, no-wrap
5995 msgid "PTHREAD_SETSCHEDPARAM"
5996 msgstr ""
5997
5998 #. type: Plain text
5999 #: build/C/man3/pthread_setschedparam.3:28
6000 msgid ""
6001 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
6002 "parameters of a thread"
6003 msgstr ""
6004
6005 #. type: Plain text
6006 #: build/C/man3/pthread_setschedparam.3:36
6007 #, no-wrap
6008 msgid ""
6009 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
6010 "B<                      const struct sched_param *>I<param>B<);>\n"
6011 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
6012 "B<                      struct sched_param *>I<param>B<);>\n"
6013 msgstr ""
6014
6015 #. type: Plain text
6016 #: build/C/man3/pthread_setschedparam.3:43
6017 msgid ""
6018 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
6019 "parameters of the thread I<thread>."
6020 msgstr ""
6021
6022 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
6023 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
6024 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
6025 #. type: Plain text
6026 #: build/C/man3/pthread_setschedparam.3:54
6027 msgid ""
6028 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
6029 "values for I<policy>, and their semantics, are described in "
6030 "B<sched_setscheduler>(2)."
6031 msgstr ""
6032
6033 #. type: Plain text
6034 #: build/C/man3/pthread_setschedparam.3:60
6035 msgid ""
6036 "The structure pointed to by I<param> specifies the new scheduling parameters "
6037 "for I<thread>.  Scheduling parameters are maintained in the following "
6038 "structure:"
6039 msgstr ""
6040
6041 #.  FIXME . nptl/pthread_setschedparam.c has the following
6042 #.    /* If the thread should have higher priority because of some
6043 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
6044 #.  Eventually (perhaps after writing the mutexattr pages), we
6045 #.  may want to add something on the topic to this page.
6046 #. type: Plain text
6047 #: build/C/man3/pthread_setschedparam.3:101
6048 msgid ""
6049 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
6050 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
6051 "and I<param>, respectively.  The returned priority value is that set by the "
6052 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
6053 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
6054 "does not reflect any temporary priority adjustments as a result of calls to "
6055 "any priority inheritance or priority ceiling functions (see, for example, "
6056 "B<pthread_mutexattr_setprioceiling>(3)  and B<pthread_mutexattr_setprotocol>"
6057 "(3))."
6058 msgstr ""
6059
6060 #. type: Plain text
6061 #: build/C/man3/pthread_setschedparam.3:109
6062 msgid ""
6063 "On success, these functions return 0; on error, they return a nonzero error "
6064 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
6065 "parameters of I<thread> are not changed."
6066 msgstr ""
6067
6068 #. type: Plain text
6069 #: build/C/man3/pthread_setschedparam.3:111
6070 msgid "Both of these functions can fail with the following error:"
6071 msgstr ""
6072
6073 #. type: Plain text
6074 #: build/C/man3/pthread_setschedparam.3:119
6075 msgid ""
6076 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
6077 msgstr ""
6078
6079 #. type: Plain text
6080 #: build/C/man3/pthread_setschedparam.3:126
6081 msgid ""
6082 "I<policy> is not a recognized policy, or I<param> does not make sense for "
6083 "the I<policy>."
6084 msgstr ""
6085
6086 #. type: Plain text
6087 #: build/C/man3/pthread_setschedparam.3:130
6088 msgid ""
6089 "The caller does not have appropriate privileges to set the specified "
6090 "scheduling policy and parameters."
6091 msgstr ""
6092
6093 #.  .SH VERSIONS
6094 #.  Available since glibc 2.0
6095 #. type: Plain text
6096 #: build/C/man3/pthread_setschedparam.3:138
6097 msgid ""
6098 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
6099 "policy or scheduling parameters to an unsupported value\") error for "
6100 "B<pthread_setschedparam>()."
6101 msgstr ""
6102
6103 #. type: Plain text
6104 #: build/C/man3/pthread_setschedparam.3:146
6105 msgid ""
6106 "For a description of the permissions required to, and the effect of, "
6107 "changing a thread's scheduling policy and priority, and details of the "
6108 "permitted ranges for priorities in each scheduling policy, see "
6109 "B<sched_setscheduler>(2)."
6110 msgstr ""
6111
6112 #. type: Plain text
6113 #: build/C/man3/pthread_setschedparam.3:153
6114 msgid ""
6115 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
6116 "B<pthread_getschedparam>(), as well as the use of a number of other "
6117 "scheduling-related pthreads functions."
6118 msgstr ""
6119
6120 #. type: Plain text
6121 #: build/C/man3/pthread_setschedparam.3:169
6122 msgid ""
6123 "In the following run, the main thread sets its scheduling policy to "
6124 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
6125 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
6126 "priority attribute of 20.  The program then sets (using "
6127 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
6128 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
6129 "created using this attributes object should take their scheduling attributes "
6130 "from the thread attributes object.  The program then creates a thread using "
6131 "the thread attributes object, and that thread displays its scheduling policy "
6132 "and priority."
6133 msgstr ""
6134
6135 #. type: Plain text
6136 #: build/C/man3/pthread_setschedparam.3:177
6137 #, no-wrap
6138 msgid ""
6139 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
6140 "Password:\n"
6141 "# B<./a.out -mf10 -ar20 -i e>\n"
6142 "Scheduler settings of main thread\n"
6143 "    policy=SCHED_FIFO, priority=10\n"
6144 msgstr ""
6145
6146 #. type: Plain text
6147 #: build/C/man3/pthread_setschedparam.3:181
6148 #, no-wrap
6149 msgid ""
6150 "Scheduler settings in \\(aqattr\\(aq\n"
6151 "    policy=SCHED_RR, priority=20\n"
6152 "    inheritsched is EXPLICIT\n"
6153 msgstr ""
6154
6155 #. type: Plain text
6156 #: build/C/man3/pthread_setschedparam.3:184
6157 #, no-wrap
6158 msgid ""
6159 "Scheduler attributes of new thread\n"
6160 "    policy=SCHED_RR, priority=20\n"
6161 msgstr ""
6162
6163 #. type: Plain text
6164 #: build/C/man3/pthread_setschedparam.3:189
6165 msgid ""
6166 "In the above output, one can see that the scheduling policy and priority "
6167 "were taken from the values specified in the thread attributes object."
6168 msgstr ""
6169
6170 #. type: Plain text
6171 #: build/C/man3/pthread_setschedparam.3:196
6172 msgid ""
6173 "The next run is the same as the previous, except that the inherit scheduler "
6174 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
6175 "using the thread attributes object should ignore the scheduling attributes "
6176 "specified in the attributes object and instead take their scheduling "
6177 "attributes from the creating thread."
6178 msgstr ""
6179
6180 #. type: Plain text
6181 #: build/C/man3/pthread_setschedparam.3:202
6182 #, no-wrap
6183 msgid ""
6184 "# B<./a.out -mf10 -ar20 -i i>\n"
6185 "Scheduler settings of main thread\n"
6186 "    policy=SCHED_FIFO, priority=10\n"
6187 msgstr ""
6188
6189 #. type: Plain text
6190 #: build/C/man3/pthread_setschedparam.3:206
6191 #, no-wrap
6192 msgid ""
6193 "Scheduler settings in \\(aqattr\\(aq\n"
6194 "    policy=SCHED_RR, priority=20\n"
6195 "    inheritsched is INHERIT\n"
6196 msgstr ""
6197
6198 #. type: Plain text
6199 #: build/C/man3/pthread_setschedparam.3:209
6200 #, no-wrap
6201 msgid ""
6202 "Scheduler attributes of new thread\n"
6203 "    policy=SCHED_FIFO, priority=10\n"
6204 msgstr ""
6205
6206 #. type: Plain text
6207 #: build/C/man3/pthread_setschedparam.3:215
6208 msgid ""
6209 "In the above output, one can see that the scheduling policy and priority "
6210 "were taken from the creating thread, rather than the thread attributes "
6211 "object."
6212 msgstr ""
6213
6214 #. type: Plain text
6215 #: build/C/man3/pthread_setschedparam.3:221
6216 msgid ""
6217 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
6218 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
6219 "scheduler attribute."
6220 msgstr ""
6221
6222 #. type: Plain text
6223 #: build/C/man3/pthread_setschedparam.3:225
6224 #, no-wrap
6225 msgid "/* pthreads_sched_test.c */\n"
6226 msgstr ""
6227
6228 #. type: Plain text
6229 #: build/C/man3/pthread_setschedparam.3:231
6230 #, no-wrap
6231 msgid ""
6232 "#include E<lt>pthread.hE<gt>\n"
6233 "#include E<lt>stdio.hE<gt>\n"
6234 "#include E<lt>stdlib.hE<gt>\n"
6235 "#include E<lt>unistd.hE<gt>\n"
6236 "#include E<lt>errno.hE<gt>\n"
6237 msgstr ""
6238
6239 #. type: Plain text
6240 #: build/C/man3/pthread_setschedparam.3:240
6241 #, no-wrap
6242 msgid ""
6243 "static void\n"
6244 "usage(char *prog_name, char *msg)\n"
6245 "{\n"
6246 "    if (msg != NULL)\n"
6247 "        fputs(msg, stderr);\n"
6248 msgstr ""
6249
6250 #. type: Plain text
6251 #: build/C/man3/pthread_setschedparam.3:257
6252 #, no-wrap
6253 msgid ""
6254 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
6255 "    fprintf(stderr, \"Options are:\\en\");\n"
6256 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
6257 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
6258 "    fpe(\"                 thread attributes object\\en\");\n"
6259 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
6260 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
6261 "    fpe(\"                     r  SCHED_RR\\en\");\n"
6262 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
6263 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
6264 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
6265 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
6266 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
6267 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
6268 "    exit(EXIT_FAILURE);\n"
6269 "}\n"
6270 msgstr ""
6271
6272 #. type: Plain text
6273 #: build/C/man3/pthread_setschedparam.3:268
6274 #, no-wrap
6275 msgid ""
6276 "static int\n"
6277 "get_policy(char p, int *policy)\n"
6278 "{\n"
6279 "    switch (p) {\n"
6280 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
6281 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
6282 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
6283 "    default:  return 0;\n"
6284 "    }\n"
6285 "}\n"
6286 msgstr ""
6287
6288 #. type: Plain text
6289 #: build/C/man3/pthread_setschedparam.3:279
6290 #, no-wrap
6291 msgid ""
6292 "static void\n"
6293 "display_sched_attr(int policy, struct sched_param *param)\n"
6294 "{\n"
6295 "    printf(\"    policy=%s, priority=%d\\en\",\n"
6296 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
6297 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
6298 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
6299 "            \"???\",\n"
6300 "            param-E<gt>sched_priority);\n"
6301 "}\n"
6302 msgstr ""
6303
6304 #. type: Plain text
6305 #: build/C/man3/pthread_setschedparam.3:285
6306 #, no-wrap
6307 msgid ""
6308 "static void\n"
6309 "display_thread_sched_attr(char *msg)\n"
6310 "{\n"
6311 "    int policy, s;\n"
6312 "    struct sched_param param;\n"
6313 msgstr ""
6314
6315 #. type: Plain text
6316 #: build/C/man3/pthread_setschedparam.3:289
6317 #, no-wrap
6318 msgid ""
6319 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
6320 "    if (s != 0)\n"
6321 "        handle_error_en(s, \"pthread_getschedparam\");\n"
6322 msgstr ""
6323
6324 #. type: Plain text
6325 #: build/C/man3/pthread_setschedparam.3:293
6326 #, no-wrap
6327 msgid ""
6328 "    printf(\"%s\\en\", msg);\n"
6329 "    display_sched_attr(policy, &param);\n"
6330 "}\n"
6331 msgstr ""
6332
6333 #. type: Plain text
6334 #: build/C/man3/pthread_setschedparam.3:298
6335 #, no-wrap
6336 msgid ""
6337 "static void *\n"
6338 "thread_start(void *arg)\n"
6339 "{\n"
6340 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
6341 msgstr ""
6342
6343 #. type: Plain text
6344 #: build/C/man3/pthread_setschedparam.3:301
6345 #, no-wrap
6346 msgid ""
6347 "    return NULL;\n"
6348 "}\n"
6349 msgstr ""
6350
6351 #. type: Plain text
6352 #: build/C/man3/pthread_setschedparam.3:311
6353 #, no-wrap
6354 msgid ""
6355 "int\n"
6356 "main(int argc, char *argv[])\n"
6357 "{\n"
6358 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
6359 "    pthread_t thread;\n"
6360 "    pthread_attr_t attr;\n"
6361 "    pthread_attr_t *attrp;\n"
6362 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
6363 "    struct sched_param param;\n"
6364 msgstr ""
6365
6366 #. type: Plain text
6367 #: build/C/man3/pthread_setschedparam.3:313
6368 #, no-wrap
6369 msgid "    /* Process command-line options */\n"
6370 msgstr ""
6371
6372 #. type: Plain text
6373 #: build/C/man3/pthread_setschedparam.3:318
6374 #, no-wrap
6375 msgid ""
6376 "    use_null_attrib = 0;\n"
6377 "    attr_sched_str = NULL;\n"
6378 "    main_sched_str = NULL;\n"
6379 "    inheritsched_str = NULL;\n"
6380 msgstr ""
6381
6382 #. type: Plain text
6383 #: build/C/man3/pthread_setschedparam.3:328
6384 #, no-wrap
6385 msgid ""
6386 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
6387 "        switch (opt) {\n"
6388 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
6389 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
6390 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
6391 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
6392 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
6393 "        }\n"
6394 "    }\n"
6395 msgstr ""
6396
6397 #. type: Plain text
6398 #: build/C/man3/pthread_setschedparam.3:332
6399 #, no-wrap
6400 msgid ""
6401 "    if (use_null_attrib &&\n"
6402 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
6403 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
6404 msgstr ""
6405
6406 #. type: Plain text
6407 #: build/C/man3/pthread_setschedparam.3:335
6408 #, no-wrap
6409 msgid ""
6410 "    /* Optionally set scheduling attributes of main thread,\n"
6411 "       and display the attributes */\n"
6412 msgstr ""
6413
6414 #. type: Plain text
6415 #: build/C/man3/pthread_setschedparam.3:340
6416 #, no-wrap
6417 msgid ""
6418 "    if (main_sched_str != NULL) {\n"
6419 "        if (!get_policy(main_sched_str[0], &policy))\n"
6420 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
6421 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
6422 msgstr ""
6423
6424 #. type: Plain text
6425 #: build/C/man3/pthread_setschedparam.3:345
6426 #, no-wrap
6427 msgid ""
6428 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
6429 "        if (s != 0)\n"
6430 "            handle_error_en(s, \"pthread_setschedparam\");\n"
6431 "    }\n"
6432 msgstr ""
6433
6434 #. type: Plain text
6435 #: build/C/man3/pthread_setschedparam.3:348
6436 #, no-wrap
6437 msgid ""
6438 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
6439 "    printf(\"\\en\");\n"
6440 msgstr ""
6441
6442 #. type: Plain text
6443 #: build/C/man3/pthread_setschedparam.3:350
6444 #, no-wrap
6445 msgid "    /* Initialize thread attributes object according to options */\n"
6446 msgstr ""
6447
6448 #. type: Plain text
6449 #: build/C/man3/pthread_setschedparam.3:359
6450 #, no-wrap
6451 msgid ""
6452 "    if (!use_null_attrib) {\n"
6453 "        s = pthread_attr_init(&attr);\n"
6454 "        if (s != 0)\n"
6455 "            handle_error_en(s, \"pthread_attr_init\");\n"
6456 "        attrp = &attr;\n"
6457 "    }\n"
6458 msgstr ""
6459
6460 #. type: Plain text
6461 #: build/C/man3/pthread_setschedparam.3:367
6462 #, no-wrap
6463 msgid ""
6464 "    if (inheritsched_str != NULL) {\n"
6465 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
6466 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
6467 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
6468 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
6469 "        else\n"
6470 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
6471 msgstr ""
6472
6473 #. type: Plain text
6474 #: build/C/man3/pthread_setschedparam.3:372
6475 #, no-wrap
6476 msgid ""
6477 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
6478 "        if (s != 0)\n"
6479 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
6480 "    }\n"
6481 msgstr ""
6482
6483 #. type: Plain text
6484 #: build/C/man3/pthread_setschedparam.3:378
6485 #, no-wrap
6486 msgid ""
6487 "    if (attr_sched_str != NULL) {\n"
6488 "        if (!get_policy(attr_sched_str[0], &policy))\n"
6489 "            usage(argv[0],\n"
6490 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
6491 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
6492 msgstr ""
6493
6494 #. type: Plain text
6495 #: build/C/man3/pthread_setschedparam.3:386
6496 #, no-wrap
6497 msgid ""
6498 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
6499 "        if (s != 0)\n"
6500 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
6501 "        s = pthread_attr_setschedparam(&attr, &param);\n"
6502 "        if (s != 0)\n"
6503 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
6504 "    }\n"
6505 msgstr ""
6506
6507 #. type: Plain text
6508 #: build/C/man3/pthread_setschedparam.3:389
6509 #, no-wrap
6510 msgid ""
6511 "    /* If we initialized a thread attributes object, display\n"
6512 "       the scheduling attributes that were set in the object */\n"
6513 msgstr ""
6514
6515 #. type: Plain text
6516 #: build/C/man3/pthread_setschedparam.3:397
6517 #, no-wrap
6518 msgid ""
6519 "    if (attrp != NULL) {\n"
6520 "        s = pthread_attr_getschedparam(&attr, &param);\n"
6521 "        if (s != 0)\n"
6522 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
6523 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
6524 "        if (s != 0)\n"
6525 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
6526 msgstr ""
6527
6528 #. type: Plain text
6529 #: build/C/man3/pthread_setschedparam.3:400
6530 #, no-wrap
6531 msgid ""
6532 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
6533 "        display_sched_attr(policy, &param);\n"
6534 msgstr ""
6535
6536 #. type: Plain text
6537 #: build/C/man3/pthread_setschedparam.3:408
6538 #, no-wrap
6539 msgid ""
6540 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
6541 "        printf(\"    inheritsched is %s\\en\",\n"
6542 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
6543 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
6544 "                \"???\");\n"
6545 "        printf(\"\\en\");\n"
6546 "    }\n"
6547 msgstr ""
6548
6549 #. type: Plain text
6550 #: build/C/man3/pthread_setschedparam.3:410
6551 #, no-wrap
6552 msgid "    /* Create a thread that will display its scheduling attributes */\n"
6553 msgstr ""
6554
6555 #. type: Plain text
6556 #: build/C/man3/pthread_setschedparam.3:414
6557 #, no-wrap
6558 msgid ""
6559 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
6560 "    if (s != 0)\n"
6561 "        handle_error_en(s, \"pthread_create\");\n"
6562 msgstr ""
6563
6564 #. type: Plain text
6565 #: build/C/man3/pthread_setschedparam.3:416
6566 #, no-wrap
6567 msgid "    /* Destroy unneeded thread attributes object */\n"
6568 msgstr ""
6569
6570 #. type: Plain text
6571 #: build/C/man3/pthread_setschedparam.3:424
6572 #, no-wrap
6573 msgid ""
6574 "    s = pthread_join(thread, NULL);\n"
6575 "    if (s != 0)\n"
6576 "        handle_error_en(s, \"pthread_join\");\n"
6577 msgstr ""
6578
6579 #. type: Plain text
6580 #: build/C/man3/pthread_setschedparam.3:440
6581 msgid ""
6582 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
6583 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
6584 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
6585 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
6586 "B<pthreads>(7)"
6587 msgstr ""
6588
6589 #. type: TH
6590 #: build/C/man3/pthread_setschedprio.3:24
6591 #, no-wrap
6592 msgid "PTHREAD_SETSCHEDPRIO"
6593 msgstr ""
6594
6595 #. type: TH
6596 #: build/C/man3/pthread_setschedprio.3:24
6597 #, no-wrap
6598 msgid "2008-11-06"
6599 msgstr ""
6600
6601 #. type: Plain text
6602 #: build/C/man3/pthread_setschedprio.3:27
6603 msgid "pthread_setschedprio - set scheduling priority of a thread"
6604 msgstr ""
6605
6606 #. type: Plain text
6607 #: build/C/man3/pthread_setschedprio.3:32
6608 #, no-wrap
6609 msgid "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
6610 msgstr ""
6611
6612 #.  FIXME . nptl/pthread_setschedprio.c has the following
6613 #.    /* If the thread should have higher priority because of some
6614 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
6615 #.  Eventually (perhaps after writing the mutexattr pages), we
6616 #.  may want to add something on the topic to this page.
6617 #.  nptl/pthread_setschedparam.c has a similar case.
6618 #. type: Plain text
6619 #: build/C/man3/pthread_setschedprio.3:50
6620 msgid ""
6621 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
6622 "thread I<thread> to the value specified in I<prio>.  (By contrast "
6623 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
6624 "of a thread.)"
6625 msgstr ""
6626
6627 #. type: Plain text
6628 #: build/C/man3/pthread_setschedprio.3:58
6629 msgid ""
6630 "On success, this function returns 0; on error, it returns a nonzero error "
6631 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
6632 "I<thread> is not changed."
6633 msgstr ""
6634
6635 #. type: Plain text
6636 #: build/C/man3/pthread_setschedprio.3:63
6637 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
6638 msgstr ""
6639
6640 #. type: Plain text
6641 #: build/C/man3/pthread_setschedprio.3:67
6642 msgid ""
6643 "The caller does not have appropriate privileges to set the specified "
6644 "priority."
6645 msgstr ""
6646
6647 #. type: Plain text
6648 #: build/C/man3/pthread_setschedprio.3:78
6649 msgid ""
6650 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
6651 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
6652 msgstr ""
6653
6654 #. type: Plain text
6655 #: build/C/man3/pthread_setschedprio.3:80
6656 msgid "This function is available in glibc since version 2.3.4."
6657 msgstr ""
6658
6659 #. type: Plain text
6660 #: build/C/man3/pthread_setschedprio.3:88
6661 msgid ""
6662 "For a description of the permissions required to, and the effect of, "
6663 "changing a thread's scheduling priority, and details of the permitted ranges "
6664 "for priorities in each scheduling policy, see B<sched_setscheduler>(2)."
6665 msgstr ""
6666
6667 #. type: Plain text
6668 #: build/C/man3/pthread_setschedprio.3:100
6669 msgid ""
6670 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
6671 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
6672 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
6673 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
6674 "B<pthreads>(7)"
6675 msgstr ""
6676
6677 #. type: TH
6678 #: build/C/man3/pthread_sigmask.3:24
6679 #, no-wrap
6680 msgid "PTHREAD_SIGMASK"
6681 msgstr ""
6682
6683 #. type: TH
6684 #: build/C/man3/pthread_sigmask.3:24
6685 #, fuzzy, no-wrap
6686 #| msgid "2008-11-11"
6687 msgid "2011-10-16"
6688 msgstr "2008-11-11"
6689
6690 #. type: Plain text
6691 #: build/C/man3/pthread_sigmask.3:27
6692 msgid "pthread_sigmask - examine and change mask of blocked signals"
6693 msgstr ""
6694
6695 #. type: Plain text
6696 #: build/C/man3/pthread_sigmask.3:33
6697 #, no-wrap
6698 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
6699 msgstr ""
6700
6701 #. type: Plain text
6702 #: build/C/man3/pthread_sigmask.3:44
6703 msgid ""
6704 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
6705 "difference that its use in multithreaded programs is explicitly specified by "
6706 "POSIX.1-2001.  Other differences are noted in this page."
6707 msgstr ""
6708
6709 #. type: Plain text
6710 #: build/C/man3/pthread_sigmask.3:47
6711 msgid ""
6712 "For a description of the arguments and operation of this function, see "
6713 "B<sigprocmask>(2)."
6714 msgstr ""
6715
6716 #. type: Plain text
6717 #: build/C/man3/pthread_sigmask.3:52
6718 msgid ""
6719 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
6720 "number."
6721 msgstr ""
6722
6723 #. type: Plain text
6724 #: build/C/man3/pthread_sigmask.3:55
6725 msgid "See B<sigprocmask>(2)."
6726 msgstr ""
6727
6728 #. type: Plain text
6729 #: build/C/man3/pthread_sigmask.3:59
6730 msgid "A new thread inherits a copy of its creator's signal mask."
6731 msgstr ""
6732
6733 #. type: Plain text
6734 #: build/C/man3/pthread_sigmask.3:64
6735 msgid ""
6736 "The program below blocks some signals in the main thread, and then creates a "
6737 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
6738 "shell session demonstrates its use:"
6739 msgstr ""
6740
6741 #. type: Plain text
6742 #: build/C/man3/pthread_sigmask.3:75
6743 #, no-wrap
6744 msgid ""
6745 "$B< ./a.out &>\n"
6746 "[1] 5423\n"
6747 "$B< kill -QUIT %1>\n"
6748 "Signal handling thread got signal 3\n"
6749 "$B< kill -USR1 %1>\n"
6750 "Signal handling thread got signal 10\n"
6751 "$B< kill -TERM %1>\n"
6752 "[1]+  Terminated              ./a.out\n"
6753 msgstr ""
6754
6755 #. type: Plain text
6756 #: build/C/man3/pthread_sigmask.3:86
6757 #, no-wrap
6758 msgid ""
6759 "#include E<lt>pthread.hE<gt>\n"
6760 "#include E<lt>stdio.hE<gt>\n"
6761 "#include E<lt>stdlib.hE<gt>\n"
6762 "#include E<lt>unistd.hE<gt>\n"
6763 "#include E<lt>signal.hE<gt>\n"
6764 "#include E<lt>errno.hE<gt>\n"
6765 msgstr ""
6766
6767 #. type: Plain text
6768 #: build/C/man3/pthread_sigmask.3:88
6769 #, no-wrap
6770 msgid "/* Simple error handling functions */\n"
6771 msgstr ""
6772
6773 #. type: Plain text
6774 #: build/C/man3/pthread_sigmask.3:97
6775 #, no-wrap
6776 msgid ""
6777 "static void *\n"
6778 "sig_thread(void *arg)\n"
6779 "{\n"
6780 "    sigset_t *set = (sigset_t *) arg;\n"
6781 "    int s, sig;\n"
6782 msgstr ""
6783
6784 #. type: Plain text
6785 #: build/C/man3/pthread_sigmask.3:105
6786 #, no-wrap
6787 msgid ""
6788 "    for (;;) {\n"
6789 "        s = sigwait(set, &sig);\n"
6790 "        if (s != 0)\n"
6791 "            handle_error_en(s, \"sigwait\");\n"
6792 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
6793 "    }\n"
6794 "}\n"
6795 msgstr ""
6796
6797 #. type: Plain text
6798 #: build/C/man3/pthread_sigmask.3:112
6799 #, no-wrap
6800 msgid ""
6801 "int\n"
6802 "main(int argc, char *argv[])\n"
6803 "{\n"
6804 "    pthread_t thread;\n"
6805 "    sigset_t set;\n"
6806 "    int s;\n"
6807 msgstr ""
6808
6809 #. type: Plain text
6810 #: build/C/man3/pthread_sigmask.3:115
6811 #, no-wrap
6812 msgid ""
6813 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
6814 "       will inherit a copy of the signal mask. */\n"
6815 msgstr ""
6816
6817 #. type: Plain text
6818 #: build/C/man3/pthread_sigmask.3:122
6819 #, no-wrap
6820 msgid ""
6821 "    sigemptyset(&set);\n"
6822 "    sigaddset(&set, SIGQUIT);\n"
6823 "    sigaddset(&set, SIGUSR1);\n"
6824 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
6825 "    if (s != 0)\n"
6826 "        handle_error_en(s, \"pthread_sigmask\");\n"
6827 msgstr ""
6828
6829 #. type: Plain text
6830 #: build/C/man3/pthread_sigmask.3:126
6831 #, no-wrap
6832 msgid ""
6833 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
6834 "    if (s != 0)\n"
6835 "        handle_error_en(s, \"pthread_create\");\n"
6836 msgstr ""
6837
6838 #. type: Plain text
6839 #: build/C/man3/pthread_sigmask.3:129
6840 #, no-wrap
6841 msgid ""
6842 "    /* Main thread carries on to create other threads and/or do\n"
6843 "       other work */\n"
6844 msgstr ""
6845
6846 #. type: Plain text
6847 #: build/C/man3/pthread_sigmask.3:132
6848 #, no-wrap
6849 msgid ""
6850 "    pause();            /* Dummy pause so we can test program */\n"
6851 "}\n"
6852 msgstr ""
6853
6854 #. type: Plain text
6855 #: build/C/man3/pthread_sigmask.3:142
6856 msgid ""
6857 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), "
6858 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
6859 msgstr ""
6860
6861 #. type: TH
6862 #: build/C/man3/pthread_sigqueue.3:23
6863 #, no-wrap
6864 msgid "PTHREAD_SIGQUEUE"
6865 msgstr ""
6866
6867 #. type: TH
6868 #: build/C/man3/pthread_sigqueue.3:23
6869 #, no-wrap
6870 msgid "2011-09-23"
6871 msgstr ""
6872
6873 #. type: Plain text
6874 #: build/C/man3/pthread_sigqueue.3:26
6875 msgid "pthread_sigqueue - queue a signal and data to a thread"
6876 msgstr ""
6877
6878 #. type: Plain text
6879 #: build/C/man3/pthread_sigqueue.3:32
6880 #, no-wrap
6881 msgid ""
6882 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
6883 "B<                     const union sigval >I<value>B<);>\n"
6884 msgstr ""
6885
6886 #. type: Plain text
6887 #: build/C/man3/pthread_sigqueue.3:43
6888 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
6889 msgstr ""
6890
6891 #. type: Plain text
6892 #: build/C/man3/pthread_sigqueue.3:51
6893 msgid ""
6894 "The B<pthread_sigqueue>()  function performs a similar task to B<sigqueue>"
6895 "(3), but, rather than sending a signal to another process, it sends a signal "
6896 "to another thread in the same process as the calling thread."
6897 msgstr ""
6898
6899 #. type: Plain text
6900 #: build/C/man3/pthread_sigqueue.3:63
6901 msgid ""
6902 "The I<thread> argument is the ID of another thread in the same process as "
6903 "the caller.  The I<sig> argument specifies the signal to be sent.  The "
6904 "I<value> argument specifies data to accompany the signal; see B<sigqueue>"
6905 "(3)  for details."
6906 msgstr ""
6907
6908 #. type: Plain text
6909 #: build/C/man3/pthread_sigqueue.3:68
6910 msgid ""
6911 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
6912 "number."
6913 msgstr ""
6914
6915 #. type: Plain text
6916 #: build/C/man3/pthread_sigqueue.3:75
6917 msgid ""
6918 "The limit of signals which may be queued has been reached.  (See B<signal>"
6919 "(7)  for further information.)"
6920 msgstr ""
6921
6922 #. type: Plain text
6923 #: build/C/man3/pthread_sigqueue.3:79
6924 msgid "I<sig> was invalid."
6925 msgstr ""
6926
6927 #. type: TP
6928 #: build/C/man3/pthread_sigqueue.3:79
6929 #, no-wrap
6930 msgid "B<ENOSYS>"
6931 msgstr ""
6932
6933 #. type: Plain text
6934 #: build/C/man3/pthread_sigqueue.3:83
6935 msgid "B<pthread_sigqueue>()  is not supported on this system."
6936 msgstr ""
6937
6938 #. type: Plain text
6939 #: build/C/man3/pthread_sigqueue.3:87
6940 msgid "I<thread> is not valid."
6941 msgstr ""
6942
6943 #. type: Plain text
6944 #: build/C/man3/pthread_sigqueue.3:91
6945 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
6946 msgstr ""
6947
6948 #. type: Plain text
6949 #: build/C/man3/pthread_sigqueue.3:93
6950 msgid "This function is a GNU extension."
6951 msgstr ""
6952
6953 #. type: Plain text
6954 #: build/C/man3/pthread_sigqueue.3:101
6955 msgid ""
6956 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<sigqueue>(3), B<sigwait>(3), "
6957 "B<pthread_sigmask>(3), B<pthreads>(7), B<signal>(7)"
6958 msgstr ""
6959
6960 #. type: TH
6961 #: build/C/man3/pthread_testcancel.3:24
6962 #, no-wrap
6963 msgid "PTHREAD_TESTCANCEL"
6964 msgstr ""
6965
6966 #. type: Plain text
6967 #: build/C/man3/pthread_testcancel.3:27
6968 msgid ""
6969 "pthread_testcancel - request delivery of any pending cancellation request"
6970 msgstr ""
6971
6972 #. type: Plain text
6973 #: build/C/man3/pthread_testcancel.3:32
6974 #, no-wrap
6975 msgid "B<void pthread_testcancel(void);>\n"
6976 msgstr ""
6977
6978 #. type: Plain text
6979 #: build/C/man3/pthread_testcancel.3:40
6980 msgid ""
6981 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
6982 "calling thread, so that a thread that is otherwise executing code that "
6983 "contains no cancellation points will respond to a cancellation request."
6984 msgstr ""
6985
6986 #. type: Plain text
6987 #: build/C/man3/pthread_testcancel.3:47
6988 msgid ""
6989 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
6990 "cancellation request is pending, then a call to B<pthread_cancel>(3)  has no "
6991 "effect."
6992 msgstr ""
6993
6994 #. type: Plain text
6995 #: build/C/man3/pthread_testcancel.3:51
6996 msgid ""
6997 "This function does not return a value.  If the calling thread is canceled as "
6998 "a consequence of a call to this function, then the function does not return."
6999 msgstr ""
7000
7001 #. type: Plain text
7002 #: build/C/man3/pthread_testcancel.3:60
7003 msgid "See B<pthread_cleanup_push>(3)."
7004 msgstr ""
7005
7006 #. type: Plain text
7007 #: build/C/man3/pthread_testcancel.3:65
7008 msgid ""
7009 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
7010 "(3), B<pthreads>(7)"
7011 msgstr ""
7012
7013 #. type: TH
7014 #: build/C/man3/pthread_tryjoin_np.3:24
7015 #, no-wrap
7016 msgid "PTHREAD_TRYJOIN_NP"
7017 msgstr ""
7018
7019 #. type: Plain text
7020 #: build/C/man3/pthread_tryjoin_np.3:28
7021 msgid ""
7022 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
7023 "thread"
7024 msgstr ""
7025
7026 #. type: Plain text
7027 #: build/C/man3/pthread_tryjoin_np.3:34
7028 #, no-wrap
7029 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
7030 msgstr ""
7031
7032 #. type: Plain text
7033 #: build/C/man3/pthread_tryjoin_np.3:37
7034 #, no-wrap
7035 msgid ""
7036 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
7037 "B<                         const struct timespec *>I<abstime>B<);>\n"
7038 msgstr ""
7039
7040 #. type: Plain text
7041 #: build/C/man3/pthread_tryjoin_np.3:44
7042 msgid ""
7043 "These functions operate in the same way as B<pthread_join>(3), except for "
7044 "the differences described on this page."
7045 msgstr ""
7046
7047 #. type: Plain text
7048 #: build/C/man3/pthread_tryjoin_np.3:56
7049 msgid ""
7050 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
7051 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
7052 "I<thread> has not yet terminated, then instead of blocking, as is done by "
7053 "B<pthread_join>(3), the call returns an error."
7054 msgstr ""
7055
7056 #. type: Plain text
7057 #: build/C/man3/pthread_tryjoin_np.3:74
7058 msgid ""
7059 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
7060 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
7061 "specified in I<abstime>.  If the timeout expires before I<thread> "
7062 "terminates, the call returns an error.  The I<abstime> argument is a "
7063 "structure of the following form, specifying an absolute time measured since "
7064 "the Epoch (see B<time>(2)):"
7065 msgstr ""
7066
7067 #. type: Plain text
7068 #: build/C/man3/pthread_tryjoin_np.3:81
7069 #, no-wrap
7070 msgid ""
7071 "struct timespec {\n"
7072 "    time_t tv_sec;     /* seconds */\n"
7073 "    long   tv_nsec;    /* nanoseconds */\n"
7074 "};\n"
7075 msgstr ""
7076
7077 #. type: Plain text
7078 #: build/C/man3/pthread_tryjoin_np.3:87
7079 msgid ""
7080 "On success, these functions return 0; on error, they return an error number."
7081 msgstr ""
7082
7083 #. type: Plain text
7084 #: build/C/man3/pthread_tryjoin_np.3:92
7085 msgid ""
7086 "These functions can fail with the same errors as B<pthread_join>(3).  "
7087 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
7088 msgstr ""
7089
7090 #. type: TP
7091 #: build/C/man3/pthread_tryjoin_np.3:92
7092 #, no-wrap
7093 msgid "B<EBUSY>"
7094 msgstr ""
7095
7096 #. type: Plain text
7097 #: build/C/man3/pthread_tryjoin_np.3:96
7098 msgid "I<thread> had not yet terminated at the time of the call."
7099 msgstr ""
7100
7101 #. type: Plain text
7102 #: build/C/man3/pthread_tryjoin_np.3:99
7103 msgid ""
7104 "B<pthread_timedjoin_np>()  can in addition fail with the following error:"
7105 msgstr ""
7106
7107 #. type: TP
7108 #: build/C/man3/pthread_tryjoin_np.3:99
7109 #, no-wrap
7110 msgid "B<ETIMEDOUT>"
7111 msgstr ""
7112
7113 #. type: Plain text
7114 #: build/C/man3/pthread_tryjoin_np.3:104
7115 msgid "The call timed out before I<thread> terminated."
7116 msgstr ""
7117
7118 #. type: Plain text
7119 #: build/C/man3/pthread_tryjoin_np.3:108
7120 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
7121 msgstr ""
7122
7123 #. type: Plain text
7124 #: build/C/man3/pthread_tryjoin_np.3:110
7125 msgid "These functions first appeared in glibc in version 2.3.3."
7126 msgstr ""
7127
7128 #. type: Plain text
7129 #: build/C/man3/pthread_tryjoin_np.3:115
7130 msgid "The following code waits to join for up to 5 seconds:"
7131 msgstr ""
7132
7133 #. type: Plain text
7134 #: build/C/man3/pthread_tryjoin_np.3:119
7135 #, no-wrap
7136 msgid ""
7137 "    struct timespec ts;\n"
7138 "    int s;\n"
7139 msgstr ""
7140
7141 #. type: Plain text
7142 #: build/C/man3/pthread_tryjoin_np.3:121
7143 #, no-wrap
7144 msgid "    ...\n"
7145 msgstr ""
7146
7147 #. type: Plain text
7148 #: build/C/man3/pthread_tryjoin_np.3:125
7149 #, no-wrap
7150 msgid ""
7151 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
7152 "\t/* Handle error */\n"
7153 "    }\n"
7154 msgstr ""
7155
7156 #. type: Plain text
7157 #: build/C/man3/pthread_tryjoin_np.3:127
7158 #, no-wrap
7159 msgid "    ts.tv_sec += 5;\n"
7160 msgstr ""
7161
7162 #. type: Plain text
7163 #: build/C/man3/pthread_tryjoin_np.3:132
7164 #, no-wrap
7165 msgid ""
7166 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
7167 "    if (s != 0) {\n"
7168 "        /* Handle error */\n"
7169 "    }\n"
7170 msgstr ""
7171
7172 #. type: Plain text
7173 #: build/C/man3/pthread_tryjoin_np.3:138
7174 msgid ""
7175 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
7176 msgstr ""
7177
7178 #. type: TH
7179 #: build/C/man3/pthread_yield.3:23
7180 #, no-wrap
7181 msgid "PTHREAD_YIELD"
7182 msgstr ""
7183
7184 #. type: Plain text
7185 #: build/C/man3/pthread_yield.3:26
7186 msgid "pthread_yield - yield the processor"
7187 msgstr ""
7188
7189 #. type: Plain text
7190 #: build/C/man3/pthread_yield.3:31
7191 #, no-wrap
7192 msgid "B<int pthread_yield(void);>\n"
7193 msgstr ""
7194
7195 #. type: Plain text
7196 #: build/C/man3/pthread_yield.3:41
7197 msgid ""
7198 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
7199 "thread is placed at the end of the run queue for its static priority and "
7200 "another thread is scheduled to run.  For further details, see B<sched_yield>"
7201 "(2)"
7202 msgstr ""
7203
7204 #. type: Plain text
7205 #: build/C/man3/pthread_yield.3:46
7206 msgid ""
7207 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
7208 "number."
7209 msgstr ""
7210
7211 #. type: Plain text
7212 #: build/C/man3/pthread_yield.3:50
7213 msgid ""
7214 "On Linux, this call always succeeds (but portable and future-proof "
7215 "applications should nevertheless handle a possible error return)."
7216 msgstr ""
7217
7218 #.  e.g., the BSDs, Tru64, AIX, and Irix.
7219 #. type: Plain text
7220 #: build/C/man3/pthread_yield.3:56
7221 msgid ""
7222 "This call is nonstandard, but present on several other systems.  Use the "
7223 "standardized B<sched_yield>(2)  instead."
7224 msgstr ""
7225
7226 #. type: Plain text
7227 #: build/C/man3/pthread_yield.3:59
7228 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
7229 msgstr ""
7230
7231 #. type: Plain text
7232 #: build/C/man3/pthread_yield.3:63
7233 msgid "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
7234 msgstr "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
7235
7236 #. type: TH
7237 #: build/C/man7/pthreads.7:24
7238 #, no-wrap
7239 msgid "PTHREADS"
7240 msgstr "PTHREADS"
7241
7242 #. type: TH
7243 #: build/C/man7/pthreads.7:24
7244 #, fuzzy, no-wrap
7245 #| msgid "2008-11-11"
7246 msgid "2010-11-14"
7247 msgstr "2008-11-11"
7248
7249 #. type: Plain text
7250 #: build/C/man7/pthreads.7:27
7251 msgid "pthreads - POSIX threads"
7252 msgstr "pthreads - POSIX スレッド"
7253
7254 #. type: Plain text
7255 #: build/C/man7/pthreads.7:34
7256 msgid ""
7257 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
7258 "programming commonly known as POSIX threads, or Pthreads.  A single process "
7259 "can contain multiple threads, all of which are executing the same program.  "
7260 "These threads share the same global memory (data and heap segments), but "
7261 "each thread has its own stack (automatic variables)."
7262 msgstr ""
7263 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
7264 "ラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロ"
7265 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
7266 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
7267 "スレッドは自分専用のスタック (自動変数) を持つ。"
7268
7269 #. type: Plain text
7270 #: build/C/man7/pthreads.7:37
7271 msgid ""
7272 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
7273 "these attributes are process-wide rather than per-thread):"
7274 msgstr ""
7275 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
7276 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
7277
7278 #. type: IP
7279 #: build/C/man7/pthreads.7:37 build/C/man7/pthreads.7:39
7280 #: build/C/man7/pthreads.7:41 build/C/man7/pthreads.7:43
7281 #: build/C/man7/pthreads.7:45 build/C/man7/pthreads.7:47
7282 #: build/C/man7/pthreads.7:49 build/C/man7/pthreads.7:52
7283 #: build/C/man7/pthreads.7:54 build/C/man7/pthreads.7:57
7284 #: build/C/man7/pthreads.7:63 build/C/man7/pthreads.7:68
7285 #: build/C/man7/pthreads.7:71 build/C/man7/pthreads.7:74
7286 #: build/C/man7/pthreads.7:82 build/C/man7/pthreads.7:86
7287 #: build/C/man7/pthreads.7:89 build/C/man7/pthreads.7:93
7288 #: build/C/man7/pthreads.7:96 build/C/man7/pthreads.7:103
7289 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
7290 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
7291 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
7292 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
7293 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
7294 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
7295 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
7296 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
7297 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
7298 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
7299 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
7300 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
7301 #: build/C/man7/pthreads.7:833
7302 #, no-wrap
7303 msgid "-"
7304 msgstr "-"
7305
7306 #. type: Plain text
7307 #: build/C/man7/pthreads.7:39
7308 msgid "process ID"
7309 msgstr "プロセス ID"
7310
7311 #. type: Plain text
7312 #: build/C/man7/pthreads.7:41
7313 msgid "parent process ID"
7314 msgstr "親プロセス ID"
7315
7316 #. type: Plain text
7317 #: build/C/man7/pthreads.7:43
7318 msgid "process group ID and session ID"
7319 msgstr "プロセスグループ ID とセッション ID"
7320
7321 #. type: Plain text
7322 #: build/C/man7/pthreads.7:45
7323 msgid "controlling terminal"
7324 msgstr "制御端末"
7325
7326 #. type: Plain text
7327 #: build/C/man7/pthreads.7:47
7328 msgid "user and group IDs"
7329 msgstr "ユーザ ID とグループ ID"
7330
7331 #. type: Plain text
7332 #: build/C/man7/pthreads.7:49
7333 msgid "open file descriptors"
7334 msgstr "オープンするファイルディスクリプタ"
7335
7336 #. type: Plain text
7337 #: build/C/man7/pthreads.7:52
7338 msgid "record locks (see B<fcntl>(2))"
7339 msgstr "レコードのロック (B<fcntl>(3)  参照)"
7340
7341 #. type: Plain text
7342 #: build/C/man7/pthreads.7:54
7343 msgid "signal dispositions"
7344 msgstr "シグナルの配置"
7345
7346 #. type: Plain text
7347 #: build/C/man7/pthreads.7:57
7348 msgid "file mode creation mask (B<umask>(2))"
7349 msgstr "ファイルモード作成マスク (B<umask>(2))"
7350
7351 #. type: Plain text
7352 #: build/C/man7/pthreads.7:63
7353 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
7354 msgstr ""
7355 "カレント・ディレクトリ (B<chdir>(2))  とルート・ディレクトリ (B<chroot>(2))"
7356
7357 #. type: Plain text
7358 #: build/C/man7/pthreads.7:68
7359 msgid ""
7360 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
7361 msgstr ""
7362 "インターバル・タイマ (B<setitimer>(2))  と POSIX タイマ (B<timer_create>(2))"
7363
7364 #. type: Plain text
7365 #: build/C/man7/pthreads.7:71
7366 msgid "nice value (B<setpriority>(2))"
7367 msgstr "nice 値 (B<setpriority>(2))"
7368
7369 #. type: Plain text
7370 #: build/C/man7/pthreads.7:74
7371 msgid "resource limits (B<setrlimit>(2))"
7372 msgstr "リソース制限 (B<setrlimit>(2))"
7373
7374 #. type: Plain text
7375 #: build/C/man7/pthreads.7:79
7376 msgid ""
7377 "measurements of the consumption of CPU time (B<times>(2))  and resources "
7378 "(B<getrusage>(2))"
7379 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
7380
7381 #. type: Plain text
7382 #: build/C/man7/pthreads.7:82
7383 msgid ""
7384 "As well as the stack, POSIX.1 specifies that various other attributes are "
7385 "distinct for each thread, including:"
7386 msgstr ""
7387 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
7388 "るかを規定している:"
7389
7390 #. type: Plain text
7391 #: build/C/man7/pthreads.7:86
7392 msgid "thread ID (the I<pthread_t> data type)"
7393 msgstr "スレッド ID (B<pthread_t> データ型)"
7394
7395 #. type: Plain text
7396 #: build/C/man7/pthreads.7:89
7397 msgid "signal mask (B<pthread_sigmask>(3))"
7398 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
7399
7400 #. type: Plain text
7401 #: build/C/man7/pthreads.7:93
7402 msgid "the I<errno> variable"
7403 msgstr "I<errno> 変数"
7404
7405 #. type: Plain text
7406 #: build/C/man7/pthreads.7:96
7407 msgid "alternate signal stack (B<sigaltstack>(2))"
7408 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
7409
7410 #. type: Plain text
7411 #: build/C/man7/pthreads.7:101
7412 msgid ""
7413 "real-time scheduling policy and priority (B<sched_setscheduler>(2)  and "
7414 "B<sched_setparam>(2))"
7415 msgstr ""
7416 "リアルタイム・スケジューリングのポリシーと優先度 (B<sched_setscheduler>(2)  "
7417 "と B<sched_setparam>(2))"
7418
7419 #. type: Plain text
7420 #: build/C/man7/pthreads.7:103
7421 msgid "The following Linux-specific features are also per-thread:"
7422 msgstr "以下の Linux 特有の機能もスレッド単位である:"
7423
7424 #. type: Plain text
7425 #: build/C/man7/pthreads.7:106
7426 msgid "capabilities (see B<capabilities>(7))"
7427 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
7428
7429 #. type: Plain text
7430 #: build/C/man7/pthreads.7:109
7431 msgid "CPU affinity (B<sched_setaffinity>(2))"
7432 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
7433
7434 #. type: SS
7435 #: build/C/man7/pthreads.7:109
7436 #, no-wrap
7437 msgid "Pthreads function return values"
7438 msgstr "pthreads 関数の返り値"
7439
7440 #. type: Plain text
7441 #: build/C/man7/pthreads.7:116
7442 msgid ""
7443 "Most pthreads functions return 0 on success, and an error number of "
7444 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
7445 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
7446 "the function can never fail with the error B<EINTR>."
7447 msgstr ""
7448 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
7449 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
7450 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
7451 "は決してないと規定している。"
7452
7453 #. type: SS
7454 #: build/C/man7/pthreads.7:116
7455 #, no-wrap
7456 msgid "Thread IDs"
7457 msgstr "スレッド ID"
7458
7459 #. type: Plain text
7460 #: build/C/man7/pthreads.7:130
7461 msgid ""
7462 "Each of the threads in a process has a unique thread identifier (stored in "
7463 "the type I<pthread_t>).  This identifier is returned to the caller of "
7464 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
7465 "using B<pthread_self>(3).  Thread IDs are only guaranteed to be unique "
7466 "within a process.  A thread ID may be reused after a terminated thread has "
7467 "been joined, or a detached thread has terminated.  In all pthreads functions "
7468 "that accept a thread ID as an argument, that ID by definition refers to a "
7469 "thread in the same process as the caller."
7470 msgstr ""
7471 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
7472 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
7473 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
7474 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
7475 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
7476 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
7477 "じプロセス内の一つのスレッドを参照する。"
7478
7479 #. type: SS
7480 #: build/C/man7/pthreads.7:130
7481 #, no-wrap
7482 msgid "Thread-safe functions"
7483 msgstr "スレッドセーフな関数"
7484
7485 #. type: Plain text
7486 #: build/C/man7/pthreads.7:134
7487 msgid ""
7488 "A thread-safe function is one that can be safely (i.e., it will deliver the "
7489 "same results regardless of whether it is)  called from multiple threads at "
7490 "the same time."
7491 msgstr ""
7492 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
7493 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
7494
7495 #. type: Plain text
7496 #: build/C/man7/pthreads.7:138
7497 msgid ""
7498 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
7499 "standard shall be thread-safe, except for the following functions:"
7500 msgstr ""
7501 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
7502 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
7503
7504 #. type: Plain text
7505 #: build/C/man7/pthreads.7:232
7506 #, no-wrap
7507 msgid ""
7508 "asctime()\n"
7509 "basename()\n"
7510 "catgets()\n"
7511 "crypt()\n"
7512 "ctermid() if passed a non-NULL argument\n"
7513 "ctime()\n"
7514 "dbm_clearerr()\n"
7515 "dbm_close()\n"
7516 "dbm_delete()\n"
7517 "dbm_error()\n"
7518 "dbm_fetch()\n"
7519 "dbm_firstkey()\n"
7520 "dbm_nextkey()\n"
7521 "dbm_open()\n"
7522 "dbm_store()\n"
7523 "dirname()\n"
7524 "dlerror()\n"
7525 "drand48()\n"
7526 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
7527 "encrypt()\n"
7528 "endgrent()\n"
7529 "endpwent()\n"
7530 "endutxent()\n"
7531 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
7532 "ftw()\n"
7533 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
7534 "getc_unlocked()\n"
7535 "getchar_unlocked()\n"
7536 "getdate()\n"
7537 "getenv()\n"
7538 "getgrent()\n"
7539 "getgrgid()\n"
7540 "getgrnam()\n"
7541 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
7542 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
7543 "gethostent()\n"
7544 "getlogin()\n"
7545 "getnetbyaddr()\n"
7546 "getnetbyname()\n"
7547 "getnetent()\n"
7548 "getopt()\n"
7549 "getprotobyname()\n"
7550 "getprotobynumber()\n"
7551 "getprotoent()\n"
7552 "getpwent()\n"
7553 "getpwnam()\n"
7554 "getpwuid()\n"
7555 "getservbyname()\n"
7556 "getservbyport()\n"
7557 "getservent()\n"
7558 "getutxent()\n"
7559 "getutxid()\n"
7560 "getutxline()\n"
7561 "gmtime()\n"
7562 "hcreate()\n"
7563 "hdestroy()\n"
7564 "hsearch()\n"
7565 "inet_ntoa()\n"
7566 "l64a()\n"
7567 "lgamma()\n"
7568 "lgammaf()\n"
7569 "lgammal()\n"
7570 "localeconv()\n"
7571 "localtime()\n"
7572 "lrand48()\n"
7573 "mrand48()\n"
7574 "nftw()\n"
7575 "nl_langinfo()\n"
7576 "ptsname()\n"
7577 "putc_unlocked()\n"
7578 "putchar_unlocked()\n"
7579 "putenv()\n"
7580 "pututxline()\n"
7581 "rand()\n"
7582 "readdir()\n"
7583 "setenv()\n"
7584 "setgrent()\n"
7585 "setkey()\n"
7586 "setpwent()\n"
7587 "setutxent()\n"
7588 "strerror()\n"
7589 "strsignal() [Added in POSIX.1-2008]\n"
7590 "strtok()\n"
7591 "system() [Added in POSIX.1-2008]\n"
7592 "tmpnam() if passed a non-NULL argument\n"
7593 "ttyname()\n"
7594 "unsetenv()\n"
7595 "wcrtomb() if its final argument is NULL\n"
7596 "wcsrtombs() if its final argument is NULL\n"
7597 "wcstombs()\n"
7598 "wctomb()\n"
7599 msgstr ""
7600 "asctime()\n"
7601 "basename()\n"
7602 "catgets()\n"
7603 "crypt()\n"
7604 "ctermid() (NULL でない引き数を渡された場合)\n"
7605 "ctime()\n"
7606 "dbm_clearerr()\n"
7607 "dbm_close()\n"
7608 "dbm_delete()\n"
7609 "dbm_error()\n"
7610 "dbm_fetch()\n"
7611 "dbm_firstkey()\n"
7612 "dbm_nextkey()\n"
7613 "dbm_open()\n"
7614 "dbm_store()\n"
7615 "dirname()\n"
7616 "dlerror()\n"
7617 "drand48()\n"
7618 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
7619 "encrypt()\n"
7620 "endgrent()\n"
7621 "endpwent()\n"
7622 "endutxent()\n"
7623 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
7624 "ftw()\n"
7625 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
7626 "getc_unlocked()\n"
7627 "getchar_unlocked()\n"
7628 "getdate()\n"
7629 "getenv()\n"
7630 "getgrent()\n"
7631 "getgrgid()\n"
7632 "getgrnam()\n"
7633 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
7634 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
7635 "gethostent()\n"
7636 "getlogin()\n"
7637 "getnetbyaddr()\n"
7638 "getnetbyname()\n"
7639 "getnetent()\n"
7640 "getopt()\n"
7641 "getprotobyname()\n"
7642 "getprotobynumber()\n"
7643 "getprotoent()\n"
7644 "getpwent()\n"
7645 "getpwnam()\n"
7646 "getpwuid()\n"
7647 "getservbyname()\n"
7648 "getservbyport()\n"
7649 "getservent()\n"
7650 "getutxent()\n"
7651 "getutxid()\n"
7652 "getutxline()\n"
7653 "gmtime()\n"
7654 "hcreate()\n"
7655 "hdestroy()\n"
7656 "hsearch()\n"
7657 "inet_ntoa()\n"
7658 "l64a()\n"
7659 "lgamma()\n"
7660 "lgammaf()\n"
7661 "lgammal()\n"
7662 "localeconv()\n"
7663 "localtime()\n"
7664 "lrand48()\n"
7665 "mrand48()\n"
7666 "nftw()\n"
7667 "nl_langinfo()\n"
7668 "ptsname()\n"
7669 "putc_unlocked()\n"
7670 "putchar_unlocked()\n"
7671 "putenv()\n"
7672 "pututxline()\n"
7673 "rand()\n"
7674 "readdir()\n"
7675 "setenv()\n"
7676 "setgrent()\n"
7677 "setkey()\n"
7678 "setpwent()\n"
7679 "setutxent()\n"
7680 "strerror()\n"
7681 "strsignal() [POSIX.1-2008 で追加された]\n"
7682 "strtok()\n"
7683 "system() [POSIX.1-2008 で追加された]\n"
7684 "tmpnam() (NULL でない引き数を渡された場合)\n"
7685 "ttyname()\n"
7686 "unsetenv()\n"
7687 "wcrtomb() (最後の引き数が NULL の場合)\n"
7688 "wcsrtombs() (最後の引き数が NULL の場合)\n"
7689 "wcstombs()\n"
7690 "wctomb()\n"
7691
7692 #. type: SS
7693 #: build/C/man7/pthreads.7:234
7694 #, fuzzy, no-wrap
7695 #| msgid "Thread-safe functions"
7696 msgid "Async-cancel-safe functions"
7697 msgstr "スレッドセーフな関数"
7698
7699 #. type: Plain text
7700 #: build/C/man7/pthreads.7:238
7701 msgid ""
7702 "An async-cancel-safe function is one that can be safely called in an "
7703 "application where asynchronous cancelability is enabled (see "
7704 "B<pthread_setcancelstate>(3))."
7705 msgstr ""
7706
7707 #. type: Plain text
7708 #: build/C/man7/pthreads.7:241
7709 #, fuzzy
7710 #| msgid ""
7711 #| "The following functions are required to be cancellation points by "
7712 #| "POSIX.1-2001 and/or POSIX.1-2008:"
7713 msgid ""
7714 "Only the following functions are required to be async-cancel-safe by "
7715 "POSIX.1-2001 and POSIX.1-2008:"
7716 msgstr ""
7717 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
7718 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
7719
7720 #. type: Plain text
7721 #: build/C/man7/pthreads.7:247
7722 #, no-wrap
7723 msgid ""
7724 "pthread_cancel()\n"
7725 "pthread_setcancelstate()\n"
7726 "pthread_setcanceltype()\n"
7727 msgstr ""
7728
7729 #. type: SS
7730 #: build/C/man7/pthreads.7:249
7731 #, no-wrap
7732 msgid "Cancellation Points"
7733 msgstr "取り消しポイント (cancellation points)"
7734
7735 #. type: Plain text
7736 #: build/C/man7/pthreads.7:256
7737 msgid ""
7738 "POSIX.1 specifies that certain functions must, and certain other functions "
7739 "may, be cancellation points.  If a thread is cancelable, its cancelability "
7740 "type is deferred, and a cancellation request is pending for the thread, then "
7741 "the thread is canceled when it calls a function that is a cancellation point."
7742 msgstr ""
7743 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
7744 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
7745 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
7746 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
7747 "時点で、そのスレッドのキャンセルが 行われる。"
7748
7749 #. type: Plain text
7750 #: build/C/man7/pthreads.7:259
7751 msgid ""
7752 "The following functions are required to be cancellation points by "
7753 "POSIX.1-2001 and/or POSIX.1-2008:"
7754 msgstr ""
7755 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
7756 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
7757
7758 #. type: Plain text
7759 #: build/C/man7/pthreads.7:322
7760 #, no-wrap
7761 msgid ""
7762 "accept()\n"
7763 "aio_suspend()\n"
7764 "clock_nanosleep()\n"
7765 "close()\n"
7766 "connect()\n"
7767 "creat()\n"
7768 "fcntl() F_SETLKW\n"
7769 "fdatasync()\n"
7770 "fsync()\n"
7771 "getmsg()\n"
7772 "getpmsg()\n"
7773 "lockf() F_LOCK\n"
7774 "mq_receive()\n"
7775 "mq_send()\n"
7776 "mq_timedreceive()\n"
7777 "mq_timedsend()\n"
7778 "msgrcv()\n"
7779 "msgsnd()\n"
7780 "msync()\n"
7781 "nanosleep()\n"
7782 "open()\n"
7783 "openat() [Added in POSIX.1-2008]\n"
7784 "pause()\n"
7785 "poll()\n"
7786 "pread()\n"
7787 "pselect()\n"
7788 "pthread_cond_timedwait()\n"
7789 "pthread_cond_wait()\n"
7790 "pthread_join()\n"
7791 "pthread_testcancel()\n"
7792 "putmsg()\n"
7793 "putpmsg()\n"
7794 "pwrite()\n"
7795 "read()\n"
7796 "readv()\n"
7797 "recv()\n"
7798 "recvfrom()\n"
7799 "recvmsg()\n"
7800 "select()\n"
7801 "sem_timedwait()\n"
7802 "sem_wait()\n"
7803 "send()\n"
7804 "sendmsg()\n"
7805 "sendto()\n"
7806 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
7807 "sigsuspend()\n"
7808 "sigtimedwait()\n"
7809 "sigwait()\n"
7810 "sigwaitinfo()\n"
7811 "sleep()\n"
7812 "system()\n"
7813 "tcdrain()\n"
7814 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
7815 "wait()\n"
7816 "waitid()\n"
7817 "waitpid()\n"
7818 "write()\n"
7819 "writev()\n"
7820 msgstr ""
7821 "accept()\n"
7822 "aio_suspend()\n"
7823 "clock_nanosleep()\n"
7824 "close()\n"
7825 "connect()\n"
7826 "creat()\n"
7827 "fcntl() F_SETLKW\n"
7828 "fdatasync()\n"
7829 "fsync()\n"
7830 "getmsg()\n"
7831 "getpmsg()\n"
7832 "lockf() F_LOCK\n"
7833 "mq_receive()\n"
7834 "mq_send()\n"
7835 "mq_timedreceive()\n"
7836 "mq_timedsend()\n"
7837 "msgrcv()\n"
7838 "msgsnd()\n"
7839 "msync()\n"
7840 "nanosleep()\n"
7841 "open()\n"
7842 "openat() [POSIX.1-2008 で追加された]\n"
7843 "pause()\n"
7844 "poll()\n"
7845 "pread()\n"
7846 "pselect()\n"
7847 "pthread_cond_timedwait()\n"
7848 "pthread_cond_wait()\n"
7849 "pthread_join()\n"
7850 "pthread_testcancel()\n"
7851 "putmsg()\n"
7852 "putpmsg()\n"
7853 "pwrite()\n"
7854 "read()\n"
7855 "readv()\n"
7856 "recv()\n"
7857 "recvfrom()\n"
7858 "recvmsg()\n"
7859 "select()\n"
7860 "sem_timedwait()\n"
7861 "sem_wait()\n"
7862 "send()\n"
7863 "sendmsg()\n"
7864 "sendto()\n"
7865 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
7866 "sigsuspend()\n"
7867 "sigtimedwait()\n"
7868 "sigwait()\n"
7869 "sigwaitinfo()\n"
7870 "sleep()\n"
7871 "system()\n"
7872 "tcdrain()\n"
7873 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
7874 "wait()\n"
7875 "waitid()\n"
7876 "waitpid()\n"
7877 "write()\n"
7878 "writev()\n"
7879
7880 #. type: Plain text
7881 #: build/C/man7/pthreads.7:327
7882 msgid ""
7883 "The following functions may be cancellation points according to POSIX.1-2001 "
7884 "and/or POSIX.1-2008:"
7885 msgstr ""
7886 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
7887 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
7888
7889 #. type: Plain text
7890 #: build/C/man7/pthreads.7:555
7891 #, no-wrap
7892 msgid ""
7893 "access()\n"
7894 "asctime()\n"
7895 "asctime_r()\n"
7896 "catclose()\n"
7897 "catgets()\n"
7898 "catopen()\n"
7899 "chmod() [Added in POSIX.1-2008]\n"
7900 "chown() [Added in POSIX.1-2008]\n"
7901 "closedir()\n"
7902 "closelog()\n"
7903 "ctermid()\n"
7904 "ctime()\n"
7905 "ctime_r()\n"
7906 "dbm_close()\n"
7907 "dbm_delete()\n"
7908 "dbm_fetch()\n"
7909 "dbm_nextkey()\n"
7910 "dbm_open()\n"
7911 "dbm_store()\n"
7912 "dlclose()\n"
7913 "dlopen()\n"
7914 "dprintf() [Added in POSIX.1-2008]\n"
7915 "endgrent()\n"
7916 "endhostent()\n"
7917 "endnetent()\n"
7918 "endprotoent()\n"
7919 "endpwent()\n"
7920 "endservent()\n"
7921 "endutxent()\n"
7922 "faccessat() [Added in POSIX.1-2008]\n"
7923 "fchmod() [Added in POSIX.1-2008]\n"
7924 "fchmodat() [Added in POSIX.1-2008]\n"
7925 "fchown() [Added in POSIX.1-2008]\n"
7926 "fchownat() [Added in POSIX.1-2008]\n"
7927 "fclose()\n"
7928 "fcntl() (for any value of cmd argument)\n"
7929 "fflush()\n"
7930 "fgetc()\n"
7931 "fgetpos()\n"
7932 "fgets()\n"
7933 "fgetwc()\n"
7934 "fgetws()\n"
7935 "fmtmsg()\n"
7936 "fopen()\n"
7937 "fpathconf()\n"
7938 "fprintf()\n"
7939 "fputc()\n"
7940 "fputs()\n"
7941 "fputwc()\n"
7942 "fputws()\n"
7943 "fread()\n"
7944 "freopen()\n"
7945 "fscanf()\n"
7946 "fseek()\n"
7947 "fseeko()\n"
7948 "fsetpos()\n"
7949 "fstat()\n"
7950 "fstatat() [Added in POSIX.1-2008]\n"
7951 "ftell()\n"
7952 "ftello()\n"
7953 "ftw()\n"
7954 "futimens() [Added in POSIX.1-2008]\n"
7955 "fwprintf()\n"
7956 "fwrite()\n"
7957 "fwscanf()\n"
7958 "getaddrinfo()\n"
7959 "getc()\n"
7960 "getc_unlocked()\n"
7961 "getchar()\n"
7962 "getchar_unlocked()\n"
7963 "getcwd()\n"
7964 "getdate()\n"
7965 "getdelim() [Added in POSIX.1-2008]\n"
7966 "getgrent()\n"
7967 "getgrgid()\n"
7968 "getgrgid_r()\n"
7969 "getgrnam()\n"
7970 "getgrnam_r()\n"
7971 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
7972 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
7973 "gethostent()\n"
7974 "gethostid()\n"
7975 "gethostname()\n"
7976 "getline() [Added in POSIX.1-2008]\n"
7977 "getlogin()\n"
7978 "getlogin_r()\n"
7979 "getnameinfo()\n"
7980 "getnetbyaddr()\n"
7981 "getnetbyname()\n"
7982 "getnetent()\n"
7983 "getopt() (if opterr is nonzero)\n"
7984 "getprotobyname()\n"
7985 "getprotobynumber()\n"
7986 "getprotoent()\n"
7987 "getpwent()\n"
7988 "getpwnam()\n"
7989 "getpwnam_r()\n"
7990 "getpwuid()\n"
7991 "getpwuid_r()\n"
7992 "gets()\n"
7993 "getservbyname()\n"
7994 "getservbyport()\n"
7995 "getservent()\n"
7996 "getutxent()\n"
7997 "getutxid()\n"
7998 "getutxline()\n"
7999 "getwc()\n"
8000 "getwchar()\n"
8001 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
8002 "glob()\n"
8003 "iconv_close()\n"
8004 "iconv_open()\n"
8005 "ioctl()\n"
8006 "link()\n"
8007 "linkat() [Added in POSIX.1-2008]\n"
8008 "lio_listio() [Added in POSIX.1-2008]\n"
8009 "localtime()\n"
8010 "localtime_r()\n"
8011 "lockf() [Added in POSIX.1-2008]\n"
8012 "lseek()\n"
8013 "lstat()\n"
8014 "mkdir() [Added in POSIX.1-2008]\n"
8015 "mkdirat() [Added in POSIX.1-2008]\n"
8016 "mkdtemp() [Added in POSIX.1-2008]\n"
8017 "mkfifo() [Added in POSIX.1-2008]\n"
8018 "mkfifoat() [Added in POSIX.1-2008]\n"
8019 "mknod() [Added in POSIX.1-2008]\n"
8020 "mknodat() [Added in POSIX.1-2008]\n"
8021 "mkstemp()\n"
8022 "mktime()\n"
8023 "nftw()\n"
8024 "opendir()\n"
8025 "openlog()\n"
8026 "pathconf()\n"
8027 "pclose()\n"
8028 "perror()\n"
8029 "popen()\n"
8030 "posix_fadvise()\n"
8031 "posix_fallocate()\n"
8032 "posix_madvise()\n"
8033 "posix_openpt()\n"
8034 "posix_spawn()\n"
8035 "posix_spawnp()\n"
8036 "posix_trace_clear()\n"
8037 "posix_trace_close()\n"
8038 "posix_trace_create()\n"
8039 "posix_trace_create_withlog()\n"
8040 "posix_trace_eventtypelist_getnext_id()\n"
8041 "posix_trace_eventtypelist_rewind()\n"
8042 "posix_trace_flush()\n"
8043 "posix_trace_get_attr()\n"
8044 "posix_trace_get_filter()\n"
8045 "posix_trace_get_status()\n"
8046 "posix_trace_getnext_event()\n"
8047 "posix_trace_open()\n"
8048 "posix_trace_rewind()\n"
8049 "posix_trace_set_filter()\n"
8050 "posix_trace_shutdown()\n"
8051 "posix_trace_timedgetnext_event()\n"
8052 "posix_typed_mem_open()\n"
8053 "printf()\n"
8054 "psiginfo() [Added in POSIX.1-2008]\n"
8055 "psignal() [Added in POSIX.1-2008]\n"
8056 "pthread_rwlock_rdlock()\n"
8057 "pthread_rwlock_timedrdlock()\n"
8058 "pthread_rwlock_timedwrlock()\n"
8059 "pthread_rwlock_wrlock()\n"
8060 "putc()\n"
8061 "putc_unlocked()\n"
8062 "putchar()\n"
8063 "putchar_unlocked()\n"
8064 "puts()\n"
8065 "pututxline()\n"
8066 "putwc()\n"
8067 "putwchar()\n"
8068 "readdir()\n"
8069 "readdir_r()\n"
8070 "readlink() [Added in POSIX.1-2008]\n"
8071 "readlinkat() [Added in POSIX.1-2008]\n"
8072 "remove()\n"
8073 "rename()\n"
8074 "renameat() [Added in POSIX.1-2008]\n"
8075 "rewind()\n"
8076 "rewinddir()\n"
8077 "scandir() [Added in POSIX.1-2008]\n"
8078 "scanf()\n"
8079 "seekdir()\n"
8080 "semop()\n"
8081 "setgrent()\n"
8082 "sethostent()\n"
8083 "setnetent()\n"
8084 "setprotoent()\n"
8085 "setpwent()\n"
8086 "setservent()\n"
8087 "setutxent()\n"
8088 "sigpause() [Added in POSIX.1-2008]\n"
8089 "stat()\n"
8090 "strerror()\n"
8091 "strerror_r()\n"
8092 "strftime()\n"
8093 "symlink()\n"
8094 "symlinkat() [Added in POSIX.1-2008]\n"
8095 "sync()\n"
8096 "syslog()\n"
8097 "tmpfile()\n"
8098 "tmpnam()\n"
8099 "ttyname()\n"
8100 "ttyname_r()\n"
8101 "tzset()\n"
8102 "ungetc()\n"
8103 "ungetwc()\n"
8104 "unlink()\n"
8105 "unlinkat() [Added in POSIX.1-2008]\n"
8106 "utime() [Added in POSIX.1-2008]\n"
8107 "utimensat() [Added in POSIX.1-2008]\n"
8108 "utimes() [Added in POSIX.1-2008]\n"
8109 "vdprintf() [Added in POSIX.1-2008]\n"
8110 "vfprintf()\n"
8111 "vfwprintf()\n"
8112 "vprintf()\n"
8113 "vwprintf()\n"
8114 "wcsftime()\n"
8115 "wordexp()\n"
8116 "wprintf()\n"
8117 "wscanf()\n"
8118 msgstr ""
8119 "access()\n"
8120 "asctime()\n"
8121 "asctime_r()\n"
8122 "catclose()\n"
8123 "catgets()\n"
8124 "catopen()\n"
8125 "chmod() [POSIX.1-2008 で追加された]\n"
8126 "chown() [POSIX.1-2008 で追加された]\n"
8127 "closedir()\n"
8128 "closelog()\n"
8129 "ctermid()\n"
8130 "ctime()\n"
8131 "ctime_r()\n"
8132 "dbm_close()\n"
8133 "dbm_delete()\n"
8134 "dbm_fetch()\n"
8135 "dbm_nextkey()\n"
8136 "dbm_open()\n"
8137 "dbm_store()\n"
8138 "dlclose()\n"
8139 "dlopen()\n"
8140 "dprintf() [POSIX.1-2008 で追加された]\n"
8141 "endgrent()\n"
8142 "endhostent()\n"
8143 "endnetent()\n"
8144 "endprotoent()\n"
8145 "endpwent()\n"
8146 "endservent()\n"
8147 "endutxent()\n"
8148 "faccessat() [POSIX.1-2008 で追加された]\n"
8149 "fchmod() [POSIX.1-2008 で追加された]\n"
8150 "fchmodat() [POSIX.1-2008 で追加された]\n"
8151 "fchown() [POSIX.1-2008 で追加された]\n"
8152 "fchownat() [POSIX.1-2008 で追加された]\n"
8153 "fclose()\n"
8154 "fcntl() (cmd 引き数が何であっても)\n"
8155 "fflush()\n"
8156 "fgetc()\n"
8157 "fgetpos()\n"
8158 "fgets()\n"
8159 "fgetwc()\n"
8160 "fgetws()\n"
8161 "fmtmsg()\n"
8162 "fopen()\n"
8163 "fpathconf()\n"
8164 "fprintf()\n"
8165 "fputc()\n"
8166 "fputs()\n"
8167 "fputwc()\n"
8168 "fputws()\n"
8169 "fread()\n"
8170 "freopen()\n"
8171 "fscanf()\n"
8172 "fseek()\n"
8173 "fseeko()\n"
8174 "fsetpos()\n"
8175 "fstat()\n"
8176 "fstatat() [POSIX.1-2008 で追加された]\n"
8177 "ftell()\n"
8178 "ftello()\n"
8179 "ftw()\n"
8180 "futimens() [POSIX.1-2008 で追加された]\n"
8181 "fwprintf()\n"
8182 "fwrite()\n"
8183 "fwscanf()\n"
8184 "getaddrinfo()\n"
8185 "getc()\n"
8186 "getc_unlocked()\n"
8187 "getchar()\n"
8188 "getchar_unlocked()\n"
8189 "getcwd()\n"
8190 "getdate()\n"
8191 "getdelim() [POSIX.1-2008 で追加された]\n"
8192 "getgrent()\n"
8193 "getgrgid()\n"
8194 "getgrgid_r()\n"
8195 "getgrnam()\n"
8196 "getgrnam_r()\n"
8197 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
8198 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
8199 "gethostent()\n"
8200 "gethostid()\n"
8201 "gethostname()\n"
8202 "getline() [POSIX.1-2008 で追加された]\n"
8203 "getlogin()\n"
8204 "getlogin_r()\n"
8205 "getnameinfo()\n"
8206 "getnetbyaddr()\n"
8207 "getnetbyname()\n"
8208 "getnetent()\n"
8209 "getopt() (opterr が 0 以外の場合)\n"
8210 "getprotobyname()\n"
8211 "getprotobynumber()\n"
8212 "getprotoent()\n"
8213 "getpwent()\n"
8214 "getpwnam()\n"
8215 "getpwnam_r()\n"
8216 "getpwuid()\n"
8217 "getpwuid_r()\n"
8218 "gets()\n"
8219 "getservbyname()\n"
8220 "getservbyport()\n"
8221 "getservent()\n"
8222 "getutxent()\n"
8223 "getutxid()\n"
8224 "getutxline()\n"
8225 "getwc()\n"
8226 "getwchar()\n"
8227 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
8228 "glob()\n"
8229 "iconv_close()\n"
8230 "iconv_open()\n"
8231 "ioctl()\n"
8232 "link()\n"
8233 "linkat() [POSIX.1-2008 で追加された]\n"
8234 "lio_listio() [POSIX.1-2008 で追加された]\n"
8235 "localtime()\n"
8236 "localtime_r()\n"
8237 "lockf() [POSIX.1-2008 で追加された]\n"
8238 "lseek()\n"
8239 "lstat()\n"
8240 "mkdir() [POSIX.1-2008 で追加された]\n"
8241 "mkdirat() [POSIX.1-2008 で追加された]\n"
8242 "mkdtemp() [POSIX.1-2008 で追加された]\n"
8243 "mkfifo() [POSIX.1-2008 で追加された]\n"
8244 "mkfifoat() [POSIX.1-2008 で追加された]\n"
8245 "mknod() [POSIX.1-2008 で追加された]\n"
8246 "mknodat() [POSIX.1-2008 で追加された]\n"
8247 "mkstemp()\n"
8248 "mktime()\n"
8249 "nftw()\n"
8250 "opendir()\n"
8251 "openlog()\n"
8252 "pathconf()\n"
8253 "pclose()\n"
8254 "perror()\n"
8255 "popen()\n"
8256 "posix_fadvise()\n"
8257 "posix_fallocate()\n"
8258 "posix_madvise()\n"
8259 "posix_openpt()\n"
8260 "posix_spawn()\n"
8261 "posix_spawnp()\n"
8262 "posix_trace_clear()\n"
8263 "posix_trace_close()\n"
8264 "posix_trace_create()\n"
8265 "posix_trace_create_withlog()\n"
8266 "posix_trace_eventtypelist_getnext_id()\n"
8267 "posix_trace_eventtypelist_rewind()\n"
8268 "posix_trace_flush()\n"
8269 "posix_trace_get_attr()\n"
8270 "posix_trace_get_filter()\n"
8271 "posix_trace_get_status()\n"
8272 "posix_trace_getnext_event()\n"
8273 "posix_trace_open()\n"
8274 "posix_trace_rewind()\n"
8275 "posix_trace_set_filter()\n"
8276 "posix_trace_shutdown()\n"
8277 "posix_trace_timedgetnext_event()\n"
8278 "posix_typed_mem_open()\n"
8279 "printf()\n"
8280 "psiginfo() [POSIX.1-2008 で追加された]\n"
8281 "psignal() [POSIX.1-2008 で追加された]\n"
8282 "pthread_rwlock_rdlock()\n"
8283 "pthread_rwlock_timedrdlock()\n"
8284 "pthread_rwlock_timedwrlock()\n"
8285 "pthread_rwlock_wrlock()\n"
8286 "putc()\n"
8287 "putc_unlocked()\n"
8288 "putchar()\n"
8289 "putchar_unlocked()\n"
8290 "puts()\n"
8291 "pututxline()\n"
8292 "putwc()\n"
8293 "putwchar()\n"
8294 "readdir()\n"
8295 "readdir_r()\n"
8296 "readlink() [POSIX.1-2008 で追加された]\n"
8297 "readlinkat() [POSIX.1-2008 で追加された]\n"
8298 "remove()\n"
8299 "rename()\n"
8300 "renameat() [POSIX.1-2008 で追加された]\n"
8301 "rewind()\n"
8302 "rewinddir()\n"
8303 "scandir() [POSIX.1-2008 で追加された]\n"
8304 "scanf()\n"
8305 "seekdir()\n"
8306 "semop()\n"
8307 "setgrent()\n"
8308 "sethostent()\n"
8309 "setnetent()\n"
8310 "setprotoent()\n"
8311 "setpwent()\n"
8312 "setservent()\n"
8313 "setutxent()\n"
8314 "sigpause() [POSIX.1-2008 で追加された]\n"
8315 "stat()\n"
8316 "strerror()\n"
8317 "strerror_r()\n"
8318 "strftime()\n"
8319 "symlink()\n"
8320 "symlinkat() [POSIX.1-2008 で追加された]\n"
8321 "sync()\n"
8322 "syslog()\n"
8323 "tmpfile()\n"
8324 "tmpnam()\n"
8325 "ttyname()\n"
8326 "ttyname_r()\n"
8327 "tzset()\n"
8328 "ungetc()\n"
8329 "ungetwc()\n"
8330 "unlink()\n"
8331 "unlinkat() [POSIX.1-2008 で追加された]\n"
8332 "utime() [POSIX.1-2008 で追加された]\n"
8333 "utimensat() [POSIX.1-2008 で追加された]\n"
8334 "utimes() [POSIX.1-2008 で追加された]\n"
8335 "vdprintf() [POSIX.1-2008 で追加された]\n"
8336 "vfprintf()\n"
8337 "vfwprintf()\n"
8338 "vprintf()\n"
8339 "vwprintf()\n"
8340 "wcsftime()\n"
8341 "wordexp()\n"
8342 "wprintf()\n"
8343 "wscanf()\n"
8344
8345 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
8346 #.  files, it looks as though at least the following nonstandard
8347 #.  functions are cancellation points:
8348 #.  endnetgrent
8349 #.  endspent
8350 #.  epoll_pwait
8351 #.  epoll_wait
8352 #.  fcloseall
8353 #.  fdopendir
8354 #.  fflush_unlocked
8355 #.  fgetc_unlocked
8356 #.  fgetgrent
8357 #.  fgetgrent_r
8358 #.  fgetpwent
8359 #.  fgetpwent_r
8360 #.  fgets_unlocked
8361 #.  fgetspent
8362 #.  fgetspent_r
8363 #.  fgetwc_unlocked
8364 #.  fgetws_unlocked
8365 #.  fputc_unlocked
8366 #.  fputs_unlocked
8367 #.  fputwc_unlocked
8368 #.  fputws_unlocked
8369 #.  fread_unlocked
8370 #.  fwrite_unlocked
8371 #.  gai_suspend
8372 #.  getaddrinfo_a
8373 #.  getdate_r
8374 #.  getgrent_r
8375 #.  getgrouplist
8376 #.  gethostbyaddr_r
8377 #.  gethostbyname2
8378 #.  gethostbyname2_r
8379 #.  gethostbyname_r
8380 #.  gethostent_r
8381 #.  getnetbyaddr_r
8382 #.  getnetbyname_r
8383 #.  getnetent_r
8384 #.  getnetgrent
8385 #.  getnetgrent_r
8386 #.  getprotobyname_r
8387 #.  getprotobynumber_r
8388 #.  getprotoent_r
8389 #.  getpw
8390 #.  getpwent_r
8391 #.  getservbyname_r
8392 #.  getservbyport_r
8393 #.  getservent_r
8394 #.  getspent
8395 #.  getspent_r
8396 #.  getspnam
8397 #.  getspnam_r
8398 #.  getutmp
8399 #.  getutmpx
8400 #.  getw
8401 #.  getwc_unlocked
8402 #.  getwchar_unlocked
8403 #.  initgroups
8404 #.  innetgr
8405 #.  mkostemp
8406 #.  mkostemp64
8407 #.  mkstemp64
8408 #.  ppoll
8409 #.  pthread_timedjoin_np
8410 #.  putgrent
8411 #.  putpwent
8412 #.  putspent
8413 #.  putw
8414 #.  putwc_unlocked
8415 #.  putwchar_unlocked
8416 #.  rcmd
8417 #.  rcmd_af
8418 #.  rexec
8419 #.  rexec_af
8420 #.  rresvport
8421 #.  rresvport_af
8422 #.  ruserok
8423 #.  ruserok_af
8424 #.  setnetgrent
8425 #.  setspent
8426 #.  sgetspent
8427 #.  sgetspent_r
8428 #.  updwtmpx
8429 #.  utmpxname
8430 #.  vfscanf
8431 #.  vfwscanf
8432 #.  vscanf
8433 #.  vsyslog
8434 #.  vwscanf
8435 #. type: Plain text
8436 #: build/C/man7/pthreads.7:653
8437 msgid ""
8438 "An implementation may also mark other functions not specified in the "
8439 "standard as cancellation points.  In particular, an implementation is likely "
8440 "to mark any nonstandard function that may block as a cancellation point.  "
8441 "(This includes most functions that can touch files.)"
8442 msgstr ""
8443 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
8444 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
8445 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
8446 "関数がこれに含まれる)。"
8447
8448 #. type: SS
8449 #: build/C/man7/pthreads.7:653
8450 #, no-wrap
8451 msgid "Compiling on Linux"
8452 msgstr "Linux でのコンパイル"
8453
8454 #. type: Plain text
8455 #: build/C/man7/pthreads.7:656
8456 msgid ""
8457 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
8458 "pthread>."
8459 msgstr ""
8460 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
8461 "きである。"
8462
8463 #. type: SS
8464 #: build/C/man7/pthreads.7:656
8465 #, no-wrap
8466 msgid "Linux Implementations of POSIX Threads"
8467 msgstr "POSIX スレッドの Linux での実装"
8468
8469 #. type: Plain text
8470 #: build/C/man7/pthreads.7:659
8471 msgid ""
8472 "Over time, two threading implementations have been provided by the GNU C "
8473 "library on Linux:"
8474 msgstr ""
8475 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
8476 "た。"
8477
8478 #. type: TP
8479 #: build/C/man7/pthreads.7:659
8480 #, no-wrap
8481 msgid "B<LinuxThreads>"
8482 msgstr "B<LinuxThreads>"
8483
8484 #. type: Plain text
8485 #: build/C/man7/pthreads.7:663
8486 msgid ""
8487 "This is the original Pthreads implementation.  Since glibc 2.4, this "
8488 "implementation is no longer supported."
8489 msgstr ""
8490 "最初の Pthreads の実装。 glibc 2.4 以降は、この実装はもはやサポートされていな"
8491 "い。"
8492
8493 #. type: TP
8494 #: build/C/man7/pthreads.7:663
8495 #, no-wrap
8496 msgid "B<NPTL> (Native POSIX Threads Library)"
8497 msgstr "B<NPTL> (Native POSIX Threads Library)"
8498
8499 #. type: Plain text
8500 #: build/C/man7/pthreads.7:671
8501 msgid ""
8502 "This is the modern Pthreads implementation.  By comparison with "
8503 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
8504 "POSIX.1 specification and better performance when creating large numbers of "
8505 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
8506 "are present in the Linux 2.6 kernel."
8507 msgstr ""
8508 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
8509 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
8510 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
8511 "装されている機能が必要である。"
8512
8513 #. type: Plain text
8514 #: build/C/man7/pthreads.7:681
8515 msgid ""
8516 "Both of these are so-called 1:1 implementations, meaning that each thread "
8517 "maps to a kernel scheduling entity.  Both threading implementations employ "
8518 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
8519 "primitives (mutexes, thread joining, etc.) are implemented using the Linux "
8520 "B<futex>(2)  system call."
8521 msgstr ""
8522 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
8523 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
8524 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
8525 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
8526 "使って実装されている。"
8527
8528 #. type: SS
8529 #: build/C/man7/pthreads.7:681
8530 #, no-wrap
8531 msgid "LinuxThreads"
8532 msgstr "LinuxThreads"
8533
8534 #. type: Plain text
8535 #: build/C/man7/pthreads.7:683
8536 msgid "The notable features of this implementation are the following:"
8537 msgstr "この実装の大きな特徴は以下の通りである:"
8538
8539 #. type: Plain text
8540 #: build/C/man7/pthreads.7:690
8541 msgid ""
8542 "In addition to the main (initial) thread, and the threads that the program "
8543 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
8544 "thread.  This thread handles thread creation and termination.  (Problems can "
8545 "result if this thread is inadvertently killed.)"
8546 msgstr ""
8547 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
8548 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
8549 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
8550 "kill されると、問題が起こることがある)。"
8551
8552 #. type: Plain text
8553 #: build/C/man7/pthreads.7:702
8554 msgid ""
8555 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
8556 "the first three real-time signals are used (see also B<signal>(7)).  On "
8557 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
8558 "avoid the use of whichever set of signals is employed by the implementation."
8559 msgstr ""
8560 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
8561 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
8562 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
8563 "用されているシグナルを どれも使わないようにしなければならない。"
8564
8565 #. type: Plain text
8566 #: build/C/man7/pthreads.7:709
8567 msgid ""
8568 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
8569 "implemented as processes which share more information than usual, but which "
8570 "do not share a common process ID.)  LinuxThreads threads (including the "
8571 "manager thread)  are visible as separate processes using B<ps>(1)."
8572 msgstr ""
8573 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
8574 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
8575 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
8576 "を使うと別のプロセスのように見える。"
8577
8578 #. type: Plain text
8579 #: build/C/man7/pthreads.7:712
8580 msgid ""
8581 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
8582 "number of ways, including the following:"
8583 msgstr ""
8584 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
8585 "示すような点がある:"
8586
8587 #. type: Plain text
8588 #: build/C/man7/pthreads.7:716
8589 msgid "Calls to B<getpid>(2)  return a different value in each thread."
8590 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
8591
8592 #. type: Plain text
8593 #: build/C/man7/pthreads.7:725
8594 msgid ""
8595 "Calls to B<getppid>(2)  in threads other than the main thread return the "
8596 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
8597 "should return the same value as B<getppid>(2)  in the main thread."
8598 msgstr ""
8599 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
8600 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
8601 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
8602
8603 #. type: Plain text
8604 #: build/C/man7/pthreads.7:735
8605 msgid ""
8606 "When one thread creates a new child process using B<fork>(2), any thread "
8607 "should be able to B<wait>(2)  on the child.  However, the implementation "
8608 "only allows the thread that created the child to B<wait>(2)  on it."
8609 msgstr ""
8610 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
8611 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
8612 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
8613 "る。"
8614
8615 #. type: Plain text
8616 #: build/C/man7/pthreads.7:742
8617 msgid ""
8618 "When a thread calls B<execve>(2), all other threads are terminated (as "
8619 "required by POSIX.1).  However, the resulting process has the same PID as "
8620 "the thread that called B<execve>(2): it should have the same PID as the main "
8621 "thread."
8622 msgstr ""
8623 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
8624 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
8625 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
8626 "る。"
8627
8628 #. type: Plain text
8629 #: build/C/man7/pthreads.7:749
8630 msgid ""
8631 "Threads do not share user and group IDs.  This can cause complications with "
8632 "set-user-ID programs and can cause failures in Pthreads functions if an "
8633 "application changes its credentials using B<seteuid>(2)  or similar."
8634 msgstr ""
8635 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
8636 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使っ"
8637 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
8638
8639 #. type: Plain text
8640 #: build/C/man7/pthreads.7:751
8641 msgid "Threads do not share a common session ID and process group ID."
8642 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
8643
8644 #. type: Plain text
8645 #: build/C/man7/pthreads.7:754
8646 msgid "Threads do not share record locks created using B<fcntl>(2)."
8647 msgstr ""
8648 "スレッド間で B<fcntl>(2)  を使って作成されるレコード・ロックを共有しない。"
8649
8650 #. type: Plain text
8651 #: build/C/man7/pthreads.7:760
8652 msgid ""
8653 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
8654 "rather than process-wide."
8655 msgstr ""
8656 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
8657 "単位の情報である。"
8658
8659 #. type: Plain text
8660 #: build/C/man7/pthreads.7:763
8661 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
8662 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
8663
8664 #. type: Plain text
8665 #: build/C/man7/pthreads.7:765
8666 msgid "Threads do not share interval timers."
8667 msgstr "スレッド間でインターバル・タイマを共有しない。"
8668
8669 #.  FIXME . bug report filed for NPTL nice nonconformance
8670 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
8671 #.  Sep 08: there is a patch by Denys Vlasenko to address this
8672 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
8673 #.  Monitor this to see if it makes it into mainline.
8674 #. type: Plain text
8675 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
8676 msgid "Threads do not share a common nice value."
8677 msgstr "スレッドは共通の nice 値を共有しない。"
8678
8679 #. type: Plain text
8680 #: build/C/man7/pthreads.7:777
8681 msgid ""
8682 "POSIX.1 distinguishes the notions of signals that are directed to the "
8683 "process as a whole and signals that are directed to individual threads.  "
8684 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
8685 "example) should be handled by a single, arbitrarily selected thread within "
8686 "the process.  LinuxThreads does not support the notion of process-directed "
8687 "signals: signals may only be sent to specific threads."
8688 msgstr ""
8689 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
8690 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
8691 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
8692 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
8693 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
8694 "ルは特定のスレッドにだけ送ることができる。"
8695
8696 #. type: Plain text
8697 #: build/C/man7/pthreads.7:786
8698 msgid ""
8699 "Threads have distinct alternate signal stack settings.  However, a new "
8700 "thread's alternate signal stack settings are copied from the thread that "
8701 "created it, so that the threads initially share an alternate signal stack.  "
8702 "(A new thread should start with no alternate signal stack defined.  If two "
8703 "threads handle signals on their shared alternate signal stack at the same "
8704 "time, unpredictable program failures are likely to occur.)"
8705 msgstr ""
8706 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
8707 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
8708 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
8709 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
8710 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
8711 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
8712
8713 #. type: SS
8714 #: build/C/man7/pthreads.7:786
8715 #, no-wrap
8716 msgid "NPTL"
8717 msgstr "NPTL"
8718
8719 #. type: Plain text
8720 #: build/C/man7/pthreads.7:795
8721 msgid ""
8722 "With NPTL, all of the threads in a process are placed in the same thread "
8723 "group; all members of a thread group share the same PID.  NPTL does not "
8724 "employ a manager thread.  NPTL makes internal use of the first two real-time "
8725 "signals (see also B<signal>(7)); these signals cannot be used in "
8726 "applications."
8727 msgstr ""
8728 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
8729 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
8730 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
8731 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
8732 "ションでは使用できない。"
8733
8734 #. type: Plain text
8735 #: build/C/man7/pthreads.7:797
8736 msgid "NPTL still has at least one nonconformance with POSIX.1:"
8737 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
8738
8739 #. type: Plain text
8740 #: build/C/man7/pthreads.7:806
8741 msgid "Some NPTL nonconformances only occur with older kernels:"
8742 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
8743
8744 #. type: Plain text
8745 #: build/C/man7/pthreads.7:812
8746 msgid ""
8747 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
8748 "rather than process-wide (fixed in kernel 2.6.9)."
8749 msgstr ""
8750 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
8751 "単位の情報である (カーネル 2.6.9 で修正された)。"
8752
8753 #. type: Plain text
8754 #: build/C/man7/pthreads.7:814
8755 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
8756 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
8757
8758 #. type: Plain text
8759 #: build/C/man7/pthreads.7:816
8760 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
8761 msgstr ""
8762 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
8763
8764 #. type: Plain text
8765 #: build/C/man7/pthreads.7:820
8766 msgid ""
8767 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
8768 "(fixed in kernel 2.6.16)."
8769 msgstr ""
8770 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
8771 "きる (カーネル 2.6.16 で修正された)。"
8772
8773 #. type: Plain text
8774 #: build/C/man7/pthreads.7:825
8775 msgid ""
8776 "Only the main thread is permitted to make the process into a process group "
8777 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
8778 msgstr ""
8779 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセス・グルー"
8780 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
8781
8782 #. type: Plain text
8783 #: build/C/man7/pthreads.7:831
8784 msgid ""
8785 "Threads have distinct alternate signal stack settings.  However, a new "
8786 "thread's alternate signal stack settings are copied from the thread that "
8787 "created it, so that the threads initially share an alternate signal stack "
8788 "(fixed in kernel 2.6.16)."
8789 msgstr ""
8790 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
8791 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
8792 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
8793 "ル 2.6.16 で修正された)。"
8794
8795 #. type: Plain text
8796 #: build/C/man7/pthreads.7:833
8797 msgid "Note the following further points about the NPTL implementation:"
8798 msgstr "NPTL の実装では以下の点についても注意すること:"
8799
8800 #. type: Plain text
8801 #: build/C/man7/pthreads.7:847
8802 msgid ""
8803 "If the stack size soft resource limit (see the description of "
8804 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
8805 "I<unlimited>, then this value defines the default stack size for new "
8806 "threads.  To be effective, this limit must be set before the program is "
8807 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
8808 "stacksize> in the C shell)."
8809 msgstr ""
8810 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2)  の "
8811 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
8812 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
8813 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
8814 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
8815 "は I<limit stacksize>)  を使って設定する。"
8816
8817 #. type: SS
8818 #: build/C/man7/pthreads.7:847
8819 #, no-wrap
8820 msgid "Determining the Threading Implementation"
8821 msgstr "スレッド実装の判定"
8822
8823 #. type: Plain text
8824 #: build/C/man7/pthreads.7:852
8825 msgid ""
8826 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
8827 "system's threading implementation, for example:"
8828 msgstr ""
8829 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
8830 "装を判定することができる。 以下に例を示す:"
8831
8832 #. type: Plain text
8833 #: build/C/man7/pthreads.7:857
8834 #, no-wrap
8835 msgid ""
8836 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
8837 "NPTL 2.3.4\n"
8838 msgstr ""
8839 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
8840 "NPTL 2.3.4\n"
8841
8842 #. type: Plain text
8843 #: build/C/man7/pthreads.7:862
8844 msgid ""
8845 "With older glibc versions, a command such as the following should be "
8846 "sufficient to determine the default threading implementation:"
8847 msgstr ""
8848 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
8849 "ド実装を判定することができる。"
8850
8851 #. type: Plain text
8852 #: build/C/man7/pthreads.7:868
8853 #, no-wrap
8854 msgid ""
8855 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
8856 "                egrep -i \\(aqthreads|nptl\\(aq\n"
8857 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
8858 msgstr ""
8859 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
8860 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
8861 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
8862
8863 #. type: SS
8864 #: build/C/man7/pthreads.7:870
8865 #, no-wrap
8866 msgid "Selecting the Threading Implementation: LD_ASSUME_KERNEL"
8867 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
8868
8869 #. type: Plain text
8870 #: build/C/man7/pthreads.7:885
8871 msgid ""
8872 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
8873 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
8874 "override the dynamic linker's default choice of threading implementation.  "
8875 "This variable tells the dynamic linker to assume that it is running on top "
8876 "of a particular kernel version.  By specifying a kernel version that does "
8877 "not provide the support required by NPTL, we can force the use of "
8878 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
8879 "application that depends on some nonconformant behavior in LinuxThreads.)  "
8880 "For example:"
8881 msgstr ""
8882 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
8883 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
8884 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
8885 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
8886 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
8887 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
8888 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
8889 "ン を動作させる場合だろう)。 以下に例を示す:"
8890
8891 #. type: Plain text
8892 #: build/C/man7/pthreads.7:891
8893 #, no-wrap
8894 msgid ""
8895 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
8896 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
8897 "        linuxthreads-0.10 by Xavier Leroy\n"
8898 msgstr ""
8899 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
8900 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
8901 "        linuxthreads-0.10 by Xavier Leroy\n"
8902
8903 #. type: Plain text
8904 #: build/C/man7/pthreads.7:903
8905 msgid ""
8906 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), B<sigevent>"
8907 "(7), B<signal>(7),"
8908 msgstr ""
8909 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
8910 "B<signal>(7),"
8911
8912 #. type: Plain text
8913 #: build/C/man7/pthreads.7:927
8914 #, fuzzy
8915 #| msgid ""
8916 #| "and various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
8917 #| "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
8918 #| "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
8919 #| "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
8920 #| "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
8921 #| "B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>"
8922 #| "(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), "
8923 #| "B<pthread_sigmask>(3), and B<pthread_testcancel>(3)"
8924 msgid ""
8925 "and various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
8926 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
8927 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
8928 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
8929 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
8930 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>"
8931 "(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), "
8932 "B<pthread_sigmask>(3), B<pthread_sigqueue>(3), and B<pthread_testcancel>(3)"
8933 msgstr ""
8934 "および Pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3), "
8935 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
8936 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
8937 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
8938 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
8939 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>"
8940 "(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), "
8941 "B<pthread_sigmask>(3), B<pthread_testcancel>(3)"
8942
8943 #~ msgid "2008-11-18"
8944 #~ msgstr "2008-11-18"