OSDN Git Service

(split) LDP: Translation snapshots of 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-28 07:16+0900\n"
10 "PO-Revision-Date: 2012-06-04 23:34+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.41 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.41 の一部\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 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲"
1925 "は、\n"
1926 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
1927
1928 #. type: Plain text
1929 #: build/C/man3/pthread_attr_setaffinity_np.3:100
1930 msgid ""
1931 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
1932 "attributes object referred to by I<attr> lies outside the range specified by "
1933 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
1934 msgstr ""
1935 "(B<pthread_attr_getaffinity_np>())\n"
1936 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
1937 "I<cpusetsize> により指定された範囲の中になかった\n"
1938 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
1939
1940 #. type: Plain text
1941 #: build/C/man3/pthread_attr_setaffinity_np.3:104
1942 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
1943 msgstr ""
1944 "(B<pthread_attr_setaffinity_np>()) メモリを割り当てることができなかった。"
1945
1946 #. type: Plain text
1947 #: build/C/man3/pthread_attr_setaffinity_np.3:106
1948 #: build/C/man3/pthread_setaffinity_np.3:119
1949 msgid "These functions are provided by glibc since version 2.3.4."
1950 msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。"
1951
1952 #. type: Plain text
1953 #: build/C/man3/pthread_attr_setaffinity_np.3:109
1954 #: build/C/man3/pthread_cleanup_push_defer_np.3:102
1955 #: build/C/man3/pthread_setaffinity_np.3:122
1956 #: build/C/man3/pthread_tryjoin_np.3:113
1957 msgid ""
1958 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
1959 "\" (nonportable) in the names."
1960 msgstr ""
1961 "これらの関数は非標準の GNU による拡張である。\n"
1962 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
1963 "付いている。"
1964
1965 #. type: Plain text
1966 #: build/C/man3/pthread_attr_setaffinity_np.3:116
1967 #: build/C/man3/pthread_setaffinity_np.3:148
1968 msgid ""
1969 "In glibc 2.3.3 only, versions of these functions were provided that did not "
1970 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
1971 "underlying system calls was always I<sizeof(cpu_set_t)>."
1972 msgstr ""
1973 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
1974 "これらの関数は I<cpusetsize> 引き数を持っていなかった。\n"
1975 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
1976 "常に I<sizeof(cpu_set_t)> であった。"
1977
1978 #. type: Plain text
1979 #: build/C/man3/pthread_attr_setaffinity_np.3:122
1980 msgid ""
1981 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1982 "(3), B<cpuset>(7), B<pthreads>(7)"
1983 msgstr ""
1984 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1985 "(3), B<cpuset>(7), B<pthreads>(7)"
1986
1987 #. type: TH
1988 #: build/C/man3/pthread_attr_setdetachstate.3:24
1989 #, no-wrap
1990 msgid "PTHREAD_ATTR_SETDETACHSTATE"
1991 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
1992
1993 #. type: TH
1994 #: build/C/man3/pthread_attr_setdetachstate.3:24
1995 #: build/C/man3/pthread_attr_setschedpolicy.3:24
1996 #, no-wrap
1997 msgid "2010-02-03"
1998 msgstr "2010-02-03"
1999
2000 #. type: Plain text
2001 #: build/C/man3/pthread_attr_setdetachstate.3:28
2002 msgid ""
2003 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
2004 "state attribute in thread attributes object"
2005 msgstr ""
2006 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
2007 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
2008
2009 #. type: Plain text
2010 #: build/C/man3/pthread_attr_setdetachstate.3:36
2011 #, no-wrap
2012 msgid ""
2013 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2014 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2015 msgstr ""
2016 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2017 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2018
2019 #. type: Plain text
2020 #: build/C/man3/pthread_attr_setdetachstate.3:51
2021 msgid ""
2022 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
2023 "attribute of the thread attributes object referred to by I<attr> to the "
2024 "value specified in I<detachstate>.  The detach state attribute determines "
2025 "whether a thread created using the thread attributes object I<attr> will be "
2026 "created in a joinable or a detached state."
2027 msgstr ""
2028 "B<pthread_attr_setdetachstate>() 関数は、\n"
2029 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
2030 "I<detachstate> で指定された値に設定する。\n"
2031 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2032 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
2033 "detached (切り離された) 状態で作成されるかが決定される。"
2034
2035 #. type: Plain text
2036 #: build/C/man3/pthread_attr_setdetachstate.3:54
2037 msgid "The following values may be specified in I<detachstate>:"
2038 msgstr "I<detachstate> には以下の値を指定できる。"
2039
2040 #. type: TP
2041 #: build/C/man3/pthread_attr_setdetachstate.3:54
2042 #, no-wrap
2043 msgid "B<PTHREAD_CREATE_DETACHED>"
2044 msgstr "B<PTHREAD_CREATE_DETACHED>"
2045
2046 #. type: Plain text
2047 #: build/C/man3/pthread_attr_setdetachstate.3:59
2048 msgid ""
2049 "Threads that are created using I<attr> will be created in a detached state."
2050 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
2051
2052 #. type: TP
2053 #: build/C/man3/pthread_attr_setdetachstate.3:59
2054 #, no-wrap
2055 msgid "B<PTHREAD_CREATE_JOINABLE>"
2056 msgstr "B<PTHREAD_CREATE_JOINABLE>"
2057
2058 #. type: Plain text
2059 #: build/C/man3/pthread_attr_setdetachstate.3:64
2060 msgid ""
2061 "Threads that are created using I<attr> will be created in a joinable state."
2062 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
2063
2064 #. type: Plain text
2065 #: build/C/man3/pthread_attr_setdetachstate.3:68
2066 msgid ""
2067 "The default setting of the detach state attribute in a newly initialized "
2068 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
2069 msgstr ""
2070 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
2071 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
2072
2073 #. type: Plain text
2074 #: build/C/man3/pthread_attr_setdetachstate.3:75
2075 msgid ""
2076 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
2077 "the thread attributes object I<attr> in the buffer pointed to by "
2078 "I<detachstate>."
2079 msgstr ""
2080 "B<pthread_attr_getdetachstate>() は、\n"
2081 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
2082 "I<detachstate> が指すバッファに入れて返す。"
2083
2084 #. type: Plain text
2085 #: build/C/man3/pthread_attr_setdetachstate.3:81
2086 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
2087 msgstr "B<pthread_attr_setdetachstate>() は以下のエラーで失敗する場合がある。"
2088
2089 #. type: Plain text
2090 #: build/C/man3/pthread_attr_setdetachstate.3:85
2091 msgid "An invalid value was specified in I<detachstate>."
2092 msgstr "無効な値が I<detachstate> で指定された。"
2093
2094 #. type: Plain text
2095 #: build/C/man3/pthread_attr_setdetachstate.3:91
2096 msgid ""
2097 "See B<pthread_create>(3)  for more details on detached and joinable threads."
2098 msgstr ""
2099 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
2100 "B<pthread_create>(3) を参照。"
2101
2102 #. type: Plain text
2103 #: build/C/man3/pthread_attr_setdetachstate.3:99
2104 msgid ""
2105 "A thread that is created in a joinable state should eventually either be "
2106 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
2107 "B<pthread_create>(3)."
2108 msgstr ""
2109 "join 可能状態で作成されたスレッドは、最終的に\n"
2110 "B<pthread_join>(3) を使って join するか、\n"
2111 "B<pthread_detach>(3) を使って切り離すか、\n"
2112 "のどちらかを行うべきである。"
2113
2114 #. type: Plain text
2115 #: build/C/man3/pthread_attr_setdetachstate.3:106
2116 msgid ""
2117 "It is an error to specify the thread ID of a thread that was created in a "
2118 "detached state in a later call to B<pthread_detach>(3)  or B<pthread_join>"
2119 "(3)."
2120 msgstr ""
2121 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
2122 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
2123 "エラーである。"
2124
2125 #. type: Plain text
2126 #: build/C/man3/pthread_attr_setdetachstate.3:109
2127 #: build/C/man3/pthread_attr_setstack.3:154
2128 msgid "See B<pthread_attr_init>(3)."
2129 msgstr "B<pthread_attr_init>(3) を参照。"
2130
2131 #. type: Plain text
2132 #: build/C/man3/pthread_attr_setdetachstate.3:115
2133 msgid ""
2134 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2135 "B<pthread_join>(3), B<pthreads>(7)"
2136 msgstr ""
2137 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2138 "B<pthread_join>(3), B<pthreads>(7)"
2139
2140 #. type: TH
2141 #: build/C/man3/pthread_attr_setguardsize.3:24
2142 #, no-wrap
2143 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2144 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2145
2146 #. type: TH
2147 #: build/C/man3/pthread_attr_setguardsize.3:24
2148 #: build/C/man3/pthread_attr_setscope.3:24
2149 #: build/C/man3/pthread_attr_setstack.3:24
2150 #: build/C/man3/pthread_attr_setstackaddr.3:24 build/C/man3/pthread_self.3:24
2151 #, no-wrap
2152 msgid "2008-10-24"
2153 msgstr "2008-10-24"
2154
2155 #. type: Plain text
2156 #: build/C/man3/pthread_attr_setguardsize.3:28
2157 msgid ""
2158 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2159 "attribute in thread attributes object"
2160 msgstr ""
2161 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
2162 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
2163
2164 #. type: Plain text
2165 #: build/C/man3/pthread_attr_setguardsize.3:36
2166 #, no-wrap
2167 msgid ""
2168 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2169 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2170 msgstr ""
2171 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2172 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2173
2174 #. type: Plain text
2175 #: build/C/man3/pthread_attr_setguardsize.3:47
2176 msgid ""
2177 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
2178 "of the thread attributes object referred to by I<attr> to the value "
2179 "specified in I<guardsize>."
2180 msgstr ""
2181 "B<pthread_attr_setguardsize>() 関数は、\n"
2182 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
2183 "I<guardsize> で指定された値に設定する。"
2184
2185 #. type: Plain text
2186 #: build/C/man3/pthread_attr_setguardsize.3:57
2187 msgid ""
2188 "If I<guardsize> is greater than 0, then for each new thread created using "
2189 "I<attr> the system allocates an additional region of at least I<guardsize> "
2190 "bytes at the end of the thread's stack to act as the guard area for the "
2191 "stack (but see BUGS)."
2192 msgstr ""
2193 "I<guardsize> が 0 より大きい場合、\n"
2194 "I<attr> を使って新しく作成された各スレッドに対して、\n"
2195 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
2196 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
2197 "機能する (ただし「バグ」の節も参照)。"
2198
2199 #. type: Plain text
2200 #: build/C/man3/pthread_attr_setguardsize.3:63
2201 msgid ""
2202 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2203 "guard area."
2204 msgstr ""
2205 "I<guardsize> が 0 の場合、\n"
2206 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
2207
2208 #. type: Plain text
2209 #: build/C/man3/pthread_attr_setguardsize.3:65
2210 msgid "The default guard size is the same as the system page size."
2211 msgstr "デフォルトの guard size はシステムのページサイズと同じである。"
2212
2213 #. type: Plain text
2214 #: build/C/man3/pthread_attr_setguardsize.3:80
2215 msgid ""
2216 "If the stack address attribute has been set in I<attr> (using "
2217 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
2218 "that the caller is allocating the thread's stack, then the guard size "
2219 "attribute is ignored (i.e., no guard area is created by the system): it is "
2220 "the application's responsibility to handle stack overflow (perhaps by using "
2221 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
2222 "it has allocated)."
2223 msgstr ""
2224 "(B<pthread_attr_setstack>(3) や B<pthread_attr_setstackaddr>(3)を使って)\n"
2225 "I<attr> でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n"
2226 "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n"
2227 "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n"
2228 "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n"
2229 "ケーション側の責任となる (おそらく B<mprotect>(2) を使って、割り当て\n"
2230 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
2231
2232 #. type: Plain text
2233 #: build/C/man3/pthread_attr_setguardsize.3:88
2234 msgid ""
2235 "The B<pthread_attr_getguardsize>()  function returns the guard size "
2236 "attribute of the thread attributes object referred to by I<attr> in the "
2237 "buffer pointed to by I<guardsize>."
2238 msgstr ""
2239 "B<pthread_attr_getguardsize>() は、\n"
2240 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
2241 "I<guardsize> が指すバッファに入れて返す。"
2242
2243 #. type: Plain text
2244 #: build/C/man3/pthread_attr_setguardsize.3:102
2245 msgid ""
2246 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2247 "invalid.  On Linux these functions always succeed (but portable and future-"
2248 "proof applications should nevertheless handle a possible error return)."
2249 msgstr ""
2250 "POSIX.1-2001 では、エラー B<EINVAL> が\n"
2251 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2252 "Linux では、これらの関数は常に成功する\n"
2253 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2254 "正のエラーの返り値を処理するようにすべきである)。"
2255
2256 #. type: Plain text
2257 #: build/C/man3/pthread_attr_setguardsize.3:104
2258 #: build/C/man3/pthread_attr_setstackaddr.3:81
2259 #: build/C/man3/pthread_attr_setstacksize.3:81
2260 msgid "These functions are provided by glibc since version 2.1."
2261 msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。"
2262
2263 #. type: Plain text
2264 #: build/C/man3/pthread_attr_setguardsize.3:120
2265 msgid ""
2266 "A guard area consists of virtual memory pages that are protected to prevent "
2267 "read and write access.  If a thread overflows its stack into the guard area, "
2268 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2269 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
2270 "guard size is internally rounded up to the system page size when creating a "
2271 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
2272 "size that was set by B<pthread_attr_setguardsize>().)"
2273 msgstr ""
2274 "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n"
2275 "られた仮想メモリページで構成で構成される。スレッドがスタックをガード\n"
2276 "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャ\n"
2277 "では、スレッドに B<SIGSEGV> シグナルが送られ、オーバーフローが発生した\n"
2278 "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n"
2279 "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n"
2280 "(その場合も B<pthread_attr_getguardsize>() では\n"
2281 "B<pthread_attr_setguardsize>() で設定された guard size が返される)。"
2282
2283 #. type: Plain text
2284 #: build/C/man3/pthread_attr_setguardsize.3:124
2285 msgid ""
2286 "Setting a guard size of 0 may be useful to save memory in an application "
2287 "that creates many threads and knows that stack overflow can never occur."
2288 msgstr ""
2289 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2290 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2291 "することで、メモリを節約できることもある。"
2292
2293 #. type: Plain text
2294 #: build/C/man3/pthread_attr_setguardsize.3:128
2295 msgid ""
2296 "Choosing a guard size larger than the default size may be necessary for "
2297 "detecting stack overflows if a thread allocates large data structures on the "
2298 "stack."
2299 msgstr ""
2300 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2301 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2302 "大きな guard size を選ぶ必要があるかもしれない。"
2303
2304 #. type: SH
2305 #: build/C/man3/pthread_attr_setguardsize.3:128
2306 #: build/C/man3/pthread_attr_setinheritsched.3:101
2307 #: build/C/man3/pthread_attr_setstacksize.3:94
2308 #: build/C/man3/pthread_create.3:194 build/C/man3/pthread_exit.3:91
2309 #, no-wrap
2310 msgid "BUGS"
2311 msgstr "バグ"
2312
2313 #. type: Plain text
2314 #: build/C/man3/pthread_attr_setguardsize.3:139
2315 msgid ""
2316 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2317 "within the stack size allocation, rather than allocating extra space at the "
2318 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2319 "error from B<pthread_create>(3)  if the guard size value is too large, "
2320 "leaving no space for the actual stack.)"
2321 msgstr ""
2322 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2323 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2324 "末尾に追加の領域を割り当てることが求められている。\n"
2325 "(このため、ガード領域が大きすぎて、\n"
2326 "実際のスタック用の場所がなくなってしまう場合、\n"
2327 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2328
2329 #.  glibc includes the guardsize within the allocated stack size,
2330 #.  which looks pretty clearly to be in violation of POSIX.
2331 #.  Filed bug, 22 Oct 2008:
2332 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2333 #.  Older reports:
2334 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2335 #.  Reportedly, LinuxThreads did the right thing, allocating
2336 #.  extra space at the end of the stack:
2337 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2338 #. type: Plain text
2339 #: build/C/man3/pthread_attr_setguardsize.3:153
2340 msgid ""
2341 "The obsolete LinuxThreads implementation did the right thing, allocating "
2342 "extra space at the end of the stack for the guard area."
2343 msgstr ""
2344 "廃止予定の LinuxThreads 実装では、\n"
2345 "POSIX.1 で求められている通りの動作で、\n"
2346 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2347
2348 #. type: Plain text
2349 #: build/C/man3/pthread_attr_setguardsize.3:156
2350 msgid "See B<pthread_getattr_np>(3)."
2351 msgstr "B<pthread_getattr_np>(3) を参照。"
2352
2353 #. type: Plain text
2354 #: build/C/man3/pthread_attr_setguardsize.3:164
2355 msgid ""
2356 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2357 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2358 msgstr ""
2359 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2360 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2361
2362 #. type: TH
2363 #: build/C/man3/pthread_attr_setinheritsched.3:24
2364 #, no-wrap
2365 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2366 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2367
2368 #. type: TH
2369 #: build/C/man3/pthread_attr_setinheritsched.3:24
2370 #: build/C/man3/pthread_attr_setschedparam.3:24
2371 #: build/C/man3/pthread_attr_setstacksize.3:24
2372 #: build/C/man3/pthread_create.3:24
2373 #, no-wrap
2374 msgid "2012-03-15"
2375 msgstr "2012-03-15"
2376
2377 #. type: Plain text
2378 #: build/C/man3/pthread_attr_setinheritsched.3:28
2379 msgid ""
2380 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit "
2381 "scheduler attribute in thread attributes object"
2382 msgstr ""
2383 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - \n"
2384 "スレッド属性オブジェクトの inherit scheduler 属性の設定/取得を行う"
2385
2386 #. type: Plain text
2387 #: build/C/man3/pthread_attr_setinheritsched.3:36
2388 #, no-wrap
2389 msgid ""
2390 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2391 "B<                                 int >I<inheritsched>B<);>\n"
2392 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2393 "B<                                 int *>I<inheritsched>B<);>\n"
2394 msgstr ""
2395 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2396 "B<                                 int >I<inheritsched>B<);>\n"
2397 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2398 "B<                                 int *>I<inheritsched>B<);>\n"
2399
2400 #. type: Plain text
2401 #: build/C/man3/pthread_attr_setinheritsched.3:53
2402 msgid ""
2403 "The B<pthread_attr_setinheritsched>()  function sets the inherit scheduler "
2404 "attribute of the thread attributes object referred to by I<attr> to the "
2405 "value specified in I<inheritsched>.  The inherit scheduler attribute "
2406 "determines whether a thread created using the thread attributes object "
2407 "I<attr> will inherit its scheduling attributes from the calling thread or "
2408 "whether it will take them from I<attr>."
2409 msgstr ""
2410 "B<pthread_attr_setinheritsched>() 関数は、\n"
2411 "I<attr> が参照するスレッド属性オブジェクトの inherit scheduler 属性を\n"
2412 "I<inheritsched> で指定された値に設定する。\n"
2413 "inherit scheduler 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2414 "作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承\n"
2415 "するか、I<attr> からスケジューリング属性を取得するかが決定される。"
2416
2417 #. type: Plain text
2418 #: build/C/man3/pthread_attr_setinheritsched.3:56
2419 msgid "The following values may be specified in I<inheritsched>:"
2420 msgstr "以下の値を I<inheritsched> に指定できる。"
2421
2422 #. type: TP
2423 #: build/C/man3/pthread_attr_setinheritsched.3:56
2424 #, no-wrap
2425 msgid "B<PTHREAD_INHERIT_SCHED>"
2426 msgstr "B<PTHREAD_INHERIT_SCHED>"
2427
2428 #. type: Plain text
2429 #: build/C/man3/pthread_attr_setinheritsched.3:64
2430 msgid ""
2431 "Threads that are created using I<attr> inherit scheduling attributes from "
2432 "the creating thread; the scheduling attributes in I<attr> are ignored."
2433 msgstr ""
2434 "I<attr> を使って作成されたスレッドは、\n"
2435 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2436 "I<attr> 内のスケジューリング属性は無視される。"
2437
2438 #. type: TP
2439 #: build/C/man3/pthread_attr_setinheritsched.3:64
2440 #, no-wrap
2441 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2442 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2443
2444 #.  FIXME what are the defaults for scheduler settings?
2445 #. type: Plain text
2446 #: build/C/man3/pthread_attr_setinheritsched.3:71
2447 msgid ""
2448 "Threads that are created using I<attr> take their scheduling attributes from "
2449 "the values specified by the attributes object."
2450 msgstr ""
2451 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2452 "指定された値からスケジューリング属性を取得する。"
2453
2454 #. type: Plain text
2455 #: build/C/man3/pthread_attr_setinheritsched.3:75
2456 msgid ""
2457 "The default setting of the inherit scheduler attribute in a newly "
2458 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2459 msgstr ""
2460 "新たに初期化されたスレッド属性オブジェクトの inherit scheduler 属性の\n"
2461 "デフォルト設定は B<PTHREAD_INHERIT_SCHED> である。"
2462
2463 #. type: Plain text
2464 #: build/C/man3/pthread_attr_setinheritsched.3:82
2465 msgid ""
2466 "The B<pthread_attr_getinheritsched>()  returns the inherit scheduler "
2467 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2468 "by I<inheritsched>."
2469 msgstr ""
2470 "B<pthread_attr_getinheritsched>() は、\n"
2471 "スレッド属性オブジェクト I<attr> の inherit scheduler 属性を\n"
2472 "I<inheritsched> が指すバッファに入れて返す。"
2473
2474 #. type: Plain text
2475 #: build/C/man3/pthread_attr_setinheritsched.3:88
2476 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2477 msgstr "B<pthread_attr_setinheritsched>() は以下のエラーで失敗する場合がある。"
2478
2479 #. type: Plain text
2480 #: build/C/man3/pthread_attr_setinheritsched.3:92
2481 msgid "Invalid value in I<inheritsched>."
2482 msgstr "I<inheritsched> に無効な値が指定された。"
2483
2484 #.  .SH VERSIONS
2485 #.  Available since glibc 2.0.
2486 #. type: Plain text
2487 #: build/C/man3/pthread_attr_setinheritsched.3:99
2488 msgid ""
2489 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2490 "to set the attribute to an unsupported value\") for "
2491 "B<pthread_attr_setinheritsched>()."
2492 msgstr ""
2493 "POSIX.1-2001 では、 B<pthread_attr_setinheritsched>() に関して\n"
2494 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2495 "も追加で規定されている。"
2496
2497 #.  FIXME . Track status of the following bug:
2498 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2499 #. type: Plain text
2500 #: build/C/man3/pthread_attr_setinheritsched.3:117
2501 msgid ""
2502 "As at glibc 2.8, if a thread attributes object is initialized using "
2503 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2504 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2505 "if the inherit scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2506 "then a thread created using the attribute object wrongly inherits its "
2507 "scheduling attributes from the creating thread.  This bug does not occur if "
2508 "either the scheduling policy or scheduling priority attribute is explicitly "
2509 "set in the thread attributes object before calling B<pthread_create>(3)."
2510 msgstr ""
2511 "glibc 2.8 の時点では、スレッド属性オブジェクトが\n"
2512 "B<pthread_attr_init>(3) を使って初期化された場合、\n"
2513 "スレッド属性オブジェクトのスケジューリングポリシーが B<SCHED_OTHER> に、\n"
2514 "スケジューリング優先度が 0 に設定される。一方、その後 inherit\n"
2515 "scheduling 属性に B<PTHREAD_EXPLICIT_SCHED> が設定されると、このスレッ\n"
2516 "ド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するス\n"
2517 "レッドのスケジューリング属性が間違って継承されてしまう。\n"
2518 "B<pthread_create>(3) を呼び出す前にスケジューリングポリシー属性か\n"
2519 "スケジューリング優先度属性のどちらかが明示的に設定された場合には、\n"
2520 "このバグは発生しない。"
2521
2522 #. type: Plain text
2523 #: build/C/man3/pthread_attr_setinheritsched.3:120
2524 #: build/C/man3/pthread_attr_setschedparam.3:96
2525 #: build/C/man3/pthread_attr_setschedpolicy.3:92
2526 msgid "See B<pthread_setschedparam>(3)."
2527 msgstr "B<pthread_setschedparam>(3) を参照。"
2528
2529 #. type: Plain text
2530 #: build/C/man3/pthread_attr_setinheritsched.3:129
2531 msgid ""
2532 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2533 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2534 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2535 "(3), B<pthreads>(7)"
2536 msgstr ""
2537 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2538 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2539 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2540 "(3), B<pthreads>(7)"
2541
2542 #. type: TH
2543 #: build/C/man3/pthread_attr_setschedparam.3:24
2544 #, no-wrap
2545 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2546 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2547
2548 #. type: Plain text
2549 #: build/C/man3/pthread_attr_setschedparam.3:28
2550 msgid ""
2551 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2552 "parameter attributes in thread attributes object"
2553 msgstr ""
2554 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
2555 "スレッド属性オブジェクトのスケジューリングパラメータ属性の設定/取得を行う"
2556
2557 #. type: Plain text
2558 #: build/C/man3/pthread_attr_setschedparam.3:36
2559 #, no-wrap
2560 msgid ""
2561 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2562 "B<                               const struct sched_param *>I<param>B<);>\n"
2563 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2564 "B<                               struct sched_param *>I<param>B<);>\n"
2565 msgstr ""
2566 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2567 "B<                               const struct sched_param *>I<param>B<);>\n"
2568 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2569 "B<                               struct sched_param *>I<param>B<);>\n"
2570
2571 #. type: Plain text
2572 #: build/C/man3/pthread_attr_setschedparam.3:50
2573 msgid ""
2574 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2575 "attributes of the thread attributes object referred to by I<attr> to the "
2576 "values specified in the buffer pointed to by I<param>.  These attributes "
2577 "determine the scheduling parameters of a thread created using the thread "
2578 "attributes object I<attr>."
2579 msgstr ""
2580 "B<pthread_attr_setschedparam>() 関数は、\n"
2581 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2582 "パラメータ属性を I<param> が指すバッファで指定された値に設定する。\n"
2583 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2584 "作成されるスレッドのスケジューリングパラメータが決定される。"
2585
2586 #. type: Plain text
2587 #: build/C/man3/pthread_attr_setschedparam.3:57
2588 msgid ""
2589 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2590 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2591 "by I<param>."
2592 msgstr ""
2593 "B<pthread_attr_getschedparam>() は、\n"
2594 "スレッド属性オブジェクト I<attr> のスケジューリングパラメータ属性を\n"
2595 "I<param> が指すバッファに入れて返す。"
2596
2597 #. type: Plain text
2598 #: build/C/man3/pthread_attr_setschedparam.3:59
2599 msgid "Scheduling parameters are maintained in the following structure:"
2600 msgstr "スケジューリングパラメータは以下の構造体で管理される。"
2601
2602 #. type: Plain text
2603 #: build/C/man3/pthread_attr_setschedparam.3:65
2604 #: build/C/man3/pthread_setschedparam.3:67
2605 #, no-wrap
2606 msgid ""
2607 "struct sched_param {\n"
2608 "    int sched_priority;     /* Scheduling priority */\n"
2609 "};\n"
2610 msgstr ""
2611 "struct sched_param {\n"
2612 "    int sched_priority;     /* Scheduling priority */\n"
2613 "};\n"
2614
2615 #. type: Plain text
2616 #: build/C/man3/pthread_attr_setschedparam.3:72
2617 #: build/C/man3/pthread_setschedparam.3:74
2618 msgid ""
2619 "As can be seen, only one scheduling parameter is supported.  For details of "
2620 "the permitted ranges for scheduling priorities in each scheduling policy, "
2621 "see B<sched_setscheduler>(2)."
2622 msgstr ""
2623 "見て分かる通り、サポートされているスケジューリングパラメータは一つだけ\n"
2624 "である。各スケジューリングポリシーで許可されるスケジューリング優先度の\n"
2625 "詳細については、B<sched_setscheduler>(2) を参照のこと。"
2626
2627 #.  .SH VERSIONS
2628 #.  Available since glibc 2.0.
2629 #. type: Plain text
2630 #: build/C/man3/pthread_attr_setschedparam.3:87
2631 msgid ""
2632 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2633 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2634 "(but portable and future-proof applications should nevertheless handle a "
2635 "possible error return)."
2636 msgstr ""
2637 "POSIX.1 では、\n"
2638 "B<pthread_attr_setschedparam>() について\n"
2639 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
2640 "Linux では、これらの関数は常に成功する\n"
2641 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2642 "正のエラーの返り値を処理するようにすべきである)。"
2643
2644 #. type: Plain text
2645 #: build/C/man3/pthread_attr_setschedparam.3:93
2646 msgid ""
2647 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2648 "policies supported on Linux."
2649 msgstr ""
2650 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
2651 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
2652
2653 #. type: Plain text
2654 #: build/C/man3/pthread_attr_setschedparam.3:106
2655 msgid ""
2656 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2657 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2658 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2659 "(3), B<pthreads>(7)"
2660 msgstr ""
2661 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2662 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2663 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2664 "(3), B<pthreads>(7)"
2665
2666 #. type: TH
2667 #: build/C/man3/pthread_attr_setschedpolicy.3:24
2668 #, no-wrap
2669 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2670 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2671
2672 #. type: Plain text
2673 #: build/C/man3/pthread_attr_setschedpolicy.3:28
2674 msgid ""
2675 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2676 "scheduling policy attribute in thread attributes object"
2677 msgstr ""
2678 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
2679 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
2680
2681 #. type: Plain text
2682 #: build/C/man3/pthread_attr_setschedpolicy.3:36
2683 #, no-wrap
2684 msgid ""
2685 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2686 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2687 msgstr ""
2688 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2689 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2690
2691 #. type: Plain text
2692 #: build/C/man3/pthread_attr_setschedpolicy.3:50
2693 msgid ""
2694 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2695 "attribute of the thread attributes object referred to by I<attr> to the "
2696 "value specified in I<policy>.  This attribute determines the scheduling "
2697 "policy of a thread created using the thread attributes object I<attr>."
2698 msgstr ""
2699 "B<pthread_attr_setschedpolicy>() 関数は、\n"
2700 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2701 "ポリシー属性を I<policy> で指定された値に設定する。\n"
2702 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2703 "作成されるスレッドのスケジューリングポリシーが決定される。"
2704
2705 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2706 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2707 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2708 #. type: Plain text
2709 #: build/C/man3/pthread_attr_setschedpolicy.3:63
2710 msgid ""
2711 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2712 "B<SCHED_OTHER>, with the semantics described in B<sched_setscheduler>(2)."
2713 msgstr ""
2714 "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER>\n"
2715 "である。それぞれの意味は B<sched_setscheduler>(2) で説明している通り\n"
2716 "である。"
2717
2718 #. type: Plain text
2719 #: build/C/man3/pthread_attr_setschedpolicy.3:70
2720 msgid ""
2721 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2722 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2723 "by I<policy>."
2724 msgstr ""
2725 "B<pthread_attr_getschedpolicy>() は、\n"
2726 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
2727 "I<policy> が指すバッファに入れて返す。"
2728
2729 #. type: Plain text
2730 #: build/C/man3/pthread_attr_setschedpolicy.3:76
2731 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2732 msgstr "B<pthread_attr_setschedpolicy>() は以下のエラーで失敗する場合がある。"
2733
2734 #. type: Plain text
2735 #: build/C/man3/pthread_attr_setschedpolicy.3:80
2736 msgid "Invalid value in I<policy>."
2737 msgstr "I<policy> に無効な値が指定された。"
2738
2739 #.  .SH VERSIONS
2740 #.  Available since glibc 2.0.
2741 #. type: Plain text
2742 #: build/C/man3/pthread_attr_setschedpolicy.3:87
2743 msgid ""
2744 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2745 "to set the attribute to an unsupported value\") for "
2746 "B<pthread_attr_setschedpolicy>()."
2747 msgstr ""
2748 "POSIX.1-2001 では、 B<pthread_attr_setschedpolicy>() に関して\n"
2749 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2750 "も追加で規定されている。"
2751
2752 #. type: Plain text
2753 #: build/C/man3/pthread_attr_setschedpolicy.3:101
2754 msgid ""
2755 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2756 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2757 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2758 "(3), B<pthreads>(7)"
2759 msgstr ""
2760 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2761 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2762 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2763 "(3), B<pthreads>(7)"
2764
2765 #. type: TH
2766 #: build/C/man3/pthread_attr_setscope.3:24
2767 #, no-wrap
2768 msgid "PTHREAD_ATTR_SETSCOPE"
2769 msgstr "PTHREAD_ATTR_SETSCOPE"
2770
2771 #. type: Plain text
2772 #: build/C/man3/pthread_attr_setscope.3:28
2773 msgid ""
2774 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2775 "attribute in thread attributes object"
2776 msgstr ""
2777 "pthread_attr_setscope, pthread_attr_getscope - \n"
2778 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
2779
2780 #. type: Plain text
2781 #: build/C/man3/pthread_attr_setscope.3:36
2782 #, no-wrap
2783 msgid ""
2784 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2785 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2786 msgstr ""
2787 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2788 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2789
2790 #. type: Plain text
2791 #: build/C/man3/pthread_attr_setscope.3:51
2792 msgid ""
2793 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2794 "of the thread attributes object referred to by I<attr> to the value "
2795 "specified in I<scope>.  The contention scope attribute defines the set of "
2796 "threads against which a thread competes for resources such as the CPU.  "
2797 "POSIX.1-2001 specifies two possible values for I<scope>:"
2798 msgstr ""
2799 "B<pthread_attr_setscope>() 関数は、\n"
2800 "I<attr> が参照するスレッド属性オブジェクトの contention scope\n"
2801 "属性を I<scope> で指定された値に設定する。\n"
2802 "contention scope 属性により、\n"
2803 "スレッドが CPU などのリソースを取り合うスレッド集合が規定される。\n"
2804 "POSIX.1-2001 では I<scope> に指定する値として 2 つの値が規定されている。"
2805
2806 #. type: TP
2807 #: build/C/man3/pthread_attr_setscope.3:51
2808 #, no-wrap
2809 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2810 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2811
2812 #. type: Plain text
2813 #: build/C/man3/pthread_attr_setscope.3:59
2814 msgid ""
2815 "The thread competes for resources with all other threads in all processes on "
2816 "the system that are in the same scheduling allocation domain (a group of one "
2817 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2818 "to one another according to their scheduling policy and priority."
2819 msgstr ""
2820 "スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ\n"
2821 "のグループ) にある、システム上の全てのプロセスの自分以外の全ての\n"
2822 "スレッドとリソースを取り合う。 \n"
2823 "B<PTHREAD_SCOPE_SYSTEM> のスレッドは、スケジューリングポリシーと\n"
2824 "優先度に基づき、互いに相対的にスケジューリングされる。"
2825
2826 #. type: TP
2827 #: build/C/man3/pthread_attr_setscope.3:59
2828 #, no-wrap
2829 msgid "B<PTHREAD_SCOPE_PROCESS>"
2830 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2831
2832 #. type: Plain text
2833 #: build/C/man3/pthread_attr_setscope.3:74
2834 msgid ""
2835 "The thread competes for resources with all other threads in the same process "
2836 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
2837 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2838 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
2839 "leaves it unspecified how these threads contend with other threads in other "
2840 "process on the system or with other threads in the same process that were "
2841 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
2842 msgstr ""
2843 "スレッドは、contention scope が B<PTHREAD_SCOPE_PROCESS> で作成された\n"
2844 "同じプロセスの自分以外の全てのスレッドとリソースを取り合う。\n"
2845 "B<PTHREAD_SCOPE_PROCESS> のスレッドは、スケジューリングポリシーと優先度\n"
2846 "に基づき、同じプロセスの他のスレッドと相対的にスケジューリングされる。\n"
2847 "POSIX.1-2001 では、これらのスレッドがシステム上の他のプロセスのスレッド\n"
2848 "や同じプロセス内の contention scope が B<PTHREAD_SCOPE_SYSTEM> で作成\n"
2849 "された他のスレッドとどのようにリソースを取り合うかは、\n"
2850 "規定されないままになっている。"
2851
2852 #. type: Plain text
2853 #: build/C/man3/pthread_attr_setscope.3:81
2854 msgid ""
2855 "POSIX.1-2001 only requires that an implementation support one of these "
2856 "contention scopes, but permits both to be supported.  Linux supports "
2857 "B<PTHREAD_SCOPE_SYSTEM>, but not B<PTHREAD_SCOPE_PROCESS>."
2858 msgstr ""
2859 "POSIX.1-2001 で求められているのは、スレッド実装がこれらの contention\n"
2860 "scope のうち 1 つをサポートすることだけであるが、\n"
2861 "両方をサポートすることも認めている。\n"
2862 "Linux は B<PTHREAD_SCOPE_SYSTEM> をサポートしているが、\n"
2863 "B<PTHREAD_SCOPE_PROCESS> はサポートしていない。"
2864
2865 #. type: Plain text
2866 #: build/C/man3/pthread_attr_setscope.3:89
2867 msgid ""
2868 "The B<pthread_attr_getscope>()  function returns the contention scope "
2869 "attribute of the thread attributes object referred to by I<attr> in the "
2870 "buffer pointed to by I<scope>."
2871 msgstr ""
2872 "B<pthread_attr_getscope>() は、\n"
2873 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
2874 "I<scope> が指すバッファに入れて返す。"
2875
2876 #. type: Plain text
2877 #: build/C/man3/pthread_attr_setscope.3:95
2878 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
2879 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
2880
2881 #. type: Plain text
2882 #: build/C/man3/pthread_attr_setscope.3:99
2883 msgid "An invalid value was specified in I<scope>."
2884 msgstr "I<scope> に無効な値が指定された。"
2885
2886 #. type: TP
2887 #: build/C/man3/pthread_attr_setscope.3:99
2888 #, no-wrap
2889 msgid "B<ENOTSUP>"
2890 msgstr "B<ENOTSUP>"
2891
2892 #. type: Plain text
2893 #: build/C/man3/pthread_attr_setscope.3:105
2894 msgid ""
2895 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
2896 "supported on Linux."
2897 msgstr ""
2898 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
2899 "この値は Linux でサポートされていない。"
2900
2901 #. type: Plain text
2902 #: build/C/man3/pthread_attr_setscope.3:115
2903 msgid ""
2904 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a "
2905 "userspace thread is bound directly to a single kernel-scheduling entity.  "
2906 "This is the case on Linux for the obsolete LinuxThreads implementation and "
2907 "the modern NPTL implementation, which are both 1:1 threading implementations."
2908 msgstr ""
2909 "B<PTHREAD_SCOPE_SYSTEM> contention scope では、通常は、一つの\n"
2910 "ユーザ空間スレッドは一つのカーネルスケジューリング・エンティティに\n"
2911 "直接結び付けられる。\n"
2912 "Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに\n"
2913 "該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。"
2914
2915 #. type: Plain text
2916 #: build/C/man3/pthread_attr_setscope.3:118
2917 msgid ""
2918 "POSIX.1-2001 specifies that the default contention scope is implementation-"
2919 "defined."
2920 msgstr ""
2921 "POSIX.1-2001 では、 contention scope 属性のデフォルト値は\n"
2922 "実装時で定義されるものと規定されている。"
2923
2924 #. type: Plain text
2925 #: build/C/man3/pthread_attr_setscope.3:126
2926 msgid ""
2927 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2928 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2929 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2930 msgstr ""
2931 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2932 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2933 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2934
2935 #. type: TH
2936 #: build/C/man3/pthread_attr_setstack.3:24
2937 #, no-wrap
2938 msgid "PTHREAD_ATTR_SETSTACK"
2939 msgstr "PTHREAD_ATTR_SETSTACK"
2940
2941 #. type: Plain text
2942 #: build/C/man3/pthread_attr_setstack.3:28
2943 msgid ""
2944 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
2945 "thread attributes object"
2946 msgstr ""
2947 "pthread_attr_setstack, pthread_attr_getstack - \n"
2948 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
2949
2950 #. type: Plain text
2951 #: build/C/man3/pthread_attr_setstack.3:36
2952 #, no-wrap
2953 msgid ""
2954 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2955 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2956 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2957 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2958 msgstr ""
2959 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2960 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2961 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2962 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2963
2964 #. type: Plain text
2965 #: build/C/man3/pthread_attr_setstack.3:43 build/C/man3/pthread_sigqueue.3:39
2966 msgid ""
2967 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
2968 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
2969
2970 #. type: Plain text
2971 #: build/C/man3/pthread_attr_setstack.3:48
2972 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2973 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2974
2975 #. type: Plain text
2976 #: build/C/man3/pthread_attr_setstack.3:50
2977 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2978 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2979
2980 #. type: Plain text
2981 #: build/C/man3/pthread_attr_setstack.3:66
2982 msgid ""
2983 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
2984 "size attributes of the thread attributes object referred to by I<attr> to "
2985 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
2986 "attributes specify the location and size of the stack that should be used by "
2987 "a thread that is created using the thread attributes object I<attr>."
2988 msgstr ""
2989 "B<pthread_attr_setstack>() 関数は、\n"
2990 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
2991 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
2992 "指定された値に設定する。\n"
2993 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2994 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
2995
2996 #. type: Plain text
2997 #: build/C/man3/pthread_attr_setstack.3:72
2998 msgid ""
2999 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
3000 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
3001 "allocated buffer should be both readable and writable."
3002 msgstr ""
3003 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
3004 "バッファ内の指定できる最小のアドレスバイトを指すべきである。\n"
3005 "割り当てられたバッファのページは読み書き両方が可能なページとなっている\n"
3006 "べきである。"
3007
3008 #. type: Plain text
3009 #: build/C/man3/pthread_attr_setstack.3:83
3010 msgid ""
3011 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
3012 "size attributes of the thread attributes object referred to by I<attr> in "
3013 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
3014 msgstr ""
3015 "B<pthread_attr_getstack>() 関数は、\n"
3016 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
3017 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
3018 "指すバッファに入れて返す。"
3019
3020 #. type: Plain text
3021 #: build/C/man3/pthread_attr_setstack.3:89
3022 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
3023 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
3024
3025 #. type: Plain text
3026 #: build/C/man3/pthread_attr_setstack.3:100
3027 msgid ""
3028 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
3029 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
3030 "stacksize> is not suitably aligned."
3031 msgstr ""
3032 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
3033 "システムによっては、 I<stackaddr> か\n"
3034 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
3035 "このエラーが発生する。"
3036
3037 #. type: Plain text
3038 #: build/C/man3/pthread_attr_setstack.3:108
3039 msgid ""
3040 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
3041 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
3042 "caller."
3043 msgstr ""
3044 "POSIX.1-2001 では エラー B<EACCES> も規定されており、\n"
3045 "このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に\n"
3046 "呼び出し側から読み書き両方のアクセスができない状況を表す。"
3047
3048 #. type: Plain text
3049 #: build/C/man3/pthread_attr_setstack.3:110
3050 msgid "These functions are provided by glibc since version 2.2."
3051 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
3052
3053 #. type: Plain text
3054 #: build/C/man3/pthread_attr_setstack.3:120
3055 msgid ""
3056 "These functions are provided for applications that must ensure that a "
3057 "thread's stack is placed in a particular location.  For most applications, "
3058 "this is not necessary, and the use of these functions should be avoided.  "
3059 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
3060 "stack size other than the default.)"
3061 msgstr ""
3062 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
3063 "しなければならないアプリケーションのために提供されている。\n"
3064 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
3065 "これらの関数を使うのは避けるべきである。\n"
3066 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
3067 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
3068
3069 #. type: Plain text
3070 #: build/C/man3/pthread_attr_setstack.3:131
3071 msgid ""
3072 "When an application employs B<pthread_attr_setstack>(), it takes over the "
3073 "responsibility of allocating the stack.  Any guard size value that was set "
3074 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
3075 "is the application's responsibility to allocate a guard area (one or more "
3076 "pages protected against reading and writing)  to handle the possibility of "
3077 "stack overflow."
3078 msgstr ""
3079 "アプリケーションが B<pthread_attr_setstack>() を利用する際には、\n"
3080 "スタックの割り当てに責任を持つ必要がある。\n"
3081 "B<pthread_attr_setguardsize>(3) を使って設定された\n"
3082 "guard size の値は無視される。\n"
3083 "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n"
3084 "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n"
3085 "スタックオーバーフローの可能性に対処するようにする必要がある。"
3086
3087 #. type: Plain text
3088 #: build/C/man3/pthread_attr_setstack.3:142
3089 msgid ""
3090 "The address specified in I<stackaddr> should be suitably aligned: for full "
3091 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
3092 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
3093 "should also be a multiple of the system page size."
3094 msgstr ""
3095 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
3096 "完全な移植性を持たせるためには、\n"
3097 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
3098 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
3099 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
3100
3101 #. type: Plain text
3102 #: build/C/man3/pthread_attr_setstack.3:151
3103 msgid ""
3104 "If I<attr> is used to create multiple threads, then the caller must change "
3105 "the stack address attribute between calls to B<pthread_create>(3); "
3106 "otherwise, the threads will attempt to use the same memory area for their "
3107 "stacks, and chaos will ensue."
3108 msgstr ""
3109 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
3110 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
3111 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
3112 "さもなければ、複数のスレッドがスタックとして同じメモリ領域を\n"
3113 "使おうとするため、訳の分からない状況が発生してしまう。"
3114
3115 #. type: Plain text
3116 #: build/C/man3/pthread_attr_setstack.3:164
3117 msgid ""
3118 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3119 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3120 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3121 msgstr ""
3122 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3123 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3124 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3125
3126 #. type: TH
3127 #: build/C/man3/pthread_attr_setstackaddr.3:24
3128 #, no-wrap
3129 msgid "PTHREAD_ATTR_SETSTACKADDR"
3130 msgstr "PTHREAD_ATTR_SETSTACKADDR"
3131
3132 #. type: Plain text
3133 #: build/C/man3/pthread_attr_setstackaddr.3:28
3134 msgid ""
3135 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
3136 "attribute in thread attributes object"
3137 msgstr ""
3138 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
3139 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
3140
3141 #. type: Plain text
3142 #: build/C/man3/pthread_attr_setstackaddr.3:36
3143 #, no-wrap
3144 msgid ""
3145 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3146 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3147 msgstr ""
3148 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3149 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3150
3151 #. type: Plain text
3152 #: build/C/man3/pthread_attr_setstackaddr.3:47
3153 msgid ""
3154 "These functions are obsolete: B<do not use them.> Use "
3155 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
3156 msgstr ""
3157 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
3158 "代わりに Use B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使"
3159 "うこと。"
3160
3161 #. type: Plain text
3162 #: build/C/man3/pthread_attr_setstackaddr.3:58
3163 msgid ""
3164 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
3165 "attribute of the thread attributes object referred to by I<attr> to the "
3166 "value specified in I<stackaddr>.  This attribute specifies the location of "
3167 "the stack that should be used by a thread that is created using the thread "
3168 "attributes object I<attr>."
3169 msgstr ""
3170 "B<pthread_attr_setstackaddr>() 関数は、\n"
3171 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3172 "属性を I<stackaddr> で指定された値に設定する。\n"
3173 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3174 "作成されるスレッドが使用すべきスタックの位置が指定される。"
3175
3176 #. type: Plain text
3177 #: build/C/man3/pthread_attr_setstackaddr.3:64
3178 msgid ""
3179 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
3180 "that was allocated by the caller.  The pages of the allocated buffer should "
3181 "be both readable and writable."
3182 msgstr ""
3183 "I<stackaddr> は呼び出し側が割り当てたバッファ (大きさは\n"
3184 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
3185 "割り当てられたバッファのページは読み書き両方が可能なページと\n"
3186 "なっているべきである。"
3187
3188 #. type: Plain text
3189 #: build/C/man3/pthread_attr_setstackaddr.3:72
3190 msgid ""
3191 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
3192 "attribute of the thread attributes object referred to by I<attr> in the "
3193 "buffer pointed to by I<stackaddr>."
3194 msgstr ""
3195 "B<pthread_attr_getstackaddr>() は、\n"
3196 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3197 "I<stackaddr> が指すバッファに入れて返す。"
3198
3199 #. type: Plain text
3200 #: build/C/man3/pthread_attr_setstackaddr.3:79
3201 msgid ""
3202 "No errors are defined (but applications should nevertheless handle a "
3203 "possible error return)."
3204 msgstr ""
3205 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
3206 "返り値を処理するようにすべきである)。"
3207
3208 #. type: Plain text
3209 #: build/C/man3/pthread_attr_setstackaddr.3:84
3210 msgid ""
3211 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
3212 "POSIX.1-2008 removes the specification of these functions."
3213 msgstr ""
3214 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
3215 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
3216
3217 #. type: Plain text
3218 #: build/C/man3/pthread_attr_setstackaddr.3:108
3219 msgid ""
3220 "I<Do not use these functions!> They cannot be portably used, since they "
3221 "provide no way of specifying the direction of growth or the range of the "
3222 "stack.  For example, on architectures with a stack that grows downward, "
3223 "I<stackaddr> specifies the next address past the I<highest> address of the "
3224 "allocated stack area.  However, on architectures with a stack that grows "
3225 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
3226 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
3227 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
3228 "in the allocated stack area (and the I<stacksize> argument specifies the "
3229 "range of the stack)."
3230 msgstr ""
3231 "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n"
3232 "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n"
3233 "かを指定する手段が提供されていないからである。\n"
3234 "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャ\n"
3235 "では、I<stackaddr> には割り当てられたスタック領域のI<最も大きな>アドレ\n"
3236 "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n"
3237 "方向) に伸びるアーキテクチャでは、I<stackaddr> には割り当てられた\n"
3238 "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n"
3239 "B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) が使用する\n"
3240 "I<stackaddr> は、常に割り当てられたスタック領域の最も小さいアドレス\n"
3241 "へのポインタである (I<stacksize> 引き数はスタックの範囲を指定する)。"
3242
3243 #. type: Plain text
3244 #: build/C/man3/pthread_attr_setstackaddr.3:114
3245 msgid ""
3246 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3247 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3248 msgstr ""
3249 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3250 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3251
3252 #. type: TH
3253 #: build/C/man3/pthread_attr_setstacksize.3:24
3254 #, no-wrap
3255 msgid "PTHREAD_ATTR_SETSTACKSIZE"
3256 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
3257
3258 #. type: Plain text
3259 #: build/C/man3/pthread_attr_setstacksize.3:28
3260 msgid ""
3261 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
3262 "attribute in thread attributes object"
3263 msgstr ""
3264 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
3265 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
3266
3267 #. type: Plain text
3268 #: build/C/man3/pthread_attr_setstacksize.3:36
3269 #, no-wrap
3270 msgid ""
3271 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3272 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3273 msgstr ""
3274 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3275 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3276
3277 #. type: Plain text
3278 #: build/C/man3/pthread_attr_setstacksize.3:47
3279 msgid ""
3280 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
3281 "of the thread attributes object referred to by I<attr> to the value "
3282 "specified in I<stacksize>."
3283 msgstr ""
3284 "B<pthread_attr_setstacksize>() 関数は、\n"
3285 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3286 "属性を I<stacksize> で指定された値に設定する。"
3287
3288 #. type: Plain text
3289 #: build/C/man3/pthread_attr_setstacksize.3:51
3290 msgid ""
3291 "The stack size attribute determines the minimum size (in bytes) that will be "
3292 "allocated for threads created using the thread attributes object I<attr>."
3293 msgstr ""
3294 "スタックサイズ属性により、\n"
3295 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
3296 "に割り当てられる最小サイズ (バイト単位) が決定される。"
3297
3298 #. type: Plain text
3299 #: build/C/man3/pthread_attr_setstacksize.3:59
3300 msgid ""
3301 "The B<pthread_attr_getstacksize>()  function returns the stack size "
3302 "attribute of the thread attributes object referred to by I<attr> in the "
3303 "buffer pointed to by I<stacksize>."
3304 msgstr ""
3305 "B<pthread_attr_getstacksize>() は、\n"
3306 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3307 "I<stacksize> が指すバッファに入れて返す。"
3308
3309 #. type: Plain text
3310 #: build/C/man3/pthread_attr_setstacksize.3:65
3311 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
3312 msgstr "B<pthread_attr_setstacksize>() は以下のエラーで失敗する場合がある。"
3313
3314 #. type: Plain text
3315 #: build/C/man3/pthread_attr_setstacksize.3:70
3316 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
3317 msgstr "スタックサイズが B<PTHREAD_STACK_MIN> (16384) バイト未満である。"
3318
3319 #.  e.g., MacOS
3320 #. type: Plain text
3321 #: build/C/man3/pthread_attr_setstacksize.3:79
3322 msgid ""
3323 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
3324 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
3325 msgstr ""
3326 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
3327 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
3328 "エラー B<EINVAL> で失敗する。"
3329
3330 #. type: Plain text
3331 #: build/C/man3/pthread_attr_setstacksize.3:86
3332 msgid ""
3333 "For details on the default stack size of new threads, see B<pthread_create>"
3334 "(3)."
3335 msgstr ""
3336 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
3337 "B<pthread_create>(3) を参照。"
3338
3339 #. type: Plain text
3340 #: build/C/man3/pthread_attr_setstacksize.3:89
3341 msgid ""
3342 "A thread's stack size is fixed at the time of thread creation.  Only the "
3343 "main thread can dynamically grow its stack."
3344 msgstr ""
3345 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
3346 "メインスレッドだけがスタックを動的に伸ばすことができる。"
3347
3348 #. type: Plain text
3349 #: build/C/man3/pthread_attr_setstacksize.3:94
3350 msgid ""
3351 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
3352 "the size and location of a caller-allocated stack that is to be used by a "
3353 "thread."
3354 msgstr ""
3355 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
3356 "アプリケーションは、スレッドが使用するスタックとして、\n"
3357 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
3358
3359 #. type: Plain text
3360 #: build/C/man3/pthread_attr_setstacksize.3:106
3361 msgid ""
3362 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
3363 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
3364 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
3365 "stack will be at least I<stacksize> bytes."
3366 msgstr ""
3367 "glibc 2.8 の時点では、指定された I<stacksize> が B<STACK_ALIGN> \n"
3368 "(ほとんどのアーキテクチャでは 16 バイト) の倍数でない場合、\n"
3369 "I<stacksize> はI<小さくなる方向に>に丸められる。\n"
3370 "これは POSIX.1-2001 に違反している。\n"
3371 "POSIX.1-2001 では、割り当てらたスタックの大きさは\n"
3372 "少なくとも I<stacksize> バイトになると書かれている。"
3373
3374 #. type: Plain text
3375 #: build/C/man3/pthread_attr_setstacksize.3:109
3376 #: build/C/man3/pthread_join.3:125
3377 msgid "See B<pthread_create>(3)."
3378 msgstr "B<pthread_create>(3) を参照。"
3379
3380 #. type: Plain text
3381 #: build/C/man3/pthread_attr_setstacksize.3:116
3382 msgid ""
3383 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3384 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3385 msgstr ""
3386 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3387 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3388
3389 #. type: TH
3390 #: build/C/man3/pthread_cancel.3:24
3391 #, no-wrap
3392 msgid "PTHREAD_CANCEL"
3393 msgstr "PTHREAD_CANCEL"
3394
3395 #. type: TH
3396 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_setschedparam.3:24
3397 #, no-wrap
3398 msgid "2008-11-17"
3399 msgstr "2008-11-17"
3400
3401 #. type: Plain text
3402 #: build/C/man3/pthread_cancel.3:27
3403 msgid "pthread_cancel - send a cancellation request to a thread"
3404 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
3405
3406 #. type: Plain text
3407 #: build/C/man3/pthread_cancel.3:32
3408 #, no-wrap
3409 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3410 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3411
3412 #. type: Plain text
3413 #: build/C/man3/pthread_cancel.3:44
3414 msgid ""
3415 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
3416 "I<thread>.  Whether and when the target thread reacts to the cancellation "
3417 "request depends on two attributes that are under the control of that thread: "
3418 "its cancelability I<state> and I<type>."
3419 msgstr ""
3420 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
3421 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
3422 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
3423 "I<state> と I<type>により決まる。"
3424
3425 #. type: Plain text
3426 #: build/C/man3/pthread_cancel.3:56
3427 msgid ""
3428 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
3429 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
3430 "has disabled cancellation, then a cancellation request remains queued until "
3431 "the thread enables cancellation.  If a thread has enabled cancellation, then "
3432 "its cancelability type determines when cancellation occurs."
3433 msgstr ""
3434 "あるスレッドの cancelability state は B<pthread_setcancelstate>(3) で\n"
3435 "設定され、I<enabled> と I<disabled> のいずれとなる (I<enabled> が新しい\n"
3436 "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n"
3437 "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n"
3438 "れたままになる。スレッドがキャンセルを有効にしていた場合、\n"
3439 "cancelability type によって、いつキャンセルが発生するかが決まる。"
3440
3441 #. type: Plain text
3442 #: build/C/man3/pthread_cancel.3:72
3443 msgid ""
3444 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3445 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
3446 "Asynchronous cancelability means that the thread can be canceled at any time "
3447 "(usually immediately, but the system does not guarantee this).  Deferred "
3448 "cancelability means that cancellation will be delayed until the thread next "
3449 "calls a function that is a I<cancellation point>.  A list of functions that "
3450 "are or may be cancellation points is provided in I<pthreads>(7)."
3451 msgstr ""
3452 "スレッドのキャンセル種別 (cancelability type) は\n"
3453 "B<pthread_setcanceltype>(3) で設定され、I<asynchronous> か I<deferred>\n"
3454 "のいずれかとなる(I<deferred> が新しいスレッドのデフォルト値である)。\n"
3455 "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつで\n"
3456 "もキャンセルされることを意味する (通常はすぐにキャンセルされるが、\n"
3457 "システムがそのことを保証しているわけではない)。遅延キャンセル\n"
3458 "(deferred cancelability) では、そのスレッドが I<取り消しポイント\n"
3459 "(cancellation point)> となっている関数を次に呼び出すまでキャンセルが\n"
3460 "遅延される。取り消しポイントに設定されていたり設定\n"
3461 "したりできる関数のリストは I<pthreads>(7) に記載している。"
3462
3463 #. type: Plain text
3464 #: build/C/man3/pthread_cancel.3:76
3465 msgid ""
3466 "When a cancellation requested is acted on, the following steps occur for "
3467 "I<thread> (in this order):"
3468 msgstr ""
3469 "キャンセル要求が実行されると、\n"
3470 "I<thread> では以下のステップが (この順序で) 行われる。"
3471
3472 #. type: IP
3473 #: build/C/man3/pthread_cancel.3:76 build/C/man3/pthread_cleanup_push.3:67
3474 #, no-wrap
3475 msgid "1."
3476 msgstr "1."
3477
3478 #. type: Plain text
3479 #: build/C/man3/pthread_cancel.3:81
3480 msgid ""
3481 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3482 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
3483 msgstr ""
3484 "キャンセルクリーンアップハンドラが (push されたのと逆順で)\n"
3485 "取り出され (pop され)、呼び出される。\n"
3486 "(B<pthread_cleanup_push>(3) 参照)"
3487
3488 #. type: IP
3489 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:71
3490 #, no-wrap
3491 msgid "2."
3492 msgstr "2."
3493
3494 #. type: Plain text
3495 #: build/C/man3/pthread_cancel.3:86
3496 msgid ""
3497 "Thread-specific data destructors are called, in an unspecified order.  (See "
3498 "B<pthread_key_create>(3).)"
3499 msgstr ""
3500 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
3501 "呼び出し順序は規定されていない。\n"
3502 "(B<pthread_key_create>(3) 参照)"
3503
3504 #. type: IP
3505 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:79
3506 #, no-wrap
3507 msgid "3."
3508 msgstr "3."
3509
3510 #. type: Plain text
3511 #: build/C/man3/pthread_cancel.3:90
3512 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3513 msgstr "スレッドが終了される。 (B<pthread_exit>(3) 参照)"
3514
3515 #. type: Plain text
3516 #: build/C/man3/pthread_cancel.3:98
3517 msgid ""
3518 "The above steps happen asynchronously with respect to the B<pthread_cancel>"
3519 "()  call; the return status of B<pthread_cancel>()  merely informs the "
3520 "caller whether the cancellation request was successfully queued."
3521 msgstr ""
3522 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
3523 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
3524 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
3525
3526 #. type: Plain text
3527 #: build/C/man3/pthread_cancel.3:107
3528 msgid ""
3529 "After a canceled thread has terminated, a join with that thread using "
3530 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
3531 "status.  (Joining with a thread is the only way to know that cancellation "
3532 "has completed.)"
3533 msgstr ""
3534 "キャンセルされたスレッドが終了された後に、\n"
3535 "B<pthread_join>(3) でそのスレッドを join すると、\n"
3536 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
3537 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
3538
3539 #. type: Plain text
3540 #: build/C/man3/pthread_cancel.3:112
3541 msgid ""
3542 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
3543 "error number."
3544 msgstr ""
3545 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
3546 "エラーの場合、0 以外のエラー番号を返す。"
3547
3548 #. type: TP
3549 #: build/C/man3/pthread_cancel.3:113 build/C/man3/pthread_detach.3:57
3550 #: build/C/man3/pthread_getcpuclockid.3:56 build/C/man3/pthread_join.3:91
3551 #: build/C/man3/pthread_kill.3:59 build/C/man3/pthread_setaffinity_np.3:112
3552 #: build/C/man3/pthread_setschedparam.3:112
3553 #: build/C/man3/pthread_setschedprio.3:68 build/C/man3/pthread_sigqueue.3:83
3554 #, no-wrap
3555 msgid "B<ESRCH>"
3556 msgstr "B<ESRCH>"
3557
3558 #. type: Plain text
3559 #: build/C/man3/pthread_cancel.3:120 build/C/man3/pthread_detach.3:62
3560 #: build/C/man3/pthread_getcpuclockid.3:61 build/C/man3/pthread_join.3:96
3561 #: build/C/man3/pthread_kill.3:64 build/C/man3/pthread_setaffinity_np.3:117
3562 #: build/C/man3/pthread_setschedparam.3:117
3563 #: build/C/man3/pthread_setschedprio.3:73
3564 msgid "No thread with the ID I<thread> could be found."
3565 msgstr "ID が I<thread> のスレッドが見つからなかった。"
3566
3567 #. type: Plain text
3568 #: build/C/man3/pthread_cancel.3:130
3569 msgid ""
3570 "On Linux, cancellation is implemented using signals.  Under the NPTL "
3571 "threading implementation, the first real-time signal (i.e., signal 32) is "
3572 "used for this purpose.  On LinuxThreads, the second real-time signal is "
3573 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3574 msgstr ""
3575 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装で"
3576 "は、\n"
3577 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
3578 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイ"
3579 "ム\n"
3580 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
3581
3582 #. type: Plain text
3583 #: build/C/man3/pthread_cancel.3:136
3584 msgid ""
3585 "The program below creates a thread and then cancels it.  The main thread "
3586 "joins with the canceled thread to check that its exit status was "
3587 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
3588 "run the program:"
3589 msgstr ""
3590 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルす"
3591 "る。\n"
3592 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
3593 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
3594 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
3595
3596 #. type: Plain text
3597 #: build/C/man3/pthread_cancel.3:144
3598 #, no-wrap
3599 msgid ""
3600 "$ ./a.out\n"
3601 "thread_func(): started; cancellation disabled\n"
3602 "main(): sending cancellation request\n"
3603 "thread_func(): about to enable cancellation\n"
3604 "main(): thread was canceled\n"
3605 msgstr ""
3606 "$ ./a.out\n"
3607 "thread_func(): started; cancellation disabled\n"
3608 "main(): sending cancellation request\n"
3609 "thread_func(): about to enable cancellation\n"
3610 "main(): thread was canceled\n"
3611
3612 #. type: Plain text
3613 #: build/C/man3/pthread_cancel.3:154
3614 #, no-wrap
3615 msgid ""
3616 "#include E<lt>pthread.hE<gt>\n"
3617 "#include E<lt>stdio.hE<gt>\n"
3618 "#include E<lt>errno.hE<gt>\n"
3619 "#include E<lt>stdlib.hE<gt>\n"
3620 "#include E<lt>unistd.hE<gt>\n"
3621 msgstr ""
3622 "#include E<lt>pthread.hE<gt>\n"
3623 "#include E<lt>stdio.hE<gt>\n"
3624 "#include E<lt>errno.hE<gt>\n"
3625 "#include E<lt>stdlib.hE<gt>\n"
3626 "#include E<lt>unistd.hE<gt>\n"
3627
3628 #. type: Plain text
3629 #: build/C/man3/pthread_cancel.3:162
3630 #, no-wrap
3631 msgid ""
3632 "static void *\n"
3633 "thread_func(void *ignored_argument)\n"
3634 "{\n"
3635 "    int s;\n"
3636 msgstr ""
3637 "static void *\n"
3638 "thread_func(void *ignored_argument)\n"
3639 "{\n"
3640 "    int s;\n"
3641
3642 #. type: Plain text
3643 #: build/C/man3/pthread_cancel.3:165
3644 #, no-wrap
3645 msgid ""
3646 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3647 "       immediately react to a cancellation request */\n"
3648 msgstr ""
3649 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3650 "       immediately react to a cancellation request */\n"
3651
3652 #. type: Plain text
3653 #: build/C/man3/pthread_cancel.3:169
3654 #, no-wrap
3655 msgid ""
3656 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3657 "    if (s != 0)\n"
3658 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3659 msgstr ""
3660 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3661 "    if (s != 0)\n"
3662 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3663
3664 #. type: Plain text
3665 #: build/C/man3/pthread_cancel.3:173
3666 #, no-wrap
3667 msgid ""
3668 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3669 "    sleep(5);\n"
3670 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3671 msgstr ""
3672 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3673 "    sleep(5);\n"
3674 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3675
3676 #. type: Plain text
3677 #: build/C/man3/pthread_cancel.3:177
3678 #, no-wrap
3679 msgid ""
3680 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3681 "    if (s != 0)\n"
3682 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3683 msgstr ""
3684 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3685 "    if (s != 0)\n"
3686 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3687
3688 #. type: Plain text
3689 #: build/C/man3/pthread_cancel.3:179
3690 #, no-wrap
3691 msgid "    /* sleep() is a cancellation point */\n"
3692 msgstr "    /* sleep() is a cancellation point */\n"
3693
3694 #. type: Plain text
3695 #: build/C/man3/pthread_cancel.3:181
3696 #, no-wrap
3697 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3698 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3699
3700 #. type: Plain text
3701 #: build/C/man3/pthread_cancel.3:183
3702 #, no-wrap
3703 msgid "    /* Should never get here */\n"
3704 msgstr "    /* Should never get here */\n"
3705
3706 #. type: Plain text
3707 #: build/C/man3/pthread_cancel.3:187
3708 #, no-wrap
3709 msgid ""
3710 "    printf(\"thread_func(): not canceled!\\en\");\n"
3711 "    return NULL;\n"
3712 "}\n"
3713 msgstr ""
3714 "    printf(\"thread_func(): not canceled!\\en\");\n"
3715 "    return NULL;\n"
3716 "}\n"
3717
3718 #. type: Plain text
3719 #: build/C/man3/pthread_cancel.3:194
3720 #, no-wrap
3721 msgid ""
3722 "int\n"
3723 "main(void)\n"
3724 "{\n"
3725 "    pthread_t thr;\n"
3726 "    void *res;\n"
3727 "    int s;\n"
3728 msgstr ""
3729 "int\n"
3730 "main(void)\n"
3731 "{\n"
3732 "    pthread_t thr;\n"
3733 "    void *res;\n"
3734 "    int s;\n"
3735
3736 #. type: Plain text
3737 #: build/C/man3/pthread_cancel.3:196
3738 #, no-wrap
3739 msgid "    /* Start a thread and then send it a cancellation request */\n"
3740 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3741
3742 #. type: Plain text
3743 #: build/C/man3/pthread_cancel.3:200
3744 #, no-wrap
3745 msgid ""
3746 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3747 "    if (s != 0)\n"
3748 "        handle_error_en(s, \"pthread_create\");\n"
3749 msgstr ""
3750 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3751 "    if (s != 0)\n"
3752 "        handle_error_en(s, \"pthread_create\");\n"
3753
3754 #. type: Plain text
3755 #: build/C/man3/pthread_cancel.3:202
3756 #, no-wrap
3757 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3758 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3759
3760 #. type: Plain text
3761 #: build/C/man3/pthread_cancel.3:207
3762 #, no-wrap
3763 msgid ""
3764 "    printf(\"main(): sending cancellation request\\en\");\n"
3765 "    s = pthread_cancel(thr);\n"
3766 "    if (s != 0)\n"
3767 "        handle_error_en(s, \"pthread_cancel\");\n"
3768 msgstr ""
3769 "    printf(\"main(): sending cancellation request\\en\");\n"
3770 "    s = pthread_cancel(thr);\n"
3771 "    if (s != 0)\n"
3772 "        handle_error_en(s, \"pthread_cancel\");\n"
3773
3774 #. type: Plain text
3775 #: build/C/man3/pthread_cancel.3:209
3776 #, no-wrap
3777 msgid "    /* Join with thread to see what its exit status was */\n"
3778 msgstr "    /* Join with thread to see what its exit status was */\n"
3779
3780 #. type: Plain text
3781 #: build/C/man3/pthread_cancel.3:213 build/C/man3/pthread_cleanup_push.3:301
3782 #, no-wrap
3783 msgid ""
3784 "    s = pthread_join(thr, &res);\n"
3785 "    if (s != 0)\n"
3786 "        handle_error_en(s, \"pthread_join\");\n"
3787 msgstr ""
3788 "    s = pthread_join(thr, &res);\n"
3789 "    if (s != 0)\n"
3790 "        handle_error_en(s, \"pthread_join\");\n"
3791
3792 #. type: Plain text
3793 #: build/C/man3/pthread_cancel.3:220
3794 #, no-wrap
3795 msgid ""
3796 "    if (res == PTHREAD_CANCELED)\n"
3797 "        printf(\"main(): thread was canceled\\en\");\n"
3798 "    else\n"
3799 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3800 "    exit(EXIT_SUCCESS);\n"
3801 "}\n"
3802 msgstr ""
3803 "    if (res == PTHREAD_CANCELED)\n"
3804 "        printf(\"main(): thread was canceled\\en\");\n"
3805 "    else\n"
3806 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3807 "    exit(EXIT_SUCCESS);\n"
3808 "}\n"
3809
3810 #. type: Plain text
3811 #: build/C/man3/pthread_cancel.3:231
3812 msgid ""
3813 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3814 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3815 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3816 msgstr ""
3817 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3818 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3819 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3820
3821 #. type: TH
3822 #: build/C/man3/pthread_cleanup_push.3:24
3823 #, no-wrap
3824 msgid "PTHREAD_CLEANUP_PUSH"
3825 msgstr "PTHREAD_CLEANUP_PUSH"
3826
3827 #. type: TH
3828 #: build/C/man3/pthread_cleanup_push.3:24
3829 #: build/C/man3/pthread_setcancelstate.3:24
3830 #, no-wrap
3831 msgid "2008-11-24"
3832 msgstr "2008-11-24"
3833
3834 #. type: Plain text
3835 #: build/C/man3/pthread_cleanup_push.3:28
3836 msgid ""
3837 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
3838 "clean-up handlers"
3839 msgstr ""
3840 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
3841 "キャンセルクリーンアップハンドラの push/pop を行う"
3842
3843 #. type: Plain text
3844 #: build/C/man3/pthread_cleanup_push.3:35
3845 #, no-wrap
3846 msgid ""
3847 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3848 "B<                          void *>I<arg>B<);>\n"
3849 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3850 msgstr ""
3851 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3852 "B<                          void *>I<arg>B<);>\n"
3853 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3854
3855 #. type: Plain text
3856 #: build/C/man3/pthread_cleanup_push.3:46
3857 msgid ""
3858 "These functions manipulate the calling thread's stack of thread-cancellation "
3859 "clean-up handlers.  A clean-up handler is a function that is automatically "
3860 "executed when a thread is canceled (or in various other circumstances "
3861 "described below); it might, for example, unlock a mutex so that it becomes "
3862 "available to other threads in the process."
3863 msgstr ""
3864 "これらの関数は、呼び出したスレッドのスレッドキャンセル時のクリーンアッ\n"
3865 "プハンドラのスタックの操作を行う。クリーンアップハンドラは、スレッドが\n"
3866 "キャンセルされた場合 (や以下で説明する他の種々の状況において) 自動的に\n"
3867 "実行される関数である。例えば、mutex のロック解除を行い、プロセス内の\n"
3868 "他のスレッドが利用できるようにする関数などが考えられる。"
3869
3870 #. type: Plain text
3871 #: build/C/man3/pthread_cleanup_push.3:57
3872 msgid ""
3873 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
3874 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
3875 "be given I<arg> as its argument."
3876 msgstr ""
3877 "B<pthread_cleanup_push>() 関数は、 I<routine> をクリーンアップ\n"
3878 "ハンドラのスタックの一番上にプッシュする。 I<routine> が後で\n"
3879 "起動される際には、 I<arg> が関数の引き数と渡される。"
3880
3881 #. type: Plain text
3882 #: build/C/man3/pthread_cleanup_push.3:64
3883 msgid ""
3884 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
3885 "stack of clean-up handlers, and optionally executes it if I<execute> is "
3886 "nonzero."
3887 msgstr ""
3888 "B<pthread_cleanup_pop>() 関数は、クリーンアップハンドラの\n"
3889 "スタックの一番上のルーチンを削除する。\n"
3890 "I<execute> が 0 以外の場合にはそのルーチンを追加で実行する。"
3891
3892 #. type: Plain text
3893 #: build/C/man3/pthread_cleanup_push.3:67
3894 msgid ""
3895 "A cancellation clean-up handler is popped from the stack and executed in the "
3896 "following circumstances:"
3897 msgstr ""
3898 "キャンセルクリーンアップハンドラは、以下に示す場合に\n"
3899 "スタックから取り出され実行される。"
3900
3901 #. type: Plain text
3902 #: build/C/man3/pthread_cleanup_push.3:71
3903 msgid ""
3904 "When a thread is canceled, all of the stacked clean-up handlers are popped "
3905 "and executed in the reverse of the order in which they were pushed onto the "
3906 "stack."
3907 msgstr ""
3908 "スレッドがキャンセルされた際に、スタックに登録された全てのクリーン\n"
3909 "アップハンドラが取り出されて、実行される。クリーンアップハンドラの\n"
3910 "実行は、スタックに登録されたのと逆の順序で行われる。"
3911
3912 #. type: Plain text
3913 #: build/C/man3/pthread_cleanup_push.3:79
3914 msgid ""
3915 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
3916 "handlers are executed as described in the preceding point.  (Clean-up "
3917 "handlers are I<not> called if the thread terminates by performing a "
3918 "I<return> from the thread start function.)"
3919 msgstr ""
3920 "スレッドが B<pthread_exit>(3) を呼び出して終了する際に、全てのクリーン\n"
3921 "アップハンドラが上の項目で述べたのと同様に実行される。\n"
3922 "(スレッドがスレッド開始関数からの I<return> の実行により終了する場合に\n"
3923 "は、クリーンアップハンドラはI<呼び出されない>。)"
3924
3925 #. type: Plain text
3926 #: build/C/man3/pthread_cleanup_push.3:85
3927 msgid ""
3928 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
3929 "argument, the top-most clean-up handler is popped and executed."
3930 msgstr ""
3931 "スレッドが 0 以外の I<execute> 引き数で B<pthread_cleanup_pop>() を\n"
3932 "呼び出した際に、スタックの一番上のクリーンアップハンドラが取り出されて\n"
3933 "実行される。"
3934
3935 #. type: Plain text
3936 #: build/C/man3/pthread_cleanup_push.3:97
3937 msgid ""
3938 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
3939 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
3940 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
3941 "calls to these functions are paired within the same function, and at the "
3942 "same lexical nesting level.  (In other words, a clean-up handler is only "
3943 "established during the execution of a specified section of code.)"
3944 msgstr ""
3945 "POSIX.1 では、 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>() を\n"
3946 "それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開するマクロと\n"
3947 "して実装することを許容している。\n"
3948 "このため、呼び出し側では、これらの関数の呼び出しが同じ関数の中で対と\n"
3949 "なり、かつ文法的に同じネストレベル (nesting level) になることを保証\n"
3950 "しなければならない。 (言い換えると、クリーンアップハンドラは、コード\n"
3951 "の特定のセクションの実行の中でのみ設定するものであると言える。)"
3952
3953 #. type: Plain text
3954 #: build/C/man3/pthread_cleanup_push.3:117
3955 msgid ""
3956 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
3957 "call has been made to B<pthread_cleanup_push>()  or B<pthread_cleanup_pop>"
3958 "()  without the matching call of the pair since the jump buffer was filled "
3959 "by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, calling B<longjmp>(3)  "
3960 "(B<siglongjmp>(3))  from inside a clean-up handler produces undefined "
3961 "results unless the jump buffer was also filled by B<setjmp>(3)  (B<sigsetjmp>"
3962 "(3))  inside the handler."
3963 msgstr ""
3964 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しは、\n"
3965 "B<pthread_cleanup_push>() や B<pthread_cleanup_pop>() の呼び出しが対と\n"
3966 "なる呼び出しがない状態で行われた場合には、どのような結果になるかは不定\n"
3967 "である。これは jump バッファは B<setjmp>(3) (B<sigsetjmp>(3)) により設\n"
3968 "定されるからである。同様に、クリーンアップハンドラ内からの\n"
3969 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しも、jump バッファがハンドラ\n"
3970 "内で B<setjmp>(3) (B<sigsetjmp>(3)) で設定されていない限り、どのような\n"
3971 "結果になるかは不定である。"
3972
3973 #. type: Plain text
3974 #: build/C/man3/pthread_cleanup_push.3:119
3975 msgid "These functions do not return a value."
3976 msgstr "これらの関数は値を返さない。"
3977
3978 #.  SH VERSIONS
3979 #.  Available since glibc 2.0
3980 #. type: Plain text
3981 #: build/C/man3/pthread_cleanup_push.3:123
3982 msgid "There are no errors."
3983 msgstr "エラーはない。"
3984
3985 #. type: Plain text
3986 #: build/C/man3/pthread_cleanup_push.3:134
3987 msgid ""
3988 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
3989 "functions I<are> implemented as macros that expand to text containing \\(aqB<"
3990 "{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
3991 "declared within the scope of paired calls to these functions will only be "
3992 "visible within that scope."
3993 msgstr ""
3994 "Linux では、関数 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>()\n"
3995 "は、それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開する\n"
3996 "マクロとして実装されている。このことは、これらの関数を対で呼び出した\n"
3997 "スコープ内で宣言された変数は、そのスコープの中でしか参照できない\n"
3998 "ということを意味している。"
3999
4000 #.  The text was actually added in the 2004 TC2
4001 #. type: Plain text
4002 #: build/C/man3/pthread_cleanup_push.3:149
4003 msgid ""
4004 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
4005 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
4006 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
4007 "avoid doing this."
4008 msgstr ""
4009 "POSIX.1 には、括弧を含む B<pthread_cleanup_push>() と\n"
4010 "B<pthread_cleanup_pop>() のブロックをそのままにしたままで、 \n"
4011 "I<return>, I<break>, I<continue>, I<goto> を使った場合の影響は\n"
4012 "不定であると書かれている。\n"
4013 "移植性が必要なアプリケーションではこれを行うのは避けるべきである。"
4014
4015 #. type: Plain text
4016 #: build/C/man3/pthread_cleanup_push.3:164
4017 msgid ""
4018 "The program below provides a simple example of the use of the functions "
4019 "described in this page.  The program creates a thread that executes a loop "
4020 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
4021 "loop increments a global variable, I<cnt>, once each second.  Depending on "
4022 "what command-line arguments are supplied, the main thread sends the other "
4023 "thread a cancellation request, or sets a global variable that causes the "
4024 "other thread to exit its loop and terminate normally (by doing a I<return>)."
4025 msgstr ""
4026 "以下のプログラムは、このページで説明した関数の簡単な使用例を示すもので\n"
4027 "ある。このプログラムは B<pthread_cleanup_push>() と\n"
4028 "B<pthread_cleanup_pop>() で囲まれたループを実行するスレッドを作成する。\n"
4029 "このループではグローバル変数 I<cnt> を 1 秒に 1 ずつ増やしていく。\n"
4030 "指定されたコマンドライン引き数の内容に基づいて、メインスレッドはもう一\n"
4031 "つのスレッドにキャンセル要求を送ったり、もう一つのスレッドがループを\n"
4032 "抜けて (I<return> を呼び出して) 正常終了するようにグローバル変数を\n"
4033 "設定したりする。"
4034
4035 #. type: Plain text
4036 #: build/C/man3/pthread_cleanup_push.3:167
4037 msgid ""
4038 "In the following shell session, the main thread sends a cancellation request "
4039 "to the other thread:"
4040 msgstr ""
4041 "以下のシェルセッションでは、メインスレッドはもう一つのスレッドに\n"
4042 "キャンセル要求を送信する。"
4043
4044 #. type: Plain text
4045 #: build/C/man3/pthread_cleanup_push.3:177
4046 #, no-wrap
4047 msgid ""
4048 "$ B<./a.out>\n"
4049 "New thread started\n"
4050 "cnt = 0\n"
4051 "cnt = 1\n"
4052 "Canceling thread\n"
4053 "Called clean-up handler\n"
4054 "Thread was canceled; cnt = 0\n"
4055 msgstr ""
4056 "$ B<./a.out>\n"
4057 "New thread started\n"
4058 "cnt = 0\n"
4059 "cnt = 1\n"
4060 "Canceling thread\n"
4061 "Called clean-up handler\n"
4062 "Thread was canceled; cnt = 0\n"
4063
4064 #. type: Plain text
4065 #: build/C/man3/pthread_cleanup_push.3:185
4066 msgid ""
4067 "From the above, we see that the thread was canceled, and that the "
4068 "cancellation clean-up handler was called and it reset the value of the "
4069 "global variable I<cnt> to 0."
4070 msgstr ""
4071 "上記の実行例から、スレッドがキャンセルされ、\n"
4072 "キャンセルクリーンアップハンドラが呼び出され、\n"
4073 "グローバル変数 I<cnt> の値が 0 にリセットされていることが確認できる。"
4074
4075 #. type: Plain text
4076 #: build/C/man3/pthread_cleanup_push.3:188
4077 msgid ""
4078 "In the next run, the main program sets a global variable that causes other "
4079 "thread to terminate normally:"
4080 msgstr ""
4081 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4082 "もう一つのスレッドが正常終了するようにしている。"
4083
4084 #. type: Plain text
4085 #: build/C/man3/pthread_cleanup_push.3:196
4086 #, no-wrap
4087 msgid ""
4088 "$ B<./a.out x>\n"
4089 "New thread started\n"
4090 "cnt = 0\n"
4091 "cnt = 1\n"
4092 "Thread terminated normally; cnt = 2\n"
4093 msgstr ""
4094 "$ B<./a.out x>\n"
4095 "New thread started\n"
4096 "cnt = 0\n"
4097 "cnt = 1\n"
4098 "Thread terminated normally; cnt = 2\n"
4099
4100 #. type: Plain text
4101 #: build/C/man3/pthread_cleanup_push.3:204
4102 msgid ""
4103 "From the above, we see that the clean-up handler was not executed (because "
4104 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
4105 msgstr ""
4106 "上記では、 (I<cleanup_pop_arg> が 0 なので) クリーンアップハンドラは\n"
4107 "実行されておらず、その結果 I<cnt> の値はリセットされていないことが\n"
4108 "分かる。"
4109
4110 #. type: Plain text
4111 #: build/C/man3/pthread_cleanup_push.3:209
4112 msgid ""
4113 "In the next run, the main program sets a global variable that causes the "
4114 "other thread to terminate normally, and supplies a nonzero value for "
4115 "I<cleanup_pop_arg>:"
4116 msgstr ""
4117 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4118 "もう一つのスレッドが正常終了するようにし、さらに\n"
4119 "I<cleanup_pop_arg> に 0 以外の値を渡している。"
4120
4121 #. type: Plain text
4122 #: build/C/man3/pthread_cleanup_push.3:218
4123 #, no-wrap
4124 msgid ""
4125 "$ B<./a.out x 1>\n"
4126 "New thread started\n"
4127 "cnt = 0\n"
4128 "cnt = 1\n"
4129 "Called clean-up handler\n"
4130 "Thread terminated normally; cnt = 0\n"
4131 msgstr ""
4132 "$ B<./a.out x 1>\n"
4133 "New thread started\n"
4134 "cnt = 0\n"
4135 "cnt = 1\n"
4136 "Called clean-up handler\n"
4137 "Thread terminated normally; cnt = 0\n"
4138
4139 #. type: Plain text
4140 #: build/C/man3/pthread_cleanup_push.3:225
4141 msgid ""
4142 "In the above, we see that although the thread was not canceled, the clean-up "
4143 "handler was executed, because the argument given to B<pthread_cleanup_pop>"
4144 "()  was nonzero."
4145 msgstr ""
4146 "上記では、スレッドはキャンセルされていないが、クリーンアップハンドラが\n"
4147 "実行されていないことが分かる。これは B<pthread_cleanup_pop>() の引き数\n"
4148 "に 0 以外を渡したからである。"
4149
4150 #. type: Plain text
4151 #: build/C/man3/pthread_cleanup_push.3:234
4152 #, no-wrap
4153 msgid ""
4154 "#include E<lt>pthread.hE<gt>\n"
4155 "#include E<lt>sys/types.hE<gt>\n"
4156 "#include E<lt>stdio.hE<gt>\n"
4157 "#include E<lt>stdlib.hE<gt>\n"
4158 "#include E<lt>unistd.hE<gt>\n"
4159 "#include E<lt>errno.hE<gt>\n"
4160 msgstr ""
4161 "#include E<lt>pthread.hE<gt>\n"
4162 "#include E<lt>sys/types.hE<gt>\n"
4163 "#include E<lt>stdio.hE<gt>\n"
4164 "#include E<lt>stdlib.hE<gt>\n"
4165 "#include E<lt>unistd.hE<gt>\n"
4166 "#include E<lt>errno.hE<gt>\n"
4167
4168 #. type: Plain text
4169 #: build/C/man3/pthread_cleanup_push.3:241
4170 #, no-wrap
4171 msgid ""
4172 "static int done = 0;\n"
4173 "static int cleanup_pop_arg = 0;\n"
4174 "static int cnt = 0;\n"
4175 msgstr ""
4176 "static int done = 0;\n"
4177 "static int cleanup_pop_arg = 0;\n"
4178 "static int cnt = 0;\n"
4179
4180 #. type: Plain text
4181 #: build/C/man3/pthread_cleanup_push.3:248
4182 #, no-wrap
4183 msgid ""
4184 "static void\n"
4185 "cleanup_handler(void *arg)\n"
4186 "{\n"
4187 "    printf(\"Called clean-up handler\\en\");\n"
4188 "    cnt = 0;\n"
4189 "}\n"
4190 msgstr ""
4191 "static void\n"
4192 "cleanup_handler(void *arg)\n"
4193 "{\n"
4194 "    printf(\"Called clean-up handler\\en\");\n"
4195 "    cnt = 0;\n"
4196 "}\n"
4197
4198 #. type: Plain text
4199 #: build/C/man3/pthread_cleanup_push.3:253
4200 #, no-wrap
4201 msgid ""
4202 "static void *\n"
4203 "thread_start(void *arg)\n"
4204 "{\n"
4205 "    time_t start, curr;\n"
4206 msgstr ""
4207 "static void *\n"
4208 "thread_start(void *arg)\n"
4209 "{\n"
4210 "    time_t start, curr;\n"
4211
4212 #. type: Plain text
4213 #: build/C/man3/pthread_cleanup_push.3:255
4214 #, no-wrap
4215 msgid "    printf(\"New thread started\\en\");\n"
4216 msgstr "    printf(\"New thread started\\en\");\n"
4217
4218 #. type: Plain text
4219 #: build/C/man3/pthread_cleanup_push.3:257
4220 #, no-wrap
4221 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4222 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4223
4224 #. type: Plain text
4225 #: build/C/man3/pthread_cleanup_push.3:259
4226 #, no-wrap
4227 msgid "    curr = start = time(NULL);\n"
4228 msgstr "    curr = start = time(NULL);\n"
4229
4230 #. type: Plain text
4231 #: build/C/man3/pthread_cleanup_push.3:268
4232 #, no-wrap
4233 msgid ""
4234 "    while (!done) {\n"
4235 "        pthread_testcancel();           /* A cancellation point */\n"
4236 "        if (curr E<lt> time(NULL)) {\n"
4237 "            curr = time(NULL);\n"
4238 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4239 "            cnt++;\n"
4240 "        }\n"
4241 "    }\n"
4242 msgstr ""
4243 "    while (!done) {\n"
4244 "        pthread_testcancel();           /* A cancellation point */\n"
4245 "        if (curr E<lt> time(NULL)) {\n"
4246 "            curr = time(NULL);\n"
4247 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4248 "            cnt++;\n"
4249 "        }\n"
4250 "    }\n"
4251
4252 #. type: Plain text
4253 #: build/C/man3/pthread_cleanup_push.3:272
4254 #, no-wrap
4255 msgid ""
4256 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4257 "    return NULL;\n"
4258 "}\n"
4259 msgstr ""
4260 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4261 "    return NULL;\n"
4262 "}\n"
4263
4264 #. type: Plain text
4265 #: build/C/man3/pthread_cleanup_push.3:279
4266 #, no-wrap
4267 msgid ""
4268 "int\n"
4269 "main(int argc, char *argv[])\n"
4270 "{\n"
4271 "    pthread_t thr;\n"
4272 "    int s;\n"
4273 "    void *res;\n"
4274 msgstr ""
4275 "int\n"
4276 "main(int argc, char *argv[])\n"
4277 "{\n"
4278 "    pthread_t thr;\n"
4279 "    int s;\n"
4280 "    void *res;\n"
4281
4282 #. type: Plain text
4283 #: build/C/man3/pthread_cleanup_push.3:283
4284 #, no-wrap
4285 msgid ""
4286 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4287 "    if (s != 0)\n"
4288 "        handle_error_en(s, \"pthread_create\");\n"
4289 msgstr ""
4290 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4291 "    if (s != 0)\n"
4292 "        handle_error_en(s, \"pthread_create\");\n"
4293
4294 #. type: Plain text
4295 #: build/C/man3/pthread_cleanup_push.3:285
4296 #, no-wrap
4297 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
4298 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
4299
4300 #. type: Plain text
4301 #: build/C/man3/pthread_cleanup_push.3:290
4302 #, no-wrap
4303 msgid ""
4304 "    if (argc E<gt> 1) {\n"
4305 "        if (argc E<gt> 2)\n"
4306 "            cleanup_pop_arg = atoi(argv[2]);\n"
4307 "        done = 1;\n"
4308 msgstr ""
4309 "    if (argc E<gt> 1) {\n"
4310 "        if (argc E<gt> 2)\n"
4311 "            cleanup_pop_arg = atoi(argv[2]);\n"
4312 "        done = 1;\n"
4313
4314 #. type: Plain text
4315 #: build/C/man3/pthread_cleanup_push.3:297
4316 #, no-wrap
4317 msgid ""
4318 "    } else {\n"
4319 "        printf(\"Canceling thread\\en\");\n"
4320 "        s = pthread_cancel(thr);\n"
4321 "        if (s != 0)\n"
4322 "            handle_error_en(s, \"pthread_cancel\");\n"
4323 "    }\n"
4324 msgstr ""
4325 "    } else {\n"
4326 "        printf(\"Canceling thread\\en\");\n"
4327 "        s = pthread_cancel(thr);\n"
4328 "        if (s != 0)\n"
4329 "            handle_error_en(s, \"pthread_cancel\");\n"
4330 "    }\n"
4331
4332 #. type: Plain text
4333 #: build/C/man3/pthread_cleanup_push.3:308
4334 #, no-wrap
4335 msgid ""
4336 "    if (res == PTHREAD_CANCELED)\n"
4337 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4338 "    else\n"
4339 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4340 "    exit(EXIT_SUCCESS);\n"
4341 "}\n"
4342 msgstr ""
4343 "    if (res == PTHREAD_CANCELED)\n"
4344 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4345 "    else\n"
4346 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4347 "    exit(EXIT_SUCCESS);\n"
4348 "}\n"
4349
4350 #. type: Plain text
4351 #: build/C/man3/pthread_cleanup_push.3:315
4352 msgid ""
4353 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4354 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4355 msgstr ""
4356 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4357 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4358
4359 #. type: TH
4360 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
4361 #, no-wrap
4362 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4363 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4364
4365 #. type: TH
4366 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
4367 #, no-wrap
4368 msgid "2008-12-04"
4369 msgstr "2008-12-04"
4370
4371 #. type: Plain text
4372 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
4373 msgid ""
4374 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
4375 "thread cancellation clean-up handlers while saving cancelability type"
4376 msgstr ""
4377 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - "
4378 "cancelability type を保持したままでスレッドのキャンセルクリーンアップハンドラ"
4379 "の push/pop を行う"
4380
4381 #. type: Plain text
4382 #: build/C/man3/pthread_cleanup_push_defer_np.3:35
4383 #, no-wrap
4384 msgid ""
4385 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4386 "B<                                   void *>I<arg>B<);>\n"
4387 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4388 msgstr ""
4389 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4390 "B<                                   void *>I<arg>B<);>\n"
4391 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4392
4393 #. type: Plain text
4394 #: build/C/man3/pthread_cleanup_push_defer_np.3:38
4395 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
4396 #: build/C/man3/pthread_join.3:35 build/C/man3/pthread_kill.3:35
4397 #: build/C/man3/pthread_sigmask.3:36 build/C/man3/pthread_sigqueue.3:35
4398 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
4399 msgid "Compile and link with I<-pthread>."
4400 msgstr "I<-pthread> を付けてコンパイルとリンクを行う。"
4401
4402 #. type: Plain text
4403 #: build/C/man3/pthread_cleanup_push_defer_np.3:44
4404 msgid ""
4405 "These functions are the same as B<pthread_cleanup_push>(3)  and "
4406 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
4407 msgstr ""
4408 "これらの関数は B<pthread_cleanup_push>(3) と B<pthread_cleanup_pop>(3) と同じ"
4409 "だが、このページで説明する点が異なる。"
4410
4411 #. type: Plain text
4412 #: build/C/man3/pthread_cleanup_push_defer_np.3:57
4413 msgid ""
4414 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
4415 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
4416 "addition, it also saves the thread's current cancelability type, and sets "
4417 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
4418 "this ensures that cancellation clean-up will occur even if the thread's "
4419 "cancelability type was \"asynchronous\" before the call."
4420 msgstr ""
4421 "B<pthread_cleanup_push>(3) と同様に、\n"
4422 "B<pthread_cleanup_push_defer_np>() は I<routine> をそのスレッドの\n"
4423 "クリーンアップハンドラのスタックに追加する。これに加えて、\n"
4424 "B<pthread_cleanup_push_defer_np>() は現在の cancelability type も\n"
4425 "保存し、cancelability type は \"deferred\" に設定する\n"
4426 "(B<pthread_setcanceltype>(3) 参照)。\n"
4427 "これにより、この関数が呼び出される前のスレッドの cancelability type が\n"
4428 "\"asynchronous\" であったとしても、キャンセルクリーンアップが行われること\n"
4429 "が保証される。"
4430
4431 #. type: Plain text
4432 #: build/C/man3/pthread_cleanup_push_defer_np.3:66
4433 msgid ""
4434 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
4435 "the top-most clean-up handler from the thread's stack of cancellation clean-"
4436 "up handlers.  In addition, it restores the thread's cancelability type to "
4437 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
4438 msgstr ""
4439 "B<pthread_cleanup_pop>(3) と同様に、\n"
4440 "B<pthread_cleanup_pop_restore_np>() はそのスレッドのキャンセル\n"
4441 "クリーンアップハンドラのスタックから一番上にあるクリーンアップハンドラ\n"
4442 "を取り出す。これに加えて、そのスレッドの cancelability type を、対応\n"
4443 "する B<pthread_cleanup_push_defer_np>() が呼ばれた時点の値に戻す。"
4444
4445 #. type: Plain text
4446 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
4447 msgid ""
4448 "The caller must ensure that calls to these functions are paired within the "
4449 "same function, and at the same lexical nesting level.  Other restrictions "
4450 "apply, as described in B<pthread_cleanup_push>(3)."
4451 msgstr ""
4452 "呼び出し側では、これらの関数の呼び出しが同じ関数の中で対となり、かつ\n"
4453 "文法的に同じネストレベル (nesting level) になることを保証しなければ\n"
4454 "ならない。 B<pthread_cleanup_push>(3) で説明されている他の制限も\n"
4455 "適用される。"
4456
4457 #. type: Plain text
4458 #: build/C/man3/pthread_cleanup_push_defer_np.3:74
4459 msgid "This sequence of calls:"
4460 msgstr "以下の一連の呼び出し"
4461
4462 #. type: Plain text
4463 #: build/C/man3/pthread_cleanup_push_defer_np.3:79
4464 #, no-wrap
4465 msgid ""
4466 "pthread_cleanup_push_defer_np(routine, arg);\n"
4467 "pthread_cleanup_pop_restore_np(execute);\n"
4468 msgstr ""
4469 "pthread_cleanup_push_defer_np(routine, arg);\n"
4470 "pthread_cleanup_pop_restore_np(execute);\n"
4471
4472 #. type: Plain text
4473 #: build/C/man3/pthread_cleanup_push_defer_np.3:83
4474 msgid "is equivalent to (but shorter and more efficient than):"
4475 msgstr "と以下は等価である (但し、上の方がより簡潔で効率的である)。"
4476
4477 #. type: Plain text
4478 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
4479 #, no-wrap
4480 msgid "int oldtype;\n"
4481 msgstr "int oldtype;\n"
4482
4483 #. type: Plain text
4484 #: build/C/man3/pthread_cleanup_push_defer_np.3:95
4485 #, no-wrap
4486 msgid ""
4487 "pthread_cleanup_push(routine, arg);\n"
4488 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4489 "\\&...\n"
4490 "pthread_setcanceltype(oldtype, NULL);\n"
4491 "pthread_cleanup_pop(execute);\n"
4492 msgstr ""
4493 "pthread_cleanup_push(routine, arg);\n"
4494 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4495 "\\&...\n"
4496 "pthread_setcanceltype(oldtype, NULL);\n"
4497 "pthread_cleanup_pop(execute);\n"
4498
4499 #. type: Plain text
4500 #: build/C/man3/pthread_cleanup_push_defer_np.3:108
4501 msgid ""
4502 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
4503 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4504 msgstr ""
4505 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
4506 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4507
4508 #. type: TH
4509 #: build/C/man3/pthread_create.3:24
4510 #, no-wrap
4511 msgid "PTHREAD_CREATE"
4512 msgstr "PTHREAD_CREATE"
4513
4514 #. type: Plain text
4515 #: build/C/man3/pthread_create.3:27
4516 msgid "pthread_create - create a new thread"
4517 msgstr "pthread_create - 新しいスレッドを作成する"
4518
4519 #. type: Plain text
4520 #: build/C/man3/pthread_create.3:33
4521 #, no-wrap
4522 msgid ""
4523 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4524 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4525 msgstr ""
4526 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4527 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4528
4529 #. type: Plain text
4530 #: build/C/man3/pthread_create.3:45
4531 msgid ""
4532 "The B<pthread_create>()  function starts a new thread in the calling "
4533 "process.  The new thread starts execution by invoking I<start_routine>(); "
4534 "I<arg> is passed as the sole argument of I<start_routine>()."
4535 msgstr ""
4536 "B<pthread_create>() 関数は、呼び出したプロセス内に新しいスレッドを作成す"
4537 "る。\n"
4538 "新しいスレッドの実行は、 I<start_routine>() を起動することで開始される。\n"
4539 "I<start_routine>() は引き数を一つだけ取り、\n"
4540 "I<arg> が I<start_routine>() の引き数として渡される。"
4541
4542 #. type: Plain text
4543 #: build/C/man3/pthread_create.3:47
4544 msgid "The new thread terminates in one of the following ways:"
4545 msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。"
4546
4547 #. type: IP
4548 #: build/C/man3/pthread_create.3:47 build/C/man3/pthread_create.3:53
4549 #: build/C/man3/pthread_create.3:61 build/C/man3/pthread_create.3:64
4550 #: build/C/man3/pthread_getattr_np.3:50 build/C/man3/pthread_getattr_np.3:53
4551 #: build/C/man3/pthread_getattr_np.3:56
4552 #, no-wrap
4553 msgid "*"
4554 msgstr "*"
4555
4556 #. type: Plain text
4557 #: build/C/man3/pthread_create.3:53
4558 msgid ""
4559 "It calls B<pthread_exit>(3), specifying an exit status value that is "
4560 "available to another thread in the same process that calls B<pthread_join>"
4561 "(3)."
4562 msgstr ""
4563 "スレッドが B<pthread_exit>(3) を呼び出す。\n"
4564 "B<pthread_exit>(3) を呼び出す際には終了ステータス値を指定する。\n"
4565 "この値は B<pthread_join>(3) を呼び出した同じプロセス内の\n"
4566 "別のスレッドで参照できる。"
4567
4568 #. type: Plain text
4569 #: build/C/man3/pthread_create.3:61
4570 msgid ""
4571 "It returns from I<start_routine>().  This is equivalent to calling "
4572 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
4573 msgstr ""
4574 "スレッドが I<start_routine>() から返る。これは、\n"
4575 "I<return> 文に渡した値で B<pthread_exit>(3) を呼び出すのと等価である。"
4576
4577 #. type: Plain text
4578 #: build/C/man3/pthread_create.3:64
4579 msgid "It is canceled (see B<pthread_cancel>(3))."
4580 msgstr "スレッドがキャンセルされる (B<pthread_cancel>(3) 参照)。"
4581
4582 #. type: Plain text
4583 #: build/C/man3/pthread_create.3:70
4584 msgid ""
4585 "Any of the threads in the process calls B<exit>(3), or the main thread "
4586 "performs a return from I<main>().  This causes the termination of all "
4587 "threads in the process."
4588 msgstr ""
4589 "プロセス内のいずれかのスレッドで B<exit>(3) が呼ばれるか、\n"
4590 "メインスレッドで I<main>() 内で return が実行される。\n"
4591 "この場合は、プロセス内の全てのスレッドが終了される。"
4592
4593 #. type: Plain text
4594 #: build/C/man3/pthread_create.3:84
4595 msgid ""
4596 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4597 "are used at thread creation time to determine attributes for the new thread; "
4598 "this structure is initialized using B<pthread_attr_init>(3)  and related "
4599 "functions.  If I<attr> is NULL, then the thread is created with default "
4600 "attributes."
4601 msgstr ""
4602 "I<attr> 引き数は I<pthread_attr_t> 構造体へのポインタであり、\n"
4603 "I<pthread_attr_t> 構造体の内容を使用して、スレッド作成時に\n"
4604 "新しいスレッドの属性が決定される。\n"
4605 "この構造体は B<pthread_attr_init>(3) や関連の関数を使って初期化される。\n"
4606 "I<attr> が NULL の場合、新しいスレッドはデフォルトの属性で作成される。"
4607
4608 #. type: Plain text
4609 #: build/C/man3/pthread_create.3:91
4610 msgid ""
4611 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
4612 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4613 "used to refer to the thread in subsequent calls to other pthreads functions."
4614 msgstr ""
4615 "成功した場合は、 B<pthread_create>() は返る前に新しいスレッドの ID を\n"
4616 "I<thread> が指すバッファに格納する。この ID は、これ以降に他の\n"
4617 "pthreads 関数の呼び出しでスレッドを参照するのに使用される。"
4618
4619 #. type: Plain text
4620 #: build/C/man3/pthread_create.3:99
4621 msgid ""
4622 "The new thread inherits a copy of the creating thread's signal mask "
4623 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
4624 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
4625 "thread's alternate signal stack (B<sigaltstack>(2))."
4626 msgstr ""
4627 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスク\n"
4628 "(B<pthread_sigmask>(3) 参照) のコピーを継承する。\n"
4629 "新しいスレッドの処理待ちシグナル (B<sigpending>(2)) の集合は空となる。\n"
4630 "新しいスレッドはスレッドを作成したスレッドの代替シグナルスタック\n"
4631 "(B<sigaltstack>(2)) を継承しない。"
4632
4633 #. type: Plain text
4634 #: build/C/man3/pthread_create.3:102
4635 msgid ""
4636 "The new thread inherits the calling thread's floating-point environment "
4637 "(B<fenv>(3))."
4638 msgstr ""
4639 "新しいスレッドは呼び出したスレッドの浮動小数点環境 (B<fenv>(3))\n"
4640 "を継承する。"
4641
4642 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4643 #. type: Plain text
4644 #: build/C/man3/pthread_create.3:107
4645 msgid ""
4646 "The initial value of the new thread's CPU-time clock is 0 (see "
4647 "B<pthread_getcpuclockid>(3))."
4648 msgstr ""
4649 "新しいスレッドの CPU 時間時計の初期値は 0 である\n"
4650 "(B<pthread_getcpuclockid>(3) 参照)。"
4651
4652 #. type: SS
4653 #: build/C/man3/pthread_create.3:107
4654 #, no-wrap
4655 msgid "Linux-specific details"
4656 msgstr "Linux 固有の詳細"
4657
4658 #. type: Plain text
4659 #: build/C/man3/pthread_create.3:113
4660 msgid ""
4661 "The new thread inherits copies of the calling thread's capability sets (see "
4662 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4663 msgstr ""
4664 "新しいスレッドは、呼び出したスレッドの\n"
4665 "ケーパビリティセット (B<capabilities>(7) 参照) と \n"
4666 "CPU affinity マスク (B<sched_setaffinity>(2) 参照) の\n"
4667 "コピーをを継承しない。"
4668
4669 #. type: Plain text
4670 #: build/C/man3/pthread_create.3:120
4671 msgid ""
4672 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
4673 "number, and the contents of I<*thread> are undefined."
4674 msgstr ""
4675 "成功すると、 B<pthread_create>() は 0 を返す。\n"
4676 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
4677
4678 #. type: TP
4679 #: build/C/man3/pthread_create.3:121 build/C/man3/pthread_sigqueue.3:69
4680 #, no-wrap
4681 msgid "B<EAGAIN>"
4682 msgstr "B<EAGAIN>"
4683
4684 #. type: Plain text
4685 #: build/C/man3/pthread_create.3:135
4686 msgid ""
4687 "Insufficient resources to create another thread, or a system-imposed limit "
4688 "on the number of threads was encountered.  The latter case may occur in two "
4689 "ways: the B<RLIMIT_NPROC> soft resource limit (set via B<setrlimit>(2)), "
4690 "which limits the number of process for a real user ID, was reached; or the "
4691 "kernel's system-wide limit on the number of threads, I</proc/sys/kernel/"
4692 "threads-max>, was reached."
4693 msgstr ""
4694 "別のスレッドを作成するのに十分なリソースがないか、システムで設定された\n"
4695 "スレッド数の上限に達していた。後者が起こるのは 2 つの場合がある。\n"
4696 "一つは、実ユーザ ID 当たりのプロセス数の上限である、B<RLIMIT_NPROC> \n"
4697 "ソフトリソース上限 (B<setrlimit>(2) で設定できる) に達していた場合\n"
4698 "である。もう一つはカーネルのシステム全体のスレッド数の上限である\n"
4699 "I</proc/sys/kernel/threads-max> が達していた場合である。"
4700
4701 #. type: Plain text
4702 #: build/C/man3/pthread_create.3:139
4703 msgid "Invalid settings in I<attr>."
4704 msgstr "I<attr> で指定された設定が不正である。"
4705
4706 #. type: TP
4707 #: build/C/man3/pthread_create.3:139 build/C/man3/pthread_setschedparam.3:127
4708 #: build/C/man3/pthread_setschedprio.3:64
4709 #, no-wrap
4710 msgid "B<EPERM>"
4711 msgstr "B<EPERM>"
4712
4713 #. type: Plain text
4714 #: build/C/man3/pthread_create.3:144
4715 msgid ""
4716 "No permission to set the scheduling policy and parameters specified in "
4717 "I<attr>."
4718 msgstr ""
4719 "I<attr> に指定されたスケジューリングポリシーとパラメータを\n"
4720 "設定する許可がない。"
4721
4722 #. type: Plain text
4723 #: build/C/man3/pthread_create.3:158
4724 msgid ""
4725 "See B<pthread_self>(3)  for further information on the thread ID returned in "
4726 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
4727 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4728 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4729 msgstr ""
4730 "B<pthread_create>() が I<*thread> で返すスレッド ID についての\n"
4731 "詳しい情報は B<pthread_self>(3) を参照のこと。\n"
4732 "リアルタイムスケジューリングポリシーが使用されない限り、\n"
4733 "B<pthread_create>() の呼び出し後に、\n"
4734 "どのスレッドが\\(em呼び出したスレッドか新しいスレッドか\\(em\n"
4735 "次に実行されるかは決まっていない。"
4736
4737 #. type: Plain text
4738 #: build/C/man3/pthread_create.3:178
4739 msgid ""
4740 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
4741 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
4742 "terminate and fetch its exit status.  Only when a terminated joinable thread "
4743 "has been joined are the last of its resources released back to the system.  "
4744 "When a detached thread terminates, its resources are automatically released "
4745 "back to the system: it is not possible to join with the thread in order to "
4746 "obtain its exit status.  Making a thread detached is useful for some types "
4747 "of daemon threads whose exit status the application does not need to care "
4748 "about.  By default, a new thread is created in a joinable state, unless "
4749 "I<attr> was set to create the thread in a detached state (using "
4750 "B<pthread_attr_setdetachstate>(3))."
4751 msgstr ""
4752 "スレッドは I<join 可能>か I<detached (切り離された状態)> のどちらかに\n"
4753 "することができる。スレッドが join 可能な場合、別のスレッドが\n"
4754 "B<pthread_join>(3) を使って終了したスレッドを待ち、終了ステータスを取得\n"
4755 "することができる。終了した join 可能なスレッドは join された場合にのみ、\n"
4756 "そのスレッドの最後に残ったリソースが解放されシステムに戻される。\n"
4757 "detached 状態のスレッドが終了すると、そのスレッドのリソースは自動的に\n"
4758 "システムに戻される。detached 状態のスレッドを join して、その終了\n"
4759 "ステータスを取得することはできない。スレッドを detached 状態にするのは、\n"
4760 "その終了ステータスをアプリケーションが気にする必要がないある種の\n"
4761 "デーモン (daemon) スレッドでは有用である。\n"
4762 "デフォルトでは、新しいスレッドは join 可能な状態で作成される。\n"
4763 "(B<pthread_attr_setdetachstate>(3) を使って) I<attr> でスレッドが\n"
4764 "detached 状態で作成されるように設定されていない限り、join 可能な状態で\n"
4765 "作成される。"
4766
4767 #.  FIXME . Perhaps some of the following detail should be in
4768 #.  a future pthread_attr_setstacksize(3) page.
4769 #. type: Plain text
4770 #: build/C/man3/pthread_create.3:194
4771 msgid ""
4772 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
4773 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
4774 "resource limit I<at the time the program started> has any value other than "
4775 "\"unlimited\", then it determines the default stack size of new threads.  "
4776 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
4777 "explicitly set in the I<attr> argument used to create a thread, in order to "
4778 "obtain a stack size other than the default."
4779 msgstr ""
4780 "Linux/x86-32 では、新しいスレッドのデフォルトのスタックサイズは 2MB で\n"
4781 "ある。NPTL スレッド実装の下では、I<プログラム開始時の> B<RLIMIT_STACK>\n"
4782 "ソフトリソース上限が\"unlimited\" 以外の場合、その値が新しいスレッドのデ\n"
4783 "フォルトのスタックサイズとなる。\n"
4784 "B<pthread_attr_setstacksize>(3) を使って、スレッドを作成する際の\n"
4785 "I<attr> 引き数に明示的にスタックサイズ属性を設定することで、\n"
4786 "デフォルト値以外のスタックサイズを得ることができる。"
4787
4788 #. type: Plain text
4789 #: build/C/man3/pthread_create.3:200
4790 msgid ""
4791 "In the obsolete LinuxThreads implementation, each of the threads in a "
4792 "process has a different process ID.  This is in violation of the POSIX "
4793 "threads specification, and is the source of many other nonconformances to "
4794 "the standard; see B<pthreads>(7)."
4795 msgstr ""
4796 "廃止予定の LinuxThreads 実装では、プロセス内の各スレッドは異なる\n"
4797 "プロセス ID を持つ。これは POSIX スレッドの規格に違反しており、\n"
4798 "他の多くの標準非準拠の点の原因になっている。\n"
4799 "B<pthreads>(7) を参照のこと。"
4800
4801 #. type: Plain text
4802 #: build/C/man3/pthread_create.3:204
4803 msgid ""
4804 "The program below demonstrates the use of B<pthread_create>(), as well as a "
4805 "number of other functions in the pthreads API."
4806 msgstr ""
4807 "以下のプログラムは、 B<pthread_create>() や\n"
4808 "pthreads API の他のいろいろな関数の使用例を示している。"
4809
4810 #. type: Plain text
4811 #: build/C/man3/pthread_create.3:209
4812 msgid ""
4813 "In the following run, on a system providing the NPTL threading "
4814 "implementation, the stack size defaults to the value given by the \"stack "
4815 "size\" resource limit:"
4816 msgstr ""
4817 "以下の実行例は、 NPTL スレッド実装が提供されているシステムでのもので、\n"
4818 "スタックサイズがデフォルト値の \"stack size\" リソース上限で指定される値\n"
4819 "になる。"
4820
4821 #. type: Plain text
4822 #: build/C/man3/pthread_create.3:221
4823 #, no-wrap
4824 msgid ""
4825 "$B< ulimit -s>\n"
4826 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
4827 "$B< ./a.out hola salut servus>\n"
4828 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4829 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4830 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4831 "Joined with thread 1; returned value was HOLA\n"
4832 "Joined with thread 2; returned value was SALUT\n"
4833 "Joined with thread 3; returned value was SERVUS\n"
4834 msgstr ""
4835 "$B< ulimit -s>\n"
4836 "8192            # The stack size limit is 8 MB (0x80000 bytes)\n"
4837 "$B< ./a.out hola salut servus>\n"
4838 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4839 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4840 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4841 "Joined with thread 1; returned value was HOLA\n"
4842 "Joined with thread 2; returned value was SALUT\n"
4843 "Joined with thread 3; returned value was SERVUS\n"
4844
4845 #. type: Plain text
4846 #: build/C/man3/pthread_create.3:227
4847 msgid ""
4848 "In the next run, the program explicitly sets a stack size of 1MB (using "
4849 "B<pthread_attr_setstacksize>(3))  for the created threads:"
4850 msgstr ""
4851 "次の実行例では、プログラム内で、作成されるスレッドに対して\n"
4852 "(B<pthread_attr_setstacksize>(3) を使って1MB のスタックサイズを\n"
4853 "明示的に設定している。"
4854
4855 #. type: Plain text
4856 #: build/C/man3/pthread_create.3:237
4857 #, no-wrap
4858 msgid ""
4859 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4860 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4861 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4862 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4863 "Joined with thread 1; returned value was HOLA\n"
4864 "Joined with thread 2; returned value was SALUT\n"
4865 "Joined with thread 3; returned value was SERVUS\n"
4866 msgstr ""
4867 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4868 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4869 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4870 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4871 "Joined with thread 1; returned value was HOLA\n"
4872 "Joined with thread 2; returned value was SALUT\n"
4873 "Joined with thread 3; returned value was SERVUS\n"
4874
4875 #. type: Plain text
4876 #: build/C/man3/pthread_create.3:249
4877 #, no-wrap
4878 msgid ""
4879 "#include E<lt>pthread.hE<gt>\n"
4880 "#include E<lt>string.hE<gt>\n"
4881 "#include E<lt>stdio.hE<gt>\n"
4882 "#include E<lt>stdlib.hE<gt>\n"
4883 "#include E<lt>unistd.hE<gt>\n"
4884 "#include E<lt>errno.hE<gt>\n"
4885 "#include E<lt>ctype.hE<gt>\n"
4886 msgstr ""
4887 "#include E<lt>pthread.hE<gt>\n"
4888 "#include E<lt>string.hE<gt>\n"
4889 "#include E<lt>stdio.hE<gt>\n"
4890 "#include E<lt>stdlib.hE<gt>\n"
4891 "#include E<lt>unistd.hE<gt>\n"
4892 "#include E<lt>errno.hE<gt>\n"
4893 "#include E<lt>ctype.hE<gt>\n"
4894
4895 #. type: Plain text
4896 #: build/C/man3/pthread_create.3:255 build/C/man3/pthread_getcpuclockid.3:108
4897 #, no-wrap
4898 msgid ""
4899 "#define handle_error(msg) \\e\n"
4900 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4901 msgstr ""
4902 "#define handle_error(msg) \\e\n"
4903 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4904
4905 #. type: Plain text
4906 #: build/C/man3/pthread_create.3:261
4907 #, no-wrap
4908 msgid ""
4909 "struct thread_info {    /* Used as argument to thread_start() */\n"
4910 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4911 "    int       thread_num;       /* Application-defined thread # */\n"
4912 "    char     *argv_string;      /* From command-line argument */\n"
4913 "};\n"
4914 msgstr ""
4915 "struct thread_info {    /* Used as argument to thread_start() */\n"
4916 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4917 "    int       thread_num;       /* Application-defined thread # */\n"
4918 "    char     *argv_string;      /* From command-line argument */\n"
4919 "};\n"
4920
4921 #. type: Plain text
4922 #: build/C/man3/pthread_create.3:264
4923 #, no-wrap
4924 msgid ""
4925 "/* Thread start function: display address near top of our stack,\n"
4926 "   and return upper-cased copy of argv_string */\n"
4927 msgstr ""
4928 "/* Thread start function: display address near top of our stack,\n"
4929 "   and return upper-cased copy of argv_string */\n"
4930
4931 #. type: Plain text
4932 #: build/C/man3/pthread_create.3:270
4933 #, no-wrap
4934 msgid ""
4935 "static void *\n"
4936 "thread_start(void *arg)\n"
4937 "{\n"
4938 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
4939 "    char *uargv, *p;\n"
4940 msgstr ""
4941 "static void *\n"
4942 "thread_start(void *arg)\n"
4943 "{\n"
4944 "    struct thread_info *tinfo = (struct thread_info *) arg;\n"
4945 "    char *uargv, *p;\n"
4946
4947 #. type: Plain text
4948 #: build/C/man3/pthread_create.3:273
4949 #, no-wrap
4950 msgid ""
4951 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4952 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4953 msgstr ""
4954 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4955 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4956
4957 #. type: Plain text
4958 #: build/C/man3/pthread_create.3:277
4959 #, no-wrap
4960 msgid ""
4961 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4962 "    if (uargv == NULL)\n"
4963 "        handle_error(\"strdup\");\n"
4964 msgstr ""
4965 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4966 "    if (uargv == NULL)\n"
4967 "        handle_error(\"strdup\");\n"
4968
4969 #. type: Plain text
4970 #: build/C/man3/pthread_create.3:280
4971 #, no-wrap
4972 msgid ""
4973 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4974 "        *p = toupper(*p);\n"
4975 msgstr ""
4976 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4977 "        *p = toupper(*p);\n"
4978
4979 #. type: Plain text
4980 #: build/C/man3/pthread_create.3:283
4981 #, no-wrap
4982 msgid ""
4983 "    return uargv;\n"
4984 "}\n"
4985 msgstr ""
4986 "    return uargv;\n"
4987 "}\n"
4988
4989 #. type: Plain text
4990 #: build/C/man3/pthread_create.3:292
4991 #, no-wrap
4992 msgid ""
4993 "int\n"
4994 "main(int argc, char *argv[])\n"
4995 "{\n"
4996 "    int s, tnum, opt, num_threads;\n"
4997 "    struct thread_info *tinfo;\n"
4998 "    pthread_attr_t attr;\n"
4999 "    int stack_size;\n"
5000 "    void *res;\n"
5001 msgstr ""
5002 "int\n"
5003 "main(int argc, char *argv[])\n"
5004 "{\n"
5005 "    int s, tnum, opt, num_threads;\n"
5006 "    struct thread_info *tinfo;\n"
5007 "    pthread_attr_t attr;\n"
5008 "    int stack_size;\n"
5009 "    void *res;\n"
5010
5011 #. type: Plain text
5012 #: build/C/man3/pthread_create.3:294
5013 #, no-wrap
5014 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
5015 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
5016
5017 #. type: Plain text
5018 #: build/C/man3/pthread_create.3:301
5019 #, no-wrap
5020 msgid ""
5021 "    stack_size = -1;\n"
5022 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5023 "        switch (opt) {\n"
5024 "        case \\(aqs\\(aq:\n"
5025 "            stack_size = strtoul(optarg, NULL, 0);\n"
5026 "            break;\n"
5027 msgstr ""
5028 "    stack_size = -1;\n"
5029 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5030 "        switch (opt) {\n"
5031 "        case \\(aqs\\(aq:\n"
5032 "            stack_size = strtoul(optarg, NULL, 0);\n"
5033 "            break;\n"
5034
5035 #. type: Plain text
5036 #: build/C/man3/pthread_create.3:308
5037 #, no-wrap
5038 msgid ""
5039 "        default:\n"
5040 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5041 "                    argv[0]);\n"
5042 "            exit(EXIT_FAILURE);\n"
5043 "        }\n"
5044 "    }\n"
5045 msgstr ""
5046 "        default:\n"
5047 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5048 "                    argv[0]);\n"
5049 "            exit(EXIT_FAILURE);\n"
5050 "        }\n"
5051 "    }\n"
5052
5053 #. type: Plain text
5054 #: build/C/man3/pthread_create.3:310
5055 #, no-wrap
5056 msgid "    num_threads = argc - optind;\n"
5057 msgstr "    num_threads = argc - optind;\n"
5058
5059 #. type: Plain text
5060 #: build/C/man3/pthread_create.3:312
5061 #, no-wrap
5062 msgid "    /* Initialize thread creation attributes */\n"
5063 msgstr "    /* Initialize thread creation attributes */\n"
5064
5065 #. type: Plain text
5066 #: build/C/man3/pthread_create.3:316
5067 #, no-wrap
5068 msgid ""
5069 "    s = pthread_attr_init(&attr);\n"
5070 "    if (s != 0)\n"
5071 "        handle_error_en(s, \"pthread_attr_init\");\n"
5072 msgstr ""
5073 "    s = pthread_attr_init(&attr);\n"
5074 "    if (s != 0)\n"
5075 "        handle_error_en(s, \"pthread_attr_init\");\n"
5076
5077 #. type: Plain text
5078 #: build/C/man3/pthread_create.3:322
5079 #, no-wrap
5080 msgid ""
5081 "    if (stack_size E<gt> 0) {\n"
5082 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5083 "        if (s != 0)\n"
5084 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5085 "    }\n"
5086 msgstr ""
5087 "    if (stack_size E<gt> 0) {\n"
5088 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5089 "        if (s != 0)\n"
5090 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5091 "    }\n"
5092
5093 #. type: Plain text
5094 #: build/C/man3/pthread_create.3:324
5095 #, no-wrap
5096 msgid "    /* Allocate memory for pthread_create() arguments */\n"
5097 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
5098
5099 #. type: Plain text
5100 #: build/C/man3/pthread_create.3:328
5101 #, no-wrap
5102 msgid ""
5103 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5104 "    if (tinfo == NULL)\n"
5105 "        handle_error(\"calloc\");\n"
5106 msgstr ""
5107 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5108 "    if (tinfo == NULL)\n"
5109 "        handle_error(\"calloc\");\n"
5110
5111 #. type: Plain text
5112 #: build/C/man3/pthread_create.3:330
5113 #, no-wrap
5114 msgid "    /* Create one thread for each command-line argument */\n"
5115 msgstr "    /* Create one thread for each command-line argument */\n"
5116
5117 #. type: Plain text
5118 #: build/C/man3/pthread_create.3:334
5119 #, no-wrap
5120 msgid ""
5121 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5122 "        tinfo[tnum].thread_num = tnum + 1;\n"
5123 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5124 msgstr ""
5125 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5126 "        tinfo[tnum].thread_num = tnum + 1;\n"
5127 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5128
5129 #. type: Plain text
5130 #: build/C/man3/pthread_create.3:337
5131 #, no-wrap
5132 msgid ""
5133 "        /* The pthread_create() call stores the thread ID into\n"
5134 "           corresponding element of tinfo[] */\n"
5135 msgstr ""
5136 "        /* The pthread_create() call stores the thread ID into\n"
5137 "           corresponding element of tinfo[] */\n"
5138
5139 #. type: Plain text
5140 #: build/C/man3/pthread_create.3:343
5141 #, no-wrap
5142 msgid ""
5143 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5144 "                           &thread_start, &tinfo[tnum]);\n"
5145 "        if (s != 0)\n"
5146 "            handle_error_en(s, \"pthread_create\");\n"
5147 "    }\n"
5148 msgstr ""
5149 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5150 "                           &thread_start, &tinfo[tnum]);\n"
5151 "        if (s != 0)\n"
5152 "            handle_error_en(s, \"pthread_create\");\n"
5153 "    }\n"
5154
5155 #. type: Plain text
5156 #: build/C/man3/pthread_create.3:346
5157 #, no-wrap
5158 msgid ""
5159 "    /* Destroy the thread attributes object, since it is no\n"
5160 "       longer needed */\n"
5161 msgstr ""
5162 "    /* Destroy the thread attributes object, since it is no\n"
5163 "       longer needed */\n"
5164
5165 #. type: Plain text
5166 #: build/C/man3/pthread_create.3:350 build/C/man3/pthread_setschedparam.3:421
5167 #, no-wrap
5168 msgid ""
5169 "    s = pthread_attr_destroy(&attr);\n"
5170 "    if (s != 0)\n"
5171 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5172 msgstr ""
5173 "    s = pthread_attr_destroy(&attr);\n"
5174 "    if (s != 0)\n"
5175 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5176
5177 #. type: Plain text
5178 #: build/C/man3/pthread_create.3:352
5179 #, no-wrap
5180 msgid "    /* Now join with each thread, and display its returned value */\n"
5181 msgstr "    /* Now join with each thread, and display its returned value */\n"
5182
5183 #. type: Plain text
5184 #: build/C/man3/pthread_create.3:357
5185 #, no-wrap
5186 msgid ""
5187 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5188 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5189 "        if (s != 0)\n"
5190 "            handle_error_en(s, \"pthread_join\");\n"
5191 msgstr ""
5192 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5193 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5194 "        if (s != 0)\n"
5195 "            handle_error_en(s, \"pthread_join\");\n"
5196
5197 #. type: Plain text
5198 #: build/C/man3/pthread_create.3:362
5199 #, no-wrap
5200 msgid ""
5201 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5202 "                tinfo[tnum].thread_num, (char *) res);\n"
5203 "        free(res);      /* Free memory allocated by thread */\n"
5204 "    }\n"
5205 msgstr ""
5206 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5207 "                tinfo[tnum].thread_num, (char *) res);\n"
5208 "        free(res);      /* Free memory allocated by thread */\n"
5209 "    }\n"
5210
5211 #. type: Plain text
5212 #: build/C/man3/pthread_create.3:366
5213 #, no-wrap
5214 msgid ""
5215 "    free(tinfo);\n"
5216 "    exit(EXIT_SUCCESS);\n"
5217 "}\n"
5218 msgstr ""
5219 "    free(tinfo);\n"
5220 "    exit(EXIT_SUCCESS);\n"
5221 "}\n"
5222
5223 #. type: Plain text
5224 #: build/C/man3/pthread_create.3:378
5225 msgid ""
5226 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5227 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5228 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
5229 "(7)"
5230 msgstr ""
5231 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5232 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5233 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
5234 "(7)"
5235
5236 #. type: TH
5237 #: build/C/man3/pthread_detach.3:24
5238 #, no-wrap
5239 msgid "PTHREAD_DETACH"
5240 msgstr "PTHREAD_DETACH"
5241
5242 #. type: TH
5243 #: build/C/man3/pthread_detach.3:24 build/C/man3/pthread_join.3:24
5244 #, no-wrap
5245 msgid "2008-11-27"
5246 msgstr "2008-11-27"
5247
5248 #. type: Plain text
5249 #: build/C/man3/pthread_detach.3:27
5250 msgid "pthread_detach - detach a thread"
5251 msgstr "pthread_detach - スレッドを切り離す (detach する)"
5252
5253 #. type: Plain text
5254 #: build/C/man3/pthread_detach.3:32
5255 #, no-wrap
5256 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5257 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5258
5259 #. type: Plain text
5260 #: build/C/man3/pthread_detach.3:44
5261 msgid ""
5262 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
5263 "as detached.  When a detached thread terminates, its resources are "
5264 "automatically released back to the system without the need for another "
5265 "thread to join with the terminated thread."
5266 msgstr ""
5267 "B<pthread_detach>() 関数は I<thread> で識別されるスレッドに\n"
5268 "detached (切り離された状態) という印を付ける。\n"
5269 "detached 状態のスレッドが終了すると、\n"
5270 "別のスレッドが終了されたスレッドを join しなくても、\n"
5271 "そのスレッドのリソースは自動的に解放されてシステムに戻される。"
5272
5273 #. type: Plain text
5274 #: build/C/man3/pthread_detach.3:47
5275 msgid ""
5276 "Attempting to detach an already detached thread results in unspecified "
5277 "behavior."
5278 msgstr ""
5279 "すでに detach 状態のスレッドを detach しようとした場合に\n"
5280 "どのような結果となるかは規定されていない。"
5281
5282 #. type: Plain text
5283 #: build/C/man3/pthread_detach.3:52
5284 msgid ""
5285 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
5286 "number."
5287 msgstr ""
5288 "成功すると、B<pthread_detach>() は 0 を返す。\n"
5289 "エラーの場合、エラー番号を返す。"
5290
5291 #. type: Plain text
5292 #: build/C/man3/pthread_detach.3:57 build/C/man3/pthread_join.3:87
5293 msgid "I<thread> is not a joinable thread."
5294 msgstr "I<thread> が join 可能なスレッドではない。"
5295
5296 #. type: Plain text
5297 #: build/C/man3/pthread_detach.3:68
5298 msgid ""
5299 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
5300 "or be made joinable again."
5301 msgstr ""
5302 "いったんスレッドを detached 状態にすると、\n"
5303 "そのスレッドを B<pthread_join>(3) で join したり、\n"
5304 "もう一度 join 可能にしたりすることはできない。"
5305
5306 #. type: Plain text
5307 #: build/C/man3/pthread_detach.3:75
5308 msgid ""
5309 "A new thread can be created in a detached state using "
5310 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
5311 "I<attr> argument of B<pthread_create>(3)."
5312 msgstr ""
5313 "B<pthread_attr_setdetachstate>(3) を使って\n"
5314 "B<pthread_create>(3) の I<attr> 引き数の detached 属性を設定することで、\n"
5315 "新しいスレッドを detached 状態で作成することができる。"
5316
5317 #. type: Plain text
5318 #: build/C/man3/pthread_detach.3:82
5319 msgid ""
5320 "The detached attribute merely determines the behavior of the system when the "
5321 "thread terminates; it does not prevent the thread from being terminated if "
5322 "the process terminates using B<exit>(3)  (or equivalently, if the main "
5323 "thread returns)."
5324 msgstr ""
5325 "detached 属性は、スレッドが終了した際のシステムの動作を決めるだけである。\n"
5326 "プロセスが B<exit>(3) を使って終了した場合に、そのスレッドが終了され\n"
5327 "なくなるようなことはない (なお、メインスレッドが return した場合も\n"
5328 "プロセスが B<exit>(3) を使って終了した場合と全く同じである)。 "
5329
5330 #. type: Plain text
5331 #: build/C/man3/pthread_detach.3:91
5332 msgid ""
5333 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
5334 "thread that an application creates, so that system resources for the thread "
5335 "can be released.  (But note that the resources of all threads are freed when "
5336 "the process terminates.)"
5337 msgstr ""
5338 "アプリケーションが作成した各スレッドについて、そのスレッドが使用して\n"
5339 "いるシステムリソースを解放できるように、B<pthread_join>(3) か\n"
5340 "B<pthread_detach>() のどちらかを呼び出すべきである (ただし、プロセスが\n"
5341 "終了するときには、全てのスレッドのリソースが解放される)。"
5342
5343 #. type: Plain text
5344 #: build/C/man3/pthread_detach.3:93
5345 msgid "The following statement detaches the calling thread:"
5346 msgstr "以下の文は、呼び出したスレッド自身を detach する。"
5347
5348 #. type: Plain text
5349 #: build/C/man3/pthread_detach.3:95
5350 #, no-wrap
5351 msgid "    pthread_detach(pthread_self());\n"
5352 msgstr "    pthread_detach(pthread_self());\n"
5353
5354 #. type: Plain text
5355 #: build/C/man3/pthread_detach.3:102
5356 msgid ""
5357 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
5358 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5359 msgstr ""
5360 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
5361 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5362
5363 #. type: TH
5364 #: build/C/man3/pthread_equal.3:24
5365 #, no-wrap
5366 msgid "PTHREAD_EQUAL"
5367 msgstr "PTHREAD_EQUAL"
5368
5369 #. type: TH
5370 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
5371 #, no-wrap
5372 msgid "2009-03-30"
5373 msgstr "2009-03-30"
5374
5375 #. type: Plain text
5376 #: build/C/man3/pthread_equal.3:27
5377 msgid "pthread_equal - compare thread IDs"
5378 msgstr "pthread_equal - スレッド ID を比較する"
5379
5380 #. type: Plain text
5381 #: build/C/man3/pthread_equal.3:32
5382 #, no-wrap
5383 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5384 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5385
5386 #. type: Plain text
5387 #: build/C/man3/pthread_equal.3:39
5388 msgid "The B<pthread_equal>()  function compares two thread identifiers."
5389 msgstr "B<pthread_equal>() 関数は 2 つのスレッド識別子の比較を行う。"
5390
5391 #. type: Plain text
5392 #: build/C/man3/pthread_equal.3:43
5393 msgid ""
5394 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
5395 "value; otherwise, it returns 0."
5396 msgstr ""
5397 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
5398 "そうでなければ 0 を返す。"
5399
5400 #.  SH VERSIONS
5401 #.  Available since glibc 2.0
5402 #. type: Plain text
5403 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
5404 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_testcancel.3:56
5405 msgid "This function always succeeds."
5406 msgstr "この関数は常に成功する。"
5407
5408 #. type: Plain text
5409 #: build/C/man3/pthread_equal.3:54
5410 msgid ""
5411 "The B<pthread_equal>()  function is necessary because thread IDs should be "
5412 "considered opaque: there is no portable way for applications to directly "
5413 "compare two I<pthread_t> values."
5414 msgstr ""
5415 "B<pthread_equal>() 関数が必要なのは、\n"
5416 "スレッド ID はその内部構造を意識すべきではないためである。\n"
5417 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
5418 "移植性を確保できる形で比較する方法はない。"
5419
5420 #. type: Plain text
5421 #: build/C/man3/pthread_equal.3:58
5422 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5423 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5424
5425 #. type: TH
5426 #: build/C/man3/pthread_exit.3:24
5427 #, no-wrap
5428 msgid "PTHREAD_EXIT"
5429 msgstr "PTHREAD_EXIT"
5430
5431 #. type: Plain text
5432 #: build/C/man3/pthread_exit.3:27
5433 msgid "pthread_exit - terminate calling thread"
5434 msgstr "pthread_exit - 呼び出したスレッドを終了する"
5435
5436 #. type: Plain text
5437 #: build/C/man3/pthread_exit.3:32
5438 #, no-wrap
5439 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
5440 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
5441
5442 #. type: Plain text
5443 #: build/C/man3/pthread_exit.3:43
5444 msgid ""
5445 "The B<pthread_exit>()  function terminates the calling thread and returns a "
5446 "value via I<retval> that (if the thread is joinable)  is available to "
5447 "another thread in the same process that calls B<pthread_join>(3)."
5448 msgstr ""
5449 "B<pthread_exit>() 関数は、呼び出したスレッドを終了し、\n"
5450 "I<retval> 経由で値を返す。\n"
5451 "この値は (そのスレッドが join 可能な場合に) B<pthread_join>(3) を\n"
5452 "呼び出した同じプロセス内の別のスレッドが参照できる値と同じである。"
5453
5454 #. type: Plain text
5455 #: build/C/man3/pthread_exit.3:53
5456 msgid ""
5457 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
5458 "not yet been popped, are popped (in the reverse of the order in which they "
5459 "were pushed)  and executed.  If the thread has any thread-specific data, "
5460 "then, after the clean-up handlers have been executed, the corresponding "
5461 "destructor functions are called, in an unspecified order."
5462 msgstr ""
5463 "B<pthread_cleanup_push>(3) で設定されたクリーンアップハンドラのうち、\n"
5464 "まだ pop (取り出されていない) ハンドラを (push されたのと逆の順序で)\n"
5465 "取り出して実行する。そのスレッドがスレッド固有のデータを持っている\n"
5466 "場合は、クリーンアップハンドラが実行された後に、スレッド固有のデータ\n"
5467 "に対応するデストラクタ (destructor) 関数が呼び出される (呼び出し順序\n"
5468 "は規定されていない)。"
5469
5470 #. type: Plain text
5471 #: build/C/man3/pthread_exit.3:60
5472 msgid ""
5473 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
5474 "variables, semaphores, and file descriptors) are not released, and functions "
5475 "registered using B<atexit>(3)  are not called."
5476 msgstr ""
5477 "スレッドが終了する際に、プロセスの共有リソース (例えば、mutex、状態変数\n"
5478 "(condition variables)、セマフォ、ファイルディスクリプタ)が解放される。\n"
5479 "B<atexit>(3) を使って登録された関数は呼び出されない。"
5480
5481 #. type: Plain text
5482 #: build/C/man3/pthread_exit.3:69
5483 msgid ""
5484 "After the last thread in a process terminates, the process terminates as by "
5485 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
5486 "resources are released and functions registered using B<atexit>(3)  are "
5487 "called."
5488 msgstr ""
5489 "プロセスの最後のスレッドが終了すると、そのプロセスは、終了ステータス 0\n"
5490 "で B<exit>(3) を呼び出した場合と全く同じように終了する。したがって、\n"
5491 "プロセスの共有リソースは解放され、B<atexit>(3) を使って登録された関数\n"
5492 "が呼び出される。"
5493
5494 #. type: Plain text
5495 #: build/C/man3/pthread_exit.3:71
5496 msgid "This function does not return to the caller."
5497 msgstr "この関数は呼び出し側には返らない。"
5498
5499 #. type: Plain text
5500 #: build/C/man3/pthread_exit.3:80
5501 msgid ""
5502 "Performing a return from the start function of any thread other than the "
5503 "main thread results in an implicit call to B<pthread_exit>(), using the "
5504 "function's return value as the thread's exit status."
5505 msgstr ""
5506 "メインスレッド以外のスレッドの開始関数 (start function) がreturn を\n"
5507 "行うと、暗黙のうちに B<pthread_exit>() が呼び出され、\n"
5508 "関数の返り値がスレッドの終了ステータスとして使用される。"
5509
5510 #. type: Plain text
5511 #: build/C/man3/pthread_exit.3:86
5512 msgid ""
5513 "To allow other threads to continue execution, the main thread should "
5514 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
5515 msgstr ""
5516 "他のスレッドが実行を継続できるように、メインスレッドは B<exit>(3) では\n"
5517 "なく B<pthread_exit>() を呼び出して終了すべきである。"
5518
5519 #. type: Plain text
5520 #: build/C/man3/pthread_exit.3:91
5521 msgid ""
5522 "The value pointed to by I<retval> should not be located on the calling "
5523 "thread's stack, since the contents of that stack are undefined after the "
5524 "thread terminates."
5525 msgstr ""
5526 "I<retval> が指す値は、呼び出したスレッドのスタックに置くべきではない。\n"
5527 "呼び出したスレッドが終了した後は、そのスタックの内容が不定となるから\n"
5528 "である。"
5529
5530 #.  Linux 2.6.27
5531 #.  FIXME . review a later kernel to see if this gets fixed
5532 #.  http://thread.gmane.org/gmane.linux.kernel/611611
5533 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
5534 #. type: Plain text
5535 #: build/C/man3/pthread_exit.3:103
5536 msgid ""
5537 "Currently, there are limitations in the kernel implementation logic for "
5538 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
5539 "This can manifest in problems such as a locked terminal if a stop signal is "
5540 "sent to a foreground process whose thread group leader has already called "
5541 "B<pthread_exit>()."
5542 msgstr ""
5543 "現在のところ、停止 (stop) されたスレッドグループを、すでに終了した\n"
5544 "(dead) スレッドグループリーダーで B<wait>(2) する場合の、\n"
5545 "カーネル実装の論理には制限がある。\n"
5546 "この制限は、すでにスレッドグループリーダーが B<pthread_exit>() を\n"
5547 "呼び出しているようなフォアグラウンドプロセスにストップシグナルが送信\n"
5548 "された場合に、端末がロックされてしまう、といった問題として表に見える\n"
5549 "場合がある。"
5550
5551 #. type: Plain text
5552 #: build/C/man3/pthread_exit.3:107
5553 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5554 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5555
5556 #. type: TH
5557 #: build/C/man3/pthread_getattr_np.3:24
5558 #, no-wrap
5559 msgid "PTHREAD_GETATTR_NP"
5560 msgstr "PTHREAD_GETATTR_NP"
5561
5562 #. type: Plain text
5563 #: build/C/man3/pthread_getattr_np.3:27
5564 msgid "pthread_getattr_np - get attributes of created thread"
5565 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
5566
5567 #. type: Plain text
5568 #: build/C/man3/pthread_getattr_np.3:33
5569 #, no-wrap
5570 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5571 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5572
5573 #. type: Plain text
5574 #: build/C/man3/pthread_getattr_np.3:43
5575 msgid ""
5576 "The B<pthread_getattr_np>()  function initializes the thread attributes "
5577 "object referred to by I<attr> so that it contains actual attribute values "
5578 "describing the running thread I<thread>."
5579 msgstr ""
5580 "B<pthread_getattr_np>() 関数は、\n"
5581 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
5582 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
5583 "格納して返す。"
5584
5585 #. type: Plain text
5586 #: build/C/man3/pthread_getattr_np.3:50
5587 msgid ""
5588 "The returned attribute values may differ from the corresponding attribute "
5589 "values passed in the I<attr> object that was used to create the thread using "
5590 "B<pthread_create>(3).  In particular, the following attributes may differ:"
5591 msgstr ""
5592 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
5593 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
5594 "特に、以下の属性は異なる場合がある。"
5595
5596 #. type: Plain text
5597 #: build/C/man3/pthread_getattr_np.3:53
5598 msgid ""
5599 "the detach state, since a joinable thread may have detached itself after "
5600 "creation;"
5601 msgstr ""
5602 "detach state. join 可能なスレッドは作成後に自分自身を\n"
5603 "切り離す (detach する) ことができるからである。"
5604
5605 #. type: Plain text
5606 #: build/C/man3/pthread_getattr_np.3:56
5607 msgid ""
5608 "the stack size, which the implementation may align to a suitable boundary."
5609 msgstr ""
5610 "スタックサイズ。\n"
5611 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
5612
5613 #. type: Plain text
5614 #: build/C/man3/pthread_getattr_np.3:61
5615 msgid ""
5616 "and the guard size, which the implementation may round upward to a multiple "
5617 "of the page size, or ignore (i.e., treat as 0), if the application is "
5618 "allocating its own stack."
5619 msgstr ""
5620 "guard size.\n"
5621 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
5622 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
5623 "(0 として扱われる) ことがあるからである。"
5624
5625 #. type: Plain text
5626 #: build/C/man3/pthread_getattr_np.3:66
5627 msgid ""
5628 "Furthermore, if the stack address attribute was not set in the thread "
5629 "attributes object used to create the thread, then the returned thread "
5630 "attributes object will report the actual stack address that the "
5631 "implementation selected for the thread."
5632 msgstr ""
5633 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
5634 "スタックアドレスが設定されていなかった場合、\n"
5635 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
5636 "割り当てた実際のスタックアドレスが報告される。"
5637
5638 #. type: Plain text
5639 #: build/C/man3/pthread_getattr_np.3:71
5640 msgid ""
5641 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
5642 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
5643 msgstr ""
5644 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
5645 "必要なくなった際には、  B<pthread_attr_destroy>(3) を使って\n"
5646 "そのオブジェクトを破棄すべきである。"
5647
5648 #. type: Plain text
5649 #: build/C/man3/pthread_getattr_np.3:74
5650 #: build/C/man3/pthread_getcpuclockid.3:47
5651 msgid ""
5652 "On success, this function returns 0; on error, it returns a nonzero error "
5653 "number."
5654 msgstr ""
5655 "成功すると、この関数は 0 を返す。\n"
5656 "エラーの場合、 0 以外のエラー番号を返す。"
5657
5658 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
5659 #. type: Plain text
5660 #: build/C/man3/pthread_getattr_np.3:79
5661 msgid "Insufficient memory."
5662 msgstr "メモリが十分になかった。"
5663
5664 #. type: Plain text
5665 #: build/C/man3/pthread_getattr_np.3:94
5666 msgid ""
5667 "In addition, if I<thread> refers to the main thread, then "
5668 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
5669 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and B<getrlimit>"
5670 "(2), if the B<RLIMIT_STACK> resource limit is not supported."
5671 msgstr ""
5672 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
5673 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
5674 "エラーで失敗する可能性がある。\n"
5675 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
5676 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
5677 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
5678
5679 #. type: Plain text
5680 #: build/C/man3/pthread_getattr_np.3:96
5681 msgid "This function is available in glibc since version 2.2.3."
5682 msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。"
5683
5684 #. type: Plain text
5685 #: build/C/man3/pthread_getattr_np.3:99
5686 #: build/C/man3/pthread_kill_other_threads_np.3:48
5687 msgid ""
5688 "This function is a nonstandard GNU extension; hence the suffix \"_np"
5689 "\" (nonportable) in the name."
5690 msgstr ""
5691 "この関数は非標準の GNU による拡張である。\n"
5692 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
5693 "付いている。"
5694
5695 #. type: Plain text
5696 #: build/C/man3/pthread_getattr_np.3:109
5697 msgid ""
5698 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
5699 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
5700 "and display its guard size, stack address, and stack size attributes.  "
5701 "Command-line arguments can be used to set these attributes to values other "
5702 "than the default when creating the thread.  The shell sessions below "
5703 "demonstrate the use of the program."
5704 msgstr ""
5705 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
5706 "このプログラムは、スレッドを作成し、それから\n"
5707 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
5708 "スタックアドレス、スタックサイズを取得し表示する。\n"
5709 "コマンドライン引き数での指定で、スレッドを作成する際に\n"
5710 "上記の属性にデフォルト値以外の値を設定することができる。\n"
5711 "下記のシェルのセッションはこのプログラムの使用例である。"
5712
5713 #. type: Plain text
5714 #: build/C/man3/pthread_getattr_np.3:112
5715 msgid ""
5716 "In the first run, on an x86-32 system, a thread is created using default "
5717 "attributes:"
5718 msgstr ""
5719 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
5720 "(x86-32 システム上で実行)。"
5721
5722 #. type: Plain text
5723 #: build/C/man3/pthread_getattr_np.3:122
5724 #, no-wrap
5725 msgid ""
5726 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5727 "unlimited\n"
5728 "$B< ./a.out>\n"
5729 "Attributes of created thread:\n"
5730 "        Guard size          = 4096 bytes\n"
5731 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5732 "        Stack size          = 0x201000 (2101248) bytes\n"
5733 msgstr ""
5734 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5735 "unlimited\n"
5736 "$B< ./a.out>\n"
5737 "Attributes of created thread:\n"
5738 "        Guard size          = 4096 bytes\n"
5739 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5740 "        Stack size          = 0x201000 (2101248) bytes\n"
5741
5742 #. type: Plain text
5743 #: build/C/man3/pthread_getattr_np.3:128
5744 msgid ""
5745 "In the following run, we see that if a guard size is specified, it is "
5746 "rounded up to the next multiple of the system page size (4096 bytes on "
5747 "x86-32):"
5748 msgstr ""
5749 "次の実行例では、guard size が指定された場合、\n"
5750 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
5751 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
5752
5753 #. type: Plain text
5754 #: build/C/man3/pthread_getattr_np.3:136
5755 #, no-wrap
5756 msgid ""
5757 "$B< ./a.out -g 4097>\n"
5758 "Thread attributes object after initializations:\n"
5759 "        Guard size          = 4097 bytes\n"
5760 "        Stack address       = (nil)\n"
5761 "        Stack size          = 0x0 (0) bytes\n"
5762 msgstr ""
5763 "$B< ./a.out -g 4097>\n"
5764 "Thread attributes object after initializations:\n"
5765 "        Guard size          = 4097 bytes\n"
5766 "        Stack address       = (nil)\n"
5767 "        Stack size          = 0x0 (0) bytes\n"
5768
5769 #. type: Plain text
5770 #: build/C/man3/pthread_getattr_np.3:141
5771 #, no-wrap
5772 msgid ""
5773 "Attributes of created thread:\n"
5774 "        Guard size          = 8192 bytes\n"
5775 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5776 "        Stack size          = 0x201000 (2101248) bytes\n"
5777 msgstr ""
5778 "Attributes of created thread:\n"
5779 "        Guard size          = 8192 bytes\n"
5780 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5781 "        Stack size          = 0x201000 (2101248) bytes\n"
5782
5783 #. .in +4n
5784 #. .nf
5785 #. $ ./a.out \-s 0x8000
5786 #. Thread attributes object after initializations:
5787 #.         Guard size          = 4096 bytes
5788 #.         Stack address       = 0xffff8000 (EOS = (nil))
5789 #.         Stack size          = 0x8000 (32768) bytes
5790 #. Attributes of created thread:
5791 #.         Guard size          = 4096 bytes
5792 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
5793 #.         Stack size          = 0x8000 (32768) bytes
5794 #. .fi
5795 #. .in
5796 #. type: Plain text
5797 #: build/C/man3/pthread_getattr_np.3:160
5798 msgid ""
5799 "In the last run, the program manually allocates a stack for the thread.  In "
5800 "this case, the guard size attribute is ignored."
5801 msgstr ""
5802 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
5803 "この場合には、guard size 属性は無視される。"
5804
5805 #. type: Plain text
5806 #: build/C/man3/pthread_getattr_np.3:165
5807 #, no-wrap
5808 msgid ""
5809 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5810 "Allocated thread stack at 0x804d000\n"
5811 msgstr ""
5812 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5813 "Allocated thread stack at 0x804d000\n"
5814
5815 #. type: Plain text
5816 #: build/C/man3/pthread_getattr_np.3:170
5817 #, no-wrap
5818 msgid ""
5819 "Thread attributes object after initializations:\n"
5820 "        Guard size          = 4096 bytes\n"
5821 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5822 "        Stack size          = 0x8000 (32768) bytes\n"
5823 msgstr ""
5824 "Thread attributes object after initializations:\n"
5825 "        Guard size          = 4096 bytes\n"
5826 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5827 "        Stack size          = 0x8000 (32768) bytes\n"
5828
5829 #. type: Plain text
5830 #: build/C/man3/pthread_getattr_np.3:175
5831 #, no-wrap
5832 msgid ""
5833 "Attributes of created thread:\n"
5834 "        Guard size          = 0 bytes\n"
5835 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5836 "        Stack size          = 0x8000 (32768) bytes\n"
5837 msgstr ""
5838 "Attributes of created thread:\n"
5839 "        Guard size          = 0 bytes\n"
5840 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5841 "        Stack size          = 0x8000 (32768) bytes\n"
5842
5843 #. type: Plain text
5844 #: build/C/man3/pthread_getattr_np.3:196
5845 #, no-wrap
5846 msgid ""
5847 "static void\n"
5848 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5849 "{\n"
5850 "    int s;\n"
5851 "    size_t stack_size, guard_size;\n"
5852 "    void *stack_addr;\n"
5853 msgstr ""
5854 "static void\n"
5855 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5856 "{\n"
5857 "    int s;\n"
5858 "    size_t stack_size, guard_size;\n"
5859 "    void *stack_addr;\n"
5860
5861 #. type: Plain text
5862 #: build/C/man3/pthread_getattr_np.3:201
5863 #, no-wrap
5864 msgid ""
5865 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5866 "    if (s != 0)\n"
5867 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5868 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5869 msgstr ""
5870 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5871 "    if (s != 0)\n"
5872 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5873 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5874
5875 #. type: Plain text
5876 #: build/C/man3/pthread_getattr_np.3:212
5877 #, no-wrap
5878 msgid ""
5879 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5880 "    if (s != 0)\n"
5881 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5882 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5883 "    if (stack_size E<gt> 0)\n"
5884 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5885 "    printf(\"\\en\");\n"
5886 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5887 "            prefix, stack_size, stack_size);\n"
5888 "}\n"
5889 msgstr ""
5890 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5891 "    if (s != 0)\n"
5892 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5893 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5894 "    if (stack_size E<gt> 0)\n"
5895 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5896 "    printf(\"\\en\");\n"
5897 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5898 "            prefix, stack_size, stack_size);\n"
5899 "}\n"
5900
5901 #. type: Plain text
5902 #: build/C/man3/pthread_getattr_np.3:218
5903 #, no-wrap
5904 msgid ""
5905 "static void\n"
5906 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5907 "{\n"
5908 "    int s;\n"
5909 "    pthread_attr_t attr;\n"
5910 msgstr ""
5911 "static void\n"
5912 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5913 "{\n"
5914 "    int s;\n"
5915 "    pthread_attr_t attr;\n"
5916
5917 #. type: Plain text
5918 #: build/C/man3/pthread_getattr_np.3:222
5919 #, no-wrap
5920 msgid ""
5921 "    s = pthread_getattr_np(thread, &attr);\n"
5922 "    if (s != 0)\n"
5923 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5924 msgstr ""
5925 "    s = pthread_getattr_np(thread, &attr);\n"
5926 "    if (s != 0)\n"
5927 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5928
5929 #. type: Plain text
5930 #: build/C/man3/pthread_getattr_np.3:224
5931 #, no-wrap
5932 msgid "    display_stack_related_attributes(&attr, prefix);\n"
5933 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
5934
5935 #. type: Plain text
5936 #: build/C/man3/pthread_getattr_np.3:229
5937 #, no-wrap
5938 msgid ""
5939 "    s = pthread_attr_destroy(&attr);\n"
5940 "    if (s != 0)\n"
5941 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5942 "}\n"
5943 msgstr ""
5944 "    s = pthread_attr_destroy(&attr);\n"
5945 "    if (s != 0)\n"
5946 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5947 "}\n"
5948
5949 #. type: Plain text
5950 #: build/C/man3/pthread_getattr_np.3:235
5951 #, no-wrap
5952 msgid ""
5953 "static void *           /* Start function for thread we create */\n"
5954 "thread_start(void *arg)\n"
5955 "{\n"
5956 "    printf(\"Attributes of created thread:\\en\");\n"
5957 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5958 msgstr ""
5959 "static void *           /* Start function for thread we create */\n"
5960 "thread_start(void *arg)\n"
5961 "{\n"
5962 "    printf(\"Attributes of created thread:\\en\");\n"
5963 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5964
5965 #. type: Plain text
5966 #: build/C/man3/pthread_getattr_np.3:249
5967 #, no-wrap
5968 msgid ""
5969 "static void\n"
5970 "usage(char *pname, char *msg)\n"
5971 "{\n"
5972 "    if (msg != NULL)\n"
5973 "        fputs(msg, stderr);\n"
5974 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5975 "            \" [-g guard-size]\\en\", pname);\n"
5976 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5977 "    exit(EXIT_FAILURE);\n"
5978 "}\n"
5979 msgstr ""
5980 "static void\n"
5981 "usage(char *pname, char *msg)\n"
5982 "{\n"
5983 "    if (msg != NULL)\n"
5984 "        fputs(msg, stderr);\n"
5985 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5986 "            \" [-g guard-size]\\en\", pname);\n"
5987 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5988 "    exit(EXIT_FAILURE);\n"
5989 "}\n"
5990
5991 #. type: Plain text
5992 #: build/C/man3/pthread_getattr_np.3:262
5993 #, no-wrap
5994 msgid ""
5995 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5996 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5997 "                              pthread_attr_t *attrp)\n"
5998 "{\n"
5999 "    int s, opt, allocate_stack;\n"
6000 "    long stack_size, guard_size;\n"
6001 "            void *stack_addr;\n"
6002 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6003 "                                           a thread attributes object */\n"
6004 "    allocate_stack = 0;\n"
6005 "    stack_size = -1;\n"
6006 "    guard_size = -1;\n"
6007 msgstr ""
6008 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6009 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6010 "                              pthread_attr_t *attrp)\n"
6011 "{\n"
6012 "    int s, opt, allocate_stack;\n"
6013 "    long stack_size, guard_size;\n"
6014 "            void *stack_addr;\n"
6015 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6016 "                                           a thread attributes object */\n"
6017 "    allocate_stack = 0;\n"
6018 "    stack_size = -1;\n"
6019 "    guard_size = -1;\n"
6020
6021 #. type: Plain text
6022 #: build/C/man3/pthread_getattr_np.3:271
6023 #, no-wrap
6024 msgid ""
6025 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6026 "        switch (opt) {\n"
6027 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6028 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6029 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6030 "        default:    usage(argv[0], NULL);\n"
6031 "        }\n"
6032 "    }\n"
6033 msgstr ""
6034 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6035 "        switch (opt) {\n"
6036 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6037 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6038 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6039 "        default:    usage(argv[0], NULL);\n"
6040 "        }\n"
6041 "    }\n"
6042
6043 #. type: Plain text
6044 #: build/C/man3/pthread_getattr_np.3:274
6045 #, no-wrap
6046 msgid ""
6047 "    if (allocate_stack && stack_size == -1)\n"
6048 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6049 msgstr ""
6050 "    if (allocate_stack && stack_size == -1)\n"
6051 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6052
6053 #. type: Plain text
6054 #: build/C/man3/pthread_getattr_np.3:277
6055 #, no-wrap
6056 msgid ""
6057 "    if (argc E<gt> optind)\n"
6058 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6059 msgstr ""
6060 "    if (argc E<gt> optind)\n"
6061 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6062
6063 #. type: Plain text
6064 #: build/C/man3/pthread_getattr_np.3:280
6065 #, no-wrap
6066 msgid ""
6067 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6068 "        ret_attrp = attrp;\n"
6069 msgstr ""
6070 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6071 "        ret_attrp = attrp;\n"
6072
6073 #. type: Plain text
6074 #: build/C/man3/pthread_getattr_np.3:285
6075 #, no-wrap
6076 msgid ""
6077 "        s = pthread_attr_init(attrp);\n"
6078 "        if (s != 0)\n"
6079 "            handle_error_en(s, \"pthread_attr_init\");\n"
6080 "    }\n"
6081 msgstr ""
6082 "        s = pthread_attr_init(attrp);\n"
6083 "        if (s != 0)\n"
6084 "            handle_error_en(s, \"pthread_attr_init\");\n"
6085 "    }\n"
6086
6087 #. type: Plain text
6088 #: build/C/man3/pthread_getattr_np.3:297
6089 #, no-wrap
6090 msgid ""
6091 "    if (stack_size E<gt>= 0) {\n"
6092 "        if (!allocate_stack) {\n"
6093 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6094 "            if (s != 0)\n"
6095 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6096 "        } else {\n"
6097 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6098 "                               stack_size);\n"
6099 "            if (s != 0)\n"
6100 "                handle_error_en(s, \"posix_memalign\");\n"
6101 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6102 msgstr ""
6103 "    if (stack_size E<gt>= 0) {\n"
6104 "        if (!allocate_stack) {\n"
6105 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6106 "            if (s != 0)\n"
6107 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6108 "        } else {\n"
6109 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6110 "                               stack_size);\n"
6111 "            if (s != 0)\n"
6112 "                handle_error_en(s, \"posix_memalign\");\n"
6113 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6114
6115 #. type: Plain text
6116 #: build/C/man3/pthread_getattr_np.3:303
6117 #, no-wrap
6118 msgid ""
6119 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6120 "            if (s != 0)\n"
6121 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6122 "        }\n"
6123 "    }\n"
6124 msgstr ""
6125 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6126 "            if (s != 0)\n"
6127 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6128 "        }\n"
6129 "    }\n"
6130
6131 #. type: Plain text
6132 #: build/C/man3/pthread_getattr_np.3:309
6133 #, no-wrap
6134 msgid ""
6135 "    if (guard_size E<gt>= 0) {\n"
6136 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6137 "        if (s != 0)\n"
6138 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6139 "    }\n"
6140 msgstr ""
6141 "    if (guard_size E<gt>= 0) {\n"
6142 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6143 "        if (s != 0)\n"
6144 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6145 "    }\n"
6146
6147 #. type: Plain text
6148 #: build/C/man3/pthread_getattr_np.3:312
6149 #, no-wrap
6150 msgid ""
6151 "    return ret_attrp;\n"
6152 "}\n"
6153 msgstr ""
6154 "    return ret_attrp;\n"
6155 "}\n"
6156
6157 #. type: Plain text
6158 #: build/C/man3/pthread_getattr_np.3:321
6159 #, no-wrap
6160 msgid ""
6161 "int\n"
6162 "main(int argc, char *argv[])\n"
6163 "{\n"
6164 "    int s;\n"
6165 "    pthread_t thr;\n"
6166 "    pthread_attr_t attr;\n"
6167 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6168 "                                        a thread attributes object */\n"
6169 msgstr ""
6170 "int\n"
6171 "main(int argc, char *argv[])\n"
6172 "{\n"
6173 "    int s;\n"
6174 "    pthread_t thr;\n"
6175 "    pthread_attr_t attr;\n"
6176 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6177 "                                        a thread attributes object */\n"
6178
6179 #. type: Plain text
6180 #: build/C/man3/pthread_getattr_np.3:323
6181 #, no-wrap
6182 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6183 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6184
6185 #. type: Plain text
6186 #: build/C/man3/pthread_getattr_np.3:329
6187 #, no-wrap
6188 msgid ""
6189 "    if (attrp != NULL) {\n"
6190 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6191 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6192 "        printf(\"\\en\");\n"
6193 "    }\n"
6194 msgstr ""
6195 "    if (attrp != NULL) {\n"
6196 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6197 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6198 "        printf(\"\\en\");\n"
6199 "    }\n"
6200
6201 #. type: Plain text
6202 #: build/C/man3/pthread_getattr_np.3:357
6203 msgid ""
6204 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6205 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6206 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6207 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6208 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6209 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6210 msgstr ""
6211 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6212 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6213 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6214 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6215 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6216 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6217
6218 #. type: TH
6219 #: build/C/man3/pthread_getcpuclockid.3:24
6220 #, no-wrap
6221 msgid "PTHREAD_GETCPUCLOCKID"
6222 msgstr "PTHREAD_GETCPUCLOCKID"
6223
6224 #. type: TH
6225 #: build/C/man3/pthread_getcpuclockid.3:24
6226 #, no-wrap
6227 msgid "2009-02-08"
6228 msgstr "2009-02-08"
6229
6230 #. type: Plain text
6231 #: build/C/man3/pthread_getcpuclockid.3:27
6232 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
6233 msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する"
6234
6235 #. type: Plain text
6236 #: build/C/man3/pthread_getcpuclockid.3:31
6237 #, no-wrap
6238 msgid ""
6239 "B<#include E<lt>pthread.hE<gt>>\n"
6240 "B<#include E<lt>time.hE<gt>>\n"
6241 msgstr ""
6242 "B<#include E<lt>pthread.hE<gt>>\n"
6243 "B<#include E<lt>time.hE<gt>>\n"
6244
6245 #. type: Plain text
6246 #: build/C/man3/pthread_getcpuclockid.3:33
6247 #, no-wrap
6248 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
6249 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
6250
6251 #.  The clockid is constructed as follows:
6252 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
6253 #.  where CLOCK_IDFIELD_SIZE is 3.
6254 #. type: Plain text
6255 #: build/C/man3/pthread_getcpuclockid.3:44
6256 msgid ""
6257 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
6258 "time clock of the thread I<thread>."
6259 msgstr ""
6260 "B<pthread_getcpuclockid>() 関数は、\n"
6261 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
6262
6263 #. type: TP
6264 #: build/C/man3/pthread_getcpuclockid.3:48
6265 #, no-wrap
6266 msgid "B<ENOENT>"
6267 msgstr "B<ENOENT>"
6268
6269 #.  CLOCK_THREAD_CPUTIME_ID not defined
6270 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
6271 #.  be possible if kernel thread IDs took more than 29 bits (which
6272 #.  they currently cannot).
6273 #. type: Plain text
6274 #: build/C/man3/pthread_getcpuclockid.3:56
6275 msgid "Per-thread CPU time clocks are not supported by the system."
6276 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
6277
6278 #. type: Plain text
6279 #: build/C/man3/pthread_getcpuclockid.3:63
6280 msgid "This function is available in glibc since version 2.2."
6281 msgstr "この関数は glibc バージョン 2.2 以降で利用できる。"
6282
6283 #. type: Plain text
6284 #: build/C/man3/pthread_getcpuclockid.3:76
6285 msgid ""
6286 "When I<thread> refers to the calling thread, this function returns an "
6287 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
6288 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
6289 msgstr ""
6290 "I<thread> が呼び出したスレッドを参照している場合、\n"
6291 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
6292 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
6293 "を参照する ID が返される。"
6294
6295 #. type: Plain text
6296 #: build/C/man3/pthread_getcpuclockid.3:82
6297 msgid ""
6298 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
6299 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
6300 "the two threads.  The following shell session shows an example run:"
6301 msgstr ""
6302 "以下のプログラムは、スレッドを作成し、それから\n"
6303 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
6304 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
6305 "スレッド毎の CPU 時間を取得する。\n"
6306 "下記のシェルのセッションは実行例である。"
6307
6308 #. type: Plain text
6309 #: build/C/man3/pthread_getcpuclockid.3:91
6310 #, no-wrap
6311 msgid ""
6312 "$ B<./a.out>\n"
6313 "Main thread sleeping\n"
6314 "Subthread starting infinite loop\n"
6315 "Main thread consuming some CPU time...\n"
6316 "Process total CPU time:    1.368\n"
6317 "Main thread CPU time:      0.376\n"
6318 "Subthread CPU time:        0.992\n"
6319 msgstr ""
6320 "$ B<./a.out>\n"
6321 "Main thread sleeping\n"
6322 "Subthread starting infinite loop\n"
6323 "Main thread consuming some CPU time...\n"
6324 "Process total CPU time:    1.368\n"
6325 "Main thread CPU time:      0.376\n"
6326 "Subthread CPU time:        0.992\n"
6327
6328 #. type: Plain text
6329 #: build/C/man3/pthread_getcpuclockid.3:97
6330 #, no-wrap
6331 msgid "/* Link with \"-lrt\" */\n"
6332 msgstr "/* \"-lrt\" でリンクする */\n"
6333
6334 #. type: Plain text
6335 #: build/C/man3/pthread_getcpuclockid.3:105
6336 #, no-wrap
6337 msgid ""
6338 "#include E<lt>time.hE<gt>\n"
6339 "#include E<lt>stdio.hE<gt>\n"
6340 "#include E<lt>stdlib.hE<gt>\n"
6341 "#include E<lt>unistd.hE<gt>\n"
6342 "#include E<lt>pthread.hE<gt>\n"
6343 "#include E<lt>string.hE<gt>\n"
6344 "#include E<lt>errno.hE<gt>\n"
6345 msgstr ""
6346 "#include E<lt>time.hE<gt>\n"
6347 "#include E<lt>stdio.hE<gt>\n"
6348 "#include E<lt>stdlib.hE<gt>\n"
6349 "#include E<lt>unistd.hE<gt>\n"
6350 "#include E<lt>pthread.hE<gt>\n"
6351 "#include E<lt>string.hE<gt>\n"
6352 "#include E<lt>errno.hE<gt>\n"
6353
6354 #. type: Plain text
6355 #: build/C/man3/pthread_getcpuclockid.3:119
6356 #, no-wrap
6357 msgid ""
6358 "static void *\n"
6359 "thread_start(void *arg)\n"
6360 "{\n"
6361 "    printf(\"Subthread starting infinite loop\\en\");\n"
6362 "    for (;;)\n"
6363 "        continue;\n"
6364 "}\n"
6365 msgstr ""
6366 "static void *\n"
6367 "thread_start(void *arg)\n"
6368 "{\n"
6369 "    printf(\"Subthread starting infinite loop\\en\");\n"
6370 "    for (;;)\n"
6371 "        continue;\n"
6372 "}\n"
6373
6374 #. type: Plain text
6375 #: build/C/man3/pthread_getcpuclockid.3:124
6376 #, no-wrap
6377 msgid ""
6378 "static void\n"
6379 "pclock(char *msg, clockid_t cid)\n"
6380 "{\n"
6381 "    struct timespec ts;\n"
6382 msgstr ""
6383 "static void\n"
6384 "pclock(char *msg, clockid_t cid)\n"
6385 "{\n"
6386 "    struct timespec ts;\n"
6387
6388 #. type: Plain text
6389 #: build/C/man3/pthread_getcpuclockid.3:130
6390 #, no-wrap
6391 msgid ""
6392 "    printf(\"%s\", msg);\n"
6393 "    if (clock_gettime(cid, &ts) == -1)\n"
6394 "        handle_error(\"clock_gettime\");\n"
6395 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6396 "}\n"
6397 msgstr ""
6398 "    printf(\"%s\", msg);\n"
6399 "    if (clock_gettime(cid, &ts) == -1)\n"
6400 "        handle_error(\"clock_gettime\");\n"
6401 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6402 "}\n"
6403
6404 #. type: Plain text
6405 #: build/C/man3/pthread_getcpuclockid.3:137
6406 #, no-wrap
6407 msgid ""
6408 "int\n"
6409 "main(int argc, char *argv[])\n"
6410 "{\n"
6411 "    pthread_t thread;\n"
6412 "    clockid_t cid;\n"
6413 "    int j, s;\n"
6414 msgstr ""
6415 "int\n"
6416 "main(int argc, char *argv[])\n"
6417 "{\n"
6418 "    pthread_t thread;\n"
6419 "    clockid_t cid;\n"
6420 "    int j, s;\n"
6421
6422 #. type: Plain text
6423 #: build/C/man3/pthread_getcpuclockid.3:141
6424 #, no-wrap
6425 msgid ""
6426 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6427 "    if (s != 0)\n"
6428 "        handle_error_en(s, \"pthread_create\");\n"
6429 msgstr ""
6430 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6431 "    if (s != 0)\n"
6432 "        handle_error_en(s, \"pthread_create\");\n"
6433
6434 #. type: Plain text
6435 #: build/C/man3/pthread_getcpuclockid.3:144
6436 #, no-wrap
6437 msgid ""
6438 "    printf(\"Main thread sleeping\\en\");\n"
6439 "    sleep(1);\n"
6440 msgstr ""
6441 "    printf(\"Main thread sleeping\\en\");\n"
6442 "    sleep(1);\n"
6443
6444 #. type: Plain text
6445 #: build/C/man3/pthread_getcpuclockid.3:148
6446 #, no-wrap
6447 msgid ""
6448 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6449 "    for (j = 0; j E<lt> 2000000; j++)\n"
6450 "        getppid();\n"
6451 msgstr ""
6452 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6453 "    for (j = 0; j E<lt> 2000000; j++)\n"
6454 "        getppid();\n"
6455
6456 #. type: Plain text
6457 #: build/C/man3/pthread_getcpuclockid.3:150
6458 #, no-wrap
6459 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6460 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6461
6462 #. type: Plain text
6463 #: build/C/man3/pthread_getcpuclockid.3:155
6464 #, no-wrap
6465 msgid ""
6466 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6467 "    if (s != 0)\n"
6468 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6469 "    pclock(\"Main thread CPU time:   \", cid);\n"
6470 msgstr ""
6471 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6472 "    if (s != 0)\n"
6473 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6474 "    pclock(\"Main thread CPU time:   \", cid);\n"
6475
6476 #. type: Plain text
6477 #: build/C/man3/pthread_getcpuclockid.3:158
6478 #, no-wrap
6479 msgid ""
6480 "    /* The preceding 4 lines of code could have been replaced by:\n"
6481 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6482 msgstr ""
6483 "    /* The preceding 4 lines of code could have been replaced by:\n"
6484 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6485
6486 #. type: Plain text
6487 #: build/C/man3/pthread_getcpuclockid.3:163
6488 #, no-wrap
6489 msgid ""
6490 "    s = pthread_getcpuclockid(thread, &cid);\n"
6491 "    if (s != 0)\n"
6492 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6493 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6494 msgstr ""
6495 "    s = pthread_getcpuclockid(thread, &cid);\n"
6496 "    if (s != 0)\n"
6497 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6498 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6499
6500 #. type: Plain text
6501 #: build/C/man3/pthread_getcpuclockid.3:166
6502 #, no-wrap
6503 msgid ""
6504 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6505 "}\n"
6506 msgstr ""
6507 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6508 "}\n"
6509
6510 #. type: Plain text
6511 #: build/C/man3/pthread_getcpuclockid.3:175
6512 msgid ""
6513 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6514 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6515 msgstr ""
6516 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6517 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6518
6519 #. type: TH
6520 #: build/C/man3/pthread_join.3:24
6521 #, no-wrap
6522 msgid "PTHREAD_JOIN"
6523 msgstr "PTHREAD_JOIN"
6524
6525 #. type: Plain text
6526 #: build/C/man3/pthread_join.3:27
6527 msgid "pthread_join - join with a terminated thread"
6528 msgstr "pthread_join - 終了したスレッドを join する"
6529
6530 #. type: Plain text
6531 #: build/C/man3/pthread_join.3:32
6532 #, no-wrap
6533 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6534 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6535
6536 #. type: Plain text
6537 #: build/C/man3/pthread_join.3:47
6538 msgid ""
6539 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
6540 "to terminate.  If that thread has already terminated, then B<pthread_join>"
6541 "()  returns immediately.  The thread specified by I<thread> must be joinable."
6542 msgstr ""
6543 "B<pthread_join>() 関数は、I<thread> で指定されたスレッドが\n"
6544 "終了するのを待つ。そのスレッドがすでに終了している場合、\n"
6545 "B<pthread_join>() はすぐに返る。\n"
6546 "I<thread> で指定されたスレッドは join 可能でなければならない。"
6547
6548 #. type: Plain text
6549 #: build/C/man3/pthread_join.3:61
6550 msgid ""
6551 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
6552 "the target thread (i.e., the value that the target thread supplied to "
6553 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
6554 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
6555 msgstr ""
6556 "I<retval> が NULL でない場合、 B<pthread_join>() は対象スレッドの終了\n"
6557 "ステータス (すなわち、対象スレッドが B<pthread_exit>(3) に渡した値) を\n"
6558 "I<*retval> が指す場所にコピーする。対象スレッドがキャンセルされた場合、\n"
6559 "I<*retval> には B<PTHREAD_CANCELED> が格納される。"
6560
6561 #. type: Plain text
6562 #: build/C/man3/pthread_join.3:68
6563 msgid ""
6564 "If multiple threads simultaneously try to join with the same thread, the "
6565 "results are undefined.  If the thread calling B<pthread_join>()  is "
6566 "canceled, then the target thread will remain joinable (i.e., it will not be "
6567 "detached)."
6568 msgstr ""
6569 "複数のスレッドが同時に同じスレッドを join しようとした場合、その結果\n"
6570 "は不定である。B<pthread_join>() を呼び出しているスレッドがキャンセル\n"
6571 "された場合、対象スレッドは join 可能のままとなる (detached 状態には\n"
6572 "ならない)。"
6573
6574 #. type: Plain text
6575 #: build/C/man3/pthread_join.3:73
6576 msgid ""
6577 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
6578 "number."
6579 msgstr ""
6580 "成功すると、 B<pthread_join>() は 0 を返す。\n"
6581 "エラーの場合、エラー番号を返す。"
6582
6583 #. type: TP
6584 #: build/C/man3/pthread_join.3:74
6585 #, no-wrap
6586 msgid "B<EDEADLK>"
6587 msgstr "B<EDEADLK>"
6588
6589 #.  The following verified by testing on glibc 2.8/NPTL:
6590 #.  The following verified by testing on glibc 2.8/NPTL:
6591 #. type: Plain text
6592 #: build/C/man3/pthread_join.3:83
6593 msgid ""
6594 "A deadlock was detected (e.g., two threads tried to join with each other); "
6595 "or I<thread> specifies the calling thread."
6596 msgstr ""
6597 "デッドロックが検出された (例えば、二つのスレッドが互いに join しようと\n"
6598 "した場合)、または I<thread> に呼び出したスレッドが指定されている。"
6599
6600 #.  POSIX.1-2001 does not specify this error case.
6601 #. type: Plain text
6602 #: build/C/man3/pthread_join.3:91
6603 msgid "Another thread is already waiting to join with this thread."
6604 msgstr "別のスレッドがすでにこのスレッドの join 待ちである。"
6605
6606 #. type: Plain text
6607 #: build/C/man3/pthread_join.3:102
6608 msgid ""
6609 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
6610 "the target thread has terminated."
6611 msgstr ""
6612 "B<pthread_join>() の呼び出しが成功した場合は、\n"
6613 "呼び出し側には、対象スレッドが終了していることが保証される。"
6614
6615 #. type: Plain text
6616 #: build/C/man3/pthread_join.3:105
6617 msgid ""
6618 "Joining with a thread that has previously been joined results in undefined "
6619 "behavior."
6620 msgstr "すでに join されたスレッドを join した場合の結果は不定である。"
6621
6622 #. type: Plain text
6623 #: build/C/man3/pthread_join.3:113
6624 msgid ""
6625 "Failure to join with a thread that is joinable (i.e., one that is not "
6626 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
6627 "zombie thread consumes some system resources, and when enough zombie threads "
6628 "have accumulated, it will no longer be possible to create new threads (or "
6629 "processes)."
6630 msgstr ""
6631 "join 可能なスレッド (detached 状態でないスレッド) の join に失敗した場合、\n"
6632 "\"ゾンビスレッド (zombie thread)\" が生成される。\n"
6633 "各ゾンビスレッドはシステムリソースをいくらかは消費し、\n"
6634 "ゾンビスレッドがたくさん生成されてしまうと、\n"
6635 "新しいスレッド (やプロセス) がそれ以上作成できなくなってしまうので、\n"
6636 "このようなことが起きるのは避けること。"
6637
6638 #. type: Plain text
6639 #: build/C/man3/pthread_join.3:119
6640 msgid ""
6641 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
6642 "\"join with any terminated thread\".  If you believe you need this "
6643 "functionality, you probably need to rethink your application design."
6644 msgstr ""
6645 "pthreads には、 I<waitpid(-1,\\ &status,\\ 0)>、つまり\n"
6646 "\"終了されたスレッドのどれかを join する\" といった機能はない。\n"
6647 "この機能が必要だと思うような場合には、おそらく\n"
6648 "自分のアプリケーションの設計を考え直す必要があるだろう。"
6649
6650 #. type: Plain text
6651 #: build/C/man3/pthread_join.3:122
6652 msgid ""
6653 "All of the threads in a process are peers: any thread can join with any "
6654 "other thread in the process."
6655 msgstr ""
6656 "プロセス内の全てのスレッドは対等であり、\n"
6657 "どのスレッドでもプロセス内の他のスレッドを join できる。"
6658
6659 #. type: Plain text
6660 #: build/C/man3/pthread_join.3:132
6661 msgid ""
6662 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6663 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6664 msgstr ""
6665 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6666 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6667
6668 #. type: TH
6669 #: build/C/man3/pthread_kill.3:24
6670 #, no-wrap
6671 msgid "PTHREAD_KILL"
6672 msgstr "PTHREAD_KILL"
6673
6674 #. type: TH
6675 #: build/C/man3/pthread_kill.3:24
6676 #, no-wrap
6677 msgid "2009-01-28"
6678 msgstr "2009-01-28"
6679
6680 #. type: Plain text
6681 #: build/C/man3/pthread_kill.3:27
6682 msgid "pthread_kill - send a signal to a thread"
6683 msgstr "pthread_kill - スレッドにシグナルを送信する"
6684
6685 #. type: Plain text
6686 #: build/C/man3/pthread_kill.3:30 build/C/man3/pthread_sigmask.3:30
6687 #, no-wrap
6688 msgid "B<#include E<lt>signal.hE<gt>>\n"
6689 msgstr "B<#include E<lt>signal.hE<gt>>\n"
6690
6691 #. type: Plain text
6692 #: build/C/man3/pthread_kill.3:32
6693 #, no-wrap
6694 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6695 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6696
6697 #. type: Plain text
6698 #: build/C/man3/pthread_kill.3:45
6699 msgid ""
6700 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, "
6701 "another thread in the same process as the caller.  The signal is "
6702 "asynchronously directed to I<thread>."
6703 msgstr ""
6704 "B<pthread_kill>() 関数は、呼び出したスレッドと同じプロセスの\n"
6705 "別のスレッド I<thread> にシグナル I<sig> を送信する。\n"
6706 "シグナルは非同期に I<thread> へ直接送られる。"
6707
6708 #. type: Plain text
6709 #: build/C/man3/pthread_kill.3:50
6710 msgid ""
6711 "If I<sig> is 0, then no signal is sent, but error checking is still "
6712 "performed; this can be used to check for the existence of a thread ID."
6713 msgstr ""
6714 "I<sig> が 0 の場合、シグナルは送信されないが、\n"
6715 "エラーチェックだけは実行される。\n"
6716 "これを使うと、スレッド ID が存在するかの確認を行うことができる。"
6717
6718 #. type: Plain text
6719 #: build/C/man3/pthread_kill.3:55
6720 msgid ""
6721 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
6722 "number, and no signal is sent."
6723 msgstr ""
6724 "成功すると、 B<pthread_kill>() は 0 を返す。\n"
6725 "エラーの場合、エラー番号を返し、シグナルの送信は行わない。"
6726
6727 #. type: Plain text
6728 #: build/C/man3/pthread_kill.3:59
6729 msgid "An invalid signal was specified."
6730 msgstr "無効なシグナルが指定された。"
6731
6732 #. type: Plain text
6733 #: build/C/man3/pthread_kill.3:73
6734 msgid ""
6735 "Signal dispositions are process-wide: if a signal handler is installed, the "
6736 "handler will be invoked in the thread I<thread>, but if the disposition of "
6737 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
6738 "affect the whole process."
6739 msgstr ""
6740 "シグナルの配送はプロセス全体で行われる。\n"
6741 "シグナルハンドラが設定されている場合、\n"
6742 "そのハンドラがスレッド I<thread> で起動されるが、\n"
6743 "シグナルの配送が \"stop\", \"continue\", \"terminate\" のいずれかの場合、\n"
6744 "シグナルに対するアクションはプロセス全体に影響がある。"
6745
6746 #. type: Plain text
6747 #: build/C/man3/pthread_kill.3:82
6748 msgid ""
6749 "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
6750 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
6751 msgstr ""
6752 "B<kill>(2)  B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
6753 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
6754
6755 #. type: TH
6756 #: build/C/man3/pthread_kill_other_threads_np.3:24
6757 #, no-wrap
6758 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
6759 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
6760
6761 #. type: TH
6762 #: build/C/man3/pthread_kill_other_threads_np.3:24
6763 #, no-wrap
6764 msgid "2010-09-09"
6765 msgstr "2010-09-09"
6766
6767 #. type: Plain text
6768 #: build/C/man3/pthread_kill_other_threads_np.3:27
6769 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
6770 msgstr "pthread_kill_other_threads_np - プロセス内の他の全スレッドを終了する"
6771
6772 #. type: Plain text
6773 #: build/C/man3/pthread_kill_other_threads_np.3:32
6774 #, no-wrap
6775 msgid "B<void pthread_kill_other_threads_np(void);>\n"
6776 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
6777
6778 #.  .SH VERSIONS
6779 #.  Available since glibc 2.0
6780 #. type: Plain text
6781 #: build/C/man3/pthread_kill_other_threads_np.3:45
6782 msgid ""
6783 "B<pthread_kill_other_threads_np>()  only has an effect in the LinuxThreads "
6784 "threading implementation.  On that implementation, calling this function "
6785 "causes the immediate termination of all threads in the application, except "
6786 "the calling thread.  The cancellation state and cancellation type of the to-"
6787 "be-terminated threads are ignored, and the cleanup handlers are not called "
6788 "in those threads."
6789 msgstr ""
6790 "B<pthread_kill_other_threads_np>() は、\n"
6791 "LinuxThreads スレッド実装においてのみ効果がある。\n"
6792 "LinuxThreads スレッド実装では、この関数を呼び出すと\n"
6793 "アプリケーション内の全てのスレッドがすぐに終了される。\n"
6794 "終了対象のスレッドの cancelability state と cancelability type は\n"
6795 "無視され、それらのスレッドのクリーンアップハンドラは呼び出されない。"
6796
6797 #. type: Plain text
6798 #: build/C/man3/pthread_kill_other_threads_np.3:57
6799 msgid ""
6800 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
6801 "thread calls B<execve>(2)  or a similar function.  This function is designed "
6802 "to address a limitation in the obsolete LinuxThreads implementation whereby "
6803 "the other threads of an application are not automatically terminated (as "
6804 "POSIX.1-2001 requires) during B<execve>(2)."
6805 msgstr ""
6806 "B<pthread_kill_other_threads_np>() は、\n"
6807 "スレッドが B<execve>(2) や同様の関数を呼び出す直前に\n"
6808 "呼ばれることを目的として用意されている。\n"
6809 "この関数は、(廃止予定の) LinuxThreads スレッド実装における、\n"
6810 "B<execve>(2) の際にアプリケーションの他のスレッドが自動的に\n"
6811 "終了されないという制限を解決するために設計された。"
6812
6813 #. type: Plain text
6814 #: build/C/man3/pthread_kill_other_threads_np.3:64
6815 msgid ""
6816 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
6817 "exists, but does nothing.  (Nothing needs to be done, because the "
6818 "implementation does the right thing during an B<execve>(2).)"
6819 msgstr ""
6820 "NPTL スレッド実装では、 B<pthread_kill_other_threads_np>() は存在するが、\n"
6821 "何もしない(NPTL 実装は B<execve>(2) の際に適切な動作をするので、\n"
6822 "何もする必要がないということだ)。"
6823
6824 #. type: Plain text
6825 #: build/C/man3/pthread_kill_other_threads_np.3:70
6826 msgid ""
6827 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
6828 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
6829 msgstr ""
6830 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
6831 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
6832
6833 #. type: TH
6834 #: build/C/man3/pthread_self.3:24
6835 #, no-wrap
6836 msgid "PTHREAD_SELF"
6837 msgstr "PTHREAD_SELF"
6838
6839 #. type: Plain text
6840 #: build/C/man3/pthread_self.3:27
6841 msgid "pthread_self - obtain ID of the calling thread"
6842 msgstr "pthread_self - 呼び出したスレッドの ID を取得する"
6843
6844 #. type: Plain text
6845 #: build/C/man3/pthread_self.3:32
6846 #, no-wrap
6847 msgid "B<pthread_t pthread_self(void);>\n"
6848 msgstr "B<pthread_t pthread_self(void);>\n"
6849
6850 #. type: Plain text
6851 #: build/C/man3/pthread_self.3:44
6852 msgid ""
6853 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
6854 "is the same value that is returned in I<*thread> in the B<pthread_create>"
6855 "(3)  call that created this thread."
6856 msgstr ""
6857 "B<pthread_self>() 関数は、呼び出したスレッドの ID を返す。\n"
6858 "得られる ID は、このスレッドが作成された B<pthread_create>(3) の\n"
6859 "呼び出しで I<*thread> で返されるのと同じ値である。"
6860
6861 #. type: Plain text
6862 #: build/C/man3/pthread_self.3:46
6863 msgid "This function always succeeds, returning the calling thread's ID."
6864 msgstr "この関数は常に成功し、呼び出したスレッドの ID を返す。"
6865
6866 #. type: Plain text
6867 #: build/C/man3/pthread_self.3:61
6868 msgid ""
6869 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
6870 "represent a thread ID; for example, representation using either an "
6871 "arithmetic type or a structure is permitted.  Therefore, variables of type "
6872 "I<pthread_t> can't portably be compared using the C equality operator "
6873 "(B<==>); use B<pthread_equal>(3)  instead."
6874 msgstr ""
6875 "POSIX.1 では、スレッド ID を表現するのに使用する型は、\n"
6876 "スレッド実装が完全に自由に選択してよいことになっている。\n"
6877 "例えば、スレッド ID を表現するのに数値型を使っても構造体を使ってもよい。\n"
6878 "そのため、移植性を確保しつつ、 C 言語の等価演算子 (B<==>) を使って、\n"
6879 "I<pthread_t> 型の変数の比較を行うことはできない。\n"
6880 "代わりに B<pthread_equal>(3) を使うこと。"
6881
6882 #. type: Plain text
6883 #: build/C/man3/pthread_self.3:65
6884 msgid ""
6885 "Thread identifiers should be considered opaque: any attempt to use a thread "
6886 "ID other than in pthreads calls is nonportable and can lead to unspecified "
6887 "results."
6888 msgstr ""
6889 "スレッド識別子はその内部構造を意識すべきではない。\n"
6890 "pthreads 関数以外でスレッド ID を利用しようとした場合、\n"
6891 "移植性がなくなり、どのような結果が得られるかも分からない。"
6892
6893 #. type: Plain text
6894 #: build/C/man3/pthread_self.3:69
6895 msgid ""
6896 "Thread IDs are only guaranteed to be unique within a process.  A thread ID "
6897 "may be reused after a terminated thread has been joined, or a detached "
6898 "thread has terminated."
6899 msgstr ""
6900 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
6901 "終了したスレッドが join されたり、\n"
6902 "切り離された (detached) スレッドが終了されたりした後は、\n"
6903 "そのスレッド ID は再利用されることがある。"
6904
6905 #. type: Plain text
6906 #: build/C/man3/pthread_self.3:74
6907 msgid ""
6908 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
6909 "kernel thread ID returned by a call to B<gettid>(2)."
6910 msgstr ""
6911 "B<pthread_self>() が返すスレッド ID は、\n"
6912 "B<gettid>(2) が返すカーネルスレッド ID とは違うものである。"
6913
6914 #. type: Plain text
6915 #: build/C/man3/pthread_self.3:78
6916 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6917 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6918
6919 #. type: TH
6920 #: build/C/man3/pthread_setaffinity_np.3:24
6921 #, no-wrap
6922 msgid "PTHREAD_SETAFFINITY_NP"
6923 msgstr "PTHREAD_SETAFFINITY_NP"
6924
6925 #. type: Plain text
6926 #: build/C/man3/pthread_setaffinity_np.3:28
6927 msgid ""
6928 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
6929 "thread"
6930 msgstr ""
6931 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
6932 "CPU affinity の設定/取得を行う"
6933
6934 #. type: Plain text
6935 #: build/C/man3/pthread_setaffinity_np.3:37
6936 #, no-wrap
6937 msgid ""
6938 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6939 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6940 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6941 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6942 msgstr ""
6943 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6944 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6945 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6946 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6947
6948 #. type: Plain text
6949 #: build/C/man3/pthread_setaffinity_np.3:52
6950 msgid ""
6951 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
6952 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
6953 "successful, and the thread is not currently running on one of the CPUs in "
6954 "I<cpuset>, then it is migrated to one of those CPUs."
6955 msgstr ""
6956 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
6957 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
6958 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
6959 "場合は、スレッドは指定された CPU のいずれかに移動される。"
6960
6961 #. type: Plain text
6962 #: build/C/man3/pthread_setaffinity_np.3:59
6963 msgid ""
6964 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
6965 "the thread I<thread> in the buffer pointed to by I<cpuset>."
6966 msgstr ""
6967 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
6968 "マスクを、I<cpuset> が指すバッファに入れて返す。"
6969
6970 #. type: Plain text
6971 #: build/C/man3/pthread_setaffinity_np.3:75
6972 msgid ""
6973 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
6974 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
6975 "(cpu_set_t)>.  (It may be some other value, if using the macros described in "
6976 "B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
6977 msgstr ""
6978 "引き数 I<cpusetsize> は I<cpuset> が指すバッファの長さ (バイト単位) で\n"
6979 "ある。通常は、この引き数には I<sizeof(cpu_set_t)> を指定する\n"
6980 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
6981 "割り当てている場合には、別の値になることもある)。"
6982
6983 #. type: TP
6984 #: build/C/man3/pthread_setaffinity_np.3:79
6985 #, no-wrap
6986 msgid "B<EFAULT>"
6987 msgstr "B<EFAULT>"
6988
6989 #. type: Plain text
6990 #: build/C/man3/pthread_setaffinity_np.3:82
6991 msgid "A supplied memory address was invalid."
6992 msgstr "指定されたメモリアドレスが無効である。"
6993
6994 #. type: Plain text
6995 #: build/C/man3/pthread_setaffinity_np.3:91
6996 msgid ""
6997 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
6998 "processors that are currently physically on the system and permitted to the "
6999 "thread according to any restrictions that may be imposed by the \"cpuset\" "
7000 "mechanism described in B<cpuset>(7)."
7001 msgstr ""
7002 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
7003 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
7004 "されているプロセッサが一つも含まれていない。\n"
7005 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
7006 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
7007
7008 #.  FIXME . ?
7009 #.  Loic Domaigne commented: it seems that in the future the
7010 #.  kernel developers want to make cpumask_t dynamic, so
7011 #.  CONFIG_NR_CPUS might become obsolete in the future.
7012 #.  cpumask_t
7013 #.  The raw sched_getaffinity() system call returns the size (in bytes)
7014 #.  of the cpumask_t type.
7015 #. type: Plain text
7016 #: build/C/man3/pthread_setaffinity_np.3:107
7017 msgid ""
7018 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
7019 "the set supported by the kernel.  (The kernel configuration option "
7020 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
7021 "type used to represent CPU sets.)"
7022 msgstr ""
7023 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
7024 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
7025 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
7026 "データ型がサポートする CPU 集合の範囲が定義される。)"
7027
7028 #. type: Plain text
7029 #: build/C/man3/pthread_setaffinity_np.3:112
7030 msgid ""
7031 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
7032 "affinity mask used by the kernel."
7033 msgstr ""
7034 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
7035 "affinity マスクの大きさよりも小さい。"
7036
7037 #. type: Plain text
7038 #: build/C/man3/pthread_setaffinity_np.3:135
7039 msgid ""
7040 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
7041 "thread will actually run is the intersection of the set specified in the "
7042 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
7043 "system may further restrict the set of CPUs on which the thread runs if the "
7044 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
7045 "restrictions on the actual set of CPUs on which the thread will run are "
7046 "silently imposed by the kernel."
7047 msgstr ""
7048 "B<pthread_setaffinity_np>() を呼び出した後、\n"
7049 "そのスレッドが実際に実行される CPU 集合は、\n"
7050 "I<cpuset> 引き数で指定された集合と\n"
7051 "システムに実際に存在する CPU 集合の共通部分になる。\n"
7052 "また、 B<cpuset>(7) で説明されている \"cpuset\" 機構が使われている場合\n"
7053 "には、そのスレッドが実行される CPU 集合がシステムによってさらに制限\n"
7054 "される場合がある。そのスレッドが実行される実際の CPU 集合に対する\n"
7055 "これらの制限は、カーネルにより黙って適用される。"
7056
7057 #. type: Plain text
7058 #: build/C/man3/pthread_setaffinity_np.3:141
7059 msgid ""
7060 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
7061 "B<sched_getaffinity>(2)  system calls."
7062 msgstr ""
7063 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
7064 "B<sched_getaffinity>(2) を使って実装されている。"
7065
7066 #. type: Plain text
7067 #: build/C/man3/pthread_setaffinity_np.3:152
7068 msgid ""
7069 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
7070 "creator's CPU affinity mask."
7071 msgstr ""
7072 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
7073 "作成者の CPU affinity マスクを継承する。"
7074
7075 #. type: Plain text
7076 #: build/C/man3/pthread_setaffinity_np.3:160
7077 msgid ""
7078 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
7079 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
7080 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
7081 "check the resulting CPU affinity mask of the thread."
7082 msgstr ""
7083 "以下のプログラムでは、メインスレッドは\n"
7084 "B<pthread_setaffinity_np>() を使って自分の CPU affinity マスクに\n"
7085 "CPU 0 から 7 が含まれるように設定し\n"
7086 "(システム上には 0 から 7 に対応する CPU が全て存在するとは限らない)、\n"
7087 "その後で B<pthread_getaffinity_np>() を使って\n"
7088 "スレッドに実際に設定された CPU affinity マスクを確認している。"
7089
7090 #. type: Plain text
7091 #: build/C/man3/pthread_setaffinity_np.3:167
7092 #, no-wrap
7093 msgid ""
7094 "#define _GNU_SOURCE\n"
7095 "#include E<lt>pthread.hE<gt>\n"
7096 "#include E<lt>stdio.hE<gt>\n"
7097 "#include E<lt>stdlib.hE<gt>\n"
7098 "#include E<lt>errno.hE<gt>\n"
7099 msgstr ""
7100 "#define _GNU_SOURCE\n"
7101 "#include E<lt>pthread.hE<gt>\n"
7102 "#include E<lt>stdio.hE<gt>\n"
7103 "#include E<lt>stdlib.hE<gt>\n"
7104 "#include E<lt>errno.hE<gt>\n"
7105
7106 #. type: Plain text
7107 #: build/C/man3/pthread_setaffinity_np.3:177
7108 #, no-wrap
7109 msgid ""
7110 "int\n"
7111 "main(int argc, char *argv[])\n"
7112 "{\n"
7113 "    int s, j;\n"
7114 "    cpu_set_t cpuset;\n"
7115 "    pthread_t thread;\n"
7116 msgstr ""
7117 "int\n"
7118 "main(int argc, char *argv[])\n"
7119 "{\n"
7120 "    int s, j;\n"
7121 "    cpu_set_t cpuset;\n"
7122 "    pthread_t thread;\n"
7123
7124 #. type: Plain text
7125 #: build/C/man3/pthread_setaffinity_np.3:179
7126 #, no-wrap
7127 msgid "    thread = pthread_self();\n"
7128 msgstr "    thread = pthread_self();\n"
7129
7130 #. type: Plain text
7131 #: build/C/man3/pthread_setaffinity_np.3:181
7132 #, no-wrap
7133 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7134 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7135
7136 #. type: Plain text
7137 #: build/C/man3/pthread_setaffinity_np.3:185
7138 #, no-wrap
7139 msgid ""
7140 "    CPU_ZERO(&cpuset);\n"
7141 "    for (j = 0; j E<lt> 8; j++)\n"
7142 "        CPU_SET(j, &cpuset);\n"
7143 msgstr ""
7144 "    CPU_ZERO(&cpuset);\n"
7145 "    for (j = 0; j E<lt> 8; j++)\n"
7146 "        CPU_SET(j, &cpuset);\n"
7147
7148 #. type: Plain text
7149 #: build/C/man3/pthread_setaffinity_np.3:189
7150 #, no-wrap
7151 msgid ""
7152 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7153 "    if (s != 0)\n"
7154 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7155 msgstr ""
7156 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7157 "    if (s != 0)\n"
7158 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7159
7160 #. type: Plain text
7161 #: build/C/man3/pthread_setaffinity_np.3:191
7162 #, no-wrap
7163 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
7164 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
7165
7166 #. type: Plain text
7167 #: build/C/man3/pthread_setaffinity_np.3:195
7168 #, no-wrap
7169 msgid ""
7170 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7171 "    if (s != 0)\n"
7172 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7173 msgstr ""
7174 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7175 "    if (s != 0)\n"
7176 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7177
7178 #. type: Plain text
7179 #: build/C/man3/pthread_setaffinity_np.3:200
7180 #, no-wrap
7181 msgid ""
7182 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7183 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7184 "        if (CPU_ISSET(j, &cpuset))\n"
7185 "            printf(\"    CPU %d\\en\", j);\n"
7186 msgstr ""
7187 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7188 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7189 "        if (CPU_ISSET(j, &cpuset))\n"
7190 "            printf(\"    CPU %d\\en\", j);\n"
7191
7192 #. type: Plain text
7193 #: build/C/man3/pthread_setaffinity_np.3:203
7194 #: build/C/man3/pthread_setschedparam.3:428
7195 #, no-wrap
7196 msgid ""
7197 "    exit(EXIT_SUCCESS);\n"
7198 "}\n"
7199 msgstr ""
7200 "    exit(EXIT_SUCCESS);\n"
7201 "}\n"
7202
7203 #. type: Plain text
7204 #: build/C/man3/pthread_setaffinity_np.3:212
7205 msgid ""
7206 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
7207 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
7208 "B<cpuset>(7), B<pthreads>(7)"
7209 msgstr ""
7210 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
7211 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
7212 "B<cpuset>(7), B<pthreads>(7)"
7213
7214 #. type: TH
7215 #: build/C/man3/pthread_setcancelstate.3:24
7216 #, no-wrap
7217 msgid "PTHREAD_SETCANCELSTATE"
7218 msgstr "PTHREAD_SETCANCELSTATE"
7219
7220 #. type: Plain text
7221 #: build/C/man3/pthread_setcancelstate.3:28
7222 msgid ""
7223 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
7224 "type"
7225 msgstr ""
7226 "pthread_setcancelstate, pthread_setcanceltype - cancelability state と "
7227 "cancelability type を設定する"
7228
7229 #. type: Plain text
7230 #: build/C/man3/pthread_setcancelstate.3:34
7231 #, no-wrap
7232 msgid ""
7233 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7234 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7235 msgstr ""
7236 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7237 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7238
7239 #. type: Plain text
7240 #: build/C/man3/pthread_setcancelstate.3:49
7241 msgid ""
7242 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
7243 "thread to the value given in I<state>.  The previous cancelability state of "
7244 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
7245 "I<state> argument must have one of the following values:"
7246 msgstr ""
7247 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
7248 "cancelability state に I<state> で指定された\n"
7249 "値を設定する。変更前のスレッドの cancelability state は\n"
7250 "I<oldstate> が指すバッファで返される。\n"
7251 "I<state> 引き数には以下の値のいずれか一つを指定しなければならない。"
7252
7253 #. type: TP
7254 #: build/C/man3/pthread_setcancelstate.3:49
7255 #, no-wrap
7256 msgid "B<PTHREAD_CANCEL_ENABLE>"
7257 msgstr "B<PTHREAD_CANCEL_ENABLE>"
7258
7259 #. type: Plain text
7260 #: build/C/man3/pthread_setcancelstate.3:56
7261 msgid ""
7262 "The thread is cancelable.  This is the default cancelability state in all "
7263 "new threads, including the initial thread.  The thread's cancelability type "
7264 "determines when a cancelable thread will respond to a cancellation request."
7265 msgstr ""
7266 "スレッドは取り消し可能 (cancelable) である。\n"
7267 "これが全ての新しく作成されるスレッドでのデフォルトの\n"
7268 "cancelability state である。これには最初のスレッドも含まれる。\n"
7269 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
7270 "取り消し要求にいつ反応するかが決まる。"
7271
7272 #. type: TP
7273 #: build/C/man3/pthread_setcancelstate.3:56
7274 #, no-wrap
7275 msgid "B<PTHREAD_CANCEL_DISABLE>"
7276 msgstr "B<PTHREAD_CANCEL_DISABLE>"
7277
7278 #. type: Plain text
7279 #: build/C/man3/pthread_setcancelstate.3:61
7280 msgid ""
7281 "The thread is not cancelable.  If a cancellation request is received, it is "
7282 "blocked until cancelability is enabled."
7283 msgstr ""
7284 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
7285 "取り消し可能に設定されるまでその要求はブロックされる。"
7286
7287 #. type: Plain text
7288 #: build/C/man3/pthread_setcancelstate.3:73
7289 msgid ""
7290 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
7291 "thread to the value given in I<type>.  The previous cancelability type of "
7292 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
7293 "argument must have one of the following values:"
7294 msgstr ""
7295 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
7296 "cancelability type に I<type> で指定された値を設定する。\n"
7297 "変更前のスレッドの cancelability type は\n"
7298 "I<oldtype> が指すバッファで返される。\n"
7299 "I<type> 引き数には以下の値のいずれか一つを指定しなければならない。"
7300
7301 #. type: TP
7302 #: build/C/man3/pthread_setcancelstate.3:73
7303 #, no-wrap
7304 msgid "B<PTHREAD_CANCEL_DEFERRED>"
7305 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
7306
7307 #. type: Plain text
7308 #: build/C/man3/pthread_setcancelstate.3:80
7309 msgid ""
7310 "A cancellation request is deferred until the thread next calls a function "
7311 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
7312 "cancelability type in all new threads, including the initial thread."
7313 msgstr ""
7314 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
7315 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
7316 "スレッドでのデフォルトの cancelability type である。\n"
7317 "これには最初のスレッドも含まれる。"
7318
7319 #. type: TP
7320 #: build/C/man3/pthread_setcancelstate.3:80
7321 #, no-wrap
7322 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7323 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7324
7325 #. type: Plain text
7326 #: build/C/man3/pthread_setcancelstate.3:86
7327 msgid ""
7328 "The thread can be canceled at any time.  (Typically, it will be canceled "
7329 "immediately upon receiving a cancellation request, but the system doesn't "
7330 "guarantee this.)"
7331 msgstr ""
7332 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
7333 "システムがそのことを保証しているわけではない)。"
7334
7335 #. type: Plain text
7336 #: build/C/man3/pthread_setcancelstate.3:90
7337 msgid ""
7338 "The set-and-get operation performed by each of these functions is atomic "
7339 "with respect to other threads in the process calling the same function."
7340 msgstr ""
7341 "これらの関数により実行される「設定と取得」操作 (set-and-get operation) は、\n"
7342 "同じ関数を呼び出したプロセス内の他のスレッドがあっても、\n"
7343 "アトミックに行われる。"
7344
7345 #. type: Plain text
7346 #: build/C/man3/pthread_setcancelstate.3:97
7347 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
7348 msgstr "B<pthread_setcancelstate>() は以下のエラーで失敗する場合がある。"
7349
7350 #. type: Plain text
7351 #: build/C/man3/pthread_setcancelstate.3:101
7352 msgid "Invalid value for I<state>."
7353 msgstr "I<state> に無効な値が指定された。"
7354
7355 #. type: Plain text
7356 #: build/C/man3/pthread_setcancelstate.3:105
7357 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
7358 msgstr "B<pthread_setcanceltype>() は以下のエラーで失敗する場合がある。"
7359
7360 #.  .SH VERSIONS
7361 #.  Available since glibc 2.0
7362 #. type: Plain text
7363 #: build/C/man3/pthread_setcancelstate.3:111
7364 msgid "Invalid value for I<type>."
7365 msgstr "I<type> に無効な値が指定された。"
7366
7367 #. type: Plain text
7368 #: build/C/man3/pthread_setcancelstate.3:116
7369 msgid ""
7370 "For details of what happens when a thread is canceled, see B<pthread_cancel>"
7371 "(3)."
7372 msgstr ""
7373 "スレッドが取り消された場合に何が起こるかの詳細については\n"
7374 "B<pthread_cancel>(3) を参照。"
7375
7376 #. type: Plain text
7377 #: build/C/man3/pthread_setcancelstate.3:123
7378 msgid ""
7379 "Briefly disabling cancelability is useful if a thread performs some critical "
7380 "action that must not be interrupted by a cancellation request.  Beware of "
7381 "disabling cancelability for long periods, or around operations that may "
7382 "block for long periods, since that will render the thread unresponsive to "
7383 "cancellation requests."
7384 msgstr ""
7385 "取り消し要求により中断されてはならない重要なアクションをスレッドが\n"
7386 "実行する場合、短い時間だけ cancelability を無効にするのは有用である。\n"
7387 "長い時間 cancelability を無効にしたり、長い時間停止 (block) される\n"
7388 "可能性のある操作の前後で cancelability を無効にしたりする際には\n"
7389 "注意すること。なぜなら、無効にしてしまうと、キャンセル要求に対して\n"
7390 "スレッドが応答しない状態になってしまうからである。"
7391
7392 #. type: Plain text
7393 #: build/C/man3/pthread_setcancelstate.3:154
7394 msgid ""
7395 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
7396 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
7397 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
7398 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
7399 "because the application has no way of knowing what the state of these "
7400 "resources is when the thread is canceled; that is, did cancellation occur "
7401 "before the resources were reserved, while they were reserved, or after they "
7402 "were released? Furthermore, some internal data structures (e.g., the linked "
7403 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
7404 "left in an inconsistent state if cancellation occurs in the middle of the "
7405 "function call.  Consequently, clean-up handlers cease to be useful.  "
7406 "Functions that can be safely asynchronously canceled are called I<async-"
7407 "cancel-safe functions>.  POSIX.1-2001 only requires that B<pthread_cancel>"
7408 "(3), B<pthread_setcancelstate>(), and B<pthread_setcanceltype>()  be async-"
7409 "cancel-safe.  In general, other library functions can't be safely called "
7410 "from an asynchronously cancelable thread.  One of the few circumstances in "
7411 "which asynchronous cancelability is useful is for cancellation of a thread "
7412 "that is in a pure compute-bound loop."
7413 msgstr ""
7414 "cancelability type を B<PTHREAD_CANCEL_ASYNCHRONOUS> に設定して役に立つ\n"
7415 "ことはめったにない。スレッドはI<いつでも>キャンセルすることができること\n"
7416 "になるので、スレッドが安全にリソースの確保 (例えば B<malloc>(3) で\n"
7417 "メモリを割り当てる) や mutex、セマフォ、ロックなどの獲得を行うことがで\n"
7418 "きない。アプリケーションは、スレッドがキャンセルされる際に、これらのリ\n"
7419 "ソースがどのような状態にあるかを知る術はないので、リソースの確保が安全\n"
7420 "ではなくなる。つまり、キャンセルが起こったのが、リソースの確保前なのか、\n"
7421 "確保中なのか、確保後なのかが分からない。さらに、関数呼び出しの最中に\n"
7422 "キャンセルが発生すると、いくつかの内部データ構造 (例えば、B<malloc>(3)\n"
7423 "関連の関数が管理している未使用ブロックのリンクリスト) が一貫性のない\n"
7424 "状態のままになってしまう可能性がある。その結果、クリーンアップハンドラ\n"
7425 "が役に立たないものになってしまう。\n"
7426 "非同期で安全にキャンセルできる関数は I<async-cancel-safe functions> と\n"
7427 "呼ばれる。 POSIX.1-2001 で、非同期で安全にキャンセルできるように求めら\n"
7428 "れている関数は B<pthread_cancel>(3), B<pthread_setcancelstate>(),\n"
7429 "B<pthread_setcanceltype>() だけである。一般的には、それ以外のライブラリ\n"
7430 "関数は、非同期にキャンセルできるスレッドから安全に呼び出すことはできな\n"
7431 "い。非同期でのキャンセルが有効な数少ない状況としては、純粋に計算だけを\n"
7432 "行うループに入っているスレッドをキャンセルするといった場面がある。"
7433
7434 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
7435 #. type: Plain text
7436 #: build/C/man3/pthread_setcancelstate.3:172
7437 msgid ""
7438 "The Linux threading implementations permit the I<oldstate> argument of "
7439 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
7440 "the previous cancelability state is not returned to the caller.  Many other "
7441 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
7442 "does not specify this point, so portable applications should always specify "
7443 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
7444 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
7445 msgstr ""
7446 "Linux のスレッド実装では、 B<pthread_setcancelstate>() の I<oldstate>\n"
7447 "引き数に NULL を指定することを認めている。 NULL が指定された場合、\n"
7448 "変更前の cancelability state の情報が呼び出し側に返されない。\n"
7449 "他の多くの実装でも I<oldstate> 引き数に NULL を指定することを認めて\n"
7450 "いるが、 POSIX.1-2001 ではこの点については規定されていない。\n"
7451 "したがって、移植性が必要なアプリケーションでは常に I<oldstate> に\n"
7452 "NULL 以外の値を指定するようにすべきである。\n"
7453 "B<pthread_setcanceltype>() の I<oldtype> 引き数についても、\n"
7454 "全く同じことが言える。"
7455
7456 #. type: Plain text
7457 #: build/C/man3/pthread_setcancelstate.3:175
7458 msgid "See B<pthread_cancel>(3)."
7459 msgstr "B<pthread_cancel>(3) を参照。"
7460
7461 #. type: Plain text
7462 #: build/C/man3/pthread_setcancelstate.3:180
7463 msgid ""
7464 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7465 "B<pthreads>(7)"
7466 msgstr ""
7467 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7468 "B<pthreads>(7)"
7469
7470 #. type: TH
7471 #: build/C/man3/pthread_setconcurrency.3:23
7472 #, no-wrap
7473 msgid "PTHREAD_SETCONCURRENCY"
7474 msgstr "PTHREAD_SETCONCURRENCY"
7475
7476 #. type: TH
7477 #: build/C/man3/pthread_setconcurrency.3:23 build/C/man3/pthread_yield.3:23
7478 #, no-wrap
7479 msgid "2009-04-10"
7480 msgstr "2009-04-10"
7481
7482 #. type: Plain text
7483 #: build/C/man3/pthread_setconcurrency.3:27
7484 msgid ""
7485 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
7486 "level"
7487 msgstr ""
7488 "pthread_setconcurrency, pthread_getconcurrency - 並列処理レベルの設定/取得を"
7489 "行う"
7490
7491 #. type: Plain text
7492 #: build/C/man3/pthread_setconcurrency.3:33
7493 #, no-wrap
7494 msgid ""
7495 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7496 "B<int pthread_getconcurrency(void);>\n"
7497 msgstr ""
7498 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7499 "B<int pthread_getconcurrency(void);>\n"
7500
7501 #. type: Plain text
7502 #: build/C/man3/pthread_setconcurrency.3:46
7503 msgid ""
7504 "The B<pthread_setconcurrency>()  function informs the implementation of the "
7505 "application's desired concurrency level, specified in I<new_level>.  The "
7506 "implementation only takes this as a hint: POSIX.1 does not specify the level "
7507 "of concurrency that should be provided as a result of calling "
7508 "B<pthread_setconcurrency>()."
7509 msgstr ""
7510 "B<pthread_setconcurrency>() 関数は、アプリケーションが希望する\n"
7511 "並列処理レベル (concurrency level) をスレッド実装に通知する。\n"
7512 "希望する並列処理レベルは I<new_level> で指定する。\n"
7513 "スレッド実装はこの情報を参考情報として利用する。\n"
7514 "POSIX.1 では、 B<pthread_setconcurrency>() の呼び出した結果、\n"
7515 "どのような並列度になるべきかは規定されていない。"
7516
7517 #. type: Plain text
7518 #: build/C/man3/pthread_setconcurrency.3:51
7519 msgid ""
7520 "Specifying I<new_level> as 0 instructs the implementation to manage the "
7521 "concurrency level as it deems appropriate."
7522 msgstr ""
7523 "I<new_level> に 0 を指定すると、スレッド実装は並列処理レベルを\n"
7524 "実装側で適切とみなしたレベルに設定するようになる。"
7525
7526 #. type: Plain text
7527 #: build/C/man3/pthread_setconcurrency.3:54
7528 msgid ""
7529 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
7530 "level for this process."
7531 msgstr ""
7532 "B<pthread_getconcurrency>() は、このプロセスの concurrency level\n"
7533 "の現在値を返す。"
7534
7535 #. type: Plain text
7536 #: build/C/man3/pthread_setconcurrency.3:59
7537 msgid ""
7538 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
7539 "nonzero error number."
7540 msgstr ""
7541 "成功すると、 B<pthread_setconcurrency>() は 0 を返す。\n"
7542 "エラーの場合、 0 以外のエラー番号を返す。"
7543
7544 #. type: Plain text
7545 #: build/C/man3/pthread_setconcurrency.3:66
7546 msgid ""
7547 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
7548 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
7549 "B<pthread_setconcurrency>()  has not previously been called."
7550 msgstr ""
7551 "B<pthread_getconcurrency>() は常に成功し、最後の\n"
7552 "B<pthread_getconcurrency>() の呼び出しで設定された \n"
7553 "concurrency level を返す。 B<pthread_getconcurrency>() が\n"
7554 "それまでに一度も呼び出されていない場合は 0 が返る。"
7555
7556 #. type: Plain text
7557 #: build/C/man3/pthread_setconcurrency.3:69
7558 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
7559 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
7560
7561 #. type: Plain text
7562 #: build/C/man3/pthread_setconcurrency.3:73
7563 msgid "I<new_level> is negative."
7564 msgstr "I<new_level> が負である。"
7565
7566 #. type: Plain text
7567 #: build/C/man3/pthread_setconcurrency.3:79
7568 msgid ""
7569 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
7570 "I<new_level> would cause a system resource to be exceeded\")."
7571 msgstr ""
7572 "POSIX.1-2001 には、エラー B<EAGAIN> も記載されている\n"
7573 "(「I<new_level> に指定された値を適用すると、システムリソースが\n"
7574 "超過してしまう」)。"
7575
7576 #. type: Plain text
7577 #: build/C/man3/pthread_setconcurrency.3:81
7578 msgid "These functions are available in glibc since version 2.1."
7579 msgstr "これらの関数は glibc バージョン 2.1 以降で利用できる。"
7580
7581 #. type: Plain text
7582 #: build/C/man3/pthread_setconcurrency.3:85
7583 msgid "The default concurrency level is 0."
7584 msgstr "デフォルトの concurrency level は 0 である。"
7585
7586 #. type: Plain text
7587 #: build/C/man3/pthread_setconcurrency.3:92
7588 msgid ""
7589 "Concurrency levels are only meaningful for M:N threading implementations, "
7590 "where at any moment a subset of a process's set of user-level threads may be "
7591 "bound to a smaller number of kernel-scheduling entities.  Setting the "
7592 "concurrency level allows the application to give the system a hint as to the "
7593 "number of kernel-scheduling entities that should be provided for efficient "
7594 "execution of the application."
7595 msgstr ""
7596 "並列処理レベルが意味を持つのは M:N スレッド実装の場合のみである。\n"
7597 "M:N スレッド実装では、ある瞬間において、あるプロセスのユーザレベルスレッ\n"
7598 "ドの集合のサブ集合が、そのサブ集合のサイズよりも少ない数のカーネルの\n"
7599 "スケジューリング実体 (kernel-scheduling entity) に結び付けられる。\n"
7600 "並列処理レベルを設定すると、そのアプリケーションの効率的な実行に必要な\n"
7601 "カーネルのスケジューリング実体の数のヒントを、アプリケーションはシステ\n"
7602 "ムに伝えることができる。"
7603
7604 #. type: Plain text
7605 #: build/C/man3/pthread_setconcurrency.3:98
7606 msgid ""
7607 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
7608 "concurrency level has no meaning.  In other words, on Linux these functions "
7609 "merely exist for compatibility with other systems, and they have no effect "
7610 "on the execution of a program."
7611 msgstr ""
7612 "LinuxThreads と NPTL のどちらも 1:1 スレッド実装であり、\n"
7613 "並列処理レベルを設定しても何の意味もない。\n"
7614 "言い換えると、 Linux では、これらの関数は、\n"
7615 "他のシステムとの互換性のためだけに存在し、\n"
7616 "プログラムの実行には何の影響も与えないということである。"
7617
7618 #. type: Plain text
7619 #: build/C/man3/pthread_setconcurrency.3:101
7620 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
7621 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
7622
7623 #. type: TH
7624 #: build/C/man3/pthread_setschedparam.3:24
7625 #, no-wrap
7626 msgid "PTHREAD_SETSCHEDPARAM"
7627 msgstr "PTHREAD_SETSCHEDPARAM"
7628
7629 #. type: Plain text
7630 #: build/C/man3/pthread_setschedparam.3:28
7631 msgid ""
7632 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
7633 "parameters of a thread"
7634 msgstr ""
7635 "pthread_setschedparam, pthread_getschedparam - スレッドの\n"
7636 "スケジューリングポリシーとパラメータを設定/取得する"
7637
7638 #. type: Plain text
7639 #: build/C/man3/pthread_setschedparam.3:36
7640 #, no-wrap
7641 msgid ""
7642 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
7643 "B<                      const struct sched_param *>I<param>B<);>\n"
7644 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
7645 "B<                      struct sched_param *>I<param>B<);>\n"
7646 msgstr ""
7647 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
7648 "B<                      const struct sched_param *>I<param>B<);>\n"
7649 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
7650 "B<                      struct sched_param *>I<param>B<);>\n"
7651
7652 #. type: Plain text
7653 #: build/C/man3/pthread_setschedparam.3:44
7654 msgid ""
7655 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
7656 "parameters of the thread I<thread>."
7657 msgstr ""
7658 "B<pthread_setschedparam>() 関数は、スレッド I<thread> の\n"
7659 "スケジューリングポリシーとスケジューリングパラメータを設定する。"
7660
7661 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
7662 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
7663 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
7664 #. type: Plain text
7665 #: build/C/man3/pthread_setschedparam.3:55
7666 msgid ""
7667 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
7668 "values for I<policy>, and their semantics, are described in "
7669 "B<sched_setscheduler>(2)."
7670 msgstr ""
7671 "I<policy> は I<thread> の新しいスケジューリングポリシーを指定する。\n"
7672 "I<policy> に指定できる値とその意味は B<sched_setscheduler>(2) で\n"
7673 "説明されている。"
7674
7675 #. type: Plain text
7676 #: build/C/man3/pthread_setschedparam.3:61
7677 msgid ""
7678 "The structure pointed to by I<param> specifies the new scheduling parameters "
7679 "for I<thread>.  Scheduling parameters are maintained in the following "
7680 "structure:"
7681 msgstr ""
7682 "I<param> が指す構造体は I<thread> の新しいスケジューリングパラメータを\n"
7683 "指定する。スケジューリングパラメータは以下の構造体で管理される。"
7684
7685 #.  FIXME . nptl/pthread_setschedparam.c has the following
7686 #.    /* If the thread should have higher priority because of some
7687 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
7688 #.  Eventually (perhaps after writing the mutexattr pages), we
7689 #.  may want to add something on the topic to this page.
7690 #. type: Plain text
7691 #: build/C/man3/pthread_setschedparam.3:102
7692 msgid ""
7693 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
7694 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
7695 "and I<param>, respectively.  The returned priority value is that set by the "
7696 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
7697 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
7698 "does not reflect any temporary priority adjustments as a result of calls to "
7699 "any priority inheritance or priority ceiling functions (see, for example, "
7700 "B<pthread_mutexattr_setprioceiling>(3)  and B<pthread_mutexattr_setprotocol>"
7701 "(3))."
7702 msgstr ""
7703 "B<pthread_getschedparam>() 関数は、スレッド I<thread> の\n"
7704 "スケジューリングポリシーとパラメータを、\n"
7705 "それぞれ I<policy> と I<param> が指すバッファに入れて返す。\n"
7706 "返された優先度の値は、最も最近実行した I<thread> に影響を与える\n"
7707 "B<pthread_setschedparam>(), B<pthread_setschedprio>,\n"
7708 "B<pthread_create> で設定された値となる。\n"
7709 "返された優先度は、優先度の継承や優先度の上限を設定する関数\n"
7710 "(例えば B<pthread_mutexattr_setprioceiling>(3) や\n"
7711 "B<pthread_mutexattr_setprotocol>(3) を参照) の呼び出しの結果\n"
7712 "行われる一時的な優先度の調整の影響を受けない。"
7713
7714 #. type: Plain text
7715 #: build/C/man3/pthread_setschedparam.3:110
7716 msgid ""
7717 "On success, these functions return 0; on error, they return a nonzero error "
7718 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
7719 "parameters of I<thread> are not changed."
7720 msgstr ""
7721 "成功すると、これらの関数は 0 を返す。\n"
7722 "エラーの場合、0 以外のエラー番号を返す。\n"
7723 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
7724 "スケジューリングポリシーとパラメータは変更されない。"
7725
7726 #. type: Plain text
7727 #: build/C/man3/pthread_setschedparam.3:112
7728 msgid "Both of these functions can fail with the following error:"
7729 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
7730
7731 #. type: Plain text
7732 #: build/C/man3/pthread_setschedparam.3:120
7733 msgid ""
7734 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
7735 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
7736
7737 #. type: Plain text
7738 #: build/C/man3/pthread_setschedparam.3:127
7739 msgid ""
7740 "I<policy> is not a recognized policy, or I<param> does not make sense for "
7741 "the I<policy>."
7742 msgstr ""
7743 "I<policy> が認識できないポリシーであるか、\n"
7744 "I<param> が I<policy> では意味を持たない値である。"
7745
7746 #. type: Plain text
7747 #: build/C/man3/pthread_setschedparam.3:131
7748 msgid ""
7749 "The caller does not have appropriate privileges to set the specified "
7750 "scheduling policy and parameters."
7751 msgstr ""
7752 "呼び出し側が、指定されたスケジューリングポリシーやパラメータを設定する\n"
7753 "のに必要な特権を持たない。"
7754
7755 #.  .SH VERSIONS
7756 #.  Available since glibc 2.0
7757 #. type: Plain text
7758 #: build/C/man3/pthread_setschedparam.3:139
7759 msgid ""
7760 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
7761 "policy or scheduling parameters to an unsupported value\") error for "
7762 "B<pthread_setschedparam>()."
7763 msgstr ""
7764 "POSIX.1-2001 では、 B<pthread_setschedparam>() に関して\n"
7765 "エラー B<ENOTSUP> (\"サポートされていない値をスケジューリングポリシーや\n"
7766 "パラメータに設定しようとした\") も追加で規定されている。"
7767
7768 #. type: Plain text
7769 #: build/C/man3/pthread_setschedparam.3:147
7770 msgid ""
7771 "For a description of the permissions required to, and the effect of, "
7772 "changing a thread's scheduling policy and priority, and details of the "
7773 "permitted ranges for priorities in each scheduling policy, see "
7774 "B<sched_setscheduler>(2)."
7775 msgstr ""
7776 "スレッドのスケジューリングポリシーや優先度を変更するために必要な許可や\n"
7777 "変更した場合の影響、および各スケジューリングポリシーで認められる優先度\n"
7778 "の範囲の詳細については、 B<sched_setscheduler>(2) を参照。"
7779
7780 #. type: Plain text
7781 #: build/C/man3/pthread_setschedparam.3:154
7782 msgid ""
7783 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
7784 "B<pthread_getschedparam>(), as well as the use of a number of other "
7785 "scheduling-related pthreads functions."
7786 msgstr ""
7787 "以下のプログラムは B<pthread_setschedparam>() と\n"
7788 "B<pthread_getschedparam>() やスケジューリングに関連する pthreads の\n"
7789 "他のいろいろな関数の使用例を示すものである。"
7790
7791 #. type: Plain text
7792 #: build/C/man3/pthread_setschedparam.3:170
7793 msgid ""
7794 "In the following run, the main thread sets its scheduling policy to "
7795 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
7796 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
7797 "priority attribute of 20.  The program then sets (using "
7798 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
7799 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
7800 "created using this attributes object should take their scheduling attributes "
7801 "from the thread attributes object.  The program then creates a thread using "
7802 "the thread attributes object, and that thread displays its scheduling policy "
7803 "and priority."
7804 msgstr ""
7805 "以下の実行例では、メインスレッドは、自分のスケジューリングポリシーを\n"
7806 "優先度 10 の B<SCHED_FIFO> を設定し、スレッド属性オブジェクトを\n"
7807 "スケジューリングポリシー属性 B<SCHED_RR> とスケジューリング優先度\n"
7808 "属性 20 で初期化する。\n"
7809 "次に、このプログラムは (B<pthread_attr_setinheritsched>(3) を使って) \n"
7810 "そのスレッド属性オブジェクトの inherit scheduler 属性に\n"
7811 "B<PTHREAD_EXPLICIT_SCHED> を設定する。B<PTHREAD_EXPLICIT_SCHED> は、\n"
7812 "そのスレッド属性オブジェクトを使って作成されたスレッドはスレッド属性\n"
7813 "オブジェクトからスケジューリング属性を取得して使うことを意味する。\n"
7814 "それから、このスレッド属性オブジェクトを使ってスレッドを作成し、\n"
7815 "作成したスレッドのスケジューリングポリシーと優先度を表示する。"
7816
7817 #. type: Plain text
7818 #: build/C/man3/pthread_setschedparam.3:178
7819 #, no-wrap
7820 msgid ""
7821 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
7822 "Password:\n"
7823 "# B<./a.out -mf10 -ar20 -i e>\n"
7824 "Scheduler settings of main thread\n"
7825 "    policy=SCHED_FIFO, priority=10\n"
7826 msgstr ""
7827 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
7828 "Password:\n"
7829 "# B<./a.out -mf10 -ar20 -i e>\n"
7830 "Scheduler settings of main thread\n"
7831 "    policy=SCHED_FIFO, priority=10\n"
7832
7833 #. type: Plain text
7834 #: build/C/man3/pthread_setschedparam.3:182
7835 #, no-wrap
7836 msgid ""
7837 "Scheduler settings in \\(aqattr\\(aq\n"
7838 "    policy=SCHED_RR, priority=20\n"
7839 "    inheritsched is EXPLICIT\n"
7840 msgstr ""
7841 "Scheduler settings in \\(aqattr\\(aq\n"
7842 "    policy=SCHED_RR, priority=20\n"
7843 "    inheritsched is EXPLICIT\n"
7844
7845 #. type: Plain text
7846 #: build/C/man3/pthread_setschedparam.3:185
7847 #, no-wrap
7848 msgid ""
7849 "Scheduler attributes of new thread\n"
7850 "    policy=SCHED_RR, priority=20\n"
7851 msgstr ""
7852 "Scheduler attributes of new thread\n"
7853 "    policy=SCHED_RR, priority=20\n"
7854
7855 #. type: Plain text
7856 #: build/C/man3/pthread_setschedparam.3:190
7857 msgid ""
7858 "In the above output, one can see that the scheduling policy and priority "
7859 "were taken from the values specified in the thread attributes object."
7860 msgstr ""
7861 "上記の出力では、スケジューリングポリシーと優先度がスレッド属性\n"
7862 "オブジェクトで指定された値から取られていることが分かる。"
7863
7864 #. type: Plain text
7865 #: build/C/man3/pthread_setschedparam.3:197
7866 msgid ""
7867 "The next run is the same as the previous, except that the inherit scheduler "
7868 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
7869 "using the thread attributes object should ignore the scheduling attributes "
7870 "specified in the attributes object and instead take their scheduling "
7871 "attributes from the creating thread."
7872 msgstr ""
7873 "次の実行例は前のものと同じだが、 inherit scheduler 属性が \n"
7874 "B<PTHREAD_INHERIT_SCHED> に設定される点が異なる。\n"
7875 "B<PTHREAD_INHERIT_SCHED> は、そのスレッド属性オブジェクトを使って作成\n"
7876 "されたスレッドは、スレッド属性オブジェクトからスケジューリング属性を\n"
7877 "無視し、代わりに呼び出したスレッドからスケジューリング属性を取得する\n"
7878 "ことを意味する。"
7879
7880 #. type: Plain text
7881 #: build/C/man3/pthread_setschedparam.3:203
7882 #, no-wrap
7883 msgid ""
7884 "# B<./a.out -mf10 -ar20 -i i>\n"
7885 "Scheduler settings of main thread\n"
7886 "    policy=SCHED_FIFO, priority=10\n"
7887 msgstr ""
7888 "# B<./a.out -mf10 -ar20 -i i>\n"
7889 "Scheduler settings of main thread\n"
7890 "    policy=SCHED_FIFO, priority=10\n"
7891
7892 #. type: Plain text
7893 #: build/C/man3/pthread_setschedparam.3:207
7894 #, no-wrap
7895 msgid ""
7896 "Scheduler settings in \\(aqattr\\(aq\n"
7897 "    policy=SCHED_RR, priority=20\n"
7898 "    inheritsched is INHERIT\n"
7899 msgstr ""
7900 "Scheduler settings in \\(aqattr\\(aq\n"
7901 "    policy=SCHED_RR, priority=20\n"
7902 "    inheritsched is INHERIT\n"
7903
7904 #. type: Plain text
7905 #: build/C/man3/pthread_setschedparam.3:210
7906 #, no-wrap
7907 msgid ""
7908 "Scheduler attributes of new thread\n"
7909 "    policy=SCHED_FIFO, priority=10\n"
7910 msgstr ""
7911 "Scheduler attributes of new thread\n"
7912 "    policy=SCHED_FIFO, priority=10\n"
7913
7914 #. type: Plain text
7915 #: build/C/man3/pthread_setschedparam.3:216
7916 msgid ""
7917 "In the above output, one can see that the scheduling policy and priority "
7918 "were taken from the creating thread, rather than the thread attributes "
7919 "object."
7920 msgstr ""
7921 "上記の出力では、スケジューリングポリシーと優先度が、\n"
7922 "スレッド属性オブジェクトからではなく、\n"
7923 "スレッドを作成したスレッドから取れれていることが分かる。"
7924
7925 #. type: Plain text
7926 #: build/C/man3/pthread_setschedparam.3:222
7927 msgid ""
7928 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
7929 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
7930 "scheduler attribute."
7931 msgstr ""
7932 "なお、 I<-i\\ i> を省略した場合でも、\n"
7933 "B<PTHREAD_INHERIT_SCHED> が inherit scheduler 属性のデフォルト値なので、\n"
7934 "出力は同じになる。"
7935
7936 #. type: Plain text
7937 #: build/C/man3/pthread_setschedparam.3:226
7938 #, no-wrap
7939 msgid "/* pthreads_sched_test.c */\n"
7940 msgstr "/* pthreads_sched_test.c */\n"
7941
7942 #. type: Plain text
7943 #: build/C/man3/pthread_setschedparam.3:232
7944 #, no-wrap
7945 msgid ""
7946 "#include E<lt>pthread.hE<gt>\n"
7947 "#include E<lt>stdio.hE<gt>\n"
7948 "#include E<lt>stdlib.hE<gt>\n"
7949 "#include E<lt>unistd.hE<gt>\n"
7950 "#include E<lt>errno.hE<gt>\n"
7951 msgstr ""
7952 "#include E<lt>pthread.hE<gt>\n"
7953 "#include E<lt>stdio.hE<gt>\n"
7954 "#include E<lt>stdlib.hE<gt>\n"
7955 "#include E<lt>unistd.hE<gt>\n"
7956 "#include E<lt>errno.hE<gt>\n"
7957
7958 #. type: Plain text
7959 #: build/C/man3/pthread_setschedparam.3:241
7960 #, no-wrap
7961 msgid ""
7962 "static void\n"
7963 "usage(char *prog_name, char *msg)\n"
7964 "{\n"
7965 "    if (msg != NULL)\n"
7966 "        fputs(msg, stderr);\n"
7967 msgstr ""
7968 "static void\n"
7969 "usage(char *prog_name, char *msg)\n"
7970 "{\n"
7971 "    if (msg != NULL)\n"
7972 "        fputs(msg, stderr);\n"
7973
7974 #. type: Plain text
7975 #: build/C/man3/pthread_setschedparam.3:258
7976 #, no-wrap
7977 msgid ""
7978 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
7979 "    fprintf(stderr, \"Options are:\\en\");\n"
7980 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
7981 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
7982 "    fpe(\"                 thread attributes object\\en\");\n"
7983 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
7984 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
7985 "    fpe(\"                     r  SCHED_RR\\en\");\n"
7986 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
7987 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
7988 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
7989 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
7990 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
7991 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
7992 "    exit(EXIT_FAILURE);\n"
7993 "}\n"
7994 msgstr ""
7995 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
7996 "    fprintf(stderr, \"Options are:\\en\");\n"
7997 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
7998 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
7999 "    fpe(\"                 thread attributes object\\en\");\n"
8000 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8001 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8002 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8003 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8004 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8005 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
8006 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8007 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8008 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8009 "    exit(EXIT_FAILURE);\n"
8010 "}\n"
8011
8012 #. type: Plain text
8013 #: build/C/man3/pthread_setschedparam.3:269
8014 #, no-wrap
8015 msgid ""
8016 "static int\n"
8017 "get_policy(char p, int *policy)\n"
8018 "{\n"
8019 "    switch (p) {\n"
8020 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8021 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8022 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8023 "    default:  return 0;\n"
8024 "    }\n"
8025 "}\n"
8026 msgstr ""
8027 "static int\n"
8028 "get_policy(char p, int *policy)\n"
8029 "{\n"
8030 "    switch (p) {\n"
8031 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8032 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8033 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8034 "    default:  return 0;\n"
8035 "    }\n"
8036 "}\n"
8037
8038 #. type: Plain text
8039 #: build/C/man3/pthread_setschedparam.3:280
8040 #, no-wrap
8041 msgid ""
8042 "static void\n"
8043 "display_sched_attr(int policy, struct sched_param *param)\n"
8044 "{\n"
8045 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8046 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8047 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8048 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8049 "            \"???\",\n"
8050 "            param-E<gt>sched_priority);\n"
8051 "}\n"
8052 msgstr ""
8053 "static void\n"
8054 "display_sched_attr(int policy, struct sched_param *param)\n"
8055 "{\n"
8056 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8057 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8058 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8059 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8060 "            \"???\",\n"
8061 "            param-E<gt>sched_priority);\n"
8062 "}\n"
8063
8064 #. type: Plain text
8065 #: build/C/man3/pthread_setschedparam.3:286
8066 #, no-wrap
8067 msgid ""
8068 "static void\n"
8069 "display_thread_sched_attr(char *msg)\n"
8070 "{\n"
8071 "    int policy, s;\n"
8072 "    struct sched_param param;\n"
8073 msgstr ""
8074 "static void\n"
8075 "display_thread_sched_attr(char *msg)\n"
8076 "{\n"
8077 "    int policy, s;\n"
8078 "    struct sched_param param;\n"
8079
8080 #. type: Plain text
8081 #: build/C/man3/pthread_setschedparam.3:290
8082 #, no-wrap
8083 msgid ""
8084 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8085 "    if (s != 0)\n"
8086 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8087 msgstr ""
8088 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8089 "    if (s != 0)\n"
8090 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8091
8092 #. type: Plain text
8093 #: build/C/man3/pthread_setschedparam.3:294
8094 #, no-wrap
8095 msgid ""
8096 "    printf(\"%s\\en\", msg);\n"
8097 "    display_sched_attr(policy, &param);\n"
8098 "}\n"
8099 msgstr ""
8100 "    printf(\"%s\\en\", msg);\n"
8101 "    display_sched_attr(policy, &param);\n"
8102 "}\n"
8103
8104 #. type: Plain text
8105 #: build/C/man3/pthread_setschedparam.3:299
8106 #, no-wrap
8107 msgid ""
8108 "static void *\n"
8109 "thread_start(void *arg)\n"
8110 "{\n"
8111 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8112 msgstr ""
8113 "static void *\n"
8114 "thread_start(void *arg)\n"
8115 "{\n"
8116 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8117
8118 #. type: Plain text
8119 #: build/C/man3/pthread_setschedparam.3:302
8120 #, no-wrap
8121 msgid ""
8122 "    return NULL;\n"
8123 "}\n"
8124 msgstr ""
8125 "    return NULL;\n"
8126 "}\n"
8127
8128 #. type: Plain text
8129 #: build/C/man3/pthread_setschedparam.3:312
8130 #, no-wrap
8131 msgid ""
8132 "int\n"
8133 "main(int argc, char *argv[])\n"
8134 "{\n"
8135 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
8136 "    pthread_t thread;\n"
8137 "    pthread_attr_t attr;\n"
8138 "    pthread_attr_t *attrp;\n"
8139 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
8140 "    struct sched_param param;\n"
8141 msgstr ""
8142 "int\n"
8143 "main(int argc, char *argv[])\n"
8144 "{\n"
8145 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
8146 "    pthread_t thread;\n"
8147 "    pthread_attr_t attr;\n"
8148 "    pthread_attr_t *attrp;\n"
8149 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
8150 "    struct sched_param param;\n"
8151
8152 #. type: Plain text
8153 #: build/C/man3/pthread_setschedparam.3:314
8154 #, no-wrap
8155 msgid "    /* Process command-line options */\n"
8156 msgstr "    /* Process command-line options */\n"
8157
8158 #. type: Plain text
8159 #: build/C/man3/pthread_setschedparam.3:319
8160 #, no-wrap
8161 msgid ""
8162 "    use_null_attrib = 0;\n"
8163 "    attr_sched_str = NULL;\n"
8164 "    main_sched_str = NULL;\n"
8165 "    inheritsched_str = NULL;\n"
8166 msgstr ""
8167 "    use_null_attrib = 0;\n"
8168 "    attr_sched_str = NULL;\n"
8169 "    main_sched_str = NULL;\n"
8170 "    inheritsched_str = NULL;\n"
8171
8172 #. type: Plain text
8173 #: build/C/man3/pthread_setschedparam.3:329
8174 #, no-wrap
8175 msgid ""
8176 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
8177 "        switch (opt) {\n"
8178 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
8179 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
8180 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
8181 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
8182 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
8183 "        }\n"
8184 "    }\n"
8185 msgstr ""
8186 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
8187 "        switch (opt) {\n"
8188 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
8189 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
8190 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
8191 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
8192 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
8193 "        }\n"
8194 "    }\n"
8195
8196 #. type: Plain text
8197 #: build/C/man3/pthread_setschedparam.3:333
8198 #, no-wrap
8199 msgid ""
8200 "    if (use_null_attrib &&\n"
8201 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
8202 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
8203 msgstr ""
8204 "    if (use_null_attrib &&\n"
8205 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
8206 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
8207
8208 #. type: Plain text
8209 #: build/C/man3/pthread_setschedparam.3:336
8210 #, no-wrap
8211 msgid ""
8212 "    /* Optionally set scheduling attributes of main thread,\n"
8213 "       and display the attributes */\n"
8214 msgstr ""
8215 "    /* Optionally set scheduling attributes of main thread,\n"
8216 "       and display the attributes */\n"
8217
8218 #. type: Plain text
8219 #: build/C/man3/pthread_setschedparam.3:341
8220 #, no-wrap
8221 msgid ""
8222 "    if (main_sched_str != NULL) {\n"
8223 "        if (!get_policy(main_sched_str[0], &policy))\n"
8224 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
8225 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
8226 msgstr ""
8227 "    if (main_sched_str != NULL) {\n"
8228 "        if (!get_policy(main_sched_str[0], &policy))\n"
8229 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
8230 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
8231
8232 #. type: Plain text
8233 #: build/C/man3/pthread_setschedparam.3:346
8234 #, no-wrap
8235 msgid ""
8236 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
8237 "        if (s != 0)\n"
8238 "            handle_error_en(s, \"pthread_setschedparam\");\n"
8239 "    }\n"
8240 msgstr ""
8241 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
8242 "        if (s != 0)\n"
8243 "            handle_error_en(s, \"pthread_setschedparam\");\n"
8244 "    }\n"
8245
8246 #. type: Plain text
8247 #: build/C/man3/pthread_setschedparam.3:349
8248 #, no-wrap
8249 msgid ""
8250 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
8251 "    printf(\"\\en\");\n"
8252 msgstr ""
8253 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
8254 "    printf(\"\\en\");\n"
8255
8256 #. type: Plain text
8257 #: build/C/man3/pthread_setschedparam.3:351
8258 #, no-wrap
8259 msgid "    /* Initialize thread attributes object according to options */\n"
8260 msgstr "    /* Initialize thread attributes object according to options */\n"
8261
8262 #. type: Plain text
8263 #: build/C/man3/pthread_setschedparam.3:360
8264 #, no-wrap
8265 msgid ""
8266 "    if (!use_null_attrib) {\n"
8267 "        s = pthread_attr_init(&attr);\n"
8268 "        if (s != 0)\n"
8269 "            handle_error_en(s, \"pthread_attr_init\");\n"
8270 "        attrp = &attr;\n"
8271 "    }\n"
8272 msgstr ""
8273 "    if (!use_null_attrib) {\n"
8274 "        s = pthread_attr_init(&attr);\n"
8275 "        if (s != 0)\n"
8276 "            handle_error_en(s, \"pthread_attr_init\");\n"
8277 "        attrp = &attr;\n"
8278 "    }\n"
8279
8280 #. type: Plain text
8281 #: build/C/man3/pthread_setschedparam.3:368
8282 #, no-wrap
8283 msgid ""
8284 "    if (inheritsched_str != NULL) {\n"
8285 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
8286 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
8287 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
8288 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
8289 "        else\n"
8290 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
8291 msgstr ""
8292 "    if (inheritsched_str != NULL) {\n"
8293 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
8294 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
8295 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
8296 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
8297 "        else\n"
8298 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
8299
8300 #. type: Plain text
8301 #: build/C/man3/pthread_setschedparam.3:373
8302 #, no-wrap
8303 msgid ""
8304 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
8305 "        if (s != 0)\n"
8306 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
8307 "    }\n"
8308 msgstr ""
8309 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
8310 "        if (s != 0)\n"
8311 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
8312 "    }\n"
8313
8314 #. type: Plain text
8315 #: build/C/man3/pthread_setschedparam.3:379
8316 #, no-wrap
8317 msgid ""
8318 "    if (attr_sched_str != NULL) {\n"
8319 "        if (!get_policy(attr_sched_str[0], &policy))\n"
8320 "            usage(argv[0],\n"
8321 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
8322 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
8323 msgstr ""
8324 "    if (attr_sched_str != NULL) {\n"
8325 "        if (!get_policy(attr_sched_str[0], &policy))\n"
8326 "            usage(argv[0],\n"
8327 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
8328 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
8329
8330 #. type: Plain text
8331 #: build/C/man3/pthread_setschedparam.3:387
8332 #, no-wrap
8333 msgid ""
8334 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
8335 "        if (s != 0)\n"
8336 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
8337 "        s = pthread_attr_setschedparam(&attr, &param);\n"
8338 "        if (s != 0)\n"
8339 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
8340 "    }\n"
8341 msgstr ""
8342 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
8343 "        if (s != 0)\n"
8344 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
8345 "        s = pthread_attr_setschedparam(&attr, &param);\n"
8346 "        if (s != 0)\n"
8347 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
8348 "    }\n"
8349
8350 #. type: Plain text
8351 #: build/C/man3/pthread_setschedparam.3:390
8352 #, no-wrap
8353 msgid ""
8354 "    /* If we initialized a thread attributes object, display\n"
8355 "       the scheduling attributes that were set in the object */\n"
8356 msgstr ""
8357 "    /* If we initialized a thread attributes object, display\n"
8358 "       the scheduling attributes that were set in the object */\n"
8359
8360 #. type: Plain text
8361 #: build/C/man3/pthread_setschedparam.3:398
8362 #, no-wrap
8363 msgid ""
8364 "    if (attrp != NULL) {\n"
8365 "        s = pthread_attr_getschedparam(&attr, &param);\n"
8366 "        if (s != 0)\n"
8367 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
8368 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
8369 "        if (s != 0)\n"
8370 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
8371 msgstr ""
8372 "    if (attrp != NULL) {\n"
8373 "        s = pthread_attr_getschedparam(&attr, &param);\n"
8374 "        if (s != 0)\n"
8375 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
8376 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
8377 "        if (s != 0)\n"
8378 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
8379
8380 #. type: Plain text
8381 #: build/C/man3/pthread_setschedparam.3:401
8382 #, no-wrap
8383 msgid ""
8384 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
8385 "        display_sched_attr(policy, &param);\n"
8386 msgstr ""
8387 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
8388 "        display_sched_attr(policy, &param);\n"
8389
8390 #. type: Plain text
8391 #: build/C/man3/pthread_setschedparam.3:409
8392 #, no-wrap
8393 msgid ""
8394 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
8395 "        printf(\"    inheritsched is %s\\en\",\n"
8396 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
8397 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
8398 "                \"???\");\n"
8399 "        printf(\"\\en\");\n"
8400 "    }\n"
8401 msgstr ""
8402 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
8403 "        printf(\"    inheritsched is %s\\en\",\n"
8404 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
8405 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
8406 "                \"???\");\n"
8407 "        printf(\"\\en\");\n"
8408 "    }\n"
8409
8410 #. type: Plain text
8411 #: build/C/man3/pthread_setschedparam.3:411
8412 #, no-wrap
8413 msgid "    /* Create a thread that will display its scheduling attributes */\n"
8414 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
8415
8416 #. type: Plain text
8417 #: build/C/man3/pthread_setschedparam.3:415
8418 #, no-wrap
8419 msgid ""
8420 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
8421 "    if (s != 0)\n"
8422 "        handle_error_en(s, \"pthread_create\");\n"
8423 msgstr ""
8424 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
8425 "    if (s != 0)\n"
8426 "        handle_error_en(s, \"pthread_create\");\n"
8427
8428 #. type: Plain text
8429 #: build/C/man3/pthread_setschedparam.3:417
8430 #, no-wrap
8431 msgid "    /* Destroy unneeded thread attributes object */\n"
8432 msgstr "    /* Destroy unneeded thread attributes object */\n"
8433
8434 #. type: Plain text
8435 #: build/C/man3/pthread_setschedparam.3:425
8436 #, no-wrap
8437 msgid ""
8438 "    s = pthread_join(thread, NULL);\n"
8439 "    if (s != 0)\n"
8440 "        handle_error_en(s, \"pthread_join\");\n"
8441 msgstr ""
8442 "    s = pthread_join(thread, NULL);\n"
8443 "    if (s != 0)\n"
8444 "        handle_error_en(s, \"pthread_join\");\n"
8445
8446 #. type: Plain text
8447 #: build/C/man3/pthread_setschedparam.3:441
8448 msgid ""
8449 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
8450 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
8451 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
8452 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
8453 "B<pthreads>(7)"
8454 msgstr ""
8455 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
8456 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
8457 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
8458 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
8459 "B<pthreads>(7)"
8460
8461 #. type: TH
8462 #: build/C/man3/pthread_setschedprio.3:24
8463 #, no-wrap
8464 msgid "PTHREAD_SETSCHEDPRIO"
8465 msgstr "PTHREAD_SETSCHEDPRIO"
8466
8467 #. type: TH
8468 #: build/C/man3/pthread_setschedprio.3:24
8469 #, no-wrap
8470 msgid "2008-11-06"
8471 msgstr "2008-11-06"
8472
8473 #. type: Plain text
8474 #: build/C/man3/pthread_setschedprio.3:27
8475 msgid "pthread_setschedprio - set scheduling priority of a thread"
8476 msgstr "pthread_setschedprio - スレッドのスケジューリング優先度を設定する"
8477
8478 #. type: Plain text
8479 #: build/C/man3/pthread_setschedprio.3:32
8480 #, no-wrap
8481 msgid "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
8482 msgstr "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
8483
8484 #.  FIXME . nptl/pthread_setschedprio.c has the following
8485 #.    /* If the thread should have higher priority because of some
8486 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
8487 #.  Eventually (perhaps after writing the mutexattr pages), we
8488 #.  may want to add something on the topic to this page.
8489 #.  nptl/pthread_setschedparam.c has a similar case.
8490 #. type: Plain text
8491 #: build/C/man3/pthread_setschedprio.3:51
8492 msgid ""
8493 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
8494 "thread I<thread> to the value specified in I<prio>.  (By contrast "
8495 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
8496 "of a thread.)"
8497 msgstr ""
8498 "B<pthread_setschedprio>() 関数は、スレッド I<thread> のスケジューリング\n"
8499 "優先度に I<prio> で指定された値を設定する\n"
8500 "(一方、B<pthread_setschedparam>(3) はスレッドのスケジューリングポリシー\n"
8501 "と優先度の両方を変更する)。"
8502
8503 #. type: Plain text
8504 #: build/C/man3/pthread_setschedprio.3:59
8505 msgid ""
8506 "On success, this function returns 0; on error, it returns a nonzero error "
8507 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
8508 "I<thread> is not changed."
8509 msgstr ""
8510 "成功すると、この関数は 0 を返す。\n"
8511 "エラーの場合、0 以外のエラー番号を返す。\n"
8512 "B<pthread_setschedprio>() が失敗した場合、 I<thread> の\n"
8513 "スケジューリング優先度は変更されない。"
8514
8515 #. type: Plain text
8516 #: build/C/man3/pthread_setschedprio.3:64
8517 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
8518 msgstr ""
8519 "指定されたスレッドのスケジューリングポリシーでは、 I<prio> は無効である。"
8520
8521 #. type: Plain text
8522 #: build/C/man3/pthread_setschedprio.3:68
8523 msgid ""
8524 "The caller does not have appropriate privileges to set the specified "
8525 "priority."
8526 msgstr "呼び出し側が、指定された優先度を設定するのに必要な特権を持っていない。"
8527
8528 #. type: Plain text
8529 #: build/C/man3/pthread_setschedprio.3:79
8530 msgid ""
8531 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
8532 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
8533 msgstr ""
8534 "POSIX.1-2001 では、 B<pthread_setschedprio>() に関して\n"
8535 "エラー B<ENOTSUP> (\"サポートされていない値を優先度\n"
8536 "に設定しようとした\") も追加で規定されている。"
8537
8538 #. type: Plain text
8539 #: build/C/man3/pthread_setschedprio.3:81
8540 msgid "This function is available in glibc since version 2.3.4."
8541 msgstr "この関数は glibc バージョン 2.3.4 以降で利用できる。"
8542
8543 #. type: Plain text
8544 #: build/C/man3/pthread_setschedprio.3:89
8545 msgid ""
8546 "For a description of the permissions required to, and the effect of, "
8547 "changing a thread's scheduling priority, and details of the permitted ranges "
8548 "for priorities in each scheduling policy, see B<sched_setscheduler>(2)."
8549 msgstr ""
8550 "スレッドのスケジューリング優先度を変更するために必要な許可や\n"
8551 "変更した場合の影響、および各スケジューリングポリシーで認められる優先度\n"
8552 "の範囲の詳細については、 B<sched_setscheduler>(2) を参照。"
8553
8554 #. type: Plain text
8555 #: build/C/man3/pthread_setschedprio.3:101
8556 msgid ""
8557 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
8558 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
8559 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
8560 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
8561 "B<pthreads>(7)"
8562 msgstr ""
8563 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
8564 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
8565 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
8566 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
8567 "B<pthreads>(7)"
8568
8569 #. type: TH
8570 #: build/C/man3/pthread_sigmask.3:24
8571 #, no-wrap
8572 msgid "PTHREAD_SIGMASK"
8573 msgstr "PTHREAD_SIGMASK"
8574
8575 #. type: TH
8576 #: build/C/man3/pthread_sigmask.3:24
8577 #, no-wrap
8578 msgid "2011-10-16"
8579 msgstr "2011-10-16"
8580
8581 #. type: Plain text
8582 #: build/C/man3/pthread_sigmask.3:27
8583 msgid "pthread_sigmask - examine and change mask of blocked signals"
8584 msgstr "pthread_sigmask - 禁止するシグナルマスクの確認と変更を行う"
8585
8586 #. type: Plain text
8587 #: build/C/man3/pthread_sigmask.3:33
8588 #, no-wrap
8589 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
8590 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
8591
8592 #. type: Plain text
8593 #: build/C/man3/pthread_sigmask.3:44
8594 msgid ""
8595 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
8596 "difference that its use in multithreaded programs is explicitly specified by "
8597 "POSIX.1-2001.  Other differences are noted in this page."
8598 msgstr ""
8599 "B<pthread_sigmask>() 関数は B<sigprocmask>(2) と全く同様だが、\n"
8600 "マルチスレッドプログラムでの利用が POSIX.1-2001 で明示的に規定されて\n"
8601 "いる点が異なる。他の違いはこのマニュアルページで説明する。"
8602
8603 #. type: Plain text
8604 #: build/C/man3/pthread_sigmask.3:47
8605 msgid ""
8606 "For a description of the arguments and operation of this function, see "
8607 "B<sigprocmask>(2)."
8608 msgstr "この関数の引き数と動作の説明は B<sigprocmask>(2) を参照。"
8609
8610 #. type: Plain text
8611 #: build/C/man3/pthread_sigmask.3:52
8612 msgid ""
8613 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
8614 "number."
8615 msgstr ""
8616 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
8617 "エラーの場合、エラー番号を返す。"
8618
8619 #. type: Plain text
8620 #: build/C/man3/pthread_sigmask.3:55
8621 msgid "See B<sigprocmask>(2)."
8622 msgstr "B<sigprocmask>(2) を参照。"
8623
8624 #. type: Plain text
8625 #: build/C/man3/pthread_sigmask.3:59
8626 msgid "A new thread inherits a copy of its creator's signal mask."
8627 msgstr ""
8628 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスクのコピーを\n"
8629 "継承する。"
8630
8631 #. type: Plain text
8632 #: build/C/man3/pthread_sigmask.3:64
8633 msgid ""
8634 "The program below blocks some signals in the main thread, and then creates a "
8635 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
8636 "shell session demonstrates its use:"
8637 msgstr ""
8638 "以下のプログラムは、メインスレッドでシグナルのいくつかを禁止 (block)\n"
8639 "するように設定を行い、 B<sigwait>(3) 経由でそれらのシグナルを集める\n"
8640 "専用のスレッドを作成する。\n"
8641 "下記のシェルのセッションはその利用例を示したものである。"
8642
8643 #. type: Plain text
8644 #: build/C/man3/pthread_sigmask.3:75
8645 #, no-wrap
8646 msgid ""
8647 "$B< ./a.out &>\n"
8648 "[1] 5423\n"
8649 "$B< kill -QUIT %1>\n"
8650 "Signal handling thread got signal 3\n"
8651 "$B< kill -USR1 %1>\n"
8652 "Signal handling thread got signal 10\n"
8653 "$B< kill -TERM %1>\n"
8654 "[1]+  Terminated              ./a.out\n"
8655 msgstr ""
8656 "$B< ./a.out &>\n"
8657 "[1] 5423\n"
8658 "$B< kill -QUIT %1>\n"
8659 "Signal handling thread got signal 3\n"
8660 "$B< kill -USR1 %1>\n"
8661 "Signal handling thread got signal 10\n"
8662 "$B< kill -TERM %1>\n"
8663 "[1]+  Terminated              ./a.out\n"
8664
8665 #. type: Plain text
8666 #: build/C/man3/pthread_sigmask.3:86
8667 #, no-wrap
8668 msgid ""
8669 "#include E<lt>pthread.hE<gt>\n"
8670 "#include E<lt>stdio.hE<gt>\n"
8671 "#include E<lt>stdlib.hE<gt>\n"
8672 "#include E<lt>unistd.hE<gt>\n"
8673 "#include E<lt>signal.hE<gt>\n"
8674 "#include E<lt>errno.hE<gt>\n"
8675 msgstr ""
8676 "#include E<lt>pthread.hE<gt>\n"
8677 "#include E<lt>stdio.hE<gt>\n"
8678 "#include E<lt>stdlib.hE<gt>\n"
8679 "#include E<lt>unistd.hE<gt>\n"
8680 "#include E<lt>signal.hE<gt>\n"
8681 "#include E<lt>errno.hE<gt>\n"
8682
8683 #. type: Plain text
8684 #: build/C/man3/pthread_sigmask.3:88
8685 #, no-wrap
8686 msgid "/* Simple error handling functions */\n"
8687 msgstr "/* Simple error handling functions */\n"
8688
8689 #. type: Plain text
8690 #: build/C/man3/pthread_sigmask.3:97
8691 #, no-wrap
8692 msgid ""
8693 "static void *\n"
8694 "sig_thread(void *arg)\n"
8695 "{\n"
8696 "    sigset_t *set = (sigset_t *) arg;\n"
8697 "    int s, sig;\n"
8698 msgstr ""
8699 "static void *\n"
8700 "sig_thread(void *arg)\n"
8701 "{\n"
8702 "    sigset_t *set = (sigset_t *) arg;\n"
8703 "    int s, sig;\n"
8704
8705 #. type: Plain text
8706 #: build/C/man3/pthread_sigmask.3:105
8707 #, no-wrap
8708 msgid ""
8709 "    for (;;) {\n"
8710 "        s = sigwait(set, &sig);\n"
8711 "        if (s != 0)\n"
8712 "            handle_error_en(s, \"sigwait\");\n"
8713 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
8714 "    }\n"
8715 "}\n"
8716 msgstr ""
8717 "    for (;;) {\n"
8718 "        s = sigwait(set, &sig);\n"
8719 "        if (s != 0)\n"
8720 "            handle_error_en(s, \"sigwait\");\n"
8721 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
8722 "    }\n"
8723 "}\n"
8724
8725 #. type: Plain text
8726 #: build/C/man3/pthread_sigmask.3:112
8727 #, no-wrap
8728 msgid ""
8729 "int\n"
8730 "main(int argc, char *argv[])\n"
8731 "{\n"
8732 "    pthread_t thread;\n"
8733 "    sigset_t set;\n"
8734 "    int s;\n"
8735 msgstr ""
8736 "int\n"
8737 "main(int argc, char *argv[])\n"
8738 "{\n"
8739 "    pthread_t thread;\n"
8740 "    sigset_t set;\n"
8741 "    int s;\n"
8742
8743 #. type: Plain text
8744 #: build/C/man3/pthread_sigmask.3:115
8745 #, no-wrap
8746 msgid ""
8747 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
8748 "       will inherit a copy of the signal mask. */\n"
8749 msgstr ""
8750 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
8751 "       will inherit a copy of the signal mask. */\n"
8752
8753 #. type: Plain text
8754 #: build/C/man3/pthread_sigmask.3:122
8755 #, no-wrap
8756 msgid ""
8757 "    sigemptyset(&set);\n"
8758 "    sigaddset(&set, SIGQUIT);\n"
8759 "    sigaddset(&set, SIGUSR1);\n"
8760 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
8761 "    if (s != 0)\n"
8762 "        handle_error_en(s, \"pthread_sigmask\");\n"
8763 msgstr ""
8764 "    sigemptyset(&set);\n"
8765 "    sigaddset(&set, SIGQUIT);\n"
8766 "    sigaddset(&set, SIGUSR1);\n"
8767 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
8768 "    if (s != 0)\n"
8769 "        handle_error_en(s, \"pthread_sigmask\");\n"
8770
8771 #. type: Plain text
8772 #: build/C/man3/pthread_sigmask.3:126
8773 #, no-wrap
8774 msgid ""
8775 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
8776 "    if (s != 0)\n"
8777 "        handle_error_en(s, \"pthread_create\");\n"
8778 msgstr ""
8779 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
8780 "    if (s != 0)\n"
8781 "        handle_error_en(s, \"pthread_create\");\n"
8782
8783 #. type: Plain text
8784 #: build/C/man3/pthread_sigmask.3:129
8785 #, no-wrap
8786 msgid ""
8787 "    /* Main thread carries on to create other threads and/or do\n"
8788 "       other work */\n"
8789 msgstr ""
8790 "    /* Main thread carries on to create other threads and/or do\n"
8791 "       other work */\n"
8792
8793 #. type: Plain text
8794 #: build/C/man3/pthread_sigmask.3:132
8795 #, no-wrap
8796 msgid ""
8797 "    pause();            /* Dummy pause so we can test program */\n"
8798 "}\n"
8799 msgstr ""
8800 "    pause();            /* Dummy pause so we can test program */\n"
8801 "}\n"
8802
8803 #. type: Plain text
8804 #: build/C/man3/pthread_sigmask.3:142
8805 msgid ""
8806 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), "
8807 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
8808 msgstr ""
8809 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2)  B<pthread_create>(3), "
8810 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
8811
8812 #. type: TH
8813 #: build/C/man3/pthread_sigqueue.3:23
8814 #, no-wrap
8815 msgid "PTHREAD_SIGQUEUE"
8816 msgstr "PTHREAD_SIGQUEUE"
8817
8818 #. type: TH
8819 #: build/C/man3/pthread_sigqueue.3:23
8820 #, no-wrap
8821 msgid "2011-09-23"
8822 msgstr "2011-09-23"
8823
8824 #. type: Plain text
8825 #: build/C/man3/pthread_sigqueue.3:26
8826 msgid "pthread_sigqueue - queue a signal and data to a thread"
8827 msgstr "pthread_sigqueue - スレッドに対するシグナルとデータをキューに入れる"
8828
8829 #. type: Plain text
8830 #: build/C/man3/pthread_sigqueue.3:32
8831 #, no-wrap
8832 msgid ""
8833 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
8834 "B<                     const union sigval >I<value>B<);>\n"
8835 msgstr ""
8836 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
8837 "B<                     const union sigval >I<value>B<);>\n"
8838
8839 #. type: Plain text
8840 #: build/C/man3/pthread_sigqueue.3:43
8841 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
8842 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
8843
8844 #. type: Plain text
8845 #: build/C/man3/pthread_sigqueue.3:51
8846 msgid ""
8847 "The B<pthread_sigqueue>()  function performs a similar task to B<sigqueue>"
8848 "(3), but, rather than sending a signal to another process, it sends a signal "
8849 "to another thread in the same process as the calling thread."
8850 msgstr ""
8851 "B<pthread_sigqueue>() 関数は B<sigqueue>(3) と同様の処理を実行するが、\n"
8852 "別のプロセスにシグナルを送信するのではなく、呼び出したスレッドと\n"
8853 "同じプロセス内の他のスレッドにシグナルを送信する。"
8854
8855 #. type: Plain text
8856 #: build/C/man3/pthread_sigqueue.3:63
8857 msgid ""
8858 "The I<thread> argument is the ID of another thread in the same process as "
8859 "the caller.  The I<sig> argument specifies the signal to be sent.  The "
8860 "I<value> argument specifies data to accompany the signal; see B<sigqueue>"
8861 "(3)  for details."
8862 msgstr ""
8863 "I<thread> 引き数は、呼び出し側と同じプロセスの別のスレッドの ID である。\n"
8864 "I<sig> 引き数は送信するシグナルを指定する。\n"
8865 "I<value> 引き数はシグナルと一緒に渡すデータを指定する。\n"
8866 "詳細は B<sigqueue>(3) を参照。"
8867
8868 #. type: Plain text
8869 #: build/C/man3/pthread_sigqueue.3:68
8870 msgid ""
8871 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
8872 "number."
8873 msgstr ""
8874 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
8875 "エラーの場合、エラー番号を返す。"
8876
8877 #. type: Plain text
8878 #: build/C/man3/pthread_sigqueue.3:75
8879 msgid ""
8880 "The limit of signals which may be queued has been reached.  (See B<signal>"
8881 "(7)  for further information.)"
8882 msgstr ""
8883 "キューに入れられるシグナル数が上限に達していた\n"
8884 "(詳しい情報は (B<signal>(7) を参照)。"
8885
8886 #. type: Plain text
8887 #: build/C/man3/pthread_sigqueue.3:79
8888 msgid "I<sig> was invalid."
8889 msgstr "I<sig> が無効であった。"
8890
8891 #. type: TP
8892 #: build/C/man3/pthread_sigqueue.3:79
8893 #, no-wrap
8894 msgid "B<ENOSYS>"
8895 msgstr "B<ENOSYS>"
8896
8897 #. type: Plain text
8898 #: build/C/man3/pthread_sigqueue.3:83
8899 msgid "B<pthread_sigqueue>()  is not supported on this system."
8900 msgstr "B<pthread_sigqueue>() がこのシステムではサポートされていない。"
8901
8902 #. type: Plain text
8903 #: build/C/man3/pthread_sigqueue.3:87
8904 msgid "I<thread> is not valid."
8905 msgstr "I<thread> が無効である。"
8906
8907 #. type: Plain text
8908 #: build/C/man3/pthread_sigqueue.3:91
8909 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
8910 msgstr "B<pthread_sigqueue>() 関数は glibc 2.11 で初めて登場した。"
8911
8912 #. type: Plain text
8913 #: build/C/man3/pthread_sigqueue.3:93
8914 msgid "This function is a GNU extension."
8915 msgstr "この関数は GNU による拡張である。"
8916
8917 #. type: Plain text
8918 #: build/C/man3/pthread_sigqueue.3:101
8919 msgid ""
8920 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), B<sigqueue>"
8921 "(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
8922 msgstr ""
8923 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
8924 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
8925
8926 #. type: TH
8927 #: build/C/man3/pthread_testcancel.3:24
8928 #, no-wrap
8929 msgid "PTHREAD_TESTCANCEL"
8930 msgstr "PTHREAD_TESTCANCEL"
8931
8932 #. type: TH
8933 #: build/C/man3/pthread_testcancel.3:24
8934 #, no-wrap
8935 msgid "2012-04-14"
8936 msgstr "2012-04-14"
8937
8938 #. type: Plain text
8939 #: build/C/man3/pthread_testcancel.3:27
8940 msgid ""
8941 "pthread_testcancel - request delivery of any pending cancellation request"
8942 msgstr "pthread_testcancel - 処理待ちの取り消し要求の配送を要求する"
8943
8944 #. type: Plain text
8945 #: build/C/man3/pthread_testcancel.3:32
8946 #, no-wrap
8947 msgid "B<void pthread_testcancel(void);>\n"
8948 msgstr "B<void pthread_testcancel(void);>\n"
8949
8950 #. type: Plain text
8951 #: build/C/man3/pthread_testcancel.3:41
8952 msgid ""
8953 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
8954 "calling thread, so that a thread that is otherwise executing code that "
8955 "contains no cancellation points will respond to a cancellation request."
8956 msgstr ""
8957 "B<pthread_testcancel>() を呼び出すと、呼び出したスレッド内に取り消し\n"
8958 "ポイント (cancellation point) が作成される。\n"
8959 "これにより、これ以外には取り消しポイントを含まないコードを実行して\n"
8960 "いるスレッドが取り消し要求に対応することができるようになる。"
8961
8962 #. type: Plain text
8963 #: build/C/man3/pthread_testcancel.3:48
8964 msgid ""
8965 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
8966 "cancellation request is pending, then a call to B<pthread_testcancel>(3)  "
8967 "has no effect."
8968 msgstr ""
8969 "(B<pthread_setcancelstate>(3) を使って) キャンセルが無効になっている\n"
8970 "場合や処理待ちの取り消し要求がない場合は、B<pthread_testcancel>(3) を\n"
8971 "呼び出しても何の影響もない。"
8972
8973 #. type: Plain text
8974 #: build/C/man3/pthread_testcancel.3:52
8975 msgid ""
8976 "This function does not return a value.  If the calling thread is canceled as "
8977 "a consequence of a call to this function, then the function does not return."
8978 msgstr ""
8979 "この関数は値を返さない。この関数の呼び出しの結果、呼び出したスレッドが\n"
8980 "キャンセルされた場合、この関数が返ることはない。"
8981
8982 #. type: Plain text
8983 #: build/C/man3/pthread_testcancel.3:61
8984 msgid "See B<pthread_cleanup_push>(3)."
8985 msgstr "B<pthread_cleanup_push>(3) を参照。"
8986
8987 #. type: Plain text
8988 #: build/C/man3/pthread_testcancel.3:66
8989 msgid ""
8990 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
8991 "(3), B<pthreads>(7)"
8992 msgstr ""
8993 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
8994 "(3), B<pthreads>(7)"
8995
8996 #. type: TH
8997 #: build/C/man3/pthread_tryjoin_np.3:24
8998 #, no-wrap
8999 msgid "PTHREAD_TRYJOIN_NP"
9000 msgstr "PTHREAD_TRYJOIN_NP"
9001
9002 #. type: Plain text
9003 #: build/C/man3/pthread_tryjoin_np.3:28
9004 msgid ""
9005 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
9006 "thread"
9007 msgstr ""
9008 "pthread_tryjoin_np, pthread_timedjoin_np - 終了したスレッドの join を\n"
9009 "試みる"
9010
9011 #. type: Plain text
9012 #: build/C/man3/pthread_tryjoin_np.3:34
9013 #, no-wrap
9014 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9015 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9016
9017 #. type: Plain text
9018 #: build/C/man3/pthread_tryjoin_np.3:37
9019 #, no-wrap
9020 msgid ""
9021 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9022 "B<                         const struct timespec *>I<abstime>B<);>\n"
9023 msgstr ""
9024 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9025 "B<                         const struct timespec *>I<abstime>B<);>\n"
9026
9027 #. type: Plain text
9028 #: build/C/man3/pthread_tryjoin_np.3:44
9029 msgid ""
9030 "These functions operate in the same way as B<pthread_join>(3), except for "
9031 "the differences described on this page."
9032 msgstr ""
9033 "これらの関数は B<pthread_join>(3) と同じように動作するが、\n"
9034 "このページで説明する違いがある。"
9035
9036 #. type: Plain text
9037 #: build/C/man3/pthread_tryjoin_np.3:56
9038 msgid ""
9039 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
9040 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
9041 "I<thread> has not yet terminated, then instead of blocking, as is done by "
9042 "B<pthread_join>(3), the call returns an error."
9043 msgstr ""
9044 "B<pthread_tryjoin_np>() 関数は、スレッド I<thread> の非停止\n"
9045 "(nonblocking) での join を実行し、スレッドの終了ステータスを\n"
9046 "I<*retval> に入れて返す。I<thread> がまだ終了していない場合は、\n"
9047 "B<pthread_join>(3) のように停止 (block) せずに、エラーを返す。"
9048
9049 #. type: Plain text
9050 #: build/C/man3/pthread_tryjoin_np.3:74
9051 msgid ""
9052 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
9053 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
9054 "specified in I<abstime>.  If the timeout expires before I<thread> "
9055 "terminates, the call returns an error.  The I<abstime> argument is a "
9056 "structure of the following form, specifying an absolute time measured since "
9057 "the Epoch (see B<time>(2)):"
9058 msgstr ""
9059 "B<pthread_timedjoin_np>() 関数は、タイムアウト付きの join を行う。\n"
9060 "I<thread> がまだ終了していない場合、 I<abstime> で指定された最大時間\n"
9061 "まで停止する。 I<thread> が終了する前にタイムアウト時間が経過した場合は、\n"
9062 "エラーを返す。I<abstime> 引き数は以下に示す構造体であり、\n"
9063 "Epoch (時刻紀元; B<time>(2) 参照) から測った絶対時刻を指定する。"
9064
9065 #. type: Plain text
9066 #: build/C/man3/pthread_tryjoin_np.3:81
9067 #, no-wrap
9068 msgid ""
9069 "struct timespec {\n"
9070 "    time_t tv_sec;     /* seconds */\n"
9071 "    long   tv_nsec;    /* nanoseconds */\n"
9072 "};\n"
9073 msgstr ""
9074 "struct timespec {\n"
9075 "    time_t tv_sec;     /* seconds */\n"
9076 "    long   tv_nsec;    /* nanoseconds */\n"
9077 "};\n"
9078
9079 #. type: Plain text
9080 #: build/C/man3/pthread_tryjoin_np.3:87
9081 msgid ""
9082 "On success, these functions return 0; on error, they return an error number."
9083 msgstr ""
9084 "成功すると、これらの関数は 0 を返す。\n"
9085 "エラーの場合、エラー番号を返す。"
9086
9087 #. type: Plain text
9088 #: build/C/man3/pthread_tryjoin_np.3:92
9089 msgid ""
9090 "These functions can fail with the same errors as B<pthread_join>(3).  "
9091 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
9092 msgstr ""
9093 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
9094 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
9095
9096 #. type: TP
9097 #: build/C/man3/pthread_tryjoin_np.3:92
9098 #, no-wrap
9099 msgid "B<EBUSY>"
9100 msgstr "B<EBUSY>"
9101
9102 #. type: Plain text
9103 #: build/C/man3/pthread_tryjoin_np.3:96
9104 msgid "I<thread> had not yet terminated at the time of the call."
9105 msgstr "呼び出しを行った時点では I<thread> はまだ終了していない。"
9106
9107 #. type: Plain text
9108 #: build/C/man3/pthread_tryjoin_np.3:99
9109 msgid ""
9110 "B<pthread_timedjoin_np>()  can in addition fail with the following error:"
9111 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
9112
9113 #. type: TP
9114 #: build/C/man3/pthread_tryjoin_np.3:99
9115 #, no-wrap
9116 msgid "B<ETIMEDOUT>"
9117 msgstr "B<ETIMEDOUT>"
9118
9119 #. type: Plain text
9120 #: build/C/man3/pthread_tryjoin_np.3:104
9121 msgid "The call timed out before I<thread> terminated."
9122 msgstr "I<thread> が終了する前に呼び出しがタイムアウトとなった。"
9123
9124 #. type: Plain text
9125 #: build/C/man3/pthread_tryjoin_np.3:108
9126 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
9127 msgstr "B<pthread_timedjoin_np>() がエラー B<EINTR> を返すことはない。"
9128
9129 #. type: Plain text
9130 #: build/C/man3/pthread_tryjoin_np.3:110
9131 msgid "These functions first appeared in glibc in version 2.3.3."
9132 msgstr "これらの関数は glibc バージョン 2.3.3 で初めて登場した。"
9133
9134 #. type: Plain text
9135 #: build/C/man3/pthread_tryjoin_np.3:115
9136 msgid "The following code waits to join for up to 5 seconds:"
9137 msgstr "以下のコードは、最大 5 秒まで join を待つ。"
9138
9139 #. type: Plain text
9140 #: build/C/man3/pthread_tryjoin_np.3:119
9141 #, no-wrap
9142 msgid ""
9143 "    struct timespec ts;\n"
9144 "    int s;\n"
9145 msgstr ""
9146 "    struct timespec ts;\n"
9147 "    int s;\n"
9148
9149 #. type: Plain text
9150 #: build/C/man3/pthread_tryjoin_np.3:121
9151 #, no-wrap
9152 msgid "    ...\n"
9153 msgstr "    ...\n"
9154
9155 #. type: Plain text
9156 #: build/C/man3/pthread_tryjoin_np.3:125
9157 #, no-wrap
9158 msgid ""
9159 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
9160 "\t/* Handle error */\n"
9161 "    }\n"
9162 msgstr ""
9163 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
9164 "\t/* Handle error */\n"
9165 "    }\n"
9166
9167 #. type: Plain text
9168 #: build/C/man3/pthread_tryjoin_np.3:127
9169 #, no-wrap
9170 msgid "    ts.tv_sec += 5;\n"
9171 msgstr "    ts.tv_sec += 5;\n"
9172
9173 #. type: Plain text
9174 #: build/C/man3/pthread_tryjoin_np.3:132
9175 #, no-wrap
9176 msgid ""
9177 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
9178 "    if (s != 0) {\n"
9179 "        /* Handle error */\n"
9180 "    }\n"
9181 msgstr ""
9182 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
9183 "    if (s != 0) {\n"
9184 "        /* Handle error */\n"
9185 "    }\n"
9186
9187 #. type: Plain text
9188 #: build/C/man3/pthread_tryjoin_np.3:138
9189 msgid ""
9190 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
9191 msgstr ""
9192 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
9193
9194 #. type: TH
9195 #: build/C/man3/pthread_yield.3:23
9196 #, no-wrap
9197 msgid "PTHREAD_YIELD"
9198 msgstr "PTHREAD_YIELD"
9199
9200 #. type: Plain text
9201 #: build/C/man3/pthread_yield.3:26
9202 msgid "pthread_yield - yield the processor"
9203 msgstr "pthread_yield - プロセッサを明け渡す (yield)"
9204
9205 #. type: Plain text
9206 #: build/C/man3/pthread_yield.3:31
9207 #, no-wrap
9208 msgid "B<int pthread_yield(void);>\n"
9209 msgstr "B<int pthread_yield(void);>\n"
9210
9211 #. type: Plain text
9212 #: build/C/man3/pthread_yield.3:41
9213 msgid ""
9214 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
9215 "thread is placed at the end of the run queue for its static priority and "
9216 "another thread is scheduled to run.  For further details, see B<sched_yield>"
9217 "(2)"
9218 msgstr ""
9219 "B<pthread_yield>() を呼び出すと、呼び出したスレッドは CPU を手放す。\n"
9220 "スレッドはそのスレッドの静的優先度の実行キューの末尾に回り、\n"
9221 "別のスレッドが実行されるようにスケジューリングされる。\n"
9222 "詳細は B<sched_yield>(2) を参照。"
9223
9224 #. type: Plain text
9225 #: build/C/man3/pthread_yield.3:46
9226 msgid ""
9227 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
9228 "number."
9229 msgstr ""
9230 "成功すると、 B<pthread_yield>() は 0 を返す。\n"
9231 "エラーの場合、エラー番号を返す。"
9232
9233 #. type: Plain text
9234 #: build/C/man3/pthread_yield.3:50
9235 msgid ""
9236 "On Linux, this call always succeeds (but portable and future-proof "
9237 "applications should nevertheless handle a possible error return)."
9238 msgstr ""
9239 "Linux では、この関数の呼び出しは常に成功する\n"
9240 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
9241 "正のエラーの返り値を処理するようにすべきである)。"
9242
9243 #.  e.g., the BSDs, Tru64, AIX, and Irix.
9244 #. type: Plain text
9245 #: build/C/man3/pthread_yield.3:56
9246 msgid ""
9247 "This call is nonstandard, but present on several other systems.  Use the "
9248 "standardized B<sched_yield>(2)  instead."
9249 msgstr ""
9250 "この関数は非標準だが、他のいくつかのシステムにも存在する。\n"
9251 "代わりに、標準化されている B<sched_yield>(2) を使うこと。"
9252
9253 #. type: Plain text
9254 #: build/C/man3/pthread_yield.3:59
9255 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
9256 msgstr ""
9257 "Linux では、この関数は B<sched_yield>(2) を呼び出す形で実装されている。"
9258
9259 #. type: Plain text
9260 #: build/C/man3/pthread_yield.3:63
9261 msgid "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
9262 msgstr "B<sched_setscheduler>(2), B<sched_yield>(2)  B<pthreads>(7)"
9263
9264 #. type: TH
9265 #: build/C/man7/pthreads.7:24
9266 #, no-wrap
9267 msgid "PTHREADS"
9268 msgstr "PTHREADS"
9269
9270 #. type: TH
9271 #: build/C/man7/pthreads.7:24
9272 #, no-wrap
9273 msgid "2010-11-14"
9274 msgstr "2010-11-14"
9275
9276 #. type: Plain text
9277 #: build/C/man7/pthreads.7:27
9278 msgid "pthreads - POSIX threads"
9279 msgstr "pthreads - POSIX スレッド"
9280
9281 #. type: Plain text
9282 #: build/C/man7/pthreads.7:34
9283 msgid ""
9284 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
9285 "programming commonly known as POSIX threads, or Pthreads.  A single process "
9286 "can contain multiple threads, all of which are executing the same program.  "
9287 "These threads share the same global memory (data and heap segments), but "
9288 "each thread has its own stack (automatic variables)."
9289 msgstr ""
9290 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
9291 "ラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロ"
9292 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
9293 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
9294 "スレッドは自分専用のスタック (自動変数) を持つ。"
9295
9296 #. type: Plain text
9297 #: build/C/man7/pthreads.7:37
9298 msgid ""
9299 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
9300 "these attributes are process-wide rather than per-thread):"
9301 msgstr ""
9302 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
9303 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
9304
9305 #. type: IP
9306 #: build/C/man7/pthreads.7:37 build/C/man7/pthreads.7:39
9307 #: build/C/man7/pthreads.7:41 build/C/man7/pthreads.7:43
9308 #: build/C/man7/pthreads.7:45 build/C/man7/pthreads.7:47
9309 #: build/C/man7/pthreads.7:49 build/C/man7/pthreads.7:52
9310 #: build/C/man7/pthreads.7:54 build/C/man7/pthreads.7:57
9311 #: build/C/man7/pthreads.7:63 build/C/man7/pthreads.7:68
9312 #: build/C/man7/pthreads.7:71 build/C/man7/pthreads.7:74
9313 #: build/C/man7/pthreads.7:82 build/C/man7/pthreads.7:86
9314 #: build/C/man7/pthreads.7:89 build/C/man7/pthreads.7:93
9315 #: build/C/man7/pthreads.7:96 build/C/man7/pthreads.7:103
9316 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
9317 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
9318 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
9319 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
9320 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
9321 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
9322 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
9323 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
9324 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
9325 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
9326 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
9327 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
9328 #: build/C/man7/pthreads.7:833
9329 #, no-wrap
9330 msgid "-"
9331 msgstr "-"
9332
9333 #. type: Plain text
9334 #: build/C/man7/pthreads.7:39
9335 msgid "process ID"
9336 msgstr "プロセス ID"
9337
9338 #. type: Plain text
9339 #: build/C/man7/pthreads.7:41
9340 msgid "parent process ID"
9341 msgstr "親プロセス ID"
9342
9343 #. type: Plain text
9344 #: build/C/man7/pthreads.7:43
9345 msgid "process group ID and session ID"
9346 msgstr "プロセスグループ ID とセッション ID"
9347
9348 #. type: Plain text
9349 #: build/C/man7/pthreads.7:45
9350 msgid "controlling terminal"
9351 msgstr "制御端末"
9352
9353 #. type: Plain text
9354 #: build/C/man7/pthreads.7:47
9355 msgid "user and group IDs"
9356 msgstr "ユーザ ID とグループ ID"
9357
9358 #. type: Plain text
9359 #: build/C/man7/pthreads.7:49
9360 msgid "open file descriptors"
9361 msgstr "オープンするファイルディスクリプタ"
9362
9363 #. type: Plain text
9364 #: build/C/man7/pthreads.7:52
9365 msgid "record locks (see B<fcntl>(2))"
9366 msgstr "レコードのロック (B<fcntl>(3)  参照)"
9367
9368 #. type: Plain text
9369 #: build/C/man7/pthreads.7:54
9370 msgid "signal dispositions"
9371 msgstr "シグナルの配置"
9372
9373 #. type: Plain text
9374 #: build/C/man7/pthreads.7:57
9375 msgid "file mode creation mask (B<umask>(2))"
9376 msgstr "ファイルモード作成マスク (B<umask>(2))"
9377
9378 #. type: Plain text
9379 #: build/C/man7/pthreads.7:63
9380 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
9381 msgstr ""
9382 "カレント・ディレクトリ (B<chdir>(2))  とルート・ディレクトリ (B<chroot>(2))"
9383
9384 #. type: Plain text
9385 #: build/C/man7/pthreads.7:68
9386 msgid ""
9387 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
9388 msgstr ""
9389 "インターバル・タイマ (B<setitimer>(2))  と POSIX タイマ (B<timer_create>(2))"
9390
9391 #. type: Plain text
9392 #: build/C/man7/pthreads.7:71
9393 msgid "nice value (B<setpriority>(2))"
9394 msgstr "nice 値 (B<setpriority>(2))"
9395
9396 #. type: Plain text
9397 #: build/C/man7/pthreads.7:74
9398 msgid "resource limits (B<setrlimit>(2))"
9399 msgstr "リソース制限 (B<setrlimit>(2))"
9400
9401 #. type: Plain text
9402 #: build/C/man7/pthreads.7:79
9403 msgid ""
9404 "measurements of the consumption of CPU time (B<times>(2))  and resources "
9405 "(B<getrusage>(2))"
9406 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
9407
9408 #. type: Plain text
9409 #: build/C/man7/pthreads.7:82
9410 msgid ""
9411 "As well as the stack, POSIX.1 specifies that various other attributes are "
9412 "distinct for each thread, including:"
9413 msgstr ""
9414 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
9415 "るかを規定している:"
9416
9417 #. type: Plain text
9418 #: build/C/man7/pthreads.7:86
9419 msgid "thread ID (the I<pthread_t> data type)"
9420 msgstr "スレッド ID (B<pthread_t> データ型)"
9421
9422 #. type: Plain text
9423 #: build/C/man7/pthreads.7:89
9424 msgid "signal mask (B<pthread_sigmask>(3))"
9425 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
9426
9427 #. type: Plain text
9428 #: build/C/man7/pthreads.7:93
9429 msgid "the I<errno> variable"
9430 msgstr "I<errno> 変数"
9431
9432 #. type: Plain text
9433 #: build/C/man7/pthreads.7:96
9434 msgid "alternate signal stack (B<sigaltstack>(2))"
9435 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
9436
9437 #. type: Plain text
9438 #: build/C/man7/pthreads.7:101
9439 msgid ""
9440 "real-time scheduling policy and priority (B<sched_setscheduler>(2)  and "
9441 "B<sched_setparam>(2))"
9442 msgstr ""
9443 "リアルタイム・スケジューリングのポリシーと優先度 (B<sched_setscheduler>(2)  "
9444 "と B<sched_setparam>(2))"
9445
9446 #. type: Plain text
9447 #: build/C/man7/pthreads.7:103
9448 msgid "The following Linux-specific features are also per-thread:"
9449 msgstr "以下の Linux 特有の機能もスレッド単位である:"
9450
9451 #. type: Plain text
9452 #: build/C/man7/pthreads.7:106
9453 msgid "capabilities (see B<capabilities>(7))"
9454 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
9455
9456 #. type: Plain text
9457 #: build/C/man7/pthreads.7:109
9458 msgid "CPU affinity (B<sched_setaffinity>(2))"
9459 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
9460
9461 #. type: SS
9462 #: build/C/man7/pthreads.7:109
9463 #, no-wrap
9464 msgid "Pthreads function return values"
9465 msgstr "pthreads 関数の返り値"
9466
9467 #. type: Plain text
9468 #: build/C/man7/pthreads.7:116
9469 msgid ""
9470 "Most pthreads functions return 0 on success, and an error number of "
9471 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
9472 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
9473 "the function can never fail with the error B<EINTR>."
9474 msgstr ""
9475 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
9476 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
9477 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
9478 "は決してないと規定している。"
9479
9480 #. type: SS
9481 #: build/C/man7/pthreads.7:116
9482 #, no-wrap
9483 msgid "Thread IDs"
9484 msgstr "スレッド ID"
9485
9486 #. type: Plain text
9487 #: build/C/man7/pthreads.7:130
9488 msgid ""
9489 "Each of the threads in a process has a unique thread identifier (stored in "
9490 "the type I<pthread_t>).  This identifier is returned to the caller of "
9491 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
9492 "using B<pthread_self>(3).  Thread IDs are only guaranteed to be unique "
9493 "within a process.  A thread ID may be reused after a terminated thread has "
9494 "been joined, or a detached thread has terminated.  In all pthreads functions "
9495 "that accept a thread ID as an argument, that ID by definition refers to a "
9496 "thread in the same process as the caller."
9497 msgstr ""
9498 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
9499 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
9500 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
9501 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
9502 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
9503 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
9504 "じプロセス内の一つのスレッドを参照する。"
9505
9506 #. type: SS
9507 #: build/C/man7/pthreads.7:130
9508 #, no-wrap
9509 msgid "Thread-safe functions"
9510 msgstr "スレッドセーフな関数"
9511
9512 #. type: Plain text
9513 #: build/C/man7/pthreads.7:134
9514 msgid ""
9515 "A thread-safe function is one that can be safely (i.e., it will deliver the "
9516 "same results regardless of whether it is)  called from multiple threads at "
9517 "the same time."
9518 msgstr ""
9519 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
9520 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
9521
9522 #. type: Plain text
9523 #: build/C/man7/pthreads.7:138
9524 msgid ""
9525 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
9526 "standard shall be thread-safe, except for the following functions:"
9527 msgstr ""
9528 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
9529 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
9530
9531 #. type: Plain text
9532 #: build/C/man7/pthreads.7:232
9533 #, no-wrap
9534 msgid ""
9535 "asctime()\n"
9536 "basename()\n"
9537 "catgets()\n"
9538 "crypt()\n"
9539 "ctermid() if passed a non-NULL argument\n"
9540 "ctime()\n"
9541 "dbm_clearerr()\n"
9542 "dbm_close()\n"
9543 "dbm_delete()\n"
9544 "dbm_error()\n"
9545 "dbm_fetch()\n"
9546 "dbm_firstkey()\n"
9547 "dbm_nextkey()\n"
9548 "dbm_open()\n"
9549 "dbm_store()\n"
9550 "dirname()\n"
9551 "dlerror()\n"
9552 "drand48()\n"
9553 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9554 "encrypt()\n"
9555 "endgrent()\n"
9556 "endpwent()\n"
9557 "endutxent()\n"
9558 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9559 "ftw()\n"
9560 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9561 "getc_unlocked()\n"
9562 "getchar_unlocked()\n"
9563 "getdate()\n"
9564 "getenv()\n"
9565 "getgrent()\n"
9566 "getgrgid()\n"
9567 "getgrnam()\n"
9568 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9569 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9570 "gethostent()\n"
9571 "getlogin()\n"
9572 "getnetbyaddr()\n"
9573 "getnetbyname()\n"
9574 "getnetent()\n"
9575 "getopt()\n"
9576 "getprotobyname()\n"
9577 "getprotobynumber()\n"
9578 "getprotoent()\n"
9579 "getpwent()\n"
9580 "getpwnam()\n"
9581 "getpwuid()\n"
9582 "getservbyname()\n"
9583 "getservbyport()\n"
9584 "getservent()\n"
9585 "getutxent()\n"
9586 "getutxid()\n"
9587 "getutxline()\n"
9588 "gmtime()\n"
9589 "hcreate()\n"
9590 "hdestroy()\n"
9591 "hsearch()\n"
9592 "inet_ntoa()\n"
9593 "l64a()\n"
9594 "lgamma()\n"
9595 "lgammaf()\n"
9596 "lgammal()\n"
9597 "localeconv()\n"
9598 "localtime()\n"
9599 "lrand48()\n"
9600 "mrand48()\n"
9601 "nftw()\n"
9602 "nl_langinfo()\n"
9603 "ptsname()\n"
9604 "putc_unlocked()\n"
9605 "putchar_unlocked()\n"
9606 "putenv()\n"
9607 "pututxline()\n"
9608 "rand()\n"
9609 "readdir()\n"
9610 "setenv()\n"
9611 "setgrent()\n"
9612 "setkey()\n"
9613 "setpwent()\n"
9614 "setutxent()\n"
9615 "strerror()\n"
9616 "strsignal() [Added in POSIX.1-2008]\n"
9617 "strtok()\n"
9618 "system() [Added in POSIX.1-2008]\n"
9619 "tmpnam() if passed a non-NULL argument\n"
9620 "ttyname()\n"
9621 "unsetenv()\n"
9622 "wcrtomb() if its final argument is NULL\n"
9623 "wcsrtombs() if its final argument is NULL\n"
9624 "wcstombs()\n"
9625 "wctomb()\n"
9626 msgstr ""
9627 "asctime()\n"
9628 "basename()\n"
9629 "catgets()\n"
9630 "crypt()\n"
9631 "ctermid() (NULL でない引き数を渡された場合)\n"
9632 "ctime()\n"
9633 "dbm_clearerr()\n"
9634 "dbm_close()\n"
9635 "dbm_delete()\n"
9636 "dbm_error()\n"
9637 "dbm_fetch()\n"
9638 "dbm_firstkey()\n"
9639 "dbm_nextkey()\n"
9640 "dbm_open()\n"
9641 "dbm_store()\n"
9642 "dirname()\n"
9643 "dlerror()\n"
9644 "drand48()\n"
9645 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9646 "encrypt()\n"
9647 "endgrent()\n"
9648 "endpwent()\n"
9649 "endutxent()\n"
9650 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9651 "ftw()\n"
9652 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9653 "getc_unlocked()\n"
9654 "getchar_unlocked()\n"
9655 "getdate()\n"
9656 "getenv()\n"
9657 "getgrent()\n"
9658 "getgrgid()\n"
9659 "getgrnam()\n"
9660 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9661 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9662 "gethostent()\n"
9663 "getlogin()\n"
9664 "getnetbyaddr()\n"
9665 "getnetbyname()\n"
9666 "getnetent()\n"
9667 "getopt()\n"
9668 "getprotobyname()\n"
9669 "getprotobynumber()\n"
9670 "getprotoent()\n"
9671 "getpwent()\n"
9672 "getpwnam()\n"
9673 "getpwuid()\n"
9674 "getservbyname()\n"
9675 "getservbyport()\n"
9676 "getservent()\n"
9677 "getutxent()\n"
9678 "getutxid()\n"
9679 "getutxline()\n"
9680 "gmtime()\n"
9681 "hcreate()\n"
9682 "hdestroy()\n"
9683 "hsearch()\n"
9684 "inet_ntoa()\n"
9685 "l64a()\n"
9686 "lgamma()\n"
9687 "lgammaf()\n"
9688 "lgammal()\n"
9689 "localeconv()\n"
9690 "localtime()\n"
9691 "lrand48()\n"
9692 "mrand48()\n"
9693 "nftw()\n"
9694 "nl_langinfo()\n"
9695 "ptsname()\n"
9696 "putc_unlocked()\n"
9697 "putchar_unlocked()\n"
9698 "putenv()\n"
9699 "pututxline()\n"
9700 "rand()\n"
9701 "readdir()\n"
9702 "setenv()\n"
9703 "setgrent()\n"
9704 "setkey()\n"
9705 "setpwent()\n"
9706 "setutxent()\n"
9707 "strerror()\n"
9708 "strsignal() [POSIX.1-2008 で追加された]\n"
9709 "strtok()\n"
9710 "system() [POSIX.1-2008 で追加された]\n"
9711 "tmpnam() (NULL でない引き数を渡された場合)\n"
9712 "ttyname()\n"
9713 "unsetenv()\n"
9714 "wcrtomb() (最後の引き数が NULL の場合)\n"
9715 "wcsrtombs() (最後の引き数が NULL の場合)\n"
9716 "wcstombs()\n"
9717 "wctomb()\n"
9718
9719 #. type: SS
9720 #: build/C/man7/pthreads.7:234
9721 #, no-wrap
9722 msgid "Async-cancel-safe functions"
9723 msgstr "async-cancel-safe 関数"
9724
9725 #. type: Plain text
9726 #: build/C/man7/pthreads.7:238
9727 msgid ""
9728 "An async-cancel-safe function is one that can be safely called in an "
9729 "application where asynchronous cancelability is enabled (see "
9730 "B<pthread_setcancelstate>(3))."
9731 msgstr ""
9732 "async-cancel-safe 関数は、\n"
9733 "非同期キャンセル機能が有効になっているアプリケーションで\n"
9734 "安全に呼び出すことができる関数のことである\n"
9735 "(B<pthread_setcancelstate>(3) を参照)。"
9736
9737 #. type: Plain text
9738 #: build/C/man7/pthreads.7:241
9739 msgid ""
9740 "Only the following functions are required to be async-cancel-safe by "
9741 "POSIX.1-2001 and POSIX.1-2008:"
9742 msgstr ""
9743 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
9744 "なければならないとされている。"
9745
9746 #. type: Plain text
9747 #: build/C/man7/pthreads.7:247
9748 #, no-wrap
9749 msgid ""
9750 "pthread_cancel()\n"
9751 "pthread_setcancelstate()\n"
9752 "pthread_setcanceltype()\n"
9753 msgstr ""
9754 "pthread_cancel()\n"
9755 "pthread_setcancelstate()\n"
9756 "pthread_setcanceltype()\n"
9757
9758 #. type: SS
9759 #: build/C/man7/pthreads.7:249
9760 #, no-wrap
9761 msgid "Cancellation Points"
9762 msgstr "取り消しポイント (cancellation points)"
9763
9764 #. type: Plain text
9765 #: build/C/man7/pthreads.7:256
9766 msgid ""
9767 "POSIX.1 specifies that certain functions must, and certain other functions "
9768 "may, be cancellation points.  If a thread is cancelable, its cancelability "
9769 "type is deferred, and a cancellation request is pending for the thread, then "
9770 "the thread is canceled when it calls a function that is a cancellation point."
9771 msgstr ""
9772 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
9773 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
9774 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
9775 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
9776 "時点で、そのスレッドのキャンセルが 行われる。"
9777
9778 #. type: Plain text
9779 #: build/C/man7/pthreads.7:259
9780 msgid ""
9781 "The following functions are required to be cancellation points by "
9782 "POSIX.1-2001 and/or POSIX.1-2008:"
9783 msgstr ""
9784 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
9785 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
9786
9787 #. type: Plain text
9788 #: build/C/man7/pthreads.7:322
9789 #, no-wrap
9790 msgid ""
9791 "accept()\n"
9792 "aio_suspend()\n"
9793 "clock_nanosleep()\n"
9794 "close()\n"
9795 "connect()\n"
9796 "creat()\n"
9797 "fcntl() F_SETLKW\n"
9798 "fdatasync()\n"
9799 "fsync()\n"
9800 "getmsg()\n"
9801 "getpmsg()\n"
9802 "lockf() F_LOCK\n"
9803 "mq_receive()\n"
9804 "mq_send()\n"
9805 "mq_timedreceive()\n"
9806 "mq_timedsend()\n"
9807 "msgrcv()\n"
9808 "msgsnd()\n"
9809 "msync()\n"
9810 "nanosleep()\n"
9811 "open()\n"
9812 "openat() [Added in POSIX.1-2008]\n"
9813 "pause()\n"
9814 "poll()\n"
9815 "pread()\n"
9816 "pselect()\n"
9817 "pthread_cond_timedwait()\n"
9818 "pthread_cond_wait()\n"
9819 "pthread_join()\n"
9820 "pthread_testcancel()\n"
9821 "putmsg()\n"
9822 "putpmsg()\n"
9823 "pwrite()\n"
9824 "read()\n"
9825 "readv()\n"
9826 "recv()\n"
9827 "recvfrom()\n"
9828 "recvmsg()\n"
9829 "select()\n"
9830 "sem_timedwait()\n"
9831 "sem_wait()\n"
9832 "send()\n"
9833 "sendmsg()\n"
9834 "sendto()\n"
9835 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
9836 "sigsuspend()\n"
9837 "sigtimedwait()\n"
9838 "sigwait()\n"
9839 "sigwaitinfo()\n"
9840 "sleep()\n"
9841 "system()\n"
9842 "tcdrain()\n"
9843 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9844 "wait()\n"
9845 "waitid()\n"
9846 "waitpid()\n"
9847 "write()\n"
9848 "writev()\n"
9849 msgstr ""
9850 "accept()\n"
9851 "aio_suspend()\n"
9852 "clock_nanosleep()\n"
9853 "close()\n"
9854 "connect()\n"
9855 "creat()\n"
9856 "fcntl() F_SETLKW\n"
9857 "fdatasync()\n"
9858 "fsync()\n"
9859 "getmsg()\n"
9860 "getpmsg()\n"
9861 "lockf() F_LOCK\n"
9862 "mq_receive()\n"
9863 "mq_send()\n"
9864 "mq_timedreceive()\n"
9865 "mq_timedsend()\n"
9866 "msgrcv()\n"
9867 "msgsnd()\n"
9868 "msync()\n"
9869 "nanosleep()\n"
9870 "open()\n"
9871 "openat() [POSIX.1-2008 で追加された]\n"
9872 "pause()\n"
9873 "poll()\n"
9874 "pread()\n"
9875 "pselect()\n"
9876 "pthread_cond_timedwait()\n"
9877 "pthread_cond_wait()\n"
9878 "pthread_join()\n"
9879 "pthread_testcancel()\n"
9880 "putmsg()\n"
9881 "putpmsg()\n"
9882 "pwrite()\n"
9883 "read()\n"
9884 "readv()\n"
9885 "recv()\n"
9886 "recvfrom()\n"
9887 "recvmsg()\n"
9888 "select()\n"
9889 "sem_timedwait()\n"
9890 "sem_wait()\n"
9891 "send()\n"
9892 "sendmsg()\n"
9893 "sendto()\n"
9894 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
9895 "sigsuspend()\n"
9896 "sigtimedwait()\n"
9897 "sigwait()\n"
9898 "sigwaitinfo()\n"
9899 "sleep()\n"
9900 "system()\n"
9901 "tcdrain()\n"
9902 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9903 "wait()\n"
9904 "waitid()\n"
9905 "waitpid()\n"
9906 "write()\n"
9907 "writev()\n"
9908
9909 #. type: Plain text
9910 #: build/C/man7/pthreads.7:327
9911 msgid ""
9912 "The following functions may be cancellation points according to POSIX.1-2001 "
9913 "and/or POSIX.1-2008:"
9914 msgstr ""
9915 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
9916 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
9917
9918 #. type: Plain text
9919 #: build/C/man7/pthreads.7:555
9920 #, no-wrap
9921 msgid ""
9922 "access()\n"
9923 "asctime()\n"
9924 "asctime_r()\n"
9925 "catclose()\n"
9926 "catgets()\n"
9927 "catopen()\n"
9928 "chmod() [Added in POSIX.1-2008]\n"
9929 "chown() [Added in POSIX.1-2008]\n"
9930 "closedir()\n"
9931 "closelog()\n"
9932 "ctermid()\n"
9933 "ctime()\n"
9934 "ctime_r()\n"
9935 "dbm_close()\n"
9936 "dbm_delete()\n"
9937 "dbm_fetch()\n"
9938 "dbm_nextkey()\n"
9939 "dbm_open()\n"
9940 "dbm_store()\n"
9941 "dlclose()\n"
9942 "dlopen()\n"
9943 "dprintf() [Added in POSIX.1-2008]\n"
9944 "endgrent()\n"
9945 "endhostent()\n"
9946 "endnetent()\n"
9947 "endprotoent()\n"
9948 "endpwent()\n"
9949 "endservent()\n"
9950 "endutxent()\n"
9951 "faccessat() [Added in POSIX.1-2008]\n"
9952 "fchmod() [Added in POSIX.1-2008]\n"
9953 "fchmodat() [Added in POSIX.1-2008]\n"
9954 "fchown() [Added in POSIX.1-2008]\n"
9955 "fchownat() [Added in POSIX.1-2008]\n"
9956 "fclose()\n"
9957 "fcntl() (for any value of cmd argument)\n"
9958 "fflush()\n"
9959 "fgetc()\n"
9960 "fgetpos()\n"
9961 "fgets()\n"
9962 "fgetwc()\n"
9963 "fgetws()\n"
9964 "fmtmsg()\n"
9965 "fopen()\n"
9966 "fpathconf()\n"
9967 "fprintf()\n"
9968 "fputc()\n"
9969 "fputs()\n"
9970 "fputwc()\n"
9971 "fputws()\n"
9972 "fread()\n"
9973 "freopen()\n"
9974 "fscanf()\n"
9975 "fseek()\n"
9976 "fseeko()\n"
9977 "fsetpos()\n"
9978 "fstat()\n"
9979 "fstatat() [Added in POSIX.1-2008]\n"
9980 "ftell()\n"
9981 "ftello()\n"
9982 "ftw()\n"
9983 "futimens() [Added in POSIX.1-2008]\n"
9984 "fwprintf()\n"
9985 "fwrite()\n"
9986 "fwscanf()\n"
9987 "getaddrinfo()\n"
9988 "getc()\n"
9989 "getc_unlocked()\n"
9990 "getchar()\n"
9991 "getchar_unlocked()\n"
9992 "getcwd()\n"
9993 "getdate()\n"
9994 "getdelim() [Added in POSIX.1-2008]\n"
9995 "getgrent()\n"
9996 "getgrgid()\n"
9997 "getgrgid_r()\n"
9998 "getgrnam()\n"
9999 "getgrnam_r()\n"
10000 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10001 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10002 "gethostent()\n"
10003 "gethostid()\n"
10004 "gethostname()\n"
10005 "getline() [Added in POSIX.1-2008]\n"
10006 "getlogin()\n"
10007 "getlogin_r()\n"
10008 "getnameinfo()\n"
10009 "getnetbyaddr()\n"
10010 "getnetbyname()\n"
10011 "getnetent()\n"
10012 "getopt() (if opterr is nonzero)\n"
10013 "getprotobyname()\n"
10014 "getprotobynumber()\n"
10015 "getprotoent()\n"
10016 "getpwent()\n"
10017 "getpwnam()\n"
10018 "getpwnam_r()\n"
10019 "getpwuid()\n"
10020 "getpwuid_r()\n"
10021 "gets()\n"
10022 "getservbyname()\n"
10023 "getservbyport()\n"
10024 "getservent()\n"
10025 "getutxent()\n"
10026 "getutxid()\n"
10027 "getutxline()\n"
10028 "getwc()\n"
10029 "getwchar()\n"
10030 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10031 "glob()\n"
10032 "iconv_close()\n"
10033 "iconv_open()\n"
10034 "ioctl()\n"
10035 "link()\n"
10036 "linkat() [Added in POSIX.1-2008]\n"
10037 "lio_listio() [Added in POSIX.1-2008]\n"
10038 "localtime()\n"
10039 "localtime_r()\n"
10040 "lockf() [Added in POSIX.1-2008]\n"
10041 "lseek()\n"
10042 "lstat()\n"
10043 "mkdir() [Added in POSIX.1-2008]\n"
10044 "mkdirat() [Added in POSIX.1-2008]\n"
10045 "mkdtemp() [Added in POSIX.1-2008]\n"
10046 "mkfifo() [Added in POSIX.1-2008]\n"
10047 "mkfifoat() [Added in POSIX.1-2008]\n"
10048 "mknod() [Added in POSIX.1-2008]\n"
10049 "mknodat() [Added in POSIX.1-2008]\n"
10050 "mkstemp()\n"
10051 "mktime()\n"
10052 "nftw()\n"
10053 "opendir()\n"
10054 "openlog()\n"
10055 "pathconf()\n"
10056 "pclose()\n"
10057 "perror()\n"
10058 "popen()\n"
10059 "posix_fadvise()\n"
10060 "posix_fallocate()\n"
10061 "posix_madvise()\n"
10062 "posix_openpt()\n"
10063 "posix_spawn()\n"
10064 "posix_spawnp()\n"
10065 "posix_trace_clear()\n"
10066 "posix_trace_close()\n"
10067 "posix_trace_create()\n"
10068 "posix_trace_create_withlog()\n"
10069 "posix_trace_eventtypelist_getnext_id()\n"
10070 "posix_trace_eventtypelist_rewind()\n"
10071 "posix_trace_flush()\n"
10072 "posix_trace_get_attr()\n"
10073 "posix_trace_get_filter()\n"
10074 "posix_trace_get_status()\n"
10075 "posix_trace_getnext_event()\n"
10076 "posix_trace_open()\n"
10077 "posix_trace_rewind()\n"
10078 "posix_trace_set_filter()\n"
10079 "posix_trace_shutdown()\n"
10080 "posix_trace_timedgetnext_event()\n"
10081 "posix_typed_mem_open()\n"
10082 "printf()\n"
10083 "psiginfo() [Added in POSIX.1-2008]\n"
10084 "psignal() [Added in POSIX.1-2008]\n"
10085 "pthread_rwlock_rdlock()\n"
10086 "pthread_rwlock_timedrdlock()\n"
10087 "pthread_rwlock_timedwrlock()\n"
10088 "pthread_rwlock_wrlock()\n"
10089 "putc()\n"
10090 "putc_unlocked()\n"
10091 "putchar()\n"
10092 "putchar_unlocked()\n"
10093 "puts()\n"
10094 "pututxline()\n"
10095 "putwc()\n"
10096 "putwchar()\n"
10097 "readdir()\n"
10098 "readdir_r()\n"
10099 "readlink() [Added in POSIX.1-2008]\n"
10100 "readlinkat() [Added in POSIX.1-2008]\n"
10101 "remove()\n"
10102 "rename()\n"
10103 "renameat() [Added in POSIX.1-2008]\n"
10104 "rewind()\n"
10105 "rewinddir()\n"
10106 "scandir() [Added in POSIX.1-2008]\n"
10107 "scanf()\n"
10108 "seekdir()\n"
10109 "semop()\n"
10110 "setgrent()\n"
10111 "sethostent()\n"
10112 "setnetent()\n"
10113 "setprotoent()\n"
10114 "setpwent()\n"
10115 "setservent()\n"
10116 "setutxent()\n"
10117 "sigpause() [Added in POSIX.1-2008]\n"
10118 "stat()\n"
10119 "strerror()\n"
10120 "strerror_r()\n"
10121 "strftime()\n"
10122 "symlink()\n"
10123 "symlinkat() [Added in POSIX.1-2008]\n"
10124 "sync()\n"
10125 "syslog()\n"
10126 "tmpfile()\n"
10127 "tmpnam()\n"
10128 "ttyname()\n"
10129 "ttyname_r()\n"
10130 "tzset()\n"
10131 "ungetc()\n"
10132 "ungetwc()\n"
10133 "unlink()\n"
10134 "unlinkat() [Added in POSIX.1-2008]\n"
10135 "utime() [Added in POSIX.1-2008]\n"
10136 "utimensat() [Added in POSIX.1-2008]\n"
10137 "utimes() [Added in POSIX.1-2008]\n"
10138 "vdprintf() [Added in POSIX.1-2008]\n"
10139 "vfprintf()\n"
10140 "vfwprintf()\n"
10141 "vprintf()\n"
10142 "vwprintf()\n"
10143 "wcsftime()\n"
10144 "wordexp()\n"
10145 "wprintf()\n"
10146 "wscanf()\n"
10147 msgstr ""
10148 "access()\n"
10149 "asctime()\n"
10150 "asctime_r()\n"
10151 "catclose()\n"
10152 "catgets()\n"
10153 "catopen()\n"
10154 "chmod() [POSIX.1-2008 で追加された]\n"
10155 "chown() [POSIX.1-2008 で追加された]\n"
10156 "closedir()\n"
10157 "closelog()\n"
10158 "ctermid()\n"
10159 "ctime()\n"
10160 "ctime_r()\n"
10161 "dbm_close()\n"
10162 "dbm_delete()\n"
10163 "dbm_fetch()\n"
10164 "dbm_nextkey()\n"
10165 "dbm_open()\n"
10166 "dbm_store()\n"
10167 "dlclose()\n"
10168 "dlopen()\n"
10169 "dprintf() [POSIX.1-2008 で追加された]\n"
10170 "endgrent()\n"
10171 "endhostent()\n"
10172 "endnetent()\n"
10173 "endprotoent()\n"
10174 "endpwent()\n"
10175 "endservent()\n"
10176 "endutxent()\n"
10177 "faccessat() [POSIX.1-2008 で追加された]\n"
10178 "fchmod() [POSIX.1-2008 で追加された]\n"
10179 "fchmodat() [POSIX.1-2008 で追加された]\n"
10180 "fchown() [POSIX.1-2008 で追加された]\n"
10181 "fchownat() [POSIX.1-2008 で追加された]\n"
10182 "fclose()\n"
10183 "fcntl() (cmd 引き数が何であっても)\n"
10184 "fflush()\n"
10185 "fgetc()\n"
10186 "fgetpos()\n"
10187 "fgets()\n"
10188 "fgetwc()\n"
10189 "fgetws()\n"
10190 "fmtmsg()\n"
10191 "fopen()\n"
10192 "fpathconf()\n"
10193 "fprintf()\n"
10194 "fputc()\n"
10195 "fputs()\n"
10196 "fputwc()\n"
10197 "fputws()\n"
10198 "fread()\n"
10199 "freopen()\n"
10200 "fscanf()\n"
10201 "fseek()\n"
10202 "fseeko()\n"
10203 "fsetpos()\n"
10204 "fstat()\n"
10205 "fstatat() [POSIX.1-2008 で追加された]\n"
10206 "ftell()\n"
10207 "ftello()\n"
10208 "ftw()\n"
10209 "futimens() [POSIX.1-2008 で追加された]\n"
10210 "fwprintf()\n"
10211 "fwrite()\n"
10212 "fwscanf()\n"
10213 "getaddrinfo()\n"
10214 "getc()\n"
10215 "getc_unlocked()\n"
10216 "getchar()\n"
10217 "getchar_unlocked()\n"
10218 "getcwd()\n"
10219 "getdate()\n"
10220 "getdelim() [POSIX.1-2008 で追加された]\n"
10221 "getgrent()\n"
10222 "getgrgid()\n"
10223 "getgrgid_r()\n"
10224 "getgrnam()\n"
10225 "getgrnam_r()\n"
10226 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
10227 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
10228 "gethostent()\n"
10229 "gethostid()\n"
10230 "gethostname()\n"
10231 "getline() [POSIX.1-2008 で追加された]\n"
10232 "getlogin()\n"
10233 "getlogin_r()\n"
10234 "getnameinfo()\n"
10235 "getnetbyaddr()\n"
10236 "getnetbyname()\n"
10237 "getnetent()\n"
10238 "getopt() (opterr が 0 以外の場合)\n"
10239 "getprotobyname()\n"
10240 "getprotobynumber()\n"
10241 "getprotoent()\n"
10242 "getpwent()\n"
10243 "getpwnam()\n"
10244 "getpwnam_r()\n"
10245 "getpwuid()\n"
10246 "getpwuid_r()\n"
10247 "gets()\n"
10248 "getservbyname()\n"
10249 "getservbyport()\n"
10250 "getservent()\n"
10251 "getutxent()\n"
10252 "getutxid()\n"
10253 "getutxline()\n"
10254 "getwc()\n"
10255 "getwchar()\n"
10256 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
10257 "glob()\n"
10258 "iconv_close()\n"
10259 "iconv_open()\n"
10260 "ioctl()\n"
10261 "link()\n"
10262 "linkat() [POSIX.1-2008 で追加された]\n"
10263 "lio_listio() [POSIX.1-2008 で追加された]\n"
10264 "localtime()\n"
10265 "localtime_r()\n"
10266 "lockf() [POSIX.1-2008 で追加された]\n"
10267 "lseek()\n"
10268 "lstat()\n"
10269 "mkdir() [POSIX.1-2008 で追加された]\n"
10270 "mkdirat() [POSIX.1-2008 で追加された]\n"
10271 "mkdtemp() [POSIX.1-2008 で追加された]\n"
10272 "mkfifo() [POSIX.1-2008 で追加された]\n"
10273 "mkfifoat() [POSIX.1-2008 で追加された]\n"
10274 "mknod() [POSIX.1-2008 で追加された]\n"
10275 "mknodat() [POSIX.1-2008 で追加された]\n"
10276 "mkstemp()\n"
10277 "mktime()\n"
10278 "nftw()\n"
10279 "opendir()\n"
10280 "openlog()\n"
10281 "pathconf()\n"
10282 "pclose()\n"
10283 "perror()\n"
10284 "popen()\n"
10285 "posix_fadvise()\n"
10286 "posix_fallocate()\n"
10287 "posix_madvise()\n"
10288 "posix_openpt()\n"
10289 "posix_spawn()\n"
10290 "posix_spawnp()\n"
10291 "posix_trace_clear()\n"
10292 "posix_trace_close()\n"
10293 "posix_trace_create()\n"
10294 "posix_trace_create_withlog()\n"
10295 "posix_trace_eventtypelist_getnext_id()\n"
10296 "posix_trace_eventtypelist_rewind()\n"
10297 "posix_trace_flush()\n"
10298 "posix_trace_get_attr()\n"
10299 "posix_trace_get_filter()\n"
10300 "posix_trace_get_status()\n"
10301 "posix_trace_getnext_event()\n"
10302 "posix_trace_open()\n"
10303 "posix_trace_rewind()\n"
10304 "posix_trace_set_filter()\n"
10305 "posix_trace_shutdown()\n"
10306 "posix_trace_timedgetnext_event()\n"
10307 "posix_typed_mem_open()\n"
10308 "printf()\n"
10309 "psiginfo() [POSIX.1-2008 で追加された]\n"
10310 "psignal() [POSIX.1-2008 で追加された]\n"
10311 "pthread_rwlock_rdlock()\n"
10312 "pthread_rwlock_timedrdlock()\n"
10313 "pthread_rwlock_timedwrlock()\n"
10314 "pthread_rwlock_wrlock()\n"
10315 "putc()\n"
10316 "putc_unlocked()\n"
10317 "putchar()\n"
10318 "putchar_unlocked()\n"
10319 "puts()\n"
10320 "pututxline()\n"
10321 "putwc()\n"
10322 "putwchar()\n"
10323 "readdir()\n"
10324 "readdir_r()\n"
10325 "readlink() [POSIX.1-2008 で追加された]\n"
10326 "readlinkat() [POSIX.1-2008 で追加された]\n"
10327 "remove()\n"
10328 "rename()\n"
10329 "renameat() [POSIX.1-2008 で追加された]\n"
10330 "rewind()\n"
10331 "rewinddir()\n"
10332 "scandir() [POSIX.1-2008 で追加された]\n"
10333 "scanf()\n"
10334 "seekdir()\n"
10335 "semop()\n"
10336 "setgrent()\n"
10337 "sethostent()\n"
10338 "setnetent()\n"
10339 "setprotoent()\n"
10340 "setpwent()\n"
10341 "setservent()\n"
10342 "setutxent()\n"
10343 "sigpause() [POSIX.1-2008 で追加された]\n"
10344 "stat()\n"
10345 "strerror()\n"
10346 "strerror_r()\n"
10347 "strftime()\n"
10348 "symlink()\n"
10349 "symlinkat() [POSIX.1-2008 で追加された]\n"
10350 "sync()\n"
10351 "syslog()\n"
10352 "tmpfile()\n"
10353 "tmpnam()\n"
10354 "ttyname()\n"
10355 "ttyname_r()\n"
10356 "tzset()\n"
10357 "ungetc()\n"
10358 "ungetwc()\n"
10359 "unlink()\n"
10360 "unlinkat() [POSIX.1-2008 で追加された]\n"
10361 "utime() [POSIX.1-2008 で追加された]\n"
10362 "utimensat() [POSIX.1-2008 で追加された]\n"
10363 "utimes() [POSIX.1-2008 で追加された]\n"
10364 "vdprintf() [POSIX.1-2008 で追加された]\n"
10365 "vfprintf()\n"
10366 "vfwprintf()\n"
10367 "vprintf()\n"
10368 "vwprintf()\n"
10369 "wcsftime()\n"
10370 "wordexp()\n"
10371 "wprintf()\n"
10372 "wscanf()\n"
10373
10374 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
10375 #.  files, it looks as though at least the following nonstandard
10376 #.  functions are cancellation points:
10377 #.  endnetgrent
10378 #.  endspent
10379 #.  epoll_pwait
10380 #.  epoll_wait
10381 #.  fcloseall
10382 #.  fdopendir
10383 #.  fflush_unlocked
10384 #.  fgetc_unlocked
10385 #.  fgetgrent
10386 #.  fgetgrent_r
10387 #.  fgetpwent
10388 #.  fgetpwent_r
10389 #.  fgets_unlocked
10390 #.  fgetspent
10391 #.  fgetspent_r
10392 #.  fgetwc_unlocked
10393 #.  fgetws_unlocked
10394 #.  fputc_unlocked
10395 #.  fputs_unlocked
10396 #.  fputwc_unlocked
10397 #.  fputws_unlocked
10398 #.  fread_unlocked
10399 #.  fwrite_unlocked
10400 #.  gai_suspend
10401 #.  getaddrinfo_a
10402 #.  getdate_r
10403 #.  getgrent_r
10404 #.  getgrouplist
10405 #.  gethostbyaddr_r
10406 #.  gethostbyname2
10407 #.  gethostbyname2_r
10408 #.  gethostbyname_r
10409 #.  gethostent_r
10410 #.  getnetbyaddr_r
10411 #.  getnetbyname_r
10412 #.  getnetent_r
10413 #.  getnetgrent
10414 #.  getnetgrent_r
10415 #.  getprotobyname_r
10416 #.  getprotobynumber_r
10417 #.  getprotoent_r
10418 #.  getpw
10419 #.  getpwent_r
10420 #.  getservbyname_r
10421 #.  getservbyport_r
10422 #.  getservent_r
10423 #.  getspent
10424 #.  getspent_r
10425 #.  getspnam
10426 #.  getspnam_r
10427 #.  getutmp
10428 #.  getutmpx
10429 #.  getw
10430 #.  getwc_unlocked
10431 #.  getwchar_unlocked
10432 #.  initgroups
10433 #.  innetgr
10434 #.  mkostemp
10435 #.  mkostemp64
10436 #.  mkstemp64
10437 #.  ppoll
10438 #.  pthread_timedjoin_np
10439 #.  putgrent
10440 #.  putpwent
10441 #.  putspent
10442 #.  putw
10443 #.  putwc_unlocked
10444 #.  putwchar_unlocked
10445 #.  rcmd
10446 #.  rcmd_af
10447 #.  rexec
10448 #.  rexec_af
10449 #.  rresvport
10450 #.  rresvport_af
10451 #.  ruserok
10452 #.  ruserok_af
10453 #.  setnetgrent
10454 #.  setspent
10455 #.  sgetspent
10456 #.  sgetspent_r
10457 #.  updwtmpx
10458 #.  utmpxname
10459 #.  vfscanf
10460 #.  vfwscanf
10461 #.  vscanf
10462 #.  vsyslog
10463 #.  vwscanf
10464 #. type: Plain text
10465 #: build/C/man7/pthreads.7:653
10466 msgid ""
10467 "An implementation may also mark other functions not specified in the "
10468 "standard as cancellation points.  In particular, an implementation is likely "
10469 "to mark any nonstandard function that may block as a cancellation point.  "
10470 "(This includes most functions that can touch files.)"
10471 msgstr ""
10472 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
10473 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
10474 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
10475 "関数がこれに含まれる)。"
10476
10477 #. type: SS
10478 #: build/C/man7/pthreads.7:653
10479 #, no-wrap
10480 msgid "Compiling on Linux"
10481 msgstr "Linux でのコンパイル"
10482
10483 #. type: Plain text
10484 #: build/C/man7/pthreads.7:656
10485 msgid ""
10486 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
10487 "pthread>."
10488 msgstr ""
10489 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
10490 "きである。"
10491
10492 #. type: SS
10493 #: build/C/man7/pthreads.7:656
10494 #, no-wrap
10495 msgid "Linux Implementations of POSIX Threads"
10496 msgstr "POSIX スレッドの Linux での実装"
10497
10498 #. type: Plain text
10499 #: build/C/man7/pthreads.7:659
10500 msgid ""
10501 "Over time, two threading implementations have been provided by the GNU C "
10502 "library on Linux:"
10503 msgstr ""
10504 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
10505 "た。"
10506
10507 #. type: TP
10508 #: build/C/man7/pthreads.7:659
10509 #, no-wrap
10510 msgid "B<LinuxThreads>"
10511 msgstr "B<LinuxThreads>"
10512
10513 #. type: Plain text
10514 #: build/C/man7/pthreads.7:663
10515 msgid ""
10516 "This is the original Pthreads implementation.  Since glibc 2.4, this "
10517 "implementation is no longer supported."
10518 msgstr ""
10519 "最初の Pthreads の実装。\n"
10520 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
10521
10522 #. type: TP
10523 #: build/C/man7/pthreads.7:663
10524 #, no-wrap
10525 msgid "B<NPTL> (Native POSIX Threads Library)"
10526 msgstr "B<NPTL> (Native POSIX Threads Library)"
10527
10528 #. type: Plain text
10529 #: build/C/man7/pthreads.7:671
10530 msgid ""
10531 "This is the modern Pthreads implementation.  By comparison with "
10532 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
10533 "POSIX.1 specification and better performance when creating large numbers of "
10534 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
10535 "are present in the Linux 2.6 kernel."
10536 msgstr ""
10537 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
10538 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
10539 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
10540 "装されている機能が必要である。"
10541
10542 #. type: Plain text
10543 #: build/C/man7/pthreads.7:681
10544 msgid ""
10545 "Both of these are so-called 1:1 implementations, meaning that each thread "
10546 "maps to a kernel scheduling entity.  Both threading implementations employ "
10547 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
10548 "primitives (mutexes, thread joining, and so on) are implemented using the "
10549 "Linux B<futex>(2)  system call."
10550 msgstr ""
10551 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
10552 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
10553 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
10554 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
10555 "使って実装されている。"
10556
10557 #. type: SS
10558 #: build/C/man7/pthreads.7:681
10559 #, no-wrap
10560 msgid "LinuxThreads"
10561 msgstr "LinuxThreads"
10562
10563 #. type: Plain text
10564 #: build/C/man7/pthreads.7:683
10565 msgid "The notable features of this implementation are the following:"
10566 msgstr "この実装の大きな特徴は以下の通りである:"
10567
10568 #. type: Plain text
10569 #: build/C/man7/pthreads.7:690
10570 msgid ""
10571 "In addition to the main (initial) thread, and the threads that the program "
10572 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
10573 "thread.  This thread handles thread creation and termination.  (Problems can "
10574 "result if this thread is inadvertently killed.)"
10575 msgstr ""
10576 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
10577 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
10578 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
10579 "kill されると、問題が起こることがある)。"
10580
10581 #. type: Plain text
10582 #: build/C/man7/pthreads.7:702
10583 msgid ""
10584 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
10585 "the first three real-time signals are used (see also B<signal>(7)).  On "
10586 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
10587 "avoid the use of whichever set of signals is employed by the implementation."
10588 msgstr ""
10589 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
10590 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
10591 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
10592 "用されているシグナルを どれも使わないようにしなければならない。"
10593
10594 #. type: Plain text
10595 #: build/C/man7/pthreads.7:709
10596 msgid ""
10597 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
10598 "implemented as processes which share more information than usual, but which "
10599 "do not share a common process ID.)  LinuxThreads threads (including the "
10600 "manager thread)  are visible as separate processes using B<ps>(1)."
10601 msgstr ""
10602 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
10603 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
10604 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
10605 "を使うと別のプロセスのように見える。"
10606
10607 #. type: Plain text
10608 #: build/C/man7/pthreads.7:712
10609 msgid ""
10610 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
10611 "number of ways, including the following:"
10612 msgstr ""
10613 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
10614 "示すような点がある:"
10615
10616 #. type: Plain text
10617 #: build/C/man7/pthreads.7:716
10618 msgid "Calls to B<getpid>(2)  return a different value in each thread."
10619 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
10620
10621 #. type: Plain text
10622 #: build/C/man7/pthreads.7:725
10623 msgid ""
10624 "Calls to B<getppid>(2)  in threads other than the main thread return the "
10625 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
10626 "should return the same value as B<getppid>(2)  in the main thread."
10627 msgstr ""
10628 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
10629 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
10630 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
10631
10632 #. type: Plain text
10633 #: build/C/man7/pthreads.7:735
10634 msgid ""
10635 "When one thread creates a new child process using B<fork>(2), any thread "
10636 "should be able to B<wait>(2)  on the child.  However, the implementation "
10637 "only allows the thread that created the child to B<wait>(2)  on it."
10638 msgstr ""
10639 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
10640 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
10641 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
10642 "る。"
10643
10644 #. type: Plain text
10645 #: build/C/man7/pthreads.7:742
10646 msgid ""
10647 "When a thread calls B<execve>(2), all other threads are terminated (as "
10648 "required by POSIX.1).  However, the resulting process has the same PID as "
10649 "the thread that called B<execve>(2): it should have the same PID as the main "
10650 "thread."
10651 msgstr ""
10652 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
10653 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
10654 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
10655 "る。"
10656
10657 #. type: Plain text
10658 #: build/C/man7/pthreads.7:749
10659 msgid ""
10660 "Threads do not share user and group IDs.  This can cause complications with "
10661 "set-user-ID programs and can cause failures in Pthreads functions if an "
10662 "application changes its credentials using B<seteuid>(2)  or similar."
10663 msgstr ""
10664 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
10665 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使っ"
10666 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
10667
10668 #. type: Plain text
10669 #: build/C/man7/pthreads.7:751
10670 msgid "Threads do not share a common session ID and process group ID."
10671 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
10672
10673 #. type: Plain text
10674 #: build/C/man7/pthreads.7:754
10675 msgid "Threads do not share record locks created using B<fcntl>(2)."
10676 msgstr ""
10677 "スレッド間で B<fcntl>(2)  を使って作成されるレコード・ロックを共有しない。"
10678
10679 #. type: Plain text
10680 #: build/C/man7/pthreads.7:760
10681 msgid ""
10682 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
10683 "rather than process-wide."
10684 msgstr ""
10685 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
10686 "単位の情報である。"
10687
10688 #. type: Plain text
10689 #: build/C/man7/pthreads.7:763
10690 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
10691 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
10692
10693 #. type: Plain text
10694 #: build/C/man7/pthreads.7:765
10695 msgid "Threads do not share interval timers."
10696 msgstr "スレッド間でインターバル・タイマを共有しない。"
10697
10698 #.  FIXME . bug report filed for NPTL nice nonconformance
10699 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
10700 #.  Sep 08: there is a patch by Denys Vlasenko to address this
10701 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
10702 #.  Monitor this to see if it makes it into mainline.
10703 #. type: Plain text
10704 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
10705 msgid "Threads do not share a common nice value."
10706 msgstr "スレッドは共通の nice 値を共有しない。"
10707
10708 #. type: Plain text
10709 #: build/C/man7/pthreads.7:777
10710 msgid ""
10711 "POSIX.1 distinguishes the notions of signals that are directed to the "
10712 "process as a whole and signals that are directed to individual threads.  "
10713 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
10714 "example) should be handled by a single, arbitrarily selected thread within "
10715 "the process.  LinuxThreads does not support the notion of process-directed "
10716 "signals: signals may only be sent to specific threads."
10717 msgstr ""
10718 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
10719 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
10720 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
10721 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
10722 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
10723 "ルは特定のスレッドにだけ送ることができる。"
10724
10725 #. type: Plain text
10726 #: build/C/man7/pthreads.7:786
10727 msgid ""
10728 "Threads have distinct alternate signal stack settings.  However, a new "
10729 "thread's alternate signal stack settings are copied from the thread that "
10730 "created it, so that the threads initially share an alternate signal stack.  "
10731 "(A new thread should start with no alternate signal stack defined.  If two "
10732 "threads handle signals on their shared alternate signal stack at the same "
10733 "time, unpredictable program failures are likely to occur.)"
10734 msgstr ""
10735 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
10736 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
10737 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
10738 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
10739 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
10740 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
10741
10742 #. type: SS
10743 #: build/C/man7/pthreads.7:786
10744 #, no-wrap
10745 msgid "NPTL"
10746 msgstr "NPTL"
10747
10748 #. type: Plain text
10749 #: build/C/man7/pthreads.7:795
10750 msgid ""
10751 "With NPTL, all of the threads in a process are placed in the same thread "
10752 "group; all members of a thread group share the same PID.  NPTL does not "
10753 "employ a manager thread.  NPTL makes internal use of the first two real-time "
10754 "signals (see also B<signal>(7)); these signals cannot be used in "
10755 "applications."
10756 msgstr ""
10757 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
10758 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
10759 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
10760 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
10761 "ションでは使用できない。"
10762
10763 #. type: Plain text
10764 #: build/C/man7/pthreads.7:797
10765 msgid "NPTL still has at least one nonconformance with POSIX.1:"
10766 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
10767
10768 #. type: Plain text
10769 #: build/C/man7/pthreads.7:806
10770 msgid "Some NPTL nonconformances only occur with older kernels:"
10771 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
10772
10773 #. type: Plain text
10774 #: build/C/man7/pthreads.7:812
10775 msgid ""
10776 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
10777 "rather than process-wide (fixed in kernel 2.6.9)."
10778 msgstr ""
10779 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
10780 "単位の情報である (カーネル 2.6.9 で修正された)。"
10781
10782 #. type: Plain text
10783 #: build/C/man7/pthreads.7:814
10784 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
10785 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
10786
10787 #. type: Plain text
10788 #: build/C/man7/pthreads.7:816
10789 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
10790 msgstr ""
10791 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
10792
10793 #. type: Plain text
10794 #: build/C/man7/pthreads.7:820
10795 msgid ""
10796 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
10797 "(fixed in kernel 2.6.16)."
10798 msgstr ""
10799 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
10800 "きる (カーネル 2.6.16 で修正された)。"
10801
10802 #. type: Plain text
10803 #: build/C/man7/pthreads.7:825
10804 msgid ""
10805 "Only the main thread is permitted to make the process into a process group "
10806 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
10807 msgstr ""
10808 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセス・グルー"
10809 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
10810
10811 #. type: Plain text
10812 #: build/C/man7/pthreads.7:831
10813 msgid ""
10814 "Threads have distinct alternate signal stack settings.  However, a new "
10815 "thread's alternate signal stack settings are copied from the thread that "
10816 "created it, so that the threads initially share an alternate signal stack "
10817 "(fixed in kernel 2.6.16)."
10818 msgstr ""
10819 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
10820 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
10821 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
10822 "ル 2.6.16 で修正された)。"
10823
10824 #. type: Plain text
10825 #: build/C/man7/pthreads.7:833
10826 msgid "Note the following further points about the NPTL implementation:"
10827 msgstr "NPTL の実装では以下の点についても注意すること:"
10828
10829 #. type: Plain text
10830 #: build/C/man7/pthreads.7:847
10831 msgid ""
10832 "If the stack size soft resource limit (see the description of "
10833 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
10834 "I<unlimited>, then this value defines the default stack size for new "
10835 "threads.  To be effective, this limit must be set before the program is "
10836 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
10837 "stacksize> in the C shell)."
10838 msgstr ""
10839 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2)  の "
10840 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
10841 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
10842 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
10843 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
10844 "は I<limit stacksize>)  を使って設定する。"
10845
10846 #. type: SS
10847 #: build/C/man7/pthreads.7:847
10848 #, no-wrap
10849 msgid "Determining the Threading Implementation"
10850 msgstr "スレッド実装の判定"
10851
10852 #. type: Plain text
10853 #: build/C/man7/pthreads.7:852
10854 msgid ""
10855 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
10856 "system's threading implementation, for example:"
10857 msgstr ""
10858 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
10859 "装を判定することができる。 以下に例を示す:"
10860
10861 #. type: Plain text
10862 #: build/C/man7/pthreads.7:857
10863 #, no-wrap
10864 msgid ""
10865 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
10866 "NPTL 2.3.4\n"
10867 msgstr ""
10868 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
10869 "NPTL 2.3.4\n"
10870
10871 #. type: Plain text
10872 #: build/C/man7/pthreads.7:862
10873 msgid ""
10874 "With older glibc versions, a command such as the following should be "
10875 "sufficient to determine the default threading implementation:"
10876 msgstr ""
10877 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
10878 "ド実装を判定することができる。"
10879
10880 #. type: Plain text
10881 #: build/C/man7/pthreads.7:868
10882 #, no-wrap
10883 msgid ""
10884 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
10885 "                egrep -i \\(aqthreads|nptl\\(aq\n"
10886 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
10887 msgstr ""
10888 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
10889 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
10890 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
10891
10892 #. type: SS
10893 #: build/C/man7/pthreads.7:870
10894 #, no-wrap
10895 msgid "Selecting the Threading Implementation: LD_ASSUME_KERNEL"
10896 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
10897
10898 #. type: Plain text
10899 #: build/C/man7/pthreads.7:885
10900 msgid ""
10901 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
10902 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
10903 "override the dynamic linker's default choice of threading implementation.  "
10904 "This variable tells the dynamic linker to assume that it is running on top "
10905 "of a particular kernel version.  By specifying a kernel version that does "
10906 "not provide the support required by NPTL, we can force the use of "
10907 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
10908 "application that depends on some nonconformant behavior in LinuxThreads.)  "
10909 "For example:"
10910 msgstr ""
10911 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
10912 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
10913 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
10914 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
10915 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
10916 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
10917 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
10918 "ン を動作させる場合だろう)。 以下に例を示す:"
10919
10920 #. type: Plain text
10921 #: build/C/man7/pthreads.7:891
10922 #, no-wrap
10923 msgid ""
10924 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
10925 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
10926 "        linuxthreads-0.10 by Xavier Leroy\n"
10927 msgstr ""
10928 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
10929 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
10930 "        linuxthreads-0.10 by Xavier Leroy\n"
10931
10932 #. type: Plain text
10933 #: build/C/man7/pthreads.7:903
10934 msgid ""
10935 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), B<sigevent>"
10936 "(7), B<signal>(7),"
10937 msgstr ""
10938 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
10939 "B<signal>(7),"
10940
10941 #. type: Plain text
10942 #: build/C/man7/pthreads.7:927
10943 msgid ""
10944 "and various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
10945 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
10946 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
10947 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
10948 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
10949 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>"
10950 "(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), "
10951 "B<pthread_sigmask>(3), B<pthread_sigqueue>(3), and B<pthread_testcancel>(3)"
10952 msgstr ""
10953 "および Pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
10954 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
10955 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
10956 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
10957 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
10958 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
10959 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
10960 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
10961 "and B<pthread_testcancel>(3)"