OSDN Git Service

Translation snapshot for LDP v3.76
[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: 2015-01-04 23:49+0900\n"
10 "PO-Revision-Date: 2015-01-05 07:49+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man3/getcontext.3:25
20 #, no-wrap
21 msgid "GETCONTEXT"
22 msgstr "GETCONTEXT"
23
24 #. type: TH
25 #: build/C/man3/getcontext.3:25
26 #, no-wrap
27 msgid "2014-04-08"
28 msgstr "2014-04-08"
29
30 #. type: TH
31 #: build/C/man3/getcontext.3:25 build/C/man3/pthread_attr_init.3:26
32 #: build/C/man3/pthread_attr_setaffinity_np.3:26
33 #: build/C/man3/pthread_attr_setdetachstate.3:26
34 #: build/C/man3/pthread_attr_setguardsize.3:26
35 #: build/C/man3/pthread_attr_setinheritsched.3:26
36 #: build/C/man3/pthread_attr_setschedparam.3:26
37 #: build/C/man3/pthread_attr_setschedpolicy.3:26
38 #: build/C/man3/pthread_attr_setscope.3:26
39 #: build/C/man3/pthread_attr_setstack.3:26
40 #: build/C/man3/pthread_attr_setstackaddr.3:26
41 #: build/C/man3/pthread_attr_setstacksize.3:26
42 #: build/C/man3/pthread_cancel.3:26 build/C/man3/pthread_cleanup_push.3:26
43 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
44 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_detach.3:26
45 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
46 #: build/C/man3/pthread_getattr_np.3:26
47 #: build/C/man3/pthread_getcpuclockid.3:26 build/C/man3/pthread_join.3:26
48 #: build/C/man3/pthread_kill.3:26
49 #: build/C/man3/pthread_kill_other_threads_np.3:26
50 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setaffinity_np.3:26
51 #: build/C/man3/pthread_setcancelstate.3:26
52 #: build/C/man3/pthread_setconcurrency.3:25
53 #: build/C/man3/pthread_setname_np.3:26
54 #: build/C/man3/pthread_setschedparam.3:26
55 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigmask.3:26
56 #: build/C/man3/pthread_sigqueue.3:25 build/C/man3/pthread_testcancel.3:26
57 #: build/C/man3/pthread_tryjoin_np.3:26 build/C/man3/pthread_yield.3:25
58 #: build/C/man7/pthreads.7:26
59 #, no-wrap
60 msgid "Linux"
61 msgstr "Linux"
62
63 #. type: TH
64 #: build/C/man3/getcontext.3:25 build/C/man3/makecontext.3:28
65 #: build/C/man3/pthread_attr_init.3:26
66 #: build/C/man3/pthread_attr_setaffinity_np.3:26
67 #: build/C/man3/pthread_attr_setdetachstate.3:26
68 #: build/C/man3/pthread_attr_setguardsize.3:26
69 #: build/C/man3/pthread_attr_setinheritsched.3:26
70 #: build/C/man3/pthread_attr_setschedparam.3:26
71 #: build/C/man3/pthread_attr_setschedpolicy.3:26
72 #: build/C/man3/pthread_attr_setscope.3:26
73 #: build/C/man3/pthread_attr_setstack.3:26
74 #: build/C/man3/pthread_attr_setstackaddr.3:26
75 #: build/C/man3/pthread_attr_setstacksize.3:26
76 #: build/C/man3/pthread_cancel.3:26 build/C/man3/pthread_cleanup_push.3:26
77 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
78 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_detach.3:26
79 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
80 #: build/C/man3/pthread_getattr_np.3:26
81 #: build/C/man3/pthread_getcpuclockid.3:26 build/C/man3/pthread_join.3:26
82 #: build/C/man3/pthread_kill.3:26
83 #: build/C/man3/pthread_kill_other_threads_np.3:26
84 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
85 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setaffinity_np.3:26
86 #: build/C/man3/pthread_setcancelstate.3:26
87 #: build/C/man3/pthread_setconcurrency.3:25
88 #: build/C/man3/pthread_setname_np.3:26
89 #: build/C/man3/pthread_setschedparam.3:26
90 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigmask.3:26
91 #: build/C/man3/pthread_sigqueue.3:25 build/C/man3/pthread_testcancel.3:26
92 #: build/C/man3/pthread_tryjoin_np.3:26 build/C/man3/pthread_yield.3:25
93 #: build/C/man7/pthreads.7:26
94 #, no-wrap
95 msgid "Linux Programmer's Manual"
96 msgstr "Linux Programmer's Manual"
97
98 #. type: SH
99 #: build/C/man3/getcontext.3:26 build/C/man3/makecontext.3:29
100 #: build/C/man3/pthread_attr_init.3:27
101 #: build/C/man3/pthread_attr_setaffinity_np.3:27
102 #: build/C/man3/pthread_attr_setdetachstate.3:27
103 #: build/C/man3/pthread_attr_setguardsize.3:27
104 #: build/C/man3/pthread_attr_setinheritsched.3:27
105 #: build/C/man3/pthread_attr_setschedparam.3:27
106 #: build/C/man3/pthread_attr_setschedpolicy.3:27
107 #: build/C/man3/pthread_attr_setscope.3:27
108 #: build/C/man3/pthread_attr_setstack.3:27
109 #: build/C/man3/pthread_attr_setstackaddr.3:27
110 #: build/C/man3/pthread_attr_setstacksize.3:27
111 #: build/C/man3/pthread_cancel.3:27 build/C/man3/pthread_cleanup_push.3:27
112 #: build/C/man3/pthread_cleanup_push_defer_np.3:27
113 #: build/C/man3/pthread_create.3:27 build/C/man3/pthread_detach.3:27
114 #: build/C/man3/pthread_equal.3:27 build/C/man3/pthread_exit.3:27
115 #: build/C/man3/pthread_getattr_np.3:27
116 #: build/C/man3/pthread_getcpuclockid.3:27 build/C/man3/pthread_join.3:27
117 #: build/C/man3/pthread_kill.3:27
118 #: build/C/man3/pthread_kill_other_threads_np.3:27
119 #: build/C/man3/pthread_rwlockattr_setkind_np.3:26
120 #: build/C/man3/pthread_self.3:27 build/C/man3/pthread_setaffinity_np.3:27
121 #: build/C/man3/pthread_setcancelstate.3:27
122 #: build/C/man3/pthread_setconcurrency.3:26
123 #: build/C/man3/pthread_setname_np.3:27
124 #: build/C/man3/pthread_setschedparam.3:27
125 #: build/C/man3/pthread_setschedprio.3:27 build/C/man3/pthread_sigmask.3:27
126 #: build/C/man3/pthread_sigqueue.3:26 build/C/man3/pthread_testcancel.3:27
127 #: build/C/man3/pthread_tryjoin_np.3:27 build/C/man3/pthread_yield.3:26
128 #: build/C/man7/pthreads.7:27
129 #, no-wrap
130 msgid "NAME"
131 msgstr "名前"
132
133 #. type: Plain text
134 #: build/C/man3/getcontext.3:28
135 msgid "getcontext, setcontext - get or set the user context"
136 msgstr "getcontext, setcontext - ユーザコンテキストを取得/設定する"
137
138 #. type: SH
139 #: build/C/man3/getcontext.3:28 build/C/man3/makecontext.3:31
140 #: build/C/man3/pthread_attr_init.3:30
141 #: build/C/man3/pthread_attr_setaffinity_np.3:30
142 #: build/C/man3/pthread_attr_setdetachstate.3:30
143 #: build/C/man3/pthread_attr_setguardsize.3:30
144 #: build/C/man3/pthread_attr_setinheritsched.3:30
145 #: build/C/man3/pthread_attr_setschedparam.3:30
146 #: build/C/man3/pthread_attr_setschedpolicy.3:30
147 #: build/C/man3/pthread_attr_setscope.3:30
148 #: build/C/man3/pthread_attr_setstack.3:30
149 #: build/C/man3/pthread_attr_setstackaddr.3:30
150 #: build/C/man3/pthread_attr_setstacksize.3:30
151 #: build/C/man3/pthread_cancel.3:29 build/C/man3/pthread_cleanup_push.3:30
152 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
153 #: build/C/man3/pthread_create.3:29 build/C/man3/pthread_detach.3:29
154 #: build/C/man3/pthread_equal.3:29 build/C/man3/pthread_exit.3:29
155 #: build/C/man3/pthread_getattr_np.3:29
156 #: build/C/man3/pthread_getcpuclockid.3:29 build/C/man3/pthread_join.3:29
157 #: build/C/man3/pthread_kill.3:29
158 #: build/C/man3/pthread_kill_other_threads_np.3:29
159 #: build/C/man3/pthread_rwlockattr_setkind_np.3:29
160 #: build/C/man3/pthread_self.3:29 build/C/man3/pthread_setaffinity_np.3:30
161 #: build/C/man3/pthread_setcancelstate.3:30
162 #: build/C/man3/pthread_setconcurrency.3:29
163 #: build/C/man3/pthread_setname_np.3:29
164 #: build/C/man3/pthread_setschedparam.3:30
165 #: build/C/man3/pthread_setschedprio.3:29 build/C/man3/pthread_sigmask.3:29
166 #: build/C/man3/pthread_sigqueue.3:28 build/C/man3/pthread_testcancel.3:29
167 #: build/C/man3/pthread_tryjoin_np.3:30 build/C/man3/pthread_yield.3:28
168 #, no-wrap
169 msgid "SYNOPSIS"
170 msgstr "書式"
171
172 #. type: Plain text
173 #: build/C/man3/getcontext.3:30 build/C/man3/makecontext.3:33
174 msgid "B<#include E<lt>ucontext.hE<gt>>"
175 msgstr "B<#include E<lt>ucontext.hE<gt>>"
176
177 #. type: Plain text
178 #: build/C/man3/getcontext.3:32
179 msgid "B<int getcontext(ucontext_t *>I<ucp>B<);>"
180 msgstr "B<int getcontext(ucontext_t *>I<ucp>B<);>"
181
182 #. type: Plain text
183 #: build/C/man3/getcontext.3:34
184 msgid "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
185 msgstr "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
186
187 #. type: SH
188 #: build/C/man3/getcontext.3:34 build/C/man3/makecontext.3:38
189 #: build/C/man3/pthread_attr_init.3:39
190 #: build/C/man3/pthread_attr_setaffinity_np.3:42
191 #: build/C/man3/pthread_attr_setdetachstate.3:41
192 #: build/C/man3/pthread_attr_setguardsize.3:41
193 #: build/C/man3/pthread_attr_setinheritsched.3:41
194 #: build/C/man3/pthread_attr_setschedparam.3:41
195 #: build/C/man3/pthread_attr_setschedpolicy.3:41
196 #: build/C/man3/pthread_attr_setscope.3:41
197 #: build/C/man3/pthread_attr_setstack.3:54
198 #: build/C/man3/pthread_attr_setstackaddr.3:41
199 #: build/C/man3/pthread_attr_setstacksize.3:41
200 #: build/C/man3/pthread_cancel.3:37 build/C/man3/pthread_cleanup_push.3:40
201 #: build/C/man3/pthread_cleanup_push_defer_np.3:53
202 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
203 #: build/C/man3/pthread_equal.3:37 build/C/man3/pthread_exit.3:37
204 #: build/C/man3/pthread_getattr_np.3:38
205 #: build/C/man3/pthread_getcpuclockid.3:38 build/C/man3/pthread_join.3:37
206 #: build/C/man3/pthread_kill.3:49
207 #: build/C/man3/pthread_kill_other_threads_np.3:35
208 #: build/C/man3/pthread_rwlockattr_setkind_np.3:54
209 #: build/C/man3/pthread_self.3:37 build/C/man3/pthread_setaffinity_np.3:42
210 #: build/C/man3/pthread_setcancelstate.3:39
211 #: build/C/man3/pthread_setconcurrency.3:38
212 #: build/C/man3/pthread_setname_np.3:39
213 #: build/C/man3/pthread_setschedparam.3:41
214 #: build/C/man3/pthread_setschedprio.3:37 build/C/man3/pthread_sigmask.3:50
215 #: build/C/man3/pthread_sigqueue.3:46 build/C/man3/pthread_testcancel.3:37
216 #: build/C/man3/pthread_tryjoin_np.3:42 build/C/man3/pthread_yield.3:37
217 #: build/C/man7/pthreads.7:29
218 #, no-wrap
219 msgid "DESCRIPTION"
220 msgstr "説明"
221
222 #. type: Plain text
223 #: build/C/man3/getcontext.3:49
224 msgid ""
225 "In a System V-like environment, one has the two types I<mcontext_t> and "
226 "I<ucontext_t> defined in I<E<lt>ucontext.hE<gt>> and the four functions "
227 "B<getcontext>(), B<setcontext>(), B<makecontext>(3), and B<swapcontext>(3)  "
228 "that allow user-level context switching between multiple threads of control "
229 "within a process."
230 msgstr ""
231 "System V 的な環境では、 I<mcontext_t> および I<ucontext_t> という 2 つの型"
232 "と、 B<getcontext>(), B<setcontext>(), B<makecontext>(3), B<swapcontext>(3)  "
233 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
234 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
235 "ようになっている。"
236
237 #. type: Plain text
238 #: build/C/man3/getcontext.3:57
239 msgid ""
240 "The I<mcontext_t> type is machine-dependent and opaque.  The I<ucontext_t> "
241 "type is a structure that has at least the following fields:"
242 msgstr ""
243 "I<mcontext_t> 型はマシン依存で、外部からは隠蔽されている。 I<ucontext_t> 型は"
244 "構造体で、少なくとも以下の 4 つのフィールドを持つ。"
245
246 #. type: Plain text
247 #: build/C/man3/getcontext.3:67
248 #, no-wrap
249 msgid ""
250 "typedef struct ucontext {\n"
251 "    struct ucontext *uc_link;\n"
252 "    sigset_t         uc_sigmask;\n"
253 "    stack_t          uc_stack;\n"
254 "    mcontext_t       uc_mcontext;\n"
255 "    ...\n"
256 "} ucontext_t;\n"
257 msgstr ""
258 "typedef struct ucontext {\n"
259 "    struct ucontext *uc_link;\n"
260 "    sigset_t         uc_sigmask;\n"
261 "    stack_t          uc_stack;\n"
262 "    mcontext_t       uc_mcontext;\n"
263 "    ...\n"
264 "} ucontext_t;\n"
265
266 #. type: Plain text
267 #: build/C/man3/getcontext.3:94
268 msgid ""
269 "with I<sigset_t> and I<stack_t> defined in I<E<lt>signal.hE<gt>>.  Here "
270 "I<uc_link> points to the context that will be resumed when the current "
271 "context terminates (in case the current context was created using "
272 "B<makecontext>(3)), I<uc_sigmask> is the set of signals blocked in this "
273 "context (see B<sigprocmask>(2)), I<uc_stack> is the stack used by this "
274 "context (see B<sigaltstack>(2)), and I<uc_mcontext> is the machine-specific "
275 "representation of the saved context, that includes the calling thread's "
276 "machine registers."
277 msgstr ""
278 "I<sigset_t> と I<stack_t> は I<E<lt>signal.hE<gt>> で定義されている。 ここで "
279 "I<uc_link> は、 現在のコンテキストが終了したとき、 続いて切り替わるコンテキス"
280 "トへのポインタである (現在のコンテキストが B<makecontext>(3)  で生成されたも"
281 "のの場合)。 I<uc_sigmask> はこのコンテキストでブロックされている シグナル群で"
282 "ある (B<sigprocmask>(2)  を見よ)。 I<uc_stack> はこのコンテキストが用いている"
283 "スタックである (B<signalstack>(2)  を見よ)。 I<uc_mcontext> は保存されている"
284 "コンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマシ"
285 "ンレジスタが格納される。"
286
287 #. type: Plain text
288 #: build/C/man3/getcontext.3:101
289 msgid ""
290 "The function B<getcontext>()  initializes the structure pointed at by I<ucp> "
291 "to the currently active context."
292 msgstr ""
293 "B<getcontext>()  関数は、 ポインタ I<ucp> が指す構造体を、 現在アクティブなコ"
294 "ンテキストに初期化する。"
295
296 #. type: Plain text
297 #: build/C/man3/getcontext.3:114
298 msgid ""
299 "The function B<setcontext>()  restores the user context pointed at by "
300 "I<ucp>.  A successful call does not return.  The context should have been "
301 "obtained by a call of B<getcontext>(), or B<makecontext>(3), or passed as "
302 "third argument to a signal handler."
303 msgstr ""
304 "B<setcontext>()  関数は、ポインタ I<ucp> が指すユーザコンテキストをリストアす"
305 "る。 呼び出しに成功すると返らない。 このコンテキストは、以前に "
306 "B<getcontext>()  または B<makecontext>(3)  で得られたものか、 あるいはシグナ"
307 "ルの第三引数として与えられたものになる。"
308
309 #. type: Plain text
310 #: build/C/man3/getcontext.3:118
311 msgid ""
312 "If the context was obtained by a call of B<getcontext>(), program execution "
313 "continues as if this call just returned."
314 msgstr ""
315 "コンテキストが B<getcontext>()  の呼び出しによって得られていたものの場合は、 "
316 "プログラムはこの呼び出しから返った直後からのように実行を継続する。"
317
318 #. type: Plain text
319 #: build/C/man3/getcontext.3:135
320 msgid ""
321 "If the context was obtained by a call of B<makecontext>(3), program "
322 "execution continues by a call to the function I<func> specified as the "
323 "second argument of that call to B<makecontext>(3).  When the function "
324 "I<func> returns, we continue with the I<uc_link> member of the structure "
325 "I<ucp> specified as the first argument of that call to B<makecontext>(3).  "
326 "When this member is NULL, the thread exits."
327 msgstr ""
328 "コンテキストが B<makecontext>(3)  の呼び出しによって得られていたものの場合"
329 "は、 プログラムの実行はその B<makecontext>(3)  呼び出しの第二引数で指定された"
330 "関数 I<func> を呼び出すかたちで継続する。 I<func> から返ると、 "
331 "B<makecontext>(3)  呼び出しの第一引数で指定されていた I<ucp> 構造体の "
332 "I<uc_link> メンバで継続する。 このメンバが NULL だった場合は、そのスレッドは"
333 "終了する。"
334
335 #. type: Plain text
336 #: build/C/man3/getcontext.3:142
337 msgid ""
338 "If the context was obtained by a call to a signal handler, then old standard "
339 "text says that \"program execution continues with the program instruction "
340 "following the instruction interrupted by the signal\".  However, this "
341 "sentence was removed in SUSv2, and the present verdict is \"the result is "
342 "unspecified\"."
343 msgstr ""
344 "コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 古"
345 "い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命令"
346 "から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結果"
347 "は定義されていない」である。"
348
349 #. type: SH
350 #: build/C/man3/getcontext.3:142 build/C/man3/makecontext.3:84
351 #: build/C/man3/pthread_attr_init.3:68
352 #: build/C/man3/pthread_attr_setaffinity_np.3:76
353 #: build/C/man3/pthread_attr_setdetachstate.3:77
354 #: build/C/man3/pthread_attr_setguardsize.3:90
355 #: build/C/man3/pthread_attr_setinheritsched.3:93
356 #: build/C/man3/pthread_attr_setschedparam.3:85
357 #: build/C/man3/pthread_attr_setschedpolicy.3:83
358 #: build/C/man3/pthread_attr_setscope.3:103
359 #: build/C/man3/pthread_attr_setstack.3:85
360 #: build/C/man3/pthread_attr_setstackaddr.3:74
361 #: build/C/man3/pthread_attr_setstacksize.3:61
362 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_cleanup_push.3:121
363 #: build/C/man3/pthread_create.3:115 build/C/man3/pthread_detach.3:49
364 #: build/C/man3/pthread_equal.3:41 build/C/man3/pthread_exit.3:71
365 #: build/C/man3/pthread_getattr_np.3:73
366 #: build/C/man3/pthread_getcpuclockid.3:46 build/C/man3/pthread_join.3:70
367 #: build/C/man3/pthread_kill.3:63
368 #: build/C/man3/pthread_rwlockattr_setkind_np.3:96
369 #: build/C/man3/pthread_self.3:46 build/C/man3/pthread_setaffinity_np.3:77
370 #: build/C/man3/pthread_setcancelstate.3:92
371 #: build/C/man3/pthread_setconcurrency.3:56
372 #: build/C/man3/pthread_setname_np.3:72
373 #: build/C/man3/pthread_setschedparam.3:104
374 #: build/C/man3/pthread_setschedprio.3:53 build/C/man3/pthread_sigmask.3:61
375 #: build/C/man3/pthread_sigqueue.3:66 build/C/man3/pthread_testcancel.3:50
376 #: build/C/man3/pthread_tryjoin_np.3:85 build/C/man3/pthread_yield.3:44
377 #, no-wrap
378 msgid "RETURN VALUE"
379 msgstr "返り値"
380
381 #. type: Plain text
382 #: build/C/man3/getcontext.3:151
383 msgid ""
384 "When successful, B<getcontext>()  returns 0 and B<setcontext>()  does not "
385 "return.  On error, both return -1 and set I<errno> appropriately."
386 msgstr ""
387 "成功すると、 B<getcontext>()  は 0 を返し、 B<setcontext>()  は返らない。 失"
388 "敗すると、両者とも -1 を返し、I<errno> をエラーに応じて設定する。"
389
390 #. type: SH
391 #: build/C/man3/getcontext.3:151 build/C/man3/makecontext.3:96
392 #: build/C/man3/pthread_attr_init.3:71
393 #: build/C/man3/pthread_attr_setaffinity_np.3:79
394 #: build/C/man3/pthread_attr_setdetachstate.3:80
395 #: build/C/man3/pthread_attr_setguardsize.3:93
396 #: build/C/man3/pthread_attr_setinheritsched.3:96
397 #: build/C/man3/pthread_attr_setschedparam.3:88
398 #: build/C/man3/pthread_attr_setschedpolicy.3:86
399 #: build/C/man3/pthread_attr_setscope.3:106
400 #: build/C/man3/pthread_attr_setstack.3:88
401 #: build/C/man3/pthread_attr_setstackaddr.3:77
402 #: build/C/man3/pthread_attr_setstacksize.3:64
403 #: build/C/man3/pthread_cancel.3:117 build/C/man3/pthread_cleanup_push.3:123
404 #: build/C/man3/pthread_create.3:122 build/C/man3/pthread_detach.3:54
405 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
406 #: build/C/man3/pthread_getattr_np.3:76
407 #: build/C/man3/pthread_getcpuclockid.3:49 build/C/man3/pthread_join.3:75
408 #: build/C/man3/pthread_kill.3:68
409 #: build/C/man3/pthread_rwlockattr_setkind_np.3:104
410 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_setaffinity_np.3:80
411 #: build/C/man3/pthread_setcancelstate.3:95
412 #: build/C/man3/pthread_setconcurrency.3:68
413 #: build/C/man3/pthread_setname_np.3:75
414 #: build/C/man3/pthread_setschedparam.3:112
415 #: build/C/man3/pthread_setschedprio.3:61 build/C/man3/pthread_sigmask.3:66
416 #: build/C/man3/pthread_sigqueue.3:71 build/C/man3/pthread_testcancel.3:54
417 #: build/C/man3/pthread_tryjoin_np.3:89 build/C/man3/pthread_yield.3:49
418 #, no-wrap
419 msgid "ERRORS"
420 msgstr "エラー"
421
422 #. type: Plain text
423 #: build/C/man3/getcontext.3:153
424 msgid "None defined."
425 msgstr "定義されていない。"
426
427 #. type: SH
428 #: build/C/man3/getcontext.3:153 build/C/man3/makecontext.3:105
429 #: build/C/man3/pthread_attr_setdetachstate.3:87
430 #: build/C/man3/pthread_attr_setguardsize.3:106
431 #: build/C/man3/pthread_attr_setinheritsched.3:110
432 #: build/C/man3/pthread_attr_setschedparam.3:100
433 #: build/C/man3/pthread_attr_setschedpolicy.3:100
434 #: build/C/man3/pthread_attr_setscope.3:119
435 #: build/C/man3/pthread_attr_setstack.3:112
436 #: build/C/man3/pthread_attr_setstackaddr.3:83
437 #: build/C/man3/pthread_attr_setstacksize.3:83 build/C/man3/pthread_equal.3:47
438 #: build/C/man3/pthread_exit.3:75 build/C/man3/pthread_getcpuclockid.3:65
439 #: build/C/man3/pthread_kill.3:72
440 #: build/C/man3/pthread_kill_other_threads_np.3:47
441 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_setaffinity_np.3:121
442 #: build/C/man3/pthread_setcancelstate.3:113
443 #: build/C/man3/pthread_setconcurrency.3:83
444 #: build/C/man3/pthread_setschedparam.3:141
445 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:69
446 #: build/C/man3/pthread_sigqueue.3:94 build/C/man3/pthread_testcancel.3:58
447 #: build/C/man3/pthread_yield.3:53
448 #, no-wrap
449 msgid "ATTRIBUTES"
450 msgstr "属性"
451
452 #. type: SS
453 #: build/C/man3/getcontext.3:154 build/C/man3/makecontext.3:106
454 #: build/C/man3/pthread_attr_setdetachstate.3:88
455 #: build/C/man3/pthread_attr_setguardsize.3:107
456 #: build/C/man3/pthread_attr_setinheritsched.3:111
457 #: build/C/man3/pthread_attr_setschedparam.3:101
458 #: build/C/man3/pthread_attr_setschedpolicy.3:101
459 #: build/C/man3/pthread_attr_setscope.3:120
460 #: build/C/man3/pthread_attr_setstack.3:113
461 #: build/C/man3/pthread_attr_setstackaddr.3:84
462 #: build/C/man3/pthread_attr_setstacksize.3:84 build/C/man3/pthread_equal.3:48
463 #: build/C/man3/pthread_exit.3:76 build/C/man3/pthread_getcpuclockid.3:66
464 #: build/C/man3/pthread_kill.3:73
465 #: build/C/man3/pthread_kill_other_threads_np.3:48
466 #: build/C/man3/pthread_self.3:51 build/C/man3/pthread_setaffinity_np.3:122
467 #: build/C/man3/pthread_setcancelstate.3:114
468 #: build/C/man3/pthread_setconcurrency.3:84
469 #: build/C/man3/pthread_setschedparam.3:142
470 #: build/C/man3/pthread_setschedprio.3:84 build/C/man3/pthread_sigmask.3:70
471 #: build/C/man3/pthread_sigqueue.3:95 build/C/man3/pthread_testcancel.3:59
472 #: build/C/man3/pthread_yield.3:54
473 #, no-wrap
474 msgid "Multithreading (see pthreads(7))"
475 msgstr "マルチスレッディング (pthreads(7) 参照)"
476
477 #. type: Plain text
478 #: build/C/man3/getcontext.3:160
479 msgid "The B<getcontext>()  and B<setcontext>()  functions are thread-safe."
480 msgstr "関数 B<getcontext>() と B<setcontext>() はスレッドセーフである。"
481
482 #. type: SH
483 #: build/C/man3/getcontext.3:160 build/C/man3/makecontext.3:112
484 #: build/C/man3/pthread_attr_init.3:79
485 #: build/C/man3/pthread_attr_setaffinity_np.3:108
486 #: build/C/man3/pthread_attr_setdetachstate.3:94
487 #: build/C/man3/pthread_attr_setguardsize.3:113
488 #: build/C/man3/pthread_attr_setinheritsched.3:117
489 #: build/C/man3/pthread_attr_setschedparam.3:107
490 #: build/C/man3/pthread_attr_setschedpolicy.3:107
491 #: build/C/man3/pthread_attr_setscope.3:126
492 #: build/C/man3/pthread_attr_setstack.3:119
493 #: build/C/man3/pthread_attr_setstackaddr.3:90
494 #: build/C/man3/pthread_attr_setstacksize.3:90
495 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_cleanup_push.3:127
496 #: build/C/man3/pthread_cleanup_push_defer_np.3:114
497 #: build/C/man3/pthread_create.3:153 build/C/man3/pthread_detach.3:64
498 #: build/C/man3/pthread_equal.3:52 build/C/man3/pthread_exit.3:80
499 #: build/C/man3/pthread_getattr_np.3:98
500 #: build/C/man3/pthread_getcpuclockid.3:70 build/C/man3/pthread_join.3:98
501 #: build/C/man3/pthread_kill.3:77
502 #: build/C/man3/pthread_kill_other_threads_np.3:52
503 #: build/C/man3/pthread_rwlockattr_setkind_np.3:127
504 #: build/C/man3/pthread_self.3:55 build/C/man3/pthread_setaffinity_np.3:128
505 #: build/C/man3/pthread_setcancelstate.3:120
506 #: build/C/man3/pthread_setconcurrency.3:90
507 #: build/C/man3/pthread_setname_np.3:102
508 #: build/C/man3/pthread_setschedparam.3:148
509 #: build/C/man3/pthread_setschedprio.3:88 build/C/man3/pthread_sigmask.3:74
510 #: build/C/man3/pthread_sigqueue.3:99 build/C/man3/pthread_testcancel.3:63
511 #: build/C/man3/pthread_tryjoin_np.3:112 build/C/man3/pthread_yield.3:58
512 #, no-wrap
513 msgid "CONFORMING TO"
514 msgstr "準拠"
515
516 #. type: Plain text
517 #: build/C/man3/getcontext.3:166
518 msgid ""
519 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specification of "
520 "B<getcontext>(), citing portability issues, and recommending that "
521 "applications be rewritten to use POSIX threads instead."
522 msgstr ""
523 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<getcontext>()  の"
524 "仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直"
525 "すことが 推奨されている。"
526
527 #. type: SH
528 #: build/C/man3/getcontext.3:166 build/C/man3/makecontext.3:120
529 #: build/C/man3/pthread_attr_init.3:81
530 #: build/C/man3/pthread_attr_setaffinity_np.3:111
531 #: build/C/man3/pthread_attr_setdetachstate.3:96
532 #: build/C/man3/pthread_attr_setguardsize.3:115
533 #: build/C/man3/pthread_attr_setschedparam.3:109
534 #: build/C/man3/pthread_attr_setscope.3:128
535 #: build/C/man3/pthread_attr_setstack.3:121
536 #: build/C/man3/pthread_attr_setstackaddr.3:93
537 #: build/C/man3/pthread_attr_setstacksize.3:92
538 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129
539 #: build/C/man3/pthread_create.3:155 build/C/man3/pthread_detach.3:66
540 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82
541 #: build/C/man3/pthread_getcpuclockid.3:72 build/C/man3/pthread_join.3:100
542 #: build/C/man3/pthread_kill.3:79
543 #: build/C/man3/pthread_kill_other_threads_np.3:55
544 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setaffinity_np.3:131
545 #: build/C/man3/pthread_setcancelstate.3:122
546 #: build/C/man3/pthread_setconcurrency.3:92
547 #: build/C/man3/pthread_setname_np.3:104
548 #: build/C/man3/pthread_setschedparam.3:150
549 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
550 #: build/C/man3/pthread_yield.3:64
551 #, no-wrap
552 msgid "NOTES"
553 msgstr "注意"
554
555 #. type: Plain text
556 #: build/C/man3/getcontext.3:183
557 msgid ""
558 "The earliest incarnation of this mechanism was the B<setjmp>(3)/"
559 "B<longjmp>(3)  mechanism.  Since that does not define the handling of the "
560 "signal context, the next stage was the B<sigsetjmp>(3)/B<siglongjmp>(3)  "
561 "pair.  The present mechanism gives much more control.  On the other hand, "
562 "there is no easy way to detect whether a return from B<getcontext>()  is "
563 "from the first call, or via a B<setcontext>()  call.  The user has to invent "
564 "her own bookkeeping device, and a register variable won't do since registers "
565 "are restored."
566 msgstr ""
567 "このメカニズムの最古の実装は、 B<setjmp>(3)/B<longjmp>(3)  機構であった。 こ"
568 "れらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階で"
569 "は B<sigsetjmp>(3)/B<siglongjmp>(3)  のペアが現われた。 現在の機構ではずっと"
570 "細かな制御ができる。 一方 B<getcontext>()  から返ったとき、 これが最初の呼び"
571 "出しであったか、 それとも B<setcontext>()  呼び出しからのものであるかを 区別"
572 "する容易な方法がなくなってしまった。 ユーザは「しおり」機構を自分で作らなけれ"
573 "ばならない。 レジスタ変数は (レジスタはリストアされてしまうので) これをやって"
574 "くれない。"
575
576 #. type: Plain text
577 #: build/C/man3/getcontext.3:194
578 msgid ""
579 "When a signal occurs, the current user context is saved and a new context is "
580 "created by the kernel for the signal handler.  Do not leave the handler "
581 "using B<longjmp>(3): it is undefined what would happen with contexts.  Use "
582 "B<siglongjmp>(3)  or B<setcontext>()  instead."
583 msgstr ""
584 "シグナルが発生すると、 現在のユーザコンテキストは保存され、 シグナルハンドラ"
585 "用のコンテキストがカーネルによって生成される。 今後はハンドラに "
586 "B<longjmp>(3)  を使わせないこと: この関数のコンテキスト下での動作は定義されて"
587 "いない。 代わりに B<siglongjmp>(3)  か B<setcontext>()  を使うこと。"
588
589 #. type: SH
590 #: build/C/man3/getcontext.3:194 build/C/man3/makecontext.3:227
591 #: build/C/man3/pthread_attr_init.3:297
592 #: build/C/man3/pthread_attr_setaffinity_np.3:118
593 #: build/C/man3/pthread_attr_setdetachstate.3:118
594 #: build/C/man3/pthread_attr_setguardsize.3:165
595 #: build/C/man3/pthread_attr_setinheritsched.3:138
596 #: build/C/man3/pthread_attr_setschedparam.3:116
597 #: build/C/man3/pthread_attr_setschedpolicy.3:112
598 #: build/C/man3/pthread_attr_setscope.3:139
599 #: build/C/man3/pthread_attr_setstack.3:162
600 #: build/C/man3/pthread_attr_setstackaddr.3:117
601 #: build/C/man3/pthread_attr_setstacksize.3:118
602 #: build/C/man3/pthread_cancel.3:226 build/C/man3/pthread_cleanup_push.3:315
603 #: build/C/man3/pthread_cleanup_push_defer_np.3:117
604 #: build/C/man3/pthread_create.3:376 build/C/man3/pthread_detach.3:97
605 #: build/C/man3/pthread_equal.3:61 build/C/man3/pthread_exit.3:110
606 #: build/C/man3/pthread_getattr_np.3:345
607 #: build/C/man3/pthread_getcpuclockid.3:175 build/C/man3/pthread_join.3:127
608 #: build/C/man3/pthread_kill.3:99
609 #: build/C/man3/pthread_kill_other_threads_np.3:71
610 #: build/C/man3/pthread_rwlockattr_setkind_np.3:130
611 #: build/C/man3/pthread_self.3:81 build/C/man3/pthread_setaffinity_np.3:213
612 #: build/C/man3/pthread_setcancelstate.3:186
613 #: build/C/man3/pthread_setconcurrency.3:107
614 #: build/C/man3/pthread_setname_np.3:200
615 #: build/C/man3/pthread_setschedparam.3:440
616 #: build/C/man3/pthread_setschedprio.3:96 build/C/man3/pthread_sigmask.3:152
617 #: build/C/man3/pthread_sigqueue.3:101 build/C/man3/pthread_testcancel.3:68
618 #: build/C/man3/pthread_tryjoin_np.3:135 build/C/man3/pthread_yield.3:67
619 #: build/C/man7/pthreads.7:893
620 #, no-wrap
621 msgid "SEE ALSO"
622 msgstr "関連項目"
623
624 #. type: Plain text
625 #: build/C/man3/getcontext.3:201
626 msgid ""
627 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
628 "B<makecontext>(3), B<sigsetjmp>(3)"
629 msgstr ""
630 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
631 "B<makecontext>(3), B<sigsetjmp>(3)"
632
633 #. type: SH
634 #: build/C/man3/getcontext.3:201 build/C/man3/makecontext.3:233
635 #: build/C/man3/pthread_attr_init.3:313
636 #: build/C/man3/pthread_attr_setaffinity_np.3:124
637 #: build/C/man3/pthread_attr_setdetachstate.3:124
638 #: build/C/man3/pthread_attr_setguardsize.3:173
639 #: build/C/man3/pthread_attr_setinheritsched.3:150
640 #: build/C/man3/pthread_attr_setschedparam.3:128
641 #: build/C/man3/pthread_attr_setschedpolicy.3:123
642 #: build/C/man3/pthread_attr_setscope.3:149
643 #: build/C/man3/pthread_attr_setstack.3:174
644 #: build/C/man3/pthread_attr_setstackaddr.3:123
645 #: build/C/man3/pthread_attr_setstacksize.3:125
646 #: build/C/man3/pthread_cancel.3:238 build/C/man3/pthread_cleanup_push.3:321
647 #: build/C/man3/pthread_cleanup_push_defer_np.3:123
648 #: build/C/man3/pthread_create.3:389 build/C/man3/pthread_detach.3:104
649 #: build/C/man3/pthread_equal.3:65 build/C/man3/pthread_exit.3:114
650 #: build/C/man3/pthread_getattr_np.3:361
651 #: build/C/man3/pthread_getcpuclockid.3:183 build/C/man3/pthread_join.3:134
652 #: build/C/man3/pthread_kill.3:108
653 #: build/C/man3/pthread_kill_other_threads_np.3:77
654 #: build/C/man3/pthread_rwlockattr_setkind_np.3:132
655 #: build/C/man3/pthread_self.3:85 build/C/man3/pthread_setaffinity_np.3:221
656 #: build/C/man3/pthread_setcancelstate.3:191
657 #: build/C/man3/pthread_setconcurrency.3:110
658 #: build/C/man3/pthread_setname_np.3:206
659 #: build/C/man3/pthread_setschedparam.3:454
660 #: build/C/man3/pthread_setschedprio.3:110 build/C/man3/pthread_sigmask.3:161
661 #: build/C/man3/pthread_sigqueue.3:109 build/C/man3/pthread_testcancel.3:73
662 #: build/C/man3/pthread_tryjoin_np.3:140 build/C/man3/pthread_yield.3:71
663 #: build/C/man7/pthreads.7:927
664 #, no-wrap
665 msgid "COLOPHON"
666 msgstr "この文書について"
667
668 #. type: Plain text
669 #: build/C/man3/getcontext.3:209 build/C/man3/makecontext.3:241
670 #: build/C/man3/pthread_attr_init.3:321
671 #: build/C/man3/pthread_attr_setaffinity_np.3:132
672 #: build/C/man3/pthread_attr_setdetachstate.3:132
673 #: build/C/man3/pthread_attr_setguardsize.3:181
674 #: build/C/man3/pthread_attr_setinheritsched.3:158
675 #: build/C/man3/pthread_attr_setschedparam.3:136
676 #: build/C/man3/pthread_attr_setschedpolicy.3:131
677 #: build/C/man3/pthread_attr_setscope.3:157
678 #: build/C/man3/pthread_attr_setstack.3:182
679 #: build/C/man3/pthread_attr_setstackaddr.3:131
680 #: build/C/man3/pthread_attr_setstacksize.3:133
681 #: build/C/man3/pthread_cancel.3:246 build/C/man3/pthread_cleanup_push.3:329
682 #: build/C/man3/pthread_cleanup_push_defer_np.3:131
683 #: build/C/man3/pthread_create.3:397 build/C/man3/pthread_detach.3:112
684 #: build/C/man3/pthread_equal.3:73 build/C/man3/pthread_exit.3:122
685 #: build/C/man3/pthread_getattr_np.3:369
686 #: build/C/man3/pthread_getcpuclockid.3:191 build/C/man3/pthread_join.3:142
687 #: build/C/man3/pthread_kill.3:116
688 #: build/C/man3/pthread_kill_other_threads_np.3:85
689 #: build/C/man3/pthread_rwlockattr_setkind_np.3:140
690 #: build/C/man3/pthread_self.3:93 build/C/man3/pthread_setaffinity_np.3:229
691 #: build/C/man3/pthread_setcancelstate.3:199
692 #: build/C/man3/pthread_setconcurrency.3:118
693 #: build/C/man3/pthread_setname_np.3:214
694 #: build/C/man3/pthread_setschedparam.3:462
695 #: build/C/man3/pthread_setschedprio.3:118 build/C/man3/pthread_sigmask.3:169
696 #: build/C/man3/pthread_sigqueue.3:117 build/C/man3/pthread_testcancel.3:81
697 #: build/C/man3/pthread_tryjoin_np.3:148 build/C/man3/pthread_yield.3:79
698 #: build/C/man7/pthreads.7:935
699 msgid ""
700 "This page is part of release 3.76 of the Linux I<man-pages> project.  A "
701 "description of the project, information about reporting bugs, and the latest "
702 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
703 "pages/."
704 msgstr ""
705 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.76 の一部\n"
706 "である。プロジェクトの説明とバグ報告に関する情報は\n"
707 "http://www.kernel.org/doc/man-pages/ に書かれている。"
708
709 #. type: TH
710 #: build/C/man3/makecontext.3:28
711 #, no-wrap
712 msgid "MAKECONTEXT"
713 msgstr "MAKECONTEXT"
714
715 #. type: TH
716 #: build/C/man3/makecontext.3:28 build/C/man3/pthread_attr_setaffinity_np.3:26
717 #: build/C/man3/pthread_attr_setdetachstate.3:26
718 #: build/C/man3/pthread_attr_setguardsize.3:26
719 #: build/C/man3/pthread_attr_setscope.3:26
720 #: build/C/man3/pthread_attr_setstack.3:26
721 #: build/C/man3/pthread_attr_setstackaddr.3:26
722 #: build/C/man3/pthread_attr_setstacksize.3:26
723 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
724 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_setname_np.3:26
725 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigqueue.3:25
726 #, no-wrap
727 msgid "2014-05-28"
728 msgstr "2014-05-28"
729
730 #. type: TH
731 #: build/C/man3/makecontext.3:28
732 #, no-wrap
733 msgid "GNU"
734 msgstr "GNU"
735
736 #. type: Plain text
737 #: build/C/man3/makecontext.3:31
738 msgid "makecontext, swapcontext - manipulate user context"
739 msgstr "makecontext, swapcontext - ユーザコンテキストを操作する"
740
741 #. type: Plain text
742 #: build/C/man3/makecontext.3:36
743 msgid ""
744 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
745 ">I<argc>B<, ...);>"
746 msgstr ""
747 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
748 ">I<argc>B<, ...);>"
749
750 #. type: Plain text
751 #: build/C/man3/makecontext.3:38
752 msgid ""
753 "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
754 msgstr ""
755 "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
756
757 #. type: Plain text
758 #: build/C/man3/makecontext.3:49
759 msgid ""
760 "In a System V-like environment, one has the type I<ucontext_t> defined in "
761 "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(3), "
762 "B<setcontext>(3), B<makecontext>()  and B<swapcontext>()  that allow user-"
763 "level context switching between multiple threads of control within a process."
764 msgstr ""
765 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
766 "と、 B<getcontext>(3), B<setcontext>(3), B<makecontext>(), B<swapcontext>()  "
767 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
768 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
769 "ようになっている。"
770
771 #. type: Plain text
772 #: build/C/man3/makecontext.3:52
773 msgid "For the type and the first two functions, see B<getcontext>(3)."
774 msgstr ""
775 "これらの型と、最初の 2 つの関数については、 B<getcontext>(3) を参照のこと。"
776
777 #. type: Plain text
778 #: build/C/man3/makecontext.3:64
779 msgid ""
780 "The B<makecontext>()  function modifies the context pointed to by I<ucp> "
781 "(which was obtained from a call to B<getcontext>(3)).  Before invoking "
782 "B<makecontext>(), the caller must allocate a new stack for this context and "
783 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
784 "and assign its address to I<ucp-E<gt>uc_link>."
785 msgstr ""
786 "B<makecontext>()  関数は、ポインタ I<ucp> が指すコンテキストを変更する "
787 "(I<ucp> は以前の B<getcontext>(3)  呼び出しで得られたものである)。 "
788 "B<makecontext>()  を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
789 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
790 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
791 "らない。"
792
793 #. type: Plain text
794 #: build/C/man3/makecontext.3:78
795 msgid ""
796 "When this context is later activated (using B<setcontext>(3)  or "
797 "B<swapcontext>())  the function I<func> is called, and passed the series of "
798 "integer (I<int>)  arguments that follow I<argc>; the caller must specify the "
799 "number of these arguments in I<argc>.  When this function returns, the "
800 "successor context is activated.  If the successor context pointer is NULL, "
801 "the thread exits."
802 msgstr ""
803 "このコンテキストが将来 (B<setcontext>(3)  または B<swapcontext>()  によっ"
804 "て)  有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 "
805 "(I<int>)  引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数"
806 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
807 "る。 後継コンテキストのポインタが NULL の場合、そのスレッドが終了する。"
808
809 #. type: Plain text
810 #: build/C/man3/makecontext.3:84
811 msgid ""
812 "The B<swapcontext>()  function saves the current context in the structure "
813 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
814 msgstr ""
815 "B<swapcontext>()  関数は現在のコンテキストを ポインタ I<oucp> が指す構造体に"
816 "保存し、 ポインタ I<ucp> が指すコンテキストを有効にする。"
817
818 #. type: Plain text
819 #: build/C/man3/makecontext.3:96
820 msgid ""
821 "When successful, B<swapcontext>()  does not return.  (But we may return "
822 "later, in case I<oucp> is activated, in which case it looks like "
823 "B<swapcontext>()  returns 0.)  On error, B<swapcontext>()  returns -1 and "
824 "sets I<errno> appropriately."
825 msgstr ""
826 "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった"
827 "場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見え"
828 "る。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じ"
829 "て設定する。"
830
831 #. type: TP
832 #: build/C/man3/makecontext.3:97
833 #: build/C/man3/pthread_attr_setaffinity_np.3:102
834 #: build/C/man3/pthread_getattr_np.3:77
835 #, no-wrap
836 msgid "B<ENOMEM>"
837 msgstr "B<ENOMEM>"
838
839 #. type: Plain text
840 #: build/C/man3/makecontext.3:100
841 msgid "Insufficient stack space left."
842 msgstr "スタックに割り当てる空間が残っていない。"
843
844 #. type: SH
845 #: build/C/man3/makecontext.3:100
846 #: build/C/man3/pthread_attr_setaffinity_np.3:106
847 #: build/C/man3/pthread_attr_setguardsize.3:104
848 #: build/C/man3/pthread_attr_setstack.3:110
849 #: build/C/man3/pthread_attr_setstackaddr.3:81
850 #: build/C/man3/pthread_attr_setstacksize.3:81
851 #: build/C/man3/pthread_getattr_np.3:96
852 #: build/C/man3/pthread_getcpuclockid.3:63
853 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
854 #: build/C/man3/pthread_setaffinity_np.3:119
855 #: build/C/man3/pthread_setconcurrency.3:81
856 #: build/C/man3/pthread_setname_np.3:100
857 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigqueue.3:90
858 #: build/C/man3/pthread_tryjoin_np.3:110
859 #, no-wrap
860 msgid "VERSIONS"
861 msgstr "バージョン"
862
863 #. type: Plain text
864 #: build/C/man3/makecontext.3:105
865 msgid ""
866 "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version "
867 "2.1."
868 msgstr ""
869 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
870 "されている。"
871
872 #. type: Plain text
873 #: build/C/man3/makecontext.3:112
874 msgid "The B<makecontext>()  and B<swapcontext>()  functions are thread-safe."
875 msgstr "関数 B<makecontext>() と B<swapcontext>() はスレッドセーフである。"
876
877 #. type: Plain text
878 #: build/C/man3/makecontext.3:120
879 msgid ""
880 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specifications of "
881 "B<makecontext>()  and B<swapcontext>(), citing portability issues, and "
882 "recommending that applications be rewritten to use POSIX threads instead."
883 msgstr ""
884 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  "
885 "と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを "
886 "POSIX スレッドを使って書き直すことが 推奨されている。"
887
888 #. type: Plain text
889 #: build/C/man3/makecontext.3:128
890 msgid ""
891 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
892 "namely, this struct contains the start and length of a memory area to be "
893 "used as the stack, regardless of the direction of growth of the stack.  "
894 "Thus, it is not necessary for the user program to worry about this direction."
895 msgstr ""
896 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわ"
897 "ちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含"
898 "まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
899 "て、ユーザプログラムはこの件については心配しなくてよい。"
900
901 #. type: Plain text
902 #: build/C/man3/makecontext.3:144
903 msgid ""
904 "On architectures where I<int> and pointer types are the same size (e.g., "
905 "x86-32, where both types are 32 bits), you may be able to get away with "
906 "passing pointers as arguments to B<makecontext>()  following I<argc>.  "
907 "However, doing this is not guaranteed to be portable, is undefined according "
908 "to the standards, and won't work on architectures where pointers are larger "
909 "than I<int>s.  Nevertheless, starting with version 2.8, glibc makes some "
910 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
911 "g., x86-64)."
912 msgstr ""
913 "I<int> とポインタ型が同じ大きさであるアーキテクチャでは (x86-32 はその例であ"
914 "り、両方の型とも 32 ビットである)、 B<makecontext>()  の I<argc> 以降の引き数"
915 "としてポインタを渡してもうまく動くかもしれない。 しかしながら、このようにする"
916 "と、移植性は保証されず、 標準に従えば動作は未定義であり、ポインタが I<int> よ"
917 "りも大きいアーキテクチャでは正しく動作しないことだろう。 それにも関わらず、"
918 "バージョン 2.8 以降の glibc では、 B<makecontext>()  に変更が行われ、(x86-64 "
919 "などの) いくつかの 64 ビットアーキテクチャで 引き数としてポインタを渡すことが"
920 "できるようになっている。"
921
922 #. type: SH
923 #: build/C/man3/makecontext.3:144 build/C/man3/pthread_attr_init.3:87
924 #: build/C/man3/pthread_attr_setdetachstate.3:115
925 #: build/C/man3/pthread_attr_setguardsize.3:162
926 #: build/C/man3/pthread_attr_setinheritsched.3:135
927 #: build/C/man3/pthread_attr_setschedparam.3:113
928 #: build/C/man3/pthread_attr_setschedpolicy.3:109
929 #: build/C/man3/pthread_attr_setstack.3:159
930 #: build/C/man3/pthread_attr_setstacksize.3:115
931 #: build/C/man3/pthread_cancel.3:135 build/C/man3/pthread_cleanup_push.3:155
932 #: build/C/man3/pthread_create.3:209 build/C/man3/pthread_detach.3:93
933 #: build/C/man3/pthread_getattr_np.3:101
934 #: build/C/man3/pthread_getcpuclockid.3:83 build/C/man3/pthread_join.3:124
935 #: build/C/man3/pthread_setaffinity_np.3:161
936 #: build/C/man3/pthread_setcancelstate.3:183
937 #: build/C/man3/pthread_setname_np.3:114
938 #: build/C/man3/pthread_setschedparam.3:156 build/C/man3/pthread_sigmask.3:78
939 #: build/C/man3/pthread_testcancel.3:65 build/C/man3/pthread_tryjoin_np.3:115
940 #, no-wrap
941 msgid "EXAMPLE"
942 msgstr "例"
943
944 #. type: Plain text
945 #: build/C/man3/makecontext.3:152
946 msgid ""
947 "The example program below demonstrates the use of B<getcontext>(3), "
948 "B<makecontext>(), and B<swapcontext>().  Running the program produces the "
949 "following output:"
950 msgstr ""
951 "以下のサンプル・プログラムは、 B<getcontext>(3), B<makecontext>(), "
952 "B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行する"
953 "と、以下のような出力が得られる:"
954
955 #. type: Plain text
956 #: build/C/man3/makecontext.3:164
957 #, no-wrap
958 msgid ""
959 "$B< ./a.out>\n"
960 "main: swapcontext(&uctx_main, &uctx_func2)\n"
961 "func2: started\n"
962 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
963 "func1: started\n"
964 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
965 "func2: returning\n"
966 "func1: returning\n"
967 "main: exiting\n"
968 msgstr ""
969 "$B< ./a.out>\n"
970 "main: swapcontext(&uctx_main, &uctx_func2)\n"
971 "func2: started\n"
972 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
973 "func1: started\n"
974 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
975 "func2: returning\n"
976 "func1: returning\n"
977 "main: exiting\n"
978
979 #. type: SS
980 #: build/C/man3/makecontext.3:166 build/C/man3/pthread_attr_init.3:148
981 #: build/C/man3/pthread_cancel.3:151 build/C/man3/pthread_cleanup_push.3:231
982 #: build/C/man3/pthread_create.3:248 build/C/man3/pthread_getattr_np.3:179
983 #: build/C/man3/pthread_getcpuclockid.3:101
984 #: build/C/man3/pthread_setname_np.3:140
985 #: build/C/man3/pthread_setschedparam.3:231 build/C/man3/pthread_sigmask.3:96
986 #, no-wrap
987 msgid "Program source"
988 msgstr "プログラムのソース"
989
990 #. type: Plain text
991 #: build/C/man3/makecontext.3:172
992 #, no-wrap
993 msgid ""
994 "#include E<lt>ucontext.hE<gt>\n"
995 "#include E<lt>stdio.hE<gt>\n"
996 "#include E<lt>stdlib.hE<gt>\n"
997 msgstr ""
998 "#include E<lt>ucontext.hE<gt>\n"
999 "#include E<lt>stdio.hE<gt>\n"
1000 "#include E<lt>stdlib.hE<gt>\n"
1001
1002 #. type: Plain text
1003 #: build/C/man3/makecontext.3:174
1004 #, no-wrap
1005 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
1006 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
1007
1008 #. type: Plain text
1009 #: build/C/man3/makecontext.3:177
1010 #, no-wrap
1011 msgid ""
1012 "#define handle_error(msg) \\e\n"
1013 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1014 msgstr ""
1015 "#define handle_error(msg) \\e\n"
1016 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1017
1018 #. type: Plain text
1019 #: build/C/man3/makecontext.3:187
1020 #, no-wrap
1021 msgid ""
1022 "static void\n"
1023 "func1(void)\n"
1024 "{\n"
1025 "    printf(\"func1: started\\en\");\n"
1026 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
1027 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
1028 "        handle_error(\"swapcontext\");\n"
1029 "    printf(\"func1: returning\\en\");\n"
1030 "}\n"
1031 msgstr ""
1032 "static void\n"
1033 "func1(void)\n"
1034 "{\n"
1035 "    printf(\"func1: started\\en\");\n"
1036 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
1037 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
1038 "        handle_error(\"swapcontext\");\n"
1039 "    printf(\"func1: returning\\en\");\n"
1040 "}\n"
1041
1042 #. type: Plain text
1043 #: build/C/man3/makecontext.3:197
1044 #, no-wrap
1045 msgid ""
1046 "static void\n"
1047 "func2(void)\n"
1048 "{\n"
1049 "    printf(\"func2: started\\en\");\n"
1050 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1051 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1052 "        handle_error(\"swapcontext\");\n"
1053 "    printf(\"func2: returning\\en\");\n"
1054 "}\n"
1055 msgstr ""
1056 "static void\n"
1057 "func2(void)\n"
1058 "{\n"
1059 "    printf(\"func2: started\\en\");\n"
1060 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1061 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1062 "        handle_error(\"swapcontext\");\n"
1063 "    printf(\"func2: returning\\en\");\n"
1064 "}\n"
1065
1066 #. type: Plain text
1067 #: build/C/man3/makecontext.3:203
1068 #, no-wrap
1069 msgid ""
1070 "int\n"
1071 "main(int argc, char *argv[])\n"
1072 "{\n"
1073 "    char func1_stack[16384];\n"
1074 "    char func2_stack[16384];\n"
1075 msgstr ""
1076 "int\n"
1077 "main(int argc, char *argv[])\n"
1078 "{\n"
1079 "    char func1_stack[16384];\n"
1080 "    char func2_stack[16384];\n"
1081
1082 #. type: Plain text
1083 #: build/C/man3/makecontext.3:210
1084 #, no-wrap
1085 msgid ""
1086 "    if (getcontext(&uctx_func1) == -1)\n"
1087 "        handle_error(\"getcontext\");\n"
1088 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1089 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1090 "    uctx_func1.uc_link = &uctx_main;\n"
1091 "    makecontext(&uctx_func1, func1, 0);\n"
1092 msgstr ""
1093 "    if (getcontext(&uctx_func1) == -1)\n"
1094 "        handle_error(\"getcontext\");\n"
1095 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1096 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1097 "    uctx_func1.uc_link = &uctx_main;\n"
1098 "    makecontext(&uctx_func1, func1, 0);\n"
1099
1100 #. type: Plain text
1101 #: build/C/man3/makecontext.3:218
1102 #, no-wrap
1103 msgid ""
1104 "    if (getcontext(&uctx_func2) == -1)\n"
1105 "        handle_error(\"getcontext\");\n"
1106 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1107 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1108 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1109 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1110 "    makecontext(&uctx_func2, func2, 0);\n"
1111 msgstr ""
1112 "    if (getcontext(&uctx_func2) == -1)\n"
1113 "        handle_error(\"getcontext\");\n"
1114 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1115 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1116 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1117 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1118 "    makecontext(&uctx_func2, func2, 0);\n"
1119
1120 #. type: Plain text
1121 #: build/C/man3/makecontext.3:222
1122 #, no-wrap
1123 msgid ""
1124 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1125 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1126 "        handle_error(\"swapcontext\");\n"
1127 msgstr ""
1128 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1129 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1130 "        handle_error(\"swapcontext\");\n"
1131
1132 #. type: Plain text
1133 #: build/C/man3/makecontext.3:226
1134 #, no-wrap
1135 msgid ""
1136 "    printf(\"main: exiting\\en\");\n"
1137 "    exit(EXIT_SUCCESS);\n"
1138 "}\n"
1139 msgstr ""
1140 "    printf(\"main: exiting\\en\");\n"
1141 "    exit(EXIT_SUCCESS);\n"
1142 "}\n"
1143
1144 #. type: Plain text
1145 #: build/C/man3/makecontext.3:233
1146 msgid ""
1147 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1148 "B<sigsetjmp>(3)"
1149 msgstr ""
1150 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1151 "B<sigsetjmp>(3)"
1152
1153 #. type: TH
1154 #: build/C/man3/pthread_attr_init.3:26
1155 #, no-wrap
1156 msgid "PTHREAD_ATTR_INIT"
1157 msgstr "PTHREAD_ATTR_INIT"
1158
1159 #. type: TH
1160 #: build/C/man3/pthread_attr_init.3:26
1161 #, no-wrap
1162 msgid "2008-11-11"
1163 msgstr "2008-11-11"
1164
1165 #. type: Plain text
1166 #: build/C/man3/pthread_attr_init.3:30
1167 msgid ""
1168 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1169 "attributes object"
1170 msgstr ""
1171 "pthread_attr_init, pthread_attr_destroy - \n"
1172 "スレッド属性オブジェクトの初期化と破棄を行う"
1173
1174 #. type: Plain text
1175 #: build/C/man3/pthread_attr_init.3:33
1176 #: build/C/man3/pthread_attr_setdetachstate.3:33
1177 #: build/C/man3/pthread_attr_setguardsize.3:33
1178 #: build/C/man3/pthread_attr_setinheritsched.3:33
1179 #: build/C/man3/pthread_attr_setschedparam.3:33
1180 #: build/C/man3/pthread_attr_setschedpolicy.3:33
1181 #: build/C/man3/pthread_attr_setscope.3:33
1182 #: build/C/man3/pthread_attr_setstack.3:33
1183 #: build/C/man3/pthread_attr_setstackaddr.3:33
1184 #: build/C/man3/pthread_attr_setstacksize.3:33
1185 #: build/C/man3/pthread_cancel.3:32 build/C/man3/pthread_cleanup_push.3:33
1186 #: build/C/man3/pthread_cleanup_push_defer_np.3:33
1187 #: build/C/man3/pthread_create.3:32 build/C/man3/pthread_detach.3:32
1188 #: build/C/man3/pthread_equal.3:32 build/C/man3/pthread_exit.3:32
1189 #: build/C/man3/pthread_join.3:32
1190 #: build/C/man3/pthread_kill_other_threads_np.3:32
1191 #: build/C/man3/pthread_rwlockattr_setkind_np.3:32
1192 #: build/C/man3/pthread_self.3:32 build/C/man3/pthread_setcancelstate.3:33
1193 #: build/C/man3/pthread_setconcurrency.3:32
1194 #: build/C/man3/pthread_setschedparam.3:33
1195 #: build/C/man3/pthread_setschedprio.3:32 build/C/man3/pthread_testcancel.3:32
1196 #, no-wrap
1197 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1198 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1199
1200 #. type: Plain text
1201 #: build/C/man3/pthread_attr_init.3:36
1202 #, no-wrap
1203 msgid ""
1204 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1205 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1206 msgstr ""
1207 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1208 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1209
1210 #. type: Plain text
1211 #: build/C/man3/pthread_attr_init.3:38
1212 #: build/C/man3/pthread_attr_setaffinity_np.3:41
1213 #: build/C/man3/pthread_attr_setdetachstate.3:40
1214 #: build/C/man3/pthread_attr_setguardsize.3:40
1215 #: build/C/man3/pthread_attr_setinheritsched.3:40
1216 #: build/C/man3/pthread_attr_setschedparam.3:40
1217 #: build/C/man3/pthread_attr_setschedpolicy.3:40
1218 #: build/C/man3/pthread_attr_setscope.3:40
1219 #: build/C/man3/pthread_attr_setstack.3:40
1220 #: build/C/man3/pthread_attr_setstackaddr.3:40
1221 #: build/C/man3/pthread_attr_setstacksize.3:40
1222 #: build/C/man3/pthread_cancel.3:36 build/C/man3/pthread_cleanup_push.3:39
1223 #: build/C/man3/pthread_equal.3:36 build/C/man3/pthread_exit.3:36
1224 #: build/C/man3/pthread_getattr_np.3:37
1225 #: build/C/man3/pthread_getcpuclockid.3:37
1226 #: build/C/man3/pthread_rwlockattr_setkind_np.3:39
1227 #: build/C/man3/pthread_self.3:36 build/C/man3/pthread_setaffinity_np.3:41
1228 #: build/C/man3/pthread_setcancelstate.3:38
1229 #: build/C/man3/pthread_setconcurrency.3:37
1230 #: build/C/man3/pthread_setschedparam.3:40
1231 #: build/C/man3/pthread_setschedprio.3:36 build/C/man3/pthread_testcancel.3:36
1232 #, no-wrap
1233 msgid "Compile and link with I<-pthread>.\n"
1234 msgstr "I<-pthread> でコンパイルしてリンクする。\n"
1235
1236 #. type: Plain text
1237 #: build/C/man3/pthread_attr_init.3:50
1238 msgid ""
1239 "The B<pthread_attr_init>()  function initializes the thread attributes "
1240 "object pointed to by I<attr> with default attribute values.  After this "
1241 "call, individual attributes of the object can be set using various related "
1242 "functions (listed under SEE ALSO), and then the object can be used in one or "
1243 "more B<pthread_create>(3)  calls that create threads."
1244 msgstr ""
1245 "B<pthread_attr_init>() 関数は I<attr> が指すスレッド属性オブジェクト\n"
1246 "(thread attributes object) をデフォルトの属性値で初期化する。\n"
1247 "この呼び出しの後、オブジェクトの各属性は (関連項目に載っている) 種々の\n"
1248 "関数を使って設定することができ、このオブジェクトはスレッドの作成を行う\n"
1249 "B<pthread_create>(3) の呼び出しにおいて使用することができる (一つの\n"
1250 "オブジェクトを複数の B<pthread_create>(3) に渡してもよい)。"
1251
1252 #. type: Plain text
1253 #: build/C/man3/pthread_attr_init.3:55
1254 msgid ""
1255 "Calling B<pthread_attr_init>()  on a thread attributes object that has "
1256 "already been initialized results in undefined behavior."
1257 msgstr ""
1258 "すでに初期化されているスレッド属性オブジェクトに対して\n"
1259 "B<pthread_attr_init>() を呼び出した場合、\n"
1260 "どのような動作になるかは不定である。"
1261
1262 #. type: Plain text
1263 #: build/C/man3/pthread_attr_init.3:62
1264 msgid ""
1265 "When a thread attributes object is no longer required, it should be "
1266 "destroyed using the B<pthread_attr_destroy>()  function.  Destroying a "
1267 "thread attributes object has no effect on threads that were created using "
1268 "that object."
1269 msgstr ""
1270 "スレッド属性オブジェクトがもはや必要なくなった際には、\n"
1271 "そのオブジェクトは B<pthread_attr_destroy>() 関数を使って破棄すべきである。\n"
1272 "スレッド属性オブジェクトを破棄しても、\n"
1273 "そのオブジェクトを使って作成されたスレッドには影響はない。"
1274
1275 #. type: Plain text
1276 #: build/C/man3/pthread_attr_init.3:68
1277 msgid ""
1278 "Once a thread attributes object has been destroyed, it can be reinitialized "
1279 "using B<pthread_attr_init>().  Any other use of a destroyed thread "
1280 "attributes object has undefined results."
1281 msgstr ""
1282 "いったん破棄したスレッド属性オブジェクトは、\n"
1283 "B<pthread_attr_init>() を使って再初期化することができる。\n"
1284 "破棄したスレッド属性オブジェクトをこれ以外の用途で\n"
1285 "使った場合の結果は不定である。"
1286
1287 #. type: Plain text
1288 #: build/C/man3/pthread_attr_init.3:71
1289 #: build/C/man3/pthread_attr_setaffinity_np.3:79
1290 #: build/C/man3/pthread_attr_setdetachstate.3:80
1291 #: build/C/man3/pthread_attr_setguardsize.3:93
1292 #: build/C/man3/pthread_attr_setinheritsched.3:96
1293 #: build/C/man3/pthread_attr_setschedparam.3:88
1294 #: build/C/man3/pthread_attr_setschedpolicy.3:86
1295 #: build/C/man3/pthread_attr_setscope.3:106
1296 #: build/C/man3/pthread_attr_setstack.3:88
1297 #: build/C/man3/pthread_attr_setstackaddr.3:77
1298 #: build/C/man3/pthread_attr_setstacksize.3:64
1299 #: build/C/man3/pthread_setaffinity_np.3:80
1300 #: build/C/man3/pthread_setcancelstate.3:95
1301 #: build/C/man3/pthread_setname_np.3:75
1302 msgid ""
1303 "On success, these functions return 0; on error, they return a nonzero error "
1304 "number."
1305 msgstr ""
1306 "成功すると、これらの関数は 0 を返す。\n"
1307 "エラーの場合、0 以外のエラー番号を返す。"
1308
1309 #. type: Plain text
1310 #: build/C/man3/pthread_attr_init.3:79
1311 msgid ""
1312 "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on "
1313 "Linux these functions always succeed (but portable and future-proof "
1314 "applications should nevertheless handle a possible error return)."
1315 msgstr ""
1316 "POSIX.1-2001 では B<pthread_attr_init>() にはエラー B<ENOMEM> が\n"
1317 "記載されている。\n"
1318 "Linux では、これらの関数は常に成功する\n"
1319 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
1320 "正のエラーの返り値を処理するようにすべきである)。"
1321
1322 #. type: Plain text
1323 #: build/C/man3/pthread_attr_init.3:81
1324 #: build/C/man3/pthread_attr_setdetachstate.3:96
1325 #: build/C/man3/pthread_attr_setguardsize.3:115
1326 #: build/C/man3/pthread_attr_setinheritsched.3:119
1327 #: build/C/man3/pthread_attr_setschedparam.3:109
1328 #: build/C/man3/pthread_attr_setschedpolicy.3:109
1329 #: build/C/man3/pthread_attr_setscope.3:128
1330 #: build/C/man3/pthread_attr_setstack.3:121
1331 #: build/C/man3/pthread_attr_setstacksize.3:92
1332 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129
1333 #: build/C/man3/pthread_create.3:155 build/C/man3/pthread_detach.3:66
1334 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82
1335 #: build/C/man3/pthread_getcpuclockid.3:72 build/C/man3/pthread_join.3:100
1336 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setcancelstate.3:122
1337 #: build/C/man3/pthread_setconcurrency.3:92
1338 #: build/C/man3/pthread_setschedparam.3:150
1339 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
1340 #: build/C/man3/pthread_testcancel.3:65
1341 msgid "POSIX.1-2001."
1342 msgstr "POSIX.1-2001."
1343
1344 #. type: Plain text
1345 #: build/C/man3/pthread_attr_init.3:87
1346 msgid ""
1347 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1348 "object other than via pthreads functions is nonportable and produces "
1349 "undefined results."
1350 msgstr ""
1351 "I<pthread_attr_t> 型の内部構造は意識すべきではない。\n"
1352 "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n"
1353 "どのような結果が得られるかも分からない。"
1354
1355 #. type: Plain text
1356 #: build/C/man3/pthread_attr_init.3:96
1357 msgid ""
1358 "The program below optionally makes use of B<pthread_attr_init>()  and "
1359 "various related functions to initialize a thread attributes object that is "
1360 "used to create a single thread.  Once created, the thread uses the "
1361 "B<pthread_getattr_np>(3)  function (a nonstandard GNU extension) to retrieve "
1362 "the thread's attributes, and then displays those attributes."
1363 msgstr ""
1364 "下記のプログラムは、B<pthread_attr_init>() と種々の関連関数を使って、\n"
1365 "スレッド属性オブジェクトの初期化を行い、\n"
1366 "そのオブジェクトを使ってスレッドを一つ作成する。\n"
1367 "作成されたスレッドは、作成後に B<pthread_getattr_np>(3) 関数 \n"
1368 "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n"
1369 "取得した属性を表示する。"
1370
1371 #. type: Plain text
1372 #: build/C/man3/pthread_attr_init.3:105
1373 msgid ""
1374 "If the program is run with no command-line argument, then it passes NULL as "
1375 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1376 "with default attributes.  Running the program on Linux/x86-32 with the NPTL "
1377 "threading implementation, we see the following:"
1378 msgstr ""
1379 "コマンドライン引き数なしでプログラムを実行した場合、\n"
1380 "B<pthread_create>(3) の I<attr> 引き数には NULL が渡される。\n"
1381 "この場合、スレッドはデフォルトの属性で作成される。\n"
1382 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1383 "動作させると、以下のような出力が得られる。"
1384
1385 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1386 #. type: Plain text
1387 #: build/C/man3/pthread_attr_init.3:121
1388 #, no-wrap
1389 msgid ""
1390 "$B< ulimit -s>       # No stack limit ==E<gt> default stack size is 2MB\n"
1391 "unlimited\n"
1392 "$B< ./a.out>\n"
1393 "Thread attributes:\n"
1394 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1395 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1396 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1397 "        Scheduling policy   = SCHED_OTHER\n"
1398 "        Scheduling priority = 0\n"
1399 "        Guard size          = 4096 bytes\n"
1400 "        Stack address       = 0x40196000\n"
1401 "        Stack size          = 0x201000 bytes\n"
1402 msgstr ""
1403 "$B< ulimit -s>       # No stack limit ==E<gt> default stack size is 2MB\n"
1404 "unlimited\n"
1405 "$B< ./a.out>\n"
1406 "Thread attributes:\n"
1407 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1408 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1409 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1410 "        Scheduling policy   = SCHED_OTHER\n"
1411 "        Scheduling priority = 0\n"
1412 "        Guard size          = 4096 bytes\n"
1413 "        Stack address       = 0x40196000\n"
1414 "        Stack size          = 0x201000 bytes\n"
1415
1416 #. type: Plain text
1417 #: build/C/man3/pthread_attr_init.3:131
1418 msgid ""
1419 "When we supply a stack size as a command-line argument, the program "
1420 "initializes a thread attributes object, sets various attributes in that "
1421 "object, and passes a pointer to the object in the call to "
1422 "B<pthread_create>(3).  Running the program on Linux/x86-32 with the NPTL "
1423 "threading implementation, we see the following:"
1424 msgstr ""
1425 "コマンドライン引き数でスタックサイズが与えられた場合、\n"
1426 "このプログラムは、スレッド属性オブジェクトを初期化し、\n"
1427 "そのオブジェクトの各種属性を設定し、\n"
1428 "B<pthread_create>(3) の呼び出しでこのオブジェクトへのポインタを渡す。\n"
1429 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1430 "動作させると、以下のような出力が得られる。"
1431
1432 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1433 #. type: Plain text
1434 #: build/C/man3/pthread_attr_init.3:146
1435 #, no-wrap
1436 msgid ""
1437 "$B< ./a.out 0x3000000>\n"
1438 "posix_memalign() allocated at 0x40197000\n"
1439 "Thread attributes:\n"
1440 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1441 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1442 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1443 "        Scheduling policy   = SCHED_OTHER\n"
1444 "        Scheduling priority = 0\n"
1445 "        Guard size          = 0 bytes\n"
1446 "        Stack address       = 0x40197000\n"
1447 "        Stack size          = 0x3000000 bytes\n"
1448 msgstr ""
1449 "$B< ./a.out 0x3000000>\n"
1450 "posix_memalign() allocated at 0x40197000\n"
1451 "Thread attributes:\n"
1452 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1453 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1454 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1455 "        Scheduling policy   = SCHED_OTHER\n"
1456 "        Scheduling priority = 0\n"
1457 "        Guard size          = 0 bytes\n"
1458 "        Stack address       = 0x40197000\n"
1459 "        Stack size          = 0x3000000 bytes\n"
1460
1461 #. type: Plain text
1462 #: build/C/man3/pthread_attr_init.3:157 build/C/man3/pthread_getattr_np.3:188
1463 #, no-wrap
1464 msgid ""
1465 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1466 "#include E<lt>pthread.hE<gt>\n"
1467 "#include E<lt>stdio.hE<gt>\n"
1468 "#include E<lt>stdlib.hE<gt>\n"
1469 "#include E<lt>unistd.hE<gt>\n"
1470 "#include E<lt>errno.hE<gt>\n"
1471 msgstr ""
1472 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1473 "#include E<lt>pthread.hE<gt>\n"
1474 "#include E<lt>stdio.hE<gt>\n"
1475 "#include E<lt>stdlib.hE<gt>\n"
1476 "#include E<lt>unistd.hE<gt>\n"
1477 "#include E<lt>errno.hE<gt>\n"
1478
1479 #. type: Plain text
1480 #: build/C/man3/pthread_attr_init.3:160 build/C/man3/pthread_cancel.3:162
1481 #: build/C/man3/pthread_cleanup_push.3:243 build/C/man3/pthread_create.3:261
1482 #: build/C/man3/pthread_getattr_np.3:191
1483 #: build/C/man3/pthread_getcpuclockid.3:119
1484 #: build/C/man3/pthread_setaffinity_np.3:179
1485 #: build/C/man3/pthread_setschedparam.3:244 build/C/man3/pthread_sigmask.3:110
1486 #, no-wrap
1487 msgid ""
1488 "#define handle_error_en(en, msg) \\e\n"
1489 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1490 msgstr ""
1491 "#define handle_error_en(en, msg) \\e\n"
1492 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1493
1494 #. type: Plain text
1495 #: build/C/man3/pthread_attr_init.3:168
1496 #, no-wrap
1497 msgid ""
1498 "static void\n"
1499 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1500 "{\n"
1501 "    int s, i;\n"
1502 "    size_t v;\n"
1503 "    void *stkaddr;\n"
1504 "    struct sched_param sp;\n"
1505 msgstr ""
1506 "static void\n"
1507 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1508 "{\n"
1509 "    int s, i;\n"
1510 "    size_t v;\n"
1511 "    void *stkaddr;\n"
1512 "    struct sched_param sp;\n"
1513
1514 #. type: Plain text
1515 #: build/C/man3/pthread_attr_init.3:176
1516 #, no-wrap
1517 msgid ""
1518 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1519 "    if (s != 0)\n"
1520 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1521 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1522 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1523 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1524 "            \"???\");\n"
1525 msgstr ""
1526 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1527 "    if (s != 0)\n"
1528 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1529 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1530 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1531 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1532 "            \"???\");\n"
1533
1534 #. type: Plain text
1535 #: build/C/man3/pthread_attr_init.3:184
1536 #, no-wrap
1537 msgid ""
1538 "    s = pthread_attr_getscope(attr, &i);\n"
1539 "    if (s != 0)\n"
1540 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1541 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1542 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1543 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1544 "            \"???\");\n"
1545 msgstr ""
1546 "    s = pthread_attr_getscope(attr, &i);\n"
1547 "    if (s != 0)\n"
1548 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1549 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1550 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1551 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1552 "            \"???\");\n"
1553
1554 #. type: Plain text
1555 #: build/C/man3/pthread_attr_init.3:192
1556 #, no-wrap
1557 msgid ""
1558 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1559 "    if (s != 0)\n"
1560 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1561 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1562 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1563 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1564 "            \"???\");\n"
1565 msgstr ""
1566 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1567 "    if (s != 0)\n"
1568 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1569 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1570 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1571 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1572 "            \"???\");\n"
1573
1574 #. type: Plain text
1575 #: build/C/man3/pthread_attr_init.3:201
1576 #, no-wrap
1577 msgid ""
1578 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1579 "    if (s != 0)\n"
1580 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1581 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1582 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1583 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1584 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1585 "            \"???\");\n"
1586 msgstr ""
1587 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1588 "    if (s != 0)\n"
1589 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1590 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1591 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1592 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1593 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1594 "            \"???\");\n"
1595
1596 #. type: Plain text
1597 #: build/C/man3/pthread_attr_init.3:206
1598 #, no-wrap
1599 msgid ""
1600 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1601 "    if (s != 0)\n"
1602 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1603 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1604 msgstr ""
1605 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1606 "    if (s != 0)\n"
1607 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1608 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1609
1610 #. type: Plain text
1611 #: build/C/man3/pthread_attr_init.3:211
1612 #, no-wrap
1613 msgid ""
1614 "    s = pthread_attr_getguardsize(attr, &v);\n"
1615 "    if (s != 0)\n"
1616 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1617 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1618 msgstr ""
1619 "    s = pthread_attr_getguardsize(attr, &v);\n"
1620 "    if (s != 0)\n"
1621 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1622 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1623
1624 #. type: Plain text
1625 #: build/C/man3/pthread_attr_init.3:218
1626 #, no-wrap
1627 msgid ""
1628 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1629 "    if (s != 0)\n"
1630 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1631 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1632 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1633 "}\n"
1634 msgstr ""
1635 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1636 "    if (s != 0)\n"
1637 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1638 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1639 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1640 "}\n"
1641
1642 #. type: Plain text
1643 #: build/C/man3/pthread_attr_init.3:224
1644 #, no-wrap
1645 msgid ""
1646 "static void *\n"
1647 "thread_start(void *arg)\n"
1648 "{\n"
1649 "    int s;\n"
1650 "    pthread_attr_t gattr;\n"
1651 msgstr ""
1652 "static void *\n"
1653 "thread_start(void *arg)\n"
1654 "{\n"
1655 "    int s;\n"
1656 "    pthread_attr_t gattr;\n"
1657
1658 #. type: Plain text
1659 #: build/C/man3/pthread_attr_init.3:228
1660 #, no-wrap
1661 msgid ""
1662 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1663 "       retrieves the attributes of the thread specified in its\n"
1664 "       first argument */\n"
1665 msgstr ""
1666 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1667 "       retrieves the attributes of the thread specified in its\n"
1668 "       first argument */\n"
1669
1670 #. type: Plain text
1671 #: build/C/man3/pthread_attr_init.3:232
1672 #, no-wrap
1673 msgid ""
1674 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1675 "    if (s != 0)\n"
1676 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1677 msgstr ""
1678 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1679 "    if (s != 0)\n"
1680 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1681
1682 #. type: Plain text
1683 #: build/C/man3/pthread_attr_init.3:235
1684 #, no-wrap
1685 msgid ""
1686 "    printf(\"Thread attributes:\\en\");\n"
1687 "    display_pthread_attr(&gattr, \"\\et\");\n"
1688 msgstr ""
1689 "    printf(\"Thread attributes:\\en\");\n"
1690 "    display_pthread_attr(&gattr, \"\\et\");\n"
1691
1692 #. type: Plain text
1693 #: build/C/man3/pthread_attr_init.3:238 build/C/man3/pthread_getattr_np.3:240
1694 #, no-wrap
1695 msgid ""
1696 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1697 "}\n"
1698 msgstr ""
1699 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1700 "}\n"
1701
1702 #. type: Plain text
1703 #: build/C/man3/pthread_attr_init.3:246
1704 #, no-wrap
1705 msgid ""
1706 "int\n"
1707 "main(int argc, char *argv[])\n"
1708 "{\n"
1709 "    pthread_t thr;\n"
1710 "    pthread_attr_t attr;\n"
1711 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1712 "    int s;\n"
1713 msgstr ""
1714 "int\n"
1715 "main(int argc, char *argv[])\n"
1716 "{\n"
1717 "    pthread_t thr;\n"
1718 "    pthread_attr_t attr;\n"
1719 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1720 "    int s;\n"
1721
1722 #. type: Plain text
1723 #: build/C/man3/pthread_attr_init.3:248
1724 #: build/C/man3/pthread_setschedparam.3:362
1725 #, no-wrap
1726 msgid "    attrp = NULL;\n"
1727 msgstr "    attrp = NULL;\n"
1728
1729 #. type: Plain text
1730 #: build/C/man3/pthread_attr_init.3:252
1731 #, no-wrap
1732 msgid ""
1733 "    /* If a command-line argument was supplied, use it to set the\n"
1734 "       stack-size attribute and set a few other thread attributes,\n"
1735 "       and set attrp pointing to thread attributes object */\n"
1736 msgstr ""
1737 "    /* If a command-line argument was supplied, use it to set the\n"
1738 "       stack-size attribute and set a few other thread attributes,\n"
1739 "       and set attrp pointing to thread attributes object */\n"
1740
1741 #. type: Plain text
1742 #: build/C/man3/pthread_attr_init.3:256
1743 #, no-wrap
1744 msgid ""
1745 "    if (argc E<gt> 1) {\n"
1746 "        int stack_size;\n"
1747 "        void *sp;\n"
1748 msgstr ""
1749 "    if (argc E<gt> 1) {\n"
1750 "        int stack_size;\n"
1751 "        void *sp;\n"
1752
1753 #. type: Plain text
1754 #: build/C/man3/pthread_attr_init.3:258
1755 #, no-wrap
1756 msgid "        attrp = &attr;\n"
1757 msgstr "        attrp = &attr;\n"
1758
1759 #. type: Plain text
1760 #: build/C/man3/pthread_attr_init.3:262
1761 #, no-wrap
1762 msgid ""
1763 "        s = pthread_attr_init(&attr);\n"
1764 "        if (s != 0)\n"
1765 "            handle_error_en(s, \"pthread_attr_init\");\n"
1766 msgstr ""
1767 "        s = pthread_attr_init(&attr);\n"
1768 "        if (s != 0)\n"
1769 "            handle_error_en(s, \"pthread_attr_init\");\n"
1770
1771 #. type: Plain text
1772 #: build/C/man3/pthread_attr_init.3:266
1773 #, no-wrap
1774 msgid ""
1775 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1776 "        if (s != 0)\n"
1777 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1778 msgstr ""
1779 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1780 "        if (s != 0)\n"
1781 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1782
1783 #. type: Plain text
1784 #: build/C/man3/pthread_attr_init.3:270
1785 #, no-wrap
1786 msgid ""
1787 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1788 "        if (s != 0)\n"
1789 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1790 msgstr ""
1791 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1792 "        if (s != 0)\n"
1793 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1794
1795 #. type: Plain text
1796 #: build/C/man3/pthread_attr_init.3:272
1797 #, no-wrap
1798 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1799 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
1800
1801 #. type: Plain text
1802 #: build/C/man3/pthread_attr_init.3:276
1803 #, no-wrap
1804 msgid ""
1805 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1806 "        if (s != 0)\n"
1807 "            handle_error_en(s, \"posix_memalign\");\n"
1808 msgstr ""
1809 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1810 "        if (s != 0)\n"
1811 "            handle_error_en(s, \"posix_memalign\");\n"
1812
1813 #. type: Plain text
1814 #: build/C/man3/pthread_attr_init.3:278
1815 #, no-wrap
1816 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1817 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1818
1819 #. type: Plain text
1820 #: build/C/man3/pthread_attr_init.3:283
1821 #, no-wrap
1822 msgid ""
1823 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1824 "        if (s != 0)\n"
1825 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1826 "    }\n"
1827 msgstr ""
1828 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1829 "        if (s != 0)\n"
1830 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1831 "    }\n"
1832
1833 #. type: Plain text
1834 #: build/C/man3/pthread_attr_init.3:287 build/C/man3/pthread_getattr_np.3:335
1835 #, no-wrap
1836 msgid ""
1837 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1838 "    if (s != 0)\n"
1839 "        handle_error_en(s, \"pthread_create\");\n"
1840 msgstr ""
1841 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1842 "    if (s != 0)\n"
1843 "        handle_error_en(s, \"pthread_create\");\n"
1844
1845 #. type: Plain text
1846 #: build/C/man3/pthread_attr_init.3:293 build/C/man3/pthread_getattr_np.3:341
1847 #, no-wrap
1848 msgid ""
1849 "    if (attrp != NULL) {\n"
1850 "        s = pthread_attr_destroy(attrp);\n"
1851 "        if (s != 0)\n"
1852 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1853 "    }\n"
1854 msgstr ""
1855 "    if (attrp != NULL) {\n"
1856 "        s = pthread_attr_destroy(attrp);\n"
1857 "        if (s != 0)\n"
1858 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1859 "    }\n"
1860
1861 #. type: Plain text
1862 #: build/C/man3/pthread_attr_init.3:296 build/C/man3/pthread_getattr_np.3:344
1863 #, no-wrap
1864 msgid ""
1865 "    pause();    /* Terminates when other thread calls exit() */\n"
1866 "}\n"
1867 msgstr ""
1868 "    pause();    /* Terminates when other thread calls exit() */\n"
1869 "}\n"
1870
1871 #. type: Plain text
1872 #: build/C/man3/pthread_attr_init.3:313
1873 msgid ""
1874 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1875 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1876 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1877 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1878 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1879 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1880 msgstr ""
1881 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1882 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1883 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1884 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1885 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1886 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1887
1888 #. type: TH
1889 #: build/C/man3/pthread_attr_setaffinity_np.3:26
1890 #, no-wrap
1891 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1892 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1893
1894 #. type: Plain text
1895 #: build/C/man3/pthread_attr_setaffinity_np.3:30
1896 msgid ""
1897 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1898 "affinity attribute in thread attributes object"
1899 msgstr ""
1900 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
1901 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
1902
1903 #. type: Plain text
1904 #: build/C/man3/pthread_attr_setaffinity_np.3:34
1905 #: build/C/man3/pthread_getattr_np.3:33
1906 #: build/C/man3/pthread_setaffinity_np.3:34
1907 #: build/C/man3/pthread_tryjoin_np.3:34 build/C/man3/pthread_yield.3:32
1908 #, no-wrap
1909 msgid ""
1910 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1911 "B<#include E<lt>pthread.hE<gt>>\n"
1912 msgstr ""
1913 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1914 "B<#include E<lt>pthread.hE<gt>>\n"
1915
1916 #. type: Plain text
1917 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1918 #, no-wrap
1919 msgid ""
1920 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1921 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1922 "B<int pthread_attr_getaffinity_np(const pthread_attr_t *>I<attr>B<,>\n"
1923 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1924 msgstr ""
1925 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1926 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1927 "B<int pthread_attr_getaffinity_np(const pthread_attr_t *>I<attr>B<,>\n"
1928 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1929
1930 #. type: Plain text
1931 #: build/C/man3/pthread_attr_setaffinity_np.3:54
1932 msgid ""
1933 "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask "
1934 "attribute of the thread attributes object referred to by I<attr> to the "
1935 "value specified in I<cpuset>.  This attribute determines the CPU affinity "
1936 "mask of a thread created using the thread attributes object I<attr>."
1937 msgstr ""
1938 "B<pthread_attr_setaffinity_np>() 関数は、\n"
1939 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
1940 "I<cpuset> で指定された値に設定する。\n"
1941 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
1942 "作成されたスレッドの CPU affinity マスクが決定される。"
1943
1944 #. type: Plain text
1945 #: build/C/man3/pthread_attr_setaffinity_np.3:63
1946 msgid ""
1947 "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask "
1948 "attribute of the thread attributes object referred to by I<attr> in the "
1949 "buffer pointed to by I<cpuset>."
1950 msgstr ""
1951 "B<pthread_attr_getaffinity_np>() 関数は、 I<attr> が参照する\n"
1952 "スレッド属性オブジェクトの CPU affinity マスク属性を\n"
1953 "I<cpuset> が指すバッファに入れて返す。"
1954
1955 #. type: Plain text
1956 #: build/C/man3/pthread_attr_setaffinity_np.3:70
1957 msgid ""
1958 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1959 "by I<cpuset>.  Typically, this argument would be specified as "
1960 "I<sizeof(cpu_set_t)>."
1961 msgstr ""
1962 "I<cpusetsize> 引き数は I<cpuset> が指すバッファの (バイト単位の)\n"
1963 "大きさである。通常は、この引き数には I<sizeof(cpu_set_t)> を\n"
1964 "指定することだろう。"
1965
1966 #. type: Plain text
1967 #: build/C/man3/pthread_attr_setaffinity_np.3:76
1968 #: build/C/man3/pthread_setaffinity_np.3:67
1969 msgid ""
1970 "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a "
1971 "description of a set of macros that can be used to manipulate and inspect "
1972 "CPU sets, see B<CPU_SET>(3)."
1973 msgstr ""
1974 "CPU affinity マスクの詳細については、 \n"
1975 "B<sched_setaffinity>(2) を参照してほしい。\n"
1976 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
1977 "B<CPU_SET>(3) を参照してほしい。"
1978
1979 #. type: TP
1980 #: build/C/man3/pthread_attr_setaffinity_np.3:80
1981 #: build/C/man3/pthread_attr_setaffinity_np.3:92
1982 #: build/C/man3/pthread_attr_setdetachstate.3:83
1983 #: build/C/man3/pthread_attr_setinheritsched.3:99
1984 #: build/C/man3/pthread_attr_setschedpolicy.3:89
1985 #: build/C/man3/pthread_attr_setscope.3:109
1986 #: build/C/man3/pthread_attr_setstack.3:91
1987 #: build/C/man3/pthread_attr_setstacksize.3:67
1988 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:55
1989 #: build/C/man3/pthread_join.3:85 build/C/man3/pthread_join.3:89
1990 #: build/C/man3/pthread_kill.3:69
1991 #: build/C/man3/pthread_rwlockattr_setkind_np.3:105
1992 #: build/C/man3/pthread_setaffinity_np.3:84
1993 #: build/C/man3/pthread_setaffinity_np.3:93
1994 #: build/C/man3/pthread_setaffinity_np.3:109
1995 #: build/C/man3/pthread_setcancelstate.3:99
1996 #: build/C/man3/pthread_setcancelstate.3:107
1997 #: build/C/man3/pthread_setconcurrency.3:71
1998 #: build/C/man3/pthread_setschedparam.3:122
1999 #: build/C/man3/pthread_setschedprio.3:62 build/C/man3/pthread_sigqueue.3:78
2000 #, no-wrap
2001 msgid "B<EINVAL>"
2002 msgstr "B<EINVAL>"
2003
2004 #.  cpumask_t
2005 #.  The raw sched_getaffinity() system call returns the size (in bytes)
2006 #.  of the cpumask_t type.
2007 #. type: Plain text
2008 #: build/C/man3/pthread_attr_setaffinity_np.3:92
2009 msgid ""
2010 "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was "
2011 "outside the set supported by the kernel.  (The kernel configuration option "
2012 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
2013 "type used to represent CPU sets.)"
2014 msgstr ""
2015 "(B<pthread_attr_setaffinity_np>())\n"
2016 "I<cpuset> がカーネルがサポートする CPU 集合にない CPU を指定していた。\n"
2017 "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲"
2018 "は、\n"
2019 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
2020
2021 #. type: Plain text
2022 #: build/C/man3/pthread_attr_setaffinity_np.3:102
2023 msgid ""
2024 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
2025 "attributes object referred to by I<attr> lies outside the range specified by "
2026 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
2027 msgstr ""
2028 "(B<pthread_attr_getaffinity_np>())\n"
2029 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
2030 "I<cpusetsize> により指定された範囲の中になかった\n"
2031 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
2032
2033 #. type: Plain text
2034 #: build/C/man3/pthread_attr_setaffinity_np.3:106
2035 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
2036 msgstr ""
2037 "(B<pthread_attr_setaffinity_np>()) メモリを割り当てることができなかった。"
2038
2039 #. type: Plain text
2040 #: build/C/man3/pthread_attr_setaffinity_np.3:108
2041 #: build/C/man3/pthread_setaffinity_np.3:121
2042 msgid "These functions are provided by glibc since version 2.3.4."
2043 msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。"
2044
2045 #. type: Plain text
2046 #: build/C/man3/pthread_attr_setaffinity_np.3:111
2047 #: build/C/man3/pthread_cleanup_push_defer_np.3:117
2048 #: build/C/man3/pthread_setaffinity_np.3:131
2049 #: build/C/man3/pthread_tryjoin_np.3:115
2050 msgid ""
2051 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
2052 "\" (nonportable) in the names."
2053 msgstr ""
2054 "これらの関数は非標準の GNU による拡張である。\n"
2055 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
2056 "付いている。"
2057
2058 #. type: Plain text
2059 #: build/C/man3/pthread_attr_setaffinity_np.3:118
2060 #: build/C/man3/pthread_setaffinity_np.3:157
2061 msgid ""
2062 "In glibc 2.3.3 only, versions of these functions were provided that did not "
2063 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
2064 "underlying system calls was always I<sizeof(cpu_set_t)>."
2065 msgstr ""
2066 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
2067 "これらの関数は I<cpusetsize> 引き数を持っていなかった。\n"
2068 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
2069 "常に I<sizeof(cpu_set_t)> であった。"
2070
2071 #. type: Plain text
2072 #: build/C/man3/pthread_attr_setaffinity_np.3:124
2073 msgid ""
2074 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2075 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2076 msgstr ""
2077 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2078 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2079
2080 #. type: TH
2081 #: build/C/man3/pthread_attr_setdetachstate.3:26
2082 #, no-wrap
2083 msgid "PTHREAD_ATTR_SETDETACHSTATE"
2084 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
2085
2086 #. type: Plain text
2087 #: build/C/man3/pthread_attr_setdetachstate.3:30
2088 msgid ""
2089 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
2090 "state attribute in thread attributes object"
2091 msgstr ""
2092 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
2093 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
2094
2095 #. type: Plain text
2096 #: build/C/man3/pthread_attr_setdetachstate.3:38
2097 #, no-wrap
2098 msgid ""
2099 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2100 "B<int pthread_attr_getdetachstate(const pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2101 msgstr ""
2102 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2103 "B<int pthread_attr_getdetachstate(const pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2104
2105 #. type: Plain text
2106 #: build/C/man3/pthread_attr_setdetachstate.3:53
2107 msgid ""
2108 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
2109 "attribute of the thread attributes object referred to by I<attr> to the "
2110 "value specified in I<detachstate>.  The detach state attribute determines "
2111 "whether a thread created using the thread attributes object I<attr> will be "
2112 "created in a joinable or a detached state."
2113 msgstr ""
2114 "B<pthread_attr_setdetachstate>() 関数は、\n"
2115 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
2116 "I<detachstate> で指定された値に設定する。\n"
2117 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2118 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
2119 "detached (切り離された) 状態で作成されるかが決定される。"
2120
2121 #. type: Plain text
2122 #: build/C/man3/pthread_attr_setdetachstate.3:56
2123 msgid "The following values may be specified in I<detachstate>:"
2124 msgstr "I<detachstate> には以下の値を指定できる。"
2125
2126 #. type: TP
2127 #: build/C/man3/pthread_attr_setdetachstate.3:56
2128 #, no-wrap
2129 msgid "B<PTHREAD_CREATE_DETACHED>"
2130 msgstr "B<PTHREAD_CREATE_DETACHED>"
2131
2132 #. type: Plain text
2133 #: build/C/man3/pthread_attr_setdetachstate.3:61
2134 msgid ""
2135 "Threads that are created using I<attr> will be created in a detached state."
2136 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
2137
2138 #. type: TP
2139 #: build/C/man3/pthread_attr_setdetachstate.3:61
2140 #, no-wrap
2141 msgid "B<PTHREAD_CREATE_JOINABLE>"
2142 msgstr "B<PTHREAD_CREATE_JOINABLE>"
2143
2144 #. type: Plain text
2145 #: build/C/man3/pthread_attr_setdetachstate.3:66
2146 msgid ""
2147 "Threads that are created using I<attr> will be created in a joinable state."
2148 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
2149
2150 #. type: Plain text
2151 #: build/C/man3/pthread_attr_setdetachstate.3:70
2152 msgid ""
2153 "The default setting of the detach state attribute in a newly initialized "
2154 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
2155 msgstr ""
2156 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
2157 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
2158
2159 #. type: Plain text
2160 #: build/C/man3/pthread_attr_setdetachstate.3:77
2161 msgid ""
2162 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
2163 "the thread attributes object I<attr> in the buffer pointed to by "
2164 "I<detachstate>."
2165 msgstr ""
2166 "B<pthread_attr_getdetachstate>() は、\n"
2167 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
2168 "I<detachstate> が指すバッファに入れて返す。"
2169
2170 #. type: Plain text
2171 #: build/C/man3/pthread_attr_setdetachstate.3:83
2172 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
2173 msgstr "B<pthread_attr_setdetachstate>() は以下のエラーで失敗する場合がある。"
2174
2175 #. type: Plain text
2176 #: build/C/man3/pthread_attr_setdetachstate.3:87
2177 msgid "An invalid value was specified in I<detachstate>."
2178 msgstr "無効な値が I<detachstate> で指定された。"
2179
2180 #. type: Plain text
2181 #: build/C/man3/pthread_attr_setdetachstate.3:94
2182 msgid ""
2183 "The B<pthread_attr_setdetachstate>()  and B<pthread_attr_getdetachstate>()  "
2184 "functions are thread-safe."
2185 msgstr ""
2186 "関数 B<pthread_attr_setdetachstate>() と B<pthread_attr_getdetachstate>() は"
2187 "スレッドセーフである。"
2188
2189 #. type: Plain text
2190 #: build/C/man3/pthread_attr_setdetachstate.3:100
2191 msgid ""
2192 "See B<pthread_create>(3)  for more details on detached and joinable threads."
2193 msgstr ""
2194 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
2195 "B<pthread_create>(3) を参照。"
2196
2197 #. type: Plain text
2198 #: build/C/man3/pthread_attr_setdetachstate.3:108
2199 msgid ""
2200 "A thread that is created in a joinable state should eventually either be "
2201 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
2202 "B<pthread_create>(3)."
2203 msgstr ""
2204 "join 可能状態で作成されたスレッドは、最終的に\n"
2205 "B<pthread_join>(3) を使って join するか、\n"
2206 "B<pthread_detach>(3) を使って切り離すか、\n"
2207 "のどちらかを行うべきである。"
2208
2209 #. type: Plain text
2210 #: build/C/man3/pthread_attr_setdetachstate.3:115
2211 msgid ""
2212 "It is an error to specify the thread ID of a thread that was created in a "
2213 "detached state in a later call to B<pthread_detach>(3)  or "
2214 "B<pthread_join>(3)."
2215 msgstr ""
2216 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
2217 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
2218 "エラーである。"
2219
2220 #. type: Plain text
2221 #: build/C/man3/pthread_attr_setdetachstate.3:118
2222 #: build/C/man3/pthread_attr_setstack.3:162
2223 msgid "See B<pthread_attr_init>(3)."
2224 msgstr "B<pthread_attr_init>(3) を参照。"
2225
2226 #. type: Plain text
2227 #: build/C/man3/pthread_attr_setdetachstate.3:124
2228 msgid ""
2229 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2230 "B<pthread_join>(3), B<pthreads>(7)"
2231 msgstr ""
2232 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2233 "B<pthread_join>(3), B<pthreads>(7)"
2234
2235 #. type: TH
2236 #: build/C/man3/pthread_attr_setguardsize.3:26
2237 #, no-wrap
2238 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2239 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2240
2241 #. type: Plain text
2242 #: build/C/man3/pthread_attr_setguardsize.3:30
2243 msgid ""
2244 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2245 "attribute in thread attributes object"
2246 msgstr ""
2247 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
2248 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
2249
2250 #. type: Plain text
2251 #: build/C/man3/pthread_attr_setguardsize.3:38
2252 #, no-wrap
2253 msgid ""
2254 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2255 "B<int pthread_attr_getguardsize(const pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2256 msgstr ""
2257 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2258 "B<int pthread_attr_getguardsize(const pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2259
2260 #. type: Plain text
2261 #: build/C/man3/pthread_attr_setguardsize.3:49
2262 msgid ""
2263 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
2264 "of the thread attributes object referred to by I<attr> to the value "
2265 "specified in I<guardsize>."
2266 msgstr ""
2267 "B<pthread_attr_setguardsize>() 関数は、\n"
2268 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
2269 "I<guardsize> で指定された値に設定する。"
2270
2271 #. type: Plain text
2272 #: build/C/man3/pthread_attr_setguardsize.3:59
2273 msgid ""
2274 "If I<guardsize> is greater than 0, then for each new thread created using "
2275 "I<attr> the system allocates an additional region of at least I<guardsize> "
2276 "bytes at the end of the thread's stack to act as the guard area for the "
2277 "stack (but see BUGS)."
2278 msgstr ""
2279 "I<guardsize> が 0 より大きい場合、\n"
2280 "I<attr> を使って新しく作成された各スレッドに対して、\n"
2281 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
2282 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
2283 "機能する (ただし「バグ」の節も参照)。"
2284
2285 #. type: Plain text
2286 #: build/C/man3/pthread_attr_setguardsize.3:65
2287 msgid ""
2288 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2289 "guard area."
2290 msgstr ""
2291 "I<guardsize> が 0 の場合、\n"
2292 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
2293
2294 #. type: Plain text
2295 #: build/C/man3/pthread_attr_setguardsize.3:67
2296 msgid "The default guard size is the same as the system page size."
2297 msgstr "デフォルトの guard size はシステムのページサイズと同じである。"
2298
2299 #. type: Plain text
2300 #: build/C/man3/pthread_attr_setguardsize.3:82
2301 msgid ""
2302 "If the stack address attribute has been set in I<attr> (using "
2303 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
2304 "that the caller is allocating the thread's stack, then the guard size "
2305 "attribute is ignored (i.e., no guard area is created by the system): it is "
2306 "the application's responsibility to handle stack overflow (perhaps by using "
2307 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
2308 "it has allocated)."
2309 msgstr ""
2310 "(B<pthread_attr_setstack>(3) や B<pthread_attr_setstackaddr>(3)を使って)\n"
2311 "I<attr> でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n"
2312 "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n"
2313 "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n"
2314 "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n"
2315 "ケーション側の責任となる (おそらく B<mprotect>(2) を使って、割り当て\n"
2316 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
2317
2318 #. type: Plain text
2319 #: build/C/man3/pthread_attr_setguardsize.3:90
2320 msgid ""
2321 "The B<pthread_attr_getguardsize>()  function returns the guard size "
2322 "attribute of the thread attributes object referred to by I<attr> in the "
2323 "buffer pointed to by I<guardsize>."
2324 msgstr ""
2325 "B<pthread_attr_getguardsize>() は、\n"
2326 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
2327 "I<guardsize> が指すバッファに入れて返す。"
2328
2329 #. type: Plain text
2330 #: build/C/man3/pthread_attr_setguardsize.3:104
2331 msgid ""
2332 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2333 "invalid.  On Linux these functions always succeed (but portable and future-"
2334 "proof applications should nevertheless handle a possible error return)."
2335 msgstr ""
2336 "POSIX.1-2001 では、エラー B<EINVAL> が\n"
2337 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2338 "Linux では、これらの関数は常に成功する\n"
2339 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2340 "正のエラーの返り値を処理するようにすべきである)。"
2341
2342 #. type: Plain text
2343 #: build/C/man3/pthread_attr_setguardsize.3:106
2344 #: build/C/man3/pthread_attr_setstackaddr.3:83
2345 #: build/C/man3/pthread_attr_setstacksize.3:83
2346 msgid "These functions are provided by glibc since version 2.1."
2347 msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。"
2348
2349 #. type: Plain text
2350 #: build/C/man3/pthread_attr_setguardsize.3:113
2351 msgid ""
2352 "The B<pthread_attr_setguardsize>()  and B<pthread_attr_getguardsize>()  "
2353 "functions are thread-safe."
2354 msgstr ""
2355 "関数 B<pthread_attr_setguardsize>() と B<pthread_attr_getguardsize>() はス"
2356 "レッドセーフである。"
2357
2358 #. type: Plain text
2359 #: build/C/man3/pthread_attr_setguardsize.3:129
2360 msgid ""
2361 "A guard area consists of virtual memory pages that are protected to prevent "
2362 "read and write access.  If a thread overflows its stack into the guard area, "
2363 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2364 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
2365 "guard size is internally rounded up to the system page size when creating a "
2366 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
2367 "size that was set by B<pthread_attr_setguardsize>().)"
2368 msgstr ""
2369 "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n"
2370 "られた仮想メモリページで構成で構成される。スレッドがスタックをガード\n"
2371 "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャ\n"
2372 "では、スレッドに B<SIGSEGV> シグナルが送られ、オーバーフローが発生した\n"
2373 "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n"
2374 "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n"
2375 "(その場合も B<pthread_attr_getguardsize>() では\n"
2376 "B<pthread_attr_setguardsize>() で設定された guard size が返される)。"
2377
2378 #. type: Plain text
2379 #: build/C/man3/pthread_attr_setguardsize.3:133
2380 msgid ""
2381 "Setting a guard size of 0 may be useful to save memory in an application "
2382 "that creates many threads and knows that stack overflow can never occur."
2383 msgstr ""
2384 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2385 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2386 "することで、メモリを節約できることもある。"
2387
2388 #. type: Plain text
2389 #: build/C/man3/pthread_attr_setguardsize.3:137
2390 msgid ""
2391 "Choosing a guard size larger than the default size may be necessary for "
2392 "detecting stack overflows if a thread allocates large data structures on the "
2393 "stack."
2394 msgstr ""
2395 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2396 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2397 "大きな guard size を選ぶ必要があるかもしれない。"
2398
2399 #. type: SH
2400 #: build/C/man3/pthread_attr_setguardsize.3:137
2401 #: build/C/man3/pthread_attr_setinheritsched.3:119
2402 #: build/C/man3/pthread_attr_setstacksize.3:103
2403 #: build/C/man3/pthread_create.3:203 build/C/man3/pthread_exit.3:98
2404 #: build/C/man3/pthread_rwlockattr_setkind_np.3:109
2405 #, no-wrap
2406 msgid "BUGS"
2407 msgstr "バグ"
2408
2409 #. type: Plain text
2410 #: build/C/man3/pthread_attr_setguardsize.3:148
2411 msgid ""
2412 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2413 "within the stack size allocation, rather than allocating extra space at the "
2414 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2415 "error from B<pthread_create>(3)  if the guard size value is too large, "
2416 "leaving no space for the actual stack.)"
2417 msgstr ""
2418 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2419 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2420 "末尾に追加の領域を割り当てることが求められている。\n"
2421 "(このため、ガード領域が大きすぎて、\n"
2422 "実際のスタック用の場所がなくなってしまう場合、\n"
2423 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2424
2425 #.  glibc includes the guardsize within the allocated stack size,
2426 #.  which looks pretty clearly to be in violation of POSIX.
2427 #.  Filed bug, 22 Oct 2008:
2428 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2429 #.  Older reports:
2430 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2431 #.  Reportedly, LinuxThreads did the right thing, allocating
2432 #.  extra space at the end of the stack:
2433 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2434 #. type: Plain text
2435 #: build/C/man3/pthread_attr_setguardsize.3:162
2436 msgid ""
2437 "The obsolete LinuxThreads implementation did the right thing, allocating "
2438 "extra space at the end of the stack for the guard area."
2439 msgstr ""
2440 "廃止予定の LinuxThreads 実装では、\n"
2441 "POSIX.1 で求められている通りの動作で、\n"
2442 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2443
2444 #. type: Plain text
2445 #: build/C/man3/pthread_attr_setguardsize.3:165
2446 msgid "See B<pthread_getattr_np>(3)."
2447 msgstr "B<pthread_getattr_np>(3) を参照。"
2448
2449 #. type: Plain text
2450 #: build/C/man3/pthread_attr_setguardsize.3:173
2451 msgid ""
2452 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), "
2453 "B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), "
2454 "B<pthread_create>(3), B<pthreads>(7)"
2455 msgstr ""
2456 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), "
2457 "B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), "
2458 "B<pthread_create>(3), B<pthreads>(7)"
2459
2460 #. type: TH
2461 #: build/C/man3/pthread_attr_setinheritsched.3:26
2462 #, no-wrap
2463 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2464 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2465
2466 #. type: TH
2467 #: build/C/man3/pthread_attr_setinheritsched.3:26
2468 #: build/C/man3/pthread_attr_setschedparam.3:26
2469 #: build/C/man3/pthread_attr_setschedpolicy.3:26 build/C/man7/pthreads.7:26
2470 #, no-wrap
2471 msgid "2014-05-21"
2472 msgstr "2014-05-21"
2473
2474 #. type: Plain text
2475 #: build/C/man3/pthread_attr_setinheritsched.3:30
2476 msgid ""
2477 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit-"
2478 "scheduler attribute in thread attributes object"
2479 msgstr ""
2480 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - スレッド属性オブ"
2481 "ジェクトの inherit-scheduler 属性の設定/取得を行う"
2482
2483 #. type: Plain text
2484 #: build/C/man3/pthread_attr_setinheritsched.3:38
2485 #, no-wrap
2486 msgid ""
2487 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2488 "B<                                 int >I<inheritsched>B<);>\n"
2489 "B<int pthread_attr_getinheritsched(const pthread_attr_t *>I<attr>B<,>\n"
2490 "B<                                 int *>I<inheritsched>B<);>\n"
2491 msgstr ""
2492 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2493 "B<                                 int >I<inheritsched>B<);>\n"
2494 "B<int pthread_attr_getinheritsched(const pthread_attr_t *>I<attr>B<,>\n"
2495 "B<                                 int *>I<inheritsched>B<);>\n"
2496
2497 #. type: Plain text
2498 #: build/C/man3/pthread_attr_setinheritsched.3:55
2499 msgid ""
2500 "The B<pthread_attr_setinheritsched>()  function sets the inherit-scheduler "
2501 "attribute of the thread attributes object referred to by I<attr> to the "
2502 "value specified in I<inheritsched>.  The inherit-scheduler attribute "
2503 "determines whether a thread created using the thread attributes object "
2504 "I<attr> will inherit its scheduling attributes from the calling thread or "
2505 "whether it will take them from I<attr>."
2506 msgstr ""
2507 "B<pthread_attr_setinheritsched>() 関数は、 I<attr> が参照するスレッド属性オブ"
2508 "ジェクトの inherit-scheduler 属性を I<inheritsched> で指定された値に設定す"
2509 "る。 inherit-scheduler 属性により、スレッド属性オブジェクト I<attr> を使って"
2510 "作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承するか、 "
2511 "I<attr> からスケジューリング属性を取得するかが決定される。"
2512
2513 #. type: Plain text
2514 #: build/C/man3/pthread_attr_setinheritsched.3:64
2515 msgid ""
2516 "The following scheduling attributes are affected by the inherit-scheduler "
2517 "attribute: scheduling policy (B<pthread_attr_setschedpolicy>(3)), scheduling "
2518 "priority (B<pthread_attr_setschedparam>(3)), and contention scope "
2519 "(B<pthread_attr_setscope>(3))."
2520 msgstr ""
2521 "次に挙げるスケジューリング属性は inherit-scheduler 属性の影響を受ける: スケ"
2522 "ジューリングポリシー (B<pthread_attr_setschedpolicy>(3))、 スケジューリング優"
2523 "先度 (B<pthread_attr_setschedparam>(3))、 contention scope "
2524 "(B<pthread_attr_setscope>(3))。"
2525
2526 #. type: Plain text
2527 #: build/C/man3/pthread_attr_setinheritsched.3:67
2528 msgid "The following values may be specified in I<inheritsched>:"
2529 msgstr "以下の値を I<inheritsched> に指定できる。"
2530
2531 #. type: TP
2532 #: build/C/man3/pthread_attr_setinheritsched.3:67
2533 #, no-wrap
2534 msgid "B<PTHREAD_INHERIT_SCHED>"
2535 msgstr "B<PTHREAD_INHERIT_SCHED>"
2536
2537 #. type: Plain text
2538 #: build/C/man3/pthread_attr_setinheritsched.3:75
2539 msgid ""
2540 "Threads that are created using I<attr> inherit scheduling attributes from "
2541 "the creating thread; the scheduling attributes in I<attr> are ignored."
2542 msgstr ""
2543 "I<attr> を使って作成されたスレッドは、\n"
2544 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2545 "I<attr> 内のスケジューリング属性は無視される。"
2546
2547 #. type: TP
2548 #: build/C/man3/pthread_attr_setinheritsched.3:75
2549 #, no-wrap
2550 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2551 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2552
2553 #.  FIXME Document the defaults for scheduler settings
2554 #. type: Plain text
2555 #: build/C/man3/pthread_attr_setinheritsched.3:82
2556 msgid ""
2557 "Threads that are created using I<attr> take their scheduling attributes from "
2558 "the values specified by the attributes object."
2559 msgstr ""
2560 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2561 "指定された値からスケジューリング属性を取得する。"
2562
2563 #. type: Plain text
2564 #: build/C/man3/pthread_attr_setinheritsched.3:86
2565 msgid ""
2566 "The default setting of the inherit-scheduler attribute in a newly "
2567 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2568 msgstr ""
2569 "新たに初期化されたスレッド属性オブジェクトの inherit-scheduler 属性のデフォル"
2570 "ト設定は B<PTHREAD_INHERIT_SCHED> である。"
2571
2572 #. type: Plain text
2573 #: build/C/man3/pthread_attr_setinheritsched.3:93
2574 msgid ""
2575 "The B<pthread_attr_getinheritsched>()  returns the inherit-scheduler "
2576 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2577 "by I<inheritsched>."
2578 msgstr ""
2579 "B<pthread_attr_getinheritsched>() は、 スレッド属性オブジェクト I<attr> の "
2580 "inherit-scheduler 属性を I<inheritsched> が指すバッファに入れて返す。"
2581
2582 #. type: Plain text
2583 #: build/C/man3/pthread_attr_setinheritsched.3:99
2584 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2585 msgstr "B<pthread_attr_setinheritsched>() は以下のエラーで失敗する場合がある。"
2586
2587 #. type: Plain text
2588 #: build/C/man3/pthread_attr_setinheritsched.3:103
2589 msgid "Invalid value in I<inheritsched>."
2590 msgstr "I<inheritsched> に無効な値が指定された。"
2591
2592 #.  .SH VERSIONS
2593 #.  Available since glibc 2.0.
2594 #. type: Plain text
2595 #: build/C/man3/pthread_attr_setinheritsched.3:110
2596 msgid ""
2597 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2598 "to set the attribute to an unsupported value\") for "
2599 "B<pthread_attr_setinheritsched>()."
2600 msgstr ""
2601 "POSIX.1-2001 では、 B<pthread_attr_setinheritsched>() に関して\n"
2602 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2603 "も追加で規定されている。"
2604
2605 #. type: Plain text
2606 #: build/C/man3/pthread_attr_setinheritsched.3:117
2607 msgid ""
2608 "The B<pthread_attr_setinheritsched>()  and "
2609 "B<pthread_attr_getinheritsched>()  functions are thread-safe."
2610 msgstr ""
2611 "関数 B<pthread_attr_setinheritsched>() と B<pthread_attr_getinheritsched>() "
2612 "はスレッドセーフである。"
2613
2614 #.  FIXME . Track status of the following bug:
2615 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2616 #. type: Plain text
2617 #: build/C/man3/pthread_attr_setinheritsched.3:135
2618 msgid ""
2619 "As at glibc 2.8, if a thread attributes object is initialized using "
2620 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2621 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2622 "if the inherit-scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2623 "then a thread created using the attribute object wrongly inherits its "
2624 "scheduling attributes from the creating thread.  This bug does not occur if "
2625 "either the scheduling policy or scheduling priority attribute is explicitly "
2626 "set in the thread attributes object before calling B<pthread_create>(3)."
2627 msgstr ""
2628 "glibc 2.8 の時点では、スレッド属性オブジェクトが B<pthread_attr_init>(3) を"
2629 "使って初期化された場合、 スレッド属性オブジェクトのスケジューリングポリシー"
2630 "が B<SCHED_OTHER> に、 スケジューリング優先度が 0 に設定される。一方、その後 "
2631 "inherit-scheduler 属性に B<PTHREAD_EXPLICIT_SCHED> が設定されると、このスレッ"
2632 "ド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するスレッド"
2633 "のスケジューリング属性が間違って継承されてしまう。 B<pthread_create>(3) を呼"
2634 "び出す前にスケジューリングポリシー属性かスケジューリング優先度属性のどちらか"
2635 "が明示的に設定された場合には、 このバグは発生しない。"
2636
2637 #. type: Plain text
2638 #: build/C/man3/pthread_attr_setinheritsched.3:138
2639 #: build/C/man3/pthread_attr_setschedparam.3:116
2640 #: build/C/man3/pthread_attr_setschedpolicy.3:112
2641 msgid "See B<pthread_setschedparam>(3)."
2642 msgstr "B<pthread_setschedparam>(3) を参照。"
2643
2644 #. type: Plain text
2645 #: build/C/man3/pthread_attr_setinheritsched.3:150
2646 msgid ""
2647 "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), "
2648 "B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), "
2649 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2650 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2651 msgstr ""
2652 "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), "
2653 "B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), "
2654 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2655 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2656
2657 #. type: TH
2658 #: build/C/man3/pthread_attr_setschedparam.3:26
2659 #, no-wrap
2660 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2661 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2662
2663 #. type: Plain text
2664 #: build/C/man3/pthread_attr_setschedparam.3:30
2665 msgid ""
2666 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2667 "parameter attributes in thread attributes object"
2668 msgstr ""
2669 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
2670 "スレッド属性オブジェクトのスケジューリングパラメータ属性の設定/取得を行う"
2671
2672 #. type: Plain text
2673 #: build/C/man3/pthread_attr_setschedparam.3:38
2674 #, no-wrap
2675 msgid ""
2676 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2677 "B<                               const struct sched_param *>I<param>B<);>\n"
2678 "B<int pthread_attr_getschedparam(const pthread_attr_t *>I<attr>B<,>\n"
2679 "B<                               struct sched_param *>I<param>B<);>\n"
2680 msgstr ""
2681 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2682 "B<                               const struct sched_param *>I<param>B<);>\n"
2683 "B<int pthread_attr_getschedparam(const pthread_attr_t *>I<attr>B<,>\n"
2684 "B<                               struct sched_param *>I<param>B<);>\n"
2685
2686 #. type: Plain text
2687 #: build/C/man3/pthread_attr_setschedparam.3:52
2688 msgid ""
2689 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2690 "attributes of the thread attributes object referred to by I<attr> to the "
2691 "values specified in the buffer pointed to by I<param>.  These attributes "
2692 "determine the scheduling parameters of a thread created using the thread "
2693 "attributes object I<attr>."
2694 msgstr ""
2695 "B<pthread_attr_setschedparam>() 関数は、\n"
2696 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2697 "パラメータ属性を I<param> が指すバッファで指定された値に設定する。\n"
2698 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2699 "作成されるスレッドのスケジューリングパラメータが決定される。"
2700
2701 #. type: Plain text
2702 #: build/C/man3/pthread_attr_setschedparam.3:59
2703 msgid ""
2704 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2705 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2706 "by I<param>."
2707 msgstr ""
2708 "B<pthread_attr_getschedparam>() は、\n"
2709 "スレッド属性オブジェクト I<attr> のスケジューリングパラメータ属性を\n"
2710 "I<param> が指すバッファに入れて返す。"
2711
2712 #. type: Plain text
2713 #: build/C/man3/pthread_attr_setschedparam.3:61
2714 msgid "Scheduling parameters are maintained in the following structure:"
2715 msgstr "スケジューリングパラメータは以下の構造体で管理される。"
2716
2717 #. type: Plain text
2718 #: build/C/man3/pthread_attr_setschedparam.3:67
2719 #: build/C/man3/pthread_setschedparam.3:69
2720 #, no-wrap
2721 msgid ""
2722 "struct sched_param {\n"
2723 "    int sched_priority;     /* Scheduling priority */\n"
2724 "};\n"
2725 msgstr ""
2726 "struct sched_param {\n"
2727 "    int sched_priority;     /* Scheduling priority */\n"
2728 "};\n"
2729
2730 #. type: Plain text
2731 #: build/C/man3/pthread_attr_setschedparam.3:74
2732 #: build/C/man3/pthread_setschedparam.3:76
2733 msgid ""
2734 "As can be seen, only one scheduling parameter is supported.  For details of "
2735 "the permitted ranges for scheduling priorities in each scheduling policy, "
2736 "see B<sched>(7)."
2737 msgstr ""
2738 "見て分かる通り、サポートされているスケジューリングパラメータは一つだけであ"
2739 "る。各スケジューリングポリシーで許可されるスケジューリング優先度の詳細につい"
2740 "ては、B<sched>(7) を参照のこと。"
2741
2742 #. type: Plain text
2743 #: build/C/man3/pthread_attr_setschedparam.3:85
2744 msgid ""
2745 "In order for the parameter setting made by B<pthread_attr_setschedparam>()  "
2746 "to have effect when calling B<pthread_create>(3), the caller must use "
2747 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2748 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2749 msgstr ""
2750 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedparam>() で行っ"
2751 "たパラメータ設定を有効にするには、 呼び出し側で "
2752 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
2753 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
2754 "ない。"
2755
2756 #.  .SH VERSIONS
2757 #.  Available since glibc 2.0.
2758 #. type: Plain text
2759 #: build/C/man3/pthread_attr_setschedparam.3:100
2760 msgid ""
2761 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2762 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2763 "(but portable and future-proof applications should nevertheless handle a "
2764 "possible error return)."
2765 msgstr ""
2766 "POSIX.1 では、\n"
2767 "B<pthread_attr_setschedparam>() について\n"
2768 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
2769 "Linux では、これらの関数は常に成功する\n"
2770 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2771 "正のエラーの返り値を処理するようにすべきである)。"
2772
2773 #. type: Plain text
2774 #: build/C/man3/pthread_attr_setschedparam.3:107
2775 msgid ""
2776 "The B<pthread_attr_setschedparam>()  and B<pthread_attr_getschedparam>()  "
2777 "functions are thread-safe."
2778 msgstr ""
2779 "関数 B<pthread_attr_setschedparam>() と B<pthread_attr_getschedparam>() はス"
2780 "レッドセーフである。"
2781
2782 #. type: Plain text
2783 #: build/C/man3/pthread_attr_setschedparam.3:113
2784 msgid ""
2785 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2786 "policies supported on Linux."
2787 msgstr ""
2788 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
2789 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
2790
2791 #. type: Plain text
2792 #: build/C/man3/pthread_attr_setschedparam.3:128
2793 msgid ""
2794 "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
2795 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2796 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2797 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2798 msgstr ""
2799 "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
2800 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2801 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2802 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2803
2804 #. type: TH
2805 #: build/C/man3/pthread_attr_setschedpolicy.3:26
2806 #, no-wrap
2807 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2808 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2809
2810 #. type: Plain text
2811 #: build/C/man3/pthread_attr_setschedpolicy.3:30
2812 msgid ""
2813 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2814 "scheduling policy attribute in thread attributes object"
2815 msgstr ""
2816 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
2817 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
2818
2819 #. type: Plain text
2820 #: build/C/man3/pthread_attr_setschedpolicy.3:38
2821 #, no-wrap
2822 msgid ""
2823 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2824 "B<int pthread_attr_getschedpolicy(const pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2825 msgstr ""
2826 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2827 "B<int pthread_attr_getschedpolicy(const pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2828
2829 #. type: Plain text
2830 #: build/C/man3/pthread_attr_setschedpolicy.3:52
2831 msgid ""
2832 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2833 "attribute of the thread attributes object referred to by I<attr> to the "
2834 "value specified in I<policy>.  This attribute determines the scheduling "
2835 "policy of a thread created using the thread attributes object I<attr>."
2836 msgstr ""
2837 "B<pthread_attr_setschedpolicy>() 関数は、\n"
2838 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2839 "ポリシー属性を I<policy> で指定された値に設定する。\n"
2840 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2841 "作成されるスレッドのスケジューリングポリシーが決定される。"
2842
2843 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2844 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2845 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2846 #. type: Plain text
2847 #: build/C/man3/pthread_attr_setschedpolicy.3:65
2848 msgid ""
2849 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2850 "B<SCHED_OTHER>, with the semantics described in B<sched>(7)."
2851 msgstr ""
2852 "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER> であ"
2853 "る。それぞれの意味は B<sched>(7) で説明している通りである。"
2854
2855 #. type: Plain text
2856 #: build/C/man3/pthread_attr_setschedpolicy.3:72
2857 msgid ""
2858 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2859 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2860 "by I<policy>."
2861 msgstr ""
2862 "B<pthread_attr_getschedpolicy>() は、\n"
2863 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
2864 "I<policy> が指すバッファに入れて返す。"
2865
2866 #. type: Plain text
2867 #: build/C/man3/pthread_attr_setschedpolicy.3:83
2868 msgid ""
2869 "In order for the policy setting made by B<pthread_attr_setschedpolicy>()  to "
2870 "have effect when calling B<pthread_create>(3), the caller must use "
2871 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2872 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2873 msgstr ""
2874 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedpolicy>() で行っ"
2875 "たポリシー設定を有効にするには、 呼び出し側で "
2876 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
2877 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
2878 "ない。"
2879
2880 #. type: Plain text
2881 #: build/C/man3/pthread_attr_setschedpolicy.3:89
2882 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2883 msgstr "B<pthread_attr_setschedpolicy>() は以下のエラーで失敗する場合がある。"
2884
2885 #. type: Plain text
2886 #: build/C/man3/pthread_attr_setschedpolicy.3:93
2887 msgid "Invalid value in I<policy>."
2888 msgstr "I<policy> に無効な値が指定された。"
2889
2890 #.  .SH VERSIONS
2891 #.  Available since glibc 2.0.
2892 #. type: Plain text
2893 #: build/C/man3/pthread_attr_setschedpolicy.3:100
2894 msgid ""
2895 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2896 "to set the attribute to an unsupported value\") for "
2897 "B<pthread_attr_setschedpolicy>()."
2898 msgstr ""
2899 "POSIX.1-2001 では、 B<pthread_attr_setschedpolicy>() に関して\n"
2900 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2901 "も追加で規定されている。"
2902
2903 #. type: Plain text
2904 #: build/C/man3/pthread_attr_setschedpolicy.3:107
2905 msgid ""
2906 "The B<pthread_attr_setschedpolicy>()  and B<pthread_attr_getschedpolicy>()  "
2907 "functions are thread-safe."
2908 msgstr ""
2909 "関数 B<pthread_attr_setschedpolicy>() と B<pthread_attr_getschedpolicy>() は"
2910 "スレッドセーフである。"
2911
2912 #. type: Plain text
2913 #: build/C/man3/pthread_attr_setschedpolicy.3:123
2914 msgid ""
2915 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
2916 "B<pthread_attr_setschedparam>(3), B<pthread_create>(3), "
2917 "B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), "
2918 "B<sched>(7)"
2919 msgstr ""
2920 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
2921 "B<pthread_attr_setschedparam>(3), B<pthread_create>(3), "
2922 "B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), "
2923 "B<sched>(7)"
2924
2925 #. type: TH
2926 #: build/C/man3/pthread_attr_setscope.3:26
2927 #, no-wrap
2928 msgid "PTHREAD_ATTR_SETSCOPE"
2929 msgstr "PTHREAD_ATTR_SETSCOPE"
2930
2931 #. type: Plain text
2932 #: build/C/man3/pthread_attr_setscope.3:30
2933 msgid ""
2934 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2935 "attribute in thread attributes object"
2936 msgstr ""
2937 "pthread_attr_setscope, pthread_attr_getscope - \n"
2938 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
2939
2940 #. type: Plain text
2941 #: build/C/man3/pthread_attr_setscope.3:38
2942 #, no-wrap
2943 msgid ""
2944 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2945 "B<int pthread_attr_getscope(const pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2946 msgstr ""
2947 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2948 "B<int pthread_attr_getscope(const pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2949
2950 #. type: Plain text
2951 #: build/C/man3/pthread_attr_setscope.3:53
2952 msgid ""
2953 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2954 "of the thread attributes object referred to by I<attr> to the value "
2955 "specified in I<scope>.  The contention scope attribute defines the set of "
2956 "threads against which a thread competes for resources such as the CPU.  "
2957 "POSIX.1-2001 specifies two possible values for I<scope>:"
2958 msgstr ""
2959 "B<pthread_attr_setscope>() 関数は、\n"
2960 "I<attr> が参照するスレッド属性オブジェクトの contention scope\n"
2961 "属性を I<scope> で指定された値に設定する。\n"
2962 "contention scope 属性により、\n"
2963 "スレッドが CPU などのリソースを取り合うスレッド集合が規定される。\n"
2964 "POSIX.1-2001 では I<scope> に指定する値として 2 つの値が規定されている。"
2965
2966 #. type: TP
2967 #: build/C/man3/pthread_attr_setscope.3:53
2968 #, no-wrap
2969 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2970 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2971
2972 #. type: Plain text
2973 #: build/C/man3/pthread_attr_setscope.3:61
2974 msgid ""
2975 "The thread competes for resources with all other threads in all processes on "
2976 "the system that are in the same scheduling allocation domain (a group of one "
2977 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2978 "to one another according to their scheduling policy and priority."
2979 msgstr ""
2980 "スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ\n"
2981 "のグループ) にある、システム上の全てのプロセスの自分以外の全ての\n"
2982 "スレッドとリソースを取り合う。 \n"
2983 "B<PTHREAD_SCOPE_SYSTEM> のスレッドは、スケジューリングポリシーと\n"
2984 "優先度に基づき、互いに相対的にスケジューリングされる。"
2985
2986 #. type: TP
2987 #: build/C/man3/pthread_attr_setscope.3:61
2988 #, no-wrap
2989 msgid "B<PTHREAD_SCOPE_PROCESS>"
2990 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2991
2992 #. type: Plain text
2993 #: build/C/man3/pthread_attr_setscope.3:76
2994 msgid ""
2995 "The thread competes for resources with all other threads in the same process "
2996 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
2997 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2998 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
2999 "leaves it unspecified how these threads contend with other threads in other "
3000 "process on the system or with other threads in the same process that were "
3001 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
3002 msgstr ""
3003 "スレッドは、contention scope が B<PTHREAD_SCOPE_PROCESS> で作成された\n"
3004 "同じプロセスの自分以外の全てのスレッドとリソースを取り合う。\n"
3005 "B<PTHREAD_SCOPE_PROCESS> のスレッドは、スケジューリングポリシーと優先度\n"
3006 "に基づき、同じプロセスの他のスレッドと相対的にスケジューリングされる。\n"
3007 "POSIX.1-2001 では、これらのスレッドがシステム上の他のプロセスのスレッド\n"
3008 "や同じプロセス内の contention scope が B<PTHREAD_SCOPE_SYSTEM> で作成\n"
3009 "された他のスレッドとどのようにリソースを取り合うかは、\n"
3010 "規定されないままになっている。"
3011
3012 #. type: Plain text
3013 #: build/C/man3/pthread_attr_setscope.3:83
3014 msgid ""
3015 "POSIX.1-2001 requires that an implementation support at least one of these "
3016 "contention scopes.  Linux supports B<PTHREAD_SCOPE_SYSTEM>, but not "
3017 "B<PTHREAD_SCOPE_PROCESS>."
3018 msgstr ""
3019 "POSIX.1-2001 で求められているのは、スレッド実装がこれらの contention scope の"
3020 "うち少なくとも 1 つをサポートすることだけである。 Linux は "
3021 "B<PTHREAD_SCOPE_SYSTEM> をサポートしているが、 B<PTHREAD_SCOPE_PROCESS> はサ"
3022 "ポートしていない。"
3023
3024 #. type: Plain text
3025 #: build/C/man3/pthread_attr_setscope.3:95
3026 msgid ""
3027 "On systems that support multiple contention scopes, then, in order for the "
3028 "parameter setting made by B<pthread_attr_setscope>()  to have effect when "
3029 "calling B<pthread_create>(3), the caller must use "
3030 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
3031 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
3032 msgstr ""
3033 "複数の contention scope をサポートしているシステムで、 B<pthread_create>(3) "
3034 "を呼び出した際に B<pthread_attr_setscope>() で行ったパラメータ設定を有効にす"
3035 "るには、 呼び出し側で B<pthread_attr_setinheritsched>(3) を使って 属性オブ"
3036 "ジェクト I<attr> の inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定"
3037 "しておかなければならない。"
3038
3039 #. type: Plain text
3040 #: build/C/man3/pthread_attr_setscope.3:103
3041 msgid ""
3042 "The B<pthread_attr_getscope>()  function returns the contention scope "
3043 "attribute of the thread attributes object referred to by I<attr> in the "
3044 "buffer pointed to by I<scope>."
3045 msgstr ""
3046 "B<pthread_attr_getscope>() は、\n"
3047 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
3048 "I<scope> が指すバッファに入れて返す。"
3049
3050 #. type: Plain text
3051 #: build/C/man3/pthread_attr_setscope.3:109
3052 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
3053 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
3054
3055 #. type: Plain text
3056 #: build/C/man3/pthread_attr_setscope.3:113
3057 msgid "An invalid value was specified in I<scope>."
3058 msgstr "I<scope> に無効な値が指定された。"
3059
3060 #. type: TP
3061 #: build/C/man3/pthread_attr_setscope.3:113
3062 #, no-wrap
3063 msgid "B<ENOTSUP>"
3064 msgstr "B<ENOTSUP>"
3065
3066 #. type: Plain text
3067 #: build/C/man3/pthread_attr_setscope.3:119
3068 msgid ""
3069 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
3070 "supported on Linux."
3071 msgstr ""
3072 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
3073 "この値は Linux でサポートされていない。"
3074
3075 #. type: Plain text
3076 #: build/C/man3/pthread_attr_setscope.3:126
3077 msgid ""
3078 "The B<pthread_attr_setscope>()  and B<pthread_attr_getscope>()  functions "
3079 "are thread-safe."
3080 msgstr ""
3081 "関数 B<pthread_attr_setscope>() と B<pthread_attr_getscope>() はスレッドセー"
3082 "フである。"
3083
3084 #. type: Plain text
3085 #: build/C/man3/pthread_attr_setscope.3:136
3086 msgid ""
3087 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a user-"
3088 "space thread is bound directly to a single kernel-scheduling entity.  This "
3089 "is the case on Linux for the obsolete LinuxThreads implementation and the "
3090 "modern NPTL implementation, which are both 1:1 threading implementations."
3091 msgstr ""
3092 "B<PTHREAD_SCOPE_SYSTEM> contention scope では、通常は、一つの\n"
3093 "ユーザ空間スレッドは一つのカーネルスケジューリング・エンティティに\n"
3094 "直接結び付けられる。\n"
3095 "Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに\n"
3096 "該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。"
3097
3098 #. type: Plain text
3099 #: build/C/man3/pthread_attr_setscope.3:139
3100 msgid ""
3101 "POSIX.1-2001 specifies that the default contention scope is implementation-"
3102 "defined."
3103 msgstr ""
3104 "POSIX.1-2001 では、 contention scope 属性のデフォルト値は\n"
3105 "実装時で定義されるものと規定されている。"
3106
3107 #. type: Plain text
3108 #: build/C/man3/pthread_attr_setscope.3:149
3109 msgid ""
3110 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3111 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3112 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3113 msgstr ""
3114 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3115 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3116 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3117
3118 #. type: TH
3119 #: build/C/man3/pthread_attr_setstack.3:26
3120 #, no-wrap
3121 msgid "PTHREAD_ATTR_SETSTACK"
3122 msgstr "PTHREAD_ATTR_SETSTACK"
3123
3124 #. type: Plain text
3125 #: build/C/man3/pthread_attr_setstack.3:30
3126 msgid ""
3127 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
3128 "thread attributes object"
3129 msgstr ""
3130 "pthread_attr_setstack, pthread_attr_getstack - \n"
3131 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
3132
3133 #. type: Plain text
3134 #: build/C/man3/pthread_attr_setstack.3:38
3135 #, no-wrap
3136 msgid ""
3137 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3138 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3139 "B<int pthread_attr_getstack(const pthread_attr_t *>I<attr>B<,>\n"
3140 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3141 msgstr ""
3142 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3143 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3144 "B<int pthread_attr_getstack(const pthread_attr_t *>I<attr>B<,>\n"
3145 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3146
3147 #. type: Plain text
3148 #: build/C/man3/pthread_attr_setstack.3:45
3149 #: build/C/man3/pthread_cleanup_push_defer_np.3:44
3150 #: build/C/man3/pthread_kill.3:41
3151 #: build/C/man3/pthread_rwlockattr_setkind_np.3:44
3152 #: build/C/man3/pthread_sigmask.3:42 build/C/man3/pthread_sigqueue.3:42
3153 msgid ""
3154 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3155 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
3156
3157 #. type: Plain text
3158 #: build/C/man3/pthread_attr_setstack.3:50
3159 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3160 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3161
3162 #. type: Plain text
3163 #: build/C/man3/pthread_attr_setstack.3:52
3164 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
3165 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
3166
3167 #. type: Plain text
3168 #: build/C/man3/pthread_attr_setstack.3:68
3169 msgid ""
3170 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
3171 "size attributes of the thread attributes object referred to by I<attr> to "
3172 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
3173 "attributes specify the location and size of the stack that should be used by "
3174 "a thread that is created using the thread attributes object I<attr>."
3175 msgstr ""
3176 "B<pthread_attr_setstack>() 関数は、\n"
3177 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
3178 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
3179 "指定された値に設定する。\n"
3180 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
3181 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
3182
3183 #. type: Plain text
3184 #: build/C/man3/pthread_attr_setstack.3:74
3185 msgid ""
3186 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
3187 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
3188 "allocated buffer should be both readable and writable."
3189 msgstr ""
3190 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
3191 "バッファ内の指定できる最小のアドレスバイトを指すべきである。\n"
3192 "割り当てられたバッファのページは読み書き両方が可能なページとなっている\n"
3193 "べきである。"
3194
3195 #. type: Plain text
3196 #: build/C/man3/pthread_attr_setstack.3:85
3197 msgid ""
3198 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
3199 "size attributes of the thread attributes object referred to by I<attr> in "
3200 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
3201 msgstr ""
3202 "B<pthread_attr_getstack>() 関数は、\n"
3203 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
3204 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
3205 "指すバッファに入れて返す。"
3206
3207 #. type: Plain text
3208 #: build/C/man3/pthread_attr_setstack.3:91
3209 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
3210 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
3211
3212 #. type: Plain text
3213 #: build/C/man3/pthread_attr_setstack.3:102
3214 msgid ""
3215 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
3216 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
3217 "stacksize> is not suitably aligned."
3218 msgstr ""
3219 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
3220 "システムによっては、 I<stackaddr> か\n"
3221 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
3222 "このエラーが発生する。"
3223
3224 #. type: Plain text
3225 #: build/C/man3/pthread_attr_setstack.3:110
3226 msgid ""
3227 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
3228 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
3229 "caller."
3230 msgstr ""
3231 "POSIX.1-2001 では エラー B<EACCES> も規定されており、\n"
3232 "このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に\n"
3233 "呼び出し側から読み書き両方のアクセスができない状況を表す。"
3234
3235 #. type: Plain text
3236 #: build/C/man3/pthread_attr_setstack.3:112
3237 msgid "These functions are provided by glibc since version 2.2."
3238 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
3239
3240 #. type: Plain text
3241 #: build/C/man3/pthread_attr_setstack.3:119
3242 msgid ""
3243 "The B<pthread_attr_setstack>()  and B<pthread_attr_getstack>()  functions "
3244 "are thread-safe."
3245 msgstr ""
3246 "関数 B<pthread_attr_setstack>() と B<pthread_attr_getstack>() はスレッドセー"
3247 "フである。"
3248
3249 #. type: Plain text
3250 #: build/C/man3/pthread_attr_setstack.3:129
3251 msgid ""
3252 "These functions are provided for applications that must ensure that a "
3253 "thread's stack is placed in a particular location.  For most applications, "
3254 "this is not necessary, and the use of these functions should be avoided.  "
3255 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
3256 "stack size other than the default.)"
3257 msgstr ""
3258 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
3259 "しなければならないアプリケーションのために提供されている。\n"
3260 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
3261 "これらの関数を使うのは避けるべきである。\n"
3262 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
3263 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
3264
3265 #. type: Plain text
3266 #: build/C/man3/pthread_attr_setstack.3:140
3267 msgid ""
3268 "When an application employs B<pthread_attr_setstack>(), it takes over the "
3269 "responsibility of allocating the stack.  Any guard size value that was set "
3270 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
3271 "is the application's responsibility to allocate a guard area (one or more "
3272 "pages protected against reading and writing)  to handle the possibility of "
3273 "stack overflow."
3274 msgstr ""
3275 "アプリケーションが B<pthread_attr_setstack>() を利用する際には、\n"
3276 "スタックの割り当てに責任を持つ必要がある。\n"
3277 "B<pthread_attr_setguardsize>(3) を使って設定された\n"
3278 "guard size の値は無視される。\n"
3279 "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n"
3280 "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n"
3281 "スタックオーバーフローの可能性に対処するようにする必要がある。"
3282
3283 #. type: Plain text
3284 #: build/C/man3/pthread_attr_setstack.3:151
3285 msgid ""
3286 "The address specified in I<stackaddr> should be suitably aligned: for full "
3287 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
3288 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
3289 "should also be a multiple of the system page size."
3290 msgstr ""
3291 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
3292 "完全な移植性を持たせるためには、\n"
3293 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
3294 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
3295 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
3296
3297 #. type: Plain text
3298 #: build/C/man3/pthread_attr_setstack.3:159
3299 msgid ""
3300 "If I<attr> is used to create multiple threads, then the caller must change "
3301 "the stack address attribute between calls to B<pthread_create>(3); "
3302 "otherwise, the threads will attempt to use the same memory area for their "
3303 "stacks, and chaos will ensue."
3304 msgstr ""
3305 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
3306 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
3307 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
3308 "さもなければ、複数のスレッドがスタックとして同じメモリ領域を\n"
3309 "使おうとするため、訳の分からない状況が発生してしまう。"
3310
3311 #. type: Plain text
3312 #: build/C/man3/pthread_attr_setstack.3:174
3313 msgid ""
3314 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3315 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3316 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3317 msgstr ""
3318 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3319 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3320 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3321
3322 #. type: TH
3323 #: build/C/man3/pthread_attr_setstackaddr.3:26
3324 #, no-wrap
3325 msgid "PTHREAD_ATTR_SETSTACKADDR"
3326 msgstr "PTHREAD_ATTR_SETSTACKADDR"
3327
3328 #. type: Plain text
3329 #: build/C/man3/pthread_attr_setstackaddr.3:30
3330 msgid ""
3331 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
3332 "attribute in thread attributes object"
3333 msgstr ""
3334 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
3335 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
3336
3337 #. type: Plain text
3338 #: build/C/man3/pthread_attr_setstackaddr.3:38
3339 #, no-wrap
3340 msgid ""
3341 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3342 "B<int pthread_attr_getstackaddr(const pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3343 msgstr ""
3344 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3345 "B<int pthread_attr_getstackaddr(const pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3346
3347 #. type: Plain text
3348 #: build/C/man3/pthread_attr_setstackaddr.3:49
3349 msgid ""
3350 "These functions are obsolete: B<do not use them.> Use "
3351 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
3352 msgstr ""
3353 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
3354 "代わりに B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使うこ"
3355 "と。"
3356
3357 #. type: Plain text
3358 #: build/C/man3/pthread_attr_setstackaddr.3:60
3359 msgid ""
3360 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
3361 "attribute of the thread attributes object referred to by I<attr> to the "
3362 "value specified in I<stackaddr>.  This attribute specifies the location of "
3363 "the stack that should be used by a thread that is created using the thread "
3364 "attributes object I<attr>."
3365 msgstr ""
3366 "B<pthread_attr_setstackaddr>() 関数は、\n"
3367 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3368 "属性を I<stackaddr> で指定された値に設定する。\n"
3369 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3370 "作成されるスレッドが使用すべきスタックの位置が指定される。"
3371
3372 #. type: Plain text
3373 #: build/C/man3/pthread_attr_setstackaddr.3:66
3374 msgid ""
3375 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
3376 "that was allocated by the caller.  The pages of the allocated buffer should "
3377 "be both readable and writable."
3378 msgstr ""
3379 "I<stackaddr> は呼び出し側が割り当てたバッファ (大きさは\n"
3380 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
3381 "割り当てられたバッファのページは読み書き両方が可能なページと\n"
3382 "なっているべきである。"
3383
3384 #. type: Plain text
3385 #: build/C/man3/pthread_attr_setstackaddr.3:74
3386 msgid ""
3387 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
3388 "attribute of the thread attributes object referred to by I<attr> in the "
3389 "buffer pointed to by I<stackaddr>."
3390 msgstr ""
3391 "B<pthread_attr_getstackaddr>() は、\n"
3392 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3393 "I<stackaddr> が指すバッファに入れて返す。"
3394
3395 #. type: Plain text
3396 #: build/C/man3/pthread_attr_setstackaddr.3:81
3397 msgid ""
3398 "No errors are defined (but applications should nevertheless handle a "
3399 "possible error return)."
3400 msgstr ""
3401 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
3402 "返り値を処理するようにすべきである)。"
3403
3404 #. type: Plain text
3405 #: build/C/man3/pthread_attr_setstackaddr.3:90
3406 msgid ""
3407 "The B<pthread_attr_setstackaddr>()  and B<pthread_attr_getstackaddr>()  "
3408 "functions are thread-safe."
3409 msgstr ""
3410 "関数 B<pthread_attr_setstackaddr>() と B<pthread_attr_getstackaddr>() はス"
3411 "レッドセーフである。"
3412
3413 #. type: Plain text
3414 #: build/C/man3/pthread_attr_setstackaddr.3:93
3415 msgid ""
3416 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
3417 "POSIX.1-2008 removes the specification of these functions."
3418 msgstr ""
3419 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
3420 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
3421
3422 #. type: Plain text
3423 #: build/C/man3/pthread_attr_setstackaddr.3:117
3424 msgid ""
3425 "I<Do not use these functions!> They cannot be portably used, since they "
3426 "provide no way of specifying the direction of growth or the range of the "
3427 "stack.  For example, on architectures with a stack that grows downward, "
3428 "I<stackaddr> specifies the next address past the I<highest> address of the "
3429 "allocated stack area.  However, on architectures with a stack that grows "
3430 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
3431 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
3432 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
3433 "in the allocated stack area (and the I<stacksize> argument specifies the "
3434 "range of the stack)."
3435 msgstr ""
3436 "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n"
3437 "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n"
3438 "かを指定する手段が提供されていないからである。\n"
3439 "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャ\n"
3440 "では、I<stackaddr> には割り当てられたスタック領域のI<最も大きな>アドレ\n"
3441 "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n"
3442 "方向) に伸びるアーキテクチャでは、I<stackaddr> には割り当てられた\n"
3443 "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n"
3444 "B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) が使用する\n"
3445 "I<stackaddr> は、常に割り当てられたスタック領域の最も小さいアドレス\n"
3446 "へのポインタである (I<stacksize> 引き数はスタックの範囲を指定する)。"
3447
3448 #. type: Plain text
3449 #: build/C/man3/pthread_attr_setstackaddr.3:123
3450 msgid ""
3451 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3452 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3453 msgstr ""
3454 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3455 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3456
3457 #. type: TH
3458 #: build/C/man3/pthread_attr_setstacksize.3:26
3459 #, no-wrap
3460 msgid "PTHREAD_ATTR_SETSTACKSIZE"
3461 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
3462
3463 #. type: Plain text
3464 #: build/C/man3/pthread_attr_setstacksize.3:30
3465 msgid ""
3466 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
3467 "attribute in thread attributes object"
3468 msgstr ""
3469 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
3470 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
3471
3472 #. type: Plain text
3473 #: build/C/man3/pthread_attr_setstacksize.3:38
3474 #, no-wrap
3475 msgid ""
3476 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3477 "B<int pthread_attr_getstacksize(const pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3478 msgstr ""
3479 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3480 "B<int pthread_attr_getstacksize(const pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3481
3482 #. type: Plain text
3483 #: build/C/man3/pthread_attr_setstacksize.3:49
3484 msgid ""
3485 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
3486 "of the thread attributes object referred to by I<attr> to the value "
3487 "specified in I<stacksize>."
3488 msgstr ""
3489 "B<pthread_attr_setstacksize>() 関数は、\n"
3490 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3491 "属性を I<stacksize> で指定された値に設定する。"
3492
3493 #. type: Plain text
3494 #: build/C/man3/pthread_attr_setstacksize.3:53
3495 msgid ""
3496 "The stack size attribute determines the minimum size (in bytes) that will be "
3497 "allocated for threads created using the thread attributes object I<attr>."
3498 msgstr ""
3499 "スタックサイズ属性により、\n"
3500 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
3501 "に割り当てられる最小サイズ (バイト単位) が決定される。"
3502
3503 #. type: Plain text
3504 #: build/C/man3/pthread_attr_setstacksize.3:61
3505 msgid ""
3506 "The B<pthread_attr_getstacksize>()  function returns the stack size "
3507 "attribute of the thread attributes object referred to by I<attr> in the "
3508 "buffer pointed to by I<stacksize>."
3509 msgstr ""
3510 "B<pthread_attr_getstacksize>() は、\n"
3511 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3512 "I<stacksize> が指すバッファに入れて返す。"
3513
3514 #. type: Plain text
3515 #: build/C/man3/pthread_attr_setstacksize.3:67
3516 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
3517 msgstr "B<pthread_attr_setstacksize>() は以下のエラーで失敗する場合がある。"
3518
3519 #. type: Plain text
3520 #: build/C/man3/pthread_attr_setstacksize.3:72
3521 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
3522 msgstr "スタックサイズが B<PTHREAD_STACK_MIN> (16384) バイト未満である。"
3523
3524 #.  e.g., MacOS
3525 #. type: Plain text
3526 #: build/C/man3/pthread_attr_setstacksize.3:81
3527 msgid ""
3528 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
3529 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
3530 msgstr ""
3531 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
3532 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
3533 "エラー B<EINVAL> で失敗する。"
3534
3535 #. type: Plain text
3536 #: build/C/man3/pthread_attr_setstacksize.3:90
3537 msgid ""
3538 "The B<pthread_attr_setstacksize>()  and B<pthread_attr_getstacksize>()  "
3539 "functions are thread-safe."
3540 msgstr ""
3541 "関数 B<pthread_attr_setstacksize>() と B<pthread_attr_getstacksize>() はス"
3542 "レッドセーフである。"
3543
3544 #. type: Plain text
3545 #: build/C/man3/pthread_attr_setstacksize.3:95
3546 msgid ""
3547 "For details on the default stack size of new threads, see "
3548 "B<pthread_create>(3)."
3549 msgstr ""
3550 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
3551 "B<pthread_create>(3) を参照。"
3552
3553 #. type: Plain text
3554 #: build/C/man3/pthread_attr_setstacksize.3:98
3555 msgid ""
3556 "A thread's stack size is fixed at the time of thread creation.  Only the "
3557 "main thread can dynamically grow its stack."
3558 msgstr ""
3559 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
3560 "メインスレッドだけがスタックを動的に伸ばすことができる。"
3561
3562 #. type: Plain text
3563 #: build/C/man3/pthread_attr_setstacksize.3:103
3564 msgid ""
3565 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
3566 "the size and location of a caller-allocated stack that is to be used by a "
3567 "thread."
3568 msgstr ""
3569 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
3570 "アプリケーションは、スレッドが使用するスタックとして、\n"
3571 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
3572
3573 #. type: Plain text
3574 #: build/C/man3/pthread_attr_setstacksize.3:115
3575 msgid ""
3576 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
3577 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
3578 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
3579 "stack will be at least I<stacksize> bytes."
3580 msgstr ""
3581 "glibc 2.8 の時点では、指定された I<stacksize> が B<STACK_ALIGN> \n"
3582 "(ほとんどのアーキテクチャでは 16 バイト) の倍数でない場合、\n"
3583 "I<stacksize> はI<小さくなる方向に>に丸められる。\n"
3584 "これは POSIX.1-2001 に違反している。\n"
3585 "POSIX.1-2001 では、割り当てらたスタックの大きさは\n"
3586 "少なくとも I<stacksize> バイトになると書かれている。"
3587
3588 #. type: Plain text
3589 #: build/C/man3/pthread_attr_setstacksize.3:118
3590 #: build/C/man3/pthread_join.3:127
3591 msgid "See B<pthread_create>(3)."
3592 msgstr "B<pthread_create>(3) を参照。"
3593
3594 #. type: Plain text
3595 #: build/C/man3/pthread_attr_setstacksize.3:125
3596 msgid ""
3597 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3598 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3599 msgstr ""
3600 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3601 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3602
3603 #. type: TH
3604 #: build/C/man3/pthread_cancel.3:26
3605 #, no-wrap
3606 msgid "PTHREAD_CANCEL"
3607 msgstr "PTHREAD_CANCEL"
3608
3609 #. type: TH
3610 #: build/C/man3/pthread_cancel.3:26
3611 #, no-wrap
3612 msgid "2008-11-17"
3613 msgstr "2008-11-17"
3614
3615 #. type: Plain text
3616 #: build/C/man3/pthread_cancel.3:29
3617 msgid "pthread_cancel - send a cancellation request to a thread"
3618 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
3619
3620 #. type: Plain text
3621 #: build/C/man3/pthread_cancel.3:34
3622 #, no-wrap
3623 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3624 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3625
3626 #. type: Plain text
3627 #: build/C/man3/pthread_cancel.3:49
3628 msgid ""
3629 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
3630 "I<thread>.  Whether and when the target thread reacts to the cancellation "
3631 "request depends on two attributes that are under the control of that thread: "
3632 "its cancelability I<state> and I<type>."
3633 msgstr ""
3634 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
3635 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
3636 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
3637 "I<state> と I<type>により決まる。"
3638
3639 #. type: Plain text
3640 #: build/C/man3/pthread_cancel.3:61
3641 msgid ""
3642 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
3643 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
3644 "has disabled cancellation, then a cancellation request remains queued until "
3645 "the thread enables cancellation.  If a thread has enabled cancellation, then "
3646 "its cancelability type determines when cancellation occurs."
3647 msgstr ""
3648 "あるスレッドの cancelability state は B<pthread_setcancelstate>(3) で\n"
3649 "設定され、I<enabled> と I<disabled> のいずれとなる (I<enabled> が新しい\n"
3650 "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n"
3651 "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n"
3652 "れたままになる。スレッドがキャンセルを有効にしていた場合、\n"
3653 "cancelability type によって、いつキャンセルが発生するかが決まる。"
3654
3655 #. type: Plain text
3656 #: build/C/man3/pthread_cancel.3:77
3657 msgid ""
3658 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3659 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
3660 "Asynchronous cancelability means that the thread can be canceled at any time "
3661 "(usually immediately, but the system does not guarantee this).  Deferred "
3662 "cancelability means that cancellation will be delayed until the thread next "
3663 "calls a function that is a I<cancellation point>.  A list of functions that "
3664 "are or may be cancellation points is provided in B<pthreads>(7)."
3665 msgstr ""
3666 "スレッドのキャンセル種別 (cancelability type) は\n"
3667 "B<pthread_setcanceltype>(3) で設定され、I<asynchronous> か I<deferred>\n"
3668 "のいずれかとなる(I<deferred> が新しいスレッドのデフォルト値である)。\n"
3669 "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつで\n"
3670 "もキャンセルされることを意味する (通常はすぐにキャンセルされるが、\n"
3671 "システムがそのことを保証しているわけではない)。遅延キャンセル\n"
3672 "(deferred cancelability) では、そのスレッドが I<取り消しポイント\n"
3673 "(cancellation point)> となっている関数を次に呼び出すまでキャンセルが\n"
3674 "遅延される。取り消しポイントに設定されていたり設定\n"
3675 "したりできる関数のリストは B<pthreads>(7) に記載している。"
3676
3677 #. type: Plain text
3678 #: build/C/man3/pthread_cancel.3:81
3679 msgid ""
3680 "When a cancellation requested is acted on, the following steps occur for "
3681 "I<thread> (in this order):"
3682 msgstr ""
3683 "キャンセル要求が実行されると、\n"
3684 "I<thread> では以下のステップが (この順序で) 行われる。"
3685
3686 #. type: IP
3687 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:69
3688 #, no-wrap
3689 msgid "1."
3690 msgstr "1."
3691
3692 #. type: Plain text
3693 #: build/C/man3/pthread_cancel.3:86
3694 msgid ""
3695 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3696 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
3697 msgstr ""
3698 "キャンセルクリーンアップハンドラが (push されたのと逆順で)\n"
3699 "取り出され (pop され)、呼び出される。\n"
3700 "(B<pthread_cleanup_push>(3) 参照)"
3701
3702 #. type: IP
3703 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:73
3704 #, no-wrap
3705 msgid "2."
3706 msgstr "2."
3707
3708 #. type: Plain text
3709 #: build/C/man3/pthread_cancel.3:91
3710 msgid ""
3711 "Thread-specific data destructors are called, in an unspecified order.  (See "
3712 "B<pthread_key_create>(3).)"
3713 msgstr ""
3714 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
3715 "呼び出し順序は規定されていない。\n"
3716 "(B<pthread_key_create>(3) 参照)"
3717
3718 #. type: IP
3719 #: build/C/man3/pthread_cancel.3:91 build/C/man3/pthread_cleanup_push.3:83
3720 #, no-wrap
3721 msgid "3."
3722 msgstr "3."
3723
3724 #. type: Plain text
3725 #: build/C/man3/pthread_cancel.3:95
3726 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3727 msgstr "スレッドが終了される。 (B<pthread_exit>(3) 参照)"
3728
3729 #. type: Plain text
3730 #: build/C/man3/pthread_cancel.3:103
3731 msgid ""
3732 "The above steps happen asynchronously with respect to the "
3733 "B<pthread_cancel>()  call; the return status of B<pthread_cancel>()  merely "
3734 "informs the caller whether the cancellation request was successfully queued."
3735 msgstr ""
3736 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
3737 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
3738 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
3739
3740 #. type: Plain text
3741 #: build/C/man3/pthread_cancel.3:112
3742 msgid ""
3743 "After a canceled thread has terminated, a join with that thread using "
3744 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
3745 "status.  (Joining with a thread is the only way to know that cancellation "
3746 "has completed.)"
3747 msgstr ""
3748 "キャンセルされたスレッドが終了された後に、\n"
3749 "B<pthread_join>(3) でそのスレッドを join すると、\n"
3750 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
3751 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
3752
3753 #. type: Plain text
3754 #: build/C/man3/pthread_cancel.3:117
3755 msgid ""
3756 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
3757 "error number."
3758 msgstr ""
3759 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
3760 "エラーの場合、0 以外のエラー番号を返す。"
3761
3762 #. type: TP
3763 #: build/C/man3/pthread_cancel.3:118 build/C/man3/pthread_detach.3:59
3764 #: build/C/man3/pthread_getcpuclockid.3:58 build/C/man3/pthread_join.3:93
3765 #: build/C/man3/pthread_setaffinity_np.3:114
3766 #: build/C/man3/pthread_setschedparam.3:114
3767 #: build/C/man3/pthread_setschedprio.3:70 build/C/man3/pthread_sigqueue.3:86
3768 #, no-wrap
3769 msgid "B<ESRCH>"
3770 msgstr "B<ESRCH>"
3771
3772 #. type: Plain text
3773 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_detach.3:64
3774 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:98
3775 #: build/C/man3/pthread_setaffinity_np.3:119
3776 #: build/C/man3/pthread_setschedparam.3:119
3777 #: build/C/man3/pthread_setschedprio.3:75
3778 msgid "No thread with the ID I<thread> could be found."
3779 msgstr "ID が I<thread> のスレッドが見つからなかった。"
3780
3781 #. type: Plain text
3782 #: build/C/man3/pthread_cancel.3:135
3783 msgid ""
3784 "On Linux, cancellation is implemented using signals.  Under the NPTL "
3785 "threading implementation, the first real-time signal (i.e., signal 32) is "
3786 "used for this purpose.  On LinuxThreads, the second real-time signal is "
3787 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3788 msgstr ""
3789 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装で"
3790 "は、\n"
3791 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
3792 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイ"
3793 "ム\n"
3794 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
3795
3796 #. type: Plain text
3797 #: build/C/man3/pthread_cancel.3:141
3798 msgid ""
3799 "The program below creates a thread and then cancels it.  The main thread "
3800 "joins with the canceled thread to check that its exit status was "
3801 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
3802 "run the program:"
3803 msgstr ""
3804 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルす"
3805 "る。\n"
3806 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
3807 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
3808 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
3809
3810 #. type: Plain text
3811 #: build/C/man3/pthread_cancel.3:149
3812 #, no-wrap
3813 msgid ""
3814 "$ ./a.out\n"
3815 "thread_func(): started; cancellation disabled\n"
3816 "main(): sending cancellation request\n"
3817 "thread_func(): about to enable cancellation\n"
3818 "main(): thread was canceled\n"
3819 msgstr ""
3820 "$ ./a.out\n"
3821 "thread_func(): started; cancellation disabled\n"
3822 "main(): sending cancellation request\n"
3823 "thread_func(): about to enable cancellation\n"
3824 "main(): thread was canceled\n"
3825
3826 #. type: Plain text
3827 #: build/C/man3/pthread_cancel.3:159
3828 #, no-wrap
3829 msgid ""
3830 "#include E<lt>pthread.hE<gt>\n"
3831 "#include E<lt>stdio.hE<gt>\n"
3832 "#include E<lt>errno.hE<gt>\n"
3833 "#include E<lt>stdlib.hE<gt>\n"
3834 "#include E<lt>unistd.hE<gt>\n"
3835 msgstr ""
3836 "#include E<lt>pthread.hE<gt>\n"
3837 "#include E<lt>stdio.hE<gt>\n"
3838 "#include E<lt>errno.hE<gt>\n"
3839 "#include E<lt>stdlib.hE<gt>\n"
3840 "#include E<lt>unistd.hE<gt>\n"
3841
3842 #. type: Plain text
3843 #: build/C/man3/pthread_cancel.3:167
3844 #, no-wrap
3845 msgid ""
3846 "static void *\n"
3847 "thread_func(void *ignored_argument)\n"
3848 "{\n"
3849 "    int s;\n"
3850 msgstr ""
3851 "static void *\n"
3852 "thread_func(void *ignored_argument)\n"
3853 "{\n"
3854 "    int s;\n"
3855
3856 #. type: Plain text
3857 #: build/C/man3/pthread_cancel.3:170
3858 #, no-wrap
3859 msgid ""
3860 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3861 "       immediately react to a cancellation request */\n"
3862 msgstr ""
3863 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3864 "       immediately react to a cancellation request */\n"
3865
3866 #. type: Plain text
3867 #: build/C/man3/pthread_cancel.3:174
3868 #, no-wrap
3869 msgid ""
3870 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3871 "    if (s != 0)\n"
3872 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3873 msgstr ""
3874 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3875 "    if (s != 0)\n"
3876 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3877
3878 #. type: Plain text
3879 #: build/C/man3/pthread_cancel.3:178
3880 #, no-wrap
3881 msgid ""
3882 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3883 "    sleep(5);\n"
3884 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3885 msgstr ""
3886 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3887 "    sleep(5);\n"
3888 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3889
3890 #. type: Plain text
3891 #: build/C/man3/pthread_cancel.3:182
3892 #, no-wrap
3893 msgid ""
3894 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3895 "    if (s != 0)\n"
3896 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3897 msgstr ""
3898 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3899 "    if (s != 0)\n"
3900 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3901
3902 #. type: Plain text
3903 #: build/C/man3/pthread_cancel.3:184
3904 #, no-wrap
3905 msgid "    /* sleep() is a cancellation point */\n"
3906 msgstr "    /* sleep() is a cancellation point */\n"
3907
3908 #. type: Plain text
3909 #: build/C/man3/pthread_cancel.3:186
3910 #, no-wrap
3911 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3912 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3913
3914 #. type: Plain text
3915 #: build/C/man3/pthread_cancel.3:188
3916 #, no-wrap
3917 msgid "    /* Should never get here */\n"
3918 msgstr "    /* Should never get here */\n"
3919
3920 #. type: Plain text
3921 #: build/C/man3/pthread_cancel.3:192
3922 #, no-wrap
3923 msgid ""
3924 "    printf(\"thread_func(): not canceled!\\en\");\n"
3925 "    return NULL;\n"
3926 "}\n"
3927 msgstr ""
3928 "    printf(\"thread_func(): not canceled!\\en\");\n"
3929 "    return NULL;\n"
3930 "}\n"
3931
3932 #. type: Plain text
3933 #: build/C/man3/pthread_cancel.3:199
3934 #, no-wrap
3935 msgid ""
3936 "int\n"
3937 "main(void)\n"
3938 "{\n"
3939 "    pthread_t thr;\n"
3940 "    void *res;\n"
3941 "    int s;\n"
3942 msgstr ""
3943 "int\n"
3944 "main(void)\n"
3945 "{\n"
3946 "    pthread_t thr;\n"
3947 "    void *res;\n"
3948 "    int s;\n"
3949
3950 #. type: Plain text
3951 #: build/C/man3/pthread_cancel.3:201
3952 #, no-wrap
3953 msgid "    /* Start a thread and then send it a cancellation request */\n"
3954 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3955
3956 #. type: Plain text
3957 #: build/C/man3/pthread_cancel.3:205
3958 #, no-wrap
3959 msgid ""
3960 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3961 "    if (s != 0)\n"
3962 "        handle_error_en(s, \"pthread_create\");\n"
3963 msgstr ""
3964 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3965 "    if (s != 0)\n"
3966 "        handle_error_en(s, \"pthread_create\");\n"
3967
3968 #. type: Plain text
3969 #: build/C/man3/pthread_cancel.3:207
3970 #, no-wrap
3971 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3972 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3973
3974 #. type: Plain text
3975 #: build/C/man3/pthread_cancel.3:212
3976 #, no-wrap
3977 msgid ""
3978 "    printf(\"main(): sending cancellation request\\en\");\n"
3979 "    s = pthread_cancel(thr);\n"
3980 "    if (s != 0)\n"
3981 "        handle_error_en(s, \"pthread_cancel\");\n"
3982 msgstr ""
3983 "    printf(\"main(): sending cancellation request\\en\");\n"
3984 "    s = pthread_cancel(thr);\n"
3985 "    if (s != 0)\n"
3986 "        handle_error_en(s, \"pthread_cancel\");\n"
3987
3988 #. type: Plain text
3989 #: build/C/man3/pthread_cancel.3:214
3990 #, no-wrap
3991 msgid "    /* Join with thread to see what its exit status was */\n"
3992 msgstr "    /* Join with thread to see what its exit status was */\n"
3993
3994 #. type: Plain text
3995 #: build/C/man3/pthread_cancel.3:218 build/C/man3/pthread_cleanup_push.3:307
3996 #, no-wrap
3997 msgid ""
3998 "    s = pthread_join(thr, &res);\n"
3999 "    if (s != 0)\n"
4000 "        handle_error_en(s, \"pthread_join\");\n"
4001 msgstr ""
4002 "    s = pthread_join(thr, &res);\n"
4003 "    if (s != 0)\n"
4004 "        handle_error_en(s, \"pthread_join\");\n"
4005
4006 #. type: Plain text
4007 #: build/C/man3/pthread_cancel.3:225
4008 #, no-wrap
4009 msgid ""
4010 "    if (res == PTHREAD_CANCELED)\n"
4011 "        printf(\"main(): thread was canceled\\en\");\n"
4012 "    else\n"
4013 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
4014 "    exit(EXIT_SUCCESS);\n"
4015 "}\n"
4016 msgstr ""
4017 "    if (res == PTHREAD_CANCELED)\n"
4018 "        printf(\"main(): thread was canceled\\en\");\n"
4019 "    else\n"
4020 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
4021 "    exit(EXIT_SUCCESS);\n"
4022 "}\n"
4023
4024 #. type: Plain text
4025 #: build/C/man3/pthread_cancel.3:238
4026 msgid ""
4027 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
4028 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
4029 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4030 msgstr ""
4031 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
4032 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
4033 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4034
4035 #. type: TH
4036 #: build/C/man3/pthread_cleanup_push.3:26
4037 #, no-wrap
4038 msgid "PTHREAD_CLEANUP_PUSH"
4039 msgstr "PTHREAD_CLEANUP_PUSH"
4040
4041 #. type: TH
4042 #: build/C/man3/pthread_cleanup_push.3:26
4043 #, no-wrap
4044 msgid "2008-11-24"
4045 msgstr "2008-11-24"
4046
4047 #. type: Plain text
4048 #: build/C/man3/pthread_cleanup_push.3:30
4049 msgid ""
4050 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
4051 "clean-up handlers"
4052 msgstr ""
4053 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
4054 "キャンセルクリーンアップハンドラの push/pop を行う"
4055
4056 #. type: Plain text
4057 #: build/C/man3/pthread_cleanup_push.3:37
4058 #, no-wrap
4059 msgid ""
4060 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
4061 "B<                          void *>I<arg>B<);>\n"
4062 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
4063 msgstr ""
4064 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
4065 "B<                          void *>I<arg>B<);>\n"
4066 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
4067
4068 #. type: Plain text
4069 #: build/C/man3/pthread_cleanup_push.3:48
4070 msgid ""
4071 "These functions manipulate the calling thread's stack of thread-cancellation "
4072 "clean-up handlers.  A clean-up handler is a function that is automatically "
4073 "executed when a thread is canceled (or in various other circumstances "
4074 "described below); it might, for example, unlock a mutex so that it becomes "
4075 "available to other threads in the process."
4076 msgstr ""
4077 "これらの関数は、呼び出したスレッドのスレッドキャンセル時のクリーンアッ\n"
4078 "プハンドラのスタックの操作を行う。クリーンアップハンドラは、スレッドが\n"
4079 "キャンセルされた場合 (や以下で説明する他の種々の状況において) 自動的に\n"
4080 "実行される関数である。例えば、mutex のロック解除を行い、プロセス内の\n"
4081 "他のスレッドが利用できるようにする関数などが考えられる。"
4082
4083 #. type: Plain text
4084 #: build/C/man3/pthread_cleanup_push.3:59
4085 msgid ""
4086 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
4087 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
4088 "be given I<arg> as its argument."
4089 msgstr ""
4090 "B<pthread_cleanup_push>() 関数は、 I<routine> をクリーンアップ\n"
4091 "ハンドラのスタックの一番上にプッシュする。 I<routine> が後で\n"
4092 "起動される際には、 I<arg> が関数の引き数と渡される。"
4093
4094 #. type: Plain text
4095 #: build/C/man3/pthread_cleanup_push.3:66
4096 msgid ""
4097 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
4098 "stack of clean-up handlers, and optionally executes it if I<execute> is "
4099 "nonzero."
4100 msgstr ""
4101 "B<pthread_cleanup_pop>() 関数は、クリーンアップハンドラの\n"
4102 "スタックの一番上のルーチンを削除する。\n"
4103 "I<execute> が 0 以外の場合にはそのルーチンを追加で実行する。"
4104
4105 #. type: Plain text
4106 #: build/C/man3/pthread_cleanup_push.3:69
4107 msgid ""
4108 "A cancellation clean-up handler is popped from the stack and executed in the "
4109 "following circumstances:"
4110 msgstr ""
4111 "キャンセルクリーンアップハンドラは、以下に示す場合に\n"
4112 "スタックから取り出され実行される。"
4113
4114 #. type: Plain text
4115 #: build/C/man3/pthread_cleanup_push.3:73
4116 msgid ""
4117 "When a thread is canceled, all of the stacked clean-up handlers are popped "
4118 "and executed in the reverse of the order in which they were pushed onto the "
4119 "stack."
4120 msgstr ""
4121 "スレッドがキャンセルされた際に、スタックに登録された全てのクリーン\n"
4122 "アップハンドラが取り出されて、実行される。クリーンアップハンドラの\n"
4123 "実行は、スタックに登録されたのと逆の順序で行われる。"
4124
4125 #. type: Plain text
4126 #: build/C/man3/pthread_cleanup_push.3:83
4127 msgid ""
4128 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
4129 "handlers are executed as described in the preceding point.  (Clean-up "
4130 "handlers are I<not> called if the thread terminates by performing a "
4131 "I<return> from the thread start function.)"
4132 msgstr ""
4133 "スレッドが B<pthread_exit>(3) を呼び出して終了する際に、全てのクリーン\n"
4134 "アップハンドラが上の項目で述べたのと同様に実行される。\n"
4135 "(スレッドがスレッド開始関数からの I<return> の実行により終了する場合に\n"
4136 "は、クリーンアップハンドラはI<呼び出されない>。)"
4137
4138 #. type: Plain text
4139 #: build/C/man3/pthread_cleanup_push.3:89
4140 msgid ""
4141 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
4142 "argument, the top-most clean-up handler is popped and executed."
4143 msgstr ""
4144 "スレッドが 0 以外の I<execute> 引き数で B<pthread_cleanup_pop>() を\n"
4145 "呼び出した際に、スタックの一番上のクリーンアップハンドラが取り出されて\n"
4146 "実行される。"
4147
4148 #. type: Plain text
4149 #: build/C/man3/pthread_cleanup_push.3:101
4150 msgid ""
4151 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
4152 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
4153 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
4154 "calls to these functions are paired within the same function, and at the "
4155 "same lexical nesting level.  (In other words, a clean-up handler is "
4156 "established only during the execution of a specified section of code.)"
4157 msgstr ""
4158 "POSIX.1 では、 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>() を\n"
4159 "それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開するマクロと\n"
4160 "して実装することを許容している。\n"
4161 "このため、呼び出し側では、これらの関数の呼び出しが同じ関数の中で対と\n"
4162 "なり、かつ文法的に同じネストレベル (nesting level) になることを保証\n"
4163 "しなければならない。 (言い換えると、クリーンアップハンドラは、コード\n"
4164 "の特定のセクションの実行の中でのみ設定するものであると言える。)"
4165
4166 #. type: Plain text
4167 #: build/C/man3/pthread_cleanup_push.3:121
4168 msgid ""
4169 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
4170 "call has been made to B<pthread_cleanup_push>()  or "
4171 "B<pthread_cleanup_pop>()  without the matching call of the pair since the "
4172 "jump buffer was filled by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, "
4173 "calling B<longjmp>(3)  (B<siglongjmp>(3))  from inside a clean-up handler "
4174 "produces undefined results unless the jump buffer was also filled by "
4175 "B<setjmp>(3)  (B<sigsetjmp>(3))  inside the handler."
4176 msgstr ""
4177 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しは、\n"
4178 "B<pthread_cleanup_push>() や B<pthread_cleanup_pop>() の呼び出しが対と\n"
4179 "なる呼び出しがない状態で行われた場合には、どのような結果になるかは不定\n"
4180 "である。これは jump バッファは B<setjmp>(3) (B<sigsetjmp>(3)) により設\n"
4181 "定されるからである。同様に、クリーンアップハンドラ内からの\n"
4182 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しも、jump バッファがハンドラ\n"
4183 "内で B<setjmp>(3) (B<sigsetjmp>(3)) で設定されていない限り、どのような\n"
4184 "結果になるかは不定である。"
4185
4186 #. type: Plain text
4187 #: build/C/man3/pthread_cleanup_push.3:123
4188 msgid "These functions do not return a value."
4189 msgstr "これらの関数は値を返さない。"
4190
4191 #.  SH VERSIONS
4192 #.  Available since glibc 2.0
4193 #. type: Plain text
4194 #: build/C/man3/pthread_cleanup_push.3:127
4195 msgid "There are no errors."
4196 msgstr "エラーはない。"
4197
4198 #. type: Plain text
4199 #: build/C/man3/pthread_cleanup_push.3:140
4200 msgid ""
4201 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
4202 "functions I<are> implemented as macros that expand to text containing "
4203 "\\(aqB<{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
4204 "declared within the scope of paired calls to these functions will be visible "
4205 "within only that scope."
4206 msgstr ""
4207 "Linux では、関数 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>()\n"
4208 "は、それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開する\n"
4209 "マクロとして実装されている。このことは、これらの関数を対で呼び出した\n"
4210 "スコープ内で宣言された変数は、そのスコープの中でしか参照できない\n"
4211 "ということを意味している。"
4212
4213 #.  The text was actually added in the 2004 TC2
4214 #. type: Plain text
4215 #: build/C/man3/pthread_cleanup_push.3:155
4216 msgid ""
4217 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
4218 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
4219 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
4220 "avoid doing this."
4221 msgstr ""
4222 "POSIX.1 には、括弧を含む B<pthread_cleanup_push>() と\n"
4223 "B<pthread_cleanup_pop>() のブロックをそのままにしたままで、 \n"
4224 "I<return>, I<break>, I<continue>, I<goto> を使った場合の影響は\n"
4225 "不定であると書かれている。\n"
4226 "移植性が必要なアプリケーションではこれを行うのは避けるべきである。"
4227
4228 #. type: Plain text
4229 #: build/C/man3/pthread_cleanup_push.3:170
4230 msgid ""
4231 "The program below provides a simple example of the use of the functions "
4232 "described in this page.  The program creates a thread that executes a loop "
4233 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
4234 "loop increments a global variable, I<cnt>, once each second.  Depending on "
4235 "what command-line arguments are supplied, the main thread sends the other "
4236 "thread a cancellation request, or sets a global variable that causes the "
4237 "other thread to exit its loop and terminate normally (by doing a I<return>)."
4238 msgstr ""
4239 "以下のプログラムは、このページで説明した関数の簡単な使用例を示すもので\n"
4240 "ある。このプログラムは B<pthread_cleanup_push>() と\n"
4241 "B<pthread_cleanup_pop>() で囲まれたループを実行するスレッドを作成する。\n"
4242 "このループではグローバル変数 I<cnt> を 1 秒に 1 ずつ増やしていく。\n"
4243 "指定されたコマンドライン引き数の内容に基づいて、メインスレッドはもう一\n"
4244 "つのスレッドにキャンセル要求を送ったり、もう一つのスレッドがループを\n"
4245 "抜けて (I<return> を呼び出して) 正常終了するようにグローバル変数を\n"
4246 "設定したりする。"
4247
4248 #. type: Plain text
4249 #: build/C/man3/pthread_cleanup_push.3:173
4250 msgid ""
4251 "In the following shell session, the main thread sends a cancellation request "
4252 "to the other thread:"
4253 msgstr ""
4254 "以下のシェルセッションでは、メインスレッドはもう一つのスレッドに\n"
4255 "キャンセル要求を送信する。"
4256
4257 #. type: Plain text
4258 #: build/C/man3/pthread_cleanup_push.3:183
4259 #, no-wrap
4260 msgid ""
4261 "$ B<./a.out>\n"
4262 "New thread started\n"
4263 "cnt = 0\n"
4264 "cnt = 1\n"
4265 "Canceling thread\n"
4266 "Called clean-up handler\n"
4267 "Thread was canceled; cnt = 0\n"
4268 msgstr ""
4269 "$ B<./a.out>\n"
4270 "New thread started\n"
4271 "cnt = 0\n"
4272 "cnt = 1\n"
4273 "Canceling thread\n"
4274 "Called clean-up handler\n"
4275 "Thread was canceled; cnt = 0\n"
4276
4277 #. type: Plain text
4278 #: build/C/man3/pthread_cleanup_push.3:191
4279 msgid ""
4280 "From the above, we see that the thread was canceled, and that the "
4281 "cancellation clean-up handler was called and it reset the value of the "
4282 "global variable I<cnt> to 0."
4283 msgstr ""
4284 "上記の実行例から、スレッドがキャンセルされ、\n"
4285 "キャンセルクリーンアップハンドラが呼び出され、\n"
4286 "グローバル変数 I<cnt> の値が 0 にリセットされていることが確認できる。"
4287
4288 #. type: Plain text
4289 #: build/C/man3/pthread_cleanup_push.3:194
4290 msgid ""
4291 "In the next run, the main program sets a global variable that causes other "
4292 "thread to terminate normally:"
4293 msgstr ""
4294 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4295 "もう一つのスレッドが正常終了するようにしている。"
4296
4297 #. type: Plain text
4298 #: build/C/man3/pthread_cleanup_push.3:202
4299 #, no-wrap
4300 msgid ""
4301 "$ B<./a.out x>\n"
4302 "New thread started\n"
4303 "cnt = 0\n"
4304 "cnt = 1\n"
4305 "Thread terminated normally; cnt = 2\n"
4306 msgstr ""
4307 "$ B<./a.out x>\n"
4308 "New thread started\n"
4309 "cnt = 0\n"
4310 "cnt = 1\n"
4311 "Thread terminated normally; cnt = 2\n"
4312
4313 #. type: Plain text
4314 #: build/C/man3/pthread_cleanup_push.3:210
4315 msgid ""
4316 "From the above, we see that the clean-up handler was not executed (because "
4317 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
4318 msgstr ""
4319 "上記では、 (I<cleanup_pop_arg> が 0 なので) クリーンアップハンドラは\n"
4320 "実行されておらず、その結果 I<cnt> の値はリセットされていないことが\n"
4321 "分かる。"
4322
4323 #. type: Plain text
4324 #: build/C/man3/pthread_cleanup_push.3:215
4325 msgid ""
4326 "In the next run, the main program sets a global variable that causes the "
4327 "other thread to terminate normally, and supplies a nonzero value for "
4328 "I<cleanup_pop_arg>:"
4329 msgstr ""
4330 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4331 "もう一つのスレッドが正常終了するようにし、さらに\n"
4332 "I<cleanup_pop_arg> に 0 以外の値を渡している。"
4333
4334 #. type: Plain text
4335 #: build/C/man3/pthread_cleanup_push.3:224
4336 #, no-wrap
4337 msgid ""
4338 "$ B<./a.out x 1>\n"
4339 "New thread started\n"
4340 "cnt = 0\n"
4341 "cnt = 1\n"
4342 "Called clean-up handler\n"
4343 "Thread terminated normally; cnt = 0\n"
4344 msgstr ""
4345 "$ B<./a.out x 1>\n"
4346 "New thread started\n"
4347 "cnt = 0\n"
4348 "cnt = 1\n"
4349 "Called clean-up handler\n"
4350 "Thread terminated normally; cnt = 0\n"
4351
4352 #. type: Plain text
4353 #: build/C/man3/pthread_cleanup_push.3:231
4354 msgid ""
4355 "In the above, we see that although the thread was not canceled, the clean-up "
4356 "handler was executed, because the argument given to "
4357 "B<pthread_cleanup_pop>()  was nonzero."
4358 msgstr ""
4359 "上記では、スレッドはキャンセルされていないが、クリーンアップハンドラが\n"
4360 "実行されていないことが分かる。これは B<pthread_cleanup_pop>() の引き数\n"
4361 "に 0 以外を渡したからである。"
4362
4363 #. type: Plain text
4364 #: build/C/man3/pthread_cleanup_push.3:240
4365 #, no-wrap
4366 msgid ""
4367 "#include E<lt>pthread.hE<gt>\n"
4368 "#include E<lt>sys/types.hE<gt>\n"
4369 "#include E<lt>stdio.hE<gt>\n"
4370 "#include E<lt>stdlib.hE<gt>\n"
4371 "#include E<lt>unistd.hE<gt>\n"
4372 "#include E<lt>errno.hE<gt>\n"
4373 msgstr ""
4374 "#include E<lt>pthread.hE<gt>\n"
4375 "#include E<lt>sys/types.hE<gt>\n"
4376 "#include E<lt>stdio.hE<gt>\n"
4377 "#include E<lt>stdlib.hE<gt>\n"
4378 "#include E<lt>unistd.hE<gt>\n"
4379 "#include E<lt>errno.hE<gt>\n"
4380
4381 #. type: Plain text
4382 #: build/C/man3/pthread_cleanup_push.3:247
4383 #, no-wrap
4384 msgid ""
4385 "static int done = 0;\n"
4386 "static int cleanup_pop_arg = 0;\n"
4387 "static int cnt = 0;\n"
4388 msgstr ""
4389 "static int done = 0;\n"
4390 "static int cleanup_pop_arg = 0;\n"
4391 "static int cnt = 0;\n"
4392
4393 #. type: Plain text
4394 #: build/C/man3/pthread_cleanup_push.3:254
4395 #, no-wrap
4396 msgid ""
4397 "static void\n"
4398 "cleanup_handler(void *arg)\n"
4399 "{\n"
4400 "    printf(\"Called clean-up handler\\en\");\n"
4401 "    cnt = 0;\n"
4402 "}\n"
4403 msgstr ""
4404 "static void\n"
4405 "cleanup_handler(void *arg)\n"
4406 "{\n"
4407 "    printf(\"Called clean-up handler\\en\");\n"
4408 "    cnt = 0;\n"
4409 "}\n"
4410
4411 #. type: Plain text
4412 #: build/C/man3/pthread_cleanup_push.3:259
4413 #, no-wrap
4414 msgid ""
4415 "static void *\n"
4416 "thread_start(void *arg)\n"
4417 "{\n"
4418 "    time_t start, curr;\n"
4419 msgstr ""
4420 "static void *\n"
4421 "thread_start(void *arg)\n"
4422 "{\n"
4423 "    time_t start, curr;\n"
4424
4425 #. type: Plain text
4426 #: build/C/man3/pthread_cleanup_push.3:261
4427 #, no-wrap
4428 msgid "    printf(\"New thread started\\en\");\n"
4429 msgstr "    printf(\"New thread started\\en\");\n"
4430
4431 #. type: Plain text
4432 #: build/C/man3/pthread_cleanup_push.3:263
4433 #, no-wrap
4434 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4435 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4436
4437 #. type: Plain text
4438 #: build/C/man3/pthread_cleanup_push.3:265
4439 #, no-wrap
4440 msgid "    curr = start = time(NULL);\n"
4441 msgstr "    curr = start = time(NULL);\n"
4442
4443 #. type: Plain text
4444 #: build/C/man3/pthread_cleanup_push.3:274
4445 #, no-wrap
4446 msgid ""
4447 "    while (!done) {\n"
4448 "        pthread_testcancel();           /* A cancellation point */\n"
4449 "        if (curr E<lt> time(NULL)) {\n"
4450 "            curr = time(NULL);\n"
4451 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4452 "            cnt++;\n"
4453 "        }\n"
4454 "    }\n"
4455 msgstr ""
4456 "    while (!done) {\n"
4457 "        pthread_testcancel();           /* A cancellation point */\n"
4458 "        if (curr E<lt> time(NULL)) {\n"
4459 "            curr = time(NULL);\n"
4460 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4461 "            cnt++;\n"
4462 "        }\n"
4463 "    }\n"
4464
4465 #. type: Plain text
4466 #: build/C/man3/pthread_cleanup_push.3:278
4467 #, no-wrap
4468 msgid ""
4469 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4470 "    return NULL;\n"
4471 "}\n"
4472 msgstr ""
4473 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4474 "    return NULL;\n"
4475 "}\n"
4476
4477 #. type: Plain text
4478 #: build/C/man3/pthread_cleanup_push.3:285
4479 #, no-wrap
4480 msgid ""
4481 "int\n"
4482 "main(int argc, char *argv[])\n"
4483 "{\n"
4484 "    pthread_t thr;\n"
4485 "    int s;\n"
4486 "    void *res;\n"
4487 msgstr ""
4488 "int\n"
4489 "main(int argc, char *argv[])\n"
4490 "{\n"
4491 "    pthread_t thr;\n"
4492 "    int s;\n"
4493 "    void *res;\n"
4494
4495 #. type: Plain text
4496 #: build/C/man3/pthread_cleanup_push.3:289
4497 #, no-wrap
4498 msgid ""
4499 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4500 "    if (s != 0)\n"
4501 "        handle_error_en(s, \"pthread_create\");\n"
4502 msgstr ""
4503 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4504 "    if (s != 0)\n"
4505 "        handle_error_en(s, \"pthread_create\");\n"
4506
4507 #. type: Plain text
4508 #: build/C/man3/pthread_cleanup_push.3:291
4509 #, no-wrap
4510 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
4511 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
4512
4513 #. type: Plain text
4514 #: build/C/man3/pthread_cleanup_push.3:296
4515 #, no-wrap
4516 msgid ""
4517 "    if (argc E<gt> 1) {\n"
4518 "        if (argc E<gt> 2)\n"
4519 "            cleanup_pop_arg = atoi(argv[2]);\n"
4520 "        done = 1;\n"
4521 msgstr ""
4522 "    if (argc E<gt> 1) {\n"
4523 "        if (argc E<gt> 2)\n"
4524 "            cleanup_pop_arg = atoi(argv[2]);\n"
4525 "        done = 1;\n"
4526
4527 #. type: Plain text
4528 #: build/C/man3/pthread_cleanup_push.3:303
4529 #, no-wrap
4530 msgid ""
4531 "    } else {\n"
4532 "        printf(\"Canceling thread\\en\");\n"
4533 "        s = pthread_cancel(thr);\n"
4534 "        if (s != 0)\n"
4535 "            handle_error_en(s, \"pthread_cancel\");\n"
4536 "    }\n"
4537 msgstr ""
4538 "    } else {\n"
4539 "        printf(\"Canceling thread\\en\");\n"
4540 "        s = pthread_cancel(thr);\n"
4541 "        if (s != 0)\n"
4542 "            handle_error_en(s, \"pthread_cancel\");\n"
4543 "    }\n"
4544
4545 #. type: Plain text
4546 #: build/C/man3/pthread_cleanup_push.3:314
4547 #, no-wrap
4548 msgid ""
4549 "    if (res == PTHREAD_CANCELED)\n"
4550 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4551 "    else\n"
4552 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4553 "    exit(EXIT_SUCCESS);\n"
4554 "}\n"
4555 msgstr ""
4556 "    if (res == PTHREAD_CANCELED)\n"
4557 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4558 "    else\n"
4559 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4560 "    exit(EXIT_SUCCESS);\n"
4561 "}\n"
4562
4563 #. type: Plain text
4564 #: build/C/man3/pthread_cleanup_push.3:321
4565 msgid ""
4566 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4567 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4568 msgstr ""
4569 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4570 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4571
4572 #. type: TH
4573 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
4574 #, no-wrap
4575 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4576 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4577
4578 #. type: Plain text
4579 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
4580 msgid ""
4581 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
4582 "thread cancellation clean-up handlers while saving cancelability type"
4583 msgstr ""
4584 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - "
4585 "cancelability type を保持したままでスレッドのキャンセルクリーンアップハンドラ"
4586 "の push/pop を行う"
4587
4588 #. type: Plain text
4589 #: build/C/man3/pthread_cleanup_push_defer_np.3:37
4590 #, no-wrap
4591 msgid ""
4592 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4593 "B<                                   void *>I<arg>B<);>\n"
4594 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4595 msgstr ""
4596 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4597 "B<                                   void *>I<arg>B<);>\n"
4598 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4599
4600 #. type: Plain text
4601 #: build/C/man3/pthread_cleanup_push_defer_np.3:40
4602 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
4603 #: build/C/man3/pthread_join.3:37 build/C/man3/pthread_kill.3:37
4604 #: build/C/man3/pthread_setname_np.3:39 build/C/man3/pthread_sigmask.3:38
4605 #: build/C/man3/pthread_sigqueue.3:38 build/C/man3/pthread_tryjoin_np.3:42
4606 #: build/C/man3/pthread_yield.3:37
4607 msgid "Compile and link with I<-pthread>."
4608 msgstr "I<-pthread> を付けてコンパイルとリンクを行う。"
4609
4610 #. type: Plain text
4611 #: build/C/man3/pthread_cleanup_push_defer_np.3:49
4612 msgid "B<pthread_cleanup_push_defer_np>(), B<pthread_cleanup_pop_defer_np>():"
4613 msgstr "B<pthread_cleanup_push_defer_np>(), B<pthread_cleanup_pop_defer_np>():"
4614
4615 #. type: Plain text
4616 #: build/C/man3/pthread_cleanup_push_defer_np.3:51
4617 msgid "_GNU_SOURCE"
4618 msgstr "_GNU_SOURCE"
4619
4620 #. type: Plain text
4621 #: build/C/man3/pthread_cleanup_push_defer_np.3:59
4622 msgid ""
4623 "These functions are the same as B<pthread_cleanup_push>(3)  and "
4624 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
4625 msgstr ""
4626 "これらの関数は B<pthread_cleanup_push>(3) と B<pthread_cleanup_pop>(3) と同じ"
4627 "だが、このページで説明する点が異なる。"
4628
4629 #. type: Plain text
4630 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
4631 msgid ""
4632 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
4633 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
4634 "addition, it also saves the thread's current cancelability type, and sets "
4635 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
4636 "this ensures that cancellation clean-up will occur even if the thread's "
4637 "cancelability type was \"asynchronous\" before the call."
4638 msgstr ""
4639 "B<pthread_cleanup_push>(3) と同様に、\n"
4640 "B<pthread_cleanup_push_defer_np>() は I<routine> をそのスレッドの\n"
4641 "クリーンアップハンドラのスタックに追加する。これに加えて、\n"
4642 "B<pthread_cleanup_push_defer_np>() は現在の cancelability type も\n"
4643 "保存し、cancelability type は \"deferred\" に設定する\n"
4644 "(B<pthread_setcanceltype>(3) 参照)。\n"
4645 "これにより、この関数が呼び出される前のスレッドの cancelability type が\n"
4646 "\"asynchronous\" であったとしても、キャンセルクリーンアップが行われること\n"
4647 "が保証される。"
4648
4649 #. type: Plain text
4650 #: build/C/man3/pthread_cleanup_push_defer_np.3:81
4651 msgid ""
4652 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
4653 "the top-most clean-up handler from the thread's stack of cancellation clean-"
4654 "up handlers.  In addition, it restores the thread's cancelability type to "
4655 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
4656 msgstr ""
4657 "B<pthread_cleanup_pop>(3) と同様に、\n"
4658 "B<pthread_cleanup_pop_restore_np>() はそのスレッドのキャンセル\n"
4659 "クリーンアップハンドラのスタックから一番上にあるクリーンアップハンドラ\n"
4660 "を取り出す。これに加えて、そのスレッドの cancelability type を、対応\n"
4661 "する B<pthread_cleanup_push_defer_np>() が呼ばれた時点の値に戻す。"
4662
4663 #. type: Plain text
4664 #: build/C/man3/pthread_cleanup_push_defer_np.3:87
4665 msgid ""
4666 "The caller must ensure that calls to these functions are paired within the "
4667 "same function, and at the same lexical nesting level.  Other restrictions "
4668 "apply, as described in B<pthread_cleanup_push>(3)."
4669 msgstr ""
4670 "呼び出し側では、これらの関数の呼び出しが同じ関数の中で対となり、かつ\n"
4671 "文法的に同じネストレベル (nesting level) になることを保証しなければ\n"
4672 "ならない。 B<pthread_cleanup_push>(3) で説明されている他の制限も\n"
4673 "適用される。"
4674
4675 #. type: Plain text
4676 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
4677 msgid "This sequence of calls:"
4678 msgstr "以下の一連の呼び出し"
4679
4680 #. type: Plain text
4681 #: build/C/man3/pthread_cleanup_push_defer_np.3:94
4682 #, no-wrap
4683 msgid ""
4684 "pthread_cleanup_push_defer_np(routine, arg);\n"
4685 "pthread_cleanup_pop_restore_np(execute);\n"
4686 msgstr ""
4687 "pthread_cleanup_push_defer_np(routine, arg);\n"
4688 "pthread_cleanup_pop_restore_np(execute);\n"
4689
4690 #. type: Plain text
4691 #: build/C/man3/pthread_cleanup_push_defer_np.3:98
4692 msgid "is equivalent to (but shorter and more efficient than):"
4693 msgstr "と以下は等価である (但し、上の方がより簡潔で効率的である)。"
4694
4695 #. type: Plain text
4696 #: build/C/man3/pthread_cleanup_push_defer_np.3:104
4697 #, no-wrap
4698 msgid "int oldtype;\n"
4699 msgstr "int oldtype;\n"
4700
4701 #. type: Plain text
4702 #: build/C/man3/pthread_cleanup_push_defer_np.3:110
4703 #, no-wrap
4704 msgid ""
4705 "pthread_cleanup_push(routine, arg);\n"
4706 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4707 "\\&...\n"
4708 "pthread_setcanceltype(oldtype, NULL);\n"
4709 "pthread_cleanup_pop(execute);\n"
4710 msgstr ""
4711 "pthread_cleanup_push(routine, arg);\n"
4712 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4713 "\\&...\n"
4714 "pthread_setcanceltype(oldtype, NULL);\n"
4715 "pthread_cleanup_pop(execute);\n"
4716
4717 #. type: Plain text
4718 #: build/C/man3/pthread_cleanup_push_defer_np.3:123
4719 msgid ""
4720 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
4721 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4722 msgstr ""
4723 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
4724 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4725
4726 #. type: TH
4727 #: build/C/man3/pthread_create.3:26
4728 #, no-wrap
4729 msgid "PTHREAD_CREATE"
4730 msgstr "PTHREAD_CREATE"
4731
4732 #. type: Plain text
4733 #: build/C/man3/pthread_create.3:29
4734 msgid "pthread_create - create a new thread"
4735 msgstr "pthread_create - 新しいスレッドを作成する"
4736
4737 #. type: Plain text
4738 #: build/C/man3/pthread_create.3:35
4739 #, no-wrap
4740 msgid ""
4741 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4742 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4743 msgstr ""
4744 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4745 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4746
4747 #. type: Plain text
4748 #: build/C/man3/pthread_create.3:47
4749 msgid ""
4750 "The B<pthread_create>()  function starts a new thread in the calling "
4751 "process.  The new thread starts execution by invoking I<start_routine>(); "
4752 "I<arg> is passed as the sole argument of I<start_routine>()."
4753 msgstr ""
4754 "B<pthread_create>() 関数は、呼び出したプロセス内に新しいスレッドを作成す"
4755 "る。\n"
4756 "新しいスレッドの実行は、 I<start_routine>() を起動することで開始される。\n"
4757 "I<start_routine>() は引き数を一つだけ取り、\n"
4758 "I<arg> が I<start_routine>() の引き数として渡される。"
4759
4760 #. type: Plain text
4761 #: build/C/man3/pthread_create.3:49
4762 msgid "The new thread terminates in one of the following ways:"
4763 msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。"
4764
4765 #. type: IP
4766 #: build/C/man3/pthread_create.3:49 build/C/man3/pthread_create.3:55
4767 #: build/C/man3/pthread_create.3:63 build/C/man3/pthread_create.3:66
4768 #: build/C/man3/pthread_getattr_np.3:52 build/C/man3/pthread_getattr_np.3:55
4769 #: build/C/man3/pthread_getattr_np.3:58
4770 #, no-wrap
4771 msgid "*"
4772 msgstr "*"
4773
4774 #. type: Plain text
4775 #: build/C/man3/pthread_create.3:55
4776 msgid ""
4777 "It calls B<pthread_exit>(3), specifying an exit status value that is "
4778 "available to another thread in the same process that calls "
4779 "B<pthread_join>(3)."
4780 msgstr ""
4781 "スレッドが B<pthread_exit>(3) を呼び出す。\n"
4782 "B<pthread_exit>(3) を呼び出す際には終了ステータス値を指定する。\n"
4783 "この値は B<pthread_join>(3) を呼び出した同じプロセス内の\n"
4784 "別のスレッドで参照できる。"
4785
4786 #. type: Plain text
4787 #: build/C/man3/pthread_create.3:63
4788 msgid ""
4789 "It returns from I<start_routine>().  This is equivalent to calling "
4790 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
4791 msgstr ""
4792 "スレッドが I<start_routine>() から返る。これは、\n"
4793 "I<return> 文に渡した値で B<pthread_exit>(3) を呼び出すのと等価である。"
4794
4795 #. type: Plain text
4796 #: build/C/man3/pthread_create.3:66
4797 msgid "It is canceled (see B<pthread_cancel>(3))."
4798 msgstr "スレッドがキャンセルされる (B<pthread_cancel>(3) 参照)。"
4799
4800 #. type: Plain text
4801 #: build/C/man3/pthread_create.3:72
4802 msgid ""
4803 "Any of the threads in the process calls B<exit>(3), or the main thread "
4804 "performs a return from I<main>().  This causes the termination of all "
4805 "threads in the process."
4806 msgstr ""
4807 "プロセス内のいずれかのスレッドで B<exit>(3) が呼ばれるか、\n"
4808 "メインスレッドで I<main>() 内で return が実行される。\n"
4809 "この場合は、プロセス内の全てのスレッドが終了される。"
4810
4811 #. type: Plain text
4812 #: build/C/man3/pthread_create.3:86
4813 msgid ""
4814 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4815 "are used at thread creation time to determine attributes for the new thread; "
4816 "this structure is initialized using B<pthread_attr_init>(3)  and related "
4817 "functions.  If I<attr> is NULL, then the thread is created with default "
4818 "attributes."
4819 msgstr ""
4820 "I<attr> 引き数は I<pthread_attr_t> 構造体へのポインタであり、\n"
4821 "I<pthread_attr_t> 構造体の内容を使用して、スレッド作成時に\n"
4822 "新しいスレッドの属性が決定される。\n"
4823 "この構造体は B<pthread_attr_init>(3) や関連の関数を使って初期化される。\n"
4824 "I<attr> が NULL の場合、新しいスレッドはデフォルトの属性で作成される。"
4825
4826 #. type: Plain text
4827 #: build/C/man3/pthread_create.3:93
4828 msgid ""
4829 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
4830 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4831 "used to refer to the thread in subsequent calls to other pthreads functions."
4832 msgstr ""
4833 "成功した場合は、 B<pthread_create>() は返る前に新しいスレッドの ID を\n"
4834 "I<thread> が指すバッファに格納する。この ID は、これ以降に他の\n"
4835 "pthreads 関数の呼び出しでスレッドを参照するのに使用される。"
4836
4837 #. type: Plain text
4838 #: build/C/man3/pthread_create.3:101
4839 msgid ""
4840 "The new thread inherits a copy of the creating thread's signal mask "
4841 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
4842 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
4843 "thread's alternate signal stack (B<sigaltstack>(2))."
4844 msgstr ""
4845 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスク\n"
4846 "(B<pthread_sigmask>(3) 参照) のコピーを継承する。\n"
4847 "新しいスレッドの処理待ちシグナル (B<sigpending>(2)) の集合は空となる。\n"
4848 "新しいスレッドはスレッドを作成したスレッドの代替シグナルスタック\n"
4849 "(B<sigaltstack>(2)) を継承しない。"
4850
4851 #. type: Plain text
4852 #: build/C/man3/pthread_create.3:104
4853 msgid ""
4854 "The new thread inherits the calling thread's floating-point environment "
4855 "(B<fenv>(3))."
4856 msgstr ""
4857 "新しいスレッドは呼び出したスレッドの浮動小数点環境 (B<fenv>(3))\n"
4858 "を継承する。"
4859
4860 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4861 #. type: Plain text
4862 #: build/C/man3/pthread_create.3:109
4863 msgid ""
4864 "The initial value of the new thread's CPU-time clock is 0 (see "
4865 "B<pthread_getcpuclockid>(3))."
4866 msgstr ""
4867 "新しいスレッドの CPU 時間時計の初期値は 0 である\n"
4868 "(B<pthread_getcpuclockid>(3) 参照)。"
4869
4870 #. type: SS
4871 #: build/C/man3/pthread_create.3:109
4872 #, no-wrap
4873 msgid "Linux-specific details"
4874 msgstr "Linux 固有の詳細"
4875
4876 #. type: Plain text
4877 #: build/C/man3/pthread_create.3:115
4878 msgid ""
4879 "The new thread inherits copies of the calling thread's capability sets (see "
4880 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4881 msgstr ""
4882 "新しいスレッドは、呼び出したスレッドの\n"
4883 "ケーパビリティセット (B<capabilities>(7) 参照) と \n"
4884 "CPU affinity マスク (B<sched_setaffinity>(2) 参照) の\n"
4885 "コピーをを継承しない。"
4886
4887 #. type: Plain text
4888 #: build/C/man3/pthread_create.3:122
4889 msgid ""
4890 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
4891 "number, and the contents of I<*thread> are undefined."
4892 msgstr ""
4893 "成功すると、 B<pthread_create>() は 0 を返す。\n"
4894 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
4895
4896 #. type: TP
4897 #: build/C/man3/pthread_create.3:123 build/C/man3/pthread_create.3:126
4898 #: build/C/man3/pthread_sigqueue.3:72
4899 #, no-wrap
4900 msgid "B<EAGAIN>"
4901 msgstr "B<EAGAIN>"
4902
4903 #. type: Plain text
4904 #: build/C/man3/pthread_create.3:126
4905 msgid "Insufficient resources to create another thread."
4906 msgstr "別のスレッドを作成するのに十分なリソースがない。"
4907
4908 #.  NOTE! The following should match the description in fork(2)
4909 #. type: Plain text
4910 #: build/C/man3/pthread_create.3:144
4911 msgid ""
4912 "A system-imposed limit on the number of threads was encountered.  There are "
4913 "a number of limits that may trigger this error: the B<RLIMIT_NPROC> soft "
4914 "resource limit (set via B<setrlimit>(2)), which limits the number of "
4915 "processes and threads for a real user ID, was reached; the kernel's system-"
4916 "wide limit on the number of processes and threads, I</proc/sys/kernel/"
4917 "threads-max>, was reached (see B<proc>(5)); or the maximum number of PIDs, "
4918 "I</proc/sys/kernel/pid_max>, was reached (see B<proc>(5))."
4919 msgstr ""
4920 "システムで設定されたスレッド数の上限に達していた。 このエラーの原因となる上限"
4921 "値はいくつかある。 実ユーザ ID 当たりのプロセス数とスレッド数の上限である、ソ"
4922 "フトリソース上限 B<RLIMIT_NPROC> に達していた (B<setrlimit>(2) で設定でき"
4923 "る)。 カーネルのシステム全体のプロセスとスレッドの数の上限値である I</proc/"
4924 "sys/kernel/threads-max> が達していた (B<proc>(5) 参照)。 PID の最大値 I</"
4925 "proc/sys/kernel/pid_max> に達していた (B<proc>(5) 参照)。"
4926
4927 #. type: Plain text
4928 #: build/C/man3/pthread_create.3:148
4929 msgid "Invalid settings in I<attr>."
4930 msgstr "I<attr> で指定された設定が不正である。"
4931
4932 #. type: TP
4933 #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_setschedparam.3:129
4934 #: build/C/man3/pthread_setschedprio.3:66
4935 #, no-wrap
4936 msgid "B<EPERM>"
4937 msgstr "B<EPERM>"
4938
4939 #. type: Plain text
4940 #: build/C/man3/pthread_create.3:153
4941 msgid ""
4942 "No permission to set the scheduling policy and parameters specified in "
4943 "I<attr>."
4944 msgstr ""
4945 "I<attr> に指定されたスケジューリングポリシーとパラメータを\n"
4946 "設定する許可がない。"
4947
4948 #. type: Plain text
4949 #: build/C/man3/pthread_create.3:167
4950 msgid ""
4951 "See B<pthread_self>(3)  for further information on the thread ID returned in "
4952 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
4953 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4954 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4955 msgstr ""
4956 "B<pthread_create>() が I<*thread> で返すスレッド ID についての\n"
4957 "詳しい情報は B<pthread_self>(3) を参照のこと。\n"
4958 "リアルタイムスケジューリングポリシーが使用されない限り、\n"
4959 "B<pthread_create>() の呼び出し後に、\n"
4960 "どのスレッドが\\(em呼び出したスレッドか新しいスレッドか\\(em\n"
4961 "次に実行されるかは決まっていない。"
4962
4963 #. type: Plain text
4964 #: build/C/man3/pthread_create.3:187
4965 msgid ""
4966 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
4967 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
4968 "terminate and fetch its exit status.  Only when a terminated joinable thread "
4969 "has been joined are the last of its resources released back to the system.  "
4970 "When a detached thread terminates, its resources are automatically released "
4971 "back to the system: it is not possible to join with the thread in order to "
4972 "obtain its exit status.  Making a thread detached is useful for some types "
4973 "of daemon threads whose exit status the application does not need to care "
4974 "about.  By default, a new thread is created in a joinable state, unless "
4975 "I<attr> was set to create the thread in a detached state (using "
4976 "B<pthread_attr_setdetachstate>(3))."
4977 msgstr ""
4978 "スレッドは I<join 可能>か I<detached (切り離された状態)> のどちらかに\n"
4979 "することができる。スレッドが join 可能な場合、別のスレッドが\n"
4980 "B<pthread_join>(3) を使って終了したスレッドを待ち、終了ステータスを取得\n"
4981 "することができる。終了した join 可能なスレッドは join された場合にのみ、\n"
4982 "そのスレッドの最後に残ったリソースが解放されシステムに戻される。\n"
4983 "detached 状態のスレッドが終了すると、そのスレッドのリソースは自動的に\n"
4984 "システムに戻される。detached 状態のスレッドを join して、その終了\n"
4985 "ステータスを取得することはできない。スレッドを detached 状態にするのは、\n"
4986 "その終了ステータスをアプリケーションが気にする必要がないある種の\n"
4987 "デーモン (daemon) スレッドでは有用である。\n"
4988 "デフォルトでは、新しいスレッドは join 可能な状態で作成される。\n"
4989 "(B<pthread_attr_setdetachstate>(3) を使って) I<attr> でスレッドが\n"
4990 "detached 状態で作成されるように設定されていない限り、join 可能な状態で\n"
4991 "作成される。"
4992
4993 #.  FIXME . Perhaps some of the following detail should be in
4994 #.  a future pthread_attr_setstacksize(3) page.
4995 #. type: Plain text
4996 #: build/C/man3/pthread_create.3:203
4997 msgid ""
4998 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
4999 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
5000 "resource limit I<at the time the program started> has any value other than "
5001 "\"unlimited\", then it determines the default stack size of new threads.  "
5002 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
5003 "explicitly set in the I<attr> argument used to create a thread, in order to "
5004 "obtain a stack size other than the default."
5005 msgstr ""
5006 "Linux/x86-32 では、新しいスレッドのデフォルトのスタックサイズは 2MB で\n"
5007 "ある。NPTL スレッド実装の下では、I<プログラム開始時の> B<RLIMIT_STACK>\n"
5008 "ソフトリソース上限が\"unlimited\" 以外の場合、その値が新しいスレッドのデ\n"
5009 "フォルトのスタックサイズとなる。\n"
5010 "B<pthread_attr_setstacksize>(3) を使って、スレッドを作成する際の\n"
5011 "I<attr> 引き数に明示的にスタックサイズ属性を設定することで、\n"
5012 "デフォルト値以外のスタックサイズを得ることができる。"
5013
5014 #. type: Plain text
5015 #: build/C/man3/pthread_create.3:209
5016 msgid ""
5017 "In the obsolete LinuxThreads implementation, each of the threads in a "
5018 "process has a different process ID.  This is in violation of the POSIX "
5019 "threads specification, and is the source of many other nonconformances to "
5020 "the standard; see B<pthreads>(7)."
5021 msgstr ""
5022 "廃止予定の LinuxThreads 実装では、プロセス内の各スレッドは異なる\n"
5023 "プロセス ID を持つ。これは POSIX スレッドの規格に違反しており、\n"
5024 "他の多くの標準非準拠の点の原因になっている。\n"
5025 "B<pthreads>(7) を参照のこと。"
5026
5027 #. type: Plain text
5028 #: build/C/man3/pthread_create.3:213
5029 msgid ""
5030 "The program below demonstrates the use of B<pthread_create>(), as well as a "
5031 "number of other functions in the pthreads API."
5032 msgstr ""
5033 "以下のプログラムは、 B<pthread_create>() や\n"
5034 "pthreads API の他のいろいろな関数の使用例を示している。"
5035
5036 #. type: Plain text
5037 #: build/C/man3/pthread_create.3:218
5038 msgid ""
5039 "In the following run, on a system providing the NPTL threading "
5040 "implementation, the stack size defaults to the value given by the \"stack "
5041 "size\" resource limit:"
5042 msgstr ""
5043 "以下の実行例は、 NPTL スレッド実装が提供されているシステムでのもので、\n"
5044 "スタックサイズがデフォルト値の \"stack size\" リソース上限で指定される値\n"
5045 "になる。"
5046
5047 #. type: Plain text
5048 #: build/C/man3/pthread_create.3:230
5049 #, no-wrap
5050 msgid ""
5051 "$B< ulimit -s>\n"
5052 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
5053 "$B< ./a.out hola salut servus>\n"
5054 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
5055 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
5056 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
5057 "Joined with thread 1; returned value was HOLA\n"
5058 "Joined with thread 2; returned value was SALUT\n"
5059 "Joined with thread 3; returned value was SERVUS\n"
5060 msgstr ""
5061 "$B< ulimit -s>\n"
5062 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
5063 "$B< ./a.out hola salut servus>\n"
5064 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
5065 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
5066 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
5067 "Joined with thread 1; returned value was HOLA\n"
5068 "Joined with thread 2; returned value was SALUT\n"
5069 "Joined with thread 3; returned value was SERVUS\n"
5070
5071 #. type: Plain text
5072 #: build/C/man3/pthread_create.3:236
5073 msgid ""
5074 "In the next run, the program explicitly sets a stack size of 1MB (using "
5075 "B<pthread_attr_setstacksize>(3))  for the created threads:"
5076 msgstr ""
5077 "次の実行例では、プログラム内で、作成されるスレッドに対して\n"
5078 "(B<pthread_attr_setstacksize>(3) を使って1MB のスタックサイズを\n"
5079 "明示的に設定している。"
5080
5081 #. type: Plain text
5082 #: build/C/man3/pthread_create.3:246
5083 #, no-wrap
5084 msgid ""
5085 "$B< ./a.out -s 0x100000 hola salut servus>\n"
5086 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
5087 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
5088 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
5089 "Joined with thread 1; returned value was HOLA\n"
5090 "Joined with thread 2; returned value was SALUT\n"
5091 "Joined with thread 3; returned value was SERVUS\n"
5092 msgstr ""
5093 "$B< ./a.out -s 0x100000 hola salut servus>\n"
5094 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
5095 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
5096 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
5097 "Joined with thread 1; returned value was HOLA\n"
5098 "Joined with thread 2; returned value was SALUT\n"
5099 "Joined with thread 3; returned value was SERVUS\n"
5100
5101 #. type: Plain text
5102 #: build/C/man3/pthread_create.3:258
5103 #, no-wrap
5104 msgid ""
5105 "#include E<lt>pthread.hE<gt>\n"
5106 "#include E<lt>string.hE<gt>\n"
5107 "#include E<lt>stdio.hE<gt>\n"
5108 "#include E<lt>stdlib.hE<gt>\n"
5109 "#include E<lt>unistd.hE<gt>\n"
5110 "#include E<lt>errno.hE<gt>\n"
5111 "#include E<lt>ctype.hE<gt>\n"
5112 msgstr ""
5113 "#include E<lt>pthread.hE<gt>\n"
5114 "#include E<lt>string.hE<gt>\n"
5115 "#include E<lt>stdio.hE<gt>\n"
5116 "#include E<lt>stdlib.hE<gt>\n"
5117 "#include E<lt>unistd.hE<gt>\n"
5118 "#include E<lt>errno.hE<gt>\n"
5119 "#include E<lt>ctype.hE<gt>\n"
5120
5121 #. type: Plain text
5122 #: build/C/man3/pthread_create.3:264 build/C/man3/pthread_getcpuclockid.3:116
5123 #, no-wrap
5124 msgid ""
5125 "#define handle_error(msg) \\e\n"
5126 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5127 msgstr ""
5128 "#define handle_error(msg) \\e\n"
5129 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5130
5131 #. type: Plain text
5132 #: build/C/man3/pthread_create.3:270
5133 #, no-wrap
5134 msgid ""
5135 "struct thread_info {    /* Used as argument to thread_start() */\n"
5136 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
5137 "    int       thread_num;       /* Application-defined thread # */\n"
5138 "    char     *argv_string;      /* From command-line argument */\n"
5139 "};\n"
5140 msgstr ""
5141 "struct thread_info {    /* Used as argument to thread_start() */\n"
5142 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
5143 "    int       thread_num;       /* Application-defined thread # */\n"
5144 "    char     *argv_string;      /* From command-line argument */\n"
5145 "};\n"
5146
5147 #. type: Plain text
5148 #: build/C/man3/pthread_create.3:273
5149 #, no-wrap
5150 msgid ""
5151 "/* Thread start function: display address near top of our stack,\n"
5152 "   and return upper-cased copy of argv_string */\n"
5153 msgstr ""
5154 "/* Thread start function: display address near top of our stack,\n"
5155 "   and return upper-cased copy of argv_string */\n"
5156
5157 #. type: Plain text
5158 #: build/C/man3/pthread_create.3:279
5159 #, no-wrap
5160 msgid ""
5161 "static void *\n"
5162 "thread_start(void *arg)\n"
5163 "{\n"
5164 "    struct thread_info *tinfo = arg;\n"
5165 "    char *uargv, *p;\n"
5166 msgstr ""
5167 "static void *\n"
5168 "thread_start(void *arg)\n"
5169 "{\n"
5170 "    struct thread_info *tinfo = arg;\n"
5171 "    char *uargv, *p;\n"
5172
5173 #. type: Plain text
5174 #: build/C/man3/pthread_create.3:282
5175 #, no-wrap
5176 msgid ""
5177 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5178 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5179 msgstr ""
5180 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5181 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5182
5183 #. type: Plain text
5184 #: build/C/man3/pthread_create.3:286
5185 #, no-wrap
5186 msgid ""
5187 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5188 "    if (uargv == NULL)\n"
5189 "        handle_error(\"strdup\");\n"
5190 msgstr ""
5191 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5192 "    if (uargv == NULL)\n"
5193 "        handle_error(\"strdup\");\n"
5194
5195 #. type: Plain text
5196 #: build/C/man3/pthread_create.3:289
5197 #, no-wrap
5198 msgid ""
5199 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5200 "        *p = toupper(*p);\n"
5201 msgstr ""
5202 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5203 "        *p = toupper(*p);\n"
5204
5205 #. type: Plain text
5206 #: build/C/man3/pthread_create.3:292
5207 #, no-wrap
5208 msgid ""
5209 "    return uargv;\n"
5210 "}\n"
5211 msgstr ""
5212 "    return uargv;\n"
5213 "}\n"
5214
5215 #. type: Plain text
5216 #: build/C/man3/pthread_create.3:301
5217 #, no-wrap
5218 msgid ""
5219 "int\n"
5220 "main(int argc, char *argv[])\n"
5221 "{\n"
5222 "    int s, tnum, opt, num_threads;\n"
5223 "    struct thread_info *tinfo;\n"
5224 "    pthread_attr_t attr;\n"
5225 "    int stack_size;\n"
5226 "    void *res;\n"
5227 msgstr ""
5228 "int\n"
5229 "main(int argc, char *argv[])\n"
5230 "{\n"
5231 "    int s, tnum, opt, num_threads;\n"
5232 "    struct thread_info *tinfo;\n"
5233 "    pthread_attr_t attr;\n"
5234 "    int stack_size;\n"
5235 "    void *res;\n"
5236
5237 #. type: Plain text
5238 #: build/C/man3/pthread_create.3:303
5239 #, no-wrap
5240 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
5241 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
5242
5243 #. type: Plain text
5244 #: build/C/man3/pthread_create.3:310
5245 #, no-wrap
5246 msgid ""
5247 "    stack_size = -1;\n"
5248 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5249 "        switch (opt) {\n"
5250 "        case \\(aqs\\(aq:\n"
5251 "            stack_size = strtoul(optarg, NULL, 0);\n"
5252 "            break;\n"
5253 msgstr ""
5254 "    stack_size = -1;\n"
5255 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5256 "        switch (opt) {\n"
5257 "        case \\(aqs\\(aq:\n"
5258 "            stack_size = strtoul(optarg, NULL, 0);\n"
5259 "            break;\n"
5260
5261 #. type: Plain text
5262 #: build/C/man3/pthread_create.3:317
5263 #, no-wrap
5264 msgid ""
5265 "        default:\n"
5266 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5267 "                    argv[0]);\n"
5268 "            exit(EXIT_FAILURE);\n"
5269 "        }\n"
5270 "    }\n"
5271 msgstr ""
5272 "        default:\n"
5273 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5274 "                    argv[0]);\n"
5275 "            exit(EXIT_FAILURE);\n"
5276 "        }\n"
5277 "    }\n"
5278
5279 #. type: Plain text
5280 #: build/C/man3/pthread_create.3:319
5281 #, no-wrap
5282 msgid "    num_threads = argc - optind;\n"
5283 msgstr "    num_threads = argc - optind;\n"
5284
5285 #. type: Plain text
5286 #: build/C/man3/pthread_create.3:321
5287 #, no-wrap
5288 msgid "    /* Initialize thread creation attributes */\n"
5289 msgstr "    /* Initialize thread creation attributes */\n"
5290
5291 #. type: Plain text
5292 #: build/C/man3/pthread_create.3:325
5293 #, no-wrap
5294 msgid ""
5295 "    s = pthread_attr_init(&attr);\n"
5296 "    if (s != 0)\n"
5297 "        handle_error_en(s, \"pthread_attr_init\");\n"
5298 msgstr ""
5299 "    s = pthread_attr_init(&attr);\n"
5300 "    if (s != 0)\n"
5301 "        handle_error_en(s, \"pthread_attr_init\");\n"
5302
5303 #. type: Plain text
5304 #: build/C/man3/pthread_create.3:331
5305 #, no-wrap
5306 msgid ""
5307 "    if (stack_size E<gt> 0) {\n"
5308 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5309 "        if (s != 0)\n"
5310 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5311 "    }\n"
5312 msgstr ""
5313 "    if (stack_size E<gt> 0) {\n"
5314 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5315 "        if (s != 0)\n"
5316 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5317 "    }\n"
5318
5319 #. type: Plain text
5320 #: build/C/man3/pthread_create.3:333
5321 #, no-wrap
5322 msgid "    /* Allocate memory for pthread_create() arguments */\n"
5323 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
5324
5325 #. type: Plain text
5326 #: build/C/man3/pthread_create.3:337
5327 #, no-wrap
5328 msgid ""
5329 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5330 "    if (tinfo == NULL)\n"
5331 "        handle_error(\"calloc\");\n"
5332 msgstr ""
5333 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5334 "    if (tinfo == NULL)\n"
5335 "        handle_error(\"calloc\");\n"
5336
5337 #. type: Plain text
5338 #: build/C/man3/pthread_create.3:339
5339 #, no-wrap
5340 msgid "    /* Create one thread for each command-line argument */\n"
5341 msgstr "    /* Create one thread for each command-line argument */\n"
5342
5343 #. type: Plain text
5344 #: build/C/man3/pthread_create.3:343
5345 #, no-wrap
5346 msgid ""
5347 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5348 "        tinfo[tnum].thread_num = tnum + 1;\n"
5349 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5350 msgstr ""
5351 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5352 "        tinfo[tnum].thread_num = tnum + 1;\n"
5353 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5354
5355 #. type: Plain text
5356 #: build/C/man3/pthread_create.3:346
5357 #, no-wrap
5358 msgid ""
5359 "        /* The pthread_create() call stores the thread ID into\n"
5360 "           corresponding element of tinfo[] */\n"
5361 msgstr ""
5362 "        /* The pthread_create() call stores the thread ID into\n"
5363 "           corresponding element of tinfo[] */\n"
5364
5365 #. type: Plain text
5366 #: build/C/man3/pthread_create.3:352
5367 #, no-wrap
5368 msgid ""
5369 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5370 "                           &thread_start, &tinfo[tnum]);\n"
5371 "        if (s != 0)\n"
5372 "            handle_error_en(s, \"pthread_create\");\n"
5373 "    }\n"
5374 msgstr ""
5375 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5376 "                           &thread_start, &tinfo[tnum]);\n"
5377 "        if (s != 0)\n"
5378 "            handle_error_en(s, \"pthread_create\");\n"
5379 "    }\n"
5380
5381 #. type: Plain text
5382 #: build/C/man3/pthread_create.3:355
5383 #, no-wrap
5384 msgid ""
5385 "    /* Destroy the thread attributes object, since it is no\n"
5386 "       longer needed */\n"
5387 msgstr ""
5388 "    /* Destroy the thread attributes object, since it is no\n"
5389 "       longer needed */\n"
5390
5391 #. type: Plain text
5392 #: build/C/man3/pthread_create.3:359
5393 #, no-wrap
5394 msgid ""
5395 "    s = pthread_attr_destroy(&attr);\n"
5396 "    if (s != 0)\n"
5397 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5398 msgstr ""
5399 "    s = pthread_attr_destroy(&attr);\n"
5400 "    if (s != 0)\n"
5401 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5402
5403 #. type: Plain text
5404 #: build/C/man3/pthread_create.3:361
5405 #, no-wrap
5406 msgid "    /* Now join with each thread, and display its returned value */\n"
5407 msgstr "    /* Now join with each thread, and display its returned value */\n"
5408
5409 #. type: Plain text
5410 #: build/C/man3/pthread_create.3:366
5411 #, no-wrap
5412 msgid ""
5413 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5414 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5415 "        if (s != 0)\n"
5416 "            handle_error_en(s, \"pthread_join\");\n"
5417 msgstr ""
5418 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5419 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5420 "        if (s != 0)\n"
5421 "            handle_error_en(s, \"pthread_join\");\n"
5422
5423 #. type: Plain text
5424 #: build/C/man3/pthread_create.3:371
5425 #, no-wrap
5426 msgid ""
5427 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5428 "                tinfo[tnum].thread_num, (char *) res);\n"
5429 "        free(res);      /* Free memory allocated by thread */\n"
5430 "    }\n"
5431 msgstr ""
5432 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5433 "                tinfo[tnum].thread_num, (char *) res);\n"
5434 "        free(res);      /* Free memory allocated by thread */\n"
5435 "    }\n"
5436
5437 #. type: Plain text
5438 #: build/C/man3/pthread_create.3:375
5439 #, no-wrap
5440 msgid ""
5441 "    free(tinfo);\n"
5442 "    exit(EXIT_SUCCESS);\n"
5443 "}\n"
5444 msgstr ""
5445 "    free(tinfo);\n"
5446 "    exit(EXIT_SUCCESS);\n"
5447 "}\n"
5448
5449 #. type: Plain text
5450 #: build/C/man3/pthread_create.3:389
5451 msgid ""
5452 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5453 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5454 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), "
5455 "B<pthreads>(7)"
5456 msgstr ""
5457 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5458 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5459 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), "
5460 "B<pthreads>(7)"
5461
5462 #. type: TH
5463 #: build/C/man3/pthread_detach.3:26
5464 #, no-wrap
5465 msgid "PTHREAD_DETACH"
5466 msgstr "PTHREAD_DETACH"
5467
5468 #. type: TH
5469 #: build/C/man3/pthread_detach.3:26 build/C/man3/pthread_join.3:26
5470 #, no-wrap
5471 msgid "2008-11-27"
5472 msgstr "2008-11-27"
5473
5474 #. type: Plain text
5475 #: build/C/man3/pthread_detach.3:29
5476 msgid "pthread_detach - detach a thread"
5477 msgstr "pthread_detach - スレッドを切り離す (detach する)"
5478
5479 #. type: Plain text
5480 #: build/C/man3/pthread_detach.3:34
5481 #, no-wrap
5482 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5483 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5484
5485 #. type: Plain text
5486 #: build/C/man3/pthread_detach.3:46
5487 msgid ""
5488 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
5489 "as detached.  When a detached thread terminates, its resources are "
5490 "automatically released back to the system without the need for another "
5491 "thread to join with the terminated thread."
5492 msgstr ""
5493 "B<pthread_detach>() 関数は I<thread> で識別されるスレッドに\n"
5494 "detached (切り離された状態) という印を付ける。\n"
5495 "detached 状態のスレッドが終了すると、\n"
5496 "別のスレッドが終了されたスレッドを join しなくても、\n"
5497 "そのスレッドのリソースは自動的に解放されてシステムに戻される。"
5498
5499 #. type: Plain text
5500 #: build/C/man3/pthread_detach.3:49
5501 msgid ""
5502 "Attempting to detach an already detached thread results in unspecified "
5503 "behavior."
5504 msgstr ""
5505 "すでに detach 状態のスレッドを detach しようとした場合に\n"
5506 "どのような結果となるかは規定されていない。"
5507
5508 #. type: Plain text
5509 #: build/C/man3/pthread_detach.3:54
5510 msgid ""
5511 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
5512 "number."
5513 msgstr ""
5514 "成功すると、B<pthread_detach>() は 0 を返す。\n"
5515 "エラーの場合、エラー番号を返す。"
5516
5517 #. type: Plain text
5518 #: build/C/man3/pthread_detach.3:59 build/C/man3/pthread_join.3:89
5519 msgid "I<thread> is not a joinable thread."
5520 msgstr "I<thread> が join 可能なスレッドではない。"
5521
5522 #. type: Plain text
5523 #: build/C/man3/pthread_detach.3:70
5524 msgid ""
5525 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
5526 "or be made joinable again."
5527 msgstr ""
5528 "いったんスレッドを detached 状態にすると、\n"
5529 "そのスレッドを B<pthread_join>(3) で join したり、\n"
5530 "もう一度 join 可能にしたりすることはできない。"
5531
5532 #. type: Plain text
5533 #: build/C/man3/pthread_detach.3:77
5534 msgid ""
5535 "A new thread can be created in a detached state using "
5536 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
5537 "I<attr> argument of B<pthread_create>(3)."
5538 msgstr ""
5539 "B<pthread_attr_setdetachstate>(3) を使って\n"
5540 "B<pthread_create>(3) の I<attr> 引き数の detached 属性を設定することで、\n"
5541 "新しいスレッドを detached 状態で作成することができる。"
5542
5543 #. type: Plain text
5544 #: build/C/man3/pthread_detach.3:84
5545 msgid ""
5546 "The detached attribute merely determines the behavior of the system when the "
5547 "thread terminates; it does not prevent the thread from being terminated if "
5548 "the process terminates using B<exit>(3)  (or equivalently, if the main "
5549 "thread returns)."
5550 msgstr ""
5551 "detached 属性は、スレッドが終了した際のシステムの動作を決めるだけである。\n"
5552 "プロセスが B<exit>(3) を使って終了した場合に、そのスレッドが終了され\n"
5553 "なくなるようなことはない (なお、メインスレッドが return した場合も\n"
5554 "プロセスが B<exit>(3) を使って終了した場合と全く同じである)。 "
5555
5556 #. type: Plain text
5557 #: build/C/man3/pthread_detach.3:93
5558 msgid ""
5559 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
5560 "thread that an application creates, so that system resources for the thread "
5561 "can be released.  (But note that the resources of all threads are freed when "
5562 "the process terminates.)"
5563 msgstr ""
5564 "アプリケーションが作成した各スレッドについて、そのスレッドが使用して\n"
5565 "いるシステムリソースを解放できるように、B<pthread_join>(3) か\n"
5566 "B<pthread_detach>() のどちらかを呼び出すべきである (ただし、プロセスが\n"
5567 "終了するときには、全てのスレッドのリソースが解放される)。"
5568
5569 #. type: Plain text
5570 #: build/C/man3/pthread_detach.3:95
5571 msgid "The following statement detaches the calling thread:"
5572 msgstr "以下の文は、呼び出したスレッド自身を detach する。"
5573
5574 #. type: Plain text
5575 #: build/C/man3/pthread_detach.3:97
5576 #, no-wrap
5577 msgid "    pthread_detach(pthread_self());\n"
5578 msgstr "    pthread_detach(pthread_self());\n"
5579
5580 #. type: Plain text
5581 #: build/C/man3/pthread_detach.3:104
5582 msgid ""
5583 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), "
5584 "B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5585 msgstr ""
5586 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), "
5587 "B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5588
5589 #. type: TH
5590 #: build/C/man3/pthread_equal.3:26
5591 #, no-wrap
5592 msgid "PTHREAD_EQUAL"
5593 msgstr "PTHREAD_EQUAL"
5594
5595 #. type: TH
5596 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
5597 #: build/C/man3/pthread_getcpuclockid.3:26
5598 #: build/C/man3/pthread_setaffinity_np.3:26
5599 #: build/C/man3/pthread_setconcurrency.3:25
5600 #, no-wrap
5601 msgid "2014-05-23"
5602 msgstr "2014-05-23"
5603
5604 #. type: Plain text
5605 #: build/C/man3/pthread_equal.3:29
5606 msgid "pthread_equal - compare thread IDs"
5607 msgstr "pthread_equal - スレッド ID を比較する"
5608
5609 #. type: Plain text
5610 #: build/C/man3/pthread_equal.3:34
5611 #, no-wrap
5612 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5613 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5614
5615 #. type: Plain text
5616 #: build/C/man3/pthread_equal.3:41
5617 msgid "The B<pthread_equal>()  function compares two thread identifiers."
5618 msgstr "B<pthread_equal>() 関数は 2 つのスレッド識別子の比較を行う。"
5619
5620 #. type: Plain text
5621 #: build/C/man3/pthread_equal.3:45
5622 msgid ""
5623 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
5624 "value; otherwise, it returns 0."
5625 msgstr ""
5626 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
5627 "そうでなければ 0 を返す。"
5628
5629 #.  SH VERSIONS
5630 #.  Available since glibc 2.0
5631 #. type: Plain text
5632 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
5633 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_testcancel.3:58
5634 msgid "This function always succeeds."
5635 msgstr "この関数は常に成功する。"
5636
5637 #. type: Plain text
5638 #: build/C/man3/pthread_equal.3:52
5639 msgid "The B<pthread_equal>()  function is thread-safe."
5640 msgstr "B<pthread_equal>() 関数はスレッドセーフである。"
5641
5642 #. type: Plain text
5643 #: build/C/man3/pthread_equal.3:61
5644 msgid ""
5645 "The B<pthread_equal>()  function is necessary because thread IDs should be "
5646 "considered opaque: there is no portable way for applications to directly "
5647 "compare two I<pthread_t> values."
5648 msgstr ""
5649 "B<pthread_equal>() 関数が必要なのは、\n"
5650 "スレッド ID はその内部構造を意識すべきではないためである。\n"
5651 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
5652 "移植性を確保できる形で比較する方法はない。"
5653
5654 #. type: Plain text
5655 #: build/C/man3/pthread_equal.3:65
5656 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5657 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5658
5659 #. type: TH
5660 #: build/C/man3/pthread_exit.3:26
5661 #, no-wrap
5662 msgid "PTHREAD_EXIT"
5663 msgstr "PTHREAD_EXIT"
5664
5665 #. type: Plain text
5666 #: build/C/man3/pthread_exit.3:29
5667 msgid "pthread_exit - terminate calling thread"
5668 msgstr "pthread_exit - 呼び出したスレッドを終了する"
5669
5670 #. type: Plain text
5671 #: build/C/man3/pthread_exit.3:34
5672 #, no-wrap
5673 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
5674 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
5675
5676 #. type: Plain text
5677 #: build/C/man3/pthread_exit.3:45
5678 msgid ""
5679 "The B<pthread_exit>()  function terminates the calling thread and returns a "
5680 "value via I<retval> that (if the thread is joinable)  is available to "
5681 "another thread in the same process that calls B<pthread_join>(3)."
5682 msgstr ""
5683 "B<pthread_exit>() 関数は、呼び出したスレッドを終了し、\n"
5684 "I<retval> 経由で値を返す。\n"
5685 "この値は (そのスレッドが join 可能な場合に) B<pthread_join>(3) を\n"
5686 "呼び出した同じプロセス内の別のスレッドが参照できる値と同じである。"
5687
5688 #. type: Plain text
5689 #: build/C/man3/pthread_exit.3:55
5690 msgid ""
5691 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
5692 "not yet been popped, are popped (in the reverse of the order in which they "
5693 "were pushed)  and executed.  If the thread has any thread-specific data, "
5694 "then, after the clean-up handlers have been executed, the corresponding "
5695 "destructor functions are called, in an unspecified order."
5696 msgstr ""
5697 "B<pthread_cleanup_push>(3) で設定されたクリーンアップハンドラのうち、\n"
5698 "まだ pop (取り出されていない) ハンドラを (push されたのと逆の順序で)\n"
5699 "取り出して実行する。そのスレッドがスレッド固有のデータを持っている\n"
5700 "場合は、クリーンアップハンドラが実行された後に、スレッド固有のデータ\n"
5701 "に対応するデストラクタ (destructor) 関数が呼び出される (呼び出し順序\n"
5702 "は規定されていない)。"
5703
5704 #. type: Plain text
5705 #: build/C/man3/pthread_exit.3:62
5706 msgid ""
5707 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
5708 "variables, semaphores, and file descriptors) are not released, and functions "
5709 "registered using B<atexit>(3)  are not called."
5710 msgstr ""
5711 "スレッドが終了する際に、プロセスの共有リソース (例えば、mutex、状態変数\n"
5712 "(condition variables)、セマフォ、ファイルディスクリプタ)が解放される。\n"
5713 "B<atexit>(3) を使って登録された関数は呼び出されない。"
5714
5715 #. type: Plain text
5716 #: build/C/man3/pthread_exit.3:71
5717 msgid ""
5718 "After the last thread in a process terminates, the process terminates as by "
5719 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
5720 "resources are released and functions registered using B<atexit>(3)  are "
5721 "called."
5722 msgstr ""
5723 "プロセスの最後のスレッドが終了すると、そのプロセスは、終了ステータス 0\n"
5724 "で B<exit>(3) を呼び出した場合と全く同じように終了する。したがって、\n"
5725 "プロセスの共有リソースは解放され、B<atexit>(3) を使って登録された関数\n"
5726 "が呼び出される。"
5727
5728 #. type: Plain text
5729 #: build/C/man3/pthread_exit.3:73
5730 msgid "This function does not return to the caller."
5731 msgstr "この関数は呼び出し側には返らない。"
5732
5733 #. type: Plain text
5734 #: build/C/man3/pthread_exit.3:80
5735 msgid "The B<pthread_exit>()  function is thread-safe."
5736 msgstr "B<pthread_exit>() 関数はスレッドセーフである。"
5737
5738 #. type: Plain text
5739 #: build/C/man3/pthread_exit.3:87
5740 msgid ""
5741 "Performing a return from the start function of any thread other than the "
5742 "main thread results in an implicit call to B<pthread_exit>(), using the "
5743 "function's return value as the thread's exit status."
5744 msgstr ""
5745 "メインスレッド以外のスレッドの開始関数 (start function) がreturn を\n"
5746 "行うと、暗黙のうちに B<pthread_exit>() が呼び出され、\n"
5747 "関数の返り値がスレッドの終了ステータスとして使用される。"
5748
5749 #. type: Plain text
5750 #: build/C/man3/pthread_exit.3:93
5751 msgid ""
5752 "To allow other threads to continue execution, the main thread should "
5753 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
5754 msgstr ""
5755 "他のスレッドが実行を継続できるように、メインスレッドは B<exit>(3) では\n"
5756 "なく B<pthread_exit>() を呼び出して終了すべきである。"
5757
5758 #. type: Plain text
5759 #: build/C/man3/pthread_exit.3:98
5760 msgid ""
5761 "The value pointed to by I<retval> should not be located on the calling "
5762 "thread's stack, since the contents of that stack are undefined after the "
5763 "thread terminates."
5764 msgstr ""
5765 "I<retval> が指す値は、呼び出したスレッドのスタックに置くべきではない。\n"
5766 "呼び出したスレッドが終了した後は、そのスタックの内容が不定となるから\n"
5767 "である。"
5768
5769 #.  Linux 2.6.27
5770 #.  FIXME . review a later kernel to see if this gets fixed
5771 #.  http://thread.gmane.org/gmane.linux.kernel/611611
5772 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
5773 #. type: Plain text
5774 #: build/C/man3/pthread_exit.3:110
5775 msgid ""
5776 "Currently, there are limitations in the kernel implementation logic for "
5777 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
5778 "This can manifest in problems such as a locked terminal if a stop signal is "
5779 "sent to a foreground process whose thread group leader has already called "
5780 "B<pthread_exit>()."
5781 msgstr ""
5782 "現在のところ、停止 (stop) されたスレッドグループを、すでに終了した\n"
5783 "(dead) スレッドグループリーダーで B<wait>(2) する場合の、\n"
5784 "カーネル実装の論理には制限がある。\n"
5785 "この制限は、すでにスレッドグループリーダーが B<pthread_exit>() を\n"
5786 "呼び出しているようなフォアグラウンドプロセスにストップシグナルが送信\n"
5787 "された場合に、端末がロックされてしまう、といった問題として表に見える\n"
5788 "場合がある。"
5789
5790 #. type: Plain text
5791 #: build/C/man3/pthread_exit.3:114
5792 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5793 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5794
5795 #. type: TH
5796 #: build/C/man3/pthread_getattr_np.3:26
5797 #, no-wrap
5798 msgid "PTHREAD_GETATTR_NP"
5799 msgstr "PTHREAD_GETATTR_NP"
5800
5801 #. type: TH
5802 #: build/C/man3/pthread_getattr_np.3:26 build/C/man3/pthread_tryjoin_np.3:26
5803 #, no-wrap
5804 msgid "2010-09-10"
5805 msgstr "2010-09-10"
5806
5807 #. type: Plain text
5808 #: build/C/man3/pthread_getattr_np.3:29
5809 msgid "pthread_getattr_np - get attributes of created thread"
5810 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
5811
5812 #. type: Plain text
5813 #: build/C/man3/pthread_getattr_np.3:35
5814 #, no-wrap
5815 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5816 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5817
5818 #. type: Plain text
5819 #: build/C/man3/pthread_getattr_np.3:45
5820 msgid ""
5821 "The B<pthread_getattr_np>()  function initializes the thread attributes "
5822 "object referred to by I<attr> so that it contains actual attribute values "
5823 "describing the running thread I<thread>."
5824 msgstr ""
5825 "B<pthread_getattr_np>() 関数は、\n"
5826 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
5827 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
5828 "格納して返す。"
5829
5830 #. type: Plain text
5831 #: build/C/man3/pthread_getattr_np.3:52
5832 msgid ""
5833 "The returned attribute values may differ from the corresponding attribute "
5834 "values passed in the I<attr> object that was used to create the thread using "
5835 "B<pthread_create>(3).  In particular, the following attributes may differ:"
5836 msgstr ""
5837 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
5838 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
5839 "特に、以下の属性は異なる場合がある。"
5840
5841 #. type: Plain text
5842 #: build/C/man3/pthread_getattr_np.3:55
5843 msgid ""
5844 "the detach state, since a joinable thread may have detached itself after "
5845 "creation;"
5846 msgstr ""
5847 "detach state. join 可能なスレッドは作成後に自分自身を\n"
5848 "切り離す (detach する) ことができるからである。"
5849
5850 #. type: Plain text
5851 #: build/C/man3/pthread_getattr_np.3:58
5852 msgid ""
5853 "the stack size, which the implementation may align to a suitable boundary."
5854 msgstr ""
5855 "スタックサイズ。\n"
5856 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
5857
5858 #. type: Plain text
5859 #: build/C/man3/pthread_getattr_np.3:63
5860 msgid ""
5861 "and the guard size, which the implementation may round upward to a multiple "
5862 "of the page size, or ignore (i.e., treat as 0), if the application is "
5863 "allocating its own stack."
5864 msgstr ""
5865 "guard size.\n"
5866 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
5867 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
5868 "(0 として扱われる) ことがあるからである。"
5869
5870 #. type: Plain text
5871 #: build/C/man3/pthread_getattr_np.3:68
5872 msgid ""
5873 "Furthermore, if the stack address attribute was not set in the thread "
5874 "attributes object used to create the thread, then the returned thread "
5875 "attributes object will report the actual stack address that the "
5876 "implementation selected for the thread."
5877 msgstr ""
5878 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
5879 "スタックアドレスが設定されていなかった場合、\n"
5880 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
5881 "割り当てた実際のスタックアドレスが報告される。"
5882
5883 #. type: Plain text
5884 #: build/C/man3/pthread_getattr_np.3:73
5885 msgid ""
5886 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
5887 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
5888 msgstr ""
5889 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
5890 "必要なくなった際には、  B<pthread_attr_destroy>(3) を使って\n"
5891 "そのオブジェクトを破棄すべきである。"
5892
5893 #. type: Plain text
5894 #: build/C/man3/pthread_getattr_np.3:76
5895 #: build/C/man3/pthread_getcpuclockid.3:49
5896 msgid ""
5897 "On success, this function returns 0; on error, it returns a nonzero error "
5898 "number."
5899 msgstr ""
5900 "成功すると、この関数は 0 を返す。\n"
5901 "エラーの場合、 0 以外のエラー番号を返す。"
5902
5903 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
5904 #. type: Plain text
5905 #: build/C/man3/pthread_getattr_np.3:81
5906 msgid "Insufficient memory."
5907 msgstr "メモリが十分になかった。"
5908
5909 #. type: Plain text
5910 #: build/C/man3/pthread_getattr_np.3:96
5911 msgid ""
5912 "In addition, if I<thread> refers to the main thread, then "
5913 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
5914 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and "
5915 "B<getrlimit>(2), if the B<RLIMIT_STACK> resource limit is not supported."
5916 msgstr ""
5917 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
5918 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
5919 "エラーで失敗する可能性がある。\n"
5920 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
5921 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
5922 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
5923
5924 #. type: Plain text
5925 #: build/C/man3/pthread_getattr_np.3:98
5926 msgid "This function is available in glibc since version 2.2.3."
5927 msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。"
5928
5929 #. type: Plain text
5930 #: build/C/man3/pthread_getattr_np.3:101
5931 #: build/C/man3/pthread_kill_other_threads_np.3:55
5932 msgid ""
5933 "This function is a nonstandard GNU extension; hence the suffix \"_np"
5934 "\" (nonportable) in the name."
5935 msgstr ""
5936 "この関数は非標準の GNU による拡張である。\n"
5937 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
5938 "付いている。"
5939
5940 #. type: Plain text
5941 #: build/C/man3/pthread_getattr_np.3:111
5942 msgid ""
5943 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
5944 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
5945 "and display its guard size, stack address, and stack size attributes.  "
5946 "Command-line arguments can be used to set these attributes to values other "
5947 "than the default when creating the thread.  The shell sessions below "
5948 "demonstrate the use of the program."
5949 msgstr ""
5950 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
5951 "このプログラムは、スレッドを作成し、それから\n"
5952 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
5953 "スタックアドレス、スタックサイズを取得し表示する。\n"
5954 "コマンドライン引き数での指定で、スレッドを作成する際に\n"
5955 "上記の属性にデフォルト値以外の値を設定することができる。\n"
5956 "下記のシェルのセッションはこのプログラムの使用例である。"
5957
5958 #. type: Plain text
5959 #: build/C/man3/pthread_getattr_np.3:114
5960 msgid ""
5961 "In the first run, on an x86-32 system, a thread is created using default "
5962 "attributes:"
5963 msgstr ""
5964 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
5965 "(x86-32 システム上で実行)。"
5966
5967 #. type: Plain text
5968 #: build/C/man3/pthread_getattr_np.3:124
5969 #, no-wrap
5970 msgid ""
5971 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5972 "unlimited\n"
5973 "$B< ./a.out>\n"
5974 "Attributes of created thread:\n"
5975 "        Guard size          = 4096 bytes\n"
5976 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5977 "        Stack size          = 0x201000 (2101248) bytes\n"
5978 msgstr ""
5979 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5980 "unlimited\n"
5981 "$B< ./a.out>\n"
5982 "Attributes of created thread:\n"
5983 "        Guard size          = 4096 bytes\n"
5984 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5985 "        Stack size          = 0x201000 (2101248) bytes\n"
5986
5987 #. type: Plain text
5988 #: build/C/man3/pthread_getattr_np.3:130
5989 msgid ""
5990 "In the following run, we see that if a guard size is specified, it is "
5991 "rounded up to the next multiple of the system page size (4096 bytes on "
5992 "x86-32):"
5993 msgstr ""
5994 "次の実行例では、guard size が指定された場合、\n"
5995 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
5996 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
5997
5998 #. type: Plain text
5999 #: build/C/man3/pthread_getattr_np.3:138
6000 #, no-wrap
6001 msgid ""
6002 "$B< ./a.out -g 4097>\n"
6003 "Thread attributes object after initializations:\n"
6004 "        Guard size          = 4097 bytes\n"
6005 "        Stack address       = (nil)\n"
6006 "        Stack size          = 0x0 (0) bytes\n"
6007 msgstr ""
6008 "$B< ./a.out -g 4097>\n"
6009 "Thread attributes object after initializations:\n"
6010 "        Guard size          = 4097 bytes\n"
6011 "        Stack address       = (nil)\n"
6012 "        Stack size          = 0x0 (0) bytes\n"
6013
6014 #. type: Plain text
6015 #: build/C/man3/pthread_getattr_np.3:143
6016 #, no-wrap
6017 msgid ""
6018 "Attributes of created thread:\n"
6019 "        Guard size          = 8192 bytes\n"
6020 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
6021 "        Stack size          = 0x201000 (2101248) bytes\n"
6022 msgstr ""
6023 "Attributes of created thread:\n"
6024 "        Guard size          = 8192 bytes\n"
6025 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
6026 "        Stack size          = 0x201000 (2101248) bytes\n"
6027
6028 #. .in +4n
6029 #. .nf
6030 #. $ ./a.out \-s 0x8000
6031 #. Thread attributes object after initializations:
6032 #.         Guard size          = 4096 bytes
6033 #.         Stack address       = 0xffff8000 (EOS = (nil))
6034 #.         Stack size          = 0x8000 (32768) bytes
6035 #. Attributes of created thread:
6036 #.         Guard size          = 4096 bytes
6037 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
6038 #.         Stack size          = 0x8000 (32768) bytes
6039 #. .fi
6040 #. .in
6041 #. type: Plain text
6042 #: build/C/man3/pthread_getattr_np.3:162
6043 msgid ""
6044 "In the last run, the program manually allocates a stack for the thread.  In "
6045 "this case, the guard size attribute is ignored."
6046 msgstr ""
6047 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
6048 "この場合には、guard size 属性は無視される。"
6049
6050 #. type: Plain text
6051 #: build/C/man3/pthread_getattr_np.3:167
6052 #, no-wrap
6053 msgid ""
6054 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
6055 "Allocated thread stack at 0x804d000\n"
6056 msgstr ""
6057 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
6058 "Allocated thread stack at 0x804d000\n"
6059
6060 #. type: Plain text
6061 #: build/C/man3/pthread_getattr_np.3:172
6062 #, no-wrap
6063 msgid ""
6064 "Thread attributes object after initializations:\n"
6065 "        Guard size          = 4096 bytes\n"
6066 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6067 "        Stack size          = 0x8000 (32768) bytes\n"
6068 msgstr ""
6069 "Thread attributes object after initializations:\n"
6070 "        Guard size          = 4096 bytes\n"
6071 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6072 "        Stack size          = 0x8000 (32768) bytes\n"
6073
6074 #. type: Plain text
6075 #: build/C/man3/pthread_getattr_np.3:177
6076 #, no-wrap
6077 msgid ""
6078 "Attributes of created thread:\n"
6079 "        Guard size          = 0 bytes\n"
6080 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6081 "        Stack size          = 0x8000 (32768) bytes\n"
6082 msgstr ""
6083 "Attributes of created thread:\n"
6084 "        Guard size          = 0 bytes\n"
6085 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6086 "        Stack size          = 0x8000 (32768) bytes\n"
6087
6088 #. type: Plain text
6089 #: build/C/man3/pthread_getattr_np.3:198
6090 #, no-wrap
6091 msgid ""
6092 "static void\n"
6093 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6094 "{\n"
6095 "    int s;\n"
6096 "    size_t stack_size, guard_size;\n"
6097 "    void *stack_addr;\n"
6098 msgstr ""
6099 "static void\n"
6100 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6101 "{\n"
6102 "    int s;\n"
6103 "    size_t stack_size, guard_size;\n"
6104 "    void *stack_addr;\n"
6105
6106 #. type: Plain text
6107 #: build/C/man3/pthread_getattr_np.3:203
6108 #, no-wrap
6109 msgid ""
6110 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
6111 "    if (s != 0)\n"
6112 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6113 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
6114 msgstr ""
6115 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
6116 "    if (s != 0)\n"
6117 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6118 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
6119
6120 #. type: Plain text
6121 #: build/C/man3/pthread_getattr_np.3:214
6122 #, no-wrap
6123 msgid ""
6124 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6125 "    if (s != 0)\n"
6126 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
6127 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
6128 "    if (stack_size E<gt> 0)\n"
6129 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6130 "    printf(\"\\en\");\n"
6131 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
6132 "            prefix, stack_size, stack_size);\n"
6133 "}\n"
6134 msgstr ""
6135 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6136 "    if (s != 0)\n"
6137 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
6138 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
6139 "    if (stack_size E<gt> 0)\n"
6140 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6141 "    printf(\"\\en\");\n"
6142 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
6143 "            prefix, stack_size, stack_size);\n"
6144 "}\n"
6145
6146 #. type: Plain text
6147 #: build/C/man3/pthread_getattr_np.3:220
6148 #, no-wrap
6149 msgid ""
6150 "static void\n"
6151 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6152 "{\n"
6153 "    int s;\n"
6154 "    pthread_attr_t attr;\n"
6155 msgstr ""
6156 "static void\n"
6157 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6158 "{\n"
6159 "    int s;\n"
6160 "    pthread_attr_t attr;\n"
6161
6162 #. type: Plain text
6163 #: build/C/man3/pthread_getattr_np.3:224
6164 #, no-wrap
6165 msgid ""
6166 "    s = pthread_getattr_np(thread, &attr);\n"
6167 "    if (s != 0)\n"
6168 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6169 msgstr ""
6170 "    s = pthread_getattr_np(thread, &attr);\n"
6171 "    if (s != 0)\n"
6172 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6173
6174 #. type: Plain text
6175 #: build/C/man3/pthread_getattr_np.3:226
6176 #, no-wrap
6177 msgid "    display_stack_related_attributes(&attr, prefix);\n"
6178 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
6179
6180 #. type: Plain text
6181 #: build/C/man3/pthread_getattr_np.3:231
6182 #, no-wrap
6183 msgid ""
6184 "    s = pthread_attr_destroy(&attr);\n"
6185 "    if (s != 0)\n"
6186 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6187 "}\n"
6188 msgstr ""
6189 "    s = pthread_attr_destroy(&attr);\n"
6190 "    if (s != 0)\n"
6191 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6192 "}\n"
6193
6194 #. type: Plain text
6195 #: build/C/man3/pthread_getattr_np.3:237
6196 #, no-wrap
6197 msgid ""
6198 "static void *           /* Start function for thread we create */\n"
6199 "thread_start(void *arg)\n"
6200 "{\n"
6201 "    printf(\"Attributes of created thread:\\en\");\n"
6202 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6203 msgstr ""
6204 "static void *           /* Start function for thread we create */\n"
6205 "thread_start(void *arg)\n"
6206 "{\n"
6207 "    printf(\"Attributes of created thread:\\en\");\n"
6208 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6209
6210 #. type: Plain text
6211 #: build/C/man3/pthread_getattr_np.3:251
6212 #, no-wrap
6213 msgid ""
6214 "static void\n"
6215 "usage(char *pname, char *msg)\n"
6216 "{\n"
6217 "    if (msg != NULL)\n"
6218 "        fputs(msg, stderr);\n"
6219 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6220 "            \" [-g guard-size]\\en\", pname);\n"
6221 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6222 "    exit(EXIT_FAILURE);\n"
6223 "}\n"
6224 msgstr ""
6225 "static void\n"
6226 "usage(char *pname, char *msg)\n"
6227 "{\n"
6228 "    if (msg != NULL)\n"
6229 "        fputs(msg, stderr);\n"
6230 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6231 "            \" [-g guard-size]\\en\", pname);\n"
6232 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6233 "    exit(EXIT_FAILURE);\n"
6234 "}\n"
6235
6236 #. type: Plain text
6237 #: build/C/man3/pthread_getattr_np.3:264
6238 #, no-wrap
6239 msgid ""
6240 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6241 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6242 "                              pthread_attr_t *attrp)\n"
6243 "{\n"
6244 "    int s, opt, allocate_stack;\n"
6245 "    long stack_size, guard_size;\n"
6246 "            void *stack_addr;\n"
6247 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6248 "                                           a thread attributes object */\n"
6249 "    allocate_stack = 0;\n"
6250 "    stack_size = -1;\n"
6251 "    guard_size = -1;\n"
6252 msgstr ""
6253 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6254 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6255 "                              pthread_attr_t *attrp)\n"
6256 "{\n"
6257 "    int s, opt, allocate_stack;\n"
6258 "    long stack_size, guard_size;\n"
6259 "            void *stack_addr;\n"
6260 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6261 "                                           a thread attributes object */\n"
6262 "    allocate_stack = 0;\n"
6263 "    stack_size = -1;\n"
6264 "    guard_size = -1;\n"
6265
6266 #. type: Plain text
6267 #: build/C/man3/pthread_getattr_np.3:273
6268 #, no-wrap
6269 msgid ""
6270 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6271 "        switch (opt) {\n"
6272 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6273 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6274 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6275 "        default:    usage(argv[0], NULL);\n"
6276 "        }\n"
6277 "    }\n"
6278 msgstr ""
6279 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6280 "        switch (opt) {\n"
6281 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6282 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6283 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6284 "        default:    usage(argv[0], NULL);\n"
6285 "        }\n"
6286 "    }\n"
6287
6288 #. type: Plain text
6289 #: build/C/man3/pthread_getattr_np.3:276
6290 #, no-wrap
6291 msgid ""
6292 "    if (allocate_stack && stack_size == -1)\n"
6293 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6294 msgstr ""
6295 "    if (allocate_stack && stack_size == -1)\n"
6296 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6297
6298 #. type: Plain text
6299 #: build/C/man3/pthread_getattr_np.3:279
6300 #, no-wrap
6301 msgid ""
6302 "    if (argc E<gt> optind)\n"
6303 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6304 msgstr ""
6305 "    if (argc E<gt> optind)\n"
6306 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6307
6308 #. type: Plain text
6309 #: build/C/man3/pthread_getattr_np.3:282
6310 #, no-wrap
6311 msgid ""
6312 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6313 "        ret_attrp = attrp;\n"
6314 msgstr ""
6315 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6316 "        ret_attrp = attrp;\n"
6317
6318 #. type: Plain text
6319 #: build/C/man3/pthread_getattr_np.3:287
6320 #, no-wrap
6321 msgid ""
6322 "        s = pthread_attr_init(attrp);\n"
6323 "        if (s != 0)\n"
6324 "            handle_error_en(s, \"pthread_attr_init\");\n"
6325 "    }\n"
6326 msgstr ""
6327 "        s = pthread_attr_init(attrp);\n"
6328 "        if (s != 0)\n"
6329 "            handle_error_en(s, \"pthread_attr_init\");\n"
6330 "    }\n"
6331
6332 #. type: Plain text
6333 #: build/C/man3/pthread_getattr_np.3:299
6334 #, no-wrap
6335 msgid ""
6336 "    if (stack_size E<gt>= 0) {\n"
6337 "        if (!allocate_stack) {\n"
6338 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6339 "            if (s != 0)\n"
6340 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6341 "        } else {\n"
6342 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6343 "                               stack_size);\n"
6344 "            if (s != 0)\n"
6345 "                handle_error_en(s, \"posix_memalign\");\n"
6346 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6347 msgstr ""
6348 "    if (stack_size E<gt>= 0) {\n"
6349 "        if (!allocate_stack) {\n"
6350 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6351 "            if (s != 0)\n"
6352 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6353 "        } else {\n"
6354 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6355 "                               stack_size);\n"
6356 "            if (s != 0)\n"
6357 "                handle_error_en(s, \"posix_memalign\");\n"
6358 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6359
6360 #. type: Plain text
6361 #: build/C/man3/pthread_getattr_np.3:305
6362 #, no-wrap
6363 msgid ""
6364 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6365 "            if (s != 0)\n"
6366 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6367 "        }\n"
6368 "    }\n"
6369 msgstr ""
6370 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6371 "            if (s != 0)\n"
6372 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6373 "        }\n"
6374 "    }\n"
6375
6376 #. type: Plain text
6377 #: build/C/man3/pthread_getattr_np.3:311
6378 #, no-wrap
6379 msgid ""
6380 "    if (guard_size E<gt>= 0) {\n"
6381 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6382 "        if (s != 0)\n"
6383 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6384 "    }\n"
6385 msgstr ""
6386 "    if (guard_size E<gt>= 0) {\n"
6387 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6388 "        if (s != 0)\n"
6389 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6390 "    }\n"
6391
6392 #. type: Plain text
6393 #: build/C/man3/pthread_getattr_np.3:314
6394 #, no-wrap
6395 msgid ""
6396 "    return ret_attrp;\n"
6397 "}\n"
6398 msgstr ""
6399 "    return ret_attrp;\n"
6400 "}\n"
6401
6402 #. type: Plain text
6403 #: build/C/man3/pthread_getattr_np.3:323
6404 #, no-wrap
6405 msgid ""
6406 "int\n"
6407 "main(int argc, char *argv[])\n"
6408 "{\n"
6409 "    int s;\n"
6410 "    pthread_t thr;\n"
6411 "    pthread_attr_t attr;\n"
6412 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6413 "                                        a thread attributes object */\n"
6414 msgstr ""
6415 "int\n"
6416 "main(int argc, char *argv[])\n"
6417 "{\n"
6418 "    int s;\n"
6419 "    pthread_t thr;\n"
6420 "    pthread_attr_t attr;\n"
6421 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6422 "                                        a thread attributes object */\n"
6423
6424 #. type: Plain text
6425 #: build/C/man3/pthread_getattr_np.3:325
6426 #, no-wrap
6427 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6428 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6429
6430 #. type: Plain text
6431 #: build/C/man3/pthread_getattr_np.3:331
6432 #, no-wrap
6433 msgid ""
6434 "    if (attrp != NULL) {\n"
6435 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6436 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6437 "        printf(\"\\en\");\n"
6438 "    }\n"
6439 msgstr ""
6440 "    if (attrp != NULL) {\n"
6441 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6442 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6443 "        printf(\"\\en\");\n"
6444 "    }\n"
6445
6446 #. type: Plain text
6447 #: build/C/man3/pthread_getattr_np.3:361
6448 msgid ""
6449 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6450 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6451 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6452 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6453 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6454 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6455 msgstr ""
6456 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6457 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6458 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6459 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6460 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6461 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6462
6463 #. type: TH
6464 #: build/C/man3/pthread_getcpuclockid.3:26
6465 #, no-wrap
6466 msgid "PTHREAD_GETCPUCLOCKID"
6467 msgstr "PTHREAD_GETCPUCLOCKID"
6468
6469 #. type: Plain text
6470 #: build/C/man3/pthread_getcpuclockid.3:29
6471 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
6472 msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する"
6473
6474 #. type: Plain text
6475 #: build/C/man3/pthread_getcpuclockid.3:33
6476 #, no-wrap
6477 msgid ""
6478 "B<#include E<lt>pthread.hE<gt>>\n"
6479 "B<#include E<lt>time.hE<gt>>\n"
6480 msgstr ""
6481 "B<#include E<lt>pthread.hE<gt>>\n"
6482 "B<#include E<lt>time.hE<gt>>\n"
6483
6484 #. type: Plain text
6485 #: build/C/man3/pthread_getcpuclockid.3:35
6486 #, no-wrap
6487 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id>B<);>\n"
6488 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id>B<);>\n"
6489
6490 #.  The clockid is constructed as follows:
6491 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
6492 #.  where CLOCK_IDFIELD_SIZE is 3.
6493 #. type: Plain text
6494 #: build/C/man3/pthread_getcpuclockid.3:46
6495 msgid ""
6496 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
6497 "time clock of the thread I<thread>."
6498 msgstr ""
6499 "B<pthread_getcpuclockid>() 関数は、\n"
6500 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
6501
6502 #. type: TP
6503 #: build/C/man3/pthread_getcpuclockid.3:50
6504 #, no-wrap
6505 msgid "B<ENOENT>"
6506 msgstr "B<ENOENT>"
6507
6508 #.  CLOCK_THREAD_CPUTIME_ID not defined
6509 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
6510 #.  be possible if kernel thread IDs took more than 29 bits (which
6511 #.  they currently cannot).
6512 #. type: Plain text
6513 #: build/C/man3/pthread_getcpuclockid.3:58
6514 msgid "Per-thread CPU time clocks are not supported by the system."
6515 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
6516
6517 #. type: Plain text
6518 #: build/C/man3/pthread_getcpuclockid.3:65
6519 msgid "This function is available in glibc since version 2.2."
6520 msgstr "この関数は glibc バージョン 2.2 以降で利用できる。"
6521
6522 #. type: Plain text
6523 #: build/C/man3/pthread_getcpuclockid.3:70
6524 msgid "The B<pthread_getcpuclockid>()  function is thread-safe."
6525 msgstr "B<pthread_getcpuclockid>() 関数はスレッドセーフである。"
6526
6527 #. type: Plain text
6528 #: build/C/man3/pthread_getcpuclockid.3:83
6529 msgid ""
6530 "When I<thread> refers to the calling thread, this function returns an "
6531 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
6532 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
6533 msgstr ""
6534 "I<thread> が呼び出したスレッドを参照している場合、\n"
6535 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
6536 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
6537 "を参照する ID が返される。"
6538
6539 #. type: Plain text
6540 #: build/C/man3/pthread_getcpuclockid.3:89
6541 msgid ""
6542 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
6543 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
6544 "the two threads.  The following shell session shows an example run:"
6545 msgstr ""
6546 "以下のプログラムは、スレッドを作成し、それから\n"
6547 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
6548 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
6549 "スレッド毎の CPU 時間を取得する。\n"
6550 "下記のシェルのセッションは実行例である。"
6551
6552 #. type: Plain text
6553 #: build/C/man3/pthread_getcpuclockid.3:99
6554 #, no-wrap
6555 msgid ""
6556 "$ B<./a.out>\n"
6557 "Main thread sleeping\n"
6558 "Subthread starting infinite loop\n"
6559 "Main thread consuming some CPU time...\n"
6560 "Process total CPU time:    1.368\n"
6561 "Main thread CPU time:      0.376\n"
6562 "Subthread CPU time:        0.992\n"
6563 msgstr ""
6564 "$ B<./a.out>\n"
6565 "Main thread sleeping\n"
6566 "Subthread starting infinite loop\n"
6567 "Main thread consuming some CPU time...\n"
6568 "Process total CPU time:    1.368\n"
6569 "Main thread CPU time:      0.376\n"
6570 "Subthread CPU time:        0.992\n"
6571
6572 #. type: Plain text
6573 #: build/C/man3/pthread_getcpuclockid.3:105
6574 #, no-wrap
6575 msgid "/* Link with \"-lrt\" */\n"
6576 msgstr "/* \"-lrt\" でリンクする */\n"
6577
6578 #. type: Plain text
6579 #: build/C/man3/pthread_getcpuclockid.3:113
6580 #, no-wrap
6581 msgid ""
6582 "#include E<lt>time.hE<gt>\n"
6583 "#include E<lt>stdio.hE<gt>\n"
6584 "#include E<lt>stdlib.hE<gt>\n"
6585 "#include E<lt>unistd.hE<gt>\n"
6586 "#include E<lt>pthread.hE<gt>\n"
6587 "#include E<lt>string.hE<gt>\n"
6588 "#include E<lt>errno.hE<gt>\n"
6589 msgstr ""
6590 "#include E<lt>time.hE<gt>\n"
6591 "#include E<lt>stdio.hE<gt>\n"
6592 "#include E<lt>stdlib.hE<gt>\n"
6593 "#include E<lt>unistd.hE<gt>\n"
6594 "#include E<lt>pthread.hE<gt>\n"
6595 "#include E<lt>string.hE<gt>\n"
6596 "#include E<lt>errno.hE<gt>\n"
6597
6598 #. type: Plain text
6599 #: build/C/man3/pthread_getcpuclockid.3:127
6600 #, no-wrap
6601 msgid ""
6602 "static void *\n"
6603 "thread_start(void *arg)\n"
6604 "{\n"
6605 "    printf(\"Subthread starting infinite loop\\en\");\n"
6606 "    for (;;)\n"
6607 "        continue;\n"
6608 "}\n"
6609 msgstr ""
6610 "static void *\n"
6611 "thread_start(void *arg)\n"
6612 "{\n"
6613 "    printf(\"Subthread starting infinite loop\\en\");\n"
6614 "    for (;;)\n"
6615 "        continue;\n"
6616 "}\n"
6617
6618 #. type: Plain text
6619 #: build/C/man3/pthread_getcpuclockid.3:132
6620 #, no-wrap
6621 msgid ""
6622 "static void\n"
6623 "pclock(char *msg, clockid_t cid)\n"
6624 "{\n"
6625 "    struct timespec ts;\n"
6626 msgstr ""
6627 "static void\n"
6628 "pclock(char *msg, clockid_t cid)\n"
6629 "{\n"
6630 "    struct timespec ts;\n"
6631
6632 #. type: Plain text
6633 #: build/C/man3/pthread_getcpuclockid.3:138
6634 #, no-wrap
6635 msgid ""
6636 "    printf(\"%s\", msg);\n"
6637 "    if (clock_gettime(cid, &ts) == -1)\n"
6638 "        handle_error(\"clock_gettime\");\n"
6639 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6640 "}\n"
6641 msgstr ""
6642 "    printf(\"%s\", msg);\n"
6643 "    if (clock_gettime(cid, &ts) == -1)\n"
6644 "        handle_error(\"clock_gettime\");\n"
6645 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6646 "}\n"
6647
6648 #. type: Plain text
6649 #: build/C/man3/pthread_getcpuclockid.3:145
6650 #, no-wrap
6651 msgid ""
6652 "int\n"
6653 "main(int argc, char *argv[])\n"
6654 "{\n"
6655 "    pthread_t thread;\n"
6656 "    clockid_t cid;\n"
6657 "    int j, s;\n"
6658 msgstr ""
6659 "int\n"
6660 "main(int argc, char *argv[])\n"
6661 "{\n"
6662 "    pthread_t thread;\n"
6663 "    clockid_t cid;\n"
6664 "    int j, s;\n"
6665
6666 #. type: Plain text
6667 #: build/C/man3/pthread_getcpuclockid.3:149
6668 #, no-wrap
6669 msgid ""
6670 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6671 "    if (s != 0)\n"
6672 "        handle_error_en(s, \"pthread_create\");\n"
6673 msgstr ""
6674 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6675 "    if (s != 0)\n"
6676 "        handle_error_en(s, \"pthread_create\");\n"
6677
6678 #. type: Plain text
6679 #: build/C/man3/pthread_getcpuclockid.3:152
6680 #, no-wrap
6681 msgid ""
6682 "    printf(\"Main thread sleeping\\en\");\n"
6683 "    sleep(1);\n"
6684 msgstr ""
6685 "    printf(\"Main thread sleeping\\en\");\n"
6686 "    sleep(1);\n"
6687
6688 #. type: Plain text
6689 #: build/C/man3/pthread_getcpuclockid.3:156
6690 #, no-wrap
6691 msgid ""
6692 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6693 "    for (j = 0; j E<lt> 2000000; j++)\n"
6694 "        getppid();\n"
6695 msgstr ""
6696 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6697 "    for (j = 0; j E<lt> 2000000; j++)\n"
6698 "        getppid();\n"
6699
6700 #. type: Plain text
6701 #: build/C/man3/pthread_getcpuclockid.3:158
6702 #, no-wrap
6703 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6704 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6705
6706 #. type: Plain text
6707 #: build/C/man3/pthread_getcpuclockid.3:163
6708 #, no-wrap
6709 msgid ""
6710 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6711 "    if (s != 0)\n"
6712 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6713 "    pclock(\"Main thread CPU time:   \", cid);\n"
6714 msgstr ""
6715 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6716 "    if (s != 0)\n"
6717 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6718 "    pclock(\"Main thread CPU time:   \", cid);\n"
6719
6720 #. type: Plain text
6721 #: build/C/man3/pthread_getcpuclockid.3:166
6722 #, no-wrap
6723 msgid ""
6724 "    /* The preceding 4 lines of code could have been replaced by:\n"
6725 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6726 msgstr ""
6727 "    /* The preceding 4 lines of code could have been replaced by:\n"
6728 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6729
6730 #. type: Plain text
6731 #: build/C/man3/pthread_getcpuclockid.3:171
6732 #, no-wrap
6733 msgid ""
6734 "    s = pthread_getcpuclockid(thread, &cid);\n"
6735 "    if (s != 0)\n"
6736 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6737 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6738 msgstr ""
6739 "    s = pthread_getcpuclockid(thread, &cid);\n"
6740 "    if (s != 0)\n"
6741 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6742 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6743
6744 #. type: Plain text
6745 #: build/C/man3/pthread_getcpuclockid.3:174
6746 #, no-wrap
6747 msgid ""
6748 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6749 "}\n"
6750 msgstr ""
6751 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6752 "}\n"
6753
6754 #. type: Plain text
6755 #: build/C/man3/pthread_getcpuclockid.3:183
6756 msgid ""
6757 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6758 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6759 msgstr ""
6760 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6761 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6762
6763 #. type: TH
6764 #: build/C/man3/pthread_join.3:26
6765 #, no-wrap
6766 msgid "PTHREAD_JOIN"
6767 msgstr "PTHREAD_JOIN"
6768
6769 #. type: Plain text
6770 #: build/C/man3/pthread_join.3:29
6771 msgid "pthread_join - join with a terminated thread"
6772 msgstr "pthread_join - 終了したスレッドを join する"
6773
6774 #. type: Plain text
6775 #: build/C/man3/pthread_join.3:34
6776 #, no-wrap
6777 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6778 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6779
6780 #. type: Plain text
6781 #: build/C/man3/pthread_join.3:49
6782 msgid ""
6783 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
6784 "to terminate.  If that thread has already terminated, then "
6785 "B<pthread_join>()  returns immediately.  The thread specified by I<thread> "
6786 "must be joinable."
6787 msgstr ""
6788 "B<pthread_join>() 関数は、I<thread> で指定されたスレッドが\n"
6789 "終了するのを待つ。そのスレッドがすでに終了している場合、\n"
6790 "B<pthread_join>() はすぐに返る。\n"
6791 "I<thread> で指定されたスレッドは join 可能でなければならない。"
6792
6793 #. type: Plain text
6794 #: build/C/man3/pthread_join.3:63
6795 msgid ""
6796 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
6797 "the target thread (i.e., the value that the target thread supplied to "
6798 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
6799 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
6800 msgstr ""
6801 "I<retval> が NULL でない場合、 B<pthread_join>() は対象スレッドの終了\n"
6802 "ステータス (すなわち、対象スレッドが B<pthread_exit>(3) に渡した値) を\n"
6803 "I<*retval> が指す場所にコピーする。対象スレッドがキャンセルされた場合、\n"
6804 "I<*retval> には B<PTHREAD_CANCELED> が格納される。"
6805
6806 #. type: Plain text
6807 #: build/C/man3/pthread_join.3:70
6808 msgid ""
6809 "If multiple threads simultaneously try to join with the same thread, the "
6810 "results are undefined.  If the thread calling B<pthread_join>()  is "
6811 "canceled, then the target thread will remain joinable (i.e., it will not be "
6812 "detached)."
6813 msgstr ""
6814 "複数のスレッドが同時に同じスレッドを join しようとした場合、その結果\n"
6815 "は不定である。B<pthread_join>() を呼び出しているスレッドがキャンセル\n"
6816 "された場合、対象スレッドは join 可能のままとなる (detached 状態には\n"
6817 "ならない)。"
6818
6819 #. type: Plain text
6820 #: build/C/man3/pthread_join.3:75
6821 msgid ""
6822 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
6823 "number."
6824 msgstr ""
6825 "成功すると、 B<pthread_join>() は 0 を返す。\n"
6826 "エラーの場合、エラー番号を返す。"
6827
6828 #. type: TP
6829 #: build/C/man3/pthread_join.3:76
6830 #, no-wrap
6831 msgid "B<EDEADLK>"
6832 msgstr "B<EDEADLK>"
6833
6834 #.  The following verified by testing on glibc 2.8/NPTL:
6835 #.  The following verified by testing on glibc 2.8/NPTL:
6836 #. type: Plain text
6837 #: build/C/man3/pthread_join.3:85
6838 msgid ""
6839 "A deadlock was detected (e.g., two threads tried to join with each other); "
6840 "or I<thread> specifies the calling thread."
6841 msgstr ""
6842 "デッドロックが検出された (例えば、二つのスレッドが互いに join しようと\n"
6843 "した場合)、または I<thread> に呼び出したスレッドが指定されている。"
6844
6845 #.  POSIX.1-2001 does not specify this error case.
6846 #. type: Plain text
6847 #: build/C/man3/pthread_join.3:93
6848 msgid "Another thread is already waiting to join with this thread."
6849 msgstr "別のスレッドがすでにこのスレッドの join 待ちである。"
6850
6851 #. type: Plain text
6852 #: build/C/man3/pthread_join.3:104
6853 msgid ""
6854 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
6855 "the target thread has terminated."
6856 msgstr ""
6857 "B<pthread_join>() の呼び出しが成功した場合は、\n"
6858 "呼び出し側には、対象スレッドが終了していることが保証される。"
6859
6860 #. type: Plain text
6861 #: build/C/man3/pthread_join.3:107
6862 msgid ""
6863 "Joining with a thread that has previously been joined results in undefined "
6864 "behavior."
6865 msgstr "すでに join されたスレッドを join した場合の結果は不定である。"
6866
6867 #. type: Plain text
6868 #: build/C/man3/pthread_join.3:115
6869 msgid ""
6870 "Failure to join with a thread that is joinable (i.e., one that is not "
6871 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
6872 "zombie thread consumes some system resources, and when enough zombie threads "
6873 "have accumulated, it will no longer be possible to create new threads (or "
6874 "processes)."
6875 msgstr ""
6876 "join 可能なスレッド (detached 状態でないスレッド) の join に失敗した場合、\n"
6877 "\"ゾンビスレッド (zombie thread)\" が生成される。\n"
6878 "各ゾンビスレッドはシステムリソースをいくらかは消費し、\n"
6879 "ゾンビスレッドがたくさん生成されてしまうと、\n"
6880 "新しいスレッド (やプロセス) がそれ以上作成できなくなってしまうので、\n"
6881 "このようなことが起きるのは避けること。"
6882
6883 #. type: Plain text
6884 #: build/C/man3/pthread_join.3:121
6885 msgid ""
6886 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
6887 "\"join with any terminated thread\".  If you believe you need this "
6888 "functionality, you probably need to rethink your application design."
6889 msgstr ""
6890 "pthreads には、 I<waitpid(-1,\\ &status,\\ 0)>、つまり\n"
6891 "\"終了されたスレッドのどれかを join する\" といった機能はない。\n"
6892 "この機能が必要だと思うような場合には、おそらく\n"
6893 "自分のアプリケーションの設計を考え直す必要があるだろう。"
6894
6895 #. type: Plain text
6896 #: build/C/man3/pthread_join.3:124
6897 msgid ""
6898 "All of the threads in a process are peers: any thread can join with any "
6899 "other thread in the process."
6900 msgstr ""
6901 "プロセス内の全てのスレッドは対等であり、\n"
6902 "どのスレッドでもプロセス内の他のスレッドを join できる。"
6903
6904 #. type: Plain text
6905 #: build/C/man3/pthread_join.3:134
6906 msgid ""
6907 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6908 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6909 msgstr ""
6910 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6911 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6912
6913 #. type: TH
6914 #: build/C/man3/pthread_kill.3:26
6915 #, no-wrap
6916 msgid "PTHREAD_KILL"
6917 msgstr "PTHREAD_KILL"
6918
6919 #. type: TH
6920 #: build/C/man3/pthread_kill.3:26
6921 #: build/C/man3/pthread_kill_other_threads_np.3:26
6922 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setcancelstate.3:26
6923 #: build/C/man3/pthread_yield.3:25
6924 #, no-wrap
6925 msgid "2014-05-13"
6926 msgstr "2014-05-13"
6927
6928 #. type: Plain text
6929 #: build/C/man3/pthread_kill.3:29
6930 msgid "pthread_kill - send a signal to a thread"
6931 msgstr "pthread_kill - スレッドにシグナルを送信する"
6932
6933 #. type: Plain text
6934 #: build/C/man3/pthread_kill.3:32 build/C/man3/pthread_sigmask.3:32
6935 #, no-wrap
6936 msgid "B<#include E<lt>signal.hE<gt>>\n"
6937 msgstr "B<#include E<lt>signal.hE<gt>>\n"
6938
6939 #. type: Plain text
6940 #: build/C/man3/pthread_kill.3:34
6941 #, no-wrap
6942 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6943 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6944
6945 #. type: Plain text
6946 #: build/C/man3/pthread_kill.3:45
6947 msgid "B<pthread_kill>():"
6948 msgstr "B<pthread_kill>():"
6949
6950 #. type: Plain text
6951 #: build/C/man3/pthread_kill.3:47 build/C/man3/pthread_sigmask.3:48
6952 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
6953 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
6954
6955 #. type: Plain text
6956 #: build/C/man3/pthread_kill.3:59
6957 msgid ""
6958 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, a "
6959 "thread in the same process as the caller.  The signal is asynchronously "
6960 "directed to I<thread>."
6961 msgstr ""
6962 "B<pthread_kill>() 関数は、呼び出したスレッドと同じプロセスの\n"
6963 "スレッド I<thread> にシグナル I<sig> を送信する。\n"
6964 "シグナルは非同期に I<thread> へ直接送られる。"
6965
6966 #. type: Plain text
6967 #: build/C/man3/pthread_kill.3:63
6968 msgid ""
6969 "If I<sig> is 0, then no signal is sent, but error checking is still "
6970 "performed."
6971 msgstr ""
6972 "I<sig> が 0 の場合、シグナルは送信されないが、エラーチェックだけは実行され"
6973 "る。"
6974
6975 #. type: Plain text
6976 #: build/C/man3/pthread_kill.3:68
6977 msgid ""
6978 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
6979 "number, and no signal is sent."
6980 msgstr ""
6981 "成功すると、 B<pthread_kill>() は 0 を返す。\n"
6982 "エラーの場合、エラー番号を返し、シグナルの送信は行わない。"
6983
6984 #. type: Plain text
6985 #: build/C/man3/pthread_kill.3:72
6986 msgid "An invalid signal was specified."
6987 msgstr "無効なシグナルが指定された。"
6988
6989 #. type: Plain text
6990 #: build/C/man3/pthread_kill.3:77
6991 msgid "The B<pthread_kill>()  function is thread-safe."
6992 msgstr "B<pthread_kill>() 関数はスレッドセーフである。"
6993
6994 #. type: Plain text
6995 #: build/C/man3/pthread_kill.3:79
6996 msgid "POSIX.1-2008."
6997 msgstr "POSIX.1-2008."
6998
6999 #. type: Plain text
7000 #: build/C/man3/pthread_kill.3:86
7001 msgid ""
7002 "Signal dispositions are process-wide: if a signal handler is installed, the "
7003 "handler will be invoked in the thread I<thread>, but if the disposition of "
7004 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
7005 "affect the whole process."
7006 msgstr ""
7007 "シグナルの配送はプロセス全体で行われる。\n"
7008 "シグナルハンドラが設定されている場合、\n"
7009 "そのハンドラがスレッド I<thread> で起動されるが、\n"
7010 "シグナルの配送が \"stop\", \"continue\", \"terminate\" のいずれかの場合、\n"
7011 "シグナルに対するアクションはプロセス全体に影響がある。"
7012
7013 #. type: Plain text
7014 #: build/C/man3/pthread_kill.3:99
7015 msgid ""
7016 "POSIX.1-2008 recommends that if an implementation detects the use of a "
7017 "thread ID after the end of its lifetime, B<pthread_kill>()  should return "
7018 "the error B<ESRCH>.  The glibc implementation returns this error in the "
7019 "cases where an invalid thread ID can be detected.  But note also that POSIX "
7020 "says that an attempt to use a thread ID whose lifetime has ended produces "
7021 "undefined behavior, and an attempt to use an invalid thread ID in a call to "
7022 "B<pthread_kill>()  can, for example, cause a segmentation fault."
7023 msgstr ""
7024 "POSIX.1-2008 では、 スレッドが終了した後にそのスレッド ID が使用されたことを"
7025 "検出した場合に、 B<pthread_kill>() はエラー B<ESRCH> を返すことを推奨されてい"
7026 "る。 glibc の実装では、無効なスレッド ID を検出できる場合にはこのエラーを返"
7027 "す。 しかし、 POSIX では、 終了したスレッド ID を使おうとした場合の動作は不定"
7028 "であり、 B<pthread_kill>() で無効なスレッド ID を使おうとした場合には、 例え"
7029 "ば、 セグメンテーションフォールトになる可能性もある点に注意すること。"
7030
7031 #. type: Plain text
7032 #: build/C/man3/pthread_kill.3:108
7033 msgid ""
7034 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
7035 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
7036 msgstr ""
7037 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
7038 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
7039
7040 #. type: TH
7041 #: build/C/man3/pthread_kill_other_threads_np.3:26
7042 #, no-wrap
7043 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
7044 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
7045
7046 #. type: Plain text
7047 #: build/C/man3/pthread_kill_other_threads_np.3:29
7048 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
7049 msgstr "pthread_kill_other_threads_np - プロセス内の他の全スレッドを終了する"
7050
7051 #. type: Plain text
7052 #: build/C/man3/pthread_kill_other_threads_np.3:34
7053 #, no-wrap
7054 msgid "B<void pthread_kill_other_threads_np(void);>\n"
7055 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
7056
7057 #.  .SH VERSIONS
7058 #.  Available since glibc 2.0
7059 #. type: Plain text
7060 #: build/C/man3/pthread_kill_other_threads_np.3:47
7061 msgid ""
7062 "B<pthread_kill_other_threads_np>()  has an effect only in the LinuxThreads "
7063 "threading implementation.  On that implementation, calling this function "
7064 "causes the immediate termination of all threads in the application, except "
7065 "the calling thread.  The cancellation state and cancellation type of the to-"
7066 "be-terminated threads are ignored, and the cleanup handlers are not called "
7067 "in those threads."
7068 msgstr ""
7069 "B<pthread_kill_other_threads_np>() は、\n"
7070 "LinuxThreads スレッド実装においてのみ効果がある。\n"
7071 "LinuxThreads スレッド実装では、この関数を呼び出すと\n"
7072 "アプリケーション内の全てのスレッドがすぐに終了される。\n"
7073 "終了対象のスレッドの cancelability state と cancelability type は\n"
7074 "無視され、それらのスレッドのクリーンアップハンドラは呼び出されない。"
7075
7076 #. type: Plain text
7077 #: build/C/man3/pthread_kill_other_threads_np.3:52
7078 msgid "The B<pthread_kill_other_threads_np>()  function is thread-safe."
7079 msgstr "B<pthread_kill_other_threads_np>() 関数はスレッドセーフである。"
7080
7081 #. type: Plain text
7082 #: build/C/man3/pthread_kill_other_threads_np.3:64
7083 msgid ""
7084 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
7085 "thread calls B<execve>(2)  or a similar function.  This function is designed "
7086 "to address a limitation in the obsolete LinuxThreads implementation whereby "
7087 "the other threads of an application are not automatically terminated (as "
7088 "POSIX.1-2001 requires) during B<execve>(2)."
7089 msgstr ""
7090 "B<pthread_kill_other_threads_np>() は、\n"
7091 "スレッドが B<execve>(2) や同様の関数を呼び出す直前に\n"
7092 "呼ばれることを目的として用意されている。\n"
7093 "この関数は、(廃止予定の) LinuxThreads スレッド実装における、\n"
7094 "B<execve>(2) の際にアプリケーションの他のスレッドが自動的に\n"
7095 "終了されないという制限を解決するために設計された。"
7096
7097 #. type: Plain text
7098 #: build/C/man3/pthread_kill_other_threads_np.3:71
7099 msgid ""
7100 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
7101 "exists, but does nothing.  (Nothing needs to be done, because the "
7102 "implementation does the right thing during an B<execve>(2).)"
7103 msgstr ""
7104 "NPTL スレッド実装では、 B<pthread_kill_other_threads_np>() は存在するが、\n"
7105 "何もしない(NPTL 実装は B<execve>(2) の際に適切な動作をするので、\n"
7106 "何もする必要がないということだ)。"
7107
7108 #. type: Plain text
7109 #: build/C/man3/pthread_kill_other_threads_np.3:77
7110 msgid ""
7111 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7112 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7113 msgstr ""
7114 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7115 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7116
7117 #. type: TH
7118 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
7119 #, no-wrap
7120 msgid "PTHREAD_RWLOCKATTR_SETKIND_NP"
7121 msgstr "PTHREAD_RWLOCKATTR_SETKIND_NP"
7122
7123 #. type: TH
7124 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
7125 #, no-wrap
7126 msgid "2014-10-15"
7127 msgstr "2014-10-15"
7128
7129 #. type: Plain text
7130 #: build/C/man3/pthread_rwlockattr_setkind_np.3:29
7131 msgid ""
7132 "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - set/get the "
7133 "read-write lock kind of the thread read-write lock attribute object"
7134 msgstr "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - スレッドの読み書きロック属性オブジェクトの読み書きロック種別の設定、取得を行う"
7135
7136 #. type: Plain text
7137 #: build/C/man3/pthread_rwlockattr_setkind_np.3:37
7138 #, no-wrap
7139 msgid ""
7140 "B<int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *>I<attr>B<,>\n"
7141 "B<                                   int >I<pref>B<);>\n"
7142 "B<int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *>I<attr>B<,>\n"
7143 "B<                                   int *>I<pref>B<);>\n"
7144 msgstr ""
7145 "B<int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *>I<attr>B<,>\n"
7146 "B<                                   int >I<pref>B<);>\n"
7147 "B<int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *>I<attr>B<,>\n"
7148 "B<                                   int *>I<pref>B<);>\n"
7149
7150 #. type: Plain text
7151 #: build/C/man3/pthread_rwlockattr_setkind_np.3:48
7152 msgid "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
7153 msgstr ""
7154 "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
7155
7156 #. type: Plain text
7157 #: build/C/man3/pthread_rwlockattr_setkind_np.3:52
7158 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _POSIX_C_SOURCE E<gt>= 200809L"
7159 msgstr "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _POSIX_C_SOURCE E<gt>= 200809L"
7160
7161 #. type: Plain text
7162 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
7163 msgid ""
7164 "The B<pthread_rwlockattr_setkind_np>()  function sets the \"lock kind\" "
7165 "attribute of the read-write lock attribute object referred to by I<attr> to "
7166 "the value specified in I<pref>.  The argument I<pref> may be set to one of "
7167 "the following:"
7168 msgstr "B<pthread_rwlockattr_setkind_np>() 関数は、 I<attr> が参照する読み書きロック属性オブジェクトの「ロック種別 (lock kind)」を I<pref> で指定された値に設定する。 引き数 I<pref> には以下のいずれか一つを設定できる。"
7169
7170 #. type: TP
7171 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
7172 #, no-wrap
7173 msgid "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
7174 msgstr "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
7175
7176 #. type: Plain text
7177 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
7178 msgid ""
7179 "This is the default.  A thread may hold multiple read locks; that is, read "
7180 "locks are recursive.  According to The Single Unix Specification, the "
7181 "behavior is unspecified when a reader tries to place a lock, and there is no "
7182 "write lock but writers are waiting.  Giving preference to the reader, as is "
7183 "set by B<PTHREAD_RWLOCK_PREFER_READER_NP>, implies that the reader will "
7184 "receive the requested lock, even if a writer is waiting.  As long as there "
7185 "are readers, the writer will be starved."
7186 msgstr "これがデフォルトである。 スレッドは複数の読み出しロックを保持できる。 つまり、読み出しロックは再帰的である。 Single Unix Specification では、 読み出し側がロックをかけようとした際に、書き込みロックはないが書き込み側が待っていた場合の、動作は規定されていない。 B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定し、読み出し側に優先度を与えるということは、 たとえ書き込み側が待っていたとしても、読み出し側が要求したロックを受け取ることを意味する。 読み出し側がいる限り、書き込み側は待つことになる。"
7187
7188 #. type: TP
7189 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
7190 #, no-wrap
7191 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
7192 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
7193
7194 #. type: Plain text
7195 #: build/C/man3/pthread_rwlockattr_setkind_np.3:83
7196 msgid ""
7197 "This is intended as the write lock analog of "
7198 "B<PTHREAD_RWLOCK_PREFER_READER_NP>.  But see BUGS."
7199 msgstr "これは B<PTHREAD_RWLOCK_PREFER_READER_NP> の書き込みロック版である。 ただし「バグ」を参照のこと。"
7200
7201 #. type: TP
7202 #: build/C/man3/pthread_rwlockattr_setkind_np.3:83
7203 #, no-wrap
7204 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
7205 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
7206
7207 #. type: Plain text
7208 #: build/C/man3/pthread_rwlockattr_setkind_np.3:88
7209 msgid ""
7210 "Setting the lock kind to this avoids writer starvation as long as any read "
7211 "locking is not done in a recursive fashion."
7212 msgstr "ロック種別をこの値に設定すると、 読み出しロックが再帰的に行われない限りは、 書き込み側の待ちを避けることができる。"
7213
7214 #. type: Plain text
7215 #: build/C/man3/pthread_rwlockattr_setkind_np.3:96
7216 msgid ""
7217 "The B<pthread_rwlockattr_getkind_np>()  function returns the value of the "
7218 "lock kind attribute of the read-write lock attribute object referred to by "
7219 "I<attr> in the pointer I<pref>."
7220 msgstr "B<pthread_rwlockattr_getkind_np>() 関数は、 I<attr> が参照する読み書きロック属性オブジェクトのロック種別属性の値をポインター I<pref> に入れて返す。"
7221
7222 #. type: Plain text
7223 #: build/C/man3/pthread_rwlockattr_setkind_np.3:104
7224 msgid ""
7225 "On success, these functions return 0.  Given valid pointer arguments, "
7226 "B<pthread_rwlockattr_getkind_np>()  always succeeds.  On error, "
7227 "B<pthread_rwlockattr_setkind_np>()  returns a non-zero error number."
7228 msgstr "成功すると、これらの関数は 0 を返す。 有効なポインター引き数が渡された場合、 B<pthread_rwlockattr_getkind_np>() は常に成功する。 エラーの場合、 B<pthread_rwlockattr_setkind_np>() は 0 以外のエラー番号を返す。"
7229
7230 #. type: Plain text
7231 #: build/C/man3/pthread_rwlockattr_setkind_np.3:109
7232 msgid "I<pref> specifies an unsupported value."
7233 msgstr "I<pref> にサポート外の値が指定された。"
7234
7235 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7057
7236 #. type: Plain text
7237 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
7238 msgid ""
7239 "Setting the value read-write lock kind to B<PTHREAD_RWLOCK_PREFER_WRITER_NP> "
7240 "results in the same behavior as setting the value to "
7241 "B<PTHREAD_RWLOCK_PREFER_READER_NP>.  As long as a reader thread holds the "
7242 "lock, the thread holding a write lock will be starved.  Setting the lock "
7243 "kind to B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> allows writers to "
7244 "run, but, as the name implies a writer may not lock recursively."
7245 msgstr "読み書きロック種別の値を B<PTHREAD_RWLOCK_PREFER_WRITER_NP> に設定することは、 値を B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定するのと同じ動作となる。 読み出しスレッドがロックを保持する限り、書き込みロックを保持しているスレッドは停止することになる。 ロック種別を B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> に設定すると、 書き込み側が動作できるようになるが、変数名から分かるように、 書き込み側はロックを再帰的に行うことはできない。"
7246
7247 #. type: Plain text
7248 #: build/C/man3/pthread_rwlockattr_setkind_np.3:127
7249 msgid ""
7250 "The B<pthread_rwlockattr_getkind_np>()  and "
7251 "B<pthread_rwlockattr_setkind_np>()  functions first appeared in glibc 2.1."
7252 msgstr "関数 B<pthread_rwlockattr_getkind_np>() と B<pthread_rwlockattr_setkind_np>() は glibc 2.1 で初めて登場した。"
7253
7254 #. type: Plain text
7255 #: build/C/man3/pthread_rwlockattr_setkind_np.3:130
7256 msgid ""
7257 "These functions are non-standard GNU extensions; hence the suffix \"_np"
7258 "\" (non-portable) in the names."
7259 msgstr ""
7260 "これらの関数は非標準の GNU による拡張である。 そのため、名前に \"_np\" (non-"
7261 "portable; 移植性がない) という接尾辞が付いている。"
7262
7263 #. type: Plain text
7264 #: build/C/man3/pthread_rwlockattr_setkind_np.3:132
7265 msgid "B<pthreads>(7)"
7266 msgstr "B<pthreads>(7)"
7267
7268 #. type: TH
7269 #: build/C/man3/pthread_self.3:26
7270 #, no-wrap
7271 msgid "PTHREAD_SELF"
7272 msgstr "PTHREAD_SELF"
7273
7274 #. type: Plain text
7275 #: build/C/man3/pthread_self.3:29
7276 msgid "pthread_self - obtain ID of the calling thread"
7277 msgstr "pthread_self - 呼び出したスレッドの ID を取得する"
7278
7279 #. type: Plain text
7280 #: build/C/man3/pthread_self.3:34
7281 #, no-wrap
7282 msgid "B<pthread_t pthread_self(void);>\n"
7283 msgstr "B<pthread_t pthread_self(void);>\n"
7284
7285 #. type: Plain text
7286 #: build/C/man3/pthread_self.3:46
7287 msgid ""
7288 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
7289 "is the same value that is returned in I<*thread> in the "
7290 "B<pthread_create>(3)  call that created this thread."
7291 msgstr ""
7292 "B<pthread_self>() 関数は、呼び出したスレッドの ID を返す。\n"
7293 "得られる ID は、このスレッドが作成された B<pthread_create>(3) の\n"
7294 "呼び出しで I<*thread> で返されるのと同じ値である。"
7295
7296 #. type: Plain text
7297 #: build/C/man3/pthread_self.3:48
7298 msgid "This function always succeeds, returning the calling thread's ID."
7299 msgstr "この関数は常に成功し、呼び出したスレッドの ID を返す。"
7300
7301 #. type: Plain text
7302 #: build/C/man3/pthread_self.3:55
7303 msgid "The B<pthread_self>()  function is thread-safe."
7304 msgstr "B<pthread_self>() 関数はスレッドセーフである。"
7305
7306 #. type: Plain text
7307 #: build/C/man3/pthread_self.3:68
7308 msgid ""
7309 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
7310 "represent a thread ID; for example, representation using either an "
7311 "arithmetic type or a structure is permitted.  Therefore, variables of type "
7312 "I<pthread_t> can't portably be compared using the C equality operator "
7313 "(B<==>); use B<pthread_equal>(3)  instead."
7314 msgstr ""
7315 "POSIX.1 では、スレッド ID を表現するのに使用する型は、\n"
7316 "スレッド実装が完全に自由に選択してよいことになっている。\n"
7317 "例えば、スレッド ID を表現するのに数値型を使っても構造体を使ってもよい。\n"
7318 "そのため、移植性を確保しつつ、 C 言語の等価演算子 (B<==>) を使って、\n"
7319 "I<pthread_t> 型の変数の比較を行うことはできない。\n"
7320 "代わりに B<pthread_equal>(3) を使うこと。"
7321
7322 #. type: Plain text
7323 #: build/C/man3/pthread_self.3:72
7324 msgid ""
7325 "Thread identifiers should be considered opaque: any attempt to use a thread "
7326 "ID other than in pthreads calls is nonportable and can lead to unspecified "
7327 "results."
7328 msgstr ""
7329 "スレッド識別子はその内部構造を意識すべきではない。\n"
7330 "pthreads 関数以外でスレッド ID を利用しようとした場合、\n"
7331 "移植性がなくなり、どのような結果が得られるかも分からない。"
7332
7333 #. type: Plain text
7334 #: build/C/man3/pthread_self.3:76
7335 msgid ""
7336 "Thread IDs are guaranteed to be unique only within a process.  A thread ID "
7337 "may be reused after a terminated thread has been joined, or a detached "
7338 "thread has terminated."
7339 msgstr ""
7340 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
7341 "終了したスレッドが join されたり、\n"
7342 "切り離された (detached) スレッドが終了されたりした後は、\n"
7343 "そのスレッド ID は再利用されることがある。"
7344
7345 #. type: Plain text
7346 #: build/C/man3/pthread_self.3:81
7347 msgid ""
7348 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
7349 "kernel thread ID returned by a call to B<gettid>(2)."
7350 msgstr ""
7351 "B<pthread_self>() が返すスレッド ID は、\n"
7352 "B<gettid>(2) が返すカーネルスレッド ID とは違うものである。"
7353
7354 #. type: Plain text
7355 #: build/C/man3/pthread_self.3:85
7356 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7357 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7358
7359 #. type: TH
7360 #: build/C/man3/pthread_setaffinity_np.3:26
7361 #, no-wrap
7362 msgid "PTHREAD_SETAFFINITY_NP"
7363 msgstr "PTHREAD_SETAFFINITY_NP"
7364
7365 #. type: Plain text
7366 #: build/C/man3/pthread_setaffinity_np.3:30
7367 msgid ""
7368 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
7369 "thread"
7370 msgstr ""
7371 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
7372 "CPU affinity の設定/取得を行う"
7373
7374 #. type: Plain text
7375 #: build/C/man3/pthread_setaffinity_np.3:39
7376 #, no-wrap
7377 msgid ""
7378 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7379 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
7380 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7381 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
7382 msgstr ""
7383 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7384 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
7385 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7386 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
7387
7388 #. type: Plain text
7389 #: build/C/man3/pthread_setaffinity_np.3:54
7390 msgid ""
7391 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
7392 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
7393 "successful, and the thread is not currently running on one of the CPUs in "
7394 "I<cpuset>, then it is migrated to one of those CPUs."
7395 msgstr ""
7396 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7397 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
7398 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
7399 "場合は、スレッドは指定された CPU のいずれかに移動される。"
7400
7401 #. type: Plain text
7402 #: build/C/man3/pthread_setaffinity_np.3:61
7403 msgid ""
7404 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
7405 "the thread I<thread> in the buffer pointed to by I<cpuset>."
7406 msgstr ""
7407 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7408 "マスクを、I<cpuset> が指すバッファに入れて返す。"
7409
7410 #. type: Plain text
7411 #: build/C/man3/pthread_setaffinity_np.3:77
7412 msgid ""
7413 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
7414 "by I<cpuset>.  Typically, this argument would be specified as "
7415 "I<sizeof(cpu_set_t)>.  (It may be some other value, if using the macros "
7416 "described in B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
7417 msgstr ""
7418 "引き数 I<cpusetsize> は I<cpuset> が指すバッファの長さ (バイト単位) で\n"
7419 "ある。通常は、この引き数には I<sizeof(cpu_set_t)> を指定する\n"
7420 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
7421 "割り当てている場合には、別の値になることもある)。"
7422
7423 #. type: TP
7424 #: build/C/man3/pthread_setaffinity_np.3:81
7425 #, no-wrap
7426 msgid "B<EFAULT>"
7427 msgstr "B<EFAULT>"
7428
7429 #. type: Plain text
7430 #: build/C/man3/pthread_setaffinity_np.3:84
7431 msgid "A supplied memory address was invalid."
7432 msgstr "指定されたメモリアドレスが無効である。"
7433
7434 #. type: Plain text
7435 #: build/C/man3/pthread_setaffinity_np.3:93
7436 msgid ""
7437 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
7438 "processors that are currently physically on the system and permitted to the "
7439 "thread according to any restrictions that may be imposed by the \"cpuset\" "
7440 "mechanism described in B<cpuset>(7)."
7441 msgstr ""
7442 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
7443 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
7444 "されているプロセッサが一つも含まれていない。\n"
7445 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
7446 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
7447
7448 #.  FIXME . ?
7449 #.  Loic Domaigne commented: it seems that in the future the
7450 #.  kernel developers want to make cpumask_t dynamic, so
7451 #.  CONFIG_NR_CPUS might become obsolete in the future.
7452 #.  cpumask_t
7453 #.  The raw sched_getaffinity() system call returns the size (in bytes)
7454 #.  of the cpumask_t type.
7455 #. type: Plain text
7456 #: build/C/man3/pthread_setaffinity_np.3:109
7457 msgid ""
7458 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
7459 "the set supported by the kernel.  (The kernel configuration option "
7460 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
7461 "type used to represent CPU sets.)"
7462 msgstr ""
7463 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
7464 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
7465 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
7466 "データ型がサポートする CPU 集合の範囲が定義される。)"
7467
7468 #. type: Plain text
7469 #: build/C/man3/pthread_setaffinity_np.3:114
7470 msgid ""
7471 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
7472 "affinity mask used by the kernel."
7473 msgstr ""
7474 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
7475 "affinity マスクの大きさよりも小さい。"
7476
7477 #. type: Plain text
7478 #: build/C/man3/pthread_setaffinity_np.3:128
7479 msgid ""
7480 "The B<pthread_setaffinity_np>()  and B<pthread_getaffinity_np>()  functions "
7481 "are thread-safe."
7482 msgstr ""
7483 "関数 B<pthread_setaffinity_np>() と B<pthread_getaffinity_np>() はスレッド"
7484 "セーフである。"
7485
7486 #. type: Plain text
7487 #: build/C/man3/pthread_setaffinity_np.3:144
7488 msgid ""
7489 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
7490 "thread will actually run is the intersection of the set specified in the "
7491 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
7492 "system may further restrict the set of CPUs on which the thread runs if the "
7493 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
7494 "restrictions on the actual set of CPUs on which the thread will run are "
7495 "silently imposed by the kernel."
7496 msgstr ""
7497 "B<pthread_setaffinity_np>() を呼び出した後、\n"
7498 "そのスレッドが実際に実行される CPU 集合は、\n"
7499 "I<cpuset> 引き数で指定された集合と\n"
7500 "システムに実際に存在する CPU 集合の共通部分になる。\n"
7501 "また、 B<cpuset>(7) で説明されている \"cpuset\" 機構が使われている場合\n"
7502 "には、そのスレッドが実行される CPU 集合がシステムによってさらに制限\n"
7503 "される場合がある。そのスレッドが実行される実際の CPU 集合に対する\n"
7504 "これらの制限は、カーネルにより黙って適用される。"
7505
7506 #. type: Plain text
7507 #: build/C/man3/pthread_setaffinity_np.3:150
7508 msgid ""
7509 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
7510 "B<sched_getaffinity>(2)  system calls."
7511 msgstr ""
7512 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
7513 "B<sched_getaffinity>(2) を使って実装されている。"
7514
7515 #. type: Plain text
7516 #: build/C/man3/pthread_setaffinity_np.3:161
7517 msgid ""
7518 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
7519 "creator's CPU affinity mask."
7520 msgstr ""
7521 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
7522 "作成者の CPU affinity マスクを継承する。"
7523
7524 #. type: Plain text
7525 #: build/C/man3/pthread_setaffinity_np.3:169
7526 msgid ""
7527 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
7528 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
7529 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
7530 "check the resulting CPU affinity mask of the thread."
7531 msgstr ""
7532 "以下のプログラムでは、メインスレッドは\n"
7533 "B<pthread_setaffinity_np>() を使って自分の CPU affinity マスクに\n"
7534 "CPU 0 から 7 が含まれるように設定し\n"
7535 "(システム上には 0 から 7 に対応する CPU が全て存在するとは限らない)、\n"
7536 "その後で B<pthread_getaffinity_np>() を使って\n"
7537 "スレッドに実際に設定された CPU affinity マスクを確認している。"
7538
7539 #. type: Plain text
7540 #: build/C/man3/pthread_setaffinity_np.3:176
7541 #, no-wrap
7542 msgid ""
7543 "#define _GNU_SOURCE\n"
7544 "#include E<lt>pthread.hE<gt>\n"
7545 "#include E<lt>stdio.hE<gt>\n"
7546 "#include E<lt>stdlib.hE<gt>\n"
7547 "#include E<lt>errno.hE<gt>\n"
7548 msgstr ""
7549 "#define _GNU_SOURCE\n"
7550 "#include E<lt>pthread.hE<gt>\n"
7551 "#include E<lt>stdio.hE<gt>\n"
7552 "#include E<lt>stdlib.hE<gt>\n"
7553 "#include E<lt>errno.hE<gt>\n"
7554
7555 #. type: Plain text
7556 #: build/C/man3/pthread_setaffinity_np.3:186
7557 #, no-wrap
7558 msgid ""
7559 "int\n"
7560 "main(int argc, char *argv[])\n"
7561 "{\n"
7562 "    int s, j;\n"
7563 "    cpu_set_t cpuset;\n"
7564 "    pthread_t thread;\n"
7565 msgstr ""
7566 "int\n"
7567 "main(int argc, char *argv[])\n"
7568 "{\n"
7569 "    int s, j;\n"
7570 "    cpu_set_t cpuset;\n"
7571 "    pthread_t thread;\n"
7572
7573 #. type: Plain text
7574 #: build/C/man3/pthread_setaffinity_np.3:188
7575 #, no-wrap
7576 msgid "    thread = pthread_self();\n"
7577 msgstr "    thread = pthread_self();\n"
7578
7579 #. type: Plain text
7580 #: build/C/man3/pthread_setaffinity_np.3:190
7581 #, no-wrap
7582 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7583 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7584
7585 #. type: Plain text
7586 #: build/C/man3/pthread_setaffinity_np.3:194
7587 #, no-wrap
7588 msgid ""
7589 "    CPU_ZERO(&cpuset);\n"
7590 "    for (j = 0; j E<lt> 8; j++)\n"
7591 "        CPU_SET(j, &cpuset);\n"
7592 msgstr ""
7593 "    CPU_ZERO(&cpuset);\n"
7594 "    for (j = 0; j E<lt> 8; j++)\n"
7595 "        CPU_SET(j, &cpuset);\n"
7596
7597 #. type: Plain text
7598 #: build/C/man3/pthread_setaffinity_np.3:198
7599 #, no-wrap
7600 msgid ""
7601 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7602 "    if (s != 0)\n"
7603 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7604 msgstr ""
7605 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7606 "    if (s != 0)\n"
7607 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7608
7609 #. type: Plain text
7610 #: build/C/man3/pthread_setaffinity_np.3:200
7611 #, no-wrap
7612 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
7613 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
7614
7615 #. type: Plain text
7616 #: build/C/man3/pthread_setaffinity_np.3:204
7617 #, no-wrap
7618 msgid ""
7619 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7620 "    if (s != 0)\n"
7621 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7622 msgstr ""
7623 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7624 "    if (s != 0)\n"
7625 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7626
7627 #. type: Plain text
7628 #: build/C/man3/pthread_setaffinity_np.3:209
7629 #, no-wrap
7630 msgid ""
7631 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7632 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7633 "        if (CPU_ISSET(j, &cpuset))\n"
7634 "            printf(\"    CPU %d\\en\", j);\n"
7635 msgstr ""
7636 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7637 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7638 "        if (CPU_ISSET(j, &cpuset))\n"
7639 "            printf(\"    CPU %d\\en\", j);\n"
7640
7641 #. type: Plain text
7642 #: build/C/man3/pthread_setaffinity_np.3:212
7643 #: build/C/man3/pthread_setschedparam.3:439
7644 #, no-wrap
7645 msgid ""
7646 "    exit(EXIT_SUCCESS);\n"
7647 "}\n"
7648 msgstr ""
7649 "    exit(EXIT_SUCCESS);\n"
7650 "}\n"
7651
7652 #. type: Plain text
7653 #: build/C/man3/pthread_setaffinity_np.3:221
7654 msgid ""
7655 "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), "
7656 "B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), "
7657 "B<sched>(7)"
7658 msgstr ""
7659 "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), "
7660 "B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), "
7661 "B<sched>(7)"
7662
7663 #. type: TH
7664 #: build/C/man3/pthread_setcancelstate.3:26
7665 #, no-wrap
7666 msgid "PTHREAD_SETCANCELSTATE"
7667 msgstr "PTHREAD_SETCANCELSTATE"
7668
7669 #. type: Plain text
7670 #: build/C/man3/pthread_setcancelstate.3:30
7671 msgid ""
7672 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
7673 "type"
7674 msgstr ""
7675 "pthread_setcancelstate, pthread_setcanceltype - cancelability state と "
7676 "cancelability type を設定する"
7677
7678 #. type: Plain text
7679 #: build/C/man3/pthread_setcancelstate.3:36
7680 #, no-wrap
7681 msgid ""
7682 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7683 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7684 msgstr ""
7685 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7686 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7687
7688 #. type: Plain text
7689 #: build/C/man3/pthread_setcancelstate.3:51
7690 msgid ""
7691 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
7692 "thread to the value given in I<state>.  The previous cancelability state of "
7693 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
7694 "I<state> argument must have one of the following values:"
7695 msgstr ""
7696 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
7697 "cancelability state に I<state> で指定された\n"
7698 "値を設定する。変更前のスレッドの cancelability state は\n"
7699 "I<oldstate> が指すバッファで返される。\n"
7700 "I<state> 引き数には以下の値のいずれか一つを指定しなければならない。"
7701
7702 #. type: TP
7703 #: build/C/man3/pthread_setcancelstate.3:51
7704 #, no-wrap
7705 msgid "B<PTHREAD_CANCEL_ENABLE>"
7706 msgstr "B<PTHREAD_CANCEL_ENABLE>"
7707
7708 #. type: Plain text
7709 #: build/C/man3/pthread_setcancelstate.3:58
7710 msgid ""
7711 "The thread is cancelable.  This is the default cancelability state in all "
7712 "new threads, including the initial thread.  The thread's cancelability type "
7713 "determines when a cancelable thread will respond to a cancellation request."
7714 msgstr ""
7715 "スレッドは取り消し可能 (cancelable) である。\n"
7716 "これが全ての新しく作成されるスレッドでのデフォルトの\n"
7717 "cancelability state である。これには最初のスレッドも含まれる。\n"
7718 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
7719 "取り消し要求にいつ反応するかが決まる。"
7720
7721 #. type: TP
7722 #: build/C/man3/pthread_setcancelstate.3:58
7723 #, no-wrap
7724 msgid "B<PTHREAD_CANCEL_DISABLE>"
7725 msgstr "B<PTHREAD_CANCEL_DISABLE>"
7726
7727 #. type: Plain text
7728 #: build/C/man3/pthread_setcancelstate.3:63
7729 msgid ""
7730 "The thread is not cancelable.  If a cancellation request is received, it is "
7731 "blocked until cancelability is enabled."
7732 msgstr ""
7733 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
7734 "取り消し可能に設定されるまでその要求はブロックされる。"
7735
7736 #. type: Plain text
7737 #: build/C/man3/pthread_setcancelstate.3:75
7738 msgid ""
7739 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
7740 "thread to the value given in I<type>.  The previous cancelability type of "
7741 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
7742 "argument must have one of the following values:"
7743 msgstr ""
7744 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
7745 "cancelability type に I<type> で指定された値を設定する。\n"
7746 "変更前のスレッドの cancelability type は\n"
7747 "I<oldtype> が指すバッファで返される。\n"
7748 "I<type> 引き数には以下の値のいずれか一つを指定しなければならない。"
7749
7750 #. type: TP
7751 #: build/C/man3/pthread_setcancelstate.3:75
7752 #, no-wrap
7753 msgid "B<PTHREAD_CANCEL_DEFERRED>"
7754 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
7755
7756 #. type: Plain text
7757 #: build/C/man3/pthread_setcancelstate.3:82
7758 msgid ""
7759 "A cancellation request is deferred until the thread next calls a function "
7760 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
7761 "cancelability type in all new threads, including the initial thread."
7762 msgstr ""
7763 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
7764 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
7765 "スレッドでのデフォルトの cancelability type である。\n"
7766 "これには最初のスレッドも含まれる。"
7767
7768 #. type: TP
7769 #: build/C/man3/pthread_setcancelstate.3:82
7770 #, no-wrap
7771 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7772 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7773
7774 #. type: Plain text
7775 #: build/C/man3/pthread_setcancelstate.3:88
7776 msgid ""
7777 "The thread can be canceled at any time.  (Typically, it will be canceled "
7778 "immediately upon receiving a cancellation request, but the system doesn't "
7779 "guarantee this.)"
7780 msgstr ""
7781 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
7782 "システムがそのことを保証しているわけではない)。"
7783
7784 #. type: Plain text
7785 #: build/C/man3/pthread_setcancelstate.3:92
7786 msgid ""
7787 "The set-and-get operation performed by each of these functions is atomic "
7788 "with respect to other threads in the process calling the same function."
7789 msgstr ""
7790 "これらの関数により実行される「設定と取得」操作 (set-and-get operation) は、\n"
7791 "同じ関数を呼び出したプロセス内の他のスレッドがあっても、\n"
7792 "アトミックに行われる。"
7793
7794 #. type: Plain text
7795 #: build/C/man3/pthread_setcancelstate.3:99
7796 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
7797 msgstr "B<pthread_setcancelstate>() は以下のエラーで失敗する場合がある。"
7798
7799 #. type: Plain text
7800 #: build/C/man3/pthread_setcancelstate.3:103
7801 msgid "Invalid value for I<state>."
7802 msgstr "I<state> に無効な値が指定された。"
7803
7804 #. type: Plain text
7805 #: build/C/man3/pthread_setcancelstate.3:107
7806 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
7807 msgstr "B<pthread_setcanceltype>() は以下のエラーで失敗する場合がある。"
7808
7809 #.  .SH VERSIONS
7810 #.  Available since glibc 2.0
7811 #. type: Plain text
7812 #: build/C/man3/pthread_setcancelstate.3:113
7813 msgid "Invalid value for I<type>."
7814 msgstr "I<type> に無効な値が指定された。"
7815
7816 #. type: Plain text
7817 #: build/C/man3/pthread_setcancelstate.3:120
7818 msgid ""
7819 "The B<pthread_setcancelstate>()  and B<pthread_setcanceltype>()  functions "
7820 "are thread-safe."
7821 msgstr ""
7822 "関数 B<pthread_setcancelstate>() と B<pthread_setcanceltype>() はスレッドセー"
7823 "フである。"
7824
7825 #. type: Plain text
7826 #: build/C/man3/pthread_setcancelstate.3:125
7827 msgid ""
7828 "For details of what happens when a thread is canceled, see "
7829 "B<pthread_cancel>(3)."
7830 msgstr ""
7831 "スレッドが取り消された場合に何が起こるかの詳細については\n"
7832 "B<pthread_cancel>(3) を参照。"
7833
7834 #. type: Plain text
7835 #: build/C/man3/pthread_setcancelstate.3:132
7836 msgid ""
7837 "Briefly disabling cancelability is useful if a thread performs some critical "
7838 "action that must not be interrupted by a cancellation request.  Beware of "
7839 "disabling cancelability for long periods, or around operations that may "
7840 "block for long periods, since that will render the thread unresponsive to "
7841 "cancellation requests."
7842 msgstr ""
7843 "取り消し要求により中断されてはならない重要なアクションをスレッドが\n"
7844 "実行する場合、短い時間だけ cancelability を無効にするのは有用である。\n"
7845 "長い時間 cancelability を無効にしたり、長い時間停止 (block) される\n"
7846 "可能性のある操作の前後で cancelability を無効にしたりする際には\n"
7847 "注意すること。なぜなら、無効にしてしまうと、キャンセル要求に対して\n"
7848 "スレッドが応答しない状態になってしまうからである。"
7849
7850 #. type: SS
7851 #: build/C/man3/pthread_setcancelstate.3:132
7852 #, no-wrap
7853 msgid "Asynchronous cancelability"
7854 msgstr "非同期キャンセル"
7855
7856 #. type: Plain text
7857 #: build/C/man3/pthread_setcancelstate.3:151
7858 msgid ""
7859 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
7860 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
7861 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
7862 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
7863 "because the application has no way of knowing what the state of these "
7864 "resources is when the thread is canceled; that is, did cancellation occur "
7865 "before the resources were reserved, while they were reserved, or after they "
7866 "were released? Furthermore, some internal data structures (e.g., the linked "
7867 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
7868 "left in an inconsistent state if cancellation occurs in the middle of the "
7869 "function call.  Consequently, clean-up handlers cease to be useful."
7870 msgstr ""
7871 "cancelability type を B<PTHREAD_CANCEL_ASYNCHRONOUS> に設定して役に立つことは"
7872 "めったにない。スレッドはI<いつでも>キャンセルすることができることになるので、"
7873 "スレッドが安全にリソースの確保 (例えば B<malloc>(3) でメモリを割り当てる) や "
7874 "mutex、セマフォ、ロックなどの獲得を行うことができない。アプリケーションは、ス"
7875 "レッドがキャンセルされる際に、これらのリソースがどのような状態にあるかを知る"
7876 "術はないので、リソースの確保が安全ではなくなる。つまり、キャンセルが起こった"
7877 "のが、リソースの確保前なのか、確保中なのか、確保後なのかが分からない。さら"
7878 "に、関数呼び出しの最中にキャンセルが発生すると、いくつかの内部データ構造 (例"
7879 "えば、B<malloc>(3) 関連の関数が管理している未使用ブロックのリンクリスト) が一"
7880 "貫性のない状態のままになってしまう可能性がある。その結果、クリーンアップハン"
7881 "ドラが役に立たないものになってしまう。"
7882
7883 #. type: Plain text
7884 #: build/C/man3/pthread_setcancelstate.3:162
7885 msgid ""
7886 "Functions that can be safely asynchronously canceled are called I<async-"
7887 "cancel-safe functions>.  POSIX.1-2001 requires only that "
7888 "B<pthread_cancel>(3), B<pthread_setcancelstate>(), and "
7889 "B<pthread_setcanceltype>()  be async-cancel-safe.  In general, other library "
7890 "functions can't be safely called from an asynchronously cancelable thread."
7891 msgstr ""
7892 "非同期で安全にキャンセルできる関数は I<async-cancel-safe functions> と呼ばれ"
7893 "る。 POSIX.1-2001 で、非同期で安全にキャンセルできるように求められている関数"
7894 "は B<pthread_cancel>(3), B<pthread_setcancelstate>(), "
7895 "B<pthread_setcanceltype>() だけである。 一般的には、それ以外のライブラリ関数"
7896 "は、非同期にキャンセルできるスレッドから安全に呼び出すことはできない。"
7897
7898 #. type: Plain text
7899 #: build/C/man3/pthread_setcancelstate.3:165
7900 msgid ""
7901 "One of the few circumstances in which asynchronous cancelability is useful "
7902 "is for cancellation of a thread that is in a pure compute-bound loop."
7903 msgstr ""
7904 "非同期でのキャンセルが有効な数少ない状況としては、純粋に計算だけを行うループ"
7905 "に入っているスレッドをキャンセルするといった場面がある。"
7906
7907 #. type: SS
7908 #: build/C/man3/pthread_setcancelstate.3:165
7909 #, no-wrap
7910 msgid "Portability notes"
7911 msgstr "移植性に関する注意"
7912
7913 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
7914 #. type: Plain text
7915 #: build/C/man3/pthread_setcancelstate.3:183
7916 msgid ""
7917 "The Linux threading implementations permit the I<oldstate> argument of "
7918 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
7919 "the previous cancelability state is not returned to the caller.  Many other "
7920 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
7921 "does not specify this point, so portable applications should always specify "
7922 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
7923 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
7924 msgstr ""
7925 "Linux のスレッド実装では、 B<pthread_setcancelstate>() の I<oldstate>\n"
7926 "引き数に NULL を指定することを認めている。 NULL が指定された場合、\n"
7927 "変更前の cancelability state の情報が呼び出し側に返されない。\n"
7928 "他の多くの実装でも I<oldstate> 引き数に NULL を指定することを認めて\n"
7929 "いるが、 POSIX.1-2001 ではこの点については規定されていない。\n"
7930 "したがって、移植性が必要なアプリケーションでは常に I<oldstate> に\n"
7931 "NULL 以外の値を指定するようにすべきである。\n"
7932 "B<pthread_setcanceltype>() の I<oldtype> 引き数についても、\n"
7933 "全く同じことが言える。"
7934
7935 #. type: Plain text
7936 #: build/C/man3/pthread_setcancelstate.3:186
7937 msgid "See B<pthread_cancel>(3)."
7938 msgstr "B<pthread_cancel>(3) を参照。"
7939
7940 #. type: Plain text
7941 #: build/C/man3/pthread_setcancelstate.3:191
7942 msgid ""
7943 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7944 "B<pthreads>(7)"
7945 msgstr ""
7946 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7947 "B<pthreads>(7)"
7948
7949 #. type: TH
7950 #: build/C/man3/pthread_setconcurrency.3:25
7951 #, no-wrap
7952 msgid "PTHREAD_SETCONCURRENCY"
7953 msgstr "PTHREAD_SETCONCURRENCY"
7954
7955 #. type: Plain text
7956 #: build/C/man3/pthread_setconcurrency.3:29
7957 msgid ""
7958 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
7959 "level"
7960 msgstr ""
7961 "pthread_setconcurrency, pthread_getconcurrency - 並列処理レベルの設定/取得を"
7962 "行う"
7963
7964 #. type: Plain text
7965 #: build/C/man3/pthread_setconcurrency.3:35
7966 #, no-wrap
7967 msgid ""
7968 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7969 "B<int pthread_getconcurrency(void);>\n"
7970 msgstr ""
7971 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7972 "B<int pthread_getconcurrency(void);>\n"
7973
7974 #. type: Plain text
7975 #: build/C/man3/pthread_setconcurrency.3:48
7976 msgid ""
7977 "The B<pthread_setconcurrency>()  function informs the implementation of the "
7978 "application's desired concurrency level, specified in I<new_level>.  The "
7979 "implementation takes this only as a hint: POSIX.1 does not specify the level "
7980 "of concurrency that should be provided as a result of calling "
7981 "B<pthread_setconcurrency>()."
7982 msgstr ""
7983 "B<pthread_setconcurrency>() 関数は、アプリケーションが希望する\n"
7984 "並列処理レベル (concurrency level) をスレッド実装に通知する。\n"
7985 "希望する並列処理レベルは I<new_level> で指定する。\n"
7986 "スレッド実装はこの情報をヒントとしてのみ利用する。\n"
7987 "POSIX.1 では、 B<pthread_setconcurrency>() の呼び出した結果、\n"
7988 "どのような並列度になるべきかは規定されていない。"
7989
7990 #. type: Plain text
7991 #: build/C/man3/pthread_setconcurrency.3:53
7992 msgid ""
7993 "Specifying I<new_level> as 0 instructs the implementation to manage the "
7994 "concurrency level as it deems appropriate."
7995 msgstr ""
7996 "I<new_level> に 0 を指定すると、スレッド実装は並列処理レベルを\n"
7997 "実装側で適切とみなしたレベルに設定するようになる。"
7998
7999 #. type: Plain text
8000 #: build/C/man3/pthread_setconcurrency.3:56
8001 msgid ""
8002 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
8003 "level for this process."
8004 msgstr ""
8005 "B<pthread_getconcurrency>() は、このプロセスの concurrency level\n"
8006 "の現在値を返す。"
8007
8008 #. type: Plain text
8009 #: build/C/man3/pthread_setconcurrency.3:61
8010 msgid ""
8011 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
8012 "nonzero error number."
8013 msgstr ""
8014 "成功すると、 B<pthread_setconcurrency>() は 0 を返す。\n"
8015 "エラーの場合、 0 以外のエラー番号を返す。"
8016
8017 #. type: Plain text
8018 #: build/C/man3/pthread_setconcurrency.3:68
8019 msgid ""
8020 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
8021 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
8022 "B<pthread_setconcurrency>()  has not previously been called."
8023 msgstr ""
8024 "B<pthread_getconcurrency>() は常に成功し、最後の\n"
8025 "B<pthread_getconcurrency>() の呼び出しで設定された \n"
8026 "concurrency level を返す。 B<pthread_getconcurrency>() が\n"
8027 "それまでに一度も呼び出されていない場合は 0 が返る。"
8028
8029 #. type: Plain text
8030 #: build/C/man3/pthread_setconcurrency.3:71
8031 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
8032 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
8033
8034 #. type: Plain text
8035 #: build/C/man3/pthread_setconcurrency.3:75
8036 msgid "I<new_level> is negative."
8037 msgstr "I<new_level> が負である。"
8038
8039 #. type: Plain text
8040 #: build/C/man3/pthread_setconcurrency.3:81
8041 msgid ""
8042 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
8043 "I<new_level> would cause a system resource to be exceeded\")."
8044 msgstr ""
8045 "POSIX.1-2001 には、エラー B<EAGAIN> も記載されている\n"
8046 "(「I<new_level> に指定された値を適用すると、システムリソースが\n"
8047 "超過してしまう」)。"
8048
8049 #. type: Plain text
8050 #: build/C/man3/pthread_setconcurrency.3:83
8051 msgid "These functions are available in glibc since version 2.1."
8052 msgstr "これらの関数は glibc バージョン 2.1 以降で利用できる。"
8053
8054 #. type: Plain text
8055 #: build/C/man3/pthread_setconcurrency.3:90
8056 msgid ""
8057 "The B<pthread_setconcurrency>()  and B<pthread_getconcurrency>()  functions "
8058 "are thread-safe."
8059 msgstr ""
8060 "関数 B<pthread_setconcurrency>() と B<pthread_getconcurrency>() はスレッド"
8061 "セーフである。"
8062
8063 #. type: Plain text
8064 #: build/C/man3/pthread_setconcurrency.3:94
8065 msgid "The default concurrency level is 0."
8066 msgstr "デフォルトの concurrency level は 0 である。"
8067
8068 #. type: Plain text
8069 #: build/C/man3/pthread_setconcurrency.3:101
8070 msgid ""
8071 "Concurrency levels are meaningful only for M:N threading implementations, "
8072 "where at any moment a subset of a process's set of user-level threads may be "
8073 "bound to a smaller number of kernel-scheduling entities.  Setting the "
8074 "concurrency level allows the application to give the system a hint as to the "
8075 "number of kernel-scheduling entities that should be provided for efficient "
8076 "execution of the application."
8077 msgstr ""
8078 "並列処理レベルが意味を持つのは M:N スレッド実装の場合のみである。\n"
8079 "M:N スレッド実装では、ある瞬間において、あるプロセスのユーザレベルスレッ\n"
8080 "ドの集合のサブ集合が、そのサブ集合のサイズよりも少ない数のカーネルの\n"
8081 "スケジューリング実体 (kernel-scheduling entity) に結び付けられる。\n"
8082 "並列処理レベルを設定すると、そのアプリケーションの効率的な実行に必要な\n"
8083 "カーネルのスケジューリング実体の数のヒントを、アプリケーションはシステ\n"
8084 "ムに伝えることができる。"
8085
8086 #. type: Plain text
8087 #: build/C/man3/pthread_setconcurrency.3:107
8088 msgid ""
8089 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
8090 "concurrency level has no meaning.  In other words, on Linux these functions "
8091 "merely exist for compatibility with other systems, and they have no effect "
8092 "on the execution of a program."
8093 msgstr ""
8094 "LinuxThreads と NPTL のどちらも 1:1 スレッド実装であり、\n"
8095 "並列処理レベルを設定しても何の意味もない。\n"
8096 "言い換えると、 Linux では、これらの関数は、\n"
8097 "他のシステムとの互換性のためだけに存在し、\n"
8098 "プログラムの実行には何の影響も与えないということである。"
8099
8100 #. type: Plain text
8101 #: build/C/man3/pthread_setconcurrency.3:110
8102 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
8103 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
8104
8105 #. type: TH
8106 #: build/C/man3/pthread_setname_np.3:26
8107 #, no-wrap
8108 msgid "PTHREAD_SETNAME_NP"
8109 msgstr "PTHREAD_SETNAME_NP"
8110
8111 #. type: Plain text
8112 #: build/C/man3/pthread_setname_np.3:29
8113 msgid "pthread_setname_np, pthread_getname_np - set/get the name of a thread"
8114 msgstr "pthread_setname_np, pthread_getname_np - スレッド名の設定/取得を行う"
8115
8116 #. type: Plain text
8117 #: build/C/man3/pthread_setname_np.3:36
8118 #, no-wrap
8119 msgid ""
8120 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
8121 "B<#include E<lt>pthread.hE<gt>>\n"
8122 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
8123 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
8124 "B<                       char *>I<name>B<, size_t >I<len>B<);>\n"
8125 msgstr ""
8126 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
8127 "B<#include E<lt>pthread.hE<gt>>\n"
8128 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
8129 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
8130 "B<                       char *>I<name>B<, size_t >I<len>B<);>\n"
8131
8132 #. type: Plain text
8133 #: build/C/man3/pthread_setname_np.3:55
8134 msgid ""
8135 "By default, all the threads created using B<pthread_create>()  inherit the "
8136 "program name.  The B<pthread_setname_np>()  function can be used to set a "
8137 "unique name for a thread, which can be useful for debugging multithreaded "
8138 "applications.  The thread name is a meaningful C language string, whose "
8139 "length is restricted to 16 characters, including the terminating null byte "
8140 "(\\(aq\\e0\\(aq).  The I<thread> argument specifies the thread whose name is "
8141 "to be changed; I<name> specifies the new name."
8142 msgstr ""
8143 "デフォルトでは、 B<pthread_create>() で作成されたすべてのスレッドはプログラム"
8144 "名を継承する。 B<pthread_setname_np>() 関数を使うとスレッドに固有の名前を設定"
8145 "することができる。 スレッド固有の名前はマルチスレッド・アプリケーションのデ"
8146 "バッグに便利である。 スレッド名は意味のある C 言語の文字列である。 その長さ"
8147 "は 16 文字に限定されており、 終端のヌルバイト (\\(aq\\e0\\(aq) も 16 文字に含"
8148 "まれる。 I<thread> 引き数で名前を変更するスレッドを指定する。 I<name> には新"
8149 "しい名前を指定する。"
8150
8151 #. type: Plain text
8152 #: build/C/man3/pthread_setname_np.3:72
8153 msgid ""
8154 "The B<pthread_getname_np>()  function can be used to retrieve the name of "
8155 "the thread.  The I<thread> argument specifies the thread whose name is to be "
8156 "retrieved.  The buffer I<name> is used to return the thread name; I<len> "
8157 "specifies the number of bytes available in I<name>.  The buffer specified by "
8158 "I<name> should be at least 16 characters in length.  The returned thread "
8159 "name in the output buffer will be null terminated."
8160 msgstr ""
8161 "B<pthread_getname_np>() 関数を使うと、 スレッド名を取得することができる。 "
8162 "I<thread> 引き数は名前を取得するスレッドを指定する。 バッファ I<name> はス"
8163 "レッド名を返すのに使用される。 I<len> には I<name> の大きさをバイトで指定す"
8164 "る。 I<name> で指定されたバッファの大きさは最低でも 16 文字とすべきである。 "
8165 "出力バッファに返されたスレッド名はヌル終端される。"
8166
8167 #. type: Plain text
8168 #: build/C/man3/pthread_setname_np.3:79
8169 msgid ""
8170 "The B<pthread_setname_np>()  function can fail with the following error:"
8171 msgstr "B<pthread_setname_np>() は以下のエラーで失敗する場合がある。"
8172
8173 #. type: TP
8174 #: build/C/man3/pthread_setname_np.3:79 build/C/man3/pthread_setname_np.3:88
8175 #, no-wrap
8176 msgid "B<ERANGE>"
8177 msgstr "B<ERANGE>"
8178
8179 #. type: Plain text
8180 #: build/C/man3/pthread_setname_np.3:84
8181 msgid ""
8182 "The length of the string specified pointed to by I<name> exceeds the allowed "
8183 "limit."
8184 msgstr "I<name> で指定された文字列の長さが、許可されている上限を超えている。"
8185
8186 #. type: Plain text
8187 #: build/C/man3/pthread_setname_np.3:88
8188 msgid ""
8189 "The B<pthread_getname_np>()  function can fail with the following error:"
8190 msgstr "B<pthread_getname_np>() は以下のエラーで失敗する場合がある。"
8191
8192 #. type: Plain text
8193 #: build/C/man3/pthread_setname_np.3:95
8194 msgid ""
8195 "The buffer specified by I<name> and I<len> is too small to hold the thread "
8196 "name."
8197 msgstr ""
8198 "I<name> と I<len> で指定されたバッファが、 スレッド名を格納するには短かすぎ"
8199 "る。"
8200
8201 #. type: Plain text
8202 #: build/C/man3/pthread_setname_np.3:100
8203 msgid ""
8204 "If either of these functions fails to open I</proc/self/task/[tid]/comm>, "
8205 "then the call may fail with one of the errors described in B<open>(2)."
8206 msgstr ""
8207 "I</proc/self/task/[tid]/comm> のオープンに失敗した場合、 これらの関数は "
8208 "B<open>(2) で説明されているエラーのいずれかで失敗する。"
8209
8210 #. type: Plain text
8211 #: build/C/man3/pthread_setname_np.3:102
8212 msgid "These functions first appeared in glibc in version 2.12."
8213 msgstr "これらの関数は glibc バージョン 2.12 で初めて登場した。"
8214
8215 #. type: Plain text
8216 #: build/C/man3/pthread_setname_np.3:104
8217 msgid "These functions are nonstandard GNU extensions."
8218 msgstr "これらの関数は非標準の GNU による拡張である。"
8219
8220 #. type: Plain text
8221 #: build/C/man3/pthread_setname_np.3:114
8222 msgid ""
8223 "B<pthread_setname_np>()  internally writes to the thread-specific I<comm> "
8224 "file under the I</proc> filesystem: I</proc/self/task/[tid]/comm>.  "
8225 "B<pthread_getname_np>()  retrieves it from the same location."
8226 msgstr ""
8227 "B<pthread_setname_np>() は内部で I</proc> ファイルシステムのスレッド固有の "
8228 "I<comm> ファイル (I</proc/self/task/[tid]/comm>) に書き込みを行う。 "
8229 "B<pthread_getname_np>() はこのファイルから読み出しを行う。"
8230
8231 #. type: Plain text
8232 #: build/C/man3/pthread_setname_np.3:120
8233 msgid ""
8234 "The program below demonstrates the use of B<pthread_setname_np>()  and "
8235 "B<pthread_getname_np>()."
8236 msgstr ""
8237 "以下のプログラムは、 B<pthread_setname_np>() と B<pthread_getname_np>()\n"
8238 "の使用例を示している。"
8239
8240 #. type: Plain text
8241 #: build/C/man3/pthread_setname_np.3:122
8242 msgid "The following shell session shows a sample run of the program:"
8243 msgstr "以下のシェルセッションは、このプログラムの実行例である。"
8244
8245 #. type: Plain text
8246 #: build/C/man3/pthread_setname_np.3:138
8247 #, no-wrap
8248 msgid ""
8249 "$B< ./a.out>\n"
8250 "Created a thread. Default name is: a.out\n"
8251 "The thread name after setting it is THREADFOO.\n"
8252 "B<^Z>                           # Suspend the program\n"
8253 "[1]+  Stopped           ./a.out\n"
8254 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
8255 "  PID   TID CMD                         COMMAND\n"
8256 " 5990  5990 ./a.out                     a.out\n"
8257 " 5990  5991 ./a.out                     THREADFOO\n"
8258 "$ B<cat /proc/5990/task/5990/comm>\n"
8259 "a.out\n"
8260 "$ B<cat /proc/5990/task/5991/comm>\n"
8261 "THREADFOO\n"
8262 msgstr ""
8263 "$B< ./a.out>\n"
8264 "Created a thread. Default name is: a.out\n"
8265 "The thread name after setting it is THREADFOO.\n"
8266 "B<^Z>                           # Suspend the program\n"
8267 "[1]+  Stopped           ./a.out\n"
8268 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
8269 "  PID   TID CMD                         COMMAND\n"
8270 " 5990  5990 ./a.out                     a.out\n"
8271 " 5990  5991 ./a.out                     THREADFOO\n"
8272 "$ B<cat /proc/5990/task/5990/comm>\n"
8273 "a.out\n"
8274 "$ B<cat /proc/5990/task/5991/comm>\n"
8275 "THREADFOO\n"
8276
8277 #. type: Plain text
8278 #: build/C/man3/pthread_setname_np.3:150
8279 #, no-wrap
8280 msgid ""
8281 "#define _GNU_SOURCE\n"
8282 "#include E<lt>pthread.hE<gt>\n"
8283 "#include E<lt>stdio.hE<gt>\n"
8284 "#include E<lt>string.hE<gt>\n"
8285 "#include E<lt>unistd.hE<gt>\n"
8286 "#include E<lt>errno.hE<gt>\n"
8287 "#include E<lt>stdlib.hE<gt>\n"
8288 msgstr ""
8289 "#define _GNU_SOURCE\n"
8290 "#include E<lt>pthread.hE<gt>\n"
8291 "#include E<lt>stdio.hE<gt>\n"
8292 "#include E<lt>string.hE<gt>\n"
8293 "#include E<lt>unistd.hE<gt>\n"
8294 "#include E<lt>errno.hE<gt>\n"
8295 "#include E<lt>stdlib.hE<gt>\n"
8296
8297 #. type: Plain text
8298 #: build/C/man3/pthread_setname_np.3:152
8299 #, no-wrap
8300 msgid "#define NAMELEN 16\n"
8301 msgstr "#define NAMELEN 16\n"
8302
8303 #. type: Plain text
8304 #: build/C/man3/pthread_setname_np.3:156
8305 #, no-wrap
8306 msgid ""
8307 "#define errExitEN(en, msg) \\e\n"
8308 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
8309 "        } while (0)\n"
8310 msgstr ""
8311 "#define errExitEN(en, msg) \\e\n"
8312 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
8313 "        } while (0)\n"
8314
8315 #. type: Plain text
8316 #: build/C/man3/pthread_setname_np.3:163
8317 #, no-wrap
8318 msgid ""
8319 "static void *\n"
8320 "threadfunc(void *parm)\n"
8321 "{\n"
8322 "    sleep(5);          // allow main program to set the thread name\n"
8323 "    return NULL;\n"
8324 "}\n"
8325 msgstr ""
8326 "static void *\n"
8327 "threadfunc(void *parm)\n"
8328 "{\n"
8329 "    sleep(5);          // allow main program to set the thread name\n"
8330 "    return NULL;\n"
8331 "}\n"
8332
8333 #. type: Plain text
8334 #: build/C/man3/pthread_setname_np.3:170
8335 #, no-wrap
8336 msgid ""
8337 "int\n"
8338 "main(int argc, char **argv)\n"
8339 "{\n"
8340 "    pthread_t thread;\n"
8341 "    int rc;\n"
8342 "    char thread_name[NAMELEN];\n"
8343 msgstr ""
8344 "int\n"
8345 "main(int argc, char **argv)\n"
8346 "{\n"
8347 "    pthread_t thread;\n"
8348 "    int rc;\n"
8349 "    char thread_name[NAMELEN];\n"
8350
8351 #. type: Plain text
8352 #: build/C/man3/pthread_setname_np.3:174
8353 #, no-wrap
8354 msgid ""
8355 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8356 "    if (rc != 0)\n"
8357 "        errExitEN(rc, \"pthread_create\");\n"
8358 msgstr ""
8359 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8360 "    if (rc != 0)\n"
8361 "        errExitEN(rc, \"pthread_create\");\n"
8362
8363 #. type: Plain text
8364 #: build/C/man3/pthread_setname_np.3:178
8365 #, no-wrap
8366 msgid ""
8367 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8368 "    if (rc != 0)\n"
8369 "        errExitEN(rc, \"pthread_getname_np\");\n"
8370 msgstr ""
8371 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8372 "    if (rc != 0)\n"
8373 "        errExitEN(rc, \"pthread_getname_np\");\n"
8374
8375 #. type: Plain text
8376 #: build/C/man3/pthread_setname_np.3:183
8377 #, no-wrap
8378 msgid ""
8379 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8380 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8381 "    if (rc != 0)\n"
8382 "        errExitEN(rc, \"pthread_setname_np\");\n"
8383 msgstr ""
8384 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8385 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8386 "    if (rc != 0)\n"
8387 "        errExitEN(rc, \"pthread_setname_np\");\n"
8388
8389 #. type: Plain text
8390 #: build/C/man3/pthread_setname_np.3:185
8391 #, no-wrap
8392 msgid "    sleep(2);\n"
8393 msgstr "    sleep(2);\n"
8394
8395 #. type: Plain text
8396 #: build/C/man3/pthread_setname_np.3:191
8397 #, no-wrap
8398 msgid ""
8399 "    rc = pthread_getname_np(thread, thread_name,\n"
8400 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8401 "    if (rc != 0)\n"
8402 "        errExitEN(rc, \"pthread_getname_np\");\n"
8403 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8404 msgstr ""
8405 "    rc = pthread_getname_np(thread, thread_name,\n"
8406 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8407 "    if (rc != 0)\n"
8408 "        errExitEN(rc, \"pthread_getname_np\");\n"
8409 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8410
8411 #. type: Plain text
8412 #: build/C/man3/pthread_setname_np.3:195
8413 #, no-wrap
8414 msgid ""
8415 "    rc = pthread_join(thread, NULL);\n"
8416 "    if (rc != 0)\n"
8417 "        errExitEN(rc, \"pthread_join\");\n"
8418 msgstr ""
8419 "    rc = pthread_join(thread, NULL);\n"
8420 "    if (rc != 0)\n"
8421 "        errExitEN(rc, \"pthread_join\");\n"
8422
8423 #. type: Plain text
8424 #: build/C/man3/pthread_setname_np.3:199
8425 #, no-wrap
8426 msgid ""
8427 "    printf(\"Done\\en\");\n"
8428 "    exit(EXIT_SUCCESS);\n"
8429 "}\n"
8430 msgstr ""
8431 "    printf(\"Done\\en\");\n"
8432 "    exit(EXIT_SUCCESS);\n"
8433 "}\n"
8434
8435 #. type: Plain text
8436 #: build/C/man3/pthread_setname_np.3:206
8437 msgid "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8438 msgstr "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8439
8440 #. type: TH
8441 #: build/C/man3/pthread_setschedparam.3:26
8442 #, no-wrap
8443 msgid "PTHREAD_SETSCHEDPARAM"
8444 msgstr "PTHREAD_SETSCHEDPARAM"
8445
8446 #. type: TH
8447 #: build/C/man3/pthread_setschedparam.3:26
8448 #, no-wrap
8449 msgid "2014-12-31"
8450 msgstr "2014-12-31"
8451
8452 #. type: Plain text
8453 #: build/C/man3/pthread_setschedparam.3:30
8454 msgid ""
8455 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
8456 "parameters of a thread"
8457 msgstr ""
8458 "pthread_setschedparam, pthread_getschedparam - スレッドの\n"
8459 "スケジューリングポリシーとパラメータを設定/取得する"
8460
8461 #. type: Plain text
8462 #: build/C/man3/pthread_setschedparam.3:38
8463 #, no-wrap
8464 msgid ""
8465 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8466 "B<                          const struct sched_param *>I<param>B<);>\n"
8467 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8468 "B<                          struct sched_param *>I<param>B<);>\n"
8469 msgstr ""
8470 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8471 "B<                          const struct sched_param *>I<param>B<);>\n"
8472 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8473 "B<                          struct sched_param *>I<param>B<);>\n"
8474
8475 #. type: Plain text
8476 #: build/C/man3/pthread_setschedparam.3:46
8477 msgid ""
8478 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
8479 "parameters of the thread I<thread>."
8480 msgstr ""
8481 "B<pthread_setschedparam>() 関数は、スレッド I<thread> の\n"
8482 "スケジューリングポリシーとスケジューリングパラメータを設定する。"
8483
8484 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
8485 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
8486 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
8487 #. type: Plain text
8488 #: build/C/man3/pthread_setschedparam.3:57
8489 msgid ""
8490 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
8491 "values for I<policy>, and their semantics, are described in B<sched>(7)."
8492 msgstr ""
8493 "I<policy> は I<thread> の新しいスケジューリングポリシーを指定する。 "
8494 "I<policy> に指定できる値とその意味は B<sched>(7) で説明されている。"
8495
8496 #. type: Plain text
8497 #: build/C/man3/pthread_setschedparam.3:63
8498 msgid ""
8499 "The structure pointed to by I<param> specifies the new scheduling parameters "
8500 "for I<thread>.  Scheduling parameters are maintained in the following "
8501 "structure:"
8502 msgstr ""
8503 "I<param> が指す構造体は I<thread> の新しいスケジューリングパラメータを\n"
8504 "指定する。スケジューリングパラメータは以下の構造体で管理される。"
8505
8506 #.  FIXME . nptl/pthread_setschedparam.c has the following
8507 #.    /* If the thread should have higher priority because of some
8508 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
8509 #.  Eventually (perhaps after writing the mutexattr pages), we
8510 #.  may want to add something on the topic to this page.
8511 #. type: Plain text
8512 #: build/C/man3/pthread_setschedparam.3:104
8513 msgid ""
8514 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
8515 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
8516 "and I<param>, respectively.  The returned priority value is that set by the "
8517 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
8518 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
8519 "does not reflect any temporary priority adjustments as a result of calls to "
8520 "any priority inheritance or priority ceiling functions (see, for example, "
8521 "B<pthread_mutexattr_setprioceiling>(3)  and "
8522 "B<pthread_mutexattr_setprotocol>(3))."
8523 msgstr ""
8524 "B<pthread_getschedparam>() 関数は、スレッド I<thread> の\n"
8525 "スケジューリングポリシーとパラメータを、\n"
8526 "それぞれ I<policy> と I<param> が指すバッファに入れて返す。\n"
8527 "返された優先度の値は、最も最近実行した I<thread> に影響を与える\n"
8528 "B<pthread_setschedparam>(), B<pthread_setschedprio>,\n"
8529 "B<pthread_create> で設定された値となる。\n"
8530 "返された優先度は、優先度の継承や優先度の上限を設定する関数\n"
8531 "(例えば B<pthread_mutexattr_setprioceiling>(3) や\n"
8532 "B<pthread_mutexattr_setprotocol>(3) を参照) の呼び出しの結果\n"
8533 "行われる一時的な優先度の調整の影響を受けない。"
8534
8535 #. type: Plain text
8536 #: build/C/man3/pthread_setschedparam.3:112
8537 msgid ""
8538 "On success, these functions return 0; on error, they return a nonzero error "
8539 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
8540 "parameters of I<thread> are not changed."
8541 msgstr ""
8542 "成功すると、これらの関数は 0 を返す。\n"
8543 "エラーの場合、0 以外のエラー番号を返す。\n"
8544 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
8545 "スケジューリングポリシーとパラメータは変更されない。"
8546
8547 #. type: Plain text
8548 #: build/C/man3/pthread_setschedparam.3:114
8549 msgid "Both of these functions can fail with the following error:"
8550 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
8551
8552 #. type: Plain text
8553 #: build/C/man3/pthread_setschedparam.3:122
8554 msgid ""
8555 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
8556 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
8557
8558 #. type: Plain text
8559 #: build/C/man3/pthread_setschedparam.3:129
8560 msgid ""
8561 "I<policy> is not a recognized policy, or I<param> does not make sense for "
8562 "the I<policy>."
8563 msgstr ""
8564 "I<policy> が認識できないポリシーであるか、\n"
8565 "I<param> が I<policy> では意味を持たない値である。"
8566
8567 #. type: Plain text
8568 #: build/C/man3/pthread_setschedparam.3:133
8569 msgid ""
8570 "The caller does not have appropriate privileges to set the specified "
8571 "scheduling policy and parameters."
8572 msgstr ""
8573 "呼び出し側が、指定されたスケジューリングポリシーやパラメータを設定する\n"
8574 "のに必要な特権を持たない。"
8575
8576 #.  .SH VERSIONS
8577 #.  Available since glibc 2.0
8578 #. type: Plain text
8579 #: build/C/man3/pthread_setschedparam.3:141
8580 msgid ""
8581 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
8582 "policy or scheduling parameters to an unsupported value\") error for "
8583 "B<pthread_setschedparam>()."
8584 msgstr ""
8585 "POSIX.1-2001 では、 B<pthread_setschedparam>() に関して\n"
8586 "エラー B<ENOTSUP> (\"サポートされていない値をスケジューリングポリシーや\n"
8587 "パラメータに設定しようとした\") も追加で規定されている。"
8588
8589 #. type: Plain text
8590 #: build/C/man3/pthread_setschedparam.3:148
8591 msgid ""
8592 "The B<pthread_setschedparam>()  and B<pthread_getschedparam>()  functions "
8593 "are thread-safe."
8594 msgstr ""
8595 "関数 B<pthread_setschedparam>() と B<pthread_getschedparam>() はスレッドセー"
8596 "フである。"
8597
8598 #. type: Plain text
8599 #: build/C/man3/pthread_setschedparam.3:156
8600 msgid ""
8601 "For a description of the permissions required to, and the effect of, "
8602 "changing a thread's scheduling policy and priority, and details of the "
8603 "permitted ranges for priorities in each scheduling policy, see B<sched>(7)."
8604 msgstr ""
8605 "スレッドのスケジューリングポリシーや優先度を変更するために必要な許可や変更し"
8606 "た場合の影響、および各スケジューリングポリシーで認められる優先度の範囲の詳細"
8607 "については、 B<sched>(7) を参照。"
8608
8609 #. type: Plain text
8610 #: build/C/man3/pthread_setschedparam.3:163
8611 msgid ""
8612 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
8613 "B<pthread_getschedparam>(), as well as the use of a number of other "
8614 "scheduling-related pthreads functions."
8615 msgstr ""
8616 "以下のプログラムは B<pthread_setschedparam>() と\n"
8617 "B<pthread_getschedparam>() やスケジューリングに関連する pthreads の\n"
8618 "他のいろいろな関数の使用例を示すものである。"
8619
8620 #. type: Plain text
8621 #: build/C/man3/pthread_setschedparam.3:179
8622 msgid ""
8623 "In the following run, the main thread sets its scheduling policy to "
8624 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
8625 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
8626 "priority attribute of 20.  The program then sets (using "
8627 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
8628 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
8629 "created using this attributes object should take their scheduling attributes "
8630 "from the thread attributes object.  The program then creates a thread using "
8631 "the thread attributes object, and that thread displays its scheduling policy "
8632 "and priority."
8633 msgstr ""
8634 "以下の実行例では、メインスレッドは、自分のスケジューリングポリシーを\n"
8635 "優先度 10 の B<SCHED_FIFO> を設定し、スレッド属性オブジェクトを\n"
8636 "スケジューリングポリシー属性 B<SCHED_RR> とスケジューリング優先度\n"
8637 "属性 20 で初期化する。\n"
8638 "次に、このプログラムは (B<pthread_attr_setinheritsched>(3) を使って) \n"
8639 "そのスレッド属性オブジェクトの inherit scheduler 属性に\n"
8640 "B<PTHREAD_EXPLICIT_SCHED> を設定する。B<PTHREAD_EXPLICIT_SCHED> は、\n"
8641 "そのスレッド属性オブジェクトを使って作成されたスレッドはスレッド属性\n"
8642 "オブジェクトからスケジューリング属性を取得して使うことを意味する。\n"
8643 "それから、このスレッド属性オブジェクトを使ってスレッドを作成し、\n"
8644 "作成したスレッドのスケジューリングポリシーと優先度を表示する。"
8645
8646 #. type: Plain text
8647 #: build/C/man3/pthread_setschedparam.3:187
8648 #, no-wrap
8649 msgid ""
8650 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
8651 "Password:\n"
8652 "# B<./a.out -mf10 -ar20 -i e>\n"
8653 "Scheduler settings of main thread\n"
8654 "    policy=SCHED_FIFO, priority=10\n"
8655 msgstr ""
8656 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
8657 "Password:\n"
8658 "# B<./a.out -mf10 -ar20 -i e>\n"
8659 "Scheduler settings of main thread\n"
8660 "    policy=SCHED_FIFO, priority=10\n"
8661
8662 #. type: Plain text
8663 #: build/C/man3/pthread_setschedparam.3:191
8664 #, no-wrap
8665 msgid ""
8666 "Scheduler settings in \\(aqattr\\(aq\n"
8667 "    policy=SCHED_RR, priority=20\n"
8668 "    inheritsched is EXPLICIT\n"
8669 msgstr ""
8670 "Scheduler settings in \\(aqattr\\(aq\n"
8671 "    policy=SCHED_RR, priority=20\n"
8672 "    inheritsched is EXPLICIT\n"
8673
8674 #. type: Plain text
8675 #: build/C/man3/pthread_setschedparam.3:194
8676 #, no-wrap
8677 msgid ""
8678 "Scheduler attributes of new thread\n"
8679 "    policy=SCHED_RR, priority=20\n"
8680 msgstr ""
8681 "Scheduler attributes of new thread\n"
8682 "    policy=SCHED_RR, priority=20\n"
8683
8684 #. type: Plain text
8685 #: build/C/man3/pthread_setschedparam.3:199
8686 msgid ""
8687 "In the above output, one can see that the scheduling policy and priority "
8688 "were taken from the values specified in the thread attributes object."
8689 msgstr ""
8690 "上記の出力では、スケジューリングポリシーと優先度がスレッド属性\n"
8691 "オブジェクトで指定された値から取られていることが分かる。"
8692
8693 #. type: Plain text
8694 #: build/C/man3/pthread_setschedparam.3:206
8695 msgid ""
8696 "The next run is the same as the previous, except that the inherit scheduler "
8697 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
8698 "using the thread attributes object should ignore the scheduling attributes "
8699 "specified in the attributes object and instead take their scheduling "
8700 "attributes from the creating thread."
8701 msgstr ""
8702 "次の実行例は前のものと同じだが、 inherit scheduler 属性が \n"
8703 "B<PTHREAD_INHERIT_SCHED> に設定される点が異なる。\n"
8704 "B<PTHREAD_INHERIT_SCHED> は、そのスレッド属性オブジェクトを使って作成\n"
8705 "されたスレッドは、スレッド属性オブジェクトからスケジューリング属性を\n"
8706 "無視し、代わりに呼び出したスレッドからスケジューリング属性を取得する\n"
8707 "ことを意味する。"
8708
8709 #. type: Plain text
8710 #: build/C/man3/pthread_setschedparam.3:212
8711 #, no-wrap
8712 msgid ""
8713 "# B<./a.out -mf10 -ar20 -i i>\n"
8714 "Scheduler settings of main thread\n"
8715 "    policy=SCHED_FIFO, priority=10\n"
8716 msgstr ""
8717 "# B<./a.out -mf10 -ar20 -i i>\n"
8718 "Scheduler settings of main thread\n"
8719 "    policy=SCHED_FIFO, priority=10\n"
8720
8721 #. type: Plain text
8722 #: build/C/man3/pthread_setschedparam.3:216
8723 #, no-wrap
8724 msgid ""
8725 "Scheduler settings in \\(aqattr\\(aq\n"
8726 "    policy=SCHED_RR, priority=20\n"
8727 "    inheritsched is INHERIT\n"
8728 msgstr ""
8729 "Scheduler settings in \\(aqattr\\(aq\n"
8730 "    policy=SCHED_RR, priority=20\n"
8731 "    inheritsched is INHERIT\n"
8732
8733 #. type: Plain text
8734 #: build/C/man3/pthread_setschedparam.3:219
8735 #, no-wrap
8736 msgid ""
8737 "Scheduler attributes of new thread\n"
8738 "    policy=SCHED_FIFO, priority=10\n"
8739 msgstr ""
8740 "Scheduler attributes of new thread\n"
8741 "    policy=SCHED_FIFO, priority=10\n"
8742
8743 #. type: Plain text
8744 #: build/C/man3/pthread_setschedparam.3:225
8745 msgid ""
8746 "In the above output, one can see that the scheduling policy and priority "
8747 "were taken from the creating thread, rather than the thread attributes "
8748 "object."
8749 msgstr ""
8750 "上記の出力では、スケジューリングポリシーと優先度が、\n"
8751 "スレッド属性オブジェクトからではなく、\n"
8752 "スレッドを作成したスレッドから取れれていることが分かる。"
8753
8754 #. type: Plain text
8755 #: build/C/man3/pthread_setschedparam.3:231
8756 msgid ""
8757 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
8758 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
8759 "scheduler attribute."
8760 msgstr ""
8761 "なお、 I<-i\\ i> を省略した場合でも、\n"
8762 "B<PTHREAD_INHERIT_SCHED> が inherit scheduler 属性のデフォルト値なので、\n"
8763 "出力は同じになる。"
8764
8765 #. type: Plain text
8766 #: build/C/man3/pthread_setschedparam.3:235
8767 #, no-wrap
8768 msgid "/* pthreads_sched_test.c */\n"
8769 msgstr "/* pthreads_sched_test.c */\n"
8770
8771 #. type: Plain text
8772 #: build/C/man3/pthread_setschedparam.3:241
8773 #, no-wrap
8774 msgid ""
8775 "#include E<lt>pthread.hE<gt>\n"
8776 "#include E<lt>stdio.hE<gt>\n"
8777 "#include E<lt>stdlib.hE<gt>\n"
8778 "#include E<lt>unistd.hE<gt>\n"
8779 "#include E<lt>errno.hE<gt>\n"
8780 msgstr ""
8781 "#include E<lt>pthread.hE<gt>\n"
8782 "#include E<lt>stdio.hE<gt>\n"
8783 "#include E<lt>stdlib.hE<gt>\n"
8784 "#include E<lt>unistd.hE<gt>\n"
8785 "#include E<lt>errno.hE<gt>\n"
8786
8787 #. type: Plain text
8788 #: build/C/man3/pthread_setschedparam.3:250
8789 #, no-wrap
8790 msgid ""
8791 "static void\n"
8792 "usage(char *prog_name, char *msg)\n"
8793 "{\n"
8794 "    if (msg != NULL)\n"
8795 "        fputs(msg, stderr);\n"
8796 msgstr ""
8797 "static void\n"
8798 "usage(char *prog_name, char *msg)\n"
8799 "{\n"
8800 "    if (msg != NULL)\n"
8801 "        fputs(msg, stderr);\n"
8802
8803 #. type: Plain text
8804 #: build/C/man3/pthread_setschedparam.3:267
8805 #, no-wrap
8806 msgid ""
8807 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
8808 "    fprintf(stderr, \"Options are:\\en\");\n"
8809 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
8810 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
8811 "    fpe(\"                 thread attributes object\\en\");\n"
8812 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8813 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8814 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8815 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8816 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8817 "    fpe(\"-i {e|i}         Set inherit scheduler attribute to\\en\");\n"
8818 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8819 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8820 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8821 "    exit(EXIT_FAILURE);\n"
8822 "}\n"
8823 msgstr ""
8824 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
8825 "    fprintf(stderr, \"Options are:\\en\");\n"
8826 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
8827 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
8828 "    fpe(\"                 thread attributes object\\en\");\n"
8829 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8830 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8831 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8832 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8833 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8834 "    fpe(\"-i {e|i}         Set inherit scheduler attribute to\\en\");\n"
8835 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8836 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8837 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8838 "    exit(EXIT_FAILURE);\n"
8839 "}\n"
8840
8841 #. type: Plain text
8842 #: build/C/man3/pthread_setschedparam.3:278
8843 #, no-wrap
8844 msgid ""
8845 "static int\n"
8846 "get_policy(char p, int *policy)\n"
8847 "{\n"
8848 "    switch (p) {\n"
8849 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8850 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8851 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8852 "    default:  return 0;\n"
8853 "    }\n"
8854 "}\n"
8855 msgstr ""
8856 "static int\n"
8857 "get_policy(char p, int *policy)\n"
8858 "{\n"
8859 "    switch (p) {\n"
8860 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8861 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8862 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8863 "    default:  return 0;\n"
8864 "    }\n"
8865 "}\n"
8866
8867 #. type: Plain text
8868 #: build/C/man3/pthread_setschedparam.3:289
8869 #, no-wrap
8870 msgid ""
8871 "static void\n"
8872 "display_sched_attr(int policy, struct sched_param *param)\n"
8873 "{\n"
8874 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8875 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8876 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8877 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8878 "            \"???\",\n"
8879 "            param-E<gt>sched_priority);\n"
8880 "}\n"
8881 msgstr ""
8882 "static void\n"
8883 "display_sched_attr(int policy, struct sched_param *param)\n"
8884 "{\n"
8885 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8886 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8887 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8888 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8889 "            \"???\",\n"
8890 "            param-E<gt>sched_priority);\n"
8891 "}\n"
8892
8893 #. type: Plain text
8894 #: build/C/man3/pthread_setschedparam.3:295
8895 #, no-wrap
8896 msgid ""
8897 "static void\n"
8898 "display_thread_sched_attr(char *msg)\n"
8899 "{\n"
8900 "    int policy, s;\n"
8901 "    struct sched_param param;\n"
8902 msgstr ""
8903 "static void\n"
8904 "display_thread_sched_attr(char *msg)\n"
8905 "{\n"
8906 "    int policy, s;\n"
8907 "    struct sched_param param;\n"
8908
8909 #. type: Plain text
8910 #: build/C/man3/pthread_setschedparam.3:299
8911 #, no-wrap
8912 msgid ""
8913 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8914 "    if (s != 0)\n"
8915 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8916 msgstr ""
8917 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8918 "    if (s != 0)\n"
8919 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8920
8921 #. type: Plain text
8922 #: build/C/man3/pthread_setschedparam.3:303
8923 #, no-wrap
8924 msgid ""
8925 "    printf(\"%s\\en\", msg);\n"
8926 "    display_sched_attr(policy, &param);\n"
8927 "}\n"
8928 msgstr ""
8929 "    printf(\"%s\\en\", msg);\n"
8930 "    display_sched_attr(policy, &param);\n"
8931 "}\n"
8932
8933 #. type: Plain text
8934 #: build/C/man3/pthread_setschedparam.3:308
8935 #, no-wrap
8936 msgid ""
8937 "static void *\n"
8938 "thread_start(void *arg)\n"
8939 "{\n"
8940 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8941 msgstr ""
8942 "static void *\n"
8943 "thread_start(void *arg)\n"
8944 "{\n"
8945 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8946
8947 #. type: Plain text
8948 #: build/C/man3/pthread_setschedparam.3:311
8949 #, no-wrap
8950 msgid ""
8951 "    return NULL;\n"
8952 "}\n"
8953 msgstr ""
8954 "    return NULL;\n"
8955 "}\n"
8956
8957 #. type: Plain text
8958 #: build/C/man3/pthread_setschedparam.3:321
8959 #, no-wrap
8960 msgid ""
8961 "int\n"
8962 "main(int argc, char *argv[])\n"
8963 "{\n"
8964 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
8965 "    pthread_t thread;\n"
8966 "    pthread_attr_t attr;\n"
8967 "    pthread_attr_t *attrp;\n"
8968 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
8969 "    struct sched_param param;\n"
8970 msgstr ""
8971 "int\n"
8972 "main(int argc, char *argv[])\n"
8973 "{\n"
8974 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
8975 "    pthread_t thread;\n"
8976 "    pthread_attr_t attr;\n"
8977 "    pthread_attr_t *attrp;\n"
8978 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
8979 "    struct sched_param param;\n"
8980
8981 #. type: Plain text
8982 #: build/C/man3/pthread_setschedparam.3:323
8983 #, no-wrap
8984 msgid "    /* Process command-line options */\n"
8985 msgstr "    /* Process command-line options */\n"
8986
8987 #. type: Plain text
8988 #: build/C/man3/pthread_setschedparam.3:328
8989 #, no-wrap
8990 msgid ""
8991 "    use_null_attrib = 0;\n"
8992 "    attr_sched_str = NULL;\n"
8993 "    main_sched_str = NULL;\n"
8994 "    inheritsched_str = NULL;\n"
8995 msgstr ""
8996 "    use_null_attrib = 0;\n"
8997 "    attr_sched_str = NULL;\n"
8998 "    main_sched_str = NULL;\n"
8999 "    inheritsched_str = NULL;\n"
9000
9001 #. type: Plain text
9002 #: build/C/man3/pthread_setschedparam.3:338
9003 #, no-wrap
9004 msgid ""
9005 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
9006 "        switch (opt) {\n"
9007 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
9008 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
9009 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
9010 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
9011 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
9012 "        }\n"
9013 "    }\n"
9014 msgstr ""
9015 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
9016 "        switch (opt) {\n"
9017 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
9018 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
9019 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
9020 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
9021 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
9022 "        }\n"
9023 "    }\n"
9024
9025 #. type: Plain text
9026 #: build/C/man3/pthread_setschedparam.3:342
9027 #, no-wrap
9028 msgid ""
9029 "    if (use_null_attrib &&\n"
9030 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
9031 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
9032 msgstr ""
9033 "    if (use_null_attrib &&\n"
9034 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
9035 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
9036
9037 #. type: Plain text
9038 #: build/C/man3/pthread_setschedparam.3:345
9039 #, no-wrap
9040 msgid ""
9041 "    /* Optionally set scheduling attributes of main thread,\n"
9042 "       and display the attributes */\n"
9043 msgstr ""
9044 "    /* Optionally set scheduling attributes of main thread,\n"
9045 "       and display the attributes */\n"
9046
9047 #. type: Plain text
9048 #: build/C/man3/pthread_setschedparam.3:350
9049 #, no-wrap
9050 msgid ""
9051 "    if (main_sched_str != NULL) {\n"
9052 "        if (!get_policy(main_sched_str[0], &policy))\n"
9053 "            usage(argv[0], \"Bad policy for main thread (-m)\\en\");\n"
9054 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
9055 msgstr ""
9056 "    if (main_sched_str != NULL) {\n"
9057 "        if (!get_policy(main_sched_str[0], &policy))\n"
9058 "            usage(argv[0], \"Bad policy for main thread (-m)\\en\");\n"
9059 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
9060
9061 #. type: Plain text
9062 #: build/C/man3/pthread_setschedparam.3:355
9063 #, no-wrap
9064 msgid ""
9065 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
9066 "        if (s != 0)\n"
9067 "            handle_error_en(s, \"pthread_setschedparam\");\n"
9068 "    }\n"
9069 msgstr ""
9070 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
9071 "        if (s != 0)\n"
9072 "            handle_error_en(s, \"pthread_setschedparam\");\n"
9073 "    }\n"
9074
9075 #. type: Plain text
9076 #: build/C/man3/pthread_setschedparam.3:358
9077 #, no-wrap
9078 msgid ""
9079 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
9080 "    printf(\"\\en\");\n"
9081 msgstr ""
9082 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
9083 "    printf(\"\\en\");\n"
9084
9085 #. type: Plain text
9086 #: build/C/man3/pthread_setschedparam.3:360
9087 #, no-wrap
9088 msgid "    /* Initialize thread attributes object according to options */\n"
9089 msgstr "    /* Initialize thread attributes object according to options */\n"
9090
9091 #. type: Plain text
9092 #: build/C/man3/pthread_setschedparam.3:369
9093 #, no-wrap
9094 msgid ""
9095 "    if (!use_null_attrib) {\n"
9096 "        s = pthread_attr_init(&attr);\n"
9097 "        if (s != 0)\n"
9098 "            handle_error_en(s, \"pthread_attr_init\");\n"
9099 "        attrp = &attr;\n"
9100 "    }\n"
9101 msgstr ""
9102 "    if (!use_null_attrib) {\n"
9103 "        s = pthread_attr_init(&attr);\n"
9104 "        if (s != 0)\n"
9105 "            handle_error_en(s, \"pthread_attr_init\");\n"
9106 "        attrp = &attr;\n"
9107 "    }\n"
9108
9109 #. type: Plain text
9110 #: build/C/man3/pthread_setschedparam.3:377
9111 #, no-wrap
9112 msgid ""
9113 "    if (inheritsched_str != NULL) {\n"
9114 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
9115 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
9116 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
9117 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
9118 "        else\n"
9119 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
9120 msgstr ""
9121 "    if (inheritsched_str != NULL) {\n"
9122 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
9123 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
9124 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
9125 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
9126 "        else\n"
9127 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
9128
9129 #. type: Plain text
9130 #: build/C/man3/pthread_setschedparam.3:382
9131 #, no-wrap
9132 msgid ""
9133 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
9134 "        if (s != 0)\n"
9135 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
9136 "    }\n"
9137 msgstr ""
9138 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
9139 "        if (s != 0)\n"
9140 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
9141 "    }\n"
9142
9143 #. type: Plain text
9144 #: build/C/man3/pthread_setschedparam.3:388
9145 #, no-wrap
9146 msgid ""
9147 "    if (attr_sched_str != NULL) {\n"
9148 "        if (!get_policy(attr_sched_str[0], &policy))\n"
9149 "            usage(argv[0],\n"
9150 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
9151 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
9152 msgstr ""
9153 "    if (attr_sched_str != NULL) {\n"
9154 "        if (!get_policy(attr_sched_str[0], &policy))\n"
9155 "            usage(argv[0],\n"
9156 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
9157 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
9158
9159 #. type: Plain text
9160 #: build/C/man3/pthread_setschedparam.3:396
9161 #, no-wrap
9162 msgid ""
9163 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
9164 "        if (s != 0)\n"
9165 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
9166 "        s = pthread_attr_setschedparam(&attr, &param);\n"
9167 "        if (s != 0)\n"
9168 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
9169 "    }\n"
9170 msgstr ""
9171 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
9172 "        if (s != 0)\n"
9173 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
9174 "        s = pthread_attr_setschedparam(&attr, &param);\n"
9175 "        if (s != 0)\n"
9176 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
9177 "    }\n"
9178
9179 #. type: Plain text
9180 #: build/C/man3/pthread_setschedparam.3:399
9181 #, no-wrap
9182 msgid ""
9183 "    /* If we initialized a thread attributes object, display\n"
9184 "       the scheduling attributes that were set in the object */\n"
9185 msgstr ""
9186 "    /* If we initialized a thread attributes object, display\n"
9187 "       the scheduling attributes that were set in the object */\n"
9188
9189 #. type: Plain text
9190 #: build/C/man3/pthread_setschedparam.3:407
9191 #, no-wrap
9192 msgid ""
9193 "    if (attrp != NULL) {\n"
9194 "        s = pthread_attr_getschedparam(&attr, &param);\n"
9195 "        if (s != 0)\n"
9196 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
9197 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
9198 "        if (s != 0)\n"
9199 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
9200 msgstr ""
9201 "    if (attrp != NULL) {\n"
9202 "        s = pthread_attr_getschedparam(&attr, &param);\n"
9203 "        if (s != 0)\n"
9204 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
9205 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
9206 "        if (s != 0)\n"
9207 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
9208
9209 #. type: Plain text
9210 #: build/C/man3/pthread_setschedparam.3:410
9211 #, no-wrap
9212 msgid ""
9213 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
9214 "        display_sched_attr(policy, &param);\n"
9215 msgstr ""
9216 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
9217 "        display_sched_attr(policy, &param);\n"
9218
9219 #. type: Plain text
9220 #: build/C/man3/pthread_setschedparam.3:418
9221 #, no-wrap
9222 msgid ""
9223 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
9224 "        printf(\"    inheritsched is %s\\en\",\n"
9225 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
9226 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
9227 "                \"???\");\n"
9228 "        printf(\"\\en\");\n"
9229 "    }\n"
9230 msgstr ""
9231 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
9232 "        printf(\"    inheritsched is %s\\en\",\n"
9233 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
9234 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
9235 "                \"???\");\n"
9236 "        printf(\"\\en\");\n"
9237 "    }\n"
9238
9239 #. type: Plain text
9240 #: build/C/man3/pthread_setschedparam.3:420
9241 #, no-wrap
9242 msgid "    /* Create a thread that will display its scheduling attributes */\n"
9243 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
9244
9245 #. type: Plain text
9246 #: build/C/man3/pthread_setschedparam.3:424
9247 #, no-wrap
9248 msgid ""
9249 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
9250 "    if (s != 0)\n"
9251 "        handle_error_en(s, \"pthread_create\");\n"
9252 msgstr ""
9253 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
9254 "    if (s != 0)\n"
9255 "        handle_error_en(s, \"pthread_create\");\n"
9256
9257 #. type: Plain text
9258 #: build/C/man3/pthread_setschedparam.3:426
9259 #, no-wrap
9260 msgid "    /* Destroy unneeded thread attributes object */\n"
9261 msgstr "    /* Destroy unneeded thread attributes object */\n"
9262
9263 #. type: Plain text
9264 #: build/C/man3/pthread_setschedparam.3:432
9265 #, no-wrap
9266 msgid ""
9267 "    if (!use_null_attrib) {\n"
9268 "      s = pthread_attr_destroy(&attr);\n"
9269 "      if (s != 0)\n"
9270 "          handle_error_en(s, \"pthread_attr_destroy\");\n"
9271 "    }\n"
9272 msgstr ""
9273 "    if (!use_null_attrib) {\n"
9274 "      s = pthread_attr_destroy(&attr);\n"
9275 "      if (s != 0)\n"
9276 "          handle_error_en(s, \"pthread_attr_destroy\");\n"
9277 "    }\n"
9278
9279 #. type: Plain text
9280 #: build/C/man3/pthread_setschedparam.3:436
9281 #, no-wrap
9282 msgid ""
9283 "    s = pthread_join(thread, NULL);\n"
9284 "    if (s != 0)\n"
9285 "        handle_error_en(s, \"pthread_join\");\n"
9286 msgstr ""
9287 "    s = pthread_join(thread, NULL);\n"
9288 "    if (s != 0)\n"
9289 "        handle_error_en(s, \"pthread_join\");\n"
9290
9291 #. type: Plain text
9292 #: build/C/man3/pthread_setschedparam.3:454
9293 msgid ""
9294 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9295 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9296 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9297 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
9298 msgstr ""
9299 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9300 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9301 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9302 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
9303
9304 #. type: TH
9305 #: build/C/man3/pthread_setschedprio.3:26
9306 #, no-wrap
9307 msgid "PTHREAD_SETSCHEDPRIO"
9308 msgstr "PTHREAD_SETSCHEDPRIO"
9309
9310 #. type: Plain text
9311 #: build/C/man3/pthread_setschedprio.3:29
9312 msgid "pthread_setschedprio - set scheduling priority of a thread"
9313 msgstr "pthread_setschedprio - スレッドのスケジューリング優先度を設定する"
9314
9315 #. type: Plain text
9316 #: build/C/man3/pthread_setschedprio.3:34
9317 #, no-wrap
9318 msgid "B<int pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
9319 msgstr "B<int pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
9320
9321 #.  FIXME . nptl/pthread_setschedprio.c has the following
9322 #.    /* If the thread should have higher priority because of some
9323 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
9324 #.  Eventually (perhaps after writing the mutexattr pages), we
9325 #.  may want to add something on the topic to this page.
9326 #.  nptl/pthread_setschedparam.c has a similar case.
9327 #. type: Plain text
9328 #: build/C/man3/pthread_setschedprio.3:53
9329 msgid ""
9330 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
9331 "thread I<thread> to the value specified in I<prio>.  (By contrast "
9332 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
9333 "of a thread.)"
9334 msgstr ""
9335 "B<pthread_setschedprio>() 関数は、スレッド I<thread> のスケジューリング\n"
9336 "優先度に I<prio> で指定された値を設定する\n"
9337 "(一方、B<pthread_setschedparam>(3) はスレッドのスケジューリングポリシー\n"
9338 "と優先度の両方を変更する)。"
9339
9340 #. type: Plain text
9341 #: build/C/man3/pthread_setschedprio.3:61
9342 msgid ""
9343 "On success, this function returns 0; on error, it returns a nonzero error "
9344 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
9345 "I<thread> is not changed."
9346 msgstr ""
9347 "成功すると、この関数は 0 を返す。\n"
9348 "エラーの場合、0 以外のエラー番号を返す。\n"
9349 "B<pthread_setschedprio>() が失敗した場合、 I<thread> の\n"
9350 "スケジューリング優先度は変更されない。"
9351
9352 #. type: Plain text
9353 #: build/C/man3/pthread_setschedprio.3:66
9354 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
9355 msgstr ""
9356 "指定されたスレッドのスケジューリングポリシーでは、 I<prio> は無効である。"
9357
9358 #. type: Plain text
9359 #: build/C/man3/pthread_setschedprio.3:70
9360 msgid ""
9361 "The caller does not have appropriate privileges to set the specified "
9362 "priority."
9363 msgstr "呼び出し側が、指定された優先度を設定するのに必要な特権を持っていない。"
9364
9365 #. type: Plain text
9366 #: build/C/man3/pthread_setschedprio.3:81
9367 msgid ""
9368 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
9369 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
9370 msgstr ""
9371 "POSIX.1-2001 では、 B<pthread_setschedprio>() に関して\n"
9372 "エラー B<ENOTSUP> (\"サポートされていない値を優先度\n"
9373 "に設定しようとした\") も追加で規定されている。"
9374
9375 #. type: Plain text
9376 #: build/C/man3/pthread_setschedprio.3:83
9377 msgid "This function is available in glibc since version 2.3.4."
9378 msgstr "この関数は glibc バージョン 2.3.4 以降で利用できる。"
9379
9380 #. type: Plain text
9381 #: build/C/man3/pthread_setschedprio.3:88
9382 msgid "The B<pthread_setschedprio>()  function is thread-safe."
9383 msgstr "B<pthread_setschedprio>() 関数はスレッドセーフである。"
9384
9385 #. type: Plain text
9386 #: build/C/man3/pthread_setschedprio.3:96
9387 msgid ""
9388 "For a description of the permissions required to, and the effect of, "
9389 "changing a thread's scheduling priority, and details of the permitted ranges "
9390 "for priorities in each scheduling policy, see B<sched>(7)."
9391 msgstr ""
9392 "スレッドのスケジューリング優先度を変更するために必要な許可や変更した場合の影"
9393 "響、および各スケジューリングポリシーで認められる優先度の範囲の詳細について"
9394 "は、 B<sched>(7) を参照。"
9395
9396 #. type: Plain text
9397 #: build/C/man3/pthread_setschedprio.3:110
9398 msgid ""
9399 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9400 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9401 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9402 "B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
9403 msgstr ""
9404 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9405 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9406 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9407 "B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
9408
9409 #. type: TH
9410 #: build/C/man3/pthread_sigmask.3:26
9411 #, no-wrap
9412 msgid "PTHREAD_SIGMASK"
9413 msgstr "PTHREAD_SIGMASK"
9414
9415 #. type: TH
9416 #: build/C/man3/pthread_sigmask.3:26 build/C/man3/pthread_testcancel.3:26
9417 #, no-wrap
9418 msgid "2014-05-19"
9419 msgstr "2014-05-19"
9420
9421 #. type: Plain text
9422 #: build/C/man3/pthread_sigmask.3:29
9423 msgid "pthread_sigmask - examine and change mask of blocked signals"
9424 msgstr "pthread_sigmask - 禁止するシグナルマスクの確認と変更を行う"
9425
9426 #. type: Plain text
9427 #: build/C/man3/pthread_sigmask.3:35
9428 #, no-wrap
9429 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9430 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9431
9432 #. type: Plain text
9433 #: build/C/man3/pthread_sigmask.3:46
9434 msgid "B<pthread_sigmask>():"
9435 msgstr "B<pthread_sigmask>():"
9436
9437 #. type: Plain text
9438 #: build/C/man3/pthread_sigmask.3:58
9439 msgid ""
9440 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
9441 "difference that its use in multithreaded programs is explicitly specified by "
9442 "POSIX.1-2001.  Other differences are noted in this page."
9443 msgstr ""
9444 "B<pthread_sigmask>() 関数は B<sigprocmask>(2) と全く同様だが、\n"
9445 "マルチスレッドプログラムでの利用が POSIX.1-2001 で明示的に規定されて\n"
9446 "いる点が異なる。他の違いはこのマニュアルページで説明する。"
9447
9448 #. type: Plain text
9449 #: build/C/man3/pthread_sigmask.3:61
9450 msgid ""
9451 "For a description of the arguments and operation of this function, see "
9452 "B<sigprocmask>(2)."
9453 msgstr "この関数の引き数と動作の説明は B<sigprocmask>(2) を参照。"
9454
9455 #. type: Plain text
9456 #: build/C/man3/pthread_sigmask.3:66
9457 msgid ""
9458 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
9459 "number."
9460 msgstr ""
9461 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9462 "エラーの場合、エラー番号を返す。"
9463
9464 #. type: Plain text
9465 #: build/C/man3/pthread_sigmask.3:69
9466 msgid "See B<sigprocmask>(2)."
9467 msgstr "B<sigprocmask>(2) を参照。"
9468
9469 #. type: Plain text
9470 #: build/C/man3/pthread_sigmask.3:74
9471 msgid "The B<pthread_sigmask>()  function is thread-safe."
9472 msgstr "B<pthread_sigmask>() 関数はスレッドセーフである。"
9473
9474 #. type: Plain text
9475 #: build/C/man3/pthread_sigmask.3:78
9476 msgid "A new thread inherits a copy of its creator's signal mask."
9477 msgstr ""
9478 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスクのコピーを\n"
9479 "継承する。"
9480
9481 #. type: Plain text
9482 #: build/C/man3/pthread_sigmask.3:83
9483 msgid ""
9484 "The program below blocks some signals in the main thread, and then creates a "
9485 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
9486 "shell session demonstrates its use:"
9487 msgstr ""
9488 "以下のプログラムは、メインスレッドでシグナルのいくつかを禁止 (block)\n"
9489 "するように設定を行い、 B<sigwait>(3) 経由でそれらのシグナルを集める\n"
9490 "専用のスレッドを作成する。\n"
9491 "下記のシェルのセッションはその利用例を示したものである。"
9492
9493 #. type: Plain text
9494 #: build/C/man3/pthread_sigmask.3:94
9495 #, no-wrap
9496 msgid ""
9497 "$B< ./a.out &>\n"
9498 "[1] 5423\n"
9499 "$B< kill -QUIT %1>\n"
9500 "Signal handling thread got signal 3\n"
9501 "$B< kill -USR1 %1>\n"
9502 "Signal handling thread got signal 10\n"
9503 "$B< kill -TERM %1>\n"
9504 "[1]+  Terminated              ./a.out\n"
9505 msgstr ""
9506 "$B< ./a.out &>\n"
9507 "[1] 5423\n"
9508 "$B< kill -QUIT %1>\n"
9509 "Signal handling thread got signal 3\n"
9510 "$B< kill -USR1 %1>\n"
9511 "Signal handling thread got signal 10\n"
9512 "$B< kill -TERM %1>\n"
9513 "[1]+  Terminated              ./a.out\n"
9514
9515 #. type: Plain text
9516 #: build/C/man3/pthread_sigmask.3:105
9517 #, no-wrap
9518 msgid ""
9519 "#include E<lt>pthread.hE<gt>\n"
9520 "#include E<lt>stdio.hE<gt>\n"
9521 "#include E<lt>stdlib.hE<gt>\n"
9522 "#include E<lt>unistd.hE<gt>\n"
9523 "#include E<lt>signal.hE<gt>\n"
9524 "#include E<lt>errno.hE<gt>\n"
9525 msgstr ""
9526 "#include E<lt>pthread.hE<gt>\n"
9527 "#include E<lt>stdio.hE<gt>\n"
9528 "#include E<lt>stdlib.hE<gt>\n"
9529 "#include E<lt>unistd.hE<gt>\n"
9530 "#include E<lt>signal.hE<gt>\n"
9531 "#include E<lt>errno.hE<gt>\n"
9532
9533 #. type: Plain text
9534 #: build/C/man3/pthread_sigmask.3:107
9535 #, no-wrap
9536 msgid "/* Simple error handling functions */\n"
9537 msgstr "/* Simple error handling functions */\n"
9538
9539 #. type: Plain text
9540 #: build/C/man3/pthread_sigmask.3:116
9541 #, no-wrap
9542 msgid ""
9543 "static void *\n"
9544 "sig_thread(void *arg)\n"
9545 "{\n"
9546 "    sigset_t *set = arg;\n"
9547 "    int s, sig;\n"
9548 msgstr ""
9549 "static void *\n"
9550 "sig_thread(void *arg)\n"
9551 "{\n"
9552 "    sigset_t *set = arg;\n"
9553 "    int s, sig;\n"
9554
9555 #. type: Plain text
9556 #: build/C/man3/pthread_sigmask.3:124
9557 #, no-wrap
9558 msgid ""
9559 "    for (;;) {\n"
9560 "        s = sigwait(set, &sig);\n"
9561 "        if (s != 0)\n"
9562 "            handle_error_en(s, \"sigwait\");\n"
9563 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
9564 "    }\n"
9565 "}\n"
9566 msgstr ""
9567 "    for (;;) {\n"
9568 "        s = sigwait(set, &sig);\n"
9569 "        if (s != 0)\n"
9570 "            handle_error_en(s, \"sigwait\");\n"
9571 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
9572 "    }\n"
9573 "}\n"
9574
9575 #. type: Plain text
9576 #: build/C/man3/pthread_sigmask.3:131
9577 #, no-wrap
9578 msgid ""
9579 "int\n"
9580 "main(int argc, char *argv[])\n"
9581 "{\n"
9582 "    pthread_t thread;\n"
9583 "    sigset_t set;\n"
9584 "    int s;\n"
9585 msgstr ""
9586 "int\n"
9587 "main(int argc, char *argv[])\n"
9588 "{\n"
9589 "    pthread_t thread;\n"
9590 "    sigset_t set;\n"
9591 "    int s;\n"
9592
9593 #. type: Plain text
9594 #: build/C/man3/pthread_sigmask.3:134
9595 #, no-wrap
9596 msgid ""
9597 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
9598 "       will inherit a copy of the signal mask. */\n"
9599 msgstr ""
9600 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
9601 "       will inherit a copy of the signal mask. */\n"
9602
9603 #. type: Plain text
9604 #: build/C/man3/pthread_sigmask.3:141
9605 #, no-wrap
9606 msgid ""
9607 "    sigemptyset(&set);\n"
9608 "    sigaddset(&set, SIGQUIT);\n"
9609 "    sigaddset(&set, SIGUSR1);\n"
9610 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
9611 "    if (s != 0)\n"
9612 "        handle_error_en(s, \"pthread_sigmask\");\n"
9613 msgstr ""
9614 "    sigemptyset(&set);\n"
9615 "    sigaddset(&set, SIGQUIT);\n"
9616 "    sigaddset(&set, SIGUSR1);\n"
9617 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
9618 "    if (s != 0)\n"
9619 "        handle_error_en(s, \"pthread_sigmask\");\n"
9620
9621 #. type: Plain text
9622 #: build/C/man3/pthread_sigmask.3:145
9623 #, no-wrap
9624 msgid ""
9625 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
9626 "    if (s != 0)\n"
9627 "        handle_error_en(s, \"pthread_create\");\n"
9628 msgstr ""
9629 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
9630 "    if (s != 0)\n"
9631 "        handle_error_en(s, \"pthread_create\");\n"
9632
9633 #. type: Plain text
9634 #: build/C/man3/pthread_sigmask.3:148
9635 #, no-wrap
9636 msgid ""
9637 "    /* Main thread carries on to create other threads and/or do\n"
9638 "       other work */\n"
9639 msgstr ""
9640 "    /* Main thread carries on to create other threads and/or do\n"
9641 "       other work */\n"
9642
9643 #. type: Plain text
9644 #: build/C/man3/pthread_sigmask.3:151
9645 #, no-wrap
9646 msgid ""
9647 "    pause();            /* Dummy pause so we can test program */\n"
9648 "}\n"
9649 msgstr ""
9650 "    pause();            /* Dummy pause so we can test program */\n"
9651 "}\n"
9652
9653 #. type: Plain text
9654 #: build/C/man3/pthread_sigmask.3:161
9655 msgid ""
9656 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), "
9657 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
9658 msgstr ""
9659 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), "
9660 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
9661
9662 #. type: TH
9663 #: build/C/man3/pthread_sigqueue.3:25
9664 #, no-wrap
9665 msgid "PTHREAD_SIGQUEUE"
9666 msgstr "PTHREAD_SIGQUEUE"
9667
9668 #. type: Plain text
9669 #: build/C/man3/pthread_sigqueue.3:28
9670 msgid "pthread_sigqueue - queue a signal and data to a thread"
9671 msgstr "pthread_sigqueue - スレッドに対するシグナルとデータをキューに入れる"
9672
9673 #. type: Plain text
9674 #: build/C/man3/pthread_sigqueue.3:32
9675 #, no-wrap
9676 msgid ""
9677 "B<#include E<lt>signal.hE<gt>>\n"
9678 "B<#include E<lt>pthread.hE<gt>>\n"
9679 msgstr ""
9680 "B<#include E<lt>signal.hE<gt>>\n"
9681 "B<#include E<lt>pthread.hE<gt>>\n"
9682
9683 #. type: Plain text
9684 #: build/C/man3/pthread_sigqueue.3:35
9685 #, no-wrap
9686 msgid ""
9687 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
9688 "B<                     const union sigval >I<value>B<);>\n"
9689 msgstr ""
9690 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
9691 "B<                     const union sigval >I<value>B<);>\n"
9692
9693 #. type: Plain text
9694 #: build/C/man3/pthread_sigqueue.3:46
9695 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
9696 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
9697
9698 #. type: Plain text
9699 #: build/C/man3/pthread_sigqueue.3:54
9700 msgid ""
9701 "The B<pthread_sigqueue>()  function performs a similar task to "
9702 "B<sigqueue>(3), but, rather than sending a signal to a process, it sends a "
9703 "signal to a thread in the same process as the calling thread."
9704 msgstr ""
9705 "B<pthread_sigqueue>() 関数は B<sigqueue>(3) と同様の処理を実行するが、\n"
9706 "プロセスにシグナルを送信するのではなく、呼び出したスレッドと\n"
9707 "同じプロセス内のスレッドにシグナルを送信する。"
9708
9709 #. type: Plain text
9710 #: build/C/man3/pthread_sigqueue.3:66
9711 msgid ""
9712 "The I<thread> argument is the ID of a thread in the same process as the "
9713 "caller.  The I<sig> argument specifies the signal to be sent.  The I<value> "
9714 "argument specifies data to accompany the signal; see B<sigqueue>(3)  for "
9715 "details."
9716 msgstr ""
9717 "I<thread> 引き数は、呼び出し側と同じプロセスのスレッドの ID である。\n"
9718 "I<sig> 引き数は送信するシグナルを指定する。\n"
9719 "I<value> 引き数はシグナルと一緒に渡すデータを指定する。\n"
9720 "詳細は B<sigqueue>(3) を参照。"
9721
9722 #. type: Plain text
9723 #: build/C/man3/pthread_sigqueue.3:71
9724 msgid ""
9725 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
9726 "number."
9727 msgstr ""
9728 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9729 "エラーの場合、エラー番号を返す。"
9730
9731 #. type: Plain text
9732 #: build/C/man3/pthread_sigqueue.3:78
9733 msgid ""
9734 "The limit of signals which may be queued has been reached.  (See "
9735 "B<signal>(7)  for further information.)"
9736 msgstr ""
9737 "キューに入れられるシグナル数が上限に達していた\n"
9738 "(詳しい情報は (B<signal>(7) を参照)。"
9739
9740 #. type: Plain text
9741 #: build/C/man3/pthread_sigqueue.3:82
9742 msgid "I<sig> was invalid."
9743 msgstr "I<sig> が無効であった。"
9744
9745 #. type: TP
9746 #: build/C/man3/pthread_sigqueue.3:82
9747 #, no-wrap
9748 msgid "B<ENOSYS>"
9749 msgstr "B<ENOSYS>"
9750
9751 #. type: Plain text
9752 #: build/C/man3/pthread_sigqueue.3:86
9753 msgid "B<pthread_sigqueue>()  is not supported on this system."
9754 msgstr "B<pthread_sigqueue>() がこのシステムではサポートされていない。"
9755
9756 #. type: Plain text
9757 #: build/C/man3/pthread_sigqueue.3:90
9758 msgid "I<thread> is not valid."
9759 msgstr "I<thread> が無効である。"
9760
9761 #. type: Plain text
9762 #: build/C/man3/pthread_sigqueue.3:94
9763 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
9764 msgstr "B<pthread_sigqueue>() 関数は glibc 2.11 で初めて登場した。"
9765
9766 #. type: Plain text
9767 #: build/C/man3/pthread_sigqueue.3:99
9768 msgid "The B<pthread_sigqueue>()  function is thread-safe."
9769 msgstr "B<pthread_sigqueue>() 関数はスレッドセーフである。"
9770
9771 #. type: Plain text
9772 #: build/C/man3/pthread_sigqueue.3:101
9773 msgid "This function is a GNU extension."
9774 msgstr "この関数は GNU による拡張である。"
9775
9776 #. type: Plain text
9777 #: build/C/man3/pthread_sigqueue.3:109
9778 msgid ""
9779 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), "
9780 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
9781 msgstr ""
9782 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
9783 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
9784
9785 #. type: TH
9786 #: build/C/man3/pthread_testcancel.3:26
9787 #, no-wrap
9788 msgid "PTHREAD_TESTCANCEL"
9789 msgstr "PTHREAD_TESTCANCEL"
9790
9791 #. type: Plain text
9792 #: build/C/man3/pthread_testcancel.3:29
9793 msgid ""
9794 "pthread_testcancel - request delivery of any pending cancellation request"
9795 msgstr "pthread_testcancel - 処理待ちの取り消し要求の配送を要求する"
9796
9797 #. type: Plain text
9798 #: build/C/man3/pthread_testcancel.3:34
9799 #, no-wrap
9800 msgid "B<void pthread_testcancel(void);>\n"
9801 msgstr "B<void pthread_testcancel(void);>\n"
9802
9803 #. type: Plain text
9804 #: build/C/man3/pthread_testcancel.3:43
9805 msgid ""
9806 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
9807 "calling thread, so that a thread that is otherwise executing code that "
9808 "contains no cancellation points will respond to a cancellation request."
9809 msgstr ""
9810 "B<pthread_testcancel>() を呼び出すと、呼び出したスレッド内に取り消し\n"
9811 "ポイント (cancellation point) が作成される。\n"
9812 "これにより、これ以外には取り消しポイントを含まないコードを実行して\n"
9813 "いるスレッドが取り消し要求に対応することができるようになる。"
9814
9815 #. type: Plain text
9816 #: build/C/man3/pthread_testcancel.3:50
9817 msgid ""
9818 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
9819 "cancellation request is pending, then a call to B<pthread_testcancel>()  has "
9820 "no effect."
9821 msgstr ""
9822 "(B<pthread_setcancelstate>(3) を使って) キャンセルが無効になっている\n"
9823 "場合や処理待ちの取り消し要求がない場合は、B<pthread_testcancel>() を\n"
9824 "呼び出しても何の影響もない。"
9825
9826 #. type: Plain text
9827 #: build/C/man3/pthread_testcancel.3:54
9828 msgid ""
9829 "This function does not return a value.  If the calling thread is canceled as "
9830 "a consequence of a call to this function, then the function does not return."
9831 msgstr ""
9832 "この関数は値を返さない。この関数の呼び出しの結果、呼び出したスレッドが\n"
9833 "キャンセルされた場合、この関数が返ることはない。"
9834
9835 #. type: Plain text
9836 #: build/C/man3/pthread_testcancel.3:63
9837 msgid "The B<pthread_testcancel>()  function is thread-safe."
9838 msgstr "B<pthread_testcancel>() 関数はスレッドセーフである。"
9839
9840 #. type: Plain text
9841 #: build/C/man3/pthread_testcancel.3:68
9842 msgid "See B<pthread_cleanup_push>(3)."
9843 msgstr "B<pthread_cleanup_push>(3) を参照。"
9844
9845 #. type: Plain text
9846 #: build/C/man3/pthread_testcancel.3:73
9847 msgid ""
9848 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9849 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
9850 msgstr ""
9851 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9852 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
9853
9854 #. type: TH
9855 #: build/C/man3/pthread_tryjoin_np.3:26
9856 #, no-wrap
9857 msgid "PTHREAD_TRYJOIN_NP"
9858 msgstr "PTHREAD_TRYJOIN_NP"
9859
9860 #. type: Plain text
9861 #: build/C/man3/pthread_tryjoin_np.3:30
9862 msgid ""
9863 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
9864 "thread"
9865 msgstr ""
9866 "pthread_tryjoin_np, pthread_timedjoin_np - 終了したスレッドの join を\n"
9867 "試みる"
9868
9869 #. type: Plain text
9870 #: build/C/man3/pthread_tryjoin_np.3:36
9871 #, no-wrap
9872 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9873 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9874
9875 #. type: Plain text
9876 #: build/C/man3/pthread_tryjoin_np.3:39
9877 #, no-wrap
9878 msgid ""
9879 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9880 "B<                         const struct timespec *>I<abstime>B<);>\n"
9881 msgstr ""
9882 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9883 "B<                         const struct timespec *>I<abstime>B<);>\n"
9884
9885 #. type: Plain text
9886 #: build/C/man3/pthread_tryjoin_np.3:46
9887 msgid ""
9888 "These functions operate in the same way as B<pthread_join>(3), except for "
9889 "the differences described on this page."
9890 msgstr ""
9891 "これらの関数は B<pthread_join>(3) と同じように動作するが、\n"
9892 "このページで説明する違いがある。"
9893
9894 #. type: Plain text
9895 #: build/C/man3/pthread_tryjoin_np.3:58
9896 msgid ""
9897 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
9898 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
9899 "I<thread> has not yet terminated, then instead of blocking, as is done by "
9900 "B<pthread_join>(3), the call returns an error."
9901 msgstr ""
9902 "B<pthread_tryjoin_np>() 関数は、スレッド I<thread> の非停止\n"
9903 "(nonblocking) での join を実行し、スレッドの終了ステータスを\n"
9904 "I<*retval> に入れて返す。I<thread> がまだ終了していない場合は、\n"
9905 "B<pthread_join>(3) のように停止 (block) せずに、エラーを返す。"
9906
9907 #. type: Plain text
9908 #: build/C/man3/pthread_tryjoin_np.3:76
9909 msgid ""
9910 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
9911 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
9912 "specified in I<abstime>.  If the timeout expires before I<thread> "
9913 "terminates, the call returns an error.  The I<abstime> argument is a "
9914 "structure of the following form, specifying an absolute time measured since "
9915 "the Epoch (see B<time>(2)):"
9916 msgstr ""
9917 "B<pthread_timedjoin_np>() 関数は、タイムアウト付きの join を行う。\n"
9918 "I<thread> がまだ終了していない場合、 I<abstime> で指定された最大時間\n"
9919 "まで停止する。 I<thread> が終了する前にタイムアウト時間が経過した場合は、\n"
9920 "エラーを返す。I<abstime> 引き数は以下に示す構造体であり、\n"
9921 "Epoch (時刻紀元; B<time>(2) 参照) から測った絶対時刻を指定する。"
9922
9923 #. type: Plain text
9924 #: build/C/man3/pthread_tryjoin_np.3:83
9925 #, no-wrap
9926 msgid ""
9927 "struct timespec {\n"
9928 "    time_t tv_sec;     /* seconds */\n"
9929 "    long   tv_nsec;    /* nanoseconds */\n"
9930 "};\n"
9931 msgstr ""
9932 "struct timespec {\n"
9933 "    time_t tv_sec;     /* seconds */\n"
9934 "    long   tv_nsec;    /* nanoseconds */\n"
9935 "};\n"
9936
9937 #. type: Plain text
9938 #: build/C/man3/pthread_tryjoin_np.3:89
9939 msgid ""
9940 "On success, these functions return 0; on error, they return an error number."
9941 msgstr ""
9942 "成功すると、これらの関数は 0 を返す。\n"
9943 "エラーの場合、エラー番号を返す。"
9944
9945 #. type: Plain text
9946 #: build/C/man3/pthread_tryjoin_np.3:94
9947 msgid ""
9948 "These functions can fail with the same errors as B<pthread_join>(3).  "
9949 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
9950 msgstr ""
9951 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
9952 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
9953
9954 #. type: TP
9955 #: build/C/man3/pthread_tryjoin_np.3:94
9956 #, no-wrap
9957 msgid "B<EBUSY>"
9958 msgstr "B<EBUSY>"
9959
9960 #. type: Plain text
9961 #: build/C/man3/pthread_tryjoin_np.3:98
9962 msgid "I<thread> had not yet terminated at the time of the call."
9963 msgstr "呼び出しを行った時点では I<thread> はまだ終了していない。"
9964
9965 #. type: Plain text
9966 #: build/C/man3/pthread_tryjoin_np.3:101
9967 msgid ""
9968 "B<pthread_timedjoin_np>()  can in addition fail with the following error:"
9969 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
9970
9971 #. type: TP
9972 #: build/C/man3/pthread_tryjoin_np.3:101
9973 #, no-wrap
9974 msgid "B<ETIMEDOUT>"
9975 msgstr "B<ETIMEDOUT>"
9976
9977 #. type: Plain text
9978 #: build/C/man3/pthread_tryjoin_np.3:106
9979 msgid "The call timed out before I<thread> terminated."
9980 msgstr "I<thread> が終了する前に呼び出しがタイムアウトとなった。"
9981
9982 #. type: Plain text
9983 #: build/C/man3/pthread_tryjoin_np.3:110
9984 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
9985 msgstr "B<pthread_timedjoin_np>() がエラー B<EINTR> を返すことはない。"
9986
9987 #. type: Plain text
9988 #: build/C/man3/pthread_tryjoin_np.3:112
9989 msgid "These functions first appeared in glibc in version 2.3.3."
9990 msgstr "これらの関数は glibc バージョン 2.3.3 で初めて登場した。"
9991
9992 #. type: Plain text
9993 #: build/C/man3/pthread_tryjoin_np.3:117
9994 msgid "The following code waits to join for up to 5 seconds:"
9995 msgstr "以下のコードは、最大 5 秒まで join を待つ。"
9996
9997 #. type: Plain text
9998 #: build/C/man3/pthread_tryjoin_np.3:121
9999 #, no-wrap
10000 msgid ""
10001 "    struct timespec ts;\n"
10002 "    int s;\n"
10003 msgstr ""
10004 "    struct timespec ts;\n"
10005 "    int s;\n"
10006
10007 #. type: Plain text
10008 #: build/C/man3/pthread_tryjoin_np.3:123
10009 #, no-wrap
10010 msgid "    ...\n"
10011 msgstr "    ...\n"
10012
10013 #. type: Plain text
10014 #: build/C/man3/pthread_tryjoin_np.3:127
10015 #, no-wrap
10016 msgid ""
10017 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
10018 "\t/* Handle error */\n"
10019 "    }\n"
10020 msgstr ""
10021 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
10022 "\t/* Handle error */\n"
10023 "    }\n"
10024
10025 #. type: Plain text
10026 #: build/C/man3/pthread_tryjoin_np.3:129
10027 #, no-wrap
10028 msgid "    ts.tv_sec += 5;\n"
10029 msgstr "    ts.tv_sec += 5;\n"
10030
10031 #. type: Plain text
10032 #: build/C/man3/pthread_tryjoin_np.3:134
10033 #, no-wrap
10034 msgid ""
10035 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
10036 "    if (s != 0) {\n"
10037 "        /* Handle error */\n"
10038 "    }\n"
10039 msgstr ""
10040 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
10041 "    if (s != 0) {\n"
10042 "        /* Handle error */\n"
10043 "    }\n"
10044
10045 #. type: Plain text
10046 #: build/C/man3/pthread_tryjoin_np.3:140
10047 msgid ""
10048 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
10049 msgstr ""
10050 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
10051
10052 #. type: TH
10053 #: build/C/man3/pthread_yield.3:25
10054 #, no-wrap
10055 msgid "PTHREAD_YIELD"
10056 msgstr "PTHREAD_YIELD"
10057
10058 #. type: Plain text
10059 #: build/C/man3/pthread_yield.3:28
10060 msgid "pthread_yield - yield the processor"
10061 msgstr "pthread_yield - プロセッサを明け渡す (yield)"
10062
10063 #. type: Plain text
10064 #: build/C/man3/pthread_yield.3:34
10065 #, no-wrap
10066 msgid "B<int pthread_yield(void);>\n"
10067 msgstr "B<int pthread_yield(void);>\n"
10068
10069 #. type: Plain text
10070 #: build/C/man3/pthread_yield.3:44
10071 msgid ""
10072 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
10073 "thread is placed at the end of the run queue for its static priority and "
10074 "another thread is scheduled to run.  For further details, see "
10075 "B<sched_yield>(2)"
10076 msgstr ""
10077 "B<pthread_yield>() を呼び出すと、呼び出したスレッドは CPU を手放す。\n"
10078 "スレッドはそのスレッドの静的優先度の実行キューの末尾に回り、\n"
10079 "別のスレッドが実行されるようにスケジューリングされる。\n"
10080 "詳細は B<sched_yield>(2) を参照。"
10081
10082 #. type: Plain text
10083 #: build/C/man3/pthread_yield.3:49
10084 msgid ""
10085 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
10086 "number."
10087 msgstr ""
10088 "成功すると、 B<pthread_yield>() は 0 を返す。\n"
10089 "エラーの場合、エラー番号を返す。"
10090
10091 #. type: Plain text
10092 #: build/C/man3/pthread_yield.3:53
10093 msgid ""
10094 "On Linux, this call always succeeds (but portable and future-proof "
10095 "applications should nevertheless handle a possible error return)."
10096 msgstr ""
10097 "Linux では、この関数の呼び出しは常に成功する\n"
10098 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
10099 "正のエラーの返り値を処理するようにすべきである)。"
10100
10101 #. type: Plain text
10102 #: build/C/man3/pthread_yield.3:58
10103 msgid "The B<pthread_yield>()  function is thread-safe."
10104 msgstr "B<pthread_yield>() 関数はスレッドセーフである。"
10105
10106 #.  e.g., the BSDs, Tru64, AIX, and Irix.
10107 #. type: Plain text
10108 #: build/C/man3/pthread_yield.3:64
10109 msgid ""
10110 "This call is nonstandard, but present on several other systems.  Use the "
10111 "standardized B<sched_yield>(2)  instead."
10112 msgstr ""
10113 "この関数は非標準だが、他のいくつかのシステムにも存在する。\n"
10114 "代わりに、標準化されている B<sched_yield>(2) を使うこと。"
10115
10116 #. type: Plain text
10117 #: build/C/man3/pthread_yield.3:67
10118 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
10119 msgstr ""
10120 "Linux では、この関数は B<sched_yield>(2) を呼び出す形で実装されている。"
10121
10122 #. type: Plain text
10123 #: build/C/man3/pthread_yield.3:71
10124 msgid "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
10125 msgstr "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
10126
10127 #. type: TH
10128 #: build/C/man7/pthreads.7:26
10129 #, no-wrap
10130 msgid "PTHREADS"
10131 msgstr "PTHREADS"
10132
10133 #. type: Plain text
10134 #: build/C/man7/pthreads.7:29
10135 msgid "pthreads - POSIX threads"
10136 msgstr "pthreads - POSIX スレッド"
10137
10138 #. type: Plain text
10139 #: build/C/man7/pthreads.7:36
10140 msgid ""
10141 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
10142 "programming commonly known as POSIX threads, or Pthreads.  A single process "
10143 "can contain multiple threads, all of which are executing the same program.  "
10144 "These threads share the same global memory (data and heap segments), but "
10145 "each thread has its own stack (automatic variables)."
10146 msgstr ""
10147 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
10148 "ラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロ"
10149 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
10150 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
10151 "スレッドは自分専用のスタック (自動変数) を持つ。"
10152
10153 #. type: Plain text
10154 #: build/C/man7/pthreads.7:39
10155 msgid ""
10156 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
10157 "these attributes are process-wide rather than per-thread):"
10158 msgstr ""
10159 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
10160 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
10161
10162 #. type: IP
10163 #: build/C/man7/pthreads.7:39 build/C/man7/pthreads.7:41
10164 #: build/C/man7/pthreads.7:43 build/C/man7/pthreads.7:45
10165 #: build/C/man7/pthreads.7:47 build/C/man7/pthreads.7:49
10166 #: build/C/man7/pthreads.7:51 build/C/man7/pthreads.7:54
10167 #: build/C/man7/pthreads.7:56 build/C/man7/pthreads.7:59
10168 #: build/C/man7/pthreads.7:65 build/C/man7/pthreads.7:70
10169 #: build/C/man7/pthreads.7:73 build/C/man7/pthreads.7:76
10170 #: build/C/man7/pthreads.7:84 build/C/man7/pthreads.7:88
10171 #: build/C/man7/pthreads.7:91 build/C/man7/pthreads.7:95
10172 #: build/C/man7/pthreads.7:98 build/C/man7/pthreads.7:103
10173 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
10174 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
10175 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
10176 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
10177 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
10178 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
10179 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
10180 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
10181 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
10182 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
10183 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
10184 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
10185 #: build/C/man7/pthreads.7:833
10186 #, no-wrap
10187 msgid "-"
10188 msgstr "-"
10189
10190 #. type: Plain text
10191 #: build/C/man7/pthreads.7:41
10192 msgid "process ID"
10193 msgstr "プロセス ID"
10194
10195 #. type: Plain text
10196 #: build/C/man7/pthreads.7:43
10197 msgid "parent process ID"
10198 msgstr "親プロセス ID"
10199
10200 #. type: Plain text
10201 #: build/C/man7/pthreads.7:45
10202 msgid "process group ID and session ID"
10203 msgstr "プロセスグループ ID とセッション ID"
10204
10205 #. type: Plain text
10206 #: build/C/man7/pthreads.7:47
10207 msgid "controlling terminal"
10208 msgstr "制御端末"
10209
10210 #. type: Plain text
10211 #: build/C/man7/pthreads.7:49
10212 msgid "user and group IDs"
10213 msgstr "ユーザ ID とグループ ID"
10214
10215 #. type: Plain text
10216 #: build/C/man7/pthreads.7:51
10217 msgid "open file descriptors"
10218 msgstr "オープンするファイルディスクリプタ"
10219
10220 #. type: Plain text
10221 #: build/C/man7/pthreads.7:54
10222 msgid "record locks (see B<fcntl>(2))"
10223 msgstr "レコードのロック (B<fcntl>(3)  参照)"
10224
10225 #. type: Plain text
10226 #: build/C/man7/pthreads.7:56
10227 msgid "signal dispositions"
10228 msgstr "シグナルの配置"
10229
10230 #. type: Plain text
10231 #: build/C/man7/pthreads.7:59
10232 msgid "file mode creation mask (B<umask>(2))"
10233 msgstr "ファイルモード作成マスク (B<umask>(2))"
10234
10235 #. type: Plain text
10236 #: build/C/man7/pthreads.7:65
10237 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
10238 msgstr ""
10239 "カレント・ディレクトリ (B<chdir>(2))  とルート・ディレクトリ (B<chroot>(2))"
10240
10241 #. type: Plain text
10242 #: build/C/man7/pthreads.7:70
10243 msgid ""
10244 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
10245 msgstr ""
10246 "インターバル・タイマ (B<setitimer>(2))  と POSIX タイマ (B<timer_create>(2))"
10247
10248 #. type: Plain text
10249 #: build/C/man7/pthreads.7:73
10250 msgid "nice value (B<setpriority>(2))"
10251 msgstr "nice 値 (B<setpriority>(2))"
10252
10253 #. type: Plain text
10254 #: build/C/man7/pthreads.7:76
10255 msgid "resource limits (B<setrlimit>(2))"
10256 msgstr "リソース制限 (B<setrlimit>(2))"
10257
10258 #. type: Plain text
10259 #: build/C/man7/pthreads.7:81
10260 msgid ""
10261 "measurements of the consumption of CPU time (B<times>(2))  and resources "
10262 "(B<getrusage>(2))"
10263 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
10264
10265 #. type: Plain text
10266 #: build/C/man7/pthreads.7:84
10267 msgid ""
10268 "As well as the stack, POSIX.1 specifies that various other attributes are "
10269 "distinct for each thread, including:"
10270 msgstr ""
10271 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
10272 "るかを規定している:"
10273
10274 #. type: Plain text
10275 #: build/C/man7/pthreads.7:88
10276 msgid "thread ID (the I<pthread_t> data type)"
10277 msgstr "スレッド ID (B<pthread_t> データ型)"
10278
10279 #. type: Plain text
10280 #: build/C/man7/pthreads.7:91
10281 msgid "signal mask (B<pthread_sigmask>(3))"
10282 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
10283
10284 #. type: Plain text
10285 #: build/C/man7/pthreads.7:95
10286 msgid "the I<errno> variable"
10287 msgstr "I<errno> 変数"
10288
10289 #. type: Plain text
10290 #: build/C/man7/pthreads.7:98
10291 msgid "alternate signal stack (B<sigaltstack>(2))"
10292 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
10293
10294 #. type: Plain text
10295 #: build/C/man7/pthreads.7:101
10296 msgid "real-time scheduling policy and priority (B<sched>(7))"
10297 msgstr "リアルタイム・スケジューリングのポリシーと優先度 (B<sched>(7))"
10298
10299 #. type: Plain text
10300 #: build/C/man7/pthreads.7:103
10301 msgid "The following Linux-specific features are also per-thread:"
10302 msgstr "以下の Linux 特有の機能もスレッド単位である:"
10303
10304 #. type: Plain text
10305 #: build/C/man7/pthreads.7:106
10306 msgid "capabilities (see B<capabilities>(7))"
10307 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
10308
10309 #. type: Plain text
10310 #: build/C/man7/pthreads.7:109
10311 msgid "CPU affinity (B<sched_setaffinity>(2))"
10312 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
10313
10314 #. type: SS
10315 #: build/C/man7/pthreads.7:109
10316 #, no-wrap
10317 msgid "Pthreads function return values"
10318 msgstr "pthreads 関数の返り値"
10319
10320 #. type: Plain text
10321 #: build/C/man7/pthreads.7:116
10322 msgid ""
10323 "Most pthreads functions return 0 on success, and an error number of "
10324 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
10325 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
10326 "the function can never fail with the error B<EINTR>."
10327 msgstr ""
10328 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
10329 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
10330 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
10331 "は決してないと規定している。"
10332
10333 #. type: SS
10334 #: build/C/man7/pthreads.7:116
10335 #, no-wrap
10336 msgid "Thread IDs"
10337 msgstr "スレッド ID"
10338
10339 #. type: Plain text
10340 #: build/C/man7/pthreads.7:130
10341 msgid ""
10342 "Each of the threads in a process has a unique thread identifier (stored in "
10343 "the type I<pthread_t>).  This identifier is returned to the caller of "
10344 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
10345 "using B<pthread_self>(3).  Thread IDs are guaranteed to be unique only "
10346 "within a process.  A thread ID may be reused after a terminated thread has "
10347 "been joined, or a detached thread has terminated.  In all pthreads functions "
10348 "that accept a thread ID as an argument, that ID by definition refers to a "
10349 "thread in the same process as the caller."
10350 msgstr ""
10351 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
10352 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
10353 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
10354 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
10355 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
10356 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
10357 "じプロセス内の一つのスレッドを参照する。"
10358
10359 #. type: SS
10360 #: build/C/man7/pthreads.7:130
10361 #, no-wrap
10362 msgid "Thread-safe functions"
10363 msgstr "スレッドセーフな関数"
10364
10365 #. type: Plain text
10366 #: build/C/man7/pthreads.7:134
10367 msgid ""
10368 "A thread-safe function is one that can be safely (i.e., it will deliver the "
10369 "same results regardless of whether it is)  called from multiple threads at "
10370 "the same time."
10371 msgstr ""
10372 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
10373 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
10374
10375 #. type: Plain text
10376 #: build/C/man7/pthreads.7:138
10377 msgid ""
10378 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
10379 "standard shall be thread-safe, except for the following functions:"
10380 msgstr ""
10381 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
10382 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
10383
10384 #. type: Plain text
10385 #: build/C/man7/pthreads.7:232
10386 #, no-wrap
10387 msgid ""
10388 "asctime()\n"
10389 "basename()\n"
10390 "catgets()\n"
10391 "crypt()\n"
10392 "ctermid() if passed a non-NULL argument\n"
10393 "ctime()\n"
10394 "dbm_clearerr()\n"
10395 "dbm_close()\n"
10396 "dbm_delete()\n"
10397 "dbm_error()\n"
10398 "dbm_fetch()\n"
10399 "dbm_firstkey()\n"
10400 "dbm_nextkey()\n"
10401 "dbm_open()\n"
10402 "dbm_store()\n"
10403 "dirname()\n"
10404 "dlerror()\n"
10405 "drand48()\n"
10406 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10407 "encrypt()\n"
10408 "endgrent()\n"
10409 "endpwent()\n"
10410 "endutxent()\n"
10411 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10412 "ftw()\n"
10413 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10414 "getc_unlocked()\n"
10415 "getchar_unlocked()\n"
10416 "getdate()\n"
10417 "getenv()\n"
10418 "getgrent()\n"
10419 "getgrgid()\n"
10420 "getgrnam()\n"
10421 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10422 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10423 "gethostent()\n"
10424 "getlogin()\n"
10425 "getnetbyaddr()\n"
10426 "getnetbyname()\n"
10427 "getnetent()\n"
10428 "getopt()\n"
10429 "getprotobyname()\n"
10430 "getprotobynumber()\n"
10431 "getprotoent()\n"
10432 "getpwent()\n"
10433 "getpwnam()\n"
10434 "getpwuid()\n"
10435 "getservbyname()\n"
10436 "getservbyport()\n"
10437 "getservent()\n"
10438 "getutxent()\n"
10439 "getutxid()\n"
10440 "getutxline()\n"
10441 "gmtime()\n"
10442 "hcreate()\n"
10443 "hdestroy()\n"
10444 "hsearch()\n"
10445 "inet_ntoa()\n"
10446 "l64a()\n"
10447 "lgamma()\n"
10448 "lgammaf()\n"
10449 "lgammal()\n"
10450 "localeconv()\n"
10451 "localtime()\n"
10452 "lrand48()\n"
10453 "mrand48()\n"
10454 "nftw()\n"
10455 "nl_langinfo()\n"
10456 "ptsname()\n"
10457 "putc_unlocked()\n"
10458 "putchar_unlocked()\n"
10459 "putenv()\n"
10460 "pututxline()\n"
10461 "rand()\n"
10462 "readdir()\n"
10463 "setenv()\n"
10464 "setgrent()\n"
10465 "setkey()\n"
10466 "setpwent()\n"
10467 "setutxent()\n"
10468 "strerror()\n"
10469 "strsignal() [Added in POSIX.1-2008]\n"
10470 "strtok()\n"
10471 "system() [Added in POSIX.1-2008]\n"
10472 "tmpnam() if passed a non-NULL argument\n"
10473 "ttyname()\n"
10474 "unsetenv()\n"
10475 "wcrtomb() if its final argument is NULL\n"
10476 "wcsrtombs() if its final argument is NULL\n"
10477 "wcstombs()\n"
10478 "wctomb()\n"
10479 msgstr ""
10480 "asctime()\n"
10481 "basename()\n"
10482 "catgets()\n"
10483 "crypt()\n"
10484 "ctermid() (NULL でない引き数を渡された場合)\n"
10485 "ctime()\n"
10486 "dbm_clearerr()\n"
10487 "dbm_close()\n"
10488 "dbm_delete()\n"
10489 "dbm_error()\n"
10490 "dbm_fetch()\n"
10491 "dbm_firstkey()\n"
10492 "dbm_nextkey()\n"
10493 "dbm_open()\n"
10494 "dbm_store()\n"
10495 "dirname()\n"
10496 "dlerror()\n"
10497 "drand48()\n"
10498 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10499 "encrypt()\n"
10500 "endgrent()\n"
10501 "endpwent()\n"
10502 "endutxent()\n"
10503 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10504 "ftw()\n"
10505 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10506 "getc_unlocked()\n"
10507 "getchar_unlocked()\n"
10508 "getdate()\n"
10509 "getenv()\n"
10510 "getgrent()\n"
10511 "getgrgid()\n"
10512 "getgrnam()\n"
10513 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10514 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10515 "gethostent()\n"
10516 "getlogin()\n"
10517 "getnetbyaddr()\n"
10518 "getnetbyname()\n"
10519 "getnetent()\n"
10520 "getopt()\n"
10521 "getprotobyname()\n"
10522 "getprotobynumber()\n"
10523 "getprotoent()\n"
10524 "getpwent()\n"
10525 "getpwnam()\n"
10526 "getpwuid()\n"
10527 "getservbyname()\n"
10528 "getservbyport()\n"
10529 "getservent()\n"
10530 "getutxent()\n"
10531 "getutxid()\n"
10532 "getutxline()\n"
10533 "gmtime()\n"
10534 "hcreate()\n"
10535 "hdestroy()\n"
10536 "hsearch()\n"
10537 "inet_ntoa()\n"
10538 "l64a()\n"
10539 "lgamma()\n"
10540 "lgammaf()\n"
10541 "lgammal()\n"
10542 "localeconv()\n"
10543 "localtime()\n"
10544 "lrand48()\n"
10545 "mrand48()\n"
10546 "nftw()\n"
10547 "nl_langinfo()\n"
10548 "ptsname()\n"
10549 "putc_unlocked()\n"
10550 "putchar_unlocked()\n"
10551 "putenv()\n"
10552 "pututxline()\n"
10553 "rand()\n"
10554 "readdir()\n"
10555 "setenv()\n"
10556 "setgrent()\n"
10557 "setkey()\n"
10558 "setpwent()\n"
10559 "setutxent()\n"
10560 "strerror()\n"
10561 "strsignal() [POSIX.1-2008 で追加された]\n"
10562 "strtok()\n"
10563 "system() [POSIX.1-2008 で追加された]\n"
10564 "tmpnam() (NULL でない引き数を渡された場合)\n"
10565 "ttyname()\n"
10566 "unsetenv()\n"
10567 "wcrtomb() (最後の引き数が NULL の場合)\n"
10568 "wcsrtombs() (最後の引き数が NULL の場合)\n"
10569 "wcstombs()\n"
10570 "wctomb()\n"
10571
10572 #. type: SS
10573 #: build/C/man7/pthreads.7:234
10574 #, no-wrap
10575 msgid "Async-cancel-safe functions"
10576 msgstr "async-cancel-safe 関数"
10577
10578 #. type: Plain text
10579 #: build/C/man7/pthreads.7:238
10580 msgid ""
10581 "An async-cancel-safe function is one that can be safely called in an "
10582 "application where asynchronous cancelability is enabled (see "
10583 "B<pthread_setcancelstate>(3))."
10584 msgstr ""
10585 "async-cancel-safe 関数は、\n"
10586 "非同期キャンセル機能が有効になっているアプリケーションで\n"
10587 "安全に呼び出すことができる関数のことである\n"
10588 "(B<pthread_setcancelstate>(3) を参照)。"
10589
10590 #. type: Plain text
10591 #: build/C/man7/pthreads.7:241
10592 msgid ""
10593 "Only the following functions are required to be async-cancel-safe by "
10594 "POSIX.1-2001 and POSIX.1-2008:"
10595 msgstr ""
10596 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
10597 "なければならないとされている。"
10598
10599 #. type: Plain text
10600 #: build/C/man7/pthreads.7:247
10601 #, no-wrap
10602 msgid ""
10603 "pthread_cancel()\n"
10604 "pthread_setcancelstate()\n"
10605 "pthread_setcanceltype()\n"
10606 msgstr ""
10607 "pthread_cancel()\n"
10608 "pthread_setcancelstate()\n"
10609 "pthread_setcanceltype()\n"
10610
10611 #. type: SS
10612 #: build/C/man7/pthreads.7:249
10613 #, no-wrap
10614 msgid "Cancellation points"
10615 msgstr "取り消しポイント (cancellation points)"
10616
10617 #. type: Plain text
10618 #: build/C/man7/pthreads.7:256
10619 msgid ""
10620 "POSIX.1 specifies that certain functions must, and certain other functions "
10621 "may, be cancellation points.  If a thread is cancelable, its cancelability "
10622 "type is deferred, and a cancellation request is pending for the thread, then "
10623 "the thread is canceled when it calls a function that is a cancellation point."
10624 msgstr ""
10625 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
10626 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
10627 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
10628 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
10629 "時点で、そのスレッドのキャンセルが 行われる。"
10630
10631 #. type: Plain text
10632 #: build/C/man7/pthreads.7:259
10633 msgid ""
10634 "The following functions are required to be cancellation points by "
10635 "POSIX.1-2001 and/or POSIX.1-2008:"
10636 msgstr ""
10637 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
10638 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
10639
10640 #. type: Plain text
10641 #: build/C/man7/pthreads.7:322
10642 #, no-wrap
10643 msgid ""
10644 "accept()\n"
10645 "aio_suspend()\n"
10646 "clock_nanosleep()\n"
10647 "close()\n"
10648 "connect()\n"
10649 "creat()\n"
10650 "fcntl() F_SETLKW\n"
10651 "fdatasync()\n"
10652 "fsync()\n"
10653 "getmsg()\n"
10654 "getpmsg()\n"
10655 "lockf() F_LOCK\n"
10656 "mq_receive()\n"
10657 "mq_send()\n"
10658 "mq_timedreceive()\n"
10659 "mq_timedsend()\n"
10660 "msgrcv()\n"
10661 "msgsnd()\n"
10662 "msync()\n"
10663 "nanosleep()\n"
10664 "open()\n"
10665 "openat() [Added in POSIX.1-2008]\n"
10666 "pause()\n"
10667 "poll()\n"
10668 "pread()\n"
10669 "pselect()\n"
10670 "pthread_cond_timedwait()\n"
10671 "pthread_cond_wait()\n"
10672 "pthread_join()\n"
10673 "pthread_testcancel()\n"
10674 "putmsg()\n"
10675 "putpmsg()\n"
10676 "pwrite()\n"
10677 "read()\n"
10678 "readv()\n"
10679 "recv()\n"
10680 "recvfrom()\n"
10681 "recvmsg()\n"
10682 "select()\n"
10683 "sem_timedwait()\n"
10684 "sem_wait()\n"
10685 "send()\n"
10686 "sendmsg()\n"
10687 "sendto()\n"
10688 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
10689 "sigsuspend()\n"
10690 "sigtimedwait()\n"
10691 "sigwait()\n"
10692 "sigwaitinfo()\n"
10693 "sleep()\n"
10694 "system()\n"
10695 "tcdrain()\n"
10696 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10697 "wait()\n"
10698 "waitid()\n"
10699 "waitpid()\n"
10700 "write()\n"
10701 "writev()\n"
10702 msgstr ""
10703 "accept()\n"
10704 "aio_suspend()\n"
10705 "clock_nanosleep()\n"
10706 "close()\n"
10707 "connect()\n"
10708 "creat()\n"
10709 "fcntl() F_SETLKW\n"
10710 "fdatasync()\n"
10711 "fsync()\n"
10712 "getmsg()\n"
10713 "getpmsg()\n"
10714 "lockf() F_LOCK\n"
10715 "mq_receive()\n"
10716 "mq_send()\n"
10717 "mq_timedreceive()\n"
10718 "mq_timedsend()\n"
10719 "msgrcv()\n"
10720 "msgsnd()\n"
10721 "msync()\n"
10722 "nanosleep()\n"
10723 "open()\n"
10724 "openat() [POSIX.1-2008 で追加された]\n"
10725 "pause()\n"
10726 "poll()\n"
10727 "pread()\n"
10728 "pselect()\n"
10729 "pthread_cond_timedwait()\n"
10730 "pthread_cond_wait()\n"
10731 "pthread_join()\n"
10732 "pthread_testcancel()\n"
10733 "putmsg()\n"
10734 "putpmsg()\n"
10735 "pwrite()\n"
10736 "read()\n"
10737 "readv()\n"
10738 "recv()\n"
10739 "recvfrom()\n"
10740 "recvmsg()\n"
10741 "select()\n"
10742 "sem_timedwait()\n"
10743 "sem_wait()\n"
10744 "send()\n"
10745 "sendmsg()\n"
10746 "sendto()\n"
10747 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
10748 "sigsuspend()\n"
10749 "sigtimedwait()\n"
10750 "sigwait()\n"
10751 "sigwaitinfo()\n"
10752 "sleep()\n"
10753 "system()\n"
10754 "tcdrain()\n"
10755 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10756 "wait()\n"
10757 "waitid()\n"
10758 "waitpid()\n"
10759 "write()\n"
10760 "writev()\n"
10761
10762 #. type: Plain text
10763 #: build/C/man7/pthreads.7:327
10764 msgid ""
10765 "The following functions may be cancellation points according to POSIX.1-2001 "
10766 "and/or POSIX.1-2008:"
10767 msgstr ""
10768 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
10769 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
10770
10771 #. type: Plain text
10772 #: build/C/man7/pthreads.7:555
10773 #, no-wrap
10774 msgid ""
10775 "access()\n"
10776 "asctime()\n"
10777 "asctime_r()\n"
10778 "catclose()\n"
10779 "catgets()\n"
10780 "catopen()\n"
10781 "chmod() [Added in POSIX.1-2008]\n"
10782 "chown() [Added in POSIX.1-2008]\n"
10783 "closedir()\n"
10784 "closelog()\n"
10785 "ctermid()\n"
10786 "ctime()\n"
10787 "ctime_r()\n"
10788 "dbm_close()\n"
10789 "dbm_delete()\n"
10790 "dbm_fetch()\n"
10791 "dbm_nextkey()\n"
10792 "dbm_open()\n"
10793 "dbm_store()\n"
10794 "dlclose()\n"
10795 "dlopen()\n"
10796 "dprintf() [Added in POSIX.1-2008]\n"
10797 "endgrent()\n"
10798 "endhostent()\n"
10799 "endnetent()\n"
10800 "endprotoent()\n"
10801 "endpwent()\n"
10802 "endservent()\n"
10803 "endutxent()\n"
10804 "faccessat() [Added in POSIX.1-2008]\n"
10805 "fchmod() [Added in POSIX.1-2008]\n"
10806 "fchmodat() [Added in POSIX.1-2008]\n"
10807 "fchown() [Added in POSIX.1-2008]\n"
10808 "fchownat() [Added in POSIX.1-2008]\n"
10809 "fclose()\n"
10810 "fcntl() (for any value of cmd argument)\n"
10811 "fflush()\n"
10812 "fgetc()\n"
10813 "fgetpos()\n"
10814 "fgets()\n"
10815 "fgetwc()\n"
10816 "fgetws()\n"
10817 "fmtmsg()\n"
10818 "fopen()\n"
10819 "fpathconf()\n"
10820 "fprintf()\n"
10821 "fputc()\n"
10822 "fputs()\n"
10823 "fputwc()\n"
10824 "fputws()\n"
10825 "fread()\n"
10826 "freopen()\n"
10827 "fscanf()\n"
10828 "fseek()\n"
10829 "fseeko()\n"
10830 "fsetpos()\n"
10831 "fstat()\n"
10832 "fstatat() [Added in POSIX.1-2008]\n"
10833 "ftell()\n"
10834 "ftello()\n"
10835 "ftw()\n"
10836 "futimens() [Added in POSIX.1-2008]\n"
10837 "fwprintf()\n"
10838 "fwrite()\n"
10839 "fwscanf()\n"
10840 "getaddrinfo()\n"
10841 "getc()\n"
10842 "getc_unlocked()\n"
10843 "getchar()\n"
10844 "getchar_unlocked()\n"
10845 "getcwd()\n"
10846 "getdate()\n"
10847 "getdelim() [Added in POSIX.1-2008]\n"
10848 "getgrent()\n"
10849 "getgrgid()\n"
10850 "getgrgid_r()\n"
10851 "getgrnam()\n"
10852 "getgrnam_r()\n"
10853 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10854 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10855 "gethostent()\n"
10856 "gethostid()\n"
10857 "gethostname()\n"
10858 "getline() [Added in POSIX.1-2008]\n"
10859 "getlogin()\n"
10860 "getlogin_r()\n"
10861 "getnameinfo()\n"
10862 "getnetbyaddr()\n"
10863 "getnetbyname()\n"
10864 "getnetent()\n"
10865 "getopt() (if opterr is nonzero)\n"
10866 "getprotobyname()\n"
10867 "getprotobynumber()\n"
10868 "getprotoent()\n"
10869 "getpwent()\n"
10870 "getpwnam()\n"
10871 "getpwnam_r()\n"
10872 "getpwuid()\n"
10873 "getpwuid_r()\n"
10874 "gets()\n"
10875 "getservbyname()\n"
10876 "getservbyport()\n"
10877 "getservent()\n"
10878 "getutxent()\n"
10879 "getutxid()\n"
10880 "getutxline()\n"
10881 "getwc()\n"
10882 "getwchar()\n"
10883 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10884 "glob()\n"
10885 "iconv_close()\n"
10886 "iconv_open()\n"
10887 "ioctl()\n"
10888 "link()\n"
10889 "linkat() [Added in POSIX.1-2008]\n"
10890 "lio_listio() [Added in POSIX.1-2008]\n"
10891 "localtime()\n"
10892 "localtime_r()\n"
10893 "lockf() [Added in POSIX.1-2008]\n"
10894 "lseek()\n"
10895 "lstat()\n"
10896 "mkdir() [Added in POSIX.1-2008]\n"
10897 "mkdirat() [Added in POSIX.1-2008]\n"
10898 "mkdtemp() [Added in POSIX.1-2008]\n"
10899 "mkfifo() [Added in POSIX.1-2008]\n"
10900 "mkfifoat() [Added in POSIX.1-2008]\n"
10901 "mknod() [Added in POSIX.1-2008]\n"
10902 "mknodat() [Added in POSIX.1-2008]\n"
10903 "mkstemp()\n"
10904 "mktime()\n"
10905 "nftw()\n"
10906 "opendir()\n"
10907 "openlog()\n"
10908 "pathconf()\n"
10909 "pclose()\n"
10910 "perror()\n"
10911 "popen()\n"
10912 "posix_fadvise()\n"
10913 "posix_fallocate()\n"
10914 "posix_madvise()\n"
10915 "posix_openpt()\n"
10916 "posix_spawn()\n"
10917 "posix_spawnp()\n"
10918 "posix_trace_clear()\n"
10919 "posix_trace_close()\n"
10920 "posix_trace_create()\n"
10921 "posix_trace_create_withlog()\n"
10922 "posix_trace_eventtypelist_getnext_id()\n"
10923 "posix_trace_eventtypelist_rewind()\n"
10924 "posix_trace_flush()\n"
10925 "posix_trace_get_attr()\n"
10926 "posix_trace_get_filter()\n"
10927 "posix_trace_get_status()\n"
10928 "posix_trace_getnext_event()\n"
10929 "posix_trace_open()\n"
10930 "posix_trace_rewind()\n"
10931 "posix_trace_set_filter()\n"
10932 "posix_trace_shutdown()\n"
10933 "posix_trace_timedgetnext_event()\n"
10934 "posix_typed_mem_open()\n"
10935 "printf()\n"
10936 "psiginfo() [Added in POSIX.1-2008]\n"
10937 "psignal() [Added in POSIX.1-2008]\n"
10938 "pthread_rwlock_rdlock()\n"
10939 "pthread_rwlock_timedrdlock()\n"
10940 "pthread_rwlock_timedwrlock()\n"
10941 "pthread_rwlock_wrlock()\n"
10942 "putc()\n"
10943 "putc_unlocked()\n"
10944 "putchar()\n"
10945 "putchar_unlocked()\n"
10946 "puts()\n"
10947 "pututxline()\n"
10948 "putwc()\n"
10949 "putwchar()\n"
10950 "readdir()\n"
10951 "readdir_r()\n"
10952 "readlink() [Added in POSIX.1-2008]\n"
10953 "readlinkat() [Added in POSIX.1-2008]\n"
10954 "remove()\n"
10955 "rename()\n"
10956 "renameat() [Added in POSIX.1-2008]\n"
10957 "rewind()\n"
10958 "rewinddir()\n"
10959 "scandir() [Added in POSIX.1-2008]\n"
10960 "scanf()\n"
10961 "seekdir()\n"
10962 "semop()\n"
10963 "setgrent()\n"
10964 "sethostent()\n"
10965 "setnetent()\n"
10966 "setprotoent()\n"
10967 "setpwent()\n"
10968 "setservent()\n"
10969 "setutxent()\n"
10970 "sigpause() [Added in POSIX.1-2008]\n"
10971 "stat()\n"
10972 "strerror()\n"
10973 "strerror_r()\n"
10974 "strftime()\n"
10975 "symlink()\n"
10976 "symlinkat() [Added in POSIX.1-2008]\n"
10977 "sync()\n"
10978 "syslog()\n"
10979 "tmpfile()\n"
10980 "tmpnam()\n"
10981 "ttyname()\n"
10982 "ttyname_r()\n"
10983 "tzset()\n"
10984 "ungetc()\n"
10985 "ungetwc()\n"
10986 "unlink()\n"
10987 "unlinkat() [Added in POSIX.1-2008]\n"
10988 "utime() [Added in POSIX.1-2008]\n"
10989 "utimensat() [Added in POSIX.1-2008]\n"
10990 "utimes() [Added in POSIX.1-2008]\n"
10991 "vdprintf() [Added in POSIX.1-2008]\n"
10992 "vfprintf()\n"
10993 "vfwprintf()\n"
10994 "vprintf()\n"
10995 "vwprintf()\n"
10996 "wcsftime()\n"
10997 "wordexp()\n"
10998 "wprintf()\n"
10999 "wscanf()\n"
11000 msgstr ""
11001 "access()\n"
11002 "asctime()\n"
11003 "asctime_r()\n"
11004 "catclose()\n"
11005 "catgets()\n"
11006 "catopen()\n"
11007 "chmod() [POSIX.1-2008 で追加された]\n"
11008 "chown() [POSIX.1-2008 で追加された]\n"
11009 "closedir()\n"
11010 "closelog()\n"
11011 "ctermid()\n"
11012 "ctime()\n"
11013 "ctime_r()\n"
11014 "dbm_close()\n"
11015 "dbm_delete()\n"
11016 "dbm_fetch()\n"
11017 "dbm_nextkey()\n"
11018 "dbm_open()\n"
11019 "dbm_store()\n"
11020 "dlclose()\n"
11021 "dlopen()\n"
11022 "dprintf() [POSIX.1-2008 で追加された]\n"
11023 "endgrent()\n"
11024 "endhostent()\n"
11025 "endnetent()\n"
11026 "endprotoent()\n"
11027 "endpwent()\n"
11028 "endservent()\n"
11029 "endutxent()\n"
11030 "faccessat() [POSIX.1-2008 で追加された]\n"
11031 "fchmod() [POSIX.1-2008 で追加された]\n"
11032 "fchmodat() [POSIX.1-2008 で追加された]\n"
11033 "fchown() [POSIX.1-2008 で追加された]\n"
11034 "fchownat() [POSIX.1-2008 で追加された]\n"
11035 "fclose()\n"
11036 "fcntl() (cmd 引き数が何であっても)\n"
11037 "fflush()\n"
11038 "fgetc()\n"
11039 "fgetpos()\n"
11040 "fgets()\n"
11041 "fgetwc()\n"
11042 "fgetws()\n"
11043 "fmtmsg()\n"
11044 "fopen()\n"
11045 "fpathconf()\n"
11046 "fprintf()\n"
11047 "fputc()\n"
11048 "fputs()\n"
11049 "fputwc()\n"
11050 "fputws()\n"
11051 "fread()\n"
11052 "freopen()\n"
11053 "fscanf()\n"
11054 "fseek()\n"
11055 "fseeko()\n"
11056 "fsetpos()\n"
11057 "fstat()\n"
11058 "fstatat() [POSIX.1-2008 で追加された]\n"
11059 "ftell()\n"
11060 "ftello()\n"
11061 "ftw()\n"
11062 "futimens() [POSIX.1-2008 で追加された]\n"
11063 "fwprintf()\n"
11064 "fwrite()\n"
11065 "fwscanf()\n"
11066 "getaddrinfo()\n"
11067 "getc()\n"
11068 "getc_unlocked()\n"
11069 "getchar()\n"
11070 "getchar_unlocked()\n"
11071 "getcwd()\n"
11072 "getdate()\n"
11073 "getdelim() [POSIX.1-2008 で追加された]\n"
11074 "getgrent()\n"
11075 "getgrgid()\n"
11076 "getgrgid_r()\n"
11077 "getgrnam()\n"
11078 "getgrnam_r()\n"
11079 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
11080 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
11081 "gethostent()\n"
11082 "gethostid()\n"
11083 "gethostname()\n"
11084 "getline() [POSIX.1-2008 で追加された]\n"
11085 "getlogin()\n"
11086 "getlogin_r()\n"
11087 "getnameinfo()\n"
11088 "getnetbyaddr()\n"
11089 "getnetbyname()\n"
11090 "getnetent()\n"
11091 "getopt() (opterr が 0 以外の場合)\n"
11092 "getprotobyname()\n"
11093 "getprotobynumber()\n"
11094 "getprotoent()\n"
11095 "getpwent()\n"
11096 "getpwnam()\n"
11097 "getpwnam_r()\n"
11098 "getpwuid()\n"
11099 "getpwuid_r()\n"
11100 "gets()\n"
11101 "getservbyname()\n"
11102 "getservbyport()\n"
11103 "getservent()\n"
11104 "getutxent()\n"
11105 "getutxid()\n"
11106 "getutxline()\n"
11107 "getwc()\n"
11108 "getwchar()\n"
11109 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
11110 "glob()\n"
11111 "iconv_close()\n"
11112 "iconv_open()\n"
11113 "ioctl()\n"
11114 "link()\n"
11115 "linkat() [POSIX.1-2008 で追加された]\n"
11116 "lio_listio() [POSIX.1-2008 で追加された]\n"
11117 "localtime()\n"
11118 "localtime_r()\n"
11119 "lockf() [POSIX.1-2008 で追加された]\n"
11120 "lseek()\n"
11121 "lstat()\n"
11122 "mkdir() [POSIX.1-2008 で追加された]\n"
11123 "mkdirat() [POSIX.1-2008 で追加された]\n"
11124 "mkdtemp() [POSIX.1-2008 で追加された]\n"
11125 "mkfifo() [POSIX.1-2008 で追加された]\n"
11126 "mkfifoat() [POSIX.1-2008 で追加された]\n"
11127 "mknod() [POSIX.1-2008 で追加された]\n"
11128 "mknodat() [POSIX.1-2008 で追加された]\n"
11129 "mkstemp()\n"
11130 "mktime()\n"
11131 "nftw()\n"
11132 "opendir()\n"
11133 "openlog()\n"
11134 "pathconf()\n"
11135 "pclose()\n"
11136 "perror()\n"
11137 "popen()\n"
11138 "posix_fadvise()\n"
11139 "posix_fallocate()\n"
11140 "posix_madvise()\n"
11141 "posix_openpt()\n"
11142 "posix_spawn()\n"
11143 "posix_spawnp()\n"
11144 "posix_trace_clear()\n"
11145 "posix_trace_close()\n"
11146 "posix_trace_create()\n"
11147 "posix_trace_create_withlog()\n"
11148 "posix_trace_eventtypelist_getnext_id()\n"
11149 "posix_trace_eventtypelist_rewind()\n"
11150 "posix_trace_flush()\n"
11151 "posix_trace_get_attr()\n"
11152 "posix_trace_get_filter()\n"
11153 "posix_trace_get_status()\n"
11154 "posix_trace_getnext_event()\n"
11155 "posix_trace_open()\n"
11156 "posix_trace_rewind()\n"
11157 "posix_trace_set_filter()\n"
11158 "posix_trace_shutdown()\n"
11159 "posix_trace_timedgetnext_event()\n"
11160 "posix_typed_mem_open()\n"
11161 "printf()\n"
11162 "psiginfo() [POSIX.1-2008 で追加された]\n"
11163 "psignal() [POSIX.1-2008 で追加された]\n"
11164 "pthread_rwlock_rdlock()\n"
11165 "pthread_rwlock_timedrdlock()\n"
11166 "pthread_rwlock_timedwrlock()\n"
11167 "pthread_rwlock_wrlock()\n"
11168 "putc()\n"
11169 "putc_unlocked()\n"
11170 "putchar()\n"
11171 "putchar_unlocked()\n"
11172 "puts()\n"
11173 "pututxline()\n"
11174 "putwc()\n"
11175 "putwchar()\n"
11176 "readdir()\n"
11177 "readdir_r()\n"
11178 "readlink() [POSIX.1-2008 で追加された]\n"
11179 "readlinkat() [POSIX.1-2008 で追加された]\n"
11180 "remove()\n"
11181 "rename()\n"
11182 "renameat() [POSIX.1-2008 で追加された]\n"
11183 "rewind()\n"
11184 "rewinddir()\n"
11185 "scandir() [POSIX.1-2008 で追加された]\n"
11186 "scanf()\n"
11187 "seekdir()\n"
11188 "semop()\n"
11189 "setgrent()\n"
11190 "sethostent()\n"
11191 "setnetent()\n"
11192 "setprotoent()\n"
11193 "setpwent()\n"
11194 "setservent()\n"
11195 "setutxent()\n"
11196 "sigpause() [POSIX.1-2008 で追加された]\n"
11197 "stat()\n"
11198 "strerror()\n"
11199 "strerror_r()\n"
11200 "strftime()\n"
11201 "symlink()\n"
11202 "symlinkat() [POSIX.1-2008 で追加された]\n"
11203 "sync()\n"
11204 "syslog()\n"
11205 "tmpfile()\n"
11206 "tmpnam()\n"
11207 "ttyname()\n"
11208 "ttyname_r()\n"
11209 "tzset()\n"
11210 "ungetc()\n"
11211 "ungetwc()\n"
11212 "unlink()\n"
11213 "unlinkat() [POSIX.1-2008 で追加された]\n"
11214 "utime() [POSIX.1-2008 で追加された]\n"
11215 "utimensat() [POSIX.1-2008 で追加された]\n"
11216 "utimes() [POSIX.1-2008 で追加された]\n"
11217 "vdprintf() [POSIX.1-2008 で追加された]\n"
11218 "vfprintf()\n"
11219 "vfwprintf()\n"
11220 "vprintf()\n"
11221 "vwprintf()\n"
11222 "wcsftime()\n"
11223 "wordexp()\n"
11224 "wprintf()\n"
11225 "wscanf()\n"
11226
11227 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
11228 #.  files, it looks as though at least the following nonstandard
11229 #.  functions are cancellation points:
11230 #.  endnetgrent
11231 #.  endspent
11232 #.  epoll_pwait
11233 #.  epoll_wait
11234 #.  fcloseall
11235 #.  fdopendir
11236 #.  fflush_unlocked
11237 #.  fgetc_unlocked
11238 #.  fgetgrent
11239 #.  fgetgrent_r
11240 #.  fgetpwent
11241 #.  fgetpwent_r
11242 #.  fgets_unlocked
11243 #.  fgetspent
11244 #.  fgetspent_r
11245 #.  fgetwc_unlocked
11246 #.  fgetws_unlocked
11247 #.  fputc_unlocked
11248 #.  fputs_unlocked
11249 #.  fputwc_unlocked
11250 #.  fputws_unlocked
11251 #.  fread_unlocked
11252 #.  fwrite_unlocked
11253 #.  gai_suspend
11254 #.  getaddrinfo_a
11255 #.  getdate_r
11256 #.  getgrent_r
11257 #.  getgrouplist
11258 #.  gethostbyaddr_r
11259 #.  gethostbyname2
11260 #.  gethostbyname2_r
11261 #.  gethostbyname_r
11262 #.  gethostent_r
11263 #.  getnetbyaddr_r
11264 #.  getnetbyname_r
11265 #.  getnetent_r
11266 #.  getnetgrent
11267 #.  getnetgrent_r
11268 #.  getprotobyname_r
11269 #.  getprotobynumber_r
11270 #.  getprotoent_r
11271 #.  getpw
11272 #.  getpwent_r
11273 #.  getservbyname_r
11274 #.  getservbyport_r
11275 #.  getservent_r
11276 #.  getspent
11277 #.  getspent_r
11278 #.  getspnam
11279 #.  getspnam_r
11280 #.  getutmp
11281 #.  getutmpx
11282 #.  getw
11283 #.  getwc_unlocked
11284 #.  getwchar_unlocked
11285 #.  initgroups
11286 #.  innetgr
11287 #.  mkostemp
11288 #.  mkostemp64
11289 #.  mkstemp64
11290 #.  ppoll
11291 #.  pthread_timedjoin_np
11292 #.  putgrent
11293 #.  putpwent
11294 #.  putspent
11295 #.  putw
11296 #.  putwc_unlocked
11297 #.  putwchar_unlocked
11298 #.  rcmd
11299 #.  rcmd_af
11300 #.  rexec
11301 #.  rexec_af
11302 #.  rresvport
11303 #.  rresvport_af
11304 #.  ruserok
11305 #.  ruserok_af
11306 #.  setnetgrent
11307 #.  setspent
11308 #.  sgetspent
11309 #.  sgetspent_r
11310 #.  updwtmpx
11311 #.  utmpxname
11312 #.  vfscanf
11313 #.  vfwscanf
11314 #.  vscanf
11315 #.  vsyslog
11316 #.  vwscanf
11317 #. type: Plain text
11318 #: build/C/man7/pthreads.7:653
11319 msgid ""
11320 "An implementation may also mark other functions not specified in the "
11321 "standard as cancellation points.  In particular, an implementation is likely "
11322 "to mark any nonstandard function that may block as a cancellation point.  "
11323 "(This includes most functions that can touch files.)"
11324 msgstr ""
11325 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
11326 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
11327 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
11328 "関数がこれに含まれる)。"
11329
11330 #. type: SS
11331 #: build/C/man7/pthreads.7:653
11332 #, no-wrap
11333 msgid "Compiling on Linux"
11334 msgstr "Linux でのコンパイル"
11335
11336 #. type: Plain text
11337 #: build/C/man7/pthreads.7:656
11338 msgid ""
11339 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
11340 "pthread>."
11341 msgstr ""
11342 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
11343 "きである。"
11344
11345 #. type: SS
11346 #: build/C/man7/pthreads.7:656
11347 #, no-wrap
11348 msgid "Linux implementations of POSIX threads"
11349 msgstr "POSIX スレッドの Linux での実装"
11350
11351 #. type: Plain text
11352 #: build/C/man7/pthreads.7:659
11353 msgid ""
11354 "Over time, two threading implementations have been provided by the GNU C "
11355 "library on Linux:"
11356 msgstr ""
11357 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
11358 "た。"
11359
11360 #. type: TP
11361 #: build/C/man7/pthreads.7:659
11362 #, no-wrap
11363 msgid "B<LinuxThreads>"
11364 msgstr "B<LinuxThreads>"
11365
11366 #. type: Plain text
11367 #: build/C/man7/pthreads.7:663
11368 msgid ""
11369 "This is the original Pthreads implementation.  Since glibc 2.4, this "
11370 "implementation is no longer supported."
11371 msgstr ""
11372 "最初の Pthreads の実装。\n"
11373 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
11374
11375 #. type: TP
11376 #: build/C/man7/pthreads.7:663
11377 #, no-wrap
11378 msgid "B<NPTL> (Native POSIX Threads Library)"
11379 msgstr "B<NPTL> (Native POSIX Threads Library)"
11380
11381 #. type: Plain text
11382 #: build/C/man7/pthreads.7:671
11383 msgid ""
11384 "This is the modern Pthreads implementation.  By comparison with "
11385 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
11386 "POSIX.1 specification and better performance when creating large numbers of "
11387 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
11388 "are present in the Linux 2.6 kernel."
11389 msgstr ""
11390 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
11391 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
11392 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
11393 "装されている機能が必要である。"
11394
11395 #. type: Plain text
11396 #: build/C/man7/pthreads.7:681
11397 msgid ""
11398 "Both of these are so-called 1:1 implementations, meaning that each thread "
11399 "maps to a kernel scheduling entity.  Both threading implementations employ "
11400 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
11401 "primitives (mutexes, thread joining, and so on) are implemented using the "
11402 "Linux B<futex>(2)  system call."
11403 msgstr ""
11404 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
11405 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
11406 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
11407 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
11408 "使って実装されている。"
11409
11410 #. type: SS
11411 #: build/C/man7/pthreads.7:681
11412 #, no-wrap
11413 msgid "LinuxThreads"
11414 msgstr "LinuxThreads"
11415
11416 #. type: Plain text
11417 #: build/C/man7/pthreads.7:683
11418 msgid "The notable features of this implementation are the following:"
11419 msgstr "この実装の大きな特徴は以下の通りである:"
11420
11421 #. type: Plain text
11422 #: build/C/man7/pthreads.7:690
11423 msgid ""
11424 "In addition to the main (initial) thread, and the threads that the program "
11425 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
11426 "thread.  This thread handles thread creation and termination.  (Problems can "
11427 "result if this thread is inadvertently killed.)"
11428 msgstr ""
11429 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
11430 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
11431 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
11432 "kill されると、問題が起こることがある)。"
11433
11434 #. type: Plain text
11435 #: build/C/man7/pthreads.7:702
11436 msgid ""
11437 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
11438 "the first three real-time signals are used (see also B<signal>(7)).  On "
11439 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
11440 "avoid the use of whichever set of signals is employed by the implementation."
11441 msgstr ""
11442 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
11443 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
11444 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
11445 "用されているシグナルを どれも使わないようにしなければならない。"
11446
11447 #. type: Plain text
11448 #: build/C/man7/pthreads.7:709
11449 msgid ""
11450 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
11451 "implemented as processes which share more information than usual, but which "
11452 "do not share a common process ID.)  LinuxThreads threads (including the "
11453 "manager thread)  are visible as separate processes using B<ps>(1)."
11454 msgstr ""
11455 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
11456 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
11457 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
11458 "を使うと別のプロセスのように見える。"
11459
11460 #. type: Plain text
11461 #: build/C/man7/pthreads.7:712
11462 msgid ""
11463 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
11464 "number of ways, including the following:"
11465 msgstr ""
11466 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
11467 "示すような点がある:"
11468
11469 #. type: Plain text
11470 #: build/C/man7/pthreads.7:716
11471 msgid "Calls to B<getpid>(2)  return a different value in each thread."
11472 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
11473
11474 #. type: Plain text
11475 #: build/C/man7/pthreads.7:725
11476 msgid ""
11477 "Calls to B<getppid>(2)  in threads other than the main thread return the "
11478 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
11479 "should return the same value as B<getppid>(2)  in the main thread."
11480 msgstr ""
11481 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
11482 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
11483 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
11484
11485 #. type: Plain text
11486 #: build/C/man7/pthreads.7:735
11487 msgid ""
11488 "When one thread creates a new child process using B<fork>(2), any thread "
11489 "should be able to B<wait>(2)  on the child.  However, the implementation "
11490 "only allows the thread that created the child to B<wait>(2)  on it."
11491 msgstr ""
11492 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
11493 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
11494 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
11495 "る。"
11496
11497 #. type: Plain text
11498 #: build/C/man7/pthreads.7:742
11499 msgid ""
11500 "When a thread calls B<execve>(2), all other threads are terminated (as "
11501 "required by POSIX.1).  However, the resulting process has the same PID as "
11502 "the thread that called B<execve>(2): it should have the same PID as the main "
11503 "thread."
11504 msgstr ""
11505 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
11506 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
11507 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
11508 "る。"
11509
11510 #. type: Plain text
11511 #: build/C/man7/pthreads.7:749
11512 msgid ""
11513 "Threads do not share user and group IDs.  This can cause complications with "
11514 "set-user-ID programs and can cause failures in Pthreads functions if an "
11515 "application changes its credentials using B<seteuid>(2)  or similar."
11516 msgstr ""
11517 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
11518 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使っ"
11519 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
11520
11521 #. type: Plain text
11522 #: build/C/man7/pthreads.7:751
11523 msgid "Threads do not share a common session ID and process group ID."
11524 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
11525
11526 #. type: Plain text
11527 #: build/C/man7/pthreads.7:754
11528 msgid "Threads do not share record locks created using B<fcntl>(2)."
11529 msgstr ""
11530 "スレッド間で B<fcntl>(2)  を使って作成されるレコード・ロックを共有しない。"
11531
11532 #. type: Plain text
11533 #: build/C/man7/pthreads.7:760
11534 msgid ""
11535 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
11536 "rather than process-wide."
11537 msgstr ""
11538 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
11539 "単位の情報である。"
11540
11541 #. type: Plain text
11542 #: build/C/man7/pthreads.7:763
11543 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
11544 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
11545
11546 #. type: Plain text
11547 #: build/C/man7/pthreads.7:765
11548 msgid "Threads do not share interval timers."
11549 msgstr "スレッド間でインターバル・タイマを共有しない。"
11550
11551 #.  FIXME . bug report filed for NPTL nice nonconformance
11552 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
11553 #.  Sep 08: there is a patch by Denys Vlasenko to address this
11554 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
11555 #.  Monitor this to see if it makes it into mainline.
11556 #. type: Plain text
11557 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
11558 msgid "Threads do not share a common nice value."
11559 msgstr "スレッドは共通の nice 値を共有しない。"
11560
11561 #. type: Plain text
11562 #: build/C/man7/pthreads.7:777
11563 msgid ""
11564 "POSIX.1 distinguishes the notions of signals that are directed to the "
11565 "process as a whole and signals that are directed to individual threads.  "
11566 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
11567 "example) should be handled by a single, arbitrarily selected thread within "
11568 "the process.  LinuxThreads does not support the notion of process-directed "
11569 "signals: signals may be sent only to specific threads."
11570 msgstr ""
11571 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
11572 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
11573 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
11574 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
11575 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
11576 "ルは特定のスレッドにだけ送ることができる。"
11577
11578 #. type: Plain text
11579 #: build/C/man7/pthreads.7:786
11580 msgid ""
11581 "Threads have distinct alternate signal stack settings.  However, a new "
11582 "thread's alternate signal stack settings are copied from the thread that "
11583 "created it, so that the threads initially share an alternate signal stack.  "
11584 "(A new thread should start with no alternate signal stack defined.  If two "
11585 "threads handle signals on their shared alternate signal stack at the same "
11586 "time, unpredictable program failures are likely to occur.)"
11587 msgstr ""
11588 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
11589 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
11590 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
11591 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
11592 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
11593 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
11594
11595 #. type: SS
11596 #: build/C/man7/pthreads.7:786
11597 #, no-wrap
11598 msgid "NPTL"
11599 msgstr "NPTL"
11600
11601 #. type: Plain text
11602 #: build/C/man7/pthreads.7:795
11603 msgid ""
11604 "With NPTL, all of the threads in a process are placed in the same thread "
11605 "group; all members of a thread group share the same PID.  NPTL does not "
11606 "employ a manager thread.  NPTL makes internal use of the first two real-time "
11607 "signals (see also B<signal>(7)); these signals cannot be used in "
11608 "applications."
11609 msgstr ""
11610 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
11611 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
11612 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
11613 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
11614 "ションでは使用できない。"
11615
11616 #. type: Plain text
11617 #: build/C/man7/pthreads.7:797
11618 msgid "NPTL still has at least one nonconformance with POSIX.1:"
11619 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
11620
11621 #. type: Plain text
11622 #: build/C/man7/pthreads.7:806
11623 msgid "Some NPTL nonconformances occur only with older kernels:"
11624 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
11625
11626 #. type: Plain text
11627 #: build/C/man7/pthreads.7:812
11628 msgid ""
11629 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
11630 "rather than process-wide (fixed in kernel 2.6.9)."
11631 msgstr ""
11632 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
11633 "単位の情報である (カーネル 2.6.9 で修正された)。"
11634
11635 #. type: Plain text
11636 #: build/C/man7/pthreads.7:814
11637 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
11638 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
11639
11640 #. type: Plain text
11641 #: build/C/man7/pthreads.7:816
11642 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
11643 msgstr ""
11644 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
11645
11646 #. type: Plain text
11647 #: build/C/man7/pthreads.7:820
11648 msgid ""
11649 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
11650 "(fixed in kernel 2.6.16)."
11651 msgstr ""
11652 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
11653 "きる (カーネル 2.6.16 で修正された)。"
11654
11655 #. type: Plain text
11656 #: build/C/man7/pthreads.7:825
11657 msgid ""
11658 "Only the main thread is permitted to make the process into a process group "
11659 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
11660 msgstr ""
11661 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセス・グルー"
11662 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
11663
11664 #. type: Plain text
11665 #: build/C/man7/pthreads.7:831
11666 msgid ""
11667 "Threads have distinct alternate signal stack settings.  However, a new "
11668 "thread's alternate signal stack settings are copied from the thread that "
11669 "created it, so that the threads initially share an alternate signal stack "
11670 "(fixed in kernel 2.6.16)."
11671 msgstr ""
11672 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
11673 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
11674 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
11675 "ル 2.6.16 で修正された)。"
11676
11677 #. type: Plain text
11678 #: build/C/man7/pthreads.7:833
11679 msgid "Note the following further points about the NPTL implementation:"
11680 msgstr "NPTL の実装では以下の点についても注意すること:"
11681
11682 #. type: Plain text
11683 #: build/C/man7/pthreads.7:847
11684 msgid ""
11685 "If the stack size soft resource limit (see the description of "
11686 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
11687 "I<unlimited>, then this value defines the default stack size for new "
11688 "threads.  To be effective, this limit must be set before the program is "
11689 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
11690 "stacksize> in the C shell)."
11691 msgstr ""
11692 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2)  の "
11693 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
11694 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
11695 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
11696 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
11697 "は I<limit stacksize>)  を使って設定する。"
11698
11699 #. type: SS
11700 #: build/C/man7/pthreads.7:847
11701 #, no-wrap
11702 msgid "Determining the threading implementation"
11703 msgstr "スレッド実装の判定"
11704
11705 #. type: Plain text
11706 #: build/C/man7/pthreads.7:852
11707 msgid ""
11708 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
11709 "system's threading implementation, for example:"
11710 msgstr ""
11711 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
11712 "装を判定することができる。 以下に例を示す:"
11713
11714 #. type: Plain text
11715 #: build/C/man7/pthreads.7:857
11716 #, no-wrap
11717 msgid ""
11718 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
11719 "NPTL 2.3.4\n"
11720 msgstr ""
11721 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
11722 "NPTL 2.3.4\n"
11723
11724 #. type: Plain text
11725 #: build/C/man7/pthreads.7:862
11726 msgid ""
11727 "With older glibc versions, a command such as the following should be "
11728 "sufficient to determine the default threading implementation:"
11729 msgstr ""
11730 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
11731 "ド実装を判定することができる。"
11732
11733 #. type: Plain text
11734 #: build/C/man7/pthreads.7:868
11735 #, no-wrap
11736 msgid ""
11737 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
11738 "                egrep -i \\(aqthreads|nptl\\(aq\n"
11739 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
11740 msgstr ""
11741 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
11742 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
11743 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
11744
11745 #. type: SS
11746 #: build/C/man7/pthreads.7:870
11747 #, no-wrap
11748 msgid "Selecting the threading implementation: LD_ASSUME_KERNEL"
11749 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
11750
11751 #. type: Plain text
11752 #: build/C/man7/pthreads.7:885
11753 msgid ""
11754 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
11755 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
11756 "override the dynamic linker's default choice of threading implementation.  "
11757 "This variable tells the dynamic linker to assume that it is running on top "
11758 "of a particular kernel version.  By specifying a kernel version that does "
11759 "not provide the support required by NPTL, we can force the use of "
11760 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
11761 "application that depends on some nonconformant behavior in LinuxThreads.)  "
11762 "For example:"
11763 msgstr ""
11764 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
11765 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
11766 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
11767 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
11768 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
11769 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
11770 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
11771 "ン を動作させる場合だろう)。 以下に例を示す:"
11772
11773 #. type: Plain text
11774 #: build/C/man7/pthreads.7:891
11775 #, no-wrap
11776 msgid ""
11777 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
11778 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
11779 "        linuxthreads-0.10 by Xavier Leroy\n"
11780 msgstr ""
11781 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
11782 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
11783 "        linuxthreads-0.10 by Xavier Leroy\n"
11784
11785 #. type: Plain text
11786 #: build/C/man7/pthreads.7:903
11787 msgid ""
11788 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), "
11789 "B<sigevent>(7), B<signal>(7),"
11790 msgstr ""
11791 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
11792 "B<signal>(7),"
11793
11794 #. type: Plain text
11795 #: build/C/man7/pthreads.7:927
11796 msgid ""
11797 "Various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
11798 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
11799 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
11800 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
11801 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
11802 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), "
11803 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), "
11804 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3), "
11805 "and B<pthread_testcancel>(3)"
11806 msgstr ""
11807 "pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
11808 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
11809 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
11810 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
11811 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
11812 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
11813 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
11814 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
11815 "and B<pthread_testcancel>(3)"