OSDN Git Service

ff5cc1480b271b589f5ed77c80ae2cc25c17ef7e
[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-02-04 23:30+0900\n"
10 "PO-Revision-Date: 2015-01-25 07:23+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:120 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:143 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:148 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:156 build/C/man3/pthread_yield.3:79
698 #: build/C/man7/pthreads.7:935
699 #, fuzzy
700 #| msgid ""
701 #| "This page is part of release 3.78 of the Linux I<man-pages> project.  A "
702 #| "description of the project, information about reporting bugs, and the "
703 #| "latest version of this page, can be found at \\%http://www.kernel.org/doc/"
704 #| "man-pages/."
705 msgid ""
706 "This page is part of release 3.79 of the Linux I<man-pages> project.  A "
707 "description of the project, information about reporting bugs, and the latest "
708 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
709 "pages/."
710 msgstr ""
711 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.78 の一部\n"
712 "である。プロジェクトの説明とバグ報告に関する情報は\n"
713 "http://www.kernel.org/doc/man-pages/ に書かれている。"
714
715 #. type: TH
716 #: build/C/man3/makecontext.3:28
717 #, no-wrap
718 msgid "MAKECONTEXT"
719 msgstr "MAKECONTEXT"
720
721 #. type: TH
722 #: build/C/man3/makecontext.3:28 build/C/man3/pthread_attr_setaffinity_np.3:26
723 #: build/C/man3/pthread_attr_setdetachstate.3:26
724 #: build/C/man3/pthread_attr_setguardsize.3:26
725 #: build/C/man3/pthread_attr_setscope.3:26
726 #: build/C/man3/pthread_attr_setstack.3:26
727 #: build/C/man3/pthread_attr_setstackaddr.3:26
728 #: build/C/man3/pthread_attr_setstacksize.3:26
729 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
730 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_setname_np.3:26
731 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigqueue.3:25
732 #, no-wrap
733 msgid "2014-05-28"
734 msgstr "2014-05-28"
735
736 #. type: TH
737 #: build/C/man3/makecontext.3:28
738 #, no-wrap
739 msgid "GNU"
740 msgstr "GNU"
741
742 #. type: Plain text
743 #: build/C/man3/makecontext.3:31
744 msgid "makecontext, swapcontext - manipulate user context"
745 msgstr "makecontext, swapcontext - ユーザーコンテキストを操作する"
746
747 #. type: Plain text
748 #: build/C/man3/makecontext.3:36
749 msgid ""
750 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
751 ">I<argc>B<, ...);>"
752 msgstr ""
753 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
754 ">I<argc>B<, ...);>"
755
756 #. type: Plain text
757 #: build/C/man3/makecontext.3:38
758 msgid ""
759 "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
760 msgstr ""
761 "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
762
763 #. type: Plain text
764 #: build/C/man3/makecontext.3:49
765 msgid ""
766 "In a System V-like environment, one has the type I<ucontext_t> defined in "
767 "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(3), "
768 "B<setcontext>(3), B<makecontext>()  and B<swapcontext>()  that allow user-"
769 "level context switching between multiple threads of control within a process."
770 msgstr ""
771 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
772 "と、 B<getcontext>(3), B<setcontext>(3), B<makecontext>(), B<swapcontext>()  "
773 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
774 "部で制御下にある複数のスレッド間で、 ユーザーレベルのコンテキスト切替えができ"
775 "るようになっている。"
776
777 #. type: Plain text
778 #: build/C/man3/makecontext.3:52
779 msgid "For the type and the first two functions, see B<getcontext>(3)."
780 msgstr ""
781 "これらの型と、最初の 2 つの関数については、 B<getcontext>(3) を参照のこと。"
782
783 #. type: Plain text
784 #: build/C/man3/makecontext.3:64
785 msgid ""
786 "The B<makecontext>()  function modifies the context pointed to by I<ucp> "
787 "(which was obtained from a call to B<getcontext>(3)).  Before invoking "
788 "B<makecontext>(), the caller must allocate a new stack for this context and "
789 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
790 "and assign its address to I<ucp-E<gt>uc_link>."
791 msgstr ""
792 "B<makecontext>()  関数は、ポインター I<ucp> が指すコンテキストを変更する "
793 "(I<ucp> は以前の B<getcontext>(3)  呼び出しで得られたものである)。 "
794 "B<makecontext>()  を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
795 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
796 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
797 "らない。"
798
799 #. type: Plain text
800 #: build/C/man3/makecontext.3:78
801 msgid ""
802 "When this context is later activated (using B<setcontext>(3)  or "
803 "B<swapcontext>())  the function I<func> is called, and passed the series of "
804 "integer (I<int>)  arguments that follow I<argc>; the caller must specify the "
805 "number of these arguments in I<argc>.  When this function returns, the "
806 "successor context is activated.  If the successor context pointer is NULL, "
807 "the thread exits."
808 msgstr ""
809 "このコンテキストが将来 (B<setcontext>(3)  または B<swapcontext>()  によっ"
810 "て)  有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 "
811 "(I<int>)  引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数"
812 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
813 "る。 後継コンテキストのポインターが NULL の場合、そのスレッドが終了する。"
814
815 #. type: Plain text
816 #: build/C/man3/makecontext.3:84
817 msgid ""
818 "The B<swapcontext>()  function saves the current context in the structure "
819 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
820 msgstr ""
821 "B<swapcontext>()  関数は現在のコンテキストを ポインター I<oucp> が指す構造体"
822 "に保存し、 ポインター I<ucp> が指すコンテキストを有効にする。"
823
824 #. type: Plain text
825 #: build/C/man3/makecontext.3:96
826 msgid ""
827 "When successful, B<swapcontext>()  does not return.  (But we may return "
828 "later, in case I<oucp> is activated, in which case it looks like "
829 "B<swapcontext>()  returns 0.)  On error, B<swapcontext>()  returns -1 and "
830 "sets I<errno> appropriately."
831 msgstr ""
832 "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった"
833 "場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見え"
834 "る。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じ"
835 "て設定する。"
836
837 #. type: TP
838 #: build/C/man3/makecontext.3:97
839 #: build/C/man3/pthread_attr_setaffinity_np.3:102
840 #: build/C/man3/pthread_getattr_np.3:77
841 #, no-wrap
842 msgid "B<ENOMEM>"
843 msgstr "B<ENOMEM>"
844
845 #. type: Plain text
846 #: build/C/man3/makecontext.3:100
847 msgid "Insufficient stack space left."
848 msgstr "スタックに割り当てる空間が残っていない。"
849
850 #. type: SH
851 #: build/C/man3/makecontext.3:100
852 #: build/C/man3/pthread_attr_setaffinity_np.3:106
853 #: build/C/man3/pthread_attr_setguardsize.3:104
854 #: build/C/man3/pthread_attr_setstack.3:110
855 #: build/C/man3/pthread_attr_setstackaddr.3:81
856 #: build/C/man3/pthread_attr_setstacksize.3:81
857 #: build/C/man3/pthread_getattr_np.3:96
858 #: build/C/man3/pthread_getcpuclockid.3:63
859 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
860 #: build/C/man3/pthread_setaffinity_np.3:119
861 #: build/C/man3/pthread_setconcurrency.3:81
862 #: build/C/man3/pthread_setname_np.3:100
863 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigqueue.3:90
864 #: build/C/man3/pthread_tryjoin_np.3:118
865 #, no-wrap
866 msgid "VERSIONS"
867 msgstr "バージョン"
868
869 #. type: Plain text
870 #: build/C/man3/makecontext.3:105
871 msgid ""
872 "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version "
873 "2.1."
874 msgstr ""
875 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
876 "されている。"
877
878 #. type: Plain text
879 #: build/C/man3/makecontext.3:112
880 msgid "The B<makecontext>()  and B<swapcontext>()  functions are thread-safe."
881 msgstr "関数 B<makecontext>() と B<swapcontext>() はスレッドセーフである。"
882
883 #. type: Plain text
884 #: build/C/man3/makecontext.3:120
885 msgid ""
886 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specifications of "
887 "B<makecontext>()  and B<swapcontext>(), citing portability issues, and "
888 "recommending that applications be rewritten to use POSIX threads instead."
889 msgstr ""
890 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  "
891 "と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを "
892 "POSIX スレッドを使って書き直すことが 推奨されている。"
893
894 #. type: Plain text
895 #: build/C/man3/makecontext.3:128
896 msgid ""
897 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
898 "namely, this struct contains the start and length of a memory area to be "
899 "used as the stack, regardless of the direction of growth of the stack.  "
900 "Thus, it is not necessary for the user program to worry about this direction."
901 msgstr ""
902 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわ"
903 "ちこの構造体には、 スタックとして用いられるメモリー領域の開始アドレスと長さが"
904 "含まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
905 "て、ユーザープログラムはこの件については心配しなくてよい。"
906
907 #. type: Plain text
908 #: build/C/man3/makecontext.3:144
909 msgid ""
910 "On architectures where I<int> and pointer types are the same size (e.g., "
911 "x86-32, where both types are 32 bits), you may be able to get away with "
912 "passing pointers as arguments to B<makecontext>()  following I<argc>.  "
913 "However, doing this is not guaranteed to be portable, is undefined according "
914 "to the standards, and won't work on architectures where pointers are larger "
915 "than I<int>s.  Nevertheless, starting with version 2.8, glibc makes some "
916 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
917 "g., x86-64)."
918 msgstr ""
919 "I<int> とポインター型が同じ大きさであるアーキテクチャーでは (x86-32 はその例"
920 "であり、両方の型とも 32 ビットである)、 B<makecontext>()  の I<argc> 以降の引"
921 "き数としてポインターを渡してもうまく動くかもしれない。 しかしながら、このよう"
922 "にすると、移植性は保証されず、 標準に従えば動作は未定義であり、ポインターが "
923 "I<int> よりも大きいアーキテクチャーでは正しく動作しないことだろう。 それにも"
924 "関わらず、バージョン 2.8 以降の glibc では、 B<makecontext>()  に変更が行わ"
925 "れ、(x86-64 などの) いくつかの 64 ビットアーキテクチャーで 引き数としてポイン"
926 "ターを渡すことができるようになっている。"
927
928 #. type: SH
929 #: build/C/man3/makecontext.3:144 build/C/man3/pthread_attr_init.3:87
930 #: build/C/man3/pthread_attr_setdetachstate.3:115
931 #: build/C/man3/pthread_attr_setguardsize.3:162
932 #: build/C/man3/pthread_attr_setinheritsched.3:135
933 #: build/C/man3/pthread_attr_setschedparam.3:113
934 #: build/C/man3/pthread_attr_setschedpolicy.3:109
935 #: build/C/man3/pthread_attr_setstack.3:159
936 #: build/C/man3/pthread_attr_setstacksize.3:115
937 #: build/C/man3/pthread_cancel.3:135 build/C/man3/pthread_cleanup_push.3:155
938 #: build/C/man3/pthread_create.3:209 build/C/man3/pthread_detach.3:93
939 #: build/C/man3/pthread_getattr_np.3:101
940 #: build/C/man3/pthread_getcpuclockid.3:83 build/C/man3/pthread_join.3:124
941 #: build/C/man3/pthread_setaffinity_np.3:161
942 #: build/C/man3/pthread_setcancelstate.3:183
943 #: build/C/man3/pthread_setname_np.3:114
944 #: build/C/man3/pthread_setschedparam.3:156 build/C/man3/pthread_sigmask.3:78
945 #: build/C/man3/pthread_testcancel.3:65 build/C/man3/pthread_tryjoin_np.3:123
946 #, no-wrap
947 msgid "EXAMPLE"
948 msgstr "例"
949
950 #. type: Plain text
951 #: build/C/man3/makecontext.3:152
952 msgid ""
953 "The example program below demonstrates the use of B<getcontext>(3), "
954 "B<makecontext>(), and B<swapcontext>().  Running the program produces the "
955 "following output:"
956 msgstr ""
957 "以下のサンプルプログラムは、 B<getcontext>(3), B<makecontext>(), "
958 "B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行する"
959 "と、以下のような出力が得られる:"
960
961 #. type: Plain text
962 #: build/C/man3/makecontext.3:164
963 #, no-wrap
964 msgid ""
965 "$B< ./a.out>\n"
966 "main: swapcontext(&uctx_main, &uctx_func2)\n"
967 "func2: started\n"
968 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
969 "func1: started\n"
970 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
971 "func2: returning\n"
972 "func1: returning\n"
973 "main: exiting\n"
974 msgstr ""
975 "$B< ./a.out>\n"
976 "main: swapcontext(&uctx_main, &uctx_func2)\n"
977 "func2: started\n"
978 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
979 "func1: started\n"
980 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
981 "func2: returning\n"
982 "func1: returning\n"
983 "main: exiting\n"
984
985 #. type: SS
986 #: build/C/man3/makecontext.3:166 build/C/man3/pthread_attr_init.3:148
987 #: build/C/man3/pthread_cancel.3:151 build/C/man3/pthread_cleanup_push.3:231
988 #: build/C/man3/pthread_create.3:248 build/C/man3/pthread_getattr_np.3:179
989 #: build/C/man3/pthread_getcpuclockid.3:101
990 #: build/C/man3/pthread_setname_np.3:140
991 #: build/C/man3/pthread_setschedparam.3:231 build/C/man3/pthread_sigmask.3:96
992 #, no-wrap
993 msgid "Program source"
994 msgstr "プログラムのソース"
995
996 #. type: Plain text
997 #: build/C/man3/makecontext.3:172
998 #, no-wrap
999 msgid ""
1000 "#include E<lt>ucontext.hE<gt>\n"
1001 "#include E<lt>stdio.hE<gt>\n"
1002 "#include E<lt>stdlib.hE<gt>\n"
1003 msgstr ""
1004 "#include E<lt>ucontext.hE<gt>\n"
1005 "#include E<lt>stdio.hE<gt>\n"
1006 "#include E<lt>stdlib.hE<gt>\n"
1007
1008 #. type: Plain text
1009 #: build/C/man3/makecontext.3:174
1010 #, no-wrap
1011 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
1012 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
1013
1014 #. type: Plain text
1015 #: build/C/man3/makecontext.3:177
1016 #, no-wrap
1017 msgid ""
1018 "#define handle_error(msg) \\e\n"
1019 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1020 msgstr ""
1021 "#define handle_error(msg) \\e\n"
1022 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1023
1024 #. type: Plain text
1025 #: build/C/man3/makecontext.3:187
1026 #, no-wrap
1027 msgid ""
1028 "static void\n"
1029 "func1(void)\n"
1030 "{\n"
1031 "    printf(\"func1: started\\en\");\n"
1032 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
1033 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
1034 "        handle_error(\"swapcontext\");\n"
1035 "    printf(\"func1: returning\\en\");\n"
1036 "}\n"
1037 msgstr ""
1038 "static void\n"
1039 "func1(void)\n"
1040 "{\n"
1041 "    printf(\"func1: started\\en\");\n"
1042 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
1043 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
1044 "        handle_error(\"swapcontext\");\n"
1045 "    printf(\"func1: returning\\en\");\n"
1046 "}\n"
1047
1048 #. type: Plain text
1049 #: build/C/man3/makecontext.3:197
1050 #, no-wrap
1051 msgid ""
1052 "static void\n"
1053 "func2(void)\n"
1054 "{\n"
1055 "    printf(\"func2: started\\en\");\n"
1056 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1057 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1058 "        handle_error(\"swapcontext\");\n"
1059 "    printf(\"func2: returning\\en\");\n"
1060 "}\n"
1061 msgstr ""
1062 "static void\n"
1063 "func2(void)\n"
1064 "{\n"
1065 "    printf(\"func2: started\\en\");\n"
1066 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1067 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1068 "        handle_error(\"swapcontext\");\n"
1069 "    printf(\"func2: returning\\en\");\n"
1070 "}\n"
1071
1072 #. type: Plain text
1073 #: build/C/man3/makecontext.3:203
1074 #, no-wrap
1075 msgid ""
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 msgstr ""
1082 "int\n"
1083 "main(int argc, char *argv[])\n"
1084 "{\n"
1085 "    char func1_stack[16384];\n"
1086 "    char func2_stack[16384];\n"
1087
1088 #. type: Plain text
1089 #: build/C/man3/makecontext.3:210
1090 #, no-wrap
1091 msgid ""
1092 "    if (getcontext(&uctx_func1) == -1)\n"
1093 "        handle_error(\"getcontext\");\n"
1094 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1095 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1096 "    uctx_func1.uc_link = &uctx_main;\n"
1097 "    makecontext(&uctx_func1, func1, 0);\n"
1098 msgstr ""
1099 "    if (getcontext(&uctx_func1) == -1)\n"
1100 "        handle_error(\"getcontext\");\n"
1101 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1102 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1103 "    uctx_func1.uc_link = &uctx_main;\n"
1104 "    makecontext(&uctx_func1, func1, 0);\n"
1105
1106 #. type: Plain text
1107 #: build/C/man3/makecontext.3:218
1108 #, no-wrap
1109 msgid ""
1110 "    if (getcontext(&uctx_func2) == -1)\n"
1111 "        handle_error(\"getcontext\");\n"
1112 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1113 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1114 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1115 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1116 "    makecontext(&uctx_func2, func2, 0);\n"
1117 msgstr ""
1118 "    if (getcontext(&uctx_func2) == -1)\n"
1119 "        handle_error(\"getcontext\");\n"
1120 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1121 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1122 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1123 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1124 "    makecontext(&uctx_func2, func2, 0);\n"
1125
1126 #. type: Plain text
1127 #: build/C/man3/makecontext.3:222
1128 #, no-wrap
1129 msgid ""
1130 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1131 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1132 "        handle_error(\"swapcontext\");\n"
1133 msgstr ""
1134 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1135 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1136 "        handle_error(\"swapcontext\");\n"
1137
1138 #. type: Plain text
1139 #: build/C/man3/makecontext.3:226
1140 #, no-wrap
1141 msgid ""
1142 "    printf(\"main: exiting\\en\");\n"
1143 "    exit(EXIT_SUCCESS);\n"
1144 "}\n"
1145 msgstr ""
1146 "    printf(\"main: exiting\\en\");\n"
1147 "    exit(EXIT_SUCCESS);\n"
1148 "}\n"
1149
1150 #. type: Plain text
1151 #: build/C/man3/makecontext.3:233
1152 msgid ""
1153 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1154 "B<sigsetjmp>(3)"
1155 msgstr ""
1156 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1157 "B<sigsetjmp>(3)"
1158
1159 #. type: TH
1160 #: build/C/man3/pthread_attr_init.3:26
1161 #, no-wrap
1162 msgid "PTHREAD_ATTR_INIT"
1163 msgstr "PTHREAD_ATTR_INIT"
1164
1165 #. type: TH
1166 #: build/C/man3/pthread_attr_init.3:26
1167 #, no-wrap
1168 msgid "2008-11-11"
1169 msgstr "2008-11-11"
1170
1171 #. type: Plain text
1172 #: build/C/man3/pthread_attr_init.3:30
1173 msgid ""
1174 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1175 "attributes object"
1176 msgstr ""
1177 "pthread_attr_init, pthread_attr_destroy - \n"
1178 "スレッド属性オブジェクトの初期化と破棄を行う"
1179
1180 #. type: Plain text
1181 #: build/C/man3/pthread_attr_init.3:33
1182 #: build/C/man3/pthread_attr_setdetachstate.3:33
1183 #: build/C/man3/pthread_attr_setguardsize.3:33
1184 #: build/C/man3/pthread_attr_setinheritsched.3:33
1185 #: build/C/man3/pthread_attr_setschedparam.3:33
1186 #: build/C/man3/pthread_attr_setschedpolicy.3:33
1187 #: build/C/man3/pthread_attr_setscope.3:33
1188 #: build/C/man3/pthread_attr_setstack.3:33
1189 #: build/C/man3/pthread_attr_setstackaddr.3:33
1190 #: build/C/man3/pthread_attr_setstacksize.3:33
1191 #: build/C/man3/pthread_cancel.3:32 build/C/man3/pthread_cleanup_push.3:33
1192 #: build/C/man3/pthread_cleanup_push_defer_np.3:33
1193 #: build/C/man3/pthread_create.3:32 build/C/man3/pthread_detach.3:32
1194 #: build/C/man3/pthread_equal.3:32 build/C/man3/pthread_exit.3:32
1195 #: build/C/man3/pthread_join.3:32
1196 #: build/C/man3/pthread_kill_other_threads_np.3:32
1197 #: build/C/man3/pthread_rwlockattr_setkind_np.3:32
1198 #: build/C/man3/pthread_self.3:32 build/C/man3/pthread_setcancelstate.3:33
1199 #: build/C/man3/pthread_setconcurrency.3:32
1200 #: build/C/man3/pthread_setschedparam.3:33
1201 #: build/C/man3/pthread_setschedprio.3:32 build/C/man3/pthread_testcancel.3:32
1202 #, no-wrap
1203 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1204 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1205
1206 #. type: Plain text
1207 #: build/C/man3/pthread_attr_init.3:36
1208 #, no-wrap
1209 msgid ""
1210 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1211 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1212 msgstr ""
1213 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1214 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1215
1216 #. type: Plain text
1217 #: build/C/man3/pthread_attr_init.3:38
1218 #: build/C/man3/pthread_attr_setaffinity_np.3:41
1219 #: build/C/man3/pthread_attr_setdetachstate.3:40
1220 #: build/C/man3/pthread_attr_setguardsize.3:40
1221 #: build/C/man3/pthread_attr_setinheritsched.3:40
1222 #: build/C/man3/pthread_attr_setschedparam.3:40
1223 #: build/C/man3/pthread_attr_setschedpolicy.3:40
1224 #: build/C/man3/pthread_attr_setscope.3:40
1225 #: build/C/man3/pthread_attr_setstack.3:40
1226 #: build/C/man3/pthread_attr_setstackaddr.3:40
1227 #: build/C/man3/pthread_attr_setstacksize.3:40
1228 #: build/C/man3/pthread_cancel.3:36 build/C/man3/pthread_cleanup_push.3:39
1229 #: build/C/man3/pthread_equal.3:36 build/C/man3/pthread_exit.3:36
1230 #: build/C/man3/pthread_getattr_np.3:37
1231 #: build/C/man3/pthread_getcpuclockid.3:37
1232 #: build/C/man3/pthread_rwlockattr_setkind_np.3:39
1233 #: build/C/man3/pthread_self.3:36 build/C/man3/pthread_setaffinity_np.3:41
1234 #: build/C/man3/pthread_setcancelstate.3:38
1235 #: build/C/man3/pthread_setconcurrency.3:37
1236 #: build/C/man3/pthread_setschedparam.3:40
1237 #: build/C/man3/pthread_setschedprio.3:36 build/C/man3/pthread_testcancel.3:36
1238 #, no-wrap
1239 msgid "Compile and link with I<-pthread>.\n"
1240 msgstr "I<-pthread> でコンパイルしてリンクする。\n"
1241
1242 #. type: Plain text
1243 #: build/C/man3/pthread_attr_init.3:50
1244 msgid ""
1245 "The B<pthread_attr_init>()  function initializes the thread attributes "
1246 "object pointed to by I<attr> with default attribute values.  After this "
1247 "call, individual attributes of the object can be set using various related "
1248 "functions (listed under SEE ALSO), and then the object can be used in one or "
1249 "more B<pthread_create>(3)  calls that create threads."
1250 msgstr ""
1251 "B<pthread_attr_init>() 関数は I<attr> が指すスレッド属性オブジェクト\n"
1252 "(thread attributes object) をデフォルトの属性値で初期化する。\n"
1253 "この呼び出しの後、オブジェクトの各属性は (関連項目に載っている) 種々の\n"
1254 "関数を使って設定することができ、このオブジェクトはスレッドの作成を行う\n"
1255 "B<pthread_create>(3) の呼び出しにおいて使用することができる (一つの\n"
1256 "オブジェクトを複数の B<pthread_create>(3) に渡してもよい)。"
1257
1258 #. type: Plain text
1259 #: build/C/man3/pthread_attr_init.3:55
1260 msgid ""
1261 "Calling B<pthread_attr_init>()  on a thread attributes object that has "
1262 "already been initialized results in undefined behavior."
1263 msgstr ""
1264 "すでに初期化されているスレッド属性オブジェクトに対して\n"
1265 "B<pthread_attr_init>() を呼び出した場合、\n"
1266 "どのような動作になるかは不定である。"
1267
1268 #. type: Plain text
1269 #: build/C/man3/pthread_attr_init.3:62
1270 msgid ""
1271 "When a thread attributes object is no longer required, it should be "
1272 "destroyed using the B<pthread_attr_destroy>()  function.  Destroying a "
1273 "thread attributes object has no effect on threads that were created using "
1274 "that object."
1275 msgstr ""
1276 "スレッド属性オブジェクトがもはや必要なくなった際には、\n"
1277 "そのオブジェクトは B<pthread_attr_destroy>() 関数を使って破棄すべきである。\n"
1278 "スレッド属性オブジェクトを破棄しても、\n"
1279 "そのオブジェクトを使って作成されたスレッドには影響はない。"
1280
1281 #. type: Plain text
1282 #: build/C/man3/pthread_attr_init.3:68
1283 msgid ""
1284 "Once a thread attributes object has been destroyed, it can be reinitialized "
1285 "using B<pthread_attr_init>().  Any other use of a destroyed thread "
1286 "attributes object has undefined results."
1287 msgstr ""
1288 "いったん破棄したスレッド属性オブジェクトは、\n"
1289 "B<pthread_attr_init>() を使って再初期化することができる。\n"
1290 "破棄したスレッド属性オブジェクトをこれ以外の用途で\n"
1291 "使った場合の結果は不定である。"
1292
1293 #. type: Plain text
1294 #: build/C/man3/pthread_attr_init.3:71
1295 #: build/C/man3/pthread_attr_setaffinity_np.3:79
1296 #: build/C/man3/pthread_attr_setdetachstate.3:80
1297 #: build/C/man3/pthread_attr_setguardsize.3:93
1298 #: build/C/man3/pthread_attr_setinheritsched.3:96
1299 #: build/C/man3/pthread_attr_setschedparam.3:88
1300 #: build/C/man3/pthread_attr_setschedpolicy.3:86
1301 #: build/C/man3/pthread_attr_setscope.3:106
1302 #: build/C/man3/pthread_attr_setstack.3:88
1303 #: build/C/man3/pthread_attr_setstackaddr.3:77
1304 #: build/C/man3/pthread_attr_setstacksize.3:64
1305 #: build/C/man3/pthread_setaffinity_np.3:80
1306 #: build/C/man3/pthread_setcancelstate.3:95
1307 #: build/C/man3/pthread_setname_np.3:75
1308 msgid ""
1309 "On success, these functions return 0; on error, they return a nonzero error "
1310 "number."
1311 msgstr ""
1312 "成功すると、これらの関数は 0 を返す。\n"
1313 "エラーの場合、0 以外のエラー番号を返す。"
1314
1315 #. type: Plain text
1316 #: build/C/man3/pthread_attr_init.3:79
1317 msgid ""
1318 "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on "
1319 "Linux these functions always succeed (but portable and future-proof "
1320 "applications should nevertheless handle a possible error return)."
1321 msgstr ""
1322 "POSIX.1-2001 では B<pthread_attr_init>() にはエラー B<ENOMEM> が\n"
1323 "記載されている。\n"
1324 "Linux では、これらの関数は常に成功する\n"
1325 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
1326 "正のエラーの返り値を処理するようにすべきである)。"
1327
1328 #. type: Plain text
1329 #: build/C/man3/pthread_attr_init.3:81
1330 #: build/C/man3/pthread_attr_setdetachstate.3:96
1331 #: build/C/man3/pthread_attr_setguardsize.3:115
1332 #: build/C/man3/pthread_attr_setinheritsched.3:119
1333 #: build/C/man3/pthread_attr_setschedparam.3:109
1334 #: build/C/man3/pthread_attr_setschedpolicy.3:109
1335 #: build/C/man3/pthread_attr_setscope.3:128
1336 #: build/C/man3/pthread_attr_setstack.3:121
1337 #: build/C/man3/pthread_attr_setstacksize.3:92
1338 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129
1339 #: build/C/man3/pthread_create.3:155 build/C/man3/pthread_detach.3:66
1340 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82
1341 #: build/C/man3/pthread_getcpuclockid.3:72 build/C/man3/pthread_join.3:100
1342 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setcancelstate.3:122
1343 #: build/C/man3/pthread_setconcurrency.3:92
1344 #: build/C/man3/pthread_setschedparam.3:150
1345 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
1346 #: build/C/man3/pthread_testcancel.3:65
1347 msgid "POSIX.1-2001."
1348 msgstr "POSIX.1-2001."
1349
1350 #. type: Plain text
1351 #: build/C/man3/pthread_attr_init.3:87
1352 msgid ""
1353 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1354 "object other than via pthreads functions is nonportable and produces "
1355 "undefined results."
1356 msgstr ""
1357 "I<pthread_attr_t> 型の内部構造は意識すべきではない。\n"
1358 "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n"
1359 "どのような結果が得られるかも分からない。"
1360
1361 #. type: Plain text
1362 #: build/C/man3/pthread_attr_init.3:96
1363 msgid ""
1364 "The program below optionally makes use of B<pthread_attr_init>()  and "
1365 "various related functions to initialize a thread attributes object that is "
1366 "used to create a single thread.  Once created, the thread uses the "
1367 "B<pthread_getattr_np>(3)  function (a nonstandard GNU extension) to retrieve "
1368 "the thread's attributes, and then displays those attributes."
1369 msgstr ""
1370 "下記のプログラムは、B<pthread_attr_init>() と種々の関連関数を使って、\n"
1371 "スレッド属性オブジェクトの初期化を行い、\n"
1372 "そのオブジェクトを使ってスレッドを一つ作成する。\n"
1373 "作成されたスレッドは、作成後に B<pthread_getattr_np>(3) 関数 \n"
1374 "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n"
1375 "取得した属性を表示する。"
1376
1377 #. type: Plain text
1378 #: build/C/man3/pthread_attr_init.3:105
1379 msgid ""
1380 "If the program is run with no command-line argument, then it passes NULL as "
1381 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1382 "with default attributes.  Running the program on Linux/x86-32 with the NPTL "
1383 "threading implementation, we see the following:"
1384 msgstr ""
1385 "コマンドライン引き数なしでプログラムを実行した場合、\n"
1386 "B<pthread_create>(3) の I<attr> 引き数には NULL が渡される。\n"
1387 "この場合、スレッドはデフォルトの属性で作成される。\n"
1388 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1389 "動作させると、以下のような出力が得られる。"
1390
1391 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1392 #. type: Plain text
1393 #: build/C/man3/pthread_attr_init.3:121
1394 #, no-wrap
1395 msgid ""
1396 "$B< ulimit -s>       # No stack limit ==E<gt> default stack size is 2MB\n"
1397 "unlimited\n"
1398 "$B< ./a.out>\n"
1399 "Thread attributes:\n"
1400 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1401 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1402 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1403 "        Scheduling policy   = SCHED_OTHER\n"
1404 "        Scheduling priority = 0\n"
1405 "        Guard size          = 4096 bytes\n"
1406 "        Stack address       = 0x40196000\n"
1407 "        Stack size          = 0x201000 bytes\n"
1408 msgstr ""
1409 "$B< ulimit -s>       # No stack limit ==E<gt> default stack size is 2MB\n"
1410 "unlimited\n"
1411 "$B< ./a.out>\n"
1412 "Thread attributes:\n"
1413 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1414 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1415 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1416 "        Scheduling policy   = SCHED_OTHER\n"
1417 "        Scheduling priority = 0\n"
1418 "        Guard size          = 4096 bytes\n"
1419 "        Stack address       = 0x40196000\n"
1420 "        Stack size          = 0x201000 bytes\n"
1421
1422 #. type: Plain text
1423 #: build/C/man3/pthread_attr_init.3:131
1424 msgid ""
1425 "When we supply a stack size as a command-line argument, the program "
1426 "initializes a thread attributes object, sets various attributes in that "
1427 "object, and passes a pointer to the object in the call to "
1428 "B<pthread_create>(3).  Running the program on Linux/x86-32 with the NPTL "
1429 "threading implementation, we see the following:"
1430 msgstr ""
1431 "コマンドライン引き数でスタックサイズが与えられた場合、\n"
1432 "このプログラムは、スレッド属性オブジェクトを初期化し、\n"
1433 "そのオブジェクトの各種属性を設定し、\n"
1434 "B<pthread_create>(3) の呼び出しでこのオブジェクトへのポインターを渡す。\n"
1435 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1436 "動作させると、以下のような出力が得られる。"
1437
1438 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1439 #. type: Plain text
1440 #: build/C/man3/pthread_attr_init.3:146
1441 #, no-wrap
1442 msgid ""
1443 "$B< ./a.out 0x3000000>\n"
1444 "posix_memalign() allocated at 0x40197000\n"
1445 "Thread attributes:\n"
1446 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1447 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1448 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1449 "        Scheduling policy   = SCHED_OTHER\n"
1450 "        Scheduling priority = 0\n"
1451 "        Guard size          = 0 bytes\n"
1452 "        Stack address       = 0x40197000\n"
1453 "        Stack size          = 0x3000000 bytes\n"
1454 msgstr ""
1455 "$B< ./a.out 0x3000000>\n"
1456 "posix_memalign() allocated at 0x40197000\n"
1457 "Thread attributes:\n"
1458 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1459 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1460 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1461 "        Scheduling policy   = SCHED_OTHER\n"
1462 "        Scheduling priority = 0\n"
1463 "        Guard size          = 0 bytes\n"
1464 "        Stack address       = 0x40197000\n"
1465 "        Stack size          = 0x3000000 bytes\n"
1466
1467 #. type: Plain text
1468 #: build/C/man3/pthread_attr_init.3:157 build/C/man3/pthread_getattr_np.3:188
1469 #, no-wrap
1470 msgid ""
1471 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1472 "#include E<lt>pthread.hE<gt>\n"
1473 "#include E<lt>stdio.hE<gt>\n"
1474 "#include E<lt>stdlib.hE<gt>\n"
1475 "#include E<lt>unistd.hE<gt>\n"
1476 "#include E<lt>errno.hE<gt>\n"
1477 msgstr ""
1478 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1479 "#include E<lt>pthread.hE<gt>\n"
1480 "#include E<lt>stdio.hE<gt>\n"
1481 "#include E<lt>stdlib.hE<gt>\n"
1482 "#include E<lt>unistd.hE<gt>\n"
1483 "#include E<lt>errno.hE<gt>\n"
1484
1485 #. type: Plain text
1486 #: build/C/man3/pthread_attr_init.3:160 build/C/man3/pthread_cancel.3:162
1487 #: build/C/man3/pthread_cleanup_push.3:243 build/C/man3/pthread_create.3:261
1488 #: build/C/man3/pthread_getattr_np.3:191
1489 #: build/C/man3/pthread_getcpuclockid.3:119
1490 #: build/C/man3/pthread_setaffinity_np.3:179
1491 #: build/C/man3/pthread_setschedparam.3:244 build/C/man3/pthread_sigmask.3:110
1492 #, no-wrap
1493 msgid ""
1494 "#define handle_error_en(en, msg) \\e\n"
1495 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1496 msgstr ""
1497 "#define handle_error_en(en, msg) \\e\n"
1498 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1499
1500 #. type: Plain text
1501 #: build/C/man3/pthread_attr_init.3:168
1502 #, no-wrap
1503 msgid ""
1504 "static void\n"
1505 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1506 "{\n"
1507 "    int s, i;\n"
1508 "    size_t v;\n"
1509 "    void *stkaddr;\n"
1510 "    struct sched_param sp;\n"
1511 msgstr ""
1512 "static void\n"
1513 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1514 "{\n"
1515 "    int s, i;\n"
1516 "    size_t v;\n"
1517 "    void *stkaddr;\n"
1518 "    struct sched_param sp;\n"
1519
1520 #. type: Plain text
1521 #: build/C/man3/pthread_attr_init.3:176
1522 #, no-wrap
1523 msgid ""
1524 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1525 "    if (s != 0)\n"
1526 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1527 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1528 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1529 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1530 "            \"???\");\n"
1531 msgstr ""
1532 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1533 "    if (s != 0)\n"
1534 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1535 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1536 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1537 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1538 "            \"???\");\n"
1539
1540 #. type: Plain text
1541 #: build/C/man3/pthread_attr_init.3:184
1542 #, no-wrap
1543 msgid ""
1544 "    s = pthread_attr_getscope(attr, &i);\n"
1545 "    if (s != 0)\n"
1546 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1547 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1548 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1549 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1550 "            \"???\");\n"
1551 msgstr ""
1552 "    s = pthread_attr_getscope(attr, &i);\n"
1553 "    if (s != 0)\n"
1554 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1555 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1556 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1557 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1558 "            \"???\");\n"
1559
1560 #. type: Plain text
1561 #: build/C/man3/pthread_attr_init.3:192
1562 #, no-wrap
1563 msgid ""
1564 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1565 "    if (s != 0)\n"
1566 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1567 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1568 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1569 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1570 "            \"???\");\n"
1571 msgstr ""
1572 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1573 "    if (s != 0)\n"
1574 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1575 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1576 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1577 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1578 "            \"???\");\n"
1579
1580 #. type: Plain text
1581 #: build/C/man3/pthread_attr_init.3:201
1582 #, no-wrap
1583 msgid ""
1584 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1585 "    if (s != 0)\n"
1586 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1587 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1588 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1589 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1590 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1591 "            \"???\");\n"
1592 msgstr ""
1593 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1594 "    if (s != 0)\n"
1595 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1596 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1597 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1598 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1599 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1600 "            \"???\");\n"
1601
1602 #. type: Plain text
1603 #: build/C/man3/pthread_attr_init.3:206
1604 #, no-wrap
1605 msgid ""
1606 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1607 "    if (s != 0)\n"
1608 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1609 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1610 msgstr ""
1611 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1612 "    if (s != 0)\n"
1613 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1614 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1615
1616 #. type: Plain text
1617 #: build/C/man3/pthread_attr_init.3:211
1618 #, no-wrap
1619 msgid ""
1620 "    s = pthread_attr_getguardsize(attr, &v);\n"
1621 "    if (s != 0)\n"
1622 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1623 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1624 msgstr ""
1625 "    s = pthread_attr_getguardsize(attr, &v);\n"
1626 "    if (s != 0)\n"
1627 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1628 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1629
1630 #. type: Plain text
1631 #: build/C/man3/pthread_attr_init.3:218
1632 #, no-wrap
1633 msgid ""
1634 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1635 "    if (s != 0)\n"
1636 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1637 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1638 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1639 "}\n"
1640 msgstr ""
1641 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1642 "    if (s != 0)\n"
1643 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1644 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1645 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1646 "}\n"
1647
1648 #. type: Plain text
1649 #: build/C/man3/pthread_attr_init.3:224
1650 #, no-wrap
1651 msgid ""
1652 "static void *\n"
1653 "thread_start(void *arg)\n"
1654 "{\n"
1655 "    int s;\n"
1656 "    pthread_attr_t gattr;\n"
1657 msgstr ""
1658 "static void *\n"
1659 "thread_start(void *arg)\n"
1660 "{\n"
1661 "    int s;\n"
1662 "    pthread_attr_t gattr;\n"
1663
1664 #. type: Plain text
1665 #: build/C/man3/pthread_attr_init.3:228
1666 #, no-wrap
1667 msgid ""
1668 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1669 "       retrieves the attributes of the thread specified in its\n"
1670 "       first argument */\n"
1671 msgstr ""
1672 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1673 "       retrieves the attributes of the thread specified in its\n"
1674 "       first argument */\n"
1675
1676 #. type: Plain text
1677 #: build/C/man3/pthread_attr_init.3:232
1678 #, no-wrap
1679 msgid ""
1680 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1681 "    if (s != 0)\n"
1682 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1683 msgstr ""
1684 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1685 "    if (s != 0)\n"
1686 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1687
1688 #. type: Plain text
1689 #: build/C/man3/pthread_attr_init.3:235
1690 #, no-wrap
1691 msgid ""
1692 "    printf(\"Thread attributes:\\en\");\n"
1693 "    display_pthread_attr(&gattr, \"\\et\");\n"
1694 msgstr ""
1695 "    printf(\"Thread attributes:\\en\");\n"
1696 "    display_pthread_attr(&gattr, \"\\et\");\n"
1697
1698 #. type: Plain text
1699 #: build/C/man3/pthread_attr_init.3:238 build/C/man3/pthread_getattr_np.3:240
1700 #, no-wrap
1701 msgid ""
1702 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1703 "}\n"
1704 msgstr ""
1705 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1706 "}\n"
1707
1708 #. type: Plain text
1709 #: build/C/man3/pthread_attr_init.3:246
1710 #, no-wrap
1711 msgid ""
1712 "int\n"
1713 "main(int argc, char *argv[])\n"
1714 "{\n"
1715 "    pthread_t thr;\n"
1716 "    pthread_attr_t attr;\n"
1717 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1718 "    int s;\n"
1719 msgstr ""
1720 "int\n"
1721 "main(int argc, char *argv[])\n"
1722 "{\n"
1723 "    pthread_t thr;\n"
1724 "    pthread_attr_t attr;\n"
1725 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1726 "    int s;\n"
1727
1728 #. type: Plain text
1729 #: build/C/man3/pthread_attr_init.3:248
1730 #: build/C/man3/pthread_setschedparam.3:362
1731 #, no-wrap
1732 msgid "    attrp = NULL;\n"
1733 msgstr "    attrp = NULL;\n"
1734
1735 #. type: Plain text
1736 #: build/C/man3/pthread_attr_init.3:252
1737 #, no-wrap
1738 msgid ""
1739 "    /* If a command-line argument was supplied, use it to set the\n"
1740 "       stack-size attribute and set a few other thread attributes,\n"
1741 "       and set attrp pointing to thread attributes object */\n"
1742 msgstr ""
1743 "    /* If a command-line argument was supplied, use it to set the\n"
1744 "       stack-size attribute and set a few other thread attributes,\n"
1745 "       and set attrp pointing to thread attributes object */\n"
1746
1747 #. type: Plain text
1748 #: build/C/man3/pthread_attr_init.3:256
1749 #, no-wrap
1750 msgid ""
1751 "    if (argc E<gt> 1) {\n"
1752 "        int stack_size;\n"
1753 "        void *sp;\n"
1754 msgstr ""
1755 "    if (argc E<gt> 1) {\n"
1756 "        int stack_size;\n"
1757 "        void *sp;\n"
1758
1759 #. type: Plain text
1760 #: build/C/man3/pthread_attr_init.3:258
1761 #, no-wrap
1762 msgid "        attrp = &attr;\n"
1763 msgstr "        attrp = &attr;\n"
1764
1765 #. type: Plain text
1766 #: build/C/man3/pthread_attr_init.3:262
1767 #, no-wrap
1768 msgid ""
1769 "        s = pthread_attr_init(&attr);\n"
1770 "        if (s != 0)\n"
1771 "            handle_error_en(s, \"pthread_attr_init\");\n"
1772 msgstr ""
1773 "        s = pthread_attr_init(&attr);\n"
1774 "        if (s != 0)\n"
1775 "            handle_error_en(s, \"pthread_attr_init\");\n"
1776
1777 #. type: Plain text
1778 #: build/C/man3/pthread_attr_init.3:266
1779 #, no-wrap
1780 msgid ""
1781 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1782 "        if (s != 0)\n"
1783 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1784 msgstr ""
1785 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1786 "        if (s != 0)\n"
1787 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1788
1789 #. type: Plain text
1790 #: build/C/man3/pthread_attr_init.3:270
1791 #, no-wrap
1792 msgid ""
1793 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1794 "        if (s != 0)\n"
1795 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1796 msgstr ""
1797 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1798 "        if (s != 0)\n"
1799 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1800
1801 #. type: Plain text
1802 #: build/C/man3/pthread_attr_init.3:272
1803 #, no-wrap
1804 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1805 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
1806
1807 #. type: Plain text
1808 #: build/C/man3/pthread_attr_init.3:276
1809 #, no-wrap
1810 msgid ""
1811 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1812 "        if (s != 0)\n"
1813 "            handle_error_en(s, \"posix_memalign\");\n"
1814 msgstr ""
1815 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1816 "        if (s != 0)\n"
1817 "            handle_error_en(s, \"posix_memalign\");\n"
1818
1819 #. type: Plain text
1820 #: build/C/man3/pthread_attr_init.3:278
1821 #, no-wrap
1822 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1823 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1824
1825 #. type: Plain text
1826 #: build/C/man3/pthread_attr_init.3:283
1827 #, no-wrap
1828 msgid ""
1829 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1830 "        if (s != 0)\n"
1831 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1832 "    }\n"
1833 msgstr ""
1834 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1835 "        if (s != 0)\n"
1836 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1837 "    }\n"
1838
1839 #. type: Plain text
1840 #: build/C/man3/pthread_attr_init.3:287 build/C/man3/pthread_getattr_np.3:335
1841 #, no-wrap
1842 msgid ""
1843 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1844 "    if (s != 0)\n"
1845 "        handle_error_en(s, \"pthread_create\");\n"
1846 msgstr ""
1847 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1848 "    if (s != 0)\n"
1849 "        handle_error_en(s, \"pthread_create\");\n"
1850
1851 #. type: Plain text
1852 #: build/C/man3/pthread_attr_init.3:293 build/C/man3/pthread_getattr_np.3:341
1853 #, no-wrap
1854 msgid ""
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 msgstr ""
1861 "    if (attrp != NULL) {\n"
1862 "        s = pthread_attr_destroy(attrp);\n"
1863 "        if (s != 0)\n"
1864 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1865 "    }\n"
1866
1867 #. type: Plain text
1868 #: build/C/man3/pthread_attr_init.3:296 build/C/man3/pthread_getattr_np.3:344
1869 #, no-wrap
1870 msgid ""
1871 "    pause();    /* Terminates when other thread calls exit() */\n"
1872 "}\n"
1873 msgstr ""
1874 "    pause();    /* Terminates when other thread calls exit() */\n"
1875 "}\n"
1876
1877 #. type: Plain text
1878 #: build/C/man3/pthread_attr_init.3:313
1879 msgid ""
1880 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1881 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1882 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1883 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1884 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1885 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1886 msgstr ""
1887 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1888 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1889 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1890 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1891 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1892 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1893
1894 #. type: TH
1895 #: build/C/man3/pthread_attr_setaffinity_np.3:26
1896 #, no-wrap
1897 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1898 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1899
1900 #. type: Plain text
1901 #: build/C/man3/pthread_attr_setaffinity_np.3:30
1902 msgid ""
1903 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1904 "affinity attribute in thread attributes object"
1905 msgstr ""
1906 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
1907 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
1908
1909 #. type: Plain text
1910 #: build/C/man3/pthread_attr_setaffinity_np.3:34
1911 #: build/C/man3/pthread_getattr_np.3:33
1912 #: build/C/man3/pthread_setaffinity_np.3:34
1913 #: build/C/man3/pthread_tryjoin_np.3:34 build/C/man3/pthread_yield.3:32
1914 #, no-wrap
1915 msgid ""
1916 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1917 "B<#include E<lt>pthread.hE<gt>>\n"
1918 msgstr ""
1919 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1920 "B<#include E<lt>pthread.hE<gt>>\n"
1921
1922 #. type: Plain text
1923 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1924 #, no-wrap
1925 msgid ""
1926 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1927 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1928 "B<int pthread_attr_getaffinity_np(const pthread_attr_t *>I<attr>B<,>\n"
1929 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1930 msgstr ""
1931 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1932 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1933 "B<int pthread_attr_getaffinity_np(const pthread_attr_t *>I<attr>B<,>\n"
1934 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1935
1936 #. type: Plain text
1937 #: build/C/man3/pthread_attr_setaffinity_np.3:54
1938 msgid ""
1939 "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask "
1940 "attribute of the thread attributes object referred to by I<attr> to the "
1941 "value specified in I<cpuset>.  This attribute determines the CPU affinity "
1942 "mask of a thread created using the thread attributes object I<attr>."
1943 msgstr ""
1944 "B<pthread_attr_setaffinity_np>() 関数は、\n"
1945 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
1946 "I<cpuset> で指定された値に設定する。\n"
1947 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
1948 "作成されたスレッドの CPU affinity マスクが決定される。"
1949
1950 #. type: Plain text
1951 #: build/C/man3/pthread_attr_setaffinity_np.3:63
1952 msgid ""
1953 "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask "
1954 "attribute of the thread attributes object referred to by I<attr> in the "
1955 "buffer pointed to by I<cpuset>."
1956 msgstr ""
1957 "B<pthread_attr_getaffinity_np>() 関数は、 I<attr> が参照する\n"
1958 "スレッド属性オブジェクトの CPU affinity マスク属性を\n"
1959 "I<cpuset> が指すバッファーに入れて返す。"
1960
1961 #. type: Plain text
1962 #: build/C/man3/pthread_attr_setaffinity_np.3:70
1963 msgid ""
1964 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1965 "by I<cpuset>.  Typically, this argument would be specified as "
1966 "I<sizeof(cpu_set_t)>."
1967 msgstr ""
1968 "I<cpusetsize> 引き数は I<cpuset> が指すバッファーの (バイト単位の)\n"
1969 "大きさである。通常は、この引き数には I<sizeof(cpu_set_t)> を\n"
1970 "指定することだろう。"
1971
1972 #. type: Plain text
1973 #: build/C/man3/pthread_attr_setaffinity_np.3:76
1974 #: build/C/man3/pthread_setaffinity_np.3:67
1975 msgid ""
1976 "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a "
1977 "description of a set of macros that can be used to manipulate and inspect "
1978 "CPU sets, see B<CPU_SET>(3)."
1979 msgstr ""
1980 "CPU affinity マスクの詳細については、 \n"
1981 "B<sched_setaffinity>(2) を参照してほしい。\n"
1982 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
1983 "B<CPU_SET>(3) を参照してほしい。"
1984
1985 #. type: TP
1986 #: build/C/man3/pthread_attr_setaffinity_np.3:80
1987 #: build/C/man3/pthread_attr_setaffinity_np.3:92
1988 #: build/C/man3/pthread_attr_setdetachstate.3:83
1989 #: build/C/man3/pthread_attr_setinheritsched.3:99
1990 #: build/C/man3/pthread_attr_setschedpolicy.3:89
1991 #: build/C/man3/pthread_attr_setscope.3:109
1992 #: build/C/man3/pthread_attr_setstack.3:91
1993 #: build/C/man3/pthread_attr_setstacksize.3:67
1994 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:55
1995 #: build/C/man3/pthread_join.3:85 build/C/man3/pthread_join.3:89
1996 #: build/C/man3/pthread_kill.3:69
1997 #: build/C/man3/pthread_rwlockattr_setkind_np.3:105
1998 #: build/C/man3/pthread_setaffinity_np.3:84
1999 #: build/C/man3/pthread_setaffinity_np.3:93
2000 #: build/C/man3/pthread_setaffinity_np.3:109
2001 #: build/C/man3/pthread_setcancelstate.3:99
2002 #: build/C/man3/pthread_setcancelstate.3:107
2003 #: build/C/man3/pthread_setconcurrency.3:71
2004 #: build/C/man3/pthread_setschedparam.3:122
2005 #: build/C/man3/pthread_setschedprio.3:62 build/C/man3/pthread_sigqueue.3:78
2006 #: build/C/man3/pthread_tryjoin_np.3:106
2007 #, no-wrap
2008 msgid "B<EINVAL>"
2009 msgstr "B<EINVAL>"
2010
2011 #.  cpumask_t
2012 #.  The raw sched_getaffinity() system call returns the size (in bytes)
2013 #.  of the cpumask_t type.
2014 #. type: Plain text
2015 #: build/C/man3/pthread_attr_setaffinity_np.3:92
2016 msgid ""
2017 "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was "
2018 "outside the set supported by the kernel.  (The kernel configuration option "
2019 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
2020 "type used to represent CPU sets.)"
2021 msgstr ""
2022 "(B<pthread_attr_setaffinity_np>())\n"
2023 "I<cpuset> がカーネルがサポートする CPU 集合にない CPU を指定していた。\n"
2024 "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲"
2025 "は、\n"
2026 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
2027
2028 #. type: Plain text
2029 #: build/C/man3/pthread_attr_setaffinity_np.3:102
2030 msgid ""
2031 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
2032 "attributes object referred to by I<attr> lies outside the range specified by "
2033 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
2034 msgstr ""
2035 "(B<pthread_attr_getaffinity_np>())\n"
2036 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
2037 "I<cpusetsize> により指定された範囲の中になかった\n"
2038 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
2039
2040 #. type: Plain text
2041 #: build/C/man3/pthread_attr_setaffinity_np.3:106
2042 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
2043 msgstr ""
2044 "(B<pthread_attr_setaffinity_np>()) メモリーを割り当てることができなかった。"
2045
2046 #. type: Plain text
2047 #: build/C/man3/pthread_attr_setaffinity_np.3:108
2048 #: build/C/man3/pthread_setaffinity_np.3:121
2049 msgid "These functions are provided by glibc since version 2.3.4."
2050 msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。"
2051
2052 #. type: Plain text
2053 #: build/C/man3/pthread_attr_setaffinity_np.3:111
2054 #: build/C/man3/pthread_cleanup_push_defer_np.3:117
2055 #: build/C/man3/pthread_setaffinity_np.3:131
2056 #: build/C/man3/pthread_tryjoin_np.3:123
2057 msgid ""
2058 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
2059 "\" (nonportable) in the names."
2060 msgstr ""
2061 "これらの関数は非標準の GNU による拡張である。\n"
2062 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
2063 "付いている。"
2064
2065 #. type: Plain text
2066 #: build/C/man3/pthread_attr_setaffinity_np.3:118
2067 #: build/C/man3/pthread_setaffinity_np.3:157
2068 msgid ""
2069 "In glibc 2.3.3 only, versions of these functions were provided that did not "
2070 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
2071 "underlying system calls was always I<sizeof(cpu_set_t)>."
2072 msgstr ""
2073 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
2074 "これらの関数は I<cpusetsize> 引き数を持っていなかった。\n"
2075 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
2076 "常に I<sizeof(cpu_set_t)> であった。"
2077
2078 #. type: Plain text
2079 #: build/C/man3/pthread_attr_setaffinity_np.3:124
2080 msgid ""
2081 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2082 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2083 msgstr ""
2084 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2085 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2086
2087 #. type: TH
2088 #: build/C/man3/pthread_attr_setdetachstate.3:26
2089 #, no-wrap
2090 msgid "PTHREAD_ATTR_SETDETACHSTATE"
2091 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
2092
2093 #. type: Plain text
2094 #: build/C/man3/pthread_attr_setdetachstate.3:30
2095 msgid ""
2096 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
2097 "state attribute in thread attributes object"
2098 msgstr ""
2099 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
2100 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
2101
2102 #. type: Plain text
2103 #: build/C/man3/pthread_attr_setdetachstate.3:38
2104 #, no-wrap
2105 msgid ""
2106 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2107 "B<int pthread_attr_getdetachstate(const pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2108 msgstr ""
2109 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2110 "B<int pthread_attr_getdetachstate(const pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2111
2112 #. type: Plain text
2113 #: build/C/man3/pthread_attr_setdetachstate.3:53
2114 msgid ""
2115 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
2116 "attribute of the thread attributes object referred to by I<attr> to the "
2117 "value specified in I<detachstate>.  The detach state attribute determines "
2118 "whether a thread created using the thread attributes object I<attr> will be "
2119 "created in a joinable or a detached state."
2120 msgstr ""
2121 "B<pthread_attr_setdetachstate>() 関数は、\n"
2122 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
2123 "I<detachstate> で指定された値に設定する。\n"
2124 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2125 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
2126 "detached (切り離された) 状態で作成されるかが決定される。"
2127
2128 #. type: Plain text
2129 #: build/C/man3/pthread_attr_setdetachstate.3:56
2130 msgid "The following values may be specified in I<detachstate>:"
2131 msgstr "I<detachstate> には以下の値を指定できる。"
2132
2133 #. type: TP
2134 #: build/C/man3/pthread_attr_setdetachstate.3:56
2135 #, no-wrap
2136 msgid "B<PTHREAD_CREATE_DETACHED>"
2137 msgstr "B<PTHREAD_CREATE_DETACHED>"
2138
2139 #. type: Plain text
2140 #: build/C/man3/pthread_attr_setdetachstate.3:61
2141 msgid ""
2142 "Threads that are created using I<attr> will be created in a detached state."
2143 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
2144
2145 #. type: TP
2146 #: build/C/man3/pthread_attr_setdetachstate.3:61
2147 #, no-wrap
2148 msgid "B<PTHREAD_CREATE_JOINABLE>"
2149 msgstr "B<PTHREAD_CREATE_JOINABLE>"
2150
2151 #. type: Plain text
2152 #: build/C/man3/pthread_attr_setdetachstate.3:66
2153 msgid ""
2154 "Threads that are created using I<attr> will be created in a joinable state."
2155 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
2156
2157 #. type: Plain text
2158 #: build/C/man3/pthread_attr_setdetachstate.3:70
2159 msgid ""
2160 "The default setting of the detach state attribute in a newly initialized "
2161 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
2162 msgstr ""
2163 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
2164 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
2165
2166 #. type: Plain text
2167 #: build/C/man3/pthread_attr_setdetachstate.3:77
2168 msgid ""
2169 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
2170 "the thread attributes object I<attr> in the buffer pointed to by "
2171 "I<detachstate>."
2172 msgstr ""
2173 "B<pthread_attr_getdetachstate>() は、\n"
2174 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
2175 "I<detachstate> が指すバッファーに入れて返す。"
2176
2177 #. type: Plain text
2178 #: build/C/man3/pthread_attr_setdetachstate.3:83
2179 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
2180 msgstr "B<pthread_attr_setdetachstate>() は以下のエラーで失敗する場合がある。"
2181
2182 #. type: Plain text
2183 #: build/C/man3/pthread_attr_setdetachstate.3:87
2184 msgid "An invalid value was specified in I<detachstate>."
2185 msgstr "無効な値が I<detachstate> で指定された。"
2186
2187 #. type: Plain text
2188 #: build/C/man3/pthread_attr_setdetachstate.3:94
2189 msgid ""
2190 "The B<pthread_attr_setdetachstate>()  and B<pthread_attr_getdetachstate>()  "
2191 "functions are thread-safe."
2192 msgstr ""
2193 "関数 B<pthread_attr_setdetachstate>() と B<pthread_attr_getdetachstate>() は"
2194 "スレッドセーフである。"
2195
2196 #. type: Plain text
2197 #: build/C/man3/pthread_attr_setdetachstate.3:100
2198 msgid ""
2199 "See B<pthread_create>(3)  for more details on detached and joinable threads."
2200 msgstr ""
2201 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
2202 "B<pthread_create>(3) を参照。"
2203
2204 #. type: Plain text
2205 #: build/C/man3/pthread_attr_setdetachstate.3:108
2206 msgid ""
2207 "A thread that is created in a joinable state should eventually either be "
2208 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
2209 "B<pthread_create>(3)."
2210 msgstr ""
2211 "join 可能状態で作成されたスレッドは、最終的に\n"
2212 "B<pthread_join>(3) を使って join するか、\n"
2213 "B<pthread_detach>(3) を使って切り離すか、\n"
2214 "のどちらかを行うべきである。"
2215
2216 #. type: Plain text
2217 #: build/C/man3/pthread_attr_setdetachstate.3:115
2218 msgid ""
2219 "It is an error to specify the thread ID of a thread that was created in a "
2220 "detached state in a later call to B<pthread_detach>(3)  or "
2221 "B<pthread_join>(3)."
2222 msgstr ""
2223 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
2224 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
2225 "エラーである。"
2226
2227 #. type: Plain text
2228 #: build/C/man3/pthread_attr_setdetachstate.3:118
2229 #: build/C/man3/pthread_attr_setstack.3:162
2230 msgid "See B<pthread_attr_init>(3)."
2231 msgstr "B<pthread_attr_init>(3) を参照。"
2232
2233 #. type: Plain text
2234 #: build/C/man3/pthread_attr_setdetachstate.3:124
2235 msgid ""
2236 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2237 "B<pthread_join>(3), B<pthreads>(7)"
2238 msgstr ""
2239 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2240 "B<pthread_join>(3), B<pthreads>(7)"
2241
2242 #. type: TH
2243 #: build/C/man3/pthread_attr_setguardsize.3:26
2244 #, no-wrap
2245 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2246 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2247
2248 #. type: Plain text
2249 #: build/C/man3/pthread_attr_setguardsize.3:30
2250 msgid ""
2251 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2252 "attribute in thread attributes object"
2253 msgstr ""
2254 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
2255 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
2256
2257 #. type: Plain text
2258 #: build/C/man3/pthread_attr_setguardsize.3:38
2259 #, no-wrap
2260 msgid ""
2261 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2262 "B<int pthread_attr_getguardsize(const pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2263 msgstr ""
2264 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2265 "B<int pthread_attr_getguardsize(const pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2266
2267 #. type: Plain text
2268 #: build/C/man3/pthread_attr_setguardsize.3:49
2269 msgid ""
2270 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
2271 "of the thread attributes object referred to by I<attr> to the value "
2272 "specified in I<guardsize>."
2273 msgstr ""
2274 "B<pthread_attr_setguardsize>() 関数は、\n"
2275 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
2276 "I<guardsize> で指定された値に設定する。"
2277
2278 #. type: Plain text
2279 #: build/C/man3/pthread_attr_setguardsize.3:59
2280 msgid ""
2281 "If I<guardsize> is greater than 0, then for each new thread created using "
2282 "I<attr> the system allocates an additional region of at least I<guardsize> "
2283 "bytes at the end of the thread's stack to act as the guard area for the "
2284 "stack (but see BUGS)."
2285 msgstr ""
2286 "I<guardsize> が 0 より大きい場合、\n"
2287 "I<attr> を使って新しく作成された各スレッドに対して、\n"
2288 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
2289 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
2290 "機能する (ただし「バグ」の節も参照)。"
2291
2292 #. type: Plain text
2293 #: build/C/man3/pthread_attr_setguardsize.3:65
2294 msgid ""
2295 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2296 "guard area."
2297 msgstr ""
2298 "I<guardsize> が 0 の場合、\n"
2299 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
2300
2301 #. type: Plain text
2302 #: build/C/man3/pthread_attr_setguardsize.3:67
2303 msgid "The default guard size is the same as the system page size."
2304 msgstr "デフォルトの guard size はシステムのページサイズと同じである。"
2305
2306 #. type: Plain text
2307 #: build/C/man3/pthread_attr_setguardsize.3:82
2308 msgid ""
2309 "If the stack address attribute has been set in I<attr> (using "
2310 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
2311 "that the caller is allocating the thread's stack, then the guard size "
2312 "attribute is ignored (i.e., no guard area is created by the system): it is "
2313 "the application's responsibility to handle stack overflow (perhaps by using "
2314 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
2315 "it has allocated)."
2316 msgstr ""
2317 "(B<pthread_attr_setstack>(3) や B<pthread_attr_setstackaddr>(3)を使って)\n"
2318 "I<attr> でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n"
2319 "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n"
2320 "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n"
2321 "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n"
2322 "ケーション側の責任となる (おそらく B<mprotect>(2) を使って、割り当て\n"
2323 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
2324
2325 #. type: Plain text
2326 #: build/C/man3/pthread_attr_setguardsize.3:90
2327 msgid ""
2328 "The B<pthread_attr_getguardsize>()  function returns the guard size "
2329 "attribute of the thread attributes object referred to by I<attr> in the "
2330 "buffer pointed to by I<guardsize>."
2331 msgstr ""
2332 "B<pthread_attr_getguardsize>() は、\n"
2333 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
2334 "I<guardsize> が指すバッファーに入れて返す。"
2335
2336 #. type: Plain text
2337 #: build/C/man3/pthread_attr_setguardsize.3:104
2338 msgid ""
2339 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2340 "invalid.  On Linux these functions always succeed (but portable and future-"
2341 "proof applications should nevertheless handle a possible error return)."
2342 msgstr ""
2343 "POSIX.1-2001 では、エラー B<EINVAL> が\n"
2344 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2345 "Linux では、これらの関数は常に成功する\n"
2346 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2347 "正のエラーの返り値を処理するようにすべきである)。"
2348
2349 #. type: Plain text
2350 #: build/C/man3/pthread_attr_setguardsize.3:106
2351 #: build/C/man3/pthread_attr_setstackaddr.3:83
2352 #: build/C/man3/pthread_attr_setstacksize.3:83
2353 msgid "These functions are provided by glibc since version 2.1."
2354 msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。"
2355
2356 #. type: Plain text
2357 #: build/C/man3/pthread_attr_setguardsize.3:113
2358 msgid ""
2359 "The B<pthread_attr_setguardsize>()  and B<pthread_attr_getguardsize>()  "
2360 "functions are thread-safe."
2361 msgstr ""
2362 "関数 B<pthread_attr_setguardsize>() と B<pthread_attr_getguardsize>() はス"
2363 "レッドセーフである。"
2364
2365 #. type: Plain text
2366 #: build/C/man3/pthread_attr_setguardsize.3:129
2367 msgid ""
2368 "A guard area consists of virtual memory pages that are protected to prevent "
2369 "read and write access.  If a thread overflows its stack into the guard area, "
2370 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2371 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
2372 "guard size is internally rounded up to the system page size when creating a "
2373 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
2374 "size that was set by B<pthread_attr_setguardsize>().)"
2375 msgstr ""
2376 "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n"
2377 "られた仮想メモリーページで構成で構成される。スレッドがスタックをガード\n"
2378 "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャー\n"
2379 "では、スレッドに B<SIGSEGV> シグナルが送られ、オーバーフローが発生した\n"
2380 "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n"
2381 "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n"
2382 "(その場合も B<pthread_attr_getguardsize>() では\n"
2383 "B<pthread_attr_setguardsize>() で設定された guard size が返される)。"
2384
2385 #. type: Plain text
2386 #: build/C/man3/pthread_attr_setguardsize.3:133
2387 msgid ""
2388 "Setting a guard size of 0 may be useful to save memory in an application "
2389 "that creates many threads and knows that stack overflow can never occur."
2390 msgstr ""
2391 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2392 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2393 "することで、メモリーを節約できることもある。"
2394
2395 #. type: Plain text
2396 #: build/C/man3/pthread_attr_setguardsize.3:137
2397 msgid ""
2398 "Choosing a guard size larger than the default size may be necessary for "
2399 "detecting stack overflows if a thread allocates large data structures on the "
2400 "stack."
2401 msgstr ""
2402 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2403 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2404 "大きな guard size を選ぶ必要があるかもしれない。"
2405
2406 #. type: SH
2407 #: build/C/man3/pthread_attr_setguardsize.3:137
2408 #: build/C/man3/pthread_attr_setinheritsched.3:119
2409 #: build/C/man3/pthread_attr_setstacksize.3:103
2410 #: build/C/man3/pthread_create.3:203 build/C/man3/pthread_exit.3:98
2411 #: build/C/man3/pthread_rwlockattr_setkind_np.3:109
2412 #, no-wrap
2413 msgid "BUGS"
2414 msgstr "バグ"
2415
2416 #. type: Plain text
2417 #: build/C/man3/pthread_attr_setguardsize.3:148
2418 msgid ""
2419 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2420 "within the stack size allocation, rather than allocating extra space at the "
2421 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2422 "error from B<pthread_create>(3)  if the guard size value is too large, "
2423 "leaving no space for the actual stack.)"
2424 msgstr ""
2425 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2426 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2427 "末尾に追加の領域を割り当てることが求められている。\n"
2428 "(このため、ガード領域が大きすぎて、\n"
2429 "実際のスタック用の場所がなくなってしまう場合、\n"
2430 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2431
2432 #.  glibc includes the guardsize within the allocated stack size,
2433 #.  which looks pretty clearly to be in violation of POSIX.
2434 #.  Filed bug, 22 Oct 2008:
2435 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2436 #.  Older reports:
2437 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2438 #.  Reportedly, LinuxThreads did the right thing, allocating
2439 #.  extra space at the end of the stack:
2440 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2441 #. type: Plain text
2442 #: build/C/man3/pthread_attr_setguardsize.3:162
2443 msgid ""
2444 "The obsolete LinuxThreads implementation did the right thing, allocating "
2445 "extra space at the end of the stack for the guard area."
2446 msgstr ""
2447 "廃止予定の LinuxThreads 実装では、\n"
2448 "POSIX.1 で求められている通りの動作で、\n"
2449 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2450
2451 #. type: Plain text
2452 #: build/C/man3/pthread_attr_setguardsize.3:165
2453 msgid "See B<pthread_getattr_np>(3)."
2454 msgstr "B<pthread_getattr_np>(3) を参照。"
2455
2456 #. type: Plain text
2457 #: build/C/man3/pthread_attr_setguardsize.3:173
2458 msgid ""
2459 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), "
2460 "B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), "
2461 "B<pthread_create>(3), B<pthreads>(7)"
2462 msgstr ""
2463 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), "
2464 "B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), "
2465 "B<pthread_create>(3), B<pthreads>(7)"
2466
2467 #. type: TH
2468 #: build/C/man3/pthread_attr_setinheritsched.3:26
2469 #, no-wrap
2470 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2471 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2472
2473 #. type: TH
2474 #: build/C/man3/pthread_attr_setinheritsched.3:26
2475 #: build/C/man3/pthread_attr_setschedparam.3:26
2476 #: build/C/man3/pthread_attr_setschedpolicy.3:26 build/C/man7/pthreads.7:26
2477 #, no-wrap
2478 msgid "2014-05-21"
2479 msgstr "2014-05-21"
2480
2481 #. type: Plain text
2482 #: build/C/man3/pthread_attr_setinheritsched.3:30
2483 msgid ""
2484 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit-"
2485 "scheduler attribute in thread attributes object"
2486 msgstr ""
2487 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - スレッド属性オブ"
2488 "ジェクトの inherit-scheduler 属性の設定/取得を行う"
2489
2490 #. type: Plain text
2491 #: build/C/man3/pthread_attr_setinheritsched.3:38
2492 #, no-wrap
2493 msgid ""
2494 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2495 "B<                                 int >I<inheritsched>B<);>\n"
2496 "B<int pthread_attr_getinheritsched(const pthread_attr_t *>I<attr>B<,>\n"
2497 "B<                                 int *>I<inheritsched>B<);>\n"
2498 msgstr ""
2499 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2500 "B<                                 int >I<inheritsched>B<);>\n"
2501 "B<int pthread_attr_getinheritsched(const pthread_attr_t *>I<attr>B<,>\n"
2502 "B<                                 int *>I<inheritsched>B<);>\n"
2503
2504 #. type: Plain text
2505 #: build/C/man3/pthread_attr_setinheritsched.3:55
2506 msgid ""
2507 "The B<pthread_attr_setinheritsched>()  function sets the inherit-scheduler "
2508 "attribute of the thread attributes object referred to by I<attr> to the "
2509 "value specified in I<inheritsched>.  The inherit-scheduler attribute "
2510 "determines whether a thread created using the thread attributes object "
2511 "I<attr> will inherit its scheduling attributes from the calling thread or "
2512 "whether it will take them from I<attr>."
2513 msgstr ""
2514 "B<pthread_attr_setinheritsched>() 関数は、 I<attr> が参照するスレッド属性オブ"
2515 "ジェクトの inherit-scheduler 属性を I<inheritsched> で指定された値に設定す"
2516 "る。 inherit-scheduler 属性により、スレッド属性オブジェクト I<attr> を使って"
2517 "作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承するか、 "
2518 "I<attr> からスケジューリング属性を取得するかが決定される。"
2519
2520 #. type: Plain text
2521 #: build/C/man3/pthread_attr_setinheritsched.3:64
2522 msgid ""
2523 "The following scheduling attributes are affected by the inherit-scheduler "
2524 "attribute: scheduling policy (B<pthread_attr_setschedpolicy>(3)), scheduling "
2525 "priority (B<pthread_attr_setschedparam>(3)), and contention scope "
2526 "(B<pthread_attr_setscope>(3))."
2527 msgstr ""
2528 "次に挙げるスケジューリング属性は inherit-scheduler 属性の影響を受ける: スケ"
2529 "ジューリングポリシー (B<pthread_attr_setschedpolicy>(3))、 スケジューリング優"
2530 "先度 (B<pthread_attr_setschedparam>(3))、 contention scope "
2531 "(B<pthread_attr_setscope>(3))。"
2532
2533 #. type: Plain text
2534 #: build/C/man3/pthread_attr_setinheritsched.3:67
2535 msgid "The following values may be specified in I<inheritsched>:"
2536 msgstr "以下の値を I<inheritsched> に指定できる。"
2537
2538 #. type: TP
2539 #: build/C/man3/pthread_attr_setinheritsched.3:67
2540 #, no-wrap
2541 msgid "B<PTHREAD_INHERIT_SCHED>"
2542 msgstr "B<PTHREAD_INHERIT_SCHED>"
2543
2544 #. type: Plain text
2545 #: build/C/man3/pthread_attr_setinheritsched.3:75
2546 msgid ""
2547 "Threads that are created using I<attr> inherit scheduling attributes from "
2548 "the creating thread; the scheduling attributes in I<attr> are ignored."
2549 msgstr ""
2550 "I<attr> を使って作成されたスレッドは、\n"
2551 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2552 "I<attr> 内のスケジューリング属性は無視される。"
2553
2554 #. type: TP
2555 #: build/C/man3/pthread_attr_setinheritsched.3:75
2556 #, no-wrap
2557 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2558 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2559
2560 #.  FIXME Document the defaults for scheduler settings
2561 #. type: Plain text
2562 #: build/C/man3/pthread_attr_setinheritsched.3:82
2563 msgid ""
2564 "Threads that are created using I<attr> take their scheduling attributes from "
2565 "the values specified by the attributes object."
2566 msgstr ""
2567 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2568 "指定された値からスケジューリング属性を取得する。"
2569
2570 #. type: Plain text
2571 #: build/C/man3/pthread_attr_setinheritsched.3:86
2572 msgid ""
2573 "The default setting of the inherit-scheduler attribute in a newly "
2574 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2575 msgstr ""
2576 "新たに初期化されたスレッド属性オブジェクトの inherit-scheduler 属性のデフォル"
2577 "ト設定は B<PTHREAD_INHERIT_SCHED> である。"
2578
2579 #. type: Plain text
2580 #: build/C/man3/pthread_attr_setinheritsched.3:93
2581 msgid ""
2582 "The B<pthread_attr_getinheritsched>()  returns the inherit-scheduler "
2583 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2584 "by I<inheritsched>."
2585 msgstr ""
2586 "B<pthread_attr_getinheritsched>() は、 スレッド属性オブジェクト I<attr> の "
2587 "inherit-scheduler 属性を I<inheritsched> が指すバッファーに入れて返す。"
2588
2589 #. type: Plain text
2590 #: build/C/man3/pthread_attr_setinheritsched.3:99
2591 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2592 msgstr "B<pthread_attr_setinheritsched>() は以下のエラーで失敗する場合がある。"
2593
2594 #. type: Plain text
2595 #: build/C/man3/pthread_attr_setinheritsched.3:103
2596 msgid "Invalid value in I<inheritsched>."
2597 msgstr "I<inheritsched> に無効な値が指定された。"
2598
2599 #.  .SH VERSIONS
2600 #.  Available since glibc 2.0.
2601 #. type: Plain text
2602 #: build/C/man3/pthread_attr_setinheritsched.3:110
2603 msgid ""
2604 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2605 "to set the attribute to an unsupported value\") for "
2606 "B<pthread_attr_setinheritsched>()."
2607 msgstr ""
2608 "POSIX.1-2001 では、 B<pthread_attr_setinheritsched>() に関して\n"
2609 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2610 "も追加で規定されている。"
2611
2612 #. type: Plain text
2613 #: build/C/man3/pthread_attr_setinheritsched.3:117
2614 msgid ""
2615 "The B<pthread_attr_setinheritsched>()  and "
2616 "B<pthread_attr_getinheritsched>()  functions are thread-safe."
2617 msgstr ""
2618 "関数 B<pthread_attr_setinheritsched>() と B<pthread_attr_getinheritsched>() "
2619 "はスレッドセーフである。"
2620
2621 #.  FIXME . Track status of the following bug:
2622 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2623 #. type: Plain text
2624 #: build/C/man3/pthread_attr_setinheritsched.3:135
2625 msgid ""
2626 "As at glibc 2.8, if a thread attributes object is initialized using "
2627 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2628 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2629 "if the inherit-scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2630 "then a thread created using the attribute object wrongly inherits its "
2631 "scheduling attributes from the creating thread.  This bug does not occur if "
2632 "either the scheduling policy or scheduling priority attribute is explicitly "
2633 "set in the thread attributes object before calling B<pthread_create>(3)."
2634 msgstr ""
2635 "glibc 2.8 の時点では、スレッド属性オブジェクトが B<pthread_attr_init>(3) を"
2636 "使って初期化された場合、 スレッド属性オブジェクトのスケジューリングポリシー"
2637 "が B<SCHED_OTHER> に、 スケジューリング優先度が 0 に設定される。一方、その後 "
2638 "inherit-scheduler 属性に B<PTHREAD_EXPLICIT_SCHED> が設定されると、このスレッ"
2639 "ド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するスレッド"
2640 "のスケジューリング属性が間違って継承されてしまう。 B<pthread_create>(3) を呼"
2641 "び出す前にスケジューリングポリシー属性かスケジューリング優先度属性のどちらか"
2642 "が明示的に設定された場合には、 このバグは発生しない。"
2643
2644 #. type: Plain text
2645 #: build/C/man3/pthread_attr_setinheritsched.3:138
2646 #: build/C/man3/pthread_attr_setschedparam.3:116
2647 #: build/C/man3/pthread_attr_setschedpolicy.3:112
2648 msgid "See B<pthread_setschedparam>(3)."
2649 msgstr "B<pthread_setschedparam>(3) を参照。"
2650
2651 #. type: Plain text
2652 #: build/C/man3/pthread_attr_setinheritsched.3:150
2653 msgid ""
2654 "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), "
2655 "B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), "
2656 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2657 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2658 msgstr ""
2659 "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), "
2660 "B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), "
2661 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2662 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2663
2664 #. type: TH
2665 #: build/C/man3/pthread_attr_setschedparam.3:26
2666 #, no-wrap
2667 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2668 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2669
2670 #. type: Plain text
2671 #: build/C/man3/pthread_attr_setschedparam.3:30
2672 msgid ""
2673 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2674 "parameter attributes in thread attributes object"
2675 msgstr ""
2676 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
2677 "スレッド属性オブジェクトのスケジューリングパラメーター属性の設定/取得を行う"
2678
2679 #. type: Plain text
2680 #: build/C/man3/pthread_attr_setschedparam.3:38
2681 #, no-wrap
2682 msgid ""
2683 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2684 "B<                               const struct sched_param *>I<param>B<);>\n"
2685 "B<int pthread_attr_getschedparam(const pthread_attr_t *>I<attr>B<,>\n"
2686 "B<                               struct sched_param *>I<param>B<);>\n"
2687 msgstr ""
2688 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2689 "B<                               const struct sched_param *>I<param>B<);>\n"
2690 "B<int pthread_attr_getschedparam(const pthread_attr_t *>I<attr>B<,>\n"
2691 "B<                               struct sched_param *>I<param>B<);>\n"
2692
2693 #. type: Plain text
2694 #: build/C/man3/pthread_attr_setschedparam.3:52
2695 msgid ""
2696 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2697 "attributes of the thread attributes object referred to by I<attr> to the "
2698 "values specified in the buffer pointed to by I<param>.  These attributes "
2699 "determine the scheduling parameters of a thread created using the thread "
2700 "attributes object I<attr>."
2701 msgstr ""
2702 "B<pthread_attr_setschedparam>() 関数は、\n"
2703 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2704 "パラメーター属性を I<param> が指すバッファーで指定された値に設定する。\n"
2705 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2706 "作成されるスレッドのスケジューリングパラメーターが決定される。"
2707
2708 #. type: Plain text
2709 #: build/C/man3/pthread_attr_setschedparam.3:59
2710 msgid ""
2711 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2712 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2713 "by I<param>."
2714 msgstr ""
2715 "B<pthread_attr_getschedparam>() は、\n"
2716 "スレッド属性オブジェクト I<attr> のスケジューリングパラメーター属性を\n"
2717 "I<param> が指すバッファーに入れて返す。"
2718
2719 #. type: Plain text
2720 #: build/C/man3/pthread_attr_setschedparam.3:61
2721 msgid "Scheduling parameters are maintained in the following structure:"
2722 msgstr "スケジューリングパラメーターは以下の構造体で管理される。"
2723
2724 #. type: Plain text
2725 #: build/C/man3/pthread_attr_setschedparam.3:67
2726 #: build/C/man3/pthread_setschedparam.3:69
2727 #, no-wrap
2728 msgid ""
2729 "struct sched_param {\n"
2730 "    int sched_priority;     /* Scheduling priority */\n"
2731 "};\n"
2732 msgstr ""
2733 "struct sched_param {\n"
2734 "    int sched_priority;     /* Scheduling priority */\n"
2735 "};\n"
2736
2737 #. type: Plain text
2738 #: build/C/man3/pthread_attr_setschedparam.3:74
2739 #: build/C/man3/pthread_setschedparam.3:76
2740 msgid ""
2741 "As can be seen, only one scheduling parameter is supported.  For details of "
2742 "the permitted ranges for scheduling priorities in each scheduling policy, "
2743 "see B<sched>(7)."
2744 msgstr ""
2745 "見て分かる通り、サポートされているスケジューリングパラメーターは一つだけであ"
2746 "る。各スケジューリングポリシーで許可されるスケジューリング優先度の詳細につい"
2747 "ては、B<sched>(7) を参照のこと。"
2748
2749 #. type: Plain text
2750 #: build/C/man3/pthread_attr_setschedparam.3:85
2751 msgid ""
2752 "In order for the parameter setting made by B<pthread_attr_setschedparam>()  "
2753 "to have effect when calling B<pthread_create>(3), the caller must use "
2754 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2755 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2756 msgstr ""
2757 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedparam>() で行っ"
2758 "たパラメーター設定を有効にするには、 呼び出し側で "
2759 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
2760 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
2761 "ない。"
2762
2763 #.  .SH VERSIONS
2764 #.  Available since glibc 2.0.
2765 #. type: Plain text
2766 #: build/C/man3/pthread_attr_setschedparam.3:100
2767 msgid ""
2768 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2769 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2770 "(but portable and future-proof applications should nevertheless handle a "
2771 "possible error return)."
2772 msgstr ""
2773 "POSIX.1 では、\n"
2774 "B<pthread_attr_setschedparam>() について\n"
2775 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
2776 "Linux では、これらの関数は常に成功する\n"
2777 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2778 "正のエラーの返り値を処理するようにすべきである)。"
2779
2780 #. type: Plain text
2781 #: build/C/man3/pthread_attr_setschedparam.3:107
2782 msgid ""
2783 "The B<pthread_attr_setschedparam>()  and B<pthread_attr_getschedparam>()  "
2784 "functions are thread-safe."
2785 msgstr ""
2786 "関数 B<pthread_attr_setschedparam>() と B<pthread_attr_getschedparam>() はス"
2787 "レッドセーフである。"
2788
2789 #. type: Plain text
2790 #: build/C/man3/pthread_attr_setschedparam.3:113
2791 msgid ""
2792 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2793 "policies supported on Linux."
2794 msgstr ""
2795 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
2796 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
2797
2798 #. type: Plain text
2799 #: build/C/man3/pthread_attr_setschedparam.3:128
2800 msgid ""
2801 "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
2802 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2803 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2804 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2805 msgstr ""
2806 "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
2807 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2808 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2809 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2810
2811 #. type: TH
2812 #: build/C/man3/pthread_attr_setschedpolicy.3:26
2813 #, no-wrap
2814 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2815 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2816
2817 #. type: Plain text
2818 #: build/C/man3/pthread_attr_setschedpolicy.3:30
2819 msgid ""
2820 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2821 "scheduling policy attribute in thread attributes object"
2822 msgstr ""
2823 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
2824 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
2825
2826 #. type: Plain text
2827 #: build/C/man3/pthread_attr_setschedpolicy.3:38
2828 #, no-wrap
2829 msgid ""
2830 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2831 "B<int pthread_attr_getschedpolicy(const pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2832 msgstr ""
2833 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2834 "B<int pthread_attr_getschedpolicy(const pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2835
2836 #. type: Plain text
2837 #: build/C/man3/pthread_attr_setschedpolicy.3:52
2838 msgid ""
2839 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2840 "attribute of the thread attributes object referred to by I<attr> to the "
2841 "value specified in I<policy>.  This attribute determines the scheduling "
2842 "policy of a thread created using the thread attributes object I<attr>."
2843 msgstr ""
2844 "B<pthread_attr_setschedpolicy>() 関数は、\n"
2845 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2846 "ポリシー属性を I<policy> で指定された値に設定する。\n"
2847 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2848 "作成されるスレッドのスケジューリングポリシーが決定される。"
2849
2850 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2851 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2852 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2853 #. type: Plain text
2854 #: build/C/man3/pthread_attr_setschedpolicy.3:65
2855 msgid ""
2856 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2857 "B<SCHED_OTHER>, with the semantics described in B<sched>(7)."
2858 msgstr ""
2859 "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER> であ"
2860 "る。それぞれの意味は B<sched>(7) で説明している通りである。"
2861
2862 #. type: Plain text
2863 #: build/C/man3/pthread_attr_setschedpolicy.3:72
2864 msgid ""
2865 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2866 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2867 "by I<policy>."
2868 msgstr ""
2869 "B<pthread_attr_getschedpolicy>() は、\n"
2870 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
2871 "I<policy> が指すバッファーに入れて返す。"
2872
2873 #. type: Plain text
2874 #: build/C/man3/pthread_attr_setschedpolicy.3:83
2875 msgid ""
2876 "In order for the policy setting made by B<pthread_attr_setschedpolicy>()  to "
2877 "have effect when calling B<pthread_create>(3), the caller must use "
2878 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2879 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2880 msgstr ""
2881 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedpolicy>() で行っ"
2882 "たポリシー設定を有効にするには、 呼び出し側で "
2883 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
2884 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
2885 "ない。"
2886
2887 #. type: Plain text
2888 #: build/C/man3/pthread_attr_setschedpolicy.3:89
2889 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2890 msgstr "B<pthread_attr_setschedpolicy>() は以下のエラーで失敗する場合がある。"
2891
2892 #. type: Plain text
2893 #: build/C/man3/pthread_attr_setschedpolicy.3:93
2894 msgid "Invalid value in I<policy>."
2895 msgstr "I<policy> に無効な値が指定された。"
2896
2897 #.  .SH VERSIONS
2898 #.  Available since glibc 2.0.
2899 #. type: Plain text
2900 #: build/C/man3/pthread_attr_setschedpolicy.3:100
2901 msgid ""
2902 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2903 "to set the attribute to an unsupported value\") for "
2904 "B<pthread_attr_setschedpolicy>()."
2905 msgstr ""
2906 "POSIX.1-2001 では、 B<pthread_attr_setschedpolicy>() に関して\n"
2907 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2908 "も追加で規定されている。"
2909
2910 #. type: Plain text
2911 #: build/C/man3/pthread_attr_setschedpolicy.3:107
2912 msgid ""
2913 "The B<pthread_attr_setschedpolicy>()  and B<pthread_attr_getschedpolicy>()  "
2914 "functions are thread-safe."
2915 msgstr ""
2916 "関数 B<pthread_attr_setschedpolicy>() と B<pthread_attr_getschedpolicy>() は"
2917 "スレッドセーフである。"
2918
2919 #. type: Plain text
2920 #: build/C/man3/pthread_attr_setschedpolicy.3:123
2921 msgid ""
2922 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
2923 "B<pthread_attr_setschedparam>(3), B<pthread_create>(3), "
2924 "B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), "
2925 "B<sched>(7)"
2926 msgstr ""
2927 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
2928 "B<pthread_attr_setschedparam>(3), B<pthread_create>(3), "
2929 "B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), "
2930 "B<sched>(7)"
2931
2932 #. type: TH
2933 #: build/C/man3/pthread_attr_setscope.3:26
2934 #, no-wrap
2935 msgid "PTHREAD_ATTR_SETSCOPE"
2936 msgstr "PTHREAD_ATTR_SETSCOPE"
2937
2938 #. type: Plain text
2939 #: build/C/man3/pthread_attr_setscope.3:30
2940 msgid ""
2941 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2942 "attribute in thread attributes object"
2943 msgstr ""
2944 "pthread_attr_setscope, pthread_attr_getscope - \n"
2945 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
2946
2947 #. type: Plain text
2948 #: build/C/man3/pthread_attr_setscope.3:38
2949 #, no-wrap
2950 msgid ""
2951 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2952 "B<int pthread_attr_getscope(const pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2953 msgstr ""
2954 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2955 "B<int pthread_attr_getscope(const pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2956
2957 #. type: Plain text
2958 #: build/C/man3/pthread_attr_setscope.3:53
2959 msgid ""
2960 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2961 "of the thread attributes object referred to by I<attr> to the value "
2962 "specified in I<scope>.  The contention scope attribute defines the set of "
2963 "threads against which a thread competes for resources such as the CPU.  "
2964 "POSIX.1-2001 specifies two possible values for I<scope>:"
2965 msgstr ""
2966 "B<pthread_attr_setscope>() 関数は、\n"
2967 "I<attr> が参照するスレッド属性オブジェクトの contention scope\n"
2968 "属性を I<scope> で指定された値に設定する。\n"
2969 "contention scope 属性により、\n"
2970 "スレッドが CPU などのリソースを取り合うスレッド集合が規定される。\n"
2971 "POSIX.1-2001 では I<scope> に指定する値として 2 つの値が規定されている。"
2972
2973 #. type: TP
2974 #: build/C/man3/pthread_attr_setscope.3:53
2975 #, no-wrap
2976 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2977 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2978
2979 #. type: Plain text
2980 #: build/C/man3/pthread_attr_setscope.3:61
2981 msgid ""
2982 "The thread competes for resources with all other threads in all processes on "
2983 "the system that are in the same scheduling allocation domain (a group of one "
2984 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2985 "to one another according to their scheduling policy and priority."
2986 msgstr ""
2987 "スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ\n"
2988 "のグループ) にある、システム上の全てのプロセスの自分以外の全ての\n"
2989 "スレッドとリソースを取り合う。 \n"
2990 "B<PTHREAD_SCOPE_SYSTEM> のスレッドは、スケジューリングポリシーと\n"
2991 "優先度に基づき、互いに相対的にスケジューリングされる。"
2992
2993 #. type: TP
2994 #: build/C/man3/pthread_attr_setscope.3:61
2995 #, no-wrap
2996 msgid "B<PTHREAD_SCOPE_PROCESS>"
2997 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2998
2999 #. type: Plain text
3000 #: build/C/man3/pthread_attr_setscope.3:76
3001 msgid ""
3002 "The thread competes for resources with all other threads in the same process "
3003 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
3004 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
3005 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
3006 "leaves it unspecified how these threads contend with other threads in other "
3007 "process on the system or with other threads in the same process that were "
3008 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
3009 msgstr ""
3010 "スレッドは、contention scope が B<PTHREAD_SCOPE_PROCESS> で作成された\n"
3011 "同じプロセスの自分以外の全てのスレッドとリソースを取り合う。\n"
3012 "B<PTHREAD_SCOPE_PROCESS> のスレッドは、スケジューリングポリシーと優先度\n"
3013 "に基づき、同じプロセスの他のスレッドと相対的にスケジューリングされる。\n"
3014 "POSIX.1-2001 では、これらのスレッドがシステム上の他のプロセスのスレッド\n"
3015 "や同じプロセス内の contention scope が B<PTHREAD_SCOPE_SYSTEM> で作成\n"
3016 "された他のスレッドとどのようにリソースを取り合うかは、\n"
3017 "規定されないままになっている。"
3018
3019 #. type: Plain text
3020 #: build/C/man3/pthread_attr_setscope.3:83
3021 msgid ""
3022 "POSIX.1-2001 requires that an implementation support at least one of these "
3023 "contention scopes.  Linux supports B<PTHREAD_SCOPE_SYSTEM>, but not "
3024 "B<PTHREAD_SCOPE_PROCESS>."
3025 msgstr ""
3026 "POSIX.1-2001 で求められているのは、スレッド実装がこれらの contention scope の"
3027 "うち少なくとも 1 つをサポートすることだけである。 Linux は "
3028 "B<PTHREAD_SCOPE_SYSTEM> をサポートしているが、 B<PTHREAD_SCOPE_PROCESS> はサ"
3029 "ポートしていない。"
3030
3031 #. type: Plain text
3032 #: build/C/man3/pthread_attr_setscope.3:95
3033 msgid ""
3034 "On systems that support multiple contention scopes, then, in order for the "
3035 "parameter setting made by B<pthread_attr_setscope>()  to have effect when "
3036 "calling B<pthread_create>(3), the caller must use "
3037 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
3038 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
3039 msgstr ""
3040 "複数の contention scope をサポートしているシステムで、 B<pthread_create>(3) "
3041 "を呼び出した際に B<pthread_attr_setscope>() で行ったパラメーター設定を有効に"
3042 "するには、 呼び出し側で B<pthread_attr_setinheritsched>(3) を使って 属性オブ"
3043 "ジェクト I<attr> の inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定"
3044 "しておかなければならない。"
3045
3046 #. type: Plain text
3047 #: build/C/man3/pthread_attr_setscope.3:103
3048 msgid ""
3049 "The B<pthread_attr_getscope>()  function returns the contention scope "
3050 "attribute of the thread attributes object referred to by I<attr> in the "
3051 "buffer pointed to by I<scope>."
3052 msgstr ""
3053 "B<pthread_attr_getscope>() は、\n"
3054 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
3055 "I<scope> が指すバッファーに入れて返す。"
3056
3057 #. type: Plain text
3058 #: build/C/man3/pthread_attr_setscope.3:109
3059 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
3060 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
3061
3062 #. type: Plain text
3063 #: build/C/man3/pthread_attr_setscope.3:113
3064 msgid "An invalid value was specified in I<scope>."
3065 msgstr "I<scope> に無効な値が指定された。"
3066
3067 #. type: TP
3068 #: build/C/man3/pthread_attr_setscope.3:113
3069 #, no-wrap
3070 msgid "B<ENOTSUP>"
3071 msgstr "B<ENOTSUP>"
3072
3073 #. type: Plain text
3074 #: build/C/man3/pthread_attr_setscope.3:119
3075 msgid ""
3076 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
3077 "supported on Linux."
3078 msgstr ""
3079 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
3080 "この値は Linux でサポートされていない。"
3081
3082 #. type: Plain text
3083 #: build/C/man3/pthread_attr_setscope.3:126
3084 msgid ""
3085 "The B<pthread_attr_setscope>()  and B<pthread_attr_getscope>()  functions "
3086 "are thread-safe."
3087 msgstr ""
3088 "関数 B<pthread_attr_setscope>() と B<pthread_attr_getscope>() はスレッドセー"
3089 "フである。"
3090
3091 #. type: Plain text
3092 #: build/C/man3/pthread_attr_setscope.3:136
3093 msgid ""
3094 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a user-"
3095 "space thread is bound directly to a single kernel-scheduling entity.  This "
3096 "is the case on Linux for the obsolete LinuxThreads implementation and the "
3097 "modern NPTL implementation, which are both 1:1 threading implementations."
3098 msgstr ""
3099 "B<PTHREAD_SCOPE_SYSTEM> contention scope では、通常は、一つの\n"
3100 "ユーザー空間スレッドは一つのカーネルスケジューリングエンティティに\n"
3101 "直接結び付けられる。\n"
3102 "Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに\n"
3103 "該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。"
3104
3105 #. type: Plain text
3106 #: build/C/man3/pthread_attr_setscope.3:139
3107 msgid ""
3108 "POSIX.1-2001 specifies that the default contention scope is implementation-"
3109 "defined."
3110 msgstr ""
3111 "POSIX.1-2001 では、 contention scope 属性のデフォルト値は\n"
3112 "実装時で定義されるものと規定されている。"
3113
3114 #. type: Plain text
3115 #: build/C/man3/pthread_attr_setscope.3:149
3116 msgid ""
3117 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3118 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3119 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3120 msgstr ""
3121 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3122 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3123 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3124
3125 #. type: TH
3126 #: build/C/man3/pthread_attr_setstack.3:26
3127 #, no-wrap
3128 msgid "PTHREAD_ATTR_SETSTACK"
3129 msgstr "PTHREAD_ATTR_SETSTACK"
3130
3131 #. type: Plain text
3132 #: build/C/man3/pthread_attr_setstack.3:30
3133 msgid ""
3134 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
3135 "thread attributes object"
3136 msgstr ""
3137 "pthread_attr_setstack, pthread_attr_getstack - \n"
3138 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
3139
3140 #. type: Plain text
3141 #: build/C/man3/pthread_attr_setstack.3:38
3142 #, no-wrap
3143 msgid ""
3144 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3145 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3146 "B<int pthread_attr_getstack(const pthread_attr_t *>I<attr>B<,>\n"
3147 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3148 msgstr ""
3149 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3150 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3151 "B<int pthread_attr_getstack(const pthread_attr_t *>I<attr>B<,>\n"
3152 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3153
3154 #. type: Plain text
3155 #: build/C/man3/pthread_attr_setstack.3:45
3156 #: build/C/man3/pthread_cleanup_push_defer_np.3:44
3157 #: build/C/man3/pthread_kill.3:41
3158 #: build/C/man3/pthread_rwlockattr_setkind_np.3:44
3159 #: build/C/man3/pthread_sigmask.3:42 build/C/man3/pthread_sigqueue.3:42
3160 msgid ""
3161 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3162 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
3163
3164 #. type: Plain text
3165 #: build/C/man3/pthread_attr_setstack.3:50
3166 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3167 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3168
3169 #. type: Plain text
3170 #: build/C/man3/pthread_attr_setstack.3:52
3171 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
3172 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
3173
3174 #. type: Plain text
3175 #: build/C/man3/pthread_attr_setstack.3:68
3176 msgid ""
3177 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
3178 "size attributes of the thread attributes object referred to by I<attr> to "
3179 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
3180 "attributes specify the location and size of the stack that should be used by "
3181 "a thread that is created using the thread attributes object I<attr>."
3182 msgstr ""
3183 "B<pthread_attr_setstack>() 関数は、\n"
3184 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
3185 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
3186 "指定された値に設定する。\n"
3187 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
3188 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
3189
3190 #. type: Plain text
3191 #: build/C/man3/pthread_attr_setstack.3:74
3192 msgid ""
3193 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
3194 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
3195 "allocated buffer should be both readable and writable."
3196 msgstr ""
3197 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
3198 "バッファー内の指定できる最小のアドレスバイトを指すべきである。\n"
3199 "割り当てられたバッファーのページは読み書き両方が可能なページとなっている\n"
3200 "べきである。"
3201
3202 #. type: Plain text
3203 #: build/C/man3/pthread_attr_setstack.3:85
3204 msgid ""
3205 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
3206 "size attributes of the thread attributes object referred to by I<attr> in "
3207 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
3208 msgstr ""
3209 "B<pthread_attr_getstack>() 関数は、\n"
3210 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
3211 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
3212 "指すバッファーに入れて返す。"
3213
3214 #. type: Plain text
3215 #: build/C/man3/pthread_attr_setstack.3:91
3216 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
3217 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
3218
3219 #. type: Plain text
3220 #: build/C/man3/pthread_attr_setstack.3:102
3221 msgid ""
3222 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
3223 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
3224 "stacksize> is not suitably aligned."
3225 msgstr ""
3226 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
3227 "システムによっては、 I<stackaddr> か\n"
3228 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
3229 "このエラーが発生する。"
3230
3231 #. type: Plain text
3232 #: build/C/man3/pthread_attr_setstack.3:110
3233 msgid ""
3234 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
3235 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
3236 "caller."
3237 msgstr ""
3238 "POSIX.1-2001 では エラー B<EACCES> も規定されており、\n"
3239 "このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に\n"
3240 "呼び出し側から読み書き両方のアクセスができない状況を表す。"
3241
3242 #. type: Plain text
3243 #: build/C/man3/pthread_attr_setstack.3:112
3244 msgid "These functions are provided by glibc since version 2.2."
3245 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
3246
3247 #. type: Plain text
3248 #: build/C/man3/pthread_attr_setstack.3:119
3249 msgid ""
3250 "The B<pthread_attr_setstack>()  and B<pthread_attr_getstack>()  functions "
3251 "are thread-safe."
3252 msgstr ""
3253 "関数 B<pthread_attr_setstack>() と B<pthread_attr_getstack>() はスレッドセー"
3254 "フである。"
3255
3256 #. type: Plain text
3257 #: build/C/man3/pthread_attr_setstack.3:129
3258 msgid ""
3259 "These functions are provided for applications that must ensure that a "
3260 "thread's stack is placed in a particular location.  For most applications, "
3261 "this is not necessary, and the use of these functions should be avoided.  "
3262 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
3263 "stack size other than the default.)"
3264 msgstr ""
3265 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
3266 "しなければならないアプリケーションのために提供されている。\n"
3267 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
3268 "これらの関数を使うのは避けるべきである。\n"
3269 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
3270 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
3271
3272 #. type: Plain text
3273 #: build/C/man3/pthread_attr_setstack.3:140
3274 msgid ""
3275 "When an application employs B<pthread_attr_setstack>(), it takes over the "
3276 "responsibility of allocating the stack.  Any guard size value that was set "
3277 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
3278 "is the application's responsibility to allocate a guard area (one or more "
3279 "pages protected against reading and writing)  to handle the possibility of "
3280 "stack overflow."
3281 msgstr ""
3282 "アプリケーションが B<pthread_attr_setstack>() を利用する際には、\n"
3283 "スタックの割り当てに責任を持つ必要がある。\n"
3284 "B<pthread_attr_setguardsize>(3) を使って設定された\n"
3285 "guard size の値は無視される。\n"
3286 "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n"
3287 "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n"
3288 "スタックオーバーフローの可能性に対処するようにする必要がある。"
3289
3290 #. type: Plain text
3291 #: build/C/man3/pthread_attr_setstack.3:151
3292 msgid ""
3293 "The address specified in I<stackaddr> should be suitably aligned: for full "
3294 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
3295 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
3296 "should also be a multiple of the system page size."
3297 msgstr ""
3298 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
3299 "完全な移植性を持たせるためには、\n"
3300 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
3301 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
3302 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
3303
3304 #. type: Plain text
3305 #: build/C/man3/pthread_attr_setstack.3:159
3306 msgid ""
3307 "If I<attr> is used to create multiple threads, then the caller must change "
3308 "the stack address attribute between calls to B<pthread_create>(3); "
3309 "otherwise, the threads will attempt to use the same memory area for their "
3310 "stacks, and chaos will ensue."
3311 msgstr ""
3312 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
3313 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
3314 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
3315 "さもなければ、複数のスレッドがスタックとして同じメモリー領域を\n"
3316 "使おうとするため、訳の分からない状況が発生してしまう。"
3317
3318 #. type: Plain text
3319 #: build/C/man3/pthread_attr_setstack.3:174
3320 msgid ""
3321 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3322 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3323 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3324 msgstr ""
3325 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3326 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3327 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3328
3329 #. type: TH
3330 #: build/C/man3/pthread_attr_setstackaddr.3:26
3331 #, no-wrap
3332 msgid "PTHREAD_ATTR_SETSTACKADDR"
3333 msgstr "PTHREAD_ATTR_SETSTACKADDR"
3334
3335 #. type: Plain text
3336 #: build/C/man3/pthread_attr_setstackaddr.3:30
3337 msgid ""
3338 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
3339 "attribute in thread attributes object"
3340 msgstr ""
3341 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
3342 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
3343
3344 #. type: Plain text
3345 #: build/C/man3/pthread_attr_setstackaddr.3:38
3346 #, no-wrap
3347 msgid ""
3348 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3349 "B<int pthread_attr_getstackaddr(const pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3350 msgstr ""
3351 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3352 "B<int pthread_attr_getstackaddr(const pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3353
3354 #. type: Plain text
3355 #: build/C/man3/pthread_attr_setstackaddr.3:49
3356 msgid ""
3357 "These functions are obsolete: B<do not use them.> Use "
3358 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
3359 msgstr ""
3360 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
3361 "代わりに B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使うこ"
3362 "と。"
3363
3364 #. type: Plain text
3365 #: build/C/man3/pthread_attr_setstackaddr.3:60
3366 msgid ""
3367 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
3368 "attribute of the thread attributes object referred to by I<attr> to the "
3369 "value specified in I<stackaddr>.  This attribute specifies the location of "
3370 "the stack that should be used by a thread that is created using the thread "
3371 "attributes object I<attr>."
3372 msgstr ""
3373 "B<pthread_attr_setstackaddr>() 関数は、\n"
3374 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3375 "属性を I<stackaddr> で指定された値に設定する。\n"
3376 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3377 "作成されるスレッドが使用すべきスタックの位置が指定される。"
3378
3379 #. type: Plain text
3380 #: build/C/man3/pthread_attr_setstackaddr.3:66
3381 msgid ""
3382 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
3383 "that was allocated by the caller.  The pages of the allocated buffer should "
3384 "be both readable and writable."
3385 msgstr ""
3386 "I<stackaddr> は呼び出し側が割り当てたバッファー (大きさは\n"
3387 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
3388 "割り当てられたバッファーのページは読み書き両方が可能なページと\n"
3389 "なっているべきである。"
3390
3391 #. type: Plain text
3392 #: build/C/man3/pthread_attr_setstackaddr.3:74
3393 msgid ""
3394 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
3395 "attribute of the thread attributes object referred to by I<attr> in the "
3396 "buffer pointed to by I<stackaddr>."
3397 msgstr ""
3398 "B<pthread_attr_getstackaddr>() は、\n"
3399 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3400 "I<stackaddr> が指すバッファーに入れて返す。"
3401
3402 #. type: Plain text
3403 #: build/C/man3/pthread_attr_setstackaddr.3:81
3404 msgid ""
3405 "No errors are defined (but applications should nevertheless handle a "
3406 "possible error return)."
3407 msgstr ""
3408 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
3409 "返り値を処理するようにすべきである)。"
3410
3411 #. type: Plain text
3412 #: build/C/man3/pthread_attr_setstackaddr.3:90
3413 msgid ""
3414 "The B<pthread_attr_setstackaddr>()  and B<pthread_attr_getstackaddr>()  "
3415 "functions are thread-safe."
3416 msgstr ""
3417 "関数 B<pthread_attr_setstackaddr>() と B<pthread_attr_getstackaddr>() はス"
3418 "レッドセーフである。"
3419
3420 #. type: Plain text
3421 #: build/C/man3/pthread_attr_setstackaddr.3:93
3422 msgid ""
3423 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
3424 "POSIX.1-2008 removes the specification of these functions."
3425 msgstr ""
3426 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
3427 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
3428
3429 #. type: Plain text
3430 #: build/C/man3/pthread_attr_setstackaddr.3:117
3431 msgid ""
3432 "I<Do not use these functions!> They cannot be portably used, since they "
3433 "provide no way of specifying the direction of growth or the range of the "
3434 "stack.  For example, on architectures with a stack that grows downward, "
3435 "I<stackaddr> specifies the next address past the I<highest> address of the "
3436 "allocated stack area.  However, on architectures with a stack that grows "
3437 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
3438 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
3439 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
3440 "in the allocated stack area (and the I<stacksize> argument specifies the "
3441 "range of the stack)."
3442 msgstr ""
3443 "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n"
3444 "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n"
3445 "かを指定する手段が提供されていないからである。\n"
3446 "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャー\n"
3447 "では、I<stackaddr> には割り当てられたスタック領域のI<最も大きな>アドレ\n"
3448 "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n"
3449 "方向) に伸びるアーキテクチャーでは、I<stackaddr> には割り当てられた\n"
3450 "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n"
3451 "B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) が使用する\n"
3452 "I<stackaddr> は、常に割り当てられたスタック領域の最も小さいアドレス\n"
3453 "へのポインターである (I<stacksize> 引き数はスタックの範囲を指定する)。"
3454
3455 #. type: Plain text
3456 #: build/C/man3/pthread_attr_setstackaddr.3:123
3457 msgid ""
3458 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3459 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3460 msgstr ""
3461 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3462 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3463
3464 #. type: TH
3465 #: build/C/man3/pthread_attr_setstacksize.3:26
3466 #, no-wrap
3467 msgid "PTHREAD_ATTR_SETSTACKSIZE"
3468 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
3469
3470 #. type: Plain text
3471 #: build/C/man3/pthread_attr_setstacksize.3:30
3472 msgid ""
3473 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
3474 "attribute in thread attributes object"
3475 msgstr ""
3476 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
3477 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
3478
3479 #. type: Plain text
3480 #: build/C/man3/pthread_attr_setstacksize.3:38
3481 #, no-wrap
3482 msgid ""
3483 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3484 "B<int pthread_attr_getstacksize(const pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3485 msgstr ""
3486 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3487 "B<int pthread_attr_getstacksize(const pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3488
3489 #. type: Plain text
3490 #: build/C/man3/pthread_attr_setstacksize.3:49
3491 msgid ""
3492 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
3493 "of the thread attributes object referred to by I<attr> to the value "
3494 "specified in I<stacksize>."
3495 msgstr ""
3496 "B<pthread_attr_setstacksize>() 関数は、\n"
3497 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3498 "属性を I<stacksize> で指定された値に設定する。"
3499
3500 #. type: Plain text
3501 #: build/C/man3/pthread_attr_setstacksize.3:53
3502 msgid ""
3503 "The stack size attribute determines the minimum size (in bytes) that will be "
3504 "allocated for threads created using the thread attributes object I<attr>."
3505 msgstr ""
3506 "スタックサイズ属性により、\n"
3507 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
3508 "に割り当てられる最小サイズ (バイト単位) が決定される。"
3509
3510 #. type: Plain text
3511 #: build/C/man3/pthread_attr_setstacksize.3:61
3512 msgid ""
3513 "The B<pthread_attr_getstacksize>()  function returns the stack size "
3514 "attribute of the thread attributes object referred to by I<attr> in the "
3515 "buffer pointed to by I<stacksize>."
3516 msgstr ""
3517 "B<pthread_attr_getstacksize>() は、\n"
3518 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3519 "I<stacksize> が指すバッファーに入れて返す。"
3520
3521 #. type: Plain text
3522 #: build/C/man3/pthread_attr_setstacksize.3:67
3523 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
3524 msgstr "B<pthread_attr_setstacksize>() は以下のエラーで失敗する場合がある。"
3525
3526 #. type: Plain text
3527 #: build/C/man3/pthread_attr_setstacksize.3:72
3528 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
3529 msgstr "スタックサイズが B<PTHREAD_STACK_MIN> (16384) バイト未満である。"
3530
3531 #.  e.g., MacOS
3532 #. type: Plain text
3533 #: build/C/man3/pthread_attr_setstacksize.3:81
3534 msgid ""
3535 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
3536 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
3537 msgstr ""
3538 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
3539 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
3540 "エラー B<EINVAL> で失敗する。"
3541
3542 #. type: Plain text
3543 #: build/C/man3/pthread_attr_setstacksize.3:90
3544 msgid ""
3545 "The B<pthread_attr_setstacksize>()  and B<pthread_attr_getstacksize>()  "
3546 "functions are thread-safe."
3547 msgstr ""
3548 "関数 B<pthread_attr_setstacksize>() と B<pthread_attr_getstacksize>() はス"
3549 "レッドセーフである。"
3550
3551 #. type: Plain text
3552 #: build/C/man3/pthread_attr_setstacksize.3:95
3553 msgid ""
3554 "For details on the default stack size of new threads, see "
3555 "B<pthread_create>(3)."
3556 msgstr ""
3557 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
3558 "B<pthread_create>(3) を参照。"
3559
3560 #. type: Plain text
3561 #: build/C/man3/pthread_attr_setstacksize.3:98
3562 msgid ""
3563 "A thread's stack size is fixed at the time of thread creation.  Only the "
3564 "main thread can dynamically grow its stack."
3565 msgstr ""
3566 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
3567 "メインスレッドだけがスタックを動的に伸ばすことができる。"
3568
3569 #. type: Plain text
3570 #: build/C/man3/pthread_attr_setstacksize.3:103
3571 msgid ""
3572 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
3573 "the size and location of a caller-allocated stack that is to be used by a "
3574 "thread."
3575 msgstr ""
3576 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
3577 "アプリケーションは、スレッドが使用するスタックとして、\n"
3578 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
3579
3580 #. type: Plain text
3581 #: build/C/man3/pthread_attr_setstacksize.3:115
3582 msgid ""
3583 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
3584 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
3585 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
3586 "stack will be at least I<stacksize> bytes."
3587 msgstr ""
3588 "glibc 2.8 の時点では、指定された I<stacksize> が B<STACK_ALIGN> \n"
3589 "(ほとんどのアーキテクチャーでは 16 バイト) の倍数でない場合、\n"
3590 "I<stacksize> はI<小さくなる方向に>に丸められる。\n"
3591 "これは POSIX.1-2001 に違反している。\n"
3592 "POSIX.1-2001 では、割り当てらたスタックの大きさは\n"
3593 "少なくとも I<stacksize> バイトになると書かれている。"
3594
3595 #. type: Plain text
3596 #: build/C/man3/pthread_attr_setstacksize.3:118
3597 #: build/C/man3/pthread_join.3:127
3598 msgid "See B<pthread_create>(3)."
3599 msgstr "B<pthread_create>(3) を参照。"
3600
3601 #. type: Plain text
3602 #: build/C/man3/pthread_attr_setstacksize.3:125
3603 msgid ""
3604 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3605 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3606 msgstr ""
3607 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3608 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3609
3610 #. type: TH
3611 #: build/C/man3/pthread_cancel.3:26
3612 #, no-wrap
3613 msgid "PTHREAD_CANCEL"
3614 msgstr "PTHREAD_CANCEL"
3615
3616 #. type: TH
3617 #: build/C/man3/pthread_cancel.3:26
3618 #, no-wrap
3619 msgid "2008-11-17"
3620 msgstr "2008-11-17"
3621
3622 #. type: Plain text
3623 #: build/C/man3/pthread_cancel.3:29
3624 msgid "pthread_cancel - send a cancellation request to a thread"
3625 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
3626
3627 #. type: Plain text
3628 #: build/C/man3/pthread_cancel.3:34
3629 #, no-wrap
3630 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3631 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3632
3633 #. type: Plain text
3634 #: build/C/man3/pthread_cancel.3:49
3635 msgid ""
3636 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
3637 "I<thread>.  Whether and when the target thread reacts to the cancellation "
3638 "request depends on two attributes that are under the control of that thread: "
3639 "its cancelability I<state> and I<type>."
3640 msgstr ""
3641 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
3642 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
3643 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
3644 "I<state> と I<type>により決まる。"
3645
3646 #. type: Plain text
3647 #: build/C/man3/pthread_cancel.3:61
3648 msgid ""
3649 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
3650 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
3651 "has disabled cancellation, then a cancellation request remains queued until "
3652 "the thread enables cancellation.  If a thread has enabled cancellation, then "
3653 "its cancelability type determines when cancellation occurs."
3654 msgstr ""
3655 "あるスレッドの cancelability state は B<pthread_setcancelstate>(3) で\n"
3656 "設定され、I<enabled> と I<disabled> のいずれとなる (I<enabled> が新しい\n"
3657 "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n"
3658 "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n"
3659 "れたままになる。スレッドがキャンセルを有効にしていた場合、\n"
3660 "cancelability type によって、いつキャンセルが発生するかが決まる。"
3661
3662 #. type: Plain text
3663 #: build/C/man3/pthread_cancel.3:77
3664 msgid ""
3665 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3666 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
3667 "Asynchronous cancelability means that the thread can be canceled at any time "
3668 "(usually immediately, but the system does not guarantee this).  Deferred "
3669 "cancelability means that cancellation will be delayed until the thread next "
3670 "calls a function that is a I<cancellation point>.  A list of functions that "
3671 "are or may be cancellation points is provided in B<pthreads>(7)."
3672 msgstr ""
3673 "スレッドのキャンセル種別 (cancelability type) は\n"
3674 "B<pthread_setcanceltype>(3) で設定され、I<asynchronous> か I<deferred>\n"
3675 "のいずれかとなる(I<deferred> が新しいスレッドのデフォルト値である)。\n"
3676 "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつで\n"
3677 "もキャンセルされることを意味する (通常はすぐにキャンセルされるが、\n"
3678 "システムがそのことを保証しているわけではない)。遅延キャンセル\n"
3679 "(deferred cancelability) では、そのスレッドが I<取り消しポイント\n"
3680 "(cancellation point)> となっている関数を次に呼び出すまでキャンセルが\n"
3681 "遅延される。取り消しポイントに設定されていたり設定\n"
3682 "したりできる関数のリストは B<pthreads>(7) に記載している。"
3683
3684 #. type: Plain text
3685 #: build/C/man3/pthread_cancel.3:81
3686 msgid ""
3687 "When a cancellation requested is acted on, the following steps occur for "
3688 "I<thread> (in this order):"
3689 msgstr ""
3690 "キャンセル要求が実行されると、\n"
3691 "I<thread> では以下のステップが (この順序で) 行われる。"
3692
3693 #. type: IP
3694 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:69
3695 #, no-wrap
3696 msgid "1."
3697 msgstr "1."
3698
3699 #. type: Plain text
3700 #: build/C/man3/pthread_cancel.3:86
3701 msgid ""
3702 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3703 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
3704 msgstr ""
3705 "キャンセルクリーンアップハンドラーが (push されたのと逆順で)\n"
3706 "取り出され (pop され)、呼び出される。\n"
3707 "(B<pthread_cleanup_push>(3) 参照)"
3708
3709 #. type: IP
3710 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:73
3711 #, no-wrap
3712 msgid "2."
3713 msgstr "2."
3714
3715 #. type: Plain text
3716 #: build/C/man3/pthread_cancel.3:91
3717 msgid ""
3718 "Thread-specific data destructors are called, in an unspecified order.  (See "
3719 "B<pthread_key_create>(3).)"
3720 msgstr ""
3721 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
3722 "呼び出し順序は規定されていない。\n"
3723 "(B<pthread_key_create>(3) 参照)"
3724
3725 #. type: IP
3726 #: build/C/man3/pthread_cancel.3:91 build/C/man3/pthread_cleanup_push.3:83
3727 #, no-wrap
3728 msgid "3."
3729 msgstr "3."
3730
3731 #. type: Plain text
3732 #: build/C/man3/pthread_cancel.3:95
3733 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3734 msgstr "スレッドが終了される。 (B<pthread_exit>(3) 参照)"
3735
3736 #. type: Plain text
3737 #: build/C/man3/pthread_cancel.3:103
3738 msgid ""
3739 "The above steps happen asynchronously with respect to the "
3740 "B<pthread_cancel>()  call; the return status of B<pthread_cancel>()  merely "
3741 "informs the caller whether the cancellation request was successfully queued."
3742 msgstr ""
3743 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
3744 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
3745 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
3746
3747 #. type: Plain text
3748 #: build/C/man3/pthread_cancel.3:112
3749 msgid ""
3750 "After a canceled thread has terminated, a join with that thread using "
3751 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
3752 "status.  (Joining with a thread is the only way to know that cancellation "
3753 "has completed.)"
3754 msgstr ""
3755 "キャンセルされたスレッドが終了された後に、\n"
3756 "B<pthread_join>(3) でそのスレッドを join すると、\n"
3757 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
3758 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
3759
3760 #. type: Plain text
3761 #: build/C/man3/pthread_cancel.3:117
3762 msgid ""
3763 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
3764 "error number."
3765 msgstr ""
3766 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
3767 "エラーの場合、0 以外のエラー番号を返す。"
3768
3769 #. type: TP
3770 #: build/C/man3/pthread_cancel.3:118 build/C/man3/pthread_detach.3:59
3771 #: build/C/man3/pthread_getcpuclockid.3:58 build/C/man3/pthread_join.3:93
3772 #: build/C/man3/pthread_setaffinity_np.3:114
3773 #: build/C/man3/pthread_setschedparam.3:114
3774 #: build/C/man3/pthread_setschedprio.3:70 build/C/man3/pthread_sigqueue.3:86
3775 #, no-wrap
3776 msgid "B<ESRCH>"
3777 msgstr "B<ESRCH>"
3778
3779 #. type: Plain text
3780 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_detach.3:64
3781 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:98
3782 #: build/C/man3/pthread_setaffinity_np.3:119
3783 #: build/C/man3/pthread_setschedparam.3:119
3784 #: build/C/man3/pthread_setschedprio.3:75
3785 msgid "No thread with the ID I<thread> could be found."
3786 msgstr "ID が I<thread> のスレッドが見つからなかった。"
3787
3788 #. type: Plain text
3789 #: build/C/man3/pthread_cancel.3:135
3790 msgid ""
3791 "On Linux, cancellation is implemented using signals.  Under the NPTL "
3792 "threading implementation, the first real-time signal (i.e., signal 32) is "
3793 "used for this purpose.  On LinuxThreads, the second real-time signal is "
3794 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3795 msgstr ""
3796 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装で"
3797 "は、\n"
3798 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
3799 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイ"
3800 "ム\n"
3801 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
3802
3803 #. type: Plain text
3804 #: build/C/man3/pthread_cancel.3:141
3805 msgid ""
3806 "The program below creates a thread and then cancels it.  The main thread "
3807 "joins with the canceled thread to check that its exit status was "
3808 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
3809 "run the program:"
3810 msgstr ""
3811 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルす"
3812 "る。\n"
3813 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
3814 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
3815 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
3816
3817 #. type: Plain text
3818 #: build/C/man3/pthread_cancel.3:149
3819 #, no-wrap
3820 msgid ""
3821 "$ ./a.out\n"
3822 "thread_func(): started; cancellation disabled\n"
3823 "main(): sending cancellation request\n"
3824 "thread_func(): about to enable cancellation\n"
3825 "main(): thread was canceled\n"
3826 msgstr ""
3827 "$ ./a.out\n"
3828 "thread_func(): started; cancellation disabled\n"
3829 "main(): sending cancellation request\n"
3830 "thread_func(): about to enable cancellation\n"
3831 "main(): thread was canceled\n"
3832
3833 #. type: Plain text
3834 #: build/C/man3/pthread_cancel.3:159
3835 #, no-wrap
3836 msgid ""
3837 "#include E<lt>pthread.hE<gt>\n"
3838 "#include E<lt>stdio.hE<gt>\n"
3839 "#include E<lt>errno.hE<gt>\n"
3840 "#include E<lt>stdlib.hE<gt>\n"
3841 "#include E<lt>unistd.hE<gt>\n"
3842 msgstr ""
3843 "#include E<lt>pthread.hE<gt>\n"
3844 "#include E<lt>stdio.hE<gt>\n"
3845 "#include E<lt>errno.hE<gt>\n"
3846 "#include E<lt>stdlib.hE<gt>\n"
3847 "#include E<lt>unistd.hE<gt>\n"
3848
3849 #. type: Plain text
3850 #: build/C/man3/pthread_cancel.3:167
3851 #, no-wrap
3852 msgid ""
3853 "static void *\n"
3854 "thread_func(void *ignored_argument)\n"
3855 "{\n"
3856 "    int s;\n"
3857 msgstr ""
3858 "static void *\n"
3859 "thread_func(void *ignored_argument)\n"
3860 "{\n"
3861 "    int s;\n"
3862
3863 #. type: Plain text
3864 #: build/C/man3/pthread_cancel.3:170
3865 #, no-wrap
3866 msgid ""
3867 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3868 "       immediately react to a cancellation request */\n"
3869 msgstr ""
3870 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3871 "       immediately react to a cancellation request */\n"
3872
3873 #. type: Plain text
3874 #: build/C/man3/pthread_cancel.3:174
3875 #, no-wrap
3876 msgid ""
3877 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3878 "    if (s != 0)\n"
3879 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3880 msgstr ""
3881 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3882 "    if (s != 0)\n"
3883 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3884
3885 #. type: Plain text
3886 #: build/C/man3/pthread_cancel.3:178
3887 #, no-wrap
3888 msgid ""
3889 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3890 "    sleep(5);\n"
3891 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3892 msgstr ""
3893 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3894 "    sleep(5);\n"
3895 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3896
3897 #. type: Plain text
3898 #: build/C/man3/pthread_cancel.3:182
3899 #, no-wrap
3900 msgid ""
3901 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3902 "    if (s != 0)\n"
3903 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3904 msgstr ""
3905 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3906 "    if (s != 0)\n"
3907 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3908
3909 #. type: Plain text
3910 #: build/C/man3/pthread_cancel.3:184
3911 #, no-wrap
3912 msgid "    /* sleep() is a cancellation point */\n"
3913 msgstr "    /* sleep() is a cancellation point */\n"
3914
3915 #. type: Plain text
3916 #: build/C/man3/pthread_cancel.3:186
3917 #, no-wrap
3918 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3919 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3920
3921 #. type: Plain text
3922 #: build/C/man3/pthread_cancel.3:188
3923 #, no-wrap
3924 msgid "    /* Should never get here */\n"
3925 msgstr "    /* Should never get here */\n"
3926
3927 #. type: Plain text
3928 #: build/C/man3/pthread_cancel.3:192
3929 #, no-wrap
3930 msgid ""
3931 "    printf(\"thread_func(): not canceled!\\en\");\n"
3932 "    return NULL;\n"
3933 "}\n"
3934 msgstr ""
3935 "    printf(\"thread_func(): not canceled!\\en\");\n"
3936 "    return NULL;\n"
3937 "}\n"
3938
3939 #. type: Plain text
3940 #: build/C/man3/pthread_cancel.3:199
3941 #, no-wrap
3942 msgid ""
3943 "int\n"
3944 "main(void)\n"
3945 "{\n"
3946 "    pthread_t thr;\n"
3947 "    void *res;\n"
3948 "    int s;\n"
3949 msgstr ""
3950 "int\n"
3951 "main(void)\n"
3952 "{\n"
3953 "    pthread_t thr;\n"
3954 "    void *res;\n"
3955 "    int s;\n"
3956
3957 #. type: Plain text
3958 #: build/C/man3/pthread_cancel.3:201
3959 #, no-wrap
3960 msgid "    /* Start a thread and then send it a cancellation request */\n"
3961 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3962
3963 #. type: Plain text
3964 #: build/C/man3/pthread_cancel.3:205
3965 #, no-wrap
3966 msgid ""
3967 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3968 "    if (s != 0)\n"
3969 "        handle_error_en(s, \"pthread_create\");\n"
3970 msgstr ""
3971 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3972 "    if (s != 0)\n"
3973 "        handle_error_en(s, \"pthread_create\");\n"
3974
3975 #. type: Plain text
3976 #: build/C/man3/pthread_cancel.3:207
3977 #, no-wrap
3978 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3979 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3980
3981 #. type: Plain text
3982 #: build/C/man3/pthread_cancel.3:212
3983 #, no-wrap
3984 msgid ""
3985 "    printf(\"main(): sending cancellation request\\en\");\n"
3986 "    s = pthread_cancel(thr);\n"
3987 "    if (s != 0)\n"
3988 "        handle_error_en(s, \"pthread_cancel\");\n"
3989 msgstr ""
3990 "    printf(\"main(): sending cancellation request\\en\");\n"
3991 "    s = pthread_cancel(thr);\n"
3992 "    if (s != 0)\n"
3993 "        handle_error_en(s, \"pthread_cancel\");\n"
3994
3995 #. type: Plain text
3996 #: build/C/man3/pthread_cancel.3:214
3997 #, no-wrap
3998 msgid "    /* Join with thread to see what its exit status was */\n"
3999 msgstr "    /* Join with thread to see what its exit status was */\n"
4000
4001 #. type: Plain text
4002 #: build/C/man3/pthread_cancel.3:218 build/C/man3/pthread_cleanup_push.3:307
4003 #, no-wrap
4004 msgid ""
4005 "    s = pthread_join(thr, &res);\n"
4006 "    if (s != 0)\n"
4007 "        handle_error_en(s, \"pthread_join\");\n"
4008 msgstr ""
4009 "    s = pthread_join(thr, &res);\n"
4010 "    if (s != 0)\n"
4011 "        handle_error_en(s, \"pthread_join\");\n"
4012
4013 #. type: Plain text
4014 #: build/C/man3/pthread_cancel.3:225
4015 #, no-wrap
4016 msgid ""
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 msgstr ""
4024 "    if (res == PTHREAD_CANCELED)\n"
4025 "        printf(\"main(): thread was canceled\\en\");\n"
4026 "    else\n"
4027 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
4028 "    exit(EXIT_SUCCESS);\n"
4029 "}\n"
4030
4031 #. type: Plain text
4032 #: build/C/man3/pthread_cancel.3:238
4033 msgid ""
4034 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
4035 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
4036 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4037 msgstr ""
4038 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
4039 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
4040 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4041
4042 #. type: TH
4043 #: build/C/man3/pthread_cleanup_push.3:26
4044 #, no-wrap
4045 msgid "PTHREAD_CLEANUP_PUSH"
4046 msgstr "PTHREAD_CLEANUP_PUSH"
4047
4048 #. type: TH
4049 #: build/C/man3/pthread_cleanup_push.3:26
4050 #, no-wrap
4051 msgid "2008-11-24"
4052 msgstr "2008-11-24"
4053
4054 #. type: Plain text
4055 #: build/C/man3/pthread_cleanup_push.3:30
4056 msgid ""
4057 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
4058 "clean-up handlers"
4059 msgstr ""
4060 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
4061 "キャンセルクリーンアップハンドラーの push/pop を行う"
4062
4063 #. type: Plain text
4064 #: build/C/man3/pthread_cleanup_push.3:37
4065 #, no-wrap
4066 msgid ""
4067 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
4068 "B<                          void *>I<arg>B<);>\n"
4069 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
4070 msgstr ""
4071 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
4072 "B<                          void *>I<arg>B<);>\n"
4073 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
4074
4075 #. type: Plain text
4076 #: build/C/man3/pthread_cleanup_push.3:48
4077 msgid ""
4078 "These functions manipulate the calling thread's stack of thread-cancellation "
4079 "clean-up handlers.  A clean-up handler is a function that is automatically "
4080 "executed when a thread is canceled (or in various other circumstances "
4081 "described below); it might, for example, unlock a mutex so that it becomes "
4082 "available to other threads in the process."
4083 msgstr ""
4084 "これらの関数は、呼び出したスレッドのスレッドキャンセル時のクリーンアッ\n"
4085 "プハンドラーのスタックの操作を行う。クリーンアップハンドラーは、スレッドが\n"
4086 "キャンセルされた場合 (や以下で説明する他の種々の状況において) 自動的に\n"
4087 "実行される関数である。例えば、mutex のロック解除を行い、プロセス内の\n"
4088 "他のスレッドが利用できるようにする関数などが考えられる。"
4089
4090 #. type: Plain text
4091 #: build/C/man3/pthread_cleanup_push.3:59
4092 msgid ""
4093 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
4094 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
4095 "be given I<arg> as its argument."
4096 msgstr ""
4097 "B<pthread_cleanup_push>() 関数は、 I<routine> をクリーンアップ\n"
4098 "ハンドラーのスタックの一番上にプッシュする。 I<routine> が後で\n"
4099 "起動される際には、 I<arg> が関数の引き数と渡される。"
4100
4101 #. type: Plain text
4102 #: build/C/man3/pthread_cleanup_push.3:66
4103 msgid ""
4104 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
4105 "stack of clean-up handlers, and optionally executes it if I<execute> is "
4106 "nonzero."
4107 msgstr ""
4108 "B<pthread_cleanup_pop>() 関数は、クリーンアップハンドラーの\n"
4109 "スタックの一番上のルーチンを削除する。\n"
4110 "I<execute> が 0 以外の場合にはそのルーチンを追加で実行する。"
4111
4112 #. type: Plain text
4113 #: build/C/man3/pthread_cleanup_push.3:69
4114 msgid ""
4115 "A cancellation clean-up handler is popped from the stack and executed in the "
4116 "following circumstances:"
4117 msgstr ""
4118 "キャンセルクリーンアップハンドラーは、以下に示す場合に\n"
4119 "スタックから取り出され実行される。"
4120
4121 #. type: Plain text
4122 #: build/C/man3/pthread_cleanup_push.3:73
4123 msgid ""
4124 "When a thread is canceled, all of the stacked clean-up handlers are popped "
4125 "and executed in the reverse of the order in which they were pushed onto the "
4126 "stack."
4127 msgstr ""
4128 "スレッドがキャンセルされた際に、スタックに登録された全てのクリーン\n"
4129 "アップハンドラーが取り出されて、実行される。クリーンアップハンドラーの\n"
4130 "実行は、スタックに登録されたのと逆の順序で行われる。"
4131
4132 #. type: Plain text
4133 #: build/C/man3/pthread_cleanup_push.3:83
4134 msgid ""
4135 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
4136 "handlers are executed as described in the preceding point.  (Clean-up "
4137 "handlers are I<not> called if the thread terminates by performing a "
4138 "I<return> from the thread start function.)"
4139 msgstr ""
4140 "スレッドが B<pthread_exit>(3) を呼び出して終了する際に、全てのクリーン\n"
4141 "アップハンドラーが上の項目で述べたのと同様に実行される。\n"
4142 "(スレッドがスレッド開始関数からの I<return> の実行により終了する場合に\n"
4143 "は、クリーンアップハンドラーはI<呼び出されない>。)"
4144
4145 #. type: Plain text
4146 #: build/C/man3/pthread_cleanup_push.3:89
4147 msgid ""
4148 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
4149 "argument, the top-most clean-up handler is popped and executed."
4150 msgstr ""
4151 "スレッドが 0 以外の I<execute> 引き数で B<pthread_cleanup_pop>() を\n"
4152 "呼び出した際に、スタックの一番上のクリーンアップハンドラーが取り出されて\n"
4153 "実行される。"
4154
4155 #. type: Plain text
4156 #: build/C/man3/pthread_cleanup_push.3:101
4157 msgid ""
4158 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
4159 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
4160 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
4161 "calls to these functions are paired within the same function, and at the "
4162 "same lexical nesting level.  (In other words, a clean-up handler is "
4163 "established only during the execution of a specified section of code.)"
4164 msgstr ""
4165 "POSIX.1 では、 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>() を\n"
4166 "それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開するマクロと\n"
4167 "して実装することを許容している。\n"
4168 "このため、呼び出し側では、これらの関数の呼び出しが同じ関数の中で対と\n"
4169 "なり、かつ文法的に同じネストレベル (nesting level) になることを保証\n"
4170 "しなければならない。 (言い換えると、クリーンアップハンドラーは、コード\n"
4171 "の特定のセクションの実行の中でのみ設定するものであると言える。)"
4172
4173 #. type: Plain text
4174 #: build/C/man3/pthread_cleanup_push.3:121
4175 msgid ""
4176 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
4177 "call has been made to B<pthread_cleanup_push>()  or "
4178 "B<pthread_cleanup_pop>()  without the matching call of the pair since the "
4179 "jump buffer was filled by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, "
4180 "calling B<longjmp>(3)  (B<siglongjmp>(3))  from inside a clean-up handler "
4181 "produces undefined results unless the jump buffer was also filled by "
4182 "B<setjmp>(3)  (B<sigsetjmp>(3))  inside the handler."
4183 msgstr ""
4184 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しは、\n"
4185 "B<pthread_cleanup_push>() や B<pthread_cleanup_pop>() の呼び出しが対と\n"
4186 "なる呼び出しがない状態で行われた場合には、どのような結果になるかは不定\n"
4187 "である。これは jump バッファーは B<setjmp>(3) (B<sigsetjmp>(3)) により設\n"
4188 "定されるからである。同様に、クリーンアップハンドラー内からの\n"
4189 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しも、jump バッファーがハンドラー\n"
4190 "内で B<setjmp>(3) (B<sigsetjmp>(3)) で設定されていない限り、どのような\n"
4191 "結果になるかは不定である。"
4192
4193 #. type: Plain text
4194 #: build/C/man3/pthread_cleanup_push.3:123
4195 msgid "These functions do not return a value."
4196 msgstr "これらの関数は値を返さない。"
4197
4198 #.  SH VERSIONS
4199 #.  Available since glibc 2.0
4200 #. type: Plain text
4201 #: build/C/man3/pthread_cleanup_push.3:127
4202 msgid "There are no errors."
4203 msgstr "エラーはない。"
4204
4205 #. type: Plain text
4206 #: build/C/man3/pthread_cleanup_push.3:140
4207 msgid ""
4208 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
4209 "functions I<are> implemented as macros that expand to text containing "
4210 "\\(aqB<{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
4211 "declared within the scope of paired calls to these functions will be visible "
4212 "within only that scope."
4213 msgstr ""
4214 "Linux では、関数 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>()\n"
4215 "は、それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開する\n"
4216 "マクロとして実装されている。このことは、これらの関数を対で呼び出した\n"
4217 "スコープ内で宣言された変数は、そのスコープの中でしか参照できない\n"
4218 "ということを意味している。"
4219
4220 #.  The text was actually added in the 2004 TC2
4221 #. type: Plain text
4222 #: build/C/man3/pthread_cleanup_push.3:155
4223 msgid ""
4224 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
4225 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
4226 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
4227 "avoid doing this."
4228 msgstr ""
4229 "POSIX.1 には、括弧を含む B<pthread_cleanup_push>() と\n"
4230 "B<pthread_cleanup_pop>() のブロックをそのままにしたままで、 \n"
4231 "I<return>, I<break>, I<continue>, I<goto> を使った場合の影響は\n"
4232 "不定であると書かれている。\n"
4233 "移植性が必要なアプリケーションではこれを行うのは避けるべきである。"
4234
4235 #. type: Plain text
4236 #: build/C/man3/pthread_cleanup_push.3:170
4237 msgid ""
4238 "The program below provides a simple example of the use of the functions "
4239 "described in this page.  The program creates a thread that executes a loop "
4240 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
4241 "loop increments a global variable, I<cnt>, once each second.  Depending on "
4242 "what command-line arguments are supplied, the main thread sends the other "
4243 "thread a cancellation request, or sets a global variable that causes the "
4244 "other thread to exit its loop and terminate normally (by doing a I<return>)."
4245 msgstr ""
4246 "以下のプログラムは、このページで説明した関数の簡単な使用例を示すもので\n"
4247 "ある。このプログラムは B<pthread_cleanup_push>() と\n"
4248 "B<pthread_cleanup_pop>() で囲まれたループを実行するスレッドを作成する。\n"
4249 "このループではグローバル変数 I<cnt> を 1 秒に 1 ずつ増やしていく。\n"
4250 "指定されたコマンドライン引き数の内容に基づいて、メインスレッドはもう一\n"
4251 "つのスレッドにキャンセル要求を送ったり、もう一つのスレッドがループを\n"
4252 "抜けて (I<return> を呼び出して) 正常終了するようにグローバル変数を\n"
4253 "設定したりする。"
4254
4255 #. type: Plain text
4256 #: build/C/man3/pthread_cleanup_push.3:173
4257 msgid ""
4258 "In the following shell session, the main thread sends a cancellation request "
4259 "to the other thread:"
4260 msgstr ""
4261 "以下のシェルセッションでは、メインスレッドはもう一つのスレッドに\n"
4262 "キャンセル要求を送信する。"
4263
4264 #. type: Plain text
4265 #: build/C/man3/pthread_cleanup_push.3:183
4266 #, no-wrap
4267 msgid ""
4268 "$ B<./a.out>\n"
4269 "New thread started\n"
4270 "cnt = 0\n"
4271 "cnt = 1\n"
4272 "Canceling thread\n"
4273 "Called clean-up handler\n"
4274 "Thread was canceled; cnt = 0\n"
4275 msgstr ""
4276 "$ B<./a.out>\n"
4277 "New thread started\n"
4278 "cnt = 0\n"
4279 "cnt = 1\n"
4280 "Canceling thread\n"
4281 "Called clean-up handler\n"
4282 "Thread was canceled; cnt = 0\n"
4283
4284 #. type: Plain text
4285 #: build/C/man3/pthread_cleanup_push.3:191
4286 msgid ""
4287 "From the above, we see that the thread was canceled, and that the "
4288 "cancellation clean-up handler was called and it reset the value of the "
4289 "global variable I<cnt> to 0."
4290 msgstr ""
4291 "上記の実行例から、スレッドがキャンセルされ、\n"
4292 "キャンセルクリーンアップハンドラーが呼び出され、\n"
4293 "グローバル変数 I<cnt> の値が 0 にリセットされていることが確認できる。"
4294
4295 #. type: Plain text
4296 #: build/C/man3/pthread_cleanup_push.3:194
4297 msgid ""
4298 "In the next run, the main program sets a global variable that causes other "
4299 "thread to terminate normally:"
4300 msgstr ""
4301 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4302 "もう一つのスレッドが正常終了するようにしている。"
4303
4304 #. type: Plain text
4305 #: build/C/man3/pthread_cleanup_push.3:202
4306 #, no-wrap
4307 msgid ""
4308 "$ B<./a.out x>\n"
4309 "New thread started\n"
4310 "cnt = 0\n"
4311 "cnt = 1\n"
4312 "Thread terminated normally; cnt = 2\n"
4313 msgstr ""
4314 "$ B<./a.out x>\n"
4315 "New thread started\n"
4316 "cnt = 0\n"
4317 "cnt = 1\n"
4318 "Thread terminated normally; cnt = 2\n"
4319
4320 #. type: Plain text
4321 #: build/C/man3/pthread_cleanup_push.3:210
4322 msgid ""
4323 "From the above, we see that the clean-up handler was not executed (because "
4324 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
4325 msgstr ""
4326 "上記では、 (I<cleanup_pop_arg> が 0 なので) クリーンアップハンドラーは\n"
4327 "実行されておらず、その結果 I<cnt> の値はリセットされていないことが\n"
4328 "分かる。"
4329
4330 #. type: Plain text
4331 #: build/C/man3/pthread_cleanup_push.3:215
4332 msgid ""
4333 "In the next run, the main program sets a global variable that causes the "
4334 "other thread to terminate normally, and supplies a nonzero value for "
4335 "I<cleanup_pop_arg>:"
4336 msgstr ""
4337 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4338 "もう一つのスレッドが正常終了するようにし、さらに\n"
4339 "I<cleanup_pop_arg> に 0 以外の値を渡している。"
4340
4341 #. type: Plain text
4342 #: build/C/man3/pthread_cleanup_push.3:224
4343 #, no-wrap
4344 msgid ""
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 msgstr ""
4352 "$ B<./a.out x 1>\n"
4353 "New thread started\n"
4354 "cnt = 0\n"
4355 "cnt = 1\n"
4356 "Called clean-up handler\n"
4357 "Thread terminated normally; cnt = 0\n"
4358
4359 #. type: Plain text
4360 #: build/C/man3/pthread_cleanup_push.3:231
4361 msgid ""
4362 "In the above, we see that although the thread was not canceled, the clean-up "
4363 "handler was executed, because the argument given to "
4364 "B<pthread_cleanup_pop>()  was nonzero."
4365 msgstr ""
4366 "上記では、スレッドはキャンセルされていないが、クリーンアップハンドラーが\n"
4367 "実行されていないことが分かる。これは B<pthread_cleanup_pop>() の引き数\n"
4368 "に 0 以外を渡したからである。"
4369
4370 #. type: Plain text
4371 #: build/C/man3/pthread_cleanup_push.3:240
4372 #, no-wrap
4373 msgid ""
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 msgstr ""
4381 "#include E<lt>pthread.hE<gt>\n"
4382 "#include E<lt>sys/types.hE<gt>\n"
4383 "#include E<lt>stdio.hE<gt>\n"
4384 "#include E<lt>stdlib.hE<gt>\n"
4385 "#include E<lt>unistd.hE<gt>\n"
4386 "#include E<lt>errno.hE<gt>\n"
4387
4388 #. type: Plain text
4389 #: build/C/man3/pthread_cleanup_push.3:247
4390 #, no-wrap
4391 msgid ""
4392 "static int done = 0;\n"
4393 "static int cleanup_pop_arg = 0;\n"
4394 "static int cnt = 0;\n"
4395 msgstr ""
4396 "static int done = 0;\n"
4397 "static int cleanup_pop_arg = 0;\n"
4398 "static int cnt = 0;\n"
4399
4400 #. type: Plain text
4401 #: build/C/man3/pthread_cleanup_push.3:254
4402 #, no-wrap
4403 msgid ""
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 msgstr ""
4411 "static void\n"
4412 "cleanup_handler(void *arg)\n"
4413 "{\n"
4414 "    printf(\"Called clean-up handler\\en\");\n"
4415 "    cnt = 0;\n"
4416 "}\n"
4417
4418 #. type: Plain text
4419 #: build/C/man3/pthread_cleanup_push.3:259
4420 #, no-wrap
4421 msgid ""
4422 "static void *\n"
4423 "thread_start(void *arg)\n"
4424 "{\n"
4425 "    time_t start, curr;\n"
4426 msgstr ""
4427 "static void *\n"
4428 "thread_start(void *arg)\n"
4429 "{\n"
4430 "    time_t start, curr;\n"
4431
4432 #. type: Plain text
4433 #: build/C/man3/pthread_cleanup_push.3:261
4434 #, no-wrap
4435 msgid "    printf(\"New thread started\\en\");\n"
4436 msgstr "    printf(\"New thread started\\en\");\n"
4437
4438 #. type: Plain text
4439 #: build/C/man3/pthread_cleanup_push.3:263
4440 #, no-wrap
4441 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4442 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4443
4444 #. type: Plain text
4445 #: build/C/man3/pthread_cleanup_push.3:265
4446 #, no-wrap
4447 msgid "    curr = start = time(NULL);\n"
4448 msgstr "    curr = start = time(NULL);\n"
4449
4450 #. type: Plain text
4451 #: build/C/man3/pthread_cleanup_push.3:274
4452 #, no-wrap
4453 msgid ""
4454 "    while (!done) {\n"
4455 "        pthread_testcancel();           /* A cancellation point */\n"
4456 "        if (curr E<lt> time(NULL)) {\n"
4457 "            curr = time(NULL);\n"
4458 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4459 "            cnt++;\n"
4460 "        }\n"
4461 "    }\n"
4462 msgstr ""
4463 "    while (!done) {\n"
4464 "        pthread_testcancel();           /* A cancellation point */\n"
4465 "        if (curr E<lt> time(NULL)) {\n"
4466 "            curr = time(NULL);\n"
4467 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4468 "            cnt++;\n"
4469 "        }\n"
4470 "    }\n"
4471
4472 #. type: Plain text
4473 #: build/C/man3/pthread_cleanup_push.3:278
4474 #, no-wrap
4475 msgid ""
4476 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4477 "    return NULL;\n"
4478 "}\n"
4479 msgstr ""
4480 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4481 "    return NULL;\n"
4482 "}\n"
4483
4484 #. type: Plain text
4485 #: build/C/man3/pthread_cleanup_push.3:285
4486 #, no-wrap
4487 msgid ""
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 msgstr ""
4495 "int\n"
4496 "main(int argc, char *argv[])\n"
4497 "{\n"
4498 "    pthread_t thr;\n"
4499 "    int s;\n"
4500 "    void *res;\n"
4501
4502 #. type: Plain text
4503 #: build/C/man3/pthread_cleanup_push.3:289
4504 #, no-wrap
4505 msgid ""
4506 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4507 "    if (s != 0)\n"
4508 "        handle_error_en(s, \"pthread_create\");\n"
4509 msgstr ""
4510 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4511 "    if (s != 0)\n"
4512 "        handle_error_en(s, \"pthread_create\");\n"
4513
4514 #. type: Plain text
4515 #: build/C/man3/pthread_cleanup_push.3:291
4516 #, no-wrap
4517 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
4518 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
4519
4520 #. type: Plain text
4521 #: build/C/man3/pthread_cleanup_push.3:296
4522 #, no-wrap
4523 msgid ""
4524 "    if (argc E<gt> 1) {\n"
4525 "        if (argc E<gt> 2)\n"
4526 "            cleanup_pop_arg = atoi(argv[2]);\n"
4527 "        done = 1;\n"
4528 msgstr ""
4529 "    if (argc E<gt> 1) {\n"
4530 "        if (argc E<gt> 2)\n"
4531 "            cleanup_pop_arg = atoi(argv[2]);\n"
4532 "        done = 1;\n"
4533
4534 #. type: Plain text
4535 #: build/C/man3/pthread_cleanup_push.3:303
4536 #, no-wrap
4537 msgid ""
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 msgstr ""
4545 "    } else {\n"
4546 "        printf(\"Canceling thread\\en\");\n"
4547 "        s = pthread_cancel(thr);\n"
4548 "        if (s != 0)\n"
4549 "            handle_error_en(s, \"pthread_cancel\");\n"
4550 "    }\n"
4551
4552 #. type: Plain text
4553 #: build/C/man3/pthread_cleanup_push.3:314
4554 #, no-wrap
4555 msgid ""
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 msgstr ""
4563 "    if (res == PTHREAD_CANCELED)\n"
4564 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4565 "    else\n"
4566 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4567 "    exit(EXIT_SUCCESS);\n"
4568 "}\n"
4569
4570 #. type: Plain text
4571 #: build/C/man3/pthread_cleanup_push.3:321
4572 msgid ""
4573 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4574 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4575 msgstr ""
4576 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4577 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4578
4579 #. type: TH
4580 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
4581 #, no-wrap
4582 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4583 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4584
4585 #. type: Plain text
4586 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
4587 msgid ""
4588 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
4589 "thread cancellation clean-up handlers while saving cancelability type"
4590 msgstr ""
4591 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - "
4592 "cancelability type を保持したままでスレッドのキャンセルクリーンアップハンド"
4593 "ラーの push/pop を行う"
4594
4595 #. type: Plain text
4596 #: build/C/man3/pthread_cleanup_push_defer_np.3:37
4597 #, no-wrap
4598 msgid ""
4599 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4600 "B<                                   void *>I<arg>B<);>\n"
4601 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4602 msgstr ""
4603 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4604 "B<                                   void *>I<arg>B<);>\n"
4605 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4606
4607 #. type: Plain text
4608 #: build/C/man3/pthread_cleanup_push_defer_np.3:40
4609 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
4610 #: build/C/man3/pthread_join.3:37 build/C/man3/pthread_kill.3:37
4611 #: build/C/man3/pthread_setname_np.3:39 build/C/man3/pthread_sigmask.3:38
4612 #: build/C/man3/pthread_sigqueue.3:38 build/C/man3/pthread_tryjoin_np.3:42
4613 #: build/C/man3/pthread_yield.3:37
4614 msgid "Compile and link with I<-pthread>."
4615 msgstr "I<-pthread> を付けてコンパイルとリンクを行う。"
4616
4617 #. type: Plain text
4618 #: build/C/man3/pthread_cleanup_push_defer_np.3:49
4619 msgid "B<pthread_cleanup_push_defer_np>(), B<pthread_cleanup_pop_defer_np>():"
4620 msgstr "B<pthread_cleanup_push_defer_np>(), B<pthread_cleanup_pop_defer_np>():"
4621
4622 #. type: Plain text
4623 #: build/C/man3/pthread_cleanup_push_defer_np.3:51
4624 msgid "_GNU_SOURCE"
4625 msgstr "_GNU_SOURCE"
4626
4627 #. type: Plain text
4628 #: build/C/man3/pthread_cleanup_push_defer_np.3:59
4629 msgid ""
4630 "These functions are the same as B<pthread_cleanup_push>(3)  and "
4631 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
4632 msgstr ""
4633 "これらの関数は B<pthread_cleanup_push>(3) と B<pthread_cleanup_pop>(3) と同じ"
4634 "だが、このページで説明する点が異なる。"
4635
4636 #. type: Plain text
4637 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
4638 msgid ""
4639 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
4640 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
4641 "addition, it also saves the thread's current cancelability type, and sets "
4642 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
4643 "this ensures that cancellation clean-up will occur even if the thread's "
4644 "cancelability type was \"asynchronous\" before the call."
4645 msgstr ""
4646 "B<pthread_cleanup_push>(3) と同様に、\n"
4647 "B<pthread_cleanup_push_defer_np>() は I<routine> をそのスレッドの\n"
4648 "クリーンアップハンドラーのスタックに追加する。これに加えて、\n"
4649 "B<pthread_cleanup_push_defer_np>() は現在の cancelability type も\n"
4650 "保存し、cancelability type は \"deferred\" に設定する\n"
4651 "(B<pthread_setcanceltype>(3) 参照)。\n"
4652 "これにより、この関数が呼び出される前のスレッドの cancelability type が\n"
4653 "\"asynchronous\" であったとしても、キャンセルクリーンアップが行われること\n"
4654 "が保証される。"
4655
4656 #. type: Plain text
4657 #: build/C/man3/pthread_cleanup_push_defer_np.3:81
4658 msgid ""
4659 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
4660 "the top-most clean-up handler from the thread's stack of cancellation clean-"
4661 "up handlers.  In addition, it restores the thread's cancelability type to "
4662 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
4663 msgstr ""
4664 "B<pthread_cleanup_pop>(3) と同様に、\n"
4665 "B<pthread_cleanup_pop_restore_np>() はそのスレッドのキャンセル\n"
4666 "クリーンアップハンドラーのスタックから一番上にあるクリーンアップハンドラー\n"
4667 "を取り出す。これに加えて、そのスレッドの cancelability type を、対応\n"
4668 "する B<pthread_cleanup_push_defer_np>() が呼ばれた時点の値に戻す。"
4669
4670 #. type: Plain text
4671 #: build/C/man3/pthread_cleanup_push_defer_np.3:87
4672 msgid ""
4673 "The caller must ensure that calls to these functions are paired within the "
4674 "same function, and at the same lexical nesting level.  Other restrictions "
4675 "apply, as described in B<pthread_cleanup_push>(3)."
4676 msgstr ""
4677 "呼び出し側では、これらの関数の呼び出しが同じ関数の中で対となり、かつ\n"
4678 "文法的に同じネストレベル (nesting level) になることを保証しなければ\n"
4679 "ならない。 B<pthread_cleanup_push>(3) で説明されている他の制限も\n"
4680 "適用される。"
4681
4682 #. type: Plain text
4683 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
4684 msgid "This sequence of calls:"
4685 msgstr "以下の一連の呼び出し"
4686
4687 #. type: Plain text
4688 #: build/C/man3/pthread_cleanup_push_defer_np.3:94
4689 #, no-wrap
4690 msgid ""
4691 "pthread_cleanup_push_defer_np(routine, arg);\n"
4692 "pthread_cleanup_pop_restore_np(execute);\n"
4693 msgstr ""
4694 "pthread_cleanup_push_defer_np(routine, arg);\n"
4695 "pthread_cleanup_pop_restore_np(execute);\n"
4696
4697 #. type: Plain text
4698 #: build/C/man3/pthread_cleanup_push_defer_np.3:98
4699 msgid "is equivalent to (but shorter and more efficient than):"
4700 msgstr "と以下は等価である (但し、上の方がより簡潔で効率的である)。"
4701
4702 #. type: Plain text
4703 #: build/C/man3/pthread_cleanup_push_defer_np.3:104
4704 #, no-wrap
4705 msgid "int oldtype;\n"
4706 msgstr "int oldtype;\n"
4707
4708 #. type: Plain text
4709 #: build/C/man3/pthread_cleanup_push_defer_np.3:110
4710 #, no-wrap
4711 msgid ""
4712 "pthread_cleanup_push(routine, arg);\n"
4713 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4714 "\\&...\n"
4715 "pthread_setcanceltype(oldtype, NULL);\n"
4716 "pthread_cleanup_pop(execute);\n"
4717 msgstr ""
4718 "pthread_cleanup_push(routine, arg);\n"
4719 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4720 "\\&...\n"
4721 "pthread_setcanceltype(oldtype, NULL);\n"
4722 "pthread_cleanup_pop(execute);\n"
4723
4724 #. type: Plain text
4725 #: build/C/man3/pthread_cleanup_push_defer_np.3:123
4726 msgid ""
4727 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
4728 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4729 msgstr ""
4730 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
4731 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4732
4733 #. type: TH
4734 #: build/C/man3/pthread_create.3:26
4735 #, no-wrap
4736 msgid "PTHREAD_CREATE"
4737 msgstr "PTHREAD_CREATE"
4738
4739 #. type: Plain text
4740 #: build/C/man3/pthread_create.3:29
4741 msgid "pthread_create - create a new thread"
4742 msgstr "pthread_create - 新しいスレッドを作成する"
4743
4744 #. type: Plain text
4745 #: build/C/man3/pthread_create.3:35
4746 #, no-wrap
4747 msgid ""
4748 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4749 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4750 msgstr ""
4751 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4752 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4753
4754 #. type: Plain text
4755 #: build/C/man3/pthread_create.3:47
4756 msgid ""
4757 "The B<pthread_create>()  function starts a new thread in the calling "
4758 "process.  The new thread starts execution by invoking I<start_routine>(); "
4759 "I<arg> is passed as the sole argument of I<start_routine>()."
4760 msgstr ""
4761 "B<pthread_create>() 関数は、呼び出したプロセス内に新しいスレッドを作成す"
4762 "る。\n"
4763 "新しいスレッドの実行は、 I<start_routine>() を起動することで開始される。\n"
4764 "I<start_routine>() は引き数を一つだけ取り、\n"
4765 "I<arg> が I<start_routine>() の引き数として渡される。"
4766
4767 #. type: Plain text
4768 #: build/C/man3/pthread_create.3:49
4769 msgid "The new thread terminates in one of the following ways:"
4770 msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。"
4771
4772 #. type: IP
4773 #: build/C/man3/pthread_create.3:49 build/C/man3/pthread_create.3:55
4774 #: build/C/man3/pthread_create.3:63 build/C/man3/pthread_create.3:66
4775 #: build/C/man3/pthread_getattr_np.3:52 build/C/man3/pthread_getattr_np.3:55
4776 #: build/C/man3/pthread_getattr_np.3:58
4777 #, no-wrap
4778 msgid "*"
4779 msgstr "*"
4780
4781 #. type: Plain text
4782 #: build/C/man3/pthread_create.3:55
4783 msgid ""
4784 "It calls B<pthread_exit>(3), specifying an exit status value that is "
4785 "available to another thread in the same process that calls "
4786 "B<pthread_join>(3)."
4787 msgstr ""
4788 "スレッドが B<pthread_exit>(3) を呼び出す。\n"
4789 "B<pthread_exit>(3) を呼び出す際には終了ステータス値を指定する。\n"
4790 "この値は B<pthread_join>(3) を呼び出した同じプロセス内の\n"
4791 "別のスレッドで参照できる。"
4792
4793 #. type: Plain text
4794 #: build/C/man3/pthread_create.3:63
4795 msgid ""
4796 "It returns from I<start_routine>().  This is equivalent to calling "
4797 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
4798 msgstr ""
4799 "スレッドが I<start_routine>() から返る。これは、\n"
4800 "I<return> 文に渡した値で B<pthread_exit>(3) を呼び出すのと等価である。"
4801
4802 #. type: Plain text
4803 #: build/C/man3/pthread_create.3:66
4804 msgid "It is canceled (see B<pthread_cancel>(3))."
4805 msgstr "スレッドがキャンセルされる (B<pthread_cancel>(3) 参照)。"
4806
4807 #. type: Plain text
4808 #: build/C/man3/pthread_create.3:72
4809 msgid ""
4810 "Any of the threads in the process calls B<exit>(3), or the main thread "
4811 "performs a return from I<main>().  This causes the termination of all "
4812 "threads in the process."
4813 msgstr ""
4814 "プロセス内のいずれかのスレッドで B<exit>(3) が呼ばれるか、\n"
4815 "メインスレッドで I<main>() 内で return が実行される。\n"
4816 "この場合は、プロセス内の全てのスレッドが終了される。"
4817
4818 #. type: Plain text
4819 #: build/C/man3/pthread_create.3:86
4820 msgid ""
4821 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4822 "are used at thread creation time to determine attributes for the new thread; "
4823 "this structure is initialized using B<pthread_attr_init>(3)  and related "
4824 "functions.  If I<attr> is NULL, then the thread is created with default "
4825 "attributes."
4826 msgstr ""
4827 "I<attr> 引き数は I<pthread_attr_t> 構造体へのポインターであり、\n"
4828 "I<pthread_attr_t> 構造体の内容を使用して、スレッド作成時に\n"
4829 "新しいスレッドの属性が決定される。\n"
4830 "この構造体は B<pthread_attr_init>(3) や関連の関数を使って初期化される。\n"
4831 "I<attr> が NULL の場合、新しいスレッドはデフォルトの属性で作成される。"
4832
4833 #. type: Plain text
4834 #: build/C/man3/pthread_create.3:93
4835 msgid ""
4836 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
4837 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4838 "used to refer to the thread in subsequent calls to other pthreads functions."
4839 msgstr ""
4840 "成功した場合は、 B<pthread_create>() は返る前に新しいスレッドの ID を\n"
4841 "I<thread> が指すバッファーに格納する。この ID は、これ以降に他の\n"
4842 "pthreads 関数の呼び出しでスレッドを参照するのに使用される。"
4843
4844 #. type: Plain text
4845 #: build/C/man3/pthread_create.3:101
4846 msgid ""
4847 "The new thread inherits a copy of the creating thread's signal mask "
4848 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
4849 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
4850 "thread's alternate signal stack (B<sigaltstack>(2))."
4851 msgstr ""
4852 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスク\n"
4853 "(B<pthread_sigmask>(3) 参照) のコピーを継承する。\n"
4854 "新しいスレッドの処理待ちシグナル (B<sigpending>(2)) の集合は空となる。\n"
4855 "新しいスレッドはスレッドを作成したスレッドの代替シグナルスタック\n"
4856 "(B<sigaltstack>(2)) を継承しない。"
4857
4858 #. type: Plain text
4859 #: build/C/man3/pthread_create.3:104
4860 msgid ""
4861 "The new thread inherits the calling thread's floating-point environment "
4862 "(B<fenv>(3))."
4863 msgstr ""
4864 "新しいスレッドは呼び出したスレッドの浮動小数点環境 (B<fenv>(3))\n"
4865 "を継承する。"
4866
4867 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4868 #. type: Plain text
4869 #: build/C/man3/pthread_create.3:109
4870 msgid ""
4871 "The initial value of the new thread's CPU-time clock is 0 (see "
4872 "B<pthread_getcpuclockid>(3))."
4873 msgstr ""
4874 "新しいスレッドの CPU 時間時計の初期値は 0 である\n"
4875 "(B<pthread_getcpuclockid>(3) 参照)。"
4876
4877 #. type: SS
4878 #: build/C/man3/pthread_create.3:109
4879 #, no-wrap
4880 msgid "Linux-specific details"
4881 msgstr "Linux 固有の詳細"
4882
4883 #. type: Plain text
4884 #: build/C/man3/pthread_create.3:115
4885 msgid ""
4886 "The new thread inherits copies of the calling thread's capability sets (see "
4887 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4888 msgstr ""
4889 "新しいスレッドは、呼び出したスレッドの\n"
4890 "ケーパビリティセット (B<capabilities>(7) 参照) と \n"
4891 "CPU affinity マスク (B<sched_setaffinity>(2) 参照) の\n"
4892 "コピーをを継承しない。"
4893
4894 #. type: Plain text
4895 #: build/C/man3/pthread_create.3:122
4896 msgid ""
4897 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
4898 "number, and the contents of I<*thread> are undefined."
4899 msgstr ""
4900 "成功すると、 B<pthread_create>() は 0 を返す。\n"
4901 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
4902
4903 #. type: TP
4904 #: build/C/man3/pthread_create.3:123 build/C/man3/pthread_create.3:126
4905 #: build/C/man3/pthread_sigqueue.3:72
4906 #, no-wrap
4907 msgid "B<EAGAIN>"
4908 msgstr "B<EAGAIN>"
4909
4910 #. type: Plain text
4911 #: build/C/man3/pthread_create.3:126
4912 msgid "Insufficient resources to create another thread."
4913 msgstr "別のスレッドを作成するのに十分なリソースがない。"
4914
4915 #.  NOTE! The following should match the description in fork(2)
4916 #. type: Plain text
4917 #: build/C/man3/pthread_create.3:144
4918 msgid ""
4919 "A system-imposed limit on the number of threads was encountered.  There are "
4920 "a number of limits that may trigger this error: the B<RLIMIT_NPROC> soft "
4921 "resource limit (set via B<setrlimit>(2)), which limits the number of "
4922 "processes and threads for a real user ID, was reached; the kernel's system-"
4923 "wide limit on the number of processes and threads, I</proc/sys/kernel/"
4924 "threads-max>, was reached (see B<proc>(5)); or the maximum number of PIDs, "
4925 "I</proc/sys/kernel/pid_max>, was reached (see B<proc>(5))."
4926 msgstr ""
4927 "システムで設定されたスレッド数の上限に達していた。 このエラーの原因となる上限"
4928 "値はいくつかある。 実ユーザー ID 当たりのプロセス数とスレッド数の上限である、"
4929 "ソフトリソース上限 B<RLIMIT_NPROC> に達していた (B<setrlimit>(2) で設定でき"
4930 "る)。 カーネルのシステム全体のプロセスとスレッドの数の上限値である I</proc/"
4931 "sys/kernel/threads-max> が達していた (B<proc>(5) 参照)。 PID の最大値 I</"
4932 "proc/sys/kernel/pid_max> に達していた (B<proc>(5) 参照)。"
4933
4934 #. type: Plain text
4935 #: build/C/man3/pthread_create.3:148
4936 msgid "Invalid settings in I<attr>."
4937 msgstr "I<attr> で指定された設定が不正である。"
4938
4939 #. type: TP
4940 #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_setschedparam.3:129
4941 #: build/C/man3/pthread_setschedprio.3:66
4942 #, no-wrap
4943 msgid "B<EPERM>"
4944 msgstr "B<EPERM>"
4945
4946 #. type: Plain text
4947 #: build/C/man3/pthread_create.3:153
4948 msgid ""
4949 "No permission to set the scheduling policy and parameters specified in "
4950 "I<attr>."
4951 msgstr ""
4952 "I<attr> に指定されたスケジューリングポリシーとパラメーターを\n"
4953 "設定する許可がない。"
4954
4955 #. type: Plain text
4956 #: build/C/man3/pthread_create.3:167
4957 msgid ""
4958 "See B<pthread_self>(3)  for further information on the thread ID returned in "
4959 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
4960 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4961 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4962 msgstr ""
4963 "B<pthread_create>() が I<*thread> で返すスレッド ID についての\n"
4964 "詳しい情報は B<pthread_self>(3) を参照のこと。\n"
4965 "リアルタイムスケジューリングポリシーが使用されない限り、\n"
4966 "B<pthread_create>() の呼び出し後に、\n"
4967 "どのスレッドが\\(em呼び出したスレッドか新しいスレッドか\\(em\n"
4968 "次に実行されるかは決まっていない。"
4969
4970 #. type: Plain text
4971 #: build/C/man3/pthread_create.3:187
4972 msgid ""
4973 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
4974 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
4975 "terminate and fetch its exit status.  Only when a terminated joinable thread "
4976 "has been joined are the last of its resources released back to the system.  "
4977 "When a detached thread terminates, its resources are automatically released "
4978 "back to the system: it is not possible to join with the thread in order to "
4979 "obtain its exit status.  Making a thread detached is useful for some types "
4980 "of daemon threads whose exit status the application does not need to care "
4981 "about.  By default, a new thread is created in a joinable state, unless "
4982 "I<attr> was set to create the thread in a detached state (using "
4983 "B<pthread_attr_setdetachstate>(3))."
4984 msgstr ""
4985 "スレッドは I<join 可能>か I<detached (切り離された状態)> のどちらかに\n"
4986 "することができる。スレッドが join 可能な場合、別のスレッドが\n"
4987 "B<pthread_join>(3) を使って終了したスレッドを待ち、終了ステータスを取得\n"
4988 "することができる。終了した join 可能なスレッドは join された場合にのみ、\n"
4989 "そのスレッドの最後に残ったリソースが解放されシステムに戻される。\n"
4990 "detached 状態のスレッドが終了すると、そのスレッドのリソースは自動的に\n"
4991 "システムに戻される。detached 状態のスレッドを join して、その終了\n"
4992 "ステータスを取得することはできない。スレッドを detached 状態にするのは、\n"
4993 "その終了ステータスをアプリケーションが気にする必要がないある種の\n"
4994 "デーモン (daemon) スレッドでは有用である。\n"
4995 "デフォルトでは、新しいスレッドは join 可能な状態で作成される。\n"
4996 "(B<pthread_attr_setdetachstate>(3) を使って) I<attr> でスレッドが\n"
4997 "detached 状態で作成されるように設定されていない限り、join 可能な状態で\n"
4998 "作成される。"
4999
5000 #.  FIXME . Perhaps some of the following detail should be in
5001 #.  a future pthread_attr_setstacksize(3) page.
5002 #. type: Plain text
5003 #: build/C/man3/pthread_create.3:203
5004 msgid ""
5005 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
5006 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
5007 "resource limit I<at the time the program started> has any value other than "
5008 "\"unlimited\", then it determines the default stack size of new threads.  "
5009 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
5010 "explicitly set in the I<attr> argument used to create a thread, in order to "
5011 "obtain a stack size other than the default."
5012 msgstr ""
5013 "Linux/x86-32 では、新しいスレッドのデフォルトのスタックサイズは 2MB で\n"
5014 "ある。NPTL スレッド実装の下では、I<プログラム開始時の> B<RLIMIT_STACK>\n"
5015 "ソフトリソース上限が\"unlimited\" 以外の場合、その値が新しいスレッドのデ\n"
5016 "フォルトのスタックサイズとなる。\n"
5017 "B<pthread_attr_setstacksize>(3) を使って、スレッドを作成する際の\n"
5018 "I<attr> 引き数に明示的にスタックサイズ属性を設定することで、\n"
5019 "デフォルト値以外のスタックサイズを得ることができる。"
5020
5021 #. type: Plain text
5022 #: build/C/man3/pthread_create.3:209
5023 msgid ""
5024 "In the obsolete LinuxThreads implementation, each of the threads in a "
5025 "process has a different process ID.  This is in violation of the POSIX "
5026 "threads specification, and is the source of many other nonconformances to "
5027 "the standard; see B<pthreads>(7)."
5028 msgstr ""
5029 "廃止予定の LinuxThreads 実装では、プロセス内の各スレッドは異なる\n"
5030 "プロセス ID を持つ。これは POSIX スレッドの規格に違反しており、\n"
5031 "他の多くの標準非準拠の点の原因になっている。\n"
5032 "B<pthreads>(7) を参照のこと。"
5033
5034 #. type: Plain text
5035 #: build/C/man3/pthread_create.3:213
5036 msgid ""
5037 "The program below demonstrates the use of B<pthread_create>(), as well as a "
5038 "number of other functions in the pthreads API."
5039 msgstr ""
5040 "以下のプログラムは、 B<pthread_create>() や\n"
5041 "pthreads API の他のいろいろな関数の使用例を示している。"
5042
5043 #. type: Plain text
5044 #: build/C/man3/pthread_create.3:218
5045 msgid ""
5046 "In the following run, on a system providing the NPTL threading "
5047 "implementation, the stack size defaults to the value given by the \"stack "
5048 "size\" resource limit:"
5049 msgstr ""
5050 "以下の実行例は、 NPTL スレッド実装が提供されているシステムでのもので、\n"
5051 "スタックサイズがデフォルト値の \"stack size\" リソース上限で指定される値\n"
5052 "になる。"
5053
5054 #. type: Plain text
5055 #: build/C/man3/pthread_create.3:230
5056 #, no-wrap
5057 msgid ""
5058 "$B< ulimit -s>\n"
5059 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
5060 "$B< ./a.out hola salut servus>\n"
5061 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
5062 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
5063 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
5064 "Joined with thread 1; returned value was HOLA\n"
5065 "Joined with thread 2; returned value was SALUT\n"
5066 "Joined with thread 3; returned value was SERVUS\n"
5067 msgstr ""
5068 "$B< ulimit -s>\n"
5069 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
5070 "$B< ./a.out hola salut servus>\n"
5071 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
5072 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
5073 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
5074 "Joined with thread 1; returned value was HOLA\n"
5075 "Joined with thread 2; returned value was SALUT\n"
5076 "Joined with thread 3; returned value was SERVUS\n"
5077
5078 #. type: Plain text
5079 #: build/C/man3/pthread_create.3:236
5080 msgid ""
5081 "In the next run, the program explicitly sets a stack size of 1MB (using "
5082 "B<pthread_attr_setstacksize>(3))  for the created threads:"
5083 msgstr ""
5084 "次の実行例では、プログラム内で、作成されるスレッドに対して\n"
5085 "(B<pthread_attr_setstacksize>(3) を使って1MB のスタックサイズを\n"
5086 "明示的に設定している。"
5087
5088 #. type: Plain text
5089 #: build/C/man3/pthread_create.3:246
5090 #, no-wrap
5091 msgid ""
5092 "$B< ./a.out -s 0x100000 hola salut servus>\n"
5093 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
5094 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
5095 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
5096 "Joined with thread 1; returned value was HOLA\n"
5097 "Joined with thread 2; returned value was SALUT\n"
5098 "Joined with thread 3; returned value was SERVUS\n"
5099 msgstr ""
5100 "$B< ./a.out -s 0x100000 hola salut servus>\n"
5101 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
5102 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
5103 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
5104 "Joined with thread 1; returned value was HOLA\n"
5105 "Joined with thread 2; returned value was SALUT\n"
5106 "Joined with thread 3; returned value was SERVUS\n"
5107
5108 #. type: Plain text
5109 #: build/C/man3/pthread_create.3:258
5110 #, no-wrap
5111 msgid ""
5112 "#include E<lt>pthread.hE<gt>\n"
5113 "#include E<lt>string.hE<gt>\n"
5114 "#include E<lt>stdio.hE<gt>\n"
5115 "#include E<lt>stdlib.hE<gt>\n"
5116 "#include E<lt>unistd.hE<gt>\n"
5117 "#include E<lt>errno.hE<gt>\n"
5118 "#include E<lt>ctype.hE<gt>\n"
5119 msgstr ""
5120 "#include E<lt>pthread.hE<gt>\n"
5121 "#include E<lt>string.hE<gt>\n"
5122 "#include E<lt>stdio.hE<gt>\n"
5123 "#include E<lt>stdlib.hE<gt>\n"
5124 "#include E<lt>unistd.hE<gt>\n"
5125 "#include E<lt>errno.hE<gt>\n"
5126 "#include E<lt>ctype.hE<gt>\n"
5127
5128 #. type: Plain text
5129 #: build/C/man3/pthread_create.3:264 build/C/man3/pthread_getcpuclockid.3:116
5130 #, no-wrap
5131 msgid ""
5132 "#define handle_error(msg) \\e\n"
5133 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5134 msgstr ""
5135 "#define handle_error(msg) \\e\n"
5136 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5137
5138 #. type: Plain text
5139 #: build/C/man3/pthread_create.3:270
5140 #, no-wrap
5141 msgid ""
5142 "struct thread_info {    /* Used as argument to thread_start() */\n"
5143 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
5144 "    int       thread_num;       /* Application-defined thread # */\n"
5145 "    char     *argv_string;      /* From command-line argument */\n"
5146 "};\n"
5147 msgstr ""
5148 "struct thread_info {    /* Used as argument to thread_start() */\n"
5149 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
5150 "    int       thread_num;       /* Application-defined thread # */\n"
5151 "    char     *argv_string;      /* From command-line argument */\n"
5152 "};\n"
5153
5154 #. type: Plain text
5155 #: build/C/man3/pthread_create.3:273
5156 #, no-wrap
5157 msgid ""
5158 "/* Thread start function: display address near top of our stack,\n"
5159 "   and return upper-cased copy of argv_string */\n"
5160 msgstr ""
5161 "/* Thread start function: display address near top of our stack,\n"
5162 "   and return upper-cased copy of argv_string */\n"
5163
5164 #. type: Plain text
5165 #: build/C/man3/pthread_create.3:279
5166 #, no-wrap
5167 msgid ""
5168 "static void *\n"
5169 "thread_start(void *arg)\n"
5170 "{\n"
5171 "    struct thread_info *tinfo = arg;\n"
5172 "    char *uargv, *p;\n"
5173 msgstr ""
5174 "static void *\n"
5175 "thread_start(void *arg)\n"
5176 "{\n"
5177 "    struct thread_info *tinfo = arg;\n"
5178 "    char *uargv, *p;\n"
5179
5180 #. type: Plain text
5181 #: build/C/man3/pthread_create.3:282
5182 #, no-wrap
5183 msgid ""
5184 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5185 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5186 msgstr ""
5187 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5188 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5189
5190 #. type: Plain text
5191 #: build/C/man3/pthread_create.3:286
5192 #, no-wrap
5193 msgid ""
5194 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5195 "    if (uargv == NULL)\n"
5196 "        handle_error(\"strdup\");\n"
5197 msgstr ""
5198 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5199 "    if (uargv == NULL)\n"
5200 "        handle_error(\"strdup\");\n"
5201
5202 #. type: Plain text
5203 #: build/C/man3/pthread_create.3:289
5204 #, no-wrap
5205 msgid ""
5206 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5207 "        *p = toupper(*p);\n"
5208 msgstr ""
5209 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5210 "        *p = toupper(*p);\n"
5211
5212 #. type: Plain text
5213 #: build/C/man3/pthread_create.3:292
5214 #, no-wrap
5215 msgid ""
5216 "    return uargv;\n"
5217 "}\n"
5218 msgstr ""
5219 "    return uargv;\n"
5220 "}\n"
5221
5222 #. type: Plain text
5223 #: build/C/man3/pthread_create.3:301
5224 #, no-wrap
5225 msgid ""
5226 "int\n"
5227 "main(int argc, char *argv[])\n"
5228 "{\n"
5229 "    int s, tnum, opt, num_threads;\n"
5230 "    struct thread_info *tinfo;\n"
5231 "    pthread_attr_t attr;\n"
5232 "    int stack_size;\n"
5233 "    void *res;\n"
5234 msgstr ""
5235 "int\n"
5236 "main(int argc, char *argv[])\n"
5237 "{\n"
5238 "    int s, tnum, opt, num_threads;\n"
5239 "    struct thread_info *tinfo;\n"
5240 "    pthread_attr_t attr;\n"
5241 "    int stack_size;\n"
5242 "    void *res;\n"
5243
5244 #. type: Plain text
5245 #: build/C/man3/pthread_create.3:303
5246 #, no-wrap
5247 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
5248 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
5249
5250 #. type: Plain text
5251 #: build/C/man3/pthread_create.3:310
5252 #, no-wrap
5253 msgid ""
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 msgstr ""
5261 "    stack_size = -1;\n"
5262 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5263 "        switch (opt) {\n"
5264 "        case \\(aqs\\(aq:\n"
5265 "            stack_size = strtoul(optarg, NULL, 0);\n"
5266 "            break;\n"
5267
5268 #. type: Plain text
5269 #: build/C/man3/pthread_create.3:317
5270 #, no-wrap
5271 msgid ""
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 msgstr ""
5279 "        default:\n"
5280 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5281 "                    argv[0]);\n"
5282 "            exit(EXIT_FAILURE);\n"
5283 "        }\n"
5284 "    }\n"
5285
5286 #. type: Plain text
5287 #: build/C/man3/pthread_create.3:319
5288 #, no-wrap
5289 msgid "    num_threads = argc - optind;\n"
5290 msgstr "    num_threads = argc - optind;\n"
5291
5292 #. type: Plain text
5293 #: build/C/man3/pthread_create.3:321
5294 #, no-wrap
5295 msgid "    /* Initialize thread creation attributes */\n"
5296 msgstr "    /* Initialize thread creation attributes */\n"
5297
5298 #. type: Plain text
5299 #: build/C/man3/pthread_create.3:325
5300 #, no-wrap
5301 msgid ""
5302 "    s = pthread_attr_init(&attr);\n"
5303 "    if (s != 0)\n"
5304 "        handle_error_en(s, \"pthread_attr_init\");\n"
5305 msgstr ""
5306 "    s = pthread_attr_init(&attr);\n"
5307 "    if (s != 0)\n"
5308 "        handle_error_en(s, \"pthread_attr_init\");\n"
5309
5310 #. type: Plain text
5311 #: build/C/man3/pthread_create.3:331
5312 #, no-wrap
5313 msgid ""
5314 "    if (stack_size E<gt> 0) {\n"
5315 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5316 "        if (s != 0)\n"
5317 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5318 "    }\n"
5319 msgstr ""
5320 "    if (stack_size E<gt> 0) {\n"
5321 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5322 "        if (s != 0)\n"
5323 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5324 "    }\n"
5325
5326 #. type: Plain text
5327 #: build/C/man3/pthread_create.3:333
5328 #, no-wrap
5329 msgid "    /* Allocate memory for pthread_create() arguments */\n"
5330 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
5331
5332 #. type: Plain text
5333 #: build/C/man3/pthread_create.3:337
5334 #, no-wrap
5335 msgid ""
5336 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5337 "    if (tinfo == NULL)\n"
5338 "        handle_error(\"calloc\");\n"
5339 msgstr ""
5340 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5341 "    if (tinfo == NULL)\n"
5342 "        handle_error(\"calloc\");\n"
5343
5344 #. type: Plain text
5345 #: build/C/man3/pthread_create.3:339
5346 #, no-wrap
5347 msgid "    /* Create one thread for each command-line argument */\n"
5348 msgstr "    /* Create one thread for each command-line argument */\n"
5349
5350 #. type: Plain text
5351 #: build/C/man3/pthread_create.3:343
5352 #, no-wrap
5353 msgid ""
5354 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5355 "        tinfo[tnum].thread_num = tnum + 1;\n"
5356 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5357 msgstr ""
5358 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5359 "        tinfo[tnum].thread_num = tnum + 1;\n"
5360 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5361
5362 #. type: Plain text
5363 #: build/C/man3/pthread_create.3:346
5364 #, no-wrap
5365 msgid ""
5366 "        /* The pthread_create() call stores the thread ID into\n"
5367 "           corresponding element of tinfo[] */\n"
5368 msgstr ""
5369 "        /* The pthread_create() call stores the thread ID into\n"
5370 "           corresponding element of tinfo[] */\n"
5371
5372 #. type: Plain text
5373 #: build/C/man3/pthread_create.3:352
5374 #, no-wrap
5375 msgid ""
5376 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5377 "                           &thread_start, &tinfo[tnum]);\n"
5378 "        if (s != 0)\n"
5379 "            handle_error_en(s, \"pthread_create\");\n"
5380 "    }\n"
5381 msgstr ""
5382 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5383 "                           &thread_start, &tinfo[tnum]);\n"
5384 "        if (s != 0)\n"
5385 "            handle_error_en(s, \"pthread_create\");\n"
5386 "    }\n"
5387
5388 #. type: Plain text
5389 #: build/C/man3/pthread_create.3:355
5390 #, no-wrap
5391 msgid ""
5392 "    /* Destroy the thread attributes object, since it is no\n"
5393 "       longer needed */\n"
5394 msgstr ""
5395 "    /* Destroy the thread attributes object, since it is no\n"
5396 "       longer needed */\n"
5397
5398 #. type: Plain text
5399 #: build/C/man3/pthread_create.3:359
5400 #, no-wrap
5401 msgid ""
5402 "    s = pthread_attr_destroy(&attr);\n"
5403 "    if (s != 0)\n"
5404 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5405 msgstr ""
5406 "    s = pthread_attr_destroy(&attr);\n"
5407 "    if (s != 0)\n"
5408 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5409
5410 #. type: Plain text
5411 #: build/C/man3/pthread_create.3:361
5412 #, no-wrap
5413 msgid "    /* Now join with each thread, and display its returned value */\n"
5414 msgstr "    /* Now join with each thread, and display its returned value */\n"
5415
5416 #. type: Plain text
5417 #: build/C/man3/pthread_create.3:366
5418 #, no-wrap
5419 msgid ""
5420 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5421 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5422 "        if (s != 0)\n"
5423 "            handle_error_en(s, \"pthread_join\");\n"
5424 msgstr ""
5425 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5426 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5427 "        if (s != 0)\n"
5428 "            handle_error_en(s, \"pthread_join\");\n"
5429
5430 #. type: Plain text
5431 #: build/C/man3/pthread_create.3:371
5432 #, no-wrap
5433 msgid ""
5434 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5435 "                tinfo[tnum].thread_num, (char *) res);\n"
5436 "        free(res);      /* Free memory allocated by thread */\n"
5437 "    }\n"
5438 msgstr ""
5439 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5440 "                tinfo[tnum].thread_num, (char *) res);\n"
5441 "        free(res);      /* Free memory allocated by thread */\n"
5442 "    }\n"
5443
5444 #. type: Plain text
5445 #: build/C/man3/pthread_create.3:375
5446 #, no-wrap
5447 msgid ""
5448 "    free(tinfo);\n"
5449 "    exit(EXIT_SUCCESS);\n"
5450 "}\n"
5451 msgstr ""
5452 "    free(tinfo);\n"
5453 "    exit(EXIT_SUCCESS);\n"
5454 "}\n"
5455
5456 #. type: Plain text
5457 #: build/C/man3/pthread_create.3:389
5458 msgid ""
5459 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5460 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5461 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), "
5462 "B<pthreads>(7)"
5463 msgstr ""
5464 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5465 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5466 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), "
5467 "B<pthreads>(7)"
5468
5469 #. type: TH
5470 #: build/C/man3/pthread_detach.3:26
5471 #, no-wrap
5472 msgid "PTHREAD_DETACH"
5473 msgstr "PTHREAD_DETACH"
5474
5475 #. type: TH
5476 #: build/C/man3/pthread_detach.3:26 build/C/man3/pthread_join.3:26
5477 #, no-wrap
5478 msgid "2008-11-27"
5479 msgstr "2008-11-27"
5480
5481 #. type: Plain text
5482 #: build/C/man3/pthread_detach.3:29
5483 msgid "pthread_detach - detach a thread"
5484 msgstr "pthread_detach - スレッドを切り離す (detach する)"
5485
5486 #. type: Plain text
5487 #: build/C/man3/pthread_detach.3:34
5488 #, no-wrap
5489 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5490 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5491
5492 #. type: Plain text
5493 #: build/C/man3/pthread_detach.3:46
5494 msgid ""
5495 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
5496 "as detached.  When a detached thread terminates, its resources are "
5497 "automatically released back to the system without the need for another "
5498 "thread to join with the terminated thread."
5499 msgstr ""
5500 "B<pthread_detach>() 関数は I<thread> で識別されるスレッドに\n"
5501 "detached (切り離された状態) という印を付ける。\n"
5502 "detached 状態のスレッドが終了すると、\n"
5503 "別のスレッドが終了されたスレッドを join しなくても、\n"
5504 "そのスレッドのリソースは自動的に解放されてシステムに戻される。"
5505
5506 #. type: Plain text
5507 #: build/C/man3/pthread_detach.3:49
5508 msgid ""
5509 "Attempting to detach an already detached thread results in unspecified "
5510 "behavior."
5511 msgstr ""
5512 "すでに detach 状態のスレッドを detach しようとした場合に\n"
5513 "どのような結果となるかは規定されていない。"
5514
5515 #. type: Plain text
5516 #: build/C/man3/pthread_detach.3:54
5517 msgid ""
5518 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
5519 "number."
5520 msgstr ""
5521 "成功すると、B<pthread_detach>() は 0 を返す。\n"
5522 "エラーの場合、エラー番号を返す。"
5523
5524 #. type: Plain text
5525 #: build/C/man3/pthread_detach.3:59 build/C/man3/pthread_join.3:89
5526 msgid "I<thread> is not a joinable thread."
5527 msgstr "I<thread> が join 可能なスレッドではない。"
5528
5529 #. type: Plain text
5530 #: build/C/man3/pthread_detach.3:70
5531 msgid ""
5532 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
5533 "or be made joinable again."
5534 msgstr ""
5535 "いったんスレッドを detached 状態にすると、\n"
5536 "そのスレッドを B<pthread_join>(3) で join したり、\n"
5537 "もう一度 join 可能にしたりすることはできない。"
5538
5539 #. type: Plain text
5540 #: build/C/man3/pthread_detach.3:77
5541 msgid ""
5542 "A new thread can be created in a detached state using "
5543 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
5544 "I<attr> argument of B<pthread_create>(3)."
5545 msgstr ""
5546 "B<pthread_attr_setdetachstate>(3) を使って\n"
5547 "B<pthread_create>(3) の I<attr> 引き数の detached 属性を設定することで、\n"
5548 "新しいスレッドを detached 状態で作成することができる。"
5549
5550 #. type: Plain text
5551 #: build/C/man3/pthread_detach.3:84
5552 msgid ""
5553 "The detached attribute merely determines the behavior of the system when the "
5554 "thread terminates; it does not prevent the thread from being terminated if "
5555 "the process terminates using B<exit>(3)  (or equivalently, if the main "
5556 "thread returns)."
5557 msgstr ""
5558 "detached 属性は、スレッドが終了した際のシステムの動作を決めるだけである。\n"
5559 "プロセスが B<exit>(3) を使って終了した場合に、そのスレッドが終了され\n"
5560 "なくなるようなことはない (なお、メインスレッドが return した場合も\n"
5561 "プロセスが B<exit>(3) を使って終了した場合と全く同じである)。 "
5562
5563 #. type: Plain text
5564 #: build/C/man3/pthread_detach.3:93
5565 msgid ""
5566 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
5567 "thread that an application creates, so that system resources for the thread "
5568 "can be released.  (But note that the resources of all threads are freed when "
5569 "the process terminates.)"
5570 msgstr ""
5571 "アプリケーションが作成した各スレッドについて、そのスレッドが使用して\n"
5572 "いるシステムリソースを解放できるように、B<pthread_join>(3) か\n"
5573 "B<pthread_detach>() のどちらかを呼び出すべきである (ただし、プロセスが\n"
5574 "終了するときには、全てのスレッドのリソースが解放される)。"
5575
5576 #. type: Plain text
5577 #: build/C/man3/pthread_detach.3:95
5578 msgid "The following statement detaches the calling thread:"
5579 msgstr "以下の文は、呼び出したスレッド自身を detach する。"
5580
5581 #. type: Plain text
5582 #: build/C/man3/pthread_detach.3:97
5583 #, no-wrap
5584 msgid "    pthread_detach(pthread_self());\n"
5585 msgstr "    pthread_detach(pthread_self());\n"
5586
5587 #. type: Plain text
5588 #: build/C/man3/pthread_detach.3:104
5589 msgid ""
5590 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), "
5591 "B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5592 msgstr ""
5593 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), "
5594 "B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5595
5596 #. type: TH
5597 #: build/C/man3/pthread_equal.3:26
5598 #, no-wrap
5599 msgid "PTHREAD_EQUAL"
5600 msgstr "PTHREAD_EQUAL"
5601
5602 #. type: TH
5603 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
5604 #: build/C/man3/pthread_getcpuclockid.3:26
5605 #: build/C/man3/pthread_setaffinity_np.3:26
5606 #: build/C/man3/pthread_setconcurrency.3:25
5607 #, no-wrap
5608 msgid "2014-05-23"
5609 msgstr "2014-05-23"
5610
5611 #. type: Plain text
5612 #: build/C/man3/pthread_equal.3:29
5613 msgid "pthread_equal - compare thread IDs"
5614 msgstr "pthread_equal - スレッド ID を比較する"
5615
5616 #. type: Plain text
5617 #: build/C/man3/pthread_equal.3:34
5618 #, no-wrap
5619 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5620 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5621
5622 #. type: Plain text
5623 #: build/C/man3/pthread_equal.3:41
5624 msgid "The B<pthread_equal>()  function compares two thread identifiers."
5625 msgstr "B<pthread_equal>() 関数は 2 つのスレッド識別子の比較を行う。"
5626
5627 #. type: Plain text
5628 #: build/C/man3/pthread_equal.3:45
5629 msgid ""
5630 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
5631 "value; otherwise, it returns 0."
5632 msgstr ""
5633 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
5634 "そうでなければ 0 を返す。"
5635
5636 #.  SH VERSIONS
5637 #.  Available since glibc 2.0
5638 #. type: Plain text
5639 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
5640 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_testcancel.3:58
5641 msgid "This function always succeeds."
5642 msgstr "この関数は常に成功する。"
5643
5644 #. type: Plain text
5645 #: build/C/man3/pthread_equal.3:52
5646 msgid "The B<pthread_equal>()  function is thread-safe."
5647 msgstr "B<pthread_equal>() 関数はスレッドセーフである。"
5648
5649 #. type: Plain text
5650 #: build/C/man3/pthread_equal.3:61
5651 msgid ""
5652 "The B<pthread_equal>()  function is necessary because thread IDs should be "
5653 "considered opaque: there is no portable way for applications to directly "
5654 "compare two I<pthread_t> values."
5655 msgstr ""
5656 "B<pthread_equal>() 関数が必要なのは、\n"
5657 "スレッド ID はその内部構造を意識すべきではないためである。\n"
5658 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
5659 "移植性を確保できる形で比較する方法はない。"
5660
5661 #. type: Plain text
5662 #: build/C/man3/pthread_equal.3:65
5663 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5664 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5665
5666 #. type: TH
5667 #: build/C/man3/pthread_exit.3:26
5668 #, no-wrap
5669 msgid "PTHREAD_EXIT"
5670 msgstr "PTHREAD_EXIT"
5671
5672 #. type: Plain text
5673 #: build/C/man3/pthread_exit.3:29
5674 msgid "pthread_exit - terminate calling thread"
5675 msgstr "pthread_exit - 呼び出したスレッドを終了する"
5676
5677 #. type: Plain text
5678 #: build/C/man3/pthread_exit.3:34
5679 #, no-wrap
5680 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
5681 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
5682
5683 #. type: Plain text
5684 #: build/C/man3/pthread_exit.3:45
5685 msgid ""
5686 "The B<pthread_exit>()  function terminates the calling thread and returns a "
5687 "value via I<retval> that (if the thread is joinable)  is available to "
5688 "another thread in the same process that calls B<pthread_join>(3)."
5689 msgstr ""
5690 "B<pthread_exit>() 関数は、呼び出したスレッドを終了し、\n"
5691 "I<retval> 経由で値を返す。\n"
5692 "この値は (そのスレッドが join 可能な場合に) B<pthread_join>(3) を\n"
5693 "呼び出した同じプロセス内の別のスレッドが参照できる値と同じである。"
5694
5695 #. type: Plain text
5696 #: build/C/man3/pthread_exit.3:55
5697 msgid ""
5698 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
5699 "not yet been popped, are popped (in the reverse of the order in which they "
5700 "were pushed)  and executed.  If the thread has any thread-specific data, "
5701 "then, after the clean-up handlers have been executed, the corresponding "
5702 "destructor functions are called, in an unspecified order."
5703 msgstr ""
5704 "B<pthread_cleanup_push>(3) で設定されたクリーンアップハンドラーのうち、\n"
5705 "まだ pop (取り出されていない) ハンドラーを (push されたのと逆の順序で)\n"
5706 "取り出して実行する。そのスレッドがスレッド固有のデータを持っている\n"
5707 "場合は、クリーンアップハンドラーが実行された後に、スレッド固有のデータ\n"
5708 "に対応するデストラクタ (destructor) 関数が呼び出される (呼び出し順序\n"
5709 "は規定されていない)。"
5710
5711 #. type: Plain text
5712 #: build/C/man3/pthread_exit.3:62
5713 msgid ""
5714 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
5715 "variables, semaphores, and file descriptors) are not released, and functions "
5716 "registered using B<atexit>(3)  are not called."
5717 msgstr ""
5718 "スレッドが終了する際に、プロセスの共有リソース (例えば、mutex、状態変数\n"
5719 "(condition variables)、セマフォ、ファイルディスクリプター)が解放される。\n"
5720 "B<atexit>(3) を使って登録された関数は呼び出されない。"
5721
5722 #. type: Plain text
5723 #: build/C/man3/pthread_exit.3:71
5724 msgid ""
5725 "After the last thread in a process terminates, the process terminates as by "
5726 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
5727 "resources are released and functions registered using B<atexit>(3)  are "
5728 "called."
5729 msgstr ""
5730 "プロセスの最後のスレッドが終了すると、そのプロセスは、終了ステータス 0\n"
5731 "で B<exit>(3) を呼び出した場合と全く同じように終了する。したがって、\n"
5732 "プロセスの共有リソースは解放され、B<atexit>(3) を使って登録された関数\n"
5733 "が呼び出される。"
5734
5735 #. type: Plain text
5736 #: build/C/man3/pthread_exit.3:73
5737 msgid "This function does not return to the caller."
5738 msgstr "この関数は呼び出し側には返らない。"
5739
5740 #. type: Plain text
5741 #: build/C/man3/pthread_exit.3:80
5742 msgid "The B<pthread_exit>()  function is thread-safe."
5743 msgstr "B<pthread_exit>() 関数はスレッドセーフである。"
5744
5745 #. type: Plain text
5746 #: build/C/man3/pthread_exit.3:87
5747 msgid ""
5748 "Performing a return from the start function of any thread other than the "
5749 "main thread results in an implicit call to B<pthread_exit>(), using the "
5750 "function's return value as the thread's exit status."
5751 msgstr ""
5752 "メインスレッド以外のスレッドの開始関数 (start function) がreturn を\n"
5753 "行うと、暗黙のうちに B<pthread_exit>() が呼び出され、\n"
5754 "関数の返り値がスレッドの終了ステータスとして使用される。"
5755
5756 #. type: Plain text
5757 #: build/C/man3/pthread_exit.3:93
5758 msgid ""
5759 "To allow other threads to continue execution, the main thread should "
5760 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
5761 msgstr ""
5762 "他のスレッドが実行を継続できるように、メインスレッドは B<exit>(3) では\n"
5763 "なく B<pthread_exit>() を呼び出して終了すべきである。"
5764
5765 #. type: Plain text
5766 #: build/C/man3/pthread_exit.3:98
5767 msgid ""
5768 "The value pointed to by I<retval> should not be located on the calling "
5769 "thread's stack, since the contents of that stack are undefined after the "
5770 "thread terminates."
5771 msgstr ""
5772 "I<retval> が指す値は、呼び出したスレッドのスタックに置くべきではない。\n"
5773 "呼び出したスレッドが終了した後は、そのスタックの内容が不定となるから\n"
5774 "である。"
5775
5776 #.  Linux 2.6.27
5777 #.  FIXME . review a later kernel to see if this gets fixed
5778 #.  http://thread.gmane.org/gmane.linux.kernel/611611
5779 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
5780 #. type: Plain text
5781 #: build/C/man3/pthread_exit.3:110
5782 msgid ""
5783 "Currently, there are limitations in the kernel implementation logic for "
5784 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
5785 "This can manifest in problems such as a locked terminal if a stop signal is "
5786 "sent to a foreground process whose thread group leader has already called "
5787 "B<pthread_exit>()."
5788 msgstr ""
5789 "現在のところ、停止 (stop) されたスレッドグループを、すでに終了した\n"
5790 "(dead) スレッドグループリーダーで B<wait>(2) する場合の、\n"
5791 "カーネル実装の論理には制限がある。\n"
5792 "この制限は、すでにスレッドグループリーダーが B<pthread_exit>() を\n"
5793 "呼び出しているようなフォアグラウンドプロセスにストップシグナルが送信\n"
5794 "された場合に、端末がロックされてしまう、といった問題として表に見える\n"
5795 "場合がある。"
5796
5797 #. type: Plain text
5798 #: build/C/man3/pthread_exit.3:114
5799 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5800 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5801
5802 #. type: TH
5803 #: build/C/man3/pthread_getattr_np.3:26
5804 #, no-wrap
5805 msgid "PTHREAD_GETATTR_NP"
5806 msgstr "PTHREAD_GETATTR_NP"
5807
5808 #. type: TH
5809 #: build/C/man3/pthread_getattr_np.3:26
5810 #, no-wrap
5811 msgid "2010-09-10"
5812 msgstr "2010-09-10"
5813
5814 #. type: Plain text
5815 #: build/C/man3/pthread_getattr_np.3:29
5816 msgid "pthread_getattr_np - get attributes of created thread"
5817 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
5818
5819 #. type: Plain text
5820 #: build/C/man3/pthread_getattr_np.3:35
5821 #, no-wrap
5822 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5823 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5824
5825 #. type: Plain text
5826 #: build/C/man3/pthread_getattr_np.3:45
5827 msgid ""
5828 "The B<pthread_getattr_np>()  function initializes the thread attributes "
5829 "object referred to by I<attr> so that it contains actual attribute values "
5830 "describing the running thread I<thread>."
5831 msgstr ""
5832 "B<pthread_getattr_np>() 関数は、\n"
5833 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
5834 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
5835 "格納して返す。"
5836
5837 #. type: Plain text
5838 #: build/C/man3/pthread_getattr_np.3:52
5839 msgid ""
5840 "The returned attribute values may differ from the corresponding attribute "
5841 "values passed in the I<attr> object that was used to create the thread using "
5842 "B<pthread_create>(3).  In particular, the following attributes may differ:"
5843 msgstr ""
5844 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
5845 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
5846 "特に、以下の属性は異なる場合がある。"
5847
5848 #. type: Plain text
5849 #: build/C/man3/pthread_getattr_np.3:55
5850 msgid ""
5851 "the detach state, since a joinable thread may have detached itself after "
5852 "creation;"
5853 msgstr ""
5854 "detach state. join 可能なスレッドは作成後に自分自身を\n"
5855 "切り離す (detach する) ことができるからである。"
5856
5857 #. type: Plain text
5858 #: build/C/man3/pthread_getattr_np.3:58
5859 msgid ""
5860 "the stack size, which the implementation may align to a suitable boundary."
5861 msgstr ""
5862 "スタックサイズ。\n"
5863 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
5864
5865 #. type: Plain text
5866 #: build/C/man3/pthread_getattr_np.3:63
5867 msgid ""
5868 "and the guard size, which the implementation may round upward to a multiple "
5869 "of the page size, or ignore (i.e., treat as 0), if the application is "
5870 "allocating its own stack."
5871 msgstr ""
5872 "guard size.\n"
5873 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
5874 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
5875 "(0 として扱われる) ことがあるからである。"
5876
5877 #. type: Plain text
5878 #: build/C/man3/pthread_getattr_np.3:68
5879 msgid ""
5880 "Furthermore, if the stack address attribute was not set in the thread "
5881 "attributes object used to create the thread, then the returned thread "
5882 "attributes object will report the actual stack address that the "
5883 "implementation selected for the thread."
5884 msgstr ""
5885 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
5886 "スタックアドレスが設定されていなかった場合、\n"
5887 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
5888 "割り当てた実際のスタックアドレスが報告される。"
5889
5890 #. type: Plain text
5891 #: build/C/man3/pthread_getattr_np.3:73
5892 msgid ""
5893 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
5894 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
5895 msgstr ""
5896 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
5897 "必要なくなった際には、  B<pthread_attr_destroy>(3) を使って\n"
5898 "そのオブジェクトを破棄すべきである。"
5899
5900 #. type: Plain text
5901 #: build/C/man3/pthread_getattr_np.3:76
5902 #: build/C/man3/pthread_getcpuclockid.3:49
5903 msgid ""
5904 "On success, this function returns 0; on error, it returns a nonzero error "
5905 "number."
5906 msgstr ""
5907 "成功すると、この関数は 0 を返す。\n"
5908 "エラーの場合、 0 以外のエラー番号を返す。"
5909
5910 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
5911 #. type: Plain text
5912 #: build/C/man3/pthread_getattr_np.3:81
5913 msgid "Insufficient memory."
5914 msgstr "メモリーが十分になかった。"
5915
5916 #. type: Plain text
5917 #: build/C/man3/pthread_getattr_np.3:96
5918 msgid ""
5919 "In addition, if I<thread> refers to the main thread, then "
5920 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
5921 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and "
5922 "B<getrlimit>(2), if the B<RLIMIT_STACK> resource limit is not supported."
5923 msgstr ""
5924 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
5925 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
5926 "エラーで失敗する可能性がある。\n"
5927 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
5928 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
5929 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
5930
5931 #. type: Plain text
5932 #: build/C/man3/pthread_getattr_np.3:98
5933 msgid "This function is available in glibc since version 2.2.3."
5934 msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。"
5935
5936 #. type: Plain text
5937 #: build/C/man3/pthread_getattr_np.3:101
5938 #: build/C/man3/pthread_kill_other_threads_np.3:55
5939 msgid ""
5940 "This function is a nonstandard GNU extension; hence the suffix \"_np"
5941 "\" (nonportable) in the name."
5942 msgstr ""
5943 "この関数は非標準の GNU による拡張である。\n"
5944 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
5945 "付いている。"
5946
5947 #. type: Plain text
5948 #: build/C/man3/pthread_getattr_np.3:111
5949 msgid ""
5950 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
5951 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
5952 "and display its guard size, stack address, and stack size attributes.  "
5953 "Command-line arguments can be used to set these attributes to values other "
5954 "than the default when creating the thread.  The shell sessions below "
5955 "demonstrate the use of the program."
5956 msgstr ""
5957 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
5958 "このプログラムは、スレッドを作成し、それから\n"
5959 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
5960 "スタックアドレス、スタックサイズを取得し表示する。\n"
5961 "コマンドライン引き数での指定で、スレッドを作成する際に\n"
5962 "上記の属性にデフォルト値以外の値を設定することができる。\n"
5963 "下記のシェルのセッションはこのプログラムの使用例である。"
5964
5965 #. type: Plain text
5966 #: build/C/man3/pthread_getattr_np.3:114
5967 msgid ""
5968 "In the first run, on an x86-32 system, a thread is created using default "
5969 "attributes:"
5970 msgstr ""
5971 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
5972 "(x86-32 システム上で実行)。"
5973
5974 #. type: Plain text
5975 #: build/C/man3/pthread_getattr_np.3:124
5976 #, no-wrap
5977 msgid ""
5978 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5979 "unlimited\n"
5980 "$B< ./a.out>\n"
5981 "Attributes of created thread:\n"
5982 "        Guard size          = 4096 bytes\n"
5983 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5984 "        Stack size          = 0x201000 (2101248) bytes\n"
5985 msgstr ""
5986 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5987 "unlimited\n"
5988 "$B< ./a.out>\n"
5989 "Attributes of created thread:\n"
5990 "        Guard size          = 4096 bytes\n"
5991 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5992 "        Stack size          = 0x201000 (2101248) bytes\n"
5993
5994 #. type: Plain text
5995 #: build/C/man3/pthread_getattr_np.3:130
5996 msgid ""
5997 "In the following run, we see that if a guard size is specified, it is "
5998 "rounded up to the next multiple of the system page size (4096 bytes on "
5999 "x86-32):"
6000 msgstr ""
6001 "次の実行例では、guard size が指定された場合、\n"
6002 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
6003 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
6004
6005 #. type: Plain text
6006 #: build/C/man3/pthread_getattr_np.3:138
6007 #, no-wrap
6008 msgid ""
6009 "$B< ./a.out -g 4097>\n"
6010 "Thread attributes object after initializations:\n"
6011 "        Guard size          = 4097 bytes\n"
6012 "        Stack address       = (nil)\n"
6013 "        Stack size          = 0x0 (0) bytes\n"
6014 msgstr ""
6015 "$B< ./a.out -g 4097>\n"
6016 "Thread attributes object after initializations:\n"
6017 "        Guard size          = 4097 bytes\n"
6018 "        Stack address       = (nil)\n"
6019 "        Stack size          = 0x0 (0) bytes\n"
6020
6021 #. type: Plain text
6022 #: build/C/man3/pthread_getattr_np.3:143
6023 #, no-wrap
6024 msgid ""
6025 "Attributes of created thread:\n"
6026 "        Guard size          = 8192 bytes\n"
6027 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
6028 "        Stack size          = 0x201000 (2101248) bytes\n"
6029 msgstr ""
6030 "Attributes of created thread:\n"
6031 "        Guard size          = 8192 bytes\n"
6032 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
6033 "        Stack size          = 0x201000 (2101248) bytes\n"
6034
6035 #. .in +4n
6036 #. .nf
6037 #. $ ./a.out \-s 0x8000
6038 #. Thread attributes object after initializations:
6039 #.         Guard size          = 4096 bytes
6040 #.         Stack address       = 0xffff8000 (EOS = (nil))
6041 #.         Stack size          = 0x8000 (32768) bytes
6042 #. Attributes of created thread:
6043 #.         Guard size          = 4096 bytes
6044 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
6045 #.         Stack size          = 0x8000 (32768) bytes
6046 #. .fi
6047 #. .in
6048 #. type: Plain text
6049 #: build/C/man3/pthread_getattr_np.3:162
6050 msgid ""
6051 "In the last run, the program manually allocates a stack for the thread.  In "
6052 "this case, the guard size attribute is ignored."
6053 msgstr ""
6054 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
6055 "この場合には、guard size 属性は無視される。"
6056
6057 #. type: Plain text
6058 #: build/C/man3/pthread_getattr_np.3:167
6059 #, no-wrap
6060 msgid ""
6061 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
6062 "Allocated thread stack at 0x804d000\n"
6063 msgstr ""
6064 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
6065 "Allocated thread stack at 0x804d000\n"
6066
6067 #. type: Plain text
6068 #: build/C/man3/pthread_getattr_np.3:172
6069 #, no-wrap
6070 msgid ""
6071 "Thread attributes object after initializations:\n"
6072 "        Guard size          = 4096 bytes\n"
6073 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6074 "        Stack size          = 0x8000 (32768) bytes\n"
6075 msgstr ""
6076 "Thread attributes object after initializations:\n"
6077 "        Guard size          = 4096 bytes\n"
6078 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6079 "        Stack size          = 0x8000 (32768) bytes\n"
6080
6081 #. type: Plain text
6082 #: build/C/man3/pthread_getattr_np.3:177
6083 #, no-wrap
6084 msgid ""
6085 "Attributes of created thread:\n"
6086 "        Guard size          = 0 bytes\n"
6087 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6088 "        Stack size          = 0x8000 (32768) bytes\n"
6089 msgstr ""
6090 "Attributes of created thread:\n"
6091 "        Guard size          = 0 bytes\n"
6092 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6093 "        Stack size          = 0x8000 (32768) bytes\n"
6094
6095 #. type: Plain text
6096 #: build/C/man3/pthread_getattr_np.3:198
6097 #, no-wrap
6098 msgid ""
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 msgstr ""
6106 "static void\n"
6107 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6108 "{\n"
6109 "    int s;\n"
6110 "    size_t stack_size, guard_size;\n"
6111 "    void *stack_addr;\n"
6112
6113 #. type: Plain text
6114 #: build/C/man3/pthread_getattr_np.3:203
6115 #, no-wrap
6116 msgid ""
6117 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
6118 "    if (s != 0)\n"
6119 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6120 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
6121 msgstr ""
6122 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
6123 "    if (s != 0)\n"
6124 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6125 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
6126
6127 #. type: Plain text
6128 #: build/C/man3/pthread_getattr_np.3:214
6129 #, no-wrap
6130 msgid ""
6131 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6132 "    if (s != 0)\n"
6133 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
6134 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
6135 "    if (stack_size E<gt> 0)\n"
6136 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6137 "    printf(\"\\en\");\n"
6138 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
6139 "            prefix, stack_size, stack_size);\n"
6140 "}\n"
6141 msgstr ""
6142 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6143 "    if (s != 0)\n"
6144 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
6145 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
6146 "    if (stack_size E<gt> 0)\n"
6147 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6148 "    printf(\"\\en\");\n"
6149 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
6150 "            prefix, stack_size, stack_size);\n"
6151 "}\n"
6152
6153 #. type: Plain text
6154 #: build/C/man3/pthread_getattr_np.3:220
6155 #, no-wrap
6156 msgid ""
6157 "static void\n"
6158 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6159 "{\n"
6160 "    int s;\n"
6161 "    pthread_attr_t attr;\n"
6162 msgstr ""
6163 "static void\n"
6164 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6165 "{\n"
6166 "    int s;\n"
6167 "    pthread_attr_t attr;\n"
6168
6169 #. type: Plain text
6170 #: build/C/man3/pthread_getattr_np.3:224
6171 #, no-wrap
6172 msgid ""
6173 "    s = pthread_getattr_np(thread, &attr);\n"
6174 "    if (s != 0)\n"
6175 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6176 msgstr ""
6177 "    s = pthread_getattr_np(thread, &attr);\n"
6178 "    if (s != 0)\n"
6179 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6180
6181 #. type: Plain text
6182 #: build/C/man3/pthread_getattr_np.3:226
6183 #, no-wrap
6184 msgid "    display_stack_related_attributes(&attr, prefix);\n"
6185 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
6186
6187 #. type: Plain text
6188 #: build/C/man3/pthread_getattr_np.3:231
6189 #, no-wrap
6190 msgid ""
6191 "    s = pthread_attr_destroy(&attr);\n"
6192 "    if (s != 0)\n"
6193 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6194 "}\n"
6195 msgstr ""
6196 "    s = pthread_attr_destroy(&attr);\n"
6197 "    if (s != 0)\n"
6198 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6199 "}\n"
6200
6201 #. type: Plain text
6202 #: build/C/man3/pthread_getattr_np.3:237
6203 #, no-wrap
6204 msgid ""
6205 "static void *           /* Start function for thread we create */\n"
6206 "thread_start(void *arg)\n"
6207 "{\n"
6208 "    printf(\"Attributes of created thread:\\en\");\n"
6209 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6210 msgstr ""
6211 "static void *           /* Start function for thread we create */\n"
6212 "thread_start(void *arg)\n"
6213 "{\n"
6214 "    printf(\"Attributes of created thread:\\en\");\n"
6215 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6216
6217 #. type: Plain text
6218 #: build/C/man3/pthread_getattr_np.3:251
6219 #, no-wrap
6220 msgid ""
6221 "static void\n"
6222 "usage(char *pname, char *msg)\n"
6223 "{\n"
6224 "    if (msg != NULL)\n"
6225 "        fputs(msg, stderr);\n"
6226 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6227 "            \" [-g guard-size]\\en\", pname);\n"
6228 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6229 "    exit(EXIT_FAILURE);\n"
6230 "}\n"
6231 msgstr ""
6232 "static void\n"
6233 "usage(char *pname, char *msg)\n"
6234 "{\n"
6235 "    if (msg != NULL)\n"
6236 "        fputs(msg, stderr);\n"
6237 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6238 "            \" [-g guard-size]\\en\", pname);\n"
6239 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6240 "    exit(EXIT_FAILURE);\n"
6241 "}\n"
6242
6243 #. type: Plain text
6244 #: build/C/man3/pthread_getattr_np.3:264
6245 #, no-wrap
6246 msgid ""
6247 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6248 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6249 "                              pthread_attr_t *attrp)\n"
6250 "{\n"
6251 "    int s, opt, allocate_stack;\n"
6252 "    long stack_size, guard_size;\n"
6253 "            void *stack_addr;\n"
6254 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6255 "                                           a thread attributes object */\n"
6256 "    allocate_stack = 0;\n"
6257 "    stack_size = -1;\n"
6258 "    guard_size = -1;\n"
6259 msgstr ""
6260 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6261 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6262 "                              pthread_attr_t *attrp)\n"
6263 "{\n"
6264 "    int s, opt, allocate_stack;\n"
6265 "    long stack_size, guard_size;\n"
6266 "            void *stack_addr;\n"
6267 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6268 "                                           a thread attributes object */\n"
6269 "    allocate_stack = 0;\n"
6270 "    stack_size = -1;\n"
6271 "    guard_size = -1;\n"
6272
6273 #. type: Plain text
6274 #: build/C/man3/pthread_getattr_np.3:273
6275 #, no-wrap
6276 msgid ""
6277 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6278 "        switch (opt) {\n"
6279 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6280 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6281 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6282 "        default:    usage(argv[0], NULL);\n"
6283 "        }\n"
6284 "    }\n"
6285 msgstr ""
6286 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6287 "        switch (opt) {\n"
6288 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6289 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6290 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6291 "        default:    usage(argv[0], NULL);\n"
6292 "        }\n"
6293 "    }\n"
6294
6295 #. type: Plain text
6296 #: build/C/man3/pthread_getattr_np.3:276
6297 #, no-wrap
6298 msgid ""
6299 "    if (allocate_stack && stack_size == -1)\n"
6300 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6301 msgstr ""
6302 "    if (allocate_stack && stack_size == -1)\n"
6303 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6304
6305 #. type: Plain text
6306 #: build/C/man3/pthread_getattr_np.3:279
6307 #, no-wrap
6308 msgid ""
6309 "    if (argc E<gt> optind)\n"
6310 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6311 msgstr ""
6312 "    if (argc E<gt> optind)\n"
6313 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6314
6315 #. type: Plain text
6316 #: build/C/man3/pthread_getattr_np.3:282
6317 #, no-wrap
6318 msgid ""
6319 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6320 "        ret_attrp = attrp;\n"
6321 msgstr ""
6322 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6323 "        ret_attrp = attrp;\n"
6324
6325 #. type: Plain text
6326 #: build/C/man3/pthread_getattr_np.3:287
6327 #, no-wrap
6328 msgid ""
6329 "        s = pthread_attr_init(attrp);\n"
6330 "        if (s != 0)\n"
6331 "            handle_error_en(s, \"pthread_attr_init\");\n"
6332 "    }\n"
6333 msgstr ""
6334 "        s = pthread_attr_init(attrp);\n"
6335 "        if (s != 0)\n"
6336 "            handle_error_en(s, \"pthread_attr_init\");\n"
6337 "    }\n"
6338
6339 #. type: Plain text
6340 #: build/C/man3/pthread_getattr_np.3:299
6341 #, no-wrap
6342 msgid ""
6343 "    if (stack_size E<gt>= 0) {\n"
6344 "        if (!allocate_stack) {\n"
6345 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6346 "            if (s != 0)\n"
6347 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6348 "        } else {\n"
6349 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6350 "                               stack_size);\n"
6351 "            if (s != 0)\n"
6352 "                handle_error_en(s, \"posix_memalign\");\n"
6353 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6354 msgstr ""
6355 "    if (stack_size E<gt>= 0) {\n"
6356 "        if (!allocate_stack) {\n"
6357 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6358 "            if (s != 0)\n"
6359 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6360 "        } else {\n"
6361 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6362 "                               stack_size);\n"
6363 "            if (s != 0)\n"
6364 "                handle_error_en(s, \"posix_memalign\");\n"
6365 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6366
6367 #. type: Plain text
6368 #: build/C/man3/pthread_getattr_np.3:305
6369 #, no-wrap
6370 msgid ""
6371 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6372 "            if (s != 0)\n"
6373 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6374 "        }\n"
6375 "    }\n"
6376 msgstr ""
6377 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6378 "            if (s != 0)\n"
6379 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6380 "        }\n"
6381 "    }\n"
6382
6383 #. type: Plain text
6384 #: build/C/man3/pthread_getattr_np.3:311
6385 #, no-wrap
6386 msgid ""
6387 "    if (guard_size E<gt>= 0) {\n"
6388 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6389 "        if (s != 0)\n"
6390 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6391 "    }\n"
6392 msgstr ""
6393 "    if (guard_size E<gt>= 0) {\n"
6394 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6395 "        if (s != 0)\n"
6396 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6397 "    }\n"
6398
6399 #. type: Plain text
6400 #: build/C/man3/pthread_getattr_np.3:314
6401 #, no-wrap
6402 msgid ""
6403 "    return ret_attrp;\n"
6404 "}\n"
6405 msgstr ""
6406 "    return ret_attrp;\n"
6407 "}\n"
6408
6409 #. type: Plain text
6410 #: build/C/man3/pthread_getattr_np.3:323
6411 #, no-wrap
6412 msgid ""
6413 "int\n"
6414 "main(int argc, char *argv[])\n"
6415 "{\n"
6416 "    int s;\n"
6417 "    pthread_t thr;\n"
6418 "    pthread_attr_t attr;\n"
6419 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6420 "                                        a thread attributes object */\n"
6421 msgstr ""
6422 "int\n"
6423 "main(int argc, char *argv[])\n"
6424 "{\n"
6425 "    int s;\n"
6426 "    pthread_t thr;\n"
6427 "    pthread_attr_t attr;\n"
6428 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6429 "                                        a thread attributes object */\n"
6430
6431 #. type: Plain text
6432 #: build/C/man3/pthread_getattr_np.3:325
6433 #, no-wrap
6434 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6435 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6436
6437 #. type: Plain text
6438 #: build/C/man3/pthread_getattr_np.3:331
6439 #, no-wrap
6440 msgid ""
6441 "    if (attrp != NULL) {\n"
6442 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6443 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6444 "        printf(\"\\en\");\n"
6445 "    }\n"
6446 msgstr ""
6447 "    if (attrp != NULL) {\n"
6448 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6449 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6450 "        printf(\"\\en\");\n"
6451 "    }\n"
6452
6453 #. type: Plain text
6454 #: build/C/man3/pthread_getattr_np.3:361
6455 msgid ""
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 msgstr ""
6463 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6464 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6465 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6466 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6467 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6468 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6469
6470 #. type: TH
6471 #: build/C/man3/pthread_getcpuclockid.3:26
6472 #, no-wrap
6473 msgid "PTHREAD_GETCPUCLOCKID"
6474 msgstr "PTHREAD_GETCPUCLOCKID"
6475
6476 #. type: Plain text
6477 #: build/C/man3/pthread_getcpuclockid.3:29
6478 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
6479 msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する"
6480
6481 #. type: Plain text
6482 #: build/C/man3/pthread_getcpuclockid.3:33
6483 #, no-wrap
6484 msgid ""
6485 "B<#include E<lt>pthread.hE<gt>>\n"
6486 "B<#include E<lt>time.hE<gt>>\n"
6487 msgstr ""
6488 "B<#include E<lt>pthread.hE<gt>>\n"
6489 "B<#include E<lt>time.hE<gt>>\n"
6490
6491 #. type: Plain text
6492 #: build/C/man3/pthread_getcpuclockid.3:35
6493 #, no-wrap
6494 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id>B<);>\n"
6495 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id>B<);>\n"
6496
6497 #.  The clockid is constructed as follows:
6498 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
6499 #.  where CLOCK_IDFIELD_SIZE is 3.
6500 #. type: Plain text
6501 #: build/C/man3/pthread_getcpuclockid.3:46
6502 msgid ""
6503 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
6504 "time clock of the thread I<thread>."
6505 msgstr ""
6506 "B<pthread_getcpuclockid>() 関数は、\n"
6507 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
6508
6509 #. type: TP
6510 #: build/C/man3/pthread_getcpuclockid.3:50
6511 #, no-wrap
6512 msgid "B<ENOENT>"
6513 msgstr "B<ENOENT>"
6514
6515 #.  CLOCK_THREAD_CPUTIME_ID not defined
6516 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
6517 #.  be possible if kernel thread IDs took more than 29 bits (which
6518 #.  they currently cannot).
6519 #. type: Plain text
6520 #: build/C/man3/pthread_getcpuclockid.3:58
6521 msgid "Per-thread CPU time clocks are not supported by the system."
6522 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
6523
6524 #. type: Plain text
6525 #: build/C/man3/pthread_getcpuclockid.3:65
6526 msgid "This function is available in glibc since version 2.2."
6527 msgstr "この関数は glibc バージョン 2.2 以降で利用できる。"
6528
6529 #. type: Plain text
6530 #: build/C/man3/pthread_getcpuclockid.3:70
6531 msgid "The B<pthread_getcpuclockid>()  function is thread-safe."
6532 msgstr "B<pthread_getcpuclockid>() 関数はスレッドセーフである。"
6533
6534 #. type: Plain text
6535 #: build/C/man3/pthread_getcpuclockid.3:83
6536 msgid ""
6537 "When I<thread> refers to the calling thread, this function returns an "
6538 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
6539 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
6540 msgstr ""
6541 "I<thread> が呼び出したスレッドを参照している場合、\n"
6542 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
6543 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
6544 "を参照する ID が返される。"
6545
6546 #. type: Plain text
6547 #: build/C/man3/pthread_getcpuclockid.3:89
6548 msgid ""
6549 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
6550 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
6551 "the two threads.  The following shell session shows an example run:"
6552 msgstr ""
6553 "以下のプログラムは、スレッドを作成し、それから\n"
6554 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
6555 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
6556 "スレッド毎の CPU 時間を取得する。\n"
6557 "下記のシェルのセッションは実行例である。"
6558
6559 #. type: Plain text
6560 #: build/C/man3/pthread_getcpuclockid.3:99
6561 #, no-wrap
6562 msgid ""
6563 "$ B<./a.out>\n"
6564 "Main thread sleeping\n"
6565 "Subthread starting infinite loop\n"
6566 "Main thread consuming some CPU time...\n"
6567 "Process total CPU time:    1.368\n"
6568 "Main thread CPU time:      0.376\n"
6569 "Subthread CPU time:        0.992\n"
6570 msgstr ""
6571 "$ B<./a.out>\n"
6572 "Main thread sleeping\n"
6573 "Subthread starting infinite loop\n"
6574 "Main thread consuming some CPU time...\n"
6575 "Process total CPU time:    1.368\n"
6576 "Main thread CPU time:      0.376\n"
6577 "Subthread CPU time:        0.992\n"
6578
6579 #. type: Plain text
6580 #: build/C/man3/pthread_getcpuclockid.3:105
6581 #, no-wrap
6582 msgid "/* Link with \"-lrt\" */\n"
6583 msgstr "/* \"-lrt\" でリンクする */\n"
6584
6585 #. type: Plain text
6586 #: build/C/man3/pthread_getcpuclockid.3:113
6587 #, no-wrap
6588 msgid ""
6589 "#include E<lt>time.hE<gt>\n"
6590 "#include E<lt>stdio.hE<gt>\n"
6591 "#include E<lt>stdlib.hE<gt>\n"
6592 "#include E<lt>unistd.hE<gt>\n"
6593 "#include E<lt>pthread.hE<gt>\n"
6594 "#include E<lt>string.hE<gt>\n"
6595 "#include E<lt>errno.hE<gt>\n"
6596 msgstr ""
6597 "#include E<lt>time.hE<gt>\n"
6598 "#include E<lt>stdio.hE<gt>\n"
6599 "#include E<lt>stdlib.hE<gt>\n"
6600 "#include E<lt>unistd.hE<gt>\n"
6601 "#include E<lt>pthread.hE<gt>\n"
6602 "#include E<lt>string.hE<gt>\n"
6603 "#include E<lt>errno.hE<gt>\n"
6604
6605 #. type: Plain text
6606 #: build/C/man3/pthread_getcpuclockid.3:127
6607 #, no-wrap
6608 msgid ""
6609 "static void *\n"
6610 "thread_start(void *arg)\n"
6611 "{\n"
6612 "    printf(\"Subthread starting infinite loop\\en\");\n"
6613 "    for (;;)\n"
6614 "        continue;\n"
6615 "}\n"
6616 msgstr ""
6617 "static void *\n"
6618 "thread_start(void *arg)\n"
6619 "{\n"
6620 "    printf(\"Subthread starting infinite loop\\en\");\n"
6621 "    for (;;)\n"
6622 "        continue;\n"
6623 "}\n"
6624
6625 #. type: Plain text
6626 #: build/C/man3/pthread_getcpuclockid.3:132
6627 #, no-wrap
6628 msgid ""
6629 "static void\n"
6630 "pclock(char *msg, clockid_t cid)\n"
6631 "{\n"
6632 "    struct timespec ts;\n"
6633 msgstr ""
6634 "static void\n"
6635 "pclock(char *msg, clockid_t cid)\n"
6636 "{\n"
6637 "    struct timespec ts;\n"
6638
6639 #. type: Plain text
6640 #: build/C/man3/pthread_getcpuclockid.3:138
6641 #, no-wrap
6642 msgid ""
6643 "    printf(\"%s\", msg);\n"
6644 "    if (clock_gettime(cid, &ts) == -1)\n"
6645 "        handle_error(\"clock_gettime\");\n"
6646 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6647 "}\n"
6648 msgstr ""
6649 "    printf(\"%s\", msg);\n"
6650 "    if (clock_gettime(cid, &ts) == -1)\n"
6651 "        handle_error(\"clock_gettime\");\n"
6652 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6653 "}\n"
6654
6655 #. type: Plain text
6656 #: build/C/man3/pthread_getcpuclockid.3:145
6657 #, no-wrap
6658 msgid ""
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 msgstr ""
6666 "int\n"
6667 "main(int argc, char *argv[])\n"
6668 "{\n"
6669 "    pthread_t thread;\n"
6670 "    clockid_t cid;\n"
6671 "    int j, s;\n"
6672
6673 #. type: Plain text
6674 #: build/C/man3/pthread_getcpuclockid.3:149
6675 #, no-wrap
6676 msgid ""
6677 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6678 "    if (s != 0)\n"
6679 "        handle_error_en(s, \"pthread_create\");\n"
6680 msgstr ""
6681 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6682 "    if (s != 0)\n"
6683 "        handle_error_en(s, \"pthread_create\");\n"
6684
6685 #. type: Plain text
6686 #: build/C/man3/pthread_getcpuclockid.3:152
6687 #, no-wrap
6688 msgid ""
6689 "    printf(\"Main thread sleeping\\en\");\n"
6690 "    sleep(1);\n"
6691 msgstr ""
6692 "    printf(\"Main thread sleeping\\en\");\n"
6693 "    sleep(1);\n"
6694
6695 #. type: Plain text
6696 #: build/C/man3/pthread_getcpuclockid.3:156
6697 #, no-wrap
6698 msgid ""
6699 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6700 "    for (j = 0; j E<lt> 2000000; j++)\n"
6701 "        getppid();\n"
6702 msgstr ""
6703 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6704 "    for (j = 0; j E<lt> 2000000; j++)\n"
6705 "        getppid();\n"
6706
6707 #. type: Plain text
6708 #: build/C/man3/pthread_getcpuclockid.3:158
6709 #, no-wrap
6710 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6711 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6712
6713 #. type: Plain text
6714 #: build/C/man3/pthread_getcpuclockid.3:163
6715 #, no-wrap
6716 msgid ""
6717 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6718 "    if (s != 0)\n"
6719 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6720 "    pclock(\"Main thread CPU time:   \", cid);\n"
6721 msgstr ""
6722 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6723 "    if (s != 0)\n"
6724 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6725 "    pclock(\"Main thread CPU time:   \", cid);\n"
6726
6727 #. type: Plain text
6728 #: build/C/man3/pthread_getcpuclockid.3:166
6729 #, no-wrap
6730 msgid ""
6731 "    /* The preceding 4 lines of code could have been replaced by:\n"
6732 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6733 msgstr ""
6734 "    /* The preceding 4 lines of code could have been replaced by:\n"
6735 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6736
6737 #. type: Plain text
6738 #: build/C/man3/pthread_getcpuclockid.3:171
6739 #, no-wrap
6740 msgid ""
6741 "    s = pthread_getcpuclockid(thread, &cid);\n"
6742 "    if (s != 0)\n"
6743 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6744 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6745 msgstr ""
6746 "    s = pthread_getcpuclockid(thread, &cid);\n"
6747 "    if (s != 0)\n"
6748 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6749 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6750
6751 #. type: Plain text
6752 #: build/C/man3/pthread_getcpuclockid.3:174
6753 #, no-wrap
6754 msgid ""
6755 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6756 "}\n"
6757 msgstr ""
6758 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6759 "}\n"
6760
6761 #. type: Plain text
6762 #: build/C/man3/pthread_getcpuclockid.3:183
6763 msgid ""
6764 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6765 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6766 msgstr ""
6767 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6768 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6769
6770 #. type: TH
6771 #: build/C/man3/pthread_join.3:26
6772 #, no-wrap
6773 msgid "PTHREAD_JOIN"
6774 msgstr "PTHREAD_JOIN"
6775
6776 #. type: Plain text
6777 #: build/C/man3/pthread_join.3:29
6778 msgid "pthread_join - join with a terminated thread"
6779 msgstr "pthread_join - 終了したスレッドを join する"
6780
6781 #. type: Plain text
6782 #: build/C/man3/pthread_join.3:34
6783 #, no-wrap
6784 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6785 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6786
6787 #. type: Plain text
6788 #: build/C/man3/pthread_join.3:49
6789 msgid ""
6790 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
6791 "to terminate.  If that thread has already terminated, then "
6792 "B<pthread_join>()  returns immediately.  The thread specified by I<thread> "
6793 "must be joinable."
6794 msgstr ""
6795 "B<pthread_join>() 関数は、I<thread> で指定されたスレッドが\n"
6796 "終了するのを待つ。そのスレッドがすでに終了している場合、\n"
6797 "B<pthread_join>() はすぐに返る。\n"
6798 "I<thread> で指定されたスレッドは join 可能でなければならない。"
6799
6800 #. type: Plain text
6801 #: build/C/man3/pthread_join.3:63
6802 msgid ""
6803 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
6804 "the target thread (i.e., the value that the target thread supplied to "
6805 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
6806 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
6807 msgstr ""
6808 "I<retval> が NULL でない場合、 B<pthread_join>() は対象スレッドの終了\n"
6809 "ステータス (すなわち、対象スレッドが B<pthread_exit>(3) に渡した値) を\n"
6810 "I<*retval> が指す場所にコピーする。対象スレッドがキャンセルされた場合、\n"
6811 "I<*retval> には B<PTHREAD_CANCELED> が格納される。"
6812
6813 #. type: Plain text
6814 #: build/C/man3/pthread_join.3:70
6815 msgid ""
6816 "If multiple threads simultaneously try to join with the same thread, the "
6817 "results are undefined.  If the thread calling B<pthread_join>()  is "
6818 "canceled, then the target thread will remain joinable (i.e., it will not be "
6819 "detached)."
6820 msgstr ""
6821 "複数のスレッドが同時に同じスレッドを join しようとした場合、その結果\n"
6822 "は不定である。B<pthread_join>() を呼び出しているスレッドがキャンセル\n"
6823 "された場合、対象スレッドは join 可能のままとなる (detached 状態には\n"
6824 "ならない)。"
6825
6826 #. type: Plain text
6827 #: build/C/man3/pthread_join.3:75
6828 msgid ""
6829 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
6830 "number."
6831 msgstr ""
6832 "成功すると、 B<pthread_join>() は 0 を返す。\n"
6833 "エラーの場合、エラー番号を返す。"
6834
6835 #. type: TP
6836 #: build/C/man3/pthread_join.3:76
6837 #, no-wrap
6838 msgid "B<EDEADLK>"
6839 msgstr "B<EDEADLK>"
6840
6841 #.  The following verified by testing on glibc 2.8/NPTL:
6842 #.  The following verified by testing on glibc 2.8/NPTL:
6843 #. type: Plain text
6844 #: build/C/man3/pthread_join.3:85
6845 msgid ""
6846 "A deadlock was detected (e.g., two threads tried to join with each other); "
6847 "or I<thread> specifies the calling thread."
6848 msgstr ""
6849 "デッドロックが検出された (例えば、二つのスレッドが互いに join しようと\n"
6850 "した場合)、または I<thread> に呼び出したスレッドが指定されている。"
6851
6852 #.  POSIX.1-2001 does not specify this error case.
6853 #. type: Plain text
6854 #: build/C/man3/pthread_join.3:93
6855 msgid "Another thread is already waiting to join with this thread."
6856 msgstr "別のスレッドがすでにこのスレッドの join 待ちである。"
6857
6858 #. type: Plain text
6859 #: build/C/man3/pthread_join.3:104
6860 msgid ""
6861 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
6862 "the target thread has terminated."
6863 msgstr ""
6864 "B<pthread_join>() の呼び出しが成功した場合は、\n"
6865 "呼び出し側には、対象スレッドが終了していることが保証される。"
6866
6867 #. type: Plain text
6868 #: build/C/man3/pthread_join.3:107
6869 msgid ""
6870 "Joining with a thread that has previously been joined results in undefined "
6871 "behavior."
6872 msgstr "すでに join されたスレッドを join した場合の結果は不定である。"
6873
6874 #. type: Plain text
6875 #: build/C/man3/pthread_join.3:115
6876 msgid ""
6877 "Failure to join with a thread that is joinable (i.e., one that is not "
6878 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
6879 "zombie thread consumes some system resources, and when enough zombie threads "
6880 "have accumulated, it will no longer be possible to create new threads (or "
6881 "processes)."
6882 msgstr ""
6883 "join 可能なスレッド (detached 状態でないスレッド) の join に失敗した場合、\n"
6884 "\"ゾンビスレッド (zombie thread)\" が生成される。\n"
6885 "各ゾンビスレッドはシステムリソースをいくらかは消費し、\n"
6886 "ゾンビスレッドがたくさん生成されてしまうと、\n"
6887 "新しいスレッド (やプロセス) がそれ以上作成できなくなってしまうので、\n"
6888 "このようなことが起きるのは避けること。"
6889
6890 #. type: Plain text
6891 #: build/C/man3/pthread_join.3:121
6892 msgid ""
6893 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
6894 "\"join with any terminated thread\".  If you believe you need this "
6895 "functionality, you probably need to rethink your application design."
6896 msgstr ""
6897 "pthreads には、 I<waitpid(-1,\\ &status,\\ 0)>、つまり\n"
6898 "\"終了されたスレッドのどれかを join する\" といった機能はない。\n"
6899 "この機能が必要だと思うような場合には、おそらく\n"
6900 "自分のアプリケーションの設計を考え直す必要があるだろう。"
6901
6902 #. type: Plain text
6903 #: build/C/man3/pthread_join.3:124
6904 msgid ""
6905 "All of the threads in a process are peers: any thread can join with any "
6906 "other thread in the process."
6907 msgstr ""
6908 "プロセス内の全てのスレッドは対等であり、\n"
6909 "どのスレッドでもプロセス内の他のスレッドを join できる。"
6910
6911 #. type: Plain text
6912 #: build/C/man3/pthread_join.3:134
6913 msgid ""
6914 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6915 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6916 msgstr ""
6917 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6918 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6919
6920 #. type: TH
6921 #: build/C/man3/pthread_kill.3:26
6922 #, no-wrap
6923 msgid "PTHREAD_KILL"
6924 msgstr "PTHREAD_KILL"
6925
6926 #. type: TH
6927 #: build/C/man3/pthread_kill.3:26
6928 #: build/C/man3/pthread_kill_other_threads_np.3:26
6929 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setcancelstate.3:26
6930 #: build/C/man3/pthread_yield.3:25
6931 #, no-wrap
6932 msgid "2014-05-13"
6933 msgstr "2014-05-13"
6934
6935 #. type: Plain text
6936 #: build/C/man3/pthread_kill.3:29
6937 msgid "pthread_kill - send a signal to a thread"
6938 msgstr "pthread_kill - スレッドにシグナルを送信する"
6939
6940 #. type: Plain text
6941 #: build/C/man3/pthread_kill.3:32 build/C/man3/pthread_sigmask.3:32
6942 #, no-wrap
6943 msgid "B<#include E<lt>signal.hE<gt>>\n"
6944 msgstr "B<#include E<lt>signal.hE<gt>>\n"
6945
6946 #. type: Plain text
6947 #: build/C/man3/pthread_kill.3:34
6948 #, no-wrap
6949 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6950 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6951
6952 #. type: Plain text
6953 #: build/C/man3/pthread_kill.3:45
6954 msgid "B<pthread_kill>():"
6955 msgstr "B<pthread_kill>():"
6956
6957 #. type: Plain text
6958 #: build/C/man3/pthread_kill.3:47 build/C/man3/pthread_sigmask.3:48
6959 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
6960 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
6961
6962 #. type: Plain text
6963 #: build/C/man3/pthread_kill.3:59
6964 msgid ""
6965 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, a "
6966 "thread in the same process as the caller.  The signal is asynchronously "
6967 "directed to I<thread>."
6968 msgstr ""
6969 "B<pthread_kill>() 関数は、呼び出したスレッドと同じプロセスの\n"
6970 "スレッド I<thread> にシグナル I<sig> を送信する。\n"
6971 "シグナルは非同期に I<thread> へ直接送られる。"
6972
6973 #. type: Plain text
6974 #: build/C/man3/pthread_kill.3:63
6975 msgid ""
6976 "If I<sig> is 0, then no signal is sent, but error checking is still "
6977 "performed."
6978 msgstr ""
6979 "I<sig> が 0 の場合、シグナルは送信されないが、エラーチェックだけは実行され"
6980 "る。"
6981
6982 #. type: Plain text
6983 #: build/C/man3/pthread_kill.3:68
6984 msgid ""
6985 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
6986 "number, and no signal is sent."
6987 msgstr ""
6988 "成功すると、 B<pthread_kill>() は 0 を返す。\n"
6989 "エラーの場合、エラー番号を返し、シグナルの送信は行わない。"
6990
6991 #. type: Plain text
6992 #: build/C/man3/pthread_kill.3:72
6993 msgid "An invalid signal was specified."
6994 msgstr "無効なシグナルが指定された。"
6995
6996 #. type: Plain text
6997 #: build/C/man3/pthread_kill.3:77
6998 msgid "The B<pthread_kill>()  function is thread-safe."
6999 msgstr "B<pthread_kill>() 関数はスレッドセーフである。"
7000
7001 #. type: Plain text
7002 #: build/C/man3/pthread_kill.3:79
7003 msgid "POSIX.1-2008."
7004 msgstr "POSIX.1-2008."
7005
7006 #. type: Plain text
7007 #: build/C/man3/pthread_kill.3:86
7008 msgid ""
7009 "Signal dispositions are process-wide: if a signal handler is installed, the "
7010 "handler will be invoked in the thread I<thread>, but if the disposition of "
7011 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
7012 "affect the whole process."
7013 msgstr ""
7014 "シグナルの配送はプロセス全体で行われる。\n"
7015 "シグナルハンドラーが設定されている場合、\n"
7016 "そのハンドラーがスレッド I<thread> で起動されるが、\n"
7017 "シグナルの配送が \"stop\", \"continue\", \"terminate\" のいずれかの場合、\n"
7018 "シグナルに対するアクションはプロセス全体に影響がある。"
7019
7020 #. type: Plain text
7021 #: build/C/man3/pthread_kill.3:99
7022 msgid ""
7023 "POSIX.1-2008 recommends that if an implementation detects the use of a "
7024 "thread ID after the end of its lifetime, B<pthread_kill>()  should return "
7025 "the error B<ESRCH>.  The glibc implementation returns this error in the "
7026 "cases where an invalid thread ID can be detected.  But note also that POSIX "
7027 "says that an attempt to use a thread ID whose lifetime has ended produces "
7028 "undefined behavior, and an attempt to use an invalid thread ID in a call to "
7029 "B<pthread_kill>()  can, for example, cause a segmentation fault."
7030 msgstr ""
7031 "POSIX.1-2008 では、 スレッドが終了した後にそのスレッド ID が使用されたことを"
7032 "検出した場合に、 B<pthread_kill>() はエラー B<ESRCH> を返すことを推奨されてい"
7033 "る。 glibc の実装では、無効なスレッド ID を検出できる場合にはこのエラーを返"
7034 "す。 しかし、 POSIX では、 終了したスレッド ID を使おうとした場合の動作は不定"
7035 "であり、 B<pthread_kill>() で無効なスレッド ID を使おうとした場合には、 例え"
7036 "ば、 セグメンテーションフォールトになる可能性もある点に注意すること。"
7037
7038 #. type: Plain text
7039 #: build/C/man3/pthread_kill.3:108
7040 msgid ""
7041 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
7042 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
7043 msgstr ""
7044 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
7045 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
7046
7047 #. type: TH
7048 #: build/C/man3/pthread_kill_other_threads_np.3:26
7049 #, no-wrap
7050 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
7051 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
7052
7053 #. type: Plain text
7054 #: build/C/man3/pthread_kill_other_threads_np.3:29
7055 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
7056 msgstr "pthread_kill_other_threads_np - プロセス内の他の全スレッドを終了する"
7057
7058 #. type: Plain text
7059 #: build/C/man3/pthread_kill_other_threads_np.3:34
7060 #, no-wrap
7061 msgid "B<void pthread_kill_other_threads_np(void);>\n"
7062 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
7063
7064 #.  .SH VERSIONS
7065 #.  Available since glibc 2.0
7066 #. type: Plain text
7067 #: build/C/man3/pthread_kill_other_threads_np.3:47
7068 msgid ""
7069 "B<pthread_kill_other_threads_np>()  has an effect only in the LinuxThreads "
7070 "threading implementation.  On that implementation, calling this function "
7071 "causes the immediate termination of all threads in the application, except "
7072 "the calling thread.  The cancellation state and cancellation type of the to-"
7073 "be-terminated threads are ignored, and the cleanup handlers are not called "
7074 "in those threads."
7075 msgstr ""
7076 "B<pthread_kill_other_threads_np>() は、\n"
7077 "LinuxThreads スレッド実装においてのみ効果がある。\n"
7078 "LinuxThreads スレッド実装では、この関数を呼び出すと\n"
7079 "アプリケーション内の全てのスレッドがすぐに終了される。\n"
7080 "終了対象のスレッドの cancelability state と cancelability type は\n"
7081 "無視され、それらのスレッドのクリーンアップハンドラーは呼び出されない。"
7082
7083 #. type: Plain text
7084 #: build/C/man3/pthread_kill_other_threads_np.3:52
7085 msgid "The B<pthread_kill_other_threads_np>()  function is thread-safe."
7086 msgstr "B<pthread_kill_other_threads_np>() 関数はスレッドセーフである。"
7087
7088 #. type: Plain text
7089 #: build/C/man3/pthread_kill_other_threads_np.3:64
7090 msgid ""
7091 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
7092 "thread calls B<execve>(2)  or a similar function.  This function is designed "
7093 "to address a limitation in the obsolete LinuxThreads implementation whereby "
7094 "the other threads of an application are not automatically terminated (as "
7095 "POSIX.1-2001 requires) during B<execve>(2)."
7096 msgstr ""
7097 "B<pthread_kill_other_threads_np>() は、\n"
7098 "スレッドが B<execve>(2) や同様の関数を呼び出す直前に\n"
7099 "呼ばれることを目的として用意されている。\n"
7100 "この関数は、(廃止予定の) LinuxThreads スレッド実装における、\n"
7101 "B<execve>(2) の際にアプリケーションの他のスレッドが自動的に\n"
7102 "終了されないという制限を解決するために設計された。"
7103
7104 #. type: Plain text
7105 #: build/C/man3/pthread_kill_other_threads_np.3:71
7106 msgid ""
7107 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
7108 "exists, but does nothing.  (Nothing needs to be done, because the "
7109 "implementation does the right thing during an B<execve>(2).)"
7110 msgstr ""
7111 "NPTL スレッド実装では、 B<pthread_kill_other_threads_np>() は存在するが、\n"
7112 "何もしない(NPTL 実装は B<execve>(2) の際に適切な動作をするので、\n"
7113 "何もする必要がないということだ)。"
7114
7115 #. type: Plain text
7116 #: build/C/man3/pthread_kill_other_threads_np.3:77
7117 msgid ""
7118 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7119 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7120 msgstr ""
7121 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7122 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7123
7124 #. type: TH
7125 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
7126 #, no-wrap
7127 msgid "PTHREAD_RWLOCKATTR_SETKIND_NP"
7128 msgstr "PTHREAD_RWLOCKATTR_SETKIND_NP"
7129
7130 #. type: TH
7131 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
7132 #, no-wrap
7133 msgid "2014-10-15"
7134 msgstr "2014-10-15"
7135
7136 #. type: Plain text
7137 #: build/C/man3/pthread_rwlockattr_setkind_np.3:29
7138 msgid ""
7139 "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - set/get the "
7140 "read-write lock kind of the thread read-write lock attribute object"
7141 msgstr ""
7142 "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - スレッドの読み"
7143 "書きロック属性オブジェクトの読み書きロック種別の設定、取得を行う"
7144
7145 #. type: Plain text
7146 #: build/C/man3/pthread_rwlockattr_setkind_np.3:37
7147 #, no-wrap
7148 msgid ""
7149 "B<int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *>I<attr>B<,>\n"
7150 "B<                                   int >I<pref>B<);>\n"
7151 "B<int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *>I<attr>B<,>\n"
7152 "B<                                   int *>I<pref>B<);>\n"
7153 msgstr ""
7154 "B<int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *>I<attr>B<,>\n"
7155 "B<                                   int >I<pref>B<);>\n"
7156 "B<int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *>I<attr>B<,>\n"
7157 "B<                                   int *>I<pref>B<);>\n"
7158
7159 #. type: Plain text
7160 #: build/C/man3/pthread_rwlockattr_setkind_np.3:48
7161 msgid "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
7162 msgstr ""
7163 "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
7164
7165 #. type: Plain text
7166 #: build/C/man3/pthread_rwlockattr_setkind_np.3:52
7167 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _POSIX_C_SOURCE E<gt>= 200809L"
7168 msgstr "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _POSIX_C_SOURCE E<gt>= 200809L"
7169
7170 #. type: Plain text
7171 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
7172 msgid ""
7173 "The B<pthread_rwlockattr_setkind_np>()  function sets the \"lock kind\" "
7174 "attribute of the read-write lock attribute object referred to by I<attr> to "
7175 "the value specified in I<pref>.  The argument I<pref> may be set to one of "
7176 "the following:"
7177 msgstr ""
7178 "B<pthread_rwlockattr_setkind_np>() 関数は、 I<attr> が参照する読み書きロック"
7179 "属性オブジェクトの「ロック種別 (lock kind)」を I<pref> で指定された値に設定す"
7180 "る。 引き数 I<pref> には以下のいずれか一つを設定できる。"
7181
7182 #. type: TP
7183 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
7184 #, no-wrap
7185 msgid "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
7186 msgstr "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
7187
7188 #. type: Plain text
7189 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
7190 msgid ""
7191 "This is the default.  A thread may hold multiple read locks; that is, read "
7192 "locks are recursive.  According to The Single Unix Specification, the "
7193 "behavior is unspecified when a reader tries to place a lock, and there is no "
7194 "write lock but writers are waiting.  Giving preference to the reader, as is "
7195 "set by B<PTHREAD_RWLOCK_PREFER_READER_NP>, implies that the reader will "
7196 "receive the requested lock, even if a writer is waiting.  As long as there "
7197 "are readers, the writer will be starved."
7198 msgstr ""
7199 "これがデフォルトである。 スレッドは複数の読み出しロックを保持できる。 つま"
7200 "り、読み出しロックは再帰的である。 Single Unix Specification では、 読み出し"
7201 "側がロックをかけようとした際に、書き込みロックはないが書き込み側が待っていた"
7202 "場合の、動作は規定されていない。 B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定"
7203 "し、読み出し側に優先度を与えるということは、 たとえ書き込み側が待っていたとし"
7204 "ても、読み出し側が要求したロックを受け取ることを意味する。 読み出し側がいる限"
7205 "り、書き込み側は待つことになる。"
7206
7207 #. type: TP
7208 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
7209 #, no-wrap
7210 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
7211 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
7212
7213 #. type: Plain text
7214 #: build/C/man3/pthread_rwlockattr_setkind_np.3:83
7215 msgid ""
7216 "This is intended as the write lock analog of "
7217 "B<PTHREAD_RWLOCK_PREFER_READER_NP>.  But see BUGS."
7218 msgstr ""
7219 "これは B<PTHREAD_RWLOCK_PREFER_READER_NP> の書き込みロック版である。 ただし"
7220 "「バグ」を参照のこと。"
7221
7222 #. type: TP
7223 #: build/C/man3/pthread_rwlockattr_setkind_np.3:83
7224 #, no-wrap
7225 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
7226 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
7227
7228 #. type: Plain text
7229 #: build/C/man3/pthread_rwlockattr_setkind_np.3:88
7230 msgid ""
7231 "Setting the lock kind to this avoids writer starvation as long as any read "
7232 "locking is not done in a recursive fashion."
7233 msgstr ""
7234 "ロック種別をこの値に設定すると、 読み出しロックが再帰的に行われない限りは、 "
7235 "書き込み側の待ちを避けることができる。"
7236
7237 #. type: Plain text
7238 #: build/C/man3/pthread_rwlockattr_setkind_np.3:96
7239 msgid ""
7240 "The B<pthread_rwlockattr_getkind_np>()  function returns the value of the "
7241 "lock kind attribute of the read-write lock attribute object referred to by "
7242 "I<attr> in the pointer I<pref>."
7243 msgstr ""
7244 "B<pthread_rwlockattr_getkind_np>() 関数は、 I<attr> が参照する読み書きロック"
7245 "属性オブジェクトのロック種別属性の値をポインター I<pref> に入れて返す。"
7246
7247 #. type: Plain text
7248 #: build/C/man3/pthread_rwlockattr_setkind_np.3:104
7249 msgid ""
7250 "On success, these functions return 0.  Given valid pointer arguments, "
7251 "B<pthread_rwlockattr_getkind_np>()  always succeeds.  On error, "
7252 "B<pthread_rwlockattr_setkind_np>()  returns a non-zero error number."
7253 msgstr ""
7254 "成功すると、これらの関数は 0 を返す。 有効なポインター引き数が渡された場合、 "
7255 "B<pthread_rwlockattr_getkind_np>() は常に成功する。 エラーの場合、 "
7256 "B<pthread_rwlockattr_setkind_np>() は 0 以外のエラー番号を返す。"
7257
7258 #. type: Plain text
7259 #: build/C/man3/pthread_rwlockattr_setkind_np.3:109
7260 msgid "I<pref> specifies an unsupported value."
7261 msgstr "I<pref> にサポート外の値が指定された。"
7262
7263 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7057
7264 #. type: Plain text
7265 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
7266 msgid ""
7267 "Setting the value read-write lock kind to B<PTHREAD_RWLOCK_PREFER_WRITER_NP> "
7268 "results in the same behavior as setting the value to "
7269 "B<PTHREAD_RWLOCK_PREFER_READER_NP>.  As long as a reader thread holds the "
7270 "lock, the thread holding a write lock will be starved.  Setting the lock "
7271 "kind to B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> allows writers to "
7272 "run, but, as the name implies a writer may not lock recursively."
7273 msgstr ""
7274 "読み書きロック種別の値を B<PTHREAD_RWLOCK_PREFER_WRITER_NP> に設定すること"
7275 "は、 値を B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定するのと同じ動作となる。 "
7276 "読み出しスレッドがロックを保持する限り、書き込みロックを保持しているスレッド"
7277 "は停止することになる。 ロック種別を "
7278 "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> に設定すると、 書き込み側が動"
7279 "作できるようになるが、変数名から分かるように、 書き込み側はロックを再帰的に行"
7280 "うことはできない。"
7281
7282 #. type: Plain text
7283 #: build/C/man3/pthread_rwlockattr_setkind_np.3:127
7284 msgid ""
7285 "The B<pthread_rwlockattr_getkind_np>()  and "
7286 "B<pthread_rwlockattr_setkind_np>()  functions first appeared in glibc 2.1."
7287 msgstr ""
7288 "関数 B<pthread_rwlockattr_getkind_np>() と "
7289 "B<pthread_rwlockattr_setkind_np>() は glibc 2.1 で初めて登場した。"
7290
7291 #. type: Plain text
7292 #: build/C/man3/pthread_rwlockattr_setkind_np.3:130
7293 msgid ""
7294 "These functions are non-standard GNU extensions; hence the suffix \"_np"
7295 "\" (non-portable) in the names."
7296 msgstr ""
7297 "これらの関数は非標準の GNU による拡張である。 そのため、名前に \"_np\" (non-"
7298 "portable; 移植性がない) という接尾辞が付いている。"
7299
7300 #. type: Plain text
7301 #: build/C/man3/pthread_rwlockattr_setkind_np.3:132
7302 msgid "B<pthreads>(7)"
7303 msgstr "B<pthreads>(7)"
7304
7305 #. type: TH
7306 #: build/C/man3/pthread_self.3:26
7307 #, no-wrap
7308 msgid "PTHREAD_SELF"
7309 msgstr "PTHREAD_SELF"
7310
7311 #. type: Plain text
7312 #: build/C/man3/pthread_self.3:29
7313 msgid "pthread_self - obtain ID of the calling thread"
7314 msgstr "pthread_self - 呼び出したスレッドの ID を取得する"
7315
7316 #. type: Plain text
7317 #: build/C/man3/pthread_self.3:34
7318 #, no-wrap
7319 msgid "B<pthread_t pthread_self(void);>\n"
7320 msgstr "B<pthread_t pthread_self(void);>\n"
7321
7322 #. type: Plain text
7323 #: build/C/man3/pthread_self.3:46
7324 msgid ""
7325 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
7326 "is the same value that is returned in I<*thread> in the "
7327 "B<pthread_create>(3)  call that created this thread."
7328 msgstr ""
7329 "B<pthread_self>() 関数は、呼び出したスレッドの ID を返す。\n"
7330 "得られる ID は、このスレッドが作成された B<pthread_create>(3) の\n"
7331 "呼び出しで I<*thread> で返されるのと同じ値である。"
7332
7333 #. type: Plain text
7334 #: build/C/man3/pthread_self.3:48
7335 msgid "This function always succeeds, returning the calling thread's ID."
7336 msgstr "この関数は常に成功し、呼び出したスレッドの ID を返す。"
7337
7338 #. type: Plain text
7339 #: build/C/man3/pthread_self.3:55
7340 msgid "The B<pthread_self>()  function is thread-safe."
7341 msgstr "B<pthread_self>() 関数はスレッドセーフである。"
7342
7343 #. type: Plain text
7344 #: build/C/man3/pthread_self.3:68
7345 msgid ""
7346 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
7347 "represent a thread ID; for example, representation using either an "
7348 "arithmetic type or a structure is permitted.  Therefore, variables of type "
7349 "I<pthread_t> can't portably be compared using the C equality operator "
7350 "(B<==>); use B<pthread_equal>(3)  instead."
7351 msgstr ""
7352 "POSIX.1 では、スレッド ID を表現するのに使用する型は、\n"
7353 "スレッド実装が完全に自由に選択してよいことになっている。\n"
7354 "例えば、スレッド ID を表現するのに数値型を使っても構造体を使ってもよい。\n"
7355 "そのため、移植性を確保しつつ、 C 言語の等価演算子 (B<==>) を使って、\n"
7356 "I<pthread_t> 型の変数の比較を行うことはできない。\n"
7357 "代わりに B<pthread_equal>(3) を使うこと。"
7358
7359 #. type: Plain text
7360 #: build/C/man3/pthread_self.3:72
7361 msgid ""
7362 "Thread identifiers should be considered opaque: any attempt to use a thread "
7363 "ID other than in pthreads calls is nonportable and can lead to unspecified "
7364 "results."
7365 msgstr ""
7366 "スレッド識別子はその内部構造を意識すべきではない。\n"
7367 "pthreads 関数以外でスレッド ID を利用しようとした場合、\n"
7368 "移植性がなくなり、どのような結果が得られるかも分からない。"
7369
7370 #. type: Plain text
7371 #: build/C/man3/pthread_self.3:76
7372 msgid ""
7373 "Thread IDs are guaranteed to be unique only within a process.  A thread ID "
7374 "may be reused after a terminated thread has been joined, or a detached "
7375 "thread has terminated."
7376 msgstr ""
7377 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
7378 "終了したスレッドが join されたり、\n"
7379 "切り離された (detached) スレッドが終了されたりした後は、\n"
7380 "そのスレッド ID は再利用されることがある。"
7381
7382 #. type: Plain text
7383 #: build/C/man3/pthread_self.3:81
7384 msgid ""
7385 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
7386 "kernel thread ID returned by a call to B<gettid>(2)."
7387 msgstr ""
7388 "B<pthread_self>() が返すスレッド ID は、\n"
7389 "B<gettid>(2) が返すカーネルスレッド ID とは違うものである。"
7390
7391 #. type: Plain text
7392 #: build/C/man3/pthread_self.3:85
7393 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7394 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7395
7396 #. type: TH
7397 #: build/C/man3/pthread_setaffinity_np.3:26
7398 #, no-wrap
7399 msgid "PTHREAD_SETAFFINITY_NP"
7400 msgstr "PTHREAD_SETAFFINITY_NP"
7401
7402 #. type: Plain text
7403 #: build/C/man3/pthread_setaffinity_np.3:30
7404 msgid ""
7405 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
7406 "thread"
7407 msgstr ""
7408 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
7409 "CPU affinity の設定/取得を行う"
7410
7411 #. type: Plain text
7412 #: build/C/man3/pthread_setaffinity_np.3:39
7413 #, no-wrap
7414 msgid ""
7415 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7416 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
7417 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7418 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
7419 msgstr ""
7420 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7421 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
7422 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7423 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
7424
7425 #. type: Plain text
7426 #: build/C/man3/pthread_setaffinity_np.3:54
7427 msgid ""
7428 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
7429 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
7430 "successful, and the thread is not currently running on one of the CPUs in "
7431 "I<cpuset>, then it is migrated to one of those CPUs."
7432 msgstr ""
7433 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7434 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
7435 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
7436 "場合は、スレッドは指定された CPU のいずれかに移動される。"
7437
7438 #. type: Plain text
7439 #: build/C/man3/pthread_setaffinity_np.3:61
7440 msgid ""
7441 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
7442 "the thread I<thread> in the buffer pointed to by I<cpuset>."
7443 msgstr ""
7444 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7445 "マスクを、I<cpuset> が指すバッファーに入れて返す。"
7446
7447 #. type: Plain text
7448 #: build/C/man3/pthread_setaffinity_np.3:77
7449 msgid ""
7450 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
7451 "by I<cpuset>.  Typically, this argument would be specified as "
7452 "I<sizeof(cpu_set_t)>.  (It may be some other value, if using the macros "
7453 "described in B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
7454 msgstr ""
7455 "引き数 I<cpusetsize> は I<cpuset> が指すバッファーの長さ (バイト単位) で\n"
7456 "ある。通常は、この引き数には I<sizeof(cpu_set_t)> を指定する\n"
7457 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
7458 "割り当てている場合には、別の値になることもある)。"
7459
7460 #. type: TP
7461 #: build/C/man3/pthread_setaffinity_np.3:81
7462 #, no-wrap
7463 msgid "B<EFAULT>"
7464 msgstr "B<EFAULT>"
7465
7466 #. type: Plain text
7467 #: build/C/man3/pthread_setaffinity_np.3:84
7468 msgid "A supplied memory address was invalid."
7469 msgstr "指定されたメモリーアドレスが無効である。"
7470
7471 #. type: Plain text
7472 #: build/C/man3/pthread_setaffinity_np.3:93
7473 msgid ""
7474 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
7475 "processors that are currently physically on the system and permitted to the "
7476 "thread according to any restrictions that may be imposed by the \"cpuset\" "
7477 "mechanism described in B<cpuset>(7)."
7478 msgstr ""
7479 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
7480 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
7481 "されているプロセッサが一つも含まれていない。\n"
7482 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
7483 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
7484
7485 #.  FIXME . ?
7486 #.  Loic Domaigne commented: it seems that in the future the
7487 #.  kernel developers want to make cpumask_t dynamic, so
7488 #.  CONFIG_NR_CPUS might become obsolete in the future.
7489 #.  cpumask_t
7490 #.  The raw sched_getaffinity() system call returns the size (in bytes)
7491 #.  of the cpumask_t type.
7492 #. type: Plain text
7493 #: build/C/man3/pthread_setaffinity_np.3:109
7494 msgid ""
7495 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
7496 "the set supported by the kernel.  (The kernel configuration option "
7497 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
7498 "type used to represent CPU sets.)"
7499 msgstr ""
7500 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
7501 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
7502 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
7503 "データ型がサポートする CPU 集合の範囲が定義される。)"
7504
7505 #. type: Plain text
7506 #: build/C/man3/pthread_setaffinity_np.3:114
7507 msgid ""
7508 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
7509 "affinity mask used by the kernel."
7510 msgstr ""
7511 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
7512 "affinity マスクの大きさよりも小さい。"
7513
7514 #. type: Plain text
7515 #: build/C/man3/pthread_setaffinity_np.3:128
7516 msgid ""
7517 "The B<pthread_setaffinity_np>()  and B<pthread_getaffinity_np>()  functions "
7518 "are thread-safe."
7519 msgstr ""
7520 "関数 B<pthread_setaffinity_np>() と B<pthread_getaffinity_np>() はスレッド"
7521 "セーフである。"
7522
7523 #. type: Plain text
7524 #: build/C/man3/pthread_setaffinity_np.3:144
7525 msgid ""
7526 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
7527 "thread will actually run is the intersection of the set specified in the "
7528 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
7529 "system may further restrict the set of CPUs on which the thread runs if the "
7530 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
7531 "restrictions on the actual set of CPUs on which the thread will run are "
7532 "silently imposed by the kernel."
7533 msgstr ""
7534 "B<pthread_setaffinity_np>() を呼び出した後、\n"
7535 "そのスレッドが実際に実行される CPU 集合は、\n"
7536 "I<cpuset> 引き数で指定された集合と\n"
7537 "システムに実際に存在する CPU 集合の共通部分になる。\n"
7538 "また、 B<cpuset>(7) で説明されている \"cpuset\" 機構が使われている場合\n"
7539 "には、そのスレッドが実行される CPU 集合がシステムによってさらに制限\n"
7540 "される場合がある。そのスレッドが実行される実際の CPU 集合に対する\n"
7541 "これらの制限は、カーネルにより黙って適用される。"
7542
7543 #. type: Plain text
7544 #: build/C/man3/pthread_setaffinity_np.3:150
7545 msgid ""
7546 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
7547 "B<sched_getaffinity>(2)  system calls."
7548 msgstr ""
7549 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
7550 "B<sched_getaffinity>(2) を使って実装されている。"
7551
7552 #. type: Plain text
7553 #: build/C/man3/pthread_setaffinity_np.3:161
7554 msgid ""
7555 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
7556 "creator's CPU affinity mask."
7557 msgstr ""
7558 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
7559 "作成者の CPU affinity マスクを継承する。"
7560
7561 #. type: Plain text
7562 #: build/C/man3/pthread_setaffinity_np.3:169
7563 msgid ""
7564 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
7565 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
7566 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
7567 "check the resulting CPU affinity mask of the thread."
7568 msgstr ""
7569 "以下のプログラムでは、メインスレッドは\n"
7570 "B<pthread_setaffinity_np>() を使って自分の CPU affinity マスクに\n"
7571 "CPU 0 から 7 が含まれるように設定し\n"
7572 "(システム上には 0 から 7 に対応する CPU が全て存在するとは限らない)、\n"
7573 "その後で B<pthread_getaffinity_np>() を使って\n"
7574 "スレッドに実際に設定された CPU affinity マスクを確認している。"
7575
7576 #. type: Plain text
7577 #: build/C/man3/pthread_setaffinity_np.3:176
7578 #, no-wrap
7579 msgid ""
7580 "#define _GNU_SOURCE\n"
7581 "#include E<lt>pthread.hE<gt>\n"
7582 "#include E<lt>stdio.hE<gt>\n"
7583 "#include E<lt>stdlib.hE<gt>\n"
7584 "#include E<lt>errno.hE<gt>\n"
7585 msgstr ""
7586 "#define _GNU_SOURCE\n"
7587 "#include E<lt>pthread.hE<gt>\n"
7588 "#include E<lt>stdio.hE<gt>\n"
7589 "#include E<lt>stdlib.hE<gt>\n"
7590 "#include E<lt>errno.hE<gt>\n"
7591
7592 #. type: Plain text
7593 #: build/C/man3/pthread_setaffinity_np.3:186
7594 #, no-wrap
7595 msgid ""
7596 "int\n"
7597 "main(int argc, char *argv[])\n"
7598 "{\n"
7599 "    int s, j;\n"
7600 "    cpu_set_t cpuset;\n"
7601 "    pthread_t thread;\n"
7602 msgstr ""
7603 "int\n"
7604 "main(int argc, char *argv[])\n"
7605 "{\n"
7606 "    int s, j;\n"
7607 "    cpu_set_t cpuset;\n"
7608 "    pthread_t thread;\n"
7609
7610 #. type: Plain text
7611 #: build/C/man3/pthread_setaffinity_np.3:188
7612 #, no-wrap
7613 msgid "    thread = pthread_self();\n"
7614 msgstr "    thread = pthread_self();\n"
7615
7616 #. type: Plain text
7617 #: build/C/man3/pthread_setaffinity_np.3:190
7618 #, no-wrap
7619 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7620 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7621
7622 #. type: Plain text
7623 #: build/C/man3/pthread_setaffinity_np.3:194
7624 #, no-wrap
7625 msgid ""
7626 "    CPU_ZERO(&cpuset);\n"
7627 "    for (j = 0; j E<lt> 8; j++)\n"
7628 "        CPU_SET(j, &cpuset);\n"
7629 msgstr ""
7630 "    CPU_ZERO(&cpuset);\n"
7631 "    for (j = 0; j E<lt> 8; j++)\n"
7632 "        CPU_SET(j, &cpuset);\n"
7633
7634 #. type: Plain text
7635 #: build/C/man3/pthread_setaffinity_np.3:198
7636 #, no-wrap
7637 msgid ""
7638 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7639 "    if (s != 0)\n"
7640 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7641 msgstr ""
7642 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7643 "    if (s != 0)\n"
7644 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7645
7646 #. type: Plain text
7647 #: build/C/man3/pthread_setaffinity_np.3:200
7648 #, no-wrap
7649 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
7650 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
7651
7652 #. type: Plain text
7653 #: build/C/man3/pthread_setaffinity_np.3:204
7654 #, no-wrap
7655 msgid ""
7656 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7657 "    if (s != 0)\n"
7658 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7659 msgstr ""
7660 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7661 "    if (s != 0)\n"
7662 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7663
7664 #. type: Plain text
7665 #: build/C/man3/pthread_setaffinity_np.3:209
7666 #, no-wrap
7667 msgid ""
7668 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7669 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7670 "        if (CPU_ISSET(j, &cpuset))\n"
7671 "            printf(\"    CPU %d\\en\", j);\n"
7672 msgstr ""
7673 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7674 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7675 "        if (CPU_ISSET(j, &cpuset))\n"
7676 "            printf(\"    CPU %d\\en\", j);\n"
7677
7678 #. type: Plain text
7679 #: build/C/man3/pthread_setaffinity_np.3:212
7680 #: build/C/man3/pthread_setschedparam.3:439
7681 #, no-wrap
7682 msgid ""
7683 "    exit(EXIT_SUCCESS);\n"
7684 "}\n"
7685 msgstr ""
7686 "    exit(EXIT_SUCCESS);\n"
7687 "}\n"
7688
7689 #. type: Plain text
7690 #: build/C/man3/pthread_setaffinity_np.3:221
7691 msgid ""
7692 "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), "
7693 "B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), "
7694 "B<sched>(7)"
7695 msgstr ""
7696 "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), "
7697 "B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), "
7698 "B<sched>(7)"
7699
7700 #. type: TH
7701 #: build/C/man3/pthread_setcancelstate.3:26
7702 #, no-wrap
7703 msgid "PTHREAD_SETCANCELSTATE"
7704 msgstr "PTHREAD_SETCANCELSTATE"
7705
7706 #. type: Plain text
7707 #: build/C/man3/pthread_setcancelstate.3:30
7708 msgid ""
7709 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
7710 "type"
7711 msgstr ""
7712 "pthread_setcancelstate, pthread_setcanceltype - cancelability state と "
7713 "cancelability type を設定する"
7714
7715 #. type: Plain text
7716 #: build/C/man3/pthread_setcancelstate.3:36
7717 #, no-wrap
7718 msgid ""
7719 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7720 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7721 msgstr ""
7722 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7723 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7724
7725 #. type: Plain text
7726 #: build/C/man3/pthread_setcancelstate.3:51
7727 msgid ""
7728 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
7729 "thread to the value given in I<state>.  The previous cancelability state of "
7730 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
7731 "I<state> argument must have one of the following values:"
7732 msgstr ""
7733 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
7734 "cancelability state に I<state> で指定された\n"
7735 "値を設定する。変更前のスレッドの cancelability state は\n"
7736 "I<oldstate> が指すバッファーで返される。\n"
7737 "I<state> 引き数には以下の値のいずれか一つを指定しなければならない。"
7738
7739 #. type: TP
7740 #: build/C/man3/pthread_setcancelstate.3:51
7741 #, no-wrap
7742 msgid "B<PTHREAD_CANCEL_ENABLE>"
7743 msgstr "B<PTHREAD_CANCEL_ENABLE>"
7744
7745 #. type: Plain text
7746 #: build/C/man3/pthread_setcancelstate.3:58
7747 msgid ""
7748 "The thread is cancelable.  This is the default cancelability state in all "
7749 "new threads, including the initial thread.  The thread's cancelability type "
7750 "determines when a cancelable thread will respond to a cancellation request."
7751 msgstr ""
7752 "スレッドは取り消し可能 (cancelable) である。\n"
7753 "これが全ての新しく作成されるスレッドでのデフォルトの\n"
7754 "cancelability state である。これには最初のスレッドも含まれる。\n"
7755 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
7756 "取り消し要求にいつ反応するかが決まる。"
7757
7758 #. type: TP
7759 #: build/C/man3/pthread_setcancelstate.3:58
7760 #, no-wrap
7761 msgid "B<PTHREAD_CANCEL_DISABLE>"
7762 msgstr "B<PTHREAD_CANCEL_DISABLE>"
7763
7764 #. type: Plain text
7765 #: build/C/man3/pthread_setcancelstate.3:63
7766 msgid ""
7767 "The thread is not cancelable.  If a cancellation request is received, it is "
7768 "blocked until cancelability is enabled."
7769 msgstr ""
7770 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
7771 "取り消し可能に設定されるまでその要求はブロックされる。"
7772
7773 #. type: Plain text
7774 #: build/C/man3/pthread_setcancelstate.3:75
7775 msgid ""
7776 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
7777 "thread to the value given in I<type>.  The previous cancelability type of "
7778 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
7779 "argument must have one of the following values:"
7780 msgstr ""
7781 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
7782 "cancelability type に I<type> で指定された値を設定する。\n"
7783 "変更前のスレッドの cancelability type は\n"
7784 "I<oldtype> が指すバッファーで返される。\n"
7785 "I<type> 引き数には以下の値のいずれか一つを指定しなければならない。"
7786
7787 #. type: TP
7788 #: build/C/man3/pthread_setcancelstate.3:75
7789 #, no-wrap
7790 msgid "B<PTHREAD_CANCEL_DEFERRED>"
7791 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
7792
7793 #. type: Plain text
7794 #: build/C/man3/pthread_setcancelstate.3:82
7795 msgid ""
7796 "A cancellation request is deferred until the thread next calls a function "
7797 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
7798 "cancelability type in all new threads, including the initial thread."
7799 msgstr ""
7800 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
7801 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
7802 "スレッドでのデフォルトの cancelability type である。\n"
7803 "これには最初のスレッドも含まれる。"
7804
7805 #. type: TP
7806 #: build/C/man3/pthread_setcancelstate.3:82
7807 #, no-wrap
7808 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7809 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7810
7811 #. type: Plain text
7812 #: build/C/man3/pthread_setcancelstate.3:88
7813 msgid ""
7814 "The thread can be canceled at any time.  (Typically, it will be canceled "
7815 "immediately upon receiving a cancellation request, but the system doesn't "
7816 "guarantee this.)"
7817 msgstr ""
7818 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
7819 "システムがそのことを保証しているわけではない)。"
7820
7821 #. type: Plain text
7822 #: build/C/man3/pthread_setcancelstate.3:92
7823 msgid ""
7824 "The set-and-get operation performed by each of these functions is atomic "
7825 "with respect to other threads in the process calling the same function."
7826 msgstr ""
7827 "これらの関数により実行される「設定と取得」操作 (set-and-get operation) は、\n"
7828 "同じ関数を呼び出したプロセス内の他のスレッドがあっても、\n"
7829 "アトミックに行われる。"
7830
7831 #. type: Plain text
7832 #: build/C/man3/pthread_setcancelstate.3:99
7833 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
7834 msgstr "B<pthread_setcancelstate>() は以下のエラーで失敗する場合がある。"
7835
7836 #. type: Plain text
7837 #: build/C/man3/pthread_setcancelstate.3:103
7838 msgid "Invalid value for I<state>."
7839 msgstr "I<state> に無効な値が指定された。"
7840
7841 #. type: Plain text
7842 #: build/C/man3/pthread_setcancelstate.3:107
7843 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
7844 msgstr "B<pthread_setcanceltype>() は以下のエラーで失敗する場合がある。"
7845
7846 #.  .SH VERSIONS
7847 #.  Available since glibc 2.0
7848 #. type: Plain text
7849 #: build/C/man3/pthread_setcancelstate.3:113
7850 msgid "Invalid value for I<type>."
7851 msgstr "I<type> に無効な値が指定された。"
7852
7853 #. type: Plain text
7854 #: build/C/man3/pthread_setcancelstate.3:120
7855 msgid ""
7856 "The B<pthread_setcancelstate>()  and B<pthread_setcanceltype>()  functions "
7857 "are thread-safe."
7858 msgstr ""
7859 "関数 B<pthread_setcancelstate>() と B<pthread_setcanceltype>() はスレッドセー"
7860 "フである。"
7861
7862 #. type: Plain text
7863 #: build/C/man3/pthread_setcancelstate.3:125
7864 msgid ""
7865 "For details of what happens when a thread is canceled, see "
7866 "B<pthread_cancel>(3)."
7867 msgstr ""
7868 "スレッドが取り消された場合に何が起こるかの詳細については\n"
7869 "B<pthread_cancel>(3) を参照。"
7870
7871 #. type: Plain text
7872 #: build/C/man3/pthread_setcancelstate.3:132
7873 msgid ""
7874 "Briefly disabling cancelability is useful if a thread performs some critical "
7875 "action that must not be interrupted by a cancellation request.  Beware of "
7876 "disabling cancelability for long periods, or around operations that may "
7877 "block for long periods, since that will render the thread unresponsive to "
7878 "cancellation requests."
7879 msgstr ""
7880 "取り消し要求により中断されてはならない重要なアクションをスレッドが\n"
7881 "実行する場合、短い時間だけ cancelability を無効にするのは有用である。\n"
7882 "長い時間 cancelability を無効にしたり、長い時間停止 (block) される\n"
7883 "可能性のある操作の前後で cancelability を無効にしたりする際には\n"
7884 "注意すること。なぜなら、無効にしてしまうと、キャンセル要求に対して\n"
7885 "スレッドが応答しない状態になってしまうからである。"
7886
7887 #. type: SS
7888 #: build/C/man3/pthread_setcancelstate.3:132
7889 #, no-wrap
7890 msgid "Asynchronous cancelability"
7891 msgstr "非同期キャンセル"
7892
7893 #. type: Plain text
7894 #: build/C/man3/pthread_setcancelstate.3:151
7895 msgid ""
7896 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
7897 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
7898 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
7899 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
7900 "because the application has no way of knowing what the state of these "
7901 "resources is when the thread is canceled; that is, did cancellation occur "
7902 "before the resources were reserved, while they were reserved, or after they "
7903 "were released? Furthermore, some internal data structures (e.g., the linked "
7904 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
7905 "left in an inconsistent state if cancellation occurs in the middle of the "
7906 "function call.  Consequently, clean-up handlers cease to be useful."
7907 msgstr ""
7908 "cancelability type を B<PTHREAD_CANCEL_ASYNCHRONOUS> に設定して役に立つことは"
7909 "めったにない。スレッドはI<いつでも>キャンセルすることができることになるので、"
7910 "スレッドが安全にリソースの確保 (例えば B<malloc>(3) でメモリーを割り当てる) "
7911 "や mutex、セマフォ、ロックなどの獲得を行うことができない。アプリケーション"
7912 "は、スレッドがキャンセルされる際に、これらのリソースがどのような状態にあるか"
7913 "を知る術はないので、リソースの確保が安全ではなくなる。つまり、キャンセルが起"
7914 "こったのが、リソースの確保前なのか、確保中なのか、確保後なのかが分からない。"
7915 "さらに、関数呼び出しの最中にキャンセルが発生すると、いくつかの内部データ構造 "
7916 "(例えば、B<malloc>(3) 関連の関数が管理している未使用ブロックのリンクリスト) "
7917 "が一貫性のない状態のままになってしまう可能性がある。その結果、クリーンアップ"
7918 "ハンドラーが役に立たないものになってしまう。"
7919
7920 #. type: Plain text
7921 #: build/C/man3/pthread_setcancelstate.3:162
7922 msgid ""
7923 "Functions that can be safely asynchronously canceled are called I<async-"
7924 "cancel-safe functions>.  POSIX.1-2001 requires only that "
7925 "B<pthread_cancel>(3), B<pthread_setcancelstate>(), and "
7926 "B<pthread_setcanceltype>()  be async-cancel-safe.  In general, other library "
7927 "functions can't be safely called from an asynchronously cancelable thread."
7928 msgstr ""
7929 "非同期で安全にキャンセルできる関数は I<async-cancel-safe functions> と呼ばれ"
7930 "る。 POSIX.1-2001 で、非同期で安全にキャンセルできるように求められている関数"
7931 "は B<pthread_cancel>(3), B<pthread_setcancelstate>(), "
7932 "B<pthread_setcanceltype>() だけである。 一般的には、それ以外のライブラリ関数"
7933 "は、非同期にキャンセルできるスレッドから安全に呼び出すことはできない。"
7934
7935 #. type: Plain text
7936 #: build/C/man3/pthread_setcancelstate.3:165
7937 msgid ""
7938 "One of the few circumstances in which asynchronous cancelability is useful "
7939 "is for cancellation of a thread that is in a pure compute-bound loop."
7940 msgstr ""
7941 "非同期でのキャンセルが有効な数少ない状況としては、純粋に計算だけを行うループ"
7942 "に入っているスレッドをキャンセルするといった場面がある。"
7943
7944 #. type: SS
7945 #: build/C/man3/pthread_setcancelstate.3:165
7946 #, no-wrap
7947 msgid "Portability notes"
7948 msgstr "移植性に関する注意"
7949
7950 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
7951 #. type: Plain text
7952 #: build/C/man3/pthread_setcancelstate.3:183
7953 msgid ""
7954 "The Linux threading implementations permit the I<oldstate> argument of "
7955 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
7956 "the previous cancelability state is not returned to the caller.  Many other "
7957 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
7958 "does not specify this point, so portable applications should always specify "
7959 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
7960 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
7961 msgstr ""
7962 "Linux のスレッド実装では、 B<pthread_setcancelstate>() の I<oldstate>\n"
7963 "引き数に NULL を指定することを認めている。 NULL が指定された場合、\n"
7964 "変更前の cancelability state の情報が呼び出し側に返されない。\n"
7965 "他の多くの実装でも I<oldstate> 引き数に NULL を指定することを認めて\n"
7966 "いるが、 POSIX.1-2001 ではこの点については規定されていない。\n"
7967 "したがって、移植性が必要なアプリケーションでは常に I<oldstate> に\n"
7968 "NULL 以外の値を指定するようにすべきである。\n"
7969 "B<pthread_setcanceltype>() の I<oldtype> 引き数についても、\n"
7970 "全く同じことが言える。"
7971
7972 #. type: Plain text
7973 #: build/C/man3/pthread_setcancelstate.3:186
7974 msgid "See B<pthread_cancel>(3)."
7975 msgstr "B<pthread_cancel>(3) を参照。"
7976
7977 #. type: Plain text
7978 #: build/C/man3/pthread_setcancelstate.3:191
7979 msgid ""
7980 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7981 "B<pthreads>(7)"
7982 msgstr ""
7983 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7984 "B<pthreads>(7)"
7985
7986 #. type: TH
7987 #: build/C/man3/pthread_setconcurrency.3:25
7988 #, no-wrap
7989 msgid "PTHREAD_SETCONCURRENCY"
7990 msgstr "PTHREAD_SETCONCURRENCY"
7991
7992 #. type: Plain text
7993 #: build/C/man3/pthread_setconcurrency.3:29
7994 msgid ""
7995 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
7996 "level"
7997 msgstr ""
7998 "pthread_setconcurrency, pthread_getconcurrency - 並列処理レベルの設定/取得を"
7999 "行う"
8000
8001 #. type: Plain text
8002 #: build/C/man3/pthread_setconcurrency.3:35
8003 #, no-wrap
8004 msgid ""
8005 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
8006 "B<int pthread_getconcurrency(void);>\n"
8007 msgstr ""
8008 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
8009 "B<int pthread_getconcurrency(void);>\n"
8010
8011 #. type: Plain text
8012 #: build/C/man3/pthread_setconcurrency.3:48
8013 msgid ""
8014 "The B<pthread_setconcurrency>()  function informs the implementation of the "
8015 "application's desired concurrency level, specified in I<new_level>.  The "
8016 "implementation takes this only as a hint: POSIX.1 does not specify the level "
8017 "of concurrency that should be provided as a result of calling "
8018 "B<pthread_setconcurrency>()."
8019 msgstr ""
8020 "B<pthread_setconcurrency>() 関数は、アプリケーションが希望する\n"
8021 "並列処理レベル (concurrency level) をスレッド実装に通知する。\n"
8022 "希望する並列処理レベルは I<new_level> で指定する。\n"
8023 "スレッド実装はこの情報をヒントとしてのみ利用する。\n"
8024 "POSIX.1 では、 B<pthread_setconcurrency>() の呼び出した結果、\n"
8025 "どのような並列度になるべきかは規定されていない。"
8026
8027 #. type: Plain text
8028 #: build/C/man3/pthread_setconcurrency.3:53
8029 msgid ""
8030 "Specifying I<new_level> as 0 instructs the implementation to manage the "
8031 "concurrency level as it deems appropriate."
8032 msgstr ""
8033 "I<new_level> に 0 を指定すると、スレッド実装は並列処理レベルを\n"
8034 "実装側で適切とみなしたレベルに設定するようになる。"
8035
8036 #. type: Plain text
8037 #: build/C/man3/pthread_setconcurrency.3:56
8038 msgid ""
8039 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
8040 "level for this process."
8041 msgstr ""
8042 "B<pthread_getconcurrency>() は、このプロセスの concurrency level\n"
8043 "の現在値を返す。"
8044
8045 #. type: Plain text
8046 #: build/C/man3/pthread_setconcurrency.3:61
8047 msgid ""
8048 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
8049 "nonzero error number."
8050 msgstr ""
8051 "成功すると、 B<pthread_setconcurrency>() は 0 を返す。\n"
8052 "エラーの場合、 0 以外のエラー番号を返す。"
8053
8054 #. type: Plain text
8055 #: build/C/man3/pthread_setconcurrency.3:68
8056 msgid ""
8057 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
8058 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
8059 "B<pthread_setconcurrency>()  has not previously been called."
8060 msgstr ""
8061 "B<pthread_getconcurrency>() は常に成功し、最後の\n"
8062 "B<pthread_getconcurrency>() の呼び出しで設定された \n"
8063 "concurrency level を返す。 B<pthread_getconcurrency>() が\n"
8064 "それまでに一度も呼び出されていない場合は 0 が返る。"
8065
8066 #. type: Plain text
8067 #: build/C/man3/pthread_setconcurrency.3:71
8068 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
8069 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
8070
8071 #. type: Plain text
8072 #: build/C/man3/pthread_setconcurrency.3:75
8073 msgid "I<new_level> is negative."
8074 msgstr "I<new_level> が負である。"
8075
8076 #. type: Plain text
8077 #: build/C/man3/pthread_setconcurrency.3:81
8078 msgid ""
8079 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
8080 "I<new_level> would cause a system resource to be exceeded\")."
8081 msgstr ""
8082 "POSIX.1-2001 には、エラー B<EAGAIN> も記載されている\n"
8083 "(「I<new_level> に指定された値を適用すると、システムリソースが\n"
8084 "超過してしまう」)。"
8085
8086 #. type: Plain text
8087 #: build/C/man3/pthread_setconcurrency.3:83
8088 msgid "These functions are available in glibc since version 2.1."
8089 msgstr "これらの関数は glibc バージョン 2.1 以降で利用できる。"
8090
8091 #. type: Plain text
8092 #: build/C/man3/pthread_setconcurrency.3:90
8093 msgid ""
8094 "The B<pthread_setconcurrency>()  and B<pthread_getconcurrency>()  functions "
8095 "are thread-safe."
8096 msgstr ""
8097 "関数 B<pthread_setconcurrency>() と B<pthread_getconcurrency>() はスレッド"
8098 "セーフである。"
8099
8100 #. type: Plain text
8101 #: build/C/man3/pthread_setconcurrency.3:94
8102 msgid "The default concurrency level is 0."
8103 msgstr "デフォルトの concurrency level は 0 である。"
8104
8105 #. type: Plain text
8106 #: build/C/man3/pthread_setconcurrency.3:101
8107 msgid ""
8108 "Concurrency levels are meaningful only for M:N threading implementations, "
8109 "where at any moment a subset of a process's set of user-level threads may be "
8110 "bound to a smaller number of kernel-scheduling entities.  Setting the "
8111 "concurrency level allows the application to give the system a hint as to the "
8112 "number of kernel-scheduling entities that should be provided for efficient "
8113 "execution of the application."
8114 msgstr ""
8115 "並列処理レベルが意味を持つのは M:N スレッド実装の場合のみである。\n"
8116 "M:N スレッド実装では、ある瞬間において、あるプロセスのユーザーレベルスレッ\n"
8117 "ドの集合のサブ集合が、そのサブ集合のサイズよりも少ない数のカーネルの\n"
8118 "スケジューリング実体 (kernel-scheduling entity) に結び付けられる。\n"
8119 "並列処理レベルを設定すると、そのアプリケーションの効率的な実行に必要な\n"
8120 "カーネルのスケジューリング実体の数のヒントを、アプリケーションはシステ\n"
8121 "ムに伝えることができる。"
8122
8123 #. type: Plain text
8124 #: build/C/man3/pthread_setconcurrency.3:107
8125 msgid ""
8126 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
8127 "concurrency level has no meaning.  In other words, on Linux these functions "
8128 "merely exist for compatibility with other systems, and they have no effect "
8129 "on the execution of a program."
8130 msgstr ""
8131 "LinuxThreads と NPTL のどちらも 1:1 スレッド実装であり、\n"
8132 "並列処理レベルを設定しても何の意味もない。\n"
8133 "言い換えると、 Linux では、これらの関数は、\n"
8134 "他のシステムとの互換性のためだけに存在し、\n"
8135 "プログラムの実行には何の影響も与えないということである。"
8136
8137 #. type: Plain text
8138 #: build/C/man3/pthread_setconcurrency.3:110
8139 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
8140 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
8141
8142 #. type: TH
8143 #: build/C/man3/pthread_setname_np.3:26
8144 #, no-wrap
8145 msgid "PTHREAD_SETNAME_NP"
8146 msgstr "PTHREAD_SETNAME_NP"
8147
8148 #. type: Plain text
8149 #: build/C/man3/pthread_setname_np.3:29
8150 msgid "pthread_setname_np, pthread_getname_np - set/get the name of a thread"
8151 msgstr "pthread_setname_np, pthread_getname_np - スレッド名の設定/取得を行う"
8152
8153 #. type: Plain text
8154 #: build/C/man3/pthread_setname_np.3:36
8155 #, no-wrap
8156 msgid ""
8157 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
8158 "B<#include E<lt>pthread.hE<gt>>\n"
8159 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
8160 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
8161 "B<                       char *>I<name>B<, size_t >I<len>B<);>\n"
8162 msgstr ""
8163 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
8164 "B<#include E<lt>pthread.hE<gt>>\n"
8165 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
8166 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
8167 "B<                       char *>I<name>B<, size_t >I<len>B<);>\n"
8168
8169 #. type: Plain text
8170 #: build/C/man3/pthread_setname_np.3:55
8171 msgid ""
8172 "By default, all the threads created using B<pthread_create>()  inherit the "
8173 "program name.  The B<pthread_setname_np>()  function can be used to set a "
8174 "unique name for a thread, which can be useful for debugging multithreaded "
8175 "applications.  The thread name is a meaningful C language string, whose "
8176 "length is restricted to 16 characters, including the terminating null byte "
8177 "(\\(aq\\e0\\(aq).  The I<thread> argument specifies the thread whose name is "
8178 "to be changed; I<name> specifies the new name."
8179 msgstr ""
8180 "デフォルトでは、 B<pthread_create>() で作成されたすべてのスレッドはプログラム"
8181 "名を継承する。 B<pthread_setname_np>() 関数を使うとスレッドに固有の名前を設定"
8182 "することができる。 スレッド固有の名前はマルチスレッドアプリケーションのデバッ"
8183 "グに便利である。 スレッド名は意味のある C 言語の文字列である。 その長さは 16 "
8184 "文字に限定されており、 終端のヌルバイト (\\(aq\\e0\\(aq) も 16 文字に含まれ"
8185 "る。 I<thread> 引き数で名前を変更するスレッドを指定する。 I<name> には新しい"
8186 "名前を指定する。"
8187
8188 #. type: Plain text
8189 #: build/C/man3/pthread_setname_np.3:72
8190 msgid ""
8191 "The B<pthread_getname_np>()  function can be used to retrieve the name of "
8192 "the thread.  The I<thread> argument specifies the thread whose name is to be "
8193 "retrieved.  The buffer I<name> is used to return the thread name; I<len> "
8194 "specifies the number of bytes available in I<name>.  The buffer specified by "
8195 "I<name> should be at least 16 characters in length.  The returned thread "
8196 "name in the output buffer will be null terminated."
8197 msgstr ""
8198 "B<pthread_getname_np>() 関数を使うと、 スレッド名を取得することができる。 "
8199 "I<thread> 引き数は名前を取得するスレッドを指定する。 バッファー I<name> はス"
8200 "レッド名を返すのに使用される。 I<len> には I<name> の大きさをバイトで指定す"
8201 "る。 I<name> で指定されたバッファーの大きさは最低でも 16 文字とすべきであ"
8202 "る。 出力バッファーに返されたスレッド名はヌル終端される。"
8203
8204 #. type: Plain text
8205 #: build/C/man3/pthread_setname_np.3:79
8206 msgid ""
8207 "The B<pthread_setname_np>()  function can fail with the following error:"
8208 msgstr "B<pthread_setname_np>() は以下のエラーで失敗する場合がある。"
8209
8210 #. type: TP
8211 #: build/C/man3/pthread_setname_np.3:79 build/C/man3/pthread_setname_np.3:88
8212 #, no-wrap
8213 msgid "B<ERANGE>"
8214 msgstr "B<ERANGE>"
8215
8216 #. type: Plain text
8217 #: build/C/man3/pthread_setname_np.3:84
8218 msgid ""
8219 "The length of the string specified pointed to by I<name> exceeds the allowed "
8220 "limit."
8221 msgstr "I<name> で指定された文字列の長さが、許可されている上限を超えている。"
8222
8223 #. type: Plain text
8224 #: build/C/man3/pthread_setname_np.3:88
8225 msgid ""
8226 "The B<pthread_getname_np>()  function can fail with the following error:"
8227 msgstr "B<pthread_getname_np>() は以下のエラーで失敗する場合がある。"
8228
8229 #. type: Plain text
8230 #: build/C/man3/pthread_setname_np.3:95
8231 msgid ""
8232 "The buffer specified by I<name> and I<len> is too small to hold the thread "
8233 "name."
8234 msgstr ""
8235 "I<name> と I<len> で指定されたバッファーが、 スレッド名を格納するには短かすぎ"
8236 "る。"
8237
8238 #. type: Plain text
8239 #: build/C/man3/pthread_setname_np.3:100
8240 msgid ""
8241 "If either of these functions fails to open I</proc/self/task/[tid]/comm>, "
8242 "then the call may fail with one of the errors described in B<open>(2)."
8243 msgstr ""
8244 "I</proc/self/task/[tid]/comm> のオープンに失敗した場合、 これらの関数は "
8245 "B<open>(2) で説明されているエラーのいずれかで失敗する。"
8246
8247 #. type: Plain text
8248 #: build/C/man3/pthread_setname_np.3:102
8249 msgid "These functions first appeared in glibc in version 2.12."
8250 msgstr "これらの関数は glibc バージョン 2.12 で初めて登場した。"
8251
8252 #. type: Plain text
8253 #: build/C/man3/pthread_setname_np.3:104
8254 msgid "These functions are nonstandard GNU extensions."
8255 msgstr "これらの関数は非標準の GNU による拡張である。"
8256
8257 #. type: Plain text
8258 #: build/C/man3/pthread_setname_np.3:114
8259 msgid ""
8260 "B<pthread_setname_np>()  internally writes to the thread-specific I<comm> "
8261 "file under the I</proc> filesystem: I</proc/self/task/[tid]/comm>.  "
8262 "B<pthread_getname_np>()  retrieves it from the same location."
8263 msgstr ""
8264 "B<pthread_setname_np>() は内部で I</proc> ファイルシステムのスレッド固有の "
8265 "I<comm> ファイル (I</proc/self/task/[tid]/comm>) に書き込みを行う。 "
8266 "B<pthread_getname_np>() はこのファイルから読み出しを行う。"
8267
8268 #. type: Plain text
8269 #: build/C/man3/pthread_setname_np.3:120
8270 msgid ""
8271 "The program below demonstrates the use of B<pthread_setname_np>()  and "
8272 "B<pthread_getname_np>()."
8273 msgstr ""
8274 "以下のプログラムは、 B<pthread_setname_np>() と B<pthread_getname_np>()\n"
8275 "の使用例を示している。"
8276
8277 #. type: Plain text
8278 #: build/C/man3/pthread_setname_np.3:122
8279 msgid "The following shell session shows a sample run of the program:"
8280 msgstr "以下のシェルセッションは、このプログラムの実行例である。"
8281
8282 #. type: Plain text
8283 #: build/C/man3/pthread_setname_np.3:138
8284 #, no-wrap
8285 msgid ""
8286 "$B< ./a.out>\n"
8287 "Created a thread. Default name is: a.out\n"
8288 "The thread name after setting it is THREADFOO.\n"
8289 "B<^Z>                           # Suspend the program\n"
8290 "[1]+  Stopped           ./a.out\n"
8291 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
8292 "  PID   TID CMD                         COMMAND\n"
8293 " 5990  5990 ./a.out                     a.out\n"
8294 " 5990  5991 ./a.out                     THREADFOO\n"
8295 "$ B<cat /proc/5990/task/5990/comm>\n"
8296 "a.out\n"
8297 "$ B<cat /proc/5990/task/5991/comm>\n"
8298 "THREADFOO\n"
8299 msgstr ""
8300 "$B< ./a.out>\n"
8301 "Created a thread. Default name is: a.out\n"
8302 "The thread name after setting it is THREADFOO.\n"
8303 "B<^Z>                           # Suspend the program\n"
8304 "[1]+  Stopped           ./a.out\n"
8305 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
8306 "  PID   TID CMD                         COMMAND\n"
8307 " 5990  5990 ./a.out                     a.out\n"
8308 " 5990  5991 ./a.out                     THREADFOO\n"
8309 "$ B<cat /proc/5990/task/5990/comm>\n"
8310 "a.out\n"
8311 "$ B<cat /proc/5990/task/5991/comm>\n"
8312 "THREADFOO\n"
8313
8314 #. type: Plain text
8315 #: build/C/man3/pthread_setname_np.3:150
8316 #, no-wrap
8317 msgid ""
8318 "#define _GNU_SOURCE\n"
8319 "#include E<lt>pthread.hE<gt>\n"
8320 "#include E<lt>stdio.hE<gt>\n"
8321 "#include E<lt>string.hE<gt>\n"
8322 "#include E<lt>unistd.hE<gt>\n"
8323 "#include E<lt>errno.hE<gt>\n"
8324 "#include E<lt>stdlib.hE<gt>\n"
8325 msgstr ""
8326 "#define _GNU_SOURCE\n"
8327 "#include E<lt>pthread.hE<gt>\n"
8328 "#include E<lt>stdio.hE<gt>\n"
8329 "#include E<lt>string.hE<gt>\n"
8330 "#include E<lt>unistd.hE<gt>\n"
8331 "#include E<lt>errno.hE<gt>\n"
8332 "#include E<lt>stdlib.hE<gt>\n"
8333
8334 #. type: Plain text
8335 #: build/C/man3/pthread_setname_np.3:152
8336 #, no-wrap
8337 msgid "#define NAMELEN 16\n"
8338 msgstr "#define NAMELEN 16\n"
8339
8340 #. type: Plain text
8341 #: build/C/man3/pthread_setname_np.3:156
8342 #, no-wrap
8343 msgid ""
8344 "#define errExitEN(en, msg) \\e\n"
8345 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
8346 "        } while (0)\n"
8347 msgstr ""
8348 "#define errExitEN(en, msg) \\e\n"
8349 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
8350 "        } while (0)\n"
8351
8352 #. type: Plain text
8353 #: build/C/man3/pthread_setname_np.3:163
8354 #, no-wrap
8355 msgid ""
8356 "static void *\n"
8357 "threadfunc(void *parm)\n"
8358 "{\n"
8359 "    sleep(5);          // allow main program to set the thread name\n"
8360 "    return NULL;\n"
8361 "}\n"
8362 msgstr ""
8363 "static void *\n"
8364 "threadfunc(void *parm)\n"
8365 "{\n"
8366 "    sleep(5);          // allow main program to set the thread name\n"
8367 "    return NULL;\n"
8368 "}\n"
8369
8370 #. type: Plain text
8371 #: build/C/man3/pthread_setname_np.3:170
8372 #, no-wrap
8373 msgid ""
8374 "int\n"
8375 "main(int argc, char **argv)\n"
8376 "{\n"
8377 "    pthread_t thread;\n"
8378 "    int rc;\n"
8379 "    char thread_name[NAMELEN];\n"
8380 msgstr ""
8381 "int\n"
8382 "main(int argc, char **argv)\n"
8383 "{\n"
8384 "    pthread_t thread;\n"
8385 "    int rc;\n"
8386 "    char thread_name[NAMELEN];\n"
8387
8388 #. type: Plain text
8389 #: build/C/man3/pthread_setname_np.3:174
8390 #, no-wrap
8391 msgid ""
8392 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8393 "    if (rc != 0)\n"
8394 "        errExitEN(rc, \"pthread_create\");\n"
8395 msgstr ""
8396 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8397 "    if (rc != 0)\n"
8398 "        errExitEN(rc, \"pthread_create\");\n"
8399
8400 #. type: Plain text
8401 #: build/C/man3/pthread_setname_np.3:178
8402 #, no-wrap
8403 msgid ""
8404 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8405 "    if (rc != 0)\n"
8406 "        errExitEN(rc, \"pthread_getname_np\");\n"
8407 msgstr ""
8408 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8409 "    if (rc != 0)\n"
8410 "        errExitEN(rc, \"pthread_getname_np\");\n"
8411
8412 #. type: Plain text
8413 #: build/C/man3/pthread_setname_np.3:183
8414 #, no-wrap
8415 msgid ""
8416 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8417 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8418 "    if (rc != 0)\n"
8419 "        errExitEN(rc, \"pthread_setname_np\");\n"
8420 msgstr ""
8421 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8422 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8423 "    if (rc != 0)\n"
8424 "        errExitEN(rc, \"pthread_setname_np\");\n"
8425
8426 #. type: Plain text
8427 #: build/C/man3/pthread_setname_np.3:185
8428 #, no-wrap
8429 msgid "    sleep(2);\n"
8430 msgstr "    sleep(2);\n"
8431
8432 #. type: Plain text
8433 #: build/C/man3/pthread_setname_np.3:191
8434 #, no-wrap
8435 msgid ""
8436 "    rc = pthread_getname_np(thread, thread_name,\n"
8437 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8438 "    if (rc != 0)\n"
8439 "        errExitEN(rc, \"pthread_getname_np\");\n"
8440 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8441 msgstr ""
8442 "    rc = pthread_getname_np(thread, thread_name,\n"
8443 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8444 "    if (rc != 0)\n"
8445 "        errExitEN(rc, \"pthread_getname_np\");\n"
8446 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8447
8448 #. type: Plain text
8449 #: build/C/man3/pthread_setname_np.3:195
8450 #, no-wrap
8451 msgid ""
8452 "    rc = pthread_join(thread, NULL);\n"
8453 "    if (rc != 0)\n"
8454 "        errExitEN(rc, \"pthread_join\");\n"
8455 msgstr ""
8456 "    rc = pthread_join(thread, NULL);\n"
8457 "    if (rc != 0)\n"
8458 "        errExitEN(rc, \"pthread_join\");\n"
8459
8460 #. type: Plain text
8461 #: build/C/man3/pthread_setname_np.3:199
8462 #, no-wrap
8463 msgid ""
8464 "    printf(\"Done\\en\");\n"
8465 "    exit(EXIT_SUCCESS);\n"
8466 "}\n"
8467 msgstr ""
8468 "    printf(\"Done\\en\");\n"
8469 "    exit(EXIT_SUCCESS);\n"
8470 "}\n"
8471
8472 #. type: Plain text
8473 #: build/C/man3/pthread_setname_np.3:206
8474 msgid "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8475 msgstr "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8476
8477 #. type: TH
8478 #: build/C/man3/pthread_setschedparam.3:26
8479 #, no-wrap
8480 msgid "PTHREAD_SETSCHEDPARAM"
8481 msgstr "PTHREAD_SETSCHEDPARAM"
8482
8483 #. type: TH
8484 #: build/C/man3/pthread_setschedparam.3:26
8485 #, no-wrap
8486 msgid "2014-12-31"
8487 msgstr "2014-12-31"
8488
8489 #. type: Plain text
8490 #: build/C/man3/pthread_setschedparam.3:30
8491 msgid ""
8492 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
8493 "parameters of a thread"
8494 msgstr ""
8495 "pthread_setschedparam, pthread_getschedparam - スレッドの\n"
8496 "スケジューリングポリシーとパラメーターを設定/取得する"
8497
8498 #. type: Plain text
8499 #: build/C/man3/pthread_setschedparam.3:38
8500 #, no-wrap
8501 msgid ""
8502 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8503 "B<                          const struct sched_param *>I<param>B<);>\n"
8504 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8505 "B<                          struct sched_param *>I<param>B<);>\n"
8506 msgstr ""
8507 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8508 "B<                          const struct sched_param *>I<param>B<);>\n"
8509 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8510 "B<                          struct sched_param *>I<param>B<);>\n"
8511
8512 #. type: Plain text
8513 #: build/C/man3/pthread_setschedparam.3:46
8514 msgid ""
8515 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
8516 "parameters of the thread I<thread>."
8517 msgstr ""
8518 "B<pthread_setschedparam>() 関数は、スレッド I<thread> の\n"
8519 "スケジューリングポリシーとスケジューリングパラメーターを設定する。"
8520
8521 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
8522 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
8523 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
8524 #. type: Plain text
8525 #: build/C/man3/pthread_setschedparam.3:57
8526 msgid ""
8527 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
8528 "values for I<policy>, and their semantics, are described in B<sched>(7)."
8529 msgstr ""
8530 "I<policy> は I<thread> の新しいスケジューリングポリシーを指定する。 "
8531 "I<policy> に指定できる値とその意味は B<sched>(7) で説明されている。"
8532
8533 #. type: Plain text
8534 #: build/C/man3/pthread_setschedparam.3:63
8535 msgid ""
8536 "The structure pointed to by I<param> specifies the new scheduling parameters "
8537 "for I<thread>.  Scheduling parameters are maintained in the following "
8538 "structure:"
8539 msgstr ""
8540 "I<param> が指す構造体は I<thread> の新しいスケジューリングパラメーターを\n"
8541 "指定する。スケジューリングパラメーターは以下の構造体で管理される。"
8542
8543 #.  FIXME . nptl/pthread_setschedparam.c has the following
8544 #.    /* If the thread should have higher priority because of some
8545 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
8546 #.  Eventually (perhaps after writing the mutexattr pages), we
8547 #.  may want to add something on the topic to this page.
8548 #. type: Plain text
8549 #: build/C/man3/pthread_setschedparam.3:104
8550 msgid ""
8551 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
8552 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
8553 "and I<param>, respectively.  The returned priority value is that set by the "
8554 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
8555 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
8556 "does not reflect any temporary priority adjustments as a result of calls to "
8557 "any priority inheritance or priority ceiling functions (see, for example, "
8558 "B<pthread_mutexattr_setprioceiling>(3)  and "
8559 "B<pthread_mutexattr_setprotocol>(3))."
8560 msgstr ""
8561 "B<pthread_getschedparam>() 関数は、スレッド I<thread> の\n"
8562 "スケジューリングポリシーとパラメーターを、\n"
8563 "それぞれ I<policy> と I<param> が指すバッファーに入れて返す。\n"
8564 "返された優先度の値は、最も最近実行した I<thread> に影響を与える\n"
8565 "B<pthread_setschedparam>(), B<pthread_setschedprio>,\n"
8566 "B<pthread_create> で設定された値となる。\n"
8567 "返された優先度は、優先度の継承や優先度の上限を設定する関数\n"
8568 "(例えば B<pthread_mutexattr_setprioceiling>(3) や\n"
8569 "B<pthread_mutexattr_setprotocol>(3) を参照) の呼び出しの結果\n"
8570 "行われる一時的な優先度の調整の影響を受けない。"
8571
8572 #. type: Plain text
8573 #: build/C/man3/pthread_setschedparam.3:112
8574 msgid ""
8575 "On success, these functions return 0; on error, they return a nonzero error "
8576 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
8577 "parameters of I<thread> are not changed."
8578 msgstr ""
8579 "成功すると、これらの関数は 0 を返す。\n"
8580 "エラーの場合、0 以外のエラー番号を返す。\n"
8581 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
8582 "スケジューリングポリシーとパラメーターは変更されない。"
8583
8584 #. type: Plain text
8585 #: build/C/man3/pthread_setschedparam.3:114
8586 msgid "Both of these functions can fail with the following error:"
8587 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
8588
8589 #. type: Plain text
8590 #: build/C/man3/pthread_setschedparam.3:122
8591 msgid ""
8592 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
8593 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
8594
8595 #. type: Plain text
8596 #: build/C/man3/pthread_setschedparam.3:129
8597 msgid ""
8598 "I<policy> is not a recognized policy, or I<param> does not make sense for "
8599 "the I<policy>."
8600 msgstr ""
8601 "I<policy> が認識できないポリシーであるか、\n"
8602 "I<param> が I<policy> では意味を持たない値である。"
8603
8604 #. type: Plain text
8605 #: build/C/man3/pthread_setschedparam.3:133
8606 msgid ""
8607 "The caller does not have appropriate privileges to set the specified "
8608 "scheduling policy and parameters."
8609 msgstr ""
8610 "呼び出し側が、指定されたスケジューリングポリシーやパラメーターを設定する\n"
8611 "のに必要な特権を持たない。"
8612
8613 #.  .SH VERSIONS
8614 #.  Available since glibc 2.0
8615 #. type: Plain text
8616 #: build/C/man3/pthread_setschedparam.3:141
8617 msgid ""
8618 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
8619 "policy or scheduling parameters to an unsupported value\") error for "
8620 "B<pthread_setschedparam>()."
8621 msgstr ""
8622 "POSIX.1-2001 では、 B<pthread_setschedparam>() に関して\n"
8623 "エラー B<ENOTSUP> (\"サポートされていない値をスケジューリングポリシーや\n"
8624 "パラメーターに設定しようとした\") も追加で規定されている。"
8625
8626 #. type: Plain text
8627 #: build/C/man3/pthread_setschedparam.3:148
8628 msgid ""
8629 "The B<pthread_setschedparam>()  and B<pthread_getschedparam>()  functions "
8630 "are thread-safe."
8631 msgstr ""
8632 "関数 B<pthread_setschedparam>() と B<pthread_getschedparam>() はスレッドセー"
8633 "フである。"
8634
8635 #. type: Plain text
8636 #: build/C/man3/pthread_setschedparam.3:156
8637 msgid ""
8638 "For a description of the permissions required to, and the effect of, "
8639 "changing a thread's scheduling policy and priority, and details of the "
8640 "permitted ranges for priorities in each scheduling policy, see B<sched>(7)."
8641 msgstr ""
8642 "スレッドのスケジューリングポリシーや優先度を変更するために必要な許可や変更し"
8643 "た場合の影響、および各スケジューリングポリシーで認められる優先度の範囲の詳細"
8644 "については、 B<sched>(7) を参照。"
8645
8646 #. type: Plain text
8647 #: build/C/man3/pthread_setschedparam.3:163
8648 msgid ""
8649 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
8650 "B<pthread_getschedparam>(), as well as the use of a number of other "
8651 "scheduling-related pthreads functions."
8652 msgstr ""
8653 "以下のプログラムは B<pthread_setschedparam>() と\n"
8654 "B<pthread_getschedparam>() やスケジューリングに関連する pthreads の\n"
8655 "他のいろいろな関数の使用例を示すものである。"
8656
8657 #. type: Plain text
8658 #: build/C/man3/pthread_setschedparam.3:179
8659 msgid ""
8660 "In the following run, the main thread sets its scheduling policy to "
8661 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
8662 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
8663 "priority attribute of 20.  The program then sets (using "
8664 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
8665 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
8666 "created using this attributes object should take their scheduling attributes "
8667 "from the thread attributes object.  The program then creates a thread using "
8668 "the thread attributes object, and that thread displays its scheduling policy "
8669 "and priority."
8670 msgstr ""
8671 "以下の実行例では、メインスレッドは、自分のスケジューリングポリシーを\n"
8672 "優先度 10 の B<SCHED_FIFO> を設定し、スレッド属性オブジェクトを\n"
8673 "スケジューリングポリシー属性 B<SCHED_RR> とスケジューリング優先度\n"
8674 "属性 20 で初期化する。\n"
8675 "次に、このプログラムは (B<pthread_attr_setinheritsched>(3) を使って) \n"
8676 "そのスレッド属性オブジェクトの inherit scheduler 属性に\n"
8677 "B<PTHREAD_EXPLICIT_SCHED> を設定する。B<PTHREAD_EXPLICIT_SCHED> は、\n"
8678 "そのスレッド属性オブジェクトを使って作成されたスレッドはスレッド属性\n"
8679 "オブジェクトからスケジューリング属性を取得して使うことを意味する。\n"
8680 "それから、このスレッド属性オブジェクトを使ってスレッドを作成し、\n"
8681 "作成したスレッドのスケジューリングポリシーと優先度を表示する。"
8682
8683 #. type: Plain text
8684 #: build/C/man3/pthread_setschedparam.3:187
8685 #, no-wrap
8686 msgid ""
8687 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
8688 "Password:\n"
8689 "# B<./a.out -mf10 -ar20 -i e>\n"
8690 "Scheduler settings of main thread\n"
8691 "    policy=SCHED_FIFO, priority=10\n"
8692 msgstr ""
8693 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
8694 "Password:\n"
8695 "# B<./a.out -mf10 -ar20 -i e>\n"
8696 "Scheduler settings of main thread\n"
8697 "    policy=SCHED_FIFO, priority=10\n"
8698
8699 #. type: Plain text
8700 #: build/C/man3/pthread_setschedparam.3:191
8701 #, no-wrap
8702 msgid ""
8703 "Scheduler settings in \\(aqattr\\(aq\n"
8704 "    policy=SCHED_RR, priority=20\n"
8705 "    inheritsched is EXPLICIT\n"
8706 msgstr ""
8707 "Scheduler settings in \\(aqattr\\(aq\n"
8708 "    policy=SCHED_RR, priority=20\n"
8709 "    inheritsched is EXPLICIT\n"
8710
8711 #. type: Plain text
8712 #: build/C/man3/pthread_setschedparam.3:194
8713 #, no-wrap
8714 msgid ""
8715 "Scheduler attributes of new thread\n"
8716 "    policy=SCHED_RR, priority=20\n"
8717 msgstr ""
8718 "Scheduler attributes of new thread\n"
8719 "    policy=SCHED_RR, priority=20\n"
8720
8721 #. type: Plain text
8722 #: build/C/man3/pthread_setschedparam.3:199
8723 msgid ""
8724 "In the above output, one can see that the scheduling policy and priority "
8725 "were taken from the values specified in the thread attributes object."
8726 msgstr ""
8727 "上記の出力では、スケジューリングポリシーと優先度がスレッド属性\n"
8728 "オブジェクトで指定された値から取られていることが分かる。"
8729
8730 #. type: Plain text
8731 #: build/C/man3/pthread_setschedparam.3:206
8732 msgid ""
8733 "The next run is the same as the previous, except that the inherit scheduler "
8734 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
8735 "using the thread attributes object should ignore the scheduling attributes "
8736 "specified in the attributes object and instead take their scheduling "
8737 "attributes from the creating thread."
8738 msgstr ""
8739 "次の実行例は前のものと同じだが、 inherit scheduler 属性が \n"
8740 "B<PTHREAD_INHERIT_SCHED> に設定される点が異なる。\n"
8741 "B<PTHREAD_INHERIT_SCHED> は、そのスレッド属性オブジェクトを使って作成\n"
8742 "されたスレッドは、スレッド属性オブジェクトからスケジューリング属性を\n"
8743 "無視し、代わりに呼び出したスレッドからスケジューリング属性を取得する\n"
8744 "ことを意味する。"
8745
8746 #. type: Plain text
8747 #: build/C/man3/pthread_setschedparam.3:212
8748 #, no-wrap
8749 msgid ""
8750 "# B<./a.out -mf10 -ar20 -i i>\n"
8751 "Scheduler settings of main thread\n"
8752 "    policy=SCHED_FIFO, priority=10\n"
8753 msgstr ""
8754 "# B<./a.out -mf10 -ar20 -i i>\n"
8755 "Scheduler settings of main thread\n"
8756 "    policy=SCHED_FIFO, priority=10\n"
8757
8758 #. type: Plain text
8759 #: build/C/man3/pthread_setschedparam.3:216
8760 #, no-wrap
8761 msgid ""
8762 "Scheduler settings in \\(aqattr\\(aq\n"
8763 "    policy=SCHED_RR, priority=20\n"
8764 "    inheritsched is INHERIT\n"
8765 msgstr ""
8766 "Scheduler settings in \\(aqattr\\(aq\n"
8767 "    policy=SCHED_RR, priority=20\n"
8768 "    inheritsched is INHERIT\n"
8769
8770 #. type: Plain text
8771 #: build/C/man3/pthread_setschedparam.3:219
8772 #, no-wrap
8773 msgid ""
8774 "Scheduler attributes of new thread\n"
8775 "    policy=SCHED_FIFO, priority=10\n"
8776 msgstr ""
8777 "Scheduler attributes of new thread\n"
8778 "    policy=SCHED_FIFO, priority=10\n"
8779
8780 #. type: Plain text
8781 #: build/C/man3/pthread_setschedparam.3:225
8782 msgid ""
8783 "In the above output, one can see that the scheduling policy and priority "
8784 "were taken from the creating thread, rather than the thread attributes "
8785 "object."
8786 msgstr ""
8787 "上記の出力では、スケジューリングポリシーと優先度が、\n"
8788 "スレッド属性オブジェクトからではなく、\n"
8789 "スレッドを作成したスレッドから取れれていることが分かる。"
8790
8791 #. type: Plain text
8792 #: build/C/man3/pthread_setschedparam.3:231
8793 msgid ""
8794 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
8795 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
8796 "scheduler attribute."
8797 msgstr ""
8798 "なお、 I<-i\\ i> を省略した場合でも、\n"
8799 "B<PTHREAD_INHERIT_SCHED> が inherit scheduler 属性のデフォルト値なので、\n"
8800 "出力は同じになる。"
8801
8802 #. type: Plain text
8803 #: build/C/man3/pthread_setschedparam.3:235
8804 #, no-wrap
8805 msgid "/* pthreads_sched_test.c */\n"
8806 msgstr "/* pthreads_sched_test.c */\n"
8807
8808 #. type: Plain text
8809 #: build/C/man3/pthread_setschedparam.3:241
8810 #, no-wrap
8811 msgid ""
8812 "#include E<lt>pthread.hE<gt>\n"
8813 "#include E<lt>stdio.hE<gt>\n"
8814 "#include E<lt>stdlib.hE<gt>\n"
8815 "#include E<lt>unistd.hE<gt>\n"
8816 "#include E<lt>errno.hE<gt>\n"
8817 msgstr ""
8818 "#include E<lt>pthread.hE<gt>\n"
8819 "#include E<lt>stdio.hE<gt>\n"
8820 "#include E<lt>stdlib.hE<gt>\n"
8821 "#include E<lt>unistd.hE<gt>\n"
8822 "#include E<lt>errno.hE<gt>\n"
8823
8824 #. type: Plain text
8825 #: build/C/man3/pthread_setschedparam.3:250
8826 #, no-wrap
8827 msgid ""
8828 "static void\n"
8829 "usage(char *prog_name, char *msg)\n"
8830 "{\n"
8831 "    if (msg != NULL)\n"
8832 "        fputs(msg, stderr);\n"
8833 msgstr ""
8834 "static void\n"
8835 "usage(char *prog_name, char *msg)\n"
8836 "{\n"
8837 "    if (msg != NULL)\n"
8838 "        fputs(msg, stderr);\n"
8839
8840 #. type: Plain text
8841 #: build/C/man3/pthread_setschedparam.3:267
8842 #, no-wrap
8843 msgid ""
8844 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
8845 "    fprintf(stderr, \"Options are:\\en\");\n"
8846 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
8847 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
8848 "    fpe(\"                 thread attributes object\\en\");\n"
8849 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8850 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8851 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8852 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8853 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8854 "    fpe(\"-i {e|i}         Set inherit scheduler attribute to\\en\");\n"
8855 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8856 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8857 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8858 "    exit(EXIT_FAILURE);\n"
8859 "}\n"
8860 msgstr ""
8861 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
8862 "    fprintf(stderr, \"Options are:\\en\");\n"
8863 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
8864 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
8865 "    fpe(\"                 thread attributes object\\en\");\n"
8866 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8867 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8868 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8869 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8870 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8871 "    fpe(\"-i {e|i}         Set inherit scheduler attribute to\\en\");\n"
8872 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8873 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8874 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8875 "    exit(EXIT_FAILURE);\n"
8876 "}\n"
8877
8878 #. type: Plain text
8879 #: build/C/man3/pthread_setschedparam.3:278
8880 #, no-wrap
8881 msgid ""
8882 "static int\n"
8883 "get_policy(char p, int *policy)\n"
8884 "{\n"
8885 "    switch (p) {\n"
8886 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8887 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8888 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8889 "    default:  return 0;\n"
8890 "    }\n"
8891 "}\n"
8892 msgstr ""
8893 "static int\n"
8894 "get_policy(char p, int *policy)\n"
8895 "{\n"
8896 "    switch (p) {\n"
8897 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8898 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8899 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8900 "    default:  return 0;\n"
8901 "    }\n"
8902 "}\n"
8903
8904 #. type: Plain text
8905 #: build/C/man3/pthread_setschedparam.3:289
8906 #, no-wrap
8907 msgid ""
8908 "static void\n"
8909 "display_sched_attr(int policy, struct sched_param *param)\n"
8910 "{\n"
8911 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8912 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8913 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8914 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8915 "            \"???\",\n"
8916 "            param-E<gt>sched_priority);\n"
8917 "}\n"
8918 msgstr ""
8919 "static void\n"
8920 "display_sched_attr(int policy, struct sched_param *param)\n"
8921 "{\n"
8922 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8923 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8924 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8925 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8926 "            \"???\",\n"
8927 "            param-E<gt>sched_priority);\n"
8928 "}\n"
8929
8930 #. type: Plain text
8931 #: build/C/man3/pthread_setschedparam.3:295
8932 #, no-wrap
8933 msgid ""
8934 "static void\n"
8935 "display_thread_sched_attr(char *msg)\n"
8936 "{\n"
8937 "    int policy, s;\n"
8938 "    struct sched_param param;\n"
8939 msgstr ""
8940 "static void\n"
8941 "display_thread_sched_attr(char *msg)\n"
8942 "{\n"
8943 "    int policy, s;\n"
8944 "    struct sched_param param;\n"
8945
8946 #. type: Plain text
8947 #: build/C/man3/pthread_setschedparam.3:299
8948 #, no-wrap
8949 msgid ""
8950 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8951 "    if (s != 0)\n"
8952 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8953 msgstr ""
8954 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8955 "    if (s != 0)\n"
8956 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8957
8958 #. type: Plain text
8959 #: build/C/man3/pthread_setschedparam.3:303
8960 #, no-wrap
8961 msgid ""
8962 "    printf(\"%s\\en\", msg);\n"
8963 "    display_sched_attr(policy, &param);\n"
8964 "}\n"
8965 msgstr ""
8966 "    printf(\"%s\\en\", msg);\n"
8967 "    display_sched_attr(policy, &param);\n"
8968 "}\n"
8969
8970 #. type: Plain text
8971 #: build/C/man3/pthread_setschedparam.3:308
8972 #, no-wrap
8973 msgid ""
8974 "static void *\n"
8975 "thread_start(void *arg)\n"
8976 "{\n"
8977 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8978 msgstr ""
8979 "static void *\n"
8980 "thread_start(void *arg)\n"
8981 "{\n"
8982 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8983
8984 #. type: Plain text
8985 #: build/C/man3/pthread_setschedparam.3:311
8986 #, no-wrap
8987 msgid ""
8988 "    return NULL;\n"
8989 "}\n"
8990 msgstr ""
8991 "    return NULL;\n"
8992 "}\n"
8993
8994 #. type: Plain text
8995 #: build/C/man3/pthread_setschedparam.3:321
8996 #, no-wrap
8997 msgid ""
8998 "int\n"
8999 "main(int argc, char *argv[])\n"
9000 "{\n"
9001 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
9002 "    pthread_t thread;\n"
9003 "    pthread_attr_t attr;\n"
9004 "    pthread_attr_t *attrp;\n"
9005 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
9006 "    struct sched_param param;\n"
9007 msgstr ""
9008 "int\n"
9009 "main(int argc, char *argv[])\n"
9010 "{\n"
9011 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
9012 "    pthread_t thread;\n"
9013 "    pthread_attr_t attr;\n"
9014 "    pthread_attr_t *attrp;\n"
9015 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
9016 "    struct sched_param param;\n"
9017
9018 #. type: Plain text
9019 #: build/C/man3/pthread_setschedparam.3:323
9020 #, no-wrap
9021 msgid "    /* Process command-line options */\n"
9022 msgstr "    /* Process command-line options */\n"
9023
9024 #. type: Plain text
9025 #: build/C/man3/pthread_setschedparam.3:328
9026 #, no-wrap
9027 msgid ""
9028 "    use_null_attrib = 0;\n"
9029 "    attr_sched_str = NULL;\n"
9030 "    main_sched_str = NULL;\n"
9031 "    inheritsched_str = NULL;\n"
9032 msgstr ""
9033 "    use_null_attrib = 0;\n"
9034 "    attr_sched_str = NULL;\n"
9035 "    main_sched_str = NULL;\n"
9036 "    inheritsched_str = NULL;\n"
9037
9038 #. type: Plain text
9039 #: build/C/man3/pthread_setschedparam.3:338
9040 #, no-wrap
9041 msgid ""
9042 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
9043 "        switch (opt) {\n"
9044 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
9045 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
9046 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
9047 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
9048 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
9049 "        }\n"
9050 "    }\n"
9051 msgstr ""
9052 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
9053 "        switch (opt) {\n"
9054 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
9055 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
9056 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
9057 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
9058 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
9059 "        }\n"
9060 "    }\n"
9061
9062 #. type: Plain text
9063 #: build/C/man3/pthread_setschedparam.3:342
9064 #, no-wrap
9065 msgid ""
9066 "    if (use_null_attrib &&\n"
9067 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
9068 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
9069 msgstr ""
9070 "    if (use_null_attrib &&\n"
9071 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
9072 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
9073
9074 #. type: Plain text
9075 #: build/C/man3/pthread_setschedparam.3:345
9076 #, no-wrap
9077 msgid ""
9078 "    /* Optionally set scheduling attributes of main thread,\n"
9079 "       and display the attributes */\n"
9080 msgstr ""
9081 "    /* Optionally set scheduling attributes of main thread,\n"
9082 "       and display the attributes */\n"
9083
9084 #. type: Plain text
9085 #: build/C/man3/pthread_setschedparam.3:350
9086 #, no-wrap
9087 msgid ""
9088 "    if (main_sched_str != NULL) {\n"
9089 "        if (!get_policy(main_sched_str[0], &policy))\n"
9090 "            usage(argv[0], \"Bad policy for main thread (-m)\\en\");\n"
9091 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
9092 msgstr ""
9093 "    if (main_sched_str != NULL) {\n"
9094 "        if (!get_policy(main_sched_str[0], &policy))\n"
9095 "            usage(argv[0], \"Bad policy for main thread (-m)\\en\");\n"
9096 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
9097
9098 #. type: Plain text
9099 #: build/C/man3/pthread_setschedparam.3:355
9100 #, no-wrap
9101 msgid ""
9102 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
9103 "        if (s != 0)\n"
9104 "            handle_error_en(s, \"pthread_setschedparam\");\n"
9105 "    }\n"
9106 msgstr ""
9107 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
9108 "        if (s != 0)\n"
9109 "            handle_error_en(s, \"pthread_setschedparam\");\n"
9110 "    }\n"
9111
9112 #. type: Plain text
9113 #: build/C/man3/pthread_setschedparam.3:358
9114 #, no-wrap
9115 msgid ""
9116 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
9117 "    printf(\"\\en\");\n"
9118 msgstr ""
9119 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
9120 "    printf(\"\\en\");\n"
9121
9122 #. type: Plain text
9123 #: build/C/man3/pthread_setschedparam.3:360
9124 #, no-wrap
9125 msgid "    /* Initialize thread attributes object according to options */\n"
9126 msgstr "    /* Initialize thread attributes object according to options */\n"
9127
9128 #. type: Plain text
9129 #: build/C/man3/pthread_setschedparam.3:369
9130 #, no-wrap
9131 msgid ""
9132 "    if (!use_null_attrib) {\n"
9133 "        s = pthread_attr_init(&attr);\n"
9134 "        if (s != 0)\n"
9135 "            handle_error_en(s, \"pthread_attr_init\");\n"
9136 "        attrp = &attr;\n"
9137 "    }\n"
9138 msgstr ""
9139 "    if (!use_null_attrib) {\n"
9140 "        s = pthread_attr_init(&attr);\n"
9141 "        if (s != 0)\n"
9142 "            handle_error_en(s, \"pthread_attr_init\");\n"
9143 "        attrp = &attr;\n"
9144 "    }\n"
9145
9146 #. type: Plain text
9147 #: build/C/man3/pthread_setschedparam.3:377
9148 #, no-wrap
9149 msgid ""
9150 "    if (inheritsched_str != NULL) {\n"
9151 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
9152 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
9153 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
9154 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
9155 "        else\n"
9156 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
9157 msgstr ""
9158 "    if (inheritsched_str != NULL) {\n"
9159 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
9160 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
9161 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
9162 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
9163 "        else\n"
9164 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
9165
9166 #. type: Plain text
9167 #: build/C/man3/pthread_setschedparam.3:382
9168 #, no-wrap
9169 msgid ""
9170 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
9171 "        if (s != 0)\n"
9172 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
9173 "    }\n"
9174 msgstr ""
9175 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
9176 "        if (s != 0)\n"
9177 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
9178 "    }\n"
9179
9180 #. type: Plain text
9181 #: build/C/man3/pthread_setschedparam.3:388
9182 #, no-wrap
9183 msgid ""
9184 "    if (attr_sched_str != NULL) {\n"
9185 "        if (!get_policy(attr_sched_str[0], &policy))\n"
9186 "            usage(argv[0],\n"
9187 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
9188 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
9189 msgstr ""
9190 "    if (attr_sched_str != NULL) {\n"
9191 "        if (!get_policy(attr_sched_str[0], &policy))\n"
9192 "            usage(argv[0],\n"
9193 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
9194 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
9195
9196 #. type: Plain text
9197 #: build/C/man3/pthread_setschedparam.3:396
9198 #, no-wrap
9199 msgid ""
9200 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
9201 "        if (s != 0)\n"
9202 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
9203 "        s = pthread_attr_setschedparam(&attr, &param);\n"
9204 "        if (s != 0)\n"
9205 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
9206 "    }\n"
9207 msgstr ""
9208 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
9209 "        if (s != 0)\n"
9210 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
9211 "        s = pthread_attr_setschedparam(&attr, &param);\n"
9212 "        if (s != 0)\n"
9213 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
9214 "    }\n"
9215
9216 #. type: Plain text
9217 #: build/C/man3/pthread_setschedparam.3:399
9218 #, no-wrap
9219 msgid ""
9220 "    /* If we initialized a thread attributes object, display\n"
9221 "       the scheduling attributes that were set in the object */\n"
9222 msgstr ""
9223 "    /* If we initialized a thread attributes object, display\n"
9224 "       the scheduling attributes that were set in the object */\n"
9225
9226 #. type: Plain text
9227 #: build/C/man3/pthread_setschedparam.3:407
9228 #, no-wrap
9229 msgid ""
9230 "    if (attrp != NULL) {\n"
9231 "        s = pthread_attr_getschedparam(&attr, &param);\n"
9232 "        if (s != 0)\n"
9233 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
9234 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
9235 "        if (s != 0)\n"
9236 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
9237 msgstr ""
9238 "    if (attrp != NULL) {\n"
9239 "        s = pthread_attr_getschedparam(&attr, &param);\n"
9240 "        if (s != 0)\n"
9241 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
9242 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
9243 "        if (s != 0)\n"
9244 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
9245
9246 #. type: Plain text
9247 #: build/C/man3/pthread_setschedparam.3:410
9248 #, no-wrap
9249 msgid ""
9250 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
9251 "        display_sched_attr(policy, &param);\n"
9252 msgstr ""
9253 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
9254 "        display_sched_attr(policy, &param);\n"
9255
9256 #. type: Plain text
9257 #: build/C/man3/pthread_setschedparam.3:418
9258 #, no-wrap
9259 msgid ""
9260 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
9261 "        printf(\"    inheritsched is %s\\en\",\n"
9262 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
9263 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
9264 "                \"???\");\n"
9265 "        printf(\"\\en\");\n"
9266 "    }\n"
9267 msgstr ""
9268 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
9269 "        printf(\"    inheritsched is %s\\en\",\n"
9270 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
9271 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
9272 "                \"???\");\n"
9273 "        printf(\"\\en\");\n"
9274 "    }\n"
9275
9276 #. type: Plain text
9277 #: build/C/man3/pthread_setschedparam.3:420
9278 #, no-wrap
9279 msgid "    /* Create a thread that will display its scheduling attributes */\n"
9280 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
9281
9282 #. type: Plain text
9283 #: build/C/man3/pthread_setschedparam.3:424
9284 #, no-wrap
9285 msgid ""
9286 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
9287 "    if (s != 0)\n"
9288 "        handle_error_en(s, \"pthread_create\");\n"
9289 msgstr ""
9290 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
9291 "    if (s != 0)\n"
9292 "        handle_error_en(s, \"pthread_create\");\n"
9293
9294 #. type: Plain text
9295 #: build/C/man3/pthread_setschedparam.3:426
9296 #, no-wrap
9297 msgid "    /* Destroy unneeded thread attributes object */\n"
9298 msgstr "    /* Destroy unneeded thread attributes object */\n"
9299
9300 #. type: Plain text
9301 #: build/C/man3/pthread_setschedparam.3:432
9302 #, no-wrap
9303 msgid ""
9304 "    if (!use_null_attrib) {\n"
9305 "      s = pthread_attr_destroy(&attr);\n"
9306 "      if (s != 0)\n"
9307 "          handle_error_en(s, \"pthread_attr_destroy\");\n"
9308 "    }\n"
9309 msgstr ""
9310 "    if (!use_null_attrib) {\n"
9311 "      s = pthread_attr_destroy(&attr);\n"
9312 "      if (s != 0)\n"
9313 "          handle_error_en(s, \"pthread_attr_destroy\");\n"
9314 "    }\n"
9315
9316 #. type: Plain text
9317 #: build/C/man3/pthread_setschedparam.3:436
9318 #, no-wrap
9319 msgid ""
9320 "    s = pthread_join(thread, NULL);\n"
9321 "    if (s != 0)\n"
9322 "        handle_error_en(s, \"pthread_join\");\n"
9323 msgstr ""
9324 "    s = pthread_join(thread, NULL);\n"
9325 "    if (s != 0)\n"
9326 "        handle_error_en(s, \"pthread_join\");\n"
9327
9328 #. type: Plain text
9329 #: build/C/man3/pthread_setschedparam.3:454
9330 msgid ""
9331 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9332 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9333 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9334 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
9335 msgstr ""
9336 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9337 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9338 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9339 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
9340
9341 #. type: TH
9342 #: build/C/man3/pthread_setschedprio.3:26
9343 #, no-wrap
9344 msgid "PTHREAD_SETSCHEDPRIO"
9345 msgstr "PTHREAD_SETSCHEDPRIO"
9346
9347 #. type: Plain text
9348 #: build/C/man3/pthread_setschedprio.3:29
9349 msgid "pthread_setschedprio - set scheduling priority of a thread"
9350 msgstr "pthread_setschedprio - スレッドのスケジューリング優先度を設定する"
9351
9352 #. type: Plain text
9353 #: build/C/man3/pthread_setschedprio.3:34
9354 #, no-wrap
9355 msgid "B<int pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
9356 msgstr "B<int pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
9357
9358 #.  FIXME . nptl/pthread_setschedprio.c has the following
9359 #.    /* If the thread should have higher priority because of some
9360 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
9361 #.  Eventually (perhaps after writing the mutexattr pages), we
9362 #.  may want to add something on the topic to this page.
9363 #.  nptl/pthread_setschedparam.c has a similar case.
9364 #. type: Plain text
9365 #: build/C/man3/pthread_setschedprio.3:53
9366 msgid ""
9367 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
9368 "thread I<thread> to the value specified in I<prio>.  (By contrast "
9369 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
9370 "of a thread.)"
9371 msgstr ""
9372 "B<pthread_setschedprio>() 関数は、スレッド I<thread> のスケジューリング\n"
9373 "優先度に I<prio> で指定された値を設定する\n"
9374 "(一方、B<pthread_setschedparam>(3) はスレッドのスケジューリングポリシー\n"
9375 "と優先度の両方を変更する)。"
9376
9377 #. type: Plain text
9378 #: build/C/man3/pthread_setschedprio.3:61
9379 msgid ""
9380 "On success, this function returns 0; on error, it returns a nonzero error "
9381 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
9382 "I<thread> is not changed."
9383 msgstr ""
9384 "成功すると、この関数は 0 を返す。\n"
9385 "エラーの場合、0 以外のエラー番号を返す。\n"
9386 "B<pthread_setschedprio>() が失敗した場合、 I<thread> の\n"
9387 "スケジューリング優先度は変更されない。"
9388
9389 #. type: Plain text
9390 #: build/C/man3/pthread_setschedprio.3:66
9391 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
9392 msgstr ""
9393 "指定されたスレッドのスケジューリングポリシーでは、 I<prio> は無効である。"
9394
9395 #. type: Plain text
9396 #: build/C/man3/pthread_setschedprio.3:70
9397 msgid ""
9398 "The caller does not have appropriate privileges to set the specified "
9399 "priority."
9400 msgstr "呼び出し側が、指定された優先度を設定するのに必要な特権を持っていない。"
9401
9402 #. type: Plain text
9403 #: build/C/man3/pthread_setschedprio.3:81
9404 msgid ""
9405 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
9406 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
9407 msgstr ""
9408 "POSIX.1-2001 では、 B<pthread_setschedprio>() に関して\n"
9409 "エラー B<ENOTSUP> (\"サポートされていない値を優先度\n"
9410 "に設定しようとした\") も追加で規定されている。"
9411
9412 #. type: Plain text
9413 #: build/C/man3/pthread_setschedprio.3:83
9414 msgid "This function is available in glibc since version 2.3.4."
9415 msgstr "この関数は glibc バージョン 2.3.4 以降で利用できる。"
9416
9417 #. type: Plain text
9418 #: build/C/man3/pthread_setschedprio.3:88
9419 msgid "The B<pthread_setschedprio>()  function is thread-safe."
9420 msgstr "B<pthread_setschedprio>() 関数はスレッドセーフである。"
9421
9422 #. type: Plain text
9423 #: build/C/man3/pthread_setschedprio.3:96
9424 msgid ""
9425 "For a description of the permissions required to, and the effect of, "
9426 "changing a thread's scheduling priority, and details of the permitted ranges "
9427 "for priorities in each scheduling policy, see B<sched>(7)."
9428 msgstr ""
9429 "スレッドのスケジューリング優先度を変更するために必要な許可や変更した場合の影"
9430 "響、および各スケジューリングポリシーで認められる優先度の範囲の詳細について"
9431 "は、 B<sched>(7) を参照。"
9432
9433 #. type: Plain text
9434 #: build/C/man3/pthread_setschedprio.3:110
9435 msgid ""
9436 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9437 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9438 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9439 "B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
9440 msgstr ""
9441 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9442 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9443 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9444 "B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
9445
9446 #. type: TH
9447 #: build/C/man3/pthread_sigmask.3:26
9448 #, no-wrap
9449 msgid "PTHREAD_SIGMASK"
9450 msgstr "PTHREAD_SIGMASK"
9451
9452 #. type: TH
9453 #: build/C/man3/pthread_sigmask.3:26 build/C/man3/pthread_testcancel.3:26
9454 #, no-wrap
9455 msgid "2014-05-19"
9456 msgstr "2014-05-19"
9457
9458 #. type: Plain text
9459 #: build/C/man3/pthread_sigmask.3:29
9460 msgid "pthread_sigmask - examine and change mask of blocked signals"
9461 msgstr "pthread_sigmask - 禁止するシグナルマスクの確認と変更を行う"
9462
9463 #. type: Plain text
9464 #: build/C/man3/pthread_sigmask.3:35
9465 #, no-wrap
9466 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9467 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9468
9469 #. type: Plain text
9470 #: build/C/man3/pthread_sigmask.3:46
9471 msgid "B<pthread_sigmask>():"
9472 msgstr "B<pthread_sigmask>():"
9473
9474 #. type: Plain text
9475 #: build/C/man3/pthread_sigmask.3:58
9476 msgid ""
9477 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
9478 "difference that its use in multithreaded programs is explicitly specified by "
9479 "POSIX.1-2001.  Other differences are noted in this page."
9480 msgstr ""
9481 "B<pthread_sigmask>() 関数は B<sigprocmask>(2) と全く同様だが、\n"
9482 "マルチスレッドプログラムでの利用が POSIX.1-2001 で明示的に規定されて\n"
9483 "いる点が異なる。他の違いはこのマニュアルページで説明する。"
9484
9485 #. type: Plain text
9486 #: build/C/man3/pthread_sigmask.3:61
9487 msgid ""
9488 "For a description of the arguments and operation of this function, see "
9489 "B<sigprocmask>(2)."
9490 msgstr "この関数の引き数と動作の説明は B<sigprocmask>(2) を参照。"
9491
9492 #. type: Plain text
9493 #: build/C/man3/pthread_sigmask.3:66
9494 msgid ""
9495 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
9496 "number."
9497 msgstr ""
9498 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9499 "エラーの場合、エラー番号を返す。"
9500
9501 #. type: Plain text
9502 #: build/C/man3/pthread_sigmask.3:69
9503 msgid "See B<sigprocmask>(2)."
9504 msgstr "B<sigprocmask>(2) を参照。"
9505
9506 #. type: Plain text
9507 #: build/C/man3/pthread_sigmask.3:74
9508 msgid "The B<pthread_sigmask>()  function is thread-safe."
9509 msgstr "B<pthread_sigmask>() 関数はスレッドセーフである。"
9510
9511 #. type: Plain text
9512 #: build/C/man3/pthread_sigmask.3:78
9513 msgid "A new thread inherits a copy of its creator's signal mask."
9514 msgstr ""
9515 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスクのコピーを\n"
9516 "継承する。"
9517
9518 #. type: Plain text
9519 #: build/C/man3/pthread_sigmask.3:83
9520 msgid ""
9521 "The program below blocks some signals in the main thread, and then creates a "
9522 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
9523 "shell session demonstrates its use:"
9524 msgstr ""
9525 "以下のプログラムは、メインスレッドでシグナルのいくつかを禁止 (block)\n"
9526 "するように設定を行い、 B<sigwait>(3) 経由でそれらのシグナルを集める\n"
9527 "専用のスレッドを作成する。\n"
9528 "下記のシェルのセッションはその利用例を示したものである。"
9529
9530 #. type: Plain text
9531 #: build/C/man3/pthread_sigmask.3:94
9532 #, no-wrap
9533 msgid ""
9534 "$B< ./a.out &>\n"
9535 "[1] 5423\n"
9536 "$B< kill -QUIT %1>\n"
9537 "Signal handling thread got signal 3\n"
9538 "$B< kill -USR1 %1>\n"
9539 "Signal handling thread got signal 10\n"
9540 "$B< kill -TERM %1>\n"
9541 "[1]+  Terminated              ./a.out\n"
9542 msgstr ""
9543 "$B< ./a.out &>\n"
9544 "[1] 5423\n"
9545 "$B< kill -QUIT %1>\n"
9546 "Signal handling thread got signal 3\n"
9547 "$B< kill -USR1 %1>\n"
9548 "Signal handling thread got signal 10\n"
9549 "$B< kill -TERM %1>\n"
9550 "[1]+  Terminated              ./a.out\n"
9551
9552 #. type: Plain text
9553 #: build/C/man3/pthread_sigmask.3:105
9554 #, no-wrap
9555 msgid ""
9556 "#include E<lt>pthread.hE<gt>\n"
9557 "#include E<lt>stdio.hE<gt>\n"
9558 "#include E<lt>stdlib.hE<gt>\n"
9559 "#include E<lt>unistd.hE<gt>\n"
9560 "#include E<lt>signal.hE<gt>\n"
9561 "#include E<lt>errno.hE<gt>\n"
9562 msgstr ""
9563 "#include E<lt>pthread.hE<gt>\n"
9564 "#include E<lt>stdio.hE<gt>\n"
9565 "#include E<lt>stdlib.hE<gt>\n"
9566 "#include E<lt>unistd.hE<gt>\n"
9567 "#include E<lt>signal.hE<gt>\n"
9568 "#include E<lt>errno.hE<gt>\n"
9569
9570 #. type: Plain text
9571 #: build/C/man3/pthread_sigmask.3:107
9572 #, no-wrap
9573 msgid "/* Simple error handling functions */\n"
9574 msgstr "/* Simple error handling functions */\n"
9575
9576 #. type: Plain text
9577 #: build/C/man3/pthread_sigmask.3:116
9578 #, no-wrap
9579 msgid ""
9580 "static void *\n"
9581 "sig_thread(void *arg)\n"
9582 "{\n"
9583 "    sigset_t *set = arg;\n"
9584 "    int s, sig;\n"
9585 msgstr ""
9586 "static void *\n"
9587 "sig_thread(void *arg)\n"
9588 "{\n"
9589 "    sigset_t *set = arg;\n"
9590 "    int s, sig;\n"
9591
9592 #. type: Plain text
9593 #: build/C/man3/pthread_sigmask.3:124
9594 #, no-wrap
9595 msgid ""
9596 "    for (;;) {\n"
9597 "        s = sigwait(set, &sig);\n"
9598 "        if (s != 0)\n"
9599 "            handle_error_en(s, \"sigwait\");\n"
9600 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
9601 "    }\n"
9602 "}\n"
9603 msgstr ""
9604 "    for (;;) {\n"
9605 "        s = sigwait(set, &sig);\n"
9606 "        if (s != 0)\n"
9607 "            handle_error_en(s, \"sigwait\");\n"
9608 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
9609 "    }\n"
9610 "}\n"
9611
9612 #. type: Plain text
9613 #: build/C/man3/pthread_sigmask.3:131
9614 #, no-wrap
9615 msgid ""
9616 "int\n"
9617 "main(int argc, char *argv[])\n"
9618 "{\n"
9619 "    pthread_t thread;\n"
9620 "    sigset_t set;\n"
9621 "    int s;\n"
9622 msgstr ""
9623 "int\n"
9624 "main(int argc, char *argv[])\n"
9625 "{\n"
9626 "    pthread_t thread;\n"
9627 "    sigset_t set;\n"
9628 "    int s;\n"
9629
9630 #. type: Plain text
9631 #: build/C/man3/pthread_sigmask.3:134
9632 #, no-wrap
9633 msgid ""
9634 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
9635 "       will inherit a copy of the signal mask. */\n"
9636 msgstr ""
9637 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
9638 "       will inherit a copy of the signal mask. */\n"
9639
9640 #. type: Plain text
9641 #: build/C/man3/pthread_sigmask.3:141
9642 #, no-wrap
9643 msgid ""
9644 "    sigemptyset(&set);\n"
9645 "    sigaddset(&set, SIGQUIT);\n"
9646 "    sigaddset(&set, SIGUSR1);\n"
9647 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
9648 "    if (s != 0)\n"
9649 "        handle_error_en(s, \"pthread_sigmask\");\n"
9650 msgstr ""
9651 "    sigemptyset(&set);\n"
9652 "    sigaddset(&set, SIGQUIT);\n"
9653 "    sigaddset(&set, SIGUSR1);\n"
9654 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
9655 "    if (s != 0)\n"
9656 "        handle_error_en(s, \"pthread_sigmask\");\n"
9657
9658 #. type: Plain text
9659 #: build/C/man3/pthread_sigmask.3:145
9660 #, no-wrap
9661 msgid ""
9662 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
9663 "    if (s != 0)\n"
9664 "        handle_error_en(s, \"pthread_create\");\n"
9665 msgstr ""
9666 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
9667 "    if (s != 0)\n"
9668 "        handle_error_en(s, \"pthread_create\");\n"
9669
9670 #. type: Plain text
9671 #: build/C/man3/pthread_sigmask.3:148
9672 #, no-wrap
9673 msgid ""
9674 "    /* Main thread carries on to create other threads and/or do\n"
9675 "       other work */\n"
9676 msgstr ""
9677 "    /* Main thread carries on to create other threads and/or do\n"
9678 "       other work */\n"
9679
9680 #. type: Plain text
9681 #: build/C/man3/pthread_sigmask.3:151
9682 #, no-wrap
9683 msgid ""
9684 "    pause();            /* Dummy pause so we can test program */\n"
9685 "}\n"
9686 msgstr ""
9687 "    pause();            /* Dummy pause so we can test program */\n"
9688 "}\n"
9689
9690 #. type: Plain text
9691 #: build/C/man3/pthread_sigmask.3:161
9692 msgid ""
9693 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), "
9694 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
9695 msgstr ""
9696 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), "
9697 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
9698
9699 #. type: TH
9700 #: build/C/man3/pthread_sigqueue.3:25
9701 #, no-wrap
9702 msgid "PTHREAD_SIGQUEUE"
9703 msgstr "PTHREAD_SIGQUEUE"
9704
9705 #. type: Plain text
9706 #: build/C/man3/pthread_sigqueue.3:28
9707 msgid "pthread_sigqueue - queue a signal and data to a thread"
9708 msgstr "pthread_sigqueue - スレッドに対するシグナルとデータをキューに入れる"
9709
9710 #. type: Plain text
9711 #: build/C/man3/pthread_sigqueue.3:32
9712 #, no-wrap
9713 msgid ""
9714 "B<#include E<lt>signal.hE<gt>>\n"
9715 "B<#include E<lt>pthread.hE<gt>>\n"
9716 msgstr ""
9717 "B<#include E<lt>signal.hE<gt>>\n"
9718 "B<#include E<lt>pthread.hE<gt>>\n"
9719
9720 #. type: Plain text
9721 #: build/C/man3/pthread_sigqueue.3:35
9722 #, no-wrap
9723 msgid ""
9724 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
9725 "B<                     const union sigval >I<value>B<);>\n"
9726 msgstr ""
9727 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
9728 "B<                     const union sigval >I<value>B<);>\n"
9729
9730 #. type: Plain text
9731 #: build/C/man3/pthread_sigqueue.3:46
9732 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
9733 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
9734
9735 #. type: Plain text
9736 #: build/C/man3/pthread_sigqueue.3:54
9737 msgid ""
9738 "The B<pthread_sigqueue>()  function performs a similar task to "
9739 "B<sigqueue>(3), but, rather than sending a signal to a process, it sends a "
9740 "signal to a thread in the same process as the calling thread."
9741 msgstr ""
9742 "B<pthread_sigqueue>() 関数は B<sigqueue>(3) と同様の処理を実行するが、\n"
9743 "プロセスにシグナルを送信するのではなく、呼び出したスレッドと\n"
9744 "同じプロセス内のスレッドにシグナルを送信する。"
9745
9746 #. type: Plain text
9747 #: build/C/man3/pthread_sigqueue.3:66
9748 msgid ""
9749 "The I<thread> argument is the ID of a thread in the same process as the "
9750 "caller.  The I<sig> argument specifies the signal to be sent.  The I<value> "
9751 "argument specifies data to accompany the signal; see B<sigqueue>(3)  for "
9752 "details."
9753 msgstr ""
9754 "I<thread> 引き数は、呼び出し側と同じプロセスのスレッドの ID である。\n"
9755 "I<sig> 引き数は送信するシグナルを指定する。\n"
9756 "I<value> 引き数はシグナルと一緒に渡すデータを指定する。\n"
9757 "詳細は B<sigqueue>(3) を参照。"
9758
9759 #. type: Plain text
9760 #: build/C/man3/pthread_sigqueue.3:71
9761 msgid ""
9762 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
9763 "number."
9764 msgstr ""
9765 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9766 "エラーの場合、エラー番号を返す。"
9767
9768 #. type: Plain text
9769 #: build/C/man3/pthread_sigqueue.3:78
9770 msgid ""
9771 "The limit of signals which may be queued has been reached.  (See "
9772 "B<signal>(7)  for further information.)"
9773 msgstr ""
9774 "キューに入れられるシグナル数が上限に達していた\n"
9775 "(詳しい情報は (B<signal>(7) を参照)。"
9776
9777 #. type: Plain text
9778 #: build/C/man3/pthread_sigqueue.3:82
9779 msgid "I<sig> was invalid."
9780 msgstr "I<sig> が無効であった。"
9781
9782 #. type: TP
9783 #: build/C/man3/pthread_sigqueue.3:82
9784 #, no-wrap
9785 msgid "B<ENOSYS>"
9786 msgstr "B<ENOSYS>"
9787
9788 #. type: Plain text
9789 #: build/C/man3/pthread_sigqueue.3:86
9790 msgid "B<pthread_sigqueue>()  is not supported on this system."
9791 msgstr "B<pthread_sigqueue>() がこのシステムではサポートされていない。"
9792
9793 #. type: Plain text
9794 #: build/C/man3/pthread_sigqueue.3:90
9795 msgid "I<thread> is not valid."
9796 msgstr "I<thread> が無効である。"
9797
9798 #. type: Plain text
9799 #: build/C/man3/pthread_sigqueue.3:94
9800 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
9801 msgstr "B<pthread_sigqueue>() 関数は glibc 2.11 で初めて登場した。"
9802
9803 #. type: Plain text
9804 #: build/C/man3/pthread_sigqueue.3:99
9805 msgid "The B<pthread_sigqueue>()  function is thread-safe."
9806 msgstr "B<pthread_sigqueue>() 関数はスレッドセーフである。"
9807
9808 #. type: Plain text
9809 #: build/C/man3/pthread_sigqueue.3:101
9810 msgid "This function is a GNU extension."
9811 msgstr "この関数は GNU による拡張である。"
9812
9813 #. type: Plain text
9814 #: build/C/man3/pthread_sigqueue.3:109
9815 msgid ""
9816 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), "
9817 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
9818 msgstr ""
9819 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
9820 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
9821
9822 #. type: TH
9823 #: build/C/man3/pthread_testcancel.3:26
9824 #, no-wrap
9825 msgid "PTHREAD_TESTCANCEL"
9826 msgstr "PTHREAD_TESTCANCEL"
9827
9828 #. type: Plain text
9829 #: build/C/man3/pthread_testcancel.3:29
9830 msgid ""
9831 "pthread_testcancel - request delivery of any pending cancellation request"
9832 msgstr "pthread_testcancel - 処理待ちの取り消し要求の配送を要求する"
9833
9834 #. type: Plain text
9835 #: build/C/man3/pthread_testcancel.3:34
9836 #, no-wrap
9837 msgid "B<void pthread_testcancel(void);>\n"
9838 msgstr "B<void pthread_testcancel(void);>\n"
9839
9840 #. type: Plain text
9841 #: build/C/man3/pthread_testcancel.3:43
9842 msgid ""
9843 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
9844 "calling thread, so that a thread that is otherwise executing code that "
9845 "contains no cancellation points will respond to a cancellation request."
9846 msgstr ""
9847 "B<pthread_testcancel>() を呼び出すと、呼び出したスレッド内に取り消し\n"
9848 "ポイント (cancellation point) が作成される。\n"
9849 "これにより、これ以外には取り消しポイントを含まないコードを実行して\n"
9850 "いるスレッドが取り消し要求に対応することができるようになる。"
9851
9852 #. type: Plain text
9853 #: build/C/man3/pthread_testcancel.3:50
9854 msgid ""
9855 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
9856 "cancellation request is pending, then a call to B<pthread_testcancel>()  has "
9857 "no effect."
9858 msgstr ""
9859 "(B<pthread_setcancelstate>(3) を使って) キャンセルが無効になっている\n"
9860 "場合や処理待ちの取り消し要求がない場合は、B<pthread_testcancel>() を\n"
9861 "呼び出しても何の影響もない。"
9862
9863 #. type: Plain text
9864 #: build/C/man3/pthread_testcancel.3:54
9865 msgid ""
9866 "This function does not return a value.  If the calling thread is canceled as "
9867 "a consequence of a call to this function, then the function does not return."
9868 msgstr ""
9869 "この関数は値を返さない。この関数の呼び出しの結果、呼び出したスレッドが\n"
9870 "キャンセルされた場合、この関数が返ることはない。"
9871
9872 #. type: Plain text
9873 #: build/C/man3/pthread_testcancel.3:63
9874 msgid "The B<pthread_testcancel>()  function is thread-safe."
9875 msgstr "B<pthread_testcancel>() 関数はスレッドセーフである。"
9876
9877 #. type: Plain text
9878 #: build/C/man3/pthread_testcancel.3:68
9879 msgid "See B<pthread_cleanup_push>(3)."
9880 msgstr "B<pthread_cleanup_push>(3) を参照。"
9881
9882 #. type: Plain text
9883 #: build/C/man3/pthread_testcancel.3:73
9884 msgid ""
9885 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9886 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
9887 msgstr ""
9888 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9889 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
9890
9891 #. type: TH
9892 #: build/C/man3/pthread_tryjoin_np.3:26
9893 #, no-wrap
9894 msgid "PTHREAD_TRYJOIN_NP"
9895 msgstr "PTHREAD_TRYJOIN_NP"
9896
9897 #. type: TH
9898 #: build/C/man3/pthread_tryjoin_np.3:26
9899 #, no-wrap
9900 msgid "2015-01-10"
9901 msgstr "2015-01-10"
9902
9903 #. type: Plain text
9904 #: build/C/man3/pthread_tryjoin_np.3:30
9905 msgid ""
9906 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
9907 "thread"
9908 msgstr ""
9909 "pthread_tryjoin_np, pthread_timedjoin_np - 終了したスレッドの join を\n"
9910 "試みる"
9911
9912 #. type: Plain text
9913 #: build/C/man3/pthread_tryjoin_np.3:36
9914 #, no-wrap
9915 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9916 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9917
9918 #. type: Plain text
9919 #: build/C/man3/pthread_tryjoin_np.3:39
9920 #, no-wrap
9921 msgid ""
9922 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9923 "B<                         const struct timespec *>I<abstime>B<);>\n"
9924 msgstr ""
9925 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9926 "B<                         const struct timespec *>I<abstime>B<);>\n"
9927
9928 #. type: Plain text
9929 #: build/C/man3/pthread_tryjoin_np.3:46
9930 msgid ""
9931 "These functions operate in the same way as B<pthread_join>(3), except for "
9932 "the differences described on this page."
9933 msgstr ""
9934 "これらの関数は B<pthread_join>(3) と同じように動作するが、\n"
9935 "このページで説明する違いがある。"
9936
9937 #. type: Plain text
9938 #: build/C/man3/pthread_tryjoin_np.3:58
9939 msgid ""
9940 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
9941 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
9942 "I<thread> has not yet terminated, then instead of blocking, as is done by "
9943 "B<pthread_join>(3), the call returns an error."
9944 msgstr ""
9945 "B<pthread_tryjoin_np>() 関数は、スレッド I<thread> の非停止\n"
9946 "(nonblocking) での join を実行し、スレッドの終了ステータスを\n"
9947 "I<*retval> に入れて返す。I<thread> がまだ終了していない場合は、\n"
9948 "B<pthread_join>(3) のように停止 (block) せずに、エラーを返す。"
9949
9950 #. type: Plain text
9951 #: build/C/man3/pthread_tryjoin_np.3:76
9952 msgid ""
9953 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
9954 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
9955 "specified in I<abstime>.  If the timeout expires before I<thread> "
9956 "terminates, the call returns an error.  The I<abstime> argument is a "
9957 "structure of the following form, specifying an absolute time measured since "
9958 "the Epoch (see B<time>(2)):"
9959 msgstr ""
9960 "B<pthread_timedjoin_np>() 関数は、タイムアウト付きの join を行う。\n"
9961 "I<thread> がまだ終了していない場合、 I<abstime> で指定された最大時間\n"
9962 "まで停止する。 I<thread> が終了する前にタイムアウト時間が経過した場合は、\n"
9963 "エラーを返す。I<abstime> 引き数は以下に示す構造体であり、\n"
9964 "Epoch (時刻紀元; B<time>(2) 参照) から測った絶対時刻を指定する。"
9965
9966 #. type: Plain text
9967 #: build/C/man3/pthread_tryjoin_np.3:83
9968 #, no-wrap
9969 msgid ""
9970 "struct timespec {\n"
9971 "    time_t tv_sec;     /* seconds */\n"
9972 "    long   tv_nsec;    /* nanoseconds */\n"
9973 "};\n"
9974 msgstr ""
9975 "struct timespec {\n"
9976 "    time_t tv_sec;     /* seconds */\n"
9977 "    long   tv_nsec;    /* nanoseconds */\n"
9978 "};\n"
9979
9980 #. type: Plain text
9981 #: build/C/man3/pthread_tryjoin_np.3:89
9982 msgid ""
9983 "On success, these functions return 0; on error, they return an error number."
9984 msgstr ""
9985 "成功すると、これらの関数は 0 を返す。\n"
9986 "エラーの場合、エラー番号を返す。"
9987
9988 #. type: Plain text
9989 #: build/C/man3/pthread_tryjoin_np.3:94
9990 msgid ""
9991 "These functions can fail with the same errors as B<pthread_join>(3).  "
9992 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
9993 msgstr ""
9994 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
9995 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
9996
9997 #. type: TP
9998 #: build/C/man3/pthread_tryjoin_np.3:94
9999 #, no-wrap
10000 msgid "B<EBUSY>"
10001 msgstr "B<EBUSY>"
10002
10003 #. type: Plain text
10004 #: build/C/man3/pthread_tryjoin_np.3:98
10005 msgid "I<thread> had not yet terminated at the time of the call."
10006 msgstr "呼び出しを行った時点では I<thread> はまだ終了していない。"
10007
10008 #. type: Plain text
10009 #: build/C/man3/pthread_tryjoin_np.3:101
10010 msgid ""
10011 "B<pthread_timedjoin_np>()  can in addition fail with the following errors:"
10012 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
10013
10014 #. type: TP
10015 #: build/C/man3/pthread_tryjoin_np.3:101
10016 #, no-wrap
10017 msgid "B<ETIMEDOUT>"
10018 msgstr "B<ETIMEDOUT>"
10019
10020 #. type: Plain text
10021 #: build/C/man3/pthread_tryjoin_np.3:106
10022 msgid "The call timed out before I<thread> terminated."
10023 msgstr "I<thread> が終了する前に呼び出しがタイムアウトとなった。"
10024
10025 #. type: Plain text
10026 #: build/C/man3/pthread_tryjoin_np.3:114
10027 msgid ""
10028 "I<abstime> value is invalid (I<tv_sec> is less than 0 or I<tv_nsec> is "
10029 "greater than 1e9)."
10030 msgstr ""
10031 "I<abstime> の値が無効である (I<tv_sec> が 0 より小さいか、 I<tv_nsec> 1e9 が"
10032 "より大きい)。"
10033
10034 #. type: Plain text
10035 #: build/C/man3/pthread_tryjoin_np.3:118
10036 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
10037 msgstr "B<pthread_timedjoin_np>() がエラー B<EINTR> を返すことはない。"
10038
10039 #. type: Plain text
10040 #: build/C/man3/pthread_tryjoin_np.3:120
10041 msgid "These functions first appeared in glibc in version 2.3.3."
10042 msgstr "これらの関数は glibc バージョン 2.3.3 で初めて登場した。"
10043
10044 #. type: Plain text
10045 #: build/C/man3/pthread_tryjoin_np.3:125
10046 msgid "The following code waits to join for up to 5 seconds:"
10047 msgstr "以下のコードは、最大 5 秒まで join を待つ。"
10048
10049 #. type: Plain text
10050 #: build/C/man3/pthread_tryjoin_np.3:129
10051 #, no-wrap
10052 msgid ""
10053 "    struct timespec ts;\n"
10054 "    int s;\n"
10055 msgstr ""
10056 "    struct timespec ts;\n"
10057 "    int s;\n"
10058
10059 #. type: Plain text
10060 #: build/C/man3/pthread_tryjoin_np.3:131
10061 #, no-wrap
10062 msgid "    ...\n"
10063 msgstr "    ...\n"
10064
10065 #. type: Plain text
10066 #: build/C/man3/pthread_tryjoin_np.3:135
10067 #, no-wrap
10068 msgid ""
10069 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
10070 "\t/* Handle error */\n"
10071 "    }\n"
10072 msgstr ""
10073 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
10074 "\t/* Handle error */\n"
10075 "    }\n"
10076
10077 #. type: Plain text
10078 #: build/C/man3/pthread_tryjoin_np.3:137
10079 #, no-wrap
10080 msgid "    ts.tv_sec += 5;\n"
10081 msgstr "    ts.tv_sec += 5;\n"
10082
10083 #. type: Plain text
10084 #: build/C/man3/pthread_tryjoin_np.3:142
10085 #, no-wrap
10086 msgid ""
10087 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
10088 "    if (s != 0) {\n"
10089 "        /* Handle error */\n"
10090 "    }\n"
10091 msgstr ""
10092 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
10093 "    if (s != 0) {\n"
10094 "        /* Handle error */\n"
10095 "    }\n"
10096
10097 #. type: Plain text
10098 #: build/C/man3/pthread_tryjoin_np.3:148
10099 msgid ""
10100 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
10101 msgstr ""
10102 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
10103
10104 #. type: TH
10105 #: build/C/man3/pthread_yield.3:25
10106 #, no-wrap
10107 msgid "PTHREAD_YIELD"
10108 msgstr "PTHREAD_YIELD"
10109
10110 #. type: Plain text
10111 #: build/C/man3/pthread_yield.3:28
10112 msgid "pthread_yield - yield the processor"
10113 msgstr "pthread_yield - プロセッサを明け渡す (yield)"
10114
10115 #. type: Plain text
10116 #: build/C/man3/pthread_yield.3:34
10117 #, no-wrap
10118 msgid "B<int pthread_yield(void);>\n"
10119 msgstr "B<int pthread_yield(void);>\n"
10120
10121 #. type: Plain text
10122 #: build/C/man3/pthread_yield.3:44
10123 msgid ""
10124 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
10125 "thread is placed at the end of the run queue for its static priority and "
10126 "another thread is scheduled to run.  For further details, see "
10127 "B<sched_yield>(2)"
10128 msgstr ""
10129 "B<pthread_yield>() を呼び出すと、呼び出したスレッドは CPU を手放す。\n"
10130 "スレッドはそのスレッドの静的優先度の実行キューの末尾に回り、\n"
10131 "別のスレッドが実行されるようにスケジューリングされる。\n"
10132 "詳細は B<sched_yield>(2) を参照。"
10133
10134 #. type: Plain text
10135 #: build/C/man3/pthread_yield.3:49
10136 msgid ""
10137 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
10138 "number."
10139 msgstr ""
10140 "成功すると、 B<pthread_yield>() は 0 を返す。\n"
10141 "エラーの場合、エラー番号を返す。"
10142
10143 #. type: Plain text
10144 #: build/C/man3/pthread_yield.3:53
10145 msgid ""
10146 "On Linux, this call always succeeds (but portable and future-proof "
10147 "applications should nevertheless handle a possible error return)."
10148 msgstr ""
10149 "Linux では、この関数の呼び出しは常に成功する\n"
10150 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
10151 "正のエラーの返り値を処理するようにすべきである)。"
10152
10153 #. type: Plain text
10154 #: build/C/man3/pthread_yield.3:58
10155 msgid "The B<pthread_yield>()  function is thread-safe."
10156 msgstr "B<pthread_yield>() 関数はスレッドセーフである。"
10157
10158 #.  e.g., the BSDs, Tru64, AIX, and Irix.
10159 #. type: Plain text
10160 #: build/C/man3/pthread_yield.3:64
10161 msgid ""
10162 "This call is nonstandard, but present on several other systems.  Use the "
10163 "standardized B<sched_yield>(2)  instead."
10164 msgstr ""
10165 "この関数は非標準だが、他のいくつかのシステムにも存在する。\n"
10166 "代わりに、標準化されている B<sched_yield>(2) を使うこと。"
10167
10168 #. type: Plain text
10169 #: build/C/man3/pthread_yield.3:67
10170 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
10171 msgstr ""
10172 "Linux では、この関数は B<sched_yield>(2) を呼び出す形で実装されている。"
10173
10174 #. type: Plain text
10175 #: build/C/man3/pthread_yield.3:71
10176 msgid "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
10177 msgstr "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
10178
10179 #. type: TH
10180 #: build/C/man7/pthreads.7:26
10181 #, no-wrap
10182 msgid "PTHREADS"
10183 msgstr "PTHREADS"
10184
10185 #. type: Plain text
10186 #: build/C/man7/pthreads.7:29
10187 msgid "pthreads - POSIX threads"
10188 msgstr "pthreads - POSIX スレッド"
10189
10190 #. type: Plain text
10191 #: build/C/man7/pthreads.7:36
10192 msgid ""
10193 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
10194 "programming commonly known as POSIX threads, or Pthreads.  A single process "
10195 "can contain multiple threads, all of which are executing the same program.  "
10196 "These threads share the same global memory (data and heap segments), but "
10197 "each thread has its own stack (automatic variables)."
10198 msgstr ""
10199 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッドプログラ"
10200 "ミングのインターフェース群 (関数、ヘッダーファイル)  を規定している。一つのプ"
10201 "ロセスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行"
10202 "する。 これらのスレッドは同じ大域メモリー (データとヒープ領域) を共有する"
10203 "が、 各スレッドは自分専用のスタック (自動変数) を持つ。"
10204
10205 #. type: Plain text
10206 #: build/C/man7/pthreads.7:39
10207 msgid ""
10208 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
10209 "these attributes are process-wide rather than per-thread):"
10210 msgstr ""
10211 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
10212 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
10213
10214 #. type: IP
10215 #: build/C/man7/pthreads.7:39 build/C/man7/pthreads.7:41
10216 #: build/C/man7/pthreads.7:43 build/C/man7/pthreads.7:45
10217 #: build/C/man7/pthreads.7:47 build/C/man7/pthreads.7:49
10218 #: build/C/man7/pthreads.7:51 build/C/man7/pthreads.7:54
10219 #: build/C/man7/pthreads.7:56 build/C/man7/pthreads.7:59
10220 #: build/C/man7/pthreads.7:65 build/C/man7/pthreads.7:70
10221 #: build/C/man7/pthreads.7:73 build/C/man7/pthreads.7:76
10222 #: build/C/man7/pthreads.7:84 build/C/man7/pthreads.7:88
10223 #: build/C/man7/pthreads.7:91 build/C/man7/pthreads.7:95
10224 #: build/C/man7/pthreads.7:98 build/C/man7/pthreads.7:103
10225 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
10226 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
10227 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
10228 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
10229 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
10230 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
10231 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
10232 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
10233 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
10234 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
10235 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
10236 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
10237 #: build/C/man7/pthreads.7:833
10238 #, no-wrap
10239 msgid "-"
10240 msgstr "-"
10241
10242 #. type: Plain text
10243 #: build/C/man7/pthreads.7:41
10244 msgid "process ID"
10245 msgstr "プロセス ID"
10246
10247 #. type: Plain text
10248 #: build/C/man7/pthreads.7:43
10249 msgid "parent process ID"
10250 msgstr "親プロセス ID"
10251
10252 #. type: Plain text
10253 #: build/C/man7/pthreads.7:45
10254 msgid "process group ID and session ID"
10255 msgstr "プロセスグループ ID とセッション ID"
10256
10257 #. type: Plain text
10258 #: build/C/man7/pthreads.7:47
10259 msgid "controlling terminal"
10260 msgstr "制御端末"
10261
10262 #. type: Plain text
10263 #: build/C/man7/pthreads.7:49
10264 msgid "user and group IDs"
10265 msgstr "ユーザー ID とグループ ID"
10266
10267 #. type: Plain text
10268 #: build/C/man7/pthreads.7:51
10269 msgid "open file descriptors"
10270 msgstr "オープンするファイルディスクリプター"
10271
10272 #. type: Plain text
10273 #: build/C/man7/pthreads.7:54
10274 msgid "record locks (see B<fcntl>(2))"
10275 msgstr "レコードのロック (B<fcntl>(3)  参照)"
10276
10277 #. type: Plain text
10278 #: build/C/man7/pthreads.7:56
10279 msgid "signal dispositions"
10280 msgstr "シグナルの配置"
10281
10282 #. type: Plain text
10283 #: build/C/man7/pthreads.7:59
10284 msgid "file mode creation mask (B<umask>(2))"
10285 msgstr "ファイルモード作成マスク (B<umask>(2))"
10286
10287 #. type: Plain text
10288 #: build/C/man7/pthreads.7:65
10289 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
10290 msgstr ""
10291 "カレントディレクトリ (B<chdir>(2))  とルートディレクトリ (B<chroot>(2))"
10292
10293 #. type: Plain text
10294 #: build/C/man7/pthreads.7:70
10295 msgid ""
10296 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
10297 msgstr ""
10298 "インターバルタイマー (B<setitimer>(2))  と POSIX タイマー "
10299 "(B<timer_create>(2))"
10300
10301 #. type: Plain text
10302 #: build/C/man7/pthreads.7:73
10303 msgid "nice value (B<setpriority>(2))"
10304 msgstr "nice 値 (B<setpriority>(2))"
10305
10306 #. type: Plain text
10307 #: build/C/man7/pthreads.7:76
10308 msgid "resource limits (B<setrlimit>(2))"
10309 msgstr "リソース制限 (B<setrlimit>(2))"
10310
10311 #. type: Plain text
10312 #: build/C/man7/pthreads.7:81
10313 msgid ""
10314 "measurements of the consumption of CPU time (B<times>(2))  and resources "
10315 "(B<getrusage>(2))"
10316 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
10317
10318 #. type: Plain text
10319 #: build/C/man7/pthreads.7:84
10320 msgid ""
10321 "As well as the stack, POSIX.1 specifies that various other attributes are "
10322 "distinct for each thread, including:"
10323 msgstr ""
10324 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
10325 "るかを規定している:"
10326
10327 #. type: Plain text
10328 #: build/C/man7/pthreads.7:88
10329 msgid "thread ID (the I<pthread_t> data type)"
10330 msgstr "スレッド ID (B<pthread_t> データ型)"
10331
10332 #. type: Plain text
10333 #: build/C/man7/pthreads.7:91
10334 msgid "signal mask (B<pthread_sigmask>(3))"
10335 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
10336
10337 #. type: Plain text
10338 #: build/C/man7/pthreads.7:95
10339 msgid "the I<errno> variable"
10340 msgstr "I<errno> 変数"
10341
10342 #. type: Plain text
10343 #: build/C/man7/pthreads.7:98
10344 msgid "alternate signal stack (B<sigaltstack>(2))"
10345 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
10346
10347 #. type: Plain text
10348 #: build/C/man7/pthreads.7:101
10349 msgid "real-time scheduling policy and priority (B<sched>(7))"
10350 msgstr "リアルタイムスケジューリングのポリシーと優先度 (B<sched>(7))"
10351
10352 #. type: Plain text
10353 #: build/C/man7/pthreads.7:103
10354 msgid "The following Linux-specific features are also per-thread:"
10355 msgstr "以下の Linux 特有の機能もスレッド単位である:"
10356
10357 #. type: Plain text
10358 #: build/C/man7/pthreads.7:106
10359 msgid "capabilities (see B<capabilities>(7))"
10360 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
10361
10362 #. type: Plain text
10363 #: build/C/man7/pthreads.7:109
10364 msgid "CPU affinity (B<sched_setaffinity>(2))"
10365 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
10366
10367 #. type: SS
10368 #: build/C/man7/pthreads.7:109
10369 #, no-wrap
10370 msgid "Pthreads function return values"
10371 msgstr "pthreads 関数の返り値"
10372
10373 #. type: Plain text
10374 #: build/C/man7/pthreads.7:116
10375 msgid ""
10376 "Most pthreads functions return 0 on success, and an error number of "
10377 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
10378 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
10379 "the function can never fail with the error B<EINTR>."
10380 msgstr ""
10381 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
10382 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
10383 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
10384 "は決してないと規定している。"
10385
10386 #. type: SS
10387 #: build/C/man7/pthreads.7:116
10388 #, no-wrap
10389 msgid "Thread IDs"
10390 msgstr "スレッド ID"
10391
10392 #. type: Plain text
10393 #: build/C/man7/pthreads.7:130
10394 msgid ""
10395 "Each of the threads in a process has a unique thread identifier (stored in "
10396 "the type I<pthread_t>).  This identifier is returned to the caller of "
10397 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
10398 "using B<pthread_self>(3).  Thread IDs are guaranteed to be unique only "
10399 "within a process.  A thread ID may be reused after a terminated thread has "
10400 "been joined, or a detached thread has terminated.  In all pthreads functions "
10401 "that accept a thread ID as an argument, that ID by definition refers to a "
10402 "thread in the same process as the caller."
10403 msgstr ""
10404 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
10405 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
10406 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
10407 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
10408 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
10409 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
10410 "じプロセス内の一つのスレッドを参照する。"
10411
10412 #. type: SS
10413 #: build/C/man7/pthreads.7:130
10414 #, no-wrap
10415 msgid "Thread-safe functions"
10416 msgstr "スレッドセーフな関数"
10417
10418 #. type: Plain text
10419 #: build/C/man7/pthreads.7:134
10420 msgid ""
10421 "A thread-safe function is one that can be safely (i.e., it will deliver the "
10422 "same results regardless of whether it is)  called from multiple threads at "
10423 "the same time."
10424 msgstr ""
10425 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
10426 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
10427
10428 #. type: Plain text
10429 #: build/C/man7/pthreads.7:138
10430 msgid ""
10431 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
10432 "standard shall be thread-safe, except for the following functions:"
10433 msgstr ""
10434 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
10435 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
10436
10437 #. type: Plain text
10438 #: build/C/man7/pthreads.7:232
10439 #, no-wrap
10440 msgid ""
10441 "asctime()\n"
10442 "basename()\n"
10443 "catgets()\n"
10444 "crypt()\n"
10445 "ctermid() if passed a non-NULL argument\n"
10446 "ctime()\n"
10447 "dbm_clearerr()\n"
10448 "dbm_close()\n"
10449 "dbm_delete()\n"
10450 "dbm_error()\n"
10451 "dbm_fetch()\n"
10452 "dbm_firstkey()\n"
10453 "dbm_nextkey()\n"
10454 "dbm_open()\n"
10455 "dbm_store()\n"
10456 "dirname()\n"
10457 "dlerror()\n"
10458 "drand48()\n"
10459 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10460 "encrypt()\n"
10461 "endgrent()\n"
10462 "endpwent()\n"
10463 "endutxent()\n"
10464 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10465 "ftw()\n"
10466 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10467 "getc_unlocked()\n"
10468 "getchar_unlocked()\n"
10469 "getdate()\n"
10470 "getenv()\n"
10471 "getgrent()\n"
10472 "getgrgid()\n"
10473 "getgrnam()\n"
10474 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10475 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10476 "gethostent()\n"
10477 "getlogin()\n"
10478 "getnetbyaddr()\n"
10479 "getnetbyname()\n"
10480 "getnetent()\n"
10481 "getopt()\n"
10482 "getprotobyname()\n"
10483 "getprotobynumber()\n"
10484 "getprotoent()\n"
10485 "getpwent()\n"
10486 "getpwnam()\n"
10487 "getpwuid()\n"
10488 "getservbyname()\n"
10489 "getservbyport()\n"
10490 "getservent()\n"
10491 "getutxent()\n"
10492 "getutxid()\n"
10493 "getutxline()\n"
10494 "gmtime()\n"
10495 "hcreate()\n"
10496 "hdestroy()\n"
10497 "hsearch()\n"
10498 "inet_ntoa()\n"
10499 "l64a()\n"
10500 "lgamma()\n"
10501 "lgammaf()\n"
10502 "lgammal()\n"
10503 "localeconv()\n"
10504 "localtime()\n"
10505 "lrand48()\n"
10506 "mrand48()\n"
10507 "nftw()\n"
10508 "nl_langinfo()\n"
10509 "ptsname()\n"
10510 "putc_unlocked()\n"
10511 "putchar_unlocked()\n"
10512 "putenv()\n"
10513 "pututxline()\n"
10514 "rand()\n"
10515 "readdir()\n"
10516 "setenv()\n"
10517 "setgrent()\n"
10518 "setkey()\n"
10519 "setpwent()\n"
10520 "setutxent()\n"
10521 "strerror()\n"
10522 "strsignal() [Added in POSIX.1-2008]\n"
10523 "strtok()\n"
10524 "system() [Added in POSIX.1-2008]\n"
10525 "tmpnam() if passed a non-NULL argument\n"
10526 "ttyname()\n"
10527 "unsetenv()\n"
10528 "wcrtomb() if its final argument is NULL\n"
10529 "wcsrtombs() if its final argument is NULL\n"
10530 "wcstombs()\n"
10531 "wctomb()\n"
10532 msgstr ""
10533 "asctime()\n"
10534 "basename()\n"
10535 "catgets()\n"
10536 "crypt()\n"
10537 "ctermid() (NULL でない引き数を渡された場合)\n"
10538 "ctime()\n"
10539 "dbm_clearerr()\n"
10540 "dbm_close()\n"
10541 "dbm_delete()\n"
10542 "dbm_error()\n"
10543 "dbm_fetch()\n"
10544 "dbm_firstkey()\n"
10545 "dbm_nextkey()\n"
10546 "dbm_open()\n"
10547 "dbm_store()\n"
10548 "dirname()\n"
10549 "dlerror()\n"
10550 "drand48()\n"
10551 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10552 "encrypt()\n"
10553 "endgrent()\n"
10554 "endpwent()\n"
10555 "endutxent()\n"
10556 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10557 "ftw()\n"
10558 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10559 "getc_unlocked()\n"
10560 "getchar_unlocked()\n"
10561 "getdate()\n"
10562 "getenv()\n"
10563 "getgrent()\n"
10564 "getgrgid()\n"
10565 "getgrnam()\n"
10566 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10567 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10568 "gethostent()\n"
10569 "getlogin()\n"
10570 "getnetbyaddr()\n"
10571 "getnetbyname()\n"
10572 "getnetent()\n"
10573 "getopt()\n"
10574 "getprotobyname()\n"
10575 "getprotobynumber()\n"
10576 "getprotoent()\n"
10577 "getpwent()\n"
10578 "getpwnam()\n"
10579 "getpwuid()\n"
10580 "getservbyname()\n"
10581 "getservbyport()\n"
10582 "getservent()\n"
10583 "getutxent()\n"
10584 "getutxid()\n"
10585 "getutxline()\n"
10586 "gmtime()\n"
10587 "hcreate()\n"
10588 "hdestroy()\n"
10589 "hsearch()\n"
10590 "inet_ntoa()\n"
10591 "l64a()\n"
10592 "lgamma()\n"
10593 "lgammaf()\n"
10594 "lgammal()\n"
10595 "localeconv()\n"
10596 "localtime()\n"
10597 "lrand48()\n"
10598 "mrand48()\n"
10599 "nftw()\n"
10600 "nl_langinfo()\n"
10601 "ptsname()\n"
10602 "putc_unlocked()\n"
10603 "putchar_unlocked()\n"
10604 "putenv()\n"
10605 "pututxline()\n"
10606 "rand()\n"
10607 "readdir()\n"
10608 "setenv()\n"
10609 "setgrent()\n"
10610 "setkey()\n"
10611 "setpwent()\n"
10612 "setutxent()\n"
10613 "strerror()\n"
10614 "strsignal() [POSIX.1-2008 で追加された]\n"
10615 "strtok()\n"
10616 "system() [POSIX.1-2008 で追加された]\n"
10617 "tmpnam() (NULL でない引き数を渡された場合)\n"
10618 "ttyname()\n"
10619 "unsetenv()\n"
10620 "wcrtomb() (最後の引き数が NULL の場合)\n"
10621 "wcsrtombs() (最後の引き数が NULL の場合)\n"
10622 "wcstombs()\n"
10623 "wctomb()\n"
10624
10625 #. type: SS
10626 #: build/C/man7/pthreads.7:234
10627 #, no-wrap
10628 msgid "Async-cancel-safe functions"
10629 msgstr "async-cancel-safe 関数"
10630
10631 #. type: Plain text
10632 #: build/C/man7/pthreads.7:238
10633 msgid ""
10634 "An async-cancel-safe function is one that can be safely called in an "
10635 "application where asynchronous cancelability is enabled (see "
10636 "B<pthread_setcancelstate>(3))."
10637 msgstr ""
10638 "async-cancel-safe 関数は、\n"
10639 "非同期キャンセル機能が有効になっているアプリケーションで\n"
10640 "安全に呼び出すことができる関数のことである\n"
10641 "(B<pthread_setcancelstate>(3) を参照)。"
10642
10643 #. type: Plain text
10644 #: build/C/man7/pthreads.7:241
10645 msgid ""
10646 "Only the following functions are required to be async-cancel-safe by "
10647 "POSIX.1-2001 and POSIX.1-2008:"
10648 msgstr ""
10649 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
10650 "なければならないとされている。"
10651
10652 #. type: Plain text
10653 #: build/C/man7/pthreads.7:247
10654 #, no-wrap
10655 msgid ""
10656 "pthread_cancel()\n"
10657 "pthread_setcancelstate()\n"
10658 "pthread_setcanceltype()\n"
10659 msgstr ""
10660 "pthread_cancel()\n"
10661 "pthread_setcancelstate()\n"
10662 "pthread_setcanceltype()\n"
10663
10664 #. type: SS
10665 #: build/C/man7/pthreads.7:249
10666 #, no-wrap
10667 msgid "Cancellation points"
10668 msgstr "取り消しポイント (cancellation points)"
10669
10670 #. type: Plain text
10671 #: build/C/man7/pthreads.7:256
10672 msgid ""
10673 "POSIX.1 specifies that certain functions must, and certain other functions "
10674 "may, be cancellation points.  If a thread is cancelable, its cancelability "
10675 "type is deferred, and a cancellation request is pending for the thread, then "
10676 "the thread is canceled when it calls a function that is a cancellation point."
10677 msgstr ""
10678 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
10679 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
10680 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
10681 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
10682 "時点で、そのスレッドのキャンセルが 行われる。"
10683
10684 #. type: Plain text
10685 #: build/C/man7/pthreads.7:259
10686 msgid ""
10687 "The following functions are required to be cancellation points by "
10688 "POSIX.1-2001 and/or POSIX.1-2008:"
10689 msgstr ""
10690 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
10691 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
10692
10693 #. type: Plain text
10694 #: build/C/man7/pthreads.7:322
10695 #, no-wrap
10696 msgid ""
10697 "accept()\n"
10698 "aio_suspend()\n"
10699 "clock_nanosleep()\n"
10700 "close()\n"
10701 "connect()\n"
10702 "creat()\n"
10703 "fcntl() F_SETLKW\n"
10704 "fdatasync()\n"
10705 "fsync()\n"
10706 "getmsg()\n"
10707 "getpmsg()\n"
10708 "lockf() F_LOCK\n"
10709 "mq_receive()\n"
10710 "mq_send()\n"
10711 "mq_timedreceive()\n"
10712 "mq_timedsend()\n"
10713 "msgrcv()\n"
10714 "msgsnd()\n"
10715 "msync()\n"
10716 "nanosleep()\n"
10717 "open()\n"
10718 "openat() [Added in POSIX.1-2008]\n"
10719 "pause()\n"
10720 "poll()\n"
10721 "pread()\n"
10722 "pselect()\n"
10723 "pthread_cond_timedwait()\n"
10724 "pthread_cond_wait()\n"
10725 "pthread_join()\n"
10726 "pthread_testcancel()\n"
10727 "putmsg()\n"
10728 "putpmsg()\n"
10729 "pwrite()\n"
10730 "read()\n"
10731 "readv()\n"
10732 "recv()\n"
10733 "recvfrom()\n"
10734 "recvmsg()\n"
10735 "select()\n"
10736 "sem_timedwait()\n"
10737 "sem_wait()\n"
10738 "send()\n"
10739 "sendmsg()\n"
10740 "sendto()\n"
10741 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
10742 "sigsuspend()\n"
10743 "sigtimedwait()\n"
10744 "sigwait()\n"
10745 "sigwaitinfo()\n"
10746 "sleep()\n"
10747 "system()\n"
10748 "tcdrain()\n"
10749 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10750 "wait()\n"
10751 "waitid()\n"
10752 "waitpid()\n"
10753 "write()\n"
10754 "writev()\n"
10755 msgstr ""
10756 "accept()\n"
10757 "aio_suspend()\n"
10758 "clock_nanosleep()\n"
10759 "close()\n"
10760 "connect()\n"
10761 "creat()\n"
10762 "fcntl() F_SETLKW\n"
10763 "fdatasync()\n"
10764 "fsync()\n"
10765 "getmsg()\n"
10766 "getpmsg()\n"
10767 "lockf() F_LOCK\n"
10768 "mq_receive()\n"
10769 "mq_send()\n"
10770 "mq_timedreceive()\n"
10771 "mq_timedsend()\n"
10772 "msgrcv()\n"
10773 "msgsnd()\n"
10774 "msync()\n"
10775 "nanosleep()\n"
10776 "open()\n"
10777 "openat() [POSIX.1-2008 で追加された]\n"
10778 "pause()\n"
10779 "poll()\n"
10780 "pread()\n"
10781 "pselect()\n"
10782 "pthread_cond_timedwait()\n"
10783 "pthread_cond_wait()\n"
10784 "pthread_join()\n"
10785 "pthread_testcancel()\n"
10786 "putmsg()\n"
10787 "putpmsg()\n"
10788 "pwrite()\n"
10789 "read()\n"
10790 "readv()\n"
10791 "recv()\n"
10792 "recvfrom()\n"
10793 "recvmsg()\n"
10794 "select()\n"
10795 "sem_timedwait()\n"
10796 "sem_wait()\n"
10797 "send()\n"
10798 "sendmsg()\n"
10799 "sendto()\n"
10800 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
10801 "sigsuspend()\n"
10802 "sigtimedwait()\n"
10803 "sigwait()\n"
10804 "sigwaitinfo()\n"
10805 "sleep()\n"
10806 "system()\n"
10807 "tcdrain()\n"
10808 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10809 "wait()\n"
10810 "waitid()\n"
10811 "waitpid()\n"
10812 "write()\n"
10813 "writev()\n"
10814
10815 #. type: Plain text
10816 #: build/C/man7/pthreads.7:327
10817 msgid ""
10818 "The following functions may be cancellation points according to POSIX.1-2001 "
10819 "and/or POSIX.1-2008:"
10820 msgstr ""
10821 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
10822 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
10823
10824 #. type: Plain text
10825 #: build/C/man7/pthreads.7:555
10826 #, no-wrap
10827 msgid ""
10828 "access()\n"
10829 "asctime()\n"
10830 "asctime_r()\n"
10831 "catclose()\n"
10832 "catgets()\n"
10833 "catopen()\n"
10834 "chmod() [Added in POSIX.1-2008]\n"
10835 "chown() [Added in POSIX.1-2008]\n"
10836 "closedir()\n"
10837 "closelog()\n"
10838 "ctermid()\n"
10839 "ctime()\n"
10840 "ctime_r()\n"
10841 "dbm_close()\n"
10842 "dbm_delete()\n"
10843 "dbm_fetch()\n"
10844 "dbm_nextkey()\n"
10845 "dbm_open()\n"
10846 "dbm_store()\n"
10847 "dlclose()\n"
10848 "dlopen()\n"
10849 "dprintf() [Added in POSIX.1-2008]\n"
10850 "endgrent()\n"
10851 "endhostent()\n"
10852 "endnetent()\n"
10853 "endprotoent()\n"
10854 "endpwent()\n"
10855 "endservent()\n"
10856 "endutxent()\n"
10857 "faccessat() [Added in POSIX.1-2008]\n"
10858 "fchmod() [Added in POSIX.1-2008]\n"
10859 "fchmodat() [Added in POSIX.1-2008]\n"
10860 "fchown() [Added in POSIX.1-2008]\n"
10861 "fchownat() [Added in POSIX.1-2008]\n"
10862 "fclose()\n"
10863 "fcntl() (for any value of cmd argument)\n"
10864 "fflush()\n"
10865 "fgetc()\n"
10866 "fgetpos()\n"
10867 "fgets()\n"
10868 "fgetwc()\n"
10869 "fgetws()\n"
10870 "fmtmsg()\n"
10871 "fopen()\n"
10872 "fpathconf()\n"
10873 "fprintf()\n"
10874 "fputc()\n"
10875 "fputs()\n"
10876 "fputwc()\n"
10877 "fputws()\n"
10878 "fread()\n"
10879 "freopen()\n"
10880 "fscanf()\n"
10881 "fseek()\n"
10882 "fseeko()\n"
10883 "fsetpos()\n"
10884 "fstat()\n"
10885 "fstatat() [Added in POSIX.1-2008]\n"
10886 "ftell()\n"
10887 "ftello()\n"
10888 "ftw()\n"
10889 "futimens() [Added in POSIX.1-2008]\n"
10890 "fwprintf()\n"
10891 "fwrite()\n"
10892 "fwscanf()\n"
10893 "getaddrinfo()\n"
10894 "getc()\n"
10895 "getc_unlocked()\n"
10896 "getchar()\n"
10897 "getchar_unlocked()\n"
10898 "getcwd()\n"
10899 "getdate()\n"
10900 "getdelim() [Added in POSIX.1-2008]\n"
10901 "getgrent()\n"
10902 "getgrgid()\n"
10903 "getgrgid_r()\n"
10904 "getgrnam()\n"
10905 "getgrnam_r()\n"
10906 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10907 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10908 "gethostent()\n"
10909 "gethostid()\n"
10910 "gethostname()\n"
10911 "getline() [Added in POSIX.1-2008]\n"
10912 "getlogin()\n"
10913 "getlogin_r()\n"
10914 "getnameinfo()\n"
10915 "getnetbyaddr()\n"
10916 "getnetbyname()\n"
10917 "getnetent()\n"
10918 "getopt() (if opterr is nonzero)\n"
10919 "getprotobyname()\n"
10920 "getprotobynumber()\n"
10921 "getprotoent()\n"
10922 "getpwent()\n"
10923 "getpwnam()\n"
10924 "getpwnam_r()\n"
10925 "getpwuid()\n"
10926 "getpwuid_r()\n"
10927 "gets()\n"
10928 "getservbyname()\n"
10929 "getservbyport()\n"
10930 "getservent()\n"
10931 "getutxent()\n"
10932 "getutxid()\n"
10933 "getutxline()\n"
10934 "getwc()\n"
10935 "getwchar()\n"
10936 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10937 "glob()\n"
10938 "iconv_close()\n"
10939 "iconv_open()\n"
10940 "ioctl()\n"
10941 "link()\n"
10942 "linkat() [Added in POSIX.1-2008]\n"
10943 "lio_listio() [Added in POSIX.1-2008]\n"
10944 "localtime()\n"
10945 "localtime_r()\n"
10946 "lockf() [Added in POSIX.1-2008]\n"
10947 "lseek()\n"
10948 "lstat()\n"
10949 "mkdir() [Added in POSIX.1-2008]\n"
10950 "mkdirat() [Added in POSIX.1-2008]\n"
10951 "mkdtemp() [Added in POSIX.1-2008]\n"
10952 "mkfifo() [Added in POSIX.1-2008]\n"
10953 "mkfifoat() [Added in POSIX.1-2008]\n"
10954 "mknod() [Added in POSIX.1-2008]\n"
10955 "mknodat() [Added in POSIX.1-2008]\n"
10956 "mkstemp()\n"
10957 "mktime()\n"
10958 "nftw()\n"
10959 "opendir()\n"
10960 "openlog()\n"
10961 "pathconf()\n"
10962 "pclose()\n"
10963 "perror()\n"
10964 "popen()\n"
10965 "posix_fadvise()\n"
10966 "posix_fallocate()\n"
10967 "posix_madvise()\n"
10968 "posix_openpt()\n"
10969 "posix_spawn()\n"
10970 "posix_spawnp()\n"
10971 "posix_trace_clear()\n"
10972 "posix_trace_close()\n"
10973 "posix_trace_create()\n"
10974 "posix_trace_create_withlog()\n"
10975 "posix_trace_eventtypelist_getnext_id()\n"
10976 "posix_trace_eventtypelist_rewind()\n"
10977 "posix_trace_flush()\n"
10978 "posix_trace_get_attr()\n"
10979 "posix_trace_get_filter()\n"
10980 "posix_trace_get_status()\n"
10981 "posix_trace_getnext_event()\n"
10982 "posix_trace_open()\n"
10983 "posix_trace_rewind()\n"
10984 "posix_trace_set_filter()\n"
10985 "posix_trace_shutdown()\n"
10986 "posix_trace_timedgetnext_event()\n"
10987 "posix_typed_mem_open()\n"
10988 "printf()\n"
10989 "psiginfo() [Added in POSIX.1-2008]\n"
10990 "psignal() [Added in POSIX.1-2008]\n"
10991 "pthread_rwlock_rdlock()\n"
10992 "pthread_rwlock_timedrdlock()\n"
10993 "pthread_rwlock_timedwrlock()\n"
10994 "pthread_rwlock_wrlock()\n"
10995 "putc()\n"
10996 "putc_unlocked()\n"
10997 "putchar()\n"
10998 "putchar_unlocked()\n"
10999 "puts()\n"
11000 "pututxline()\n"
11001 "putwc()\n"
11002 "putwchar()\n"
11003 "readdir()\n"
11004 "readdir_r()\n"
11005 "readlink() [Added in POSIX.1-2008]\n"
11006 "readlinkat() [Added in POSIX.1-2008]\n"
11007 "remove()\n"
11008 "rename()\n"
11009 "renameat() [Added in POSIX.1-2008]\n"
11010 "rewind()\n"
11011 "rewinddir()\n"
11012 "scandir() [Added in POSIX.1-2008]\n"
11013 "scanf()\n"
11014 "seekdir()\n"
11015 "semop()\n"
11016 "setgrent()\n"
11017 "sethostent()\n"
11018 "setnetent()\n"
11019 "setprotoent()\n"
11020 "setpwent()\n"
11021 "setservent()\n"
11022 "setutxent()\n"
11023 "sigpause() [Added in POSIX.1-2008]\n"
11024 "stat()\n"
11025 "strerror()\n"
11026 "strerror_r()\n"
11027 "strftime()\n"
11028 "symlink()\n"
11029 "symlinkat() [Added in POSIX.1-2008]\n"
11030 "sync()\n"
11031 "syslog()\n"
11032 "tmpfile()\n"
11033 "tmpnam()\n"
11034 "ttyname()\n"
11035 "ttyname_r()\n"
11036 "tzset()\n"
11037 "ungetc()\n"
11038 "ungetwc()\n"
11039 "unlink()\n"
11040 "unlinkat() [Added in POSIX.1-2008]\n"
11041 "utime() [Added in POSIX.1-2008]\n"
11042 "utimensat() [Added in POSIX.1-2008]\n"
11043 "utimes() [Added in POSIX.1-2008]\n"
11044 "vdprintf() [Added in POSIX.1-2008]\n"
11045 "vfprintf()\n"
11046 "vfwprintf()\n"
11047 "vprintf()\n"
11048 "vwprintf()\n"
11049 "wcsftime()\n"
11050 "wordexp()\n"
11051 "wprintf()\n"
11052 "wscanf()\n"
11053 msgstr ""
11054 "access()\n"
11055 "asctime()\n"
11056 "asctime_r()\n"
11057 "catclose()\n"
11058 "catgets()\n"
11059 "catopen()\n"
11060 "chmod() [POSIX.1-2008 で追加された]\n"
11061 "chown() [POSIX.1-2008 で追加された]\n"
11062 "closedir()\n"
11063 "closelog()\n"
11064 "ctermid()\n"
11065 "ctime()\n"
11066 "ctime_r()\n"
11067 "dbm_close()\n"
11068 "dbm_delete()\n"
11069 "dbm_fetch()\n"
11070 "dbm_nextkey()\n"
11071 "dbm_open()\n"
11072 "dbm_store()\n"
11073 "dlclose()\n"
11074 "dlopen()\n"
11075 "dprintf() [POSIX.1-2008 で追加された]\n"
11076 "endgrent()\n"
11077 "endhostent()\n"
11078 "endnetent()\n"
11079 "endprotoent()\n"
11080 "endpwent()\n"
11081 "endservent()\n"
11082 "endutxent()\n"
11083 "faccessat() [POSIX.1-2008 で追加された]\n"
11084 "fchmod() [POSIX.1-2008 で追加された]\n"
11085 "fchmodat() [POSIX.1-2008 で追加された]\n"
11086 "fchown() [POSIX.1-2008 で追加された]\n"
11087 "fchownat() [POSIX.1-2008 で追加された]\n"
11088 "fclose()\n"
11089 "fcntl() (cmd 引き数が何であっても)\n"
11090 "fflush()\n"
11091 "fgetc()\n"
11092 "fgetpos()\n"
11093 "fgets()\n"
11094 "fgetwc()\n"
11095 "fgetws()\n"
11096 "fmtmsg()\n"
11097 "fopen()\n"
11098 "fpathconf()\n"
11099 "fprintf()\n"
11100 "fputc()\n"
11101 "fputs()\n"
11102 "fputwc()\n"
11103 "fputws()\n"
11104 "fread()\n"
11105 "freopen()\n"
11106 "fscanf()\n"
11107 "fseek()\n"
11108 "fseeko()\n"
11109 "fsetpos()\n"
11110 "fstat()\n"
11111 "fstatat() [POSIX.1-2008 で追加された]\n"
11112 "ftell()\n"
11113 "ftello()\n"
11114 "ftw()\n"
11115 "futimens() [POSIX.1-2008 で追加された]\n"
11116 "fwprintf()\n"
11117 "fwrite()\n"
11118 "fwscanf()\n"
11119 "getaddrinfo()\n"
11120 "getc()\n"
11121 "getc_unlocked()\n"
11122 "getchar()\n"
11123 "getchar_unlocked()\n"
11124 "getcwd()\n"
11125 "getdate()\n"
11126 "getdelim() [POSIX.1-2008 で追加された]\n"
11127 "getgrent()\n"
11128 "getgrgid()\n"
11129 "getgrgid_r()\n"
11130 "getgrnam()\n"
11131 "getgrnam_r()\n"
11132 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
11133 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
11134 "gethostent()\n"
11135 "gethostid()\n"
11136 "gethostname()\n"
11137 "getline() [POSIX.1-2008 で追加された]\n"
11138 "getlogin()\n"
11139 "getlogin_r()\n"
11140 "getnameinfo()\n"
11141 "getnetbyaddr()\n"
11142 "getnetbyname()\n"
11143 "getnetent()\n"
11144 "getopt() (opterr が 0 以外の場合)\n"
11145 "getprotobyname()\n"
11146 "getprotobynumber()\n"
11147 "getprotoent()\n"
11148 "getpwent()\n"
11149 "getpwnam()\n"
11150 "getpwnam_r()\n"
11151 "getpwuid()\n"
11152 "getpwuid_r()\n"
11153 "gets()\n"
11154 "getservbyname()\n"
11155 "getservbyport()\n"
11156 "getservent()\n"
11157 "getutxent()\n"
11158 "getutxid()\n"
11159 "getutxline()\n"
11160 "getwc()\n"
11161 "getwchar()\n"
11162 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
11163 "glob()\n"
11164 "iconv_close()\n"
11165 "iconv_open()\n"
11166 "ioctl()\n"
11167 "link()\n"
11168 "linkat() [POSIX.1-2008 で追加された]\n"
11169 "lio_listio() [POSIX.1-2008 で追加された]\n"
11170 "localtime()\n"
11171 "localtime_r()\n"
11172 "lockf() [POSIX.1-2008 で追加された]\n"
11173 "lseek()\n"
11174 "lstat()\n"
11175 "mkdir() [POSIX.1-2008 で追加された]\n"
11176 "mkdirat() [POSIX.1-2008 で追加された]\n"
11177 "mkdtemp() [POSIX.1-2008 で追加された]\n"
11178 "mkfifo() [POSIX.1-2008 で追加された]\n"
11179 "mkfifoat() [POSIX.1-2008 で追加された]\n"
11180 "mknod() [POSIX.1-2008 で追加された]\n"
11181 "mknodat() [POSIX.1-2008 で追加された]\n"
11182 "mkstemp()\n"
11183 "mktime()\n"
11184 "nftw()\n"
11185 "opendir()\n"
11186 "openlog()\n"
11187 "pathconf()\n"
11188 "pclose()\n"
11189 "perror()\n"
11190 "popen()\n"
11191 "posix_fadvise()\n"
11192 "posix_fallocate()\n"
11193 "posix_madvise()\n"
11194 "posix_openpt()\n"
11195 "posix_spawn()\n"
11196 "posix_spawnp()\n"
11197 "posix_trace_clear()\n"
11198 "posix_trace_close()\n"
11199 "posix_trace_create()\n"
11200 "posix_trace_create_withlog()\n"
11201 "posix_trace_eventtypelist_getnext_id()\n"
11202 "posix_trace_eventtypelist_rewind()\n"
11203 "posix_trace_flush()\n"
11204 "posix_trace_get_attr()\n"
11205 "posix_trace_get_filter()\n"
11206 "posix_trace_get_status()\n"
11207 "posix_trace_getnext_event()\n"
11208 "posix_trace_open()\n"
11209 "posix_trace_rewind()\n"
11210 "posix_trace_set_filter()\n"
11211 "posix_trace_shutdown()\n"
11212 "posix_trace_timedgetnext_event()\n"
11213 "posix_typed_mem_open()\n"
11214 "printf()\n"
11215 "psiginfo() [POSIX.1-2008 で追加された]\n"
11216 "psignal() [POSIX.1-2008 で追加された]\n"
11217 "pthread_rwlock_rdlock()\n"
11218 "pthread_rwlock_timedrdlock()\n"
11219 "pthread_rwlock_timedwrlock()\n"
11220 "pthread_rwlock_wrlock()\n"
11221 "putc()\n"
11222 "putc_unlocked()\n"
11223 "putchar()\n"
11224 "putchar_unlocked()\n"
11225 "puts()\n"
11226 "pututxline()\n"
11227 "putwc()\n"
11228 "putwchar()\n"
11229 "readdir()\n"
11230 "readdir_r()\n"
11231 "readlink() [POSIX.1-2008 で追加された]\n"
11232 "readlinkat() [POSIX.1-2008 で追加された]\n"
11233 "remove()\n"
11234 "rename()\n"
11235 "renameat() [POSIX.1-2008 で追加された]\n"
11236 "rewind()\n"
11237 "rewinddir()\n"
11238 "scandir() [POSIX.1-2008 で追加された]\n"
11239 "scanf()\n"
11240 "seekdir()\n"
11241 "semop()\n"
11242 "setgrent()\n"
11243 "sethostent()\n"
11244 "setnetent()\n"
11245 "setprotoent()\n"
11246 "setpwent()\n"
11247 "setservent()\n"
11248 "setutxent()\n"
11249 "sigpause() [POSIX.1-2008 で追加された]\n"
11250 "stat()\n"
11251 "strerror()\n"
11252 "strerror_r()\n"
11253 "strftime()\n"
11254 "symlink()\n"
11255 "symlinkat() [POSIX.1-2008 で追加された]\n"
11256 "sync()\n"
11257 "syslog()\n"
11258 "tmpfile()\n"
11259 "tmpnam()\n"
11260 "ttyname()\n"
11261 "ttyname_r()\n"
11262 "tzset()\n"
11263 "ungetc()\n"
11264 "ungetwc()\n"
11265 "unlink()\n"
11266 "unlinkat() [POSIX.1-2008 で追加された]\n"
11267 "utime() [POSIX.1-2008 で追加された]\n"
11268 "utimensat() [POSIX.1-2008 で追加された]\n"
11269 "utimes() [POSIX.1-2008 で追加された]\n"
11270 "vdprintf() [POSIX.1-2008 で追加された]\n"
11271 "vfprintf()\n"
11272 "vfwprintf()\n"
11273 "vprintf()\n"
11274 "vwprintf()\n"
11275 "wcsftime()\n"
11276 "wordexp()\n"
11277 "wprintf()\n"
11278 "wscanf()\n"
11279
11280 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
11281 #.  files, it looks as though at least the following nonstandard
11282 #.  functions are cancellation points:
11283 #.  endnetgrent
11284 #.  endspent
11285 #.  epoll_pwait
11286 #.  epoll_wait
11287 #.  fcloseall
11288 #.  fdopendir
11289 #.  fflush_unlocked
11290 #.  fgetc_unlocked
11291 #.  fgetgrent
11292 #.  fgetgrent_r
11293 #.  fgetpwent
11294 #.  fgetpwent_r
11295 #.  fgets_unlocked
11296 #.  fgetspent
11297 #.  fgetspent_r
11298 #.  fgetwc_unlocked
11299 #.  fgetws_unlocked
11300 #.  fputc_unlocked
11301 #.  fputs_unlocked
11302 #.  fputwc_unlocked
11303 #.  fputws_unlocked
11304 #.  fread_unlocked
11305 #.  fwrite_unlocked
11306 #.  gai_suspend
11307 #.  getaddrinfo_a
11308 #.  getdate_r
11309 #.  getgrent_r
11310 #.  getgrouplist
11311 #.  gethostbyaddr_r
11312 #.  gethostbyname2
11313 #.  gethostbyname2_r
11314 #.  gethostbyname_r
11315 #.  gethostent_r
11316 #.  getnetbyaddr_r
11317 #.  getnetbyname_r
11318 #.  getnetent_r
11319 #.  getnetgrent
11320 #.  getnetgrent_r
11321 #.  getprotobyname_r
11322 #.  getprotobynumber_r
11323 #.  getprotoent_r
11324 #.  getpw
11325 #.  getpwent_r
11326 #.  getservbyname_r
11327 #.  getservbyport_r
11328 #.  getservent_r
11329 #.  getspent
11330 #.  getspent_r
11331 #.  getspnam
11332 #.  getspnam_r
11333 #.  getutmp
11334 #.  getutmpx
11335 #.  getw
11336 #.  getwc_unlocked
11337 #.  getwchar_unlocked
11338 #.  initgroups
11339 #.  innetgr
11340 #.  mkostemp
11341 #.  mkostemp64
11342 #.  mkstemp64
11343 #.  ppoll
11344 #.  pthread_timedjoin_np
11345 #.  putgrent
11346 #.  putpwent
11347 #.  putspent
11348 #.  putw
11349 #.  putwc_unlocked
11350 #.  putwchar_unlocked
11351 #.  rcmd
11352 #.  rcmd_af
11353 #.  rexec
11354 #.  rexec_af
11355 #.  rresvport
11356 #.  rresvport_af
11357 #.  ruserok
11358 #.  ruserok_af
11359 #.  setnetgrent
11360 #.  setspent
11361 #.  sgetspent
11362 #.  sgetspent_r
11363 #.  updwtmpx
11364 #.  utmpxname
11365 #.  vfscanf
11366 #.  vfwscanf
11367 #.  vscanf
11368 #.  vsyslog
11369 #.  vwscanf
11370 #. type: Plain text
11371 #: build/C/man7/pthreads.7:653
11372 msgid ""
11373 "An implementation may also mark other functions not specified in the "
11374 "standard as cancellation points.  In particular, an implementation is likely "
11375 "to mark any nonstandard function that may block as a cancellation point.  "
11376 "(This includes most functions that can touch files.)"
11377 msgstr ""
11378 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
11379 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
11380 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
11381 "関数がこれに含まれる)。"
11382
11383 #. type: SS
11384 #: build/C/man7/pthreads.7:653
11385 #, no-wrap
11386 msgid "Compiling on Linux"
11387 msgstr "Linux でのコンパイル"
11388
11389 #. type: Plain text
11390 #: build/C/man7/pthreads.7:656
11391 msgid ""
11392 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
11393 "pthread>."
11394 msgstr ""
11395 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
11396 "きである。"
11397
11398 #. type: SS
11399 #: build/C/man7/pthreads.7:656
11400 #, no-wrap
11401 msgid "Linux implementations of POSIX threads"
11402 msgstr "POSIX スレッドの Linux での実装"
11403
11404 #. type: Plain text
11405 #: build/C/man7/pthreads.7:659
11406 msgid ""
11407 "Over time, two threading implementations have been provided by the GNU C "
11408 "library on Linux:"
11409 msgstr ""
11410 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
11411 "た。"
11412
11413 #. type: TP
11414 #: build/C/man7/pthreads.7:659
11415 #, no-wrap
11416 msgid "B<LinuxThreads>"
11417 msgstr "B<LinuxThreads>"
11418
11419 #. type: Plain text
11420 #: build/C/man7/pthreads.7:663
11421 msgid ""
11422 "This is the original Pthreads implementation.  Since glibc 2.4, this "
11423 "implementation is no longer supported."
11424 msgstr ""
11425 "最初の Pthreads の実装。\n"
11426 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
11427
11428 #. type: TP
11429 #: build/C/man7/pthreads.7:663
11430 #, no-wrap
11431 msgid "B<NPTL> (Native POSIX Threads Library)"
11432 msgstr "B<NPTL> (Native POSIX Threads Library)"
11433
11434 #. type: Plain text
11435 #: build/C/man7/pthreads.7:671
11436 msgid ""
11437 "This is the modern Pthreads implementation.  By comparison with "
11438 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
11439 "POSIX.1 specification and better performance when creating large numbers of "
11440 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
11441 "are present in the Linux 2.6 kernel."
11442 msgstr ""
11443 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
11444 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
11445 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
11446 "装されている機能が必要である。"
11447
11448 #. type: Plain text
11449 #: build/C/man7/pthreads.7:681
11450 msgid ""
11451 "Both of these are so-called 1:1 implementations, meaning that each thread "
11452 "maps to a kernel scheduling entity.  Both threading implementations employ "
11453 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
11454 "primitives (mutexes, thread joining, and so on) are implemented using the "
11455 "Linux B<futex>(2)  system call."
11456 msgstr ""
11457 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
11458 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
11459 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
11460 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
11461 "使って実装されている。"
11462
11463 #. type: SS
11464 #: build/C/man7/pthreads.7:681
11465 #, no-wrap
11466 msgid "LinuxThreads"
11467 msgstr "LinuxThreads"
11468
11469 #. type: Plain text
11470 #: build/C/man7/pthreads.7:683
11471 msgid "The notable features of this implementation are the following:"
11472 msgstr "この実装の大きな特徴は以下の通りである:"
11473
11474 #. type: Plain text
11475 #: build/C/man7/pthreads.7:690
11476 msgid ""
11477 "In addition to the main (initial) thread, and the threads that the program "
11478 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
11479 "thread.  This thread handles thread creation and termination.  (Problems can "
11480 "result if this thread is inadvertently killed.)"
11481 msgstr ""
11482 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
11483 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
11484 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
11485 "kill されると、問題が起こることがある)。"
11486
11487 #. type: Plain text
11488 #: build/C/man7/pthreads.7:702
11489 msgid ""
11490 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
11491 "the first three real-time signals are used (see also B<signal>(7)).  On "
11492 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
11493 "avoid the use of whichever set of signals is employed by the implementation."
11494 msgstr ""
11495 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
11496 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
11497 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
11498 "用されているシグナルを どれも使わないようにしなければならない。"
11499
11500 #. type: Plain text
11501 #: build/C/man7/pthreads.7:709
11502 msgid ""
11503 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
11504 "implemented as processes which share more information than usual, but which "
11505 "do not share a common process ID.)  LinuxThreads threads (including the "
11506 "manager thread)  are visible as separate processes using B<ps>(1)."
11507 msgstr ""
11508 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
11509 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
11510 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
11511 "を使うと別のプロセスのように見える。"
11512
11513 #. type: Plain text
11514 #: build/C/man7/pthreads.7:712
11515 msgid ""
11516 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
11517 "number of ways, including the following:"
11518 msgstr ""
11519 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
11520 "示すような点がある:"
11521
11522 #. type: Plain text
11523 #: build/C/man7/pthreads.7:716
11524 msgid "Calls to B<getpid>(2)  return a different value in each thread."
11525 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
11526
11527 #. type: Plain text
11528 #: build/C/man7/pthreads.7:725
11529 msgid ""
11530 "Calls to B<getppid>(2)  in threads other than the main thread return the "
11531 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
11532 "should return the same value as B<getppid>(2)  in the main thread."
11533 msgstr ""
11534 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
11535 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
11536 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
11537
11538 #. type: Plain text
11539 #: build/C/man7/pthreads.7:735
11540 #, fuzzy
11541 #| msgid ""
11542 #| "When one thread creates a new child process using B<fork>(2), any thread "
11543 #| "should be able to B<wait>(2)  on the child.  However, the implementation "
11544 #| "only allows the thread that created the child to B<wait>(2)  on it."
11545 msgid ""
11546 "When one thread creates a new child process using B<fork>(2), any thread "
11547 "should be able to B<wait>(2)  on the child.  However, the implementation "
11548 "allows only the thread that created the child to B<wait>(2)  on it."
11549 msgstr ""
11550 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
11551 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
11552 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
11553 "る。"
11554
11555 #. type: Plain text
11556 #: build/C/man7/pthreads.7:742
11557 msgid ""
11558 "When a thread calls B<execve>(2), all other threads are terminated (as "
11559 "required by POSIX.1).  However, the resulting process has the same PID as "
11560 "the thread that called B<execve>(2): it should have the same PID as the main "
11561 "thread."
11562 msgstr ""
11563 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
11564 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
11565 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
11566 "る。"
11567
11568 #. type: Plain text
11569 #: build/C/man7/pthreads.7:749
11570 msgid ""
11571 "Threads do not share user and group IDs.  This can cause complications with "
11572 "set-user-ID programs and can cause failures in Pthreads functions if an "
11573 "application changes its credentials using B<seteuid>(2)  or similar."
11574 msgstr ""
11575 "スレッド間でユーザー ID とグループ ID が共有されない このことは、set-user-ID "
11576 "プログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを"
11577 "使って信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因とな"
11578 "る。"
11579
11580 #. type: Plain text
11581 #: build/C/man7/pthreads.7:751
11582 msgid "Threads do not share a common session ID and process group ID."
11583 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
11584
11585 #. type: Plain text
11586 #: build/C/man7/pthreads.7:754
11587 msgid "Threads do not share record locks created using B<fcntl>(2)."
11588 msgstr ""
11589 "スレッド間で B<fcntl>(2)  を使って作成されるレコードロックを共有しない。"
11590
11591 #. type: Plain text
11592 #: build/C/man7/pthreads.7:760
11593 msgid ""
11594 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
11595 "rather than process-wide."
11596 msgstr ""
11597 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
11598 "単位の情報である。"
11599
11600 #. type: Plain text
11601 #: build/C/man7/pthreads.7:763
11602 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
11603 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
11604
11605 #. type: Plain text
11606 #: build/C/man7/pthreads.7:765
11607 msgid "Threads do not share interval timers."
11608 msgstr "スレッド間でインターバルタイマーを共有しない。"
11609
11610 #.  FIXME . bug report filed for NPTL nice nonconformance
11611 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
11612 #.  Sep 08: there is a patch by Denys Vlasenko to address this
11613 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
11614 #.  Monitor this to see if it makes it into mainline.
11615 #. type: Plain text
11616 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
11617 msgid "Threads do not share a common nice value."
11618 msgstr "スレッドは共通の nice 値を共有しない。"
11619
11620 #. type: Plain text
11621 #: build/C/man7/pthreads.7:777
11622 msgid ""
11623 "POSIX.1 distinguishes the notions of signals that are directed to the "
11624 "process as a whole and signals that are directed to individual threads.  "
11625 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
11626 "example) should be handled by a single, arbitrarily selected thread within "
11627 "the process.  LinuxThreads does not support the notion of process-directed "
11628 "signals: signals may be sent only to specific threads."
11629 msgstr ""
11630 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
11631 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
11632 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
11633 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
11634 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
11635 "ルは特定のスレッドにだけ送ることができる。"
11636
11637 #. type: Plain text
11638 #: build/C/man7/pthreads.7:786
11639 msgid ""
11640 "Threads have distinct alternate signal stack settings.  However, a new "
11641 "thread's alternate signal stack settings are copied from the thread that "
11642 "created it, so that the threads initially share an alternate signal stack.  "
11643 "(A new thread should start with no alternate signal stack defined.  If two "
11644 "threads handle signals on their shared alternate signal stack at the same "
11645 "time, unpredictable program failures are likely to occur.)"
11646 msgstr ""
11647 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
11648 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
11649 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
11650 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
11651 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
11652 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
11653
11654 #. type: SS
11655 #: build/C/man7/pthreads.7:786
11656 #, no-wrap
11657 msgid "NPTL"
11658 msgstr "NPTL"
11659
11660 #. type: Plain text
11661 #: build/C/man7/pthreads.7:795
11662 msgid ""
11663 "With NPTL, all of the threads in a process are placed in the same thread "
11664 "group; all members of a thread group share the same PID.  NPTL does not "
11665 "employ a manager thread.  NPTL makes internal use of the first two real-time "
11666 "signals (see also B<signal>(7)); these signals cannot be used in "
11667 "applications."
11668 msgstr ""
11669 "NPTL では、一つのプロセスの全てのスレッドは同じスレッドグループ に属する; ス"
11670 "レッドグループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
11671 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
11672 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
11673 "ションでは使用できない。"
11674
11675 #. type: Plain text
11676 #: build/C/man7/pthreads.7:797
11677 msgid "NPTL still has at least one nonconformance with POSIX.1:"
11678 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
11679
11680 #. type: Plain text
11681 #: build/C/man7/pthreads.7:806
11682 msgid "Some NPTL nonconformances occur only with older kernels:"
11683 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
11684
11685 #. type: Plain text
11686 #: build/C/man7/pthreads.7:812
11687 msgid ""
11688 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
11689 "rather than process-wide (fixed in kernel 2.6.9)."
11690 msgstr ""
11691 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
11692 "単位の情報である (カーネル 2.6.9 で修正された)。"
11693
11694 #. type: Plain text
11695 #: build/C/man7/pthreads.7:814
11696 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
11697 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
11698
11699 #. type: Plain text
11700 #: build/C/man7/pthreads.7:816
11701 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
11702 msgstr ""
11703 "スレッド間でインターバルタイマーを共有しない (カーネル 2.6.12 で修正された)。"
11704
11705 #. type: Plain text
11706 #: build/C/man7/pthreads.7:820
11707 msgid ""
11708 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
11709 "(fixed in kernel 2.6.16)."
11710 msgstr ""
11711 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
11712 "きる (カーネル 2.6.16 で修正された)。"
11713
11714 #. type: Plain text
11715 #: build/C/man7/pthreads.7:825
11716 msgid ""
11717 "Only the main thread is permitted to make the process into a process group "
11718 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
11719 msgstr ""
11720 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセスグループ"
11721 "リーダーにすることができる (カーネル 2.6.16 で修正された)。"
11722
11723 #. type: Plain text
11724 #: build/C/man7/pthreads.7:831
11725 msgid ""
11726 "Threads have distinct alternate signal stack settings.  However, a new "
11727 "thread's alternate signal stack settings are copied from the thread that "
11728 "created it, so that the threads initially share an alternate signal stack "
11729 "(fixed in kernel 2.6.16)."
11730 msgstr ""
11731 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
11732 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
11733 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
11734 "ル 2.6.16 で修正された)。"
11735
11736 #. type: Plain text
11737 #: build/C/man7/pthreads.7:833
11738 msgid "Note the following further points about the NPTL implementation:"
11739 msgstr "NPTL の実装では以下の点についても注意すること:"
11740
11741 #. type: Plain text
11742 #: build/C/man7/pthreads.7:847
11743 msgid ""
11744 "If the stack size soft resource limit (see the description of "
11745 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
11746 "I<unlimited>, then this value defines the default stack size for new "
11747 "threads.  To be effective, this limit must be set before the program is "
11748 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
11749 "stacksize> in the C shell)."
11750 msgstr ""
11751 "スタックサイズのリソースのソフトリミット (B<setrlimit>(2)  の "
11752 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
11753 "ソフトリミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設定"
11754 "を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけれ"
11755 "ばならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
11756 "は I<limit stacksize>)  を使って設定する。"
11757
11758 #. type: SS
11759 #: build/C/man7/pthreads.7:847
11760 #, no-wrap
11761 msgid "Determining the threading implementation"
11762 msgstr "スレッド実装の判定"
11763
11764 #. type: Plain text
11765 #: build/C/man7/pthreads.7:852
11766 msgid ""
11767 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
11768 "system's threading implementation, for example:"
11769 msgstr ""
11770 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
11771 "装を判定することができる。 以下に例を示す:"
11772
11773 #. type: Plain text
11774 #: build/C/man7/pthreads.7:857
11775 #, no-wrap
11776 msgid ""
11777 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
11778 "NPTL 2.3.4\n"
11779 msgstr ""
11780 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
11781 "NPTL 2.3.4\n"
11782
11783 #. type: Plain text
11784 #: build/C/man7/pthreads.7:862
11785 msgid ""
11786 "With older glibc versions, a command such as the following should be "
11787 "sufficient to determine the default threading implementation:"
11788 msgstr ""
11789 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
11790 "ド実装を判定することができる。"
11791
11792 #. type: Plain text
11793 #: build/C/man7/pthreads.7:868
11794 #, no-wrap
11795 msgid ""
11796 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
11797 "                egrep -i \\(aqthreads|nptl\\(aq\n"
11798 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
11799 msgstr ""
11800 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
11801 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
11802 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
11803
11804 #. type: SS
11805 #: build/C/man7/pthreads.7:870
11806 #, no-wrap
11807 msgid "Selecting the threading implementation: LD_ASSUME_KERNEL"
11808 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
11809
11810 #. type: Plain text
11811 #: build/C/man7/pthreads.7:885
11812 msgid ""
11813 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
11814 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
11815 "override the dynamic linker's default choice of threading implementation.  "
11816 "This variable tells the dynamic linker to assume that it is running on top "
11817 "of a particular kernel version.  By specifying a kernel version that does "
11818 "not provide the support required by NPTL, we can force the use of "
11819 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
11820 "application that depends on some nonconformant behavior in LinuxThreads.)  "
11821 "For example:"
11822 msgstr ""
11823 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
11824 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカーがデフォル"
11825 "トで 選択するスレッド実装を上書きすることができる。 この変数により、動的リン"
11826 "カーが特定のバージョンのカーネル上で 動作していると仮定するように指定する。 "
11827 "NPTL が必要とするサポート機能を提供していないカーネルバージョンを 指定するこ"
11828 "とで、強制的に LinuxThreads を使うことができる (このようなことをする最もあり"
11829 "そうな場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリ"
11830 "ケーション を動作させる場合だろう)。 以下に例を示す:"
11831
11832 #. type: Plain text
11833 #: build/C/man7/pthreads.7:891
11834 #, no-wrap
11835 msgid ""
11836 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
11837 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|nptl\\(aq\n"
11838 "        linuxthreads-0.10 by Xavier Leroy\n"
11839 msgstr ""
11840 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
11841 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|nptl\\(aq\n"
11842 "        linuxthreads-0.10 by Xavier Leroy\n"
11843
11844 #. type: Plain text
11845 #: build/C/man7/pthreads.7:903
11846 msgid ""
11847 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), "
11848 "B<sigevent>(7), B<signal>(7),"
11849 msgstr ""
11850 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
11851 "B<signal>(7),"
11852
11853 #. type: Plain text
11854 #: build/C/man7/pthreads.7:927
11855 msgid ""
11856 "Various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
11857 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
11858 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
11859 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
11860 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
11861 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), "
11862 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), "
11863 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3), "
11864 "and B<pthread_testcancel>(3)"
11865 msgstr ""
11866 "pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
11867 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
11868 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
11869 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
11870 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
11871 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
11872 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
11873 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
11874 "and B<pthread_testcancel>(3)"