OSDN Git Service

(split) LDP: Some works on pthread/ja.po.
[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-05-01 04:22+0900\n"
10 "PO-Revision-Date: 2012-05-03 17:42+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man2/getcontext.2:23
20 #, no-wrap
21 msgid "GETCONTEXT"
22 msgstr "GETCONTEXT"
23
24 #. type: TH
25 #: build/C/man2/getcontext.2:23
26 #, no-wrap
27 msgid "2009-03-15"
28 msgstr "2009-03-15"
29
30 #. type: TH
31 #: build/C/man2/getcontext.2:23 build/C/man3/pthread_attr_init.3:24
32 #: build/C/man3/pthread_attr_setaffinity_np.3:24
33 #: build/C/man3/pthread_attr_setdetachstate.3:24
34 #: build/C/man3/pthread_attr_setguardsize.3:24
35 #: build/C/man3/pthread_attr_setinheritsched.3:24
36 #: build/C/man3/pthread_attr_setschedparam.3:24
37 #: build/C/man3/pthread_attr_setschedpolicy.3:24
38 #: build/C/man3/pthread_attr_setscope.3:24
39 #: build/C/man3/pthread_attr_setstack.3:24
40 #: build/C/man3/pthread_attr_setstackaddr.3:24
41 #: build/C/man3/pthread_attr_setstacksize.3:24
42 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_cleanup_push.3:24
43 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
44 #: build/C/man3/pthread_create.3:24 build/C/man3/pthread_detach.3:24
45 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
46 #: build/C/man3/pthread_getattr_np.3:24
47 #: build/C/man3/pthread_getcpuclockid.3:24 build/C/man3/pthread_join.3:24
48 #: build/C/man3/pthread_kill.3:24
49 #: build/C/man3/pthread_kill_other_threads_np.3:24
50 #: build/C/man3/pthread_self.3:24 build/C/man3/pthread_setaffinity_np.3:24
51 #: build/C/man3/pthread_setcancelstate.3:24
52 #: build/C/man3/pthread_setconcurrency.3:23
53 #: build/C/man3/pthread_setschedparam.3:24
54 #: build/C/man3/pthread_setschedprio.3:24 build/C/man3/pthread_sigmask.3:24
55 #: build/C/man3/pthread_sigqueue.3:23 build/C/man3/pthread_testcancel.3:24
56 #: build/C/man3/pthread_tryjoin_np.3:24 build/C/man3/pthread_yield.3:23
57 #: build/C/man7/pthreads.7:24
58 #, no-wrap
59 msgid "Linux"
60 msgstr "Linux"
61
62 #. type: TH
63 #: build/C/man2/getcontext.2:23 build/C/man3/makecontext.3:25
64 #: build/C/man3/pthread_attr_init.3:24
65 #: build/C/man3/pthread_attr_setaffinity_np.3:24
66 #: build/C/man3/pthread_attr_setdetachstate.3:24
67 #: build/C/man3/pthread_attr_setguardsize.3:24
68 #: build/C/man3/pthread_attr_setinheritsched.3:24
69 #: build/C/man3/pthread_attr_setschedparam.3:24
70 #: build/C/man3/pthread_attr_setschedpolicy.3:24
71 #: build/C/man3/pthread_attr_setscope.3:24
72 #: build/C/man3/pthread_attr_setstack.3:24
73 #: build/C/man3/pthread_attr_setstackaddr.3:24
74 #: build/C/man3/pthread_attr_setstacksize.3:24
75 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_cleanup_push.3:24
76 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
77 #: build/C/man3/pthread_create.3:24 build/C/man3/pthread_detach.3:24
78 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
79 #: build/C/man3/pthread_getattr_np.3:24
80 #: build/C/man3/pthread_getcpuclockid.3:24 build/C/man3/pthread_join.3:24
81 #: build/C/man3/pthread_kill.3:24
82 #: build/C/man3/pthread_kill_other_threads_np.3:24
83 #: build/C/man3/pthread_self.3:24 build/C/man3/pthread_setaffinity_np.3:24
84 #: build/C/man3/pthread_setcancelstate.3:24
85 #: build/C/man3/pthread_setconcurrency.3:23
86 #: build/C/man3/pthread_setschedparam.3:24
87 #: build/C/man3/pthread_setschedprio.3:24 build/C/man3/pthread_sigmask.3:24
88 #: build/C/man3/pthread_sigqueue.3:23 build/C/man3/pthread_testcancel.3:24
89 #: build/C/man3/pthread_tryjoin_np.3:24 build/C/man3/pthread_yield.3:23
90 #: build/C/man7/pthreads.7:24
91 #, no-wrap
92 msgid "Linux Programmer's Manual"
93 msgstr "Linux Programmer's Manual"
94
95 #. type: SH
96 #: build/C/man2/getcontext.2:24 build/C/man3/makecontext.3:26
97 #: build/C/man3/pthread_attr_init.3:25
98 #: build/C/man3/pthread_attr_setaffinity_np.3:25
99 #: build/C/man3/pthread_attr_setdetachstate.3:25
100 #: build/C/man3/pthread_attr_setguardsize.3:25
101 #: build/C/man3/pthread_attr_setinheritsched.3:25
102 #: build/C/man3/pthread_attr_setschedparam.3:25
103 #: build/C/man3/pthread_attr_setschedpolicy.3:25
104 #: build/C/man3/pthread_attr_setscope.3:25
105 #: build/C/man3/pthread_attr_setstack.3:25
106 #: build/C/man3/pthread_attr_setstackaddr.3:25
107 #: build/C/man3/pthread_attr_setstacksize.3:25
108 #: build/C/man3/pthread_cancel.3:25 build/C/man3/pthread_cleanup_push.3:25
109 #: build/C/man3/pthread_cleanup_push_defer_np.3:25
110 #: build/C/man3/pthread_create.3:25 build/C/man3/pthread_detach.3:25
111 #: build/C/man3/pthread_equal.3:25 build/C/man3/pthread_exit.3:25
112 #: build/C/man3/pthread_getattr_np.3:25
113 #: build/C/man3/pthread_getcpuclockid.3:25 build/C/man3/pthread_join.3:25
114 #: build/C/man3/pthread_kill.3:25
115 #: build/C/man3/pthread_kill_other_threads_np.3:25
116 #: build/C/man3/pthread_self.3:25 build/C/man3/pthread_setaffinity_np.3:25
117 #: build/C/man3/pthread_setcancelstate.3:25
118 #: build/C/man3/pthread_setconcurrency.3:24
119 #: build/C/man3/pthread_setschedparam.3:25
120 #: build/C/man3/pthread_setschedprio.3:25 build/C/man3/pthread_sigmask.3:25
121 #: build/C/man3/pthread_sigqueue.3:24 build/C/man3/pthread_testcancel.3:25
122 #: build/C/man3/pthread_tryjoin_np.3:25 build/C/man3/pthread_yield.3:24
123 #: build/C/man7/pthreads.7:25
124 #, no-wrap
125 msgid "NAME"
126 msgstr "名前"
127
128 #. type: Plain text
129 #: build/C/man2/getcontext.2:26
130 msgid "getcontext, setcontext - get or set the user context"
131 msgstr "getcontext, setcontext - ユーザコンテキストを取得/設定する"
132
133 #. type: SH
134 #: build/C/man2/getcontext.2:26 build/C/man3/makecontext.3:28
135 #: build/C/man3/pthread_attr_init.3:28
136 #: build/C/man3/pthread_attr_setaffinity_np.3:28
137 #: build/C/man3/pthread_attr_setdetachstate.3:28
138 #: build/C/man3/pthread_attr_setguardsize.3:28
139 #: build/C/man3/pthread_attr_setinheritsched.3:28
140 #: build/C/man3/pthread_attr_setschedparam.3:28
141 #: build/C/man3/pthread_attr_setschedpolicy.3:28
142 #: build/C/man3/pthread_attr_setscope.3:28
143 #: build/C/man3/pthread_attr_setstack.3:28
144 #: build/C/man3/pthread_attr_setstackaddr.3:28
145 #: build/C/man3/pthread_attr_setstacksize.3:28
146 #: build/C/man3/pthread_cancel.3:27 build/C/man3/pthread_cleanup_push.3:28
147 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
148 #: build/C/man3/pthread_create.3:27 build/C/man3/pthread_detach.3:27
149 #: build/C/man3/pthread_equal.3:27 build/C/man3/pthread_exit.3:27
150 #: build/C/man3/pthread_getattr_np.3:27
151 #: build/C/man3/pthread_getcpuclockid.3:27 build/C/man3/pthread_join.3:27
152 #: build/C/man3/pthread_kill.3:27
153 #: build/C/man3/pthread_kill_other_threads_np.3:27
154 #: build/C/man3/pthread_self.3:27 build/C/man3/pthread_setaffinity_np.3:28
155 #: build/C/man3/pthread_setcancelstate.3:28
156 #: build/C/man3/pthread_setconcurrency.3:27
157 #: build/C/man3/pthread_setschedparam.3:28
158 #: build/C/man3/pthread_setschedprio.3:27 build/C/man3/pthread_sigmask.3:27
159 #: build/C/man3/pthread_sigqueue.3:26 build/C/man3/pthread_testcancel.3:27
160 #: build/C/man3/pthread_tryjoin_np.3:28 build/C/man3/pthread_yield.3:26
161 #, no-wrap
162 msgid "SYNOPSIS"
163 msgstr "書式"
164
165 #. type: Plain text
166 #: build/C/man2/getcontext.2:28 build/C/man3/makecontext.3:30
167 msgid "B<#include E<lt>ucontext.hE<gt>>"
168 msgstr "B<#include E<lt>ucontext.hE<gt>>"
169
170 #. type: Plain text
171 #: build/C/man2/getcontext.2:30
172 msgid "B<int getcontext(ucontext_t *>I<ucp>B<);>"
173 msgstr "B<int getcontext(ucontext_t *>I<ucp>B<);>"
174
175 #. type: Plain text
176 #: build/C/man2/getcontext.2:32
177 msgid "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
178 msgstr "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
179
180 #. type: SH
181 #: build/C/man2/getcontext.2:32 build/C/man3/makecontext.3:35
182 #: build/C/man3/pthread_attr_init.3:37
183 #: build/C/man3/pthread_attr_setaffinity_np.3:40
184 #: build/C/man3/pthread_attr_setdetachstate.3:39
185 #: build/C/man3/pthread_attr_setguardsize.3:39
186 #: build/C/man3/pthread_attr_setinheritsched.3:39
187 #: build/C/man3/pthread_attr_setschedparam.3:39
188 #: build/C/man3/pthread_attr_setschedpolicy.3:39
189 #: build/C/man3/pthread_attr_setscope.3:39
190 #: build/C/man3/pthread_attr_setstack.3:52
191 #: build/C/man3/pthread_attr_setstackaddr.3:39
192 #: build/C/man3/pthread_attr_setstacksize.3:39
193 #: build/C/man3/pthread_cancel.3:35 build/C/man3/pthread_cleanup_push.3:38
194 #: build/C/man3/pthread_cleanup_push_defer_np.3:38
195 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
196 #: build/C/man3/pthread_equal.3:35 build/C/man3/pthread_exit.3:35
197 #: build/C/man3/pthread_getattr_np.3:36
198 #: build/C/man3/pthread_getcpuclockid.3:36 build/C/man3/pthread_join.3:35
199 #: build/C/man3/pthread_kill.3:35
200 #: build/C/man3/pthread_kill_other_threads_np.3:33
201 #: build/C/man3/pthread_self.3:35 build/C/man3/pthread_setaffinity_np.3:40
202 #: build/C/man3/pthread_setcancelstate.3:37
203 #: build/C/man3/pthread_setconcurrency.3:36
204 #: build/C/man3/pthread_setschedparam.3:39
205 #: build/C/man3/pthread_setschedprio.3:35 build/C/man3/pthread_sigmask.3:36
206 #: build/C/man3/pthread_sigqueue.3:43 build/C/man3/pthread_testcancel.3:35
207 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
208 #: build/C/man7/pthreads.7:27
209 #, no-wrap
210 msgid "DESCRIPTION"
211 msgstr "説明"
212
213 #. type: Plain text
214 #: build/C/man2/getcontext.2:44
215 msgid ""
216 "In a System V-like environment, one has the two types I<mcontext_t> and "
217 "I<ucontext_t> defined in I<E<lt>ucontext.hE<gt>> and the four functions "
218 "B<getcontext>(), B<setcontext>(), B<makecontext>(3)  and B<swapcontext>(3)  "
219 "that allow user-level context switching between multiple threads of control "
220 "within a process."
221 msgstr ""
222 "System V 的な環境では、 I<mcontext_t> および I<ucontext_t> という 2 つの型"
223 "と、 B<getcontext>(), B<setcontext>(), B<makecontext>(3), B<swapcontext>(3)  "
224 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
225 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
226 "ようになっている。"
227
228 #. type: Plain text
229 #: build/C/man2/getcontext.2:48
230 msgid ""
231 "The I<mcontext_t> type is machine-dependent and opaque.  The I<ucontext_t> "
232 "type is a structure that has at least the following fields:"
233 msgstr ""
234 "I<mcontext_t> 型はマシン依存で、外部からは隠蔽されている。 I<ucontext_t> 型は"
235 "構造体で、少なくとも以下の 4 つのフィールドを持つ。"
236
237 #. type: Plain text
238 #: build/C/man2/getcontext.2:58
239 #, no-wrap
240 msgid ""
241 "typedef struct ucontext {\n"
242 "    struct ucontext *uc_link;\n"
243 "    sigset_t         uc_sigmask;\n"
244 "    stack_t          uc_stack;\n"
245 "    mcontext_t       uc_mcontext;\n"
246 "    ...\n"
247 "} ucontext_t;\n"
248 msgstr ""
249 "typedef struct ucontext {\n"
250 "    struct ucontext *uc_link;\n"
251 "    sigset_t         uc_sigmask;\n"
252 "    stack_t          uc_stack;\n"
253 "    mcontext_t       uc_mcontext;\n"
254 "    ...\n"
255 "} ucontext_t;\n"
256
257 #. type: Plain text
258 #: build/C/man2/getcontext.2:75
259 msgid ""
260 "with I<sigset_t> and I<stack_t> defined in I<E<lt>signal.hE<gt>>.  Here "
261 "I<uc_link> points to the context that will be resumed when the current "
262 "context terminates (in case the current context was created using "
263 "B<makecontext>(3)), I<uc_sigmask> is the set of signals blocked in this "
264 "context (see B<sigprocmask>(2)), I<uc_stack> is the stack used by this "
265 "context (see B<sigaltstack>(2)), and I<uc_mcontext> is the machine-specific "
266 "representation of the saved context, that includes the calling thread's "
267 "machine registers."
268 msgstr ""
269 "I<sigset_t> と I<stack_t> は I<E<lt>signal.hE<gt>> で定義されている。 ここで "
270 "I<uc_link> は、 現在のコンテキストが終了したとき、 続いて切り替わるコンテキス"
271 "トへのポインタである (現在のコンテキストが B<makecontext>(3)  で生成されたも"
272 "のの場合)。 I<uc_sigmask> はこのコンテキストでブロックされている シグナル群で"
273 "ある (B<sigprocmask>(2)  を見よ)。 I<uc_stack> はこのコンテキストが用いている"
274 "スタックである (B<signalstack>(2)  を見よ)。 I<uc_mcontext> は保存されている"
275 "コンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマシ"
276 "ンレジスタが格納される。"
277
278 #. type: Plain text
279 #: build/C/man2/getcontext.2:80
280 msgid ""
281 "The function B<getcontext>()  initializes the structure pointed at by I<ucp> "
282 "to the currently active context."
283 msgstr ""
284 "B<getcontext>()  関数は、 ポインタ I<ucp> が指す構造体を、 現在アクティブなコ"
285 "ンテキストに初期化する。"
286
287 #. type: Plain text
288 #: build/C/man2/getcontext.2:92
289 msgid ""
290 "The function B<setcontext>()  restores the user context pointed at by "
291 "I<ucp>.  A successful call does not return.  The context should have been "
292 "obtained by a call of B<getcontext>(), or B<makecontext>(3), or passed as "
293 "third argument to a signal handler."
294 msgstr ""
295 "B<setcontext>()  関数は、ポインタ I<ucp> が指すユーザコンテキストをリストアす"
296 "る。 呼び出しに成功すると返らない。 このコンテキストは、以前に B<getcontext>"
297 "()  または B<makecontext>(3)  で得られたものか、 あるいはシグナルの第三引数と"
298 "して与えられたものになる。"
299
300 #. type: Plain text
301 #: build/C/man2/getcontext.2:96
302 msgid ""
303 "If the context was obtained by a call of B<getcontext>(), program execution "
304 "continues as if this call just returned."
305 msgstr ""
306 "コンテキストが B<getcontext>()  の呼び出しによって得られていたものの場合は、 "
307 "プログラムはこの呼び出しから返った直後からのように実行を継続する。"
308
309 #. type: Plain text
310 #: build/C/man2/getcontext.2:107
311 msgid ""
312 "If the context was obtained by a call of B<makecontext>(3), program "
313 "execution continues by a call to the function I<func> specified as the "
314 "second argument of that call to B<makecontext>(3).  When the function "
315 "I<func> returns, we continue with the I<uc_link> member of the structure "
316 "I<ucp> specified as the first argument of that call to B<makecontext>(3).  "
317 "When this member is NULL, the thread exits."
318 msgstr ""
319 "コンテキストが B<makecontext>(3)  の呼び出しによって得られていたものの場合"
320 "は、 プログラムの実行はその B<makecontext>(3)  呼び出しの第二引数で指定された"
321 "関数 I<func> を呼び出すかたちで継続する。 I<func> から返ると、 B<makecontext>"
322 "(3)  呼び出しの第一引数で指定されていた I<ucp> 構造体の I<uc_link> メンバで継"
323 "続する。 このメンバが NULL だった場合は、そのスレッドは終了する。"
324
325 #. type: Plain text
326 #: build/C/man2/getcontext.2:114
327 msgid ""
328 "If the context was obtained by a call to a signal handler, then old standard "
329 "text says that \"program execution continues with the program instruction "
330 "following the instruction interrupted by the signal\".  However, this "
331 "sentence was removed in SUSv2, and the present verdict is \"the result is "
332 "unspecified\"."
333 msgstr ""
334 "コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 古"
335 "い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命令"
336 "から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結果"
337 "は定義されていない」である。"
338
339 #. type: SH
340 #: build/C/man2/getcontext.2:114 build/C/man3/makecontext.3:81
341 #: build/C/man3/pthread_attr_init.3:66
342 #: build/C/man3/pthread_attr_setaffinity_np.3:74
343 #: build/C/man3/pthread_attr_setdetachstate.3:75
344 #: build/C/man3/pthread_attr_setguardsize.3:88
345 #: build/C/man3/pthread_attr_setinheritsched.3:82
346 #: build/C/man3/pthread_attr_setschedparam.3:72
347 #: build/C/man3/pthread_attr_setschedpolicy.3:70
348 #: build/C/man3/pthread_attr_setscope.3:89
349 #: build/C/man3/pthread_attr_setstack.3:83
350 #: build/C/man3/pthread_attr_setstackaddr.3:72
351 #: build/C/man3/pthread_attr_setstacksize.3:59
352 #: build/C/man3/pthread_cancel.3:107 build/C/man3/pthread_cleanup_push.3:117
353 #: build/C/man3/pthread_create.3:113 build/C/man3/pthread_detach.3:47
354 #: build/C/man3/pthread_equal.3:39 build/C/man3/pthread_exit.3:69
355 #: build/C/man3/pthread_getattr_np.3:71
356 #: build/C/man3/pthread_getcpuclockid.3:44 build/C/man3/pthread_join.3:68
357 #: build/C/man3/pthread_kill.3:50 build/C/man3/pthread_self.3:44
358 #: build/C/man3/pthread_setaffinity_np.3:75
359 #: build/C/man3/pthread_setcancelstate.3:90
360 #: build/C/man3/pthread_setconcurrency.3:54
361 #: build/C/man3/pthread_setschedparam.3:102
362 #: build/C/man3/pthread_setschedprio.3:51 build/C/man3/pthread_sigmask.3:47
363 #: build/C/man3/pthread_sigqueue.3:63 build/C/man3/pthread_testcancel.3:48
364 #: build/C/man3/pthread_tryjoin_np.3:83 build/C/man3/pthread_yield.3:41
365 #, no-wrap
366 msgid "RETURN VALUE"
367 msgstr "返り値"
368
369 #. type: Plain text
370 #: build/C/man2/getcontext.2:122
371 msgid ""
372 "When successful, B<getcontext>()  returns 0 and B<setcontext>()  does not "
373 "return.  On error, both return -1 and set I<errno> appropriately."
374 msgstr ""
375 "成功すると、 B<getcontext>()  は 0 を返し、 B<setcontext>()  は返らない。 失"
376 "敗すると、両者とも -1 を返し、I<errno> をエラーに応じて設定する。"
377
378 #. type: SH
379 #: build/C/man2/getcontext.2:122 build/C/man3/makecontext.3:93
380 #: build/C/man3/pthread_attr_init.3:69
381 #: build/C/man3/pthread_attr_setaffinity_np.3:77
382 #: build/C/man3/pthread_attr_setdetachstate.3:78
383 #: build/C/man3/pthread_attr_setguardsize.3:91
384 #: build/C/man3/pthread_attr_setinheritsched.3:85
385 #: build/C/man3/pthread_attr_setschedparam.3:75
386 #: build/C/man3/pthread_attr_setschedpolicy.3:73
387 #: build/C/man3/pthread_attr_setscope.3:92
388 #: build/C/man3/pthread_attr_setstack.3:86
389 #: build/C/man3/pthread_attr_setstackaddr.3:75
390 #: build/C/man3/pthread_attr_setstacksize.3:62
391 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_cleanup_push.3:119
392 #: build/C/man3/pthread_create.3:120 build/C/man3/pthread_detach.3:52
393 #: build/C/man3/pthread_equal.3:43 build/C/man3/pthread_exit.3:71
394 #: build/C/man3/pthread_getattr_np.3:74
395 #: build/C/man3/pthread_getcpuclockid.3:47 build/C/man3/pthread_join.3:73
396 #: build/C/man3/pthread_kill.3:55 build/C/man3/pthread_self.3:46
397 #: build/C/man3/pthread_setaffinity_np.3:78
398 #: build/C/man3/pthread_setcancelstate.3:93
399 #: build/C/man3/pthread_setconcurrency.3:66
400 #: build/C/man3/pthread_setschedparam.3:110
401 #: build/C/man3/pthread_setschedprio.3:59 build/C/man3/pthread_sigmask.3:52
402 #: build/C/man3/pthread_sigqueue.3:68 build/C/man3/pthread_testcancel.3:52
403 #: build/C/man3/pthread_tryjoin_np.3:87 build/C/man3/pthread_yield.3:46
404 #, no-wrap
405 msgid "ERRORS"
406 msgstr "エラー"
407
408 #. type: Plain text
409 #: build/C/man2/getcontext.2:124
410 msgid "None defined."
411 msgstr "定義されていない。"
412
413 #. type: SH
414 #: build/C/man2/getcontext.2:124 build/C/man3/makecontext.3:102
415 #: build/C/man3/pthread_attr_init.3:77
416 #: build/C/man3/pthread_attr_setaffinity_np.3:106
417 #: build/C/man3/pthread_attr_setdetachstate.3:85
418 #: build/C/man3/pthread_attr_setguardsize.3:104
419 #: build/C/man3/pthread_attr_setinheritsched.3:99
420 #: build/C/man3/pthread_attr_setschedparam.3:87
421 #: build/C/man3/pthread_attr_setschedpolicy.3:87
422 #: build/C/man3/pthread_attr_setscope.3:105
423 #: build/C/man3/pthread_attr_setstack.3:110
424 #: build/C/man3/pthread_attr_setstackaddr.3:81
425 #: build/C/man3/pthread_attr_setstacksize.3:81
426 #: build/C/man3/pthread_cancel.3:120 build/C/man3/pthread_cleanup_push.3:123
427 #: build/C/man3/pthread_cleanup_push_defer_np.3:99
428 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:62
429 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
430 #: build/C/man3/pthread_getattr_np.3:96
431 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:96
432 #: build/C/man3/pthread_kill.3:64
433 #: build/C/man3/pthread_kill_other_threads_np.3:45
434 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_setaffinity_np.3:119
435 #: build/C/man3/pthread_setcancelstate.3:111
436 #: build/C/man3/pthread_setconcurrency.3:81
437 #: build/C/man3/pthread_setschedparam.3:139
438 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigmask.3:55
439 #: build/C/man3/pthread_sigqueue.3:91 build/C/man3/pthread_testcancel.3:56
440 #: build/C/man3/pthread_tryjoin_np.3:110 build/C/man3/pthread_yield.3:50
441 #, no-wrap
442 msgid "CONFORMING TO"
443 msgstr "準拠"
444
445 #. type: Plain text
446 #: build/C/man2/getcontext.2:130
447 msgid ""
448 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specification of B<getcontext>"
449 "(), citing portability issues, and recommending that applications be "
450 "rewritten to use POSIX threads instead."
451 msgstr ""
452 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<getcontext>()  の"
453 "仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直"
454 "すことが 推奨されている。"
455
456 #. type: SH
457 #: build/C/man2/getcontext.2:130 build/C/man3/makecontext.3:110
458 #: build/C/man3/pthread_attr_init.3:79
459 #: build/C/man3/pthread_attr_setaffinity_np.3:109
460 #: build/C/man3/pthread_attr_setdetachstate.3:87
461 #: build/C/man3/pthread_attr_setguardsize.3:106
462 #: build/C/man3/pthread_attr_setschedparam.3:89
463 #: build/C/man3/pthread_attr_setscope.3:107
464 #: build/C/man3/pthread_attr_setstack.3:112
465 #: build/C/man3/pthread_attr_setstackaddr.3:84
466 #: build/C/man3/pthread_attr_setstacksize.3:83
467 #: build/C/man3/pthread_cancel.3:122 build/C/man3/pthread_cleanup_push.3:125
468 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
469 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
470 #: build/C/man3/pthread_getcpuclockid.3:65 build/C/man3/pthread_join.3:98
471 #: build/C/man3/pthread_kill.3:66
472 #: build/C/man3/pthread_kill_other_threads_np.3:48
473 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_setaffinity_np.3:122
474 #: build/C/man3/pthread_setcancelstate.3:113
475 #: build/C/man3/pthread_setconcurrency.3:83
476 #: build/C/man3/pthread_setschedparam.3:141
477 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:57
478 #: build/C/man3/pthread_yield.3:56
479 #, no-wrap
480 msgid "NOTES"
481 msgstr "注意"
482
483 #. type: Plain text
484 #: build/C/man2/getcontext.2:147
485 msgid ""
486 "The earliest incarnation of this mechanism was the B<setjmp>(3)/B<longjmp>"
487 "(3)  mechanism.  Since that does not define the handling of the signal "
488 "context, the next stage was the B<sigsetjmp>(3)/B<siglongjmp>(3)  pair.  The "
489 "present mechanism gives much more control.  On the other hand, there is no "
490 "easy way to detect whether a return from B<getcontext>()  is from the first "
491 "call, or via a B<setcontext>()  call.  The user has to invent her own "
492 "bookkeeping device, and a register variable won't do since registers are "
493 "restored."
494 msgstr ""
495 "このメカニズムの最古の実装は、 B<setjmp>(3)/B<longjmp>(3)  機構であった。 こ"
496 "れらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階で"
497 "は B<sigsetjmp>(3)/B<siglongjmp>(3)  のペアが現われた。 現在の機構ではずっと"
498 "細かな制御ができる。 一方 B<getcontext>()  から返ったとき、 これが最初の呼び"
499 "出しであったか、 それとも B<setcontext>()  呼び出しからのものであるかを 区別"
500 "する容易な方法がなくなってしまった。 ユーザは「しおり」機構を自分で作らなけれ"
501 "ばならない。 レジスタ変数は (レジスタはリストアされてしまうので) これをやって"
502 "くれない。"
503
504 #. type: Plain text
505 #: build/C/man2/getcontext.2:158
506 msgid ""
507 "When a signal occurs, the current user context is saved and a new context is "
508 "created by the kernel for the signal handler.  Do not leave the handler "
509 "using B<longjmp>(3): it is undefined what would happen with contexts.  Use "
510 "B<siglongjmp>(3)  or B<setcontext>()  instead."
511 msgstr ""
512 "シグナルが発生すると、 現在のユーザコンテキストは保存され、 シグナルハンドラ"
513 "用のコンテキストがカーネルによって生成される。 今後はハンドラに B<longjmp>"
514 "(3)  を使わせないこと: この関数のコンテキスト下での動作は定義されていない。 "
515 "代わりに B<siglongjmp>(3)  か B<setcontext>()  を使うこと。"
516
517 #. type: SH
518 #: build/C/man2/getcontext.2:158 build/C/man3/makecontext.3:217
519 #: build/C/man3/pthread_attr_init.3:295
520 #: build/C/man3/pthread_attr_setaffinity_np.3:116
521 #: build/C/man3/pthread_attr_setdetachstate.3:109
522 #: build/C/man3/pthread_attr_setguardsize.3:156
523 #: build/C/man3/pthread_attr_setinheritsched.3:120
524 #: build/C/man3/pthread_attr_setschedparam.3:96
525 #: build/C/man3/pthread_attr_setschedpolicy.3:92
526 #: build/C/man3/pthread_attr_setscope.3:118
527 #: build/C/man3/pthread_attr_setstack.3:154
528 #: build/C/man3/pthread_attr_setstackaddr.3:108
529 #: build/C/man3/pthread_attr_setstacksize.3:109
530 #: build/C/man3/pthread_cancel.3:221 build/C/man3/pthread_cleanup_push.3:309
531 #: build/C/man3/pthread_cleanup_push_defer_np.3:102
532 #: build/C/man3/pthread_create.3:367 build/C/man3/pthread_detach.3:95
533 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:103
534 #: build/C/man3/pthread_getattr_np.3:343
535 #: build/C/man3/pthread_getcpuclockid.3:167 build/C/man3/pthread_join.3:125
536 #: build/C/man3/pthread_kill.3:73
537 #: build/C/man3/pthread_kill_other_threads_np.3:64
538 #: build/C/man3/pthread_self.3:74 build/C/man3/pthread_setaffinity_np.3:204
539 #: build/C/man3/pthread_setcancelstate.3:175
540 #: build/C/man3/pthread_setconcurrency.3:98
541 #: build/C/man3/pthread_setschedparam.3:429
542 #: build/C/man3/pthread_setschedprio.3:89 build/C/man3/pthread_sigmask.3:133
543 #: build/C/man3/pthread_sigqueue.3:93 build/C/man3/pthread_testcancel.3:61
544 #: build/C/man3/pthread_tryjoin_np.3:133 build/C/man3/pthread_yield.3:59
545 #: build/C/man7/pthreads.7:893
546 #, no-wrap
547 msgid "SEE ALSO"
548 msgstr "関連項目"
549
550 #. type: Plain text
551 #: build/C/man2/getcontext.2:165
552 msgid ""
553 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
554 "B<makecontext>(3), B<sigsetjmp>(3)"
555 msgstr ""
556 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
557 "B<makecontext>(3), B<sigsetjmp>(3)"
558
559 #. type: SH
560 #: build/C/man2/getcontext.2:165 build/C/man3/makecontext.3:223
561 #: build/C/man3/pthread_attr_init.3:309
562 #: build/C/man3/pthread_attr_setaffinity_np.3:122
563 #: build/C/man3/pthread_attr_setdetachstate.3:115
564 #: build/C/man3/pthread_attr_setguardsize.3:164
565 #: build/C/man3/pthread_attr_setinheritsched.3:129
566 #: build/C/man3/pthread_attr_setschedparam.3:106
567 #: build/C/man3/pthread_attr_setschedpolicy.3:101
568 #: build/C/man3/pthread_attr_setscope.3:126
569 #: build/C/man3/pthread_attr_setstack.3:164
570 #: build/C/man3/pthread_attr_setstackaddr.3:114
571 #: build/C/man3/pthread_attr_setstacksize.3:116
572 #: build/C/man3/pthread_cancel.3:231 build/C/man3/pthread_cleanup_push.3:315
573 #: build/C/man3/pthread_cleanup_push_defer_np.3:108
574 #: build/C/man3/pthread_create.3:378 build/C/man3/pthread_detach.3:102
575 #: build/C/man3/pthread_equal.3:58 build/C/man3/pthread_exit.3:107
576 #: build/C/man3/pthread_getattr_np.3:357
577 #: build/C/man3/pthread_getcpuclockid.3:175 build/C/man3/pthread_join.3:132
578 #: build/C/man3/pthread_kill.3:82
579 #: build/C/man3/pthread_kill_other_threads_np.3:70
580 #: build/C/man3/pthread_self.3:78 build/C/man3/pthread_setaffinity_np.3:212
581 #: build/C/man3/pthread_setcancelstate.3:180
582 #: build/C/man3/pthread_setconcurrency.3:101
583 #: build/C/man3/pthread_setschedparam.3:441
584 #: build/C/man3/pthread_setschedprio.3:101 build/C/man3/pthread_sigmask.3:142
585 #: build/C/man3/pthread_sigqueue.3:101 build/C/man3/pthread_testcancel.3:66
586 #: build/C/man3/pthread_tryjoin_np.3:138 build/C/man3/pthread_yield.3:63
587 #: build/C/man7/pthreads.7:927
588 #, no-wrap
589 msgid "COLOPHON"
590 msgstr "この文書について"
591
592 #. type: Plain text
593 #: build/C/man2/getcontext.2:172 build/C/man3/makecontext.3:230
594 #: build/C/man3/pthread_attr_init.3:316
595 #: build/C/man3/pthread_attr_setaffinity_np.3:129
596 #: build/C/man3/pthread_attr_setdetachstate.3:122
597 #: build/C/man3/pthread_attr_setguardsize.3:171
598 #: build/C/man3/pthread_attr_setinheritsched.3:136
599 #: build/C/man3/pthread_attr_setschedparam.3:113
600 #: build/C/man3/pthread_attr_setschedpolicy.3:108
601 #: build/C/man3/pthread_attr_setscope.3:133
602 #: build/C/man3/pthread_attr_setstack.3:171
603 #: build/C/man3/pthread_attr_setstackaddr.3:121
604 #: build/C/man3/pthread_attr_setstacksize.3:123
605 #: build/C/man3/pthread_cancel.3:238 build/C/man3/pthread_cleanup_push.3:322
606 #: build/C/man3/pthread_cleanup_push_defer_np.3:115
607 #: build/C/man3/pthread_create.3:385 build/C/man3/pthread_detach.3:109
608 #: build/C/man3/pthread_equal.3:65 build/C/man3/pthread_exit.3:114
609 #: build/C/man3/pthread_getattr_np.3:364
610 #: build/C/man3/pthread_getcpuclockid.3:182 build/C/man3/pthread_join.3:139
611 #: build/C/man3/pthread_kill.3:89
612 #: build/C/man3/pthread_kill_other_threads_np.3:77
613 #: build/C/man3/pthread_self.3:85 build/C/man3/pthread_setaffinity_np.3:219
614 #: build/C/man3/pthread_setcancelstate.3:187
615 #: build/C/man3/pthread_setconcurrency.3:108
616 #: build/C/man3/pthread_setschedparam.3:448
617 #: build/C/man3/pthread_setschedprio.3:108 build/C/man3/pthread_sigmask.3:149
618 #: build/C/man3/pthread_sigqueue.3:108 build/C/man3/pthread_testcancel.3:73
619 #: build/C/man3/pthread_tryjoin_np.3:145 build/C/man3/pthread_yield.3:70
620 #: build/C/man7/pthreads.7:934
621 msgid ""
622 "This page is part of release 3.40 of the Linux I<man-pages> project.  A "
623 "description of the project, and information about reporting bugs, can be "
624 "found at http://www.kernel.org/doc/man-pages/."
625 msgstr ""
626 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.40 の一部\n"
627 "である。プロジェクトの説明とバグ報告に関する情報は\n"
628 "http://www.kernel.org/doc/man-pages/ に書かれている。"
629
630 #. type: TH
631 #: build/C/man3/makecontext.3:25
632 #, no-wrap
633 msgid "MAKECONTEXT"
634 msgstr "MAKECONTEXT"
635
636 #. type: TH
637 #: build/C/man3/makecontext.3:25
638 #, no-wrap
639 msgid "2009-03-31"
640 msgstr "2009-03-31"
641
642 #. type: TH
643 #: build/C/man3/makecontext.3:25
644 #, no-wrap
645 msgid "GNU"
646 msgstr "GNU"
647
648 #. type: Plain text
649 #: build/C/man3/makecontext.3:28
650 msgid "makecontext, swapcontext - manipulate user context"
651 msgstr "makecontext, swapcontext - ユーザコンテキストを操作する"
652
653 #. type: Plain text
654 #: build/C/man3/makecontext.3:33
655 msgid ""
656 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
657 ">I<argc>B<, ...);>"
658 msgstr ""
659 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
660 ">I<argc>B<, ...);>"
661
662 #. type: Plain text
663 #: build/C/man3/makecontext.3:35
664 msgid "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
665 msgstr "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
666
667 #. type: Plain text
668 #: build/C/man3/makecontext.3:46
669 msgid ""
670 "In a System V-like environment, one has the type I<ucontext_t> defined in "
671 "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(2), "
672 "B<setcontext>(2), B<makecontext>()  and B<swapcontext>()  that allow user-"
673 "level context switching between multiple threads of control within a process."
674 msgstr ""
675 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
676 "と、 B<getcontext>(2), B<setcontext>(2), B<makecontext>(), B<swapcontext>()  "
677 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
678 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
679 "ようになっている。"
680
681 #. type: Plain text
682 #: build/C/man3/makecontext.3:49
683 msgid "For the type and the first two functions, see B<getcontext>(2)."
684 msgstr ""
685 "これらの型と、最初の 2 つの関数については、 B<getcontext>(2)  を参照のこと。"
686
687 #. type: Plain text
688 #: build/C/man3/makecontext.3:61
689 msgid ""
690 "The B<makecontext>()  function modifies the context pointed to by I<ucp> "
691 "(which was obtained from a call to B<getcontext>(2)).  Before invoking "
692 "B<makecontext>(), the caller must allocate a new stack for this context and "
693 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
694 "and assign its address to I<ucp-E<gt>uc_link>."
695 msgstr ""
696 "B<makecontext>()  関数は、ポインタ I<ucp> が指すコンテキストを変更する "
697 "(I<ucp> は以前の B<getcontext>(2)  呼び出しで得られたものである)。 "
698 "B<makecontext>()  を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
699 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
700 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
701 "らない。"
702
703 #. type: Plain text
704 #: build/C/man3/makecontext.3:75
705 msgid ""
706 "When this context is later activated (using B<setcontext>(2)  or "
707 "B<swapcontext>())  the function I<func> is called, and passed the series of "
708 "integer (I<int>)  arguments that follow I<argc>; the caller must specify the "
709 "number of these arguments in I<argc>.  When this function returns, the "
710 "successor context is activated.  If the successor context pointer is NULL, "
711 "the thread exits."
712 msgstr ""
713 "このコンテキストが将来 (B<setcontext>(2)  または B<swapcontext>()  によっ"
714 "て)  有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 "
715 "(I<int>)  引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数"
716 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
717 "る。 後継コンテキストのポインタが NULL の場合、そのスレッドが終了する。"
718
719 #. type: Plain text
720 #: build/C/man3/makecontext.3:81
721 msgid ""
722 "The B<swapcontext>()  function saves the current context in the structure "
723 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
724 msgstr ""
725 "B<swapcontext>()  関数は現在のコンテキストを ポインタ I<oucp> が指す構造体に"
726 "保存し、 ポインタ I<ucp> が指すコンテキストを有効にする。"
727
728 #. type: Plain text
729 #: build/C/man3/makecontext.3:93
730 msgid ""
731 "When successful, B<swapcontext>()  does not return.  (But we may return "
732 "later, in case I<oucp> is activated, in which case it looks like "
733 "B<swapcontext>()  returns 0.)  On error, B<swapcontext>()  returns -1 and "
734 "sets I<errno> appropriately."
735 msgstr ""
736 "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった"
737 "場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見え"
738 "る。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じ"
739 "て設定する。"
740
741 #. type: TP
742 #: build/C/man3/makecontext.3:94
743 #: build/C/man3/pthread_attr_setaffinity_np.3:100
744 #: build/C/man3/pthread_getattr_np.3:75
745 #, no-wrap
746 msgid "B<ENOMEM>"
747 msgstr "B<ENOMEM>"
748
749 #. type: Plain text
750 #: build/C/man3/makecontext.3:97
751 msgid "Insufficient stack space left."
752 msgstr "スタックに割り当てる空間が残っていない。"
753
754 #. type: SH
755 #: build/C/man3/makecontext.3:97
756 #: build/C/man3/pthread_attr_setaffinity_np.3:104
757 #: build/C/man3/pthread_attr_setguardsize.3:102
758 #: build/C/man3/pthread_attr_setstack.3:108
759 #: build/C/man3/pthread_attr_setstackaddr.3:79
760 #: build/C/man3/pthread_attr_setstacksize.3:79
761 #: build/C/man3/pthread_getattr_np.3:94
762 #: build/C/man3/pthread_getcpuclockid.3:61
763 #: build/C/man3/pthread_setaffinity_np.3:117
764 #: build/C/man3/pthread_setconcurrency.3:79
765 #: build/C/man3/pthread_setschedprio.3:79 build/C/man3/pthread_sigqueue.3:87
766 #: build/C/man3/pthread_tryjoin_np.3:108
767 #, no-wrap
768 msgid "VERSIONS"
769 msgstr "バージョン"
770
771 #. type: Plain text
772 #: build/C/man3/makecontext.3:102
773 msgid ""
774 "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version "
775 "2.1."
776 msgstr ""
777 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
778 "されている。"
779
780 #. type: Plain text
781 #: build/C/man3/makecontext.3:110
782 msgid ""
783 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specifications of "
784 "B<makecontext>()  and B<swapcontext>(), citing portability issues, and "
785 "recommending that applications be rewritten to use POSIX threads instead."
786 msgstr ""
787 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  "
788 "と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを "
789 "POSIX スレッドを使って書き直すことが 推奨されている。"
790
791 #. type: Plain text
792 #: build/C/man3/makecontext.3:118
793 msgid ""
794 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
795 "namely, this struct contains the start and length of a memory area to be "
796 "used as the stack, regardless of the direction of growth of the stack.  "
797 "Thus, it is not necessary for the user program to worry about this direction."
798 msgstr ""
799 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわ"
800 "ちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含"
801 "まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
802 "て、ユーザプログラムはこの件については心配しなくてよい。"
803
804 #. type: Plain text
805 #: build/C/man3/makecontext.3:134
806 msgid ""
807 "On architectures where I<int> and pointer types are the same size (e.g., "
808 "x86-32, where both types are 32 bits), you may be able to get away with "
809 "passing pointers as arguments to B<makecontext>()  following I<argc>.  "
810 "However, doing this is not guaranteed to be portable, is undefined according "
811 "to the standards, and won't work on architectures where pointers are larger "
812 "than I<int>s.  Nevertheless, starting with version 2.8, glibc makes some "
813 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
814 "g., x86-64)."
815 msgstr ""
816 "I<int> とポインタ型が同じ大きさであるアーキテクチャでは (x86-32 はその例であ"
817 "り、両方の型とも 32 ビットである)、 B<makecontext>()  の I<argc> 以降の引き数"
818 "としてポインタを渡してもうまく動くかもしれない。 しかしながら、このようにする"
819 "と、移植性は保証されず、 標準に従えば動作は未定義であり、ポインタが I<int> よ"
820 "りも大きいアーキテクチャでは正しく動作しないことだろう。 それにも関わらず、"
821 "バージョン 2.8 以降の glibc では、 B<makecontext>()  に変更が行われ、(x86-64 "
822 "などの) いくつかの 64 ビットアーキテクチャで 引き数としてポインタを渡すことが"
823 "できるようになっている。"
824
825 #. type: SH
826 #: build/C/man3/makecontext.3:134 build/C/man3/pthread_attr_init.3:85
827 #: build/C/man3/pthread_attr_setdetachstate.3:106
828 #: build/C/man3/pthread_attr_setguardsize.3:153
829 #: build/C/man3/pthread_attr_setinheritsched.3:117
830 #: build/C/man3/pthread_attr_setschedparam.3:93
831 #: build/C/man3/pthread_attr_setschedpolicy.3:89
832 #: build/C/man3/pthread_attr_setstack.3:151
833 #: build/C/man3/pthread_attr_setstacksize.3:106
834 #: build/C/man3/pthread_cancel.3:130 build/C/man3/pthread_cleanup_push.3:149
835 #: build/C/man3/pthread_create.3:200 build/C/man3/pthread_detach.3:91
836 #: build/C/man3/pthread_getattr_np.3:99
837 #: build/C/man3/pthread_getcpuclockid.3:76 build/C/man3/pthread_join.3:122
838 #: build/C/man3/pthread_setaffinity_np.3:152
839 #: build/C/man3/pthread_setcancelstate.3:172
840 #: build/C/man3/pthread_setschedparam.3:147 build/C/man3/pthread_sigmask.3:59
841 #: build/C/man3/pthread_testcancel.3:58 build/C/man3/pthread_tryjoin_np.3:113
842 #, no-wrap
843 msgid "EXAMPLE"
844 msgstr "例"
845
846 #. type: Plain text
847 #: build/C/man3/makecontext.3:142
848 msgid ""
849 "The example program below demonstrates the use of B<getcontext>(2), "
850 "B<makecontext>(), and B<swapcontext>().  Running the program produces the "
851 "following output:"
852 msgstr ""
853 "以下のサンプル・プログラムは、 B<getcontext>(2), B<makecontext>(), "
854 "B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行する"
855 "と、以下のような出力が得られる:"
856
857 #. type: Plain text
858 #: build/C/man3/makecontext.3:154
859 #, no-wrap
860 msgid ""
861 "$B< ./a.out>\n"
862 "main: swapcontext(&uctx_main, &uctx_func2)\n"
863 "func2: started\n"
864 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
865 "func1: started\n"
866 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
867 "func2: returning\n"
868 "func1: returning\n"
869 "main: exiting\n"
870 msgstr ""
871 "$B< ./a.out>\n"
872 "main: swapcontext(&uctx_main, &uctx_func2)\n"
873 "func2: started\n"
874 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
875 "func1: started\n"
876 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
877 "func2: returning\n"
878 "func1: returning\n"
879 "main: exiting\n"
880
881 #. type: SS
882 #: build/C/man3/makecontext.3:156 build/C/man3/pthread_attr_init.3:146
883 #: build/C/man3/pthread_cancel.3:146 build/C/man3/pthread_cleanup_push.3:225
884 #: build/C/man3/pthread_create.3:239 build/C/man3/pthread_getattr_np.3:177
885 #: build/C/man3/pthread_getcpuclockid.3:93
886 #: build/C/man3/pthread_setschedparam.3:222 build/C/man3/pthread_sigmask.3:77
887 #, no-wrap
888 msgid "Program source"
889 msgstr "プログラムのソース"
890
891 #. type: Plain text
892 #: build/C/man3/makecontext.3:162
893 #, no-wrap
894 msgid ""
895 "#include E<lt>ucontext.hE<gt>\n"
896 "#include E<lt>stdio.hE<gt>\n"
897 "#include E<lt>stdlib.hE<gt>\n"
898 msgstr ""
899 "#include E<lt>ucontext.hE<gt>\n"
900 "#include E<lt>stdio.hE<gt>\n"
901 "#include E<lt>stdlib.hE<gt>\n"
902
903 #. type: Plain text
904 #: build/C/man3/makecontext.3:164
905 #, no-wrap
906 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
907 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
908
909 #. type: Plain text
910 #: build/C/man3/makecontext.3:167
911 #, no-wrap
912 msgid ""
913 "#define handle_error(msg) \\e\n"
914 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
915 msgstr ""
916 "#define handle_error(msg) \\e\n"
917 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
918
919 #. type: Plain text
920 #: build/C/man3/makecontext.3:177
921 #, no-wrap
922 msgid ""
923 "static void\n"
924 "func1(void)\n"
925 "{\n"
926 "    printf(\"func1: started\\en\");\n"
927 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
928 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
929 "        handle_error(\"swapcontext\");\n"
930 "    printf(\"func1: returning\\en\");\n"
931 "}\n"
932 msgstr ""
933 "static void\n"
934 "func1(void)\n"
935 "{\n"
936 "    printf(\"func1: started\\en\");\n"
937 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
938 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
939 "        handle_error(\"swapcontext\");\n"
940 "    printf(\"func1: returning\\en\");\n"
941 "}\n"
942
943 #. type: Plain text
944 #: build/C/man3/makecontext.3:187
945 #, no-wrap
946 msgid ""
947 "static void\n"
948 "func2(void)\n"
949 "{\n"
950 "    printf(\"func2: started\\en\");\n"
951 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
952 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
953 "        handle_error(\"swapcontext\");\n"
954 "    printf(\"func2: returning\\en\");\n"
955 "}\n"
956 msgstr ""
957 "static void\n"
958 "func2(void)\n"
959 "{\n"
960 "    printf(\"func2: started\\en\");\n"
961 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
962 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
963 "        handle_error(\"swapcontext\");\n"
964 "    printf(\"func2: returning\\en\");\n"
965 "}\n"
966
967 #. type: Plain text
968 #: build/C/man3/makecontext.3:193
969 #, no-wrap
970 msgid ""
971 "int\n"
972 "main(int argc, char *argv[])\n"
973 "{\n"
974 "    char func1_stack[16384];\n"
975 "    char func2_stack[16384];\n"
976 msgstr ""
977 "int\n"
978 "main(int argc, char *argv[])\n"
979 "{\n"
980 "    char func1_stack[16384];\n"
981 "    char func2_stack[16384];\n"
982
983 #. type: Plain text
984 #: build/C/man3/makecontext.3:200
985 #, no-wrap
986 msgid ""
987 "    if (getcontext(&uctx_func1) == -1)\n"
988 "        handle_error(\"getcontext\");\n"
989 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
990 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
991 "    uctx_func1.uc_link = &uctx_main;\n"
992 "    makecontext(&uctx_func1, func1, 0);\n"
993 msgstr ""
994 "    if (getcontext(&uctx_func1) == -1)\n"
995 "        handle_error(\"getcontext\");\n"
996 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
997 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
998 "    uctx_func1.uc_link = &uctx_main;\n"
999 "    makecontext(&uctx_func1, func1, 0);\n"
1000
1001 #. type: Plain text
1002 #: build/C/man3/makecontext.3:208
1003 #, no-wrap
1004 msgid ""
1005 "    if (getcontext(&uctx_func2) == -1)\n"
1006 "        handle_error(\"getcontext\");\n"
1007 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1008 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1009 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1010 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1011 "    makecontext(&uctx_func2, func2, 0);\n"
1012 msgstr ""
1013 "    if (getcontext(&uctx_func2) == -1)\n"
1014 "        handle_error(\"getcontext\");\n"
1015 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1016 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1017 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1018 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1019 "    makecontext(&uctx_func2, func2, 0);\n"
1020
1021 #. type: Plain text
1022 #: build/C/man3/makecontext.3:212
1023 #, no-wrap
1024 msgid ""
1025 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1026 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1027 "        handle_error(\"swapcontext\");\n"
1028 msgstr ""
1029 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1030 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1031 "        handle_error(\"swapcontext\");\n"
1032
1033 #. type: Plain text
1034 #: build/C/man3/makecontext.3:216
1035 #, no-wrap
1036 msgid ""
1037 "    printf(\"main: exiting\\en\");\n"
1038 "    exit(EXIT_SUCCESS);\n"
1039 "}\n"
1040 msgstr ""
1041 "    printf(\"main: exiting\\en\");\n"
1042 "    exit(EXIT_SUCCESS);\n"
1043 "}\n"
1044
1045 #. type: Plain text
1046 #: build/C/man3/makecontext.3:223
1047 msgid ""
1048 "B<getcontext>(2), B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), "
1049 "B<sigsetjmp>(3)"
1050 msgstr ""
1051 "B<getcontext>(2), B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), "
1052 "B<sigsetjmp>(3)"
1053
1054 #. type: TH
1055 #: build/C/man3/pthread_attr_init.3:24
1056 #, no-wrap
1057 msgid "PTHREAD_ATTR_INIT"
1058 msgstr "PTHREAD_ATTR_INIT"
1059
1060 #. type: TH
1061 #: build/C/man3/pthread_attr_init.3:24
1062 #, no-wrap
1063 msgid "2008-11-11"
1064 msgstr "2008-11-11"
1065
1066 #. type: Plain text
1067 #: build/C/man3/pthread_attr_init.3:28
1068 msgid ""
1069 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1070 "attributes object"
1071 msgstr ""
1072 "pthread_attr_init, pthread_attr_destroy - \n"
1073 "スレッド属性オブジェクトの初期化と破棄を行う"
1074
1075 #. type: Plain text
1076 #: build/C/man3/pthread_attr_init.3:31
1077 #: build/C/man3/pthread_attr_setdetachstate.3:31
1078 #: build/C/man3/pthread_attr_setguardsize.3:31
1079 #: build/C/man3/pthread_attr_setinheritsched.3:31
1080 #: build/C/man3/pthread_attr_setschedparam.3:31
1081 #: build/C/man3/pthread_attr_setschedpolicy.3:31
1082 #: build/C/man3/pthread_attr_setscope.3:31
1083 #: build/C/man3/pthread_attr_setstack.3:31
1084 #: build/C/man3/pthread_attr_setstackaddr.3:31
1085 #: build/C/man3/pthread_attr_setstacksize.3:31
1086 #: build/C/man3/pthread_cancel.3:30 build/C/man3/pthread_cleanup_push.3:31
1087 #: build/C/man3/pthread_cleanup_push_defer_np.3:31
1088 #: build/C/man3/pthread_create.3:30 build/C/man3/pthread_detach.3:30
1089 #: build/C/man3/pthread_equal.3:30 build/C/man3/pthread_exit.3:30
1090 #: build/C/man3/pthread_join.3:30
1091 #: build/C/man3/pthread_kill_other_threads_np.3:30
1092 #: build/C/man3/pthread_self.3:30 build/C/man3/pthread_setcancelstate.3:31
1093 #: build/C/man3/pthread_setconcurrency.3:30
1094 #: build/C/man3/pthread_setschedparam.3:31
1095 #: build/C/man3/pthread_setschedprio.3:30 build/C/man3/pthread_sigqueue.3:29
1096 #: build/C/man3/pthread_testcancel.3:30 build/C/man3/pthread_yield.3:29
1097 #, no-wrap
1098 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1099 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1100
1101 #. type: Plain text
1102 #: build/C/man3/pthread_attr_init.3:34
1103 #, no-wrap
1104 msgid ""
1105 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1106 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1107 msgstr ""
1108 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1109 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1110
1111 #. type: Plain text
1112 #: build/C/man3/pthread_attr_init.3:36
1113 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1114 #: build/C/man3/pthread_attr_setdetachstate.3:38
1115 #: build/C/man3/pthread_attr_setguardsize.3:38
1116 #: build/C/man3/pthread_attr_setinheritsched.3:38
1117 #: build/C/man3/pthread_attr_setschedparam.3:38
1118 #: build/C/man3/pthread_attr_setschedpolicy.3:38
1119 #: build/C/man3/pthread_attr_setscope.3:38
1120 #: build/C/man3/pthread_attr_setstack.3:38
1121 #: build/C/man3/pthread_attr_setstackaddr.3:38
1122 #: build/C/man3/pthread_attr_setstacksize.3:38
1123 #: build/C/man3/pthread_cancel.3:34 build/C/man3/pthread_cleanup_push.3:37
1124 #: build/C/man3/pthread_equal.3:34 build/C/man3/pthread_exit.3:34
1125 #: build/C/man3/pthread_getattr_np.3:35
1126 #: build/C/man3/pthread_getcpuclockid.3:35 build/C/man3/pthread_self.3:34
1127 #: build/C/man3/pthread_setaffinity_np.3:39
1128 #: build/C/man3/pthread_setcancelstate.3:36
1129 #: build/C/man3/pthread_setconcurrency.3:35
1130 #: build/C/man3/pthread_setschedparam.3:38
1131 #: build/C/man3/pthread_setschedprio.3:34 build/C/man3/pthread_testcancel.3:34
1132 #, no-wrap
1133 msgid "Compile and link with I<-pthread>.\n"
1134 msgstr "I<-pthread> でコンパイルしてリンクする。\n"
1135
1136 #. type: Plain text
1137 #: build/C/man3/pthread_attr_init.3:48
1138 msgid ""
1139 "The B<pthread_attr_init>()  function initializes the thread attributes "
1140 "object pointed to by I<attr> with default attribute values.  After this "
1141 "call, individual attributes of the object can be set using various related "
1142 "functions (listed under SEE ALSO), and then the object can be used in one or "
1143 "more B<pthread_create>(3)  calls that create threads."
1144 msgstr ""
1145 "B<pthread_attr_init>() 関数は I<attr> が指すスレッド属性オブジェクト\n"
1146 "(thread attributes object) をデフォルトの属性値で初期化する。\n"
1147 "この呼び出しの後、オブジェクトの各属性は (関連項目に載っている) 種々の\n"
1148 "関数を使って設定することができ、このオブジェクトはスレッドの作成を行う\n"
1149 "B<pthread_create>(3) の呼び出しにおいて使用することができる (一つの\n"
1150 "オブジェクトを複数の B<pthread_create>(3) に渡してもよい)。"
1151
1152 #. type: Plain text
1153 #: build/C/man3/pthread_attr_init.3:53
1154 msgid ""
1155 "Calling B<pthread_attr_init>()  on a thread attributes object that has "
1156 "already been initialized results in undefined behavior."
1157 msgstr ""
1158 "すでに初期化されているスレッド属性オブジェクトに対して\n"
1159 "B<pthread_attr_init>() を呼び出した場合、\n"
1160 "どのような動作になるかは不定である。"
1161
1162 #. type: Plain text
1163 #: build/C/man3/pthread_attr_init.3:60
1164 msgid ""
1165 "When a thread attributes object is no longer required, it should be "
1166 "destroyed using the B<pthread_attr_destroy>()  function.  Destroying a "
1167 "thread attributes object has no effect on threads that were created using "
1168 "that object."
1169 msgstr ""
1170 "スレッド属性オブジェクトがもはや必要なくなった際には、\n"
1171 "そのオブジェクトは B<pthread_attr_destroy>() 関数を使って破棄すべきである。\n"
1172 "スレッド属性オブジェクトを破棄しても、\n"
1173 "そのオブジェクトを使って作成されたスレッドには影響はない。"
1174
1175 #. type: Plain text
1176 #: build/C/man3/pthread_attr_init.3:66
1177 msgid ""
1178 "Once a thread attributes object has been destroyed, it can be reinitialized "
1179 "using B<pthread_attr_init>().  Any other use of a destroyed thread "
1180 "attributes object has undefined results."
1181 msgstr ""
1182 "いったん破棄したスレッド属性オブジェクトは、\n"
1183 "B<pthread_attr_init>() を使って再初期化することができる。\n"
1184 "破棄したスレッド属性オブジェクトをこれ以外の用途で\n"
1185 "使った場合の結果は不定である。"
1186
1187 #. type: Plain text
1188 #: build/C/man3/pthread_attr_init.3:69
1189 #: build/C/man3/pthread_attr_setaffinity_np.3:77
1190 #: build/C/man3/pthread_attr_setdetachstate.3:78
1191 #: build/C/man3/pthread_attr_setguardsize.3:91
1192 #: build/C/man3/pthread_attr_setinheritsched.3:85
1193 #: build/C/man3/pthread_attr_setschedparam.3:75
1194 #: build/C/man3/pthread_attr_setschedpolicy.3:73
1195 #: build/C/man3/pthread_attr_setscope.3:92
1196 #: build/C/man3/pthread_attr_setstack.3:86
1197 #: build/C/man3/pthread_attr_setstackaddr.3:75
1198 #: build/C/man3/pthread_attr_setstacksize.3:62
1199 #: build/C/man3/pthread_setaffinity_np.3:78
1200 #: build/C/man3/pthread_setcancelstate.3:93
1201 msgid ""
1202 "On success, these functions return 0; on error, they return a nonzero error "
1203 "number."
1204 msgstr ""
1205 "成功すると、これらの関数は 0 を返す。\n"
1206 "エラーの場合、0 以外のエラー番号を返す。"
1207
1208 #. type: Plain text
1209 #: build/C/man3/pthread_attr_init.3:77
1210 msgid ""
1211 "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on "
1212 "Linux these functions always succeed (but portable and future-proof "
1213 "applications should nevertheless handle a possible error return)."
1214 msgstr ""
1215 "POSIX.1-2001 では B<pthread_attr_init>() にはエラー B<ENOMEM> が\n"
1216 "記載されている。\n"
1217 "Linux では、これらの関数は常に作成する\n"
1218 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
1219 "正のエラーの返り値を処理するようにすべきである)。"
1220
1221 #. type: Plain text
1222 #: build/C/man3/pthread_attr_init.3:79
1223 #: build/C/man3/pthread_attr_setdetachstate.3:87
1224 #: build/C/man3/pthread_attr_setguardsize.3:106
1225 #: build/C/man3/pthread_attr_setinheritsched.3:101
1226 #: build/C/man3/pthread_attr_setschedparam.3:89
1227 #: build/C/man3/pthread_attr_setschedpolicy.3:89
1228 #: build/C/man3/pthread_attr_setscope.3:107
1229 #: build/C/man3/pthread_attr_setstack.3:112
1230 #: build/C/man3/pthread_attr_setstacksize.3:83
1231 #: build/C/man3/pthread_cancel.3:122 build/C/man3/pthread_cleanup_push.3:125
1232 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
1233 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
1234 #: build/C/man3/pthread_getcpuclockid.3:65 build/C/man3/pthread_join.3:98
1235 #: build/C/man3/pthread_kill.3:66 build/C/man3/pthread_self.3:50
1236 #: build/C/man3/pthread_setcancelstate.3:113
1237 #: build/C/man3/pthread_setconcurrency.3:83
1238 #: build/C/man3/pthread_setschedparam.3:141
1239 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:57
1240 #: build/C/man3/pthread_testcancel.3:58
1241 msgid "POSIX.1-2001."
1242 msgstr "POSIX.1-2001."
1243
1244 #. type: Plain text
1245 #: build/C/man3/pthread_attr_init.3:85
1246 msgid ""
1247 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1248 "object other than via pthreads functions is nonportable and produces "
1249 "undefined results."
1250 msgstr ""
1251 "I<pthread_attr_t> 型の内部構造は意識すべきではない。\n"
1252 "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n"
1253 "どのような結果が得られるかも分からない。"
1254
1255 #. type: Plain text
1256 #: build/C/man3/pthread_attr_init.3:94
1257 msgid ""
1258 "The program below optionally makes use of B<pthread_attr_init>()  and "
1259 "various related functions to initialize a thread attributes object that is "
1260 "used to create a single thread.  Once created, the thread uses the "
1261 "B<pthread_getattr_np>(3)  function (a nonstandard GNU extension) to retrieve "
1262 "the thread's attributes, and then displays those attributes."
1263 msgstr ""
1264 "下記のプログラムは、B<pthread_attr_init>() と種々の関連関数を使って、\n"
1265 "スレッド属性オブジェクトの初期化を行い、\n"
1266 "そのオブジェクトを使ってスレッドを一つ作成する。\n"
1267 "作成されたスレッドは、作成後に B<pthread_getattr_np>(3) 関数 \n"
1268 "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n"
1269 "取得した属性を表示する。"
1270
1271 #. type: Plain text
1272 #: build/C/man3/pthread_attr_init.3:103
1273 msgid ""
1274 "If the program is run with no command-line argument, then it passes NULL as "
1275 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1276 "with default attributes.  Running the program on Linux/x86-32 with the NPTL "
1277 "threading implementation, we see the following:"
1278 msgstr ""
1279 "コマンドライン引き数なしでプログラムを実行した場合、\n"
1280 "B<pthread_create>(3) の I<attr> 引き数には NULL が渡される。\n"
1281 "この場合、スレッドはデフォルトの属性で作成される。\n"
1282 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1283 "動作させると、以下のような出力が得られる。"
1284
1285 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1286 #. type: Plain text
1287 #: build/C/man3/pthread_attr_init.3:119
1288 #, no-wrap
1289 msgid ""
1290 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1291 "unlimited\n"
1292 "$B< ./a.out>\n"
1293 "Thread attributes:\n"
1294 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1295 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1296 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1297 "        Scheduling policy   = SCHED_OTHER\n"
1298 "        Scheduling priority = 0\n"
1299 "        Guard size          = 4096 bytes\n"
1300 "        Stack address       = 0x40196000\n"
1301 "        Stack size          = 0x201000 bytes\n"
1302 msgstr ""
1303 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1304 "unlimited\n"
1305 "$B< ./a.out>\n"
1306 "Thread attributes:\n"
1307 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1308 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1309 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1310 "        Scheduling policy   = SCHED_OTHER\n"
1311 "        Scheduling priority = 0\n"
1312 "        Guard size          = 4096 bytes\n"
1313 "        Stack address       = 0x40196000\n"
1314 "        Stack size          = 0x201000 bytes\n"
1315
1316 #. type: Plain text
1317 #: build/C/man3/pthread_attr_init.3:129
1318 msgid ""
1319 "When we supply a stack size as a command-line argument, the program "
1320 "initializes a thread attributes object, sets various attributes in that "
1321 "object, and passes a pointer to the object in the call to B<pthread_create>"
1322 "(3).  Running the program on Linux/x86-32 with the NPTL threading "
1323 "implementation, we see the following:"
1324 msgstr ""
1325 "コマンドライン引き数でスタックサイズが与えられた場合、\n"
1326 "このプログラムは、スレッド属性オブジェクトを初期化し、\n"
1327 "そのオブジェクトの各種属性を設定し、\n"
1328 "B<pthread_create>(3) の呼び出しでこのオブジェクトへのポインタを渡す。\n"
1329 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1330 "動作させると、以下のような出力が得られる。"
1331
1332 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1333 #. type: Plain text
1334 #: build/C/man3/pthread_attr_init.3:144
1335 #, no-wrap
1336 msgid ""
1337 "$B< ./a.out 0x3000000>\n"
1338 "posix_memalign() allocated at 0x40197000\n"
1339 "Thread attributes:\n"
1340 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1341 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1342 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1343 "        Scheduling policy   = SCHED_OTHER\n"
1344 "        Scheduling priority = 0\n"
1345 "        Guard size          = 0 bytes\n"
1346 "        Stack address       = 0x40197000\n"
1347 "        Stack size          = 0x3000000 bytes\n"
1348 msgstr ""
1349 "$B< ./a.out 0x3000000>\n"
1350 "posix_memalign() allocated at 0x40197000\n"
1351 "Thread attributes:\n"
1352 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1353 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1354 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1355 "        Scheduling policy   = SCHED_OTHER\n"
1356 "        Scheduling priority = 0\n"
1357 "        Guard size          = 0 bytes\n"
1358 "        Stack address       = 0x40197000\n"
1359 "        Stack size          = 0x3000000 bytes\n"
1360
1361 #. type: Plain text
1362 #: build/C/man3/pthread_attr_init.3:155 build/C/man3/pthread_getattr_np.3:186
1363 #, no-wrap
1364 msgid ""
1365 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1366 "#include E<lt>pthread.hE<gt>\n"
1367 "#include E<lt>stdio.hE<gt>\n"
1368 "#include E<lt>stdlib.hE<gt>\n"
1369 "#include E<lt>unistd.hE<gt>\n"
1370 "#include E<lt>errno.hE<gt>\n"
1371 msgstr ""
1372 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1373 "#include E<lt>pthread.hE<gt>\n"
1374 "#include E<lt>stdio.hE<gt>\n"
1375 "#include E<lt>stdlib.hE<gt>\n"
1376 "#include E<lt>unistd.hE<gt>\n"
1377 "#include E<lt>errno.hE<gt>\n"
1378
1379 #. type: Plain text
1380 #: build/C/man3/pthread_attr_init.3:158 build/C/man3/pthread_cancel.3:157
1381 #: build/C/man3/pthread_cleanup_push.3:237 build/C/man3/pthread_create.3:252
1382 #: build/C/man3/pthread_getattr_np.3:189
1383 #: build/C/man3/pthread_getcpuclockid.3:111
1384 #: build/C/man3/pthread_setaffinity_np.3:170
1385 #: build/C/man3/pthread_setschedparam.3:235 build/C/man3/pthread_sigmask.3:91
1386 #, no-wrap
1387 msgid ""
1388 "#define handle_error_en(en, msg) \\e\n"
1389 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1390 msgstr ""
1391 "#define handle_error_en(en, msg) \\e\n"
1392 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1393
1394 #. type: Plain text
1395 #: build/C/man3/pthread_attr_init.3:166
1396 #, no-wrap
1397 msgid ""
1398 "static void\n"
1399 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1400 "{\n"
1401 "    int s, i;\n"
1402 "    size_t v;\n"
1403 "    void *stkaddr;\n"
1404 "    struct sched_param sp;\n"
1405 msgstr ""
1406 "static void\n"
1407 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1408 "{\n"
1409 "    int s, i;\n"
1410 "    size_t v;\n"
1411 "    void *stkaddr;\n"
1412 "    struct sched_param sp;\n"
1413
1414 #. type: Plain text
1415 #: build/C/man3/pthread_attr_init.3:174
1416 #, no-wrap
1417 msgid ""
1418 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1419 "    if (s != 0)\n"
1420 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1421 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1422 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1423 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1424 "            \"???\");\n"
1425 msgstr ""
1426 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1427 "    if (s != 0)\n"
1428 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1429 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1430 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1431 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1432 "            \"???\");\n"
1433
1434 #. type: Plain text
1435 #: build/C/man3/pthread_attr_init.3:182
1436 #, no-wrap
1437 msgid ""
1438 "    s = pthread_attr_getscope(attr, &i);\n"
1439 "    if (s != 0)\n"
1440 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1441 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1442 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1443 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1444 "            \"???\");\n"
1445 msgstr ""
1446 "    s = pthread_attr_getscope(attr, &i);\n"
1447 "    if (s != 0)\n"
1448 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1449 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1450 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1451 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1452 "            \"???\");\n"
1453
1454 #. type: Plain text
1455 #: build/C/man3/pthread_attr_init.3:190
1456 #, no-wrap
1457 msgid ""
1458 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1459 "    if (s != 0)\n"
1460 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1461 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1462 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1463 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1464 "            \"???\");\n"
1465 msgstr ""
1466 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1467 "    if (s != 0)\n"
1468 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1469 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1470 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1471 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1472 "            \"???\");\n"
1473
1474 #. type: Plain text
1475 #: build/C/man3/pthread_attr_init.3:199
1476 #, no-wrap
1477 msgid ""
1478 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1479 "    if (s != 0)\n"
1480 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1481 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1482 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1483 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1484 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1485 "            \"???\");\n"
1486 msgstr ""
1487 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1488 "    if (s != 0)\n"
1489 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1490 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1491 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1492 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1493 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1494 "            \"???\");\n"
1495
1496 #. type: Plain text
1497 #: build/C/man3/pthread_attr_init.3:204
1498 #, no-wrap
1499 msgid ""
1500 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1501 "    if (s != 0)\n"
1502 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1503 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1504 msgstr ""
1505 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1506 "    if (s != 0)\n"
1507 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1508 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1509
1510 #. type: Plain text
1511 #: build/C/man3/pthread_attr_init.3:209
1512 #, no-wrap
1513 msgid ""
1514 "    s = pthread_attr_getguardsize(attr, &v);\n"
1515 "    if (s != 0)\n"
1516 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1517 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1518 msgstr ""
1519 "    s = pthread_attr_getguardsize(attr, &v);\n"
1520 "    if (s != 0)\n"
1521 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1522 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1523
1524 #. type: Plain text
1525 #: build/C/man3/pthread_attr_init.3:216
1526 #, no-wrap
1527 msgid ""
1528 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1529 "    if (s != 0)\n"
1530 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1531 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1532 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1533 "}\n"
1534 msgstr ""
1535 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1536 "    if (s != 0)\n"
1537 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1538 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1539 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1540 "}\n"
1541
1542 #. type: Plain text
1543 #: build/C/man3/pthread_attr_init.3:222
1544 #, no-wrap
1545 msgid ""
1546 "static void *\n"
1547 "thread_start(void *arg)\n"
1548 "{\n"
1549 "    int s;\n"
1550 "    pthread_attr_t gattr;\n"
1551 msgstr ""
1552 "static void *\n"
1553 "thread_start(void *arg)\n"
1554 "{\n"
1555 "    int s;\n"
1556 "    pthread_attr_t gattr;\n"
1557
1558 #. type: Plain text
1559 #: build/C/man3/pthread_attr_init.3:226
1560 #, no-wrap
1561 msgid ""
1562 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1563 "       retrieves the attributes of the thread specified in its\n"
1564 "       first argument */\n"
1565 msgstr ""
1566 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1567 "       retrieves the attributes of the thread specified in its\n"
1568 "       first argument */\n"
1569
1570 #. type: Plain text
1571 #: build/C/man3/pthread_attr_init.3:230
1572 #, no-wrap
1573 msgid ""
1574 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1575 "    if (s != 0)\n"
1576 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1577 msgstr ""
1578 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1579 "    if (s != 0)\n"
1580 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1581
1582 #. type: Plain text
1583 #: build/C/man3/pthread_attr_init.3:233
1584 #, no-wrap
1585 msgid ""
1586 "    printf(\"Thread attributes:\\en\");\n"
1587 "    display_pthread_attr(&gattr, \"\\et\");\n"
1588 msgstr ""
1589 "    printf(\"Thread attributes:\\en\");\n"
1590 "    display_pthread_attr(&gattr, \"\\et\");\n"
1591
1592 #. type: Plain text
1593 #: build/C/man3/pthread_attr_init.3:236 build/C/man3/pthread_getattr_np.3:238
1594 #, no-wrap
1595 msgid ""
1596 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1597 "}\n"
1598 msgstr ""
1599 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1600 "}\n"
1601
1602 #. type: Plain text
1603 #: build/C/man3/pthread_attr_init.3:244
1604 #, no-wrap
1605 msgid ""
1606 "int\n"
1607 "main(int argc, char *argv[])\n"
1608 "{\n"
1609 "    pthread_t thr;\n"
1610 "    pthread_attr_t attr;\n"
1611 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1612 "    int s;\n"
1613 msgstr ""
1614 "int\n"
1615 "main(int argc, char *argv[])\n"
1616 "{\n"
1617 "    pthread_t thr;\n"
1618 "    pthread_attr_t attr;\n"
1619 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1620 "    int s;\n"
1621
1622 #. type: Plain text
1623 #: build/C/man3/pthread_attr_init.3:246
1624 #: build/C/man3/pthread_setschedparam.3:353
1625 #, no-wrap
1626 msgid "    attrp = NULL;\n"
1627 msgstr "    attrp = NULL;\n"
1628
1629 #. type: Plain text
1630 #: build/C/man3/pthread_attr_init.3:250
1631 #, no-wrap
1632 msgid ""
1633 "    /* If a command-line argument was supplied, use it to set the\n"
1634 "       stack-size attribute and set a few other thread attributes,\n"
1635 "       and set attrp pointing to thread attributes object */\n"
1636 msgstr ""
1637 "    /* If a command-line argument was supplied, use it to set the\n"
1638 "       stack-size attribute and set a few other thread attributes,\n"
1639 "       and set attrp pointing to thread attributes object */\n"
1640
1641 #. type: Plain text
1642 #: build/C/man3/pthread_attr_init.3:254
1643 #, no-wrap
1644 msgid ""
1645 "    if (argc E<gt> 1) {\n"
1646 "        int stack_size;\n"
1647 "        void *sp;\n"
1648 msgstr ""
1649 "    if (argc E<gt> 1) {\n"
1650 "        int stack_size;\n"
1651 "        void *sp;\n"
1652
1653 #. type: Plain text
1654 #: build/C/man3/pthread_attr_init.3:256
1655 #, no-wrap
1656 msgid "        attrp = &attr;\n"
1657 msgstr "        attrp = &attr;\n"
1658
1659 #. type: Plain text
1660 #: build/C/man3/pthread_attr_init.3:260
1661 #, no-wrap
1662 msgid ""
1663 "        s = pthread_attr_init(&attr);\n"
1664 "        if (s != 0)\n"
1665 "            handle_error_en(s, \"pthread_attr_init\");\n"
1666 msgstr ""
1667 "        s = pthread_attr_init(&attr);\n"
1668 "        if (s != 0)\n"
1669 "            handle_error_en(s, \"pthread_attr_init\");\n"
1670
1671 #. type: Plain text
1672 #: build/C/man3/pthread_attr_init.3:264
1673 #, no-wrap
1674 msgid ""
1675 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1676 "        if (s != 0)\n"
1677 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1678 msgstr ""
1679 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1680 "        if (s != 0)\n"
1681 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1682
1683 #. type: Plain text
1684 #: build/C/man3/pthread_attr_init.3:268
1685 #, no-wrap
1686 msgid ""
1687 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1688 "        if (s != 0)\n"
1689 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1690 msgstr ""
1691 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1692 "        if (s != 0)\n"
1693 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1694
1695 #. type: Plain text
1696 #: build/C/man3/pthread_attr_init.3:270
1697 #, no-wrap
1698 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1699 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
1700
1701 #. type: Plain text
1702 #: build/C/man3/pthread_attr_init.3:274
1703 #, no-wrap
1704 msgid ""
1705 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1706 "        if (s != 0)\n"
1707 "            handle_error_en(s, \"posix_memalign\");\n"
1708 msgstr ""
1709 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1710 "        if (s != 0)\n"
1711 "            handle_error_en(s, \"posix_memalign\");\n"
1712
1713 #. type: Plain text
1714 #: build/C/man3/pthread_attr_init.3:276
1715 #, no-wrap
1716 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1717 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1718
1719 #. type: Plain text
1720 #: build/C/man3/pthread_attr_init.3:281
1721 #, no-wrap
1722 msgid ""
1723 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1724 "        if (s != 0)\n"
1725 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1726 "    }\n"
1727 msgstr ""
1728 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1729 "        if (s != 0)\n"
1730 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1731 "    }\n"
1732
1733 #. type: Plain text
1734 #: build/C/man3/pthread_attr_init.3:285 build/C/man3/pthread_getattr_np.3:333
1735 #, no-wrap
1736 msgid ""
1737 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1738 "    if (s != 0)\n"
1739 "        handle_error_en(s, \"pthread_create\");\n"
1740 msgstr ""
1741 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1742 "    if (s != 0)\n"
1743 "        handle_error_en(s, \"pthread_create\");\n"
1744
1745 #. type: Plain text
1746 #: build/C/man3/pthread_attr_init.3:291 build/C/man3/pthread_getattr_np.3:339
1747 #, no-wrap
1748 msgid ""
1749 "    if (attrp != NULL) {\n"
1750 "        s = pthread_attr_destroy(attrp);\n"
1751 "        if (s != 0)\n"
1752 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1753 "    }\n"
1754 msgstr ""
1755 "    if (attrp != NULL) {\n"
1756 "        s = pthread_attr_destroy(attrp);\n"
1757 "        if (s != 0)\n"
1758 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1759 "    }\n"
1760
1761 #. type: Plain text
1762 #: build/C/man3/pthread_attr_init.3:294 build/C/man3/pthread_getattr_np.3:342
1763 #, no-wrap
1764 msgid ""
1765 "    pause();    /* Terminates when other thread calls exit() */\n"
1766 "}\n"
1767 msgstr ""
1768 "    pause();    /* Terminates when other thread calls exit() */\n"
1769 "}\n"
1770
1771 #. type: Plain text
1772 #: build/C/man3/pthread_attr_init.3:309
1773 msgid ""
1774 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1775 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1776 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1777 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1778 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1779 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1780 msgstr ""
1781 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1782 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1783 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1784 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1785 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1786 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1787
1788 #. type: TH
1789 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1790 #, no-wrap
1791 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1792 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1793
1794 #. type: TH
1795 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1796 #: build/C/man3/pthread_getattr_np.3:24
1797 #: build/C/man3/pthread_setaffinity_np.3:24
1798 #: build/C/man3/pthread_tryjoin_np.3:24
1799 #, no-wrap
1800 msgid "2010-09-10"
1801 msgstr "2010-09-10"
1802
1803 #. type: Plain text
1804 #: build/C/man3/pthread_attr_setaffinity_np.3:28
1805 msgid ""
1806 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1807 "affinity attribute in thread attributes object"
1808 msgstr ""
1809 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
1810 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
1811
1812 #. type: Plain text
1813 #: build/C/man3/pthread_attr_setaffinity_np.3:32
1814 #: build/C/man3/pthread_getattr_np.3:31
1815 #: build/C/man3/pthread_setaffinity_np.3:32
1816 #: build/C/man3/pthread_tryjoin_np.3:32
1817 #, no-wrap
1818 msgid ""
1819 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1820 "B<#include E<lt>pthread.hE<gt>>\n"
1821 msgstr ""
1822 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1823 "B<#include E<lt>pthread.hE<gt>>\n"
1824
1825 #. type: Plain text
1826 #: build/C/man3/pthread_attr_setaffinity_np.3:37
1827 #, no-wrap
1828 msgid ""
1829 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1830 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1831 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1832 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1833 msgstr ""
1834 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1835 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1836 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1837 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1838
1839 #. type: Plain text
1840 #: build/C/man3/pthread_attr_setaffinity_np.3:52
1841 msgid ""
1842 "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask "
1843 "attribute of the thread attributes object referred to by I<attr> to the "
1844 "value specified in I<cpuset>.  This attribute determines the CPU affinity "
1845 "mask of a thread created using the thread attributes object I<attr>."
1846 msgstr ""
1847 "B<pthread_attr_setaffinity_np>() 関数は、\n"
1848 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
1849 "I<cpuset> で指定された値に設定する。\n"
1850 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
1851 "作成されたスレッドの CPU affinity マスクが決定される。"
1852
1853 #. type: Plain text
1854 #: build/C/man3/pthread_attr_setaffinity_np.3:61
1855 msgid ""
1856 "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask "
1857 "attribute of the thread attributes object referred to by I<attr> in the "
1858 "buffer pointed to by I<cpuset>."
1859 msgstr ""
1860 "B<pthread_attr_getaffinity_np>() 関数は、 I<attr> が参照する\n"
1861 "スレッド属性オブジェクトの CPU affinity マスク属性を\n"
1862 "I<cpuset> が指すバッファに入れて返す。"
1863
1864 #. type: Plain text
1865 #: build/C/man3/pthread_attr_setaffinity_np.3:68
1866 msgid ""
1867 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1868 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
1869 "(cpu_set_t)>."
1870 msgstr ""
1871 "I<cpusetsize> 引き数は I<cpuset> が指すバッファの (バイト単位の)\n"
1872 "大きさである。通常は、この引き数には I<sizeof(cpu_set_t)> を\n"
1873 "指定することだろう。"
1874
1875 #. type: Plain text
1876 #: build/C/man3/pthread_attr_setaffinity_np.3:74
1877 #: build/C/man3/pthread_setaffinity_np.3:65
1878 msgid ""
1879 "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a "
1880 "description of a set of macros that can be used to manipulate and inspect "
1881 "CPU sets, see B<CPU_SET>(3)."
1882 msgstr ""
1883 "CPU affinity マスクの詳細については、 \n"
1884 "B<sched_setaffinity>(2) を参照してほしい。\n"
1885 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
1886 "B<CPU_SET>(3) を参照してほしい。"
1887
1888 #. type: TP
1889 #: build/C/man3/pthread_attr_setaffinity_np.3:78
1890 #: build/C/man3/pthread_attr_setaffinity_np.3:90
1891 #: build/C/man3/pthread_attr_setdetachstate.3:81
1892 #: build/C/man3/pthread_attr_setinheritsched.3:88
1893 #: build/C/man3/pthread_attr_setschedpolicy.3:76
1894 #: build/C/man3/pthread_attr_setscope.3:95
1895 #: build/C/man3/pthread_attr_setstack.3:89
1896 #: build/C/man3/pthread_attr_setstacksize.3:65
1897 #: build/C/man3/pthread_create.3:135 build/C/man3/pthread_detach.3:53
1898 #: build/C/man3/pthread_join.3:83 build/C/man3/pthread_join.3:87
1899 #: build/C/man3/pthread_kill.3:56 build/C/man3/pthread_setaffinity_np.3:82
1900 #: build/C/man3/pthread_setaffinity_np.3:91
1901 #: build/C/man3/pthread_setaffinity_np.3:107
1902 #: build/C/man3/pthread_setcancelstate.3:97
1903 #: build/C/man3/pthread_setcancelstate.3:105
1904 #: build/C/man3/pthread_setconcurrency.3:69
1905 #: build/C/man3/pthread_setschedparam.3:120
1906 #: build/C/man3/pthread_setschedprio.3:60 build/C/man3/pthread_sigqueue.3:75
1907 #, no-wrap
1908 msgid "B<EINVAL>"
1909 msgstr "B<EINVAL>"
1910
1911 #.  cpumask_t
1912 #.  The raw sched_getaffinity() system call returns the size (in bytes)
1913 #.  of the cpumask_t type.
1914 #. type: Plain text
1915 #: build/C/man3/pthread_attr_setaffinity_np.3:90
1916 msgid ""
1917 "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was "
1918 "outside the set supported by the kernel.  (The kernel configuration option "
1919 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
1920 "type used to represent CPU sets.)"
1921 msgstr ""
1922 "(B<pthread_attr_setaffinity_np>())\n"
1923 "I<cpuset> がカーネルがサポートする CPU 集合にない CPU を指定していた。\n"
1924 "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲は、\n"
1925 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
1926
1927 #. type: Plain text
1928 #: build/C/man3/pthread_attr_setaffinity_np.3:100
1929 msgid ""
1930 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
1931 "attributes object referred to by I<attr> lies outside the range specified by "
1932 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
1933 msgstr ""
1934 "(B<pthread_attr_getaffinity_np>())\n"
1935 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
1936 "I<cpusetsize> により指定された範囲の中になかった\n"
1937 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
1938
1939 #. type: Plain text
1940 #: build/C/man3/pthread_attr_setaffinity_np.3:104
1941 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
1942 msgstr "(B<pthread_attr_setaffinity_np>()) メモリを割り当てることができなかった。"
1943
1944 #. type: Plain text
1945 #: build/C/man3/pthread_attr_setaffinity_np.3:106
1946 #: build/C/man3/pthread_setaffinity_np.3:119
1947 msgid "These functions are provided by glibc since version 2.3.4."
1948 msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。"
1949
1950 #. type: Plain text
1951 #: build/C/man3/pthread_attr_setaffinity_np.3:109
1952 #: build/C/man3/pthread_cleanup_push_defer_np.3:102
1953 #: build/C/man3/pthread_setaffinity_np.3:122
1954 #: build/C/man3/pthread_tryjoin_np.3:113
1955 msgid ""
1956 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
1957 "\" (nonportable) in the names."
1958 msgstr ""
1959 "これらの関数は非標準の GNU による拡張である。\n"
1960 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
1961 "付いている。"
1962
1963 #. type: Plain text
1964 #: build/C/man3/pthread_attr_setaffinity_np.3:116
1965 #: build/C/man3/pthread_setaffinity_np.3:148
1966 msgid ""
1967 "In glibc 2.3.3 only, versions of these functions were provided that did not "
1968 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
1969 "underlying system calls was always I<sizeof(cpu_set_t)>."
1970 msgstr ""
1971 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
1972 "これらの関数は I<cpusetsize> 引き数を持っていなかった。\n"
1973 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
1974 "常に I<sizeof(cpu_set_t)> であった。"
1975
1976 #. type: Plain text
1977 #: build/C/man3/pthread_attr_setaffinity_np.3:122
1978 msgid ""
1979 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1980 "(3), B<cpuset>(7), B<pthreads>(7)"
1981 msgstr ""
1982 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1983 "(3), B<cpuset>(7), B<pthreads>(7)"
1984
1985 #. type: TH
1986 #: build/C/man3/pthread_attr_setdetachstate.3:24
1987 #, no-wrap
1988 msgid "PTHREAD_ATTR_SETDETACHSTATE"
1989 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
1990
1991 #. type: TH
1992 #: build/C/man3/pthread_attr_setdetachstate.3:24
1993 #: build/C/man3/pthread_attr_setschedpolicy.3:24
1994 #, no-wrap
1995 msgid "2010-02-03"
1996 msgstr "2010-02-03"
1997
1998 #. type: Plain text
1999 #: build/C/man3/pthread_attr_setdetachstate.3:28
2000 msgid ""
2001 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
2002 "state attribute in thread attributes object"
2003 msgstr ""
2004 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
2005 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
2006
2007 #. type: Plain text
2008 #: build/C/man3/pthread_attr_setdetachstate.3:36
2009 #, no-wrap
2010 msgid ""
2011 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2012 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2013 msgstr ""
2014 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2015 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2016
2017 #. type: Plain text
2018 #: build/C/man3/pthread_attr_setdetachstate.3:51
2019 msgid ""
2020 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
2021 "attribute of the thread attributes object referred to by I<attr> to the "
2022 "value specified in I<detachstate>.  The detach state attribute determines "
2023 "whether a thread created using the thread attributes object I<attr> will be "
2024 "created in a joinable or a detached state."
2025 msgstr ""
2026 "B<pthread_attr_setdetachstate>() 関数は、\n"
2027 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
2028 "I<detachstate> で指定された値に設定する。\n"
2029 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2030 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
2031 "detached (切り離された) 状態で作成されるかが決定される。"
2032
2033 #. type: Plain text
2034 #: build/C/man3/pthread_attr_setdetachstate.3:54
2035 msgid "The following values may be specified in I<detachstate>:"
2036 msgstr "I<detachstate> には以下の値を指定できる。"
2037
2038 #. type: TP
2039 #: build/C/man3/pthread_attr_setdetachstate.3:54
2040 #, no-wrap
2041 msgid "B<PTHREAD_CREATE_DETACHED>"
2042 msgstr "B<PTHREAD_CREATE_DETACHED>"
2043
2044 #. type: Plain text
2045 #: build/C/man3/pthread_attr_setdetachstate.3:59
2046 msgid ""
2047 "Threads that are created using I<attr> will be created in a detached state."
2048 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
2049
2050 #. type: TP
2051 #: build/C/man3/pthread_attr_setdetachstate.3:59
2052 #, no-wrap
2053 msgid "B<PTHREAD_CREATE_JOINABLE>"
2054 msgstr "B<PTHREAD_CREATE_JOINABLE>"
2055
2056 #. type: Plain text
2057 #: build/C/man3/pthread_attr_setdetachstate.3:64
2058 msgid ""
2059 "Threads that are created using I<attr> will be created in a joinable state."
2060 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
2061
2062 #. type: Plain text
2063 #: build/C/man3/pthread_attr_setdetachstate.3:68
2064 msgid ""
2065 "The default setting of the detach state attribute in a newly initialized "
2066 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
2067 msgstr ""
2068 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
2069 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
2070
2071 #. type: Plain text
2072 #: build/C/man3/pthread_attr_setdetachstate.3:75
2073 msgid ""
2074 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
2075 "the thread attributes object I<attr> in the buffer pointed to by "
2076 "I<detachstate>."
2077 msgstr ""
2078 "B<pthread_attr_getdetachstate>() は、\n"
2079 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
2080 "I<detachstate> が指すバッファに入れて返す。"
2081
2082 #. type: Plain text
2083 #: build/C/man3/pthread_attr_setdetachstate.3:81
2084 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
2085 msgstr "B<pthread_attr_setdetachstate>() は以下のエラーで失敗する場合がある。"
2086
2087 #. type: Plain text
2088 #: build/C/man3/pthread_attr_setdetachstate.3:85
2089 msgid "An invalid value was specified in I<detachstate>."
2090 msgstr "無効な値が I<detachstate> で指定された。"
2091
2092 #. type: Plain text
2093 #: build/C/man3/pthread_attr_setdetachstate.3:91
2094 msgid ""
2095 "See B<pthread_create>(3)  for more details on detached and joinable threads."
2096 msgstr ""
2097 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
2098 "B<pthread_create>(3) を参照。"
2099
2100 #. type: Plain text
2101 #: build/C/man3/pthread_attr_setdetachstate.3:99
2102 msgid ""
2103 "A thread that is created in a joinable state should eventually either be "
2104 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
2105 "B<pthread_create>(3)."
2106 msgstr ""
2107 "join 可能状態で作成されたスレッドは、最終的に\n"
2108 "B<pthread_join>(3) を使って join するか、\n"
2109 "B<pthread_detach>(3) を使って切り離すか、\n"
2110 "のどちらかを行うべきである。"
2111
2112 #. type: Plain text
2113 #: build/C/man3/pthread_attr_setdetachstate.3:106
2114 msgid ""
2115 "It is an error to specify the thread ID of a thread that was created in a "
2116 "detached state in a later call to B<pthread_detach>(3)  or B<pthread_join>"
2117 "(3)."
2118 msgstr ""
2119 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
2120 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
2121 "エラーである。"
2122
2123 #. type: Plain text
2124 #: build/C/man3/pthread_attr_setdetachstate.3:109
2125 #: build/C/man3/pthread_attr_setstack.3:154
2126 msgid "See B<pthread_attr_init>(3)."
2127 msgstr "B<pthread_attr_init>(3) を参照。"
2128
2129 #. type: Plain text
2130 #: build/C/man3/pthread_attr_setdetachstate.3:115
2131 msgid ""
2132 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2133 "B<pthread_join>(3), B<pthreads>(7)"
2134 msgstr ""
2135 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2136 "B<pthread_join>(3), B<pthreads>(7)"
2137
2138 #. type: TH
2139 #: build/C/man3/pthread_attr_setguardsize.3:24
2140 #, no-wrap
2141 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2142 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2143
2144 #. type: TH
2145 #: build/C/man3/pthread_attr_setguardsize.3:24
2146 #: build/C/man3/pthread_attr_setscope.3:24
2147 #: build/C/man3/pthread_attr_setstack.3:24
2148 #: build/C/man3/pthread_attr_setstackaddr.3:24 build/C/man3/pthread_self.3:24
2149 #, no-wrap
2150 msgid "2008-10-24"
2151 msgstr "2008-10-24"
2152
2153 #. type: Plain text
2154 #: build/C/man3/pthread_attr_setguardsize.3:28
2155 msgid ""
2156 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2157 "attribute in thread attributes object"
2158 msgstr ""
2159 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
2160 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
2161
2162 #. type: Plain text
2163 #: build/C/man3/pthread_attr_setguardsize.3:36
2164 #, no-wrap
2165 msgid ""
2166 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2167 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2168 msgstr ""
2169 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2170 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2171
2172 #. type: Plain text
2173 #: build/C/man3/pthread_attr_setguardsize.3:47
2174 msgid ""
2175 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
2176 "of the thread attributes object referred to by I<attr> to the value "
2177 "specified in I<guardsize>."
2178 msgstr ""
2179 "B<pthread_attr_setguardsize>() 関数は、\n"
2180 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
2181 "I<guardsize> で指定された値に設定する。"
2182
2183 #. type: Plain text
2184 #: build/C/man3/pthread_attr_setguardsize.3:57
2185 msgid ""
2186 "If I<guardsize> is greater than 0, then for each new thread created using "
2187 "I<attr> the system allocates an additional region of at least I<guardsize> "
2188 "bytes at the end of the thread's stack to act as the guard area for the "
2189 "stack (but see BUGS)."
2190 msgstr ""
2191 "I<guardsize> が 0 より大きい場合、\n"
2192 "I<attr> を使って新しく作成された各スレッドに対して、\n"
2193 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
2194 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
2195 "機能する (ただし「バグ」の節も参照)。"
2196
2197 #. type: Plain text
2198 #: build/C/man3/pthread_attr_setguardsize.3:63
2199 msgid ""
2200 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2201 "guard area."
2202 msgstr ""
2203 "I<guardsize> が 0 の場合、\n"
2204 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
2205
2206 #. type: Plain text
2207 #: build/C/man3/pthread_attr_setguardsize.3:65
2208 msgid "The default guard size is the same as the system page size."
2209 msgstr "デフォルトの guard size はシステムのページサイズと同じである。"
2210
2211 #. type: Plain text
2212 #: build/C/man3/pthread_attr_setguardsize.3:80
2213 msgid ""
2214 "If the stack address attribute has been set in I<attr> (using "
2215 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
2216 "that the caller is allocating the thread's stack, then the guard size "
2217 "attribute is ignored (i.e., no guard area is created by the system): it is "
2218 "the application's responsibility to handle stack overflow (perhaps by using "
2219 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
2220 "it has allocated)."
2221 msgstr ""
2222 "(B<pthread_attr_setstack>(3) や B<pthread_attr_setstackaddr>(3)を使って)\n"
2223 "I<attr> でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n"
2224 "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n"
2225 "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n"
2226 "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n"
2227 "ケーション側の責任となる (おそらく B<mprotect>(2) を使って、割り当て\n"
2228 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
2229
2230 #. type: Plain text
2231 #: build/C/man3/pthread_attr_setguardsize.3:88
2232 msgid ""
2233 "The B<pthread_attr_getguardsize>()  function returns the guard size "
2234 "attribute of the thread attributes object referred to by I<attr> in the "
2235 "buffer pointed to by I<guardsize>."
2236 msgstr ""
2237 "B<pthread_attr_getguardsize>() は、\n"
2238 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
2239 "I<guardsize> が指すバッファに入れて返す。"
2240
2241 #. type: Plain text
2242 #: build/C/man3/pthread_attr_setguardsize.3:102
2243 msgid ""
2244 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2245 "invalid.  On Linux these functions always succeed (but portable and future-"
2246 "proof applications should nevertheless handle a possible error return)."
2247 msgstr ""
2248 "POSIX.1-2001 では、エラー B<EINVAL> が\n"
2249 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2250 "Linux では、これらの関数は常に作成する\n"
2251 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2252 "正のエラーの返り値を処理するようにすべきである)。"
2253
2254 #. type: Plain text
2255 #: build/C/man3/pthread_attr_setguardsize.3:104
2256 #: build/C/man3/pthread_attr_setstackaddr.3:81
2257 #: build/C/man3/pthread_attr_setstacksize.3:81
2258 msgid "These functions are provided by glibc since version 2.1."
2259 msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。"
2260
2261 #. type: Plain text
2262 #: build/C/man3/pthread_attr_setguardsize.3:120
2263 msgid ""
2264 "A guard area consists of virtual memory pages that are protected to prevent "
2265 "read and write access.  If a thread overflows its stack into the guard area, "
2266 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2267 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
2268 "guard size is internally rounded up to the system page size when creating a "
2269 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
2270 "size that was set by B<pthread_attr_setguardsize>().)"
2271 msgstr ""
2272 "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n"
2273 "られた仮想メモリページで構成で構成される。スレッドがスタックをガード\n"
2274 "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャ\n"
2275 "では、スレッドに B<SIGSEGV> シグナルが送られ、オーバーフローが発生した\n"
2276 "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n"
2277 "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n"
2278 "(その場合も B<pthread_attr_getguardsize>() では\n"
2279 "B<pthread_attr_setguardsize>() で設定された guard size が返される)。"
2280
2281 #. type: Plain text
2282 #: build/C/man3/pthread_attr_setguardsize.3:124
2283 msgid ""
2284 "Setting a guard size of 0 may be useful to save memory in an application "
2285 "that creates many threads and knows that stack overflow can never occur."
2286 msgstr ""
2287 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2288 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2289 "することで、メモリを節約できることもある。"
2290
2291 #. type: Plain text
2292 #: build/C/man3/pthread_attr_setguardsize.3:128
2293 msgid ""
2294 "Choosing a guard size larger than the default size may be necessary for "
2295 "detecting stack overflows if a thread allocates large data structures on the "
2296 "stack."
2297 msgstr ""
2298 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2299 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2300 "大きな guard size を選ぶ必要があるかもしれない。"
2301
2302 #. type: SH
2303 #: build/C/man3/pthread_attr_setguardsize.3:128
2304 #: build/C/man3/pthread_attr_setinheritsched.3:101
2305 #: build/C/man3/pthread_attr_setstacksize.3:94
2306 #: build/C/man3/pthread_create.3:194 build/C/man3/pthread_exit.3:91
2307 #, no-wrap
2308 msgid "BUGS"
2309 msgstr "バグ"
2310
2311 #. type: Plain text
2312 #: build/C/man3/pthread_attr_setguardsize.3:139
2313 msgid ""
2314 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2315 "within the stack size allocation, rather than allocating extra space at the "
2316 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2317 "error from B<pthread_create>(3)  if the guard size value is too large, "
2318 "leaving no space for the actual stack.)"
2319 msgstr ""
2320 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2321 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2322 "末尾に追加の領域を割り当てることが求められている。\n"
2323 "(このため、ガード領域が大きすぎて、\n"
2324 "実際のスタック用の場所がなくなってしまう場合、\n"
2325 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2326
2327 #.  glibc includes the guardsize within the allocated stack size,
2328 #.  which looks pretty clearly to be in violation of POSIX.
2329 #.  Filed bug, 22 Oct 2008:
2330 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2331 #.  Older reports:
2332 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2333 #.  Reportedly, LinuxThreads did the right thing, allocating
2334 #.  extra space at the end of the stack:
2335 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2336 #. type: Plain text
2337 #: build/C/man3/pthread_attr_setguardsize.3:153
2338 msgid ""
2339 "The obsolete LinuxThreads implementation did the right thing, allocating "
2340 "extra space at the end of the stack for the guard area."
2341 msgstr ""
2342 "廃止予定の LinuxThreads 実装では、\n"
2343 "POSIX.1 で求められている通りの動作で、\n"
2344 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2345
2346 #. type: Plain text
2347 #: build/C/man3/pthread_attr_setguardsize.3:156
2348 msgid "See B<pthread_getattr_np>(3)."
2349 msgstr "B<pthread_getattr_np>(3) を参照。"
2350
2351 #. type: Plain text
2352 #: build/C/man3/pthread_attr_setguardsize.3:164
2353 msgid ""
2354 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2355 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2356 msgstr ""
2357 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2358 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2359
2360 #. type: TH
2361 #: build/C/man3/pthread_attr_setinheritsched.3:24
2362 #, no-wrap
2363 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2364 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2365
2366 #. type: TH
2367 #: build/C/man3/pthread_attr_setinheritsched.3:24
2368 #: build/C/man3/pthread_attr_setschedparam.3:24
2369 #: build/C/man3/pthread_attr_setstacksize.3:24
2370 #: build/C/man3/pthread_create.3:24
2371 #, no-wrap
2372 msgid "2012-03-15"
2373 msgstr "2012-03-15"
2374
2375 #. type: Plain text
2376 #: build/C/man3/pthread_attr_setinheritsched.3:28
2377 msgid ""
2378 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit "
2379 "scheduler attribute in thread attributes object"
2380 msgstr ""
2381 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - \n"
2382 "スレッド属性オブジェクトの inherit scheduler 属性の設定/取得を行う"
2383
2384 #. type: Plain text
2385 #: build/C/man3/pthread_attr_setinheritsched.3:36
2386 #, no-wrap
2387 msgid ""
2388 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2389 "B<                                 int >I<inheritsched>B<);>\n"
2390 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2391 "B<                                 int *>I<inheritsched>B<);>\n"
2392 msgstr ""
2393 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2394 "B<                                 int >I<inheritsched>B<);>\n"
2395 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2396 "B<                                 int *>I<inheritsched>B<);>\n"
2397
2398 #. type: Plain text
2399 #: build/C/man3/pthread_attr_setinheritsched.3:53
2400 msgid ""
2401 "The B<pthread_attr_setinheritsched>()  function sets the inherit scheduler "
2402 "attribute of the thread attributes object referred to by I<attr> to the "
2403 "value specified in I<inheritsched>.  The inherit scheduler attribute "
2404 "determines whether a thread created using the thread attributes object "
2405 "I<attr> will inherit its scheduling attributes from the calling thread or "
2406 "whether it will take them from I<attr>."
2407 msgstr ""
2408 "B<pthread_attr_setinheritsched>() 関数は、\n"
2409 "I<attr> が参照するスレッド属性オブジェクトの inherit scheduler 属性を\n"
2410 "I<inheritsched> で指定された値に設定する。\n"
2411 "inherit scheduler 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2412 "作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承\n"
2413 "するか、I<attr> からスケジューリング属性を取得するかが決定される。"
2414
2415 #. type: Plain text
2416 #: build/C/man3/pthread_attr_setinheritsched.3:56
2417 msgid "The following values may be specified in I<inheritsched>:"
2418 msgstr "以下の値を I<inheritsched> に指定できる。"
2419
2420 #. type: TP
2421 #: build/C/man3/pthread_attr_setinheritsched.3:56
2422 #, no-wrap
2423 msgid "B<PTHREAD_INHERIT_SCHED>"
2424 msgstr "B<PTHREAD_INHERIT_SCHED>"
2425
2426 #. type: Plain text
2427 #: build/C/man3/pthread_attr_setinheritsched.3:64
2428 msgid ""
2429 "Threads that are created using I<attr> inherit scheduling attributes from "
2430 "the creating thread; the scheduling attributes in I<attr> are ignored."
2431 msgstr ""
2432 "I<attr> を使って作成されたスレッドは、\n"
2433 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2434 "I<attr> 内のスケジューリング属性は無視される。"
2435
2436 #. type: TP
2437 #: build/C/man3/pthread_attr_setinheritsched.3:64
2438 #, no-wrap
2439 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2440 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2441
2442 #.  FIXME what are the defaults for scheduler settings?
2443 #. type: Plain text
2444 #: build/C/man3/pthread_attr_setinheritsched.3:71
2445 msgid ""
2446 "Threads that are created using I<attr> take their scheduling attributes from "
2447 "the values specified by the attributes object."
2448 msgstr ""
2449 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2450 "指定された値からスケジューリング属性を取得する。"
2451
2452 #. type: Plain text
2453 #: build/C/man3/pthread_attr_setinheritsched.3:75
2454 msgid ""
2455 "The default setting of the inherit scheduler attribute in a newly "
2456 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2457 msgstr ""
2458 "新たに初期化されたスレッド属性オブジェクトの inherit scheduler 属性の\n"
2459 "デフォルト設定は B<PTHREAD_INHERIT_SCHED> である。"
2460
2461 #. type: Plain text
2462 #: build/C/man3/pthread_attr_setinheritsched.3:82
2463 msgid ""
2464 "The B<pthread_attr_getinheritsched>()  returns the inherit scheduler "
2465 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2466 "by I<inheritsched>."
2467 msgstr ""
2468 "B<pthread_attr_getinheritsched>() は、\n"
2469 "スレッド属性オブジェクト I<attr> の inherit scheduler 属性を\n"
2470 "I<inheritsched> が指すバッファに入れて返す。"
2471
2472 #. type: Plain text
2473 #: build/C/man3/pthread_attr_setinheritsched.3:88
2474 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2475 msgstr "B<pthread_attr_setinheritsched>() は以下のエラーで失敗する場合がある。"
2476
2477 #. type: Plain text
2478 #: build/C/man3/pthread_attr_setinheritsched.3:92
2479 msgid "Invalid value in I<inheritsched>."
2480 msgstr "I<inheritsched> に無効な値が指定された。"
2481
2482 #.  .SH VERSIONS
2483 #.  Available since glibc 2.0.
2484 #. type: Plain text
2485 #: build/C/man3/pthread_attr_setinheritsched.3:99
2486 msgid ""
2487 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2488 "to set the attribute to an unsupported value\") for "
2489 "B<pthread_attr_setinheritsched>()."
2490 msgstr ""
2491 "POSIX.1-2001 では、 B<pthread_attr_setinheritsched>() に関して\n"
2492 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2493 "も追加で規定されている。"
2494
2495 #.  FIXME . Track status of the following bug:
2496 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2497 #. type: Plain text
2498 #: build/C/man3/pthread_attr_setinheritsched.3:117
2499 msgid ""
2500 "As at glibc 2.8, if a thread attributes object is initialized using "
2501 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2502 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2503 "if the inherit scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2504 "then a thread created using the attribute object wrongly inherits its "
2505 "scheduling attributes from the creating thread.  This bug does not occur if "
2506 "either the scheduling policy or scheduling priority attribute is explicitly "
2507 "set in the thread attributes object before calling B<pthread_create>(3)."
2508 msgstr ""
2509 "glibc 2.8 の時点では、スレッド属性オブジェクトが\n"
2510 "B<pthread_attr_init>(3) を使って初期化された場合、\n"
2511 "スレッド属性オブジェクトのスケジューリングポリシーが B<SCHED_OTHER> に、\n"
2512 "スケジューリング優先度が 0 に設定される。一方、その後 inherit\n"
2513 "scheduling 属性に B<PTHREAD_EXPLICIT_SCHED> が設定されると、このスレッ\n"
2514 "ド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するス\n"
2515 "レッドのスケジューリング属性が間違って継承されてしまう。\n"
2516 "B<pthread_create>(3) を呼び出す前にスケジューリングポリシー属性か\n"
2517 "スケジューリング優先度属性のどちらかが明示的に設定された場合には、\n"
2518 "このバグは発生しない。"
2519
2520 #. type: Plain text
2521 #: build/C/man3/pthread_attr_setinheritsched.3:120
2522 #: build/C/man3/pthread_attr_setschedparam.3:96
2523 #: build/C/man3/pthread_attr_setschedpolicy.3:92
2524 msgid "See B<pthread_setschedparam>(3)."
2525 msgstr "B<pthread_setschedparam>(3) を参照。"
2526
2527 #. type: Plain text
2528 #: build/C/man3/pthread_attr_setinheritsched.3:129
2529 msgid ""
2530 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2531 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2532 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2533 "(3), B<pthreads>(7)"
2534 msgstr ""
2535 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2536 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2537 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2538 "(3), B<pthreads>(7)"
2539
2540 #. type: TH
2541 #: build/C/man3/pthread_attr_setschedparam.3:24
2542 #, no-wrap
2543 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2544 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2545
2546 #. type: Plain text
2547 #: build/C/man3/pthread_attr_setschedparam.3:28
2548 msgid ""
2549 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2550 "parameter attributes in thread attributes object"
2551 msgstr ""
2552 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
2553 "スレッド属性オブジェクトのスケジューリングパラメータ属性の設定/取得を行う"
2554
2555 #. type: Plain text
2556 #: build/C/man3/pthread_attr_setschedparam.3:36
2557 #, no-wrap
2558 msgid ""
2559 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2560 "B<                               const struct sched_param *>I<param>B<);>\n"
2561 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2562 "B<                               struct sched_param *>I<param>B<);>\n"
2563 msgstr ""
2564 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2565 "B<                               const struct sched_param *>I<param>B<);>\n"
2566 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2567 "B<                               struct sched_param *>I<param>B<);>\n"
2568
2569 #. type: Plain text
2570 #: build/C/man3/pthread_attr_setschedparam.3:50
2571 msgid ""
2572 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2573 "attributes of the thread attributes object referred to by I<attr> to the "
2574 "values specified in the buffer pointed to by I<param>.  These attributes "
2575 "determine the scheduling parameters of a thread created using the thread "
2576 "attributes object I<attr>."
2577 msgstr ""
2578 "B<pthread_attr_setschedparam>() 関数は、\n"
2579 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2580 "パラメータ属性を I<param> が指すバッファで指定された値に設定する。\n"
2581 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2582 "作成されるスレッドのスケジューリングパラメータが決定される。"
2583
2584 #. type: Plain text
2585 #: build/C/man3/pthread_attr_setschedparam.3:57
2586 msgid ""
2587 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2588 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2589 "by I<param>."
2590 msgstr ""
2591 "B<pthread_attr_getschedparam>() は、\n"
2592 "スレッド属性オブジェクト I<attr> のスケジューリングパラメータ属性を\n"
2593 "I<param> が指すバッファに入れて返す。"
2594
2595 #. type: Plain text
2596 #: build/C/man3/pthread_attr_setschedparam.3:59
2597 msgid "Scheduling parameters are maintained in the following structure:"
2598 msgstr "スケジューリングパラメータは以下の構造体で管理される。"
2599
2600 #. type: Plain text
2601 #: build/C/man3/pthread_attr_setschedparam.3:65
2602 #: build/C/man3/pthread_setschedparam.3:67
2603 #, no-wrap
2604 msgid ""
2605 "struct sched_param {\n"
2606 "    int sched_priority;     /* Scheduling priority */\n"
2607 "};\n"
2608 msgstr ""
2609 "struct sched_param {\n"
2610 "    int sched_priority;     /* Scheduling priority */\n"
2611 "};\n"
2612
2613 #. type: Plain text
2614 #: build/C/man3/pthread_attr_setschedparam.3:72
2615 #: build/C/man3/pthread_setschedparam.3:74
2616 msgid ""
2617 "As can be seen, only one scheduling parameter is supported.  For details of "
2618 "the permitted ranges for scheduling priorities in each scheduling policy, "
2619 "see B<sched_setscheduler>(2)."
2620 msgstr ""
2621 "見て分かる通り、サポートされているスケジューリングパラメータは一つだけ\n"
2622 "である。各スケジューリングポリシーで許可されるスケジューリング優先度の\n"
2623 "詳細については、B<sched_setscheduler>(2) を参照のこと。"
2624
2625 #.  .SH VERSIONS
2626 #.  Available since glibc 2.0.
2627 #. type: Plain text
2628 #: build/C/man3/pthread_attr_setschedparam.3:87
2629 msgid ""
2630 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2631 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2632 "(but portable and future-proof applications should nevertheless handle a "
2633 "possible error return)."
2634 msgstr ""
2635 "POSIX.1 では、\n"
2636 "B<pthread_attr_setschedparam>() について\n"
2637 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
2638 "Linux では、これらの関数は常に作成する\n"
2639 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2640 "正のエラーの返り値を処理するようにすべきである)。"
2641
2642 #. type: Plain text
2643 #: build/C/man3/pthread_attr_setschedparam.3:93
2644 msgid ""
2645 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2646 "policies supported on Linux."
2647 msgstr ""
2648 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
2649 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
2650
2651 #. type: Plain text
2652 #: build/C/man3/pthread_attr_setschedparam.3:106
2653 msgid ""
2654 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2655 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2656 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2657 "(3), B<pthreads>(7)"
2658 msgstr ""
2659 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2660 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2661 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2662 "(3), B<pthreads>(7)"
2663
2664 #. type: TH
2665 #: build/C/man3/pthread_attr_setschedpolicy.3:24
2666 #, no-wrap
2667 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2668 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2669
2670 #. type: Plain text
2671 #: build/C/man3/pthread_attr_setschedpolicy.3:28
2672 msgid ""
2673 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2674 "scheduling policy attribute in thread attributes object"
2675 msgstr ""
2676 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
2677 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
2678
2679 #. type: Plain text
2680 #: build/C/man3/pthread_attr_setschedpolicy.3:36
2681 #, no-wrap
2682 msgid ""
2683 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2684 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2685 msgstr ""
2686 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2687 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2688
2689 #. type: Plain text
2690 #: build/C/man3/pthread_attr_setschedpolicy.3:50
2691 msgid ""
2692 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2693 "attribute of the thread attributes object referred to by I<attr> to the "
2694 "value specified in I<policy>.  This attribute determines the scheduling "
2695 "policy of a thread created using the thread attributes object I<attr>."
2696 msgstr ""
2697 "B<pthread_attr_setschedpolicy>() 関数は、\n"
2698 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2699 "ポリシー属性を I<policy> で指定された値に設定する。\n"
2700 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2701 "作成されるスレッドのスケジューリングポリシーが決定される。"
2702
2703 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2704 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2705 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2706 #. type: Plain text
2707 #: build/C/man3/pthread_attr_setschedpolicy.3:63
2708 msgid ""
2709 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2710 "B<SCHED_OTHER>, with the semantics described in B<sched_setscheduler>(2)."
2711 msgstr ""
2712 "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER>\n"
2713 "である。それぞれの意味は B<sched_setscheduler>(2) で説明している通り\n"
2714 "である。"
2715
2716 #. type: Plain text
2717 #: build/C/man3/pthread_attr_setschedpolicy.3:70
2718 msgid ""
2719 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2720 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2721 "by I<policy>."
2722 msgstr ""
2723 "B<pthread_attr_getschedpolicy>() は、\n"
2724 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
2725 "I<policy> が指すバッファに入れて返す。"
2726
2727 #. type: Plain text
2728 #: build/C/man3/pthread_attr_setschedpolicy.3:76
2729 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2730 msgstr "B<pthread_attr_setschedpolicy>() は以下のエラーで失敗する場合がある。"
2731
2732 #. type: Plain text
2733 #: build/C/man3/pthread_attr_setschedpolicy.3:80
2734 msgid "Invalid value in I<policy>."
2735 msgstr "I<policy> に無効な値が指定された。"
2736
2737 #.  .SH VERSIONS
2738 #.  Available since glibc 2.0.
2739 #. type: Plain text
2740 #: build/C/man3/pthread_attr_setschedpolicy.3:87
2741 msgid ""
2742 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2743 "to set the attribute to an unsupported value\") for "
2744 "B<pthread_attr_setschedpolicy>()."
2745 msgstr ""
2746 "POSIX.1-2001 では、 B<pthread_attr_setschedpolicy>() に関して\n"
2747 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2748 "も追加で規定されている。"
2749
2750 #. type: Plain text
2751 #: build/C/man3/pthread_attr_setschedpolicy.3:101
2752 msgid ""
2753 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2754 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2755 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2756 "(3), B<pthreads>(7)"
2757 msgstr ""
2758 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2759 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2760 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2761 "(3), B<pthreads>(7)"
2762
2763 #. type: TH
2764 #: build/C/man3/pthread_attr_setscope.3:24
2765 #, no-wrap
2766 msgid "PTHREAD_ATTR_SETSCOPE"
2767 msgstr "PTHREAD_ATTR_SETSCOPE"
2768
2769 #. type: Plain text
2770 #: build/C/man3/pthread_attr_setscope.3:28
2771 msgid ""
2772 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2773 "attribute in thread attributes object"
2774 msgstr ""
2775 "pthread_attr_setscope, pthread_attr_getscope - \n"
2776 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
2777
2778 #. type: Plain text
2779 #: build/C/man3/pthread_attr_setscope.3:36
2780 #, no-wrap
2781 msgid ""
2782 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2783 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2784 msgstr ""
2785 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2786 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2787
2788 #. type: Plain text
2789 #: build/C/man3/pthread_attr_setscope.3:51
2790 msgid ""
2791 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2792 "of the thread attributes object referred to by I<attr> to the value "
2793 "specified in I<scope>.  The contention scope attribute defines the set of "
2794 "threads against which a thread competes for resources such as the CPU.  "
2795 "POSIX.1-2001 specifies two possible values for I<scope>:"
2796 msgstr ""
2797 "B<pthread_attr_setscope>() 関数は、\n"
2798 "I<attr> が参照するスレッド属性オブジェクトの contention scope\n"
2799 "属性を I<scope> で指定された値に設定する。\n"
2800 "contention scope 属性により、\n"
2801 "スレッドが CPU などのリソースを取り合うスレッド集合が規定される。\n"
2802 "POSIX.1-2001 では I<scope> に指定する値として 2 つの値が規定されている。"
2803
2804 #. type: TP
2805 #: build/C/man3/pthread_attr_setscope.3:51
2806 #, no-wrap
2807 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2808 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2809
2810 #. type: Plain text
2811 #: build/C/man3/pthread_attr_setscope.3:59
2812 msgid ""
2813 "The thread competes for resources with all other threads in all processes on "
2814 "the system that are in the same scheduling allocation domain (a group of one "
2815 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2816 "to one another according to their scheduling policy and priority."
2817 msgstr ""
2818
2819 #. type: TP
2820 #: build/C/man3/pthread_attr_setscope.3:59
2821 #, no-wrap
2822 msgid "B<PTHREAD_SCOPE_PROCESS>"
2823 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2824
2825 #. type: Plain text
2826 #: build/C/man3/pthread_attr_setscope.3:74
2827 msgid ""
2828 "The thread competes for resources with all other threads in the same process "
2829 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
2830 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2831 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
2832 "leaves it unspecified how these threads contend with other threads in other "
2833 "process on the system or with other threads in the same process that were "
2834 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
2835 msgstr ""
2836
2837 #. type: Plain text
2838 #: build/C/man3/pthread_attr_setscope.3:81
2839 msgid ""
2840 "POSIX.1-2001 only requires that an implementation support one of these "
2841 "contention scopes, but permits both to be supported.  Linux supports "
2842 "B<PTHREAD_SCOPE_SYSTEM>, but not B<PTHREAD_SCOPE_PROCESS>."
2843 msgstr ""
2844
2845 #. type: Plain text
2846 #: build/C/man3/pthread_attr_setscope.3:89
2847 msgid ""
2848 "The B<pthread_attr_getscope>()  function returns the contention scope "
2849 "attribute of the thread attributes object referred to by I<attr> in the "
2850 "buffer pointed to by I<scope>."
2851 msgstr ""
2852 "B<pthread_attr_getscope>() は、\n"
2853 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
2854 "I<scope> が指すバッファに入れて返す。"
2855
2856 #. type: Plain text
2857 #: build/C/man3/pthread_attr_setscope.3:95
2858 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
2859 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
2860
2861 #. type: Plain text
2862 #: build/C/man3/pthread_attr_setscope.3:99
2863 msgid "An invalid value was specified in I<scope>."
2864 msgstr "I<scope> に無効な値が指定された。"
2865
2866 #. type: TP
2867 #: build/C/man3/pthread_attr_setscope.3:99
2868 #, no-wrap
2869 msgid "B<ENOTSUP>"
2870 msgstr "B<ENOTSUP>"
2871
2872 #. type: Plain text
2873 #: build/C/man3/pthread_attr_setscope.3:105
2874 msgid ""
2875 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
2876 "supported on Linux."
2877 msgstr ""
2878 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
2879 "この値は Linux でサポートされていない。"
2880
2881 #. type: Plain text
2882 #: build/C/man3/pthread_attr_setscope.3:115
2883 msgid ""
2884 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a "
2885 "userspace thread is bound directly to a single kernel-scheduling entity.  "
2886 "This is the case on Linux for the obsolete LinuxThreads implementation and "
2887 "the modern NPTL implementation, which are both 1:1 threading implementations."
2888 msgstr ""
2889
2890 #. type: Plain text
2891 #: build/C/man3/pthread_attr_setscope.3:118
2892 msgid ""
2893 "POSIX.1-2001 specifies that the default contention scope is implementation-"
2894 "defined."
2895 msgstr ""
2896 "POSIX.1-2001 では、 contention scope 属性のデフォルト値は\n"
2897 "実装時で定義されるものと規定されている。"
2898
2899 #. type: Plain text
2900 #: build/C/man3/pthread_attr_setscope.3:126
2901 msgid ""
2902 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2903 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2904 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2905 msgstr ""
2906 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2907 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2908 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2909
2910 #. type: TH
2911 #: build/C/man3/pthread_attr_setstack.3:24
2912 #, no-wrap
2913 msgid "PTHREAD_ATTR_SETSTACK"
2914 msgstr "PTHREAD_ATTR_SETSTACK"
2915
2916 #. type: Plain text
2917 #: build/C/man3/pthread_attr_setstack.3:28
2918 msgid ""
2919 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
2920 "thread attributes object"
2921 msgstr ""
2922 "pthread_attr_setstack, pthread_attr_getstack - \n"
2923 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
2924
2925 #. type: Plain text
2926 #: build/C/man3/pthread_attr_setstack.3:36
2927 #, no-wrap
2928 msgid ""
2929 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2930 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2931 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2932 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2933 msgstr ""
2934 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2935 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2936 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2937 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2938
2939 #. type: Plain text
2940 #: build/C/man3/pthread_attr_setstack.3:43 build/C/man3/pthread_sigqueue.3:39
2941 msgid ""
2942 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
2943 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
2944
2945 #. type: Plain text
2946 #: build/C/man3/pthread_attr_setstack.3:48
2947 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2948 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2949
2950 #. type: Plain text
2951 #: build/C/man3/pthread_attr_setstack.3:50
2952 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2953 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2954
2955 #. type: Plain text
2956 #: build/C/man3/pthread_attr_setstack.3:66
2957 msgid ""
2958 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
2959 "size attributes of the thread attributes object referred to by I<attr> to "
2960 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
2961 "attributes specify the location and size of the stack that should be used by "
2962 "a thread that is created using the thread attributes object I<attr>."
2963 msgstr ""
2964 "B<pthread_attr_setstack>() 関数は、\n"
2965 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
2966 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
2967 "指定された値に設定する。\n"
2968 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2969 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
2970
2971 #. type: Plain text
2972 #: build/C/man3/pthread_attr_setstack.3:72
2973 msgid ""
2974 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
2975 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
2976 "allocated buffer should be both readable and writable."
2977 msgstr ""
2978 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
2979 "バッファ内の指定できる最小のアドレスバイトを指すべきである。\n"
2980 "割り当てられたバッファのページは読み書き両方が可能なページとなっている\n"
2981 "べきである。"
2982
2983 #. type: Plain text
2984 #: build/C/man3/pthread_attr_setstack.3:83
2985 msgid ""
2986 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
2987 "size attributes of the thread attributes object referred to by I<attr> in "
2988 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
2989 msgstr ""
2990 "B<pthread_attr_getstack>() 関数は、\n"
2991 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
2992 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
2993 "指すバッファに入れて返す。"
2994
2995 #. type: Plain text
2996 #: build/C/man3/pthread_attr_setstack.3:89
2997 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
2998 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
2999
3000 #. type: Plain text
3001 #: build/C/man3/pthread_attr_setstack.3:100
3002 msgid ""
3003 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
3004 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
3005 "stacksize> is not suitably aligned."
3006 msgstr ""
3007 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
3008 "システムによっては、 I<stackaddr> か\n"
3009 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
3010 "このエラーが発生する。"
3011
3012 #. type: Plain text
3013 #: build/C/man3/pthread_attr_setstack.3:108
3014 msgid ""
3015 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
3016 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
3017 "caller."
3018 msgstr ""
3019 "POSIX.1-2001 では エラー B<EACCES> も規定されており、\n"
3020 "このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に\n"
3021 "呼び出し側から読み書き両方のアクセスができない状況を表す。"
3022
3023 #. type: Plain text
3024 #: build/C/man3/pthread_attr_setstack.3:110
3025 msgid "These functions are provided by glibc since version 2.2."
3026 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
3027
3028 #. type: Plain text
3029 #: build/C/man3/pthread_attr_setstack.3:120
3030 msgid ""
3031 "These functions are provided for applications that must ensure that a "
3032 "thread's stack is placed in a particular location.  For most applications, "
3033 "this is not necessary, and the use of these functions should be avoided.  "
3034 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
3035 "stack size other than the default.)"
3036 msgstr ""
3037 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
3038 "しなければならないアプリケーションのために提供されている。\n"
3039 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
3040 "これらの関数を使うのは避けるべきである。\n"
3041 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
3042 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
3043
3044 #. type: Plain text
3045 #: build/C/man3/pthread_attr_setstack.3:131
3046 msgid ""
3047 "When an application employs B<pthread_attr_setstack>(), it takes over the "
3048 "responsibility of allocating the stack.  Any guard size value that was set "
3049 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
3050 "is the application's responsibility to allocate a guard area (one or more "
3051 "pages protected against reading and writing)  to handle the possibility of "
3052 "stack overflow."
3053 msgstr ""
3054 "アプリケーションが B<pthread_attr_setstack>() を利用する際には、\n"
3055 "スタックの割り当てに責任を持つ必要がある。\n"
3056 "B<pthread_attr_setguardsize>(3) を使って設定された\n"
3057 "guard size の値は無視される。\n"
3058 "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n"
3059 "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n"
3060 "スタックオーバーフローの可能性に対処するようにする必要がある。"
3061
3062 #. type: Plain text
3063 #: build/C/man3/pthread_attr_setstack.3:142
3064 msgid ""
3065 "The address specified in I<stackaddr> should be suitably aligned: for full "
3066 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
3067 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
3068 "should also be a multiple of the system page size."
3069 msgstr ""
3070 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
3071 "完全な移植性を持たせるためには、\n"
3072 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
3073 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
3074 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
3075
3076 #. type: Plain text
3077 #: build/C/man3/pthread_attr_setstack.3:151
3078 msgid ""
3079 "If I<attr> is used to create multiple threads, then the caller must change "
3080 "the stack address attribute between calls to B<pthread_create>(3); "
3081 "otherwise, the threads will attempt to use the same memory area for their "
3082 "stacks, and chaos will ensue."
3083 msgstr ""
3084 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
3085 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
3086 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
3087 "さもなければ、複数のスレッドがスタックとして同じメモリ領域を\n"
3088 "使おうとするため、訳の分からない状況が発生してしまう。"
3089
3090 #. type: Plain text
3091 #: build/C/man3/pthread_attr_setstack.3:164
3092 msgid ""
3093 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3094 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3095 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3096 msgstr ""
3097 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3098 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3099 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3100
3101 #. type: TH
3102 #: build/C/man3/pthread_attr_setstackaddr.3:24
3103 #, no-wrap
3104 msgid "PTHREAD_ATTR_SETSTACKADDR"
3105 msgstr "PTHREAD_ATTR_SETSTACKADDR"
3106
3107 #. type: Plain text
3108 #: build/C/man3/pthread_attr_setstackaddr.3:28
3109 msgid ""
3110 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
3111 "attribute in thread attributes object"
3112 msgstr ""
3113 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
3114 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
3115
3116 #. type: Plain text
3117 #: build/C/man3/pthread_attr_setstackaddr.3:36
3118 #, no-wrap
3119 msgid ""
3120 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3121 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3122 msgstr ""
3123 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3124 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3125
3126 #. type: Plain text
3127 #: build/C/man3/pthread_attr_setstackaddr.3:47
3128 msgid ""
3129 "These functions are obsolete: B<do not use them.> Use "
3130 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
3131 msgstr ""
3132 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
3133 "代わりに Use B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使うこと。"
3134
3135 #. type: Plain text
3136 #: build/C/man3/pthread_attr_setstackaddr.3:58
3137 msgid ""
3138 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
3139 "attribute of the thread attributes object referred to by I<attr> to the "
3140 "value specified in I<stackaddr>.  This attribute specifies the location of "
3141 "the stack that should be used by a thread that is created using the thread "
3142 "attributes object I<attr>."
3143 msgstr ""
3144 "B<pthread_attr_setstackaddr>() 関数は、\n"
3145 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3146 "属性を I<stackaddr> で指定された値に設定する。\n"
3147 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3148 "作成されるスレッドが使用すべきスタックの位置が指定される。"
3149
3150 #. type: Plain text
3151 #: build/C/man3/pthread_attr_setstackaddr.3:64
3152 msgid ""
3153 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
3154 "that was allocated by the caller.  The pages of the allocated buffer should "
3155 "be both readable and writable."
3156 msgstr ""
3157 "I<stackaddr> は呼び出し側が割り当てたバッファ (大きさは\n"
3158 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
3159 "割り当てられたバッファのページは読み書き両方が可能なページと\n"
3160 "なっているべきである。"
3161
3162 #. type: Plain text
3163 #: build/C/man3/pthread_attr_setstackaddr.3:72
3164 msgid ""
3165 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
3166 "attribute of the thread attributes object referred to by I<attr> in the "
3167 "buffer pointed to by I<stackaddr>."
3168 msgstr ""
3169 "B<pthread_attr_getstackaddr>() は、\n"
3170 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3171 "I<stackaddr> が指すバッファに入れて返す。"
3172
3173 #. type: Plain text
3174 #: build/C/man3/pthread_attr_setstackaddr.3:79
3175 msgid ""
3176 "No errors are defined (but applications should nevertheless handle a "
3177 "possible error return)."
3178 msgstr ""
3179 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
3180 "返り値を処理するようにすべきである)。"
3181
3182 #. type: Plain text
3183 #: build/C/man3/pthread_attr_setstackaddr.3:84
3184 msgid ""
3185 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
3186 "POSIX.1-2008 removes the specification of these functions."
3187 msgstr ""
3188 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
3189 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
3190
3191 #. type: Plain text
3192 #: build/C/man3/pthread_attr_setstackaddr.3:108
3193 msgid ""
3194 "I<Do not use these functions!> They cannot be portably used, since they "
3195 "provide no way of specifying the direction of growth or the range of the "
3196 "stack.  For example, on architectures with a stack that grows downward, "
3197 "I<stackaddr> specifies the next address past the I<highest> address of the "
3198 "allocated stack area.  However, on architectures with a stack that grows "
3199 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
3200 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
3201 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
3202 "in the allocated stack area (and the I<stacksize> argument specifies the "
3203 "range of the stack)."
3204 msgstr ""
3205 "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n"
3206 "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n"
3207 "かを指定する手段が提供されていないからである。\n"
3208 "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャ\n"
3209 "では、I<stackaddr> には割り当てられたスタック領域のI<最も大きな>アドレ\n"
3210 "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n"
3211 "方向) に伸びるアーキテクチャでは、I<stackaddr> には割り当てられた\n"
3212 "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n"
3213 "B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) が使用する\n"
3214 "I<stackaddr> は、常に割り当てられたスタック領域の最も小さいアドレス\n"
3215 "へのポインタである (I<stacksize> 引き数はスタックの範囲を指定する)。"
3216
3217 #. type: Plain text
3218 #: build/C/man3/pthread_attr_setstackaddr.3:114
3219 msgid ""
3220 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3221 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3222 msgstr ""
3223 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3224 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3225
3226 #. type: TH
3227 #: build/C/man3/pthread_attr_setstacksize.3:24
3228 #, no-wrap
3229 msgid "PTHREAD_ATTR_SETSTACKSIZE"
3230 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
3231
3232 #. type: Plain text
3233 #: build/C/man3/pthread_attr_setstacksize.3:28
3234 msgid ""
3235 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
3236 "attribute in thread attributes object"
3237 msgstr ""
3238 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
3239 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
3240
3241 #. type: Plain text
3242 #: build/C/man3/pthread_attr_setstacksize.3:36
3243 #, no-wrap
3244 msgid ""
3245 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3246 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3247 msgstr ""
3248 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3249 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3250
3251 #. type: Plain text
3252 #: build/C/man3/pthread_attr_setstacksize.3:47
3253 msgid ""
3254 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
3255 "of the thread attributes object referred to by I<attr> to the value "
3256 "specified in I<stacksize>."
3257 msgstr ""
3258 "B<pthread_attr_setstacksize>() 関数は、\n"
3259 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3260 "属性を I<stacksize> で指定された値に設定する。"
3261
3262 #. type: Plain text
3263 #: build/C/man3/pthread_attr_setstacksize.3:51
3264 msgid ""
3265 "The stack size attribute determines the minimum size (in bytes) that will be "
3266 "allocated for threads created using the thread attributes object I<attr>."
3267 msgstr ""
3268 "スタックサイズ属性により、\n"
3269 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
3270 "に割り当てられる最小サイズ (バイト単位) が決定される。"
3271
3272 #. type: Plain text
3273 #: build/C/man3/pthread_attr_setstacksize.3:59
3274 msgid ""
3275 "The B<pthread_attr_getstacksize>()  function returns the stack size "
3276 "attribute of the thread attributes object referred to by I<attr> in the "
3277 "buffer pointed to by I<stacksize>."
3278 msgstr ""
3279 "B<pthread_attr_getstacksize>() は、\n"
3280 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3281 "I<stacksize> が指すバッファに入れて返す。"
3282
3283 #. type: Plain text
3284 #: build/C/man3/pthread_attr_setstacksize.3:65
3285 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
3286 msgstr "B<pthread_attr_setstacksize>() は以下のエラーで失敗する場合がある。"
3287
3288 #. type: Plain text
3289 #: build/C/man3/pthread_attr_setstacksize.3:70
3290 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
3291 msgstr "スタックサイズが B<PTHREAD_STACK_MIN> (16384) バイト未満である。"
3292
3293 #.  e.g., MacOS
3294 #. type: Plain text
3295 #: build/C/man3/pthread_attr_setstacksize.3:79
3296 msgid ""
3297 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
3298 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
3299 msgstr ""
3300 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
3301 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
3302 "エラー B<EINVAL> で失敗する。"
3303
3304 #. type: Plain text
3305 #: build/C/man3/pthread_attr_setstacksize.3:86
3306 msgid ""
3307 "For details on the default stack size of new threads, see B<pthread_create>"
3308 "(3)."
3309 msgstr ""
3310 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
3311 "B<pthread_create>(3) を参照。"
3312
3313 #. type: Plain text
3314 #: build/C/man3/pthread_attr_setstacksize.3:89
3315 msgid ""
3316 "A thread's stack size is fixed at the time of thread creation.  Only the "
3317 "main thread can dynamically grow its stack."
3318 msgstr ""
3319 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
3320 "メインスレッドだけがスタックを動的に伸ばすことができる。"
3321
3322 #. type: Plain text
3323 #: build/C/man3/pthread_attr_setstacksize.3:94
3324 msgid ""
3325 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
3326 "the size and location of a caller-allocated stack that is to be used by a "
3327 "thread."
3328 msgstr ""
3329 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
3330 "アプリケーションは、スレッドが使用するスタックとして、\n"
3331 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
3332
3333 #. type: Plain text
3334 #: build/C/man3/pthread_attr_setstacksize.3:106
3335 msgid ""
3336 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
3337 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
3338 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
3339 "stack will be at least I<stacksize> bytes."
3340 msgstr ""
3341 "glibc 2.8 の時点では、指定された I<stacksize> が B<STACK_ALIGN> \n"
3342 "(ほとんどのアーキテクチャでは 16 バイト) の倍数でない場合、\n"
3343 "I<stacksize> はI<小さくなる方向に>に丸められる。\n"
3344 "これは POSIX.1-2001 に違反している。\n"
3345 "POSIX.1-2001 では、割り当てらたスタックの大きさは\n"
3346 "少なくとも I<stacksize> バイトになると書かれている。"
3347
3348 #. type: Plain text
3349 #: build/C/man3/pthread_attr_setstacksize.3:109
3350 #: build/C/man3/pthread_join.3:125
3351 msgid "See B<pthread_create>(3)."
3352 msgstr "B<pthread_create>(3) を参照。"
3353
3354 #. type: Plain text
3355 #: build/C/man3/pthread_attr_setstacksize.3:116
3356 msgid ""
3357 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3358 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3359 msgstr ""
3360 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3361 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3362
3363 #. type: TH
3364 #: build/C/man3/pthread_cancel.3:24
3365 #, no-wrap
3366 msgid "PTHREAD_CANCEL"
3367 msgstr "PTHREAD_CANCEL"
3368
3369 #. type: TH
3370 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_setschedparam.3:24
3371 #, no-wrap
3372 msgid "2008-11-17"
3373 msgstr "2008-11-17"
3374
3375 #. type: Plain text
3376 #: build/C/man3/pthread_cancel.3:27
3377 msgid "pthread_cancel - send a cancellation request to a thread"
3378 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
3379
3380 #. type: Plain text
3381 #: build/C/man3/pthread_cancel.3:32
3382 #, no-wrap
3383 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3384 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3385
3386 #. type: Plain text
3387 #: build/C/man3/pthread_cancel.3:44
3388 msgid ""
3389 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
3390 "I<thread>.  Whether and when the target thread reacts to the cancellation "
3391 "request depends on two attributes that are under the control of that thread: "
3392 "its cancelability I<state> and I<type>."
3393 msgstr ""
3394 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
3395 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
3396 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
3397 "I<state> と I<type>により決まる。"
3398
3399 #. type: Plain text
3400 #: build/C/man3/pthread_cancel.3:56
3401 msgid ""
3402 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
3403 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
3404 "has disabled cancellation, then a cancellation request remains queued until "
3405 "the thread enables cancellation.  If a thread has enabled cancellation, then "
3406 "its cancelability type determines when cancellation occurs."
3407 msgstr ""
3408 "あるスレッドの cancelability state は B<pthread_setcancelstate>(3) で\n"
3409 "設定され、I<enabled> と I<disabled> のいずれとなる (I<enabled> が新しい\n"
3410 "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n"
3411 "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n"
3412 "れたままになる。スレッドがキャンセルを有効にしていた場合、\n"
3413 "cancelability type によって、いつキャンセルが発生するかが決まる。"
3414
3415 #. type: Plain text
3416 #: build/C/man3/pthread_cancel.3:72
3417 msgid ""
3418 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3419 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
3420 "Asynchronous cancelability means that the thread can be canceled at any time "
3421 "(usually immediately, but the system does not guarantee this).  Deferred "
3422 "cancelability means that cancellation will be delayed until the thread next "
3423 "calls a function that is a I<cancellation point>.  A list of functions that "
3424 "are or may be cancellation points is provided in I<pthreads>(7)."
3425 msgstr ""
3426 "スレッドの cancellation type は B<pthread_setcanceltype>(3) で設定され、\n"
3427 "I<asynchronous> か I<deferred> のいずれかとなる(I<deferred> が新しいスレッド\n"
3428 "のデフォルト値である)。\n"
3429 "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつでも\n"
3430 "キャンセルされることを意味する (通常はすぐにキャンセルされるが、システムが\n"
3431 "そのことを保証しているわけではない)。\n"
3432 "遅延キャンセル (deferred cancelability) では、そのスレッドが I<cancellation\n"
3433 "point> となっている関数を次に呼び出すまでキャンセルが遅延される。\n"
3434 "取り消しポイント (cancellation point) に設定されていたり設定したりできる\n"
3435 "関数のリストは I<pthreads>(7) に記載している。"
3436
3437 #. type: Plain text
3438 #: build/C/man3/pthread_cancel.3:76
3439 msgid ""
3440 "When a cancellation requested is acted on, the following steps occur for "
3441 "I<thread> (in this order):"
3442 msgstr ""
3443 "キャンセル要求が実行されると、\n"
3444 "I<thread> では以下のステップが (この順序で) 行われる。"
3445
3446 #. type: IP
3447 #: build/C/man3/pthread_cancel.3:76 build/C/man3/pthread_cleanup_push.3:67
3448 #, no-wrap
3449 msgid "1."
3450 msgstr "1."
3451
3452 #. type: Plain text
3453 #: build/C/man3/pthread_cancel.3:81
3454 msgid ""
3455 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3456 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
3457 msgstr ""
3458 "キャンセルクリーンアップハンドラが (push されたのと逆順で)\n"
3459 "取り出され (pop され)、呼び出される。\n"
3460 "(B<pthread_cleanup_push>(3) 参照)"
3461
3462 #. type: IP
3463 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:71
3464 #, no-wrap
3465 msgid "2."
3466 msgstr "2."
3467
3468 #. type: Plain text
3469 #: build/C/man3/pthread_cancel.3:86
3470 msgid ""
3471 "Thread-specific data destructors are called, in an unspecified order.  (See "
3472 "B<pthread_key_create>(3).)"
3473 msgstr ""
3474 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
3475 "呼び出し順序は規定されていない。\n"
3476 "(B<pthread_key_create>(3) 参照)"
3477
3478 #. type: IP
3479 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:79
3480 #, no-wrap
3481 msgid "3."
3482 msgstr "3."
3483
3484 #. type: Plain text
3485 #: build/C/man3/pthread_cancel.3:90
3486 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3487 msgstr "スレッドが終了される。 (B<pthread_exit>(3) 参照)"
3488
3489 #. type: Plain text
3490 #: build/C/man3/pthread_cancel.3:98
3491 msgid ""
3492 "The above steps happen asynchronously with respect to the B<pthread_cancel>"
3493 "()  call; the return status of B<pthread_cancel>()  merely informs the "
3494 "caller whether the cancellation request was successfully queued."
3495 msgstr ""
3496 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
3497 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
3498 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
3499
3500 #. type: Plain text
3501 #: build/C/man3/pthread_cancel.3:107
3502 msgid ""
3503 "After a canceled thread has terminated, a join with that thread using "
3504 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
3505 "status.  (Joining with a thread is the only way to know that cancellation "
3506 "has completed.)"
3507 msgstr ""
3508 "キャンセルされたスレッドが終了された後に、\n"
3509 "B<pthread_join>(3) でそのスレッドを join すると、\n"
3510 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
3511 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
3512
3513 #. type: Plain text
3514 #: build/C/man3/pthread_cancel.3:112
3515 msgid ""
3516 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
3517 "error number."
3518 msgstr ""
3519 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
3520 "エラーの場合、0 以外のエラー番号を返す。"
3521
3522 #. type: TP
3523 #: build/C/man3/pthread_cancel.3:113 build/C/man3/pthread_detach.3:57
3524 #: build/C/man3/pthread_getcpuclockid.3:56 build/C/man3/pthread_join.3:91
3525 #: build/C/man3/pthread_kill.3:59 build/C/man3/pthread_setaffinity_np.3:112
3526 #: build/C/man3/pthread_setschedparam.3:112
3527 #: build/C/man3/pthread_setschedprio.3:68 build/C/man3/pthread_sigqueue.3:83
3528 #, no-wrap
3529 msgid "B<ESRCH>"
3530 msgstr "B<ESRCH>"
3531
3532 #. type: Plain text
3533 #: build/C/man3/pthread_cancel.3:120 build/C/man3/pthread_detach.3:62
3534 #: build/C/man3/pthread_getcpuclockid.3:61 build/C/man3/pthread_join.3:96
3535 #: build/C/man3/pthread_kill.3:64 build/C/man3/pthread_setaffinity_np.3:117
3536 #: build/C/man3/pthread_setschedparam.3:117
3537 #: build/C/man3/pthread_setschedprio.3:73
3538 msgid "No thread with the ID I<thread> could be found."
3539 msgstr "ID が I<thread> のスレッドが見つからなかった。"
3540
3541 #. type: Plain text
3542 #: build/C/man3/pthread_cancel.3:130
3543 msgid ""
3544 "On Linux, cancellation is implemented using signals.  Under the NPTL "
3545 "threading implementation, the first real-time signal (i.e., signal 32) is "
3546 "used for this purpose.  On LinuxThreads, the second real-time signal is "
3547 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3548 msgstr ""
3549 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装で"
3550 "は、\n"
3551 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
3552 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイ"
3553 "ム\n"
3554 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
3555
3556 #. type: Plain text
3557 #: build/C/man3/pthread_cancel.3:136
3558 msgid ""
3559 "The program below creates a thread and then cancels it.  The main thread "
3560 "joins with the canceled thread to check that its exit status was "
3561 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
3562 "run the program:"
3563 msgstr ""
3564 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルす"
3565 "る。\n"
3566 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
3567 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
3568 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
3569
3570 #. type: Plain text
3571 #: build/C/man3/pthread_cancel.3:144
3572 #, no-wrap
3573 msgid ""
3574 "$ ./a.out\n"
3575 "thread_func(): started; cancellation disabled\n"
3576 "main(): sending cancellation request\n"
3577 "thread_func(): about to enable cancellation\n"
3578 "main(): thread was canceled\n"
3579 msgstr ""
3580 "$ ./a.out\n"
3581 "thread_func(): started; cancellation disabled\n"
3582 "main(): sending cancellation request\n"
3583 "thread_func(): about to enable cancellation\n"
3584 "main(): thread was canceled\n"
3585
3586 #. type: Plain text
3587 #: build/C/man3/pthread_cancel.3:154
3588 #, no-wrap
3589 msgid ""
3590 "#include E<lt>pthread.hE<gt>\n"
3591 "#include E<lt>stdio.hE<gt>\n"
3592 "#include E<lt>errno.hE<gt>\n"
3593 "#include E<lt>stdlib.hE<gt>\n"
3594 "#include E<lt>unistd.hE<gt>\n"
3595 msgstr ""
3596 "#include E<lt>pthread.hE<gt>\n"
3597 "#include E<lt>stdio.hE<gt>\n"
3598 "#include E<lt>errno.hE<gt>\n"
3599 "#include E<lt>stdlib.hE<gt>\n"
3600 "#include E<lt>unistd.hE<gt>\n"
3601
3602 #. type: Plain text
3603 #: build/C/man3/pthread_cancel.3:162
3604 #, no-wrap
3605 msgid ""
3606 "static void *\n"
3607 "thread_func(void *ignored_argument)\n"
3608 "{\n"
3609 "    int s;\n"
3610 msgstr ""
3611 "static void *\n"
3612 "thread_func(void *ignored_argument)\n"
3613 "{\n"
3614 "    int s;\n"
3615
3616 #. type: Plain text
3617 #: build/C/man3/pthread_cancel.3:165
3618 #, no-wrap
3619 msgid ""
3620 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3621 "       immediately react to a cancellation request */\n"
3622 msgstr ""
3623 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3624 "       immediately react to a cancellation request */\n"
3625
3626 #. type: Plain text
3627 #: build/C/man3/pthread_cancel.3:169
3628 #, no-wrap
3629 msgid ""
3630 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3631 "    if (s != 0)\n"
3632 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3633 msgstr ""
3634 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3635 "    if (s != 0)\n"
3636 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3637
3638 #. type: Plain text
3639 #: build/C/man3/pthread_cancel.3:173
3640 #, no-wrap
3641 msgid ""
3642 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3643 "    sleep(5);\n"
3644 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3645 msgstr ""
3646 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3647 "    sleep(5);\n"
3648 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3649
3650 #. type: Plain text
3651 #: build/C/man3/pthread_cancel.3:177
3652 #, no-wrap
3653 msgid ""
3654 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3655 "    if (s != 0)\n"
3656 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3657 msgstr ""
3658 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3659 "    if (s != 0)\n"
3660 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3661
3662 #. type: Plain text
3663 #: build/C/man3/pthread_cancel.3:179
3664 #, no-wrap
3665 msgid "    /* sleep() is a cancellation point */\n"
3666 msgstr "    /* sleep() is a cancellation point */\n"
3667
3668 #. type: Plain text
3669 #: build/C/man3/pthread_cancel.3:181
3670 #, no-wrap
3671 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3672 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3673
3674 #. type: Plain text
3675 #: build/C/man3/pthread_cancel.3:183
3676 #, no-wrap
3677 msgid "    /* Should never get here */\n"
3678 msgstr "    /* Should never get here */\n"
3679
3680 #. type: Plain text
3681 #: build/C/man3/pthread_cancel.3:187
3682 #, no-wrap
3683 msgid ""
3684 "    printf(\"thread_func(): not canceled!\\en\");\n"
3685 "    return NULL;\n"
3686 "}\n"
3687 msgstr ""
3688 "    printf(\"thread_func(): not canceled!\\en\");\n"
3689 "    return NULL;\n"
3690 "}\n"
3691
3692 #. type: Plain text
3693 #: build/C/man3/pthread_cancel.3:194
3694 #, no-wrap
3695 msgid ""
3696 "int\n"
3697 "main(void)\n"
3698 "{\n"
3699 "    pthread_t thr;\n"
3700 "    void *res;\n"
3701 "    int s;\n"
3702 msgstr ""
3703 "int\n"
3704 "main(void)\n"
3705 "{\n"
3706 "    pthread_t thr;\n"
3707 "    void *res;\n"
3708 "    int s;\n"
3709
3710 #. type: Plain text
3711 #: build/C/man3/pthread_cancel.3:196
3712 #, no-wrap
3713 msgid "    /* Start a thread and then send it a cancellation request */\n"
3714 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3715
3716 #. type: Plain text
3717 #: build/C/man3/pthread_cancel.3:200
3718 #, no-wrap
3719 msgid ""
3720 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3721 "    if (s != 0)\n"
3722 "        handle_error_en(s, \"pthread_create\");\n"
3723 msgstr ""
3724 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3725 "    if (s != 0)\n"
3726 "        handle_error_en(s, \"pthread_create\");\n"
3727
3728 #. type: Plain text
3729 #: build/C/man3/pthread_cancel.3:202
3730 #, no-wrap
3731 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3732 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3733
3734 #. type: Plain text
3735 #: build/C/man3/pthread_cancel.3:207
3736 #, no-wrap
3737 msgid ""
3738 "    printf(\"main(): sending cancellation request\\en\");\n"
3739 "    s = pthread_cancel(thr);\n"
3740 "    if (s != 0)\n"
3741 "        handle_error_en(s, \"pthread_cancel\");\n"
3742 msgstr ""
3743 "    printf(\"main(): sending cancellation request\\en\");\n"
3744 "    s = pthread_cancel(thr);\n"
3745 "    if (s != 0)\n"
3746 "        handle_error_en(s, \"pthread_cancel\");\n"
3747
3748 #. type: Plain text
3749 #: build/C/man3/pthread_cancel.3:209
3750 #, no-wrap
3751 msgid "    /* Join with thread to see what its exit status was */\n"
3752 msgstr "    /* Join with thread to see what its exit status was */\n"
3753
3754 #. type: Plain text
3755 #: build/C/man3/pthread_cancel.3:213 build/C/man3/pthread_cleanup_push.3:301
3756 #, no-wrap
3757 msgid ""
3758 "    s = pthread_join(thr, &res);\n"
3759 "    if (s != 0)\n"
3760 "        handle_error_en(s, \"pthread_join\");\n"
3761 msgstr ""
3762 "    s = pthread_join(thr, &res);\n"
3763 "    if (s != 0)\n"
3764 "        handle_error_en(s, \"pthread_join\");\n"
3765
3766 #. type: Plain text
3767 #: build/C/man3/pthread_cancel.3:220
3768 #, no-wrap
3769 msgid ""
3770 "    if (res == PTHREAD_CANCELED)\n"
3771 "        printf(\"main(): thread was canceled\\en\");\n"
3772 "    else\n"
3773 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3774 "    exit(EXIT_SUCCESS);\n"
3775 "}\n"
3776 msgstr ""
3777 "    if (res == PTHREAD_CANCELED)\n"
3778 "        printf(\"main(): thread was canceled\\en\");\n"
3779 "    else\n"
3780 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3781 "    exit(EXIT_SUCCESS);\n"
3782 "}\n"
3783
3784 #. type: Plain text
3785 #: build/C/man3/pthread_cancel.3:231
3786 msgid ""
3787 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3788 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3789 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3790 msgstr ""
3791 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3792 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3793 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3794
3795 #. type: TH
3796 #: build/C/man3/pthread_cleanup_push.3:24
3797 #, no-wrap
3798 msgid "PTHREAD_CLEANUP_PUSH"
3799 msgstr "PTHREAD_CLEANUP_PUSH"
3800
3801 #. type: TH
3802 #: build/C/man3/pthread_cleanup_push.3:24
3803 #: build/C/man3/pthread_setcancelstate.3:24
3804 #, no-wrap
3805 msgid "2008-11-24"
3806 msgstr "2008-11-24"
3807
3808 #. type: Plain text
3809 #: build/C/man3/pthread_cleanup_push.3:28
3810 msgid ""
3811 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
3812 "clean-up handlers"
3813 msgstr ""
3814 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
3815 "キャンセルクリーンアップハンドラの push/pop を行う"
3816
3817 #. type: Plain text
3818 #: build/C/man3/pthread_cleanup_push.3:35
3819 #, no-wrap
3820 msgid ""
3821 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3822 "B<                          void *>I<arg>B<);>\n"
3823 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3824 msgstr ""
3825 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3826 "B<                          void *>I<arg>B<);>\n"
3827 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3828
3829 #. type: Plain text
3830 #: build/C/man3/pthread_cleanup_push.3:46
3831 msgid ""
3832 "These functions manipulate the calling thread's stack of thread-cancellation "
3833 "clean-up handlers.  A clean-up handler is a function that is automatically "
3834 "executed when a thread is canceled (or in various other circumstances "
3835 "described below); it might, for example, unlock a mutex so that it becomes "
3836 "available to other threads in the process."
3837 msgstr ""
3838
3839 #. type: Plain text
3840 #: build/C/man3/pthread_cleanup_push.3:57
3841 msgid ""
3842 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
3843 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
3844 "be given I<arg> as its argument."
3845 msgstr ""
3846
3847 #. type: Plain text
3848 #: build/C/man3/pthread_cleanup_push.3:64
3849 msgid ""
3850 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
3851 "stack of clean-up handlers, and optionally executes it if I<execute> is "
3852 "nonzero."
3853 msgstr ""
3854
3855 #. type: Plain text
3856 #: build/C/man3/pthread_cleanup_push.3:67
3857 msgid ""
3858 "A cancellation clean-up handler is popped from the stack and executed in the "
3859 "following circumstances:"
3860 msgstr ""
3861
3862 #. type: Plain text
3863 #: build/C/man3/pthread_cleanup_push.3:71
3864 msgid ""
3865 "When a thread is canceled, all of the stacked clean-up handlers are popped "
3866 "and executed in the reverse of the order in which they were pushed onto the "
3867 "stack."
3868 msgstr ""
3869
3870 #. type: Plain text
3871 #: build/C/man3/pthread_cleanup_push.3:79
3872 msgid ""
3873 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
3874 "handlers are executed as described in the preceding point.  (Clean-up "
3875 "handlers are I<not> called if the thread terminates by performing a "
3876 "I<return> from the thread start function.)"
3877 msgstr ""
3878
3879 #. type: Plain text
3880 #: build/C/man3/pthread_cleanup_push.3:85
3881 msgid ""
3882 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
3883 "argument, the top-most clean-up handler is popped and executed."
3884 msgstr ""
3885
3886 #. type: Plain text
3887 #: build/C/man3/pthread_cleanup_push.3:97
3888 msgid ""
3889 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
3890 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
3891 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
3892 "calls to these functions are paired within the same function, and at the "
3893 "same lexical nesting level.  (In other words, a clean-up handler is only "
3894 "established during the execution of a specified section of code.)"
3895 msgstr ""
3896
3897 #. type: Plain text
3898 #: build/C/man3/pthread_cleanup_push.3:117
3899 msgid ""
3900 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
3901 "call has been made to B<pthread_cleanup_push>()  or B<pthread_cleanup_pop>"
3902 "()  without the matching call of the pair since the jump buffer was filled "
3903 "by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, calling B<longjmp>(3)  "
3904 "(B<siglongjmp>(3))  from inside a clean-up handler produces undefined "
3905 "results unless the jump buffer was also filled by B<setjmp>(3)  (B<sigsetjmp>"
3906 "(3))  inside the handler."
3907 msgstr ""
3908
3909 #. type: Plain text
3910 #: build/C/man3/pthread_cleanup_push.3:119
3911 msgid "These functions do not return a value."
3912 msgstr "これらの関数は値を返さない。"
3913
3914 #.  SH VERSIONS
3915 #.  Available since glibc 2.0
3916 #. type: Plain text
3917 #: build/C/man3/pthread_cleanup_push.3:123
3918 msgid "There are no errors."
3919 msgstr "エラーはない。"
3920
3921 #. type: Plain text
3922 #: build/C/man3/pthread_cleanup_push.3:134
3923 msgid ""
3924 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
3925 "functions I<are> implemented as macros that expand to text containing \\(aqB<"
3926 "{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
3927 "declared within the scope of paired calls to these functions will only be "
3928 "visible within that scope."
3929 msgstr ""
3930
3931 #.  The text was actually added in the 2004 TC2
3932 #. type: Plain text
3933 #: build/C/man3/pthread_cleanup_push.3:149
3934 msgid ""
3935 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
3936 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
3937 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
3938 "avoid doing this."
3939 msgstr ""
3940
3941 #. type: Plain text
3942 #: build/C/man3/pthread_cleanup_push.3:164
3943 msgid ""
3944 "The program below provides a simple example of the use of the functions "
3945 "described in this page.  The program creates a thread that executes a loop "
3946 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
3947 "loop increments a global variable, I<cnt>, once each second.  Depending on "
3948 "what command-line arguments are supplied, the main thread sends the other "
3949 "thread a cancellation request, or sets a global variable that causes the "
3950 "other thread to exit its loop and terminate normally (by doing a I<return>)."
3951 msgstr ""
3952
3953 #. type: Plain text
3954 #: build/C/man3/pthread_cleanup_push.3:167
3955 msgid ""
3956 "In the following shell session, the main thread sends a cancellation request "
3957 "to the other thread:"
3958 msgstr ""
3959
3960 #. type: Plain text
3961 #: build/C/man3/pthread_cleanup_push.3:177
3962 #, no-wrap
3963 msgid ""
3964 "$ B<./a.out>\n"
3965 "New thread started\n"
3966 "cnt = 0\n"
3967 "cnt = 1\n"
3968 "Canceling thread\n"
3969 "Called clean-up handler\n"
3970 "Thread was canceled; cnt = 0\n"
3971 msgstr ""
3972 "$ B<./a.out>\n"
3973 "New thread started\n"
3974 "cnt = 0\n"
3975 "cnt = 1\n"
3976 "Canceling thread\n"
3977 "Called clean-up handler\n"
3978 "Thread was canceled; cnt = 0\n"
3979
3980 #. type: Plain text
3981 #: build/C/man3/pthread_cleanup_push.3:185
3982 msgid ""
3983 "From the above, we see that the thread was canceled, and that the "
3984 "cancellation clean-up handler was called and it reset the value of the "
3985 "global variable I<cnt> to 0."
3986 msgstr ""
3987
3988 #. type: Plain text
3989 #: build/C/man3/pthread_cleanup_push.3:188
3990 msgid ""
3991 "In the next run, the main program sets a global variable that causes other "
3992 "thread to terminate normally:"
3993 msgstr ""
3994
3995 #. type: Plain text
3996 #: build/C/man3/pthread_cleanup_push.3:196
3997 #, no-wrap
3998 msgid ""
3999 "$ B<./a.out x>\n"
4000 "New thread started\n"
4001 "cnt = 0\n"
4002 "cnt = 1\n"
4003 "Thread terminated normally; cnt = 2\n"
4004 msgstr ""
4005 "$ B<./a.out x>\n"
4006 "New thread started\n"
4007 "cnt = 0\n"
4008 "cnt = 1\n"
4009 "Thread terminated normally; cnt = 2\n"
4010
4011 #. type: Plain text
4012 #: build/C/man3/pthread_cleanup_push.3:204
4013 msgid ""
4014 "From the above, we see that the clean-up handler was not executed (because "
4015 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
4016 msgstr ""
4017
4018 #. type: Plain text
4019 #: build/C/man3/pthread_cleanup_push.3:209
4020 msgid ""
4021 "In the next run, the main program sets a global variable that causes the "
4022 "other thread to terminate normally, and supplies a nonzero value for "
4023 "I<cleanup_pop_arg>:"
4024 msgstr ""
4025
4026 #. type: Plain text
4027 #: build/C/man3/pthread_cleanup_push.3:218
4028 #, no-wrap
4029 msgid ""
4030 "$ B<./a.out x 1>\n"
4031 "New thread started\n"
4032 "cnt = 0\n"
4033 "cnt = 1\n"
4034 "Called clean-up handler\n"
4035 "Thread terminated normally; cnt = 0\n"
4036 msgstr ""
4037 "$ B<./a.out x 1>\n"
4038 "New thread started\n"
4039 "cnt = 0\n"
4040 "cnt = 1\n"
4041 "Called clean-up handler\n"
4042 "Thread terminated normally; cnt = 0\n"
4043
4044 #. type: Plain text
4045 #: build/C/man3/pthread_cleanup_push.3:225
4046 msgid ""
4047 "In the above, we see that although the thread was not canceled, the clean-up "
4048 "handler was executed, because the argument given to B<pthread_cleanup_pop>"
4049 "()  was nonzero."
4050 msgstr ""
4051
4052 #. type: Plain text
4053 #: build/C/man3/pthread_cleanup_push.3:234
4054 #, no-wrap
4055 msgid ""
4056 "#include E<lt>pthread.hE<gt>\n"
4057 "#include E<lt>sys/types.hE<gt>\n"
4058 "#include E<lt>stdio.hE<gt>\n"
4059 "#include E<lt>stdlib.hE<gt>\n"
4060 "#include E<lt>unistd.hE<gt>\n"
4061 "#include E<lt>errno.hE<gt>\n"
4062 msgstr ""
4063 "#include E<lt>pthread.hE<gt>\n"
4064 "#include E<lt>sys/types.hE<gt>\n"
4065 "#include E<lt>stdio.hE<gt>\n"
4066 "#include E<lt>stdlib.hE<gt>\n"
4067 "#include E<lt>unistd.hE<gt>\n"
4068 "#include E<lt>errno.hE<gt>\n"
4069
4070 #. type: Plain text
4071 #: build/C/man3/pthread_cleanup_push.3:241
4072 #, no-wrap
4073 msgid ""
4074 "static int done = 0;\n"
4075 "static int cleanup_pop_arg = 0;\n"
4076 "static int cnt = 0;\n"
4077 msgstr ""
4078 "static int done = 0;\n"
4079 "static int cleanup_pop_arg = 0;\n"
4080 "static int cnt = 0;\n"
4081
4082 #. type: Plain text
4083 #: build/C/man3/pthread_cleanup_push.3:248
4084 #, no-wrap
4085 msgid ""
4086 "static void\n"
4087 "cleanup_handler(void *arg)\n"
4088 "{\n"
4089 "    printf(\"Called clean-up handler\\en\");\n"
4090 "    cnt = 0;\n"
4091 "}\n"
4092 msgstr ""
4093 "static void\n"
4094 "cleanup_handler(void *arg)\n"
4095 "{\n"
4096 "    printf(\"Called clean-up handler\\en\");\n"
4097 "    cnt = 0;\n"
4098 "}\n"
4099
4100 #. type: Plain text
4101 #: build/C/man3/pthread_cleanup_push.3:253
4102 #, no-wrap
4103 msgid ""
4104 "static void *\n"
4105 "thread_start(void *arg)\n"
4106 "{\n"
4107 "    time_t start, curr;\n"
4108 msgstr ""
4109 "static void *\n"
4110 "thread_start(void *arg)\n"
4111 "{\n"
4112 "    time_t start, curr;\n"
4113
4114 #. type: Plain text
4115 #: build/C/man3/pthread_cleanup_push.3:255
4116 #, no-wrap
4117 msgid "    printf(\"New thread started\\en\");\n"
4118 msgstr "    printf(\"New thread started\\en\");\n"
4119
4120 #. type: Plain text
4121 #: build/C/man3/pthread_cleanup_push.3:257
4122 #, no-wrap
4123 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4124 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4125
4126 #. type: Plain text
4127 #: build/C/man3/pthread_cleanup_push.3:259
4128 #, no-wrap
4129 msgid "    curr = start = time(NULL);\n"
4130 msgstr "    curr = start = time(NULL);\n"
4131
4132 #. type: Plain text
4133 #: build/C/man3/pthread_cleanup_push.3:268
4134 #, no-wrap
4135 msgid ""
4136 "    while (!done) {\n"
4137 "        pthread_testcancel();           /* A cancellation point */\n"
4138 "        if (curr E<lt> time(NULL)) {\n"
4139 "            curr = time(NULL);\n"
4140 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4141 "            cnt++;\n"
4142 "        }\n"
4143 "    }\n"
4144 msgstr ""
4145 "    while (!done) {\n"
4146 "        pthread_testcancel();           /* A cancellation point */\n"
4147 "        if (curr E<lt> time(NULL)) {\n"
4148 "            curr = time(NULL);\n"
4149 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4150 "            cnt++;\n"
4151 "        }\n"
4152 "    }\n"
4153
4154 #. type: Plain text
4155 #: build/C/man3/pthread_cleanup_push.3:272
4156 #, no-wrap
4157 msgid ""
4158 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4159 "    return NULL;\n"
4160 "}\n"
4161 msgstr ""
4162 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4163 "    return NULL;\n"
4164 "}\n"
4165
4166 #. type: Plain text
4167 #: build/C/man3/pthread_cleanup_push.3:279
4168 #, no-wrap
4169 msgid ""
4170 "int\n"
4171 "main(int argc, char *argv[])\n"
4172 "{\n"
4173 "    pthread_t thr;\n"
4174 "    int s;\n"
4175 "    void *res;\n"
4176 msgstr ""
4177 "int\n"
4178 "main(int argc, char *argv[])\n"
4179 "{\n"
4180 "    pthread_t thr;\n"
4181 "    int s;\n"
4182 "    void *res;\n"
4183
4184 #. type: Plain text
4185 #: build/C/man3/pthread_cleanup_push.3:283
4186 #, no-wrap
4187 msgid ""
4188 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4189 "    if (s != 0)\n"
4190 "        handle_error_en(s, \"pthread_create\");\n"
4191 msgstr ""
4192 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4193 "    if (s != 0)\n"
4194 "        handle_error_en(s, \"pthread_create\");\n"
4195
4196 #. type: Plain text
4197 #: build/C/man3/pthread_cleanup_push.3:285
4198 #, no-wrap
4199 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
4200 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
4201
4202 #. type: Plain text
4203 #: build/C/man3/pthread_cleanup_push.3:290
4204 #, no-wrap
4205 msgid ""
4206 "    if (argc E<gt> 1) {\n"
4207 "        if (argc E<gt> 2)\n"
4208 "            cleanup_pop_arg = atoi(argv[2]);\n"
4209 "        done = 1;\n"
4210 msgstr ""
4211 "    if (argc E<gt> 1) {\n"
4212 "        if (argc E<gt> 2)\n"
4213 "            cleanup_pop_arg = atoi(argv[2]);\n"
4214 "        done = 1;\n"
4215
4216 #. type: Plain text
4217 #: build/C/man3/pthread_cleanup_push.3:297
4218 #, no-wrap
4219 msgid ""
4220 "    } else {\n"
4221 "        printf(\"Canceling thread\\en\");\n"
4222 "        s = pthread_cancel(thr);\n"
4223 "        if (s != 0)\n"
4224 "            handle_error_en(s, \"pthread_cancel\");\n"
4225 "    }\n"
4226 msgstr ""
4227 "    } else {\n"
4228 "        printf(\"Canceling thread\\en\");\n"
4229 "        s = pthread_cancel(thr);\n"
4230 "        if (s != 0)\n"
4231 "            handle_error_en(s, \"pthread_cancel\");\n"
4232 "    }\n"
4233
4234 #. type: Plain text
4235 #: build/C/man3/pthread_cleanup_push.3:308
4236 #, no-wrap
4237 msgid ""
4238 "    if (res == PTHREAD_CANCELED)\n"
4239 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4240 "    else\n"
4241 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4242 "    exit(EXIT_SUCCESS);\n"
4243 "}\n"
4244 msgstr ""
4245 "    if (res == PTHREAD_CANCELED)\n"
4246 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4247 "    else\n"
4248 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4249 "    exit(EXIT_SUCCESS);\n"
4250 "}\n"
4251
4252 #. type: Plain text
4253 #: build/C/man3/pthread_cleanup_push.3:315
4254 msgid ""
4255 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4256 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4257 msgstr ""
4258 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4259 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4260
4261 #. type: TH
4262 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
4263 #, no-wrap
4264 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4265 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4266
4267 #. type: TH
4268 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
4269 #, no-wrap
4270 msgid "2008-12-04"
4271 msgstr "2008-12-04"
4272
4273 #. type: Plain text
4274 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
4275 msgid ""
4276 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
4277 "thread cancellation clean-up handlers while saving cancelability type"
4278 msgstr ""
4279
4280 #. type: Plain text
4281 #: build/C/man3/pthread_cleanup_push_defer_np.3:35
4282 #, no-wrap
4283 msgid ""
4284 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4285 "B<                                   void *>I<arg>B<);>\n"
4286 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4287 msgstr ""
4288 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4289 "B<                                   void *>I<arg>B<);>\n"
4290 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4291
4292 #. type: Plain text
4293 #: build/C/man3/pthread_cleanup_push_defer_np.3:38
4294 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
4295 #: build/C/man3/pthread_join.3:35 build/C/man3/pthread_kill.3:35
4296 #: build/C/man3/pthread_sigmask.3:36 build/C/man3/pthread_sigqueue.3:35
4297 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
4298 msgid "Compile and link with I<-pthread>."
4299 msgstr ""
4300
4301 #. type: Plain text
4302 #: build/C/man3/pthread_cleanup_push_defer_np.3:44
4303 msgid ""
4304 "These functions are the same as B<pthread_cleanup_push>(3)  and "
4305 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
4306 msgstr ""
4307
4308 #. type: Plain text
4309 #: build/C/man3/pthread_cleanup_push_defer_np.3:57
4310 msgid ""
4311 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
4312 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
4313 "addition, it also saves the thread's current cancelability type, and sets "
4314 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
4315 "this ensures that cancellation clean-up will occur even if the thread's "
4316 "cancelability type was \"asynchronous\" before the call."
4317 msgstr ""
4318
4319 #. type: Plain text
4320 #: build/C/man3/pthread_cleanup_push_defer_np.3:66
4321 msgid ""
4322 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
4323 "the top-most clean-up handler from the thread's stack of cancellation clean-"
4324 "up handlers.  In addition, it restores the thread's cancelability type to "
4325 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
4326 msgstr ""
4327
4328 #. type: Plain text
4329 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
4330 msgid ""
4331 "The caller must ensure that calls to these functions are paired within the "
4332 "same function, and at the same lexical nesting level.  Other restrictions "
4333 "apply, as described in B<pthread_cleanup_push>(3)."
4334 msgstr ""
4335
4336 #. type: Plain text
4337 #: build/C/man3/pthread_cleanup_push_defer_np.3:74
4338 msgid "This sequence of calls:"
4339 msgstr ""
4340
4341 #. type: Plain text
4342 #: build/C/man3/pthread_cleanup_push_defer_np.3:79
4343 #, no-wrap
4344 msgid ""
4345 "pthread_cleanup_push_defer_np(routine, arg);\n"
4346 "pthread_cleanup_pop_restore_np(execute);\n"
4347 msgstr ""
4348
4349 #. type: Plain text
4350 #: build/C/man3/pthread_cleanup_push_defer_np.3:83
4351 msgid "is equivalent to (but shorter and more efficient than):"
4352 msgstr ""
4353
4354 #. type: Plain text
4355 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
4356 #, no-wrap
4357 msgid "int oldtype;\n"
4358 msgstr "int oldtype;\n"
4359
4360 #. type: Plain text
4361 #: build/C/man3/pthread_cleanup_push_defer_np.3:95
4362 #, no-wrap
4363 msgid ""
4364 "pthread_cleanup_push(routine, arg);\n"
4365 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4366 "\\&...\n"
4367 "pthread_setcanceltype(oldtype, NULL);\n"
4368 "pthread_cleanup_pop(execute);\n"
4369 msgstr ""
4370 "pthread_cleanup_push(routine, arg);\n"
4371 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4372 "\\&...\n"
4373 "pthread_setcanceltype(oldtype, NULL);\n"
4374 "pthread_cleanup_pop(execute);\n"
4375
4376 #. type: Plain text
4377 #: build/C/man3/pthread_cleanup_push_defer_np.3:108
4378 msgid ""
4379 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
4380 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4381 msgstr ""
4382 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
4383 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4384
4385 #. type: TH
4386 #: build/C/man3/pthread_create.3:24
4387 #, no-wrap
4388 msgid "PTHREAD_CREATE"
4389 msgstr "PTHREAD_CREATE"
4390
4391 #. type: Plain text
4392 #: build/C/man3/pthread_create.3:27
4393 msgid "pthread_create - create a new thread"
4394 msgstr "pthread_create - 新しいスレッドを作成する"
4395
4396 #. type: Plain text
4397 #: build/C/man3/pthread_create.3:33
4398 #, no-wrap
4399 msgid ""
4400 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4401 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4402 msgstr ""
4403 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4404 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4405
4406 #. type: Plain text
4407 #: build/C/man3/pthread_create.3:45
4408 msgid ""
4409 "The B<pthread_create>()  function starts a new thread in the calling "
4410 "process.  The new thread starts execution by invoking I<start_routine>(); "
4411 "I<arg> is passed as the sole argument of I<start_routine>()."
4412 msgstr ""
4413
4414 #. type: Plain text
4415 #: build/C/man3/pthread_create.3:47
4416 msgid "The new thread terminates in one of the following ways:"
4417 msgstr ""
4418
4419 #. type: IP
4420 #: build/C/man3/pthread_create.3:47 build/C/man3/pthread_create.3:53
4421 #: build/C/man3/pthread_create.3:61 build/C/man3/pthread_create.3:64
4422 #: build/C/man3/pthread_getattr_np.3:50 build/C/man3/pthread_getattr_np.3:53
4423 #: build/C/man3/pthread_getattr_np.3:56
4424 #, no-wrap
4425 msgid "*"
4426 msgstr "*"
4427
4428 #. type: Plain text
4429 #: build/C/man3/pthread_create.3:53
4430 msgid ""
4431 "It calls B<pthread_exit>(3), specifying an exit status value that is "
4432 "available to another thread in the same process that calls B<pthread_join>"
4433 "(3)."
4434 msgstr ""
4435
4436 #. type: Plain text
4437 #: build/C/man3/pthread_create.3:61
4438 msgid ""
4439 "It returns from I<start_routine>().  This is equivalent to calling "
4440 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
4441 msgstr ""
4442
4443 #. type: Plain text
4444 #: build/C/man3/pthread_create.3:64
4445 msgid "It is canceled (see B<pthread_cancel>(3))."
4446 msgstr ""
4447
4448 #. type: Plain text
4449 #: build/C/man3/pthread_create.3:70
4450 msgid ""
4451 "Any of the threads in the process calls B<exit>(3), or the main thread "
4452 "performs a return from I<main>().  This causes the termination of all "
4453 "threads in the process."
4454 msgstr ""
4455
4456 #. type: Plain text
4457 #: build/C/man3/pthread_create.3:84
4458 msgid ""
4459 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4460 "are used at thread creation time to determine attributes for the new thread; "
4461 "this structure is initialized using B<pthread_attr_init>(3)  and related "
4462 "functions.  If I<attr> is NULL, then the thread is created with default "
4463 "attributes."
4464 msgstr ""
4465
4466 #. type: Plain text
4467 #: build/C/man3/pthread_create.3:91
4468 msgid ""
4469 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
4470 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4471 "used to refer to the thread in subsequent calls to other pthreads functions."
4472 msgstr ""
4473
4474 #. type: Plain text
4475 #: build/C/man3/pthread_create.3:99
4476 msgid ""
4477 "The new thread inherits a copy of the creating thread's signal mask "
4478 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
4479 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
4480 "thread's alternate signal stack (B<sigaltstack>(2))."
4481 msgstr ""
4482
4483 #. type: Plain text
4484 #: build/C/man3/pthread_create.3:102
4485 msgid ""
4486 "The new thread inherits the calling thread's floating-point environment "
4487 "(B<fenv>(3))."
4488 msgstr ""
4489
4490 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4491 #. type: Plain text
4492 #: build/C/man3/pthread_create.3:107
4493 msgid ""
4494 "The initial value of the new thread's CPU-time clock is 0 (see "
4495 "B<pthread_getcpuclockid>(3))."
4496 msgstr ""
4497
4498 #. type: SS
4499 #: build/C/man3/pthread_create.3:107
4500 #, no-wrap
4501 msgid "Linux-specific details"
4502 msgstr ""
4503
4504 #. type: Plain text
4505 #: build/C/man3/pthread_create.3:113
4506 msgid ""
4507 "The new thread inherits copies of the calling thread's capability sets (see "
4508 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4509 msgstr ""
4510
4511 #. type: Plain text
4512 #: build/C/man3/pthread_create.3:120
4513 msgid ""
4514 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
4515 "number, and the contents of I<*thread> are undefined."
4516 msgstr ""
4517
4518 #. type: TP
4519 #: build/C/man3/pthread_create.3:121 build/C/man3/pthread_sigqueue.3:69
4520 #, no-wrap
4521 msgid "B<EAGAIN>"
4522 msgstr "B<EAGAIN>"
4523
4524 #. type: Plain text
4525 #: build/C/man3/pthread_create.3:135
4526 msgid ""
4527 "Insufficient resources to create another thread, or a system-imposed limit "
4528 "on the number of threads was encountered.  The latter case may occur in two "
4529 "ways: the B<RLIMIT_NPROC> soft resource limit (set via B<setrlimit>(2)), "
4530 "which limits the number of process for a real user ID, was reached; or the "
4531 "kernel's system-wide limit on the number of threads, I</proc/sys/kernel/"
4532 "threads-max>, was reached."
4533 msgstr ""
4534
4535 #. type: Plain text
4536 #: build/C/man3/pthread_create.3:139
4537 msgid "Invalid settings in I<attr>."
4538 msgstr ""
4539
4540 #. type: TP
4541 #: build/C/man3/pthread_create.3:139 build/C/man3/pthread_setschedparam.3:127
4542 #: build/C/man3/pthread_setschedprio.3:64
4543 #, no-wrap
4544 msgid "B<EPERM>"
4545 msgstr "B<EPERM>"
4546
4547 #. type: Plain text
4548 #: build/C/man3/pthread_create.3:144
4549 msgid ""
4550 "No permission to set the scheduling policy and parameters specified in "
4551 "I<attr>."
4552 msgstr ""
4553
4554 #. type: Plain text
4555 #: build/C/man3/pthread_create.3:158
4556 msgid ""
4557 "See B<pthread_self>(3)  for further information on the thread ID returned in "
4558 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
4559 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4560 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4561 msgstr ""
4562
4563 #. type: Plain text
4564 #: build/C/man3/pthread_create.3:178
4565 msgid ""
4566 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
4567 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
4568 "terminate and fetch its exit status.  Only when a terminated joinable thread "
4569 "has been joined are the last of its resources released back to the system.  "
4570 "When a detached thread terminates, its resources are automatically released "
4571 "back to the system: it is not possible to join with the thread in order to "
4572 "obtain its exit status.  Making a thread detached is useful for some types "
4573 "of daemon threads whose exit status the application does not need to care "
4574 "about.  By default, a new thread is created in a joinable state, unless "
4575 "I<attr> was set to create the thread in a detached state (using "
4576 "B<pthread_attr_setdetachstate>(3))."
4577 msgstr ""
4578
4579 #.  FIXME . Perhaps some of the following detail should be in
4580 #.  a future pthread_attr_setstacksize(3) page.
4581 #. type: Plain text
4582 #: build/C/man3/pthread_create.3:194
4583 msgid ""
4584 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
4585 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
4586 "resource limit I<at the time the program started> has any value other than "
4587 "\"unlimited\", then it determines the default stack size of new threads.  "
4588 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
4589 "explicitly set in the I<attr> argument used to create a thread, in order to "
4590 "obtain a stack size other than the default."
4591 msgstr ""
4592
4593 #. type: Plain text
4594 #: build/C/man3/pthread_create.3:200
4595 msgid ""
4596 "In the obsolete LinuxThreads implementation, each of the threads in a "
4597 "process has a different process ID.  This is in violation of the POSIX "
4598 "threads specification, and is the source of many other nonconformances to "
4599 "the standard; see B<pthreads>(7)."
4600 msgstr ""
4601
4602 #. type: Plain text
4603 #: build/C/man3/pthread_create.3:204
4604 msgid ""
4605 "The program below demonstrates the use of B<pthread_create>(), as well as a "
4606 "number of other functions in the pthreads API."
4607 msgstr ""
4608
4609 #. type: Plain text
4610 #: build/C/man3/pthread_create.3:209
4611 msgid ""
4612 "In the following run, on a system providing the NPTL threading "
4613 "implementation, the stack size defaults to the value given by the \"stack "
4614 "size\" resource limit:"
4615 msgstr ""
4616
4617 #. type: Plain text
4618 #: build/C/man3/pthread_create.3:221
4619 #, no-wrap
4620 msgid ""
4621 "$B< ulimit -s>\n"
4622 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
4623 "$B< ./a.out hola salut servus>\n"
4624 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4625 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4626 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4627 "Joined with thread 1; returned value was HOLA\n"
4628 "Joined with thread 2; returned value was SALUT\n"
4629 "Joined with thread 3; returned value was SERVUS\n"
4630 msgstr ""
4631 "$B< ulimit -s>\n"
4632 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
4633 "$B< ./a.out hola salut servus>\n"
4634 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4635 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4636 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4637 "Joined with thread 1; returned value was HOLA\n"
4638 "Joined with thread 2; returned value was SALUT\n"
4639 "Joined with thread 3; returned value was SERVUS\n"
4640
4641 #. type: Plain text
4642 #: build/C/man3/pthread_create.3:227
4643 msgid ""
4644 "In the next run, the program explicitly sets a stack size of 1MB (using "
4645 "B<pthread_attr_setstacksize>(3))  for the created threads:"
4646 msgstr ""
4647
4648 #. type: Plain text
4649 #: build/C/man3/pthread_create.3:237
4650 #, no-wrap
4651 msgid ""
4652 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4653 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4654 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4655 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4656 "Joined with thread 1; returned value was HOLA\n"
4657 "Joined with thread 2; returned value was SALUT\n"
4658 "Joined with thread 3; returned value was SERVUS\n"
4659 msgstr ""
4660 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4661 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4662 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4663 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4664 "Joined with thread 1; returned value was HOLA\n"
4665 "Joined with thread 2; returned value was SALUT\n"
4666 "Joined with thread 3; returned value was SERVUS\n"
4667
4668 #. type: Plain text
4669 #: build/C/man3/pthread_create.3:249
4670 #, no-wrap
4671 msgid ""
4672 "#include E<lt>pthread.hE<gt>\n"
4673 "#include E<lt>string.hE<gt>\n"
4674 "#include E<lt>stdio.hE<gt>\n"
4675 "#include E<lt>stdlib.hE<gt>\n"
4676 "#include E<lt>unistd.hE<gt>\n"
4677 "#include E<lt>errno.hE<gt>\n"
4678 "#include E<lt>ctype.hE<gt>\n"
4679 msgstr ""
4680 "#include E<lt>pthread.hE<gt>\n"
4681 "#include E<lt>string.hE<gt>\n"
4682 "#include E<lt>stdio.hE<gt>\n"
4683 "#include E<lt>stdlib.hE<gt>\n"
4684 "#include E<lt>unistd.hE<gt>\n"
4685 "#include E<lt>errno.hE<gt>\n"
4686 "#include E<lt>ctype.hE<gt>\n"
4687
4688 #. type: Plain text
4689 #: build/C/man3/pthread_create.3:255 build/C/man3/pthread_getcpuclockid.3:108
4690 #, no-wrap
4691 msgid ""
4692 "#define handle_error(msg) \\e\n"
4693 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4694 msgstr ""
4695 "#define handle_error(msg) \\e\n"
4696 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4697
4698 #. type: Plain text
4699 #: build/C/man3/pthread_create.3:261
4700 #, no-wrap
4701 msgid ""
4702 "struct thread_info {    /* Used as argument to thread_start() */\n"
4703 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4704 "    int       thread_num;       /* Application-defined thread # */\n"
4705 "    char     *argv_string;      /* From command-line argument */\n"
4706 "};\n"
4707 msgstr ""
4708 "struct thread_info {    /* Used as argument to thread_start() */\n"
4709 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4710 "    int       thread_num;       /* Application-defined thread # */\n"
4711 "    char     *argv_string;      /* From command-line argument */\n"
4712 "};\n"
4713
4714 #. type: Plain text
4715 #: build/C/man3/pthread_create.3:264
4716 #, no-wrap
4717 msgid ""
4718 "/* Thread start function: display address near top of our stack,\n"
4719 "   and return upper-cased copy of argv_string */\n"
4720 msgstr ""
4721 "/* Thread start function: display address near top of our stack,\n"
4722 "   and return upper-cased copy of argv_string */\n"
4723
4724 #. type: Plain text
4725 #: build/C/man3/pthread_create.3:270
4726 #, no-wrap
4727 msgid ""
4728 "static void *\n"
4729 "thread_start(void *arg)\n"
4730 "{\n"
4731 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
4732 "    char *uargv, *p;\n"
4733 msgstr ""
4734 "static void *\n"
4735 "thread_start(void *arg)\n"
4736 "{\n"
4737 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
4738 "    char *uargv, *p;\n"
4739
4740 #. type: Plain text
4741 #: build/C/man3/pthread_create.3:273
4742 #, no-wrap
4743 msgid ""
4744 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4745 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4746 msgstr ""
4747 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4748 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4749
4750 #. type: Plain text
4751 #: build/C/man3/pthread_create.3:277
4752 #, no-wrap
4753 msgid ""
4754 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4755 "    if (uargv == NULL)\n"
4756 "        handle_error(\"strdup\");\n"
4757 msgstr ""
4758 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4759 "    if (uargv == NULL)\n"
4760 "        handle_error(\"strdup\");\n"
4761
4762 #. type: Plain text
4763 #: build/C/man3/pthread_create.3:280
4764 #, no-wrap
4765 msgid ""
4766 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4767 "        *p = toupper(*p);\n"
4768 msgstr ""
4769 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4770 "        *p = toupper(*p);\n"
4771
4772 #. type: Plain text
4773 #: build/C/man3/pthread_create.3:283
4774 #, no-wrap
4775 msgid ""
4776 "    return uargv;\n"
4777 "}\n"
4778 msgstr ""
4779 "    return uargv;\n"
4780 "}\n"
4781
4782 #. type: Plain text
4783 #: build/C/man3/pthread_create.3:292
4784 #, no-wrap
4785 msgid ""
4786 "int\n"
4787 "main(int argc, char *argv[])\n"
4788 "{\n"
4789 "    int s, tnum, opt, num_threads;\n"
4790 "    struct thread_info *tinfo;\n"
4791 "    pthread_attr_t attr;\n"
4792 "    int stack_size;\n"
4793 "    void *res;\n"
4794 msgstr ""
4795 "int\n"
4796 "main(int argc, char *argv[])\n"
4797 "{\n"
4798 "    int s, tnum, opt, num_threads;\n"
4799 "    struct thread_info *tinfo;\n"
4800 "    pthread_attr_t attr;\n"
4801 "    int stack_size;\n"
4802 "    void *res;\n"
4803
4804 #. type: Plain text
4805 #: build/C/man3/pthread_create.3:294
4806 #, no-wrap
4807 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
4808 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
4809
4810 #. type: Plain text
4811 #: build/C/man3/pthread_create.3:301
4812 #, no-wrap
4813 msgid ""
4814 "    stack_size = -1;\n"
4815 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4816 "        switch (opt) {\n"
4817 "        case \\(aqs\\(aq:\n"
4818 "            stack_size = strtoul(optarg, NULL, 0);\n"
4819 "            break;\n"
4820 msgstr ""
4821 "    stack_size = -1;\n"
4822 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4823 "        switch (opt) {\n"
4824 "        case \\(aqs\\(aq:\n"
4825 "            stack_size = strtoul(optarg, NULL, 0);\n"
4826 "            break;\n"
4827
4828 #. type: Plain text
4829 #: build/C/man3/pthread_create.3:308
4830 #, no-wrap
4831 msgid ""
4832 "        default:\n"
4833 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4834 "                    argv[0]);\n"
4835 "            exit(EXIT_FAILURE);\n"
4836 "        }\n"
4837 "    }\n"
4838 msgstr ""
4839 "        default:\n"
4840 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4841 "                    argv[0]);\n"
4842 "            exit(EXIT_FAILURE);\n"
4843 "        }\n"
4844 "    }\n"
4845
4846 #. type: Plain text
4847 #: build/C/man3/pthread_create.3:310
4848 #, no-wrap
4849 msgid "    num_threads = argc - optind;\n"
4850 msgstr "    num_threads = argc - optind;\n"
4851
4852 #. type: Plain text
4853 #: build/C/man3/pthread_create.3:312
4854 #, no-wrap
4855 msgid "    /* Initialize thread creation attributes */\n"
4856 msgstr "    /* Initialize thread creation attributes */\n"
4857
4858 #. type: Plain text
4859 #: build/C/man3/pthread_create.3:316
4860 #, no-wrap
4861 msgid ""
4862 "    s = pthread_attr_init(&attr);\n"
4863 "    if (s != 0)\n"
4864 "        handle_error_en(s, \"pthread_attr_init\");\n"
4865 msgstr ""
4866 "    s = pthread_attr_init(&attr);\n"
4867 "    if (s != 0)\n"
4868 "        handle_error_en(s, \"pthread_attr_init\");\n"
4869
4870 #. type: Plain text
4871 #: build/C/man3/pthread_create.3:322
4872 #, no-wrap
4873 msgid ""
4874 "    if (stack_size E<gt> 0) {\n"
4875 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4876 "        if (s != 0)\n"
4877 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4878 "    }\n"
4879 msgstr ""
4880 "    if (stack_size E<gt> 0) {\n"
4881 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4882 "        if (s != 0)\n"
4883 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4884 "    }\n"
4885
4886 #. type: Plain text
4887 #: build/C/man3/pthread_create.3:324
4888 #, no-wrap
4889 msgid "    /* Allocate memory for pthread_create() arguments */\n"
4890 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
4891
4892 #. type: Plain text
4893 #: build/C/man3/pthread_create.3:328
4894 #, no-wrap
4895 msgid ""
4896 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4897 "    if (tinfo == NULL)\n"
4898 "        handle_error(\"calloc\");\n"
4899 msgstr ""
4900 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4901 "    if (tinfo == NULL)\n"
4902 "        handle_error(\"calloc\");\n"
4903
4904 #. type: Plain text
4905 #: build/C/man3/pthread_create.3:330
4906 #, no-wrap
4907 msgid "    /* Create one thread for each command-line argument */\n"
4908 msgstr "    /* Create one thread for each command-line argument */\n"
4909
4910 #. type: Plain text
4911 #: build/C/man3/pthread_create.3:334
4912 #, no-wrap
4913 msgid ""
4914 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4915 "        tinfo[tnum].thread_num = tnum + 1;\n"
4916 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4917 msgstr ""
4918 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4919 "        tinfo[tnum].thread_num = tnum + 1;\n"
4920 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4921
4922 #. type: Plain text
4923 #: build/C/man3/pthread_create.3:337
4924 #, no-wrap
4925 msgid ""
4926 "        /* The pthread_create() call stores the thread ID into\n"
4927 "           corresponding element of tinfo[] */\n"
4928 msgstr ""
4929 "        /* The pthread_create() call stores the thread ID into\n"
4930 "           corresponding element of tinfo[] */\n"
4931
4932 #. type: Plain text
4933 #: build/C/man3/pthread_create.3:343
4934 #, no-wrap
4935 msgid ""
4936 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4937 "                           &thread_start, &tinfo[tnum]);\n"
4938 "        if (s != 0)\n"
4939 "            handle_error_en(s, \"pthread_create\");\n"
4940 "    }\n"
4941 msgstr ""
4942 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4943 "                           &thread_start, &tinfo[tnum]);\n"
4944 "        if (s != 0)\n"
4945 "            handle_error_en(s, \"pthread_create\");\n"
4946 "    }\n"
4947
4948 #. type: Plain text
4949 #: build/C/man3/pthread_create.3:346
4950 #, no-wrap
4951 msgid ""
4952 "    /* Destroy the thread attributes object, since it is no\n"
4953 "       longer needed */\n"
4954 msgstr ""
4955 "    /* Destroy the thread attributes object, since it is no\n"
4956 "       longer needed */\n"
4957
4958 #. type: Plain text
4959 #: build/C/man3/pthread_create.3:350 build/C/man3/pthread_setschedparam.3:421
4960 #, no-wrap
4961 msgid ""
4962 "    s = pthread_attr_destroy(&attr);\n"
4963 "    if (s != 0)\n"
4964 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4965 msgstr ""
4966 "    s = pthread_attr_destroy(&attr);\n"
4967 "    if (s != 0)\n"
4968 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4969
4970 #. type: Plain text
4971 #: build/C/man3/pthread_create.3:352
4972 #, no-wrap
4973 msgid "    /* Now join with each thread, and display its returned value */\n"
4974 msgstr "    /* Now join with each thread, and display its returned value */\n"
4975
4976 #. type: Plain text
4977 #: build/C/man3/pthread_create.3:357
4978 #, no-wrap
4979 msgid ""
4980 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4981 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4982 "        if (s != 0)\n"
4983 "            handle_error_en(s, \"pthread_join\");\n"
4984 msgstr ""
4985 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4986 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4987 "        if (s != 0)\n"
4988 "            handle_error_en(s, \"pthread_join\");\n"
4989
4990 #. type: Plain text
4991 #: build/C/man3/pthread_create.3:362
4992 #, no-wrap
4993 msgid ""
4994 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4995 "                tinfo[tnum].thread_num, (char *) res);\n"
4996 "        free(res);      /* Free memory allocated by thread */\n"
4997 "    }\n"
4998 msgstr ""
4999 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5000 "                tinfo[tnum].thread_num, (char *) res);\n"
5001 "        free(res);      /* Free memory allocated by thread */\n"
5002 "    }\n"
5003
5004 #. type: Plain text
5005 #: build/C/man3/pthread_create.3:366
5006 #, no-wrap
5007 msgid ""
5008 "    free(tinfo);\n"
5009 "    exit(EXIT_SUCCESS);\n"
5010 "}\n"
5011 msgstr ""
5012 "    free(tinfo);\n"
5013 "    exit(EXIT_SUCCESS);\n"
5014 "}\n"
5015
5016 #. type: Plain text
5017 #: build/C/man3/pthread_create.3:378
5018 msgid ""
5019 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5020 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5021 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
5022 "(7)"
5023 msgstr ""
5024 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5025 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5026 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
5027 "(7)"
5028
5029 #. type: TH
5030 #: build/C/man3/pthread_detach.3:24
5031 #, no-wrap
5032 msgid "PTHREAD_DETACH"
5033 msgstr "PTHREAD_DETACH"
5034
5035 #. type: TH
5036 #: build/C/man3/pthread_detach.3:24 build/C/man3/pthread_join.3:24
5037 #, no-wrap
5038 msgid "2008-11-27"
5039 msgstr "2008-11-27"
5040
5041 #. type: Plain text
5042 #: build/C/man3/pthread_detach.3:27
5043 msgid "pthread_detach - detach a thread"
5044 msgstr "pthread_detach - スレッドを切り離す"
5045
5046 #. type: Plain text
5047 #: build/C/man3/pthread_detach.3:32
5048 #, no-wrap
5049 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5050 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5051
5052 #. type: Plain text
5053 #: build/C/man3/pthread_detach.3:44
5054 msgid ""
5055 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
5056 "as detached.  When a detached thread terminates, its resources are "
5057 "automatically released back to the system without the need for another "
5058 "thread to join with the terminated thread."
5059 msgstr ""
5060
5061 #. type: Plain text
5062 #: build/C/man3/pthread_detach.3:47
5063 msgid ""
5064 "Attempting to detach an already detached thread results in unspecified "
5065 "behavior."
5066 msgstr ""
5067
5068 #. type: Plain text
5069 #: build/C/man3/pthread_detach.3:52
5070 msgid ""
5071 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
5072 "number."
5073 msgstr ""
5074
5075 #. type: Plain text
5076 #: build/C/man3/pthread_detach.3:57 build/C/man3/pthread_join.3:87
5077 msgid "I<thread> is not a joinable thread."
5078 msgstr ""
5079
5080 #. type: Plain text
5081 #: build/C/man3/pthread_detach.3:68
5082 msgid ""
5083 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
5084 "or be made joinable again."
5085 msgstr ""
5086
5087 #. type: Plain text
5088 #: build/C/man3/pthread_detach.3:75
5089 msgid ""
5090 "A new thread can be created in a detached state using "
5091 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
5092 "I<attr> argument of B<pthread_create>(3)."
5093 msgstr ""
5094
5095 #. type: Plain text
5096 #: build/C/man3/pthread_detach.3:82
5097 msgid ""
5098 "The detached attribute merely determines the behavior of the system when the "
5099 "thread terminates; it does not prevent the thread from being terminated if "
5100 "the process terminates using B<exit>(3)  (or equivalently, if the main "
5101 "thread returns)."
5102 msgstr ""
5103
5104 #. type: Plain text
5105 #: build/C/man3/pthread_detach.3:91
5106 msgid ""
5107 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
5108 "thread that an application creates, so that system resources for the thread "
5109 "can be released.  (But note that the resources of all threads are freed when "
5110 "the process terminates.)"
5111 msgstr ""
5112
5113 #. type: Plain text
5114 #: build/C/man3/pthread_detach.3:93
5115 msgid "The following statement detaches the calling thread:"
5116 msgstr ""
5117
5118 #. type: Plain text
5119 #: build/C/man3/pthread_detach.3:95
5120 #, no-wrap
5121 msgid "    pthread_detach(pthread_self());\n"
5122 msgstr "    pthread_detach(pthread_self());\n"
5123
5124 #. type: Plain text
5125 #: build/C/man3/pthread_detach.3:102
5126 msgid ""
5127 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
5128 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5129 msgstr ""
5130 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
5131 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5132
5133 #. type: TH
5134 #: build/C/man3/pthread_equal.3:24
5135 #, no-wrap
5136 msgid "PTHREAD_EQUAL"
5137 msgstr "PTHREAD_EQUAL"
5138
5139 #. type: TH
5140 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
5141 #, no-wrap
5142 msgid "2009-03-30"
5143 msgstr "2009-03-30"
5144
5145 #. type: Plain text
5146 #: build/C/man3/pthread_equal.3:27
5147 msgid "pthread_equal - compare thread IDs"
5148 msgstr "pthread_equal - スレッド ID を比較する"
5149
5150 #. type: Plain text
5151 #: build/C/man3/pthread_equal.3:32
5152 #, no-wrap
5153 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5154 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5155
5156 #. type: Plain text
5157 #: build/C/man3/pthread_equal.3:39
5158 msgid "The B<pthread_equal>()  function compares two thread identifiers."
5159 msgstr "B<pthread_equal>() 関数は 2 つのスレッド識別子の比較を行う。"
5160
5161 #. type: Plain text
5162 #: build/C/man3/pthread_equal.3:43
5163 msgid ""
5164 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
5165 "value; otherwise, it returns 0."
5166 msgstr ""
5167 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
5168 "そうでなければ 0 を返す。"
5169
5170 #.  SH VERSIONS
5171 #.  Available since glibc 2.0
5172 #. type: Plain text
5173 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
5174 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_testcancel.3:56
5175 msgid "This function always succeeds."
5176 msgstr "この関数は常に成功する。"
5177
5178 #. type: Plain text
5179 #: build/C/man3/pthread_equal.3:54
5180 msgid ""
5181 "The B<pthread_equal>()  function is necessary because thread IDs should be "
5182 "considered opaque: there is no portable way for applications to directly "
5183 "compare two I<pthread_t> values."
5184 msgstr ""
5185 "B<pthread_equal>() 関数が必要なのは、\n"
5186 "スレッド ID はその内部構造を意識すべきではないためである。\n"
5187 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
5188 "移植性を確保できる形で比較する方法はない。"
5189
5190 #. type: Plain text
5191 #: build/C/man3/pthread_equal.3:58
5192 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5193 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5194
5195 #. type: TH
5196 #: build/C/man3/pthread_exit.3:24
5197 #, no-wrap
5198 msgid "PTHREAD_EXIT"
5199 msgstr "PTHREAD_EXIT"
5200
5201 #. type: Plain text
5202 #: build/C/man3/pthread_exit.3:27
5203 msgid "pthread_exit - terminate calling thread"
5204 msgstr "pthread_exit - 呼び出したスレッドを終了する"
5205
5206 #. type: Plain text
5207 #: build/C/man3/pthread_exit.3:32
5208 #, no-wrap
5209 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
5210 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
5211
5212 #. type: Plain text
5213 #: build/C/man3/pthread_exit.3:43
5214 msgid ""
5215 "The B<pthread_exit>()  function terminates the calling thread and returns a "
5216 "value via I<retval> that (if the thread is joinable)  is available to "
5217 "another thread in the same process that calls B<pthread_join>(3)."
5218 msgstr ""
5219
5220 #. type: Plain text
5221 #: build/C/man3/pthread_exit.3:53
5222 msgid ""
5223 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
5224 "not yet been popped, are popped (in the reverse of the order in which they "
5225 "were pushed)  and executed.  If the thread has any thread-specific data, "
5226 "then, after the clean-up handlers have been executed, the corresponding "
5227 "destructor functions are called, in an unspecified order."
5228 msgstr ""
5229
5230 #. type: Plain text
5231 #: build/C/man3/pthread_exit.3:60
5232 msgid ""
5233 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
5234 "variables, semaphores, and file descriptors) are not released, and functions "
5235 "registered using B<atexit>(3)  are not called."
5236 msgstr ""
5237
5238 #. type: Plain text
5239 #: build/C/man3/pthread_exit.3:69
5240 msgid ""
5241 "After the last thread in a process terminates, the process terminates as by "
5242 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
5243 "resources are released and functions registered using B<atexit>(3)  are "
5244 "called."
5245 msgstr ""
5246
5247 #. type: Plain text
5248 #: build/C/man3/pthread_exit.3:71
5249 msgid "This function does not return to the caller."
5250 msgstr ""
5251
5252 #. type: Plain text
5253 #: build/C/man3/pthread_exit.3:80
5254 msgid ""
5255 "Performing a return from the start function of any thread other than the "
5256 "main thread results in an implicit call to B<pthread_exit>(), using the "
5257 "function's return value as the thread's exit status."
5258 msgstr ""
5259
5260 #. type: Plain text
5261 #: build/C/man3/pthread_exit.3:86
5262 msgid ""
5263 "To allow other threads to continue execution, the main thread should "
5264 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
5265 msgstr ""
5266
5267 #. type: Plain text
5268 #: build/C/man3/pthread_exit.3:91
5269 msgid ""
5270 "The value pointed to by I<retval> should not be located on the calling "
5271 "thread's stack, since the contents of that stack are undefined after the "
5272 "thread terminates."
5273 msgstr ""
5274
5275 #.  Linux 2.6.27
5276 #.  FIXME . review a later kernel to see if this gets fixed
5277 #.  http://thread.gmane.org/gmane.linux.kernel/611611
5278 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
5279 #. type: Plain text
5280 #: build/C/man3/pthread_exit.3:103
5281 msgid ""
5282 "Currently, there are limitations in the kernel implementation logic for "
5283 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
5284 "This can manifest in problems such as a locked terminal if a stop signal is "
5285 "sent to a foreground process whose thread group leader has already called "
5286 "B<pthread_exit>()."
5287 msgstr ""
5288
5289 #. type: Plain text
5290 #: build/C/man3/pthread_exit.3:107
5291 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5292 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5293
5294 #. type: TH
5295 #: build/C/man3/pthread_getattr_np.3:24
5296 #, no-wrap
5297 msgid "PTHREAD_GETATTR_NP"
5298 msgstr "PTHREAD_GETATTR_NP"
5299
5300 #. type: Plain text
5301 #: build/C/man3/pthread_getattr_np.3:27
5302 msgid "pthread_getattr_np - get attributes of created thread"
5303 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
5304
5305 #. type: Plain text
5306 #: build/C/man3/pthread_getattr_np.3:33
5307 #, no-wrap
5308 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5309 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5310
5311 #. type: Plain text
5312 #: build/C/man3/pthread_getattr_np.3:43
5313 msgid ""
5314 "The B<pthread_getattr_np>()  function initializes the thread attributes "
5315 "object referred to by I<attr> so that it contains actual attribute values "
5316 "describing the running thread I<thread>."
5317 msgstr ""
5318 "B<pthread_getattr_np>() 関数は、\n"
5319 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
5320 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
5321 "格納して返す。"
5322
5323 #. type: Plain text
5324 #: build/C/man3/pthread_getattr_np.3:50
5325 msgid ""
5326 "The returned attribute values may differ from the corresponding attribute "
5327 "values passed in the I<attr> object that was used to create the thread using "
5328 "B<pthread_create>(3).  In particular, the following attributes may differ:"
5329 msgstr ""
5330 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
5331 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
5332 "特に、以下の属性は異なる場合がある。"
5333
5334 #. type: Plain text
5335 #: build/C/man3/pthread_getattr_np.3:53
5336 msgid ""
5337 "the detach state, since a joinable thread may have detached itself after "
5338 "creation;"
5339 msgstr ""
5340 "detach state. join 可能なスレッドは作成後に自分自身を\n"
5341 "切り離す (detach する) ことができるからである。"
5342
5343 #. type: Plain text
5344 #: build/C/man3/pthread_getattr_np.3:56
5345 msgid ""
5346 "the stack size, which the implementation may align to a suitable boundary."
5347 msgstr ""
5348 "スタックサイズ。\n"
5349 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
5350
5351 #. type: Plain text
5352 #: build/C/man3/pthread_getattr_np.3:61
5353 msgid ""
5354 "and the guard size, which the implementation may round upward to a multiple "
5355 "of the page size, or ignore (i.e., treat as 0), if the application is "
5356 "allocating its own stack."
5357 msgstr ""
5358 "guard size.\n"
5359 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
5360 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
5361 "(0 として扱われる) ことがあるからである。"
5362
5363 #. type: Plain text
5364 #: build/C/man3/pthread_getattr_np.3:66
5365 msgid ""
5366 "Furthermore, if the stack address attribute was not set in the thread "
5367 "attributes object used to create the thread, then the returned thread "
5368 "attributes object will report the actual stack address that the "
5369 "implementation selected for the thread."
5370 msgstr ""
5371 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
5372 "スタックアドレスが設定されていなかった場合、\n"
5373 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
5374 "割り当てた実際のスタックアドレスが報告される。"
5375
5376 #. type: Plain text
5377 #: build/C/man3/pthread_getattr_np.3:71
5378 msgid ""
5379 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
5380 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
5381 msgstr ""
5382 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
5383 "必要なくなった際には、  B<pthread_attr_destroy>(3) を使って\n"
5384 "そのオブジェクトを破棄すべきである。"
5385
5386 #. type: Plain text
5387 #: build/C/man3/pthread_getattr_np.3:74
5388 #: build/C/man3/pthread_getcpuclockid.3:47
5389 msgid ""
5390 "On success, this function returns 0; on error, it returns a nonzero error "
5391 "number."
5392 msgstr ""
5393 "成功すると、この関数は 0 を返す。\n"
5394 "エラーの場合、 0 以外のエラー番号を返す。"
5395
5396 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
5397 #. type: Plain text
5398 #: build/C/man3/pthread_getattr_np.3:79
5399 msgid "Insufficient memory."
5400 msgstr "メモリが十分になかった。"
5401
5402 #. type: Plain text
5403 #: build/C/man3/pthread_getattr_np.3:94
5404 msgid ""
5405 "In addition, if I<thread> refers to the main thread, then "
5406 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
5407 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and B<getrlimit>"
5408 "(2), if the B<RLIMIT_STACK> resource limit is not supported."
5409 msgstr ""
5410 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
5411 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
5412 "エラーで失敗する可能性がある。\n"
5413 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
5414 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
5415 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
5416
5417 #. type: Plain text
5418 #: build/C/man3/pthread_getattr_np.3:96
5419 msgid "This function is available in glibc since version 2.2.3."
5420 msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。"
5421
5422 #. type: Plain text
5423 #: build/C/man3/pthread_getattr_np.3:99
5424 #: build/C/man3/pthread_kill_other_threads_np.3:48
5425 msgid ""
5426 "This function is a nonstandard GNU extension; hence the suffix \"_np"
5427 "\" (nonportable) in the name."
5428 msgstr ""
5429 "この関数は非標準の GNU による拡張である。\n"
5430 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
5431 "付いている。"
5432
5433 #. type: Plain text
5434 #: build/C/man3/pthread_getattr_np.3:109
5435 msgid ""
5436 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
5437 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
5438 "and display its guard size, stack address, and stack size attributes.  "
5439 "Command-line arguments can be used to set these attributes to values other "
5440 "than the default when creating the thread.  The shell sessions below "
5441 "demonstrate the use of the program."
5442 msgstr ""
5443 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
5444 "このプログラムは、スレッドを作成し、それから\n"
5445 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
5446 "スタックアドレス、スタックサイズを取得し表示する。\n"
5447 "コマンドライン引き数での指定で、スレッドを作成する際に\n"
5448 "上記の属性にデフォルト値以外の値を設定することができる。\n"
5449 "下記のシェルのセッションはこのプログラムの使用例である。"
5450
5451 #. type: Plain text
5452 #: build/C/man3/pthread_getattr_np.3:112
5453 msgid ""
5454 "In the first run, on an x86-32 system, a thread is created using default "
5455 "attributes:"
5456 msgstr ""
5457 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
5458 "(x86-32 システム上で実行)。"
5459
5460 #. type: Plain text
5461 #: build/C/man3/pthread_getattr_np.3:122
5462 #, no-wrap
5463 msgid ""
5464 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5465 "unlimited\n"
5466 "$B< ./a.out>\n"
5467 "Attributes of created thread:\n"
5468 "        Guard size          = 4096 bytes\n"
5469 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5470 "        Stack size          = 0x201000 (2101248) bytes\n"
5471 msgstr ""
5472 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5473 "unlimited\n"
5474 "$B< ./a.out>\n"
5475 "Attributes of created thread:\n"
5476 "        Guard size          = 4096 bytes\n"
5477 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5478 "        Stack size          = 0x201000 (2101248) bytes\n"
5479
5480 #. type: Plain text
5481 #: build/C/man3/pthread_getattr_np.3:128
5482 msgid ""
5483 "In the following run, we see that if a guard size is specified, it is "
5484 "rounded up to the next multiple of the system page size (4096 bytes on "
5485 "x86-32):"
5486 msgstr ""
5487 "次の実行例では、guard size が指定された場合、\n"
5488 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
5489 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
5490
5491 #. type: Plain text
5492 #: build/C/man3/pthread_getattr_np.3:136
5493 #, no-wrap
5494 msgid ""
5495 "$B< ./a.out -g 4097>\n"
5496 "Thread attributes object after initializations:\n"
5497 "        Guard size          = 4097 bytes\n"
5498 "        Stack address       = (nil)\n"
5499 "        Stack size          = 0x0 (0) bytes\n"
5500 msgstr ""
5501 "$B< ./a.out -g 4097>\n"
5502 "Thread attributes object after initializations:\n"
5503 "        Guard size          = 4097 bytes\n"
5504 "        Stack address       = (nil)\n"
5505 "        Stack size          = 0x0 (0) bytes\n"
5506
5507 #. type: Plain text
5508 #: build/C/man3/pthread_getattr_np.3:141
5509 #, no-wrap
5510 msgid ""
5511 "Attributes of created thread:\n"
5512 "        Guard size          = 8192 bytes\n"
5513 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5514 "        Stack size          = 0x201000 (2101248) bytes\n"
5515 msgstr ""
5516 "Attributes of created thread:\n"
5517 "        Guard size          = 8192 bytes\n"
5518 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5519 "        Stack size          = 0x201000 (2101248) bytes\n"
5520
5521 #. .in +4n
5522 #. .nf
5523 #. $ ./a.out \-s 0x8000
5524 #. Thread attributes object after initializations:
5525 #.         Guard size          = 4096 bytes
5526 #.         Stack address       = 0xffff8000 (EOS = (nil))
5527 #.         Stack size          = 0x8000 (32768) bytes
5528 #. Attributes of created thread:
5529 #.         Guard size          = 4096 bytes
5530 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
5531 #.         Stack size          = 0x8000 (32768) bytes
5532 #. .fi
5533 #. .in
5534 #. type: Plain text
5535 #: build/C/man3/pthread_getattr_np.3:160
5536 msgid ""
5537 "In the last run, the program manually allocates a stack for the thread.  In "
5538 "this case, the guard size attribute is ignored."
5539 msgstr ""
5540 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
5541 "この場合には、guard size 属性は無視される。"
5542
5543 #. type: Plain text
5544 #: build/C/man3/pthread_getattr_np.3:165
5545 #, no-wrap
5546 msgid ""
5547 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5548 "Allocated thread stack at 0x804d000\n"
5549 msgstr ""
5550 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5551 "Allocated thread stack at 0x804d000\n"
5552
5553 #. type: Plain text
5554 #: build/C/man3/pthread_getattr_np.3:170
5555 #, no-wrap
5556 msgid ""
5557 "Thread attributes object after initializations:\n"
5558 "        Guard size          = 4096 bytes\n"
5559 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5560 "        Stack size          = 0x8000 (32768) bytes\n"
5561 msgstr ""
5562 "Thread attributes object after initializations:\n"
5563 "        Guard size          = 4096 bytes\n"
5564 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5565 "        Stack size          = 0x8000 (32768) bytes\n"
5566
5567 #. type: Plain text
5568 #: build/C/man3/pthread_getattr_np.3:175
5569 #, no-wrap
5570 msgid ""
5571 "Attributes of created thread:\n"
5572 "        Guard size          = 0 bytes\n"
5573 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5574 "        Stack size          = 0x8000 (32768) bytes\n"
5575 msgstr ""
5576 "Attributes of created thread:\n"
5577 "        Guard size          = 0 bytes\n"
5578 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5579 "        Stack size          = 0x8000 (32768) bytes\n"
5580
5581 #. type: Plain text
5582 #: build/C/man3/pthread_getattr_np.3:196
5583 #, no-wrap
5584 msgid ""
5585 "static void\n"
5586 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5587 "{\n"
5588 "    int s;\n"
5589 "    size_t stack_size, guard_size;\n"
5590 "    void *stack_addr;\n"
5591 msgstr ""
5592 "static void\n"
5593 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5594 "{\n"
5595 "    int s;\n"
5596 "    size_t stack_size, guard_size;\n"
5597 "    void *stack_addr;\n"
5598
5599 #. type: Plain text
5600 #: build/C/man3/pthread_getattr_np.3:201
5601 #, no-wrap
5602 msgid ""
5603 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5604 "    if (s != 0)\n"
5605 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5606 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5607 msgstr ""
5608 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5609 "    if (s != 0)\n"
5610 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5611 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5612
5613 #. type: Plain text
5614 #: build/C/man3/pthread_getattr_np.3:212
5615 #, no-wrap
5616 msgid ""
5617 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5618 "    if (s != 0)\n"
5619 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5620 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5621 "    if (stack_size E<gt> 0)\n"
5622 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5623 "    printf(\"\\en\");\n"
5624 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5625 "            prefix, stack_size, stack_size);\n"
5626 "}\n"
5627 msgstr ""
5628 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5629 "    if (s != 0)\n"
5630 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5631 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5632 "    if (stack_size E<gt> 0)\n"
5633 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5634 "    printf(\"\\en\");\n"
5635 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5636 "            prefix, stack_size, stack_size);\n"
5637 "}\n"
5638
5639 #. type: Plain text
5640 #: build/C/man3/pthread_getattr_np.3:218
5641 #, no-wrap
5642 msgid ""
5643 "static void\n"
5644 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5645 "{\n"
5646 "    int s;\n"
5647 "    pthread_attr_t attr;\n"
5648 msgstr ""
5649 "static void\n"
5650 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5651 "{\n"
5652 "    int s;\n"
5653 "    pthread_attr_t attr;\n"
5654
5655 #. type: Plain text
5656 #: build/C/man3/pthread_getattr_np.3:222
5657 #, no-wrap
5658 msgid ""
5659 "    s = pthread_getattr_np(thread, &attr);\n"
5660 "    if (s != 0)\n"
5661 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5662 msgstr ""
5663 "    s = pthread_getattr_np(thread, &attr);\n"
5664 "    if (s != 0)\n"
5665 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5666
5667 #. type: Plain text
5668 #: build/C/man3/pthread_getattr_np.3:224
5669 #, no-wrap
5670 msgid "    display_stack_related_attributes(&attr, prefix);\n"
5671 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
5672
5673 #. type: Plain text
5674 #: build/C/man3/pthread_getattr_np.3:229
5675 #, no-wrap
5676 msgid ""
5677 "    s = pthread_attr_destroy(&attr);\n"
5678 "    if (s != 0)\n"
5679 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5680 "}\n"
5681 msgstr ""
5682 "    s = pthread_attr_destroy(&attr);\n"
5683 "    if (s != 0)\n"
5684 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5685 "}\n"
5686
5687 #. type: Plain text
5688 #: build/C/man3/pthread_getattr_np.3:235
5689 #, no-wrap
5690 msgid ""
5691 "static void *           /* Start function for thread we create */\n"
5692 "thread_start(void *arg)\n"
5693 "{\n"
5694 "    printf(\"Attributes of created thread:\\en\");\n"
5695 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5696 msgstr ""
5697 "static void *           /* Start function for thread we create */\n"
5698 "thread_start(void *arg)\n"
5699 "{\n"
5700 "    printf(\"Attributes of created thread:\\en\");\n"
5701 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5702
5703 #. type: Plain text
5704 #: build/C/man3/pthread_getattr_np.3:249
5705 #, no-wrap
5706 msgid ""
5707 "static void\n"
5708 "usage(char *pname, char *msg)\n"
5709 "{\n"
5710 "    if (msg != NULL)\n"
5711 "        fputs(msg, stderr);\n"
5712 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5713 "            \" [-g guard-size]\\en\", pname);\n"
5714 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5715 "    exit(EXIT_FAILURE);\n"
5716 "}\n"
5717 msgstr ""
5718 "static void\n"
5719 "usage(char *pname, char *msg)\n"
5720 "{\n"
5721 "    if (msg != NULL)\n"
5722 "        fputs(msg, stderr);\n"
5723 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5724 "            \" [-g guard-size]\\en\", pname);\n"
5725 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5726 "    exit(EXIT_FAILURE);\n"
5727 "}\n"
5728
5729 #. type: Plain text
5730 #: build/C/man3/pthread_getattr_np.3:262
5731 #, no-wrap
5732 msgid ""
5733 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5734 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5735 "                              pthread_attr_t *attrp)\n"
5736 "{\n"
5737 "    int s, opt, allocate_stack;\n"
5738 "    long stack_size, guard_size;\n"
5739 "            void *stack_addr;\n"
5740 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
5741 "                                           a thread attributes object */\n"
5742 "    allocate_stack = 0;\n"
5743 "    stack_size = -1;\n"
5744 "    guard_size = -1;\n"
5745 msgstr ""
5746 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5747 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5748 "                              pthread_attr_t *attrp)\n"
5749 "{\n"
5750 "    int s, opt, allocate_stack;\n"
5751 "    long stack_size, guard_size;\n"
5752 "            void *stack_addr;\n"
5753 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
5754 "                                           a thread attributes object */\n"
5755 "    allocate_stack = 0;\n"
5756 "    stack_size = -1;\n"
5757 "    guard_size = -1;\n"
5758
5759 #. type: Plain text
5760 #: build/C/man3/pthread_getattr_np.3:271
5761 #, no-wrap
5762 msgid ""
5763 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5764 "        switch (opt) {\n"
5765 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
5766 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
5767 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
5768 "        default:    usage(argv[0], NULL);\n"
5769 "        }\n"
5770 "    }\n"
5771 msgstr ""
5772 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5773 "        switch (opt) {\n"
5774 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
5775 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
5776 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
5777 "        default:    usage(argv[0], NULL);\n"
5778 "        }\n"
5779 "    }\n"
5780
5781 #. type: Plain text
5782 #: build/C/man3/pthread_getattr_np.3:274
5783 #, no-wrap
5784 msgid ""
5785 "    if (allocate_stack && stack_size == -1)\n"
5786 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5787 msgstr ""
5788 "    if (allocate_stack && stack_size == -1)\n"
5789 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5790
5791 #. type: Plain text
5792 #: build/C/man3/pthread_getattr_np.3:277
5793 #, no-wrap
5794 msgid ""
5795 "    if (argc E<gt> optind)\n"
5796 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5797 msgstr ""
5798 "    if (argc E<gt> optind)\n"
5799 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5800
5801 #. type: Plain text
5802 #: build/C/man3/pthread_getattr_np.3:280
5803 #, no-wrap
5804 msgid ""
5805 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5806 "        ret_attrp = attrp;\n"
5807 msgstr ""
5808 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5809 "        ret_attrp = attrp;\n"
5810
5811 #. type: Plain text
5812 #: build/C/man3/pthread_getattr_np.3:285
5813 #, no-wrap
5814 msgid ""
5815 "        s = pthread_attr_init(attrp);\n"
5816 "        if (s != 0)\n"
5817 "            handle_error_en(s, \"pthread_attr_init\");\n"
5818 "    }\n"
5819 msgstr ""
5820 "        s = pthread_attr_init(attrp);\n"
5821 "        if (s != 0)\n"
5822 "            handle_error_en(s, \"pthread_attr_init\");\n"
5823 "    }\n"
5824
5825 #. type: Plain text
5826 #: build/C/man3/pthread_getattr_np.3:297
5827 #, no-wrap
5828 msgid ""
5829 "    if (stack_size E<gt>= 0) {\n"
5830 "        if (!allocate_stack) {\n"
5831 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
5832 "            if (s != 0)\n"
5833 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5834 "        } else {\n"
5835 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5836 "                               stack_size);\n"
5837 "            if (s != 0)\n"
5838 "                handle_error_en(s, \"posix_memalign\");\n"
5839 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5840 msgstr ""
5841 "    if (stack_size E<gt>= 0) {\n"
5842 "        if (!allocate_stack) {\n"
5843 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
5844 "            if (s != 0)\n"
5845 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5846 "        } else {\n"
5847 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5848 "                               stack_size);\n"
5849 "            if (s != 0)\n"
5850 "                handle_error_en(s, \"posix_memalign\");\n"
5851 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5852
5853 #. type: Plain text
5854 #: build/C/man3/pthread_getattr_np.3:303
5855 #, no-wrap
5856 msgid ""
5857 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5858 "            if (s != 0)\n"
5859 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5860 "        }\n"
5861 "    }\n"
5862 msgstr ""
5863 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5864 "            if (s != 0)\n"
5865 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5866 "        }\n"
5867 "    }\n"
5868
5869 #. type: Plain text
5870 #: build/C/man3/pthread_getattr_np.3:309
5871 #, no-wrap
5872 msgid ""
5873 "    if (guard_size E<gt>= 0) {\n"
5874 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
5875 "        if (s != 0)\n"
5876 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5877 "    }\n"
5878 msgstr ""
5879 "    if (guard_size E<gt>= 0) {\n"
5880 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
5881 "        if (s != 0)\n"
5882 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5883 "    }\n"
5884
5885 #. type: Plain text
5886 #: build/C/man3/pthread_getattr_np.3:312
5887 #, no-wrap
5888 msgid ""
5889 "    return ret_attrp;\n"
5890 "}\n"
5891 msgstr ""
5892 "    return ret_attrp;\n"
5893 "}\n"
5894
5895 #. type: Plain text
5896 #: build/C/man3/pthread_getattr_np.3:321
5897 #, no-wrap
5898 msgid ""
5899 "int\n"
5900 "main(int argc, char *argv[])\n"
5901 "{\n"
5902 "    int s;\n"
5903 "    pthread_t thr;\n"
5904 "    pthread_attr_t attr;\n"
5905 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
5906 "                                        a thread attributes object */\n"
5907 msgstr ""
5908 "int\n"
5909 "main(int argc, char *argv[])\n"
5910 "{\n"
5911 "    int s;\n"
5912 "    pthread_t thr;\n"
5913 "    pthread_attr_t attr;\n"
5914 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
5915 "                                        a thread attributes object */\n"
5916
5917 #. type: Plain text
5918 #: build/C/man3/pthread_getattr_np.3:323
5919 #, no-wrap
5920 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5921 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5922
5923 #. type: Plain text
5924 #: build/C/man3/pthread_getattr_np.3:329
5925 #, no-wrap
5926 msgid ""
5927 "    if (attrp != NULL) {\n"
5928 "        printf(\"Thread attributes object after initializations:\\en\");\n"
5929 "        display_stack_related_attributes(attrp, \"\\et\");\n"
5930 "        printf(\"\\en\");\n"
5931 "    }\n"
5932 msgstr ""
5933 "    if (attrp != NULL) {\n"
5934 "        printf(\"Thread attributes object after initializations:\\en\");\n"
5935 "        display_stack_related_attributes(attrp, \"\\et\");\n"
5936 "        printf(\"\\en\");\n"
5937 "    }\n"
5938
5939 #. type: Plain text
5940 #: build/C/man3/pthread_getattr_np.3:357
5941 msgid ""
5942 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
5943 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
5944 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
5945 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
5946 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
5947 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5948 msgstr ""
5949 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
5950 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
5951 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
5952 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
5953 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
5954 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5955
5956 #. type: TH
5957 #: build/C/man3/pthread_getcpuclockid.3:24
5958 #, no-wrap
5959 msgid "PTHREAD_GETCPUCLOCKID"
5960 msgstr "PTHREAD_GETCPUCLOCKID"
5961
5962 #. type: TH
5963 #: build/C/man3/pthread_getcpuclockid.3:24
5964 #, no-wrap
5965 msgid "2009-02-08"
5966 msgstr "2009-02-08"
5967
5968 #. type: Plain text
5969 #: build/C/man3/pthread_getcpuclockid.3:27
5970 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
5971 msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する"
5972
5973 #. type: Plain text
5974 #: build/C/man3/pthread_getcpuclockid.3:31
5975 #, no-wrap
5976 msgid ""
5977 "B<#include E<lt>pthread.hE<gt>>\n"
5978 "B<#include E<lt>time.hE<gt>>\n"
5979 msgstr ""
5980 "B<#include E<lt>pthread.hE<gt>>\n"
5981 "B<#include E<lt>time.hE<gt>>\n"
5982
5983 #. type: Plain text
5984 #: build/C/man3/pthread_getcpuclockid.3:33
5985 #, no-wrap
5986 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
5987 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
5988
5989 #.  The clockid is constructed as follows:
5990 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
5991 #.  where CLOCK_IDFIELD_SIZE is 3.
5992 #. type: Plain text
5993 #: build/C/man3/pthread_getcpuclockid.3:44
5994 msgid ""
5995 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
5996 "time clock of the thread I<thread>."
5997 msgstr ""
5998 "B<pthread_getcpuclockid>() 関数は、\n"
5999 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
6000
6001 #. type: TP
6002 #: build/C/man3/pthread_getcpuclockid.3:48
6003 #, no-wrap
6004 msgid "B<ENOENT>"
6005 msgstr "B<ENOENT>"
6006
6007 #.  CLOCK_THREAD_CPUTIME_ID not defined
6008 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
6009 #.  be possible if kernel thread IDs took more than 29 bits (which
6010 #.  they currently cannot).
6011 #. type: Plain text
6012 #: build/C/man3/pthread_getcpuclockid.3:56
6013 msgid "Per-thread CPU time clocks are not supported by the system."
6014 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
6015
6016 #. type: Plain text
6017 #: build/C/man3/pthread_getcpuclockid.3:63
6018 msgid "This function is available in glibc since version 2.2."
6019 msgstr "この関数は glibc バージョン 2.2 以降で利用できる。"
6020
6021 #. type: Plain text
6022 #: build/C/man3/pthread_getcpuclockid.3:76
6023 msgid ""
6024 "When I<thread> refers to the calling thread, this function returns an "
6025 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
6026 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
6027 msgstr ""
6028 "I<thread> が呼び出したスレッドを参照している場合、\n"
6029 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
6030 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
6031 "を参照する ID が返される。"
6032
6033 #. type: Plain text
6034 #: build/C/man3/pthread_getcpuclockid.3:82
6035 msgid ""
6036 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
6037 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
6038 "the two threads.  The following shell session shows an example run:"
6039 msgstr ""
6040 "以下のプログラムは、スレッドを作成し、それから\n"
6041 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
6042 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
6043 "スレッド毎の CPU 時間を取得する。\n"
6044 "下記のシェルのセッションは実行例である。"
6045
6046 #. type: Plain text
6047 #: build/C/man3/pthread_getcpuclockid.3:91
6048 #, no-wrap
6049 msgid ""
6050 "$ B<./a.out>\n"
6051 "Main thread sleeping\n"
6052 "Subthread starting infinite loop\n"
6053 "Main thread consuming some CPU time...\n"
6054 "Process total CPU time:    1.368\n"
6055 "Main thread CPU time:      0.376\n"
6056 "Subthread CPU time:        0.992\n"
6057 msgstr ""
6058 "$ B<./a.out>\n"
6059 "Main thread sleeping\n"
6060 "Subthread starting infinite loop\n"
6061 "Main thread consuming some CPU time...\n"
6062 "Process total CPU time:    1.368\n"
6063 "Main thread CPU time:      0.376\n"
6064 "Subthread CPU time:        0.992\n"
6065
6066 #. type: Plain text
6067 #: build/C/man3/pthread_getcpuclockid.3:97
6068 #, no-wrap
6069 msgid "/* Link with \"-lrt\" */\n"
6070 msgstr "/* \"-lrt\" でリンクする */\n"
6071
6072 #. type: Plain text
6073 #: build/C/man3/pthread_getcpuclockid.3:105
6074 #, no-wrap
6075 msgid ""
6076 "#include E<lt>time.hE<gt>\n"
6077 "#include E<lt>stdio.hE<gt>\n"
6078 "#include E<lt>stdlib.hE<gt>\n"
6079 "#include E<lt>unistd.hE<gt>\n"
6080 "#include E<lt>pthread.hE<gt>\n"
6081 "#include E<lt>string.hE<gt>\n"
6082 "#include E<lt>errno.hE<gt>\n"
6083 msgstr ""
6084 "#include E<lt>time.hE<gt>\n"
6085 "#include E<lt>stdio.hE<gt>\n"
6086 "#include E<lt>stdlib.hE<gt>\n"
6087 "#include E<lt>unistd.hE<gt>\n"
6088 "#include E<lt>pthread.hE<gt>\n"
6089 "#include E<lt>string.hE<gt>\n"
6090 "#include E<lt>errno.hE<gt>\n"
6091
6092 #. type: Plain text
6093 #: build/C/man3/pthread_getcpuclockid.3:119
6094 #, no-wrap
6095 msgid ""
6096 "static void *\n"
6097 "thread_start(void *arg)\n"
6098 "{\n"
6099 "    printf(\"Subthread starting infinite loop\\en\");\n"
6100 "    for (;;)\n"
6101 "        continue;\n"
6102 "}\n"
6103 msgstr ""
6104 "static void *\n"
6105 "thread_start(void *arg)\n"
6106 "{\n"
6107 "    printf(\"Subthread starting infinite loop\\en\");\n"
6108 "    for (;;)\n"
6109 "        continue;\n"
6110 "}\n"
6111
6112 #. type: Plain text
6113 #: build/C/man3/pthread_getcpuclockid.3:124
6114 #, no-wrap
6115 msgid ""
6116 "static void\n"
6117 "pclock(char *msg, clockid_t cid)\n"
6118 "{\n"
6119 "    struct timespec ts;\n"
6120 msgstr ""
6121 "static void\n"
6122 "pclock(char *msg, clockid_t cid)\n"
6123 "{\n"
6124 "    struct timespec ts;\n"
6125
6126 #. type: Plain text
6127 #: build/C/man3/pthread_getcpuclockid.3:130
6128 #, no-wrap
6129 msgid ""
6130 "    printf(\"%s\", msg);\n"
6131 "    if (clock_gettime(cid, &ts) == -1)\n"
6132 "        handle_error(\"clock_gettime\");\n"
6133 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6134 "}\n"
6135 msgstr ""
6136 "    printf(\"%s\", msg);\n"
6137 "    if (clock_gettime(cid, &ts) == -1)\n"
6138 "        handle_error(\"clock_gettime\");\n"
6139 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6140 "}\n"
6141
6142 #. type: Plain text
6143 #: build/C/man3/pthread_getcpuclockid.3:137
6144 #, no-wrap
6145 msgid ""
6146 "int\n"
6147 "main(int argc, char *argv[])\n"
6148 "{\n"
6149 "    pthread_t thread;\n"
6150 "    clockid_t cid;\n"
6151 "    int j, s;\n"
6152 msgstr ""
6153 "int\n"
6154 "main(int argc, char *argv[])\n"
6155 "{\n"
6156 "    pthread_t thread;\n"
6157 "    clockid_t cid;\n"
6158 "    int j, s;\n"
6159
6160 #. type: Plain text
6161 #: build/C/man3/pthread_getcpuclockid.3:141
6162 #, no-wrap
6163 msgid ""
6164 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6165 "    if (s != 0)\n"
6166 "        handle_error_en(s, \"pthread_create\");\n"
6167 msgstr ""
6168 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6169 "    if (s != 0)\n"
6170 "        handle_error_en(s, \"pthread_create\");\n"
6171
6172 #. type: Plain text
6173 #: build/C/man3/pthread_getcpuclockid.3:144
6174 #, no-wrap
6175 msgid ""
6176 "    printf(\"Main thread sleeping\\en\");\n"
6177 "    sleep(1);\n"
6178 msgstr ""
6179 "    printf(\"Main thread sleeping\\en\");\n"
6180 "    sleep(1);\n"
6181
6182 #. type: Plain text
6183 #: build/C/man3/pthread_getcpuclockid.3:148
6184 #, no-wrap
6185 msgid ""
6186 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6187 "    for (j = 0; j E<lt> 2000000; j++)\n"
6188 "        getppid();\n"
6189 msgstr ""
6190 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6191 "    for (j = 0; j E<lt> 2000000; j++)\n"
6192 "        getppid();\n"
6193
6194 #. type: Plain text
6195 #: build/C/man3/pthread_getcpuclockid.3:150
6196 #, no-wrap
6197 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6198 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6199
6200 #. type: Plain text
6201 #: build/C/man3/pthread_getcpuclockid.3:155
6202 #, no-wrap
6203 msgid ""
6204 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6205 "    if (s != 0)\n"
6206 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6207 "    pclock(\"Main thread CPU time:   \", cid);\n"
6208 msgstr ""
6209 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6210 "    if (s != 0)\n"
6211 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6212 "    pclock(\"Main thread CPU time:   \", cid);\n"
6213
6214 #. type: Plain text
6215 #: build/C/man3/pthread_getcpuclockid.3:158
6216 #, no-wrap
6217 msgid ""
6218 "    /* The preceding 4 lines of code could have been replaced by:\n"
6219 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6220 msgstr ""
6221 "    /* The preceding 4 lines of code could have been replaced by:\n"
6222 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6223
6224 #. type: Plain text
6225 #: build/C/man3/pthread_getcpuclockid.3:163
6226 #, no-wrap
6227 msgid ""
6228 "    s = pthread_getcpuclockid(thread, &cid);\n"
6229 "    if (s != 0)\n"
6230 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6231 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6232 msgstr ""
6233 "    s = pthread_getcpuclockid(thread, &cid);\n"
6234 "    if (s != 0)\n"
6235 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6236 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6237
6238 #. type: Plain text
6239 #: build/C/man3/pthread_getcpuclockid.3:166
6240 #, no-wrap
6241 msgid ""
6242 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6243 "}\n"
6244 msgstr ""
6245 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6246 "}\n"
6247
6248 #. type: Plain text
6249 #: build/C/man3/pthread_getcpuclockid.3:175
6250 msgid ""
6251 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6252 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6253 msgstr ""
6254 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6255 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6256
6257 #. type: TH
6258 #: build/C/man3/pthread_join.3:24
6259 #, no-wrap
6260 msgid "PTHREAD_JOIN"
6261 msgstr "PTHREAD_JOIN"
6262
6263 #. type: Plain text
6264 #: build/C/man3/pthread_join.3:27
6265 msgid "pthread_join - join with a terminated thread"
6266 msgstr ""
6267
6268 #. type: Plain text
6269 #: build/C/man3/pthread_join.3:32
6270 #, no-wrap
6271 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6272 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6273
6274 #. type: Plain text
6275 #: build/C/man3/pthread_join.3:47
6276 msgid ""
6277 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
6278 "to terminate.  If that thread has already terminated, then B<pthread_join>"
6279 "()  returns immediately.  The thread specified by I<thread> must be joinable."
6280 msgstr ""
6281
6282 #. type: Plain text
6283 #: build/C/man3/pthread_join.3:61
6284 msgid ""
6285 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
6286 "the target thread (i.e., the value that the target thread supplied to "
6287 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
6288 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
6289 msgstr ""
6290
6291 #. type: Plain text
6292 #: build/C/man3/pthread_join.3:68
6293 msgid ""
6294 "If multiple threads simultaneously try to join with the same thread, the "
6295 "results are undefined.  If the thread calling B<pthread_join>()  is "
6296 "canceled, then the target thread will remain joinable (i.e., it will not be "
6297 "detached)."
6298 msgstr ""
6299
6300 #. type: Plain text
6301 #: build/C/man3/pthread_join.3:73
6302 msgid ""
6303 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
6304 "number."
6305 msgstr ""
6306
6307 #. type: TP
6308 #: build/C/man3/pthread_join.3:74
6309 #, no-wrap
6310 msgid "B<EDEADLK>"
6311 msgstr "B<EDEADLK>"
6312
6313 #.  The following verified by testing on glibc 2.8/NPTL:
6314 #.  The following verified by testing on glibc 2.8/NPTL:
6315 #. type: Plain text
6316 #: build/C/man3/pthread_join.3:83
6317 msgid ""
6318 "A deadlock was detected (e.g., two threads tried to join with each other); "
6319 "or I<thread> specifies the calling thread."
6320 msgstr ""
6321
6322 #.  POSIX.1-2001 does not specify this error case.
6323 #. type: Plain text
6324 #: build/C/man3/pthread_join.3:91
6325 msgid "Another thread is already waiting to join with this thread."
6326 msgstr ""
6327
6328 #. type: Plain text
6329 #: build/C/man3/pthread_join.3:102
6330 msgid ""
6331 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
6332 "the target thread has terminated."
6333 msgstr ""
6334
6335 #. type: Plain text
6336 #: build/C/man3/pthread_join.3:105
6337 msgid ""
6338 "Joining with a thread that has previously been joined results in undefined "
6339 "behavior."
6340 msgstr ""
6341
6342 #. type: Plain text
6343 #: build/C/man3/pthread_join.3:113
6344 msgid ""
6345 "Failure to join with a thread that is joinable (i.e., one that is not "
6346 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
6347 "zombie thread consumes some system resources, and when enough zombie threads "
6348 "have accumulated, it will no longer be possible to create new threads (or "
6349 "processes)."
6350 msgstr ""
6351
6352 #. type: Plain text
6353 #: build/C/man3/pthread_join.3:119
6354 msgid ""
6355 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
6356 "\"join with any terminated thread\".  If you believe you need this "
6357 "functionality, you probably need to rethink your application design."
6358 msgstr ""
6359
6360 #. type: Plain text
6361 #: build/C/man3/pthread_join.3:122
6362 msgid ""
6363 "All of the threads in a process are peers: any thread can join with any "
6364 "other thread in the process."
6365 msgstr ""
6366
6367 #. type: Plain text
6368 #: build/C/man3/pthread_join.3:132
6369 msgid ""
6370 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6371 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6372 msgstr ""
6373 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6374 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6375
6376 #. type: TH
6377 #: build/C/man3/pthread_kill.3:24
6378 #, no-wrap
6379 msgid "PTHREAD_KILL"
6380 msgstr "PTHREAD_KILL"
6381
6382 #. type: TH
6383 #: build/C/man3/pthread_kill.3:24
6384 #, no-wrap
6385 msgid "2009-01-28"
6386 msgstr "2009-01-28"
6387
6388 #. type: Plain text
6389 #: build/C/man3/pthread_kill.3:27
6390 msgid "pthread_kill - send a signal to a thread"
6391 msgstr ""
6392
6393 #. type: Plain text
6394 #: build/C/man3/pthread_kill.3:30 build/C/man3/pthread_sigmask.3:30
6395 #, no-wrap
6396 msgid "B<#include E<lt>signal.hE<gt>>\n"
6397 msgstr "B<#include E<lt>signal.hE<gt>>\n"
6398
6399 #. type: Plain text
6400 #: build/C/man3/pthread_kill.3:32
6401 #, no-wrap
6402 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6403 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6404
6405 #. type: Plain text
6406 #: build/C/man3/pthread_kill.3:45
6407 msgid ""
6408 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, "
6409 "another thread in the same process as the caller.  The signal is "
6410 "asynchronously directed to I<thread>."
6411 msgstr ""
6412
6413 #. type: Plain text
6414 #: build/C/man3/pthread_kill.3:50
6415 msgid ""
6416 "If I<sig> is 0, then no signal is sent, but error checking is still "
6417 "performed; this can be used to check for the existence of a thread ID."
6418 msgstr ""
6419
6420 #. type: Plain text
6421 #: build/C/man3/pthread_kill.3:55
6422 msgid ""
6423 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
6424 "number, and no signal is sent."
6425 msgstr ""
6426
6427 #. type: Plain text
6428 #: build/C/man3/pthread_kill.3:59
6429 msgid "An invalid signal was specified."
6430 msgstr ""
6431
6432 #. type: Plain text
6433 #: build/C/man3/pthread_kill.3:73
6434 msgid ""
6435 "Signal dispositions are process-wide: if a signal handler is installed, the "
6436 "handler will be invoked in the thread I<thread>, but if the disposition of "
6437 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
6438 "affect the whole process."
6439 msgstr ""
6440
6441 #. type: Plain text
6442 #: build/C/man3/pthread_kill.3:82
6443 msgid ""
6444 "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
6445 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
6446 msgstr ""
6447 "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
6448 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
6449
6450 #. type: TH
6451 #: build/C/man3/pthread_kill_other_threads_np.3:24
6452 #, no-wrap
6453 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
6454 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
6455
6456 #. type: TH
6457 #: build/C/man3/pthread_kill_other_threads_np.3:24
6458 #, no-wrap
6459 msgid "2010-09-09"
6460 msgstr "2010-09-09"
6461
6462 #. type: Plain text
6463 #: build/C/man3/pthread_kill_other_threads_np.3:27
6464 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
6465 msgstr ""
6466
6467 #. type: Plain text
6468 #: build/C/man3/pthread_kill_other_threads_np.3:32
6469 #, no-wrap
6470 msgid "B<void pthread_kill_other_threads_np(void);>\n"
6471 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
6472
6473 #.  .SH VERSIONS
6474 #.  Available since glibc 2.0
6475 #. type: Plain text
6476 #: build/C/man3/pthread_kill_other_threads_np.3:45
6477 msgid ""
6478 "B<pthread_kill_other_threads_np>()  only has an effect in the LinuxThreads "
6479 "threading implementation.  On that implementation, calling this function "
6480 "causes the immediate termination of all threads in the application, except "
6481 "the calling thread.  The cancellation state and cancellation type of the to-"
6482 "be-terminated threads are ignored, and the cleanup handlers are not called "
6483 "in those threads."
6484 msgstr ""
6485
6486 #. type: Plain text
6487 #: build/C/man3/pthread_kill_other_threads_np.3:57
6488 msgid ""
6489 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
6490 "thread calls B<execve>(2)  or a similar function.  This function is designed "
6491 "to address a limitation in the obsolete LinuxThreads implementation whereby "
6492 "the other threads of an application are not automatically terminated (as "
6493 "POSIX.1-2001 requires) during B<execve>(2)."
6494 msgstr ""
6495
6496 #. type: Plain text
6497 #: build/C/man3/pthread_kill_other_threads_np.3:64
6498 msgid ""
6499 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
6500 "exists, but does nothing.  (Nothing needs to be done, because the "
6501 "implementation does the right thing during an B<execve>(2).)"
6502 msgstr ""
6503
6504 #. type: Plain text
6505 #: build/C/man3/pthread_kill_other_threads_np.3:70
6506 msgid ""
6507 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
6508 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
6509 msgstr ""
6510 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
6511 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
6512
6513 #. type: TH
6514 #: build/C/man3/pthread_self.3:24
6515 #, no-wrap
6516 msgid "PTHREAD_SELF"
6517 msgstr "PTHREAD_SELF"
6518
6519 #. type: Plain text
6520 #: build/C/man3/pthread_self.3:27
6521 msgid "pthread_self - obtain ID of the calling thread"
6522 msgstr ""
6523
6524 #. type: Plain text
6525 #: build/C/man3/pthread_self.3:32
6526 #, no-wrap
6527 msgid "B<pthread_t pthread_self(void);>\n"
6528 msgstr "B<pthread_t pthread_self(void);>\n"
6529
6530 #. type: Plain text
6531 #: build/C/man3/pthread_self.3:44
6532 msgid ""
6533 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
6534 "is the same value that is returned in I<*thread> in the B<pthread_create>"
6535 "(3)  call that created this thread."
6536 msgstr ""
6537
6538 #. type: Plain text
6539 #: build/C/man3/pthread_self.3:46
6540 msgid "This function always succeeds, returning the calling thread's ID."
6541 msgstr ""
6542
6543 #. type: Plain text
6544 #: build/C/man3/pthread_self.3:61
6545 msgid ""
6546 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
6547 "represent a thread ID; for example, representation using either an "
6548 "arithmetic type or a structure is permitted.  Therefore, variables of type "
6549 "I<pthread_t> can't portably be compared using the C equality operator "
6550 "(B<==>); use B<pthread_equal>(3)  instead."
6551 msgstr ""
6552
6553 #. type: Plain text
6554 #: build/C/man3/pthread_self.3:65
6555 msgid ""
6556 "Thread identifiers should be considered opaque: any attempt to use a thread "
6557 "ID other than in pthreads calls is nonportable and can lead to unspecified "
6558 "results."
6559 msgstr ""
6560
6561 #. type: Plain text
6562 #: build/C/man3/pthread_self.3:69
6563 msgid ""
6564 "Thread IDs are only guaranteed to be unique within a process.  A thread ID "
6565 "may be reused after a terminated thread has been joined, or a detached "
6566 "thread has terminated."
6567 msgstr ""
6568
6569 #. type: Plain text
6570 #: build/C/man3/pthread_self.3:74
6571 msgid ""
6572 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
6573 "kernel thread ID returned by a call to B<gettid>(2)."
6574 msgstr ""
6575
6576 #. type: Plain text
6577 #: build/C/man3/pthread_self.3:78
6578 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6579 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6580
6581 #. type: TH
6582 #: build/C/man3/pthread_setaffinity_np.3:24
6583 #, no-wrap
6584 msgid "PTHREAD_SETAFFINITY_NP"
6585 msgstr "PTHREAD_SETAFFINITY_NP"
6586
6587 #. type: Plain text
6588 #: build/C/man3/pthread_setaffinity_np.3:28
6589 msgid ""
6590 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
6591 "thread"
6592 msgstr ""
6593 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
6594 "CPU affinity の設定/取得を行う"
6595
6596 #. type: Plain text
6597 #: build/C/man3/pthread_setaffinity_np.3:37
6598 #, no-wrap
6599 msgid ""
6600 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6601 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6602 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6603 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6604 msgstr ""
6605 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6606 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6607 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6608 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6609
6610 #. type: Plain text
6611 #: build/C/man3/pthread_setaffinity_np.3:52
6612 msgid ""
6613 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
6614 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
6615 "successful, and the thread is not currently running on one of the CPUs in "
6616 "I<cpuset>, then it is migrated to one of those CPUs."
6617 msgstr ""
6618 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
6619 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
6620 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
6621 "場合は、スレッドは指定された CPU のいずれかに移動される。"
6622
6623 #. type: Plain text
6624 #: build/C/man3/pthread_setaffinity_np.3:59
6625 msgid ""
6626 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
6627 "the thread I<thread> in the buffer pointed to by I<cpuset>."
6628 msgstr ""
6629 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
6630 "マスクを、I<cpuset> が指すバッファに入れて返す。"
6631
6632 #. type: Plain text
6633 #: build/C/man3/pthread_setaffinity_np.3:75
6634 msgid ""
6635 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
6636 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
6637 "(cpu_set_t)>.  (It may be some other value, if using the macros described in "
6638 "B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
6639 msgstr ""
6640 "引き数 I<cpusetsize> は I<cpuset> が指すバッファの長さ (バイト単位) で\n"
6641 "ある。通常は、この引き数には I<sizeof(cpu_set_t)> を指定する\n"
6642 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
6643 "割り当てている場合には、別の値になることもある)。"
6644
6645 #. type: TP
6646 #: build/C/man3/pthread_setaffinity_np.3:79
6647 #, no-wrap
6648 msgid "B<EFAULT>"
6649 msgstr "B<EFAULT>"
6650
6651 #. type: Plain text
6652 #: build/C/man3/pthread_setaffinity_np.3:82
6653 msgid "A supplied memory address was invalid."
6654 msgstr "指定されたメモリアドレスが無効である。"
6655
6656 #. type: Plain text
6657 #: build/C/man3/pthread_setaffinity_np.3:91
6658 msgid ""
6659 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
6660 "processors that are currently physically on the system and permitted to the "
6661 "thread according to any restrictions that may be imposed by the \"cpuset\" "
6662 "mechanism described in B<cpuset>(7)."
6663 msgstr ""
6664 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
6665 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
6666 "されているプロセッサが一つも含まれていない。\n"
6667 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
6668 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
6669
6670 #.  FIXME . ?
6671 #.  Loic Domaigne commented: it seems that in the future the
6672 #.  kernel developers want to make cpumask_t dynamic, so
6673 #.  CONFIG_NR_CPUS might become obsolete in the future.
6674 #.  cpumask_t
6675 #.  The raw sched_getaffinity() system call returns the size (in bytes)
6676 #.  of the cpumask_t type.
6677 #. type: Plain text
6678 #: build/C/man3/pthread_setaffinity_np.3:107
6679 msgid ""
6680 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
6681 "the set supported by the kernel.  (The kernel configuration option "
6682 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
6683 "type used to represent CPU sets.)"
6684 msgstr ""
6685 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
6686 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
6687 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
6688 "データ型がサポートする CPU 集合の範囲が定義される。)"
6689
6690 #. type: Plain text
6691 #: build/C/man3/pthread_setaffinity_np.3:112
6692 msgid ""
6693 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
6694 "affinity mask used by the kernel."
6695 msgstr ""
6696 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
6697 "affinity マスクの大きさよりも小さい。"
6698
6699 #. type: Plain text
6700 #: build/C/man3/pthread_setaffinity_np.3:135
6701 msgid ""
6702 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
6703 "thread will actually run is the intersection of the set specified in the "
6704 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
6705 "system may further restrict the set of CPUs on which the thread runs if the "
6706 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
6707 "restrictions on the actual set of CPUs on which the thread will run are "
6708 "silently imposed by the kernel."
6709 msgstr ""
6710 "B<pthread_setaffinity_np>() を呼び出した後、\n"
6711 "そのスレッドが実際に実行される CPU 集合は、\n"
6712 "I<cpuset> 引き数で指定された集合と\n"
6713 "システムに実際に存在する CPU 集合の共通部分になる。\n"
6714 "また、 B<cpuset>(7) で説明されている \"cpuset\" 機構が使われている場合\n"
6715 "には、そのスレッドが実行される CPU 集合がシステムによってさらに制限\n"
6716 "される場合がある。そのスレッドが実行される実際の CPU 集合に対する\n"
6717 "これらの制限は、カーネルにより黙って適用される。"
6718
6719 #. type: Plain text
6720 #: build/C/man3/pthread_setaffinity_np.3:141
6721 msgid ""
6722 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
6723 "B<sched_getaffinity>(2)  system calls."
6724 msgstr ""
6725 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
6726 "B<sched_getaffinity>(2) を使って実装されている。"
6727
6728 #. type: Plain text
6729 #: build/C/man3/pthread_setaffinity_np.3:152
6730 msgid ""
6731 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
6732 "creator's CPU affinity mask."
6733 msgstr ""
6734 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
6735 "作成者の CPU affinity マスクを継承する。"
6736
6737 #. type: Plain text
6738 #: build/C/man3/pthread_setaffinity_np.3:160
6739 msgid ""
6740 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
6741 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
6742 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
6743 "check the resulting CPU affinity mask of the thread."
6744 msgstr ""
6745 "以下のプログラムでは、メインスレッドは\n"
6746 "B<pthread_setaffinity_np>() を使って自分の CPU affinity マスクに\n"
6747 "CPU 0 から 7 が含まれるように設定し\n"
6748 "(システム上には 0 から 7 に対応する CPU が全て存在するとは限らない)、\n"
6749 "その後で B<pthread_getaffinity_np>() を使って\n"
6750 "スレッドに実際に設定された CPU affinity マスクを確認している。"
6751
6752 #. type: Plain text
6753 #: build/C/man3/pthread_setaffinity_np.3:167
6754 #, no-wrap
6755 msgid ""
6756 "#define _GNU_SOURCE\n"
6757 "#include E<lt>pthread.hE<gt>\n"
6758 "#include E<lt>stdio.hE<gt>\n"
6759 "#include E<lt>stdlib.hE<gt>\n"
6760 "#include E<lt>errno.hE<gt>\n"
6761 msgstr ""
6762 "#define _GNU_SOURCE\n"
6763 "#include E<lt>pthread.hE<gt>\n"
6764 "#include E<lt>stdio.hE<gt>\n"
6765 "#include E<lt>stdlib.hE<gt>\n"
6766 "#include E<lt>errno.hE<gt>\n"
6767
6768 #. type: Plain text
6769 #: build/C/man3/pthread_setaffinity_np.3:177
6770 #, no-wrap
6771 msgid ""
6772 "int\n"
6773 "main(int argc, char *argv[])\n"
6774 "{\n"
6775 "    int s, j;\n"
6776 "    cpu_set_t cpuset;\n"
6777 "    pthread_t thread;\n"
6778 msgstr ""
6779 "int\n"
6780 "main(int argc, char *argv[])\n"
6781 "{\n"
6782 "    int s, j;\n"
6783 "    cpu_set_t cpuset;\n"
6784 "    pthread_t thread;\n"
6785
6786 #. type: Plain text
6787 #: build/C/man3/pthread_setaffinity_np.3:179
6788 #, no-wrap
6789 msgid "    thread = pthread_self();\n"
6790 msgstr "    thread = pthread_self();\n"
6791
6792 #. type: Plain text
6793 #: build/C/man3/pthread_setaffinity_np.3:181
6794 #, no-wrap
6795 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
6796 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
6797
6798 #. type: Plain text
6799 #: build/C/man3/pthread_setaffinity_np.3:185
6800 #, no-wrap
6801 msgid ""
6802 "    CPU_ZERO(&cpuset);\n"
6803 "    for (j = 0; j E<lt> 8; j++)\n"
6804 "        CPU_SET(j, &cpuset);\n"
6805 msgstr ""
6806 "    CPU_ZERO(&cpuset);\n"
6807 "    for (j = 0; j E<lt> 8; j++)\n"
6808 "        CPU_SET(j, &cpuset);\n"
6809
6810 #. type: Plain text
6811 #: build/C/man3/pthread_setaffinity_np.3:189
6812 #, no-wrap
6813 msgid ""
6814 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6815 "    if (s != 0)\n"
6816 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
6817 msgstr ""
6818 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6819 "    if (s != 0)\n"
6820 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
6821
6822 #. type: Plain text
6823 #: build/C/man3/pthread_setaffinity_np.3:191
6824 #, no-wrap
6825 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
6826 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
6827
6828 #. type: Plain text
6829 #: build/C/man3/pthread_setaffinity_np.3:195
6830 #, no-wrap
6831 msgid ""
6832 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6833 "    if (s != 0)\n"
6834 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
6835 msgstr ""
6836 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6837 "    if (s != 0)\n"
6838 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
6839
6840 #. type: Plain text
6841 #: build/C/man3/pthread_setaffinity_np.3:200
6842 #, no-wrap
6843 msgid ""
6844 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6845 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6846 "        if (CPU_ISSET(j, &cpuset))\n"
6847 "            printf(\"    CPU %d\\en\", j);\n"
6848 msgstr ""
6849 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6850 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6851 "        if (CPU_ISSET(j, &cpuset))\n"
6852 "            printf(\"    CPU %d\\en\", j);\n"
6853
6854 #. type: Plain text
6855 #: build/C/man3/pthread_setaffinity_np.3:203
6856 #: build/C/man3/pthread_setschedparam.3:428
6857 #, no-wrap
6858 msgid ""
6859 "    exit(EXIT_SUCCESS);\n"
6860 "}\n"
6861 msgstr ""
6862 "    exit(EXIT_SUCCESS);\n"
6863 "}\n"
6864
6865 #. type: Plain text
6866 #: build/C/man3/pthread_setaffinity_np.3:212
6867 msgid ""
6868 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
6869 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
6870 "B<cpuset>(7), B<pthreads>(7)"
6871 msgstr ""
6872 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
6873 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
6874 "B<cpuset>(7), B<pthreads>(7)"
6875
6876 #. type: TH
6877 #: build/C/man3/pthread_setcancelstate.3:24
6878 #, no-wrap
6879 msgid "PTHREAD_SETCANCELSTATE"
6880 msgstr "PTHREAD_SETCANCELSTATE"
6881
6882 #. type: Plain text
6883 #: build/C/man3/pthread_setcancelstate.3:28
6884 msgid ""
6885 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
6886 "type"
6887 msgstr ""
6888 "pthread_setcancelstate, pthread_setcanceltype - cancelability state と\n"
6889 "type を設定する"
6890
6891 #. type: Plain text
6892 #: build/C/man3/pthread_setcancelstate.3:34
6893 #, no-wrap
6894 msgid ""
6895 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6896 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6897 msgstr ""
6898 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6899 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6900
6901 #. type: Plain text
6902 #: build/C/man3/pthread_setcancelstate.3:49
6903 msgid ""
6904 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
6905 "thread to the value given in I<state>.  The previous cancelability state of "
6906 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
6907 "I<state> argument must have one of the following values:"
6908 msgstr ""
6909 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
6910 "cancelability state に I<state> で指定された値を設定する。\n"
6911 "変更前のスレッドの cancelability state は\n"
6912 "I<oldstate> が指すバッファで返される。\n"
6913 "I<state> 引き数には以下の値のいずれか一つを指定しなければならない。"
6914
6915 #. type: TP
6916 #: build/C/man3/pthread_setcancelstate.3:49
6917 #, no-wrap
6918 msgid "B<PTHREAD_CANCEL_ENABLE>"
6919 msgstr "B<PTHREAD_CANCEL_ENABLE>"
6920
6921 #. type: Plain text
6922 #: build/C/man3/pthread_setcancelstate.3:56
6923 msgid ""
6924 "The thread is cancelable.  This is the default cancelability state in all "
6925 "new threads, including the initial thread.  The thread's cancelability type "
6926 "determines when a cancelable thread will respond to a cancellation request."
6927 msgstr ""
6928 "スレッドは取り消し可能 (cancelable) である。\n"
6929 "これが全ての新しく作成されるスレッドでのデフォルトの cancelability\n"
6930 "state である。これには最初のスレッドも含まれる。\n"
6931 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
6932 "取り消し要求にいつ反応するかが決まる。"
6933
6934 #. type: TP
6935 #: build/C/man3/pthread_setcancelstate.3:56
6936 #, no-wrap
6937 msgid "B<PTHREAD_CANCEL_DISABLE>"
6938 msgstr "B<PTHREAD_CANCEL_DISABLE>"
6939
6940 #. type: Plain text
6941 #: build/C/man3/pthread_setcancelstate.3:61
6942 msgid ""
6943 "The thread is not cancelable.  If a cancellation request is received, it is "
6944 "blocked until cancelability is enabled."
6945 msgstr ""
6946 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
6947 "取り消し可能に設定されるまでその要求はブロックされる。"
6948
6949 #. type: Plain text
6950 #: build/C/man3/pthread_setcancelstate.3:73
6951 msgid ""
6952 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
6953 "thread to the value given in I<type>.  The previous cancelability type of "
6954 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
6955 "argument must have one of the following values:"
6956 msgstr ""
6957 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
6958 "cancelability type に I<type> で指定された値を設定する。\n"
6959 "変更前のスレッドの cancelability type は\n"
6960 "I<oldtype> が指すバッファで返される。\n"
6961 "I<type> 引き数には以下の値のいずれか一つを指定しなければならない。"
6962
6963 #. type: TP
6964 #: build/C/man3/pthread_setcancelstate.3:73
6965 #, no-wrap
6966 msgid "B<PTHREAD_CANCEL_DEFERRED>"
6967 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
6968
6969 #. type: Plain text
6970 #: build/C/man3/pthread_setcancelstate.3:80
6971 msgid ""
6972 "A cancellation request is deferred until the thread next calls a function "
6973 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
6974 "cancelability type in all new threads, including the initial thread."
6975 msgstr ""
6976 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
6977 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
6978 "スレッドでのデフォルトの cancellation type である。\n"
6979 "これには最初のスレッドも含まれる。"
6980
6981 #. type: TP
6982 #: build/C/man3/pthread_setcancelstate.3:80
6983 #, no-wrap
6984 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6985 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6986
6987 #. type: Plain text
6988 #: build/C/man3/pthread_setcancelstate.3:86
6989 msgid ""
6990 "The thread can be canceled at any time.  (Typically, it will be canceled "
6991 "immediately upon receiving a cancellation request, but the system doesn't "
6992 "guarantee this.)"
6993 msgstr ""
6994 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
6995 "システムがそのことを保証しているわけではない)。"
6996
6997 #. type: Plain text
6998 #: build/C/man3/pthread_setcancelstate.3:90
6999 msgid ""
7000 "The set-and-get operation performed by each of these functions is atomic "
7001 "with respect to other threads in the process calling the same function."
7002 msgstr ""
7003
7004 #. type: Plain text
7005 #: build/C/man3/pthread_setcancelstate.3:97
7006 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
7007 msgstr "B<pthread_setcancelstate>() は以下のエラーで失敗する場合がある。"
7008
7009 #. type: Plain text
7010 #: build/C/man3/pthread_setcancelstate.3:101
7011 msgid "Invalid value for I<state>."
7012 msgstr "I<state> に無効な値が指定された。"
7013
7014 #. type: Plain text
7015 #: build/C/man3/pthread_setcancelstate.3:105
7016 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
7017 msgstr "B<pthread_setcanceltype>() は以下のエラーで失敗する場合がある。"
7018
7019 #.  .SH VERSIONS
7020 #.  Available since glibc 2.0
7021 #. type: Plain text
7022 #: build/C/man3/pthread_setcancelstate.3:111
7023 msgid "Invalid value for I<type>."
7024 msgstr "I<type> に無効な値が指定された。"
7025
7026 #. type: Plain text
7027 #: build/C/man3/pthread_setcancelstate.3:116
7028 msgid ""
7029 "For details of what happens when a thread is canceled, see B<pthread_cancel>"
7030 "(3)."
7031 msgstr ""
7032 "スレッドが取り消された場合に何が起こるかの詳細については\n"
7033 "B<pthread_cancel>(3) を参照。"
7034
7035 #. type: Plain text
7036 #: build/C/man3/pthread_setcancelstate.3:123
7037 msgid ""
7038 "Briefly disabling cancelability is useful if a thread performs some critical "
7039 "action that must not be interrupted by a cancellation request.  Beware of "
7040 "disabling cancelability for long periods, or around operations that may "
7041 "block for long periods, since that will render the thread unresponsive to "
7042 "cancellation requests."
7043 msgstr ""
7044
7045 #. type: Plain text
7046 #: build/C/man3/pthread_setcancelstate.3:154
7047 msgid ""
7048 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
7049 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
7050 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
7051 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
7052 "because the application has no way of knowing what the state of these "
7053 "resources is when the thread is canceled; that is, did cancellation occur "
7054 "before the resources were reserved, while they were reserved, or after they "
7055 "were released? Furthermore, some internal data structures (e.g., the linked "
7056 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
7057 "left in an inconsistent state if cancellation occurs in the middle of the "
7058 "function call.  Consequently, clean-up handlers cease to be useful.  "
7059 "Functions that can be safely asynchronously canceled are called I<async-"
7060 "cancel-safe functions>.  POSIX.1-2001 only requires that B<pthread_cancel>"
7061 "(3), B<pthread_setcancelstate>(), and B<pthread_setcanceltype>()  be async-"
7062 "cancel-safe.  In general, other library functions can't be safely called "
7063 "from an asynchronously cancelable thread.  One of the few circumstances in "
7064 "which asynchronous cancelability is useful is for cancellation of a thread "
7065 "that is in a pure compute-bound loop."
7066 msgstr ""
7067
7068 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
7069 #. type: Plain text
7070 #: build/C/man3/pthread_setcancelstate.3:172
7071 msgid ""
7072 "The Linux threading implementations permit the I<oldstate> argument of "
7073 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
7074 "the previous cancelability state is not returned to the caller.  Many other "
7075 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
7076 "does not specify this point, so portable applications should always specify "
7077 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
7078 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
7079 msgstr ""
7080
7081 #. type: Plain text
7082 #: build/C/man3/pthread_setcancelstate.3:175
7083 msgid "See B<pthread_cancel>(3)."
7084 msgstr "B<pthread_cancel>(3) を参照。"
7085
7086 #. type: Plain text
7087 #: build/C/man3/pthread_setcancelstate.3:180
7088 msgid ""
7089 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7090 "B<pthreads>(7)"
7091 msgstr ""
7092 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7093 "B<pthreads>(7)"
7094
7095 #. type: TH
7096 #: build/C/man3/pthread_setconcurrency.3:23
7097 #, no-wrap
7098 msgid "PTHREAD_SETCONCURRENCY"
7099 msgstr "PTHREAD_SETCONCURRENCY"
7100
7101 #. type: TH
7102 #: build/C/man3/pthread_setconcurrency.3:23 build/C/man3/pthread_yield.3:23
7103 #, no-wrap
7104 msgid "2009-04-10"
7105 msgstr "2009-04-10"
7106
7107 #. type: Plain text
7108 #: build/C/man3/pthread_setconcurrency.3:27
7109 msgid ""
7110 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
7111 "level"
7112 msgstr ""
7113
7114 #. type: Plain text
7115 #: build/C/man3/pthread_setconcurrency.3:33
7116 #, no-wrap
7117 msgid ""
7118 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7119 "B<int pthread_getconcurrency(void);>\n"
7120 msgstr ""
7121 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7122 "B<int pthread_getconcurrency(void);>\n"
7123
7124 #. type: Plain text
7125 #: build/C/man3/pthread_setconcurrency.3:46
7126 msgid ""
7127 "The B<pthread_setconcurrency>()  function informs the implementation of the "
7128 "application's desired concurrency level, specified in I<new_level>.  The "
7129 "implementation only takes this as a hint: POSIX.1 does not specify the level "
7130 "of concurrency that should be provided as a result of calling "
7131 "B<pthread_setconcurrency>()."
7132 msgstr ""
7133
7134 #. type: Plain text
7135 #: build/C/man3/pthread_setconcurrency.3:51
7136 msgid ""
7137 "Specifying I<new_level> as 0 instructs the implementation to manage the "
7138 "concurrency level as it deems appropriate."
7139 msgstr ""
7140
7141 #. type: Plain text
7142 #: build/C/man3/pthread_setconcurrency.3:54
7143 msgid ""
7144 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
7145 "level for this process."
7146 msgstr ""
7147
7148 #. type: Plain text
7149 #: build/C/man3/pthread_setconcurrency.3:59
7150 msgid ""
7151 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
7152 "nonzero error number."
7153 msgstr ""
7154
7155 #. type: Plain text
7156 #: build/C/man3/pthread_setconcurrency.3:66
7157 msgid ""
7158 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
7159 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
7160 "B<pthread_setconcurrency>()  has not previously been called."
7161 msgstr ""
7162
7163 #. type: Plain text
7164 #: build/C/man3/pthread_setconcurrency.3:69
7165 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
7166 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
7167
7168 #. type: Plain text
7169 #: build/C/man3/pthread_setconcurrency.3:73
7170 msgid "I<new_level> is negative."
7171 msgstr ""
7172
7173 #. type: Plain text
7174 #: build/C/man3/pthread_setconcurrency.3:79
7175 msgid ""
7176 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
7177 "I<new_level> would cause a system resource to be exceeded\")."
7178 msgstr ""
7179
7180 #. type: Plain text
7181 #: build/C/man3/pthread_setconcurrency.3:81
7182 msgid "These functions are available in glibc since version 2.1."
7183 msgstr "これらの関数は glibc バージョン 2.1 以降で利用できる。"
7184
7185 #. type: Plain text
7186 #: build/C/man3/pthread_setconcurrency.3:85
7187 msgid "The default concurrency level is 0."
7188 msgstr ""
7189
7190 #. type: Plain text
7191 #: build/C/man3/pthread_setconcurrency.3:92
7192 msgid ""
7193 "Concurrency levels are only meaningful for M:N threading implementations, "
7194 "where at any moment a subset of a process's set of user-level threads may be "
7195 "bound to a smaller number of kernel-scheduling entities.  Setting the "
7196 "concurrency level allows the application to give the system a hint as to the "
7197 "number of kernel-scheduling entities that should be provided for efficient "
7198 "execution of the application."
7199 msgstr ""
7200
7201 #. type: Plain text
7202 #: build/C/man3/pthread_setconcurrency.3:98
7203 msgid ""
7204 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
7205 "concurrency level has no meaning.  In other words, on Linux these functions "
7206 "merely exist for compatibility with other systems, and they have no effect "
7207 "on the execution of a program."
7208 msgstr ""
7209
7210 #. type: Plain text
7211 #: build/C/man3/pthread_setconcurrency.3:101
7212 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
7213 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
7214
7215 #. type: TH
7216 #: build/C/man3/pthread_setschedparam.3:24
7217 #, no-wrap
7218 msgid "PTHREAD_SETSCHEDPARAM"
7219 msgstr "PTHREAD_SETSCHEDPARAM"
7220
7221 #. type: Plain text
7222 #: build/C/man3/pthread_setschedparam.3:28
7223 msgid ""
7224 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
7225 "parameters of a thread"
7226 msgstr ""
7227
7228 #. type: Plain text
7229 #: build/C/man3/pthread_setschedparam.3:36
7230 #, no-wrap
7231 msgid ""
7232 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
7233 "B<                      const struct sched_param *>I<param>B<);>\n"
7234 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
7235 "B<                      struct sched_param *>I<param>B<);>\n"
7236 msgstr ""
7237 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
7238 "B<                      const struct sched_param *>I<param>B<);>\n"
7239 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
7240 "B<                      struct sched_param *>I<param>B<);>\n"
7241
7242 #. type: Plain text
7243 #: build/C/man3/pthread_setschedparam.3:44
7244 msgid ""
7245 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
7246 "parameters of the thread I<thread>."
7247 msgstr ""
7248
7249 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
7250 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
7251 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
7252 #. type: Plain text
7253 #: build/C/man3/pthread_setschedparam.3:55
7254 msgid ""
7255 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
7256 "values for I<policy>, and their semantics, are described in "
7257 "B<sched_setscheduler>(2)."
7258 msgstr ""
7259
7260 #. type: Plain text
7261 #: build/C/man3/pthread_setschedparam.3:61
7262 msgid ""
7263 "The structure pointed to by I<param> specifies the new scheduling parameters "
7264 "for I<thread>.  Scheduling parameters are maintained in the following "
7265 "structure:"
7266 msgstr ""
7267
7268 #.  FIXME . nptl/pthread_setschedparam.c has the following
7269 #.    /* If the thread should have higher priority because of some
7270 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
7271 #.  Eventually (perhaps after writing the mutexattr pages), we
7272 #.  may want to add something on the topic to this page.
7273 #. type: Plain text
7274 #: build/C/man3/pthread_setschedparam.3:102
7275 msgid ""
7276 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
7277 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
7278 "and I<param>, respectively.  The returned priority value is that set by the "
7279 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
7280 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
7281 "does not reflect any temporary priority adjustments as a result of calls to "
7282 "any priority inheritance or priority ceiling functions (see, for example, "
7283 "B<pthread_mutexattr_setprioceiling>(3)  and B<pthread_mutexattr_setprotocol>"
7284 "(3))."
7285 msgstr ""
7286
7287 #. type: Plain text
7288 #: build/C/man3/pthread_setschedparam.3:110
7289 msgid ""
7290 "On success, these functions return 0; on error, they return a nonzero error "
7291 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
7292 "parameters of I<thread> are not changed."
7293 msgstr ""
7294
7295 #. type: Plain text
7296 #: build/C/man3/pthread_setschedparam.3:112
7297 msgid "Both of these functions can fail with the following error:"
7298 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
7299
7300 #. type: Plain text
7301 #: build/C/man3/pthread_setschedparam.3:120
7302 msgid ""
7303 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
7304 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
7305
7306 #. type: Plain text
7307 #: build/C/man3/pthread_setschedparam.3:127
7308 msgid ""
7309 "I<policy> is not a recognized policy, or I<param> does not make sense for "
7310 "the I<policy>."
7311 msgstr ""
7312
7313 #. type: Plain text
7314 #: build/C/man3/pthread_setschedparam.3:131
7315 msgid ""
7316 "The caller does not have appropriate privileges to set the specified "
7317 "scheduling policy and parameters."
7318 msgstr ""
7319
7320 #.  .SH VERSIONS
7321 #.  Available since glibc 2.0
7322 #. type: Plain text
7323 #: build/C/man3/pthread_setschedparam.3:139
7324 msgid ""
7325 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
7326 "policy or scheduling parameters to an unsupported value\") error for "
7327 "B<pthread_setschedparam>()."
7328 msgstr ""
7329
7330 #. type: Plain text
7331 #: build/C/man3/pthread_setschedparam.3:147
7332 msgid ""
7333 "For a description of the permissions required to, and the effect of, "
7334 "changing a thread's scheduling policy and priority, and details of the "
7335 "permitted ranges for priorities in each scheduling policy, see "
7336 "B<sched_setscheduler>(2)."
7337 msgstr ""
7338
7339 #. type: Plain text
7340 #: build/C/man3/pthread_setschedparam.3:154
7341 msgid ""
7342 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
7343 "B<pthread_getschedparam>(), as well as the use of a number of other "
7344 "scheduling-related pthreads functions."
7345 msgstr ""
7346
7347 #. type: Plain text
7348 #: build/C/man3/pthread_setschedparam.3:170
7349 msgid ""
7350 "In the following run, the main thread sets its scheduling policy to "
7351 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
7352 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
7353 "priority attribute of 20.  The program then sets (using "
7354 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
7355 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
7356 "created using this attributes object should take their scheduling attributes "
7357 "from the thread attributes object.  The program then creates a thread using "
7358 "the thread attributes object, and that thread displays its scheduling policy "
7359 "and priority."
7360 msgstr ""
7361
7362 #. type: Plain text
7363 #: build/C/man3/pthread_setschedparam.3:178
7364 #, no-wrap
7365 msgid ""
7366 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
7367 "Password:\n"
7368 "# B<./a.out -mf10 -ar20 -i e>\n"
7369 "Scheduler settings of main thread\n"
7370 "    policy=SCHED_FIFO, priority=10\n"
7371 msgstr ""
7372 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
7373 "Password:\n"
7374 "# B<./a.out -mf10 -ar20 -i e>\n"
7375 "Scheduler settings of main thread\n"
7376 "    policy=SCHED_FIFO, priority=10\n"
7377
7378 #. type: Plain text
7379 #: build/C/man3/pthread_setschedparam.3:182
7380 #, no-wrap
7381 msgid ""
7382 "Scheduler settings in \\(aqattr\\(aq\n"
7383 "    policy=SCHED_RR, priority=20\n"
7384 "    inheritsched is EXPLICIT\n"
7385 msgstr ""
7386 "Scheduler settings in \\(aqattr\\(aq\n"
7387 "    policy=SCHED_RR, priority=20\n"
7388 "    inheritsched is EXPLICIT\n"
7389
7390 #. type: Plain text
7391 #: build/C/man3/pthread_setschedparam.3:185
7392 #, no-wrap
7393 msgid ""
7394 "Scheduler attributes of new thread\n"
7395 "    policy=SCHED_RR, priority=20\n"
7396 msgstr ""
7397 "Scheduler attributes of new thread\n"
7398 "    policy=SCHED_RR, priority=20\n"
7399
7400 #. type: Plain text
7401 #: build/C/man3/pthread_setschedparam.3:190
7402 msgid ""
7403 "In the above output, one can see that the scheduling policy and priority "
7404 "were taken from the values specified in the thread attributes object."
7405 msgstr ""
7406
7407 #. type: Plain text
7408 #: build/C/man3/pthread_setschedparam.3:197
7409 msgid ""
7410 "The next run is the same as the previous, except that the inherit scheduler "
7411 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
7412 "using the thread attributes object should ignore the scheduling attributes "
7413 "specified in the attributes object and instead take their scheduling "
7414 "attributes from the creating thread."
7415 msgstr ""
7416
7417 #. type: Plain text
7418 #: build/C/man3/pthread_setschedparam.3:203
7419 #, no-wrap
7420 msgid ""
7421 "# B<./a.out -mf10 -ar20 -i i>\n"
7422 "Scheduler settings of main thread\n"
7423 "    policy=SCHED_FIFO, priority=10\n"
7424 msgstr ""
7425 "# B<./a.out -mf10 -ar20 -i i>\n"
7426 "Scheduler settings of main thread\n"
7427 "    policy=SCHED_FIFO, priority=10\n"
7428
7429 #. type: Plain text
7430 #: build/C/man3/pthread_setschedparam.3:207
7431 #, no-wrap
7432 msgid ""
7433 "Scheduler settings in \\(aqattr\\(aq\n"
7434 "    policy=SCHED_RR, priority=20\n"
7435 "    inheritsched is INHERIT\n"
7436 msgstr ""
7437 "Scheduler settings in \\(aqattr\\(aq\n"
7438 "    policy=SCHED_RR, priority=20\n"
7439 "    inheritsched is INHERIT\n"
7440
7441 #. type: Plain text
7442 #: build/C/man3/pthread_setschedparam.3:210
7443 #, no-wrap
7444 msgid ""
7445 "Scheduler attributes of new thread\n"
7446 "    policy=SCHED_FIFO, priority=10\n"
7447 msgstr ""
7448 "Scheduler attributes of new thread\n"
7449 "    policy=SCHED_FIFO, priority=10\n"
7450
7451 #. type: Plain text
7452 #: build/C/man3/pthread_setschedparam.3:216
7453 msgid ""
7454 "In the above output, one can see that the scheduling policy and priority "
7455 "were taken from the creating thread, rather than the thread attributes "
7456 "object."
7457 msgstr ""
7458
7459 #. type: Plain text
7460 #: build/C/man3/pthread_setschedparam.3:222
7461 msgid ""
7462 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
7463 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
7464 "scheduler attribute."
7465 msgstr ""
7466
7467 #. type: Plain text
7468 #: build/C/man3/pthread_setschedparam.3:226
7469 #, no-wrap
7470 msgid "/* pthreads_sched_test.c */\n"
7471 msgstr "/* pthreads_sched_test.c */\n"
7472
7473 #. type: Plain text
7474 #: build/C/man3/pthread_setschedparam.3:232
7475 #, no-wrap
7476 msgid ""
7477 "#include E<lt>pthread.hE<gt>\n"
7478 "#include E<lt>stdio.hE<gt>\n"
7479 "#include E<lt>stdlib.hE<gt>\n"
7480 "#include E<lt>unistd.hE<gt>\n"
7481 "#include E<lt>errno.hE<gt>\n"
7482 msgstr ""
7483 "#include E<lt>pthread.hE<gt>\n"
7484 "#include E<lt>stdio.hE<gt>\n"
7485 "#include E<lt>stdlib.hE<gt>\n"
7486 "#include E<lt>unistd.hE<gt>\n"
7487 "#include E<lt>errno.hE<gt>\n"
7488
7489 #. type: Plain text
7490 #: build/C/man3/pthread_setschedparam.3:241
7491 #, no-wrap
7492 msgid ""
7493 "static void\n"
7494 "usage(char *prog_name, char *msg)\n"
7495 "{\n"
7496 "    if (msg != NULL)\n"
7497 "        fputs(msg, stderr);\n"
7498 msgstr ""
7499 "static void\n"
7500 "usage(char *prog_name, char *msg)\n"
7501 "{\n"
7502 "    if (msg != NULL)\n"
7503 "        fputs(msg, stderr);\n"
7504
7505 #. type: Plain text
7506 #: build/C/man3/pthread_setschedparam.3:258
7507 #, no-wrap
7508 msgid ""
7509 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
7510 "    fprintf(stderr, \"Options are:\\en\");\n"
7511 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
7512 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
7513 "    fpe(\"                 thread attributes object\\en\");\n"
7514 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
7515 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
7516 "    fpe(\"                     r  SCHED_RR\\en\");\n"
7517 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
7518 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
7519 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
7520 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
7521 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
7522 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
7523 "    exit(EXIT_FAILURE);\n"
7524 "}\n"
7525 msgstr ""
7526 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
7527 "    fprintf(stderr, \"Options are:\\en\");\n"
7528 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
7529 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
7530 "    fpe(\"                 thread attributes object\\en\");\n"
7531 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
7532 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
7533 "    fpe(\"                     r  SCHED_RR\\en\");\n"
7534 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
7535 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
7536 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
7537 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
7538 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
7539 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
7540 "    exit(EXIT_FAILURE);\n"
7541 "}\n"
7542
7543 #. type: Plain text
7544 #: build/C/man3/pthread_setschedparam.3:269
7545 #, no-wrap
7546 msgid ""
7547 "static int\n"
7548 "get_policy(char p, int *policy)\n"
7549 "{\n"
7550 "    switch (p) {\n"
7551 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
7552 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
7553 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
7554 "    default:  return 0;\n"
7555 "    }\n"
7556 "}\n"
7557 msgstr ""
7558 "static int\n"
7559 "get_policy(char p, int *policy)\n"
7560 "{\n"
7561 "    switch (p) {\n"
7562 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
7563 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
7564 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
7565 "    default:  return 0;\n"
7566 "    }\n"
7567 "}\n"
7568
7569 #. type: Plain text
7570 #: build/C/man3/pthread_setschedparam.3:280
7571 #, no-wrap
7572 msgid ""
7573 "static void\n"
7574 "display_sched_attr(int policy, struct sched_param *param)\n"
7575 "{\n"
7576 "    printf(\"    policy=%s, priority=%d\\en\",\n"
7577 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
7578 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
7579 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
7580 "            \"???\",\n"
7581 "            param-E<gt>sched_priority);\n"
7582 "}\n"
7583 msgstr ""
7584 "static void\n"
7585 "display_sched_attr(int policy, struct sched_param *param)\n"
7586 "{\n"
7587 "    printf(\"    policy=%s, priority=%d\\en\",\n"
7588 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
7589 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
7590 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
7591 "            \"???\",\n"
7592 "            param-E<gt>sched_priority);\n"
7593 "}\n"
7594
7595 #. type: Plain text
7596 #: build/C/man3/pthread_setschedparam.3:286
7597 #, no-wrap
7598 msgid ""
7599 "static void\n"
7600 "display_thread_sched_attr(char *msg)\n"
7601 "{\n"
7602 "    int policy, s;\n"
7603 "    struct sched_param param;\n"
7604 msgstr ""
7605 "static void\n"
7606 "display_thread_sched_attr(char *msg)\n"
7607 "{\n"
7608 "    int policy, s;\n"
7609 "    struct sched_param param;\n"
7610
7611 #. type: Plain text
7612 #: build/C/man3/pthread_setschedparam.3:290
7613 #, no-wrap
7614 msgid ""
7615 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
7616 "    if (s != 0)\n"
7617 "        handle_error_en(s, \"pthread_getschedparam\");\n"
7618 msgstr ""
7619 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
7620 "    if (s != 0)\n"
7621 "        handle_error_en(s, \"pthread_getschedparam\");\n"
7622
7623 #. type: Plain text
7624 #: build/C/man3/pthread_setschedparam.3:294
7625 #, no-wrap
7626 msgid ""
7627 "    printf(\"%s\\en\", msg);\n"
7628 "    display_sched_attr(policy, &param);\n"
7629 "}\n"
7630 msgstr ""
7631 "    printf(\"%s\\en\", msg);\n"
7632 "    display_sched_attr(policy, &param);\n"
7633 "}\n"
7634
7635 #. type: Plain text
7636 #: build/C/man3/pthread_setschedparam.3:299
7637 #, no-wrap
7638 msgid ""
7639 "static void *\n"
7640 "thread_start(void *arg)\n"
7641 "{\n"
7642 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7643 msgstr ""
7644 "static void *\n"
7645 "thread_start(void *arg)\n"
7646 "{\n"
7647 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7648
7649 #. type: Plain text
7650 #: build/C/man3/pthread_setschedparam.3:302
7651 #, no-wrap
7652 msgid ""
7653 "    return NULL;\n"
7654 "}\n"
7655 msgstr ""
7656 "    return NULL;\n"
7657 "}\n"
7658
7659 #. type: Plain text
7660 #: build/C/man3/pthread_setschedparam.3:312
7661 #, no-wrap
7662 msgid ""
7663 "int\n"
7664 "main(int argc, char *argv[])\n"
7665 "{\n"
7666 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
7667 "    pthread_t thread;\n"
7668 "    pthread_attr_t attr;\n"
7669 "    pthread_attr_t *attrp;\n"
7670 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7671 "    struct sched_param param;\n"
7672 msgstr ""
7673 "int\n"
7674 "main(int argc, char *argv[])\n"
7675 "{\n"
7676 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
7677 "    pthread_t thread;\n"
7678 "    pthread_attr_t attr;\n"
7679 "    pthread_attr_t *attrp;\n"
7680 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7681 "    struct sched_param param;\n"
7682
7683 #. type: Plain text
7684 #: build/C/man3/pthread_setschedparam.3:314
7685 #, no-wrap
7686 msgid "    /* Process command-line options */\n"
7687 msgstr "    /* Process command-line options */\n"
7688
7689 #. type: Plain text
7690 #: build/C/man3/pthread_setschedparam.3:319
7691 #, no-wrap
7692 msgid ""
7693 "    use_null_attrib = 0;\n"
7694 "    attr_sched_str = NULL;\n"
7695 "    main_sched_str = NULL;\n"
7696 "    inheritsched_str = NULL;\n"
7697 msgstr ""
7698 "    use_null_attrib = 0;\n"
7699 "    attr_sched_str = NULL;\n"
7700 "    main_sched_str = NULL;\n"
7701 "    inheritsched_str = NULL;\n"
7702
7703 #. type: Plain text
7704 #: build/C/man3/pthread_setschedparam.3:329
7705 #, no-wrap
7706 msgid ""
7707 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7708 "        switch (opt) {\n"
7709 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
7710 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
7711 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
7712 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
7713 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
7714 "        }\n"
7715 "    }\n"
7716 msgstr ""
7717 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7718 "        switch (opt) {\n"
7719 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
7720 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
7721 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
7722 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
7723 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
7724 "        }\n"
7725 "    }\n"
7726
7727 #. type: Plain text
7728 #: build/C/man3/pthread_setschedparam.3:333
7729 #, no-wrap
7730 msgid ""
7731 "    if (use_null_attrib &&\n"
7732 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7733 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7734 msgstr ""
7735 "    if (use_null_attrib &&\n"
7736 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7737 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7738
7739 #. type: Plain text
7740 #: build/C/man3/pthread_setschedparam.3:336
7741 #, no-wrap
7742 msgid ""
7743 "    /* Optionally set scheduling attributes of main thread,\n"
7744 "       and display the attributes */\n"
7745 msgstr ""
7746 "    /* Optionally set scheduling attributes of main thread,\n"
7747 "       and display the attributes */\n"
7748
7749 #. type: Plain text
7750 #: build/C/man3/pthread_setschedparam.3:341
7751 #, no-wrap
7752 msgid ""
7753 "    if (main_sched_str != NULL) {\n"
7754 "        if (!get_policy(main_sched_str[0], &policy))\n"
7755 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
7756 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7757 msgstr ""
7758 "    if (main_sched_str != NULL) {\n"
7759 "        if (!get_policy(main_sched_str[0], &policy))\n"
7760 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
7761 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7762
7763 #. type: Plain text
7764 #: build/C/man3/pthread_setschedparam.3:346
7765 #, no-wrap
7766 msgid ""
7767 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
7768 "        if (s != 0)\n"
7769 "            handle_error_en(s, \"pthread_setschedparam\");\n"
7770 "    }\n"
7771 msgstr ""
7772 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
7773 "        if (s != 0)\n"
7774 "            handle_error_en(s, \"pthread_setschedparam\");\n"
7775 "    }\n"
7776
7777 #. type: Plain text
7778 #: build/C/man3/pthread_setschedparam.3:349
7779 #, no-wrap
7780 msgid ""
7781 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7782 "    printf(\"\\en\");\n"
7783 msgstr ""
7784 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7785 "    printf(\"\\en\");\n"
7786
7787 #. type: Plain text
7788 #: build/C/man3/pthread_setschedparam.3:351
7789 #, no-wrap
7790 msgid "    /* Initialize thread attributes object according to options */\n"
7791 msgstr "    /* Initialize thread attributes object according to options */\n"
7792
7793 #. type: Plain text
7794 #: build/C/man3/pthread_setschedparam.3:360
7795 #, no-wrap
7796 msgid ""
7797 "    if (!use_null_attrib) {\n"
7798 "        s = pthread_attr_init(&attr);\n"
7799 "        if (s != 0)\n"
7800 "            handle_error_en(s, \"pthread_attr_init\");\n"
7801 "        attrp = &attr;\n"
7802 "    }\n"
7803 msgstr ""
7804 "    if (!use_null_attrib) {\n"
7805 "        s = pthread_attr_init(&attr);\n"
7806 "        if (s != 0)\n"
7807 "            handle_error_en(s, \"pthread_attr_init\");\n"
7808 "        attrp = &attr;\n"
7809 "    }\n"
7810
7811 #. type: Plain text
7812 #: build/C/man3/pthread_setschedparam.3:368
7813 #, no-wrap
7814 msgid ""
7815 "    if (inheritsched_str != NULL) {\n"
7816 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7817 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7818 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7819 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
7820 "        else\n"
7821 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7822 msgstr ""
7823 "    if (inheritsched_str != NULL) {\n"
7824 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7825 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7826 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7827 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
7828 "        else\n"
7829 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7830
7831 #. type: Plain text
7832 #: build/C/man3/pthread_setschedparam.3:373
7833 #, no-wrap
7834 msgid ""
7835 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7836 "        if (s != 0)\n"
7837 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7838 "    }\n"
7839 msgstr ""
7840 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7841 "        if (s != 0)\n"
7842 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7843 "    }\n"
7844
7845 #. type: Plain text
7846 #: build/C/man3/pthread_setschedparam.3:379
7847 #, no-wrap
7848 msgid ""
7849 "    if (attr_sched_str != NULL) {\n"
7850 "        if (!get_policy(attr_sched_str[0], &policy))\n"
7851 "            usage(argv[0],\n"
7852 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7853 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7854 msgstr ""
7855 "    if (attr_sched_str != NULL) {\n"
7856 "        if (!get_policy(attr_sched_str[0], &policy))\n"
7857 "            usage(argv[0],\n"
7858 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7859 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7860
7861 #. type: Plain text
7862 #: build/C/man3/pthread_setschedparam.3:387
7863 #, no-wrap
7864 msgid ""
7865 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
7866 "        if (s != 0)\n"
7867 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7868 "        s = pthread_attr_setschedparam(&attr, &param);\n"
7869 "        if (s != 0)\n"
7870 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7871 "    }\n"
7872 msgstr ""
7873 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
7874 "        if (s != 0)\n"
7875 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7876 "        s = pthread_attr_setschedparam(&attr, &param);\n"
7877 "        if (s != 0)\n"
7878 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7879 "    }\n"
7880
7881 #. type: Plain text
7882 #: build/C/man3/pthread_setschedparam.3:390
7883 #, no-wrap
7884 msgid ""
7885 "    /* If we initialized a thread attributes object, display\n"
7886 "       the scheduling attributes that were set in the object */\n"
7887 msgstr ""
7888 "    /* If we initialized a thread attributes object, display\n"
7889 "       the scheduling attributes that were set in the object */\n"
7890
7891 #. type: Plain text
7892 #: build/C/man3/pthread_setschedparam.3:398
7893 #, no-wrap
7894 msgid ""
7895 "    if (attrp != NULL) {\n"
7896 "        s = pthread_attr_getschedparam(&attr, &param);\n"
7897 "        if (s != 0)\n"
7898 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7899 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7900 "        if (s != 0)\n"
7901 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7902 msgstr ""
7903 "    if (attrp != NULL) {\n"
7904 "        s = pthread_attr_getschedparam(&attr, &param);\n"
7905 "        if (s != 0)\n"
7906 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7907 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7908 "        if (s != 0)\n"
7909 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7910
7911 #. type: Plain text
7912 #: build/C/man3/pthread_setschedparam.3:401
7913 #, no-wrap
7914 msgid ""
7915 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7916 "        display_sched_attr(policy, &param);\n"
7917 msgstr ""
7918 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7919 "        display_sched_attr(policy, &param);\n"
7920
7921 #. type: Plain text
7922 #: build/C/man3/pthread_setschedparam.3:409
7923 #, no-wrap
7924 msgid ""
7925 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7926 "        printf(\"    inheritsched is %s\\en\",\n"
7927 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
7928 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7929 "                \"???\");\n"
7930 "        printf(\"\\en\");\n"
7931 "    }\n"
7932 msgstr ""
7933 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7934 "        printf(\"    inheritsched is %s\\en\",\n"
7935 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
7936 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7937 "                \"???\");\n"
7938 "        printf(\"\\en\");\n"
7939 "    }\n"
7940
7941 #. type: Plain text
7942 #: build/C/man3/pthread_setschedparam.3:411
7943 #, no-wrap
7944 msgid "    /* Create a thread that will display its scheduling attributes */\n"
7945 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
7946
7947 #. type: Plain text
7948 #: build/C/man3/pthread_setschedparam.3:415
7949 #, no-wrap
7950 msgid ""
7951 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7952 "    if (s != 0)\n"
7953 "        handle_error_en(s, \"pthread_create\");\n"
7954 msgstr ""
7955 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7956 "    if (s != 0)\n"
7957 "        handle_error_en(s, \"pthread_create\");\n"
7958
7959 #. type: Plain text
7960 #: build/C/man3/pthread_setschedparam.3:417
7961 #, no-wrap
7962 msgid "    /* Destroy unneeded thread attributes object */\n"
7963 msgstr "    /* Destroy unneeded thread attributes object */\n"
7964
7965 #. type: Plain text
7966 #: build/C/man3/pthread_setschedparam.3:425
7967 #, no-wrap
7968 msgid ""
7969 "    s = pthread_join(thread, NULL);\n"
7970 "    if (s != 0)\n"
7971 "        handle_error_en(s, \"pthread_join\");\n"
7972 msgstr ""
7973 "    s = pthread_join(thread, NULL);\n"
7974 "    if (s != 0)\n"
7975 "        handle_error_en(s, \"pthread_join\");\n"
7976
7977 #. type: Plain text
7978 #: build/C/man3/pthread_setschedparam.3:441
7979 msgid ""
7980 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7981 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7982 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7983 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
7984 "B<pthreads>(7)"
7985 msgstr ""
7986 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7987 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7988 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7989 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
7990 "B<pthreads>(7)"
7991
7992 #. type: TH
7993 #: build/C/man3/pthread_setschedprio.3:24
7994 #, no-wrap
7995 msgid "PTHREAD_SETSCHEDPRIO"
7996 msgstr "PTHREAD_SETSCHEDPRIO"
7997
7998 #. type: TH
7999 #: build/C/man3/pthread_setschedprio.3:24
8000 #, no-wrap
8001 msgid "2008-11-06"
8002 msgstr "2008-11-06"
8003
8004 #. type: Plain text
8005 #: build/C/man3/pthread_setschedprio.3:27
8006 msgid "pthread_setschedprio - set scheduling priority of a thread"
8007 msgstr ""
8008
8009 #. type: Plain text
8010 #: build/C/man3/pthread_setschedprio.3:32
8011 #, no-wrap
8012 msgid "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
8013 msgstr "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
8014
8015 #.  FIXME . nptl/pthread_setschedprio.c has the following
8016 #.    /* If the thread should have higher priority because of some
8017 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
8018 #.  Eventually (perhaps after writing the mutexattr pages), we
8019 #.  may want to add something on the topic to this page.
8020 #.  nptl/pthread_setschedparam.c has a similar case.
8021 #. type: Plain text
8022 #: build/C/man3/pthread_setschedprio.3:51
8023 msgid ""
8024 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
8025 "thread I<thread> to the value specified in I<prio>.  (By contrast "
8026 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
8027 "of a thread.)"
8028 msgstr ""
8029
8030 #. type: Plain text
8031 #: build/C/man3/pthread_setschedprio.3:59
8032 msgid ""
8033 "On success, this function returns 0; on error, it returns a nonzero error "
8034 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
8035 "I<thread> is not changed."
8036 msgstr ""
8037
8038 #. type: Plain text
8039 #: build/C/man3/pthread_setschedprio.3:64
8040 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
8041 msgstr ""
8042
8043 #. type: Plain text
8044 #: build/C/man3/pthread_setschedprio.3:68
8045 msgid ""
8046 "The caller does not have appropriate privileges to set the specified "
8047 "priority."
8048 msgstr ""
8049
8050 #. type: Plain text
8051 #: build/C/man3/pthread_setschedprio.3:79
8052 msgid ""
8053 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
8054 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
8055 msgstr ""
8056
8057 #. type: Plain text
8058 #: build/C/man3/pthread_setschedprio.3:81
8059 msgid "This function is available in glibc since version 2.3.4."
8060 msgstr "この関数は glibc バージョン 2.3.4 以降で利用できる。"
8061
8062 #. type: Plain text
8063 #: build/C/man3/pthread_setschedprio.3:89
8064 msgid ""
8065 "For a description of the permissions required to, and the effect of, "
8066 "changing a thread's scheduling priority, and details of the permitted ranges "
8067 "for priorities in each scheduling policy, see B<sched_setscheduler>(2)."
8068 msgstr ""
8069
8070 #. type: Plain text
8071 #: build/C/man3/pthread_setschedprio.3:101
8072 msgid ""
8073 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
8074 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
8075 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
8076 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
8077 "B<pthreads>(7)"
8078 msgstr ""
8079 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
8080 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
8081 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
8082 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
8083 "B<pthreads>(7)"
8084
8085 #. type: TH
8086 #: build/C/man3/pthread_sigmask.3:24
8087 #, no-wrap
8088 msgid "PTHREAD_SIGMASK"
8089 msgstr "PTHREAD_SIGMASK"
8090
8091 #. type: TH
8092 #: build/C/man3/pthread_sigmask.3:24
8093 #, no-wrap
8094 msgid "2011-10-16"
8095 msgstr "2011-10-16"
8096
8097 #. type: Plain text
8098 #: build/C/man3/pthread_sigmask.3:27
8099 msgid "pthread_sigmask - examine and change mask of blocked signals"
8100 msgstr ""
8101
8102 #. type: Plain text
8103 #: build/C/man3/pthread_sigmask.3:33
8104 #, no-wrap
8105 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
8106 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
8107
8108 #. type: Plain text
8109 #: build/C/man3/pthread_sigmask.3:44
8110 msgid ""
8111 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
8112 "difference that its use in multithreaded programs is explicitly specified by "
8113 "POSIX.1-2001.  Other differences are noted in this page."
8114 msgstr ""
8115
8116 #. type: Plain text
8117 #: build/C/man3/pthread_sigmask.3:47
8118 msgid ""
8119 "For a description of the arguments and operation of this function, see "
8120 "B<sigprocmask>(2)."
8121 msgstr ""
8122
8123 #. type: Plain text
8124 #: build/C/man3/pthread_sigmask.3:52
8125 msgid ""
8126 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
8127 "number."
8128 msgstr ""
8129
8130 #. type: Plain text
8131 #: build/C/man3/pthread_sigmask.3:55
8132 msgid "See B<sigprocmask>(2)."
8133 msgstr ""
8134
8135 #. type: Plain text
8136 #: build/C/man3/pthread_sigmask.3:59
8137 msgid "A new thread inherits a copy of its creator's signal mask."
8138 msgstr ""
8139
8140 #. type: Plain text
8141 #: build/C/man3/pthread_sigmask.3:64
8142 msgid ""
8143 "The program below blocks some signals in the main thread, and then creates a "
8144 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
8145 "shell session demonstrates its use:"
8146 msgstr ""
8147
8148 #. type: Plain text
8149 #: build/C/man3/pthread_sigmask.3:75
8150 #, no-wrap
8151 msgid ""
8152 "$B< ./a.out &>\n"
8153 "[1] 5423\n"
8154 "$B< kill -QUIT %1>\n"
8155 "Signal handling thread got signal 3\n"
8156 "$B< kill -USR1 %1>\n"
8157 "Signal handling thread got signal 10\n"
8158 "$B< kill -TERM %1>\n"
8159 "[1]+  Terminated              ./a.out\n"
8160 msgstr ""
8161 "$B< ./a.out &>\n"
8162 "[1] 5423\n"
8163 "$B< kill -QUIT %1>\n"
8164 "Signal handling thread got signal 3\n"
8165 "$B< kill -USR1 %1>\n"
8166 "Signal handling thread got signal 10\n"
8167 "$B< kill -TERM %1>\n"
8168 "[1]+  Terminated              ./a.out\n"
8169
8170 #. type: Plain text
8171 #: build/C/man3/pthread_sigmask.3:86
8172 #, no-wrap
8173 msgid ""
8174 "#include E<lt>pthread.hE<gt>\n"
8175 "#include E<lt>stdio.hE<gt>\n"
8176 "#include E<lt>stdlib.hE<gt>\n"
8177 "#include E<lt>unistd.hE<gt>\n"
8178 "#include E<lt>signal.hE<gt>\n"
8179 "#include E<lt>errno.hE<gt>\n"
8180 msgstr ""
8181 "#include E<lt>pthread.hE<gt>\n"
8182 "#include E<lt>stdio.hE<gt>\n"
8183 "#include E<lt>stdlib.hE<gt>\n"
8184 "#include E<lt>unistd.hE<gt>\n"
8185 "#include E<lt>signal.hE<gt>\n"
8186 "#include E<lt>errno.hE<gt>\n"
8187
8188 #. type: Plain text
8189 #: build/C/man3/pthread_sigmask.3:88
8190 #, no-wrap
8191 msgid "/* Simple error handling functions */\n"
8192 msgstr "/* Simple error handling functions */\n"
8193
8194 #. type: Plain text
8195 #: build/C/man3/pthread_sigmask.3:97
8196 #, no-wrap
8197 msgid ""
8198 "static void *\n"
8199 "sig_thread(void *arg)\n"
8200 "{\n"
8201 "    sigset_t *set = (sigset_t *) arg;\n"
8202 "    int s, sig;\n"
8203 msgstr ""
8204 "static void *\n"
8205 "sig_thread(void *arg)\n"
8206 "{\n"
8207 "    sigset_t *set = (sigset_t *) arg;\n"
8208 "    int s, sig;\n"
8209
8210 #. type: Plain text
8211 #: build/C/man3/pthread_sigmask.3:105
8212 #, no-wrap
8213 msgid ""
8214 "    for (;;) {\n"
8215 "        s = sigwait(set, &sig);\n"
8216 "        if (s != 0)\n"
8217 "            handle_error_en(s, \"sigwait\");\n"
8218 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
8219 "    }\n"
8220 "}\n"
8221 msgstr ""
8222 "    for (;;) {\n"
8223 "        s = sigwait(set, &sig);\n"
8224 "        if (s != 0)\n"
8225 "            handle_error_en(s, \"sigwait\");\n"
8226 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
8227 "    }\n"
8228 "}\n"
8229
8230 #. type: Plain text
8231 #: build/C/man3/pthread_sigmask.3:112
8232 #, no-wrap
8233 msgid ""
8234 "int\n"
8235 "main(int argc, char *argv[])\n"
8236 "{\n"
8237 "    pthread_t thread;\n"
8238 "    sigset_t set;\n"
8239 "    int s;\n"
8240 msgstr ""
8241 "int\n"
8242 "main(int argc, char *argv[])\n"
8243 "{\n"
8244 "    pthread_t thread;\n"
8245 "    sigset_t set;\n"
8246 "    int s;\n"
8247
8248 #. type: Plain text
8249 #: build/C/man3/pthread_sigmask.3:115
8250 #, no-wrap
8251 msgid ""
8252 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
8253 "       will inherit a copy of the signal mask. */\n"
8254 msgstr ""
8255 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
8256 "       will inherit a copy of the signal mask. */\n"
8257
8258 #. type: Plain text
8259 #: build/C/man3/pthread_sigmask.3:122
8260 #, no-wrap
8261 msgid ""
8262 "    sigemptyset(&set);\n"
8263 "    sigaddset(&set, SIGQUIT);\n"
8264 "    sigaddset(&set, SIGUSR1);\n"
8265 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
8266 "    if (s != 0)\n"
8267 "        handle_error_en(s, \"pthread_sigmask\");\n"
8268 msgstr ""
8269 "    sigemptyset(&set);\n"
8270 "    sigaddset(&set, SIGQUIT);\n"
8271 "    sigaddset(&set, SIGUSR1);\n"
8272 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
8273 "    if (s != 0)\n"
8274 "        handle_error_en(s, \"pthread_sigmask\");\n"
8275
8276 #. type: Plain text
8277 #: build/C/man3/pthread_sigmask.3:126
8278 #, no-wrap
8279 msgid ""
8280 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
8281 "    if (s != 0)\n"
8282 "        handle_error_en(s, \"pthread_create\");\n"
8283 msgstr ""
8284 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
8285 "    if (s != 0)\n"
8286 "        handle_error_en(s, \"pthread_create\");\n"
8287
8288 #. type: Plain text
8289 #: build/C/man3/pthread_sigmask.3:129
8290 #, no-wrap
8291 msgid ""
8292 "    /* Main thread carries on to create other threads and/or do\n"
8293 "       other work */\n"
8294 msgstr ""
8295 "    /* Main thread carries on to create other threads and/or do\n"
8296 "       other work */\n"
8297
8298 #. type: Plain text
8299 #: build/C/man3/pthread_sigmask.3:132
8300 #, no-wrap
8301 msgid ""
8302 "    pause();            /* Dummy pause so we can test program */\n"
8303 "}\n"
8304 msgstr ""
8305 "    pause();            /* Dummy pause so we can test program */\n"
8306 "}\n"
8307
8308 #. type: Plain text
8309 #: build/C/man3/pthread_sigmask.3:142
8310 msgid ""
8311 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), "
8312 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
8313 msgstr ""
8314 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), "
8315 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
8316
8317 #. type: TH
8318 #: build/C/man3/pthread_sigqueue.3:23
8319 #, no-wrap
8320 msgid "PTHREAD_SIGQUEUE"
8321 msgstr "PTHREAD_SIGQUEUE"
8322
8323 #. type: TH
8324 #: build/C/man3/pthread_sigqueue.3:23
8325 #, no-wrap
8326 msgid "2011-09-23"
8327 msgstr "2011-09-23"
8328
8329 #. type: Plain text
8330 #: build/C/man3/pthread_sigqueue.3:26
8331 msgid "pthread_sigqueue - queue a signal and data to a thread"
8332 msgstr ""
8333
8334 #. type: Plain text
8335 #: build/C/man3/pthread_sigqueue.3:32
8336 #, no-wrap
8337 msgid ""
8338 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
8339 "B<                     const union sigval >I<value>B<);>\n"
8340 msgstr ""
8341 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
8342 "B<                     const union sigval >I<value>B<);>\n"
8343
8344 #. type: Plain text
8345 #: build/C/man3/pthread_sigqueue.3:43
8346 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
8347 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
8348
8349 #. type: Plain text
8350 #: build/C/man3/pthread_sigqueue.3:51
8351 msgid ""
8352 "The B<pthread_sigqueue>()  function performs a similar task to B<sigqueue>"
8353 "(3), but, rather than sending a signal to another process, it sends a signal "
8354 "to another thread in the same process as the calling thread."
8355 msgstr ""
8356
8357 #. type: Plain text
8358 #: build/C/man3/pthread_sigqueue.3:63
8359 msgid ""
8360 "The I<thread> argument is the ID of another thread in the same process as "
8361 "the caller.  The I<sig> argument specifies the signal to be sent.  The "
8362 "I<value> argument specifies data to accompany the signal; see B<sigqueue>"
8363 "(3)  for details."
8364 msgstr ""
8365
8366 #. type: Plain text
8367 #: build/C/man3/pthread_sigqueue.3:68
8368 msgid ""
8369 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
8370 "number."
8371 msgstr ""
8372
8373 #. type: Plain text
8374 #: build/C/man3/pthread_sigqueue.3:75
8375 msgid ""
8376 "The limit of signals which may be queued has been reached.  (See B<signal>"
8377 "(7)  for further information.)"
8378 msgstr ""
8379
8380 #. type: Plain text
8381 #: build/C/man3/pthread_sigqueue.3:79
8382 msgid "I<sig> was invalid."
8383 msgstr ""
8384
8385 #. type: TP
8386 #: build/C/man3/pthread_sigqueue.3:79
8387 #, no-wrap
8388 msgid "B<ENOSYS>"
8389 msgstr "B<ENOSYS>"
8390
8391 #. type: Plain text
8392 #: build/C/man3/pthread_sigqueue.3:83
8393 msgid "B<pthread_sigqueue>()  is not supported on this system."
8394 msgstr ""
8395
8396 #. type: Plain text
8397 #: build/C/man3/pthread_sigqueue.3:87
8398 msgid "I<thread> is not valid."
8399 msgstr ""
8400
8401 #. type: Plain text
8402 #: build/C/man3/pthread_sigqueue.3:91
8403 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
8404 msgstr ""
8405
8406 #. type: Plain text
8407 #: build/C/man3/pthread_sigqueue.3:93
8408 msgid "This function is a GNU extension."
8409 msgstr "この関数は GNU による拡張である。"
8410
8411 #. type: Plain text
8412 #: build/C/man3/pthread_sigqueue.3:101
8413 msgid ""
8414 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), B<sigqueue>"
8415 "(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
8416 msgstr ""
8417 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
8418 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
8419
8420 #. type: TH
8421 #: build/C/man3/pthread_testcancel.3:24
8422 #, no-wrap
8423 msgid "PTHREAD_TESTCANCEL"
8424 msgstr "PTHREAD_TESTCANCEL"
8425
8426 #. type: TH
8427 #: build/C/man3/pthread_testcancel.3:24
8428 #, no-wrap
8429 msgid "2012-04-14"
8430 msgstr "2012-04-14"
8431
8432 #. type: Plain text
8433 #: build/C/man3/pthread_testcancel.3:27
8434 msgid ""
8435 "pthread_testcancel - request delivery of any pending cancellation request"
8436 msgstr ""
8437
8438 #. type: Plain text
8439 #: build/C/man3/pthread_testcancel.3:32
8440 #, no-wrap
8441 msgid "B<void pthread_testcancel(void);>\n"
8442 msgstr "B<void pthread_testcancel(void);>\n"
8443
8444 #. type: Plain text
8445 #: build/C/man3/pthread_testcancel.3:41
8446 msgid ""
8447 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
8448 "calling thread, so that a thread that is otherwise executing code that "
8449 "contains no cancellation points will respond to a cancellation request."
8450 msgstr ""
8451
8452 #. type: Plain text
8453 #: build/C/man3/pthread_testcancel.3:48
8454 msgid ""
8455 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
8456 "cancellation request is pending, then a call to B<pthread_testcancel>(3)  "
8457 "has no effect."
8458 msgstr ""
8459
8460 #. type: Plain text
8461 #: build/C/man3/pthread_testcancel.3:52
8462 msgid ""
8463 "This function does not return a value.  If the calling thread is canceled as "
8464 "a consequence of a call to this function, then the function does not return."
8465 msgstr ""
8466
8467 #. type: Plain text
8468 #: build/C/man3/pthread_testcancel.3:61
8469 msgid "See B<pthread_cleanup_push>(3)."
8470 msgstr ""
8471
8472 #. type: Plain text
8473 #: build/C/man3/pthread_testcancel.3:66
8474 msgid ""
8475 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
8476 "(3), B<pthreads>(7)"
8477 msgstr ""
8478 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
8479 "(3), B<pthreads>(7)"
8480
8481 #. type: TH
8482 #: build/C/man3/pthread_tryjoin_np.3:24
8483 #, no-wrap
8484 msgid "PTHREAD_TRYJOIN_NP"
8485 msgstr "PTHREAD_TRYJOIN_NP"
8486
8487 #. type: Plain text
8488 #: build/C/man3/pthread_tryjoin_np.3:28
8489 msgid ""
8490 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
8491 "thread"
8492 msgstr ""
8493
8494 #. type: Plain text
8495 #: build/C/man3/pthread_tryjoin_np.3:34
8496 #, no-wrap
8497 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
8498 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
8499
8500 #. type: Plain text
8501 #: build/C/man3/pthread_tryjoin_np.3:37
8502 #, no-wrap
8503 msgid ""
8504 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
8505 "B<                         const struct timespec *>I<abstime>B<);>\n"
8506 msgstr ""
8507 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
8508 "B<                         const struct timespec *>I<abstime>B<);>\n"
8509
8510 #. type: Plain text
8511 #: build/C/man3/pthread_tryjoin_np.3:44
8512 msgid ""
8513 "These functions operate in the same way as B<pthread_join>(3), except for "
8514 "the differences described on this page."
8515 msgstr ""
8516
8517 #. type: Plain text
8518 #: build/C/man3/pthread_tryjoin_np.3:56
8519 msgid ""
8520 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
8521 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
8522 "I<thread> has not yet terminated, then instead of blocking, as is done by "
8523 "B<pthread_join>(3), the call returns an error."
8524 msgstr ""
8525
8526 #. type: Plain text
8527 #: build/C/man3/pthread_tryjoin_np.3:74
8528 msgid ""
8529 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
8530 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
8531 "specified in I<abstime>.  If the timeout expires before I<thread> "
8532 "terminates, the call returns an error.  The I<abstime> argument is a "
8533 "structure of the following form, specifying an absolute time measured since "
8534 "the Epoch (see B<time>(2)):"
8535 msgstr ""
8536
8537 #. type: Plain text
8538 #: build/C/man3/pthread_tryjoin_np.3:81
8539 #, no-wrap
8540 msgid ""
8541 "struct timespec {\n"
8542 "    time_t tv_sec;     /* seconds */\n"
8543 "    long   tv_nsec;    /* nanoseconds */\n"
8544 "};\n"
8545 msgstr ""
8546 "struct timespec {\n"
8547 "    time_t tv_sec;     /* seconds */\n"
8548 "    long   tv_nsec;    /* nanoseconds */\n"
8549 "};\n"
8550
8551 #. type: Plain text
8552 #: build/C/man3/pthread_tryjoin_np.3:87
8553 msgid ""
8554 "On success, these functions return 0; on error, they return an error number."
8555 msgstr ""
8556
8557 #. type: Plain text
8558 #: build/C/man3/pthread_tryjoin_np.3:92
8559 msgid ""
8560 "These functions can fail with the same errors as B<pthread_join>(3).  "
8561 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
8562 msgstr ""
8563 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
8564 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
8565
8566 #. type: TP
8567 #: build/C/man3/pthread_tryjoin_np.3:92
8568 #, no-wrap
8569 msgid "B<EBUSY>"
8570 msgstr "B<EBUSY>"
8571
8572 #. type: Plain text
8573 #: build/C/man3/pthread_tryjoin_np.3:96
8574 msgid "I<thread> had not yet terminated at the time of the call."
8575 msgstr ""
8576
8577 #. type: Plain text
8578 #: build/C/man3/pthread_tryjoin_np.3:99
8579 msgid ""
8580 "B<pthread_timedjoin_np>()  can in addition fail with the following error:"
8581 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
8582
8583 #. type: TP
8584 #: build/C/man3/pthread_tryjoin_np.3:99
8585 #, no-wrap
8586 msgid "B<ETIMEDOUT>"
8587 msgstr "B<ETIMEDOUT>"
8588
8589 #. type: Plain text
8590 #: build/C/man3/pthread_tryjoin_np.3:104
8591 msgid "The call timed out before I<thread> terminated."
8592 msgstr ""
8593
8594 #. type: Plain text
8595 #: build/C/man3/pthread_tryjoin_np.3:108
8596 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
8597 msgstr ""
8598
8599 #. type: Plain text
8600 #: build/C/man3/pthread_tryjoin_np.3:110
8601 msgid "These functions first appeared in glibc in version 2.3.3."
8602 msgstr ""
8603
8604 #. type: Plain text
8605 #: build/C/man3/pthread_tryjoin_np.3:115
8606 msgid "The following code waits to join for up to 5 seconds:"
8607 msgstr ""
8608
8609 #. type: Plain text
8610 #: build/C/man3/pthread_tryjoin_np.3:119
8611 #, no-wrap
8612 msgid ""
8613 "    struct timespec ts;\n"
8614 "    int s;\n"
8615 msgstr ""
8616 "    struct timespec ts;\n"
8617 "    int s;\n"
8618
8619 #. type: Plain text
8620 #: build/C/man3/pthread_tryjoin_np.3:121
8621 #, no-wrap
8622 msgid "    ...\n"
8623 msgstr "    ...\n"
8624
8625 #. type: Plain text
8626 #: build/C/man3/pthread_tryjoin_np.3:125
8627 #, no-wrap
8628 msgid ""
8629 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8630 "\t/* Handle error */\n"
8631 "    }\n"
8632 msgstr ""
8633 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8634 "\t/* Handle error */\n"
8635 "    }\n"
8636
8637 #. type: Plain text
8638 #: build/C/man3/pthread_tryjoin_np.3:127
8639 #, no-wrap
8640 msgid "    ts.tv_sec += 5;\n"
8641 msgstr "    ts.tv_sec += 5;\n"
8642
8643 #. type: Plain text
8644 #: build/C/man3/pthread_tryjoin_np.3:132
8645 #, no-wrap
8646 msgid ""
8647 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8648 "    if (s != 0) {\n"
8649 "        /* Handle error */\n"
8650 "    }\n"
8651 msgstr ""
8652 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8653 "    if (s != 0) {\n"
8654 "        /* Handle error */\n"
8655 "    }\n"
8656
8657 #. type: Plain text
8658 #: build/C/man3/pthread_tryjoin_np.3:138
8659 msgid ""
8660 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8661 msgstr ""
8662 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8663
8664 #. type: TH
8665 #: build/C/man3/pthread_yield.3:23
8666 #, no-wrap
8667 msgid "PTHREAD_YIELD"
8668 msgstr "PTHREAD_YIELD"
8669
8670 #. type: Plain text
8671 #: build/C/man3/pthread_yield.3:26
8672 msgid "pthread_yield - yield the processor"
8673 msgstr ""
8674
8675 #. type: Plain text
8676 #: build/C/man3/pthread_yield.3:31
8677 #, no-wrap
8678 msgid "B<int pthread_yield(void);>\n"
8679 msgstr "B<int pthread_yield(void);>\n"
8680
8681 #. type: Plain text
8682 #: build/C/man3/pthread_yield.3:41
8683 msgid ""
8684 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
8685 "thread is placed at the end of the run queue for its static priority and "
8686 "another thread is scheduled to run.  For further details, see B<sched_yield>"
8687 "(2)"
8688 msgstr ""
8689
8690 #. type: Plain text
8691 #: build/C/man3/pthread_yield.3:46
8692 msgid ""
8693 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
8694 "number."
8695 msgstr ""
8696
8697 #. type: Plain text
8698 #: build/C/man3/pthread_yield.3:50
8699 msgid ""
8700 "On Linux, this call always succeeds (but portable and future-proof "
8701 "applications should nevertheless handle a possible error return)."
8702 msgstr ""
8703
8704 #.  e.g., the BSDs, Tru64, AIX, and Irix.
8705 #. type: Plain text
8706 #: build/C/man3/pthread_yield.3:56
8707 msgid ""
8708 "This call is nonstandard, but present on several other systems.  Use the "
8709 "standardized B<sched_yield>(2)  instead."
8710 msgstr ""
8711
8712 #. type: Plain text
8713 #: build/C/man3/pthread_yield.3:59
8714 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
8715 msgstr ""
8716
8717 #. type: Plain text
8718 #: build/C/man3/pthread_yield.3:63
8719 msgid "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
8720 msgstr "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
8721
8722 #. type: TH
8723 #: build/C/man7/pthreads.7:24
8724 #, no-wrap
8725 msgid "PTHREADS"
8726 msgstr "PTHREADS"
8727
8728 #. type: TH
8729 #: build/C/man7/pthreads.7:24
8730 #, no-wrap
8731 msgid "2010-11-14"
8732 msgstr "2010-11-14"
8733
8734 #. type: Plain text
8735 #: build/C/man7/pthreads.7:27
8736 msgid "pthreads - POSIX threads"
8737 msgstr "pthreads - POSIX スレッド"
8738
8739 #. type: Plain text
8740 #: build/C/man7/pthreads.7:34
8741 msgid ""
8742 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
8743 "programming commonly known as POSIX threads, or Pthreads.  A single process "
8744 "can contain multiple threads, all of which are executing the same program.  "
8745 "These threads share the same global memory (data and heap segments), but "
8746 "each thread has its own stack (automatic variables)."
8747 msgstr ""
8748 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
8749 "ラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロ"
8750 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
8751 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
8752 "スレッドは自分専用のスタック (自動変数) を持つ。"
8753
8754 #. type: Plain text
8755 #: build/C/man7/pthreads.7:37
8756 msgid ""
8757 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
8758 "these attributes are process-wide rather than per-thread):"
8759 msgstr ""
8760 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
8761 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
8762
8763 #. type: IP
8764 #: build/C/man7/pthreads.7:37 build/C/man7/pthreads.7:39
8765 #: build/C/man7/pthreads.7:41 build/C/man7/pthreads.7:43
8766 #: build/C/man7/pthreads.7:45 build/C/man7/pthreads.7:47
8767 #: build/C/man7/pthreads.7:49 build/C/man7/pthreads.7:52
8768 #: build/C/man7/pthreads.7:54 build/C/man7/pthreads.7:57
8769 #: build/C/man7/pthreads.7:63 build/C/man7/pthreads.7:68
8770 #: build/C/man7/pthreads.7:71 build/C/man7/pthreads.7:74
8771 #: build/C/man7/pthreads.7:82 build/C/man7/pthreads.7:86
8772 #: build/C/man7/pthreads.7:89 build/C/man7/pthreads.7:93
8773 #: build/C/man7/pthreads.7:96 build/C/man7/pthreads.7:103
8774 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
8775 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
8776 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
8777 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
8778 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
8779 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
8780 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
8781 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
8782 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
8783 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
8784 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
8785 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
8786 #: build/C/man7/pthreads.7:833
8787 #, no-wrap
8788 msgid "-"
8789 msgstr "-"
8790
8791 #. type: Plain text
8792 #: build/C/man7/pthreads.7:39
8793 msgid "process ID"
8794 msgstr "プロセス ID"
8795
8796 #. type: Plain text
8797 #: build/C/man7/pthreads.7:41
8798 msgid "parent process ID"
8799 msgstr "親プロセス ID"
8800
8801 #. type: Plain text
8802 #: build/C/man7/pthreads.7:43
8803 msgid "process group ID and session ID"
8804 msgstr "プロセスグループ ID とセッション ID"
8805
8806 #. type: Plain text
8807 #: build/C/man7/pthreads.7:45
8808 msgid "controlling terminal"
8809 msgstr "制御端末"
8810
8811 #. type: Plain text
8812 #: build/C/man7/pthreads.7:47
8813 msgid "user and group IDs"
8814 msgstr "ユーザ ID とグループ ID"
8815
8816 #. type: Plain text
8817 #: build/C/man7/pthreads.7:49
8818 msgid "open file descriptors"
8819 msgstr "オープンするファイルディスクリプタ"
8820
8821 #. type: Plain text
8822 #: build/C/man7/pthreads.7:52
8823 msgid "record locks (see B<fcntl>(2))"
8824 msgstr "レコードのロック (B<fcntl>(3)  参照)"
8825
8826 #. type: Plain text
8827 #: build/C/man7/pthreads.7:54
8828 msgid "signal dispositions"
8829 msgstr "シグナルの配置"
8830
8831 #. type: Plain text
8832 #: build/C/man7/pthreads.7:57
8833 msgid "file mode creation mask (B<umask>(2))"
8834 msgstr "ファイルモード作成マスク (B<umask>(2))"
8835
8836 #. type: Plain text
8837 #: build/C/man7/pthreads.7:63
8838 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
8839 msgstr ""
8840 "カレント・ディレクトリ (B<chdir>(2))  とルート・ディレクトリ (B<chroot>(2))"
8841
8842 #. type: Plain text
8843 #: build/C/man7/pthreads.7:68
8844 msgid ""
8845 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
8846 msgstr ""
8847 "インターバル・タイマ (B<setitimer>(2))  と POSIX タイマ (B<timer_create>(2))"
8848
8849 #. type: Plain text
8850 #: build/C/man7/pthreads.7:71
8851 msgid "nice value (B<setpriority>(2))"
8852 msgstr "nice 値 (B<setpriority>(2))"
8853
8854 #. type: Plain text
8855 #: build/C/man7/pthreads.7:74
8856 msgid "resource limits (B<setrlimit>(2))"
8857 msgstr "リソース制限 (B<setrlimit>(2))"
8858
8859 #. type: Plain text
8860 #: build/C/man7/pthreads.7:79
8861 msgid ""
8862 "measurements of the consumption of CPU time (B<times>(2))  and resources "
8863 "(B<getrusage>(2))"
8864 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
8865
8866 #. type: Plain text
8867 #: build/C/man7/pthreads.7:82
8868 msgid ""
8869 "As well as the stack, POSIX.1 specifies that various other attributes are "
8870 "distinct for each thread, including:"
8871 msgstr ""
8872 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
8873 "るかを規定している:"
8874
8875 #. type: Plain text
8876 #: build/C/man7/pthreads.7:86
8877 msgid "thread ID (the I<pthread_t> data type)"
8878 msgstr "スレッド ID (B<pthread_t> データ型)"
8879
8880 #. type: Plain text
8881 #: build/C/man7/pthreads.7:89
8882 msgid "signal mask (B<pthread_sigmask>(3))"
8883 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
8884
8885 #. type: Plain text
8886 #: build/C/man7/pthreads.7:93
8887 msgid "the I<errno> variable"
8888 msgstr "I<errno> 変数"
8889
8890 #. type: Plain text
8891 #: build/C/man7/pthreads.7:96
8892 msgid "alternate signal stack (B<sigaltstack>(2))"
8893 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
8894
8895 #. type: Plain text
8896 #: build/C/man7/pthreads.7:101
8897 msgid ""
8898 "real-time scheduling policy and priority (B<sched_setscheduler>(2)  and "
8899 "B<sched_setparam>(2))"
8900 msgstr ""
8901 "リアルタイム・スケジューリングのポリシーと優先度 (B<sched_setscheduler>(2)  "
8902 "と B<sched_setparam>(2))"
8903
8904 #. type: Plain text
8905 #: build/C/man7/pthreads.7:103
8906 msgid "The following Linux-specific features are also per-thread:"
8907 msgstr "以下の Linux 特有の機能もスレッド単位である:"
8908
8909 #. type: Plain text
8910 #: build/C/man7/pthreads.7:106
8911 msgid "capabilities (see B<capabilities>(7))"
8912 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
8913
8914 #. type: Plain text
8915 #: build/C/man7/pthreads.7:109
8916 msgid "CPU affinity (B<sched_setaffinity>(2))"
8917 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
8918
8919 #. type: SS
8920 #: build/C/man7/pthreads.7:109
8921 #, no-wrap
8922 msgid "Pthreads function return values"
8923 msgstr "pthreads 関数の返り値"
8924
8925 #. type: Plain text
8926 #: build/C/man7/pthreads.7:116
8927 msgid ""
8928 "Most pthreads functions return 0 on success, and an error number of "
8929 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
8930 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
8931 "the function can never fail with the error B<EINTR>."
8932 msgstr ""
8933 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
8934 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
8935 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
8936 "は決してないと規定している。"
8937
8938 #. type: SS
8939 #: build/C/man7/pthreads.7:116
8940 #, no-wrap
8941 msgid "Thread IDs"
8942 msgstr "スレッド ID"
8943
8944 #. type: Plain text
8945 #: build/C/man7/pthreads.7:130
8946 msgid ""
8947 "Each of the threads in a process has a unique thread identifier (stored in "
8948 "the type I<pthread_t>).  This identifier is returned to the caller of "
8949 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
8950 "using B<pthread_self>(3).  Thread IDs are only guaranteed to be unique "
8951 "within a process.  A thread ID may be reused after a terminated thread has "
8952 "been joined, or a detached thread has terminated.  In all pthreads functions "
8953 "that accept a thread ID as an argument, that ID by definition refers to a "
8954 "thread in the same process as the caller."
8955 msgstr ""
8956 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
8957 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
8958 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
8959 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
8960 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
8961 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
8962 "じプロセス内の一つのスレッドを参照する。"
8963
8964 #. type: SS
8965 #: build/C/man7/pthreads.7:130
8966 #, no-wrap
8967 msgid "Thread-safe functions"
8968 msgstr "スレッドセーフな関数"
8969
8970 #. type: Plain text
8971 #: build/C/man7/pthreads.7:134
8972 msgid ""
8973 "A thread-safe function is one that can be safely (i.e., it will deliver the "
8974 "same results regardless of whether it is)  called from multiple threads at "
8975 "the same time."
8976 msgstr ""
8977 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
8978 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
8979
8980 #. type: Plain text
8981 #: build/C/man7/pthreads.7:138
8982 msgid ""
8983 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
8984 "standard shall be thread-safe, except for the following functions:"
8985 msgstr ""
8986 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
8987 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
8988
8989 #. type: Plain text
8990 #: build/C/man7/pthreads.7:232
8991 #, no-wrap
8992 msgid ""
8993 "asctime()\n"
8994 "basename()\n"
8995 "catgets()\n"
8996 "crypt()\n"
8997 "ctermid() if passed a non-NULL argument\n"
8998 "ctime()\n"
8999 "dbm_clearerr()\n"
9000 "dbm_close()\n"
9001 "dbm_delete()\n"
9002 "dbm_error()\n"
9003 "dbm_fetch()\n"
9004 "dbm_firstkey()\n"
9005 "dbm_nextkey()\n"
9006 "dbm_open()\n"
9007 "dbm_store()\n"
9008 "dirname()\n"
9009 "dlerror()\n"
9010 "drand48()\n"
9011 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9012 "encrypt()\n"
9013 "endgrent()\n"
9014 "endpwent()\n"
9015 "endutxent()\n"
9016 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9017 "ftw()\n"
9018 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9019 "getc_unlocked()\n"
9020 "getchar_unlocked()\n"
9021 "getdate()\n"
9022 "getenv()\n"
9023 "getgrent()\n"
9024 "getgrgid()\n"
9025 "getgrnam()\n"
9026 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9027 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9028 "gethostent()\n"
9029 "getlogin()\n"
9030 "getnetbyaddr()\n"
9031 "getnetbyname()\n"
9032 "getnetent()\n"
9033 "getopt()\n"
9034 "getprotobyname()\n"
9035 "getprotobynumber()\n"
9036 "getprotoent()\n"
9037 "getpwent()\n"
9038 "getpwnam()\n"
9039 "getpwuid()\n"
9040 "getservbyname()\n"
9041 "getservbyport()\n"
9042 "getservent()\n"
9043 "getutxent()\n"
9044 "getutxid()\n"
9045 "getutxline()\n"
9046 "gmtime()\n"
9047 "hcreate()\n"
9048 "hdestroy()\n"
9049 "hsearch()\n"
9050 "inet_ntoa()\n"
9051 "l64a()\n"
9052 "lgamma()\n"
9053 "lgammaf()\n"
9054 "lgammal()\n"
9055 "localeconv()\n"
9056 "localtime()\n"
9057 "lrand48()\n"
9058 "mrand48()\n"
9059 "nftw()\n"
9060 "nl_langinfo()\n"
9061 "ptsname()\n"
9062 "putc_unlocked()\n"
9063 "putchar_unlocked()\n"
9064 "putenv()\n"
9065 "pututxline()\n"
9066 "rand()\n"
9067 "readdir()\n"
9068 "setenv()\n"
9069 "setgrent()\n"
9070 "setkey()\n"
9071 "setpwent()\n"
9072 "setutxent()\n"
9073 "strerror()\n"
9074 "strsignal() [Added in POSIX.1-2008]\n"
9075 "strtok()\n"
9076 "system() [Added in POSIX.1-2008]\n"
9077 "tmpnam() if passed a non-NULL argument\n"
9078 "ttyname()\n"
9079 "unsetenv()\n"
9080 "wcrtomb() if its final argument is NULL\n"
9081 "wcsrtombs() if its final argument is NULL\n"
9082 "wcstombs()\n"
9083 "wctomb()\n"
9084 msgstr ""
9085 "asctime()\n"
9086 "basename()\n"
9087 "catgets()\n"
9088 "crypt()\n"
9089 "ctermid() (NULL でない引き数を渡された場合)\n"
9090 "ctime()\n"
9091 "dbm_clearerr()\n"
9092 "dbm_close()\n"
9093 "dbm_delete()\n"
9094 "dbm_error()\n"
9095 "dbm_fetch()\n"
9096 "dbm_firstkey()\n"
9097 "dbm_nextkey()\n"
9098 "dbm_open()\n"
9099 "dbm_store()\n"
9100 "dirname()\n"
9101 "dlerror()\n"
9102 "drand48()\n"
9103 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9104 "encrypt()\n"
9105 "endgrent()\n"
9106 "endpwent()\n"
9107 "endutxent()\n"
9108 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9109 "ftw()\n"
9110 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9111 "getc_unlocked()\n"
9112 "getchar_unlocked()\n"
9113 "getdate()\n"
9114 "getenv()\n"
9115 "getgrent()\n"
9116 "getgrgid()\n"
9117 "getgrnam()\n"
9118 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9119 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9120 "gethostent()\n"
9121 "getlogin()\n"
9122 "getnetbyaddr()\n"
9123 "getnetbyname()\n"
9124 "getnetent()\n"
9125 "getopt()\n"
9126 "getprotobyname()\n"
9127 "getprotobynumber()\n"
9128 "getprotoent()\n"
9129 "getpwent()\n"
9130 "getpwnam()\n"
9131 "getpwuid()\n"
9132 "getservbyname()\n"
9133 "getservbyport()\n"
9134 "getservent()\n"
9135 "getutxent()\n"
9136 "getutxid()\n"
9137 "getutxline()\n"
9138 "gmtime()\n"
9139 "hcreate()\n"
9140 "hdestroy()\n"
9141 "hsearch()\n"
9142 "inet_ntoa()\n"
9143 "l64a()\n"
9144 "lgamma()\n"
9145 "lgammaf()\n"
9146 "lgammal()\n"
9147 "localeconv()\n"
9148 "localtime()\n"
9149 "lrand48()\n"
9150 "mrand48()\n"
9151 "nftw()\n"
9152 "nl_langinfo()\n"
9153 "ptsname()\n"
9154 "putc_unlocked()\n"
9155 "putchar_unlocked()\n"
9156 "putenv()\n"
9157 "pututxline()\n"
9158 "rand()\n"
9159 "readdir()\n"
9160 "setenv()\n"
9161 "setgrent()\n"
9162 "setkey()\n"
9163 "setpwent()\n"
9164 "setutxent()\n"
9165 "strerror()\n"
9166 "strsignal() [POSIX.1-2008 で追加された]\n"
9167 "strtok()\n"
9168 "system() [POSIX.1-2008 で追加された]\n"
9169 "tmpnam() (NULL でない引き数を渡された場合)\n"
9170 "ttyname()\n"
9171 "unsetenv()\n"
9172 "wcrtomb() (最後の引き数が NULL の場合)\n"
9173 "wcsrtombs() (最後の引き数が NULL の場合)\n"
9174 "wcstombs()\n"
9175 "wctomb()\n"
9176
9177 #. type: SS
9178 #: build/C/man7/pthreads.7:234
9179 #, no-wrap
9180 msgid "Async-cancel-safe functions"
9181 msgstr "async-cancel-safe 関数"
9182
9183 #. type: Plain text
9184 #: build/C/man7/pthreads.7:238
9185 msgid ""
9186 "An async-cancel-safe function is one that can be safely called in an "
9187 "application where asynchronous cancelability is enabled (see "
9188 "B<pthread_setcancelstate>(3))."
9189 msgstr ""
9190 "async-cancel-safe 関数は、\n"
9191 "非同期キャンセル機能が有効になっているアプリケーションで\n"
9192 "安全に呼び出すことができる関数のことである\n"
9193 "(B<pthread_setcancelstate>(3) を参照)。"
9194
9195 #. type: Plain text
9196 #: build/C/man7/pthreads.7:241
9197 msgid ""
9198 "Only the following functions are required to be async-cancel-safe by "
9199 "POSIX.1-2001 and POSIX.1-2008:"
9200 msgstr ""
9201 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
9202 "なければならないとされている。"
9203
9204 #. type: Plain text
9205 #: build/C/man7/pthreads.7:247
9206 #, no-wrap
9207 msgid ""
9208 "pthread_cancel()\n"
9209 "pthread_setcancelstate()\n"
9210 "pthread_setcanceltype()\n"
9211 msgstr ""
9212 "pthread_cancel()\n"
9213 "pthread_setcancelstate()\n"
9214 "pthread_setcanceltype()\n"
9215
9216 #. type: SS
9217 #: build/C/man7/pthreads.7:249
9218 #, no-wrap
9219 msgid "Cancellation Points"
9220 msgstr "取り消しポイント (cancellation points)"
9221
9222 #. type: Plain text
9223 #: build/C/man7/pthreads.7:256
9224 msgid ""
9225 "POSIX.1 specifies that certain functions must, and certain other functions "
9226 "may, be cancellation points.  If a thread is cancelable, its cancelability "
9227 "type is deferred, and a cancellation request is pending for the thread, then "
9228 "the thread is canceled when it calls a function that is a cancellation point."
9229 msgstr ""
9230 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
9231 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
9232 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
9233 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
9234 "時点で、そのスレッドのキャンセルが 行われる。"
9235
9236 #. type: Plain text
9237 #: build/C/man7/pthreads.7:259
9238 msgid ""
9239 "The following functions are required to be cancellation points by "
9240 "POSIX.1-2001 and/or POSIX.1-2008:"
9241 msgstr ""
9242 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
9243 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
9244
9245 #. type: Plain text
9246 #: build/C/man7/pthreads.7:322
9247 #, no-wrap
9248 msgid ""
9249 "accept()\n"
9250 "aio_suspend()\n"
9251 "clock_nanosleep()\n"
9252 "close()\n"
9253 "connect()\n"
9254 "creat()\n"
9255 "fcntl() F_SETLKW\n"
9256 "fdatasync()\n"
9257 "fsync()\n"
9258 "getmsg()\n"
9259 "getpmsg()\n"
9260 "lockf() F_LOCK\n"
9261 "mq_receive()\n"
9262 "mq_send()\n"
9263 "mq_timedreceive()\n"
9264 "mq_timedsend()\n"
9265 "msgrcv()\n"
9266 "msgsnd()\n"
9267 "msync()\n"
9268 "nanosleep()\n"
9269 "open()\n"
9270 "openat() [Added in POSIX.1-2008]\n"
9271 "pause()\n"
9272 "poll()\n"
9273 "pread()\n"
9274 "pselect()\n"
9275 "pthread_cond_timedwait()\n"
9276 "pthread_cond_wait()\n"
9277 "pthread_join()\n"
9278 "pthread_testcancel()\n"
9279 "putmsg()\n"
9280 "putpmsg()\n"
9281 "pwrite()\n"
9282 "read()\n"
9283 "readv()\n"
9284 "recv()\n"
9285 "recvfrom()\n"
9286 "recvmsg()\n"
9287 "select()\n"
9288 "sem_timedwait()\n"
9289 "sem_wait()\n"
9290 "send()\n"
9291 "sendmsg()\n"
9292 "sendto()\n"
9293 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
9294 "sigsuspend()\n"
9295 "sigtimedwait()\n"
9296 "sigwait()\n"
9297 "sigwaitinfo()\n"
9298 "sleep()\n"
9299 "system()\n"
9300 "tcdrain()\n"
9301 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9302 "wait()\n"
9303 "waitid()\n"
9304 "waitpid()\n"
9305 "write()\n"
9306 "writev()\n"
9307 msgstr ""
9308 "accept()\n"
9309 "aio_suspend()\n"
9310 "clock_nanosleep()\n"
9311 "close()\n"
9312 "connect()\n"
9313 "creat()\n"
9314 "fcntl() F_SETLKW\n"
9315 "fdatasync()\n"
9316 "fsync()\n"
9317 "getmsg()\n"
9318 "getpmsg()\n"
9319 "lockf() F_LOCK\n"
9320 "mq_receive()\n"
9321 "mq_send()\n"
9322 "mq_timedreceive()\n"
9323 "mq_timedsend()\n"
9324 "msgrcv()\n"
9325 "msgsnd()\n"
9326 "msync()\n"
9327 "nanosleep()\n"
9328 "open()\n"
9329 "openat() [POSIX.1-2008 で追加された]\n"
9330 "pause()\n"
9331 "poll()\n"
9332 "pread()\n"
9333 "pselect()\n"
9334 "pthread_cond_timedwait()\n"
9335 "pthread_cond_wait()\n"
9336 "pthread_join()\n"
9337 "pthread_testcancel()\n"
9338 "putmsg()\n"
9339 "putpmsg()\n"
9340 "pwrite()\n"
9341 "read()\n"
9342 "readv()\n"
9343 "recv()\n"
9344 "recvfrom()\n"
9345 "recvmsg()\n"
9346 "select()\n"
9347 "sem_timedwait()\n"
9348 "sem_wait()\n"
9349 "send()\n"
9350 "sendmsg()\n"
9351 "sendto()\n"
9352 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
9353 "sigsuspend()\n"
9354 "sigtimedwait()\n"
9355 "sigwait()\n"
9356 "sigwaitinfo()\n"
9357 "sleep()\n"
9358 "system()\n"
9359 "tcdrain()\n"
9360 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9361 "wait()\n"
9362 "waitid()\n"
9363 "waitpid()\n"
9364 "write()\n"
9365 "writev()\n"
9366
9367 #. type: Plain text
9368 #: build/C/man7/pthreads.7:327
9369 msgid ""
9370 "The following functions may be cancellation points according to POSIX.1-2001 "
9371 "and/or POSIX.1-2008:"
9372 msgstr ""
9373 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
9374 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
9375
9376 #. type: Plain text
9377 #: build/C/man7/pthreads.7:555
9378 #, no-wrap
9379 msgid ""
9380 "access()\n"
9381 "asctime()\n"
9382 "asctime_r()\n"
9383 "catclose()\n"
9384 "catgets()\n"
9385 "catopen()\n"
9386 "chmod() [Added in POSIX.1-2008]\n"
9387 "chown() [Added in POSIX.1-2008]\n"
9388 "closedir()\n"
9389 "closelog()\n"
9390 "ctermid()\n"
9391 "ctime()\n"
9392 "ctime_r()\n"
9393 "dbm_close()\n"
9394 "dbm_delete()\n"
9395 "dbm_fetch()\n"
9396 "dbm_nextkey()\n"
9397 "dbm_open()\n"
9398 "dbm_store()\n"
9399 "dlclose()\n"
9400 "dlopen()\n"
9401 "dprintf() [Added in POSIX.1-2008]\n"
9402 "endgrent()\n"
9403 "endhostent()\n"
9404 "endnetent()\n"
9405 "endprotoent()\n"
9406 "endpwent()\n"
9407 "endservent()\n"
9408 "endutxent()\n"
9409 "faccessat() [Added in POSIX.1-2008]\n"
9410 "fchmod() [Added in POSIX.1-2008]\n"
9411 "fchmodat() [Added in POSIX.1-2008]\n"
9412 "fchown() [Added in POSIX.1-2008]\n"
9413 "fchownat() [Added in POSIX.1-2008]\n"
9414 "fclose()\n"
9415 "fcntl() (for any value of cmd argument)\n"
9416 "fflush()\n"
9417 "fgetc()\n"
9418 "fgetpos()\n"
9419 "fgets()\n"
9420 "fgetwc()\n"
9421 "fgetws()\n"
9422 "fmtmsg()\n"
9423 "fopen()\n"
9424 "fpathconf()\n"
9425 "fprintf()\n"
9426 "fputc()\n"
9427 "fputs()\n"
9428 "fputwc()\n"
9429 "fputws()\n"
9430 "fread()\n"
9431 "freopen()\n"
9432 "fscanf()\n"
9433 "fseek()\n"
9434 "fseeko()\n"
9435 "fsetpos()\n"
9436 "fstat()\n"
9437 "fstatat() [Added in POSIX.1-2008]\n"
9438 "ftell()\n"
9439 "ftello()\n"
9440 "ftw()\n"
9441 "futimens() [Added in POSIX.1-2008]\n"
9442 "fwprintf()\n"
9443 "fwrite()\n"
9444 "fwscanf()\n"
9445 "getaddrinfo()\n"
9446 "getc()\n"
9447 "getc_unlocked()\n"
9448 "getchar()\n"
9449 "getchar_unlocked()\n"
9450 "getcwd()\n"
9451 "getdate()\n"
9452 "getdelim() [Added in POSIX.1-2008]\n"
9453 "getgrent()\n"
9454 "getgrgid()\n"
9455 "getgrgid_r()\n"
9456 "getgrnam()\n"
9457 "getgrnam_r()\n"
9458 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
9459 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
9460 "gethostent()\n"
9461 "gethostid()\n"
9462 "gethostname()\n"
9463 "getline() [Added in POSIX.1-2008]\n"
9464 "getlogin()\n"
9465 "getlogin_r()\n"
9466 "getnameinfo()\n"
9467 "getnetbyaddr()\n"
9468 "getnetbyname()\n"
9469 "getnetent()\n"
9470 "getopt() (if opterr is nonzero)\n"
9471 "getprotobyname()\n"
9472 "getprotobynumber()\n"
9473 "getprotoent()\n"
9474 "getpwent()\n"
9475 "getpwnam()\n"
9476 "getpwnam_r()\n"
9477 "getpwuid()\n"
9478 "getpwuid_r()\n"
9479 "gets()\n"
9480 "getservbyname()\n"
9481 "getservbyport()\n"
9482 "getservent()\n"
9483 "getutxent()\n"
9484 "getutxid()\n"
9485 "getutxline()\n"
9486 "getwc()\n"
9487 "getwchar()\n"
9488 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
9489 "glob()\n"
9490 "iconv_close()\n"
9491 "iconv_open()\n"
9492 "ioctl()\n"
9493 "link()\n"
9494 "linkat() [Added in POSIX.1-2008]\n"
9495 "lio_listio() [Added in POSIX.1-2008]\n"
9496 "localtime()\n"
9497 "localtime_r()\n"
9498 "lockf() [Added in POSIX.1-2008]\n"
9499 "lseek()\n"
9500 "lstat()\n"
9501 "mkdir() [Added in POSIX.1-2008]\n"
9502 "mkdirat() [Added in POSIX.1-2008]\n"
9503 "mkdtemp() [Added in POSIX.1-2008]\n"
9504 "mkfifo() [Added in POSIX.1-2008]\n"
9505 "mkfifoat() [Added in POSIX.1-2008]\n"
9506 "mknod() [Added in POSIX.1-2008]\n"
9507 "mknodat() [Added in POSIX.1-2008]\n"
9508 "mkstemp()\n"
9509 "mktime()\n"
9510 "nftw()\n"
9511 "opendir()\n"
9512 "openlog()\n"
9513 "pathconf()\n"
9514 "pclose()\n"
9515 "perror()\n"
9516 "popen()\n"
9517 "posix_fadvise()\n"
9518 "posix_fallocate()\n"
9519 "posix_madvise()\n"
9520 "posix_openpt()\n"
9521 "posix_spawn()\n"
9522 "posix_spawnp()\n"
9523 "posix_trace_clear()\n"
9524 "posix_trace_close()\n"
9525 "posix_trace_create()\n"
9526 "posix_trace_create_withlog()\n"
9527 "posix_trace_eventtypelist_getnext_id()\n"
9528 "posix_trace_eventtypelist_rewind()\n"
9529 "posix_trace_flush()\n"
9530 "posix_trace_get_attr()\n"
9531 "posix_trace_get_filter()\n"
9532 "posix_trace_get_status()\n"
9533 "posix_trace_getnext_event()\n"
9534 "posix_trace_open()\n"
9535 "posix_trace_rewind()\n"
9536 "posix_trace_set_filter()\n"
9537 "posix_trace_shutdown()\n"
9538 "posix_trace_timedgetnext_event()\n"
9539 "posix_typed_mem_open()\n"
9540 "printf()\n"
9541 "psiginfo() [Added in POSIX.1-2008]\n"
9542 "psignal() [Added in POSIX.1-2008]\n"
9543 "pthread_rwlock_rdlock()\n"
9544 "pthread_rwlock_timedrdlock()\n"
9545 "pthread_rwlock_timedwrlock()\n"
9546 "pthread_rwlock_wrlock()\n"
9547 "putc()\n"
9548 "putc_unlocked()\n"
9549 "putchar()\n"
9550 "putchar_unlocked()\n"
9551 "puts()\n"
9552 "pututxline()\n"
9553 "putwc()\n"
9554 "putwchar()\n"
9555 "readdir()\n"
9556 "readdir_r()\n"
9557 "readlink() [Added in POSIX.1-2008]\n"
9558 "readlinkat() [Added in POSIX.1-2008]\n"
9559 "remove()\n"
9560 "rename()\n"
9561 "renameat() [Added in POSIX.1-2008]\n"
9562 "rewind()\n"
9563 "rewinddir()\n"
9564 "scandir() [Added in POSIX.1-2008]\n"
9565 "scanf()\n"
9566 "seekdir()\n"
9567 "semop()\n"
9568 "setgrent()\n"
9569 "sethostent()\n"
9570 "setnetent()\n"
9571 "setprotoent()\n"
9572 "setpwent()\n"
9573 "setservent()\n"
9574 "setutxent()\n"
9575 "sigpause() [Added in POSIX.1-2008]\n"
9576 "stat()\n"
9577 "strerror()\n"
9578 "strerror_r()\n"
9579 "strftime()\n"
9580 "symlink()\n"
9581 "symlinkat() [Added in POSIX.1-2008]\n"
9582 "sync()\n"
9583 "syslog()\n"
9584 "tmpfile()\n"
9585 "tmpnam()\n"
9586 "ttyname()\n"
9587 "ttyname_r()\n"
9588 "tzset()\n"
9589 "ungetc()\n"
9590 "ungetwc()\n"
9591 "unlink()\n"
9592 "unlinkat() [Added in POSIX.1-2008]\n"
9593 "utime() [Added in POSIX.1-2008]\n"
9594 "utimensat() [Added in POSIX.1-2008]\n"
9595 "utimes() [Added in POSIX.1-2008]\n"
9596 "vdprintf() [Added in POSIX.1-2008]\n"
9597 "vfprintf()\n"
9598 "vfwprintf()\n"
9599 "vprintf()\n"
9600 "vwprintf()\n"
9601 "wcsftime()\n"
9602 "wordexp()\n"
9603 "wprintf()\n"
9604 "wscanf()\n"
9605 msgstr ""
9606 "access()\n"
9607 "asctime()\n"
9608 "asctime_r()\n"
9609 "catclose()\n"
9610 "catgets()\n"
9611 "catopen()\n"
9612 "chmod() [POSIX.1-2008 で追加された]\n"
9613 "chown() [POSIX.1-2008 で追加された]\n"
9614 "closedir()\n"
9615 "closelog()\n"
9616 "ctermid()\n"
9617 "ctime()\n"
9618 "ctime_r()\n"
9619 "dbm_close()\n"
9620 "dbm_delete()\n"
9621 "dbm_fetch()\n"
9622 "dbm_nextkey()\n"
9623 "dbm_open()\n"
9624 "dbm_store()\n"
9625 "dlclose()\n"
9626 "dlopen()\n"
9627 "dprintf() [POSIX.1-2008 で追加された]\n"
9628 "endgrent()\n"
9629 "endhostent()\n"
9630 "endnetent()\n"
9631 "endprotoent()\n"
9632 "endpwent()\n"
9633 "endservent()\n"
9634 "endutxent()\n"
9635 "faccessat() [POSIX.1-2008 で追加された]\n"
9636 "fchmod() [POSIX.1-2008 で追加された]\n"
9637 "fchmodat() [POSIX.1-2008 で追加された]\n"
9638 "fchown() [POSIX.1-2008 で追加された]\n"
9639 "fchownat() [POSIX.1-2008 で追加された]\n"
9640 "fclose()\n"
9641 "fcntl() (cmd 引き数が何であっても)\n"
9642 "fflush()\n"
9643 "fgetc()\n"
9644 "fgetpos()\n"
9645 "fgets()\n"
9646 "fgetwc()\n"
9647 "fgetws()\n"
9648 "fmtmsg()\n"
9649 "fopen()\n"
9650 "fpathconf()\n"
9651 "fprintf()\n"
9652 "fputc()\n"
9653 "fputs()\n"
9654 "fputwc()\n"
9655 "fputws()\n"
9656 "fread()\n"
9657 "freopen()\n"
9658 "fscanf()\n"
9659 "fseek()\n"
9660 "fseeko()\n"
9661 "fsetpos()\n"
9662 "fstat()\n"
9663 "fstatat() [POSIX.1-2008 で追加された]\n"
9664 "ftell()\n"
9665 "ftello()\n"
9666 "ftw()\n"
9667 "futimens() [POSIX.1-2008 で追加された]\n"
9668 "fwprintf()\n"
9669 "fwrite()\n"
9670 "fwscanf()\n"
9671 "getaddrinfo()\n"
9672 "getc()\n"
9673 "getc_unlocked()\n"
9674 "getchar()\n"
9675 "getchar_unlocked()\n"
9676 "getcwd()\n"
9677 "getdate()\n"
9678 "getdelim() [POSIX.1-2008 で追加された]\n"
9679 "getgrent()\n"
9680 "getgrgid()\n"
9681 "getgrgid_r()\n"
9682 "getgrnam()\n"
9683 "getgrnam_r()\n"
9684 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9685 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9686 "gethostent()\n"
9687 "gethostid()\n"
9688 "gethostname()\n"
9689 "getline() [POSIX.1-2008 で追加された]\n"
9690 "getlogin()\n"
9691 "getlogin_r()\n"
9692 "getnameinfo()\n"
9693 "getnetbyaddr()\n"
9694 "getnetbyname()\n"
9695 "getnetent()\n"
9696 "getopt() (opterr が 0 以外の場合)\n"
9697 "getprotobyname()\n"
9698 "getprotobynumber()\n"
9699 "getprotoent()\n"
9700 "getpwent()\n"
9701 "getpwnam()\n"
9702 "getpwnam_r()\n"
9703 "getpwuid()\n"
9704 "getpwuid_r()\n"
9705 "gets()\n"
9706 "getservbyname()\n"
9707 "getservbyport()\n"
9708 "getservent()\n"
9709 "getutxent()\n"
9710 "getutxid()\n"
9711 "getutxline()\n"
9712 "getwc()\n"
9713 "getwchar()\n"
9714 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9715 "glob()\n"
9716 "iconv_close()\n"
9717 "iconv_open()\n"
9718 "ioctl()\n"
9719 "link()\n"
9720 "linkat() [POSIX.1-2008 で追加された]\n"
9721 "lio_listio() [POSIX.1-2008 で追加された]\n"
9722 "localtime()\n"
9723 "localtime_r()\n"
9724 "lockf() [POSIX.1-2008 で追加された]\n"
9725 "lseek()\n"
9726 "lstat()\n"
9727 "mkdir() [POSIX.1-2008 で追加された]\n"
9728 "mkdirat() [POSIX.1-2008 で追加された]\n"
9729 "mkdtemp() [POSIX.1-2008 で追加された]\n"
9730 "mkfifo() [POSIX.1-2008 で追加された]\n"
9731 "mkfifoat() [POSIX.1-2008 で追加された]\n"
9732 "mknod() [POSIX.1-2008 で追加された]\n"
9733 "mknodat() [POSIX.1-2008 で追加された]\n"
9734 "mkstemp()\n"
9735 "mktime()\n"
9736 "nftw()\n"
9737 "opendir()\n"
9738 "openlog()\n"
9739 "pathconf()\n"
9740 "pclose()\n"
9741 "perror()\n"
9742 "popen()\n"
9743 "posix_fadvise()\n"
9744 "posix_fallocate()\n"
9745 "posix_madvise()\n"
9746 "posix_openpt()\n"
9747 "posix_spawn()\n"
9748 "posix_spawnp()\n"
9749 "posix_trace_clear()\n"
9750 "posix_trace_close()\n"
9751 "posix_trace_create()\n"
9752 "posix_trace_create_withlog()\n"
9753 "posix_trace_eventtypelist_getnext_id()\n"
9754 "posix_trace_eventtypelist_rewind()\n"
9755 "posix_trace_flush()\n"
9756 "posix_trace_get_attr()\n"
9757 "posix_trace_get_filter()\n"
9758 "posix_trace_get_status()\n"
9759 "posix_trace_getnext_event()\n"
9760 "posix_trace_open()\n"
9761 "posix_trace_rewind()\n"
9762 "posix_trace_set_filter()\n"
9763 "posix_trace_shutdown()\n"
9764 "posix_trace_timedgetnext_event()\n"
9765 "posix_typed_mem_open()\n"
9766 "printf()\n"
9767 "psiginfo() [POSIX.1-2008 で追加された]\n"
9768 "psignal() [POSIX.1-2008 で追加された]\n"
9769 "pthread_rwlock_rdlock()\n"
9770 "pthread_rwlock_timedrdlock()\n"
9771 "pthread_rwlock_timedwrlock()\n"
9772 "pthread_rwlock_wrlock()\n"
9773 "putc()\n"
9774 "putc_unlocked()\n"
9775 "putchar()\n"
9776 "putchar_unlocked()\n"
9777 "puts()\n"
9778 "pututxline()\n"
9779 "putwc()\n"
9780 "putwchar()\n"
9781 "readdir()\n"
9782 "readdir_r()\n"
9783 "readlink() [POSIX.1-2008 で追加された]\n"
9784 "readlinkat() [POSIX.1-2008 で追加された]\n"
9785 "remove()\n"
9786 "rename()\n"
9787 "renameat() [POSIX.1-2008 で追加された]\n"
9788 "rewind()\n"
9789 "rewinddir()\n"
9790 "scandir() [POSIX.1-2008 で追加された]\n"
9791 "scanf()\n"
9792 "seekdir()\n"
9793 "semop()\n"
9794 "setgrent()\n"
9795 "sethostent()\n"
9796 "setnetent()\n"
9797 "setprotoent()\n"
9798 "setpwent()\n"
9799 "setservent()\n"
9800 "setutxent()\n"
9801 "sigpause() [POSIX.1-2008 で追加された]\n"
9802 "stat()\n"
9803 "strerror()\n"
9804 "strerror_r()\n"
9805 "strftime()\n"
9806 "symlink()\n"
9807 "symlinkat() [POSIX.1-2008 で追加された]\n"
9808 "sync()\n"
9809 "syslog()\n"
9810 "tmpfile()\n"
9811 "tmpnam()\n"
9812 "ttyname()\n"
9813 "ttyname_r()\n"
9814 "tzset()\n"
9815 "ungetc()\n"
9816 "ungetwc()\n"
9817 "unlink()\n"
9818 "unlinkat() [POSIX.1-2008 で追加された]\n"
9819 "utime() [POSIX.1-2008 で追加された]\n"
9820 "utimensat() [POSIX.1-2008 で追加された]\n"
9821 "utimes() [POSIX.1-2008 で追加された]\n"
9822 "vdprintf() [POSIX.1-2008 で追加された]\n"
9823 "vfprintf()\n"
9824 "vfwprintf()\n"
9825 "vprintf()\n"
9826 "vwprintf()\n"
9827 "wcsftime()\n"
9828 "wordexp()\n"
9829 "wprintf()\n"
9830 "wscanf()\n"
9831
9832 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
9833 #.  files, it looks as though at least the following nonstandard
9834 #.  functions are cancellation points:
9835 #.  endnetgrent
9836 #.  endspent
9837 #.  epoll_pwait
9838 #.  epoll_wait
9839 #.  fcloseall
9840 #.  fdopendir
9841 #.  fflush_unlocked
9842 #.  fgetc_unlocked
9843 #.  fgetgrent
9844 #.  fgetgrent_r
9845 #.  fgetpwent
9846 #.  fgetpwent_r
9847 #.  fgets_unlocked
9848 #.  fgetspent
9849 #.  fgetspent_r
9850 #.  fgetwc_unlocked
9851 #.  fgetws_unlocked
9852 #.  fputc_unlocked
9853 #.  fputs_unlocked
9854 #.  fputwc_unlocked
9855 #.  fputws_unlocked
9856 #.  fread_unlocked
9857 #.  fwrite_unlocked
9858 #.  gai_suspend
9859 #.  getaddrinfo_a
9860 #.  getdate_r
9861 #.  getgrent_r
9862 #.  getgrouplist
9863 #.  gethostbyaddr_r
9864 #.  gethostbyname2
9865 #.  gethostbyname2_r
9866 #.  gethostbyname_r
9867 #.  gethostent_r
9868 #.  getnetbyaddr_r
9869 #.  getnetbyname_r
9870 #.  getnetent_r
9871 #.  getnetgrent
9872 #.  getnetgrent_r
9873 #.  getprotobyname_r
9874 #.  getprotobynumber_r
9875 #.  getprotoent_r
9876 #.  getpw
9877 #.  getpwent_r
9878 #.  getservbyname_r
9879 #.  getservbyport_r
9880 #.  getservent_r
9881 #.  getspent
9882 #.  getspent_r
9883 #.  getspnam
9884 #.  getspnam_r
9885 #.  getutmp
9886 #.  getutmpx
9887 #.  getw
9888 #.  getwc_unlocked
9889 #.  getwchar_unlocked
9890 #.  initgroups
9891 #.  innetgr
9892 #.  mkostemp
9893 #.  mkostemp64
9894 #.  mkstemp64
9895 #.  ppoll
9896 #.  pthread_timedjoin_np
9897 #.  putgrent
9898 #.  putpwent
9899 #.  putspent
9900 #.  putw
9901 #.  putwc_unlocked
9902 #.  putwchar_unlocked
9903 #.  rcmd
9904 #.  rcmd_af
9905 #.  rexec
9906 #.  rexec_af
9907 #.  rresvport
9908 #.  rresvport_af
9909 #.  ruserok
9910 #.  ruserok_af
9911 #.  setnetgrent
9912 #.  setspent
9913 #.  sgetspent
9914 #.  sgetspent_r
9915 #.  updwtmpx
9916 #.  utmpxname
9917 #.  vfscanf
9918 #.  vfwscanf
9919 #.  vscanf
9920 #.  vsyslog
9921 #.  vwscanf
9922 #. type: Plain text
9923 #: build/C/man7/pthreads.7:653
9924 msgid ""
9925 "An implementation may also mark other functions not specified in the "
9926 "standard as cancellation points.  In particular, an implementation is likely "
9927 "to mark any nonstandard function that may block as a cancellation point.  "
9928 "(This includes most functions that can touch files.)"
9929 msgstr ""
9930 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
9931 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
9932 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
9933 "関数がこれに含まれる)。"
9934
9935 #. type: SS
9936 #: build/C/man7/pthreads.7:653
9937 #, no-wrap
9938 msgid "Compiling on Linux"
9939 msgstr "Linux でのコンパイル"
9940
9941 #. type: Plain text
9942 #: build/C/man7/pthreads.7:656
9943 msgid ""
9944 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
9945 "pthread>."
9946 msgstr ""
9947 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
9948 "きである。"
9949
9950 #. type: SS
9951 #: build/C/man7/pthreads.7:656
9952 #, no-wrap
9953 msgid "Linux Implementations of POSIX Threads"
9954 msgstr "POSIX スレッドの Linux での実装"
9955
9956 #. type: Plain text
9957 #: build/C/man7/pthreads.7:659
9958 msgid ""
9959 "Over time, two threading implementations have been provided by the GNU C "
9960 "library on Linux:"
9961 msgstr ""
9962 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
9963 "た。"
9964
9965 #. type: TP
9966 #: build/C/man7/pthreads.7:659
9967 #, no-wrap
9968 msgid "B<LinuxThreads>"
9969 msgstr "B<LinuxThreads>"
9970
9971 #. type: Plain text
9972 #: build/C/man7/pthreads.7:663
9973 msgid ""
9974 "This is the original Pthreads implementation.  Since glibc 2.4, this "
9975 "implementation is no longer supported."
9976 msgstr ""
9977 "最初の Pthreads の実装。\n"
9978 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
9979
9980 #. type: TP
9981 #: build/C/man7/pthreads.7:663
9982 #, no-wrap
9983 msgid "B<NPTL> (Native POSIX Threads Library)"
9984 msgstr "B<NPTL> (Native POSIX Threads Library)"
9985
9986 #. type: Plain text
9987 #: build/C/man7/pthreads.7:671
9988 msgid ""
9989 "This is the modern Pthreads implementation.  By comparison with "
9990 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
9991 "POSIX.1 specification and better performance when creating large numbers of "
9992 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
9993 "are present in the Linux 2.6 kernel."
9994 msgstr ""
9995 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
9996 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
9997 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
9998 "装されている機能が必要である。"
9999
10000 #. type: Plain text
10001 #: build/C/man7/pthreads.7:681
10002 msgid ""
10003 "Both of these are so-called 1:1 implementations, meaning that each thread "
10004 "maps to a kernel scheduling entity.  Both threading implementations employ "
10005 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
10006 "primitives (mutexes, thread joining, etc.) are implemented using the Linux "
10007 "B<futex>(2)  system call."
10008 msgstr ""
10009 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
10010 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
10011 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
10012 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
10013 "使って実装されている。"
10014
10015 #. type: SS
10016 #: build/C/man7/pthreads.7:681
10017 #, no-wrap
10018 msgid "LinuxThreads"
10019 msgstr "LinuxThreads"
10020
10021 #. type: Plain text
10022 #: build/C/man7/pthreads.7:683
10023 msgid "The notable features of this implementation are the following:"
10024 msgstr "この実装の大きな特徴は以下の通りである:"
10025
10026 #. type: Plain text
10027 #: build/C/man7/pthreads.7:690
10028 msgid ""
10029 "In addition to the main (initial) thread, and the threads that the program "
10030 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
10031 "thread.  This thread handles thread creation and termination.  (Problems can "
10032 "result if this thread is inadvertently killed.)"
10033 msgstr ""
10034 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
10035 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
10036 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
10037 "kill されると、問題が起こることがある)。"
10038
10039 #. type: Plain text
10040 #: build/C/man7/pthreads.7:702
10041 msgid ""
10042 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
10043 "the first three real-time signals are used (see also B<signal>(7)).  On "
10044 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
10045 "avoid the use of whichever set of signals is employed by the implementation."
10046 msgstr ""
10047 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
10048 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
10049 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
10050 "用されているシグナルを どれも使わないようにしなければならない。"
10051
10052 #. type: Plain text
10053 #: build/C/man7/pthreads.7:709
10054 msgid ""
10055 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
10056 "implemented as processes which share more information than usual, but which "
10057 "do not share a common process ID.)  LinuxThreads threads (including the "
10058 "manager thread)  are visible as separate processes using B<ps>(1)."
10059 msgstr ""
10060 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
10061 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
10062 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
10063 "を使うと別のプロセスのように見える。"
10064
10065 #. type: Plain text
10066 #: build/C/man7/pthreads.7:712
10067 msgid ""
10068 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
10069 "number of ways, including the following:"
10070 msgstr ""
10071 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
10072 "示すような点がある:"
10073
10074 #. type: Plain text
10075 #: build/C/man7/pthreads.7:716
10076 msgid "Calls to B<getpid>(2)  return a different value in each thread."
10077 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
10078
10079 #. type: Plain text
10080 #: build/C/man7/pthreads.7:725
10081 msgid ""
10082 "Calls to B<getppid>(2)  in threads other than the main thread return the "
10083 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
10084 "should return the same value as B<getppid>(2)  in the main thread."
10085 msgstr ""
10086 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
10087 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
10088 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
10089
10090 #. type: Plain text
10091 #: build/C/man7/pthreads.7:735
10092 msgid ""
10093 "When one thread creates a new child process using B<fork>(2), any thread "
10094 "should be able to B<wait>(2)  on the child.  However, the implementation "
10095 "only allows the thread that created the child to B<wait>(2)  on it."
10096 msgstr ""
10097 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
10098 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
10099 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
10100 "る。"
10101
10102 #. type: Plain text
10103 #: build/C/man7/pthreads.7:742
10104 msgid ""
10105 "When a thread calls B<execve>(2), all other threads are terminated (as "
10106 "required by POSIX.1).  However, the resulting process has the same PID as "
10107 "the thread that called B<execve>(2): it should have the same PID as the main "
10108 "thread."
10109 msgstr ""
10110 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
10111 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
10112 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
10113 "る。"
10114
10115 #. type: Plain text
10116 #: build/C/man7/pthreads.7:749
10117 msgid ""
10118 "Threads do not share user and group IDs.  This can cause complications with "
10119 "set-user-ID programs and can cause failures in Pthreads functions if an "
10120 "application changes its credentials using B<seteuid>(2)  or similar."
10121 msgstr ""
10122 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
10123 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使っ"
10124 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
10125
10126 #. type: Plain text
10127 #: build/C/man7/pthreads.7:751
10128 msgid "Threads do not share a common session ID and process group ID."
10129 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
10130
10131 #. type: Plain text
10132 #: build/C/man7/pthreads.7:754
10133 msgid "Threads do not share record locks created using B<fcntl>(2)."
10134 msgstr ""
10135 "スレッド間で B<fcntl>(2)  を使って作成されるレコード・ロックを共有しない。"
10136
10137 #. type: Plain text
10138 #: build/C/man7/pthreads.7:760
10139 msgid ""
10140 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
10141 "rather than process-wide."
10142 msgstr ""
10143 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
10144 "単位の情報である。"
10145
10146 #. type: Plain text
10147 #: build/C/man7/pthreads.7:763
10148 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
10149 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
10150
10151 #. type: Plain text
10152 #: build/C/man7/pthreads.7:765
10153 msgid "Threads do not share interval timers."
10154 msgstr "スレッド間でインターバル・タイマを共有しない。"
10155
10156 #.  FIXME . bug report filed for NPTL nice nonconformance
10157 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
10158 #.  Sep 08: there is a patch by Denys Vlasenko to address this
10159 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
10160 #.  Monitor this to see if it makes it into mainline.
10161 #. type: Plain text
10162 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
10163 msgid "Threads do not share a common nice value."
10164 msgstr "スレッドは共通の nice 値を共有しない。"
10165
10166 #. type: Plain text
10167 #: build/C/man7/pthreads.7:777
10168 msgid ""
10169 "POSIX.1 distinguishes the notions of signals that are directed to the "
10170 "process as a whole and signals that are directed to individual threads.  "
10171 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
10172 "example) should be handled by a single, arbitrarily selected thread within "
10173 "the process.  LinuxThreads does not support the notion of process-directed "
10174 "signals: signals may only be sent to specific threads."
10175 msgstr ""
10176 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
10177 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
10178 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
10179 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
10180 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
10181 "ルは特定のスレッドにだけ送ることができる。"
10182
10183 #. type: Plain text
10184 #: build/C/man7/pthreads.7:786
10185 msgid ""
10186 "Threads have distinct alternate signal stack settings.  However, a new "
10187 "thread's alternate signal stack settings are copied from the thread that "
10188 "created it, so that the threads initially share an alternate signal stack.  "
10189 "(A new thread should start with no alternate signal stack defined.  If two "
10190 "threads handle signals on their shared alternate signal stack at the same "
10191 "time, unpredictable program failures are likely to occur.)"
10192 msgstr ""
10193 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
10194 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
10195 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
10196 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
10197 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
10198 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
10199
10200 #. type: SS
10201 #: build/C/man7/pthreads.7:786
10202 #, no-wrap
10203 msgid "NPTL"
10204 msgstr "NPTL"
10205
10206 #. type: Plain text
10207 #: build/C/man7/pthreads.7:795
10208 msgid ""
10209 "With NPTL, all of the threads in a process are placed in the same thread "
10210 "group; all members of a thread group share the same PID.  NPTL does not "
10211 "employ a manager thread.  NPTL makes internal use of the first two real-time "
10212 "signals (see also B<signal>(7)); these signals cannot be used in "
10213 "applications."
10214 msgstr ""
10215 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
10216 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
10217 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
10218 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
10219 "ションでは使用できない。"
10220
10221 #. type: Plain text
10222 #: build/C/man7/pthreads.7:797
10223 msgid "NPTL still has at least one nonconformance with POSIX.1:"
10224 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
10225
10226 #. type: Plain text
10227 #: build/C/man7/pthreads.7:806
10228 msgid "Some NPTL nonconformances only occur with older kernels:"
10229 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
10230
10231 #. type: Plain text
10232 #: build/C/man7/pthreads.7:812
10233 msgid ""
10234 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
10235 "rather than process-wide (fixed in kernel 2.6.9)."
10236 msgstr ""
10237 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
10238 "単位の情報である (カーネル 2.6.9 で修正された)。"
10239
10240 #. type: Plain text
10241 #: build/C/man7/pthreads.7:814
10242 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
10243 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
10244
10245 #. type: Plain text
10246 #: build/C/man7/pthreads.7:816
10247 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
10248 msgstr ""
10249 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
10250
10251 #. type: Plain text
10252 #: build/C/man7/pthreads.7:820
10253 msgid ""
10254 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
10255 "(fixed in kernel 2.6.16)."
10256 msgstr ""
10257 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
10258 "きる (カーネル 2.6.16 で修正された)。"
10259
10260 #. type: Plain text
10261 #: build/C/man7/pthreads.7:825
10262 msgid ""
10263 "Only the main thread is permitted to make the process into a process group "
10264 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
10265 msgstr ""
10266 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセス・グルー"
10267 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
10268
10269 #. type: Plain text
10270 #: build/C/man7/pthreads.7:831
10271 msgid ""
10272 "Threads have distinct alternate signal stack settings.  However, a new "
10273 "thread's alternate signal stack settings are copied from the thread that "
10274 "created it, so that the threads initially share an alternate signal stack "
10275 "(fixed in kernel 2.6.16)."
10276 msgstr ""
10277 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
10278 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
10279 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
10280 "ル 2.6.16 で修正された)。"
10281
10282 #. type: Plain text
10283 #: build/C/man7/pthreads.7:833
10284 msgid "Note the following further points about the NPTL implementation:"
10285 msgstr "NPTL の実装では以下の点についても注意すること:"
10286
10287 #. type: Plain text
10288 #: build/C/man7/pthreads.7:847
10289 msgid ""
10290 "If the stack size soft resource limit (see the description of "
10291 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
10292 "I<unlimited>, then this value defines the default stack size for new "
10293 "threads.  To be effective, this limit must be set before the program is "
10294 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
10295 "stacksize> in the C shell)."
10296 msgstr ""
10297 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2)  の "
10298 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
10299 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
10300 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
10301 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
10302 "は I<limit stacksize>)  を使って設定する。"
10303
10304 #. type: SS
10305 #: build/C/man7/pthreads.7:847
10306 #, no-wrap
10307 msgid "Determining the Threading Implementation"
10308 msgstr "スレッド実装の判定"
10309
10310 #. type: Plain text
10311 #: build/C/man7/pthreads.7:852
10312 msgid ""
10313 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
10314 "system's threading implementation, for example:"
10315 msgstr ""
10316 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
10317 "装を判定することができる。 以下に例を示す:"
10318
10319 #. type: Plain text
10320 #: build/C/man7/pthreads.7:857
10321 #, no-wrap
10322 msgid ""
10323 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
10324 "NPTL 2.3.4\n"
10325 msgstr ""
10326 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
10327 "NPTL 2.3.4\n"
10328
10329 #. type: Plain text
10330 #: build/C/man7/pthreads.7:862
10331 msgid ""
10332 "With older glibc versions, a command such as the following should be "
10333 "sufficient to determine the default threading implementation:"
10334 msgstr ""
10335 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
10336 "ド実装を判定することができる。"
10337
10338 #. type: Plain text
10339 #: build/C/man7/pthreads.7:868
10340 #, no-wrap
10341 msgid ""
10342 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
10343 "                egrep -i \\(aqthreads|nptl\\(aq\n"
10344 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
10345 msgstr ""
10346 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
10347 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
10348 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
10349
10350 #. type: SS
10351 #: build/C/man7/pthreads.7:870
10352 #, no-wrap
10353 msgid "Selecting the Threading Implementation: LD_ASSUME_KERNEL"
10354 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
10355
10356 #. type: Plain text
10357 #: build/C/man7/pthreads.7:885
10358 msgid ""
10359 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
10360 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
10361 "override the dynamic linker's default choice of threading implementation.  "
10362 "This variable tells the dynamic linker to assume that it is running on top "
10363 "of a particular kernel version.  By specifying a kernel version that does "
10364 "not provide the support required by NPTL, we can force the use of "
10365 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
10366 "application that depends on some nonconformant behavior in LinuxThreads.)  "
10367 "For example:"
10368 msgstr ""
10369 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
10370 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
10371 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
10372 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
10373 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
10374 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
10375 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
10376 "ン を動作させる場合だろう)。 以下に例を示す:"
10377
10378 #. type: Plain text
10379 #: build/C/man7/pthreads.7:891
10380 #, no-wrap
10381 msgid ""
10382 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
10383 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
10384 "        linuxthreads-0.10 by Xavier Leroy\n"
10385 msgstr ""
10386 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
10387 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
10388 "        linuxthreads-0.10 by Xavier Leroy\n"
10389
10390 #. type: Plain text
10391 #: build/C/man7/pthreads.7:903
10392 msgid ""
10393 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), B<sigevent>"
10394 "(7), B<signal>(7),"
10395 msgstr ""
10396 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
10397 "B<signal>(7),"
10398
10399 #. type: Plain text
10400 #: build/C/man7/pthreads.7:927
10401 msgid ""
10402 "and various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
10403 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
10404 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
10405 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
10406 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
10407 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>"
10408 "(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), "
10409 "B<pthread_sigmask>(3), B<pthread_sigqueue>(3), and B<pthread_testcancel>(3)"
10410 msgstr ""
10411 "および Pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
10412 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
10413 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
10414 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
10415 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
10416 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
10417 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
10418 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
10419 "and B<pthread_testcancel>(3)"