OSDN Git Service

a123ef913178bb1a5c209e6ee499492d070e6978
[linuxjm/LDP_man-pages.git] / po4a / pthread / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2012-04-25 05:36+0900\n"
10 "PO-Revision-Date: 2012-04-25 05:03+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man2/getcontext.2:23
20 #, no-wrap
21 msgid "GETCONTEXT"
22 msgstr "GETCONTEXT"
23
24 #. type: TH
25 #: build/C/man2/getcontext.2:23
26 #, no-wrap
27 msgid "2009-03-15"
28 msgstr "2009-03-15"
29
30 #. type: TH
31 #: build/C/man2/getcontext.2:23 build/C/man3/pthread_attr_init.3:24
32 #: build/C/man3/pthread_attr_setaffinity_np.3:24
33 #: build/C/man3/pthread_attr_setdetachstate.3:24
34 #: build/C/man3/pthread_attr_setguardsize.3:24
35 #: build/C/man3/pthread_attr_setinheritsched.3:24
36 #: build/C/man3/pthread_attr_setschedparam.3:24
37 #: build/C/man3/pthread_attr_setschedpolicy.3:24
38 #: build/C/man3/pthread_attr_setscope.3:24
39 #: build/C/man3/pthread_attr_setstack.3:24
40 #: build/C/man3/pthread_attr_setstackaddr.3:24
41 #: build/C/man3/pthread_attr_setstacksize.3:24
42 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_cleanup_push.3:24
43 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
44 #: build/C/man3/pthread_create.3:24 build/C/man3/pthread_detach.3:24
45 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
46 #: build/C/man3/pthread_getattr_np.3:24
47 #: build/C/man3/pthread_getcpuclockid.3:24 build/C/man3/pthread_join.3:24
48 #: build/C/man3/pthread_kill.3:24
49 #: build/C/man3/pthread_kill_other_threads_np.3:24
50 #: build/C/man3/pthread_self.3:24 build/C/man3/pthread_setaffinity_np.3:24
51 #: build/C/man3/pthread_setcancelstate.3:24
52 #: build/C/man3/pthread_setconcurrency.3:23
53 #: build/C/man3/pthread_setschedparam.3:24
54 #: build/C/man3/pthread_setschedprio.3:24 build/C/man3/pthread_sigmask.3:24
55 #: build/C/man3/pthread_sigqueue.3:23 build/C/man3/pthread_testcancel.3:24
56 #: build/C/man3/pthread_tryjoin_np.3:24 build/C/man3/pthread_yield.3:23
57 #: build/C/man7/pthreads.7:24
58 #, no-wrap
59 msgid "Linux"
60 msgstr "Linux"
61
62 #. type: TH
63 #: build/C/man2/getcontext.2:23 build/C/man3/makecontext.3:25
64 #: build/C/man3/pthread_attr_init.3:24
65 #: build/C/man3/pthread_attr_setaffinity_np.3:24
66 #: build/C/man3/pthread_attr_setdetachstate.3:24
67 #: build/C/man3/pthread_attr_setguardsize.3:24
68 #: build/C/man3/pthread_attr_setinheritsched.3:24
69 #: build/C/man3/pthread_attr_setschedparam.3:24
70 #: build/C/man3/pthread_attr_setschedpolicy.3:24
71 #: build/C/man3/pthread_attr_setscope.3:24
72 #: build/C/man3/pthread_attr_setstack.3:24
73 #: build/C/man3/pthread_attr_setstackaddr.3:24
74 #: build/C/man3/pthread_attr_setstacksize.3:24
75 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_cleanup_push.3:24
76 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
77 #: build/C/man3/pthread_create.3:24 build/C/man3/pthread_detach.3:24
78 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
79 #: build/C/man3/pthread_getattr_np.3:24
80 #: build/C/man3/pthread_getcpuclockid.3:24 build/C/man3/pthread_join.3:24
81 #: build/C/man3/pthread_kill.3:24
82 #: build/C/man3/pthread_kill_other_threads_np.3:24
83 #: build/C/man3/pthread_self.3:24 build/C/man3/pthread_setaffinity_np.3:24
84 #: build/C/man3/pthread_setcancelstate.3:24
85 #: build/C/man3/pthread_setconcurrency.3:23
86 #: build/C/man3/pthread_setschedparam.3:24
87 #: build/C/man3/pthread_setschedprio.3:24 build/C/man3/pthread_sigmask.3:24
88 #: build/C/man3/pthread_sigqueue.3:23 build/C/man3/pthread_testcancel.3:24
89 #: build/C/man3/pthread_tryjoin_np.3:24 build/C/man3/pthread_yield.3:23
90 #: build/C/man7/pthreads.7:24
91 #, no-wrap
92 msgid "Linux Programmer's Manual"
93 msgstr "Linux Programmer's Manual"
94
95 #. type: SH
96 #: build/C/man2/getcontext.2:24 build/C/man3/makecontext.3:26
97 #: build/C/man3/pthread_attr_init.3:25
98 #: build/C/man3/pthread_attr_setaffinity_np.3:25
99 #: build/C/man3/pthread_attr_setdetachstate.3:25
100 #: build/C/man3/pthread_attr_setguardsize.3:25
101 #: build/C/man3/pthread_attr_setinheritsched.3:25
102 #: build/C/man3/pthread_attr_setschedparam.3:25
103 #: build/C/man3/pthread_attr_setschedpolicy.3:25
104 #: build/C/man3/pthread_attr_setscope.3:25
105 #: build/C/man3/pthread_attr_setstack.3:25
106 #: build/C/man3/pthread_attr_setstackaddr.3:25
107 #: build/C/man3/pthread_attr_setstacksize.3:25
108 #: build/C/man3/pthread_cancel.3:25 build/C/man3/pthread_cleanup_push.3:25
109 #: build/C/man3/pthread_cleanup_push_defer_np.3:25
110 #: build/C/man3/pthread_create.3:25 build/C/man3/pthread_detach.3:25
111 #: build/C/man3/pthread_equal.3:25 build/C/man3/pthread_exit.3:25
112 #: build/C/man3/pthread_getattr_np.3:25
113 #: build/C/man3/pthread_getcpuclockid.3:25 build/C/man3/pthread_join.3:25
114 #: build/C/man3/pthread_kill.3:25
115 #: build/C/man3/pthread_kill_other_threads_np.3:25
116 #: build/C/man3/pthread_self.3:25 build/C/man3/pthread_setaffinity_np.3:25
117 #: build/C/man3/pthread_setcancelstate.3:25
118 #: build/C/man3/pthread_setconcurrency.3:24
119 #: build/C/man3/pthread_setschedparam.3:25
120 #: build/C/man3/pthread_setschedprio.3:25 build/C/man3/pthread_sigmask.3:25
121 #: build/C/man3/pthread_sigqueue.3:24 build/C/man3/pthread_testcancel.3:25
122 #: build/C/man3/pthread_tryjoin_np.3:25 build/C/man3/pthread_yield.3:24
123 #: build/C/man7/pthreads.7:25
124 #, no-wrap
125 msgid "NAME"
126 msgstr "名前"
127
128 #. type: Plain text
129 #: build/C/man2/getcontext.2:26
130 msgid "getcontext, setcontext - get or set the user context"
131 msgstr "getcontext, setcontext - ユーザコンテキストを取得/設定する"
132
133 #. type: SH
134 #: build/C/man2/getcontext.2:26 build/C/man3/makecontext.3:28
135 #: build/C/man3/pthread_attr_init.3:28
136 #: build/C/man3/pthread_attr_setaffinity_np.3:28
137 #: build/C/man3/pthread_attr_setdetachstate.3:28
138 #: build/C/man3/pthread_attr_setguardsize.3:28
139 #: build/C/man3/pthread_attr_setinheritsched.3:28
140 #: build/C/man3/pthread_attr_setschedparam.3:28
141 #: build/C/man3/pthread_attr_setschedpolicy.3:28
142 #: build/C/man3/pthread_attr_setscope.3:28
143 #: build/C/man3/pthread_attr_setstack.3:28
144 #: build/C/man3/pthread_attr_setstackaddr.3:28
145 #: build/C/man3/pthread_attr_setstacksize.3:28
146 #: build/C/man3/pthread_cancel.3:27 build/C/man3/pthread_cleanup_push.3:28
147 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
148 #: build/C/man3/pthread_create.3:27 build/C/man3/pthread_detach.3:27
149 #: build/C/man3/pthread_equal.3:27 build/C/man3/pthread_exit.3:27
150 #: build/C/man3/pthread_getattr_np.3:27
151 #: build/C/man3/pthread_getcpuclockid.3:27 build/C/man3/pthread_join.3:27
152 #: build/C/man3/pthread_kill.3:27
153 #: build/C/man3/pthread_kill_other_threads_np.3:27
154 #: build/C/man3/pthread_self.3:27 build/C/man3/pthread_setaffinity_np.3:28
155 #: build/C/man3/pthread_setcancelstate.3:28
156 #: build/C/man3/pthread_setconcurrency.3:27
157 #: build/C/man3/pthread_setschedparam.3:28
158 #: build/C/man3/pthread_setschedprio.3:27 build/C/man3/pthread_sigmask.3:27
159 #: build/C/man3/pthread_sigqueue.3:26 build/C/man3/pthread_testcancel.3:27
160 #: build/C/man3/pthread_tryjoin_np.3:28 build/C/man3/pthread_yield.3:26
161 #, no-wrap
162 msgid "SYNOPSIS"
163 msgstr "書式"
164
165 #. type: Plain text
166 #: build/C/man2/getcontext.2:28 build/C/man3/makecontext.3:30
167 msgid "B<#include E<lt>ucontext.hE<gt>>"
168 msgstr "B<#include E<lt>ucontext.hE<gt>>"
169
170 #. type: Plain text
171 #: build/C/man2/getcontext.2:30
172 msgid "B<int getcontext(ucontext_t *>I<ucp>B<);>"
173 msgstr "B<int getcontext(ucontext_t *>I<ucp>B<);>"
174
175 #. type: Plain text
176 #: build/C/man2/getcontext.2:32
177 msgid "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
178 msgstr "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
179
180 #. type: SH
181 #: build/C/man2/getcontext.2:32 build/C/man3/makecontext.3:35
182 #: build/C/man3/pthread_attr_init.3:37
183 #: build/C/man3/pthread_attr_setaffinity_np.3:40
184 #: build/C/man3/pthread_attr_setdetachstate.3:39
185 #: build/C/man3/pthread_attr_setguardsize.3:39
186 #: build/C/man3/pthread_attr_setinheritsched.3:39
187 #: build/C/man3/pthread_attr_setschedparam.3:39
188 #: build/C/man3/pthread_attr_setschedpolicy.3:39
189 #: build/C/man3/pthread_attr_setscope.3:39
190 #: build/C/man3/pthread_attr_setstack.3:52
191 #: build/C/man3/pthread_attr_setstackaddr.3:39
192 #: build/C/man3/pthread_attr_setstacksize.3:39
193 #: build/C/man3/pthread_cancel.3:35 build/C/man3/pthread_cleanup_push.3:38
194 #: build/C/man3/pthread_cleanup_push_defer_np.3:38
195 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
196 #: build/C/man3/pthread_equal.3:35 build/C/man3/pthread_exit.3:35
197 #: build/C/man3/pthread_getattr_np.3:36
198 #: build/C/man3/pthread_getcpuclockid.3:36 build/C/man3/pthread_join.3:35
199 #: build/C/man3/pthread_kill.3:35
200 #: build/C/man3/pthread_kill_other_threads_np.3:33
201 #: build/C/man3/pthread_self.3:35 build/C/man3/pthread_setaffinity_np.3:40
202 #: build/C/man3/pthread_setcancelstate.3:37
203 #: build/C/man3/pthread_setconcurrency.3:36
204 #: build/C/man3/pthread_setschedparam.3:39
205 #: build/C/man3/pthread_setschedprio.3:35 build/C/man3/pthread_sigmask.3:36
206 #: build/C/man3/pthread_sigqueue.3:43 build/C/man3/pthread_testcancel.3:35
207 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
208 #: build/C/man7/pthreads.7:27
209 #, no-wrap
210 msgid "DESCRIPTION"
211 msgstr "説明"
212
213 #. type: Plain text
214 #: build/C/man2/getcontext.2:44
215 msgid ""
216 "In a System V-like environment, one has the two types I<mcontext_t> and "
217 "I<ucontext_t> defined in I<E<lt>ucontext.hE<gt>> and the four functions "
218 "B<getcontext>(), B<setcontext>(), B<makecontext>(3)  and B<swapcontext>(3)  "
219 "that allow user-level context switching between multiple threads of control "
220 "within a process."
221 msgstr ""
222 "System V 的な環境では、 I<mcontext_t> および I<ucontext_t> という 2 つの型"
223 "と、 B<getcontext>(), B<setcontext>(), B<makecontext>(3), B<swapcontext>(3)  "
224 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
225 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
226 "ようになっている。"
227
228 #. type: Plain text
229 #: build/C/man2/getcontext.2:48
230 msgid ""
231 "The I<mcontext_t> type is machine-dependent and opaque.  The I<ucontext_t> "
232 "type is a structure that has at least the following fields:"
233 msgstr ""
234 "I<mcontext_t> 型はマシン依存で、外部からは隠蔽されている。 I<ucontext_t> 型は"
235 "構造体で、少なくとも以下の 4 つのフィールドを持つ。"
236
237 #. type: Plain text
238 #: build/C/man2/getcontext.2:58
239 #, no-wrap
240 msgid ""
241 "typedef struct ucontext {\n"
242 "    struct ucontext *uc_link;\n"
243 "    sigset_t         uc_sigmask;\n"
244 "    stack_t          uc_stack;\n"
245 "    mcontext_t       uc_mcontext;\n"
246 "    ...\n"
247 "} ucontext_t;\n"
248 msgstr ""
249 "typedef struct ucontext {\n"
250 "    struct ucontext *uc_link;\n"
251 "    sigset_t         uc_sigmask;\n"
252 "    stack_t          uc_stack;\n"
253 "    mcontext_t       uc_mcontext;\n"
254 "    ...\n"
255 "} ucontext_t;\n"
256
257 #. type: Plain text
258 #: build/C/man2/getcontext.2:75
259 msgid ""
260 "with I<sigset_t> and I<stack_t> defined in I<E<lt>signal.hE<gt>>.  Here "
261 "I<uc_link> points to the context that will be resumed when the current "
262 "context terminates (in case the current context was created using "
263 "B<makecontext>(3)), I<uc_sigmask> is the set of signals blocked in this "
264 "context (see B<sigprocmask>(2)), I<uc_stack> is the stack used by this "
265 "context (see B<sigaltstack>(2)), and I<uc_mcontext> is the machine-specific "
266 "representation of the saved context, that includes the calling thread's "
267 "machine registers."
268 msgstr ""
269 "I<sigset_t> と I<stack_t> は I<E<lt>signal.hE<gt>> で定義されている。 ここで "
270 "I<uc_link> は、 現在のコンテキストが終了したとき、 続いて切り替わるコンテキス"
271 "トへのポインタである (現在のコンテキストが B<makecontext>(3)  で生成されたも"
272 "のの場合)。 I<uc_sigmask> はこのコンテキストでブロックされている シグナル群で"
273 "ある (B<sigprocmask>(2)  を見よ)。 I<uc_stack> はこのコンテキストが用いている"
274 "スタックである (B<signalstack>(2)  を見よ)。 I<uc_mcontext> は保存されている"
275 "コンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマシ"
276 "ンレジスタが格納される。"
277
278 #. type: Plain text
279 #: build/C/man2/getcontext.2:80
280 msgid ""
281 "The function B<getcontext>()  initializes the structure pointed at by I<ucp> "
282 "to the currently active context."
283 msgstr ""
284 "B<getcontext>()  関数は、 ポインタ I<ucp> が指す構造体を、 現在アクティブなコ"
285 "ンテキストに初期化する。"
286
287 #. type: Plain text
288 #: build/C/man2/getcontext.2:92
289 msgid ""
290 "The function B<setcontext>()  restores the user context pointed at by "
291 "I<ucp>.  A successful call does not return.  The context should have been "
292 "obtained by a call of B<getcontext>(), or B<makecontext>(3), or passed as "
293 "third argument to a signal handler."
294 msgstr ""
295 "B<setcontext>()  関数は、ポインタ I<ucp> が指すユーザコンテキストをリストアす"
296 "る。 呼び出しに成功すると返らない。 このコンテキストは、以前に B<getcontext>"
297 "()  または B<makecontext>(3)  で得られたものか、 あるいはシグナルの第三引数と"
298 "して与えられたものになる。"
299
300 #. type: Plain text
301 #: build/C/man2/getcontext.2:96
302 msgid ""
303 "If the context was obtained by a call of B<getcontext>(), program execution "
304 "continues as if this call just returned."
305 msgstr ""
306 "コンテキストが B<getcontext>()  の呼び出しによって得られていたものの場合は、 "
307 "プログラムはこの呼び出しから返った直後からのように実行を継続する。"
308
309 #. type: Plain text
310 #: build/C/man2/getcontext.2:107
311 msgid ""
312 "If the context was obtained by a call of B<makecontext>(3), program "
313 "execution continues by a call to the function I<func> specified as the "
314 "second argument of that call to B<makecontext>(3).  When the function "
315 "I<func> returns, we continue with the I<uc_link> member of the structure "
316 "I<ucp> specified as the first argument of that call to B<makecontext>(3).  "
317 "When this member is NULL, the thread exits."
318 msgstr ""
319 "コンテキストが B<makecontext>(3)  の呼び出しによって得られていたものの場合"
320 "は、 プログラムの実行はその B<makecontext>(3)  呼び出しの第二引数で指定された"
321 "関数 I<func> を呼び出すかたちで継続する。 I<func> から返ると、 B<makecontext>"
322 "(3)  呼び出しの第一引数で指定されていた I<ucp> 構造体の I<uc_link> メンバで継"
323 "続する。 このメンバが NULL だった場合は、そのスレッドは終了する。"
324
325 #. type: Plain text
326 #: build/C/man2/getcontext.2:114
327 msgid ""
328 "If the context was obtained by a call to a signal handler, then old standard "
329 "text says that \"program execution continues with the program instruction "
330 "following the instruction interrupted by the signal\".  However, this "
331 "sentence was removed in SUSv2, and the present verdict is \"the result is "
332 "unspecified\"."
333 msgstr ""
334 "コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 古"
335 "い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命令"
336 "から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結果"
337 "は定義されていない」である。"
338
339 #. type: SH
340 #: build/C/man2/getcontext.2:114 build/C/man3/makecontext.3:81
341 #: build/C/man3/pthread_attr_init.3:66
342 #: build/C/man3/pthread_attr_setaffinity_np.3:74
343 #: build/C/man3/pthread_attr_setdetachstate.3:75
344 #: build/C/man3/pthread_attr_setguardsize.3:88
345 #: build/C/man3/pthread_attr_setinheritsched.3:82
346 #: build/C/man3/pthread_attr_setschedparam.3:72
347 #: build/C/man3/pthread_attr_setschedpolicy.3:70
348 #: build/C/man3/pthread_attr_setscope.3:89
349 #: build/C/man3/pthread_attr_setstack.3:83
350 #: build/C/man3/pthread_attr_setstackaddr.3:72
351 #: build/C/man3/pthread_attr_setstacksize.3:59
352 #: build/C/man3/pthread_cancel.3:107 build/C/man3/pthread_cleanup_push.3:117
353 #: build/C/man3/pthread_create.3:113 build/C/man3/pthread_detach.3:47
354 #: build/C/man3/pthread_equal.3:39 build/C/man3/pthread_exit.3:69
355 #: build/C/man3/pthread_getattr_np.3:71
356 #: build/C/man3/pthread_getcpuclockid.3:44 build/C/man3/pthread_join.3:68
357 #: build/C/man3/pthread_kill.3:50 build/C/man3/pthread_self.3:44
358 #: build/C/man3/pthread_setaffinity_np.3:75
359 #: build/C/man3/pthread_setcancelstate.3:90
360 #: build/C/man3/pthread_setconcurrency.3:54
361 #: build/C/man3/pthread_setschedparam.3:102
362 #: build/C/man3/pthread_setschedprio.3:51 build/C/man3/pthread_sigmask.3:47
363 #: build/C/man3/pthread_sigqueue.3:63 build/C/man3/pthread_testcancel.3:48
364 #: build/C/man3/pthread_tryjoin_np.3:83 build/C/man3/pthread_yield.3:41
365 #, no-wrap
366 msgid "RETURN VALUE"
367 msgstr "返り値"
368
369 #. type: Plain text
370 #: build/C/man2/getcontext.2:122
371 msgid ""
372 "When successful, B<getcontext>()  returns 0 and B<setcontext>()  does not "
373 "return.  On error, both return -1 and set I<errno> appropriately."
374 msgstr ""
375 "成功すると、 B<getcontext>()  は 0 を返し、 B<setcontext>()  は返らない。 失"
376 "敗すると、両者とも -1 を返し、I<errno> をエラーに応じて設定する。"
377
378 #. type: SH
379 #: build/C/man2/getcontext.2:122 build/C/man3/makecontext.3:93
380 #: build/C/man3/pthread_attr_init.3:69
381 #: build/C/man3/pthread_attr_setaffinity_np.3:77
382 #: build/C/man3/pthread_attr_setdetachstate.3:78
383 #: build/C/man3/pthread_attr_setguardsize.3:91
384 #: build/C/man3/pthread_attr_setinheritsched.3:85
385 #: build/C/man3/pthread_attr_setschedparam.3:75
386 #: build/C/man3/pthread_attr_setschedpolicy.3:73
387 #: build/C/man3/pthread_attr_setscope.3:92
388 #: build/C/man3/pthread_attr_setstack.3:86
389 #: build/C/man3/pthread_attr_setstackaddr.3:75
390 #: build/C/man3/pthread_attr_setstacksize.3:62
391 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_cleanup_push.3:119
392 #: build/C/man3/pthread_create.3:120 build/C/man3/pthread_detach.3:52
393 #: build/C/man3/pthread_equal.3:43 build/C/man3/pthread_exit.3:71
394 #: build/C/man3/pthread_getattr_np.3:74
395 #: build/C/man3/pthread_getcpuclockid.3:47 build/C/man3/pthread_join.3:73
396 #: build/C/man3/pthread_kill.3:55 build/C/man3/pthread_self.3:46
397 #: build/C/man3/pthread_setaffinity_np.3:78
398 #: build/C/man3/pthread_setcancelstate.3:93
399 #: build/C/man3/pthread_setconcurrency.3:66
400 #: build/C/man3/pthread_setschedparam.3:110
401 #: build/C/man3/pthread_setschedprio.3:59 build/C/man3/pthread_sigmask.3:52
402 #: build/C/man3/pthread_sigqueue.3:68 build/C/man3/pthread_testcancel.3:52
403 #: build/C/man3/pthread_tryjoin_np.3:87 build/C/man3/pthread_yield.3:46
404 #, no-wrap
405 msgid "ERRORS"
406 msgstr "エラー"
407
408 #. type: Plain text
409 #: build/C/man2/getcontext.2:124
410 msgid "None defined."
411 msgstr "定義されていない。"
412
413 #. type: SH
414 #: build/C/man2/getcontext.2:124 build/C/man3/makecontext.3:102
415 #: build/C/man3/pthread_attr_init.3:77
416 #: build/C/man3/pthread_attr_setaffinity_np.3:106
417 #: build/C/man3/pthread_attr_setdetachstate.3:85
418 #: build/C/man3/pthread_attr_setguardsize.3:104
419 #: build/C/man3/pthread_attr_setinheritsched.3:99
420 #: build/C/man3/pthread_attr_setschedparam.3:87
421 #: build/C/man3/pthread_attr_setschedpolicy.3:87
422 #: build/C/man3/pthread_attr_setscope.3:105
423 #: build/C/man3/pthread_attr_setstack.3:110
424 #: build/C/man3/pthread_attr_setstackaddr.3:81
425 #: build/C/man3/pthread_attr_setstacksize.3:81
426 #: build/C/man3/pthread_cancel.3:120 build/C/man3/pthread_cleanup_push.3:123
427 #: build/C/man3/pthread_cleanup_push_defer_np.3:99
428 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:62
429 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
430 #: build/C/man3/pthread_getattr_np.3:96
431 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:96
432 #: build/C/man3/pthread_kill.3:64
433 #: build/C/man3/pthread_kill_other_threads_np.3:45
434 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_setaffinity_np.3:119
435 #: build/C/man3/pthread_setcancelstate.3:111
436 #: build/C/man3/pthread_setconcurrency.3:81
437 #: build/C/man3/pthread_setschedparam.3:139
438 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigmask.3:55
439 #: build/C/man3/pthread_sigqueue.3:91 build/C/man3/pthread_testcancel.3:56
440 #: build/C/man3/pthread_tryjoin_np.3:110 build/C/man3/pthread_yield.3:50
441 #, no-wrap
442 msgid "CONFORMING TO"
443 msgstr "準拠"
444
445 #. type: Plain text
446 #: build/C/man2/getcontext.2:130
447 msgid ""
448 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specification of B<getcontext>"
449 "(), citing portability issues, and recommending that applications be "
450 "rewritten to use POSIX threads instead."
451 msgstr ""
452 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<getcontext>()  の"
453 "仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直"
454 "すことが 推奨されている。"
455
456 #. type: SH
457 #: build/C/man2/getcontext.2:130 build/C/man3/makecontext.3:110
458 #: build/C/man3/pthread_attr_init.3:79
459 #: build/C/man3/pthread_attr_setaffinity_np.3:109
460 #: build/C/man3/pthread_attr_setdetachstate.3:87
461 #: build/C/man3/pthread_attr_setguardsize.3:106
462 #: build/C/man3/pthread_attr_setschedparam.3:89
463 #: build/C/man3/pthread_attr_setscope.3:107
464 #: build/C/man3/pthread_attr_setstack.3:112
465 #: build/C/man3/pthread_attr_setstackaddr.3:84
466 #: build/C/man3/pthread_attr_setstacksize.3:83
467 #: build/C/man3/pthread_cancel.3:122 build/C/man3/pthread_cleanup_push.3:125
468 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
469 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
470 #: build/C/man3/pthread_getcpuclockid.3:65 build/C/man3/pthread_join.3:98
471 #: build/C/man3/pthread_kill.3:66
472 #: build/C/man3/pthread_kill_other_threads_np.3:48
473 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_setaffinity_np.3:122
474 #: build/C/man3/pthread_setcancelstate.3:113
475 #: build/C/man3/pthread_setconcurrency.3:83
476 #: build/C/man3/pthread_setschedparam.3:141
477 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:57
478 #: build/C/man3/pthread_yield.3:56
479 #, no-wrap
480 msgid "NOTES"
481 msgstr "注意"
482
483 #. type: Plain text
484 #: build/C/man2/getcontext.2:147
485 msgid ""
486 "The earliest incarnation of this mechanism was the B<setjmp>(3)/B<longjmp>"
487 "(3)  mechanism.  Since that does not define the handling of the signal "
488 "context, the next stage was the B<sigsetjmp>(3)/B<siglongjmp>(3)  pair.  The "
489 "present mechanism gives much more control.  On the other hand, there is no "
490 "easy way to detect whether a return from B<getcontext>()  is from the first "
491 "call, or via a B<setcontext>()  call.  The user has to invent her own "
492 "bookkeeping device, and a register variable won't do since registers are "
493 "restored."
494 msgstr ""
495 "このメカニズムの最古の実装は、 B<setjmp>(3)/B<longjmp>(3)  機構であった。 こ"
496 "れらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階で"
497 "は B<sigsetjmp>(3)/B<siglongjmp>(3)  のペアが現われた。 現在の機構ではずっと"
498 "細かな制御ができる。 一方 B<getcontext>()  から返ったとき、 これが最初の呼び"
499 "出しであったか、 それとも B<setcontext>()  呼び出しからのものであるかを 区別"
500 "する容易な方法がなくなってしまった。 ユーザは「しおり」機構を自分で作らなけれ"
501 "ばならない。 レジスタ変数は (レジスタはリストアされてしまうので) これをやって"
502 "くれない。"
503
504 #. type: Plain text
505 #: build/C/man2/getcontext.2:158
506 msgid ""
507 "When a signal occurs, the current user context is saved and a new context is "
508 "created by the kernel for the signal handler.  Do not leave the handler "
509 "using B<longjmp>(3): it is undefined what would happen with contexts.  Use "
510 "B<siglongjmp>(3)  or B<setcontext>()  instead."
511 msgstr ""
512 "シグナルが発生すると、 現在のユーザコンテキストは保存され、 シグナルハンドラ"
513 "用のコンテキストがカーネルによって生成される。 今後はハンドラに B<longjmp>"
514 "(3)  を使わせないこと: この関数のコンテキスト下での動作は定義されていない。 "
515 "代わりに B<siglongjmp>(3)  か B<setcontext>()  を使うこと。"
516
517 #. type: SH
518 #: build/C/man2/getcontext.2:158 build/C/man3/makecontext.3:217
519 #: build/C/man3/pthread_attr_init.3:295
520 #: build/C/man3/pthread_attr_setaffinity_np.3:116
521 #: build/C/man3/pthread_attr_setdetachstate.3:109
522 #: build/C/man3/pthread_attr_setguardsize.3:156
523 #: build/C/man3/pthread_attr_setinheritsched.3:120
524 #: build/C/man3/pthread_attr_setschedparam.3:96
525 #: build/C/man3/pthread_attr_setschedpolicy.3:92
526 #: build/C/man3/pthread_attr_setscope.3:118
527 #: build/C/man3/pthread_attr_setstack.3:154
528 #: build/C/man3/pthread_attr_setstackaddr.3:108
529 #: build/C/man3/pthread_attr_setstacksize.3:109
530 #: build/C/man3/pthread_cancel.3:221 build/C/man3/pthread_cleanup_push.3:309
531 #: build/C/man3/pthread_cleanup_push_defer_np.3:102
532 #: build/C/man3/pthread_create.3:367 build/C/man3/pthread_detach.3:95
533 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:103
534 #: build/C/man3/pthread_getattr_np.3:343
535 #: build/C/man3/pthread_getcpuclockid.3:167 build/C/man3/pthread_join.3:125
536 #: build/C/man3/pthread_kill.3:73
537 #: build/C/man3/pthread_kill_other_threads_np.3:64
538 #: build/C/man3/pthread_self.3:74 build/C/man3/pthread_setaffinity_np.3:204
539 #: build/C/man3/pthread_setcancelstate.3:175
540 #: build/C/man3/pthread_setconcurrency.3:98
541 #: build/C/man3/pthread_setschedparam.3:429
542 #: build/C/man3/pthread_setschedprio.3:89 build/C/man3/pthread_sigmask.3:133
543 #: build/C/man3/pthread_sigqueue.3:93 build/C/man3/pthread_testcancel.3:61
544 #: build/C/man3/pthread_tryjoin_np.3:133 build/C/man3/pthread_yield.3:59
545 #: build/C/man7/pthreads.7:893
546 #, no-wrap
547 msgid "SEE ALSO"
548 msgstr "関連項目"
549
550 #. type: Plain text
551 #: build/C/man2/getcontext.2:164
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: TH
560 #: build/C/man3/makecontext.3:25
561 #, no-wrap
562 msgid "MAKECONTEXT"
563 msgstr "MAKECONTEXT"
564
565 #. type: TH
566 #: build/C/man3/makecontext.3:25
567 #, no-wrap
568 msgid "2009-03-31"
569 msgstr "2009-03-31"
570
571 #. type: TH
572 #: build/C/man3/makecontext.3:25
573 #, no-wrap
574 msgid "GNU"
575 msgstr "GNU"
576
577 #. type: Plain text
578 #: build/C/man3/makecontext.3:28
579 msgid "makecontext, swapcontext - manipulate user context"
580 msgstr "makecontext, swapcontext - ユーザコンテキストを操作する"
581
582 #. type: Plain text
583 #: build/C/man3/makecontext.3:33
584 msgid ""
585 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
586 ">I<argc>B<, ...);>"
587 msgstr ""
588 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
589 ">I<argc>B<, ...);>"
590
591 #. type: Plain text
592 #: build/C/man3/makecontext.3:35
593 msgid "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
594 msgstr "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
595
596 #. type: Plain text
597 #: build/C/man3/makecontext.3:46
598 msgid ""
599 "In a System V-like environment, one has the type I<ucontext_t> defined in "
600 "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(2), "
601 "B<setcontext>(2), B<makecontext>()  and B<swapcontext>()  that allow user-"
602 "level context switching between multiple threads of control within a process."
603 msgstr ""
604 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
605 "と、 B<getcontext>(2), B<setcontext>(2), B<makecontext>(), B<swapcontext>()  "
606 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
607 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
608 "ようになっている。"
609
610 #. type: Plain text
611 #: build/C/man3/makecontext.3:49
612 msgid "For the type and the first two functions, see B<getcontext>(2)."
613 msgstr ""
614 "これらの型と、最初の 2 つの関数については、 B<getcontext>(2)  を参照のこと。"
615
616 #. type: Plain text
617 #: build/C/man3/makecontext.3:61
618 msgid ""
619 "The B<makecontext>()  function modifies the context pointed to by I<ucp> "
620 "(which was obtained from a call to B<getcontext>(2)).  Before invoking "
621 "B<makecontext>(), the caller must allocate a new stack for this context and "
622 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
623 "and assign its address to I<ucp-E<gt>uc_link>."
624 msgstr ""
625 "B<makecontext>()  関数は、ポインタ I<ucp> が指すコンテキストを変更する "
626 "(I<ucp> は以前の B<getcontext>(2)  呼び出しで得られたものである)。 "
627 "B<makecontext>()  を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
628 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
629 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
630 "らない。"
631
632 #. type: Plain text
633 #: build/C/man3/makecontext.3:75
634 msgid ""
635 "When this context is later activated (using B<setcontext>(2)  or "
636 "B<swapcontext>())  the function I<func> is called, and passed the series of "
637 "integer (I<int>)  arguments that follow I<argc>; the caller must specify the "
638 "number of these arguments in I<argc>.  When this function returns, the "
639 "successor context is activated.  If the successor context pointer is NULL, "
640 "the thread exits."
641 msgstr ""
642 "このコンテキストが将来 (B<setcontext>(2)  または B<swapcontext>()  によっ"
643 "て)  有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 "
644 "(I<int>)  引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数"
645 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
646 "る。 後継コンテキストのポインタが NULL の場合、そのスレッドが終了する。"
647
648 #. type: Plain text
649 #: build/C/man3/makecontext.3:81
650 msgid ""
651 "The B<swapcontext>()  function saves the current context in the structure "
652 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
653 msgstr ""
654 "B<swapcontext>()  関数は現在のコンテキストを ポインタ I<oucp> が指す構造体に"
655 "保存し、 ポインタ I<ucp> が指すコンテキストを有効にする。"
656
657 #. type: Plain text
658 #: build/C/man3/makecontext.3:93
659 msgid ""
660 "When successful, B<swapcontext>()  does not return.  (But we may return "
661 "later, in case I<oucp> is activated, in which case it looks like "
662 "B<swapcontext>()  returns 0.)  On error, B<swapcontext>()  returns -1 and "
663 "sets I<errno> appropriately."
664 msgstr ""
665 "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった"
666 "場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見え"
667 "る。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じ"
668 "て設定する。"
669
670 #. type: TP
671 #: build/C/man3/makecontext.3:94
672 #: build/C/man3/pthread_attr_setaffinity_np.3:100
673 #: build/C/man3/pthread_getattr_np.3:75
674 #, no-wrap
675 msgid "B<ENOMEM>"
676 msgstr "B<ENOMEM>"
677
678 #. type: Plain text
679 #: build/C/man3/makecontext.3:97
680 msgid "Insufficient stack space left."
681 msgstr "スタックに割り当てる空間が残っていない。"
682
683 #. type: SH
684 #: build/C/man3/makecontext.3:97
685 #: build/C/man3/pthread_attr_setaffinity_np.3:104
686 #: build/C/man3/pthread_attr_setguardsize.3:102
687 #: build/C/man3/pthread_attr_setstack.3:108
688 #: build/C/man3/pthread_attr_setstackaddr.3:79
689 #: build/C/man3/pthread_attr_setstacksize.3:79
690 #: build/C/man3/pthread_getattr_np.3:94
691 #: build/C/man3/pthread_getcpuclockid.3:61
692 #: build/C/man3/pthread_setaffinity_np.3:117
693 #: build/C/man3/pthread_setconcurrency.3:79
694 #: build/C/man3/pthread_setschedprio.3:79 build/C/man3/pthread_sigqueue.3:87
695 #: build/C/man3/pthread_tryjoin_np.3:108
696 #, no-wrap
697 msgid "VERSIONS"
698 msgstr "バージョン"
699
700 #. type: Plain text
701 #: build/C/man3/makecontext.3:102
702 msgid ""
703 "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version "
704 "2.1."
705 msgstr ""
706 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
707 "されている。"
708
709 #. type: Plain text
710 #: build/C/man3/makecontext.3:110
711 msgid ""
712 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specifications of "
713 "B<makecontext>()  and B<swapcontext>(), citing portability issues, and "
714 "recommending that applications be rewritten to use POSIX threads instead."
715 msgstr ""
716 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  "
717 "と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを "
718 "POSIX スレッドを使って書き直すことが 推奨されている。"
719
720 #. type: Plain text
721 #: build/C/man3/makecontext.3:118
722 msgid ""
723 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
724 "namely, this struct contains the start and length of a memory area to be "
725 "used as the stack, regardless of the direction of growth of the stack.  "
726 "Thus, it is not necessary for the user program to worry about this direction."
727 msgstr ""
728 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわ"
729 "ちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含"
730 "まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
731 "て、ユーザプログラムはこの件については心配しなくてよい。"
732
733 #. type: Plain text
734 #: build/C/man3/makecontext.3:134
735 msgid ""
736 "On architectures where I<int> and pointer types are the same size (e.g., "
737 "x86-32, where both types are 32 bits), you may be able to get away with "
738 "passing pointers as arguments to B<makecontext>()  following I<argc>.  "
739 "However, doing this is not guaranteed to be portable, is undefined according "
740 "to the standards, and won't work on architectures where pointers are larger "
741 "than I<int>s.  Nevertheless, starting with version 2.8, glibc makes some "
742 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
743 "g., x86-64)."
744 msgstr ""
745 "I<int> とポインタ型が同じ大きさであるアーキテクチャでは (x86-32 はその例であ"
746 "り、両方の型とも 32 ビットである)、 B<makecontext>()  の I<argc> 以降の引き数"
747 "としてポインタを渡してもうまく動くかもしれない。 しかしながら、このようにする"
748 "と、移植性は保証されず、 標準に従えば動作は未定義であり、ポインタが I<int> よ"
749 "りも大きいアーキテクチャでは正しく動作しないことだろう。 それにも関わらず、"
750 "バージョン 2.8 以降の glibc では、 B<makecontext>()  に変更が行われ、(x86-64 "
751 "などの) いくつかの 64 ビットアーキテクチャで 引き数としてポインタを渡すことが"
752 "できるようになっている。"
753
754 #. type: SH
755 #: build/C/man3/makecontext.3:134 build/C/man3/pthread_attr_init.3:85
756 #: build/C/man3/pthread_attr_setdetachstate.3:106
757 #: build/C/man3/pthread_attr_setguardsize.3:153
758 #: build/C/man3/pthread_attr_setinheritsched.3:117
759 #: build/C/man3/pthread_attr_setschedparam.3:93
760 #: build/C/man3/pthread_attr_setschedpolicy.3:89
761 #: build/C/man3/pthread_attr_setstack.3:151
762 #: build/C/man3/pthread_attr_setstacksize.3:106
763 #: build/C/man3/pthread_cancel.3:130 build/C/man3/pthread_cleanup_push.3:149
764 #: build/C/man3/pthread_create.3:200 build/C/man3/pthread_detach.3:91
765 #: build/C/man3/pthread_getattr_np.3:99
766 #: build/C/man3/pthread_getcpuclockid.3:76 build/C/man3/pthread_join.3:122
767 #: build/C/man3/pthread_setaffinity_np.3:152
768 #: build/C/man3/pthread_setcancelstate.3:172
769 #: build/C/man3/pthread_setschedparam.3:147 build/C/man3/pthread_sigmask.3:59
770 #: build/C/man3/pthread_testcancel.3:58 build/C/man3/pthread_tryjoin_np.3:113
771 #, no-wrap
772 msgid "EXAMPLE"
773 msgstr "例"
774
775 #. type: Plain text
776 #: build/C/man3/makecontext.3:142
777 msgid ""
778 "The example program below demonstrates the use of B<getcontext>(2), "
779 "B<makecontext>(), and B<swapcontext>().  Running the program produces the "
780 "following output:"
781 msgstr ""
782 "以下のサンプル・プログラムは、 B<getcontext>(2), B<makecontext>(), "
783 "B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行する"
784 "と、以下のような出力が得られる:"
785
786 #. type: Plain text
787 #: build/C/man3/makecontext.3:154
788 #, no-wrap
789 msgid ""
790 "$B< ./a.out>\n"
791 "main: swapcontext(&uctx_main, &uctx_func2)\n"
792 "func2: started\n"
793 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
794 "func1: started\n"
795 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
796 "func2: returning\n"
797 "func1: returning\n"
798 "main: exiting\n"
799 msgstr ""
800 "$B< ./a.out>\n"
801 "main: swapcontext(&uctx_main, &uctx_func2)\n"
802 "func2: started\n"
803 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
804 "func1: started\n"
805 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
806 "func2: returning\n"
807 "func1: returning\n"
808 "main: exiting\n"
809
810 #. type: SS
811 #: build/C/man3/makecontext.3:156 build/C/man3/pthread_attr_init.3:146
812 #: build/C/man3/pthread_cancel.3:146 build/C/man3/pthread_cleanup_push.3:225
813 #: build/C/man3/pthread_create.3:239 build/C/man3/pthread_getattr_np.3:177
814 #: build/C/man3/pthread_getcpuclockid.3:93
815 #: build/C/man3/pthread_setschedparam.3:222 build/C/man3/pthread_sigmask.3:77
816 #, no-wrap
817 msgid "Program source"
818 msgstr "プログラムのソース"
819
820 #. type: Plain text
821 #: build/C/man3/makecontext.3:162
822 #, no-wrap
823 msgid ""
824 "#include E<lt>ucontext.hE<gt>\n"
825 "#include E<lt>stdio.hE<gt>\n"
826 "#include E<lt>stdlib.hE<gt>\n"
827 msgstr ""
828 "#include E<lt>ucontext.hE<gt>\n"
829 "#include E<lt>stdio.hE<gt>\n"
830 "#include E<lt>stdlib.hE<gt>\n"
831
832 #. type: Plain text
833 #: build/C/man3/makecontext.3:164
834 #, no-wrap
835 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
836 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
837
838 #. type: Plain text
839 #: build/C/man3/makecontext.3:167
840 #, no-wrap
841 msgid ""
842 "#define handle_error(msg) \\e\n"
843 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
844 msgstr ""
845 "#define handle_error(msg) \\e\n"
846 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
847
848 #. type: Plain text
849 #: build/C/man3/makecontext.3:177
850 #, no-wrap
851 msgid ""
852 "static void\n"
853 "func1(void)\n"
854 "{\n"
855 "    printf(\"func1: started\\en\");\n"
856 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
857 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
858 "        handle_error(\"swapcontext\");\n"
859 "    printf(\"func1: returning\\en\");\n"
860 "}\n"
861 msgstr ""
862 "static void\n"
863 "func1(void)\n"
864 "{\n"
865 "    printf(\"func1: started\\en\");\n"
866 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
867 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
868 "        handle_error(\"swapcontext\");\n"
869 "    printf(\"func1: returning\\en\");\n"
870 "}\n"
871
872 #. type: Plain text
873 #: build/C/man3/makecontext.3:187
874 #, no-wrap
875 msgid ""
876 "static void\n"
877 "func2(void)\n"
878 "{\n"
879 "    printf(\"func2: started\\en\");\n"
880 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
881 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
882 "        handle_error(\"swapcontext\");\n"
883 "    printf(\"func2: returning\\en\");\n"
884 "}\n"
885 msgstr ""
886 "static void\n"
887 "func2(void)\n"
888 "{\n"
889 "    printf(\"func2: started\\en\");\n"
890 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
891 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
892 "        handle_error(\"swapcontext\");\n"
893 "    printf(\"func2: returning\\en\");\n"
894 "}\n"
895
896 #. type: Plain text
897 #: build/C/man3/makecontext.3:193
898 #, no-wrap
899 msgid ""
900 "int\n"
901 "main(int argc, char *argv[])\n"
902 "{\n"
903 "    char func1_stack[16384];\n"
904 "    char func2_stack[16384];\n"
905 msgstr ""
906 "int\n"
907 "main(int argc, char *argv[])\n"
908 "{\n"
909 "    char func1_stack[16384];\n"
910 "    char func2_stack[16384];\n"
911
912 #. type: Plain text
913 #: build/C/man3/makecontext.3:200
914 #, no-wrap
915 msgid ""
916 "    if (getcontext(&uctx_func1) == -1)\n"
917 "        handle_error(\"getcontext\");\n"
918 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
919 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
920 "    uctx_func1.uc_link = &uctx_main;\n"
921 "    makecontext(&uctx_func1, func1, 0);\n"
922 msgstr ""
923 "    if (getcontext(&uctx_func1) == -1)\n"
924 "        handle_error(\"getcontext\");\n"
925 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
926 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
927 "    uctx_func1.uc_link = &uctx_main;\n"
928 "    makecontext(&uctx_func1, func1, 0);\n"
929
930 #. type: Plain text
931 #: build/C/man3/makecontext.3:208
932 #, no-wrap
933 msgid ""
934 "    if (getcontext(&uctx_func2) == -1)\n"
935 "        handle_error(\"getcontext\");\n"
936 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
937 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
938 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
939 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
940 "    makecontext(&uctx_func2, func2, 0);\n"
941 msgstr ""
942 "    if (getcontext(&uctx_func2) == -1)\n"
943 "        handle_error(\"getcontext\");\n"
944 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
945 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
946 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
947 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
948 "    makecontext(&uctx_func2, func2, 0);\n"
949
950 #. type: Plain text
951 #: build/C/man3/makecontext.3:212
952 #, no-wrap
953 msgid ""
954 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
955 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
956 "        handle_error(\"swapcontext\");\n"
957 msgstr ""
958 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
959 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
960 "        handle_error(\"swapcontext\");\n"
961
962 #. type: Plain text
963 #: build/C/man3/makecontext.3:216
964 #, no-wrap
965 msgid ""
966 "    printf(\"main: exiting\\en\");\n"
967 "    exit(EXIT_SUCCESS);\n"
968 "}\n"
969 msgstr ""
970 "    printf(\"main: exiting\\en\");\n"
971 "    exit(EXIT_SUCCESS);\n"
972 "}\n"
973
974 #. type: Plain text
975 #: build/C/man3/makecontext.3:222
976 msgid ""
977 "B<getcontext>(2), B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), "
978 "B<sigsetjmp>(3)"
979 msgstr ""
980 "B<getcontext>(2), B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), "
981 "B<sigsetjmp>(3)"
982
983 #. type: TH
984 #: build/C/man3/pthread_attr_init.3:24
985 #, no-wrap
986 msgid "PTHREAD_ATTR_INIT"
987 msgstr "PTHREAD_ATTR_INIT"
988
989 #. type: TH
990 #: build/C/man3/pthread_attr_init.3:24
991 #, no-wrap
992 msgid "2008-11-11"
993 msgstr "2008-11-11"
994
995 #. type: Plain text
996 #: build/C/man3/pthread_attr_init.3:28
997 msgid ""
998 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
999 "attributes object"
1000 msgstr ""
1001
1002 #. type: Plain text
1003 #: build/C/man3/pthread_attr_init.3:31
1004 #: build/C/man3/pthread_attr_setdetachstate.3:31
1005 #: build/C/man3/pthread_attr_setguardsize.3:31
1006 #: build/C/man3/pthread_attr_setinheritsched.3:31
1007 #: build/C/man3/pthread_attr_setschedparam.3:31
1008 #: build/C/man3/pthread_attr_setschedpolicy.3:31
1009 #: build/C/man3/pthread_attr_setscope.3:31
1010 #: build/C/man3/pthread_attr_setstack.3:31
1011 #: build/C/man3/pthread_attr_setstackaddr.3:31
1012 #: build/C/man3/pthread_attr_setstacksize.3:31
1013 #: build/C/man3/pthread_cancel.3:30 build/C/man3/pthread_cleanup_push.3:31
1014 #: build/C/man3/pthread_cleanup_push_defer_np.3:31
1015 #: build/C/man3/pthread_create.3:30 build/C/man3/pthread_detach.3:30
1016 #: build/C/man3/pthread_equal.3:30 build/C/man3/pthread_exit.3:30
1017 #: build/C/man3/pthread_join.3:30
1018 #: build/C/man3/pthread_kill_other_threads_np.3:30
1019 #: build/C/man3/pthread_self.3:30 build/C/man3/pthread_setcancelstate.3:31
1020 #: build/C/man3/pthread_setconcurrency.3:30
1021 #: build/C/man3/pthread_setschedparam.3:31
1022 #: build/C/man3/pthread_setschedprio.3:30 build/C/man3/pthread_sigqueue.3:29
1023 #: build/C/man3/pthread_testcancel.3:30 build/C/man3/pthread_yield.3:29
1024 #, no-wrap
1025 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1026 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1027
1028 #. type: Plain text
1029 #: build/C/man3/pthread_attr_init.3:34
1030 #, no-wrap
1031 msgid ""
1032 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1033 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1034 msgstr ""
1035 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1036 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1037
1038 #. type: Plain text
1039 #: build/C/man3/pthread_attr_init.3:36
1040 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1041 #: build/C/man3/pthread_attr_setdetachstate.3:38
1042 #: build/C/man3/pthread_attr_setguardsize.3:38
1043 #: build/C/man3/pthread_attr_setinheritsched.3:38
1044 #: build/C/man3/pthread_attr_setschedparam.3:38
1045 #: build/C/man3/pthread_attr_setschedpolicy.3:38
1046 #: build/C/man3/pthread_attr_setscope.3:38
1047 #: build/C/man3/pthread_attr_setstack.3:38
1048 #: build/C/man3/pthread_attr_setstackaddr.3:38
1049 #: build/C/man3/pthread_attr_setstacksize.3:38
1050 #: build/C/man3/pthread_cancel.3:34 build/C/man3/pthread_cleanup_push.3:37
1051 #: build/C/man3/pthread_equal.3:34 build/C/man3/pthread_exit.3:34
1052 #: build/C/man3/pthread_getattr_np.3:35
1053 #: build/C/man3/pthread_getcpuclockid.3:35 build/C/man3/pthread_self.3:34
1054 #: build/C/man3/pthread_setaffinity_np.3:39
1055 #: build/C/man3/pthread_setcancelstate.3:36
1056 #: build/C/man3/pthread_setconcurrency.3:35
1057 #: build/C/man3/pthread_setschedparam.3:38
1058 #: build/C/man3/pthread_setschedprio.3:34 build/C/man3/pthread_testcancel.3:34
1059 #, no-wrap
1060 msgid "Compile and link with I<-pthread>.\n"
1061 msgstr ""
1062
1063 #. type: Plain text
1064 #: build/C/man3/pthread_attr_init.3:48
1065 msgid ""
1066 "The B<pthread_attr_init>()  function initializes the thread attributes "
1067 "object pointed to by I<attr> with default attribute values.  After this "
1068 "call, individual attributes of the object can be set using various related "
1069 "functions (listed under SEE ALSO), and then the object can be used in one or "
1070 "more B<pthread_create>(3)  calls that create threads."
1071 msgstr ""
1072
1073 #. type: Plain text
1074 #: build/C/man3/pthread_attr_init.3:53
1075 msgid ""
1076 "Calling B<pthread_attr_init>()  on a thread attributes object that has "
1077 "already been initialized results in undefined behavior."
1078 msgstr ""
1079
1080 #. type: Plain text
1081 #: build/C/man3/pthread_attr_init.3:60
1082 msgid ""
1083 "When a thread attributes object is no longer required, it should be "
1084 "destroyed using the B<pthread_attr_destroy>()  function.  Destroying a "
1085 "thread attributes object has no effect on threads that were created using "
1086 "that object."
1087 msgstr ""
1088
1089 #. type: Plain text
1090 #: build/C/man3/pthread_attr_init.3:66
1091 msgid ""
1092 "Once a thread attributes object has been destroyed, it can be reinitialized "
1093 "using B<pthread_attr_init>().  Any other use of a destroyed thread "
1094 "attributes object has undefined results."
1095 msgstr ""
1096
1097 #. type: Plain text
1098 #: build/C/man3/pthread_attr_init.3:69
1099 #: build/C/man3/pthread_attr_setaffinity_np.3:77
1100 #: build/C/man3/pthread_attr_setdetachstate.3:78
1101 #: build/C/man3/pthread_attr_setguardsize.3:91
1102 #: build/C/man3/pthread_attr_setinheritsched.3:85
1103 #: build/C/man3/pthread_attr_setschedparam.3:75
1104 #: build/C/man3/pthread_attr_setschedpolicy.3:73
1105 #: build/C/man3/pthread_attr_setscope.3:92
1106 #: build/C/man3/pthread_attr_setstack.3:86
1107 #: build/C/man3/pthread_attr_setstackaddr.3:75
1108 #: build/C/man3/pthread_attr_setstacksize.3:62
1109 #: build/C/man3/pthread_setaffinity_np.3:78
1110 #: build/C/man3/pthread_setcancelstate.3:93
1111 msgid ""
1112 "On success, these functions return 0; on error, they return a nonzero error "
1113 "number."
1114 msgstr ""
1115
1116 #. type: Plain text
1117 #: build/C/man3/pthread_attr_init.3:77
1118 msgid ""
1119 "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on "
1120 "Linux these functions always succeed (but portable and future-proof "
1121 "applications should nevertheless handle a possible error return)."
1122 msgstr ""
1123
1124 #. type: Plain text
1125 #: build/C/man3/pthread_attr_init.3:79
1126 #: build/C/man3/pthread_attr_setdetachstate.3:87
1127 #: build/C/man3/pthread_attr_setguardsize.3:106
1128 #: build/C/man3/pthread_attr_setinheritsched.3:101
1129 #: build/C/man3/pthread_attr_setschedparam.3:89
1130 #: build/C/man3/pthread_attr_setschedpolicy.3:89
1131 #: build/C/man3/pthread_attr_setscope.3:107
1132 #: build/C/man3/pthread_attr_setstack.3:112
1133 #: build/C/man3/pthread_attr_setstacksize.3:83
1134 #: build/C/man3/pthread_cancel.3:122 build/C/man3/pthread_cleanup_push.3:125
1135 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
1136 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
1137 #: build/C/man3/pthread_getcpuclockid.3:65 build/C/man3/pthread_join.3:98
1138 #: build/C/man3/pthread_kill.3:66 build/C/man3/pthread_self.3:50
1139 #: build/C/man3/pthread_setcancelstate.3:113
1140 #: build/C/man3/pthread_setconcurrency.3:83
1141 #: build/C/man3/pthread_setschedparam.3:141
1142 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:57
1143 #: build/C/man3/pthread_testcancel.3:58
1144 msgid "POSIX.1-2001."
1145 msgstr ""
1146
1147 #. type: Plain text
1148 #: build/C/man3/pthread_attr_init.3:85
1149 msgid ""
1150 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1151 "object other than via pthreads functions is nonportable and produces "
1152 "undefined results."
1153 msgstr ""
1154
1155 #. type: Plain text
1156 #: build/C/man3/pthread_attr_init.3:94
1157 msgid ""
1158 "The program below optionally makes use of B<pthread_attr_init>()  and "
1159 "various related functions to initialize a thread attributes object that is "
1160 "used to create a single thread.  Once created, the thread uses the "
1161 "B<pthread_getattr_np>(3)  function (a nonstandard GNU extension) to retrieve "
1162 "the thread's attributes, and then displays those attributes."
1163 msgstr ""
1164
1165 #. type: Plain text
1166 #: build/C/man3/pthread_attr_init.3:103
1167 msgid ""
1168 "If the program is run with no command-line argument, then it passes NULL as "
1169 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1170 "with default attributes.  Running the program on Linux/x86-32 with the NPTL "
1171 "threading implementation, we see the following:"
1172 msgstr ""
1173
1174 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1175 #. type: Plain text
1176 #: build/C/man3/pthread_attr_init.3:119
1177 #, no-wrap
1178 msgid ""
1179 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1180 "unlimited\n"
1181 "$B< ./a.out>\n"
1182 "Thread attributes:\n"
1183 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1184 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1185 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1186 "        Scheduling policy   = SCHED_OTHER\n"
1187 "        Scheduling priority = 0\n"
1188 "        Guard size          = 4096 bytes\n"
1189 "        Stack address       = 0x40196000\n"
1190 "        Stack size          = 0x201000 bytes\n"
1191 msgstr ""
1192 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1193 "unlimited\n"
1194 "$B< ./a.out>\n"
1195 "Thread attributes:\n"
1196 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1197 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1198 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1199 "        Scheduling policy   = SCHED_OTHER\n"
1200 "        Scheduling priority = 0\n"
1201 "        Guard size          = 4096 bytes\n"
1202 "        Stack address       = 0x40196000\n"
1203 "        Stack size          = 0x201000 bytes\n"
1204
1205 #. type: Plain text
1206 #: build/C/man3/pthread_attr_init.3:129
1207 msgid ""
1208 "When we supply a stack size as a command-line argument, the program "
1209 "initializes a thread attributes object, sets various attributes in that "
1210 "object, and passes a pointer to the object in the call to B<pthread_create>"
1211 "(3).  Running the program on Linux/x86-32 with the NPTL threading "
1212 "implementation, we see the following:"
1213 msgstr ""
1214
1215 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1216 #. type: Plain text
1217 #: build/C/man3/pthread_attr_init.3:144
1218 #, no-wrap
1219 msgid ""
1220 "$B< ./a.out 0x3000000>\n"
1221 "posix_memalign() allocated at 0x40197000\n"
1222 "Thread attributes:\n"
1223 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1224 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1225 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1226 "        Scheduling policy   = SCHED_OTHER\n"
1227 "        Scheduling priority = 0\n"
1228 "        Guard size          = 0 bytes\n"
1229 "        Stack address       = 0x40197000\n"
1230 "        Stack size          = 0x3000000 bytes\n"
1231 msgstr ""
1232 "$B< ./a.out 0x3000000>\n"
1233 "posix_memalign() allocated at 0x40197000\n"
1234 "Thread attributes:\n"
1235 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1236 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1237 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1238 "        Scheduling policy   = SCHED_OTHER\n"
1239 "        Scheduling priority = 0\n"
1240 "        Guard size          = 0 bytes\n"
1241 "        Stack address       = 0x40197000\n"
1242 "        Stack size          = 0x3000000 bytes\n"
1243
1244 #. type: Plain text
1245 #: build/C/man3/pthread_attr_init.3:155 build/C/man3/pthread_getattr_np.3:186
1246 #, no-wrap
1247 msgid ""
1248 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1249 "#include E<lt>pthread.hE<gt>\n"
1250 "#include E<lt>stdio.hE<gt>\n"
1251 "#include E<lt>stdlib.hE<gt>\n"
1252 "#include E<lt>unistd.hE<gt>\n"
1253 "#include E<lt>errno.hE<gt>\n"
1254 msgstr ""
1255 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1256 "#include E<lt>pthread.hE<gt>\n"
1257 "#include E<lt>stdio.hE<gt>\n"
1258 "#include E<lt>stdlib.hE<gt>\n"
1259 "#include E<lt>unistd.hE<gt>\n"
1260 "#include E<lt>errno.hE<gt>\n"
1261
1262 #. type: Plain text
1263 #: build/C/man3/pthread_attr_init.3:158 build/C/man3/pthread_cancel.3:157
1264 #: build/C/man3/pthread_cleanup_push.3:237 build/C/man3/pthread_create.3:252
1265 #: build/C/man3/pthread_getattr_np.3:189
1266 #: build/C/man3/pthread_getcpuclockid.3:111
1267 #: build/C/man3/pthread_setaffinity_np.3:170
1268 #: build/C/man3/pthread_setschedparam.3:235 build/C/man3/pthread_sigmask.3:91
1269 #, no-wrap
1270 msgid ""
1271 "#define handle_error_en(en, msg) \\e\n"
1272 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1273 msgstr ""
1274 "#define handle_error_en(en, msg) \\e\n"
1275 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1276
1277 #. type: Plain text
1278 #: build/C/man3/pthread_attr_init.3:166
1279 #, no-wrap
1280 msgid ""
1281 "static void\n"
1282 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1283 "{\n"
1284 "    int s, i;\n"
1285 "    size_t v;\n"
1286 "    void *stkaddr;\n"
1287 "    struct sched_param sp;\n"
1288 msgstr ""
1289 "static void\n"
1290 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1291 "{\n"
1292 "    int s, i;\n"
1293 "    size_t v;\n"
1294 "    void *stkaddr;\n"
1295 "    struct sched_param sp;\n"
1296
1297 #. type: Plain text
1298 #: build/C/man3/pthread_attr_init.3:174
1299 #, no-wrap
1300 msgid ""
1301 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1302 "    if (s != 0)\n"
1303 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1304 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1305 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1306 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1307 "            \"???\");\n"
1308 msgstr ""
1309 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1310 "    if (s != 0)\n"
1311 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1312 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1313 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1314 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1315 "            \"???\");\n"
1316
1317 #. type: Plain text
1318 #: build/C/man3/pthread_attr_init.3:182
1319 #, no-wrap
1320 msgid ""
1321 "    s = pthread_attr_getscope(attr, &i);\n"
1322 "    if (s != 0)\n"
1323 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1324 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1325 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1326 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1327 "            \"???\");\n"
1328 msgstr ""
1329 "    s = pthread_attr_getscope(attr, &i);\n"
1330 "    if (s != 0)\n"
1331 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1332 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1333 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1334 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1335 "            \"???\");\n"
1336
1337 #. type: Plain text
1338 #: build/C/man3/pthread_attr_init.3:190
1339 #, no-wrap
1340 msgid ""
1341 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1342 "    if (s != 0)\n"
1343 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1344 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1345 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1346 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1347 "            \"???\");\n"
1348 msgstr ""
1349 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1350 "    if (s != 0)\n"
1351 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1352 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1353 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1354 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1355 "            \"???\");\n"
1356
1357 #. type: Plain text
1358 #: build/C/man3/pthread_attr_init.3:199
1359 #, no-wrap
1360 msgid ""
1361 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1362 "    if (s != 0)\n"
1363 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1364 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1365 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1366 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1367 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1368 "            \"???\");\n"
1369 msgstr ""
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
1379 #. type: Plain text
1380 #: build/C/man3/pthread_attr_init.3:204
1381 #, no-wrap
1382 msgid ""
1383 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1384 "    if (s != 0)\n"
1385 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1386 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1387 msgstr ""
1388 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1389 "    if (s != 0)\n"
1390 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1391 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1392
1393 #. type: Plain text
1394 #: build/C/man3/pthread_attr_init.3:209
1395 #, no-wrap
1396 msgid ""
1397 "    s = pthread_attr_getguardsize(attr, &v);\n"
1398 "    if (s != 0)\n"
1399 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1400 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1401 msgstr ""
1402 "    s = pthread_attr_getguardsize(attr, &v);\n"
1403 "    if (s != 0)\n"
1404 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1405 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1406
1407 #. type: Plain text
1408 #: build/C/man3/pthread_attr_init.3:216
1409 #, no-wrap
1410 msgid ""
1411 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1412 "    if (s != 0)\n"
1413 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1414 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1415 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1416 "}\n"
1417 msgstr ""
1418 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1419 "    if (s != 0)\n"
1420 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1421 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1422 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1423 "}\n"
1424
1425 #. type: Plain text
1426 #: build/C/man3/pthread_attr_init.3:222
1427 #, no-wrap
1428 msgid ""
1429 "static void *\n"
1430 "thread_start(void *arg)\n"
1431 "{\n"
1432 "    int s;\n"
1433 "    pthread_attr_t gattr;\n"
1434 msgstr ""
1435 "static void *\n"
1436 "thread_start(void *arg)\n"
1437 "{\n"
1438 "    int s;\n"
1439 "    pthread_attr_t gattr;\n"
1440
1441 #. type: Plain text
1442 #: build/C/man3/pthread_attr_init.3:226
1443 #, no-wrap
1444 msgid ""
1445 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1446 "       retrieves the attributes of the thread specified in its\n"
1447 "       first argument */\n"
1448 msgstr ""
1449 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1450 "       retrieves the attributes of the thread specified in its\n"
1451 "       first argument */\n"
1452
1453 #. type: Plain text
1454 #: build/C/man3/pthread_attr_init.3:230
1455 #, no-wrap
1456 msgid ""
1457 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1458 "    if (s != 0)\n"
1459 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1460 msgstr ""
1461 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1462 "    if (s != 0)\n"
1463 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1464
1465 #. type: Plain text
1466 #: build/C/man3/pthread_attr_init.3:233
1467 #, no-wrap
1468 msgid ""
1469 "    printf(\"Thread attributes:\\en\");\n"
1470 "    display_pthread_attr(&gattr, \"\\et\");\n"
1471 msgstr ""
1472 "    printf(\"Thread attributes:\\en\");\n"
1473 "    display_pthread_attr(&gattr, \"\\et\");\n"
1474
1475 #. type: Plain text
1476 #: build/C/man3/pthread_attr_init.3:236 build/C/man3/pthread_getattr_np.3:238
1477 #, no-wrap
1478 msgid ""
1479 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1480 "}\n"
1481 msgstr ""
1482 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1483 "}\n"
1484
1485 #. type: Plain text
1486 #: build/C/man3/pthread_attr_init.3:244
1487 #, no-wrap
1488 msgid ""
1489 "int\n"
1490 "main(int argc, char *argv[])\n"
1491 "{\n"
1492 "    pthread_t thr;\n"
1493 "    pthread_attr_t attr;\n"
1494 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1495 "    int s;\n"
1496 msgstr ""
1497 "int\n"
1498 "main(int argc, char *argv[])\n"
1499 "{\n"
1500 "    pthread_t thr;\n"
1501 "    pthread_attr_t attr;\n"
1502 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1503 "    int s;\n"
1504
1505 #. type: Plain text
1506 #: build/C/man3/pthread_attr_init.3:246
1507 #: build/C/man3/pthread_setschedparam.3:353
1508 #, no-wrap
1509 msgid "    attrp = NULL;\n"
1510 msgstr "    attrp = NULL;\n"
1511
1512 #. type: Plain text
1513 #: build/C/man3/pthread_attr_init.3:250
1514 #, no-wrap
1515 msgid ""
1516 "    /* If a command-line argument was supplied, use it to set the\n"
1517 "       stack-size attribute and set a few other thread attributes,\n"
1518 "       and set attrp pointing to thread attributes object */\n"
1519 msgstr ""
1520 "    /* If a command-line argument was supplied, use it to set the\n"
1521 "       stack-size attribute and set a few other thread attributes,\n"
1522 "       and set attrp pointing to thread attributes object */\n"
1523
1524 #. type: Plain text
1525 #: build/C/man3/pthread_attr_init.3:254
1526 #, no-wrap
1527 msgid ""
1528 "    if (argc E<gt> 1) {\n"
1529 "        int stack_size;\n"
1530 "        void *sp;\n"
1531 msgstr ""
1532 "    if (argc E<gt> 1) {\n"
1533 "        int stack_size;\n"
1534 "        void *sp;\n"
1535
1536 #. type: Plain text
1537 #: build/C/man3/pthread_attr_init.3:256
1538 #, no-wrap
1539 msgid "        attrp = &attr;\n"
1540 msgstr "        attrp = &attr;\n"
1541
1542 #. type: Plain text
1543 #: build/C/man3/pthread_attr_init.3:260
1544 #, no-wrap
1545 msgid ""
1546 "        s = pthread_attr_init(&attr);\n"
1547 "        if (s != 0)\n"
1548 "            handle_error_en(s, \"pthread_attr_init\");\n"
1549 msgstr ""
1550 "        s = pthread_attr_init(&attr);\n"
1551 "        if (s != 0)\n"
1552 "            handle_error_en(s, \"pthread_attr_init\");\n"
1553
1554 #. type: Plain text
1555 #: build/C/man3/pthread_attr_init.3:264
1556 #, no-wrap
1557 msgid ""
1558 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1559 "        if (s != 0)\n"
1560 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1561 msgstr ""
1562 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1563 "        if (s != 0)\n"
1564 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1565
1566 #. type: Plain text
1567 #: build/C/man3/pthread_attr_init.3:268
1568 #, no-wrap
1569 msgid ""
1570 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1571 "        if (s != 0)\n"
1572 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1573 msgstr ""
1574 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1575 "        if (s != 0)\n"
1576 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1577
1578 #. type: Plain text
1579 #: build/C/man3/pthread_attr_init.3:270
1580 #, no-wrap
1581 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1582 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
1583
1584 #. type: Plain text
1585 #: build/C/man3/pthread_attr_init.3:274
1586 #, no-wrap
1587 msgid ""
1588 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1589 "        if (s != 0)\n"
1590 "            handle_error_en(s, \"posix_memalign\");\n"
1591 msgstr ""
1592 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1593 "        if (s != 0)\n"
1594 "            handle_error_en(s, \"posix_memalign\");\n"
1595
1596 #. type: Plain text
1597 #: build/C/man3/pthread_attr_init.3:276
1598 #, no-wrap
1599 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1600 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1601
1602 #. type: Plain text
1603 #: build/C/man3/pthread_attr_init.3:281
1604 #, no-wrap
1605 msgid ""
1606 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1607 "        if (s != 0)\n"
1608 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1609 "    }\n"
1610 msgstr ""
1611 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1612 "        if (s != 0)\n"
1613 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1614 "    }\n"
1615
1616 #. type: Plain text
1617 #: build/C/man3/pthread_attr_init.3:285 build/C/man3/pthread_getattr_np.3:333
1618 #, no-wrap
1619 msgid ""
1620 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1621 "    if (s != 0)\n"
1622 "        handle_error_en(s, \"pthread_create\");\n"
1623 msgstr ""
1624 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1625 "    if (s != 0)\n"
1626 "        handle_error_en(s, \"pthread_create\");\n"
1627
1628 #. type: Plain text
1629 #: build/C/man3/pthread_attr_init.3:291 build/C/man3/pthread_getattr_np.3:339
1630 #, no-wrap
1631 msgid ""
1632 "    if (attrp != NULL) {\n"
1633 "        s = pthread_attr_destroy(attrp);\n"
1634 "        if (s != 0)\n"
1635 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1636 "    }\n"
1637 msgstr ""
1638 "    if (attrp != NULL) {\n"
1639 "        s = pthread_attr_destroy(attrp);\n"
1640 "        if (s != 0)\n"
1641 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1642 "    }\n"
1643
1644 #. type: Plain text
1645 #: build/C/man3/pthread_attr_init.3:294 build/C/man3/pthread_getattr_np.3:342
1646 #, no-wrap
1647 msgid ""
1648 "    pause();    /* Terminates when other thread calls exit() */\n"
1649 "}\n"
1650 msgstr ""
1651 "    pause();    /* Terminates when other thread calls exit() */\n"
1652 "}\n"
1653
1654 #. type: Plain text
1655 #: build/C/man3/pthread_attr_init.3:308
1656 msgid ""
1657 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1658 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1659 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1660 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1661 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1662 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1663 msgstr ""
1664 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1665 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1666 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1667 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1668 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1669 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1670
1671 #. type: TH
1672 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1673 #, no-wrap
1674 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1675 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1676
1677 #. type: TH
1678 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1679 #: build/C/man3/pthread_getattr_np.3:24
1680 #: build/C/man3/pthread_setaffinity_np.3:24
1681 #: build/C/man3/pthread_tryjoin_np.3:24
1682 #, no-wrap
1683 msgid "2010-09-10"
1684 msgstr "2010-09-10"
1685
1686 #. type: Plain text
1687 #: build/C/man3/pthread_attr_setaffinity_np.3:28
1688 msgid ""
1689 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1690 "affinity attribute in thread attributes object"
1691 msgstr ""
1692
1693 #. type: Plain text
1694 #: build/C/man3/pthread_attr_setaffinity_np.3:32
1695 #: build/C/man3/pthread_getattr_np.3:31
1696 #: build/C/man3/pthread_setaffinity_np.3:32
1697 #: build/C/man3/pthread_tryjoin_np.3:32
1698 #, no-wrap
1699 msgid ""
1700 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1701 "B<#include E<lt>pthread.hE<gt>>\n"
1702 msgstr ""
1703 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1704 "B<#include E<lt>pthread.hE<gt>>\n"
1705
1706 #. type: Plain text
1707 #: build/C/man3/pthread_attr_setaffinity_np.3:37
1708 #, no-wrap
1709 msgid ""
1710 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1711 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1712 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1713 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1714 msgstr ""
1715 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1716 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1717 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1718 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1719
1720 #. type: Plain text
1721 #: build/C/man3/pthread_attr_setaffinity_np.3:52
1722 msgid ""
1723 "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask "
1724 "attribute of the thread attributes object referred to by I<attr> to the "
1725 "value specified in I<cpuset>.  This attribute determines the CPU affinity "
1726 "mask of a thread created using the thread attributes object I<attr>."
1727 msgstr ""
1728
1729 #. type: Plain text
1730 #: build/C/man3/pthread_attr_setaffinity_np.3:61
1731 msgid ""
1732 "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask "
1733 "attribute of the thread attributes object referred to by I<attr> in the "
1734 "buffer pointed to by I<cpuset>."
1735 msgstr ""
1736
1737 #. type: Plain text
1738 #: build/C/man3/pthread_attr_setaffinity_np.3:68
1739 msgid ""
1740 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1741 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
1742 "(cpu_set_t)>."
1743 msgstr ""
1744
1745 #. type: Plain text
1746 #: build/C/man3/pthread_attr_setaffinity_np.3:74
1747 #: build/C/man3/pthread_setaffinity_np.3:65
1748 msgid ""
1749 "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a "
1750 "description of a set of macros that can be used to manipulate and inspect "
1751 "CPU sets, see B<CPU_SET>(3)."
1752 msgstr ""
1753
1754 #. type: TP
1755 #: build/C/man3/pthread_attr_setaffinity_np.3:78
1756 #: build/C/man3/pthread_attr_setaffinity_np.3:90
1757 #: build/C/man3/pthread_attr_setdetachstate.3:81
1758 #: build/C/man3/pthread_attr_setinheritsched.3:88
1759 #: build/C/man3/pthread_attr_setschedpolicy.3:76
1760 #: build/C/man3/pthread_attr_setscope.3:95
1761 #: build/C/man3/pthread_attr_setstack.3:89
1762 #: build/C/man3/pthread_attr_setstacksize.3:65
1763 #: build/C/man3/pthread_create.3:135 build/C/man3/pthread_detach.3:53
1764 #: build/C/man3/pthread_join.3:83 build/C/man3/pthread_join.3:87
1765 #: build/C/man3/pthread_kill.3:56 build/C/man3/pthread_setaffinity_np.3:82
1766 #: build/C/man3/pthread_setaffinity_np.3:91
1767 #: build/C/man3/pthread_setaffinity_np.3:107
1768 #: build/C/man3/pthread_setcancelstate.3:97
1769 #: build/C/man3/pthread_setcancelstate.3:105
1770 #: build/C/man3/pthread_setconcurrency.3:69
1771 #: build/C/man3/pthread_setschedparam.3:120
1772 #: build/C/man3/pthread_setschedprio.3:60 build/C/man3/pthread_sigqueue.3:75
1773 #, no-wrap
1774 msgid "B<EINVAL>"
1775 msgstr "B<EINVAL>"
1776
1777 #.  cpumask_t
1778 #.  The raw sched_getaffinity() system call returns the size (in bytes)
1779 #.  of the cpumask_t type.
1780 #. type: Plain text
1781 #: build/C/man3/pthread_attr_setaffinity_np.3:90
1782 msgid ""
1783 "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was "
1784 "outside the set supported by the kernel.  (The kernel configuration option "
1785 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
1786 "type used to represent CPU sets.)"
1787 msgstr ""
1788
1789 #. type: Plain text
1790 #: build/C/man3/pthread_attr_setaffinity_np.3:100
1791 msgid ""
1792 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
1793 "attributes object referred to by I<attr> lies outside the range specified by "
1794 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
1795 msgstr ""
1796
1797 #. type: Plain text
1798 #: build/C/man3/pthread_attr_setaffinity_np.3:104
1799 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
1800 msgstr ""
1801
1802 #. type: Plain text
1803 #: build/C/man3/pthread_attr_setaffinity_np.3:106
1804 #: build/C/man3/pthread_setaffinity_np.3:119
1805 msgid "These functions are provided by glibc since version 2.3.4."
1806 msgstr ""
1807
1808 #. type: Plain text
1809 #: build/C/man3/pthread_attr_setaffinity_np.3:109
1810 #: build/C/man3/pthread_cleanup_push_defer_np.3:102
1811 #: build/C/man3/pthread_setaffinity_np.3:122
1812 #: build/C/man3/pthread_tryjoin_np.3:113
1813 msgid ""
1814 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
1815 "\" (nonportable) in the names."
1816 msgstr ""
1817
1818 #. type: Plain text
1819 #: build/C/man3/pthread_attr_setaffinity_np.3:116
1820 #: build/C/man3/pthread_setaffinity_np.3:148
1821 msgid ""
1822 "In glibc 2.3.3 only, versions of these functions were provided that did not "
1823 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
1824 "underlying system calls was always I<sizeof(cpu_set_t)>."
1825 msgstr ""
1826
1827 #. type: Plain text
1828 #: build/C/man3/pthread_attr_setaffinity_np.3:121
1829 msgid ""
1830 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1831 "(3), B<cpuset>(7), B<pthreads>(7)"
1832 msgstr ""
1833 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1834 "(3), B<cpuset>(7), B<pthreads>(7)"
1835
1836 #. type: TH
1837 #: build/C/man3/pthread_attr_setdetachstate.3:24
1838 #, no-wrap
1839 msgid "PTHREAD_ATTR_SETDETACHSTATE"
1840 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
1841
1842 #. type: TH
1843 #: build/C/man3/pthread_attr_setdetachstate.3:24
1844 #: build/C/man3/pthread_attr_setschedpolicy.3:24
1845 #, no-wrap
1846 msgid "2010-02-03"
1847 msgstr "2010-02-03"
1848
1849 #. type: Plain text
1850 #: build/C/man3/pthread_attr_setdetachstate.3:28
1851 msgid ""
1852 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
1853 "state attribute in thread attributes object"
1854 msgstr ""
1855
1856 #. type: Plain text
1857 #: build/C/man3/pthread_attr_setdetachstate.3:36
1858 #, no-wrap
1859 msgid ""
1860 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
1861 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
1862 msgstr ""
1863 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
1864 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
1865
1866 #. type: Plain text
1867 #: build/C/man3/pthread_attr_setdetachstate.3:51
1868 msgid ""
1869 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
1870 "attribute of the thread attributes object referred to by I<attr> to the "
1871 "value specified in I<detachstate>.  The detach state attribute determines "
1872 "whether a thread created using the thread attributes object I<attr> will be "
1873 "created in a joinable or a detached state."
1874 msgstr ""
1875
1876 #. type: Plain text
1877 #: build/C/man3/pthread_attr_setdetachstate.3:54
1878 msgid "The following values may be specified in I<detachstate>:"
1879 msgstr ""
1880
1881 #. type: TP
1882 #: build/C/man3/pthread_attr_setdetachstate.3:54
1883 #, no-wrap
1884 msgid "B<PTHREAD_CREATE_DETACHED>"
1885 msgstr "B<PTHREAD_CREATE_DETACHED>"
1886
1887 #. type: Plain text
1888 #: build/C/man3/pthread_attr_setdetachstate.3:59
1889 msgid ""
1890 "Threads that are created using I<attr> will be created in a detached state."
1891 msgstr ""
1892
1893 #. type: TP
1894 #: build/C/man3/pthread_attr_setdetachstate.3:59
1895 #, no-wrap
1896 msgid "B<PTHREAD_CREATE_JOINABLE>"
1897 msgstr "B<PTHREAD_CREATE_JOINABLE>"
1898
1899 #. type: Plain text
1900 #: build/C/man3/pthread_attr_setdetachstate.3:64
1901 msgid ""
1902 "Threads that are created using I<attr> will be created in a joinable state."
1903 msgstr ""
1904
1905 #. type: Plain text
1906 #: build/C/man3/pthread_attr_setdetachstate.3:68
1907 msgid ""
1908 "The default setting of the detach state attribute in a newly initialized "
1909 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
1910 msgstr ""
1911
1912 #. type: Plain text
1913 #: build/C/man3/pthread_attr_setdetachstate.3:75
1914 msgid ""
1915 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
1916 "the thread attributes object I<attr> in the buffer pointed to by "
1917 "I<detachstate>."
1918 msgstr ""
1919
1920 #. type: Plain text
1921 #: build/C/man3/pthread_attr_setdetachstate.3:81
1922 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
1923 msgstr ""
1924
1925 #. type: Plain text
1926 #: build/C/man3/pthread_attr_setdetachstate.3:85
1927 msgid "An invalid value was specified in I<detachstate>."
1928 msgstr ""
1929
1930 #. type: Plain text
1931 #: build/C/man3/pthread_attr_setdetachstate.3:91
1932 msgid ""
1933 "See B<pthread_create>(3)  for more details on detached and joinable threads."
1934 msgstr ""
1935
1936 #. type: Plain text
1937 #: build/C/man3/pthread_attr_setdetachstate.3:99
1938 msgid ""
1939 "A thread that is created in a joinable state should eventually either be "
1940 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
1941 "B<pthread_create>(3)."
1942 msgstr ""
1943
1944 #. type: Plain text
1945 #: build/C/man3/pthread_attr_setdetachstate.3:106
1946 msgid ""
1947 "It is an error to specify the thread ID of a thread that was created in a "
1948 "detached state in a later call to B<pthread_detach>(3)  or B<pthread_join>"
1949 "(3)."
1950 msgstr ""
1951
1952 #. type: Plain text
1953 #: build/C/man3/pthread_attr_setdetachstate.3:109
1954 #: build/C/man3/pthread_attr_setstack.3:154
1955 msgid "See B<pthread_attr_init>(3)."
1956 msgstr ""
1957
1958 #. type: Plain text
1959 #: build/C/man3/pthread_attr_setdetachstate.3:114
1960 msgid ""
1961 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
1962 "B<pthread_join>(3), B<pthreads>(7)"
1963 msgstr ""
1964 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
1965 "B<pthread_join>(3), B<pthreads>(7)"
1966
1967 #. type: TH
1968 #: build/C/man3/pthread_attr_setguardsize.3:24
1969 #, no-wrap
1970 msgid "PTHREAD_ATTR_SETGUARDSIZE"
1971 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
1972
1973 #. type: TH
1974 #: build/C/man3/pthread_attr_setguardsize.3:24
1975 #: build/C/man3/pthread_attr_setscope.3:24
1976 #: build/C/man3/pthread_attr_setstack.3:24
1977 #: build/C/man3/pthread_attr_setstackaddr.3:24 build/C/man3/pthread_self.3:24
1978 #, no-wrap
1979 msgid "2008-10-24"
1980 msgstr "2008-10-24"
1981
1982 #. type: Plain text
1983 #: build/C/man3/pthread_attr_setguardsize.3:28
1984 msgid ""
1985 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
1986 "attribute in thread attributes object"
1987 msgstr ""
1988
1989 #. type: Plain text
1990 #: build/C/man3/pthread_attr_setguardsize.3:36
1991 #, no-wrap
1992 msgid ""
1993 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
1994 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
1995 msgstr ""
1996 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
1997 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
1998
1999 #. type: Plain text
2000 #: build/C/man3/pthread_attr_setguardsize.3:47
2001 msgid ""
2002 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
2003 "of the thread attributes object referred to by I<attr> to the value "
2004 "specified in I<guardsize>."
2005 msgstr ""
2006
2007 #. type: Plain text
2008 #: build/C/man3/pthread_attr_setguardsize.3:57
2009 msgid ""
2010 "If I<guardsize> is greater than 0, then for each new thread created using "
2011 "I<attr> the system allocates an additional region of at least I<guardsize> "
2012 "bytes at the end of the thread's stack to act as the guard area for the "
2013 "stack (but see BUGS)."
2014 msgstr ""
2015
2016 #. type: Plain text
2017 #: build/C/man3/pthread_attr_setguardsize.3:63
2018 msgid ""
2019 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2020 "guard area."
2021 msgstr ""
2022
2023 #. type: Plain text
2024 #: build/C/man3/pthread_attr_setguardsize.3:65
2025 msgid "The default guard size is the same as the system page size."
2026 msgstr ""
2027
2028 #. type: Plain text
2029 #: build/C/man3/pthread_attr_setguardsize.3:80
2030 msgid ""
2031 "If the stack address attribute has been set in I<attr> (using "
2032 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
2033 "that the caller is allocating the thread's stack, then the guard size "
2034 "attribute is ignored (i.e., no guard area is created by the system): it is "
2035 "the application's responsibility to handle stack overflow (perhaps by using "
2036 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
2037 "it has allocated)."
2038 msgstr ""
2039
2040 #. type: Plain text
2041 #: build/C/man3/pthread_attr_setguardsize.3:88
2042 msgid ""
2043 "The B<pthread_attr_getguardsize>()  function returns the guard size "
2044 "attribute of the thread attributes object referred to by I<attr> in the "
2045 "buffer pointed to by I<guardsize>."
2046 msgstr ""
2047
2048 #. type: Plain text
2049 #: build/C/man3/pthread_attr_setguardsize.3:102
2050 msgid ""
2051 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2052 "invalid.  On Linux these functions always succeed (but portable and future-"
2053 "proof applications should nevertheless handle a possible error return)."
2054 msgstr ""
2055
2056 #. type: Plain text
2057 #: build/C/man3/pthread_attr_setguardsize.3:104
2058 #: build/C/man3/pthread_attr_setstackaddr.3:81
2059 #: build/C/man3/pthread_attr_setstacksize.3:81
2060 msgid "These functions are provided by glibc since version 2.1."
2061 msgstr ""
2062
2063 #. type: Plain text
2064 #: build/C/man3/pthread_attr_setguardsize.3:120
2065 msgid ""
2066 "A guard area consists of virtual memory pages that are protected to prevent "
2067 "read and write access.  If a thread overflows its stack into the guard area, "
2068 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2069 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
2070 "guard size is internally rounded up to the system page size when creating a "
2071 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
2072 "size that was set by B<pthread_attr_setguardsize>().)"
2073 msgstr ""
2074
2075 #. type: Plain text
2076 #: build/C/man3/pthread_attr_setguardsize.3:124
2077 msgid ""
2078 "Setting a guard size of 0 may be useful to save memory in an application "
2079 "that creates many threads and knows that stack overflow can never occur."
2080 msgstr ""
2081
2082 #. type: Plain text
2083 #: build/C/man3/pthread_attr_setguardsize.3:128
2084 msgid ""
2085 "Choosing a guard size larger than the default size may be necessary for "
2086 "detecting stack overflows if a thread allocates large data structures on the "
2087 "stack."
2088 msgstr ""
2089
2090 #. type: SH
2091 #: build/C/man3/pthread_attr_setguardsize.3:128
2092 #: build/C/man3/pthread_attr_setinheritsched.3:101
2093 #: build/C/man3/pthread_attr_setstacksize.3:94
2094 #: build/C/man3/pthread_create.3:194 build/C/man3/pthread_exit.3:91
2095 #, no-wrap
2096 msgid "BUGS"
2097 msgstr "バグ"
2098
2099 #. type: Plain text
2100 #: build/C/man3/pthread_attr_setguardsize.3:139
2101 msgid ""
2102 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2103 "within the stack size allocation, rather than allocating extra space at the "
2104 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2105 "error from B<pthread_create>(3)  if the guard size value is too large, "
2106 "leaving no space for the actual stack.)"
2107 msgstr ""
2108
2109 #.  glibc includes the guardsize within the allocated stack size,
2110 #.  which looks pretty clearly to be in violation of POSIX.
2111 #.  Filed bug, 22 Oct 2008:
2112 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2113 #.  Older reports:
2114 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2115 #.  Reportedly, LinuxThreads did the right thing, allocating
2116 #.  extra space at the end of the stack:
2117 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2118 #. type: Plain text
2119 #: build/C/man3/pthread_attr_setguardsize.3:153
2120 msgid ""
2121 "The obsolete LinuxThreads implementation did the right thing, allocating "
2122 "extra space at the end of the stack for the guard area."
2123 msgstr ""
2124
2125 #. type: Plain text
2126 #: build/C/man3/pthread_attr_setguardsize.3:156
2127 msgid "See B<pthread_getattr_np>(3)."
2128 msgstr ""
2129
2130 #. type: Plain text
2131 #: build/C/man3/pthread_attr_setguardsize.3:163
2132 msgid ""
2133 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2134 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2135 msgstr ""
2136 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2137 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2138
2139 #. type: TH
2140 #: build/C/man3/pthread_attr_setinheritsched.3:24
2141 #, no-wrap
2142 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2143 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2144
2145 #. type: TH
2146 #: build/C/man3/pthread_attr_setinheritsched.3:24
2147 #: build/C/man3/pthread_attr_setschedparam.3:24
2148 #: build/C/man3/pthread_attr_setstacksize.3:24
2149 #: build/C/man3/pthread_create.3:24
2150 #, no-wrap
2151 msgid "2012-03-15"
2152 msgstr "2012-03-15"
2153
2154 #. type: Plain text
2155 #: build/C/man3/pthread_attr_setinheritsched.3:28
2156 msgid ""
2157 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit "
2158 "scheduler attribute in thread attributes object"
2159 msgstr ""
2160
2161 #. type: Plain text
2162 #: build/C/man3/pthread_attr_setinheritsched.3:36
2163 #, no-wrap
2164 msgid ""
2165 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2166 "B<                                 int >I<inheritsched>B<);>\n"
2167 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2168 "B<                                 int *>I<inheritsched>B<);>\n"
2169 msgstr ""
2170 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2171 "B<                                 int >I<inheritsched>B<);>\n"
2172 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2173 "B<                                 int *>I<inheritsched>B<);>\n"
2174
2175 #. type: Plain text
2176 #: build/C/man3/pthread_attr_setinheritsched.3:53
2177 msgid ""
2178 "The B<pthread_attr_setinheritsched>()  function sets the inherit scheduler "
2179 "attribute of the thread attributes object referred to by I<attr> to the "
2180 "value specified in I<inheritsched>.  The inherit scheduler attribute "
2181 "determines whether a thread created using the thread attributes object "
2182 "I<attr> will inherit its scheduling attributes from the calling thread or "
2183 "whether it will take them from I<attr>."
2184 msgstr ""
2185
2186 #. type: Plain text
2187 #: build/C/man3/pthread_attr_setinheritsched.3:56
2188 msgid "The following values may be specified in I<inheritsched>:"
2189 msgstr ""
2190
2191 #. type: TP
2192 #: build/C/man3/pthread_attr_setinheritsched.3:56
2193 #, no-wrap
2194 msgid "B<PTHREAD_INHERIT_SCHED>"
2195 msgstr "B<PTHREAD_INHERIT_SCHED>"
2196
2197 #. type: Plain text
2198 #: build/C/man3/pthread_attr_setinheritsched.3:64
2199 msgid ""
2200 "Threads that are created using I<attr> inherit scheduling attributes from "
2201 "the creating thread; the scheduling attributes in I<attr> are ignored."
2202 msgstr ""
2203
2204 #. type: TP
2205 #: build/C/man3/pthread_attr_setinheritsched.3:64
2206 #, no-wrap
2207 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2208 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2209
2210 #.  FIXME what are the defaults for scheduler settings?
2211 #. type: Plain text
2212 #: build/C/man3/pthread_attr_setinheritsched.3:71
2213 msgid ""
2214 "Threads that are created using I<attr> take their scheduling attributes from "
2215 "the values specified by the attributes object."
2216 msgstr ""
2217
2218 #. type: Plain text
2219 #: build/C/man3/pthread_attr_setinheritsched.3:75
2220 msgid ""
2221 "The default setting of the inherit scheduler attribute in a newly "
2222 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2223 msgstr ""
2224
2225 #. type: Plain text
2226 #: build/C/man3/pthread_attr_setinheritsched.3:82
2227 msgid ""
2228 "The B<pthread_attr_getinheritsched>()  returns the inherit scheduler "
2229 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2230 "by I<inheritsched>."
2231 msgstr ""
2232
2233 #. type: Plain text
2234 #: build/C/man3/pthread_attr_setinheritsched.3:88
2235 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2236 msgstr ""
2237
2238 #. type: Plain text
2239 #: build/C/man3/pthread_attr_setinheritsched.3:92
2240 msgid "Invalid value in I<inheritsched>."
2241 msgstr ""
2242
2243 #.  .SH VERSIONS
2244 #.  Available since glibc 2.0.
2245 #. type: Plain text
2246 #: build/C/man3/pthread_attr_setinheritsched.3:99
2247 msgid ""
2248 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2249 "to set the attribute to an unsupported value\") for "
2250 "B<pthread_attr_setinheritsched>()."
2251 msgstr ""
2252
2253 #.  FIXME . Track status of the following bug:
2254 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2255 #. type: Plain text
2256 #: build/C/man3/pthread_attr_setinheritsched.3:117
2257 msgid ""
2258 "As at glibc 2.8, if a thread attributes object is initialized using "
2259 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2260 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2261 "if the inherit scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2262 "then a thread created using the attribute object wrongly inherits its "
2263 "scheduling attributes from the creating thread.  This bug does not occur if "
2264 "either the scheduling policy or scheduling priority attribute is explicitly "
2265 "set in the thread attributes object before calling B<pthread_create>(3)."
2266 msgstr ""
2267
2268 #. type: Plain text
2269 #: build/C/man3/pthread_attr_setinheritsched.3:120
2270 #: build/C/man3/pthread_attr_setschedparam.3:96
2271 #: build/C/man3/pthread_attr_setschedpolicy.3:92
2272 msgid "See B<pthread_setschedparam>(3)."
2273 msgstr ""
2274
2275 #. type: Plain text
2276 #: build/C/man3/pthread_attr_setinheritsched.3:128
2277 msgid ""
2278 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2279 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2280 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2281 "(3), B<pthreads>(7)"
2282 msgstr ""
2283 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2284 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2285 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2286 "(3), B<pthreads>(7)"
2287
2288 #. type: TH
2289 #: build/C/man3/pthread_attr_setschedparam.3:24
2290 #, no-wrap
2291 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2292 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2293
2294 #. type: Plain text
2295 #: build/C/man3/pthread_attr_setschedparam.3:28
2296 msgid ""
2297 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2298 "parameter attributes in thread attributes object"
2299 msgstr ""
2300
2301 #. type: Plain text
2302 #: build/C/man3/pthread_attr_setschedparam.3:36
2303 #, no-wrap
2304 msgid ""
2305 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2306 "B<                               const struct sched_param *>I<param>B<);>\n"
2307 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2308 "B<                               struct sched_param *>I<param>B<);>\n"
2309 msgstr ""
2310 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2311 "B<                               const struct sched_param *>I<param>B<);>\n"
2312 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2313 "B<                               struct sched_param *>I<param>B<);>\n"
2314
2315 #. type: Plain text
2316 #: build/C/man3/pthread_attr_setschedparam.3:50
2317 msgid ""
2318 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2319 "attributes of the thread attributes object referred to by I<attr> to the "
2320 "values specified in the buffer pointed to by I<param>.  These attributes "
2321 "determine the scheduling parameters of a thread created using the thread "
2322 "attributes object I<attr>."
2323 msgstr ""
2324
2325 #. type: Plain text
2326 #: build/C/man3/pthread_attr_setschedparam.3:57
2327 msgid ""
2328 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2329 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2330 "by I<param>."
2331 msgstr ""
2332
2333 #. type: Plain text
2334 #: build/C/man3/pthread_attr_setschedparam.3:59
2335 msgid "Scheduling parameters are maintained in the following structure:"
2336 msgstr ""
2337
2338 #. type: Plain text
2339 #: build/C/man3/pthread_attr_setschedparam.3:65
2340 #: build/C/man3/pthread_setschedparam.3:67
2341 #, no-wrap
2342 msgid ""
2343 "struct sched_param {\n"
2344 "    int sched_priority;     /* Scheduling priority */\n"
2345 "};\n"
2346 msgstr ""
2347 "struct sched_param {\n"
2348 "    int sched_priority;     /* Scheduling priority */\n"
2349 "};\n"
2350
2351 #. type: Plain text
2352 #: build/C/man3/pthread_attr_setschedparam.3:72
2353 #: build/C/man3/pthread_setschedparam.3:74
2354 msgid ""
2355 "As can be seen, only one scheduling parameter is supported.  For details of "
2356 "the permitted ranges for scheduling priorities in each scheduling policy, "
2357 "see B<sched_setscheduler>(2)."
2358 msgstr ""
2359
2360 #.  .SH VERSIONS
2361 #.  Available since glibc 2.0.
2362 #. type: Plain text
2363 #: build/C/man3/pthread_attr_setschedparam.3:87
2364 msgid ""
2365 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2366 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2367 "(but portable and future-proof applications should nevertheless handle a "
2368 "possible error return)."
2369 msgstr ""
2370
2371 #. type: Plain text
2372 #: build/C/man3/pthread_attr_setschedparam.3:93
2373 msgid ""
2374 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2375 "policies supported on Linux."
2376 msgstr ""
2377
2378 #. type: Plain text
2379 #: build/C/man3/pthread_attr_setschedparam.3:105
2380 msgid ""
2381 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2382 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2383 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2384 "(3), B<pthreads>(7)"
2385 msgstr ""
2386 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2387 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2388 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2389 "(3), B<pthreads>(7)"
2390
2391 #. type: TH
2392 #: build/C/man3/pthread_attr_setschedpolicy.3:24
2393 #, no-wrap
2394 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2395 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2396
2397 #. type: Plain text
2398 #: build/C/man3/pthread_attr_setschedpolicy.3:28
2399 msgid ""
2400 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2401 "scheduling policy attribute in thread attributes object"
2402 msgstr ""
2403
2404 #. type: Plain text
2405 #: build/C/man3/pthread_attr_setschedpolicy.3:36
2406 #, no-wrap
2407 msgid ""
2408 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2409 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2410 msgstr ""
2411 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2412 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2413
2414 #. type: Plain text
2415 #: build/C/man3/pthread_attr_setschedpolicy.3:50
2416 msgid ""
2417 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2418 "attribute of the thread attributes object referred to by I<attr> to the "
2419 "value specified in I<policy>.  This attribute determines the scheduling "
2420 "policy of a thread created using the thread attributes object I<attr>."
2421 msgstr ""
2422
2423 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2424 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2425 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2426 #. type: Plain text
2427 #: build/C/man3/pthread_attr_setschedpolicy.3:63
2428 msgid ""
2429 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2430 "B<SCHED_OTHER>, with the semantics described in B<sched_setscheduler>(2)."
2431 msgstr ""
2432
2433 #. type: Plain text
2434 #: build/C/man3/pthread_attr_setschedpolicy.3:70
2435 msgid ""
2436 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2437 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2438 "by I<policy>."
2439 msgstr ""
2440
2441 #. type: Plain text
2442 #: build/C/man3/pthread_attr_setschedpolicy.3:76
2443 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2444 msgstr ""
2445
2446 #. type: Plain text
2447 #: build/C/man3/pthread_attr_setschedpolicy.3:80
2448 msgid "Invalid value in I<policy>."
2449 msgstr ""
2450
2451 #.  .SH VERSIONS
2452 #.  Available since glibc 2.0.
2453 #. type: Plain text
2454 #: build/C/man3/pthread_attr_setschedpolicy.3:87
2455 msgid ""
2456 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2457 "to set the attribute to an unsupported value\") for "
2458 "B<pthread_attr_setschedpolicy>()."
2459 msgstr ""
2460
2461 #. type: Plain text
2462 #: build/C/man3/pthread_attr_setschedpolicy.3:100
2463 msgid ""
2464 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2465 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2466 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2467 "(3), B<pthreads>(7)"
2468 msgstr ""
2469 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2470 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2471 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2472 "(3), B<pthreads>(7)"
2473
2474 #. type: TH
2475 #: build/C/man3/pthread_attr_setscope.3:24
2476 #, no-wrap
2477 msgid "PTHREAD_ATTR_SETSCOPE"
2478 msgstr "PTHREAD_ATTR_SETSCOPE"
2479
2480 #. type: Plain text
2481 #: build/C/man3/pthread_attr_setscope.3:28
2482 msgid ""
2483 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2484 "attribute in thread attributes object"
2485 msgstr ""
2486
2487 #. type: Plain text
2488 #: build/C/man3/pthread_attr_setscope.3:36
2489 #, no-wrap
2490 msgid ""
2491 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2492 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2493 msgstr ""
2494 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2495 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2496
2497 #. type: Plain text
2498 #: build/C/man3/pthread_attr_setscope.3:51
2499 msgid ""
2500 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2501 "of the thread attributes object referred to by I<attr> to the value "
2502 "specified in I<scope>.  The contention scope attribute defines the set of "
2503 "threads against which a thread competes for resources such as the CPU.  "
2504 "POSIX.1-2001 specifies two possible values for I<scope>:"
2505 msgstr ""
2506
2507 #. type: TP
2508 #: build/C/man3/pthread_attr_setscope.3:51
2509 #, no-wrap
2510 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2511 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2512
2513 #. type: Plain text
2514 #: build/C/man3/pthread_attr_setscope.3:59
2515 msgid ""
2516 "The thread competes for resources with all other threads in all processes on "
2517 "the system that are in the same scheduling allocation domain (a group of one "
2518 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2519 "to one another according to their scheduling policy and priority."
2520 msgstr ""
2521
2522 #. type: TP
2523 #: build/C/man3/pthread_attr_setscope.3:59
2524 #, no-wrap
2525 msgid "B<PTHREAD_SCOPE_PROCESS>"
2526 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2527
2528 #. type: Plain text
2529 #: build/C/man3/pthread_attr_setscope.3:74
2530 msgid ""
2531 "The thread competes for resources with all other threads in the same process "
2532 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
2533 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2534 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
2535 "leaves it unspecified how these threads contend with other threads in other "
2536 "process on the system or with other threads in the same process that were "
2537 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
2538 msgstr ""
2539
2540 #. type: Plain text
2541 #: build/C/man3/pthread_attr_setscope.3:81
2542 msgid ""
2543 "POSIX.1-2001 only requires that an implementation support one of these "
2544 "contention scopes, but permits both to be supported.  Linux supports "
2545 "B<PTHREAD_SCOPE_SYSTEM>, but not B<PTHREAD_SCOPE_PROCESS>."
2546 msgstr ""
2547
2548 #. type: Plain text
2549 #: build/C/man3/pthread_attr_setscope.3:89
2550 msgid ""
2551 "The B<pthread_attr_getscope>()  function returns the contention scope "
2552 "attribute of the thread attributes object referred to by I<attr> in the "
2553 "buffer pointed to by I<scope>."
2554 msgstr ""
2555
2556 #. type: Plain text
2557 #: build/C/man3/pthread_attr_setscope.3:95
2558 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
2559 msgstr ""
2560
2561 #. type: Plain text
2562 #: build/C/man3/pthread_attr_setscope.3:99
2563 msgid "An invalid value was specified in I<scope>."
2564 msgstr ""
2565
2566 #. type: TP
2567 #: build/C/man3/pthread_attr_setscope.3:99
2568 #, no-wrap
2569 msgid "B<ENOTSUP>"
2570 msgstr "B<ENOTSUP>"
2571
2572 #. type: Plain text
2573 #: build/C/man3/pthread_attr_setscope.3:105
2574 msgid ""
2575 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
2576 "supported on Linux."
2577 msgstr ""
2578
2579 #. type: Plain text
2580 #: build/C/man3/pthread_attr_setscope.3:115
2581 msgid ""
2582 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a "
2583 "userspace thread is bound directly to a single kernel-scheduling entity.  "
2584 "This is the case on Linux for the obsolete LinuxThreads implementation and "
2585 "the modern NPTL implementation, which are both 1:1 threading implementations."
2586 msgstr ""
2587
2588 #. type: Plain text
2589 #: build/C/man3/pthread_attr_setscope.3:118
2590 msgid ""
2591 "POSIX.1-2001 specifies that the default contention scope is implementation-"
2592 "defined."
2593 msgstr ""
2594
2595 #. type: Plain text
2596 #: build/C/man3/pthread_attr_setscope.3:125
2597 msgid ""
2598 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2599 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2600 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2601 msgstr ""
2602 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2603 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2604 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2605
2606 #. type: TH
2607 #: build/C/man3/pthread_attr_setstack.3:24
2608 #, no-wrap
2609 msgid "PTHREAD_ATTR_SETSTACK"
2610 msgstr "PTHREAD_ATTR_SETSTACK"
2611
2612 #. type: Plain text
2613 #: build/C/man3/pthread_attr_setstack.3:28
2614 msgid ""
2615 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
2616 "thread attributes object"
2617 msgstr ""
2618
2619 #. type: Plain text
2620 #: build/C/man3/pthread_attr_setstack.3:36
2621 #, no-wrap
2622 msgid ""
2623 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2624 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2625 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2626 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2627 msgstr ""
2628 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2629 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2630 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2631 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2632
2633 #. type: Plain text
2634 #: build/C/man3/pthread_attr_setstack.3:43 build/C/man3/pthread_sigqueue.3:39
2635 msgid ""
2636 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
2637 msgstr ""
2638
2639 #. type: Plain text
2640 #: build/C/man3/pthread_attr_setstack.3:48
2641 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2642 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2643
2644 #. type: Plain text
2645 #: build/C/man3/pthread_attr_setstack.3:50
2646 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2647 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2648
2649 #. type: Plain text
2650 #: build/C/man3/pthread_attr_setstack.3:66
2651 msgid ""
2652 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
2653 "size attributes of the thread attributes object referred to by I<attr> to "
2654 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
2655 "attributes specify the location and size of the stack that should be used by "
2656 "a thread that is created using the thread attributes object I<attr>."
2657 msgstr ""
2658
2659 #. type: Plain text
2660 #: build/C/man3/pthread_attr_setstack.3:72
2661 msgid ""
2662 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
2663 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
2664 "allocated buffer should be both readable and writable."
2665 msgstr ""
2666
2667 #. type: Plain text
2668 #: build/C/man3/pthread_attr_setstack.3:83
2669 msgid ""
2670 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
2671 "size attributes of the thread attributes object referred to by I<attr> in "
2672 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
2673 msgstr ""
2674
2675 #. type: Plain text
2676 #: build/C/man3/pthread_attr_setstack.3:89
2677 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
2678 msgstr ""
2679
2680 #. type: Plain text
2681 #: build/C/man3/pthread_attr_setstack.3:100
2682 msgid ""
2683 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
2684 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
2685 "stacksize> is not suitably aligned."
2686 msgstr ""
2687
2688 #. type: Plain text
2689 #: build/C/man3/pthread_attr_setstack.3:108
2690 msgid ""
2691 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
2692 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
2693 "caller."
2694 msgstr ""
2695
2696 #. type: Plain text
2697 #: build/C/man3/pthread_attr_setstack.3:110
2698 msgid "These functions are provided by glibc since version 2.2."
2699 msgstr ""
2700
2701 #. type: Plain text
2702 #: build/C/man3/pthread_attr_setstack.3:120
2703 msgid ""
2704 "These functions are provided for applications that must ensure that a "
2705 "thread's stack is placed in a particular location.  For most applications, "
2706 "this is not necessary, and the use of these functions should be avoided.  "
2707 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
2708 "stack size other than the default.)"
2709 msgstr ""
2710
2711 #. type: Plain text
2712 #: build/C/man3/pthread_attr_setstack.3:131
2713 msgid ""
2714 "When an application employs B<pthread_attr_setstack>(), it takes over the "
2715 "responsibility of allocating the stack.  Any guard size value that was set "
2716 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
2717 "is the application's responsibility to allocate a guard area (one or more "
2718 "pages protected against reading and writing)  to handle the possibility of "
2719 "stack overflow."
2720 msgstr ""
2721
2722 #. type: Plain text
2723 #: build/C/man3/pthread_attr_setstack.3:142
2724 msgid ""
2725 "The address specified in I<stackaddr> should be suitably aligned: for full "
2726 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
2727 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
2728 "should also be a multiple of the system page size."
2729 msgstr ""
2730
2731 #. type: Plain text
2732 #: build/C/man3/pthread_attr_setstack.3:151
2733 msgid ""
2734 "If I<attr> is used to create multiple threads, then the caller must change "
2735 "the stack address attribute between calls to B<pthread_create>(3); "
2736 "otherwise, the threads will attempt to use the same memory area for their "
2737 "stacks, and chaos will ensue."
2738 msgstr ""
2739
2740 #. type: Plain text
2741 #: build/C/man3/pthread_attr_setstack.3:163
2742 msgid ""
2743 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
2744 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
2745 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2746 msgstr ""
2747 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
2748 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
2749 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2750
2751 #. type: TH
2752 #: build/C/man3/pthread_attr_setstackaddr.3:24
2753 #, no-wrap
2754 msgid "PTHREAD_ATTR_SETSTACKADDR"
2755 msgstr "PTHREAD_ATTR_SETSTACKADDR"
2756
2757 #. type: Plain text
2758 #: build/C/man3/pthread_attr_setstackaddr.3:28
2759 msgid ""
2760 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
2761 "attribute in thread attributes object"
2762 msgstr ""
2763
2764 #. type: Plain text
2765 #: build/C/man3/pthread_attr_setstackaddr.3:36
2766 #, no-wrap
2767 msgid ""
2768 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
2769 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
2770 msgstr ""
2771 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
2772 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
2773
2774 #. type: Plain text
2775 #: build/C/man3/pthread_attr_setstackaddr.3:47
2776 msgid ""
2777 "These functions are obsolete: B<do not use them.> Use "
2778 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
2779 msgstr ""
2780
2781 #. type: Plain text
2782 #: build/C/man3/pthread_attr_setstackaddr.3:58
2783 msgid ""
2784 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
2785 "attribute of the thread attributes object referred to by I<attr> to the "
2786 "value specified in I<stackaddr>.  This attribute specifies the location of "
2787 "the stack that should be used by a thread that is created using the thread "
2788 "attributes object I<attr>."
2789 msgstr ""
2790
2791 #. type: Plain text
2792 #: build/C/man3/pthread_attr_setstackaddr.3:64
2793 msgid ""
2794 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
2795 "that was allocated by the caller.  The pages of the allocated buffer should "
2796 "be both readable and writable."
2797 msgstr ""
2798
2799 #. type: Plain text
2800 #: build/C/man3/pthread_attr_setstackaddr.3:72
2801 msgid ""
2802 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
2803 "attribute of the thread attributes object referred to by I<attr> in the "
2804 "buffer pointed to by I<stackaddr>."
2805 msgstr ""
2806
2807 #. type: Plain text
2808 #: build/C/man3/pthread_attr_setstackaddr.3:79
2809 msgid ""
2810 "No errors are defined (but applications should nevertheless handle a "
2811 "possible error return)."
2812 msgstr ""
2813
2814 #. type: Plain text
2815 #: build/C/man3/pthread_attr_setstackaddr.3:84
2816 msgid ""
2817 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
2818 "POSIX.1-2008 removes the specification of these functions."
2819 msgstr ""
2820
2821 #. type: Plain text
2822 #: build/C/man3/pthread_attr_setstackaddr.3:108
2823 msgid ""
2824 "I<Do not use these functions!> They cannot be portably used, since they "
2825 "provide no way of specifying the direction of growth or the range of the "
2826 "stack.  For example, on architectures with a stack that grows downward, "
2827 "I<stackaddr> specifies the next address past the I<highest> address of the "
2828 "allocated stack area.  However, on architectures with a stack that grows "
2829 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
2830 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
2831 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
2832 "in the allocated stack area (and the I<stacksize> argument specifies the "
2833 "range of the stack)."
2834 msgstr ""
2835
2836 #. type: Plain text
2837 #: build/C/man3/pthread_attr_setstackaddr.3:113
2838 msgid ""
2839 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
2840 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2841 msgstr ""
2842 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
2843 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2844
2845 #. type: TH
2846 #: build/C/man3/pthread_attr_setstacksize.3:24
2847 #, no-wrap
2848 msgid "PTHREAD_ATTR_SETSTACKSIZE"
2849 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
2850
2851 #. type: Plain text
2852 #: build/C/man3/pthread_attr_setstacksize.3:28
2853 msgid ""
2854 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
2855 "attribute in thread attributes object"
2856 msgstr ""
2857
2858 #. type: Plain text
2859 #: build/C/man3/pthread_attr_setstacksize.3:36
2860 #, no-wrap
2861 msgid ""
2862 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
2863 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
2864 msgstr ""
2865 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
2866 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
2867
2868 #. type: Plain text
2869 #: build/C/man3/pthread_attr_setstacksize.3:47
2870 msgid ""
2871 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
2872 "of the thread attributes object referred to by I<attr> to the value "
2873 "specified in I<stacksize>."
2874 msgstr ""
2875
2876 #. type: Plain text
2877 #: build/C/man3/pthread_attr_setstacksize.3:51
2878 msgid ""
2879 "The stack size attribute determines the minimum size (in bytes) that will be "
2880 "allocated for threads created using the thread attributes object I<attr>."
2881 msgstr ""
2882
2883 #. type: Plain text
2884 #: build/C/man3/pthread_attr_setstacksize.3:59
2885 msgid ""
2886 "The B<pthread_attr_getstacksize>()  function returns the stack size "
2887 "attribute of the thread attributes object referred to by I<attr> in the "
2888 "buffer pointed to by I<stacksize>."
2889 msgstr ""
2890
2891 #. type: Plain text
2892 #: build/C/man3/pthread_attr_setstacksize.3:65
2893 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
2894 msgstr ""
2895
2896 #. type: Plain text
2897 #: build/C/man3/pthread_attr_setstacksize.3:70
2898 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
2899 msgstr ""
2900
2901 #.  e.g., MacOS
2902 #. type: Plain text
2903 #: build/C/man3/pthread_attr_setstacksize.3:79
2904 msgid ""
2905 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
2906 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
2907 msgstr ""
2908
2909 #. type: Plain text
2910 #: build/C/man3/pthread_attr_setstacksize.3:86
2911 msgid ""
2912 "For details on the default stack size of new threads, see B<pthread_create>"
2913 "(3)."
2914 msgstr ""
2915
2916 #. type: Plain text
2917 #: build/C/man3/pthread_attr_setstacksize.3:89
2918 msgid ""
2919 "A thread's stack size is fixed at the time of thread creation.  Only the "
2920 "main thread can dynamically grow its stack."
2921 msgstr ""
2922
2923 #. type: Plain text
2924 #: build/C/man3/pthread_attr_setstacksize.3:94
2925 msgid ""
2926 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
2927 "the size and location of a caller-allocated stack that is to be used by a "
2928 "thread."
2929 msgstr ""
2930
2931 #. type: Plain text
2932 #: build/C/man3/pthread_attr_setstacksize.3:106
2933 msgid ""
2934 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
2935 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
2936 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
2937 "stack will be at least I<stacksize> bytes."
2938 msgstr ""
2939
2940 #. type: Plain text
2941 #: build/C/man3/pthread_attr_setstacksize.3:109
2942 #: build/C/man3/pthread_join.3:125
2943 msgid "See B<pthread_create>(3)."
2944 msgstr ""
2945
2946 #. type: Plain text
2947 #: build/C/man3/pthread_attr_setstacksize.3:115
2948 msgid ""
2949 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
2950 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
2951 msgstr ""
2952 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
2953 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
2954
2955 #. type: TH
2956 #: build/C/man3/pthread_cancel.3:24
2957 #, no-wrap
2958 msgid "PTHREAD_CANCEL"
2959 msgstr "PTHREAD_CANCEL"
2960
2961 #. type: TH
2962 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_setschedparam.3:24
2963 #, no-wrap
2964 msgid "2008-11-17"
2965 msgstr "2008-11-17"
2966
2967 #. type: Plain text
2968 #: build/C/man3/pthread_cancel.3:27
2969 msgid "pthread_cancel - send a cancellation request to a thread"
2970 msgstr ""
2971
2972 #. type: Plain text
2973 #: build/C/man3/pthread_cancel.3:32
2974 #, no-wrap
2975 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
2976 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
2977
2978 #. type: Plain text
2979 #: build/C/man3/pthread_cancel.3:44
2980 msgid ""
2981 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
2982 "I<thread>.  Whether and when the target thread reacts to the cancellation "
2983 "request depends on two attributes that are under the control of that thread: "
2984 "its cancelability I<state> and I<type>."
2985 msgstr ""
2986
2987 #. type: Plain text
2988 #: build/C/man3/pthread_cancel.3:56
2989 msgid ""
2990 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
2991 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
2992 "has disabled cancellation, then a cancellation request remains queued until "
2993 "the thread enables cancellation.  If a thread has enabled cancellation, then "
2994 "its cancelability type determines when cancellation occurs."
2995 msgstr ""
2996
2997 #. type: Plain text
2998 #: build/C/man3/pthread_cancel.3:72
2999 msgid ""
3000 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3001 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
3002 "Asynchronous cancelability means that the thread can be canceled at any time "
3003 "(usually immediately, but the system does not guarantee this).  Deferred "
3004 "cancelability means that cancellation will be delayed until the thread next "
3005 "calls a function that is a I<cancellation point>.  A list of functions that "
3006 "are or may be cancellation points is provided in I<pthreads>(7)."
3007 msgstr ""
3008
3009 #. type: Plain text
3010 #: build/C/man3/pthread_cancel.3:76
3011 msgid ""
3012 "When a cancellation requested is acted on, the following steps occur for "
3013 "I<thread> (in this order):"
3014 msgstr ""
3015
3016 #. type: IP
3017 #: build/C/man3/pthread_cancel.3:76 build/C/man3/pthread_cleanup_push.3:67
3018 #, no-wrap
3019 msgid "1."
3020 msgstr "1."
3021
3022 #. type: Plain text
3023 #: build/C/man3/pthread_cancel.3:81
3024 msgid ""
3025 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3026 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
3027 msgstr ""
3028
3029 #. type: IP
3030 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:71
3031 #, no-wrap
3032 msgid "2."
3033 msgstr "2."
3034
3035 #. type: Plain text
3036 #: build/C/man3/pthread_cancel.3:86
3037 msgid ""
3038 "Thread-specific data destructors are called, in an unspecified order.  (See "
3039 "B<pthread_key_create>(3).)"
3040 msgstr ""
3041
3042 #. type: IP
3043 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:79
3044 #, no-wrap
3045 msgid "3."
3046 msgstr "3."
3047
3048 #. type: Plain text
3049 #: build/C/man3/pthread_cancel.3:90
3050 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3051 msgstr ""
3052
3053 #. type: Plain text
3054 #: build/C/man3/pthread_cancel.3:98
3055 msgid ""
3056 "The above steps happen asynchronously with respect to the B<pthread_cancel>"
3057 "()  call; the return status of B<pthread_cancel>()  merely informs the "
3058 "caller whether the cancellation request was successfully queued."
3059 msgstr ""
3060
3061 #. type: Plain text
3062 #: build/C/man3/pthread_cancel.3:107
3063 msgid ""
3064 "After a canceled thread has terminated, a join with that thread using "
3065 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
3066 "status.  (Joining with a thread is the only way to know that cancellation "
3067 "has completed.)"
3068 msgstr ""
3069
3070 #. type: Plain text
3071 #: build/C/man3/pthread_cancel.3:112
3072 msgid ""
3073 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
3074 "error number."
3075 msgstr ""
3076
3077 #. type: TP
3078 #: build/C/man3/pthread_cancel.3:113 build/C/man3/pthread_detach.3:57
3079 #: build/C/man3/pthread_getcpuclockid.3:56 build/C/man3/pthread_join.3:91
3080 #: build/C/man3/pthread_kill.3:59 build/C/man3/pthread_setaffinity_np.3:112
3081 #: build/C/man3/pthread_setschedparam.3:112
3082 #: build/C/man3/pthread_setschedprio.3:68 build/C/man3/pthread_sigqueue.3:83
3083 #, no-wrap
3084 msgid "B<ESRCH>"
3085 msgstr "B<ESRCH>"
3086
3087 #. type: Plain text
3088 #: build/C/man3/pthread_cancel.3:120 build/C/man3/pthread_detach.3:62
3089 #: build/C/man3/pthread_getcpuclockid.3:61 build/C/man3/pthread_join.3:96
3090 #: build/C/man3/pthread_kill.3:64 build/C/man3/pthread_setaffinity_np.3:117
3091 #: build/C/man3/pthread_setschedparam.3:117
3092 #: build/C/man3/pthread_setschedprio.3:73
3093 msgid "No thread with the ID I<thread> could be found."
3094 msgstr ""
3095
3096 #. type: Plain text
3097 #: build/C/man3/pthread_cancel.3:130
3098 msgid ""
3099 "On Linux, cancellation is implemented using signals.  Under the NPTL "
3100 "threading implementation, the first real-time signal (i.e., signal 32) is "
3101 "used for this purpose.  On LinuxThreads, the second real-time signal is "
3102 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3103 msgstr ""
3104
3105 #. type: Plain text
3106 #: build/C/man3/pthread_cancel.3:136
3107 msgid ""
3108 "The program below creates a thread and then cancels it.  The main thread "
3109 "joins with the canceled thread to check that its exit status was "
3110 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
3111 "run the program:"
3112 msgstr ""
3113
3114 #. type: Plain text
3115 #: build/C/man3/pthread_cancel.3:144
3116 #, no-wrap
3117 msgid ""
3118 "$ ./a.out\n"
3119 "thread_func(): started; cancellation disabled\n"
3120 "main(): sending cancellation request\n"
3121 "thread_func(): about to enable cancellation\n"
3122 "main(): thread was canceled\n"
3123 msgstr ""
3124 "$ ./a.out\n"
3125 "thread_func(): started; cancellation disabled\n"
3126 "main(): sending cancellation request\n"
3127 "thread_func(): about to enable cancellation\n"
3128 "main(): thread was canceled\n"
3129
3130 #. type: Plain text
3131 #: build/C/man3/pthread_cancel.3:154
3132 #, no-wrap
3133 msgid ""
3134 "#include E<lt>pthread.hE<gt>\n"
3135 "#include E<lt>stdio.hE<gt>\n"
3136 "#include E<lt>errno.hE<gt>\n"
3137 "#include E<lt>stdlib.hE<gt>\n"
3138 "#include E<lt>unistd.hE<gt>\n"
3139 msgstr ""
3140 "#include E<lt>pthread.hE<gt>\n"
3141 "#include E<lt>stdio.hE<gt>\n"
3142 "#include E<lt>errno.hE<gt>\n"
3143 "#include E<lt>stdlib.hE<gt>\n"
3144 "#include E<lt>unistd.hE<gt>\n"
3145
3146 #. type: Plain text
3147 #: build/C/man3/pthread_cancel.3:162
3148 #, no-wrap
3149 msgid ""
3150 "static void *\n"
3151 "thread_func(void *ignored_argument)\n"
3152 "{\n"
3153 "    int s;\n"
3154 msgstr ""
3155 "static void *\n"
3156 "thread_func(void *ignored_argument)\n"
3157 "{\n"
3158 "    int s;\n"
3159
3160 #. type: Plain text
3161 #: build/C/man3/pthread_cancel.3:165
3162 #, no-wrap
3163 msgid ""
3164 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3165 "       immediately react to a cancellation request */\n"
3166 msgstr ""
3167 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3168 "       immediately react to a cancellation request */\n"
3169
3170 #. type: Plain text
3171 #: build/C/man3/pthread_cancel.3:169
3172 #, no-wrap
3173 msgid ""
3174 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3175 "    if (s != 0)\n"
3176 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3177 msgstr ""
3178 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3179 "    if (s != 0)\n"
3180 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3181
3182 #. type: Plain text
3183 #: build/C/man3/pthread_cancel.3:173
3184 #, no-wrap
3185 msgid ""
3186 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3187 "    sleep(5);\n"
3188 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3189 msgstr ""
3190 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3191 "    sleep(5);\n"
3192 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3193
3194 #. type: Plain text
3195 #: build/C/man3/pthread_cancel.3:177
3196 #, no-wrap
3197 msgid ""
3198 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3199 "    if (s != 0)\n"
3200 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3201 msgstr ""
3202 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3203 "    if (s != 0)\n"
3204 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3205
3206 #. type: Plain text
3207 #: build/C/man3/pthread_cancel.3:179
3208 #, no-wrap
3209 msgid "    /* sleep() is a cancellation point */\n"
3210 msgstr "    /* sleep() is a cancellation point */\n"
3211
3212 #. type: Plain text
3213 #: build/C/man3/pthread_cancel.3:181
3214 #, no-wrap
3215 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3216 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3217
3218 #. type: Plain text
3219 #: build/C/man3/pthread_cancel.3:183
3220 #, no-wrap
3221 msgid "    /* Should never get here */\n"
3222 msgstr "    /* Should never get here */\n"
3223
3224 #. type: Plain text
3225 #: build/C/man3/pthread_cancel.3:187
3226 #, no-wrap
3227 msgid ""
3228 "    printf(\"thread_func(): not canceled!\\en\");\n"
3229 "    return NULL;\n"
3230 "}\n"
3231 msgstr ""
3232 "    printf(\"thread_func(): not canceled!\\en\");\n"
3233 "    return NULL;\n"
3234 "}\n"
3235
3236 #. type: Plain text
3237 #: build/C/man3/pthread_cancel.3:194
3238 #, no-wrap
3239 msgid ""
3240 "int\n"
3241 "main(void)\n"
3242 "{\n"
3243 "    pthread_t thr;\n"
3244 "    void *res;\n"
3245 "    int s;\n"
3246 msgstr ""
3247 "int\n"
3248 "main(void)\n"
3249 "{\n"
3250 "    pthread_t thr;\n"
3251 "    void *res;\n"
3252 "    int s;\n"
3253
3254 #. type: Plain text
3255 #: build/C/man3/pthread_cancel.3:196
3256 #, no-wrap
3257 msgid "    /* Start a thread and then send it a cancellation request */\n"
3258 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3259
3260 #. type: Plain text
3261 #: build/C/man3/pthread_cancel.3:200
3262 #, no-wrap
3263 msgid ""
3264 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3265 "    if (s != 0)\n"
3266 "        handle_error_en(s, \"pthread_create\");\n"
3267 msgstr ""
3268 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3269 "    if (s != 0)\n"
3270 "        handle_error_en(s, \"pthread_create\");\n"
3271
3272 #. type: Plain text
3273 #: build/C/man3/pthread_cancel.3:202
3274 #, no-wrap
3275 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3276 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3277
3278 #. type: Plain text
3279 #: build/C/man3/pthread_cancel.3:207
3280 #, no-wrap
3281 msgid ""
3282 "    printf(\"main(): sending cancellation request\\en\");\n"
3283 "    s = pthread_cancel(thr);\n"
3284 "    if (s != 0)\n"
3285 "        handle_error_en(s, \"pthread_cancel\");\n"
3286 msgstr ""
3287 "    printf(\"main(): sending cancellation request\\en\");\n"
3288 "    s = pthread_cancel(thr);\n"
3289 "    if (s != 0)\n"
3290 "        handle_error_en(s, \"pthread_cancel\");\n"
3291
3292 #. type: Plain text
3293 #: build/C/man3/pthread_cancel.3:209
3294 #, no-wrap
3295 msgid "    /* Join with thread to see what its exit status was */\n"
3296 msgstr "    /* Join with thread to see what its exit status was */\n"
3297
3298 #. type: Plain text
3299 #: build/C/man3/pthread_cancel.3:213 build/C/man3/pthread_cleanup_push.3:301
3300 #, no-wrap
3301 msgid ""
3302 "    s = pthread_join(thr, &res);\n"
3303 "    if (s != 0)\n"
3304 "        handle_error_en(s, \"pthread_join\");\n"
3305 msgstr ""
3306 "    s = pthread_join(thr, &res);\n"
3307 "    if (s != 0)\n"
3308 "        handle_error_en(s, \"pthread_join\");\n"
3309
3310 #. type: Plain text
3311 #: build/C/man3/pthread_cancel.3:220
3312 #, no-wrap
3313 msgid ""
3314 "    if (res == PTHREAD_CANCELED)\n"
3315 "        printf(\"main(): thread was canceled\\en\");\n"
3316 "    else\n"
3317 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3318 "    exit(EXIT_SUCCESS);\n"
3319 "}\n"
3320 msgstr ""
3321 "    if (res == PTHREAD_CANCELED)\n"
3322 "        printf(\"main(): thread was canceled\\en\");\n"
3323 "    else\n"
3324 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3325 "    exit(EXIT_SUCCESS);\n"
3326 "}\n"
3327
3328 #. type: Plain text
3329 #: build/C/man3/pthread_cancel.3:230
3330 msgid ""
3331 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3332 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3333 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3334 msgstr ""
3335 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3336 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3337 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3338
3339 #. type: TH
3340 #: build/C/man3/pthread_cleanup_push.3:24
3341 #, no-wrap
3342 msgid "PTHREAD_CLEANUP_PUSH"
3343 msgstr "PTHREAD_CLEANUP_PUSH"
3344
3345 #. type: TH
3346 #: build/C/man3/pthread_cleanup_push.3:24
3347 #: build/C/man3/pthread_setcancelstate.3:24
3348 #, no-wrap
3349 msgid "2008-11-24"
3350 msgstr "2008-11-24"
3351
3352 #. type: Plain text
3353 #: build/C/man3/pthread_cleanup_push.3:28
3354 msgid ""
3355 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
3356 "clean-up handlers"
3357 msgstr ""
3358
3359 #. type: Plain text
3360 #: build/C/man3/pthread_cleanup_push.3:35
3361 #, no-wrap
3362 msgid ""
3363 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3364 "B<                          void *>I<arg>B<);>\n"
3365 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3366 msgstr ""
3367 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3368 "B<                          void *>I<arg>B<);>\n"
3369 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3370
3371 #. type: Plain text
3372 #: build/C/man3/pthread_cleanup_push.3:46
3373 msgid ""
3374 "These functions manipulate the calling thread's stack of thread-cancellation "
3375 "clean-up handlers.  A clean-up handler is a function that is automatically "
3376 "executed when a thread is canceled (or in various other circumstances "
3377 "described below); it might, for example, unlock a mutex so that it becomes "
3378 "available to other threads in the process."
3379 msgstr ""
3380
3381 #. type: Plain text
3382 #: build/C/man3/pthread_cleanup_push.3:57
3383 msgid ""
3384 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
3385 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
3386 "be given I<arg> as its argument."
3387 msgstr ""
3388
3389 #. type: Plain text
3390 #: build/C/man3/pthread_cleanup_push.3:64
3391 msgid ""
3392 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
3393 "stack of clean-up handlers, and optionally executes it if I<execute> is "
3394 "nonzero."
3395 msgstr ""
3396
3397 #. type: Plain text
3398 #: build/C/man3/pthread_cleanup_push.3:67
3399 msgid ""
3400 "A cancellation clean-up handler is popped from the stack and executed in the "
3401 "following circumstances:"
3402 msgstr ""
3403
3404 #. type: Plain text
3405 #: build/C/man3/pthread_cleanup_push.3:71
3406 msgid ""
3407 "When a thread is canceled, all of the stacked clean-up handlers are popped "
3408 "and executed in the reverse of the order in which they were pushed onto the "
3409 "stack."
3410 msgstr ""
3411
3412 #. type: Plain text
3413 #: build/C/man3/pthread_cleanup_push.3:79
3414 msgid ""
3415 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
3416 "handlers are executed as described in the preceding point.  (Clean-up "
3417 "handlers are I<not> called if the thread terminates by performing a "
3418 "I<return> from the thread start function.)"
3419 msgstr ""
3420
3421 #. type: Plain text
3422 #: build/C/man3/pthread_cleanup_push.3:85
3423 msgid ""
3424 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
3425 "argument, the top-most clean-up handler is popped and executed."
3426 msgstr ""
3427
3428 #. type: Plain text
3429 #: build/C/man3/pthread_cleanup_push.3:97
3430 msgid ""
3431 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
3432 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
3433 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
3434 "calls to these functions are paired within the same function, and at the "
3435 "same lexical nesting level.  (In other words, a clean-up handler is only "
3436 "established during the execution of a specified section of code.)"
3437 msgstr ""
3438
3439 #. type: Plain text
3440 #: build/C/man3/pthread_cleanup_push.3:117
3441 msgid ""
3442 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
3443 "call has been made to B<pthread_cleanup_push>()  or B<pthread_cleanup_pop>"
3444 "()  without the matching call of the pair since the jump buffer was filled "
3445 "by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, calling B<longjmp>(3)  "
3446 "(B<siglongjmp>(3))  from inside a clean-up handler produces undefined "
3447 "results unless the jump buffer was also filled by B<setjmp>(3)  (B<sigsetjmp>"
3448 "(3))  inside the handler."
3449 msgstr ""
3450
3451 #. type: Plain text
3452 #: build/C/man3/pthread_cleanup_push.3:119
3453 msgid "These functions do not return a value."
3454 msgstr ""
3455
3456 #.  SH VERSIONS
3457 #.  Available since glibc 2.0
3458 #. type: Plain text
3459 #: build/C/man3/pthread_cleanup_push.3:123
3460 msgid "There are no errors."
3461 msgstr ""
3462
3463 #. type: Plain text
3464 #: build/C/man3/pthread_cleanup_push.3:134
3465 msgid ""
3466 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
3467 "functions I<are> implemented as macros that expand to text containing \\(aqB<"
3468 "{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
3469 "declared within the scope of paired calls to these functions will only be "
3470 "visible within that scope."
3471 msgstr ""
3472
3473 #.  The text was actually added in the 2004 TC2
3474 #. type: Plain text
3475 #: build/C/man3/pthread_cleanup_push.3:149
3476 msgid ""
3477 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
3478 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
3479 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
3480 "avoid doing this."
3481 msgstr ""
3482
3483 #. type: Plain text
3484 #: build/C/man3/pthread_cleanup_push.3:164
3485 msgid ""
3486 "The program below provides a simple example of the use of the functions "
3487 "described in this page.  The program creates a thread that executes a loop "
3488 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
3489 "loop increments a global variable, I<cnt>, once each second.  Depending on "
3490 "what command-line arguments are supplied, the main thread sends the other "
3491 "thread a cancellation request, or sets a global variable that causes the "
3492 "other thread to exit its loop and terminate normally (by doing a I<return>)."
3493 msgstr ""
3494
3495 #. type: Plain text
3496 #: build/C/man3/pthread_cleanup_push.3:167
3497 msgid ""
3498 "In the following shell session, the main thread sends a cancellation request "
3499 "to the other thread:"
3500 msgstr ""
3501
3502 #. type: Plain text
3503 #: build/C/man3/pthread_cleanup_push.3:177
3504 #, no-wrap
3505 msgid ""
3506 "$ B<./a.out>\n"
3507 "New thread started\n"
3508 "cnt = 0\n"
3509 "cnt = 1\n"
3510 "Canceling thread\n"
3511 "Called clean-up handler\n"
3512 "Thread was canceled; cnt = 0\n"
3513 msgstr ""
3514 "$ B<./a.out>\n"
3515 "New thread started\n"
3516 "cnt = 0\n"
3517 "cnt = 1\n"
3518 "Canceling thread\n"
3519 "Called clean-up handler\n"
3520 "Thread was canceled; cnt = 0\n"
3521
3522 #. type: Plain text
3523 #: build/C/man3/pthread_cleanup_push.3:185
3524 msgid ""
3525 "From the above, we see that the thread was canceled, and that the "
3526 "cancellation clean-up handler was called and it reset the value of the "
3527 "global variable I<cnt> to 0."
3528 msgstr ""
3529
3530 #. type: Plain text
3531 #: build/C/man3/pthread_cleanup_push.3:188
3532 msgid ""
3533 "In the next run, the main program sets a global variable that causes other "
3534 "thread to terminate normally:"
3535 msgstr ""
3536
3537 #. type: Plain text
3538 #: build/C/man3/pthread_cleanup_push.3:196
3539 #, no-wrap
3540 msgid ""
3541 "$ B<./a.out x>\n"
3542 "New thread started\n"
3543 "cnt = 0\n"
3544 "cnt = 1\n"
3545 "Thread terminated normally; cnt = 2\n"
3546 msgstr ""
3547 "$ B<./a.out x>\n"
3548 "New thread started\n"
3549 "cnt = 0\n"
3550 "cnt = 1\n"
3551 "Thread terminated normally; cnt = 2\n"
3552
3553 #. type: Plain text
3554 #: build/C/man3/pthread_cleanup_push.3:204
3555 msgid ""
3556 "From the above, we see that the clean-up handler was not executed (because "
3557 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
3558 msgstr ""
3559
3560 #. type: Plain text
3561 #: build/C/man3/pthread_cleanup_push.3:209
3562 msgid ""
3563 "In the next run, the main program sets a global variable that causes the "
3564 "other thread to terminate normally, and supplies a nonzero value for "
3565 "I<cleanup_pop_arg>:"
3566 msgstr ""
3567
3568 #. type: Plain text
3569 #: build/C/man3/pthread_cleanup_push.3:218
3570 #, no-wrap
3571 msgid ""
3572 "$ B<./a.out x 1>\n"
3573 "New thread started\n"
3574 "cnt = 0\n"
3575 "cnt = 1\n"
3576 "Called clean-up handler\n"
3577 "Thread terminated normally; cnt = 0\n"
3578 msgstr ""
3579 "$ B<./a.out x 1>\n"
3580 "New thread started\n"
3581 "cnt = 0\n"
3582 "cnt = 1\n"
3583 "Called clean-up handler\n"
3584 "Thread terminated normally; cnt = 0\n"
3585
3586 #. type: Plain text
3587 #: build/C/man3/pthread_cleanup_push.3:225
3588 msgid ""
3589 "In the above, we see that although the thread was not canceled, the clean-up "
3590 "handler was executed, because the argument given to B<pthread_cleanup_pop>"
3591 "()  was nonzero."
3592 msgstr ""
3593
3594 #. type: Plain text
3595 #: build/C/man3/pthread_cleanup_push.3:234
3596 #, no-wrap
3597 msgid ""
3598 "#include E<lt>pthread.hE<gt>\n"
3599 "#include E<lt>sys/types.hE<gt>\n"
3600 "#include E<lt>stdio.hE<gt>\n"
3601 "#include E<lt>stdlib.hE<gt>\n"
3602 "#include E<lt>unistd.hE<gt>\n"
3603 "#include E<lt>errno.hE<gt>\n"
3604 msgstr ""
3605 "#include E<lt>pthread.hE<gt>\n"
3606 "#include E<lt>sys/types.hE<gt>\n"
3607 "#include E<lt>stdio.hE<gt>\n"
3608 "#include E<lt>stdlib.hE<gt>\n"
3609 "#include E<lt>unistd.hE<gt>\n"
3610 "#include E<lt>errno.hE<gt>\n"
3611
3612 #. type: Plain text
3613 #: build/C/man3/pthread_cleanup_push.3:241
3614 #, no-wrap
3615 msgid ""
3616 "static int done = 0;\n"
3617 "static int cleanup_pop_arg = 0;\n"
3618 "static int cnt = 0;\n"
3619 msgstr ""
3620 "static int done = 0;\n"
3621 "static int cleanup_pop_arg = 0;\n"
3622 "static int cnt = 0;\n"
3623
3624 #. type: Plain text
3625 #: build/C/man3/pthread_cleanup_push.3:248
3626 #, no-wrap
3627 msgid ""
3628 "static void\n"
3629 "cleanup_handler(void *arg)\n"
3630 "{\n"
3631 "    printf(\"Called clean-up handler\\en\");\n"
3632 "    cnt = 0;\n"
3633 "}\n"
3634 msgstr ""
3635 "static void\n"
3636 "cleanup_handler(void *arg)\n"
3637 "{\n"
3638 "    printf(\"Called clean-up handler\\en\");\n"
3639 "    cnt = 0;\n"
3640 "}\n"
3641
3642 #. type: Plain text
3643 #: build/C/man3/pthread_cleanup_push.3:253
3644 #, no-wrap
3645 msgid ""
3646 "static void *\n"
3647 "thread_start(void *arg)\n"
3648 "{\n"
3649 "    time_t start, curr;\n"
3650 msgstr ""
3651 "static void *\n"
3652 "thread_start(void *arg)\n"
3653 "{\n"
3654 "    time_t start, curr;\n"
3655
3656 #. type: Plain text
3657 #: build/C/man3/pthread_cleanup_push.3:255
3658 #, no-wrap
3659 msgid "    printf(\"New thread started\\en\");\n"
3660 msgstr "    printf(\"New thread started\\en\");\n"
3661
3662 #. type: Plain text
3663 #: build/C/man3/pthread_cleanup_push.3:257
3664 #, no-wrap
3665 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
3666 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
3667
3668 #. type: Plain text
3669 #: build/C/man3/pthread_cleanup_push.3:259
3670 #, no-wrap
3671 msgid "    curr = start = time(NULL);\n"
3672 msgstr "    curr = start = time(NULL);\n"
3673
3674 #. type: Plain text
3675 #: build/C/man3/pthread_cleanup_push.3:268
3676 #, no-wrap
3677 msgid ""
3678 "    while (!done) {\n"
3679 "        pthread_testcancel();           /* A cancellation point */\n"
3680 "        if (curr E<lt> time(NULL)) {\n"
3681 "            curr = time(NULL);\n"
3682 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
3683 "            cnt++;\n"
3684 "        }\n"
3685 "    }\n"
3686 msgstr ""
3687 "    while (!done) {\n"
3688 "        pthread_testcancel();           /* A cancellation point */\n"
3689 "        if (curr E<lt> time(NULL)) {\n"
3690 "            curr = time(NULL);\n"
3691 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
3692 "            cnt++;\n"
3693 "        }\n"
3694 "    }\n"
3695
3696 #. type: Plain text
3697 #: build/C/man3/pthread_cleanup_push.3:272
3698 #, no-wrap
3699 msgid ""
3700 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
3701 "    return NULL;\n"
3702 "}\n"
3703 msgstr ""
3704 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
3705 "    return NULL;\n"
3706 "}\n"
3707
3708 #. type: Plain text
3709 #: build/C/man3/pthread_cleanup_push.3:279
3710 #, no-wrap
3711 msgid ""
3712 "int\n"
3713 "main(int argc, char *argv[])\n"
3714 "{\n"
3715 "    pthread_t thr;\n"
3716 "    int s;\n"
3717 "    void *res;\n"
3718 msgstr ""
3719 "int\n"
3720 "main(int argc, char *argv[])\n"
3721 "{\n"
3722 "    pthread_t thr;\n"
3723 "    int s;\n"
3724 "    void *res;\n"
3725
3726 #. type: Plain text
3727 #: build/C/man3/pthread_cleanup_push.3:283
3728 #, no-wrap
3729 msgid ""
3730 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
3731 "    if (s != 0)\n"
3732 "        handle_error_en(s, \"pthread_create\");\n"
3733 msgstr ""
3734 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
3735 "    if (s != 0)\n"
3736 "        handle_error_en(s, \"pthread_create\");\n"
3737
3738 #. type: Plain text
3739 #: build/C/man3/pthread_cleanup_push.3:285
3740 #, no-wrap
3741 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
3742 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
3743
3744 #. type: Plain text
3745 #: build/C/man3/pthread_cleanup_push.3:290
3746 #, no-wrap
3747 msgid ""
3748 "    if (argc E<gt> 1) {\n"
3749 "        if (argc E<gt> 2)\n"
3750 "            cleanup_pop_arg = atoi(argv[2]);\n"
3751 "        done = 1;\n"
3752 msgstr ""
3753 "    if (argc E<gt> 1) {\n"
3754 "        if (argc E<gt> 2)\n"
3755 "            cleanup_pop_arg = atoi(argv[2]);\n"
3756 "        done = 1;\n"
3757
3758 #. type: Plain text
3759 #: build/C/man3/pthread_cleanup_push.3:297
3760 #, no-wrap
3761 msgid ""
3762 "    } else {\n"
3763 "        printf(\"Canceling thread\\en\");\n"
3764 "        s = pthread_cancel(thr);\n"
3765 "        if (s != 0)\n"
3766 "            handle_error_en(s, \"pthread_cancel\");\n"
3767 "    }\n"
3768 msgstr ""
3769 "    } else {\n"
3770 "        printf(\"Canceling thread\\en\");\n"
3771 "        s = pthread_cancel(thr);\n"
3772 "        if (s != 0)\n"
3773 "            handle_error_en(s, \"pthread_cancel\");\n"
3774 "    }\n"
3775
3776 #. type: Plain text
3777 #: build/C/man3/pthread_cleanup_push.3:308
3778 #, no-wrap
3779 msgid ""
3780 "    if (res == PTHREAD_CANCELED)\n"
3781 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
3782 "    else\n"
3783 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
3784 "    exit(EXIT_SUCCESS);\n"
3785 "}\n"
3786 msgstr ""
3787 "    if (res == PTHREAD_CANCELED)\n"
3788 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
3789 "    else\n"
3790 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
3791 "    exit(EXIT_SUCCESS);\n"
3792 "}\n"
3793
3794 #. type: Plain text
3795 #: build/C/man3/pthread_cleanup_push.3:314
3796 msgid ""
3797 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
3798 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3799 msgstr ""
3800 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
3801 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3802
3803 #. type: TH
3804 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
3805 #, no-wrap
3806 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
3807 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
3808
3809 #. type: TH
3810 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
3811 #, no-wrap
3812 msgid "2008-12-04"
3813 msgstr "2008-12-04"
3814
3815 #. type: Plain text
3816 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
3817 msgid ""
3818 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
3819 "thread cancellation clean-up handlers while saving cancelability type"
3820 msgstr ""
3821
3822 #. type: Plain text
3823 #: build/C/man3/pthread_cleanup_push_defer_np.3:35
3824 #, no-wrap
3825 msgid ""
3826 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
3827 "B<                                   void *>I<arg>B<);>\n"
3828 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
3829 msgstr ""
3830 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
3831 "B<                                   void *>I<arg>B<);>\n"
3832 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
3833
3834 #. type: Plain text
3835 #: build/C/man3/pthread_cleanup_push_defer_np.3:38
3836 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
3837 #: build/C/man3/pthread_join.3:35 build/C/man3/pthread_kill.3:35
3838 #: build/C/man3/pthread_sigmask.3:36 build/C/man3/pthread_sigqueue.3:35
3839 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
3840 msgid "Compile and link with I<-pthread>."
3841 msgstr ""
3842
3843 #. type: Plain text
3844 #: build/C/man3/pthread_cleanup_push_defer_np.3:44
3845 msgid ""
3846 "These functions are the same as B<pthread_cleanup_push>(3)  and "
3847 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
3848 msgstr ""
3849
3850 #. type: Plain text
3851 #: build/C/man3/pthread_cleanup_push_defer_np.3:57
3852 msgid ""
3853 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
3854 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
3855 "addition, it also saves the thread's current cancelability type, and sets "
3856 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
3857 "this ensures that cancellation clean-up will occur even if the thread's "
3858 "cancelability type was \"asynchronous\" before the call."
3859 msgstr ""
3860
3861 #. type: Plain text
3862 #: build/C/man3/pthread_cleanup_push_defer_np.3:66
3863 msgid ""
3864 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
3865 "the top-most clean-up handler from the thread's stack of cancellation clean-"
3866 "up handlers.  In addition, it restores the thread's cancelability type to "
3867 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
3868 msgstr ""
3869
3870 #. type: Plain text
3871 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
3872 msgid ""
3873 "The caller must ensure that calls to these functions are paired within the "
3874 "same function, and at the same lexical nesting level.  Other restrictions "
3875 "apply, as described in B<pthread_cleanup_push>(3)."
3876 msgstr ""
3877
3878 #. type: Plain text
3879 #: build/C/man3/pthread_cleanup_push_defer_np.3:74
3880 msgid "This sequence of calls:"
3881 msgstr ""
3882
3883 #. type: Plain text
3884 #: build/C/man3/pthread_cleanup_push_defer_np.3:79
3885 #, no-wrap
3886 msgid ""
3887 "pthread_cleanup_push_defer_np(routine, arg);\n"
3888 "pthread_cleanup_pop_restore_np(execute);\n"
3889 msgstr ""
3890
3891 #. type: Plain text
3892 #: build/C/man3/pthread_cleanup_push_defer_np.3:83
3893 msgid "is equivalent to (but shorter and more efficient than):"
3894 msgstr ""
3895
3896 #. type: Plain text
3897 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
3898 #, no-wrap
3899 msgid "int oldtype;\n"
3900 msgstr "int oldtype;\n"
3901
3902 #. type: Plain text
3903 #: build/C/man3/pthread_cleanup_push_defer_np.3:95
3904 #, no-wrap
3905 msgid ""
3906 "pthread_cleanup_push(routine, arg);\n"
3907 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
3908 "\\&...\n"
3909 "pthread_setcanceltype(oldtype, NULL);\n"
3910 "pthread_cleanup_pop(execute);\n"
3911 msgstr ""
3912 "pthread_cleanup_push(routine, arg);\n"
3913 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
3914 "\\&...\n"
3915 "pthread_setcanceltype(oldtype, NULL);\n"
3916 "pthread_cleanup_pop(execute);\n"
3917
3918 #. type: Plain text
3919 #: build/C/man3/pthread_cleanup_push_defer_np.3:107
3920 msgid ""
3921 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
3922 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3923 msgstr ""
3924 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
3925 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3926
3927 #. type: TH
3928 #: build/C/man3/pthread_create.3:24
3929 #, no-wrap
3930 msgid "PTHREAD_CREATE"
3931 msgstr "PTHREAD_CREATE"
3932
3933 #. type: Plain text
3934 #: build/C/man3/pthread_create.3:27
3935 msgid "pthread_create - create a new thread"
3936 msgstr ""
3937
3938 #. type: Plain text
3939 #: build/C/man3/pthread_create.3:33
3940 #, no-wrap
3941 msgid ""
3942 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
3943 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
3944 msgstr ""
3945 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
3946 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
3947
3948 #. type: Plain text
3949 #: build/C/man3/pthread_create.3:45
3950 msgid ""
3951 "The B<pthread_create>()  function starts a new thread in the calling "
3952 "process.  The new thread starts execution by invoking I<start_routine>(); "
3953 "I<arg> is passed as the sole argument of I<start_routine>()."
3954 msgstr ""
3955
3956 #. type: Plain text
3957 #: build/C/man3/pthread_create.3:47
3958 msgid "The new thread terminates in one of the following ways:"
3959 msgstr ""
3960
3961 #. type: IP
3962 #: build/C/man3/pthread_create.3:47 build/C/man3/pthread_create.3:53
3963 #: build/C/man3/pthread_create.3:61 build/C/man3/pthread_create.3:64
3964 #: build/C/man3/pthread_getattr_np.3:50 build/C/man3/pthread_getattr_np.3:53
3965 #: build/C/man3/pthread_getattr_np.3:56
3966 #, no-wrap
3967 msgid "*"
3968 msgstr "*"
3969
3970 #. type: Plain text
3971 #: build/C/man3/pthread_create.3:53
3972 msgid ""
3973 "It calls B<pthread_exit>(3), specifying an exit status value that is "
3974 "available to another thread in the same process that calls B<pthread_join>"
3975 "(3)."
3976 msgstr ""
3977
3978 #. type: Plain text
3979 #: build/C/man3/pthread_create.3:61
3980 msgid ""
3981 "It returns from I<start_routine>().  This is equivalent to calling "
3982 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
3983 msgstr ""
3984
3985 #. type: Plain text
3986 #: build/C/man3/pthread_create.3:64
3987 msgid "It is canceled (see B<pthread_cancel>(3))."
3988 msgstr ""
3989
3990 #. type: Plain text
3991 #: build/C/man3/pthread_create.3:70
3992 msgid ""
3993 "Any of the threads in the process calls B<exit>(3), or the main thread "
3994 "performs a return from I<main>().  This causes the termination of all "
3995 "threads in the process."
3996 msgstr ""
3997
3998 #. type: Plain text
3999 #: build/C/man3/pthread_create.3:84
4000 msgid ""
4001 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4002 "are used at thread creation time to determine attributes for the new thread; "
4003 "this structure is initialized using B<pthread_attr_init>(3)  and related "
4004 "functions.  If I<attr> is NULL, then the thread is created with default "
4005 "attributes."
4006 msgstr ""
4007
4008 #. type: Plain text
4009 #: build/C/man3/pthread_create.3:91
4010 msgid ""
4011 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
4012 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4013 "used to refer to the thread in subsequent calls to other pthreads functions."
4014 msgstr ""
4015
4016 #. type: Plain text
4017 #: build/C/man3/pthread_create.3:99
4018 msgid ""
4019 "The new thread inherits a copy of the creating thread's signal mask "
4020 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
4021 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
4022 "thread's alternate signal stack (B<sigaltstack>(2))."
4023 msgstr ""
4024
4025 #. type: Plain text
4026 #: build/C/man3/pthread_create.3:102
4027 msgid ""
4028 "The new thread inherits the calling thread's floating-point environment "
4029 "(B<fenv>(3))."
4030 msgstr ""
4031
4032 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4033 #. type: Plain text
4034 #: build/C/man3/pthread_create.3:107
4035 msgid ""
4036 "The initial value of the new thread's CPU-time clock is 0 (see "
4037 "B<pthread_getcpuclockid>(3))."
4038 msgstr ""
4039
4040 #. type: SS
4041 #: build/C/man3/pthread_create.3:107
4042 #, no-wrap
4043 msgid "Linux-specific details"
4044 msgstr ""
4045
4046 #. type: Plain text
4047 #: build/C/man3/pthread_create.3:113
4048 msgid ""
4049 "The new thread inherits copies of the calling thread's capability sets (see "
4050 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4051 msgstr ""
4052
4053 #. type: Plain text
4054 #: build/C/man3/pthread_create.3:120
4055 msgid ""
4056 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
4057 "number, and the contents of I<*thread> are undefined."
4058 msgstr ""
4059
4060 #. type: TP
4061 #: build/C/man3/pthread_create.3:121 build/C/man3/pthread_sigqueue.3:69
4062 #, no-wrap
4063 msgid "B<EAGAIN>"
4064 msgstr "B<EAGAIN>"
4065
4066 #. type: Plain text
4067 #: build/C/man3/pthread_create.3:135
4068 msgid ""
4069 "Insufficient resources to create another thread, or a system-imposed limit "
4070 "on the number of threads was encountered.  The latter case may occur in two "
4071 "ways: the B<RLIMIT_NPROC> soft resource limit (set via B<setrlimit>(2)), "
4072 "which limits the number of process for a real user ID, was reached; or the "
4073 "kernel's system-wide limit on the number of threads, I</proc/sys/kernel/"
4074 "threads-max>, was reached."
4075 msgstr ""
4076
4077 #. type: Plain text
4078 #: build/C/man3/pthread_create.3:139
4079 msgid "Invalid settings in I<attr>."
4080 msgstr ""
4081
4082 #. type: TP
4083 #: build/C/man3/pthread_create.3:139 build/C/man3/pthread_setschedparam.3:127
4084 #: build/C/man3/pthread_setschedprio.3:64
4085 #, no-wrap
4086 msgid "B<EPERM>"
4087 msgstr "B<EPERM>"
4088
4089 #. type: Plain text
4090 #: build/C/man3/pthread_create.3:144
4091 msgid ""
4092 "No permission to set the scheduling policy and parameters specified in "
4093 "I<attr>."
4094 msgstr ""
4095
4096 #. type: Plain text
4097 #: build/C/man3/pthread_create.3:158
4098 msgid ""
4099 "See B<pthread_self>(3)  for further information on the thread ID returned in "
4100 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
4101 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4102 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4103 msgstr ""
4104
4105 #. type: Plain text
4106 #: build/C/man3/pthread_create.3:178
4107 msgid ""
4108 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
4109 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
4110 "terminate and fetch its exit status.  Only when a terminated joinable thread "
4111 "has been joined are the last of its resources released back to the system.  "
4112 "When a detached thread terminates, its resources are automatically released "
4113 "back to the system: it is not possible to join with the thread in order to "
4114 "obtain its exit status.  Making a thread detached is useful for some types "
4115 "of daemon threads whose exit status the application does not need to care "
4116 "about.  By default, a new thread is created in a joinable state, unless "
4117 "I<attr> was set to create the thread in a detached state (using "
4118 "B<pthread_attr_setdetachstate>(3))."
4119 msgstr ""
4120
4121 #.  FIXME . Perhaps some of the following detail should be in
4122 #.  a future pthread_attr_setstacksize(3) page.
4123 #. type: Plain text
4124 #: build/C/man3/pthread_create.3:194
4125 msgid ""
4126 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
4127 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
4128 "resource limit I<at the time the program started> has any value other than "
4129 "\"unlimited\", then it determines the default stack size of new threads.  "
4130 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
4131 "explicitly set in the I<attr> argument used to create a thread, in order to "
4132 "obtain a stack size other than the default."
4133 msgstr ""
4134
4135 #. type: Plain text
4136 #: build/C/man3/pthread_create.3:200
4137 msgid ""
4138 "In the obsolete LinuxThreads implementation, each of the threads in a "
4139 "process has a different process ID.  This is in violation of the POSIX "
4140 "threads specification, and is the source of many other nonconformances to "
4141 "the standard; see B<pthreads>(7)."
4142 msgstr ""
4143
4144 #. type: Plain text
4145 #: build/C/man3/pthread_create.3:204
4146 msgid ""
4147 "The program below demonstrates the use of B<pthread_create>(), as well as a "
4148 "number of other functions in the pthreads API."
4149 msgstr ""
4150
4151 #. type: Plain text
4152 #: build/C/man3/pthread_create.3:209
4153 msgid ""
4154 "In the following run, on a system providing the NPTL threading "
4155 "implementation, the stack size defaults to the value given by the \"stack "
4156 "size\" resource limit:"
4157 msgstr ""
4158
4159 #. type: Plain text
4160 #: build/C/man3/pthread_create.3:221
4161 #, no-wrap
4162 msgid ""
4163 "$B< ulimit -s>\n"
4164 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
4165 "$B< ./a.out hola salut servus>\n"
4166 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4167 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4168 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4169 "Joined with thread 1; returned value was HOLA\n"
4170 "Joined with thread 2; returned value was SALUT\n"
4171 "Joined with thread 3; returned value was SERVUS\n"
4172 msgstr ""
4173 "$B< ulimit -s>\n"
4174 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
4175 "$B< ./a.out hola salut servus>\n"
4176 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4177 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4178 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4179 "Joined with thread 1; returned value was HOLA\n"
4180 "Joined with thread 2; returned value was SALUT\n"
4181 "Joined with thread 3; returned value was SERVUS\n"
4182
4183 #. type: Plain text
4184 #: build/C/man3/pthread_create.3:227
4185 msgid ""
4186 "In the next run, the program explicitly sets a stack size of 1MB (using "
4187 "B<pthread_attr_setstacksize>(3))  for the created threads:"
4188 msgstr ""
4189
4190 #. type: Plain text
4191 #: build/C/man3/pthread_create.3:237
4192 #, no-wrap
4193 msgid ""
4194 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4195 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4196 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4197 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4198 "Joined with thread 1; returned value was HOLA\n"
4199 "Joined with thread 2; returned value was SALUT\n"
4200 "Joined with thread 3; returned value was SERVUS\n"
4201 msgstr ""
4202 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4203 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4204 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4205 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4206 "Joined with thread 1; returned value was HOLA\n"
4207 "Joined with thread 2; returned value was SALUT\n"
4208 "Joined with thread 3; returned value was SERVUS\n"
4209
4210 #. type: Plain text
4211 #: build/C/man3/pthread_create.3:249
4212 #, no-wrap
4213 msgid ""
4214 "#include E<lt>pthread.hE<gt>\n"
4215 "#include E<lt>string.hE<gt>\n"
4216 "#include E<lt>stdio.hE<gt>\n"
4217 "#include E<lt>stdlib.hE<gt>\n"
4218 "#include E<lt>unistd.hE<gt>\n"
4219 "#include E<lt>errno.hE<gt>\n"
4220 "#include E<lt>ctype.hE<gt>\n"
4221 msgstr ""
4222 "#include E<lt>pthread.hE<gt>\n"
4223 "#include E<lt>string.hE<gt>\n"
4224 "#include E<lt>stdio.hE<gt>\n"
4225 "#include E<lt>stdlib.hE<gt>\n"
4226 "#include E<lt>unistd.hE<gt>\n"
4227 "#include E<lt>errno.hE<gt>\n"
4228 "#include E<lt>ctype.hE<gt>\n"
4229
4230 #. type: Plain text
4231 #: build/C/man3/pthread_create.3:255 build/C/man3/pthread_getcpuclockid.3:108
4232 #, no-wrap
4233 msgid ""
4234 "#define handle_error(msg) \\e\n"
4235 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4236 msgstr ""
4237 "#define handle_error(msg) \\e\n"
4238 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4239
4240 #. type: Plain text
4241 #: build/C/man3/pthread_create.3:261
4242 #, no-wrap
4243 msgid ""
4244 "struct thread_info {    /* Used as argument to thread_start() */\n"
4245 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4246 "    int       thread_num;       /* Application-defined thread # */\n"
4247 "    char     *argv_string;      /* From command-line argument */\n"
4248 "};\n"
4249 msgstr ""
4250 "struct thread_info {    /* Used as argument to thread_start() */\n"
4251 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4252 "    int       thread_num;       /* Application-defined thread # */\n"
4253 "    char     *argv_string;      /* From command-line argument */\n"
4254 "};\n"
4255
4256 #. type: Plain text
4257 #: build/C/man3/pthread_create.3:264
4258 #, no-wrap
4259 msgid ""
4260 "/* Thread start function: display address near top of our stack,\n"
4261 "   and return upper-cased copy of argv_string */\n"
4262 msgstr ""
4263 "/* Thread start function: display address near top of our stack,\n"
4264 "   and return upper-cased copy of argv_string */\n"
4265
4266 #. type: Plain text
4267 #: build/C/man3/pthread_create.3:270
4268 #, no-wrap
4269 msgid ""
4270 "static void *\n"
4271 "thread_start(void *arg)\n"
4272 "{\n"
4273 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
4274 "    char *uargv, *p;\n"
4275 msgstr ""
4276 "static void *\n"
4277 "thread_start(void *arg)\n"
4278 "{\n"
4279 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
4280 "    char *uargv, *p;\n"
4281
4282 #. type: Plain text
4283 #: build/C/man3/pthread_create.3:273
4284 #, no-wrap
4285 msgid ""
4286 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4287 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4288 msgstr ""
4289 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4290 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4291
4292 #. type: Plain text
4293 #: build/C/man3/pthread_create.3:277
4294 #, no-wrap
4295 msgid ""
4296 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4297 "    if (uargv == NULL)\n"
4298 "        handle_error(\"strdup\");\n"
4299 msgstr ""
4300 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4301 "    if (uargv == NULL)\n"
4302 "        handle_error(\"strdup\");\n"
4303
4304 #. type: Plain text
4305 #: build/C/man3/pthread_create.3:280
4306 #, no-wrap
4307 msgid ""
4308 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4309 "        *p = toupper(*p);\n"
4310 msgstr ""
4311 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4312 "        *p = toupper(*p);\n"
4313
4314 #. type: Plain text
4315 #: build/C/man3/pthread_create.3:283
4316 #, no-wrap
4317 msgid ""
4318 "    return uargv;\n"
4319 "}\n"
4320 msgstr ""
4321 "    return uargv;\n"
4322 "}\n"
4323
4324 #. type: Plain text
4325 #: build/C/man3/pthread_create.3:292
4326 #, no-wrap
4327 msgid ""
4328 "int\n"
4329 "main(int argc, char *argv[])\n"
4330 "{\n"
4331 "    int s, tnum, opt, num_threads;\n"
4332 "    struct thread_info *tinfo;\n"
4333 "    pthread_attr_t attr;\n"
4334 "    int stack_size;\n"
4335 "    void *res;\n"
4336 msgstr ""
4337 "int\n"
4338 "main(int argc, char *argv[])\n"
4339 "{\n"
4340 "    int s, tnum, opt, num_threads;\n"
4341 "    struct thread_info *tinfo;\n"
4342 "    pthread_attr_t attr;\n"
4343 "    int stack_size;\n"
4344 "    void *res;\n"
4345
4346 #. type: Plain text
4347 #: build/C/man3/pthread_create.3:294
4348 #, no-wrap
4349 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
4350 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
4351
4352 #. type: Plain text
4353 #: build/C/man3/pthread_create.3:301
4354 #, no-wrap
4355 msgid ""
4356 "    stack_size = -1;\n"
4357 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4358 "        switch (opt) {\n"
4359 "        case \\(aqs\\(aq:\n"
4360 "            stack_size = strtoul(optarg, NULL, 0);\n"
4361 "            break;\n"
4362 msgstr ""
4363 "    stack_size = -1;\n"
4364 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4365 "        switch (opt) {\n"
4366 "        case \\(aqs\\(aq:\n"
4367 "            stack_size = strtoul(optarg, NULL, 0);\n"
4368 "            break;\n"
4369
4370 #. type: Plain text
4371 #: build/C/man3/pthread_create.3:308
4372 #, no-wrap
4373 msgid ""
4374 "        default:\n"
4375 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4376 "                    argv[0]);\n"
4377 "            exit(EXIT_FAILURE);\n"
4378 "        }\n"
4379 "    }\n"
4380 msgstr ""
4381 "        default:\n"
4382 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4383 "                    argv[0]);\n"
4384 "            exit(EXIT_FAILURE);\n"
4385 "        }\n"
4386 "    }\n"
4387
4388 #. type: Plain text
4389 #: build/C/man3/pthread_create.3:310
4390 #, no-wrap
4391 msgid "    num_threads = argc - optind;\n"
4392 msgstr "    num_threads = argc - optind;\n"
4393
4394 #. type: Plain text
4395 #: build/C/man3/pthread_create.3:312
4396 #, no-wrap
4397 msgid "    /* Initialize thread creation attributes */\n"
4398 msgstr "    /* Initialize thread creation attributes */\n"
4399
4400 #. type: Plain text
4401 #: build/C/man3/pthread_create.3:316
4402 #, no-wrap
4403 msgid ""
4404 "    s = pthread_attr_init(&attr);\n"
4405 "    if (s != 0)\n"
4406 "        handle_error_en(s, \"pthread_attr_init\");\n"
4407 msgstr ""
4408 "    s = pthread_attr_init(&attr);\n"
4409 "    if (s != 0)\n"
4410 "        handle_error_en(s, \"pthread_attr_init\");\n"
4411
4412 #. type: Plain text
4413 #: build/C/man3/pthread_create.3:322
4414 #, no-wrap
4415 msgid ""
4416 "    if (stack_size E<gt> 0) {\n"
4417 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4418 "        if (s != 0)\n"
4419 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4420 "    }\n"
4421 msgstr ""
4422 "    if (stack_size E<gt> 0) {\n"
4423 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4424 "        if (s != 0)\n"
4425 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4426 "    }\n"
4427
4428 #. type: Plain text
4429 #: build/C/man3/pthread_create.3:324
4430 #, no-wrap
4431 msgid "    /* Allocate memory for pthread_create() arguments */\n"
4432 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
4433
4434 #. type: Plain text
4435 #: build/C/man3/pthread_create.3:328
4436 #, no-wrap
4437 msgid ""
4438 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4439 "    if (tinfo == NULL)\n"
4440 "        handle_error(\"calloc\");\n"
4441 msgstr ""
4442 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4443 "    if (tinfo == NULL)\n"
4444 "        handle_error(\"calloc\");\n"
4445
4446 #. type: Plain text
4447 #: build/C/man3/pthread_create.3:330
4448 #, no-wrap
4449 msgid "    /* Create one thread for each command-line argument */\n"
4450 msgstr "    /* Create one thread for each command-line argument */\n"
4451
4452 #. type: Plain text
4453 #: build/C/man3/pthread_create.3:334
4454 #, no-wrap
4455 msgid ""
4456 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4457 "        tinfo[tnum].thread_num = tnum + 1;\n"
4458 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4459 msgstr ""
4460 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4461 "        tinfo[tnum].thread_num = tnum + 1;\n"
4462 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4463
4464 #. type: Plain text
4465 #: build/C/man3/pthread_create.3:337
4466 #, no-wrap
4467 msgid ""
4468 "        /* The pthread_create() call stores the thread ID into\n"
4469 "           corresponding element of tinfo[] */\n"
4470 msgstr ""
4471 "        /* The pthread_create() call stores the thread ID into\n"
4472 "           corresponding element of tinfo[] */\n"
4473
4474 #. type: Plain text
4475 #: build/C/man3/pthread_create.3:343
4476 #, no-wrap
4477 msgid ""
4478 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4479 "                           &thread_start, &tinfo[tnum]);\n"
4480 "        if (s != 0)\n"
4481 "            handle_error_en(s, \"pthread_create\");\n"
4482 "    }\n"
4483 msgstr ""
4484 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4485 "                           &thread_start, &tinfo[tnum]);\n"
4486 "        if (s != 0)\n"
4487 "            handle_error_en(s, \"pthread_create\");\n"
4488 "    }\n"
4489
4490 #. type: Plain text
4491 #: build/C/man3/pthread_create.3:346
4492 #, no-wrap
4493 msgid ""
4494 "    /* Destroy the thread attributes object, since it is no\n"
4495 "       longer needed */\n"
4496 msgstr ""
4497 "    /* Destroy the thread attributes object, since it is no\n"
4498 "       longer needed */\n"
4499
4500 #. type: Plain text
4501 #: build/C/man3/pthread_create.3:350 build/C/man3/pthread_setschedparam.3:421
4502 #, no-wrap
4503 msgid ""
4504 "    s = pthread_attr_destroy(&attr);\n"
4505 "    if (s != 0)\n"
4506 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4507 msgstr ""
4508 "    s = pthread_attr_destroy(&attr);\n"
4509 "    if (s != 0)\n"
4510 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4511
4512 #. type: Plain text
4513 #: build/C/man3/pthread_create.3:352
4514 #, no-wrap
4515 msgid "    /* Now join with each thread, and display its returned value */\n"
4516 msgstr "    /* Now join with each thread, and display its returned value */\n"
4517
4518 #. type: Plain text
4519 #: build/C/man3/pthread_create.3:357
4520 #, no-wrap
4521 msgid ""
4522 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4523 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4524 "        if (s != 0)\n"
4525 "            handle_error_en(s, \"pthread_join\");\n"
4526 msgstr ""
4527 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4528 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4529 "        if (s != 0)\n"
4530 "            handle_error_en(s, \"pthread_join\");\n"
4531
4532 #. type: Plain text
4533 #: build/C/man3/pthread_create.3:362
4534 #, no-wrap
4535 msgid ""
4536 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4537 "                tinfo[tnum].thread_num, (char *) res);\n"
4538 "        free(res);      /* Free memory allocated by thread */\n"
4539 "    }\n"
4540 msgstr ""
4541 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4542 "                tinfo[tnum].thread_num, (char *) res);\n"
4543 "        free(res);      /* Free memory allocated by thread */\n"
4544 "    }\n"
4545
4546 #. type: Plain text
4547 #: build/C/man3/pthread_create.3:366
4548 #, no-wrap
4549 msgid ""
4550 "    free(tinfo);\n"
4551 "    exit(EXIT_SUCCESS);\n"
4552 "}\n"
4553 msgstr ""
4554 "    free(tinfo);\n"
4555 "    exit(EXIT_SUCCESS);\n"
4556 "}\n"
4557
4558 #. type: Plain text
4559 #: build/C/man3/pthread_create.3:377
4560 msgid ""
4561 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
4562 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
4563 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
4564 "(7)"
4565 msgstr ""
4566 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
4567 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
4568 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
4569 "(7)"
4570
4571 #. type: TH
4572 #: build/C/man3/pthread_detach.3:24
4573 #, no-wrap
4574 msgid "PTHREAD_DETACH"
4575 msgstr "PTHREAD_DETACH"
4576
4577 #. type: TH
4578 #: build/C/man3/pthread_detach.3:24 build/C/man3/pthread_join.3:24
4579 #, no-wrap
4580 msgid "2008-11-27"
4581 msgstr "2008-11-27"
4582
4583 #. type: Plain text
4584 #: build/C/man3/pthread_detach.3:27
4585 msgid "pthread_detach - detach a thread"
4586 msgstr ""
4587
4588 #. type: Plain text
4589 #: build/C/man3/pthread_detach.3:32
4590 #, no-wrap
4591 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
4592 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
4593
4594 #. type: Plain text
4595 #: build/C/man3/pthread_detach.3:44
4596 msgid ""
4597 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
4598 "as detached.  When a detached thread terminates, its resources are "
4599 "automatically released back to the system without the need for another "
4600 "thread to join with the terminated thread."
4601 msgstr ""
4602
4603 #. type: Plain text
4604 #: build/C/man3/pthread_detach.3:47
4605 msgid ""
4606 "Attempting to detach an already detached thread results in unspecified "
4607 "behavior."
4608 msgstr ""
4609
4610 #. type: Plain text
4611 #: build/C/man3/pthread_detach.3:52
4612 msgid ""
4613 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
4614 "number."
4615 msgstr ""
4616
4617 #. type: Plain text
4618 #: build/C/man3/pthread_detach.3:57 build/C/man3/pthread_join.3:87
4619 msgid "I<thread> is not a joinable thread."
4620 msgstr ""
4621
4622 #. type: Plain text
4623 #: build/C/man3/pthread_detach.3:68
4624 msgid ""
4625 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
4626 "or be made joinable again."
4627 msgstr ""
4628
4629 #. type: Plain text
4630 #: build/C/man3/pthread_detach.3:75
4631 msgid ""
4632 "A new thread can be created in a detached state using "
4633 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
4634 "I<attr> argument of B<pthread_create>(3)."
4635 msgstr ""
4636
4637 #. type: Plain text
4638 #: build/C/man3/pthread_detach.3:82
4639 msgid ""
4640 "The detached attribute merely determines the behavior of the system when the "
4641 "thread terminates; it does not prevent the thread from being terminated if "
4642 "the process terminates using B<exit>(3)  (or equivalently, if the main "
4643 "thread returns)."
4644 msgstr ""
4645
4646 #. type: Plain text
4647 #: build/C/man3/pthread_detach.3:91
4648 msgid ""
4649 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
4650 "thread that an application creates, so that system resources for the thread "
4651 "can be released.  (But note that the resources of all threads are freed when "
4652 "the process terminates.)"
4653 msgstr ""
4654
4655 #. type: Plain text
4656 #: build/C/man3/pthread_detach.3:93
4657 msgid "The following statement detaches the calling thread:"
4658 msgstr ""
4659
4660 #. type: Plain text
4661 #: build/C/man3/pthread_detach.3:95
4662 #, no-wrap
4663 msgid "    pthread_detach(pthread_self());\n"
4664 msgstr "    pthread_detach(pthread_self());\n"
4665
4666 #. type: Plain text
4667 #: build/C/man3/pthread_detach.3:101
4668 msgid ""
4669 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
4670 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
4671 msgstr ""
4672 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
4673 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
4674
4675 #. type: TH
4676 #: build/C/man3/pthread_equal.3:24
4677 #, no-wrap
4678 msgid "PTHREAD_EQUAL"
4679 msgstr "PTHREAD_EQUAL"
4680
4681 #. type: TH
4682 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
4683 #, no-wrap
4684 msgid "2009-03-30"
4685 msgstr "2009-03-30"
4686
4687 #. type: Plain text
4688 #: build/C/man3/pthread_equal.3:27
4689 msgid "pthread_equal - compare thread IDs"
4690 msgstr ""
4691
4692 #. type: Plain text
4693 #: build/C/man3/pthread_equal.3:32
4694 #, no-wrap
4695 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
4696 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
4697
4698 #. type: Plain text
4699 #: build/C/man3/pthread_equal.3:39
4700 msgid "The B<pthread_equal>()  function compares two thread identifiers."
4701 msgstr ""
4702
4703 #. type: Plain text
4704 #: build/C/man3/pthread_equal.3:43
4705 msgid ""
4706 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
4707 "value; otherwise, it returns 0."
4708 msgstr ""
4709
4710 #.  SH VERSIONS
4711 #.  Available since glibc 2.0
4712 #. type: Plain text
4713 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
4714 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_testcancel.3:56
4715 msgid "This function always succeeds."
4716 msgstr ""
4717
4718 #. type: Plain text
4719 #: build/C/man3/pthread_equal.3:54
4720 msgid ""
4721 "The B<pthread_equal>()  function is necessary because thread IDs should be "
4722 "considered opaque: there is no portable way for applications to directly "
4723 "compare two I<pthread_t> values."
4724 msgstr ""
4725
4726 #. type: Plain text
4727 #: build/C/man3/pthread_equal.3:57
4728 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
4729 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
4730
4731 #. type: TH
4732 #: build/C/man3/pthread_exit.3:24
4733 #, no-wrap
4734 msgid "PTHREAD_EXIT"
4735 msgstr "PTHREAD_EXIT"
4736
4737 #. type: Plain text
4738 #: build/C/man3/pthread_exit.3:27
4739 msgid "pthread_exit - terminate calling thread"
4740 msgstr ""
4741
4742 #. type: Plain text
4743 #: build/C/man3/pthread_exit.3:32
4744 #, no-wrap
4745 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
4746 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
4747
4748 #. type: Plain text
4749 #: build/C/man3/pthread_exit.3:43
4750 msgid ""
4751 "The B<pthread_exit>()  function terminates the calling thread and returns a "
4752 "value via I<retval> that (if the thread is joinable)  is available to "
4753 "another thread in the same process that calls B<pthread_join>(3)."
4754 msgstr ""
4755
4756 #. type: Plain text
4757 #: build/C/man3/pthread_exit.3:53
4758 msgid ""
4759 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
4760 "not yet been popped, are popped (in the reverse of the order in which they "
4761 "were pushed)  and executed.  If the thread has any thread-specific data, "
4762 "then, after the clean-up handlers have been executed, the corresponding "
4763 "destructor functions are called, in an unspecified order."
4764 msgstr ""
4765
4766 #. type: Plain text
4767 #: build/C/man3/pthread_exit.3:60
4768 msgid ""
4769 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
4770 "variables, semaphores, and file descriptors) are not released, and functions "
4771 "registered using B<atexit>(3)  are not called."
4772 msgstr ""
4773
4774 #. type: Plain text
4775 #: build/C/man3/pthread_exit.3:69
4776 msgid ""
4777 "After the last thread in a process terminates, the process terminates as by "
4778 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
4779 "resources are released and functions registered using B<atexit>(3)  are "
4780 "called."
4781 msgstr ""
4782
4783 #. type: Plain text
4784 #: build/C/man3/pthread_exit.3:71
4785 msgid "This function does not return to the caller."
4786 msgstr ""
4787
4788 #. type: Plain text
4789 #: build/C/man3/pthread_exit.3:80
4790 msgid ""
4791 "Performing a return from the start function of any thread other than the "
4792 "main thread results in an implicit call to B<pthread_exit>(), using the "
4793 "function's return value as the thread's exit status."
4794 msgstr ""
4795
4796 #. type: Plain text
4797 #: build/C/man3/pthread_exit.3:86
4798 msgid ""
4799 "To allow other threads to continue execution, the main thread should "
4800 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
4801 msgstr ""
4802
4803 #. type: Plain text
4804 #: build/C/man3/pthread_exit.3:91
4805 msgid ""
4806 "The value pointed to by I<retval> should not be located on the calling "
4807 "thread's stack, since the contents of that stack are undefined after the "
4808 "thread terminates."
4809 msgstr ""
4810
4811 #.  Linux 2.6.27
4812 #.  FIXME . review a later kernel to see if this gets fixed
4813 #.  http://thread.gmane.org/gmane.linux.kernel/611611
4814 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
4815 #. type: Plain text
4816 #: build/C/man3/pthread_exit.3:103
4817 msgid ""
4818 "Currently, there are limitations in the kernel implementation logic for "
4819 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
4820 "This can manifest in problems such as a locked terminal if a stop signal is "
4821 "sent to a foreground process whose thread group leader has already called "
4822 "B<pthread_exit>()."
4823 msgstr ""
4824
4825 #. type: Plain text
4826 #: build/C/man3/pthread_exit.3:106
4827 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
4828 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
4829
4830 #. type: TH
4831 #: build/C/man3/pthread_getattr_np.3:24
4832 #, no-wrap
4833 msgid "PTHREAD_GETATTR_NP"
4834 msgstr "PTHREAD_GETATTR_NP"
4835
4836 #. type: Plain text
4837 #: build/C/man3/pthread_getattr_np.3:27
4838 msgid "pthread_getattr_np - get attributes of created thread"
4839 msgstr ""
4840
4841 #. type: Plain text
4842 #: build/C/man3/pthread_getattr_np.3:33
4843 #, no-wrap
4844 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
4845 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
4846
4847 #. type: Plain text
4848 #: build/C/man3/pthread_getattr_np.3:43
4849 msgid ""
4850 "The B<pthread_getattr_np>()  function initializes the thread attributes "
4851 "object referred to by I<attr> so that it contains actual attribute values "
4852 "describing the running thread I<thread>."
4853 msgstr ""
4854
4855 #. type: Plain text
4856 #: build/C/man3/pthread_getattr_np.3:50
4857 msgid ""
4858 "The returned attribute values may differ from the corresponding attribute "
4859 "values passed in the I<attr> object that was used to create the thread using "
4860 "B<pthread_create>(3).  In particular, the following attributes may differ:"
4861 msgstr ""
4862
4863 #. type: Plain text
4864 #: build/C/man3/pthread_getattr_np.3:53
4865 msgid ""
4866 "the detach state, since a joinable thread may have detached itself after "
4867 "creation;"
4868 msgstr ""
4869
4870 #. type: Plain text
4871 #: build/C/man3/pthread_getattr_np.3:56
4872 msgid ""
4873 "the stack size, which the implementation may align to a suitable boundary."
4874 msgstr ""
4875
4876 #. type: Plain text
4877 #: build/C/man3/pthread_getattr_np.3:61
4878 msgid ""
4879 "and the guard size, which the implementation may round upward to a multiple "
4880 "of the page size, or ignore (i.e., treat as 0), if the application is "
4881 "allocating its own stack."
4882 msgstr ""
4883
4884 #. type: Plain text
4885 #: build/C/man3/pthread_getattr_np.3:66
4886 msgid ""
4887 "Furthermore, if the stack address attribute was not set in the thread "
4888 "attributes object used to create the thread, then the returned thread "
4889 "attributes object will report the actual stack address that the "
4890 "implementation selected for the thread."
4891 msgstr ""
4892
4893 #. type: Plain text
4894 #: build/C/man3/pthread_getattr_np.3:71
4895 msgid ""
4896 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
4897 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
4898 msgstr ""
4899
4900 #. type: Plain text
4901 #: build/C/man3/pthread_getattr_np.3:74
4902 #: build/C/man3/pthread_getcpuclockid.3:47
4903 msgid ""
4904 "On success, this function returns 0; on error, it returns a nonzero error "
4905 "number."
4906 msgstr ""
4907
4908 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
4909 #. type: Plain text
4910 #: build/C/man3/pthread_getattr_np.3:79
4911 msgid "Insufficient memory."
4912 msgstr ""
4913
4914 #. type: Plain text
4915 #: build/C/man3/pthread_getattr_np.3:94
4916 msgid ""
4917 "In addition, if I<thread> refers to the main thread, then "
4918 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
4919 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and B<getrlimit>"
4920 "(2), if the B<RLIMIT_STACK> resource limit is not supported."
4921 msgstr ""
4922
4923 #. type: Plain text
4924 #: build/C/man3/pthread_getattr_np.3:96
4925 msgid "This function is available in glibc since version 2.2.3."
4926 msgstr ""
4927
4928 #. type: Plain text
4929 #: build/C/man3/pthread_getattr_np.3:99
4930 #: build/C/man3/pthread_kill_other_threads_np.3:48
4931 msgid ""
4932 "This function is a nonstandard GNU extension; hence the suffix \"_np"
4933 "\" (nonportable) in the name."
4934 msgstr ""
4935
4936 #. type: Plain text
4937 #: build/C/man3/pthread_getattr_np.3:109
4938 msgid ""
4939 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
4940 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
4941 "and display its guard size, stack address, and stack size attributes.  "
4942 "Command-line arguments can be used to set these attributes to values other "
4943 "than the default when creating the thread.  The shell sessions below "
4944 "demonstrate the use of the program."
4945 msgstr ""
4946
4947 #. type: Plain text
4948 #: build/C/man3/pthread_getattr_np.3:112
4949 msgid ""
4950 "In the first run, on an x86-32 system, a thread is created using default "
4951 "attributes:"
4952 msgstr ""
4953
4954 #. type: Plain text
4955 #: build/C/man3/pthread_getattr_np.3:122
4956 #, no-wrap
4957 msgid ""
4958 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
4959 "unlimited\n"
4960 "$B< ./a.out>\n"
4961 "Attributes of created thread:\n"
4962 "        Guard size          = 4096 bytes\n"
4963 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
4964 "        Stack size          = 0x201000 (2101248) bytes\n"
4965 msgstr ""
4966 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
4967 "unlimited\n"
4968 "$B< ./a.out>\n"
4969 "Attributes of created thread:\n"
4970 "        Guard size          = 4096 bytes\n"
4971 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
4972 "        Stack size          = 0x201000 (2101248) bytes\n"
4973
4974 #. type: Plain text
4975 #: build/C/man3/pthread_getattr_np.3:128
4976 msgid ""
4977 "In the following run, we see that if a guard size is specified, it is "
4978 "rounded up to the next multiple of the system page size (4096 bytes on "
4979 "x86-32):"
4980 msgstr ""
4981
4982 #. type: Plain text
4983 #: build/C/man3/pthread_getattr_np.3:136
4984 #, no-wrap
4985 msgid ""
4986 "$B< ./a.out -g 4097>\n"
4987 "Thread attributes object after initializations:\n"
4988 "        Guard size          = 4097 bytes\n"
4989 "        Stack address       = (nil)\n"
4990 "        Stack size          = 0x0 (0) bytes\n"
4991 msgstr ""
4992 "$B< ./a.out -g 4097>\n"
4993 "Thread attributes object after initializations:\n"
4994 "        Guard size          = 4097 bytes\n"
4995 "        Stack address       = (nil)\n"
4996 "        Stack size          = 0x0 (0) bytes\n"
4997
4998 #. type: Plain text
4999 #: build/C/man3/pthread_getattr_np.3:141
5000 #, no-wrap
5001 msgid ""
5002 "Attributes of created thread:\n"
5003 "        Guard size          = 8192 bytes\n"
5004 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5005 "        Stack size          = 0x201000 (2101248) bytes\n"
5006 msgstr ""
5007 "Attributes of created thread:\n"
5008 "        Guard size          = 8192 bytes\n"
5009 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5010 "        Stack size          = 0x201000 (2101248) bytes\n"
5011
5012 #. .in +4n
5013 #. .nf
5014 #. $ ./a.out \-s 0x8000
5015 #. Thread attributes object after initializations:
5016 #.         Guard size          = 4096 bytes
5017 #.         Stack address       = 0xffff8000 (EOS = (nil))
5018 #.         Stack size          = 0x8000 (32768) bytes
5019 #. Attributes of created thread:
5020 #.         Guard size          = 4096 bytes
5021 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
5022 #.         Stack size          = 0x8000 (32768) bytes
5023 #. .fi
5024 #. .in
5025 #. type: Plain text
5026 #: build/C/man3/pthread_getattr_np.3:160
5027 msgid ""
5028 "In the last run, the program manually allocates a stack for the thread.  In "
5029 "this case, the guard size attribute is ignored."
5030 msgstr ""
5031
5032 #. type: Plain text
5033 #: build/C/man3/pthread_getattr_np.3:165
5034 #, no-wrap
5035 msgid ""
5036 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5037 "Allocated thread stack at 0x804d000\n"
5038 msgstr ""
5039 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5040 "Allocated thread stack at 0x804d000\n"
5041
5042 #. type: Plain text
5043 #: build/C/man3/pthread_getattr_np.3:170
5044 #, no-wrap
5045 msgid ""
5046 "Thread attributes object after initializations:\n"
5047 "        Guard size          = 4096 bytes\n"
5048 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5049 "        Stack size          = 0x8000 (32768) bytes\n"
5050 msgstr ""
5051 "Thread attributes object after initializations:\n"
5052 "        Guard size          = 4096 bytes\n"
5053 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5054 "        Stack size          = 0x8000 (32768) bytes\n"
5055
5056 #. type: Plain text
5057 #: build/C/man3/pthread_getattr_np.3:175
5058 #, no-wrap
5059 msgid ""
5060 "Attributes of created thread:\n"
5061 "        Guard size          = 0 bytes\n"
5062 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5063 "        Stack size          = 0x8000 (32768) bytes\n"
5064 msgstr ""
5065 "Attributes of created thread:\n"
5066 "        Guard size          = 0 bytes\n"
5067 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5068 "        Stack size          = 0x8000 (32768) bytes\n"
5069
5070 #. type: Plain text
5071 #: build/C/man3/pthread_getattr_np.3:196
5072 #, no-wrap
5073 msgid ""
5074 "static void\n"
5075 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5076 "{\n"
5077 "    int s;\n"
5078 "    size_t stack_size, guard_size;\n"
5079 "    void *stack_addr;\n"
5080 msgstr ""
5081 "static void\n"
5082 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5083 "{\n"
5084 "    int s;\n"
5085 "    size_t stack_size, guard_size;\n"
5086 "    void *stack_addr;\n"
5087
5088 #. type: Plain text
5089 #: build/C/man3/pthread_getattr_np.3:201
5090 #, no-wrap
5091 msgid ""
5092 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5093 "    if (s != 0)\n"
5094 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5095 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5096 msgstr ""
5097 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5098 "    if (s != 0)\n"
5099 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5100 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5101
5102 #. type: Plain text
5103 #: build/C/man3/pthread_getattr_np.3:212
5104 #, no-wrap
5105 msgid ""
5106 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5107 "    if (s != 0)\n"
5108 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5109 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5110 "    if (stack_size E<gt> 0)\n"
5111 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5112 "    printf(\"\\en\");\n"
5113 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5114 "            prefix, stack_size, stack_size);\n"
5115 "}\n"
5116 msgstr ""
5117 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5118 "    if (s != 0)\n"
5119 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5120 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5121 "    if (stack_size E<gt> 0)\n"
5122 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5123 "    printf(\"\\en\");\n"
5124 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5125 "            prefix, stack_size, stack_size);\n"
5126 "}\n"
5127
5128 #. type: Plain text
5129 #: build/C/man3/pthread_getattr_np.3:218
5130 #, no-wrap
5131 msgid ""
5132 "static void\n"
5133 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5134 "{\n"
5135 "    int s;\n"
5136 "    pthread_attr_t attr;\n"
5137 msgstr ""
5138 "static void\n"
5139 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5140 "{\n"
5141 "    int s;\n"
5142 "    pthread_attr_t attr;\n"
5143
5144 #. type: Plain text
5145 #: build/C/man3/pthread_getattr_np.3:222
5146 #, no-wrap
5147 msgid ""
5148 "    s = pthread_getattr_np(thread, &attr);\n"
5149 "    if (s != 0)\n"
5150 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5151 msgstr ""
5152 "    s = pthread_getattr_np(thread, &attr);\n"
5153 "    if (s != 0)\n"
5154 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5155
5156 #. type: Plain text
5157 #: build/C/man3/pthread_getattr_np.3:224
5158 #, no-wrap
5159 msgid "    display_stack_related_attributes(&attr, prefix);\n"
5160 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
5161
5162 #. type: Plain text
5163 #: build/C/man3/pthread_getattr_np.3:229
5164 #, no-wrap
5165 msgid ""
5166 "    s = pthread_attr_destroy(&attr);\n"
5167 "    if (s != 0)\n"
5168 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5169 "}\n"
5170 msgstr ""
5171 "    s = pthread_attr_destroy(&attr);\n"
5172 "    if (s != 0)\n"
5173 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5174 "}\n"
5175
5176 #. type: Plain text
5177 #: build/C/man3/pthread_getattr_np.3:235
5178 #, no-wrap
5179 msgid ""
5180 "static void *           /* Start function for thread we create */\n"
5181 "thread_start(void *arg)\n"
5182 "{\n"
5183 "    printf(\"Attributes of created thread:\\en\");\n"
5184 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5185 msgstr ""
5186 "static void *           /* Start function for thread we create */\n"
5187 "thread_start(void *arg)\n"
5188 "{\n"
5189 "    printf(\"Attributes of created thread:\\en\");\n"
5190 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5191
5192 #. type: Plain text
5193 #: build/C/man3/pthread_getattr_np.3:249
5194 #, no-wrap
5195 msgid ""
5196 "static void\n"
5197 "usage(char *pname, char *msg)\n"
5198 "{\n"
5199 "    if (msg != NULL)\n"
5200 "        fputs(msg, stderr);\n"
5201 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5202 "            \" [-g guard-size]\\en\", pname);\n"
5203 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5204 "    exit(EXIT_FAILURE);\n"
5205 "}\n"
5206 msgstr ""
5207 "static void\n"
5208 "usage(char *pname, char *msg)\n"
5209 "{\n"
5210 "    if (msg != NULL)\n"
5211 "        fputs(msg, stderr);\n"
5212 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5213 "            \" [-g guard-size]\\en\", pname);\n"
5214 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5215 "    exit(EXIT_FAILURE);\n"
5216 "}\n"
5217
5218 #. type: Plain text
5219 #: build/C/man3/pthread_getattr_np.3:262
5220 #, no-wrap
5221 msgid ""
5222 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5223 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5224 "                              pthread_attr_t *attrp)\n"
5225 "{\n"
5226 "    int s, opt, allocate_stack;\n"
5227 "    long stack_size, guard_size;\n"
5228 "            void *stack_addr;\n"
5229 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
5230 "                                           a thread attributes object */\n"
5231 "    allocate_stack = 0;\n"
5232 "    stack_size = -1;\n"
5233 "    guard_size = -1;\n"
5234 msgstr ""
5235 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5236 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5237 "                              pthread_attr_t *attrp)\n"
5238 "{\n"
5239 "    int s, opt, allocate_stack;\n"
5240 "    long stack_size, guard_size;\n"
5241 "            void *stack_addr;\n"
5242 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
5243 "                                           a thread attributes object */\n"
5244 "    allocate_stack = 0;\n"
5245 "    stack_size = -1;\n"
5246 "    guard_size = -1;\n"
5247
5248 #. type: Plain text
5249 #: build/C/man3/pthread_getattr_np.3:271
5250 #, no-wrap
5251 msgid ""
5252 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5253 "        switch (opt) {\n"
5254 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
5255 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
5256 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
5257 "        default:    usage(argv[0], NULL);\n"
5258 "        }\n"
5259 "    }\n"
5260 msgstr ""
5261 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5262 "        switch (opt) {\n"
5263 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
5264 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
5265 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
5266 "        default:    usage(argv[0], NULL);\n"
5267 "        }\n"
5268 "    }\n"
5269
5270 #. type: Plain text
5271 #: build/C/man3/pthread_getattr_np.3:274
5272 #, no-wrap
5273 msgid ""
5274 "    if (allocate_stack && stack_size == -1)\n"
5275 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5276 msgstr ""
5277 "    if (allocate_stack && stack_size == -1)\n"
5278 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5279
5280 #. type: Plain text
5281 #: build/C/man3/pthread_getattr_np.3:277
5282 #, no-wrap
5283 msgid ""
5284 "    if (argc E<gt> optind)\n"
5285 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5286 msgstr ""
5287 "    if (argc E<gt> optind)\n"
5288 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5289
5290 #. type: Plain text
5291 #: build/C/man3/pthread_getattr_np.3:280
5292 #, no-wrap
5293 msgid ""
5294 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5295 "        ret_attrp = attrp;\n"
5296 msgstr ""
5297 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5298 "        ret_attrp = attrp;\n"
5299
5300 #. type: Plain text
5301 #: build/C/man3/pthread_getattr_np.3:285
5302 #, no-wrap
5303 msgid ""
5304 "        s = pthread_attr_init(attrp);\n"
5305 "        if (s != 0)\n"
5306 "            handle_error_en(s, \"pthread_attr_init\");\n"
5307 "    }\n"
5308 msgstr ""
5309 "        s = pthread_attr_init(attrp);\n"
5310 "        if (s != 0)\n"
5311 "            handle_error_en(s, \"pthread_attr_init\");\n"
5312 "    }\n"
5313
5314 #. type: Plain text
5315 #: build/C/man3/pthread_getattr_np.3:297
5316 #, no-wrap
5317 msgid ""
5318 "    if (stack_size E<gt>= 0) {\n"
5319 "        if (!allocate_stack) {\n"
5320 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
5321 "            if (s != 0)\n"
5322 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5323 "        } else {\n"
5324 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5325 "                               stack_size);\n"
5326 "            if (s != 0)\n"
5327 "                handle_error_en(s, \"posix_memalign\");\n"
5328 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5329 msgstr ""
5330 "    if (stack_size E<gt>= 0) {\n"
5331 "        if (!allocate_stack) {\n"
5332 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
5333 "            if (s != 0)\n"
5334 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5335 "        } else {\n"
5336 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5337 "                               stack_size);\n"
5338 "            if (s != 0)\n"
5339 "                handle_error_en(s, \"posix_memalign\");\n"
5340 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5341
5342 #. type: Plain text
5343 #: build/C/man3/pthread_getattr_np.3:303
5344 #, no-wrap
5345 msgid ""
5346 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5347 "            if (s != 0)\n"
5348 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5349 "        }\n"
5350 "    }\n"
5351 msgstr ""
5352 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5353 "            if (s != 0)\n"
5354 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5355 "        }\n"
5356 "    }\n"
5357
5358 #. type: Plain text
5359 #: build/C/man3/pthread_getattr_np.3:309
5360 #, no-wrap
5361 msgid ""
5362 "    if (guard_size E<gt>= 0) {\n"
5363 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
5364 "        if (s != 0)\n"
5365 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5366 "    }\n"
5367 msgstr ""
5368 "    if (guard_size E<gt>= 0) {\n"
5369 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
5370 "        if (s != 0)\n"
5371 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5372 "    }\n"
5373
5374 #. type: Plain text
5375 #: build/C/man3/pthread_getattr_np.3:312
5376 #, no-wrap
5377 msgid ""
5378 "    return ret_attrp;\n"
5379 "}\n"
5380 msgstr ""
5381 "    return ret_attrp;\n"
5382 "}\n"
5383
5384 #. type: Plain text
5385 #: build/C/man3/pthread_getattr_np.3:321
5386 #, no-wrap
5387 msgid ""
5388 "int\n"
5389 "main(int argc, char *argv[])\n"
5390 "{\n"
5391 "    int s;\n"
5392 "    pthread_t thr;\n"
5393 "    pthread_attr_t attr;\n"
5394 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
5395 "                                        a thread attributes object */\n"
5396 msgstr ""
5397 "int\n"
5398 "main(int argc, char *argv[])\n"
5399 "{\n"
5400 "    int s;\n"
5401 "    pthread_t thr;\n"
5402 "    pthread_attr_t attr;\n"
5403 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
5404 "                                        a thread attributes object */\n"
5405
5406 #. type: Plain text
5407 #: build/C/man3/pthread_getattr_np.3:323
5408 #, no-wrap
5409 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5410 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5411
5412 #. type: Plain text
5413 #: build/C/man3/pthread_getattr_np.3:329
5414 #, no-wrap
5415 msgid ""
5416 "    if (attrp != NULL) {\n"
5417 "        printf(\"Thread attributes object after initializations:\\en\");\n"
5418 "        display_stack_related_attributes(attrp, \"\\et\");\n"
5419 "        printf(\"\\en\");\n"
5420 "    }\n"
5421 msgstr ""
5422 "    if (attrp != NULL) {\n"
5423 "        printf(\"Thread attributes object after initializations:\\en\");\n"
5424 "        display_stack_related_attributes(attrp, \"\\et\");\n"
5425 "        printf(\"\\en\");\n"
5426 "    }\n"
5427
5428 #. type: Plain text
5429 #: build/C/man3/pthread_getattr_np.3:356
5430 msgid ""
5431 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
5432 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
5433 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
5434 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
5435 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
5436 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5437 msgstr ""
5438 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
5439 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
5440 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
5441 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
5442 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
5443 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5444
5445 #. type: TH
5446 #: build/C/man3/pthread_getcpuclockid.3:24
5447 #, no-wrap
5448 msgid "PTHREAD_GETCPUCLOCKID"
5449 msgstr "PTHREAD_GETCPUCLOCKID"
5450
5451 #. type: TH
5452 #: build/C/man3/pthread_getcpuclockid.3:24
5453 #, no-wrap
5454 msgid "2009-02-08"
5455 msgstr "2009-02-08"
5456
5457 #. type: Plain text
5458 #: build/C/man3/pthread_getcpuclockid.3:27
5459 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
5460 msgstr ""
5461
5462 #. type: Plain text
5463 #: build/C/man3/pthread_getcpuclockid.3:31
5464 #, no-wrap
5465 msgid ""
5466 "B<#include E<lt>pthread.hE<gt>>\n"
5467 "B<#include E<lt>time.hE<gt>>\n"
5468 msgstr ""
5469 "B<#include E<lt>pthread.hE<gt>>\n"
5470 "B<#include E<lt>time.hE<gt>>\n"
5471
5472 #. type: Plain text
5473 #: build/C/man3/pthread_getcpuclockid.3:33
5474 #, no-wrap
5475 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
5476 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
5477
5478 #.  The clockid is constructed as follows:
5479 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
5480 #.  where CLOCK_IDFIELD_SIZE is 3.
5481 #. type: Plain text
5482 #: build/C/man3/pthread_getcpuclockid.3:44
5483 msgid ""
5484 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
5485 "time clock of the thread I<thread>."
5486 msgstr ""
5487
5488 #. type: TP
5489 #: build/C/man3/pthread_getcpuclockid.3:48
5490 #, no-wrap
5491 msgid "B<ENOENT>"
5492 msgstr "B<ENOENT>"
5493
5494 #.  CLOCK_THREAD_CPUTIME_ID not defined
5495 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
5496 #.  be possible if kernel thread IDs took more than 29 bits (which
5497 #.  they currently cannot).
5498 #. type: Plain text
5499 #: build/C/man3/pthread_getcpuclockid.3:56
5500 msgid "Per-thread CPU time clocks are not supported by the system."
5501 msgstr ""
5502
5503 #. type: Plain text
5504 #: build/C/man3/pthread_getcpuclockid.3:63
5505 msgid "This function is available in glibc since version 2.2."
5506 msgstr ""
5507
5508 #. type: Plain text
5509 #: build/C/man3/pthread_getcpuclockid.3:76
5510 msgid ""
5511 "When I<thread> refers to the calling thread, this function returns an "
5512 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
5513 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
5514 msgstr ""
5515
5516 #. type: Plain text
5517 #: build/C/man3/pthread_getcpuclockid.3:82
5518 msgid ""
5519 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
5520 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
5521 "the two threads.  The following shell session shows an example run:"
5522 msgstr ""
5523
5524 #. type: Plain text
5525 #: build/C/man3/pthread_getcpuclockid.3:91
5526 #, no-wrap
5527 msgid ""
5528 "$ B<./a.out>\n"
5529 "Main thread sleeping\n"
5530 "Subthread starting infinite loop\n"
5531 "Main thread consuming some CPU time...\n"
5532 "Process total CPU time:    1.368\n"
5533 "Main thread CPU time:      0.376\n"
5534 "Subthread CPU time:        0.992\n"
5535 msgstr ""
5536 "$ B<./a.out>\n"
5537 "Main thread sleeping\n"
5538 "Subthread starting infinite loop\n"
5539 "Main thread consuming some CPU time...\n"
5540 "Process total CPU time:    1.368\n"
5541 "Main thread CPU time:      0.376\n"
5542 "Subthread CPU time:        0.992\n"
5543
5544 #. type: Plain text
5545 #: build/C/man3/pthread_getcpuclockid.3:97
5546 #, no-wrap
5547 msgid "/* Link with \"-lrt\" */\n"
5548 msgstr ""
5549
5550 #. type: Plain text
5551 #: build/C/man3/pthread_getcpuclockid.3:105
5552 #, no-wrap
5553 msgid ""
5554 "#include E<lt>time.hE<gt>\n"
5555 "#include E<lt>stdio.hE<gt>\n"
5556 "#include E<lt>stdlib.hE<gt>\n"
5557 "#include E<lt>unistd.hE<gt>\n"
5558 "#include E<lt>pthread.hE<gt>\n"
5559 "#include E<lt>string.hE<gt>\n"
5560 "#include E<lt>errno.hE<gt>\n"
5561 msgstr ""
5562 "#include E<lt>time.hE<gt>\n"
5563 "#include E<lt>stdio.hE<gt>\n"
5564 "#include E<lt>stdlib.hE<gt>\n"
5565 "#include E<lt>unistd.hE<gt>\n"
5566 "#include E<lt>pthread.hE<gt>\n"
5567 "#include E<lt>string.hE<gt>\n"
5568 "#include E<lt>errno.hE<gt>\n"
5569
5570 #. type: Plain text
5571 #: build/C/man3/pthread_getcpuclockid.3:119
5572 #, no-wrap
5573 msgid ""
5574 "static void *\n"
5575 "thread_start(void *arg)\n"
5576 "{\n"
5577 "    printf(\"Subthread starting infinite loop\\en\");\n"
5578 "    for (;;)\n"
5579 "        continue;\n"
5580 "}\n"
5581 msgstr ""
5582 "static void *\n"
5583 "thread_start(void *arg)\n"
5584 "{\n"
5585 "    printf(\"Subthread starting infinite loop\\en\");\n"
5586 "    for (;;)\n"
5587 "        continue;\n"
5588 "}\n"
5589
5590 #. type: Plain text
5591 #: build/C/man3/pthread_getcpuclockid.3:124
5592 #, no-wrap
5593 msgid ""
5594 "static void\n"
5595 "pclock(char *msg, clockid_t cid)\n"
5596 "{\n"
5597 "    struct timespec ts;\n"
5598 msgstr ""
5599 "static void\n"
5600 "pclock(char *msg, clockid_t cid)\n"
5601 "{\n"
5602 "    struct timespec ts;\n"
5603
5604 #. type: Plain text
5605 #: build/C/man3/pthread_getcpuclockid.3:130
5606 #, no-wrap
5607 msgid ""
5608 "    printf(\"%s\", msg);\n"
5609 "    if (clock_gettime(cid, &ts) == -1)\n"
5610 "        handle_error(\"clock_gettime\");\n"
5611 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
5612 "}\n"
5613 msgstr ""
5614 "    printf(\"%s\", msg);\n"
5615 "    if (clock_gettime(cid, &ts) == -1)\n"
5616 "        handle_error(\"clock_gettime\");\n"
5617 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
5618 "}\n"
5619
5620 #. type: Plain text
5621 #: build/C/man3/pthread_getcpuclockid.3:137
5622 #, no-wrap
5623 msgid ""
5624 "int\n"
5625 "main(int argc, char *argv[])\n"
5626 "{\n"
5627 "    pthread_t thread;\n"
5628 "    clockid_t cid;\n"
5629 "    int j, s;\n"
5630 msgstr ""
5631 "int\n"
5632 "main(int argc, char *argv[])\n"
5633 "{\n"
5634 "    pthread_t thread;\n"
5635 "    clockid_t cid;\n"
5636 "    int j, s;\n"
5637
5638 #. type: Plain text
5639 #: build/C/man3/pthread_getcpuclockid.3:141
5640 #, no-wrap
5641 msgid ""
5642 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
5643 "    if (s != 0)\n"
5644 "        handle_error_en(s, \"pthread_create\");\n"
5645 msgstr ""
5646 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
5647 "    if (s != 0)\n"
5648 "        handle_error_en(s, \"pthread_create\");\n"
5649
5650 #. type: Plain text
5651 #: build/C/man3/pthread_getcpuclockid.3:144
5652 #, no-wrap
5653 msgid ""
5654 "    printf(\"Main thread sleeping\\en\");\n"
5655 "    sleep(1);\n"
5656 msgstr ""
5657 "    printf(\"Main thread sleeping\\en\");\n"
5658 "    sleep(1);\n"
5659
5660 #. type: Plain text
5661 #: build/C/man3/pthread_getcpuclockid.3:148
5662 #, no-wrap
5663 msgid ""
5664 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
5665 "    for (j = 0; j E<lt> 2000000; j++)\n"
5666 "        getppid();\n"
5667 msgstr ""
5668 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
5669 "    for (j = 0; j E<lt> 2000000; j++)\n"
5670 "        getppid();\n"
5671
5672 #. type: Plain text
5673 #: build/C/man3/pthread_getcpuclockid.3:150
5674 #, no-wrap
5675 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
5676 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
5677
5678 #. type: Plain text
5679 #: build/C/man3/pthread_getcpuclockid.3:155
5680 #, no-wrap
5681 msgid ""
5682 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
5683 "    if (s != 0)\n"
5684 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5685 "    pclock(\"Main thread CPU time:   \", cid);\n"
5686 msgstr ""
5687 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
5688 "    if (s != 0)\n"
5689 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5690 "    pclock(\"Main thread CPU time:   \", cid);\n"
5691
5692 #. type: Plain text
5693 #: build/C/man3/pthread_getcpuclockid.3:158
5694 #, no-wrap
5695 msgid ""
5696 "    /* The preceding 4 lines of code could have been replaced by:\n"
5697 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
5698 msgstr ""
5699 "    /* The preceding 4 lines of code could have been replaced by:\n"
5700 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
5701
5702 #. type: Plain text
5703 #: build/C/man3/pthread_getcpuclockid.3:163
5704 #, no-wrap
5705 msgid ""
5706 "    s = pthread_getcpuclockid(thread, &cid);\n"
5707 "    if (s != 0)\n"
5708 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5709 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
5710 msgstr ""
5711 "    s = pthread_getcpuclockid(thread, &cid);\n"
5712 "    if (s != 0)\n"
5713 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5714 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
5715
5716 #. type: Plain text
5717 #: build/C/man3/pthread_getcpuclockid.3:166
5718 #, no-wrap
5719 msgid ""
5720 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
5721 "}\n"
5722 msgstr ""
5723 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
5724 "}\n"
5725
5726 #. type: Plain text
5727 #: build/C/man3/pthread_getcpuclockid.3:174
5728 msgid ""
5729 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
5730 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
5731 msgstr ""
5732 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
5733 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
5734
5735 #. type: TH
5736 #: build/C/man3/pthread_join.3:24
5737 #, no-wrap
5738 msgid "PTHREAD_JOIN"
5739 msgstr "PTHREAD_JOIN"
5740
5741 #. type: Plain text
5742 #: build/C/man3/pthread_join.3:27
5743 msgid "pthread_join - join with a terminated thread"
5744 msgstr ""
5745
5746 #. type: Plain text
5747 #: build/C/man3/pthread_join.3:32
5748 #, no-wrap
5749 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
5750 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
5751
5752 #. type: Plain text
5753 #: build/C/man3/pthread_join.3:47
5754 msgid ""
5755 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
5756 "to terminate.  If that thread has already terminated, then B<pthread_join>"
5757 "()  returns immediately.  The thread specified by I<thread> must be joinable."
5758 msgstr ""
5759
5760 #. type: Plain text
5761 #: build/C/man3/pthread_join.3:61
5762 msgid ""
5763 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
5764 "the target thread (i.e., the value that the target thread supplied to "
5765 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
5766 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
5767 msgstr ""
5768
5769 #. type: Plain text
5770 #: build/C/man3/pthread_join.3:68
5771 msgid ""
5772 "If multiple threads simultaneously try to join with the same thread, the "
5773 "results are undefined.  If the thread calling B<pthread_join>()  is "
5774 "canceled, then the target thread will remain joinable (i.e., it will not be "
5775 "detached)."
5776 msgstr ""
5777
5778 #. type: Plain text
5779 #: build/C/man3/pthread_join.3:73
5780 msgid ""
5781 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
5782 "number."
5783 msgstr ""
5784
5785 #. type: TP
5786 #: build/C/man3/pthread_join.3:74
5787 #, no-wrap
5788 msgid "B<EDEADLK>"
5789 msgstr "B<EDEADLK>"
5790
5791 #.  The following verified by testing on glibc 2.8/NPTL:
5792 #.  The following verified by testing on glibc 2.8/NPTL:
5793 #. type: Plain text
5794 #: build/C/man3/pthread_join.3:83
5795 msgid ""
5796 "A deadlock was detected (e.g., two threads tried to join with each other); "
5797 "or I<thread> specifies the calling thread."
5798 msgstr ""
5799
5800 #.  POSIX.1-2001 does not specify this error case.
5801 #. type: Plain text
5802 #: build/C/man3/pthread_join.3:91
5803 msgid "Another thread is already waiting to join with this thread."
5804 msgstr ""
5805
5806 #. type: Plain text
5807 #: build/C/man3/pthread_join.3:102
5808 msgid ""
5809 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
5810 "the target thread has terminated."
5811 msgstr ""
5812
5813 #. type: Plain text
5814 #: build/C/man3/pthread_join.3:105
5815 msgid ""
5816 "Joining with a thread that has previously been joined results in undefined "
5817 "behavior."
5818 msgstr ""
5819
5820 #. type: Plain text
5821 #: build/C/man3/pthread_join.3:113
5822 msgid ""
5823 "Failure to join with a thread that is joinable (i.e., one that is not "
5824 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
5825 "zombie thread consumes some system resources, and when enough zombie threads "
5826 "have accumulated, it will no longer be possible to create new threads (or "
5827 "processes)."
5828 msgstr ""
5829
5830 #. type: Plain text
5831 #: build/C/man3/pthread_join.3:119
5832 msgid ""
5833 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
5834 "\"join with any terminated thread\".  If you believe you need this "
5835 "functionality, you probably need to rethink your application design."
5836 msgstr ""
5837
5838 #. type: Plain text
5839 #: build/C/man3/pthread_join.3:122
5840 msgid ""
5841 "All of the threads in a process are peers: any thread can join with any "
5842 "other thread in the process."
5843 msgstr ""
5844
5845 #. type: Plain text
5846 #: build/C/man3/pthread_join.3:131
5847 msgid ""
5848 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
5849 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
5850 msgstr ""
5851 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
5852 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
5853
5854 #. type: TH
5855 #: build/C/man3/pthread_kill.3:24
5856 #, no-wrap
5857 msgid "PTHREAD_KILL"
5858 msgstr "PTHREAD_KILL"
5859
5860 #. type: TH
5861 #: build/C/man3/pthread_kill.3:24
5862 #, no-wrap
5863 msgid "2009-01-28"
5864 msgstr "2009-01-28"
5865
5866 #. type: Plain text
5867 #: build/C/man3/pthread_kill.3:27
5868 msgid "pthread_kill - send a signal to a thread"
5869 msgstr ""
5870
5871 #. type: Plain text
5872 #: build/C/man3/pthread_kill.3:30 build/C/man3/pthread_sigmask.3:30
5873 #, no-wrap
5874 msgid "B<#include E<lt>signal.hE<gt>>\n"
5875 msgstr "B<#include E<lt>signal.hE<gt>>\n"
5876
5877 #. type: Plain text
5878 #: build/C/man3/pthread_kill.3:32
5879 #, no-wrap
5880 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
5881 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
5882
5883 #. type: Plain text
5884 #: build/C/man3/pthread_kill.3:45
5885 msgid ""
5886 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, "
5887 "another thread in the same process as the caller.  The signal is "
5888 "asynchronously directed to I<thread>."
5889 msgstr ""
5890
5891 #. type: Plain text
5892 #: build/C/man3/pthread_kill.3:50
5893 msgid ""
5894 "If I<sig> is 0, then no signal is sent, but error checking is still "
5895 "performed; this can be used to check for the existence of a thread ID."
5896 msgstr ""
5897
5898 #. type: Plain text
5899 #: build/C/man3/pthread_kill.3:55
5900 msgid ""
5901 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
5902 "number, and no signal is sent."
5903 msgstr ""
5904
5905 #. type: Plain text
5906 #: build/C/man3/pthread_kill.3:59
5907 msgid "An invalid signal was specified."
5908 msgstr ""
5909
5910 #. type: Plain text
5911 #: build/C/man3/pthread_kill.3:73
5912 msgid ""
5913 "Signal dispositions are process-wide: if a signal handler is installed, the "
5914 "handler will be invoked in the thread I<thread>, but if the disposition of "
5915 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
5916 "affect the whole process."
5917 msgstr ""
5918
5919 #. type: Plain text
5920 #: build/C/man3/pthread_kill.3:81
5921 msgid ""
5922 "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
5923 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
5924 msgstr ""
5925 "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
5926 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
5927
5928 #. type: TH
5929 #: build/C/man3/pthread_kill_other_threads_np.3:24
5930 #, no-wrap
5931 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
5932 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
5933
5934 #. type: TH
5935 #: build/C/man3/pthread_kill_other_threads_np.3:24
5936 #, no-wrap
5937 msgid "2010-09-09"
5938 msgstr "2010-09-09"
5939
5940 #. type: Plain text
5941 #: build/C/man3/pthread_kill_other_threads_np.3:27
5942 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
5943 msgstr ""
5944
5945 #. type: Plain text
5946 #: build/C/man3/pthread_kill_other_threads_np.3:32
5947 #, no-wrap
5948 msgid "B<void pthread_kill_other_threads_np(void);>\n"
5949 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
5950
5951 #.  .SH VERSIONS
5952 #.  Available since glibc 2.0
5953 #. type: Plain text
5954 #: build/C/man3/pthread_kill_other_threads_np.3:45
5955 msgid ""
5956 "B<pthread_kill_other_threads_np>()  only has an effect in the LinuxThreads "
5957 "threading implementation.  On that implementation, calling this function "
5958 "causes the immediate termination of all threads in the application, except "
5959 "the calling thread.  The cancellation state and cancellation type of the to-"
5960 "be-terminated threads are ignored, and the cleanup handlers are not called "
5961 "in those threads."
5962 msgstr ""
5963
5964 #. type: Plain text
5965 #: build/C/man3/pthread_kill_other_threads_np.3:57
5966 msgid ""
5967 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
5968 "thread calls B<execve>(2)  or a similar function.  This function is designed "
5969 "to address a limitation in the obsolete LinuxThreads implementation whereby "
5970 "the other threads of an application are not automatically terminated (as "
5971 "POSIX.1-2001 requires) during B<execve>(2)."
5972 msgstr ""
5973
5974 #. type: Plain text
5975 #: build/C/man3/pthread_kill_other_threads_np.3:64
5976 msgid ""
5977 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
5978 "exists, but does nothing.  (Nothing needs to be done, because the "
5979 "implementation does the right thing during an B<execve>(2).)"
5980 msgstr ""
5981
5982 #. type: Plain text
5983 #: build/C/man3/pthread_kill_other_threads_np.3:69
5984 msgid ""
5985 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
5986 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
5987 msgstr ""
5988 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
5989 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
5990
5991 #. type: TH
5992 #: build/C/man3/pthread_self.3:24
5993 #, no-wrap
5994 msgid "PTHREAD_SELF"
5995 msgstr "PTHREAD_SELF"
5996
5997 #. type: Plain text
5998 #: build/C/man3/pthread_self.3:27
5999 msgid "pthread_self - obtain ID of the calling thread"
6000 msgstr ""
6001
6002 #. type: Plain text
6003 #: build/C/man3/pthread_self.3:32
6004 #, no-wrap
6005 msgid "B<pthread_t pthread_self(void);>\n"
6006 msgstr "B<pthread_t pthread_self(void);>\n"
6007
6008 #. type: Plain text
6009 #: build/C/man3/pthread_self.3:44
6010 msgid ""
6011 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
6012 "is the same value that is returned in I<*thread> in the B<pthread_create>"
6013 "(3)  call that created this thread."
6014 msgstr ""
6015
6016 #. type: Plain text
6017 #: build/C/man3/pthread_self.3:46
6018 msgid "This function always succeeds, returning the calling thread's ID."
6019 msgstr ""
6020
6021 #. type: Plain text
6022 #: build/C/man3/pthread_self.3:61
6023 msgid ""
6024 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
6025 "represent a thread ID; for example, representation using either an "
6026 "arithmetic type or a structure is permitted.  Therefore, variables of type "
6027 "I<pthread_t> can't portably be compared using the C equality operator "
6028 "(B<==>); use B<pthread_equal>(3)  instead."
6029 msgstr ""
6030
6031 #. type: Plain text
6032 #: build/C/man3/pthread_self.3:65
6033 msgid ""
6034 "Thread identifiers should be considered opaque: any attempt to use a thread "
6035 "ID other than in pthreads calls is nonportable and can lead to unspecified "
6036 "results."
6037 msgstr ""
6038
6039 #. type: Plain text
6040 #: build/C/man3/pthread_self.3:69
6041 msgid ""
6042 "Thread IDs are only guaranteed to be unique within a process.  A thread ID "
6043 "may be reused after a terminated thread has been joined, or a detached "
6044 "thread has terminated."
6045 msgstr ""
6046
6047 #. type: Plain text
6048 #: build/C/man3/pthread_self.3:74
6049 msgid ""
6050 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
6051 "kernel thread ID returned by a call to B<gettid>(2)."
6052 msgstr ""
6053
6054 #. type: Plain text
6055 #: build/C/man3/pthread_self.3:77
6056 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6057 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6058
6059 #. type: TH
6060 #: build/C/man3/pthread_setaffinity_np.3:24
6061 #, no-wrap
6062 msgid "PTHREAD_SETAFFINITY_NP"
6063 msgstr "PTHREAD_SETAFFINITY_NP"
6064
6065 #. type: Plain text
6066 #: build/C/man3/pthread_setaffinity_np.3:28
6067 msgid ""
6068 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
6069 "thread"
6070 msgstr ""
6071
6072 #. type: Plain text
6073 #: build/C/man3/pthread_setaffinity_np.3:37
6074 #, no-wrap
6075 msgid ""
6076 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6077 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6078 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6079 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6080 msgstr ""
6081 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6082 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6083 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6084 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6085
6086 #. type: Plain text
6087 #: build/C/man3/pthread_setaffinity_np.3:52
6088 msgid ""
6089 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
6090 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
6091 "successful, and the thread is not currently running on one of the CPUs in "
6092 "I<cpuset>, then it is migrated to one of those CPUs."
6093 msgstr ""
6094
6095 #. type: Plain text
6096 #: build/C/man3/pthread_setaffinity_np.3:59
6097 msgid ""
6098 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
6099 "the thread I<thread> in the buffer pointed to by I<cpuset>."
6100 msgstr ""
6101
6102 #. type: Plain text
6103 #: build/C/man3/pthread_setaffinity_np.3:75
6104 msgid ""
6105 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
6106 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
6107 "(cpu_set_t)>.  (It may be some other value, if using the macros described in "
6108 "B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
6109 msgstr ""
6110
6111 #. type: TP
6112 #: build/C/man3/pthread_setaffinity_np.3:79
6113 #, no-wrap
6114 msgid "B<EFAULT>"
6115 msgstr "B<EFAULT>"
6116
6117 #. type: Plain text
6118 #: build/C/man3/pthread_setaffinity_np.3:82
6119 msgid "A supplied memory address was invalid."
6120 msgstr ""
6121
6122 #. type: Plain text
6123 #: build/C/man3/pthread_setaffinity_np.3:91
6124 msgid ""
6125 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
6126 "processors that are currently physically on the system and permitted to the "
6127 "thread according to any restrictions that may be imposed by the \"cpuset\" "
6128 "mechanism described in B<cpuset>(7)."
6129 msgstr ""
6130
6131 #.  FIXME . ?
6132 #.  Loic Domaigne commented: it seems that in the future the
6133 #.  kernel developers want to make cpumask_t dynamic, so
6134 #.  CONFIG_NR_CPUS might become obsolete in the future.
6135 #.  cpumask_t
6136 #.  The raw sched_getaffinity() system call returns the size (in bytes)
6137 #.  of the cpumask_t type.
6138 #. type: Plain text
6139 #: build/C/man3/pthread_setaffinity_np.3:107
6140 msgid ""
6141 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
6142 "the set supported by the kernel.  (The kernel configuration option "
6143 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
6144 "type used to represent CPU sets.)"
6145 msgstr ""
6146
6147 #. type: Plain text
6148 #: build/C/man3/pthread_setaffinity_np.3:112
6149 msgid ""
6150 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
6151 "affinity mask used by the kernel."
6152 msgstr ""
6153
6154 #. type: Plain text
6155 #: build/C/man3/pthread_setaffinity_np.3:135
6156 msgid ""
6157 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
6158 "thread will actually run is the intersection of the set specified in the "
6159 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
6160 "system may further restrict the set of CPUs on which the thread runs if the "
6161 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
6162 "restrictions on the actual set of CPUs on which the thread will run are "
6163 "silently imposed by the kernel."
6164 msgstr ""
6165
6166 #. type: Plain text
6167 #: build/C/man3/pthread_setaffinity_np.3:141
6168 msgid ""
6169 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
6170 "B<sched_getaffinity>(2)  system calls."
6171 msgstr ""
6172
6173 #. type: Plain text
6174 #: build/C/man3/pthread_setaffinity_np.3:152
6175 msgid ""
6176 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
6177 "creator's CPU affinity mask."
6178 msgstr ""
6179
6180 #. type: Plain text
6181 #: build/C/man3/pthread_setaffinity_np.3:160
6182 msgid ""
6183 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
6184 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
6185 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
6186 "check the resulting CPU affinity mask of the thread."
6187 msgstr ""
6188
6189 #. type: Plain text
6190 #: build/C/man3/pthread_setaffinity_np.3:167
6191 #, no-wrap
6192 msgid ""
6193 "#define _GNU_SOURCE\n"
6194 "#include E<lt>pthread.hE<gt>\n"
6195 "#include E<lt>stdio.hE<gt>\n"
6196 "#include E<lt>stdlib.hE<gt>\n"
6197 "#include E<lt>errno.hE<gt>\n"
6198 msgstr ""
6199 "#define _GNU_SOURCE\n"
6200 "#include E<lt>pthread.hE<gt>\n"
6201 "#include E<lt>stdio.hE<gt>\n"
6202 "#include E<lt>stdlib.hE<gt>\n"
6203 "#include E<lt>errno.hE<gt>\n"
6204
6205 #. type: Plain text
6206 #: build/C/man3/pthread_setaffinity_np.3:177
6207 #, no-wrap
6208 msgid ""
6209 "int\n"
6210 "main(int argc, char *argv[])\n"
6211 "{\n"
6212 "    int s, j;\n"
6213 "    cpu_set_t cpuset;\n"
6214 "    pthread_t thread;\n"
6215 msgstr ""
6216 "int\n"
6217 "main(int argc, char *argv[])\n"
6218 "{\n"
6219 "    int s, j;\n"
6220 "    cpu_set_t cpuset;\n"
6221 "    pthread_t thread;\n"
6222
6223 #. type: Plain text
6224 #: build/C/man3/pthread_setaffinity_np.3:179
6225 #, no-wrap
6226 msgid "    thread = pthread_self();\n"
6227 msgstr "    thread = pthread_self();\n"
6228
6229 #. type: Plain text
6230 #: build/C/man3/pthread_setaffinity_np.3:181
6231 #, no-wrap
6232 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
6233 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
6234
6235 #. type: Plain text
6236 #: build/C/man3/pthread_setaffinity_np.3:185
6237 #, no-wrap
6238 msgid ""
6239 "    CPU_ZERO(&cpuset);\n"
6240 "    for (j = 0; j E<lt> 8; j++)\n"
6241 "        CPU_SET(j, &cpuset);\n"
6242 msgstr ""
6243 "    CPU_ZERO(&cpuset);\n"
6244 "    for (j = 0; j E<lt> 8; j++)\n"
6245 "        CPU_SET(j, &cpuset);\n"
6246
6247 #. type: Plain text
6248 #: build/C/man3/pthread_setaffinity_np.3:189
6249 #, no-wrap
6250 msgid ""
6251 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6252 "    if (s != 0)\n"
6253 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
6254 msgstr ""
6255 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6256 "    if (s != 0)\n"
6257 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
6258
6259 #. type: Plain text
6260 #: build/C/man3/pthread_setaffinity_np.3:191
6261 #, no-wrap
6262 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
6263 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
6264
6265 #. type: Plain text
6266 #: build/C/man3/pthread_setaffinity_np.3:195
6267 #, no-wrap
6268 msgid ""
6269 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6270 "    if (s != 0)\n"
6271 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
6272 msgstr ""
6273 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6274 "    if (s != 0)\n"
6275 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
6276
6277 #. type: Plain text
6278 #: build/C/man3/pthread_setaffinity_np.3:200
6279 #, no-wrap
6280 msgid ""
6281 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6282 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6283 "        if (CPU_ISSET(j, &cpuset))\n"
6284 "            printf(\"    CPU %d\\en\", j);\n"
6285 msgstr ""
6286 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6287 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6288 "        if (CPU_ISSET(j, &cpuset))\n"
6289 "            printf(\"    CPU %d\\en\", j);\n"
6290
6291 #. type: Plain text
6292 #: build/C/man3/pthread_setaffinity_np.3:203
6293 #: build/C/man3/pthread_setschedparam.3:428
6294 #, no-wrap
6295 msgid ""
6296 "    exit(EXIT_SUCCESS);\n"
6297 "}\n"
6298 msgstr ""
6299 "    exit(EXIT_SUCCESS);\n"
6300 "}\n"
6301
6302 #. type: Plain text
6303 #: build/C/man3/pthread_setaffinity_np.3:211
6304 msgid ""
6305 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
6306 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
6307 "B<cpuset>(7), B<pthreads>(7)"
6308 msgstr ""
6309 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
6310 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
6311 "B<cpuset>(7), B<pthreads>(7)"
6312
6313 #. type: TH
6314 #: build/C/man3/pthread_setcancelstate.3:24
6315 #, no-wrap
6316 msgid "PTHREAD_SETCANCELSTATE"
6317 msgstr "PTHREAD_SETCANCELSTATE"
6318
6319 #. type: Plain text
6320 #: build/C/man3/pthread_setcancelstate.3:28
6321 msgid ""
6322 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
6323 "type"
6324 msgstr ""
6325
6326 #. type: Plain text
6327 #: build/C/man3/pthread_setcancelstate.3:34
6328 #, no-wrap
6329 msgid ""
6330 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6331 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6332 msgstr ""
6333 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6334 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6335
6336 #. type: Plain text
6337 #: build/C/man3/pthread_setcancelstate.3:49
6338 msgid ""
6339 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
6340 "thread to the value given in I<state>.  The previous cancelability state of "
6341 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
6342 "I<state> argument must have one of the following values:"
6343 msgstr ""
6344
6345 #. type: TP
6346 #: build/C/man3/pthread_setcancelstate.3:49
6347 #, no-wrap
6348 msgid "B<PTHREAD_CANCEL_ENABLE>"
6349 msgstr "B<PTHREAD_CANCEL_ENABLE>"
6350
6351 #. type: Plain text
6352 #: build/C/man3/pthread_setcancelstate.3:56
6353 msgid ""
6354 "The thread is cancelable.  This is the default cancelability state in all "
6355 "new threads, including the initial thread.  The thread's cancelability type "
6356 "determines when a cancelable thread will respond to a cancellation request."
6357 msgstr ""
6358
6359 #. type: TP
6360 #: build/C/man3/pthread_setcancelstate.3:56
6361 #, no-wrap
6362 msgid "B<PTHREAD_CANCEL_DISABLE>"
6363 msgstr "B<PTHREAD_CANCEL_DISABLE>"
6364
6365 #. type: Plain text
6366 #: build/C/man3/pthread_setcancelstate.3:61
6367 msgid ""
6368 "The thread is not cancelable.  If a cancellation request is received, it is "
6369 "blocked until cancelability is enabled."
6370 msgstr ""
6371
6372 #. type: Plain text
6373 #: build/C/man3/pthread_setcancelstate.3:73
6374 msgid ""
6375 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
6376 "thread to the value given in I<type>.  The previous cancelability type of "
6377 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
6378 "argument must have one of the following values:"
6379 msgstr ""
6380
6381 #. type: TP
6382 #: build/C/man3/pthread_setcancelstate.3:73
6383 #, no-wrap
6384 msgid "B<PTHREAD_CANCEL_DEFERRED>"
6385 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
6386
6387 #. type: Plain text
6388 #: build/C/man3/pthread_setcancelstate.3:80
6389 msgid ""
6390 "A cancellation request is deferred until the thread next calls a function "
6391 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
6392 "cancelability type in all new threads, including the initial thread."
6393 msgstr ""
6394
6395 #. type: TP
6396 #: build/C/man3/pthread_setcancelstate.3:80
6397 #, no-wrap
6398 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6399 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6400
6401 #. type: Plain text
6402 #: build/C/man3/pthread_setcancelstate.3:86
6403 msgid ""
6404 "The thread can be canceled at any time.  (Typically, it will be canceled "
6405 "immediately upon receiving a cancellation request, but the system doesn't "
6406 "guarantee this.)"
6407 msgstr ""
6408
6409 #. type: Plain text
6410 #: build/C/man3/pthread_setcancelstate.3:90
6411 msgid ""
6412 "The set-and-get operation performed by each of these functions is atomic "
6413 "with respect to other threads in the process calling the same function."
6414 msgstr ""
6415
6416 #. type: Plain text
6417 #: build/C/man3/pthread_setcancelstate.3:97
6418 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
6419 msgstr ""
6420
6421 #. type: Plain text
6422 #: build/C/man3/pthread_setcancelstate.3:101
6423 msgid "Invalid value for I<state>."
6424 msgstr ""
6425
6426 #. type: Plain text
6427 #: build/C/man3/pthread_setcancelstate.3:105
6428 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
6429 msgstr ""
6430
6431 #.  .SH VERSIONS
6432 #.  Available since glibc 2.0
6433 #. type: Plain text
6434 #: build/C/man3/pthread_setcancelstate.3:111
6435 msgid "Invalid value for I<type>."
6436 msgstr ""
6437
6438 #. type: Plain text
6439 #: build/C/man3/pthread_setcancelstate.3:116
6440 msgid ""
6441 "For details of what happens when a thread is canceled, see B<pthread_cancel>"
6442 "(3)."
6443 msgstr ""
6444
6445 #. type: Plain text
6446 #: build/C/man3/pthread_setcancelstate.3:123
6447 msgid ""
6448 "Briefly disabling cancelability is useful if a thread performs some critical "
6449 "action that must not be interrupted by a cancellation request.  Beware of "
6450 "disabling cancelability for long periods, or around operations that may "
6451 "block for long periods, since that will render the thread unresponsive to "
6452 "cancellation requests."
6453 msgstr ""
6454
6455 #. type: Plain text
6456 #: build/C/man3/pthread_setcancelstate.3:154
6457 msgid ""
6458 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
6459 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
6460 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
6461 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
6462 "because the application has no way of knowing what the state of these "
6463 "resources is when the thread is canceled; that is, did cancellation occur "
6464 "before the resources were reserved, while they were reserved, or after they "
6465 "were released? Furthermore, some internal data structures (e.g., the linked "
6466 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
6467 "left in an inconsistent state if cancellation occurs in the middle of the "
6468 "function call.  Consequently, clean-up handlers cease to be useful.  "
6469 "Functions that can be safely asynchronously canceled are called I<async-"
6470 "cancel-safe functions>.  POSIX.1-2001 only requires that B<pthread_cancel>"
6471 "(3), B<pthread_setcancelstate>(), and B<pthread_setcanceltype>()  be async-"
6472 "cancel-safe.  In general, other library functions can't be safely called "
6473 "from an asynchronously cancelable thread.  One of the few circumstances in "
6474 "which asynchronous cancelability is useful is for cancellation of a thread "
6475 "that is in a pure compute-bound loop."
6476 msgstr ""
6477
6478 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
6479 #. type: Plain text
6480 #: build/C/man3/pthread_setcancelstate.3:172
6481 msgid ""
6482 "The Linux threading implementations permit the I<oldstate> argument of "
6483 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
6484 "the previous cancelability state is not returned to the caller.  Many other "
6485 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
6486 "does not specify this point, so portable applications should always specify "
6487 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
6488 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
6489 msgstr ""
6490
6491 #. type: Plain text
6492 #: build/C/man3/pthread_setcancelstate.3:175
6493 msgid "See B<pthread_cancel>(3)."
6494 msgstr ""
6495
6496 #. type: Plain text
6497 #: build/C/man3/pthread_setcancelstate.3:179
6498 msgid ""
6499 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
6500 "B<pthreads>(7)"
6501 msgstr ""
6502 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
6503 "B<pthreads>(7)"
6504
6505 #. type: TH
6506 #: build/C/man3/pthread_setconcurrency.3:23
6507 #, no-wrap
6508 msgid "PTHREAD_SETCONCURRENCY"
6509 msgstr "PTHREAD_SETCONCURRENCY"
6510
6511 #. type: TH
6512 #: build/C/man3/pthread_setconcurrency.3:23 build/C/man3/pthread_yield.3:23
6513 #, no-wrap
6514 msgid "2009-04-10"
6515 msgstr "2009-04-10"
6516
6517 #. type: Plain text
6518 #: build/C/man3/pthread_setconcurrency.3:27
6519 msgid ""
6520 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
6521 "level"
6522 msgstr ""
6523
6524 #. type: Plain text
6525 #: build/C/man3/pthread_setconcurrency.3:33
6526 #, no-wrap
6527 msgid ""
6528 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
6529 "B<int pthread_getconcurrency(void);>\n"
6530 msgstr ""
6531 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
6532 "B<int pthread_getconcurrency(void);>\n"
6533
6534 #. type: Plain text
6535 #: build/C/man3/pthread_setconcurrency.3:46
6536 msgid ""
6537 "The B<pthread_setconcurrency>()  function informs the implementation of the "
6538 "application's desired concurrency level, specified in I<new_level>.  The "
6539 "implementation only takes this as a hint: POSIX.1 does not specify the level "
6540 "of concurrency that should be provided as a result of calling "
6541 "B<pthread_setconcurrency>()."
6542 msgstr ""
6543
6544 #. type: Plain text
6545 #: build/C/man3/pthread_setconcurrency.3:51
6546 msgid ""
6547 "Specifying I<new_level> as 0 instructs the implementation to manage the "
6548 "concurrency level as it deems appropriate."
6549 msgstr ""
6550
6551 #. type: Plain text
6552 #: build/C/man3/pthread_setconcurrency.3:54
6553 msgid ""
6554 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
6555 "level for this process."
6556 msgstr ""
6557
6558 #. type: Plain text
6559 #: build/C/man3/pthread_setconcurrency.3:59
6560 msgid ""
6561 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
6562 "nonzero error number."
6563 msgstr ""
6564
6565 #. type: Plain text
6566 #: build/C/man3/pthread_setconcurrency.3:66
6567 msgid ""
6568 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
6569 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
6570 "B<pthread_setconcurrency>()  has not previously been called."
6571 msgstr ""
6572
6573 #. type: Plain text
6574 #: build/C/man3/pthread_setconcurrency.3:69
6575 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
6576 msgstr ""
6577
6578 #. type: Plain text
6579 #: build/C/man3/pthread_setconcurrency.3:73
6580 msgid "I<new_level> is negative."
6581 msgstr ""
6582
6583 #. type: Plain text
6584 #: build/C/man3/pthread_setconcurrency.3:79
6585 msgid ""
6586 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
6587 "I<new_level> would cause a system resource to be exceeded\")."
6588 msgstr ""
6589
6590 #. type: Plain text
6591 #: build/C/man3/pthread_setconcurrency.3:81
6592 msgid "These functions are available in glibc since version 2.1."
6593 msgstr ""
6594
6595 #. type: Plain text
6596 #: build/C/man3/pthread_setconcurrency.3:85
6597 msgid "The default concurrency level is 0."
6598 msgstr ""
6599
6600 #. type: Plain text
6601 #: build/C/man3/pthread_setconcurrency.3:92
6602 msgid ""
6603 "Concurrency levels are only meaningful for M:N threading implementations, "
6604 "where at any moment a subset of a process's set of user-level threads may be "
6605 "bound to a smaller number of kernel-scheduling entities.  Setting the "
6606 "concurrency level allows the application to give the system a hint as to the "
6607 "number of kernel-scheduling entities that should be provided for efficient "
6608 "execution of the application."
6609 msgstr ""
6610
6611 #. type: Plain text
6612 #: build/C/man3/pthread_setconcurrency.3:98
6613 msgid ""
6614 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
6615 "concurrency level has no meaning.  In other words, on Linux these functions "
6616 "merely exist for compatibility with other systems, and they have no effect "
6617 "on the execution of a program."
6618 msgstr ""
6619
6620 #. type: Plain text
6621 #: build/C/man3/pthread_setconcurrency.3:100
6622 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
6623 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
6624
6625 #. type: TH
6626 #: build/C/man3/pthread_setschedparam.3:24
6627 #, no-wrap
6628 msgid "PTHREAD_SETSCHEDPARAM"
6629 msgstr "PTHREAD_SETSCHEDPARAM"
6630
6631 #. type: Plain text
6632 #: build/C/man3/pthread_setschedparam.3:28
6633 msgid ""
6634 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
6635 "parameters of a thread"
6636 msgstr ""
6637
6638 #. type: Plain text
6639 #: build/C/man3/pthread_setschedparam.3:36
6640 #, no-wrap
6641 msgid ""
6642 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
6643 "B<                      const struct sched_param *>I<param>B<);>\n"
6644 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
6645 "B<                      struct sched_param *>I<param>B<);>\n"
6646 msgstr ""
6647 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
6648 "B<                      const struct sched_param *>I<param>B<);>\n"
6649 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
6650 "B<                      struct sched_param *>I<param>B<);>\n"
6651
6652 #. type: Plain text
6653 #: build/C/man3/pthread_setschedparam.3:44
6654 msgid ""
6655 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
6656 "parameters of the thread I<thread>."
6657 msgstr ""
6658
6659 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
6660 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
6661 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
6662 #. type: Plain text
6663 #: build/C/man3/pthread_setschedparam.3:55
6664 msgid ""
6665 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
6666 "values for I<policy>, and their semantics, are described in "
6667 "B<sched_setscheduler>(2)."
6668 msgstr ""
6669
6670 #. type: Plain text
6671 #: build/C/man3/pthread_setschedparam.3:61
6672 msgid ""
6673 "The structure pointed to by I<param> specifies the new scheduling parameters "
6674 "for I<thread>.  Scheduling parameters are maintained in the following "
6675 "structure:"
6676 msgstr ""
6677
6678 #.  FIXME . nptl/pthread_setschedparam.c has the following
6679 #.    /* If the thread should have higher priority because of some
6680 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
6681 #.  Eventually (perhaps after writing the mutexattr pages), we
6682 #.  may want to add something on the topic to this page.
6683 #. type: Plain text
6684 #: build/C/man3/pthread_setschedparam.3:102
6685 msgid ""
6686 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
6687 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
6688 "and I<param>, respectively.  The returned priority value is that set by the "
6689 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
6690 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
6691 "does not reflect any temporary priority adjustments as a result of calls to "
6692 "any priority inheritance or priority ceiling functions (see, for example, "
6693 "B<pthread_mutexattr_setprioceiling>(3)  and B<pthread_mutexattr_setprotocol>"
6694 "(3))."
6695 msgstr ""
6696
6697 #. type: Plain text
6698 #: build/C/man3/pthread_setschedparam.3:110
6699 msgid ""
6700 "On success, these functions return 0; on error, they return a nonzero error "
6701 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
6702 "parameters of I<thread> are not changed."
6703 msgstr ""
6704
6705 #. type: Plain text
6706 #: build/C/man3/pthread_setschedparam.3:112
6707 msgid "Both of these functions can fail with the following error:"
6708 msgstr ""
6709
6710 #. type: Plain text
6711 #: build/C/man3/pthread_setschedparam.3:120
6712 msgid ""
6713 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
6714 msgstr ""
6715
6716 #. type: Plain text
6717 #: build/C/man3/pthread_setschedparam.3:127
6718 msgid ""
6719 "I<policy> is not a recognized policy, or I<param> does not make sense for "
6720 "the I<policy>."
6721 msgstr ""
6722
6723 #. type: Plain text
6724 #: build/C/man3/pthread_setschedparam.3:131
6725 msgid ""
6726 "The caller does not have appropriate privileges to set the specified "
6727 "scheduling policy and parameters."
6728 msgstr ""
6729
6730 #.  .SH VERSIONS
6731 #.  Available since glibc 2.0
6732 #. type: Plain text
6733 #: build/C/man3/pthread_setschedparam.3:139
6734 msgid ""
6735 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
6736 "policy or scheduling parameters to an unsupported value\") error for "
6737 "B<pthread_setschedparam>()."
6738 msgstr ""
6739
6740 #. type: Plain text
6741 #: build/C/man3/pthread_setschedparam.3:147
6742 msgid ""
6743 "For a description of the permissions required to, and the effect of, "
6744 "changing a thread's scheduling policy and priority, and details of the "
6745 "permitted ranges for priorities in each scheduling policy, see "
6746 "B<sched_setscheduler>(2)."
6747 msgstr ""
6748
6749 #. type: Plain text
6750 #: build/C/man3/pthread_setschedparam.3:154
6751 msgid ""
6752 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
6753 "B<pthread_getschedparam>(), as well as the use of a number of other "
6754 "scheduling-related pthreads functions."
6755 msgstr ""
6756
6757 #. type: Plain text
6758 #: build/C/man3/pthread_setschedparam.3:170
6759 msgid ""
6760 "In the following run, the main thread sets its scheduling policy to "
6761 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
6762 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
6763 "priority attribute of 20.  The program then sets (using "
6764 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
6765 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
6766 "created using this attributes object should take their scheduling attributes "
6767 "from the thread attributes object.  The program then creates a thread using "
6768 "the thread attributes object, and that thread displays its scheduling policy "
6769 "and priority."
6770 msgstr ""
6771
6772 #. type: Plain text
6773 #: build/C/man3/pthread_setschedparam.3:178
6774 #, no-wrap
6775 msgid ""
6776 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
6777 "Password:\n"
6778 "# B<./a.out -mf10 -ar20 -i e>\n"
6779 "Scheduler settings of main thread\n"
6780 "    policy=SCHED_FIFO, priority=10\n"
6781 msgstr ""
6782 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
6783 "Password:\n"
6784 "# B<./a.out -mf10 -ar20 -i e>\n"
6785 "Scheduler settings of main thread\n"
6786 "    policy=SCHED_FIFO, priority=10\n"
6787
6788 #. type: Plain text
6789 #: build/C/man3/pthread_setschedparam.3:182
6790 #, no-wrap
6791 msgid ""
6792 "Scheduler settings in \\(aqattr\\(aq\n"
6793 "    policy=SCHED_RR, priority=20\n"
6794 "    inheritsched is EXPLICIT\n"
6795 msgstr ""
6796 "Scheduler settings in \\(aqattr\\(aq\n"
6797 "    policy=SCHED_RR, priority=20\n"
6798 "    inheritsched is EXPLICIT\n"
6799
6800 #. type: Plain text
6801 #: build/C/man3/pthread_setschedparam.3:185
6802 #, no-wrap
6803 msgid ""
6804 "Scheduler attributes of new thread\n"
6805 "    policy=SCHED_RR, priority=20\n"
6806 msgstr ""
6807 "Scheduler attributes of new thread\n"
6808 "    policy=SCHED_RR, priority=20\n"
6809
6810 #. type: Plain text
6811 #: build/C/man3/pthread_setschedparam.3:190
6812 msgid ""
6813 "In the above output, one can see that the scheduling policy and priority "
6814 "were taken from the values specified in the thread attributes object."
6815 msgstr ""
6816
6817 #. type: Plain text
6818 #: build/C/man3/pthread_setschedparam.3:197
6819 msgid ""
6820 "The next run is the same as the previous, except that the inherit scheduler "
6821 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
6822 "using the thread attributes object should ignore the scheduling attributes "
6823 "specified in the attributes object and instead take their scheduling "
6824 "attributes from the creating thread."
6825 msgstr ""
6826
6827 #. type: Plain text
6828 #: build/C/man3/pthread_setschedparam.3:203
6829 #, no-wrap
6830 msgid ""
6831 "# B<./a.out -mf10 -ar20 -i i>\n"
6832 "Scheduler settings of main thread\n"
6833 "    policy=SCHED_FIFO, priority=10\n"
6834 msgstr ""
6835 "# B<./a.out -mf10 -ar20 -i i>\n"
6836 "Scheduler settings of main thread\n"
6837 "    policy=SCHED_FIFO, priority=10\n"
6838
6839 #. type: Plain text
6840 #: build/C/man3/pthread_setschedparam.3:207
6841 #, no-wrap
6842 msgid ""
6843 "Scheduler settings in \\(aqattr\\(aq\n"
6844 "    policy=SCHED_RR, priority=20\n"
6845 "    inheritsched is INHERIT\n"
6846 msgstr ""
6847 "Scheduler settings in \\(aqattr\\(aq\n"
6848 "    policy=SCHED_RR, priority=20\n"
6849 "    inheritsched is INHERIT\n"
6850
6851 #. type: Plain text
6852 #: build/C/man3/pthread_setschedparam.3:210
6853 #, no-wrap
6854 msgid ""
6855 "Scheduler attributes of new thread\n"
6856 "    policy=SCHED_FIFO, priority=10\n"
6857 msgstr ""
6858 "Scheduler attributes of new thread\n"
6859 "    policy=SCHED_FIFO, priority=10\n"
6860
6861 #. type: Plain text
6862 #: build/C/man3/pthread_setschedparam.3:216
6863 msgid ""
6864 "In the above output, one can see that the scheduling policy and priority "
6865 "were taken from the creating thread, rather than the thread attributes "
6866 "object."
6867 msgstr ""
6868
6869 #. type: Plain text
6870 #: build/C/man3/pthread_setschedparam.3:222
6871 msgid ""
6872 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
6873 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
6874 "scheduler attribute."
6875 msgstr ""
6876
6877 #. type: Plain text
6878 #: build/C/man3/pthread_setschedparam.3:226
6879 #, no-wrap
6880 msgid "/* pthreads_sched_test.c */\n"
6881 msgstr "/* pthreads_sched_test.c */\n"
6882
6883 #. type: Plain text
6884 #: build/C/man3/pthread_setschedparam.3:232
6885 #, no-wrap
6886 msgid ""
6887 "#include E<lt>pthread.hE<gt>\n"
6888 "#include E<lt>stdio.hE<gt>\n"
6889 "#include E<lt>stdlib.hE<gt>\n"
6890 "#include E<lt>unistd.hE<gt>\n"
6891 "#include E<lt>errno.hE<gt>\n"
6892 msgstr ""
6893 "#include E<lt>pthread.hE<gt>\n"
6894 "#include E<lt>stdio.hE<gt>\n"
6895 "#include E<lt>stdlib.hE<gt>\n"
6896 "#include E<lt>unistd.hE<gt>\n"
6897 "#include E<lt>errno.hE<gt>\n"
6898
6899 #. type: Plain text
6900 #: build/C/man3/pthread_setschedparam.3:241
6901 #, no-wrap
6902 msgid ""
6903 "static void\n"
6904 "usage(char *prog_name, char *msg)\n"
6905 "{\n"
6906 "    if (msg != NULL)\n"
6907 "        fputs(msg, stderr);\n"
6908 msgstr ""
6909 "static void\n"
6910 "usage(char *prog_name, char *msg)\n"
6911 "{\n"
6912 "    if (msg != NULL)\n"
6913 "        fputs(msg, stderr);\n"
6914
6915 #. type: Plain text
6916 #: build/C/man3/pthread_setschedparam.3:258
6917 #, no-wrap
6918 msgid ""
6919 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
6920 "    fprintf(stderr, \"Options are:\\en\");\n"
6921 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
6922 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
6923 "    fpe(\"                 thread attributes object\\en\");\n"
6924 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
6925 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
6926 "    fpe(\"                     r  SCHED_RR\\en\");\n"
6927 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
6928 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
6929 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
6930 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
6931 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
6932 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
6933 "    exit(EXIT_FAILURE);\n"
6934 "}\n"
6935 msgstr ""
6936 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
6937 "    fprintf(stderr, \"Options are:\\en\");\n"
6938 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
6939 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
6940 "    fpe(\"                 thread attributes object\\en\");\n"
6941 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
6942 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
6943 "    fpe(\"                     r  SCHED_RR\\en\");\n"
6944 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
6945 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
6946 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
6947 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
6948 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
6949 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
6950 "    exit(EXIT_FAILURE);\n"
6951 "}\n"
6952
6953 #. type: Plain text
6954 #: build/C/man3/pthread_setschedparam.3:269
6955 #, no-wrap
6956 msgid ""
6957 "static int\n"
6958 "get_policy(char p, int *policy)\n"
6959 "{\n"
6960 "    switch (p) {\n"
6961 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
6962 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
6963 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
6964 "    default:  return 0;\n"
6965 "    }\n"
6966 "}\n"
6967 msgstr ""
6968 "static int\n"
6969 "get_policy(char p, int *policy)\n"
6970 "{\n"
6971 "    switch (p) {\n"
6972 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
6973 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
6974 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
6975 "    default:  return 0;\n"
6976 "    }\n"
6977 "}\n"
6978
6979 #. type: Plain text
6980 #: build/C/man3/pthread_setschedparam.3:280
6981 #, no-wrap
6982 msgid ""
6983 "static void\n"
6984 "display_sched_attr(int policy, struct sched_param *param)\n"
6985 "{\n"
6986 "    printf(\"    policy=%s, priority=%d\\en\",\n"
6987 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
6988 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
6989 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
6990 "            \"???\",\n"
6991 "            param-E<gt>sched_priority);\n"
6992 "}\n"
6993 msgstr ""
6994 "static void\n"
6995 "display_sched_attr(int policy, struct sched_param *param)\n"
6996 "{\n"
6997 "    printf(\"    policy=%s, priority=%d\\en\",\n"
6998 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
6999 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
7000 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
7001 "            \"???\",\n"
7002 "            param-E<gt>sched_priority);\n"
7003 "}\n"
7004
7005 #. type: Plain text
7006 #: build/C/man3/pthread_setschedparam.3:286
7007 #, no-wrap
7008 msgid ""
7009 "static void\n"
7010 "display_thread_sched_attr(char *msg)\n"
7011 "{\n"
7012 "    int policy, s;\n"
7013 "    struct sched_param param;\n"
7014 msgstr ""
7015 "static void\n"
7016 "display_thread_sched_attr(char *msg)\n"
7017 "{\n"
7018 "    int policy, s;\n"
7019 "    struct sched_param param;\n"
7020
7021 #. type: Plain text
7022 #: build/C/man3/pthread_setschedparam.3:290
7023 #, no-wrap
7024 msgid ""
7025 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
7026 "    if (s != 0)\n"
7027 "        handle_error_en(s, \"pthread_getschedparam\");\n"
7028 msgstr ""
7029 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
7030 "    if (s != 0)\n"
7031 "        handle_error_en(s, \"pthread_getschedparam\");\n"
7032
7033 #. type: Plain text
7034 #: build/C/man3/pthread_setschedparam.3:294
7035 #, no-wrap
7036 msgid ""
7037 "    printf(\"%s\\en\", msg);\n"
7038 "    display_sched_attr(policy, &param);\n"
7039 "}\n"
7040 msgstr ""
7041 "    printf(\"%s\\en\", msg);\n"
7042 "    display_sched_attr(policy, &param);\n"
7043 "}\n"
7044
7045 #. type: Plain text
7046 #: build/C/man3/pthread_setschedparam.3:299
7047 #, no-wrap
7048 msgid ""
7049 "static void *\n"
7050 "thread_start(void *arg)\n"
7051 "{\n"
7052 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7053 msgstr ""
7054 "static void *\n"
7055 "thread_start(void *arg)\n"
7056 "{\n"
7057 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7058
7059 #. type: Plain text
7060 #: build/C/man3/pthread_setschedparam.3:302
7061 #, no-wrap
7062 msgid ""
7063 "    return NULL;\n"
7064 "}\n"
7065 msgstr ""
7066 "    return NULL;\n"
7067 "}\n"
7068
7069 #. type: Plain text
7070 #: build/C/man3/pthread_setschedparam.3:312
7071 #, no-wrap
7072 msgid ""
7073 "int\n"
7074 "main(int argc, char *argv[])\n"
7075 "{\n"
7076 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
7077 "    pthread_t thread;\n"
7078 "    pthread_attr_t attr;\n"
7079 "    pthread_attr_t *attrp;\n"
7080 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7081 "    struct sched_param param;\n"
7082 msgstr ""
7083 "int\n"
7084 "main(int argc, char *argv[])\n"
7085 "{\n"
7086 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
7087 "    pthread_t thread;\n"
7088 "    pthread_attr_t attr;\n"
7089 "    pthread_attr_t *attrp;\n"
7090 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7091 "    struct sched_param param;\n"
7092
7093 #. type: Plain text
7094 #: build/C/man3/pthread_setschedparam.3:314
7095 #, no-wrap
7096 msgid "    /* Process command-line options */\n"
7097 msgstr "    /* Process command-line options */\n"
7098
7099 #. type: Plain text
7100 #: build/C/man3/pthread_setschedparam.3:319
7101 #, no-wrap
7102 msgid ""
7103 "    use_null_attrib = 0;\n"
7104 "    attr_sched_str = NULL;\n"
7105 "    main_sched_str = NULL;\n"
7106 "    inheritsched_str = NULL;\n"
7107 msgstr ""
7108 "    use_null_attrib = 0;\n"
7109 "    attr_sched_str = NULL;\n"
7110 "    main_sched_str = NULL;\n"
7111 "    inheritsched_str = NULL;\n"
7112
7113 #. type: Plain text
7114 #: build/C/man3/pthread_setschedparam.3:329
7115 #, no-wrap
7116 msgid ""
7117 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7118 "        switch (opt) {\n"
7119 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
7120 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
7121 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
7122 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
7123 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
7124 "        }\n"
7125 "    }\n"
7126 msgstr ""
7127 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7128 "        switch (opt) {\n"
7129 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
7130 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
7131 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
7132 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
7133 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
7134 "        }\n"
7135 "    }\n"
7136
7137 #. type: Plain text
7138 #: build/C/man3/pthread_setschedparam.3:333
7139 #, no-wrap
7140 msgid ""
7141 "    if (use_null_attrib &&\n"
7142 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7143 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7144 msgstr ""
7145 "    if (use_null_attrib &&\n"
7146 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7147 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7148
7149 #. type: Plain text
7150 #: build/C/man3/pthread_setschedparam.3:336
7151 #, no-wrap
7152 msgid ""
7153 "    /* Optionally set scheduling attributes of main thread,\n"
7154 "       and display the attributes */\n"
7155 msgstr ""
7156 "    /* Optionally set scheduling attributes of main thread,\n"
7157 "       and display the attributes */\n"
7158
7159 #. type: Plain text
7160 #: build/C/man3/pthread_setschedparam.3:341
7161 #, no-wrap
7162 msgid ""
7163 "    if (main_sched_str != NULL) {\n"
7164 "        if (!get_policy(main_sched_str[0], &policy))\n"
7165 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
7166 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7167 msgstr ""
7168 "    if (main_sched_str != NULL) {\n"
7169 "        if (!get_policy(main_sched_str[0], &policy))\n"
7170 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
7171 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7172
7173 #. type: Plain text
7174 #: build/C/man3/pthread_setschedparam.3:346
7175 #, no-wrap
7176 msgid ""
7177 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
7178 "        if (s != 0)\n"
7179 "            handle_error_en(s, \"pthread_setschedparam\");\n"
7180 "    }\n"
7181 msgstr ""
7182 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
7183 "        if (s != 0)\n"
7184 "            handle_error_en(s, \"pthread_setschedparam\");\n"
7185 "    }\n"
7186
7187 #. type: Plain text
7188 #: build/C/man3/pthread_setschedparam.3:349
7189 #, no-wrap
7190 msgid ""
7191 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7192 "    printf(\"\\en\");\n"
7193 msgstr ""
7194 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7195 "    printf(\"\\en\");\n"
7196
7197 #. type: Plain text
7198 #: build/C/man3/pthread_setschedparam.3:351
7199 #, no-wrap
7200 msgid "    /* Initialize thread attributes object according to options */\n"
7201 msgstr "    /* Initialize thread attributes object according to options */\n"
7202
7203 #. type: Plain text
7204 #: build/C/man3/pthread_setschedparam.3:360
7205 #, no-wrap
7206 msgid ""
7207 "    if (!use_null_attrib) {\n"
7208 "        s = pthread_attr_init(&attr);\n"
7209 "        if (s != 0)\n"
7210 "            handle_error_en(s, \"pthread_attr_init\");\n"
7211 "        attrp = &attr;\n"
7212 "    }\n"
7213 msgstr ""
7214 "    if (!use_null_attrib) {\n"
7215 "        s = pthread_attr_init(&attr);\n"
7216 "        if (s != 0)\n"
7217 "            handle_error_en(s, \"pthread_attr_init\");\n"
7218 "        attrp = &attr;\n"
7219 "    }\n"
7220
7221 #. type: Plain text
7222 #: build/C/man3/pthread_setschedparam.3:368
7223 #, no-wrap
7224 msgid ""
7225 "    if (inheritsched_str != NULL) {\n"
7226 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7227 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7228 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7229 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
7230 "        else\n"
7231 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7232 msgstr ""
7233 "    if (inheritsched_str != NULL) {\n"
7234 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7235 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7236 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7237 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
7238 "        else\n"
7239 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7240
7241 #. type: Plain text
7242 #: build/C/man3/pthread_setschedparam.3:373
7243 #, no-wrap
7244 msgid ""
7245 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7246 "        if (s != 0)\n"
7247 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7248 "    }\n"
7249 msgstr ""
7250 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7251 "        if (s != 0)\n"
7252 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7253 "    }\n"
7254
7255 #. type: Plain text
7256 #: build/C/man3/pthread_setschedparam.3:379
7257 #, no-wrap
7258 msgid ""
7259 "    if (attr_sched_str != NULL) {\n"
7260 "        if (!get_policy(attr_sched_str[0], &policy))\n"
7261 "            usage(argv[0],\n"
7262 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7263 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7264 msgstr ""
7265 "    if (attr_sched_str != NULL) {\n"
7266 "        if (!get_policy(attr_sched_str[0], &policy))\n"
7267 "            usage(argv[0],\n"
7268 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7269 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7270
7271 #. type: Plain text
7272 #: build/C/man3/pthread_setschedparam.3:387
7273 #, no-wrap
7274 msgid ""
7275 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
7276 "        if (s != 0)\n"
7277 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7278 "        s = pthread_attr_setschedparam(&attr, &param);\n"
7279 "        if (s != 0)\n"
7280 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7281 "    }\n"
7282 msgstr ""
7283 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
7284 "        if (s != 0)\n"
7285 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7286 "        s = pthread_attr_setschedparam(&attr, &param);\n"
7287 "        if (s != 0)\n"
7288 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7289 "    }\n"
7290
7291 #. type: Plain text
7292 #: build/C/man3/pthread_setschedparam.3:390
7293 #, no-wrap
7294 msgid ""
7295 "    /* If we initialized a thread attributes object, display\n"
7296 "       the scheduling attributes that were set in the object */\n"
7297 msgstr ""
7298 "    /* If we initialized a thread attributes object, display\n"
7299 "       the scheduling attributes that were set in the object */\n"
7300
7301 #. type: Plain text
7302 #: build/C/man3/pthread_setschedparam.3:398
7303 #, no-wrap
7304 msgid ""
7305 "    if (attrp != NULL) {\n"
7306 "        s = pthread_attr_getschedparam(&attr, &param);\n"
7307 "        if (s != 0)\n"
7308 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7309 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7310 "        if (s != 0)\n"
7311 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7312 msgstr ""
7313 "    if (attrp != NULL) {\n"
7314 "        s = pthread_attr_getschedparam(&attr, &param);\n"
7315 "        if (s != 0)\n"
7316 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7317 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7318 "        if (s != 0)\n"
7319 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7320
7321 #. type: Plain text
7322 #: build/C/man3/pthread_setschedparam.3:401
7323 #, no-wrap
7324 msgid ""
7325 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7326 "        display_sched_attr(policy, &param);\n"
7327 msgstr ""
7328 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7329 "        display_sched_attr(policy, &param);\n"
7330
7331 #. type: Plain text
7332 #: build/C/man3/pthread_setschedparam.3:409
7333 #, no-wrap
7334 msgid ""
7335 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7336 "        printf(\"    inheritsched is %s\\en\",\n"
7337 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
7338 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7339 "                \"???\");\n"
7340 "        printf(\"\\en\");\n"
7341 "    }\n"
7342 msgstr ""
7343 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7344 "        printf(\"    inheritsched is %s\\en\",\n"
7345 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
7346 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7347 "                \"???\");\n"
7348 "        printf(\"\\en\");\n"
7349 "    }\n"
7350
7351 #. type: Plain text
7352 #: build/C/man3/pthread_setschedparam.3:411
7353 #, no-wrap
7354 msgid "    /* Create a thread that will display its scheduling attributes */\n"
7355 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
7356
7357 #. type: Plain text
7358 #: build/C/man3/pthread_setschedparam.3:415
7359 #, no-wrap
7360 msgid ""
7361 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7362 "    if (s != 0)\n"
7363 "        handle_error_en(s, \"pthread_create\");\n"
7364 msgstr ""
7365 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7366 "    if (s != 0)\n"
7367 "        handle_error_en(s, \"pthread_create\");\n"
7368
7369 #. type: Plain text
7370 #: build/C/man3/pthread_setschedparam.3:417
7371 #, no-wrap
7372 msgid "    /* Destroy unneeded thread attributes object */\n"
7373 msgstr "    /* Destroy unneeded thread attributes object */\n"
7374
7375 #. type: Plain text
7376 #: build/C/man3/pthread_setschedparam.3:425
7377 #, no-wrap
7378 msgid ""
7379 "    s = pthread_join(thread, NULL);\n"
7380 "    if (s != 0)\n"
7381 "        handle_error_en(s, \"pthread_join\");\n"
7382 msgstr ""
7383 "    s = pthread_join(thread, NULL);\n"
7384 "    if (s != 0)\n"
7385 "        handle_error_en(s, \"pthread_join\");\n"
7386
7387 #. type: Plain text
7388 #: build/C/man3/pthread_setschedparam.3:440
7389 msgid ""
7390 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7391 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7392 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7393 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
7394 "B<pthreads>(7)"
7395 msgstr ""
7396 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7397 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7398 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7399 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
7400 "B<pthreads>(7)"
7401
7402 #. type: TH
7403 #: build/C/man3/pthread_setschedprio.3:24
7404 #, no-wrap
7405 msgid "PTHREAD_SETSCHEDPRIO"
7406 msgstr "PTHREAD_SETSCHEDPRIO"
7407
7408 #. type: TH
7409 #: build/C/man3/pthread_setschedprio.3:24
7410 #, no-wrap
7411 msgid "2008-11-06"
7412 msgstr "2008-11-06"
7413
7414 #. type: Plain text
7415 #: build/C/man3/pthread_setschedprio.3:27
7416 msgid "pthread_setschedprio - set scheduling priority of a thread"
7417 msgstr ""
7418
7419 #. type: Plain text
7420 #: build/C/man3/pthread_setschedprio.3:32
7421 #, no-wrap
7422 msgid "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
7423 msgstr "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
7424
7425 #.  FIXME . nptl/pthread_setschedprio.c has the following
7426 #.    /* If the thread should have higher priority because of some
7427 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
7428 #.  Eventually (perhaps after writing the mutexattr pages), we
7429 #.  may want to add something on the topic to this page.
7430 #.  nptl/pthread_setschedparam.c has a similar case.
7431 #. type: Plain text
7432 #: build/C/man3/pthread_setschedprio.3:51
7433 msgid ""
7434 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
7435 "thread I<thread> to the value specified in I<prio>.  (By contrast "
7436 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
7437 "of a thread.)"
7438 msgstr ""
7439
7440 #. type: Plain text
7441 #: build/C/man3/pthread_setschedprio.3:59
7442 msgid ""
7443 "On success, this function returns 0; on error, it returns a nonzero error "
7444 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
7445 "I<thread> is not changed."
7446 msgstr ""
7447
7448 #. type: Plain text
7449 #: build/C/man3/pthread_setschedprio.3:64
7450 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
7451 msgstr ""
7452
7453 #. type: Plain text
7454 #: build/C/man3/pthread_setschedprio.3:68
7455 msgid ""
7456 "The caller does not have appropriate privileges to set the specified "
7457 "priority."
7458 msgstr ""
7459
7460 #. type: Plain text
7461 #: build/C/man3/pthread_setschedprio.3:79
7462 msgid ""
7463 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
7464 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
7465 msgstr ""
7466
7467 #. type: Plain text
7468 #: build/C/man3/pthread_setschedprio.3:81
7469 msgid "This function is available in glibc since version 2.3.4."
7470 msgstr ""
7471
7472 #. type: Plain text
7473 #: build/C/man3/pthread_setschedprio.3:89
7474 msgid ""
7475 "For a description of the permissions required to, and the effect of, "
7476 "changing a thread's scheduling priority, and details of the permitted ranges "
7477 "for priorities in each scheduling policy, see B<sched_setscheduler>(2)."
7478 msgstr ""
7479
7480 #. type: Plain text
7481 #: build/C/man3/pthread_setschedprio.3:100
7482 msgid ""
7483 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7484 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7485 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7486 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
7487 "B<pthreads>(7)"
7488 msgstr ""
7489 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7490 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7491 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7492 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
7493 "B<pthreads>(7)"
7494
7495 #. type: TH
7496 #: build/C/man3/pthread_sigmask.3:24
7497 #, no-wrap
7498 msgid "PTHREAD_SIGMASK"
7499 msgstr "PTHREAD_SIGMASK"
7500
7501 #. type: TH
7502 #: build/C/man3/pthread_sigmask.3:24
7503 #, no-wrap
7504 msgid "2011-10-16"
7505 msgstr "2011-10-16"
7506
7507 #. type: Plain text
7508 #: build/C/man3/pthread_sigmask.3:27
7509 msgid "pthread_sigmask - examine and change mask of blocked signals"
7510 msgstr ""
7511
7512 #. type: Plain text
7513 #: build/C/man3/pthread_sigmask.3:33
7514 #, no-wrap
7515 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
7516 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
7517
7518 #. type: Plain text
7519 #: build/C/man3/pthread_sigmask.3:44
7520 msgid ""
7521 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
7522 "difference that its use in multithreaded programs is explicitly specified by "
7523 "POSIX.1-2001.  Other differences are noted in this page."
7524 msgstr ""
7525
7526 #. type: Plain text
7527 #: build/C/man3/pthread_sigmask.3:47
7528 msgid ""
7529 "For a description of the arguments and operation of this function, see "
7530 "B<sigprocmask>(2)."
7531 msgstr ""
7532
7533 #. type: Plain text
7534 #: build/C/man3/pthread_sigmask.3:52
7535 msgid ""
7536 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
7537 "number."
7538 msgstr ""
7539
7540 #. type: Plain text
7541 #: build/C/man3/pthread_sigmask.3:55
7542 msgid "See B<sigprocmask>(2)."
7543 msgstr ""
7544
7545 #. type: Plain text
7546 #: build/C/man3/pthread_sigmask.3:59
7547 msgid "A new thread inherits a copy of its creator's signal mask."
7548 msgstr ""
7549
7550 #. type: Plain text
7551 #: build/C/man3/pthread_sigmask.3:64
7552 msgid ""
7553 "The program below blocks some signals in the main thread, and then creates a "
7554 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
7555 "shell session demonstrates its use:"
7556 msgstr ""
7557
7558 #. type: Plain text
7559 #: build/C/man3/pthread_sigmask.3:75
7560 #, no-wrap
7561 msgid ""
7562 "$B< ./a.out &>\n"
7563 "[1] 5423\n"
7564 "$B< kill -QUIT %1>\n"
7565 "Signal handling thread got signal 3\n"
7566 "$B< kill -USR1 %1>\n"
7567 "Signal handling thread got signal 10\n"
7568 "$B< kill -TERM %1>\n"
7569 "[1]+  Terminated              ./a.out\n"
7570 msgstr ""
7571 "$B< ./a.out &>\n"
7572 "[1] 5423\n"
7573 "$B< kill -QUIT %1>\n"
7574 "Signal handling thread got signal 3\n"
7575 "$B< kill -USR1 %1>\n"
7576 "Signal handling thread got signal 10\n"
7577 "$B< kill -TERM %1>\n"
7578 "[1]+  Terminated              ./a.out\n"
7579
7580 #. type: Plain text
7581 #: build/C/man3/pthread_sigmask.3:86
7582 #, no-wrap
7583 msgid ""
7584 "#include E<lt>pthread.hE<gt>\n"
7585 "#include E<lt>stdio.hE<gt>\n"
7586 "#include E<lt>stdlib.hE<gt>\n"
7587 "#include E<lt>unistd.hE<gt>\n"
7588 "#include E<lt>signal.hE<gt>\n"
7589 "#include E<lt>errno.hE<gt>\n"
7590 msgstr ""
7591 "#include E<lt>pthread.hE<gt>\n"
7592 "#include E<lt>stdio.hE<gt>\n"
7593 "#include E<lt>stdlib.hE<gt>\n"
7594 "#include E<lt>unistd.hE<gt>\n"
7595 "#include E<lt>signal.hE<gt>\n"
7596 "#include E<lt>errno.hE<gt>\n"
7597
7598 #. type: Plain text
7599 #: build/C/man3/pthread_sigmask.3:88
7600 #, no-wrap
7601 msgid "/* Simple error handling functions */\n"
7602 msgstr "/* Simple error handling functions */\n"
7603
7604 #. type: Plain text
7605 #: build/C/man3/pthread_sigmask.3:97
7606 #, no-wrap
7607 msgid ""
7608 "static void *\n"
7609 "sig_thread(void *arg)\n"
7610 "{\n"
7611 "    sigset_t *set = (sigset_t *) arg;\n"
7612 "    int s, sig;\n"
7613 msgstr ""
7614 "static void *\n"
7615 "sig_thread(void *arg)\n"
7616 "{\n"
7617 "    sigset_t *set = (sigset_t *) arg;\n"
7618 "    int s, sig;\n"
7619
7620 #. type: Plain text
7621 #: build/C/man3/pthread_sigmask.3:105
7622 #, no-wrap
7623 msgid ""
7624 "    for (;;) {\n"
7625 "        s = sigwait(set, &sig);\n"
7626 "        if (s != 0)\n"
7627 "            handle_error_en(s, \"sigwait\");\n"
7628 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
7629 "    }\n"
7630 "}\n"
7631 msgstr ""
7632 "    for (;;) {\n"
7633 "        s = sigwait(set, &sig);\n"
7634 "        if (s != 0)\n"
7635 "            handle_error_en(s, \"sigwait\");\n"
7636 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
7637 "    }\n"
7638 "}\n"
7639
7640 #. type: Plain text
7641 #: build/C/man3/pthread_sigmask.3:112
7642 #, no-wrap
7643 msgid ""
7644 "int\n"
7645 "main(int argc, char *argv[])\n"
7646 "{\n"
7647 "    pthread_t thread;\n"
7648 "    sigset_t set;\n"
7649 "    int s;\n"
7650 msgstr ""
7651 "int\n"
7652 "main(int argc, char *argv[])\n"
7653 "{\n"
7654 "    pthread_t thread;\n"
7655 "    sigset_t set;\n"
7656 "    int s;\n"
7657
7658 #. type: Plain text
7659 #: build/C/man3/pthread_sigmask.3:115
7660 #, no-wrap
7661 msgid ""
7662 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
7663 "       will inherit a copy of the signal mask. */\n"
7664 msgstr ""
7665 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
7666 "       will inherit a copy of the signal mask. */\n"
7667
7668 #. type: Plain text
7669 #: build/C/man3/pthread_sigmask.3:122
7670 #, no-wrap
7671 msgid ""
7672 "    sigemptyset(&set);\n"
7673 "    sigaddset(&set, SIGQUIT);\n"
7674 "    sigaddset(&set, SIGUSR1);\n"
7675 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
7676 "    if (s != 0)\n"
7677 "        handle_error_en(s, \"pthread_sigmask\");\n"
7678 msgstr ""
7679 "    sigemptyset(&set);\n"
7680 "    sigaddset(&set, SIGQUIT);\n"
7681 "    sigaddset(&set, SIGUSR1);\n"
7682 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
7683 "    if (s != 0)\n"
7684 "        handle_error_en(s, \"pthread_sigmask\");\n"
7685
7686 #. type: Plain text
7687 #: build/C/man3/pthread_sigmask.3:126
7688 #, no-wrap
7689 msgid ""
7690 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
7691 "    if (s != 0)\n"
7692 "        handle_error_en(s, \"pthread_create\");\n"
7693 msgstr ""
7694 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
7695 "    if (s != 0)\n"
7696 "        handle_error_en(s, \"pthread_create\");\n"
7697
7698 #. type: Plain text
7699 #: build/C/man3/pthread_sigmask.3:129
7700 #, no-wrap
7701 msgid ""
7702 "    /* Main thread carries on to create other threads and/or do\n"
7703 "       other work */\n"
7704 msgstr ""
7705 "    /* Main thread carries on to create other threads and/or do\n"
7706 "       other work */\n"
7707
7708 #. type: Plain text
7709 #: build/C/man3/pthread_sigmask.3:132
7710 #, no-wrap
7711 msgid ""
7712 "    pause();            /* Dummy pause so we can test program */\n"
7713 "}\n"
7714 msgstr ""
7715 "    pause();            /* Dummy pause so we can test program */\n"
7716 "}\n"
7717
7718 #. type: Plain text
7719 #: build/C/man3/pthread_sigmask.3:141
7720 msgid ""
7721 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), "
7722 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
7723 msgstr ""
7724 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), "
7725 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
7726
7727 #. type: TH
7728 #: build/C/man3/pthread_sigqueue.3:23
7729 #, no-wrap
7730 msgid "PTHREAD_SIGQUEUE"
7731 msgstr "PTHREAD_SIGQUEUE"
7732
7733 #. type: TH
7734 #: build/C/man3/pthread_sigqueue.3:23
7735 #, no-wrap
7736 msgid "2011-09-23"
7737 msgstr "2011-09-23"
7738
7739 #. type: Plain text
7740 #: build/C/man3/pthread_sigqueue.3:26
7741 msgid "pthread_sigqueue - queue a signal and data to a thread"
7742 msgstr ""
7743
7744 #. type: Plain text
7745 #: build/C/man3/pthread_sigqueue.3:32
7746 #, no-wrap
7747 msgid ""
7748 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
7749 "B<                     const union sigval >I<value>B<);>\n"
7750 msgstr ""
7751 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
7752 "B<                     const union sigval >I<value>B<);>\n"
7753
7754 #. type: Plain text
7755 #: build/C/man3/pthread_sigqueue.3:43
7756 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
7757 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
7758
7759 #. type: Plain text
7760 #: build/C/man3/pthread_sigqueue.3:51
7761 msgid ""
7762 "The B<pthread_sigqueue>()  function performs a similar task to B<sigqueue>"
7763 "(3), but, rather than sending a signal to another process, it sends a signal "
7764 "to another thread in the same process as the calling thread."
7765 msgstr ""
7766
7767 #. type: Plain text
7768 #: build/C/man3/pthread_sigqueue.3:63
7769 msgid ""
7770 "The I<thread> argument is the ID of another thread in the same process as "
7771 "the caller.  The I<sig> argument specifies the signal to be sent.  The "
7772 "I<value> argument specifies data to accompany the signal; see B<sigqueue>"
7773 "(3)  for details."
7774 msgstr ""
7775
7776 #. type: Plain text
7777 #: build/C/man3/pthread_sigqueue.3:68
7778 msgid ""
7779 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
7780 "number."
7781 msgstr ""
7782
7783 #. type: Plain text
7784 #: build/C/man3/pthread_sigqueue.3:75
7785 msgid ""
7786 "The limit of signals which may be queued has been reached.  (See B<signal>"
7787 "(7)  for further information.)"
7788 msgstr ""
7789
7790 #. type: Plain text
7791 #: build/C/man3/pthread_sigqueue.3:79
7792 msgid "I<sig> was invalid."
7793 msgstr ""
7794
7795 #. type: TP
7796 #: build/C/man3/pthread_sigqueue.3:79
7797 #, no-wrap
7798 msgid "B<ENOSYS>"
7799 msgstr "B<ENOSYS>"
7800
7801 #. type: Plain text
7802 #: build/C/man3/pthread_sigqueue.3:83
7803 msgid "B<pthread_sigqueue>()  is not supported on this system."
7804 msgstr ""
7805
7806 #. type: Plain text
7807 #: build/C/man3/pthread_sigqueue.3:87
7808 msgid "I<thread> is not valid."
7809 msgstr ""
7810
7811 #. type: Plain text
7812 #: build/C/man3/pthread_sigqueue.3:91
7813 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
7814 msgstr ""
7815
7816 #. type: Plain text
7817 #: build/C/man3/pthread_sigqueue.3:93
7818 msgid "This function is a GNU extension."
7819 msgstr ""
7820
7821 #. type: Plain text
7822 #: build/C/man3/pthread_sigqueue.3:100
7823 msgid ""
7824 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), B<sigqueue>"
7825 "(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
7826 msgstr ""
7827 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
7828 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
7829
7830 #. type: TH
7831 #: build/C/man3/pthread_testcancel.3:24
7832 #, no-wrap
7833 msgid "PTHREAD_TESTCANCEL"
7834 msgstr "PTHREAD_TESTCANCEL"
7835
7836 #. type: TH
7837 #: build/C/man3/pthread_testcancel.3:24
7838 #, fuzzy, no-wrap
7839 #| msgid "2012-03-15"
7840 msgid "2012-04-14"
7841 msgstr "2012-03-15"
7842
7843 #. type: Plain text
7844 #: build/C/man3/pthread_testcancel.3:27
7845 msgid ""
7846 "pthread_testcancel - request delivery of any pending cancellation request"
7847 msgstr ""
7848
7849 #. type: Plain text
7850 #: build/C/man3/pthread_testcancel.3:32
7851 #, no-wrap
7852 msgid "B<void pthread_testcancel(void);>\n"
7853 msgstr "B<void pthread_testcancel(void);>\n"
7854
7855 #. type: Plain text
7856 #: build/C/man3/pthread_testcancel.3:41
7857 msgid ""
7858 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
7859 "calling thread, so that a thread that is otherwise executing code that "
7860 "contains no cancellation points will respond to a cancellation request."
7861 msgstr ""
7862
7863 #. type: Plain text
7864 #: build/C/man3/pthread_testcancel.3:48
7865 msgid ""
7866 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
7867 "cancellation request is pending, then a call to B<pthread_testcancel>(3)  "
7868 "has no effect."
7869 msgstr ""
7870
7871 #. type: Plain text
7872 #: build/C/man3/pthread_testcancel.3:52
7873 msgid ""
7874 "This function does not return a value.  If the calling thread is canceled as "
7875 "a consequence of a call to this function, then the function does not return."
7876 msgstr ""
7877
7878 #. type: Plain text
7879 #: build/C/man3/pthread_testcancel.3:61
7880 msgid "See B<pthread_cleanup_push>(3)."
7881 msgstr ""
7882
7883 #. type: Plain text
7884 #: build/C/man3/pthread_testcancel.3:65
7885 msgid ""
7886 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
7887 "(3), B<pthreads>(7)"
7888 msgstr ""
7889 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
7890 "(3), B<pthreads>(7)"
7891
7892 #. type: TH
7893 #: build/C/man3/pthread_tryjoin_np.3:24
7894 #, no-wrap
7895 msgid "PTHREAD_TRYJOIN_NP"
7896 msgstr "PTHREAD_TRYJOIN_NP"
7897
7898 #. type: Plain text
7899 #: build/C/man3/pthread_tryjoin_np.3:28
7900 msgid ""
7901 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
7902 "thread"
7903 msgstr ""
7904
7905 #. type: Plain text
7906 #: build/C/man3/pthread_tryjoin_np.3:34
7907 #, no-wrap
7908 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
7909 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
7910
7911 #. type: Plain text
7912 #: build/C/man3/pthread_tryjoin_np.3:37
7913 #, no-wrap
7914 msgid ""
7915 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
7916 "B<                         const struct timespec *>I<abstime>B<);>\n"
7917 msgstr ""
7918 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
7919 "B<                         const struct timespec *>I<abstime>B<);>\n"
7920
7921 #. type: Plain text
7922 #: build/C/man3/pthread_tryjoin_np.3:44
7923 msgid ""
7924 "These functions operate in the same way as B<pthread_join>(3), except for "
7925 "the differences described on this page."
7926 msgstr ""
7927
7928 #. type: Plain text
7929 #: build/C/man3/pthread_tryjoin_np.3:56
7930 msgid ""
7931 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
7932 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
7933 "I<thread> has not yet terminated, then instead of blocking, as is done by "
7934 "B<pthread_join>(3), the call returns an error."
7935 msgstr ""
7936
7937 #. type: Plain text
7938 #: build/C/man3/pthread_tryjoin_np.3:74
7939 msgid ""
7940 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
7941 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
7942 "specified in I<abstime>.  If the timeout expires before I<thread> "
7943 "terminates, the call returns an error.  The I<abstime> argument is a "
7944 "structure of the following form, specifying an absolute time measured since "
7945 "the Epoch (see B<time>(2)):"
7946 msgstr ""
7947
7948 #. type: Plain text
7949 #: build/C/man3/pthread_tryjoin_np.3:81
7950 #, no-wrap
7951 msgid ""
7952 "struct timespec {\n"
7953 "    time_t tv_sec;     /* seconds */\n"
7954 "    long   tv_nsec;    /* nanoseconds */\n"
7955 "};\n"
7956 msgstr ""
7957 "struct timespec {\n"
7958 "    time_t tv_sec;     /* seconds */\n"
7959 "    long   tv_nsec;    /* nanoseconds */\n"
7960 "};\n"
7961
7962 #. type: Plain text
7963 #: build/C/man3/pthread_tryjoin_np.3:87
7964 msgid ""
7965 "On success, these functions return 0; on error, they return an error number."
7966 msgstr ""
7967
7968 #. type: Plain text
7969 #: build/C/man3/pthread_tryjoin_np.3:92
7970 msgid ""
7971 "These functions can fail with the same errors as B<pthread_join>(3).  "
7972 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
7973 msgstr ""
7974
7975 #. type: TP
7976 #: build/C/man3/pthread_tryjoin_np.3:92
7977 #, no-wrap
7978 msgid "B<EBUSY>"
7979 msgstr "B<EBUSY>"
7980
7981 #. type: Plain text
7982 #: build/C/man3/pthread_tryjoin_np.3:96
7983 msgid "I<thread> had not yet terminated at the time of the call."
7984 msgstr ""
7985
7986 #. type: Plain text
7987 #: build/C/man3/pthread_tryjoin_np.3:99
7988 msgid ""
7989 "B<pthread_timedjoin_np>()  can in addition fail with the following error:"
7990 msgstr ""
7991
7992 #. type: TP
7993 #: build/C/man3/pthread_tryjoin_np.3:99
7994 #, no-wrap
7995 msgid "B<ETIMEDOUT>"
7996 msgstr "B<ETIMEDOUT>"
7997
7998 #. type: Plain text
7999 #: build/C/man3/pthread_tryjoin_np.3:104
8000 msgid "The call timed out before I<thread> terminated."
8001 msgstr ""
8002
8003 #. type: Plain text
8004 #: build/C/man3/pthread_tryjoin_np.3:108
8005 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
8006 msgstr ""
8007
8008 #. type: Plain text
8009 #: build/C/man3/pthread_tryjoin_np.3:110
8010 msgid "These functions first appeared in glibc in version 2.3.3."
8011 msgstr ""
8012
8013 #. type: Plain text
8014 #: build/C/man3/pthread_tryjoin_np.3:115
8015 msgid "The following code waits to join for up to 5 seconds:"
8016 msgstr ""
8017
8018 #. type: Plain text
8019 #: build/C/man3/pthread_tryjoin_np.3:119
8020 #, no-wrap
8021 msgid ""
8022 "    struct timespec ts;\n"
8023 "    int s;\n"
8024 msgstr ""
8025 "    struct timespec ts;\n"
8026 "    int s;\n"
8027
8028 #. type: Plain text
8029 #: build/C/man3/pthread_tryjoin_np.3:121
8030 #, no-wrap
8031 msgid "    ...\n"
8032 msgstr "    ...\n"
8033
8034 #. type: Plain text
8035 #: build/C/man3/pthread_tryjoin_np.3:125
8036 #, no-wrap
8037 msgid ""
8038 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8039 "\t/* Handle error */\n"
8040 "    }\n"
8041 msgstr ""
8042 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8043 "\t/* Handle error */\n"
8044 "    }\n"
8045
8046 #. type: Plain text
8047 #: build/C/man3/pthread_tryjoin_np.3:127
8048 #, no-wrap
8049 msgid "    ts.tv_sec += 5;\n"
8050 msgstr "    ts.tv_sec += 5;\n"
8051
8052 #. type: Plain text
8053 #: build/C/man3/pthread_tryjoin_np.3:132
8054 #, no-wrap
8055 msgid ""
8056 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8057 "    if (s != 0) {\n"
8058 "        /* Handle error */\n"
8059 "    }\n"
8060 msgstr ""
8061 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8062 "    if (s != 0) {\n"
8063 "        /* Handle error */\n"
8064 "    }\n"
8065
8066 #. type: Plain text
8067 #: build/C/man3/pthread_tryjoin_np.3:137
8068 msgid ""
8069 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8070 msgstr ""
8071 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8072
8073 #. type: TH
8074 #: build/C/man3/pthread_yield.3:23
8075 #, no-wrap
8076 msgid "PTHREAD_YIELD"
8077 msgstr "PTHREAD_YIELD"
8078
8079 #. type: Plain text
8080 #: build/C/man3/pthread_yield.3:26
8081 msgid "pthread_yield - yield the processor"
8082 msgstr ""
8083
8084 #. type: Plain text
8085 #: build/C/man3/pthread_yield.3:31
8086 #, no-wrap
8087 msgid "B<int pthread_yield(void);>\n"
8088 msgstr "B<int pthread_yield(void);>\n"
8089
8090 #. type: Plain text
8091 #: build/C/man3/pthread_yield.3:41
8092 msgid ""
8093 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
8094 "thread is placed at the end of the run queue for its static priority and "
8095 "another thread is scheduled to run.  For further details, see B<sched_yield>"
8096 "(2)"
8097 msgstr ""
8098
8099 #. type: Plain text
8100 #: build/C/man3/pthread_yield.3:46
8101 msgid ""
8102 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
8103 "number."
8104 msgstr ""
8105
8106 #. type: Plain text
8107 #: build/C/man3/pthread_yield.3:50
8108 msgid ""
8109 "On Linux, this call always succeeds (but portable and future-proof "
8110 "applications should nevertheless handle a possible error return)."
8111 msgstr ""
8112
8113 #.  e.g., the BSDs, Tru64, AIX, and Irix.
8114 #. type: Plain text
8115 #: build/C/man3/pthread_yield.3:56
8116 msgid ""
8117 "This call is nonstandard, but present on several other systems.  Use the "
8118 "standardized B<sched_yield>(2)  instead."
8119 msgstr ""
8120
8121 #. type: Plain text
8122 #: build/C/man3/pthread_yield.3:59
8123 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
8124 msgstr ""
8125
8126 #. type: Plain text
8127 #: build/C/man3/pthread_yield.3:62
8128 msgid "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
8129 msgstr "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
8130
8131 #. type: TH
8132 #: build/C/man7/pthreads.7:24
8133 #, no-wrap
8134 msgid "PTHREADS"
8135 msgstr "PTHREADS"
8136
8137 #. type: TH
8138 #: build/C/man7/pthreads.7:24
8139 #, no-wrap
8140 msgid "2010-11-14"
8141 msgstr "2010-11-14"
8142
8143 #. type: Plain text
8144 #: build/C/man7/pthreads.7:27
8145 msgid "pthreads - POSIX threads"
8146 msgstr "pthreads - POSIX スレッド"
8147
8148 #. type: Plain text
8149 #: build/C/man7/pthreads.7:34
8150 msgid ""
8151 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
8152 "programming commonly known as POSIX threads, or Pthreads.  A single process "
8153 "can contain multiple threads, all of which are executing the same program.  "
8154 "These threads share the same global memory (data and heap segments), but "
8155 "each thread has its own stack (automatic variables)."
8156 msgstr ""
8157 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
8158 "ラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロ"
8159 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
8160 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
8161 "スレッドは自分専用のスタック (自動変数) を持つ。"
8162
8163 #. type: Plain text
8164 #: build/C/man7/pthreads.7:37
8165 msgid ""
8166 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
8167 "these attributes are process-wide rather than per-thread):"
8168 msgstr ""
8169 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
8170 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
8171
8172 #. type: IP
8173 #: build/C/man7/pthreads.7:37 build/C/man7/pthreads.7:39
8174 #: build/C/man7/pthreads.7:41 build/C/man7/pthreads.7:43
8175 #: build/C/man7/pthreads.7:45 build/C/man7/pthreads.7:47
8176 #: build/C/man7/pthreads.7:49 build/C/man7/pthreads.7:52
8177 #: build/C/man7/pthreads.7:54 build/C/man7/pthreads.7:57
8178 #: build/C/man7/pthreads.7:63 build/C/man7/pthreads.7:68
8179 #: build/C/man7/pthreads.7:71 build/C/man7/pthreads.7:74
8180 #: build/C/man7/pthreads.7:82 build/C/man7/pthreads.7:86
8181 #: build/C/man7/pthreads.7:89 build/C/man7/pthreads.7:93
8182 #: build/C/man7/pthreads.7:96 build/C/man7/pthreads.7:103
8183 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
8184 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
8185 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
8186 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
8187 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
8188 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
8189 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
8190 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
8191 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
8192 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
8193 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
8194 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
8195 #: build/C/man7/pthreads.7:833
8196 #, no-wrap
8197 msgid "-"
8198 msgstr "-"
8199
8200 #. type: Plain text
8201 #: build/C/man7/pthreads.7:39
8202 msgid "process ID"
8203 msgstr "プロセス ID"
8204
8205 #. type: Plain text
8206 #: build/C/man7/pthreads.7:41
8207 msgid "parent process ID"
8208 msgstr "親プロセス ID"
8209
8210 #. type: Plain text
8211 #: build/C/man7/pthreads.7:43
8212 msgid "process group ID and session ID"
8213 msgstr "プロセスグループ ID とセッション ID"
8214
8215 #. type: Plain text
8216 #: build/C/man7/pthreads.7:45
8217 msgid "controlling terminal"
8218 msgstr "制御端末"
8219
8220 #. type: Plain text
8221 #: build/C/man7/pthreads.7:47
8222 msgid "user and group IDs"
8223 msgstr "ユーザ ID とグループ ID"
8224
8225 #. type: Plain text
8226 #: build/C/man7/pthreads.7:49
8227 msgid "open file descriptors"
8228 msgstr "オープンするファイルディスクリプタ"
8229
8230 #. type: Plain text
8231 #: build/C/man7/pthreads.7:52
8232 msgid "record locks (see B<fcntl>(2))"
8233 msgstr "レコードのロック (B<fcntl>(3)  参照)"
8234
8235 #. type: Plain text
8236 #: build/C/man7/pthreads.7:54
8237 msgid "signal dispositions"
8238 msgstr "シグナルの配置"
8239
8240 #. type: Plain text
8241 #: build/C/man7/pthreads.7:57
8242 msgid "file mode creation mask (B<umask>(2))"
8243 msgstr "ファイルモード作成マスク (B<umask>(2))"
8244
8245 #. type: Plain text
8246 #: build/C/man7/pthreads.7:63
8247 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
8248 msgstr ""
8249 "カレント・ディレクトリ (B<chdir>(2))  とルート・ディレクトリ (B<chroot>(2))"
8250
8251 #. type: Plain text
8252 #: build/C/man7/pthreads.7:68
8253 msgid ""
8254 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
8255 msgstr ""
8256 "インターバル・タイマ (B<setitimer>(2))  と POSIX タイマ (B<timer_create>(2))"
8257
8258 #. type: Plain text
8259 #: build/C/man7/pthreads.7:71
8260 msgid "nice value (B<setpriority>(2))"
8261 msgstr "nice 値 (B<setpriority>(2))"
8262
8263 #. type: Plain text
8264 #: build/C/man7/pthreads.7:74
8265 msgid "resource limits (B<setrlimit>(2))"
8266 msgstr "リソース制限 (B<setrlimit>(2))"
8267
8268 #. type: Plain text
8269 #: build/C/man7/pthreads.7:79
8270 msgid ""
8271 "measurements of the consumption of CPU time (B<times>(2))  and resources "
8272 "(B<getrusage>(2))"
8273 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
8274
8275 #. type: Plain text
8276 #: build/C/man7/pthreads.7:82
8277 msgid ""
8278 "As well as the stack, POSIX.1 specifies that various other attributes are "
8279 "distinct for each thread, including:"
8280 msgstr ""
8281 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
8282 "るかを規定している:"
8283
8284 #. type: Plain text
8285 #: build/C/man7/pthreads.7:86
8286 msgid "thread ID (the I<pthread_t> data type)"
8287 msgstr "スレッド ID (B<pthread_t> データ型)"
8288
8289 #. type: Plain text
8290 #: build/C/man7/pthreads.7:89
8291 msgid "signal mask (B<pthread_sigmask>(3))"
8292 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
8293
8294 #. type: Plain text
8295 #: build/C/man7/pthreads.7:93
8296 msgid "the I<errno> variable"
8297 msgstr "I<errno> 変数"
8298
8299 #. type: Plain text
8300 #: build/C/man7/pthreads.7:96
8301 msgid "alternate signal stack (B<sigaltstack>(2))"
8302 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
8303
8304 #. type: Plain text
8305 #: build/C/man7/pthreads.7:101
8306 msgid ""
8307 "real-time scheduling policy and priority (B<sched_setscheduler>(2)  and "
8308 "B<sched_setparam>(2))"
8309 msgstr ""
8310 "リアルタイム・スケジューリングのポリシーと優先度 (B<sched_setscheduler>(2)  "
8311 "と B<sched_setparam>(2))"
8312
8313 #. type: Plain text
8314 #: build/C/man7/pthreads.7:103
8315 msgid "The following Linux-specific features are also per-thread:"
8316 msgstr "以下の Linux 特有の機能もスレッド単位である:"
8317
8318 #. type: Plain text
8319 #: build/C/man7/pthreads.7:106
8320 msgid "capabilities (see B<capabilities>(7))"
8321 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
8322
8323 #. type: Plain text
8324 #: build/C/man7/pthreads.7:109
8325 msgid "CPU affinity (B<sched_setaffinity>(2))"
8326 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
8327
8328 #. type: SS
8329 #: build/C/man7/pthreads.7:109
8330 #, no-wrap
8331 msgid "Pthreads function return values"
8332 msgstr "pthreads 関数の返り値"
8333
8334 #. type: Plain text
8335 #: build/C/man7/pthreads.7:116
8336 msgid ""
8337 "Most pthreads functions return 0 on success, and an error number of "
8338 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
8339 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
8340 "the function can never fail with the error B<EINTR>."
8341 msgstr ""
8342 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
8343 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
8344 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
8345 "は決してないと規定している。"
8346
8347 #. type: SS
8348 #: build/C/man7/pthreads.7:116
8349 #, no-wrap
8350 msgid "Thread IDs"
8351 msgstr "スレッド ID"
8352
8353 #. type: Plain text
8354 #: build/C/man7/pthreads.7:130
8355 msgid ""
8356 "Each of the threads in a process has a unique thread identifier (stored in "
8357 "the type I<pthread_t>).  This identifier is returned to the caller of "
8358 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
8359 "using B<pthread_self>(3).  Thread IDs are only guaranteed to be unique "
8360 "within a process.  A thread ID may be reused after a terminated thread has "
8361 "been joined, or a detached thread has terminated.  In all pthreads functions "
8362 "that accept a thread ID as an argument, that ID by definition refers to a "
8363 "thread in the same process as the caller."
8364 msgstr ""
8365 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
8366 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
8367 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
8368 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
8369 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
8370 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
8371 "じプロセス内の一つのスレッドを参照する。"
8372
8373 #. type: SS
8374 #: build/C/man7/pthreads.7:130
8375 #, no-wrap
8376 msgid "Thread-safe functions"
8377 msgstr "スレッドセーフな関数"
8378
8379 #. type: Plain text
8380 #: build/C/man7/pthreads.7:134
8381 msgid ""
8382 "A thread-safe function is one that can be safely (i.e., it will deliver the "
8383 "same results regardless of whether it is)  called from multiple threads at "
8384 "the same time."
8385 msgstr ""
8386 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
8387 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
8388
8389 #. type: Plain text
8390 #: build/C/man7/pthreads.7:138
8391 msgid ""
8392 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
8393 "standard shall be thread-safe, except for the following functions:"
8394 msgstr ""
8395 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
8396 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
8397
8398 #. type: Plain text
8399 #: build/C/man7/pthreads.7:232
8400 #, no-wrap
8401 msgid ""
8402 "asctime()\n"
8403 "basename()\n"
8404 "catgets()\n"
8405 "crypt()\n"
8406 "ctermid() if passed a non-NULL argument\n"
8407 "ctime()\n"
8408 "dbm_clearerr()\n"
8409 "dbm_close()\n"
8410 "dbm_delete()\n"
8411 "dbm_error()\n"
8412 "dbm_fetch()\n"
8413 "dbm_firstkey()\n"
8414 "dbm_nextkey()\n"
8415 "dbm_open()\n"
8416 "dbm_store()\n"
8417 "dirname()\n"
8418 "dlerror()\n"
8419 "drand48()\n"
8420 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8421 "encrypt()\n"
8422 "endgrent()\n"
8423 "endpwent()\n"
8424 "endutxent()\n"
8425 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8426 "ftw()\n"
8427 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8428 "getc_unlocked()\n"
8429 "getchar_unlocked()\n"
8430 "getdate()\n"
8431 "getenv()\n"
8432 "getgrent()\n"
8433 "getgrgid()\n"
8434 "getgrnam()\n"
8435 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8436 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8437 "gethostent()\n"
8438 "getlogin()\n"
8439 "getnetbyaddr()\n"
8440 "getnetbyname()\n"
8441 "getnetent()\n"
8442 "getopt()\n"
8443 "getprotobyname()\n"
8444 "getprotobynumber()\n"
8445 "getprotoent()\n"
8446 "getpwent()\n"
8447 "getpwnam()\n"
8448 "getpwuid()\n"
8449 "getservbyname()\n"
8450 "getservbyport()\n"
8451 "getservent()\n"
8452 "getutxent()\n"
8453 "getutxid()\n"
8454 "getutxline()\n"
8455 "gmtime()\n"
8456 "hcreate()\n"
8457 "hdestroy()\n"
8458 "hsearch()\n"
8459 "inet_ntoa()\n"
8460 "l64a()\n"
8461 "lgamma()\n"
8462 "lgammaf()\n"
8463 "lgammal()\n"
8464 "localeconv()\n"
8465 "localtime()\n"
8466 "lrand48()\n"
8467 "mrand48()\n"
8468 "nftw()\n"
8469 "nl_langinfo()\n"
8470 "ptsname()\n"
8471 "putc_unlocked()\n"
8472 "putchar_unlocked()\n"
8473 "putenv()\n"
8474 "pututxline()\n"
8475 "rand()\n"
8476 "readdir()\n"
8477 "setenv()\n"
8478 "setgrent()\n"
8479 "setkey()\n"
8480 "setpwent()\n"
8481 "setutxent()\n"
8482 "strerror()\n"
8483 "strsignal() [Added in POSIX.1-2008]\n"
8484 "strtok()\n"
8485 "system() [Added in POSIX.1-2008]\n"
8486 "tmpnam() if passed a non-NULL argument\n"
8487 "ttyname()\n"
8488 "unsetenv()\n"
8489 "wcrtomb() if its final argument is NULL\n"
8490 "wcsrtombs() if its final argument is NULL\n"
8491 "wcstombs()\n"
8492 "wctomb()\n"
8493 msgstr ""
8494 "asctime()\n"
8495 "basename()\n"
8496 "catgets()\n"
8497 "crypt()\n"
8498 "ctermid() (NULL でない引き数を渡された場合)\n"
8499 "ctime()\n"
8500 "dbm_clearerr()\n"
8501 "dbm_close()\n"
8502 "dbm_delete()\n"
8503 "dbm_error()\n"
8504 "dbm_fetch()\n"
8505 "dbm_firstkey()\n"
8506 "dbm_nextkey()\n"
8507 "dbm_open()\n"
8508 "dbm_store()\n"
8509 "dirname()\n"
8510 "dlerror()\n"
8511 "drand48()\n"
8512 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8513 "encrypt()\n"
8514 "endgrent()\n"
8515 "endpwent()\n"
8516 "endutxent()\n"
8517 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8518 "ftw()\n"
8519 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8520 "getc_unlocked()\n"
8521 "getchar_unlocked()\n"
8522 "getdate()\n"
8523 "getenv()\n"
8524 "getgrent()\n"
8525 "getgrgid()\n"
8526 "getgrnam()\n"
8527 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8528 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8529 "gethostent()\n"
8530 "getlogin()\n"
8531 "getnetbyaddr()\n"
8532 "getnetbyname()\n"
8533 "getnetent()\n"
8534 "getopt()\n"
8535 "getprotobyname()\n"
8536 "getprotobynumber()\n"
8537 "getprotoent()\n"
8538 "getpwent()\n"
8539 "getpwnam()\n"
8540 "getpwuid()\n"
8541 "getservbyname()\n"
8542 "getservbyport()\n"
8543 "getservent()\n"
8544 "getutxent()\n"
8545 "getutxid()\n"
8546 "getutxline()\n"
8547 "gmtime()\n"
8548 "hcreate()\n"
8549 "hdestroy()\n"
8550 "hsearch()\n"
8551 "inet_ntoa()\n"
8552 "l64a()\n"
8553 "lgamma()\n"
8554 "lgammaf()\n"
8555 "lgammal()\n"
8556 "localeconv()\n"
8557 "localtime()\n"
8558 "lrand48()\n"
8559 "mrand48()\n"
8560 "nftw()\n"
8561 "nl_langinfo()\n"
8562 "ptsname()\n"
8563 "putc_unlocked()\n"
8564 "putchar_unlocked()\n"
8565 "putenv()\n"
8566 "pututxline()\n"
8567 "rand()\n"
8568 "readdir()\n"
8569 "setenv()\n"
8570 "setgrent()\n"
8571 "setkey()\n"
8572 "setpwent()\n"
8573 "setutxent()\n"
8574 "strerror()\n"
8575 "strsignal() [POSIX.1-2008 で追加された]\n"
8576 "strtok()\n"
8577 "system() [POSIX.1-2008 で追加された]\n"
8578 "tmpnam() (NULL でない引き数を渡された場合)\n"
8579 "ttyname()\n"
8580 "unsetenv()\n"
8581 "wcrtomb() (最後の引き数が NULL の場合)\n"
8582 "wcsrtombs() (最後の引き数が NULL の場合)\n"
8583 "wcstombs()\n"
8584 "wctomb()\n"
8585
8586 #. type: SS
8587 #: build/C/man7/pthreads.7:234
8588 #, no-wrap
8589 msgid "Async-cancel-safe functions"
8590 msgstr "async-cancel-safe 関数"
8591
8592 #. type: Plain text
8593 #: build/C/man7/pthreads.7:238
8594 msgid ""
8595 "An async-cancel-safe function is one that can be safely called in an "
8596 "application where asynchronous cancelability is enabled (see "
8597 "B<pthread_setcancelstate>(3))."
8598 msgstr ""
8599 "async-cancel-safe 関数は、\n"
8600 "非同期キャンセル機能が有効になっているアプリケーションで\n"
8601 "安全に呼び出すことができる関数のことである\n"
8602 "(B<pthread_setcancelstate>(3) を参照)。"
8603
8604 #. type: Plain text
8605 #: build/C/man7/pthreads.7:241
8606 msgid ""
8607 "Only the following functions are required to be async-cancel-safe by "
8608 "POSIX.1-2001 and POSIX.1-2008:"
8609 msgstr ""
8610 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
8611 "なければならないとされている。"
8612
8613 #. type: Plain text
8614 #: build/C/man7/pthreads.7:247
8615 #, no-wrap
8616 msgid ""
8617 "pthread_cancel()\n"
8618 "pthread_setcancelstate()\n"
8619 "pthread_setcanceltype()\n"
8620 msgstr ""
8621 "pthread_cancel()\n"
8622 "pthread_setcancelstate()\n"
8623 "pthread_setcanceltype()\n"
8624
8625 #. type: SS
8626 #: build/C/man7/pthreads.7:249
8627 #, no-wrap
8628 msgid "Cancellation Points"
8629 msgstr "取り消しポイント (cancellation points)"
8630
8631 #. type: Plain text
8632 #: build/C/man7/pthreads.7:256
8633 msgid ""
8634 "POSIX.1 specifies that certain functions must, and certain other functions "
8635 "may, be cancellation points.  If a thread is cancelable, its cancelability "
8636 "type is deferred, and a cancellation request is pending for the thread, then "
8637 "the thread is canceled when it calls a function that is a cancellation point."
8638 msgstr ""
8639 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
8640 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
8641 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
8642 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
8643 "時点で、そのスレッドのキャンセルが 行われる。"
8644
8645 #. type: Plain text
8646 #: build/C/man7/pthreads.7:259
8647 msgid ""
8648 "The following functions are required to be cancellation points by "
8649 "POSIX.1-2001 and/or POSIX.1-2008:"
8650 msgstr ""
8651 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
8652 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
8653
8654 #. type: Plain text
8655 #: build/C/man7/pthreads.7:322
8656 #, no-wrap
8657 msgid ""
8658 "accept()\n"
8659 "aio_suspend()\n"
8660 "clock_nanosleep()\n"
8661 "close()\n"
8662 "connect()\n"
8663 "creat()\n"
8664 "fcntl() F_SETLKW\n"
8665 "fdatasync()\n"
8666 "fsync()\n"
8667 "getmsg()\n"
8668 "getpmsg()\n"
8669 "lockf() F_LOCK\n"
8670 "mq_receive()\n"
8671 "mq_send()\n"
8672 "mq_timedreceive()\n"
8673 "mq_timedsend()\n"
8674 "msgrcv()\n"
8675 "msgsnd()\n"
8676 "msync()\n"
8677 "nanosleep()\n"
8678 "open()\n"
8679 "openat() [Added in POSIX.1-2008]\n"
8680 "pause()\n"
8681 "poll()\n"
8682 "pread()\n"
8683 "pselect()\n"
8684 "pthread_cond_timedwait()\n"
8685 "pthread_cond_wait()\n"
8686 "pthread_join()\n"
8687 "pthread_testcancel()\n"
8688 "putmsg()\n"
8689 "putpmsg()\n"
8690 "pwrite()\n"
8691 "read()\n"
8692 "readv()\n"
8693 "recv()\n"
8694 "recvfrom()\n"
8695 "recvmsg()\n"
8696 "select()\n"
8697 "sem_timedwait()\n"
8698 "sem_wait()\n"
8699 "send()\n"
8700 "sendmsg()\n"
8701 "sendto()\n"
8702 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
8703 "sigsuspend()\n"
8704 "sigtimedwait()\n"
8705 "sigwait()\n"
8706 "sigwaitinfo()\n"
8707 "sleep()\n"
8708 "system()\n"
8709 "tcdrain()\n"
8710 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8711 "wait()\n"
8712 "waitid()\n"
8713 "waitpid()\n"
8714 "write()\n"
8715 "writev()\n"
8716 msgstr ""
8717 "accept()\n"
8718 "aio_suspend()\n"
8719 "clock_nanosleep()\n"
8720 "close()\n"
8721 "connect()\n"
8722 "creat()\n"
8723 "fcntl() F_SETLKW\n"
8724 "fdatasync()\n"
8725 "fsync()\n"
8726 "getmsg()\n"
8727 "getpmsg()\n"
8728 "lockf() F_LOCK\n"
8729 "mq_receive()\n"
8730 "mq_send()\n"
8731 "mq_timedreceive()\n"
8732 "mq_timedsend()\n"
8733 "msgrcv()\n"
8734 "msgsnd()\n"
8735 "msync()\n"
8736 "nanosleep()\n"
8737 "open()\n"
8738 "openat() [POSIX.1-2008 で追加された]\n"
8739 "pause()\n"
8740 "poll()\n"
8741 "pread()\n"
8742 "pselect()\n"
8743 "pthread_cond_timedwait()\n"
8744 "pthread_cond_wait()\n"
8745 "pthread_join()\n"
8746 "pthread_testcancel()\n"
8747 "putmsg()\n"
8748 "putpmsg()\n"
8749 "pwrite()\n"
8750 "read()\n"
8751 "readv()\n"
8752 "recv()\n"
8753 "recvfrom()\n"
8754 "recvmsg()\n"
8755 "select()\n"
8756 "sem_timedwait()\n"
8757 "sem_wait()\n"
8758 "send()\n"
8759 "sendmsg()\n"
8760 "sendto()\n"
8761 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
8762 "sigsuspend()\n"
8763 "sigtimedwait()\n"
8764 "sigwait()\n"
8765 "sigwaitinfo()\n"
8766 "sleep()\n"
8767 "system()\n"
8768 "tcdrain()\n"
8769 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8770 "wait()\n"
8771 "waitid()\n"
8772 "waitpid()\n"
8773 "write()\n"
8774 "writev()\n"
8775
8776 #. type: Plain text
8777 #: build/C/man7/pthreads.7:327
8778 msgid ""
8779 "The following functions may be cancellation points according to POSIX.1-2001 "
8780 "and/or POSIX.1-2008:"
8781 msgstr ""
8782 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
8783 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
8784
8785 #. type: Plain text
8786 #: build/C/man7/pthreads.7:555
8787 #, no-wrap
8788 msgid ""
8789 "access()\n"
8790 "asctime()\n"
8791 "asctime_r()\n"
8792 "catclose()\n"
8793 "catgets()\n"
8794 "catopen()\n"
8795 "chmod() [Added in POSIX.1-2008]\n"
8796 "chown() [Added in POSIX.1-2008]\n"
8797 "closedir()\n"
8798 "closelog()\n"
8799 "ctermid()\n"
8800 "ctime()\n"
8801 "ctime_r()\n"
8802 "dbm_close()\n"
8803 "dbm_delete()\n"
8804 "dbm_fetch()\n"
8805 "dbm_nextkey()\n"
8806 "dbm_open()\n"
8807 "dbm_store()\n"
8808 "dlclose()\n"
8809 "dlopen()\n"
8810 "dprintf() [Added in POSIX.1-2008]\n"
8811 "endgrent()\n"
8812 "endhostent()\n"
8813 "endnetent()\n"
8814 "endprotoent()\n"
8815 "endpwent()\n"
8816 "endservent()\n"
8817 "endutxent()\n"
8818 "faccessat() [Added in POSIX.1-2008]\n"
8819 "fchmod() [Added in POSIX.1-2008]\n"
8820 "fchmodat() [Added in POSIX.1-2008]\n"
8821 "fchown() [Added in POSIX.1-2008]\n"
8822 "fchownat() [Added in POSIX.1-2008]\n"
8823 "fclose()\n"
8824 "fcntl() (for any value of cmd argument)\n"
8825 "fflush()\n"
8826 "fgetc()\n"
8827 "fgetpos()\n"
8828 "fgets()\n"
8829 "fgetwc()\n"
8830 "fgetws()\n"
8831 "fmtmsg()\n"
8832 "fopen()\n"
8833 "fpathconf()\n"
8834 "fprintf()\n"
8835 "fputc()\n"
8836 "fputs()\n"
8837 "fputwc()\n"
8838 "fputws()\n"
8839 "fread()\n"
8840 "freopen()\n"
8841 "fscanf()\n"
8842 "fseek()\n"
8843 "fseeko()\n"
8844 "fsetpos()\n"
8845 "fstat()\n"
8846 "fstatat() [Added in POSIX.1-2008]\n"
8847 "ftell()\n"
8848 "ftello()\n"
8849 "ftw()\n"
8850 "futimens() [Added in POSIX.1-2008]\n"
8851 "fwprintf()\n"
8852 "fwrite()\n"
8853 "fwscanf()\n"
8854 "getaddrinfo()\n"
8855 "getc()\n"
8856 "getc_unlocked()\n"
8857 "getchar()\n"
8858 "getchar_unlocked()\n"
8859 "getcwd()\n"
8860 "getdate()\n"
8861 "getdelim() [Added in POSIX.1-2008]\n"
8862 "getgrent()\n"
8863 "getgrgid()\n"
8864 "getgrgid_r()\n"
8865 "getgrnam()\n"
8866 "getgrnam_r()\n"
8867 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
8868 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
8869 "gethostent()\n"
8870 "gethostid()\n"
8871 "gethostname()\n"
8872 "getline() [Added in POSIX.1-2008]\n"
8873 "getlogin()\n"
8874 "getlogin_r()\n"
8875 "getnameinfo()\n"
8876 "getnetbyaddr()\n"
8877 "getnetbyname()\n"
8878 "getnetent()\n"
8879 "getopt() (if opterr is nonzero)\n"
8880 "getprotobyname()\n"
8881 "getprotobynumber()\n"
8882 "getprotoent()\n"
8883 "getpwent()\n"
8884 "getpwnam()\n"
8885 "getpwnam_r()\n"
8886 "getpwuid()\n"
8887 "getpwuid_r()\n"
8888 "gets()\n"
8889 "getservbyname()\n"
8890 "getservbyport()\n"
8891 "getservent()\n"
8892 "getutxent()\n"
8893 "getutxid()\n"
8894 "getutxline()\n"
8895 "getwc()\n"
8896 "getwchar()\n"
8897 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
8898 "glob()\n"
8899 "iconv_close()\n"
8900 "iconv_open()\n"
8901 "ioctl()\n"
8902 "link()\n"
8903 "linkat() [Added in POSIX.1-2008]\n"
8904 "lio_listio() [Added in POSIX.1-2008]\n"
8905 "localtime()\n"
8906 "localtime_r()\n"
8907 "lockf() [Added in POSIX.1-2008]\n"
8908 "lseek()\n"
8909 "lstat()\n"
8910 "mkdir() [Added in POSIX.1-2008]\n"
8911 "mkdirat() [Added in POSIX.1-2008]\n"
8912 "mkdtemp() [Added in POSIX.1-2008]\n"
8913 "mkfifo() [Added in POSIX.1-2008]\n"
8914 "mkfifoat() [Added in POSIX.1-2008]\n"
8915 "mknod() [Added in POSIX.1-2008]\n"
8916 "mknodat() [Added in POSIX.1-2008]\n"
8917 "mkstemp()\n"
8918 "mktime()\n"
8919 "nftw()\n"
8920 "opendir()\n"
8921 "openlog()\n"
8922 "pathconf()\n"
8923 "pclose()\n"
8924 "perror()\n"
8925 "popen()\n"
8926 "posix_fadvise()\n"
8927 "posix_fallocate()\n"
8928 "posix_madvise()\n"
8929 "posix_openpt()\n"
8930 "posix_spawn()\n"
8931 "posix_spawnp()\n"
8932 "posix_trace_clear()\n"
8933 "posix_trace_close()\n"
8934 "posix_trace_create()\n"
8935 "posix_trace_create_withlog()\n"
8936 "posix_trace_eventtypelist_getnext_id()\n"
8937 "posix_trace_eventtypelist_rewind()\n"
8938 "posix_trace_flush()\n"
8939 "posix_trace_get_attr()\n"
8940 "posix_trace_get_filter()\n"
8941 "posix_trace_get_status()\n"
8942 "posix_trace_getnext_event()\n"
8943 "posix_trace_open()\n"
8944 "posix_trace_rewind()\n"
8945 "posix_trace_set_filter()\n"
8946 "posix_trace_shutdown()\n"
8947 "posix_trace_timedgetnext_event()\n"
8948 "posix_typed_mem_open()\n"
8949 "printf()\n"
8950 "psiginfo() [Added in POSIX.1-2008]\n"
8951 "psignal() [Added in POSIX.1-2008]\n"
8952 "pthread_rwlock_rdlock()\n"
8953 "pthread_rwlock_timedrdlock()\n"
8954 "pthread_rwlock_timedwrlock()\n"
8955 "pthread_rwlock_wrlock()\n"
8956 "putc()\n"
8957 "putc_unlocked()\n"
8958 "putchar()\n"
8959 "putchar_unlocked()\n"
8960 "puts()\n"
8961 "pututxline()\n"
8962 "putwc()\n"
8963 "putwchar()\n"
8964 "readdir()\n"
8965 "readdir_r()\n"
8966 "readlink() [Added in POSIX.1-2008]\n"
8967 "readlinkat() [Added in POSIX.1-2008]\n"
8968 "remove()\n"
8969 "rename()\n"
8970 "renameat() [Added in POSIX.1-2008]\n"
8971 "rewind()\n"
8972 "rewinddir()\n"
8973 "scandir() [Added in POSIX.1-2008]\n"
8974 "scanf()\n"
8975 "seekdir()\n"
8976 "semop()\n"
8977 "setgrent()\n"
8978 "sethostent()\n"
8979 "setnetent()\n"
8980 "setprotoent()\n"
8981 "setpwent()\n"
8982 "setservent()\n"
8983 "setutxent()\n"
8984 "sigpause() [Added in POSIX.1-2008]\n"
8985 "stat()\n"
8986 "strerror()\n"
8987 "strerror_r()\n"
8988 "strftime()\n"
8989 "symlink()\n"
8990 "symlinkat() [Added in POSIX.1-2008]\n"
8991 "sync()\n"
8992 "syslog()\n"
8993 "tmpfile()\n"
8994 "tmpnam()\n"
8995 "ttyname()\n"
8996 "ttyname_r()\n"
8997 "tzset()\n"
8998 "ungetc()\n"
8999 "ungetwc()\n"
9000 "unlink()\n"
9001 "unlinkat() [Added in POSIX.1-2008]\n"
9002 "utime() [Added in POSIX.1-2008]\n"
9003 "utimensat() [Added in POSIX.1-2008]\n"
9004 "utimes() [Added in POSIX.1-2008]\n"
9005 "vdprintf() [Added in POSIX.1-2008]\n"
9006 "vfprintf()\n"
9007 "vfwprintf()\n"
9008 "vprintf()\n"
9009 "vwprintf()\n"
9010 "wcsftime()\n"
9011 "wordexp()\n"
9012 "wprintf()\n"
9013 "wscanf()\n"
9014 msgstr ""
9015 "access()\n"
9016 "asctime()\n"
9017 "asctime_r()\n"
9018 "catclose()\n"
9019 "catgets()\n"
9020 "catopen()\n"
9021 "chmod() [POSIX.1-2008 で追加された]\n"
9022 "chown() [POSIX.1-2008 で追加された]\n"
9023 "closedir()\n"
9024 "closelog()\n"
9025 "ctermid()\n"
9026 "ctime()\n"
9027 "ctime_r()\n"
9028 "dbm_close()\n"
9029 "dbm_delete()\n"
9030 "dbm_fetch()\n"
9031 "dbm_nextkey()\n"
9032 "dbm_open()\n"
9033 "dbm_store()\n"
9034 "dlclose()\n"
9035 "dlopen()\n"
9036 "dprintf() [POSIX.1-2008 で追加された]\n"
9037 "endgrent()\n"
9038 "endhostent()\n"
9039 "endnetent()\n"
9040 "endprotoent()\n"
9041 "endpwent()\n"
9042 "endservent()\n"
9043 "endutxent()\n"
9044 "faccessat() [POSIX.1-2008 で追加された]\n"
9045 "fchmod() [POSIX.1-2008 で追加された]\n"
9046 "fchmodat() [POSIX.1-2008 で追加された]\n"
9047 "fchown() [POSIX.1-2008 で追加された]\n"
9048 "fchownat() [POSIX.1-2008 で追加された]\n"
9049 "fclose()\n"
9050 "fcntl() (cmd 引き数が何であっても)\n"
9051 "fflush()\n"
9052 "fgetc()\n"
9053 "fgetpos()\n"
9054 "fgets()\n"
9055 "fgetwc()\n"
9056 "fgetws()\n"
9057 "fmtmsg()\n"
9058 "fopen()\n"
9059 "fpathconf()\n"
9060 "fprintf()\n"
9061 "fputc()\n"
9062 "fputs()\n"
9063 "fputwc()\n"
9064 "fputws()\n"
9065 "fread()\n"
9066 "freopen()\n"
9067 "fscanf()\n"
9068 "fseek()\n"
9069 "fseeko()\n"
9070 "fsetpos()\n"
9071 "fstat()\n"
9072 "fstatat() [POSIX.1-2008 で追加された]\n"
9073 "ftell()\n"
9074 "ftello()\n"
9075 "ftw()\n"
9076 "futimens() [POSIX.1-2008 で追加された]\n"
9077 "fwprintf()\n"
9078 "fwrite()\n"
9079 "fwscanf()\n"
9080 "getaddrinfo()\n"
9081 "getc()\n"
9082 "getc_unlocked()\n"
9083 "getchar()\n"
9084 "getchar_unlocked()\n"
9085 "getcwd()\n"
9086 "getdate()\n"
9087 "getdelim() [POSIX.1-2008 で追加された]\n"
9088 "getgrent()\n"
9089 "getgrgid()\n"
9090 "getgrgid_r()\n"
9091 "getgrnam()\n"
9092 "getgrnam_r()\n"
9093 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9094 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9095 "gethostent()\n"
9096 "gethostid()\n"
9097 "gethostname()\n"
9098 "getline() [POSIX.1-2008 で追加された]\n"
9099 "getlogin()\n"
9100 "getlogin_r()\n"
9101 "getnameinfo()\n"
9102 "getnetbyaddr()\n"
9103 "getnetbyname()\n"
9104 "getnetent()\n"
9105 "getopt() (opterr が 0 以外の場合)\n"
9106 "getprotobyname()\n"
9107 "getprotobynumber()\n"
9108 "getprotoent()\n"
9109 "getpwent()\n"
9110 "getpwnam()\n"
9111 "getpwnam_r()\n"
9112 "getpwuid()\n"
9113 "getpwuid_r()\n"
9114 "gets()\n"
9115 "getservbyname()\n"
9116 "getservbyport()\n"
9117 "getservent()\n"
9118 "getutxent()\n"
9119 "getutxid()\n"
9120 "getutxline()\n"
9121 "getwc()\n"
9122 "getwchar()\n"
9123 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9124 "glob()\n"
9125 "iconv_close()\n"
9126 "iconv_open()\n"
9127 "ioctl()\n"
9128 "link()\n"
9129 "linkat() [POSIX.1-2008 で追加された]\n"
9130 "lio_listio() [POSIX.1-2008 で追加された]\n"
9131 "localtime()\n"
9132 "localtime_r()\n"
9133 "lockf() [POSIX.1-2008 で追加された]\n"
9134 "lseek()\n"
9135 "lstat()\n"
9136 "mkdir() [POSIX.1-2008 で追加された]\n"
9137 "mkdirat() [POSIX.1-2008 で追加された]\n"
9138 "mkdtemp() [POSIX.1-2008 で追加された]\n"
9139 "mkfifo() [POSIX.1-2008 で追加された]\n"
9140 "mkfifoat() [POSIX.1-2008 で追加された]\n"
9141 "mknod() [POSIX.1-2008 で追加された]\n"
9142 "mknodat() [POSIX.1-2008 で追加された]\n"
9143 "mkstemp()\n"
9144 "mktime()\n"
9145 "nftw()\n"
9146 "opendir()\n"
9147 "openlog()\n"
9148 "pathconf()\n"
9149 "pclose()\n"
9150 "perror()\n"
9151 "popen()\n"
9152 "posix_fadvise()\n"
9153 "posix_fallocate()\n"
9154 "posix_madvise()\n"
9155 "posix_openpt()\n"
9156 "posix_spawn()\n"
9157 "posix_spawnp()\n"
9158 "posix_trace_clear()\n"
9159 "posix_trace_close()\n"
9160 "posix_trace_create()\n"
9161 "posix_trace_create_withlog()\n"
9162 "posix_trace_eventtypelist_getnext_id()\n"
9163 "posix_trace_eventtypelist_rewind()\n"
9164 "posix_trace_flush()\n"
9165 "posix_trace_get_attr()\n"
9166 "posix_trace_get_filter()\n"
9167 "posix_trace_get_status()\n"
9168 "posix_trace_getnext_event()\n"
9169 "posix_trace_open()\n"
9170 "posix_trace_rewind()\n"
9171 "posix_trace_set_filter()\n"
9172 "posix_trace_shutdown()\n"
9173 "posix_trace_timedgetnext_event()\n"
9174 "posix_typed_mem_open()\n"
9175 "printf()\n"
9176 "psiginfo() [POSIX.1-2008 で追加された]\n"
9177 "psignal() [POSIX.1-2008 で追加された]\n"
9178 "pthread_rwlock_rdlock()\n"
9179 "pthread_rwlock_timedrdlock()\n"
9180 "pthread_rwlock_timedwrlock()\n"
9181 "pthread_rwlock_wrlock()\n"
9182 "putc()\n"
9183 "putc_unlocked()\n"
9184 "putchar()\n"
9185 "putchar_unlocked()\n"
9186 "puts()\n"
9187 "pututxline()\n"
9188 "putwc()\n"
9189 "putwchar()\n"
9190 "readdir()\n"
9191 "readdir_r()\n"
9192 "readlink() [POSIX.1-2008 で追加された]\n"
9193 "readlinkat() [POSIX.1-2008 で追加された]\n"
9194 "remove()\n"
9195 "rename()\n"
9196 "renameat() [POSIX.1-2008 で追加された]\n"
9197 "rewind()\n"
9198 "rewinddir()\n"
9199 "scandir() [POSIX.1-2008 で追加された]\n"
9200 "scanf()\n"
9201 "seekdir()\n"
9202 "semop()\n"
9203 "setgrent()\n"
9204 "sethostent()\n"
9205 "setnetent()\n"
9206 "setprotoent()\n"
9207 "setpwent()\n"
9208 "setservent()\n"
9209 "setutxent()\n"
9210 "sigpause() [POSIX.1-2008 で追加された]\n"
9211 "stat()\n"
9212 "strerror()\n"
9213 "strerror_r()\n"
9214 "strftime()\n"
9215 "symlink()\n"
9216 "symlinkat() [POSIX.1-2008 で追加された]\n"
9217 "sync()\n"
9218 "syslog()\n"
9219 "tmpfile()\n"
9220 "tmpnam()\n"
9221 "ttyname()\n"
9222 "ttyname_r()\n"
9223 "tzset()\n"
9224 "ungetc()\n"
9225 "ungetwc()\n"
9226 "unlink()\n"
9227 "unlinkat() [POSIX.1-2008 で追加された]\n"
9228 "utime() [POSIX.1-2008 で追加された]\n"
9229 "utimensat() [POSIX.1-2008 で追加された]\n"
9230 "utimes() [POSIX.1-2008 で追加された]\n"
9231 "vdprintf() [POSIX.1-2008 で追加された]\n"
9232 "vfprintf()\n"
9233 "vfwprintf()\n"
9234 "vprintf()\n"
9235 "vwprintf()\n"
9236 "wcsftime()\n"
9237 "wordexp()\n"
9238 "wprintf()\n"
9239 "wscanf()\n"
9240
9241 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
9242 #.  files, it looks as though at least the following nonstandard
9243 #.  functions are cancellation points:
9244 #.  endnetgrent
9245 #.  endspent
9246 #.  epoll_pwait
9247 #.  epoll_wait
9248 #.  fcloseall
9249 #.  fdopendir
9250 #.  fflush_unlocked
9251 #.  fgetc_unlocked
9252 #.  fgetgrent
9253 #.  fgetgrent_r
9254 #.  fgetpwent
9255 #.  fgetpwent_r
9256 #.  fgets_unlocked
9257 #.  fgetspent
9258 #.  fgetspent_r
9259 #.  fgetwc_unlocked
9260 #.  fgetws_unlocked
9261 #.  fputc_unlocked
9262 #.  fputs_unlocked
9263 #.  fputwc_unlocked
9264 #.  fputws_unlocked
9265 #.  fread_unlocked
9266 #.  fwrite_unlocked
9267 #.  gai_suspend
9268 #.  getaddrinfo_a
9269 #.  getdate_r
9270 #.  getgrent_r
9271 #.  getgrouplist
9272 #.  gethostbyaddr_r
9273 #.  gethostbyname2
9274 #.  gethostbyname2_r
9275 #.  gethostbyname_r
9276 #.  gethostent_r
9277 #.  getnetbyaddr_r
9278 #.  getnetbyname_r
9279 #.  getnetent_r
9280 #.  getnetgrent
9281 #.  getnetgrent_r
9282 #.  getprotobyname_r
9283 #.  getprotobynumber_r
9284 #.  getprotoent_r
9285 #.  getpw
9286 #.  getpwent_r
9287 #.  getservbyname_r
9288 #.  getservbyport_r
9289 #.  getservent_r
9290 #.  getspent
9291 #.  getspent_r
9292 #.  getspnam
9293 #.  getspnam_r
9294 #.  getutmp
9295 #.  getutmpx
9296 #.  getw
9297 #.  getwc_unlocked
9298 #.  getwchar_unlocked
9299 #.  initgroups
9300 #.  innetgr
9301 #.  mkostemp
9302 #.  mkostemp64
9303 #.  mkstemp64
9304 #.  ppoll
9305 #.  pthread_timedjoin_np
9306 #.  putgrent
9307 #.  putpwent
9308 #.  putspent
9309 #.  putw
9310 #.  putwc_unlocked
9311 #.  putwchar_unlocked
9312 #.  rcmd
9313 #.  rcmd_af
9314 #.  rexec
9315 #.  rexec_af
9316 #.  rresvport
9317 #.  rresvport_af
9318 #.  ruserok
9319 #.  ruserok_af
9320 #.  setnetgrent
9321 #.  setspent
9322 #.  sgetspent
9323 #.  sgetspent_r
9324 #.  updwtmpx
9325 #.  utmpxname
9326 #.  vfscanf
9327 #.  vfwscanf
9328 #.  vscanf
9329 #.  vsyslog
9330 #.  vwscanf
9331 #. type: Plain text
9332 #: build/C/man7/pthreads.7:653
9333 msgid ""
9334 "An implementation may also mark other functions not specified in the "
9335 "standard as cancellation points.  In particular, an implementation is likely "
9336 "to mark any nonstandard function that may block as a cancellation point.  "
9337 "(This includes most functions that can touch files.)"
9338 msgstr ""
9339 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
9340 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
9341 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
9342 "関数がこれに含まれる)。"
9343
9344 #. type: SS
9345 #: build/C/man7/pthreads.7:653
9346 #, no-wrap
9347 msgid "Compiling on Linux"
9348 msgstr "Linux でのコンパイル"
9349
9350 #. type: Plain text
9351 #: build/C/man7/pthreads.7:656
9352 msgid ""
9353 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
9354 "pthread>."
9355 msgstr ""
9356 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
9357 "きである。"
9358
9359 #. type: SS
9360 #: build/C/man7/pthreads.7:656
9361 #, no-wrap
9362 msgid "Linux Implementations of POSIX Threads"
9363 msgstr "POSIX スレッドの Linux での実装"
9364
9365 #. type: Plain text
9366 #: build/C/man7/pthreads.7:659
9367 msgid ""
9368 "Over time, two threading implementations have been provided by the GNU C "
9369 "library on Linux:"
9370 msgstr ""
9371 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
9372 "た。"
9373
9374 #. type: TP
9375 #: build/C/man7/pthreads.7:659
9376 #, no-wrap
9377 msgid "B<LinuxThreads>"
9378 msgstr "B<LinuxThreads>"
9379
9380 #. type: Plain text
9381 #: build/C/man7/pthreads.7:663
9382 msgid ""
9383 "This is the original Pthreads implementation.  Since glibc 2.4, this "
9384 "implementation is no longer supported."
9385 msgstr ""
9386 "最初の Pthreads の実装。 glibc 2.4 以降は、この実装はもはやサポートされていな"
9387 "い。"
9388
9389 #. type: TP
9390 #: build/C/man7/pthreads.7:663
9391 #, no-wrap
9392 msgid "B<NPTL> (Native POSIX Threads Library)"
9393 msgstr "B<NPTL> (Native POSIX Threads Library)"
9394
9395 #. type: Plain text
9396 #: build/C/man7/pthreads.7:671
9397 msgid ""
9398 "This is the modern Pthreads implementation.  By comparison with "
9399 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
9400 "POSIX.1 specification and better performance when creating large numbers of "
9401 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
9402 "are present in the Linux 2.6 kernel."
9403 msgstr ""
9404 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
9405 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
9406 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
9407 "装されている機能が必要である。"
9408
9409 #. type: Plain text
9410 #: build/C/man7/pthreads.7:681
9411 msgid ""
9412 "Both of these are so-called 1:1 implementations, meaning that each thread "
9413 "maps to a kernel scheduling entity.  Both threading implementations employ "
9414 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
9415 "primitives (mutexes, thread joining, etc.) are implemented using the Linux "
9416 "B<futex>(2)  system call."
9417 msgstr ""
9418 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
9419 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
9420 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
9421 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
9422 "使って実装されている。"
9423
9424 #. type: SS
9425 #: build/C/man7/pthreads.7:681
9426 #, no-wrap
9427 msgid "LinuxThreads"
9428 msgstr "LinuxThreads"
9429
9430 #. type: Plain text
9431 #: build/C/man7/pthreads.7:683
9432 msgid "The notable features of this implementation are the following:"
9433 msgstr "この実装の大きな特徴は以下の通りである:"
9434
9435 #. type: Plain text
9436 #: build/C/man7/pthreads.7:690
9437 msgid ""
9438 "In addition to the main (initial) thread, and the threads that the program "
9439 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
9440 "thread.  This thread handles thread creation and termination.  (Problems can "
9441 "result if this thread is inadvertently killed.)"
9442 msgstr ""
9443 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
9444 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
9445 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
9446 "kill されると、問題が起こることがある)。"
9447
9448 #. type: Plain text
9449 #: build/C/man7/pthreads.7:702
9450 msgid ""
9451 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
9452 "the first three real-time signals are used (see also B<signal>(7)).  On "
9453 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
9454 "avoid the use of whichever set of signals is employed by the implementation."
9455 msgstr ""
9456 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
9457 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
9458 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
9459 "用されているシグナルを どれも使わないようにしなければならない。"
9460
9461 #. type: Plain text
9462 #: build/C/man7/pthreads.7:709
9463 msgid ""
9464 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
9465 "implemented as processes which share more information than usual, but which "
9466 "do not share a common process ID.)  LinuxThreads threads (including the "
9467 "manager thread)  are visible as separate processes using B<ps>(1)."
9468 msgstr ""
9469 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
9470 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
9471 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
9472 "を使うと別のプロセスのように見える。"
9473
9474 #. type: Plain text
9475 #: build/C/man7/pthreads.7:712
9476 msgid ""
9477 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
9478 "number of ways, including the following:"
9479 msgstr ""
9480 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
9481 "示すような点がある:"
9482
9483 #. type: Plain text
9484 #: build/C/man7/pthreads.7:716
9485 msgid "Calls to B<getpid>(2)  return a different value in each thread."
9486 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
9487
9488 #. type: Plain text
9489 #: build/C/man7/pthreads.7:725
9490 msgid ""
9491 "Calls to B<getppid>(2)  in threads other than the main thread return the "
9492 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
9493 "should return the same value as B<getppid>(2)  in the main thread."
9494 msgstr ""
9495 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
9496 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
9497 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
9498
9499 #. type: Plain text
9500 #: build/C/man7/pthreads.7:735
9501 msgid ""
9502 "When one thread creates a new child process using B<fork>(2), any thread "
9503 "should be able to B<wait>(2)  on the child.  However, the implementation "
9504 "only allows the thread that created the child to B<wait>(2)  on it."
9505 msgstr ""
9506 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
9507 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
9508 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
9509 "る。"
9510
9511 #. type: Plain text
9512 #: build/C/man7/pthreads.7:742
9513 msgid ""
9514 "When a thread calls B<execve>(2), all other threads are terminated (as "
9515 "required by POSIX.1).  However, the resulting process has the same PID as "
9516 "the thread that called B<execve>(2): it should have the same PID as the main "
9517 "thread."
9518 msgstr ""
9519 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
9520 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
9521 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
9522 "る。"
9523
9524 #. type: Plain text
9525 #: build/C/man7/pthreads.7:749
9526 msgid ""
9527 "Threads do not share user and group IDs.  This can cause complications with "
9528 "set-user-ID programs and can cause failures in Pthreads functions if an "
9529 "application changes its credentials using B<seteuid>(2)  or similar."
9530 msgstr ""
9531 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
9532 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使っ"
9533 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
9534
9535 #. type: Plain text
9536 #: build/C/man7/pthreads.7:751
9537 msgid "Threads do not share a common session ID and process group ID."
9538 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
9539
9540 #. type: Plain text
9541 #: build/C/man7/pthreads.7:754
9542 msgid "Threads do not share record locks created using B<fcntl>(2)."
9543 msgstr ""
9544 "スレッド間で B<fcntl>(2)  を使って作成されるレコード・ロックを共有しない。"
9545
9546 #. type: Plain text
9547 #: build/C/man7/pthreads.7:760
9548 msgid ""
9549 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
9550 "rather than process-wide."
9551 msgstr ""
9552 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
9553 "単位の情報である。"
9554
9555 #. type: Plain text
9556 #: build/C/man7/pthreads.7:763
9557 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
9558 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
9559
9560 #. type: Plain text
9561 #: build/C/man7/pthreads.7:765
9562 msgid "Threads do not share interval timers."
9563 msgstr "スレッド間でインターバル・タイマを共有しない。"
9564
9565 #.  FIXME . bug report filed for NPTL nice nonconformance
9566 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
9567 #.  Sep 08: there is a patch by Denys Vlasenko to address this
9568 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
9569 #.  Monitor this to see if it makes it into mainline.
9570 #. type: Plain text
9571 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
9572 msgid "Threads do not share a common nice value."
9573 msgstr "スレッドは共通の nice 値を共有しない。"
9574
9575 #. type: Plain text
9576 #: build/C/man7/pthreads.7:777
9577 msgid ""
9578 "POSIX.1 distinguishes the notions of signals that are directed to the "
9579 "process as a whole and signals that are directed to individual threads.  "
9580 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
9581 "example) should be handled by a single, arbitrarily selected thread within "
9582 "the process.  LinuxThreads does not support the notion of process-directed "
9583 "signals: signals may only be sent to specific threads."
9584 msgstr ""
9585 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
9586 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
9587 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
9588 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
9589 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
9590 "ルは特定のスレッドにだけ送ることができる。"
9591
9592 #. type: Plain text
9593 #: build/C/man7/pthreads.7:786
9594 msgid ""
9595 "Threads have distinct alternate signal stack settings.  However, a new "
9596 "thread's alternate signal stack settings are copied from the thread that "
9597 "created it, so that the threads initially share an alternate signal stack.  "
9598 "(A new thread should start with no alternate signal stack defined.  If two "
9599 "threads handle signals on their shared alternate signal stack at the same "
9600 "time, unpredictable program failures are likely to occur.)"
9601 msgstr ""
9602 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
9603 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
9604 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
9605 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
9606 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
9607 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
9608
9609 #. type: SS
9610 #: build/C/man7/pthreads.7:786
9611 #, no-wrap
9612 msgid "NPTL"
9613 msgstr "NPTL"
9614
9615 #. type: Plain text
9616 #: build/C/man7/pthreads.7:795
9617 msgid ""
9618 "With NPTL, all of the threads in a process are placed in the same thread "
9619 "group; all members of a thread group share the same PID.  NPTL does not "
9620 "employ a manager thread.  NPTL makes internal use of the first two real-time "
9621 "signals (see also B<signal>(7)); these signals cannot be used in "
9622 "applications."
9623 msgstr ""
9624 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
9625 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
9626 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
9627 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
9628 "ションでは使用できない。"
9629
9630 #. type: Plain text
9631 #: build/C/man7/pthreads.7:797
9632 msgid "NPTL still has at least one nonconformance with POSIX.1:"
9633 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
9634
9635 #. type: Plain text
9636 #: build/C/man7/pthreads.7:806
9637 msgid "Some NPTL nonconformances only occur with older kernels:"
9638 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
9639
9640 #. type: Plain text
9641 #: build/C/man7/pthreads.7:812
9642 msgid ""
9643 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
9644 "rather than process-wide (fixed in kernel 2.6.9)."
9645 msgstr ""
9646 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
9647 "単位の情報である (カーネル 2.6.9 で修正された)。"
9648
9649 #. type: Plain text
9650 #: build/C/man7/pthreads.7:814
9651 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
9652 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
9653
9654 #. type: Plain text
9655 #: build/C/man7/pthreads.7:816
9656 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
9657 msgstr ""
9658 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
9659
9660 #. type: Plain text
9661 #: build/C/man7/pthreads.7:820
9662 msgid ""
9663 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
9664 "(fixed in kernel 2.6.16)."
9665 msgstr ""
9666 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
9667 "きる (カーネル 2.6.16 で修正された)。"
9668
9669 #. type: Plain text
9670 #: build/C/man7/pthreads.7:825
9671 msgid ""
9672 "Only the main thread is permitted to make the process into a process group "
9673 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
9674 msgstr ""
9675 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセス・グルー"
9676 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
9677
9678 #. type: Plain text
9679 #: build/C/man7/pthreads.7:831
9680 msgid ""
9681 "Threads have distinct alternate signal stack settings.  However, a new "
9682 "thread's alternate signal stack settings are copied from the thread that "
9683 "created it, so that the threads initially share an alternate signal stack "
9684 "(fixed in kernel 2.6.16)."
9685 msgstr ""
9686 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
9687 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
9688 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
9689 "ル 2.6.16 で修正された)。"
9690
9691 #. type: Plain text
9692 #: build/C/man7/pthreads.7:833
9693 msgid "Note the following further points about the NPTL implementation:"
9694 msgstr "NPTL の実装では以下の点についても注意すること:"
9695
9696 #. type: Plain text
9697 #: build/C/man7/pthreads.7:847
9698 msgid ""
9699 "If the stack size soft resource limit (see the description of "
9700 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
9701 "I<unlimited>, then this value defines the default stack size for new "
9702 "threads.  To be effective, this limit must be set before the program is "
9703 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
9704 "stacksize> in the C shell)."
9705 msgstr ""
9706 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2)  の "
9707 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
9708 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
9709 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
9710 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
9711 "は I<limit stacksize>)  を使って設定する。"
9712
9713 #. type: SS
9714 #: build/C/man7/pthreads.7:847
9715 #, no-wrap
9716 msgid "Determining the Threading Implementation"
9717 msgstr "スレッド実装の判定"
9718
9719 #. type: Plain text
9720 #: build/C/man7/pthreads.7:852
9721 msgid ""
9722 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
9723 "system's threading implementation, for example:"
9724 msgstr ""
9725 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
9726 "装を判定することができる。 以下に例を示す:"
9727
9728 #. type: Plain text
9729 #: build/C/man7/pthreads.7:857
9730 #, no-wrap
9731 msgid ""
9732 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
9733 "NPTL 2.3.4\n"
9734 msgstr ""
9735 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
9736 "NPTL 2.3.4\n"
9737
9738 #. type: Plain text
9739 #: build/C/man7/pthreads.7:862
9740 msgid ""
9741 "With older glibc versions, a command such as the following should be "
9742 "sufficient to determine the default threading implementation:"
9743 msgstr ""
9744 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
9745 "ド実装を判定することができる。"
9746
9747 #. type: Plain text
9748 #: build/C/man7/pthreads.7:868
9749 #, no-wrap
9750 msgid ""
9751 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
9752 "                egrep -i \\(aqthreads|nptl\\(aq\n"
9753 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
9754 msgstr ""
9755 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
9756 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
9757 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
9758
9759 #. type: SS
9760 #: build/C/man7/pthreads.7:870
9761 #, no-wrap
9762 msgid "Selecting the Threading Implementation: LD_ASSUME_KERNEL"
9763 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
9764
9765 #. type: Plain text
9766 #: build/C/man7/pthreads.7:885
9767 msgid ""
9768 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
9769 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
9770 "override the dynamic linker's default choice of threading implementation.  "
9771 "This variable tells the dynamic linker to assume that it is running on top "
9772 "of a particular kernel version.  By specifying a kernel version that does "
9773 "not provide the support required by NPTL, we can force the use of "
9774 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
9775 "application that depends on some nonconformant behavior in LinuxThreads.)  "
9776 "For example:"
9777 msgstr ""
9778 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
9779 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
9780 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
9781 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
9782 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
9783 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
9784 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
9785 "ン を動作させる場合だろう)。 以下に例を示す:"
9786
9787 #. type: Plain text
9788 #: build/C/man7/pthreads.7:891
9789 #, no-wrap
9790 msgid ""
9791 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
9792 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
9793 "        linuxthreads-0.10 by Xavier Leroy\n"
9794 msgstr ""
9795 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
9796 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
9797 "        linuxthreads-0.10 by Xavier Leroy\n"
9798
9799 #. type: Plain text
9800 #: build/C/man7/pthreads.7:903
9801 msgid ""
9802 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), B<sigevent>"
9803 "(7), B<signal>(7),"
9804 msgstr ""
9805 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
9806 "B<signal>(7),"
9807
9808 #. type: Plain text
9809 #: build/C/man7/pthreads.7:926
9810 msgid ""
9811 "and various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
9812 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9813 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
9814 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
9815 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
9816 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>"
9817 "(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), "
9818 "B<pthread_sigmask>(3), B<pthread_sigqueue>(3), and B<pthread_testcancel>(3)"
9819 msgstr ""
9820 "および Pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
9821 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
9822 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
9823 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
9824 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
9825 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
9826 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
9827 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
9828 "and B<pthread_testcancel>(3)"
9829
9830 #~ msgid "COLOPHON"
9831 #~ msgstr "この文書について"
9832
9833 #~ msgid ""
9834 #~ "This page is part of release 3.38 of the Linux I<man-pages> project.  A "
9835 #~ "description of the project, and information about reporting bugs, can be "
9836 #~ "found at http://www.kernel.org/doc/man-pages/."
9837 #~ msgstr ""
9838 #~ "この man ページは Linux I<man-pages> プロジェクトのリリース 3.38 の一部で"
9839 #~ "ある。\n"
9840 #~ "プロジェクトの説明とバグ報告に関する情報は\n"
9841 #~ "http://www.kernel.org/doc/man-pages/ に書かれている。"
9842
9843 #~ msgid "2008-11-10"
9844 #~ msgstr "2008-11-10"
9845
9846 #~ msgid "2008-11-05"
9847 #~ msgstr "2008-11-05"
9848
9849 #~ msgid "2008-11-18"
9850 #~ msgstr "2008-11-18"