OSDN Git Service

03f70e1efe206c49978d03c38184bb52409bc68a
[linuxjm/LDP_man-pages.git] / po4a / pthread / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2015-01-23 22:22+0900\n"
10 "PO-Revision-Date: 2015-01-23 22:36+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 msgid ""
700 "This page is part of release 3.78 of the Linux I<man-pages> project.  A "
701 "description of the project, information about reporting bugs, and the latest "
702 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
703 "pages/."
704 msgstr ""
705 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.78 の一部\n"
706 "である。プロジェクトの説明とバグ報告に関する情報は\n"
707 "http://www.kernel.org/doc/man-pages/ に書かれている。"
708
709 #. type: TH
710 #: build/C/man3/makecontext.3:28
711 #, no-wrap
712 msgid "MAKECONTEXT"
713 msgstr "MAKECONTEXT"
714
715 #. type: TH
716 #: build/C/man3/makecontext.3:28 build/C/man3/pthread_attr_setaffinity_np.3:26
717 #: build/C/man3/pthread_attr_setdetachstate.3:26
718 #: build/C/man3/pthread_attr_setguardsize.3:26
719 #: build/C/man3/pthread_attr_setscope.3:26
720 #: build/C/man3/pthread_attr_setstack.3:26
721 #: build/C/man3/pthread_attr_setstackaddr.3:26
722 #: build/C/man3/pthread_attr_setstacksize.3:26
723 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
724 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_setname_np.3:26
725 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigqueue.3:25
726 #, no-wrap
727 msgid "2014-05-28"
728 msgstr "2014-05-28"
729
730 #. type: TH
731 #: build/C/man3/makecontext.3:28
732 #, no-wrap
733 msgid "GNU"
734 msgstr "GNU"
735
736 #. type: Plain text
737 #: build/C/man3/makecontext.3:31
738 msgid "makecontext, swapcontext - manipulate user context"
739 msgstr "makecontext, swapcontext - ユーザコンテキストを操作する"
740
741 #. type: Plain text
742 #: build/C/man3/makecontext.3:36
743 msgid ""
744 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
745 ">I<argc>B<, ...);>"
746 msgstr ""
747 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
748 ">I<argc>B<, ...);>"
749
750 #. type: Plain text
751 #: build/C/man3/makecontext.3:38
752 msgid ""
753 "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
754 msgstr ""
755 "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
756
757 #. type: Plain text
758 #: build/C/man3/makecontext.3:49
759 msgid ""
760 "In a System V-like environment, one has the type I<ucontext_t> defined in "
761 "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(3), "
762 "B<setcontext>(3), B<makecontext>()  and B<swapcontext>()  that allow user-"
763 "level context switching between multiple threads of control within a process."
764 msgstr ""
765 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
766 "と、 B<getcontext>(3), B<setcontext>(3), B<makecontext>(), B<swapcontext>()  "
767 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
768 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
769 "ようになっている。"
770
771 #. type: Plain text
772 #: build/C/man3/makecontext.3:52
773 msgid "For the type and the first two functions, see B<getcontext>(3)."
774 msgstr ""
775 "これらの型と、最初の 2 つの関数については、 B<getcontext>(3) を参照のこと。"
776
777 #. type: Plain text
778 #: build/C/man3/makecontext.3:64
779 msgid ""
780 "The B<makecontext>()  function modifies the context pointed to by I<ucp> "
781 "(which was obtained from a call to B<getcontext>(3)).  Before invoking "
782 "B<makecontext>(), the caller must allocate a new stack for this context and "
783 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
784 "and assign its address to I<ucp-E<gt>uc_link>."
785 msgstr ""
786 "B<makecontext>()  関数は、ポインタ I<ucp> が指すコンテキストを変更する "
787 "(I<ucp> は以前の B<getcontext>(3)  呼び出しで得られたものである)。 "
788 "B<makecontext>()  を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
789 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
790 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
791 "らない。"
792
793 #. type: Plain text
794 #: build/C/man3/makecontext.3:78
795 msgid ""
796 "When this context is later activated (using B<setcontext>(3)  or "
797 "B<swapcontext>())  the function I<func> is called, and passed the series of "
798 "integer (I<int>)  arguments that follow I<argc>; the caller must specify the "
799 "number of these arguments in I<argc>.  When this function returns, the "
800 "successor context is activated.  If the successor context pointer is NULL, "
801 "the thread exits."
802 msgstr ""
803 "このコンテキストが将来 (B<setcontext>(3)  または B<swapcontext>()  によっ"
804 "て)  有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 "
805 "(I<int>)  引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数"
806 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
807 "る。 後継コンテキストのポインタが NULL の場合、そのスレッドが終了する。"
808
809 #. type: Plain text
810 #: build/C/man3/makecontext.3:84
811 msgid ""
812 "The B<swapcontext>()  function saves the current context in the structure "
813 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
814 msgstr ""
815 "B<swapcontext>()  関数は現在のコンテキストを ポインタ I<oucp> が指す構造体に"
816 "保存し、 ポインタ I<ucp> が指すコンテキストを有効にする。"
817
818 #. type: Plain text
819 #: build/C/man3/makecontext.3:96
820 msgid ""
821 "When successful, B<swapcontext>()  does not return.  (But we may return "
822 "later, in case I<oucp> is activated, in which case it looks like "
823 "B<swapcontext>()  returns 0.)  On error, B<swapcontext>()  returns -1 and "
824 "sets I<errno> appropriately."
825 msgstr ""
826 "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった"
827 "場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見え"
828 "る。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じ"
829 "て設定する。"
830
831 #. type: TP
832 #: build/C/man3/makecontext.3:97
833 #: build/C/man3/pthread_attr_setaffinity_np.3:102
834 #: build/C/man3/pthread_getattr_np.3:77
835 #, no-wrap
836 msgid "B<ENOMEM>"
837 msgstr "B<ENOMEM>"
838
839 #. type: Plain text
840 #: build/C/man3/makecontext.3:100
841 msgid "Insufficient stack space left."
842 msgstr "スタックに割り当てる空間が残っていない。"
843
844 #. type: SH
845 #: build/C/man3/makecontext.3:100
846 #: build/C/man3/pthread_attr_setaffinity_np.3:106
847 #: build/C/man3/pthread_attr_setguardsize.3:104
848 #: build/C/man3/pthread_attr_setstack.3:110
849 #: build/C/man3/pthread_attr_setstackaddr.3:81
850 #: build/C/man3/pthread_attr_setstacksize.3:81
851 #: build/C/man3/pthread_getattr_np.3:96
852 #: build/C/man3/pthread_getcpuclockid.3:63
853 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
854 #: build/C/man3/pthread_setaffinity_np.3:119
855 #: build/C/man3/pthread_setconcurrency.3:81
856 #: build/C/man3/pthread_setname_np.3:100
857 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigqueue.3:90
858 #: build/C/man3/pthread_tryjoin_np.3:118
859 #, no-wrap
860 msgid "VERSIONS"
861 msgstr "バージョン"
862
863 #. type: Plain text
864 #: build/C/man3/makecontext.3:105
865 msgid ""
866 "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version "
867 "2.1."
868 msgstr ""
869 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
870 "されている。"
871
872 #. type: Plain text
873 #: build/C/man3/makecontext.3:112
874 msgid "The B<makecontext>()  and B<swapcontext>()  functions are thread-safe."
875 msgstr "関数 B<makecontext>() と B<swapcontext>() はスレッドセーフである。"
876
877 #. type: Plain text
878 #: build/C/man3/makecontext.3:120
879 msgid ""
880 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specifications of "
881 "B<makecontext>()  and B<swapcontext>(), citing portability issues, and "
882 "recommending that applications be rewritten to use POSIX threads instead."
883 msgstr ""
884 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  "
885 "と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを "
886 "POSIX スレッドを使って書き直すことが 推奨されている。"
887
888 #. type: Plain text
889 #: build/C/man3/makecontext.3:128
890 msgid ""
891 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
892 "namely, this struct contains the start and length of a memory area to be "
893 "used as the stack, regardless of the direction of growth of the stack.  "
894 "Thus, it is not necessary for the user program to worry about this direction."
895 msgstr ""
896 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわ"
897 "ちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含"
898 "まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
899 "て、ユーザプログラムはこの件については心配しなくてよい。"
900
901 #. type: Plain text
902 #: build/C/man3/makecontext.3:144
903 msgid ""
904 "On architectures where I<int> and pointer types are the same size (e.g., "
905 "x86-32, where both types are 32 bits), you may be able to get away with "
906 "passing pointers as arguments to B<makecontext>()  following I<argc>.  "
907 "However, doing this is not guaranteed to be portable, is undefined according "
908 "to the standards, and won't work on architectures where pointers are larger "
909 "than I<int>s.  Nevertheless, starting with version 2.8, glibc makes some "
910 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
911 "g., x86-64)."
912 msgstr ""
913 "I<int> とポインタ型が同じ大きさであるアーキテクチャでは (x86-32 はその例であ"
914 "り、両方の型とも 32 ビットである)、 B<makecontext>()  の I<argc> 以降の引き数"
915 "としてポインタを渡してもうまく動くかもしれない。 しかしながら、このようにする"
916 "と、移植性は保証されず、 標準に従えば動作は未定義であり、ポインタが I<int> よ"
917 "りも大きいアーキテクチャでは正しく動作しないことだろう。 それにも関わらず、"
918 "バージョン 2.8 以降の glibc では、 B<makecontext>()  に変更が行われ、(x86-64 "
919 "などの) いくつかの 64 ビットアーキテクチャで 引き数としてポインタを渡すことが"
920 "できるようになっている。"
921
922 #. type: SH
923 #: build/C/man3/makecontext.3:144 build/C/man3/pthread_attr_init.3:87
924 #: build/C/man3/pthread_attr_setdetachstate.3:115
925 #: build/C/man3/pthread_attr_setguardsize.3:162
926 #: build/C/man3/pthread_attr_setinheritsched.3:135
927 #: build/C/man3/pthread_attr_setschedparam.3:113
928 #: build/C/man3/pthread_attr_setschedpolicy.3:109
929 #: build/C/man3/pthread_attr_setstack.3:159
930 #: build/C/man3/pthread_attr_setstacksize.3:115
931 #: build/C/man3/pthread_cancel.3:135 build/C/man3/pthread_cleanup_push.3:155
932 #: build/C/man3/pthread_create.3:209 build/C/man3/pthread_detach.3:93
933 #: build/C/man3/pthread_getattr_np.3:101
934 #: build/C/man3/pthread_getcpuclockid.3:83 build/C/man3/pthread_join.3:124
935 #: build/C/man3/pthread_setaffinity_np.3:161
936 #: build/C/man3/pthread_setcancelstate.3:183
937 #: build/C/man3/pthread_setname_np.3:114
938 #: build/C/man3/pthread_setschedparam.3:156 build/C/man3/pthread_sigmask.3:78
939 #: build/C/man3/pthread_testcancel.3:65 build/C/man3/pthread_tryjoin_np.3:123
940 #, no-wrap
941 msgid "EXAMPLE"
942 msgstr "例"
943
944 #. type: Plain text
945 #: build/C/man3/makecontext.3:152
946 msgid ""
947 "The example program below demonstrates the use of B<getcontext>(3), "
948 "B<makecontext>(), and B<swapcontext>().  Running the program produces the "
949 "following output:"
950 msgstr ""
951 "以下のサンプル・プログラムは、 B<getcontext>(3), B<makecontext>(), "
952 "B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行する"
953 "と、以下のような出力が得られる:"
954
955 #. type: Plain text
956 #: build/C/man3/makecontext.3:164
957 #, no-wrap
958 msgid ""
959 "$B< ./a.out>\n"
960 "main: swapcontext(&uctx_main, &uctx_func2)\n"
961 "func2: started\n"
962 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
963 "func1: started\n"
964 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
965 "func2: returning\n"
966 "func1: returning\n"
967 "main: exiting\n"
968 msgstr ""
969 "$B< ./a.out>\n"
970 "main: swapcontext(&uctx_main, &uctx_func2)\n"
971 "func2: started\n"
972 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
973 "func1: started\n"
974 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
975 "func2: returning\n"
976 "func1: returning\n"
977 "main: exiting\n"
978
979 #. type: SS
980 #: build/C/man3/makecontext.3:166 build/C/man3/pthread_attr_init.3:148
981 #: build/C/man3/pthread_cancel.3:151 build/C/man3/pthread_cleanup_push.3:231
982 #: build/C/man3/pthread_create.3:248 build/C/man3/pthread_getattr_np.3:179
983 #: build/C/man3/pthread_getcpuclockid.3:101
984 #: build/C/man3/pthread_setname_np.3:140
985 #: build/C/man3/pthread_setschedparam.3:231 build/C/man3/pthread_sigmask.3:96
986 #, no-wrap
987 msgid "Program source"
988 msgstr "プログラムのソース"
989
990 #. type: Plain text
991 #: build/C/man3/makecontext.3:172
992 #, no-wrap
993 msgid ""
994 "#include E<lt>ucontext.hE<gt>\n"
995 "#include E<lt>stdio.hE<gt>\n"
996 "#include E<lt>stdlib.hE<gt>\n"
997 msgstr ""
998 "#include E<lt>ucontext.hE<gt>\n"
999 "#include E<lt>stdio.hE<gt>\n"
1000 "#include E<lt>stdlib.hE<gt>\n"
1001
1002 #. type: Plain text
1003 #: build/C/man3/makecontext.3:174
1004 #, no-wrap
1005 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
1006 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
1007
1008 #. type: Plain text
1009 #: build/C/man3/makecontext.3:177
1010 #, no-wrap
1011 msgid ""
1012 "#define handle_error(msg) \\e\n"
1013 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1014 msgstr ""
1015 "#define handle_error(msg) \\e\n"
1016 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1017
1018 #. type: Plain text
1019 #: build/C/man3/makecontext.3:187
1020 #, no-wrap
1021 msgid ""
1022 "static void\n"
1023 "func1(void)\n"
1024 "{\n"
1025 "    printf(\"func1: started\\en\");\n"
1026 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
1027 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
1028 "        handle_error(\"swapcontext\");\n"
1029 "    printf(\"func1: returning\\en\");\n"
1030 "}\n"
1031 msgstr ""
1032 "static void\n"
1033 "func1(void)\n"
1034 "{\n"
1035 "    printf(\"func1: started\\en\");\n"
1036 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
1037 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
1038 "        handle_error(\"swapcontext\");\n"
1039 "    printf(\"func1: returning\\en\");\n"
1040 "}\n"
1041
1042 #. type: Plain text
1043 #: build/C/man3/makecontext.3:197
1044 #, no-wrap
1045 msgid ""
1046 "static void\n"
1047 "func2(void)\n"
1048 "{\n"
1049 "    printf(\"func2: started\\en\");\n"
1050 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1051 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1052 "        handle_error(\"swapcontext\");\n"
1053 "    printf(\"func2: returning\\en\");\n"
1054 "}\n"
1055 msgstr ""
1056 "static void\n"
1057 "func2(void)\n"
1058 "{\n"
1059 "    printf(\"func2: started\\en\");\n"
1060 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1061 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1062 "        handle_error(\"swapcontext\");\n"
1063 "    printf(\"func2: returning\\en\");\n"
1064 "}\n"
1065
1066 #. type: Plain text
1067 #: build/C/man3/makecontext.3:203
1068 #, no-wrap
1069 msgid ""
1070 "int\n"
1071 "main(int argc, char *argv[])\n"
1072 "{\n"
1073 "    char func1_stack[16384];\n"
1074 "    char func2_stack[16384];\n"
1075 msgstr ""
1076 "int\n"
1077 "main(int argc, char *argv[])\n"
1078 "{\n"
1079 "    char func1_stack[16384];\n"
1080 "    char func2_stack[16384];\n"
1081
1082 #. type: Plain text
1083 #: build/C/man3/makecontext.3:210
1084 #, no-wrap
1085 msgid ""
1086 "    if (getcontext(&uctx_func1) == -1)\n"
1087 "        handle_error(\"getcontext\");\n"
1088 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1089 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1090 "    uctx_func1.uc_link = &uctx_main;\n"
1091 "    makecontext(&uctx_func1, func1, 0);\n"
1092 msgstr ""
1093 "    if (getcontext(&uctx_func1) == -1)\n"
1094 "        handle_error(\"getcontext\");\n"
1095 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1096 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1097 "    uctx_func1.uc_link = &uctx_main;\n"
1098 "    makecontext(&uctx_func1, func1, 0);\n"
1099
1100 #. type: Plain text
1101 #: build/C/man3/makecontext.3:218
1102 #, no-wrap
1103 msgid ""
1104 "    if (getcontext(&uctx_func2) == -1)\n"
1105 "        handle_error(\"getcontext\");\n"
1106 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1107 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1108 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1109 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1110 "    makecontext(&uctx_func2, func2, 0);\n"
1111 msgstr ""
1112 "    if (getcontext(&uctx_func2) == -1)\n"
1113 "        handle_error(\"getcontext\");\n"
1114 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1115 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1116 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1117 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1118 "    makecontext(&uctx_func2, func2, 0);\n"
1119
1120 #. type: Plain text
1121 #: build/C/man3/makecontext.3:222
1122 #, no-wrap
1123 msgid ""
1124 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1125 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1126 "        handle_error(\"swapcontext\");\n"
1127 msgstr ""
1128 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1129 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1130 "        handle_error(\"swapcontext\");\n"
1131
1132 #. type: Plain text
1133 #: build/C/man3/makecontext.3:226
1134 #, no-wrap
1135 msgid ""
1136 "    printf(\"main: exiting\\en\");\n"
1137 "    exit(EXIT_SUCCESS);\n"
1138 "}\n"
1139 msgstr ""
1140 "    printf(\"main: exiting\\en\");\n"
1141 "    exit(EXIT_SUCCESS);\n"
1142 "}\n"
1143
1144 #. type: Plain text
1145 #: build/C/man3/makecontext.3:233
1146 msgid ""
1147 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1148 "B<sigsetjmp>(3)"
1149 msgstr ""
1150 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1151 "B<sigsetjmp>(3)"
1152
1153 #. type: TH
1154 #: build/C/man3/pthread_attr_init.3:26
1155 #, no-wrap
1156 msgid "PTHREAD_ATTR_INIT"
1157 msgstr "PTHREAD_ATTR_INIT"
1158
1159 #. type: TH
1160 #: build/C/man3/pthread_attr_init.3:26
1161 #, no-wrap
1162 msgid "2008-11-11"
1163 msgstr "2008-11-11"
1164
1165 #. type: Plain text
1166 #: build/C/man3/pthread_attr_init.3:30
1167 msgid ""
1168 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1169 "attributes object"
1170 msgstr ""
1171 "pthread_attr_init, pthread_attr_destroy - \n"
1172 "スレッド属性オブジェクトの初期化と破棄を行う"
1173
1174 #. type: Plain text
1175 #: build/C/man3/pthread_attr_init.3:33
1176 #: build/C/man3/pthread_attr_setdetachstate.3:33
1177 #: build/C/man3/pthread_attr_setguardsize.3:33
1178 #: build/C/man3/pthread_attr_setinheritsched.3:33
1179 #: build/C/man3/pthread_attr_setschedparam.3:33
1180 #: build/C/man3/pthread_attr_setschedpolicy.3:33
1181 #: build/C/man3/pthread_attr_setscope.3:33
1182 #: build/C/man3/pthread_attr_setstack.3:33
1183 #: build/C/man3/pthread_attr_setstackaddr.3:33
1184 #: build/C/man3/pthread_attr_setstacksize.3:33
1185 #: build/C/man3/pthread_cancel.3:32 build/C/man3/pthread_cleanup_push.3:33
1186 #: build/C/man3/pthread_cleanup_push_defer_np.3:33
1187 #: build/C/man3/pthread_create.3:32 build/C/man3/pthread_detach.3:32
1188 #: build/C/man3/pthread_equal.3:32 build/C/man3/pthread_exit.3:32
1189 #: build/C/man3/pthread_join.3:32
1190 #: build/C/man3/pthread_kill_other_threads_np.3:32
1191 #: build/C/man3/pthread_rwlockattr_setkind_np.3:32
1192 #: build/C/man3/pthread_self.3:32 build/C/man3/pthread_setcancelstate.3:33
1193 #: build/C/man3/pthread_setconcurrency.3:32
1194 #: build/C/man3/pthread_setschedparam.3:33
1195 #: build/C/man3/pthread_setschedprio.3:32 build/C/man3/pthread_testcancel.3:32
1196 #, no-wrap
1197 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1198 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1199
1200 #. type: Plain text
1201 #: build/C/man3/pthread_attr_init.3:36
1202 #, no-wrap
1203 msgid ""
1204 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1205 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1206 msgstr ""
1207 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1208 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1209
1210 #. type: Plain text
1211 #: build/C/man3/pthread_attr_init.3:38
1212 #: build/C/man3/pthread_attr_setaffinity_np.3:41
1213 #: build/C/man3/pthread_attr_setdetachstate.3:40
1214 #: build/C/man3/pthread_attr_setguardsize.3:40
1215 #: build/C/man3/pthread_attr_setinheritsched.3:40
1216 #: build/C/man3/pthread_attr_setschedparam.3:40
1217 #: build/C/man3/pthread_attr_setschedpolicy.3:40
1218 #: build/C/man3/pthread_attr_setscope.3:40
1219 #: build/C/man3/pthread_attr_setstack.3:40
1220 #: build/C/man3/pthread_attr_setstackaddr.3:40
1221 #: build/C/man3/pthread_attr_setstacksize.3:40
1222 #: build/C/man3/pthread_cancel.3:36 build/C/man3/pthread_cleanup_push.3:39
1223 #: build/C/man3/pthread_equal.3:36 build/C/man3/pthread_exit.3:36
1224 #: build/C/man3/pthread_getattr_np.3:37
1225 #: build/C/man3/pthread_getcpuclockid.3:37
1226 #: build/C/man3/pthread_rwlockattr_setkind_np.3:39
1227 #: build/C/man3/pthread_self.3:36 build/C/man3/pthread_setaffinity_np.3:41
1228 #: build/C/man3/pthread_setcancelstate.3:38
1229 #: build/C/man3/pthread_setconcurrency.3:37
1230 #: build/C/man3/pthread_setschedparam.3:40
1231 #: build/C/man3/pthread_setschedprio.3:36 build/C/man3/pthread_testcancel.3:36
1232 #, no-wrap
1233 msgid "Compile and link with I<-pthread>.\n"
1234 msgstr "I<-pthread> でコンパイルしてリンクする。\n"
1235
1236 #. type: Plain text
1237 #: build/C/man3/pthread_attr_init.3:50
1238 msgid ""
1239 "The B<pthread_attr_init>()  function initializes the thread attributes "
1240 "object pointed to by I<attr> with default attribute values.  After this "
1241 "call, individual attributes of the object can be set using various related "
1242 "functions (listed under SEE ALSO), and then the object can be used in one or "
1243 "more B<pthread_create>(3)  calls that create threads."
1244 msgstr ""
1245 "B<pthread_attr_init>() 関数は I<attr> が指すスレッド属性オブジェクト\n"
1246 "(thread attributes object) をデフォルトの属性値で初期化する。\n"
1247 "この呼び出しの後、オブジェクトの各属性は (関連項目に載っている) 種々の\n"
1248 "関数を使って設定することができ、このオブジェクトはスレッドの作成を行う\n"
1249 "B<pthread_create>(3) の呼び出しにおいて使用することができる (一つの\n"
1250 "オブジェクトを複数の B<pthread_create>(3) に渡してもよい)。"
1251
1252 #. type: Plain text
1253 #: build/C/man3/pthread_attr_init.3:55
1254 msgid ""
1255 "Calling B<pthread_attr_init>()  on a thread attributes object that has "
1256 "already been initialized results in undefined behavior."
1257 msgstr ""
1258 "すでに初期化されているスレッド属性オブジェクトに対して\n"
1259 "B<pthread_attr_init>() を呼び出した場合、\n"
1260 "どのような動作になるかは不定である。"
1261
1262 #. type: Plain text
1263 #: build/C/man3/pthread_attr_init.3:62
1264 msgid ""
1265 "When a thread attributes object is no longer required, it should be "
1266 "destroyed using the B<pthread_attr_destroy>()  function.  Destroying a "
1267 "thread attributes object has no effect on threads that were created using "
1268 "that object."
1269 msgstr ""
1270 "スレッド属性オブジェクトがもはや必要なくなった際には、\n"
1271 "そのオブジェクトは B<pthread_attr_destroy>() 関数を使って破棄すべきである。\n"
1272 "スレッド属性オブジェクトを破棄しても、\n"
1273 "そのオブジェクトを使って作成されたスレッドには影響はない。"
1274
1275 #. type: Plain text
1276 #: build/C/man3/pthread_attr_init.3:68
1277 msgid ""
1278 "Once a thread attributes object has been destroyed, it can be reinitialized "
1279 "using B<pthread_attr_init>().  Any other use of a destroyed thread "
1280 "attributes object has undefined results."
1281 msgstr ""
1282 "いったん破棄したスレッド属性オブジェクトは、\n"
1283 "B<pthread_attr_init>() を使って再初期化することができる。\n"
1284 "破棄したスレッド属性オブジェクトをこれ以外の用途で\n"
1285 "使った場合の結果は不定である。"
1286
1287 #. type: Plain text
1288 #: build/C/man3/pthread_attr_init.3:71
1289 #: build/C/man3/pthread_attr_setaffinity_np.3:79
1290 #: build/C/man3/pthread_attr_setdetachstate.3:80
1291 #: build/C/man3/pthread_attr_setguardsize.3:93
1292 #: build/C/man3/pthread_attr_setinheritsched.3:96
1293 #: build/C/man3/pthread_attr_setschedparam.3:88
1294 #: build/C/man3/pthread_attr_setschedpolicy.3:86
1295 #: build/C/man3/pthread_attr_setscope.3:106
1296 #: build/C/man3/pthread_attr_setstack.3:88
1297 #: build/C/man3/pthread_attr_setstackaddr.3:77
1298 #: build/C/man3/pthread_attr_setstacksize.3:64
1299 #: build/C/man3/pthread_setaffinity_np.3:80
1300 #: build/C/man3/pthread_setcancelstate.3:95
1301 #: build/C/man3/pthread_setname_np.3:75
1302 msgid ""
1303 "On success, these functions return 0; on error, they return a nonzero error "
1304 "number."
1305 msgstr ""
1306 "成功すると、これらの関数は 0 を返す。\n"
1307 "エラーの場合、0 以外のエラー番号を返す。"
1308
1309 #. type: Plain text
1310 #: build/C/man3/pthread_attr_init.3:79
1311 msgid ""
1312 "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on "
1313 "Linux these functions always succeed (but portable and future-proof "
1314 "applications should nevertheless handle a possible error return)."
1315 msgstr ""
1316 "POSIX.1-2001 では B<pthread_attr_init>() にはエラー B<ENOMEM> が\n"
1317 "記載されている。\n"
1318 "Linux では、これらの関数は常に成功する\n"
1319 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
1320 "正のエラーの返り値を処理するようにすべきである)。"
1321
1322 #. type: Plain text
1323 #: build/C/man3/pthread_attr_init.3:81
1324 #: build/C/man3/pthread_attr_setdetachstate.3:96
1325 #: build/C/man3/pthread_attr_setguardsize.3:115
1326 #: build/C/man3/pthread_attr_setinheritsched.3:119
1327 #: build/C/man3/pthread_attr_setschedparam.3:109
1328 #: build/C/man3/pthread_attr_setschedpolicy.3:109
1329 #: build/C/man3/pthread_attr_setscope.3:128
1330 #: build/C/man3/pthread_attr_setstack.3:121
1331 #: build/C/man3/pthread_attr_setstacksize.3:92
1332 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129
1333 #: build/C/man3/pthread_create.3:155 build/C/man3/pthread_detach.3:66
1334 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82
1335 #: build/C/man3/pthread_getcpuclockid.3:72 build/C/man3/pthread_join.3:100
1336 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setcancelstate.3:122
1337 #: build/C/man3/pthread_setconcurrency.3:92
1338 #: build/C/man3/pthread_setschedparam.3:150
1339 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
1340 #: build/C/man3/pthread_testcancel.3:65
1341 msgid "POSIX.1-2001."
1342 msgstr "POSIX.1-2001."
1343
1344 #. type: Plain text
1345 #: build/C/man3/pthread_attr_init.3:87
1346 msgid ""
1347 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1348 "object other than via pthreads functions is nonportable and produces "
1349 "undefined results."
1350 msgstr ""
1351 "I<pthread_attr_t> 型の内部構造は意識すべきではない。\n"
1352 "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n"
1353 "どのような結果が得られるかも分からない。"
1354
1355 #. type: Plain text
1356 #: build/C/man3/pthread_attr_init.3:96
1357 msgid ""
1358 "The program below optionally makes use of B<pthread_attr_init>()  and "
1359 "various related functions to initialize a thread attributes object that is "
1360 "used to create a single thread.  Once created, the thread uses the "
1361 "B<pthread_getattr_np>(3)  function (a nonstandard GNU extension) to retrieve "
1362 "the thread's attributes, and then displays those attributes."
1363 msgstr ""
1364 "下記のプログラムは、B<pthread_attr_init>() と種々の関連関数を使って、\n"
1365 "スレッド属性オブジェクトの初期化を行い、\n"
1366 "そのオブジェクトを使ってスレッドを一つ作成する。\n"
1367 "作成されたスレッドは、作成後に B<pthread_getattr_np>(3) 関数 \n"
1368 "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n"
1369 "取得した属性を表示する。"
1370
1371 #. type: Plain text
1372 #: build/C/man3/pthread_attr_init.3:105
1373 msgid ""
1374 "If the program is run with no command-line argument, then it passes NULL as "
1375 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1376 "with default attributes.  Running the program on Linux/x86-32 with the NPTL "
1377 "threading implementation, we see the following:"
1378 msgstr ""
1379 "コマンドライン引き数なしでプログラムを実行した場合、\n"
1380 "B<pthread_create>(3) の I<attr> 引き数には NULL が渡される。\n"
1381 "この場合、スレッドはデフォルトの属性で作成される。\n"
1382 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1383 "動作させると、以下のような出力が得られる。"
1384
1385 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1386 #. type: Plain text
1387 #: build/C/man3/pthread_attr_init.3:121
1388 #, no-wrap
1389 msgid ""
1390 "$B< ulimit -s>       # No stack limit ==E<gt> default stack size is 2MB\n"
1391 "unlimited\n"
1392 "$B< ./a.out>\n"
1393 "Thread attributes:\n"
1394 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1395 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1396 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1397 "        Scheduling policy   = SCHED_OTHER\n"
1398 "        Scheduling priority = 0\n"
1399 "        Guard size          = 4096 bytes\n"
1400 "        Stack address       = 0x40196000\n"
1401 "        Stack size          = 0x201000 bytes\n"
1402 msgstr ""
1403 "$B< ulimit -s>       # No stack limit ==E<gt> default stack size is 2MB\n"
1404 "unlimited\n"
1405 "$B< ./a.out>\n"
1406 "Thread attributes:\n"
1407 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1408 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1409 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1410 "        Scheduling policy   = SCHED_OTHER\n"
1411 "        Scheduling priority = 0\n"
1412 "        Guard size          = 4096 bytes\n"
1413 "        Stack address       = 0x40196000\n"
1414 "        Stack size          = 0x201000 bytes\n"
1415
1416 #. type: Plain text
1417 #: build/C/man3/pthread_attr_init.3:131
1418 msgid ""
1419 "When we supply a stack size as a command-line argument, the program "
1420 "initializes a thread attributes object, sets various attributes in that "
1421 "object, and passes a pointer to the object in the call to "
1422 "B<pthread_create>(3).  Running the program on Linux/x86-32 with the NPTL "
1423 "threading implementation, we see the following:"
1424 msgstr ""
1425 "コマンドライン引き数でスタックサイズが与えられた場合、\n"
1426 "このプログラムは、スレッド属性オブジェクトを初期化し、\n"
1427 "そのオブジェクトの各種属性を設定し、\n"
1428 "B<pthread_create>(3) の呼び出しでこのオブジェクトへのポインタを渡す。\n"
1429 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1430 "動作させると、以下のような出力が得られる。"
1431
1432 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1433 #. type: Plain text
1434 #: build/C/man3/pthread_attr_init.3:146
1435 #, no-wrap
1436 msgid ""
1437 "$B< ./a.out 0x3000000>\n"
1438 "posix_memalign() allocated at 0x40197000\n"
1439 "Thread attributes:\n"
1440 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1441 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1442 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1443 "        Scheduling policy   = SCHED_OTHER\n"
1444 "        Scheduling priority = 0\n"
1445 "        Guard size          = 0 bytes\n"
1446 "        Stack address       = 0x40197000\n"
1447 "        Stack size          = 0x3000000 bytes\n"
1448 msgstr ""
1449 "$B< ./a.out 0x3000000>\n"
1450 "posix_memalign() allocated at 0x40197000\n"
1451 "Thread attributes:\n"
1452 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1453 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1454 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1455 "        Scheduling policy   = SCHED_OTHER\n"
1456 "        Scheduling priority = 0\n"
1457 "        Guard size          = 0 bytes\n"
1458 "        Stack address       = 0x40197000\n"
1459 "        Stack size          = 0x3000000 bytes\n"
1460
1461 #. type: Plain text
1462 #: build/C/man3/pthread_attr_init.3:157 build/C/man3/pthread_getattr_np.3:188
1463 #, no-wrap
1464 msgid ""
1465 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1466 "#include E<lt>pthread.hE<gt>\n"
1467 "#include E<lt>stdio.hE<gt>\n"
1468 "#include E<lt>stdlib.hE<gt>\n"
1469 "#include E<lt>unistd.hE<gt>\n"
1470 "#include E<lt>errno.hE<gt>\n"
1471 msgstr ""
1472 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1473 "#include E<lt>pthread.hE<gt>\n"
1474 "#include E<lt>stdio.hE<gt>\n"
1475 "#include E<lt>stdlib.hE<gt>\n"
1476 "#include E<lt>unistd.hE<gt>\n"
1477 "#include E<lt>errno.hE<gt>\n"
1478
1479 #. type: Plain text
1480 #: build/C/man3/pthread_attr_init.3:160 build/C/man3/pthread_cancel.3:162
1481 #: build/C/man3/pthread_cleanup_push.3:243 build/C/man3/pthread_create.3:261
1482 #: build/C/man3/pthread_getattr_np.3:191
1483 #: build/C/man3/pthread_getcpuclockid.3:119
1484 #: build/C/man3/pthread_setaffinity_np.3:179
1485 #: build/C/man3/pthread_setschedparam.3:244 build/C/man3/pthread_sigmask.3:110
1486 #, no-wrap
1487 msgid ""
1488 "#define handle_error_en(en, msg) \\e\n"
1489 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1490 msgstr ""
1491 "#define handle_error_en(en, msg) \\e\n"
1492 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1493
1494 #. type: Plain text
1495 #: build/C/man3/pthread_attr_init.3:168
1496 #, no-wrap
1497 msgid ""
1498 "static void\n"
1499 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1500 "{\n"
1501 "    int s, i;\n"
1502 "    size_t v;\n"
1503 "    void *stkaddr;\n"
1504 "    struct sched_param sp;\n"
1505 msgstr ""
1506 "static void\n"
1507 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1508 "{\n"
1509 "    int s, i;\n"
1510 "    size_t v;\n"
1511 "    void *stkaddr;\n"
1512 "    struct sched_param sp;\n"
1513
1514 #. type: Plain text
1515 #: build/C/man3/pthread_attr_init.3:176
1516 #, no-wrap
1517 msgid ""
1518 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1519 "    if (s != 0)\n"
1520 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1521 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1522 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1523 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1524 "            \"???\");\n"
1525 msgstr ""
1526 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1527 "    if (s != 0)\n"
1528 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1529 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1530 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1531 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1532 "            \"???\");\n"
1533
1534 #. type: Plain text
1535 #: build/C/man3/pthread_attr_init.3:184
1536 #, no-wrap
1537 msgid ""
1538 "    s = pthread_attr_getscope(attr, &i);\n"
1539 "    if (s != 0)\n"
1540 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1541 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1542 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1543 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1544 "            \"???\");\n"
1545 msgstr ""
1546 "    s = pthread_attr_getscope(attr, &i);\n"
1547 "    if (s != 0)\n"
1548 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1549 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1550 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1551 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1552 "            \"???\");\n"
1553
1554 #. type: Plain text
1555 #: build/C/man3/pthread_attr_init.3:192
1556 #, no-wrap
1557 msgid ""
1558 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1559 "    if (s != 0)\n"
1560 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1561 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1562 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1563 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1564 "            \"???\");\n"
1565 msgstr ""
1566 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1567 "    if (s != 0)\n"
1568 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1569 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1570 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1571 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1572 "            \"???\");\n"
1573
1574 #. type: Plain text
1575 #: build/C/man3/pthread_attr_init.3:201
1576 #, no-wrap
1577 msgid ""
1578 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1579 "    if (s != 0)\n"
1580 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1581 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1582 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1583 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1584 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1585 "            \"???\");\n"
1586 msgstr ""
1587 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1588 "    if (s != 0)\n"
1589 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1590 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1591 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1592 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1593 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1594 "            \"???\");\n"
1595
1596 #. type: Plain text
1597 #: build/C/man3/pthread_attr_init.3:206
1598 #, no-wrap
1599 msgid ""
1600 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1601 "    if (s != 0)\n"
1602 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1603 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1604 msgstr ""
1605 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1606 "    if (s != 0)\n"
1607 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1608 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1609
1610 #. type: Plain text
1611 #: build/C/man3/pthread_attr_init.3:211
1612 #, no-wrap
1613 msgid ""
1614 "    s = pthread_attr_getguardsize(attr, &v);\n"
1615 "    if (s != 0)\n"
1616 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1617 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1618 msgstr ""
1619 "    s = pthread_attr_getguardsize(attr, &v);\n"
1620 "    if (s != 0)\n"
1621 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1622 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1623
1624 #. type: Plain text
1625 #: build/C/man3/pthread_attr_init.3:218
1626 #, no-wrap
1627 msgid ""
1628 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1629 "    if (s != 0)\n"
1630 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1631 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1632 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1633 "}\n"
1634 msgstr ""
1635 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1636 "    if (s != 0)\n"
1637 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1638 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1639 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1640 "}\n"
1641
1642 #. type: Plain text
1643 #: build/C/man3/pthread_attr_init.3:224
1644 #, no-wrap
1645 msgid ""
1646 "static void *\n"
1647 "thread_start(void *arg)\n"
1648 "{\n"
1649 "    int s;\n"
1650 "    pthread_attr_t gattr;\n"
1651 msgstr ""
1652 "static void *\n"
1653 "thread_start(void *arg)\n"
1654 "{\n"
1655 "    int s;\n"
1656 "    pthread_attr_t gattr;\n"
1657
1658 #. type: Plain text
1659 #: build/C/man3/pthread_attr_init.3:228
1660 #, no-wrap
1661 msgid ""
1662 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1663 "       retrieves the attributes of the thread specified in its\n"
1664 "       first argument */\n"
1665 msgstr ""
1666 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1667 "       retrieves the attributes of the thread specified in its\n"
1668 "       first argument */\n"
1669
1670 #. type: Plain text
1671 #: build/C/man3/pthread_attr_init.3:232
1672 #, no-wrap
1673 msgid ""
1674 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1675 "    if (s != 0)\n"
1676 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1677 msgstr ""
1678 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1679 "    if (s != 0)\n"
1680 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1681
1682 #. type: Plain text
1683 #: build/C/man3/pthread_attr_init.3:235
1684 #, no-wrap
1685 msgid ""
1686 "    printf(\"Thread attributes:\\en\");\n"
1687 "    display_pthread_attr(&gattr, \"\\et\");\n"
1688 msgstr ""
1689 "    printf(\"Thread attributes:\\en\");\n"
1690 "    display_pthread_attr(&gattr, \"\\et\");\n"
1691
1692 #. type: Plain text
1693 #: build/C/man3/pthread_attr_init.3:238 build/C/man3/pthread_getattr_np.3:240
1694 #, no-wrap
1695 msgid ""
1696 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1697 "}\n"
1698 msgstr ""
1699 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1700 "}\n"
1701
1702 #. type: Plain text
1703 #: build/C/man3/pthread_attr_init.3:246
1704 #, no-wrap
1705 msgid ""
1706 "int\n"
1707 "main(int argc, char *argv[])\n"
1708 "{\n"
1709 "    pthread_t thr;\n"
1710 "    pthread_attr_t attr;\n"
1711 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1712 "    int s;\n"
1713 msgstr ""
1714 "int\n"
1715 "main(int argc, char *argv[])\n"
1716 "{\n"
1717 "    pthread_t thr;\n"
1718 "    pthread_attr_t attr;\n"
1719 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1720 "    int s;\n"
1721
1722 #. type: Plain text
1723 #: build/C/man3/pthread_attr_init.3:248
1724 #: build/C/man3/pthread_setschedparam.3:362
1725 #, no-wrap
1726 msgid "    attrp = NULL;\n"
1727 msgstr "    attrp = NULL;\n"
1728
1729 #. type: Plain text
1730 #: build/C/man3/pthread_attr_init.3:252
1731 #, no-wrap
1732 msgid ""
1733 "    /* If a command-line argument was supplied, use it to set the\n"
1734 "       stack-size attribute and set a few other thread attributes,\n"
1735 "       and set attrp pointing to thread attributes object */\n"
1736 msgstr ""
1737 "    /* If a command-line argument was supplied, use it to set the\n"
1738 "       stack-size attribute and set a few other thread attributes,\n"
1739 "       and set attrp pointing to thread attributes object */\n"
1740
1741 #. type: Plain text
1742 #: build/C/man3/pthread_attr_init.3:256
1743 #, no-wrap
1744 msgid ""
1745 "    if (argc E<gt> 1) {\n"
1746 "        int stack_size;\n"
1747 "        void *sp;\n"
1748 msgstr ""
1749 "    if (argc E<gt> 1) {\n"
1750 "        int stack_size;\n"
1751 "        void *sp;\n"
1752
1753 #. type: Plain text
1754 #: build/C/man3/pthread_attr_init.3:258
1755 #, no-wrap
1756 msgid "        attrp = &attr;\n"
1757 msgstr "        attrp = &attr;\n"
1758
1759 #. type: Plain text
1760 #: build/C/man3/pthread_attr_init.3:262
1761 #, no-wrap
1762 msgid ""
1763 "        s = pthread_attr_init(&attr);\n"
1764 "        if (s != 0)\n"
1765 "            handle_error_en(s, \"pthread_attr_init\");\n"
1766 msgstr ""
1767 "        s = pthread_attr_init(&attr);\n"
1768 "        if (s != 0)\n"
1769 "            handle_error_en(s, \"pthread_attr_init\");\n"
1770
1771 #. type: Plain text
1772 #: build/C/man3/pthread_attr_init.3:266
1773 #, no-wrap
1774 msgid ""
1775 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1776 "        if (s != 0)\n"
1777 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1778 msgstr ""
1779 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1780 "        if (s != 0)\n"
1781 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1782
1783 #. type: Plain text
1784 #: build/C/man3/pthread_attr_init.3:270
1785 #, no-wrap
1786 msgid ""
1787 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1788 "        if (s != 0)\n"
1789 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1790 msgstr ""
1791 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1792 "        if (s != 0)\n"
1793 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1794
1795 #. type: Plain text
1796 #: build/C/man3/pthread_attr_init.3:272
1797 #, no-wrap
1798 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1799 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
1800
1801 #. type: Plain text
1802 #: build/C/man3/pthread_attr_init.3:276
1803 #, no-wrap
1804 msgid ""
1805 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1806 "        if (s != 0)\n"
1807 "            handle_error_en(s, \"posix_memalign\");\n"
1808 msgstr ""
1809 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1810 "        if (s != 0)\n"
1811 "            handle_error_en(s, \"posix_memalign\");\n"
1812
1813 #. type: Plain text
1814 #: build/C/man3/pthread_attr_init.3:278
1815 #, no-wrap
1816 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1817 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1818
1819 #. type: Plain text
1820 #: build/C/man3/pthread_attr_init.3:283
1821 #, no-wrap
1822 msgid ""
1823 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1824 "        if (s != 0)\n"
1825 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1826 "    }\n"
1827 msgstr ""
1828 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1829 "        if (s != 0)\n"
1830 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1831 "    }\n"
1832
1833 #. type: Plain text
1834 #: build/C/man3/pthread_attr_init.3:287 build/C/man3/pthread_getattr_np.3:335
1835 #, no-wrap
1836 msgid ""
1837 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1838 "    if (s != 0)\n"
1839 "        handle_error_en(s, \"pthread_create\");\n"
1840 msgstr ""
1841 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1842 "    if (s != 0)\n"
1843 "        handle_error_en(s, \"pthread_create\");\n"
1844
1845 #. type: Plain text
1846 #: build/C/man3/pthread_attr_init.3:293 build/C/man3/pthread_getattr_np.3:341
1847 #, no-wrap
1848 msgid ""
1849 "    if (attrp != NULL) {\n"
1850 "        s = pthread_attr_destroy(attrp);\n"
1851 "        if (s != 0)\n"
1852 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1853 "    }\n"
1854 msgstr ""
1855 "    if (attrp != NULL) {\n"
1856 "        s = pthread_attr_destroy(attrp);\n"
1857 "        if (s != 0)\n"
1858 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1859 "    }\n"
1860
1861 #. type: Plain text
1862 #: build/C/man3/pthread_attr_init.3:296 build/C/man3/pthread_getattr_np.3:344
1863 #, no-wrap
1864 msgid ""
1865 "    pause();    /* Terminates when other thread calls exit() */\n"
1866 "}\n"
1867 msgstr ""
1868 "    pause();    /* Terminates when other thread calls exit() */\n"
1869 "}\n"
1870
1871 #. type: Plain text
1872 #: build/C/man3/pthread_attr_init.3:313
1873 msgid ""
1874 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1875 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1876 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1877 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1878 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1879 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1880 msgstr ""
1881 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1882 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1883 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1884 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1885 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1886 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1887
1888 #. type: TH
1889 #: build/C/man3/pthread_attr_setaffinity_np.3:26
1890 #, no-wrap
1891 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1892 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1893
1894 #. type: Plain text
1895 #: build/C/man3/pthread_attr_setaffinity_np.3:30
1896 msgid ""
1897 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1898 "affinity attribute in thread attributes object"
1899 msgstr ""
1900 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
1901 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
1902
1903 #. type: Plain text
1904 #: build/C/man3/pthread_attr_setaffinity_np.3:34
1905 #: build/C/man3/pthread_getattr_np.3:33
1906 #: build/C/man3/pthread_setaffinity_np.3:34
1907 #: build/C/man3/pthread_tryjoin_np.3:34 build/C/man3/pthread_yield.3:32
1908 #, no-wrap
1909 msgid ""
1910 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1911 "B<#include E<lt>pthread.hE<gt>>\n"
1912 msgstr ""
1913 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1914 "B<#include E<lt>pthread.hE<gt>>\n"
1915
1916 #. type: Plain text
1917 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1918 #, no-wrap
1919 msgid ""
1920 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1921 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1922 "B<int pthread_attr_getaffinity_np(const pthread_attr_t *>I<attr>B<,>\n"
1923 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1924 msgstr ""
1925 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1926 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1927 "B<int pthread_attr_getaffinity_np(const pthread_attr_t *>I<attr>B<,>\n"
1928 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1929
1930 #. type: Plain text
1931 #: build/C/man3/pthread_attr_setaffinity_np.3:54
1932 msgid ""
1933 "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask "
1934 "attribute of the thread attributes object referred to by I<attr> to the "
1935 "value specified in I<cpuset>.  This attribute determines the CPU affinity "
1936 "mask of a thread created using the thread attributes object I<attr>."
1937 msgstr ""
1938 "B<pthread_attr_setaffinity_np>() 関数は、\n"
1939 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
1940 "I<cpuset> で指定された値に設定する。\n"
1941 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
1942 "作成されたスレッドの CPU affinity マスクが決定される。"
1943
1944 #. type: Plain text
1945 #: build/C/man3/pthread_attr_setaffinity_np.3:63
1946 msgid ""
1947 "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask "
1948 "attribute of the thread attributes object referred to by I<attr> in the "
1949 "buffer pointed to by I<cpuset>."
1950 msgstr ""
1951 "B<pthread_attr_getaffinity_np>() 関数は、 I<attr> が参照する\n"
1952 "スレッド属性オブジェクトの CPU affinity マスク属性を\n"
1953 "I<cpuset> が指すバッファに入れて返す。"
1954
1955 #. type: Plain text
1956 #: build/C/man3/pthread_attr_setaffinity_np.3:70
1957 msgid ""
1958 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1959 "by I<cpuset>.  Typically, this argument would be specified as "
1960 "I<sizeof(cpu_set_t)>."
1961 msgstr ""
1962 "I<cpusetsize> 引き数は I<cpuset> が指すバッファの (バイト単位の)\n"
1963 "大きさである。通常は、この引き数には I<sizeof(cpu_set_t)> を\n"
1964 "指定することだろう。"
1965
1966 #. type: Plain text
1967 #: build/C/man3/pthread_attr_setaffinity_np.3:76
1968 #: build/C/man3/pthread_setaffinity_np.3:67
1969 msgid ""
1970 "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a "
1971 "description of a set of macros that can be used to manipulate and inspect "
1972 "CPU sets, see B<CPU_SET>(3)."
1973 msgstr ""
1974 "CPU affinity マスクの詳細については、 \n"
1975 "B<sched_setaffinity>(2) を参照してほしい。\n"
1976 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
1977 "B<CPU_SET>(3) を参照してほしい。"
1978
1979 #. type: TP
1980 #: build/C/man3/pthread_attr_setaffinity_np.3:80
1981 #: build/C/man3/pthread_attr_setaffinity_np.3:92
1982 #: build/C/man3/pthread_attr_setdetachstate.3:83
1983 #: build/C/man3/pthread_attr_setinheritsched.3:99
1984 #: build/C/man3/pthread_attr_setschedpolicy.3:89
1985 #: build/C/man3/pthread_attr_setscope.3:109
1986 #: build/C/man3/pthread_attr_setstack.3:91
1987 #: build/C/man3/pthread_attr_setstacksize.3:67
1988 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:55
1989 #: build/C/man3/pthread_join.3:85 build/C/man3/pthread_join.3:89
1990 #: build/C/man3/pthread_kill.3:69
1991 #: build/C/man3/pthread_rwlockattr_setkind_np.3:105
1992 #: build/C/man3/pthread_setaffinity_np.3:84
1993 #: build/C/man3/pthread_setaffinity_np.3:93
1994 #: build/C/man3/pthread_setaffinity_np.3:109
1995 #: build/C/man3/pthread_setcancelstate.3:99
1996 #: build/C/man3/pthread_setcancelstate.3:107
1997 #: build/C/man3/pthread_setconcurrency.3:71
1998 #: build/C/man3/pthread_setschedparam.3:122
1999 #: build/C/man3/pthread_setschedprio.3:62 build/C/man3/pthread_sigqueue.3:78
2000 #: build/C/man3/pthread_tryjoin_np.3:106
2001 #, no-wrap
2002 msgid "B<EINVAL>"
2003 msgstr "B<EINVAL>"
2004
2005 #.  cpumask_t
2006 #.  The raw sched_getaffinity() system call returns the size (in bytes)
2007 #.  of the cpumask_t type.
2008 #. type: Plain text
2009 #: build/C/man3/pthread_attr_setaffinity_np.3:92
2010 msgid ""
2011 "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was "
2012 "outside the set supported by the kernel.  (The kernel configuration option "
2013 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
2014 "type used to represent CPU sets.)"
2015 msgstr ""
2016 "(B<pthread_attr_setaffinity_np>())\n"
2017 "I<cpuset> がカーネルがサポートする CPU 集合にない CPU を指定していた。\n"
2018 "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲"
2019 "は、\n"
2020 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
2021
2022 #. type: Plain text
2023 #: build/C/man3/pthread_attr_setaffinity_np.3:102
2024 msgid ""
2025 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
2026 "attributes object referred to by I<attr> lies outside the range specified by "
2027 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
2028 msgstr ""
2029 "(B<pthread_attr_getaffinity_np>())\n"
2030 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
2031 "I<cpusetsize> により指定された範囲の中になかった\n"
2032 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
2033
2034 #. type: Plain text
2035 #: build/C/man3/pthread_attr_setaffinity_np.3:106
2036 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
2037 msgstr ""
2038 "(B<pthread_attr_setaffinity_np>()) メモリを割り当てることができなかった。"
2039
2040 #. type: Plain text
2041 #: build/C/man3/pthread_attr_setaffinity_np.3:108
2042 #: build/C/man3/pthread_setaffinity_np.3:121
2043 msgid "These functions are provided by glibc since version 2.3.4."
2044 msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。"
2045
2046 #. type: Plain text
2047 #: build/C/man3/pthread_attr_setaffinity_np.3:111
2048 #: build/C/man3/pthread_cleanup_push_defer_np.3:117
2049 #: build/C/man3/pthread_setaffinity_np.3:131
2050 #: build/C/man3/pthread_tryjoin_np.3:123
2051 msgid ""
2052 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
2053 "\" (nonportable) in the names."
2054 msgstr ""
2055 "これらの関数は非標準の GNU による拡張である。\n"
2056 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
2057 "付いている。"
2058
2059 #. type: Plain text
2060 #: build/C/man3/pthread_attr_setaffinity_np.3:118
2061 #: build/C/man3/pthread_setaffinity_np.3:157
2062 msgid ""
2063 "In glibc 2.3.3 only, versions of these functions were provided that did not "
2064 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
2065 "underlying system calls was always I<sizeof(cpu_set_t)>."
2066 msgstr ""
2067 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
2068 "これらの関数は I<cpusetsize> 引き数を持っていなかった。\n"
2069 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
2070 "常に I<sizeof(cpu_set_t)> であった。"
2071
2072 #. type: Plain text
2073 #: build/C/man3/pthread_attr_setaffinity_np.3:124
2074 msgid ""
2075 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2076 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2077 msgstr ""
2078 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2079 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2080
2081 #. type: TH
2082 #: build/C/man3/pthread_attr_setdetachstate.3:26
2083 #, no-wrap
2084 msgid "PTHREAD_ATTR_SETDETACHSTATE"
2085 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
2086
2087 #. type: Plain text
2088 #: build/C/man3/pthread_attr_setdetachstate.3:30
2089 msgid ""
2090 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
2091 "state attribute in thread attributes object"
2092 msgstr ""
2093 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
2094 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
2095
2096 #. type: Plain text
2097 #: build/C/man3/pthread_attr_setdetachstate.3:38
2098 #, no-wrap
2099 msgid ""
2100 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2101 "B<int pthread_attr_getdetachstate(const pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2102 msgstr ""
2103 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2104 "B<int pthread_attr_getdetachstate(const pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2105
2106 #. type: Plain text
2107 #: build/C/man3/pthread_attr_setdetachstate.3:53
2108 msgid ""
2109 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
2110 "attribute of the thread attributes object referred to by I<attr> to the "
2111 "value specified in I<detachstate>.  The detach state attribute determines "
2112 "whether a thread created using the thread attributes object I<attr> will be "
2113 "created in a joinable or a detached state."
2114 msgstr ""
2115 "B<pthread_attr_setdetachstate>() 関数は、\n"
2116 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
2117 "I<detachstate> で指定された値に設定する。\n"
2118 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2119 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
2120 "detached (切り離された) 状態で作成されるかが決定される。"
2121
2122 #. type: Plain text
2123 #: build/C/man3/pthread_attr_setdetachstate.3:56
2124 msgid "The following values may be specified in I<detachstate>:"
2125 msgstr "I<detachstate> には以下の値を指定できる。"
2126
2127 #. type: TP
2128 #: build/C/man3/pthread_attr_setdetachstate.3:56
2129 #, no-wrap
2130 msgid "B<PTHREAD_CREATE_DETACHED>"
2131 msgstr "B<PTHREAD_CREATE_DETACHED>"
2132
2133 #. type: Plain text
2134 #: build/C/man3/pthread_attr_setdetachstate.3:61
2135 msgid ""
2136 "Threads that are created using I<attr> will be created in a detached state."
2137 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
2138
2139 #. type: TP
2140 #: build/C/man3/pthread_attr_setdetachstate.3:61
2141 #, no-wrap
2142 msgid "B<PTHREAD_CREATE_JOINABLE>"
2143 msgstr "B<PTHREAD_CREATE_JOINABLE>"
2144
2145 #. type: Plain text
2146 #: build/C/man3/pthread_attr_setdetachstate.3:66
2147 msgid ""
2148 "Threads that are created using I<attr> will be created in a joinable state."
2149 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
2150
2151 #. type: Plain text
2152 #: build/C/man3/pthread_attr_setdetachstate.3:70
2153 msgid ""
2154 "The default setting of the detach state attribute in a newly initialized "
2155 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
2156 msgstr ""
2157 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
2158 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
2159
2160 #. type: Plain text
2161 #: build/C/man3/pthread_attr_setdetachstate.3:77
2162 msgid ""
2163 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
2164 "the thread attributes object I<attr> in the buffer pointed to by "
2165 "I<detachstate>."
2166 msgstr ""
2167 "B<pthread_attr_getdetachstate>() は、\n"
2168 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
2169 "I<detachstate> が指すバッファに入れて返す。"
2170
2171 #. type: Plain text
2172 #: build/C/man3/pthread_attr_setdetachstate.3:83
2173 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
2174 msgstr "B<pthread_attr_setdetachstate>() は以下のエラーで失敗する場合がある。"
2175
2176 #. type: Plain text
2177 #: build/C/man3/pthread_attr_setdetachstate.3:87
2178 msgid "An invalid value was specified in I<detachstate>."
2179 msgstr "無効な値が I<detachstate> で指定された。"
2180
2181 #. type: Plain text
2182 #: build/C/man3/pthread_attr_setdetachstate.3:94
2183 msgid ""
2184 "The B<pthread_attr_setdetachstate>()  and B<pthread_attr_getdetachstate>()  "
2185 "functions are thread-safe."
2186 msgstr ""
2187 "関数 B<pthread_attr_setdetachstate>() と B<pthread_attr_getdetachstate>() は"
2188 "スレッドセーフである。"
2189
2190 #. type: Plain text
2191 #: build/C/man3/pthread_attr_setdetachstate.3:100
2192 msgid ""
2193 "See B<pthread_create>(3)  for more details on detached and joinable threads."
2194 msgstr ""
2195 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
2196 "B<pthread_create>(3) を参照。"
2197
2198 #. type: Plain text
2199 #: build/C/man3/pthread_attr_setdetachstate.3:108
2200 msgid ""
2201 "A thread that is created in a joinable state should eventually either be "
2202 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
2203 "B<pthread_create>(3)."
2204 msgstr ""
2205 "join 可能状態で作成されたスレッドは、最終的に\n"
2206 "B<pthread_join>(3) を使って join するか、\n"
2207 "B<pthread_detach>(3) を使って切り離すか、\n"
2208 "のどちらかを行うべきである。"
2209
2210 #. type: Plain text
2211 #: build/C/man3/pthread_attr_setdetachstate.3:115
2212 msgid ""
2213 "It is an error to specify the thread ID of a thread that was created in a "
2214 "detached state in a later call to B<pthread_detach>(3)  or "
2215 "B<pthread_join>(3)."
2216 msgstr ""
2217 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
2218 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
2219 "エラーである。"
2220
2221 #. type: Plain text
2222 #: build/C/man3/pthread_attr_setdetachstate.3:118
2223 #: build/C/man3/pthread_attr_setstack.3:162
2224 msgid "See B<pthread_attr_init>(3)."
2225 msgstr "B<pthread_attr_init>(3) を参照。"
2226
2227 #. type: Plain text
2228 #: build/C/man3/pthread_attr_setdetachstate.3:124
2229 msgid ""
2230 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2231 "B<pthread_join>(3), B<pthreads>(7)"
2232 msgstr ""
2233 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2234 "B<pthread_join>(3), B<pthreads>(7)"
2235
2236 #. type: TH
2237 #: build/C/man3/pthread_attr_setguardsize.3:26
2238 #, no-wrap
2239 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2240 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2241
2242 #. type: Plain text
2243 #: build/C/man3/pthread_attr_setguardsize.3:30
2244 msgid ""
2245 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2246 "attribute in thread attributes object"
2247 msgstr ""
2248 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
2249 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
2250
2251 #. type: Plain text
2252 #: build/C/man3/pthread_attr_setguardsize.3:38
2253 #, no-wrap
2254 msgid ""
2255 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2256 "B<int pthread_attr_getguardsize(const pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2257 msgstr ""
2258 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2259 "B<int pthread_attr_getguardsize(const pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2260
2261 #. type: Plain text
2262 #: build/C/man3/pthread_attr_setguardsize.3:49
2263 msgid ""
2264 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
2265 "of the thread attributes object referred to by I<attr> to the value "
2266 "specified in I<guardsize>."
2267 msgstr ""
2268 "B<pthread_attr_setguardsize>() 関数は、\n"
2269 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
2270 "I<guardsize> で指定された値に設定する。"
2271
2272 #. type: Plain text
2273 #: build/C/man3/pthread_attr_setguardsize.3:59
2274 msgid ""
2275 "If I<guardsize> is greater than 0, then for each new thread created using "
2276 "I<attr> the system allocates an additional region of at least I<guardsize> "
2277 "bytes at the end of the thread's stack to act as the guard area for the "
2278 "stack (but see BUGS)."
2279 msgstr ""
2280 "I<guardsize> が 0 より大きい場合、\n"
2281 "I<attr> を使って新しく作成された各スレッドに対して、\n"
2282 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
2283 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
2284 "機能する (ただし「バグ」の節も参照)。"
2285
2286 #. type: Plain text
2287 #: build/C/man3/pthread_attr_setguardsize.3:65
2288 msgid ""
2289 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2290 "guard area."
2291 msgstr ""
2292 "I<guardsize> が 0 の場合、\n"
2293 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
2294
2295 #. type: Plain text
2296 #: build/C/man3/pthread_attr_setguardsize.3:67
2297 msgid "The default guard size is the same as the system page size."
2298 msgstr "デフォルトの guard size はシステムのページサイズと同じである。"
2299
2300 #. type: Plain text
2301 #: build/C/man3/pthread_attr_setguardsize.3:82
2302 msgid ""
2303 "If the stack address attribute has been set in I<attr> (using "
2304 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
2305 "that the caller is allocating the thread's stack, then the guard size "
2306 "attribute is ignored (i.e., no guard area is created by the system): it is "
2307 "the application's responsibility to handle stack overflow (perhaps by using "
2308 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
2309 "it has allocated)."
2310 msgstr ""
2311 "(B<pthread_attr_setstack>(3) や B<pthread_attr_setstackaddr>(3)を使って)\n"
2312 "I<attr> でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n"
2313 "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n"
2314 "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n"
2315 "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n"
2316 "ケーション側の責任となる (おそらく B<mprotect>(2) を使って、割り当て\n"
2317 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
2318
2319 #. type: Plain text
2320 #: build/C/man3/pthread_attr_setguardsize.3:90
2321 msgid ""
2322 "The B<pthread_attr_getguardsize>()  function returns the guard size "
2323 "attribute of the thread attributes object referred to by I<attr> in the "
2324 "buffer pointed to by I<guardsize>."
2325 msgstr ""
2326 "B<pthread_attr_getguardsize>() は、\n"
2327 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
2328 "I<guardsize> が指すバッファに入れて返す。"
2329
2330 #. type: Plain text
2331 #: build/C/man3/pthread_attr_setguardsize.3:104
2332 msgid ""
2333 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2334 "invalid.  On Linux these functions always succeed (but portable and future-"
2335 "proof applications should nevertheless handle a possible error return)."
2336 msgstr ""
2337 "POSIX.1-2001 では、エラー B<EINVAL> が\n"
2338 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2339 "Linux では、これらの関数は常に成功する\n"
2340 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2341 "正のエラーの返り値を処理するようにすべきである)。"
2342
2343 #. type: Plain text
2344 #: build/C/man3/pthread_attr_setguardsize.3:106
2345 #: build/C/man3/pthread_attr_setstackaddr.3:83
2346 #: build/C/man3/pthread_attr_setstacksize.3:83
2347 msgid "These functions are provided by glibc since version 2.1."
2348 msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。"
2349
2350 #. type: Plain text
2351 #: build/C/man3/pthread_attr_setguardsize.3:113
2352 msgid ""
2353 "The B<pthread_attr_setguardsize>()  and B<pthread_attr_getguardsize>()  "
2354 "functions are thread-safe."
2355 msgstr ""
2356 "関数 B<pthread_attr_setguardsize>() と B<pthread_attr_getguardsize>() はス"
2357 "レッドセーフである。"
2358
2359 #. type: Plain text
2360 #: build/C/man3/pthread_attr_setguardsize.3:129
2361 msgid ""
2362 "A guard area consists of virtual memory pages that are protected to prevent "
2363 "read and write access.  If a thread overflows its stack into the guard area, "
2364 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2365 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
2366 "guard size is internally rounded up to the system page size when creating a "
2367 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
2368 "size that was set by B<pthread_attr_setguardsize>().)"
2369 msgstr ""
2370 "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n"
2371 "られた仮想メモリページで構成で構成される。スレッドがスタックをガード\n"
2372 "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャ\n"
2373 "では、スレッドに B<SIGSEGV> シグナルが送られ、オーバーフローが発生した\n"
2374 "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n"
2375 "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n"
2376 "(その場合も B<pthread_attr_getguardsize>() では\n"
2377 "B<pthread_attr_setguardsize>() で設定された guard size が返される)。"
2378
2379 #. type: Plain text
2380 #: build/C/man3/pthread_attr_setguardsize.3:133
2381 msgid ""
2382 "Setting a guard size of 0 may be useful to save memory in an application "
2383 "that creates many threads and knows that stack overflow can never occur."
2384 msgstr ""
2385 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2386 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2387 "することで、メモリを節約できることもある。"
2388
2389 #. type: Plain text
2390 #: build/C/man3/pthread_attr_setguardsize.3:137
2391 msgid ""
2392 "Choosing a guard size larger than the default size may be necessary for "
2393 "detecting stack overflows if a thread allocates large data structures on the "
2394 "stack."
2395 msgstr ""
2396 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2397 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2398 "大きな guard size を選ぶ必要があるかもしれない。"
2399
2400 #. type: SH
2401 #: build/C/man3/pthread_attr_setguardsize.3:137
2402 #: build/C/man3/pthread_attr_setinheritsched.3:119
2403 #: build/C/man3/pthread_attr_setstacksize.3:103
2404 #: build/C/man3/pthread_create.3:203 build/C/man3/pthread_exit.3:98
2405 #: build/C/man3/pthread_rwlockattr_setkind_np.3:109
2406 #, no-wrap
2407 msgid "BUGS"
2408 msgstr "バグ"
2409
2410 #. type: Plain text
2411 #: build/C/man3/pthread_attr_setguardsize.3:148
2412 msgid ""
2413 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2414 "within the stack size allocation, rather than allocating extra space at the "
2415 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2416 "error from B<pthread_create>(3)  if the guard size value is too large, "
2417 "leaving no space for the actual stack.)"
2418 msgstr ""
2419 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2420 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2421 "末尾に追加の領域を割り当てることが求められている。\n"
2422 "(このため、ガード領域が大きすぎて、\n"
2423 "実際のスタック用の場所がなくなってしまう場合、\n"
2424 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2425
2426 #.  glibc includes the guardsize within the allocated stack size,
2427 #.  which looks pretty clearly to be in violation of POSIX.
2428 #.  Filed bug, 22 Oct 2008:
2429 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2430 #.  Older reports:
2431 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2432 #.  Reportedly, LinuxThreads did the right thing, allocating
2433 #.  extra space at the end of the stack:
2434 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2435 #. type: Plain text
2436 #: build/C/man3/pthread_attr_setguardsize.3:162
2437 msgid ""
2438 "The obsolete LinuxThreads implementation did the right thing, allocating "
2439 "extra space at the end of the stack for the guard area."
2440 msgstr ""
2441 "廃止予定の LinuxThreads 実装では、\n"
2442 "POSIX.1 で求められている通りの動作で、\n"
2443 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2444
2445 #. type: Plain text
2446 #: build/C/man3/pthread_attr_setguardsize.3:165
2447 msgid "See B<pthread_getattr_np>(3)."
2448 msgstr "B<pthread_getattr_np>(3) を参照。"
2449
2450 #. type: Plain text
2451 #: build/C/man3/pthread_attr_setguardsize.3:173
2452 msgid ""
2453 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), "
2454 "B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), "
2455 "B<pthread_create>(3), B<pthreads>(7)"
2456 msgstr ""
2457 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), "
2458 "B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), "
2459 "B<pthread_create>(3), B<pthreads>(7)"
2460
2461 #. type: TH
2462 #: build/C/man3/pthread_attr_setinheritsched.3:26
2463 #, no-wrap
2464 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2465 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2466
2467 #. type: TH
2468 #: build/C/man3/pthread_attr_setinheritsched.3:26
2469 #: build/C/man3/pthread_attr_setschedparam.3:26
2470 #: build/C/man3/pthread_attr_setschedpolicy.3:26 build/C/man7/pthreads.7:26
2471 #, no-wrap
2472 msgid "2014-05-21"
2473 msgstr "2014-05-21"
2474
2475 #. type: Plain text
2476 #: build/C/man3/pthread_attr_setinheritsched.3:30
2477 msgid ""
2478 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit-"
2479 "scheduler attribute in thread attributes object"
2480 msgstr ""
2481 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - スレッド属性オブ"
2482 "ジェクトの inherit-scheduler 属性の設定/取得を行う"
2483
2484 #. type: Plain text
2485 #: build/C/man3/pthread_attr_setinheritsched.3:38
2486 #, no-wrap
2487 msgid ""
2488 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2489 "B<                                 int >I<inheritsched>B<);>\n"
2490 "B<int pthread_attr_getinheritsched(const pthread_attr_t *>I<attr>B<,>\n"
2491 "B<                                 int *>I<inheritsched>B<);>\n"
2492 msgstr ""
2493 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2494 "B<                                 int >I<inheritsched>B<);>\n"
2495 "B<int pthread_attr_getinheritsched(const pthread_attr_t *>I<attr>B<,>\n"
2496 "B<                                 int *>I<inheritsched>B<);>\n"
2497
2498 #. type: Plain text
2499 #: build/C/man3/pthread_attr_setinheritsched.3:55
2500 msgid ""
2501 "The B<pthread_attr_setinheritsched>()  function sets the inherit-scheduler "
2502 "attribute of the thread attributes object referred to by I<attr> to the "
2503 "value specified in I<inheritsched>.  The inherit-scheduler attribute "
2504 "determines whether a thread created using the thread attributes object "
2505 "I<attr> will inherit its scheduling attributes from the calling thread or "
2506 "whether it will take them from I<attr>."
2507 msgstr ""
2508 "B<pthread_attr_setinheritsched>() 関数は、 I<attr> が参照するスレッド属性オブ"
2509 "ジェクトの inherit-scheduler 属性を I<inheritsched> で指定された値に設定す"
2510 "る。 inherit-scheduler 属性により、スレッド属性オブジェクト I<attr> を使って"
2511 "作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承するか、 "
2512 "I<attr> からスケジューリング属性を取得するかが決定される。"
2513
2514 #. type: Plain text
2515 #: build/C/man3/pthread_attr_setinheritsched.3:64
2516 msgid ""
2517 "The following scheduling attributes are affected by the inherit-scheduler "
2518 "attribute: scheduling policy (B<pthread_attr_setschedpolicy>(3)), scheduling "
2519 "priority (B<pthread_attr_setschedparam>(3)), and contention scope "
2520 "(B<pthread_attr_setscope>(3))."
2521 msgstr ""
2522 "次に挙げるスケジューリング属性は inherit-scheduler 属性の影響を受ける: スケ"
2523 "ジューリングポリシー (B<pthread_attr_setschedpolicy>(3))、 スケジューリング優"
2524 "先度 (B<pthread_attr_setschedparam>(3))、 contention scope "
2525 "(B<pthread_attr_setscope>(3))。"
2526
2527 #. type: Plain text
2528 #: build/C/man3/pthread_attr_setinheritsched.3:67
2529 msgid "The following values may be specified in I<inheritsched>:"
2530 msgstr "以下の値を I<inheritsched> に指定できる。"
2531
2532 #. type: TP
2533 #: build/C/man3/pthread_attr_setinheritsched.3:67
2534 #, no-wrap
2535 msgid "B<PTHREAD_INHERIT_SCHED>"
2536 msgstr "B<PTHREAD_INHERIT_SCHED>"
2537
2538 #. type: Plain text
2539 #: build/C/man3/pthread_attr_setinheritsched.3:75
2540 msgid ""
2541 "Threads that are created using I<attr> inherit scheduling attributes from "
2542 "the creating thread; the scheduling attributes in I<attr> are ignored."
2543 msgstr ""
2544 "I<attr> を使って作成されたスレッドは、\n"
2545 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2546 "I<attr> 内のスケジューリング属性は無視される。"
2547
2548 #. type: TP
2549 #: build/C/man3/pthread_attr_setinheritsched.3:75
2550 #, no-wrap
2551 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2552 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2553
2554 #.  FIXME Document the defaults for scheduler settings
2555 #. type: Plain text
2556 #: build/C/man3/pthread_attr_setinheritsched.3:82
2557 msgid ""
2558 "Threads that are created using I<attr> take their scheduling attributes from "
2559 "the values specified by the attributes object."
2560 msgstr ""
2561 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2562 "指定された値からスケジューリング属性を取得する。"
2563
2564 #. type: Plain text
2565 #: build/C/man3/pthread_attr_setinheritsched.3:86
2566 msgid ""
2567 "The default setting of the inherit-scheduler attribute in a newly "
2568 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2569 msgstr ""
2570 "新たに初期化されたスレッド属性オブジェクトの inherit-scheduler 属性のデフォル"
2571 "ト設定は B<PTHREAD_INHERIT_SCHED> である。"
2572
2573 #. type: Plain text
2574 #: build/C/man3/pthread_attr_setinheritsched.3:93
2575 msgid ""
2576 "The B<pthread_attr_getinheritsched>()  returns the inherit-scheduler "
2577 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2578 "by I<inheritsched>."
2579 msgstr ""
2580 "B<pthread_attr_getinheritsched>() は、 スレッド属性オブジェクト I<attr> の "
2581 "inherit-scheduler 属性を I<inheritsched> が指すバッファに入れて返す。"
2582
2583 #. type: Plain text
2584 #: build/C/man3/pthread_attr_setinheritsched.3:99
2585 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2586 msgstr "B<pthread_attr_setinheritsched>() は以下のエラーで失敗する場合がある。"
2587
2588 #. type: Plain text
2589 #: build/C/man3/pthread_attr_setinheritsched.3:103
2590 msgid "Invalid value in I<inheritsched>."
2591 msgstr "I<inheritsched> に無効な値が指定された。"
2592
2593 #.  .SH VERSIONS
2594 #.  Available since glibc 2.0.
2595 #. type: Plain text
2596 #: build/C/man3/pthread_attr_setinheritsched.3:110
2597 msgid ""
2598 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2599 "to set the attribute to an unsupported value\") for "
2600 "B<pthread_attr_setinheritsched>()."
2601 msgstr ""
2602 "POSIX.1-2001 では、 B<pthread_attr_setinheritsched>() に関して\n"
2603 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2604 "も追加で規定されている。"
2605
2606 #. type: Plain text
2607 #: build/C/man3/pthread_attr_setinheritsched.3:117
2608 msgid ""
2609 "The B<pthread_attr_setinheritsched>()  and "
2610 "B<pthread_attr_getinheritsched>()  functions are thread-safe."
2611 msgstr ""
2612 "関数 B<pthread_attr_setinheritsched>() と B<pthread_attr_getinheritsched>() "
2613 "はスレッドセーフである。"
2614
2615 #.  FIXME . Track status of the following bug:
2616 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2617 #. type: Plain text
2618 #: build/C/man3/pthread_attr_setinheritsched.3:135
2619 msgid ""
2620 "As at glibc 2.8, if a thread attributes object is initialized using "
2621 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2622 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2623 "if the inherit-scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2624 "then a thread created using the attribute object wrongly inherits its "
2625 "scheduling attributes from the creating thread.  This bug does not occur if "
2626 "either the scheduling policy or scheduling priority attribute is explicitly "
2627 "set in the thread attributes object before calling B<pthread_create>(3)."
2628 msgstr ""
2629 "glibc 2.8 の時点では、スレッド属性オブジェクトが B<pthread_attr_init>(3) を"
2630 "使って初期化された場合、 スレッド属性オブジェクトのスケジューリングポリシー"
2631 "が B<SCHED_OTHER> に、 スケジューリング優先度が 0 に設定される。一方、その後 "
2632 "inherit-scheduler 属性に B<PTHREAD_EXPLICIT_SCHED> が設定されると、このスレッ"
2633 "ド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するスレッド"
2634 "のスケジューリング属性が間違って継承されてしまう。 B<pthread_create>(3) を呼"
2635 "び出す前にスケジューリングポリシー属性かスケジューリング優先度属性のどちらか"
2636 "が明示的に設定された場合には、 このバグは発生しない。"
2637
2638 #. type: Plain text
2639 #: build/C/man3/pthread_attr_setinheritsched.3:138
2640 #: build/C/man3/pthread_attr_setschedparam.3:116
2641 #: build/C/man3/pthread_attr_setschedpolicy.3:112
2642 msgid "See B<pthread_setschedparam>(3)."
2643 msgstr "B<pthread_setschedparam>(3) を参照。"
2644
2645 #. type: Plain text
2646 #: build/C/man3/pthread_attr_setinheritsched.3:150
2647 msgid ""
2648 "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), "
2649 "B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), "
2650 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2651 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2652 msgstr ""
2653 "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), "
2654 "B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), "
2655 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2656 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2657
2658 #. type: TH
2659 #: build/C/man3/pthread_attr_setschedparam.3:26
2660 #, no-wrap
2661 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2662 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2663
2664 #. type: Plain text
2665 #: build/C/man3/pthread_attr_setschedparam.3:30
2666 msgid ""
2667 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2668 "parameter attributes in thread attributes object"
2669 msgstr ""
2670 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
2671 "スレッド属性オブジェクトのスケジューリングパラメータ属性の設定/取得を行う"
2672
2673 #. type: Plain text
2674 #: build/C/man3/pthread_attr_setschedparam.3:38
2675 #, no-wrap
2676 msgid ""
2677 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2678 "B<                               const struct sched_param *>I<param>B<);>\n"
2679 "B<int pthread_attr_getschedparam(const pthread_attr_t *>I<attr>B<,>\n"
2680 "B<                               struct sched_param *>I<param>B<);>\n"
2681 msgstr ""
2682 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2683 "B<                               const struct sched_param *>I<param>B<);>\n"
2684 "B<int pthread_attr_getschedparam(const pthread_attr_t *>I<attr>B<,>\n"
2685 "B<                               struct sched_param *>I<param>B<);>\n"
2686
2687 #. type: Plain text
2688 #: build/C/man3/pthread_attr_setschedparam.3:52
2689 msgid ""
2690 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2691 "attributes of the thread attributes object referred to by I<attr> to the "
2692 "values specified in the buffer pointed to by I<param>.  These attributes "
2693 "determine the scheduling parameters of a thread created using the thread "
2694 "attributes object I<attr>."
2695 msgstr ""
2696 "B<pthread_attr_setschedparam>() 関数は、\n"
2697 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2698 "パラメータ属性を I<param> が指すバッファで指定された値に設定する。\n"
2699 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2700 "作成されるスレッドのスケジューリングパラメータが決定される。"
2701
2702 #. type: Plain text
2703 #: build/C/man3/pthread_attr_setschedparam.3:59
2704 msgid ""
2705 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2706 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2707 "by I<param>."
2708 msgstr ""
2709 "B<pthread_attr_getschedparam>() は、\n"
2710 "スレッド属性オブジェクト I<attr> のスケジューリングパラメータ属性を\n"
2711 "I<param> が指すバッファに入れて返す。"
2712
2713 #. type: Plain text
2714 #: build/C/man3/pthread_attr_setschedparam.3:61
2715 msgid "Scheduling parameters are maintained in the following structure:"
2716 msgstr "スケジューリングパラメータは以下の構造体で管理される。"
2717
2718 #. type: Plain text
2719 #: build/C/man3/pthread_attr_setschedparam.3:67
2720 #: build/C/man3/pthread_setschedparam.3:69
2721 #, no-wrap
2722 msgid ""
2723 "struct sched_param {\n"
2724 "    int sched_priority;     /* Scheduling priority */\n"
2725 "};\n"
2726 msgstr ""
2727 "struct sched_param {\n"
2728 "    int sched_priority;     /* Scheduling priority */\n"
2729 "};\n"
2730
2731 #. type: Plain text
2732 #: build/C/man3/pthread_attr_setschedparam.3:74
2733 #: build/C/man3/pthread_setschedparam.3:76
2734 msgid ""
2735 "As can be seen, only one scheduling parameter is supported.  For details of "
2736 "the permitted ranges for scheduling priorities in each scheduling policy, "
2737 "see B<sched>(7)."
2738 msgstr ""
2739 "見て分かる通り、サポートされているスケジューリングパラメータは一つだけであ"
2740 "る。各スケジューリングポリシーで許可されるスケジューリング優先度の詳細につい"
2741 "ては、B<sched>(7) を参照のこと。"
2742
2743 #. type: Plain text
2744 #: build/C/man3/pthread_attr_setschedparam.3:85
2745 msgid ""
2746 "In order for the parameter setting made by B<pthread_attr_setschedparam>()  "
2747 "to have effect when calling B<pthread_create>(3), the caller must use "
2748 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2749 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2750 msgstr ""
2751 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedparam>() で行っ"
2752 "たパラメータ設定を有効にするには、 呼び出し側で "
2753 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
2754 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
2755 "ない。"
2756
2757 #.  .SH VERSIONS
2758 #.  Available since glibc 2.0.
2759 #. type: Plain text
2760 #: build/C/man3/pthread_attr_setschedparam.3:100
2761 msgid ""
2762 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2763 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2764 "(but portable and future-proof applications should nevertheless handle a "
2765 "possible error return)."
2766 msgstr ""
2767 "POSIX.1 では、\n"
2768 "B<pthread_attr_setschedparam>() について\n"
2769 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
2770 "Linux では、これらの関数は常に成功する\n"
2771 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2772 "正のエラーの返り値を処理するようにすべきである)。"
2773
2774 #. type: Plain text
2775 #: build/C/man3/pthread_attr_setschedparam.3:107
2776 msgid ""
2777 "The B<pthread_attr_setschedparam>()  and B<pthread_attr_getschedparam>()  "
2778 "functions are thread-safe."
2779 msgstr ""
2780 "関数 B<pthread_attr_setschedparam>() と B<pthread_attr_getschedparam>() はス"
2781 "レッドセーフである。"
2782
2783 #. type: Plain text
2784 #: build/C/man3/pthread_attr_setschedparam.3:113
2785 msgid ""
2786 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2787 "policies supported on Linux."
2788 msgstr ""
2789 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
2790 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
2791
2792 #. type: Plain text
2793 #: build/C/man3/pthread_attr_setschedparam.3:128
2794 msgid ""
2795 "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
2796 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2797 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2798 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2799 msgstr ""
2800 "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
2801 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2802 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2803 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2804
2805 #. type: TH
2806 #: build/C/man3/pthread_attr_setschedpolicy.3:26
2807 #, no-wrap
2808 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2809 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2810
2811 #. type: Plain text
2812 #: build/C/man3/pthread_attr_setschedpolicy.3:30
2813 msgid ""
2814 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2815 "scheduling policy attribute in thread attributes object"
2816 msgstr ""
2817 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
2818 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
2819
2820 #. type: Plain text
2821 #: build/C/man3/pthread_attr_setschedpolicy.3:38
2822 #, no-wrap
2823 msgid ""
2824 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2825 "B<int pthread_attr_getschedpolicy(const pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2826 msgstr ""
2827 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2828 "B<int pthread_attr_getschedpolicy(const pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2829
2830 #. type: Plain text
2831 #: build/C/man3/pthread_attr_setschedpolicy.3:52
2832 msgid ""
2833 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2834 "attribute of the thread attributes object referred to by I<attr> to the "
2835 "value specified in I<policy>.  This attribute determines the scheduling "
2836 "policy of a thread created using the thread attributes object I<attr>."
2837 msgstr ""
2838 "B<pthread_attr_setschedpolicy>() 関数は、\n"
2839 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2840 "ポリシー属性を I<policy> で指定された値に設定する。\n"
2841 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2842 "作成されるスレッドのスケジューリングポリシーが決定される。"
2843
2844 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2845 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2846 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2847 #. type: Plain text
2848 #: build/C/man3/pthread_attr_setschedpolicy.3:65
2849 msgid ""
2850 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2851 "B<SCHED_OTHER>, with the semantics described in B<sched>(7)."
2852 msgstr ""
2853 "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER> であ"
2854 "る。それぞれの意味は B<sched>(7) で説明している通りである。"
2855
2856 #. type: Plain text
2857 #: build/C/man3/pthread_attr_setschedpolicy.3:72
2858 msgid ""
2859 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2860 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2861 "by I<policy>."
2862 msgstr ""
2863 "B<pthread_attr_getschedpolicy>() は、\n"
2864 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
2865 "I<policy> が指すバッファに入れて返す。"
2866
2867 #. type: Plain text
2868 #: build/C/man3/pthread_attr_setschedpolicy.3:83
2869 msgid ""
2870 "In order for the policy setting made by B<pthread_attr_setschedpolicy>()  to "
2871 "have effect when calling B<pthread_create>(3), the caller must use "
2872 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2873 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2874 msgstr ""
2875 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedpolicy>() で行っ"
2876 "たポリシー設定を有効にするには、 呼び出し側で "
2877 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
2878 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
2879 "ない。"
2880
2881 #. type: Plain text
2882 #: build/C/man3/pthread_attr_setschedpolicy.3:89
2883 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2884 msgstr "B<pthread_attr_setschedpolicy>() は以下のエラーで失敗する場合がある。"
2885
2886 #. type: Plain text
2887 #: build/C/man3/pthread_attr_setschedpolicy.3:93
2888 msgid "Invalid value in I<policy>."
2889 msgstr "I<policy> に無効な値が指定された。"
2890
2891 #.  .SH VERSIONS
2892 #.  Available since glibc 2.0.
2893 #. type: Plain text
2894 #: build/C/man3/pthread_attr_setschedpolicy.3:100
2895 msgid ""
2896 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2897 "to set the attribute to an unsupported value\") for "
2898 "B<pthread_attr_setschedpolicy>()."
2899 msgstr ""
2900 "POSIX.1-2001 では、 B<pthread_attr_setschedpolicy>() に関して\n"
2901 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2902 "も追加で規定されている。"
2903
2904 #. type: Plain text
2905 #: build/C/man3/pthread_attr_setschedpolicy.3:107
2906 msgid ""
2907 "The B<pthread_attr_setschedpolicy>()  and B<pthread_attr_getschedpolicy>()  "
2908 "functions are thread-safe."
2909 msgstr ""
2910 "関数 B<pthread_attr_setschedpolicy>() と B<pthread_attr_getschedpolicy>() は"
2911 "スレッドセーフである。"
2912
2913 #. type: Plain text
2914 #: build/C/man3/pthread_attr_setschedpolicy.3:123
2915 msgid ""
2916 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
2917 "B<pthread_attr_setschedparam>(3), B<pthread_create>(3), "
2918 "B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), "
2919 "B<sched>(7)"
2920 msgstr ""
2921 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
2922 "B<pthread_attr_setschedparam>(3), B<pthread_create>(3), "
2923 "B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), "
2924 "B<sched>(7)"
2925
2926 #. type: TH
2927 #: build/C/man3/pthread_attr_setscope.3:26
2928 #, no-wrap
2929 msgid "PTHREAD_ATTR_SETSCOPE"
2930 msgstr "PTHREAD_ATTR_SETSCOPE"
2931
2932 #. type: Plain text
2933 #: build/C/man3/pthread_attr_setscope.3:30
2934 msgid ""
2935 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2936 "attribute in thread attributes object"
2937 msgstr ""
2938 "pthread_attr_setscope, pthread_attr_getscope - \n"
2939 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
2940
2941 #. type: Plain text
2942 #: build/C/man3/pthread_attr_setscope.3:38
2943 #, no-wrap
2944 msgid ""
2945 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2946 "B<int pthread_attr_getscope(const pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2947 msgstr ""
2948 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2949 "B<int pthread_attr_getscope(const pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2950
2951 #. type: Plain text
2952 #: build/C/man3/pthread_attr_setscope.3:53
2953 msgid ""
2954 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2955 "of the thread attributes object referred to by I<attr> to the value "
2956 "specified in I<scope>.  The contention scope attribute defines the set of "
2957 "threads against which a thread competes for resources such as the CPU.  "
2958 "POSIX.1-2001 specifies two possible values for I<scope>:"
2959 msgstr ""
2960 "B<pthread_attr_setscope>() 関数は、\n"
2961 "I<attr> が参照するスレッド属性オブジェクトの contention scope\n"
2962 "属性を I<scope> で指定された値に設定する。\n"
2963 "contention scope 属性により、\n"
2964 "スレッドが CPU などのリソースを取り合うスレッド集合が規定される。\n"
2965 "POSIX.1-2001 では I<scope> に指定する値として 2 つの値が規定されている。"
2966
2967 #. type: TP
2968 #: build/C/man3/pthread_attr_setscope.3:53
2969 #, no-wrap
2970 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2971 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2972
2973 #. type: Plain text
2974 #: build/C/man3/pthread_attr_setscope.3:61
2975 msgid ""
2976 "The thread competes for resources with all other threads in all processes on "
2977 "the system that are in the same scheduling allocation domain (a group of one "
2978 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2979 "to one another according to their scheduling policy and priority."
2980 msgstr ""
2981 "スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ\n"
2982 "のグループ) にある、システム上の全てのプロセスの自分以外の全ての\n"
2983 "スレッドとリソースを取り合う。 \n"
2984 "B<PTHREAD_SCOPE_SYSTEM> のスレッドは、スケジューリングポリシーと\n"
2985 "優先度に基づき、互いに相対的にスケジューリングされる。"
2986
2987 #. type: TP
2988 #: build/C/man3/pthread_attr_setscope.3:61
2989 #, no-wrap
2990 msgid "B<PTHREAD_SCOPE_PROCESS>"
2991 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2992
2993 #. type: Plain text
2994 #: build/C/man3/pthread_attr_setscope.3:76
2995 msgid ""
2996 "The thread competes for resources with all other threads in the same process "
2997 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
2998 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2999 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
3000 "leaves it unspecified how these threads contend with other threads in other "
3001 "process on the system or with other threads in the same process that were "
3002 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
3003 msgstr ""
3004 "スレッドは、contention scope が B<PTHREAD_SCOPE_PROCESS> で作成された\n"
3005 "同じプロセスの自分以外の全てのスレッドとリソースを取り合う。\n"
3006 "B<PTHREAD_SCOPE_PROCESS> のスレッドは、スケジューリングポリシーと優先度\n"
3007 "に基づき、同じプロセスの他のスレッドと相対的にスケジューリングされる。\n"
3008 "POSIX.1-2001 では、これらのスレッドがシステム上の他のプロセスのスレッド\n"
3009 "や同じプロセス内の contention scope が B<PTHREAD_SCOPE_SYSTEM> で作成\n"
3010 "された他のスレッドとどのようにリソースを取り合うかは、\n"
3011 "規定されないままになっている。"
3012
3013 #. type: Plain text
3014 #: build/C/man3/pthread_attr_setscope.3:83
3015 msgid ""
3016 "POSIX.1-2001 requires that an implementation support at least one of these "
3017 "contention scopes.  Linux supports B<PTHREAD_SCOPE_SYSTEM>, but not "
3018 "B<PTHREAD_SCOPE_PROCESS>."
3019 msgstr ""
3020 "POSIX.1-2001 で求められているのは、スレッド実装がこれらの contention scope の"
3021 "うち少なくとも 1 つをサポートすることだけである。 Linux は "
3022 "B<PTHREAD_SCOPE_SYSTEM> をサポートしているが、 B<PTHREAD_SCOPE_PROCESS> はサ"
3023 "ポートしていない。"
3024
3025 #. type: Plain text
3026 #: build/C/man3/pthread_attr_setscope.3:95
3027 msgid ""
3028 "On systems that support multiple contention scopes, then, in order for the "
3029 "parameter setting made by B<pthread_attr_setscope>()  to have effect when "
3030 "calling B<pthread_create>(3), the caller must use "
3031 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
3032 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
3033 msgstr ""
3034 "複数の contention scope をサポートしているシステムで、 B<pthread_create>(3) "
3035 "を呼び出した際に B<pthread_attr_setscope>() で行ったパラメータ設定を有効にす"
3036 "るには、 呼び出し側で B<pthread_attr_setinheritsched>(3) を使って 属性オブ"
3037 "ジェクト I<attr> の inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定"
3038 "しておかなければならない。"
3039
3040 #. type: Plain text
3041 #: build/C/man3/pthread_attr_setscope.3:103
3042 msgid ""
3043 "The B<pthread_attr_getscope>()  function returns the contention scope "
3044 "attribute of the thread attributes object referred to by I<attr> in the "
3045 "buffer pointed to by I<scope>."
3046 msgstr ""
3047 "B<pthread_attr_getscope>() は、\n"
3048 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
3049 "I<scope> が指すバッファに入れて返す。"
3050
3051 #. type: Plain text
3052 #: build/C/man3/pthread_attr_setscope.3:109
3053 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
3054 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
3055
3056 #. type: Plain text
3057 #: build/C/man3/pthread_attr_setscope.3:113
3058 msgid "An invalid value was specified in I<scope>."
3059 msgstr "I<scope> に無効な値が指定された。"
3060
3061 #. type: TP
3062 #: build/C/man3/pthread_attr_setscope.3:113
3063 #, no-wrap
3064 msgid "B<ENOTSUP>"
3065 msgstr "B<ENOTSUP>"
3066
3067 #. type: Plain text
3068 #: build/C/man3/pthread_attr_setscope.3:119
3069 msgid ""
3070 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
3071 "supported on Linux."
3072 msgstr ""
3073 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
3074 "この値は Linux でサポートされていない。"
3075
3076 #. type: Plain text
3077 #: build/C/man3/pthread_attr_setscope.3:126
3078 msgid ""
3079 "The B<pthread_attr_setscope>()  and B<pthread_attr_getscope>()  functions "
3080 "are thread-safe."
3081 msgstr ""
3082 "関数 B<pthread_attr_setscope>() と B<pthread_attr_getscope>() はスレッドセー"
3083 "フである。"
3084
3085 #. type: Plain text
3086 #: build/C/man3/pthread_attr_setscope.3:136
3087 msgid ""
3088 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a user-"
3089 "space thread is bound directly to a single kernel-scheduling entity.  This "
3090 "is the case on Linux for the obsolete LinuxThreads implementation and the "
3091 "modern NPTL implementation, which are both 1:1 threading implementations."
3092 msgstr ""
3093 "B<PTHREAD_SCOPE_SYSTEM> contention scope では、通常は、一つの\n"
3094 "ユーザ空間スレッドは一つのカーネルスケジューリング・エンティティに\n"
3095 "直接結び付けられる。\n"
3096 "Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに\n"
3097 "該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。"
3098
3099 #. type: Plain text
3100 #: build/C/man3/pthread_attr_setscope.3:139
3101 msgid ""
3102 "POSIX.1-2001 specifies that the default contention scope is implementation-"
3103 "defined."
3104 msgstr ""
3105 "POSIX.1-2001 では、 contention scope 属性のデフォルト値は\n"
3106 "実装時で定義されるものと規定されている。"
3107
3108 #. type: Plain text
3109 #: build/C/man3/pthread_attr_setscope.3:149
3110 msgid ""
3111 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3112 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3113 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3114 msgstr ""
3115 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3116 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3117 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3118
3119 #. type: TH
3120 #: build/C/man3/pthread_attr_setstack.3:26
3121 #, no-wrap
3122 msgid "PTHREAD_ATTR_SETSTACK"
3123 msgstr "PTHREAD_ATTR_SETSTACK"
3124
3125 #. type: Plain text
3126 #: build/C/man3/pthread_attr_setstack.3:30
3127 msgid ""
3128 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
3129 "thread attributes object"
3130 msgstr ""
3131 "pthread_attr_setstack, pthread_attr_getstack - \n"
3132 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
3133
3134 #. type: Plain text
3135 #: build/C/man3/pthread_attr_setstack.3:38
3136 #, no-wrap
3137 msgid ""
3138 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3139 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3140 "B<int pthread_attr_getstack(const pthread_attr_t *>I<attr>B<,>\n"
3141 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3142 msgstr ""
3143 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3144 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3145 "B<int pthread_attr_getstack(const pthread_attr_t *>I<attr>B<,>\n"
3146 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3147
3148 #. type: Plain text
3149 #: build/C/man3/pthread_attr_setstack.3:45
3150 #: build/C/man3/pthread_cleanup_push_defer_np.3:44
3151 #: build/C/man3/pthread_kill.3:41
3152 #: build/C/man3/pthread_rwlockattr_setkind_np.3:44
3153 #: build/C/man3/pthread_sigmask.3:42 build/C/man3/pthread_sigqueue.3:42
3154 msgid ""
3155 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3156 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
3157
3158 #. type: Plain text
3159 #: build/C/man3/pthread_attr_setstack.3:50
3160 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3161 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3162
3163 #. type: Plain text
3164 #: build/C/man3/pthread_attr_setstack.3:52
3165 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
3166 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
3167
3168 #. type: Plain text
3169 #: build/C/man3/pthread_attr_setstack.3:68
3170 msgid ""
3171 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
3172 "size attributes of the thread attributes object referred to by I<attr> to "
3173 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
3174 "attributes specify the location and size of the stack that should be used by "
3175 "a thread that is created using the thread attributes object I<attr>."
3176 msgstr ""
3177 "B<pthread_attr_setstack>() 関数は、\n"
3178 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
3179 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
3180 "指定された値に設定する。\n"
3181 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
3182 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
3183
3184 #. type: Plain text
3185 #: build/C/man3/pthread_attr_setstack.3:74
3186 msgid ""
3187 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
3188 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
3189 "allocated buffer should be both readable and writable."
3190 msgstr ""
3191 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
3192 "バッファ内の指定できる最小のアドレスバイトを指すべきである。\n"
3193 "割り当てられたバッファのページは読み書き両方が可能なページとなっている\n"
3194 "べきである。"
3195
3196 #. type: Plain text
3197 #: build/C/man3/pthread_attr_setstack.3:85
3198 msgid ""
3199 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
3200 "size attributes of the thread attributes object referred to by I<attr> in "
3201 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
3202 msgstr ""
3203 "B<pthread_attr_getstack>() 関数は、\n"
3204 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
3205 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
3206 "指すバッファに入れて返す。"
3207
3208 #. type: Plain text
3209 #: build/C/man3/pthread_attr_setstack.3:91
3210 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
3211 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
3212
3213 #. type: Plain text
3214 #: build/C/man3/pthread_attr_setstack.3:102
3215 msgid ""
3216 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
3217 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
3218 "stacksize> is not suitably aligned."
3219 msgstr ""
3220 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
3221 "システムによっては、 I<stackaddr> か\n"
3222 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
3223 "このエラーが発生する。"
3224
3225 #. type: Plain text
3226 #: build/C/man3/pthread_attr_setstack.3:110
3227 msgid ""
3228 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
3229 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
3230 "caller."
3231 msgstr ""
3232 "POSIX.1-2001 では エラー B<EACCES> も規定されており、\n"
3233 "このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に\n"
3234 "呼び出し側から読み書き両方のアクセスができない状況を表す。"
3235
3236 #. type: Plain text
3237 #: build/C/man3/pthread_attr_setstack.3:112
3238 msgid "These functions are provided by glibc since version 2.2."
3239 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
3240
3241 #. type: Plain text
3242 #: build/C/man3/pthread_attr_setstack.3:119
3243 msgid ""
3244 "The B<pthread_attr_setstack>()  and B<pthread_attr_getstack>()  functions "
3245 "are thread-safe."
3246 msgstr ""
3247 "関数 B<pthread_attr_setstack>() と B<pthread_attr_getstack>() はスレッドセー"
3248 "フである。"
3249
3250 #. type: Plain text
3251 #: build/C/man3/pthread_attr_setstack.3:129
3252 msgid ""
3253 "These functions are provided for applications that must ensure that a "
3254 "thread's stack is placed in a particular location.  For most applications, "
3255 "this is not necessary, and the use of these functions should be avoided.  "
3256 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
3257 "stack size other than the default.)"
3258 msgstr ""
3259 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
3260 "しなければならないアプリケーションのために提供されている。\n"
3261 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
3262 "これらの関数を使うのは避けるべきである。\n"
3263 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
3264 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
3265
3266 #. type: Plain text
3267 #: build/C/man3/pthread_attr_setstack.3:140
3268 msgid ""
3269 "When an application employs B<pthread_attr_setstack>(), it takes over the "
3270 "responsibility of allocating the stack.  Any guard size value that was set "
3271 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
3272 "is the application's responsibility to allocate a guard area (one or more "
3273 "pages protected against reading and writing)  to handle the possibility of "
3274 "stack overflow."
3275 msgstr ""
3276 "アプリケーションが B<pthread_attr_setstack>() を利用する際には、\n"
3277 "スタックの割り当てに責任を持つ必要がある。\n"
3278 "B<pthread_attr_setguardsize>(3) を使って設定された\n"
3279 "guard size の値は無視される。\n"
3280 "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n"
3281 "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n"
3282 "スタックオーバーフローの可能性に対処するようにする必要がある。"
3283
3284 #. type: Plain text
3285 #: build/C/man3/pthread_attr_setstack.3:151
3286 msgid ""
3287 "The address specified in I<stackaddr> should be suitably aligned: for full "
3288 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
3289 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
3290 "should also be a multiple of the system page size."
3291 msgstr ""
3292 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
3293 "完全な移植性を持たせるためには、\n"
3294 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
3295 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
3296 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
3297
3298 #. type: Plain text
3299 #: build/C/man3/pthread_attr_setstack.3:159
3300 msgid ""
3301 "If I<attr> is used to create multiple threads, then the caller must change "
3302 "the stack address attribute between calls to B<pthread_create>(3); "
3303 "otherwise, the threads will attempt to use the same memory area for their "
3304 "stacks, and chaos will ensue."
3305 msgstr ""
3306 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
3307 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
3308 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
3309 "さもなければ、複数のスレッドがスタックとして同じメモリ領域を\n"
3310 "使おうとするため、訳の分からない状況が発生してしまう。"
3311
3312 #. type: Plain text
3313 #: build/C/man3/pthread_attr_setstack.3:174
3314 msgid ""
3315 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3316 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3317 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3318 msgstr ""
3319 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3320 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3321 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3322
3323 #. type: TH
3324 #: build/C/man3/pthread_attr_setstackaddr.3:26
3325 #, no-wrap
3326 msgid "PTHREAD_ATTR_SETSTACKADDR"
3327 msgstr "PTHREAD_ATTR_SETSTACKADDR"
3328
3329 #. type: Plain text
3330 #: build/C/man3/pthread_attr_setstackaddr.3:30
3331 msgid ""
3332 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
3333 "attribute in thread attributes object"
3334 msgstr ""
3335 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
3336 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
3337
3338 #. type: Plain text
3339 #: build/C/man3/pthread_attr_setstackaddr.3:38
3340 #, no-wrap
3341 msgid ""
3342 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3343 "B<int pthread_attr_getstackaddr(const pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3344 msgstr ""
3345 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3346 "B<int pthread_attr_getstackaddr(const pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3347
3348 #. type: Plain text
3349 #: build/C/man3/pthread_attr_setstackaddr.3:49
3350 msgid ""
3351 "These functions are obsolete: B<do not use them.> Use "
3352 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
3353 msgstr ""
3354 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
3355 "代わりに B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使うこ"
3356 "と。"
3357
3358 #. type: Plain text
3359 #: build/C/man3/pthread_attr_setstackaddr.3:60
3360 msgid ""
3361 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
3362 "attribute of the thread attributes object referred to by I<attr> to the "
3363 "value specified in I<stackaddr>.  This attribute specifies the location of "
3364 "the stack that should be used by a thread that is created using the thread "
3365 "attributes object I<attr>."
3366 msgstr ""
3367 "B<pthread_attr_setstackaddr>() 関数は、\n"
3368 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3369 "属性を I<stackaddr> で指定された値に設定する。\n"
3370 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3371 "作成されるスレッドが使用すべきスタックの位置が指定される。"
3372
3373 #. type: Plain text
3374 #: build/C/man3/pthread_attr_setstackaddr.3:66
3375 msgid ""
3376 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
3377 "that was allocated by the caller.  The pages of the allocated buffer should "
3378 "be both readable and writable."
3379 msgstr ""
3380 "I<stackaddr> は呼び出し側が割り当てたバッファ (大きさは\n"
3381 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
3382 "割り当てられたバッファのページは読み書き両方が可能なページと\n"
3383 "なっているべきである。"
3384
3385 #. type: Plain text
3386 #: build/C/man3/pthread_attr_setstackaddr.3:74
3387 msgid ""
3388 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
3389 "attribute of the thread attributes object referred to by I<attr> in the "
3390 "buffer pointed to by I<stackaddr>."
3391 msgstr ""
3392 "B<pthread_attr_getstackaddr>() は、\n"
3393 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3394 "I<stackaddr> が指すバッファに入れて返す。"
3395
3396 #. type: Plain text
3397 #: build/C/man3/pthread_attr_setstackaddr.3:81
3398 msgid ""
3399 "No errors are defined (but applications should nevertheless handle a "
3400 "possible error return)."
3401 msgstr ""
3402 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
3403 "返り値を処理するようにすべきである)。"
3404
3405 #. type: Plain text
3406 #: build/C/man3/pthread_attr_setstackaddr.3:90
3407 msgid ""
3408 "The B<pthread_attr_setstackaddr>()  and B<pthread_attr_getstackaddr>()  "
3409 "functions are thread-safe."
3410 msgstr ""
3411 "関数 B<pthread_attr_setstackaddr>() と B<pthread_attr_getstackaddr>() はス"
3412 "レッドセーフである。"
3413
3414 #. type: Plain text
3415 #: build/C/man3/pthread_attr_setstackaddr.3:93
3416 msgid ""
3417 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
3418 "POSIX.1-2008 removes the specification of these functions."
3419 msgstr ""
3420 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
3421 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
3422
3423 #. type: Plain text
3424 #: build/C/man3/pthread_attr_setstackaddr.3:117
3425 msgid ""
3426 "I<Do not use these functions!> They cannot be portably used, since they "
3427 "provide no way of specifying the direction of growth or the range of the "
3428 "stack.  For example, on architectures with a stack that grows downward, "
3429 "I<stackaddr> specifies the next address past the I<highest> address of the "
3430 "allocated stack area.  However, on architectures with a stack that grows "
3431 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
3432 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
3433 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
3434 "in the allocated stack area (and the I<stacksize> argument specifies the "
3435 "range of the stack)."
3436 msgstr ""
3437 "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n"
3438 "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n"
3439 "かを指定する手段が提供されていないからである。\n"
3440 "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャ\n"
3441 "では、I<stackaddr> には割り当てられたスタック領域のI<最も大きな>アドレ\n"
3442 "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n"
3443 "方向) に伸びるアーキテクチャでは、I<stackaddr> には割り当てられた\n"
3444 "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n"
3445 "B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) が使用する\n"
3446 "I<stackaddr> は、常に割り当てられたスタック領域の最も小さいアドレス\n"
3447 "へのポインタである (I<stacksize> 引き数はスタックの範囲を指定する)。"
3448
3449 #. type: Plain text
3450 #: build/C/man3/pthread_attr_setstackaddr.3:123
3451 msgid ""
3452 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3453 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3454 msgstr ""
3455 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3456 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3457
3458 #. type: TH
3459 #: build/C/man3/pthread_attr_setstacksize.3:26
3460 #, no-wrap
3461 msgid "PTHREAD_ATTR_SETSTACKSIZE"
3462 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
3463
3464 #. type: Plain text
3465 #: build/C/man3/pthread_attr_setstacksize.3:30
3466 msgid ""
3467 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
3468 "attribute in thread attributes object"
3469 msgstr ""
3470 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
3471 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
3472
3473 #. type: Plain text
3474 #: build/C/man3/pthread_attr_setstacksize.3:38
3475 #, no-wrap
3476 msgid ""
3477 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3478 "B<int pthread_attr_getstacksize(const pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3479 msgstr ""
3480 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3481 "B<int pthread_attr_getstacksize(const pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3482
3483 #. type: Plain text
3484 #: build/C/man3/pthread_attr_setstacksize.3:49
3485 msgid ""
3486 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
3487 "of the thread attributes object referred to by I<attr> to the value "
3488 "specified in I<stacksize>."
3489 msgstr ""
3490 "B<pthread_attr_setstacksize>() 関数は、\n"
3491 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3492 "属性を I<stacksize> で指定された値に設定する。"
3493
3494 #. type: Plain text
3495 #: build/C/man3/pthread_attr_setstacksize.3:53
3496 msgid ""
3497 "The stack size attribute determines the minimum size (in bytes) that will be "
3498 "allocated for threads created using the thread attributes object I<attr>."
3499 msgstr ""
3500 "スタックサイズ属性により、\n"
3501 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
3502 "に割り当てられる最小サイズ (バイト単位) が決定される。"
3503
3504 #. type: Plain text
3505 #: build/C/man3/pthread_attr_setstacksize.3:61
3506 msgid ""
3507 "The B<pthread_attr_getstacksize>()  function returns the stack size "
3508 "attribute of the thread attributes object referred to by I<attr> in the "
3509 "buffer pointed to by I<stacksize>."
3510 msgstr ""
3511 "B<pthread_attr_getstacksize>() は、\n"
3512 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3513 "I<stacksize> が指すバッファに入れて返す。"
3514
3515 #. type: Plain text
3516 #: build/C/man3/pthread_attr_setstacksize.3:67
3517 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
3518 msgstr "B<pthread_attr_setstacksize>() は以下のエラーで失敗する場合がある。"
3519
3520 #. type: Plain text
3521 #: build/C/man3/pthread_attr_setstacksize.3:72
3522 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
3523 msgstr "スタックサイズが B<PTHREAD_STACK_MIN> (16384) バイト未満である。"
3524
3525 #.  e.g., MacOS
3526 #. type: Plain text
3527 #: build/C/man3/pthread_attr_setstacksize.3:81
3528 msgid ""
3529 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
3530 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
3531 msgstr ""
3532 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
3533 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
3534 "エラー B<EINVAL> で失敗する。"
3535
3536 #. type: Plain text
3537 #: build/C/man3/pthread_attr_setstacksize.3:90
3538 msgid ""
3539 "The B<pthread_attr_setstacksize>()  and B<pthread_attr_getstacksize>()  "
3540 "functions are thread-safe."
3541 msgstr ""
3542 "関数 B<pthread_attr_setstacksize>() と B<pthread_attr_getstacksize>() はス"
3543 "レッドセーフである。"
3544
3545 #. type: Plain text
3546 #: build/C/man3/pthread_attr_setstacksize.3:95
3547 msgid ""
3548 "For details on the default stack size of new threads, see "
3549 "B<pthread_create>(3)."
3550 msgstr ""
3551 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
3552 "B<pthread_create>(3) を参照。"
3553
3554 #. type: Plain text
3555 #: build/C/man3/pthread_attr_setstacksize.3:98
3556 msgid ""
3557 "A thread's stack size is fixed at the time of thread creation.  Only the "
3558 "main thread can dynamically grow its stack."
3559 msgstr ""
3560 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
3561 "メインスレッドだけがスタックを動的に伸ばすことができる。"
3562
3563 #. type: Plain text
3564 #: build/C/man3/pthread_attr_setstacksize.3:103
3565 msgid ""
3566 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
3567 "the size and location of a caller-allocated stack that is to be used by a "
3568 "thread."
3569 msgstr ""
3570 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
3571 "アプリケーションは、スレッドが使用するスタックとして、\n"
3572 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
3573
3574 #. type: Plain text
3575 #: build/C/man3/pthread_attr_setstacksize.3:115
3576 msgid ""
3577 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
3578 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
3579 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
3580 "stack will be at least I<stacksize> bytes."
3581 msgstr ""
3582 "glibc 2.8 の時点では、指定された I<stacksize> が B<STACK_ALIGN> \n"
3583 "(ほとんどのアーキテクチャでは 16 バイト) の倍数でない場合、\n"
3584 "I<stacksize> はI<小さくなる方向に>に丸められる。\n"
3585 "これは POSIX.1-2001 に違反している。\n"
3586 "POSIX.1-2001 では、割り当てらたスタックの大きさは\n"
3587 "少なくとも I<stacksize> バイトになると書かれている。"
3588
3589 #. type: Plain text
3590 #: build/C/man3/pthread_attr_setstacksize.3:118
3591 #: build/C/man3/pthread_join.3:127
3592 msgid "See B<pthread_create>(3)."
3593 msgstr "B<pthread_create>(3) を参照。"
3594
3595 #. type: Plain text
3596 #: build/C/man3/pthread_attr_setstacksize.3:125
3597 msgid ""
3598 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3599 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3600 msgstr ""
3601 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3602 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3603
3604 #. type: TH
3605 #: build/C/man3/pthread_cancel.3:26
3606 #, no-wrap
3607 msgid "PTHREAD_CANCEL"
3608 msgstr "PTHREAD_CANCEL"
3609
3610 #. type: TH
3611 #: build/C/man3/pthread_cancel.3:26
3612 #, no-wrap
3613 msgid "2008-11-17"
3614 msgstr "2008-11-17"
3615
3616 #. type: Plain text
3617 #: build/C/man3/pthread_cancel.3:29
3618 msgid "pthread_cancel - send a cancellation request to a thread"
3619 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
3620
3621 #. type: Plain text
3622 #: build/C/man3/pthread_cancel.3:34
3623 #, no-wrap
3624 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3625 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3626
3627 #. type: Plain text
3628 #: build/C/man3/pthread_cancel.3:49
3629 msgid ""
3630 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
3631 "I<thread>.  Whether and when the target thread reacts to the cancellation "
3632 "request depends on two attributes that are under the control of that thread: "
3633 "its cancelability I<state> and I<type>."
3634 msgstr ""
3635 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
3636 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
3637 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
3638 "I<state> と I<type>により決まる。"
3639
3640 #. type: Plain text
3641 #: build/C/man3/pthread_cancel.3:61
3642 msgid ""
3643 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
3644 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
3645 "has disabled cancellation, then a cancellation request remains queued until "
3646 "the thread enables cancellation.  If a thread has enabled cancellation, then "
3647 "its cancelability type determines when cancellation occurs."
3648 msgstr ""
3649 "あるスレッドの cancelability state は B<pthread_setcancelstate>(3) で\n"
3650 "設定され、I<enabled> と I<disabled> のいずれとなる (I<enabled> が新しい\n"
3651 "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n"
3652 "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n"
3653 "れたままになる。スレッドがキャンセルを有効にしていた場合、\n"
3654 "cancelability type によって、いつキャンセルが発生するかが決まる。"
3655
3656 #. type: Plain text
3657 #: build/C/man3/pthread_cancel.3:77
3658 msgid ""
3659 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3660 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
3661 "Asynchronous cancelability means that the thread can be canceled at any time "
3662 "(usually immediately, but the system does not guarantee this).  Deferred "
3663 "cancelability means that cancellation will be delayed until the thread next "
3664 "calls a function that is a I<cancellation point>.  A list of functions that "
3665 "are or may be cancellation points is provided in B<pthreads>(7)."
3666 msgstr ""
3667 "スレッドのキャンセル種別 (cancelability type) は\n"
3668 "B<pthread_setcanceltype>(3) で設定され、I<asynchronous> か I<deferred>\n"
3669 "のいずれかとなる(I<deferred> が新しいスレッドのデフォルト値である)。\n"
3670 "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつで\n"
3671 "もキャンセルされることを意味する (通常はすぐにキャンセルされるが、\n"
3672 "システムがそのことを保証しているわけではない)。遅延キャンセル\n"
3673 "(deferred cancelability) では、そのスレッドが I<取り消しポイント\n"
3674 "(cancellation point)> となっている関数を次に呼び出すまでキャンセルが\n"
3675 "遅延される。取り消しポイントに設定されていたり設定\n"
3676 "したりできる関数のリストは B<pthreads>(7) に記載している。"
3677
3678 #. type: Plain text
3679 #: build/C/man3/pthread_cancel.3:81
3680 msgid ""
3681 "When a cancellation requested is acted on, the following steps occur for "
3682 "I<thread> (in this order):"
3683 msgstr ""
3684 "キャンセル要求が実行されると、\n"
3685 "I<thread> では以下のステップが (この順序で) 行われる。"
3686
3687 #. type: IP
3688 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:69
3689 #, no-wrap
3690 msgid "1."
3691 msgstr "1."
3692
3693 #. type: Plain text
3694 #: build/C/man3/pthread_cancel.3:86
3695 msgid ""
3696 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3697 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
3698 msgstr ""
3699 "キャンセルクリーンアップハンドラが (push されたのと逆順で)\n"
3700 "取り出され (pop され)、呼び出される。\n"
3701 "(B<pthread_cleanup_push>(3) 参照)"
3702
3703 #. type: IP
3704 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:73
3705 #, no-wrap
3706 msgid "2."
3707 msgstr "2."
3708
3709 #. type: Plain text
3710 #: build/C/man3/pthread_cancel.3:91
3711 msgid ""
3712 "Thread-specific data destructors are called, in an unspecified order.  (See "
3713 "B<pthread_key_create>(3).)"
3714 msgstr ""
3715 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
3716 "呼び出し順序は規定されていない。\n"
3717 "(B<pthread_key_create>(3) 参照)"
3718
3719 #. type: IP
3720 #: build/C/man3/pthread_cancel.3:91 build/C/man3/pthread_cleanup_push.3:83
3721 #, no-wrap
3722 msgid "3."
3723 msgstr "3."
3724
3725 #. type: Plain text
3726 #: build/C/man3/pthread_cancel.3:95
3727 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3728 msgstr "スレッドが終了される。 (B<pthread_exit>(3) 参照)"
3729
3730 #. type: Plain text
3731 #: build/C/man3/pthread_cancel.3:103
3732 msgid ""
3733 "The above steps happen asynchronously with respect to the "
3734 "B<pthread_cancel>()  call; the return status of B<pthread_cancel>()  merely "
3735 "informs the caller whether the cancellation request was successfully queued."
3736 msgstr ""
3737 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
3738 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
3739 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
3740
3741 #. type: Plain text
3742 #: build/C/man3/pthread_cancel.3:112
3743 msgid ""
3744 "After a canceled thread has terminated, a join with that thread using "
3745 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
3746 "status.  (Joining with a thread is the only way to know that cancellation "
3747 "has completed.)"
3748 msgstr ""
3749 "キャンセルされたスレッドが終了された後に、\n"
3750 "B<pthread_join>(3) でそのスレッドを join すると、\n"
3751 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
3752 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
3753
3754 #. type: Plain text
3755 #: build/C/man3/pthread_cancel.3:117
3756 msgid ""
3757 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
3758 "error number."
3759 msgstr ""
3760 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
3761 "エラーの場合、0 以外のエラー番号を返す。"
3762
3763 #. type: TP
3764 #: build/C/man3/pthread_cancel.3:118 build/C/man3/pthread_detach.3:59
3765 #: build/C/man3/pthread_getcpuclockid.3:58 build/C/man3/pthread_join.3:93
3766 #: build/C/man3/pthread_setaffinity_np.3:114
3767 #: build/C/man3/pthread_setschedparam.3:114
3768 #: build/C/man3/pthread_setschedprio.3:70 build/C/man3/pthread_sigqueue.3:86
3769 #, no-wrap
3770 msgid "B<ESRCH>"
3771 msgstr "B<ESRCH>"
3772
3773 #. type: Plain text
3774 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_detach.3:64
3775 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:98
3776 #: build/C/man3/pthread_setaffinity_np.3:119
3777 #: build/C/man3/pthread_setschedparam.3:119
3778 #: build/C/man3/pthread_setschedprio.3:75
3779 msgid "No thread with the ID I<thread> could be found."
3780 msgstr "ID が I<thread> のスレッドが見つからなかった。"
3781
3782 #. type: Plain text
3783 #: build/C/man3/pthread_cancel.3:135
3784 msgid ""
3785 "On Linux, cancellation is implemented using signals.  Under the NPTL "
3786 "threading implementation, the first real-time signal (i.e., signal 32) is "
3787 "used for this purpose.  On LinuxThreads, the second real-time signal is "
3788 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3789 msgstr ""
3790 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装で"
3791 "は、\n"
3792 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
3793 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイ"
3794 "ム\n"
3795 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
3796
3797 #. type: Plain text
3798 #: build/C/man3/pthread_cancel.3:141
3799 msgid ""
3800 "The program below creates a thread and then cancels it.  The main thread "
3801 "joins with the canceled thread to check that its exit status was "
3802 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
3803 "run the program:"
3804 msgstr ""
3805 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルす"
3806 "る。\n"
3807 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
3808 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
3809 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
3810
3811 #. type: Plain text
3812 #: build/C/man3/pthread_cancel.3:149
3813 #, no-wrap
3814 msgid ""
3815 "$ ./a.out\n"
3816 "thread_func(): started; cancellation disabled\n"
3817 "main(): sending cancellation request\n"
3818 "thread_func(): about to enable cancellation\n"
3819 "main(): thread was canceled\n"
3820 msgstr ""
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
3827 #. type: Plain text
3828 #: build/C/man3/pthread_cancel.3:159
3829 #, no-wrap
3830 msgid ""
3831 "#include E<lt>pthread.hE<gt>\n"
3832 "#include E<lt>stdio.hE<gt>\n"
3833 "#include E<lt>errno.hE<gt>\n"
3834 "#include E<lt>stdlib.hE<gt>\n"
3835 "#include E<lt>unistd.hE<gt>\n"
3836 msgstr ""
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
3843 #. type: Plain text
3844 #: build/C/man3/pthread_cancel.3:167
3845 #, no-wrap
3846 msgid ""
3847 "static void *\n"
3848 "thread_func(void *ignored_argument)\n"
3849 "{\n"
3850 "    int s;\n"
3851 msgstr ""
3852 "static void *\n"
3853 "thread_func(void *ignored_argument)\n"
3854 "{\n"
3855 "    int s;\n"
3856
3857 #. type: Plain text
3858 #: build/C/man3/pthread_cancel.3:170
3859 #, no-wrap
3860 msgid ""
3861 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3862 "       immediately react to a cancellation request */\n"
3863 msgstr ""
3864 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3865 "       immediately react to a cancellation request */\n"
3866
3867 #. type: Plain text
3868 #: build/C/man3/pthread_cancel.3:174
3869 #, no-wrap
3870 msgid ""
3871 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3872 "    if (s != 0)\n"
3873 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3874 msgstr ""
3875 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3876 "    if (s != 0)\n"
3877 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3878
3879 #. type: Plain text
3880 #: build/C/man3/pthread_cancel.3:178
3881 #, no-wrap
3882 msgid ""
3883 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3884 "    sleep(5);\n"
3885 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3886 msgstr ""
3887 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3888 "    sleep(5);\n"
3889 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3890
3891 #. type: Plain text
3892 #: build/C/man3/pthread_cancel.3:182
3893 #, no-wrap
3894 msgid ""
3895 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3896 "    if (s != 0)\n"
3897 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3898 msgstr ""
3899 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3900 "    if (s != 0)\n"
3901 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3902
3903 #. type: Plain text
3904 #: build/C/man3/pthread_cancel.3:184
3905 #, no-wrap
3906 msgid "    /* sleep() is a cancellation point */\n"
3907 msgstr "    /* sleep() is a cancellation point */\n"
3908
3909 #. type: Plain text
3910 #: build/C/man3/pthread_cancel.3:186
3911 #, no-wrap
3912 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3913 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3914
3915 #. type: Plain text
3916 #: build/C/man3/pthread_cancel.3:188
3917 #, no-wrap
3918 msgid "    /* Should never get here */\n"
3919 msgstr "    /* Should never get here */\n"
3920
3921 #. type: Plain text
3922 #: build/C/man3/pthread_cancel.3:192
3923 #, no-wrap
3924 msgid ""
3925 "    printf(\"thread_func(): not canceled!\\en\");\n"
3926 "    return NULL;\n"
3927 "}\n"
3928 msgstr ""
3929 "    printf(\"thread_func(): not canceled!\\en\");\n"
3930 "    return NULL;\n"
3931 "}\n"
3932
3933 #. type: Plain text
3934 #: build/C/man3/pthread_cancel.3:199
3935 #, no-wrap
3936 msgid ""
3937 "int\n"
3938 "main(void)\n"
3939 "{\n"
3940 "    pthread_t thr;\n"
3941 "    void *res;\n"
3942 "    int s;\n"
3943 msgstr ""
3944 "int\n"
3945 "main(void)\n"
3946 "{\n"
3947 "    pthread_t thr;\n"
3948 "    void *res;\n"
3949 "    int s;\n"
3950
3951 #. type: Plain text
3952 #: build/C/man3/pthread_cancel.3:201
3953 #, no-wrap
3954 msgid "    /* Start a thread and then send it a cancellation request */\n"
3955 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3956
3957 #. type: Plain text
3958 #: build/C/man3/pthread_cancel.3:205
3959 #, no-wrap
3960 msgid ""
3961 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3962 "    if (s != 0)\n"
3963 "        handle_error_en(s, \"pthread_create\");\n"
3964 msgstr ""
3965 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3966 "    if (s != 0)\n"
3967 "        handle_error_en(s, \"pthread_create\");\n"
3968
3969 #. type: Plain text
3970 #: build/C/man3/pthread_cancel.3:207
3971 #, no-wrap
3972 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3973 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3974
3975 #. type: Plain text
3976 #: build/C/man3/pthread_cancel.3:212
3977 #, no-wrap
3978 msgid ""
3979 "    printf(\"main(): sending cancellation request\\en\");\n"
3980 "    s = pthread_cancel(thr);\n"
3981 "    if (s != 0)\n"
3982 "        handle_error_en(s, \"pthread_cancel\");\n"
3983 msgstr ""
3984 "    printf(\"main(): sending cancellation request\\en\");\n"
3985 "    s = pthread_cancel(thr);\n"
3986 "    if (s != 0)\n"
3987 "        handle_error_en(s, \"pthread_cancel\");\n"
3988
3989 #. type: Plain text
3990 #: build/C/man3/pthread_cancel.3:214
3991 #, no-wrap
3992 msgid "    /* Join with thread to see what its exit status was */\n"
3993 msgstr "    /* Join with thread to see what its exit status was */\n"
3994
3995 #. type: Plain text
3996 #: build/C/man3/pthread_cancel.3:218 build/C/man3/pthread_cleanup_push.3:307
3997 #, no-wrap
3998 msgid ""
3999 "    s = pthread_join(thr, &res);\n"
4000 "    if (s != 0)\n"
4001 "        handle_error_en(s, \"pthread_join\");\n"
4002 msgstr ""
4003 "    s = pthread_join(thr, &res);\n"
4004 "    if (s != 0)\n"
4005 "        handle_error_en(s, \"pthread_join\");\n"
4006
4007 #. type: Plain text
4008 #: build/C/man3/pthread_cancel.3:225
4009 #, no-wrap
4010 msgid ""
4011 "    if (res == PTHREAD_CANCELED)\n"
4012 "        printf(\"main(): thread was canceled\\en\");\n"
4013 "    else\n"
4014 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
4015 "    exit(EXIT_SUCCESS);\n"
4016 "}\n"
4017 msgstr ""
4018 "    if (res == PTHREAD_CANCELED)\n"
4019 "        printf(\"main(): thread was canceled\\en\");\n"
4020 "    else\n"
4021 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
4022 "    exit(EXIT_SUCCESS);\n"
4023 "}\n"
4024
4025 #. type: Plain text
4026 #: build/C/man3/pthread_cancel.3:238
4027 msgid ""
4028 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
4029 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
4030 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4031 msgstr ""
4032 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
4033 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
4034 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4035
4036 #. type: TH
4037 #: build/C/man3/pthread_cleanup_push.3:26
4038 #, no-wrap
4039 msgid "PTHREAD_CLEANUP_PUSH"
4040 msgstr "PTHREAD_CLEANUP_PUSH"
4041
4042 #. type: TH
4043 #: build/C/man3/pthread_cleanup_push.3:26
4044 #, no-wrap
4045 msgid "2008-11-24"
4046 msgstr "2008-11-24"
4047
4048 #. type: Plain text
4049 #: build/C/man3/pthread_cleanup_push.3:30
4050 msgid ""
4051 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
4052 "clean-up handlers"
4053 msgstr ""
4054 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
4055 "キャンセルクリーンアップハンドラの push/pop を行う"
4056
4057 #. type: Plain text
4058 #: build/C/man3/pthread_cleanup_push.3:37
4059 #, no-wrap
4060 msgid ""
4061 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
4062 "B<                          void *>I<arg>B<);>\n"
4063 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
4064 msgstr ""
4065 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
4066 "B<                          void *>I<arg>B<);>\n"
4067 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
4068
4069 #. type: Plain text
4070 #: build/C/man3/pthread_cleanup_push.3:48
4071 msgid ""
4072 "These functions manipulate the calling thread's stack of thread-cancellation "
4073 "clean-up handlers.  A clean-up handler is a function that is automatically "
4074 "executed when a thread is canceled (or in various other circumstances "
4075 "described below); it might, for example, unlock a mutex so that it becomes "
4076 "available to other threads in the process."
4077 msgstr ""
4078 "これらの関数は、呼び出したスレッドのスレッドキャンセル時のクリーンアッ\n"
4079 "プハンドラのスタックの操作を行う。クリーンアップハンドラは、スレッドが\n"
4080 "キャンセルされた場合 (や以下で説明する他の種々の状況において) 自動的に\n"
4081 "実行される関数である。例えば、mutex のロック解除を行い、プロセス内の\n"
4082 "他のスレッドが利用できるようにする関数などが考えられる。"
4083
4084 #. type: Plain text
4085 #: build/C/man3/pthread_cleanup_push.3:59
4086 msgid ""
4087 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
4088 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
4089 "be given I<arg> as its argument."
4090 msgstr ""
4091 "B<pthread_cleanup_push>() 関数は、 I<routine> をクリーンアップ\n"
4092 "ハンドラのスタックの一番上にプッシュする。 I<routine> が後で\n"
4093 "起動される際には、 I<arg> が関数の引き数と渡される。"
4094
4095 #. type: Plain text
4096 #: build/C/man3/pthread_cleanup_push.3:66
4097 msgid ""
4098 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
4099 "stack of clean-up handlers, and optionally executes it if I<execute> is "
4100 "nonzero."
4101 msgstr ""
4102 "B<pthread_cleanup_pop>() 関数は、クリーンアップハンドラの\n"
4103 "スタックの一番上のルーチンを削除する。\n"
4104 "I<execute> が 0 以外の場合にはそのルーチンを追加で実行する。"
4105
4106 #. type: Plain text
4107 #: build/C/man3/pthread_cleanup_push.3:69
4108 msgid ""
4109 "A cancellation clean-up handler is popped from the stack and executed in the "
4110 "following circumstances:"
4111 msgstr ""
4112 "キャンセルクリーンアップハンドラは、以下に示す場合に\n"
4113 "スタックから取り出され実行される。"
4114
4115 #. type: Plain text
4116 #: build/C/man3/pthread_cleanup_push.3:73
4117 msgid ""
4118 "When a thread is canceled, all of the stacked clean-up handlers are popped "
4119 "and executed in the reverse of the order in which they were pushed onto the "
4120 "stack."
4121 msgstr ""
4122 "スレッドがキャンセルされた際に、スタックに登録された全てのクリーン\n"
4123 "アップハンドラが取り出されて、実行される。クリーンアップハンドラの\n"
4124 "実行は、スタックに登録されたのと逆の順序で行われる。"
4125
4126 #. type: Plain text
4127 #: build/C/man3/pthread_cleanup_push.3:83
4128 msgid ""
4129 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
4130 "handlers are executed as described in the preceding point.  (Clean-up "
4131 "handlers are I<not> called if the thread terminates by performing a "
4132 "I<return> from the thread start function.)"
4133 msgstr ""
4134 "スレッドが B<pthread_exit>(3) を呼び出して終了する際に、全てのクリーン\n"
4135 "アップハンドラが上の項目で述べたのと同様に実行される。\n"
4136 "(スレッドがスレッド開始関数からの I<return> の実行により終了する場合に\n"
4137 "は、クリーンアップハンドラはI<呼び出されない>。)"
4138
4139 #. type: Plain text
4140 #: build/C/man3/pthread_cleanup_push.3:89
4141 msgid ""
4142 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
4143 "argument, the top-most clean-up handler is popped and executed."
4144 msgstr ""
4145 "スレッドが 0 以外の I<execute> 引き数で B<pthread_cleanup_pop>() を\n"
4146 "呼び出した際に、スタックの一番上のクリーンアップハンドラが取り出されて\n"
4147 "実行される。"
4148
4149 #. type: Plain text
4150 #: build/C/man3/pthread_cleanup_push.3:101
4151 msgid ""
4152 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
4153 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
4154 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
4155 "calls to these functions are paired within the same function, and at the "
4156 "same lexical nesting level.  (In other words, a clean-up handler is "
4157 "established only during the execution of a specified section of code.)"
4158 msgstr ""
4159 "POSIX.1 では、 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>() を\n"
4160 "それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開するマクロと\n"
4161 "して実装することを許容している。\n"
4162 "このため、呼び出し側では、これらの関数の呼び出しが同じ関数の中で対と\n"
4163 "なり、かつ文法的に同じネストレベル (nesting level) になることを保証\n"
4164 "しなければならない。 (言い換えると、クリーンアップハンドラは、コード\n"
4165 "の特定のセクションの実行の中でのみ設定するものであると言える。)"
4166
4167 #. type: Plain text
4168 #: build/C/man3/pthread_cleanup_push.3:121
4169 msgid ""
4170 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
4171 "call has been made to B<pthread_cleanup_push>()  or "
4172 "B<pthread_cleanup_pop>()  without the matching call of the pair since the "
4173 "jump buffer was filled by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, "
4174 "calling B<longjmp>(3)  (B<siglongjmp>(3))  from inside a clean-up handler "
4175 "produces undefined results unless the jump buffer was also filled by "
4176 "B<setjmp>(3)  (B<sigsetjmp>(3))  inside the handler."
4177 msgstr ""
4178 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しは、\n"
4179 "B<pthread_cleanup_push>() や B<pthread_cleanup_pop>() の呼び出しが対と\n"
4180 "なる呼び出しがない状態で行われた場合には、どのような結果になるかは不定\n"
4181 "である。これは jump バッファは B<setjmp>(3) (B<sigsetjmp>(3)) により設\n"
4182 "定されるからである。同様に、クリーンアップハンドラ内からの\n"
4183 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しも、jump バッファがハンドラ\n"
4184 "内で B<setjmp>(3) (B<sigsetjmp>(3)) で設定されていない限り、どのような\n"
4185 "結果になるかは不定である。"
4186
4187 #. type: Plain text
4188 #: build/C/man3/pthread_cleanup_push.3:123
4189 msgid "These functions do not return a value."
4190 msgstr "これらの関数は値を返さない。"
4191
4192 #.  SH VERSIONS
4193 #.  Available since glibc 2.0
4194 #. type: Plain text
4195 #: build/C/man3/pthread_cleanup_push.3:127
4196 msgid "There are no errors."
4197 msgstr "エラーはない。"
4198
4199 #. type: Plain text
4200 #: build/C/man3/pthread_cleanup_push.3:140
4201 msgid ""
4202 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
4203 "functions I<are> implemented as macros that expand to text containing "
4204 "\\(aqB<{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
4205 "declared within the scope of paired calls to these functions will be visible "
4206 "within only that scope."
4207 msgstr ""
4208 "Linux では、関数 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>()\n"
4209 "は、それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開する\n"
4210 "マクロとして実装されている。このことは、これらの関数を対で呼び出した\n"
4211 "スコープ内で宣言された変数は、そのスコープの中でしか参照できない\n"
4212 "ということを意味している。"
4213
4214 #.  The text was actually added in the 2004 TC2
4215 #. type: Plain text
4216 #: build/C/man3/pthread_cleanup_push.3:155
4217 msgid ""
4218 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
4219 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
4220 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
4221 "avoid doing this."
4222 msgstr ""
4223 "POSIX.1 には、括弧を含む B<pthread_cleanup_push>() と\n"
4224 "B<pthread_cleanup_pop>() のブロックをそのままにしたままで、 \n"
4225 "I<return>, I<break>, I<continue>, I<goto> を使った場合の影響は\n"
4226 "不定であると書かれている。\n"
4227 "移植性が必要なアプリケーションではこれを行うのは避けるべきである。"
4228
4229 #. type: Plain text
4230 #: build/C/man3/pthread_cleanup_push.3:170
4231 msgid ""
4232 "The program below provides a simple example of the use of the functions "
4233 "described in this page.  The program creates a thread that executes a loop "
4234 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
4235 "loop increments a global variable, I<cnt>, once each second.  Depending on "
4236 "what command-line arguments are supplied, the main thread sends the other "
4237 "thread a cancellation request, or sets a global variable that causes the "
4238 "other thread to exit its loop and terminate normally (by doing a I<return>)."
4239 msgstr ""
4240 "以下のプログラムは、このページで説明した関数の簡単な使用例を示すもので\n"
4241 "ある。このプログラムは B<pthread_cleanup_push>() と\n"
4242 "B<pthread_cleanup_pop>() で囲まれたループを実行するスレッドを作成する。\n"
4243 "このループではグローバル変数 I<cnt> を 1 秒に 1 ずつ増やしていく。\n"
4244 "指定されたコマンドライン引き数の内容に基づいて、メインスレッドはもう一\n"
4245 "つのスレッドにキャンセル要求を送ったり、もう一つのスレッドがループを\n"
4246 "抜けて (I<return> を呼び出して) 正常終了するようにグローバル変数を\n"
4247 "設定したりする。"
4248
4249 #. type: Plain text
4250 #: build/C/man3/pthread_cleanup_push.3:173
4251 msgid ""
4252 "In the following shell session, the main thread sends a cancellation request "
4253 "to the other thread:"
4254 msgstr ""
4255 "以下のシェルセッションでは、メインスレッドはもう一つのスレッドに\n"
4256 "キャンセル要求を送信する。"
4257
4258 #. type: Plain text
4259 #: build/C/man3/pthread_cleanup_push.3:183
4260 #, no-wrap
4261 msgid ""
4262 "$ B<./a.out>\n"
4263 "New thread started\n"
4264 "cnt = 0\n"
4265 "cnt = 1\n"
4266 "Canceling thread\n"
4267 "Called clean-up handler\n"
4268 "Thread was canceled; cnt = 0\n"
4269 msgstr ""
4270 "$ B<./a.out>\n"
4271 "New thread started\n"
4272 "cnt = 0\n"
4273 "cnt = 1\n"
4274 "Canceling thread\n"
4275 "Called clean-up handler\n"
4276 "Thread was canceled; cnt = 0\n"
4277
4278 #. type: Plain text
4279 #: build/C/man3/pthread_cleanup_push.3:191
4280 msgid ""
4281 "From the above, we see that the thread was canceled, and that the "
4282 "cancellation clean-up handler was called and it reset the value of the "
4283 "global variable I<cnt> to 0."
4284 msgstr ""
4285 "上記の実行例から、スレッドがキャンセルされ、\n"
4286 "キャンセルクリーンアップハンドラが呼び出され、\n"
4287 "グローバル変数 I<cnt> の値が 0 にリセットされていることが確認できる。"
4288
4289 #. type: Plain text
4290 #: build/C/man3/pthread_cleanup_push.3:194
4291 msgid ""
4292 "In the next run, the main program sets a global variable that causes other "
4293 "thread to terminate normally:"
4294 msgstr ""
4295 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4296 "もう一つのスレッドが正常終了するようにしている。"
4297
4298 #. type: Plain text
4299 #: build/C/man3/pthread_cleanup_push.3:202
4300 #, no-wrap
4301 msgid ""
4302 "$ B<./a.out x>\n"
4303 "New thread started\n"
4304 "cnt = 0\n"
4305 "cnt = 1\n"
4306 "Thread terminated normally; cnt = 2\n"
4307 msgstr ""
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
4314 #. type: Plain text
4315 #: build/C/man3/pthread_cleanup_push.3:210
4316 msgid ""
4317 "From the above, we see that the clean-up handler was not executed (because "
4318 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
4319 msgstr ""
4320 "上記では、 (I<cleanup_pop_arg> が 0 なので) クリーンアップハンドラは\n"
4321 "実行されておらず、その結果 I<cnt> の値はリセットされていないことが\n"
4322 "分かる。"
4323
4324 #. type: Plain text
4325 #: build/C/man3/pthread_cleanup_push.3:215
4326 msgid ""
4327 "In the next run, the main program sets a global variable that causes the "
4328 "other thread to terminate normally, and supplies a nonzero value for "
4329 "I<cleanup_pop_arg>:"
4330 msgstr ""
4331 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4332 "もう一つのスレッドが正常終了するようにし、さらに\n"
4333 "I<cleanup_pop_arg> に 0 以外の値を渡している。"
4334
4335 #. type: Plain text
4336 #: build/C/man3/pthread_cleanup_push.3:224
4337 #, no-wrap
4338 msgid ""
4339 "$ B<./a.out x 1>\n"
4340 "New thread started\n"
4341 "cnt = 0\n"
4342 "cnt = 1\n"
4343 "Called clean-up handler\n"
4344 "Thread terminated normally; cnt = 0\n"
4345 msgstr ""
4346 "$ B<./a.out x 1>\n"
4347 "New thread started\n"
4348 "cnt = 0\n"
4349 "cnt = 1\n"
4350 "Called clean-up handler\n"
4351 "Thread terminated normally; cnt = 0\n"
4352
4353 #. type: Plain text
4354 #: build/C/man3/pthread_cleanup_push.3:231
4355 msgid ""
4356 "In the above, we see that although the thread was not canceled, the clean-up "
4357 "handler was executed, because the argument given to "
4358 "B<pthread_cleanup_pop>()  was nonzero."
4359 msgstr ""
4360 "上記では、スレッドはキャンセルされていないが、クリーンアップハンドラが\n"
4361 "実行されていないことが分かる。これは B<pthread_cleanup_pop>() の引き数\n"
4362 "に 0 以外を渡したからである。"
4363
4364 #. type: Plain text
4365 #: build/C/man3/pthread_cleanup_push.3:240
4366 #, no-wrap
4367 msgid ""
4368 "#include E<lt>pthread.hE<gt>\n"
4369 "#include E<lt>sys/types.hE<gt>\n"
4370 "#include E<lt>stdio.hE<gt>\n"
4371 "#include E<lt>stdlib.hE<gt>\n"
4372 "#include E<lt>unistd.hE<gt>\n"
4373 "#include E<lt>errno.hE<gt>\n"
4374 msgstr ""
4375 "#include E<lt>pthread.hE<gt>\n"
4376 "#include E<lt>sys/types.hE<gt>\n"
4377 "#include E<lt>stdio.hE<gt>\n"
4378 "#include E<lt>stdlib.hE<gt>\n"
4379 "#include E<lt>unistd.hE<gt>\n"
4380 "#include E<lt>errno.hE<gt>\n"
4381
4382 #. type: Plain text
4383 #: build/C/man3/pthread_cleanup_push.3:247
4384 #, no-wrap
4385 msgid ""
4386 "static int done = 0;\n"
4387 "static int cleanup_pop_arg = 0;\n"
4388 "static int cnt = 0;\n"
4389 msgstr ""
4390 "static int done = 0;\n"
4391 "static int cleanup_pop_arg = 0;\n"
4392 "static int cnt = 0;\n"
4393
4394 #. type: Plain text
4395 #: build/C/man3/pthread_cleanup_push.3:254
4396 #, no-wrap
4397 msgid ""
4398 "static void\n"
4399 "cleanup_handler(void *arg)\n"
4400 "{\n"
4401 "    printf(\"Called clean-up handler\\en\");\n"
4402 "    cnt = 0;\n"
4403 "}\n"
4404 msgstr ""
4405 "static void\n"
4406 "cleanup_handler(void *arg)\n"
4407 "{\n"
4408 "    printf(\"Called clean-up handler\\en\");\n"
4409 "    cnt = 0;\n"
4410 "}\n"
4411
4412 #. type: Plain text
4413 #: build/C/man3/pthread_cleanup_push.3:259
4414 #, no-wrap
4415 msgid ""
4416 "static void *\n"
4417 "thread_start(void *arg)\n"
4418 "{\n"
4419 "    time_t start, curr;\n"
4420 msgstr ""
4421 "static void *\n"
4422 "thread_start(void *arg)\n"
4423 "{\n"
4424 "    time_t start, curr;\n"
4425
4426 #. type: Plain text
4427 #: build/C/man3/pthread_cleanup_push.3:261
4428 #, no-wrap
4429 msgid "    printf(\"New thread started\\en\");\n"
4430 msgstr "    printf(\"New thread started\\en\");\n"
4431
4432 #. type: Plain text
4433 #: build/C/man3/pthread_cleanup_push.3:263
4434 #, no-wrap
4435 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4436 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4437
4438 #. type: Plain text
4439 #: build/C/man3/pthread_cleanup_push.3:265
4440 #, no-wrap
4441 msgid "    curr = start = time(NULL);\n"
4442 msgstr "    curr = start = time(NULL);\n"
4443
4444 #. type: Plain text
4445 #: build/C/man3/pthread_cleanup_push.3:274
4446 #, no-wrap
4447 msgid ""
4448 "    while (!done) {\n"
4449 "        pthread_testcancel();           /* A cancellation point */\n"
4450 "        if (curr E<lt> time(NULL)) {\n"
4451 "            curr = time(NULL);\n"
4452 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4453 "            cnt++;\n"
4454 "        }\n"
4455 "    }\n"
4456 msgstr ""
4457 "    while (!done) {\n"
4458 "        pthread_testcancel();           /* A cancellation point */\n"
4459 "        if (curr E<lt> time(NULL)) {\n"
4460 "            curr = time(NULL);\n"
4461 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4462 "            cnt++;\n"
4463 "        }\n"
4464 "    }\n"
4465
4466 #. type: Plain text
4467 #: build/C/man3/pthread_cleanup_push.3:278
4468 #, no-wrap
4469 msgid ""
4470 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4471 "    return NULL;\n"
4472 "}\n"
4473 msgstr ""
4474 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4475 "    return NULL;\n"
4476 "}\n"
4477
4478 #. type: Plain text
4479 #: build/C/man3/pthread_cleanup_push.3:285
4480 #, no-wrap
4481 msgid ""
4482 "int\n"
4483 "main(int argc, char *argv[])\n"
4484 "{\n"
4485 "    pthread_t thr;\n"
4486 "    int s;\n"
4487 "    void *res;\n"
4488 msgstr ""
4489 "int\n"
4490 "main(int argc, char *argv[])\n"
4491 "{\n"
4492 "    pthread_t thr;\n"
4493 "    int s;\n"
4494 "    void *res;\n"
4495
4496 #. type: Plain text
4497 #: build/C/man3/pthread_cleanup_push.3:289
4498 #, no-wrap
4499 msgid ""
4500 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4501 "    if (s != 0)\n"
4502 "        handle_error_en(s, \"pthread_create\");\n"
4503 msgstr ""
4504 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4505 "    if (s != 0)\n"
4506 "        handle_error_en(s, \"pthread_create\");\n"
4507
4508 #. type: Plain text
4509 #: build/C/man3/pthread_cleanup_push.3:291
4510 #, no-wrap
4511 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
4512 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
4513
4514 #. type: Plain text
4515 #: build/C/man3/pthread_cleanup_push.3:296
4516 #, no-wrap
4517 msgid ""
4518 "    if (argc E<gt> 1) {\n"
4519 "        if (argc E<gt> 2)\n"
4520 "            cleanup_pop_arg = atoi(argv[2]);\n"
4521 "        done = 1;\n"
4522 msgstr ""
4523 "    if (argc E<gt> 1) {\n"
4524 "        if (argc E<gt> 2)\n"
4525 "            cleanup_pop_arg = atoi(argv[2]);\n"
4526 "        done = 1;\n"
4527
4528 #. type: Plain text
4529 #: build/C/man3/pthread_cleanup_push.3:303
4530 #, no-wrap
4531 msgid ""
4532 "    } else {\n"
4533 "        printf(\"Canceling thread\\en\");\n"
4534 "        s = pthread_cancel(thr);\n"
4535 "        if (s != 0)\n"
4536 "            handle_error_en(s, \"pthread_cancel\");\n"
4537 "    }\n"
4538 msgstr ""
4539 "    } else {\n"
4540 "        printf(\"Canceling thread\\en\");\n"
4541 "        s = pthread_cancel(thr);\n"
4542 "        if (s != 0)\n"
4543 "            handle_error_en(s, \"pthread_cancel\");\n"
4544 "    }\n"
4545
4546 #. type: Plain text
4547 #: build/C/man3/pthread_cleanup_push.3:314
4548 #, no-wrap
4549 msgid ""
4550 "    if (res == PTHREAD_CANCELED)\n"
4551 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4552 "    else\n"
4553 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4554 "    exit(EXIT_SUCCESS);\n"
4555 "}\n"
4556 msgstr ""
4557 "    if (res == PTHREAD_CANCELED)\n"
4558 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4559 "    else\n"
4560 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4561 "    exit(EXIT_SUCCESS);\n"
4562 "}\n"
4563
4564 #. type: Plain text
4565 #: build/C/man3/pthread_cleanup_push.3:321
4566 msgid ""
4567 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4568 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4569 msgstr ""
4570 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4571 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4572
4573 #. type: TH
4574 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
4575 #, no-wrap
4576 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4577 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4578
4579 #. type: Plain text
4580 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
4581 msgid ""
4582 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
4583 "thread cancellation clean-up handlers while saving cancelability type"
4584 msgstr ""
4585 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - "
4586 "cancelability type を保持したままでスレッドのキャンセルクリーンアップハンドラ"
4587 "の push/pop を行う"
4588
4589 #. type: Plain text
4590 #: build/C/man3/pthread_cleanup_push_defer_np.3:37
4591 #, no-wrap
4592 msgid ""
4593 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4594 "B<                                   void *>I<arg>B<);>\n"
4595 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4596 msgstr ""
4597 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4598 "B<                                   void *>I<arg>B<);>\n"
4599 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4600
4601 #. type: Plain text
4602 #: build/C/man3/pthread_cleanup_push_defer_np.3:40
4603 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
4604 #: build/C/man3/pthread_join.3:37 build/C/man3/pthread_kill.3:37
4605 #: build/C/man3/pthread_setname_np.3:39 build/C/man3/pthread_sigmask.3:38
4606 #: build/C/man3/pthread_sigqueue.3:38 build/C/man3/pthread_tryjoin_np.3:42
4607 #: build/C/man3/pthread_yield.3:37
4608 msgid "Compile and link with I<-pthread>."
4609 msgstr "I<-pthread> を付けてコンパイルとリンクを行う。"
4610
4611 #. type: Plain text
4612 #: build/C/man3/pthread_cleanup_push_defer_np.3:49
4613 msgid "B<pthread_cleanup_push_defer_np>(), B<pthread_cleanup_pop_defer_np>():"
4614 msgstr "B<pthread_cleanup_push_defer_np>(), B<pthread_cleanup_pop_defer_np>():"
4615
4616 #. type: Plain text
4617 #: build/C/man3/pthread_cleanup_push_defer_np.3:51
4618 msgid "_GNU_SOURCE"
4619 msgstr "_GNU_SOURCE"
4620
4621 #. type: Plain text
4622 #: build/C/man3/pthread_cleanup_push_defer_np.3:59
4623 msgid ""
4624 "These functions are the same as B<pthread_cleanup_push>(3)  and "
4625 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
4626 msgstr ""
4627 "これらの関数は B<pthread_cleanup_push>(3) と B<pthread_cleanup_pop>(3) と同じ"
4628 "だが、このページで説明する点が異なる。"
4629
4630 #. type: Plain text
4631 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
4632 msgid ""
4633 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
4634 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
4635 "addition, it also saves the thread's current cancelability type, and sets "
4636 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
4637 "this ensures that cancellation clean-up will occur even if the thread's "
4638 "cancelability type was \"asynchronous\" before the call."
4639 msgstr ""
4640 "B<pthread_cleanup_push>(3) と同様に、\n"
4641 "B<pthread_cleanup_push_defer_np>() は I<routine> をそのスレッドの\n"
4642 "クリーンアップハンドラのスタックに追加する。これに加えて、\n"
4643 "B<pthread_cleanup_push_defer_np>() は現在の cancelability type も\n"
4644 "保存し、cancelability type は \"deferred\" に設定する\n"
4645 "(B<pthread_setcanceltype>(3) 参照)。\n"
4646 "これにより、この関数が呼び出される前のスレッドの cancelability type が\n"
4647 "\"asynchronous\" であったとしても、キャンセルクリーンアップが行われること\n"
4648 "が保証される。"
4649
4650 #. type: Plain text
4651 #: build/C/man3/pthread_cleanup_push_defer_np.3:81
4652 msgid ""
4653 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
4654 "the top-most clean-up handler from the thread's stack of cancellation clean-"
4655 "up handlers.  In addition, it restores the thread's cancelability type to "
4656 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
4657 msgstr ""
4658 "B<pthread_cleanup_pop>(3) と同様に、\n"
4659 "B<pthread_cleanup_pop_restore_np>() はそのスレッドのキャンセル\n"
4660 "クリーンアップハンドラのスタックから一番上にあるクリーンアップハンドラ\n"
4661 "を取り出す。これに加えて、そのスレッドの cancelability type を、対応\n"
4662 "する B<pthread_cleanup_push_defer_np>() が呼ばれた時点の値に戻す。"
4663
4664 #. type: Plain text
4665 #: build/C/man3/pthread_cleanup_push_defer_np.3:87
4666 msgid ""
4667 "The caller must ensure that calls to these functions are paired within the "
4668 "same function, and at the same lexical nesting level.  Other restrictions "
4669 "apply, as described in B<pthread_cleanup_push>(3)."
4670 msgstr ""
4671 "呼び出し側では、これらの関数の呼び出しが同じ関数の中で対となり、かつ\n"
4672 "文法的に同じネストレベル (nesting level) になることを保証しなければ\n"
4673 "ならない。 B<pthread_cleanup_push>(3) で説明されている他の制限も\n"
4674 "適用される。"
4675
4676 #. type: Plain text
4677 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
4678 msgid "This sequence of calls:"
4679 msgstr "以下の一連の呼び出し"
4680
4681 #. type: Plain text
4682 #: build/C/man3/pthread_cleanup_push_defer_np.3:94
4683 #, no-wrap
4684 msgid ""
4685 "pthread_cleanup_push_defer_np(routine, arg);\n"
4686 "pthread_cleanup_pop_restore_np(execute);\n"
4687 msgstr ""
4688 "pthread_cleanup_push_defer_np(routine, arg);\n"
4689 "pthread_cleanup_pop_restore_np(execute);\n"
4690
4691 #. type: Plain text
4692 #: build/C/man3/pthread_cleanup_push_defer_np.3:98
4693 msgid "is equivalent to (but shorter and more efficient than):"
4694 msgstr "と以下は等価である (但し、上の方がより簡潔で効率的である)。"
4695
4696 #. type: Plain text
4697 #: build/C/man3/pthread_cleanup_push_defer_np.3:104
4698 #, no-wrap
4699 msgid "int oldtype;\n"
4700 msgstr "int oldtype;\n"
4701
4702 #. type: Plain text
4703 #: build/C/man3/pthread_cleanup_push_defer_np.3:110
4704 #, no-wrap
4705 msgid ""
4706 "pthread_cleanup_push(routine, arg);\n"
4707 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4708 "\\&...\n"
4709 "pthread_setcanceltype(oldtype, NULL);\n"
4710 "pthread_cleanup_pop(execute);\n"
4711 msgstr ""
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
4718 #. type: Plain text
4719 #: build/C/man3/pthread_cleanup_push_defer_np.3:123
4720 msgid ""
4721 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
4722 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4723 msgstr ""
4724 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
4725 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4726
4727 #. type: TH
4728 #: build/C/man3/pthread_create.3:26
4729 #, no-wrap
4730 msgid "PTHREAD_CREATE"
4731 msgstr "PTHREAD_CREATE"
4732
4733 #. type: Plain text
4734 #: build/C/man3/pthread_create.3:29
4735 msgid "pthread_create - create a new thread"
4736 msgstr "pthread_create - 新しいスレッドを作成する"
4737
4738 #. type: Plain text
4739 #: build/C/man3/pthread_create.3:35
4740 #, no-wrap
4741 msgid ""
4742 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4743 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4744 msgstr ""
4745 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4746 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4747
4748 #. type: Plain text
4749 #: build/C/man3/pthread_create.3:47
4750 msgid ""
4751 "The B<pthread_create>()  function starts a new thread in the calling "
4752 "process.  The new thread starts execution by invoking I<start_routine>(); "
4753 "I<arg> is passed as the sole argument of I<start_routine>()."
4754 msgstr ""
4755 "B<pthread_create>() 関数は、呼び出したプロセス内に新しいスレッドを作成す"
4756 "る。\n"
4757 "新しいスレッドの実行は、 I<start_routine>() を起動することで開始される。\n"
4758 "I<start_routine>() は引き数を一つだけ取り、\n"
4759 "I<arg> が I<start_routine>() の引き数として渡される。"
4760
4761 #. type: Plain text
4762 #: build/C/man3/pthread_create.3:49
4763 msgid "The new thread terminates in one of the following ways:"
4764 msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。"
4765
4766 #. type: IP
4767 #: build/C/man3/pthread_create.3:49 build/C/man3/pthread_create.3:55
4768 #: build/C/man3/pthread_create.3:63 build/C/man3/pthread_create.3:66
4769 #: build/C/man3/pthread_getattr_np.3:52 build/C/man3/pthread_getattr_np.3:55
4770 #: build/C/man3/pthread_getattr_np.3:58
4771 #, no-wrap
4772 msgid "*"
4773 msgstr "*"
4774
4775 #. type: Plain text
4776 #: build/C/man3/pthread_create.3:55
4777 msgid ""
4778 "It calls B<pthread_exit>(3), specifying an exit status value that is "
4779 "available to another thread in the same process that calls "
4780 "B<pthread_join>(3)."
4781 msgstr ""
4782 "スレッドが B<pthread_exit>(3) を呼び出す。\n"
4783 "B<pthread_exit>(3) を呼び出す際には終了ステータス値を指定する。\n"
4784 "この値は B<pthread_join>(3) を呼び出した同じプロセス内の\n"
4785 "別のスレッドで参照できる。"
4786
4787 #. type: Plain text
4788 #: build/C/man3/pthread_create.3:63
4789 msgid ""
4790 "It returns from I<start_routine>().  This is equivalent to calling "
4791 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
4792 msgstr ""
4793 "スレッドが I<start_routine>() から返る。これは、\n"
4794 "I<return> 文に渡した値で B<pthread_exit>(3) を呼び出すのと等価である。"
4795
4796 #. type: Plain text
4797 #: build/C/man3/pthread_create.3:66
4798 msgid "It is canceled (see B<pthread_cancel>(3))."
4799 msgstr "スレッドがキャンセルされる (B<pthread_cancel>(3) 参照)。"
4800
4801 #. type: Plain text
4802 #: build/C/man3/pthread_create.3:72
4803 msgid ""
4804 "Any of the threads in the process calls B<exit>(3), or the main thread "
4805 "performs a return from I<main>().  This causes the termination of all "
4806 "threads in the process."
4807 msgstr ""
4808 "プロセス内のいずれかのスレッドで B<exit>(3) が呼ばれるか、\n"
4809 "メインスレッドで I<main>() 内で return が実行される。\n"
4810 "この場合は、プロセス内の全てのスレッドが終了される。"
4811
4812 #. type: Plain text
4813 #: build/C/man3/pthread_create.3:86
4814 msgid ""
4815 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4816 "are used at thread creation time to determine attributes for the new thread; "
4817 "this structure is initialized using B<pthread_attr_init>(3)  and related "
4818 "functions.  If I<attr> is NULL, then the thread is created with default "
4819 "attributes."
4820 msgstr ""
4821 "I<attr> 引き数は I<pthread_attr_t> 構造体へのポインタであり、\n"
4822 "I<pthread_attr_t> 構造体の内容を使用して、スレッド作成時に\n"
4823 "新しいスレッドの属性が決定される。\n"
4824 "この構造体は B<pthread_attr_init>(3) や関連の関数を使って初期化される。\n"
4825 "I<attr> が NULL の場合、新しいスレッドはデフォルトの属性で作成される。"
4826
4827 #. type: Plain text
4828 #: build/C/man3/pthread_create.3:93
4829 msgid ""
4830 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
4831 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4832 "used to refer to the thread in subsequent calls to other pthreads functions."
4833 msgstr ""
4834 "成功した場合は、 B<pthread_create>() は返る前に新しいスレッドの ID を\n"
4835 "I<thread> が指すバッファに格納する。この ID は、これ以降に他の\n"
4836 "pthreads 関数の呼び出しでスレッドを参照するのに使用される。"
4837
4838 #. type: Plain text
4839 #: build/C/man3/pthread_create.3:101
4840 msgid ""
4841 "The new thread inherits a copy of the creating thread's signal mask "
4842 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
4843 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
4844 "thread's alternate signal stack (B<sigaltstack>(2))."
4845 msgstr ""
4846 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスク\n"
4847 "(B<pthread_sigmask>(3) 参照) のコピーを継承する。\n"
4848 "新しいスレッドの処理待ちシグナル (B<sigpending>(2)) の集合は空となる。\n"
4849 "新しいスレッドはスレッドを作成したスレッドの代替シグナルスタック\n"
4850 "(B<sigaltstack>(2)) を継承しない。"
4851
4852 #. type: Plain text
4853 #: build/C/man3/pthread_create.3:104
4854 msgid ""
4855 "The new thread inherits the calling thread's floating-point environment "
4856 "(B<fenv>(3))."
4857 msgstr ""
4858 "新しいスレッドは呼び出したスレッドの浮動小数点環境 (B<fenv>(3))\n"
4859 "を継承する。"
4860
4861 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4862 #. type: Plain text
4863 #: build/C/man3/pthread_create.3:109
4864 msgid ""
4865 "The initial value of the new thread's CPU-time clock is 0 (see "
4866 "B<pthread_getcpuclockid>(3))."
4867 msgstr ""
4868 "新しいスレッドの CPU 時間時計の初期値は 0 である\n"
4869 "(B<pthread_getcpuclockid>(3) 参照)。"
4870
4871 #. type: SS
4872 #: build/C/man3/pthread_create.3:109
4873 #, no-wrap
4874 msgid "Linux-specific details"
4875 msgstr "Linux 固有の詳細"
4876
4877 #. type: Plain text
4878 #: build/C/man3/pthread_create.3:115
4879 msgid ""
4880 "The new thread inherits copies of the calling thread's capability sets (see "
4881 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4882 msgstr ""
4883 "新しいスレッドは、呼び出したスレッドの\n"
4884 "ケーパビリティセット (B<capabilities>(7) 参照) と \n"
4885 "CPU affinity マスク (B<sched_setaffinity>(2) 参照) の\n"
4886 "コピーをを継承しない。"
4887
4888 #. type: Plain text
4889 #: build/C/man3/pthread_create.3:122
4890 msgid ""
4891 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
4892 "number, and the contents of I<*thread> are undefined."
4893 msgstr ""
4894 "成功すると、 B<pthread_create>() は 0 を返す。\n"
4895 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
4896
4897 #. type: TP
4898 #: build/C/man3/pthread_create.3:123 build/C/man3/pthread_create.3:126
4899 #: build/C/man3/pthread_sigqueue.3:72
4900 #, no-wrap
4901 msgid "B<EAGAIN>"
4902 msgstr "B<EAGAIN>"
4903
4904 #. type: Plain text
4905 #: build/C/man3/pthread_create.3:126
4906 msgid "Insufficient resources to create another thread."
4907 msgstr "別のスレッドを作成するのに十分なリソースがない。"
4908
4909 #.  NOTE! The following should match the description in fork(2)
4910 #. type: Plain text
4911 #: build/C/man3/pthread_create.3:144
4912 msgid ""
4913 "A system-imposed limit on the number of threads was encountered.  There are "
4914 "a number of limits that may trigger this error: the B<RLIMIT_NPROC> soft "
4915 "resource limit (set via B<setrlimit>(2)), which limits the number of "
4916 "processes and threads for a real user ID, was reached; the kernel's system-"
4917 "wide limit on the number of processes and threads, I</proc/sys/kernel/"
4918 "threads-max>, was reached (see B<proc>(5)); or the maximum number of PIDs, "
4919 "I</proc/sys/kernel/pid_max>, was reached (see B<proc>(5))."
4920 msgstr ""
4921 "システムで設定されたスレッド数の上限に達していた。 このエラーの原因となる上限"
4922 "値はいくつかある。 実ユーザ ID 当たりのプロセス数とスレッド数の上限である、ソ"
4923 "フトリソース上限 B<RLIMIT_NPROC> に達していた (B<setrlimit>(2) で設定でき"
4924 "る)。 カーネルのシステム全体のプロセスとスレッドの数の上限値である I</proc/"
4925 "sys/kernel/threads-max> が達していた (B<proc>(5) 参照)。 PID の最大値 I</"
4926 "proc/sys/kernel/pid_max> に達していた (B<proc>(5) 参照)。"
4927
4928 #. type: Plain text
4929 #: build/C/man3/pthread_create.3:148
4930 msgid "Invalid settings in I<attr>."
4931 msgstr "I<attr> で指定された設定が不正である。"
4932
4933 #. type: TP
4934 #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_setschedparam.3:129
4935 #: build/C/man3/pthread_setschedprio.3:66
4936 #, no-wrap
4937 msgid "B<EPERM>"
4938 msgstr "B<EPERM>"
4939
4940 #. type: Plain text
4941 #: build/C/man3/pthread_create.3:153
4942 msgid ""
4943 "No permission to set the scheduling policy and parameters specified in "
4944 "I<attr>."
4945 msgstr ""
4946 "I<attr> に指定されたスケジューリングポリシーとパラメータを\n"
4947 "設定する許可がない。"
4948
4949 #. type: Plain text
4950 #: build/C/man3/pthread_create.3:167
4951 msgid ""
4952 "See B<pthread_self>(3)  for further information on the thread ID returned in "
4953 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
4954 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4955 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4956 msgstr ""
4957 "B<pthread_create>() が I<*thread> で返すスレッド ID についての\n"
4958 "詳しい情報は B<pthread_self>(3) を参照のこと。\n"
4959 "リアルタイムスケジューリングポリシーが使用されない限り、\n"
4960 "B<pthread_create>() の呼び出し後に、\n"
4961 "どのスレッドが\\(em呼び出したスレッドか新しいスレッドか\\(em\n"
4962 "次に実行されるかは決まっていない。"
4963
4964 #. type: Plain text
4965 #: build/C/man3/pthread_create.3:187
4966 msgid ""
4967 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
4968 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
4969 "terminate and fetch its exit status.  Only when a terminated joinable thread "
4970 "has been joined are the last of its resources released back to the system.  "
4971 "When a detached thread terminates, its resources are automatically released "
4972 "back to the system: it is not possible to join with the thread in order to "
4973 "obtain its exit status.  Making a thread detached is useful for some types "
4974 "of daemon threads whose exit status the application does not need to care "
4975 "about.  By default, a new thread is created in a joinable state, unless "
4976 "I<attr> was set to create the thread in a detached state (using "
4977 "B<pthread_attr_setdetachstate>(3))."
4978 msgstr ""
4979 "スレッドは I<join 可能>か I<detached (切り離された状態)> のどちらかに\n"
4980 "することができる。スレッドが join 可能な場合、別のスレッドが\n"
4981 "B<pthread_join>(3) を使って終了したスレッドを待ち、終了ステータスを取得\n"
4982 "することができる。終了した join 可能なスレッドは join された場合にのみ、\n"
4983 "そのスレッドの最後に残ったリソースが解放されシステムに戻される。\n"
4984 "detached 状態のスレッドが終了すると、そのスレッドのリソースは自動的に\n"
4985 "システムに戻される。detached 状態のスレッドを join して、その終了\n"
4986 "ステータスを取得することはできない。スレッドを detached 状態にするのは、\n"
4987 "その終了ステータスをアプリケーションが気にする必要がないある種の\n"
4988 "デーモン (daemon) スレッドでは有用である。\n"
4989 "デフォルトでは、新しいスレッドは join 可能な状態で作成される。\n"
4990 "(B<pthread_attr_setdetachstate>(3) を使って) I<attr> でスレッドが\n"
4991 "detached 状態で作成されるように設定されていない限り、join 可能な状態で\n"
4992 "作成される。"
4993
4994 #.  FIXME . Perhaps some of the following detail should be in
4995 #.  a future pthread_attr_setstacksize(3) page.
4996 #. type: Plain text
4997 #: build/C/man3/pthread_create.3:203
4998 msgid ""
4999 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
5000 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
5001 "resource limit I<at the time the program started> has any value other than "
5002 "\"unlimited\", then it determines the default stack size of new threads.  "
5003 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
5004 "explicitly set in the I<attr> argument used to create a thread, in order to "
5005 "obtain a stack size other than the default."
5006 msgstr ""
5007 "Linux/x86-32 では、新しいスレッドのデフォルトのスタックサイズは 2MB で\n"
5008 "ある。NPTL スレッド実装の下では、I<プログラム開始時の> B<RLIMIT_STACK>\n"
5009 "ソフトリソース上限が\"unlimited\" 以外の場合、その値が新しいスレッドのデ\n"
5010 "フォルトのスタックサイズとなる。\n"
5011 "B<pthread_attr_setstacksize>(3) を使って、スレッドを作成する際の\n"
5012 "I<attr> 引き数に明示的にスタックサイズ属性を設定することで、\n"
5013 "デフォルト値以外のスタックサイズを得ることができる。"
5014
5015 #. type: Plain text
5016 #: build/C/man3/pthread_create.3:209
5017 msgid ""
5018 "In the obsolete LinuxThreads implementation, each of the threads in a "
5019 "process has a different process ID.  This is in violation of the POSIX "
5020 "threads specification, and is the source of many other nonconformances to "
5021 "the standard; see B<pthreads>(7)."
5022 msgstr ""
5023 "廃止予定の LinuxThreads 実装では、プロセス内の各スレッドは異なる\n"
5024 "プロセス ID を持つ。これは POSIX スレッドの規格に違反しており、\n"
5025 "他の多くの標準非準拠の点の原因になっている。\n"
5026 "B<pthreads>(7) を参照のこと。"
5027
5028 #. type: Plain text
5029 #: build/C/man3/pthread_create.3:213
5030 msgid ""
5031 "The program below demonstrates the use of B<pthread_create>(), as well as a "
5032 "number of other functions in the pthreads API."
5033 msgstr ""
5034 "以下のプログラムは、 B<pthread_create>() や\n"
5035 "pthreads API の他のいろいろな関数の使用例を示している。"
5036
5037 #. type: Plain text
5038 #: build/C/man3/pthread_create.3:218
5039 msgid ""
5040 "In the following run, on a system providing the NPTL threading "
5041 "implementation, the stack size defaults to the value given by the \"stack "
5042 "size\" resource limit:"
5043 msgstr ""
5044 "以下の実行例は、 NPTL スレッド実装が提供されているシステムでのもので、\n"
5045 "スタックサイズがデフォルト値の \"stack size\" リソース上限で指定される値\n"
5046 "になる。"
5047
5048 #. type: Plain text
5049 #: build/C/man3/pthread_create.3:230
5050 #, no-wrap
5051 msgid ""
5052 "$B< ulimit -s>\n"
5053 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
5054 "$B< ./a.out hola salut servus>\n"
5055 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
5056 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
5057 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
5058 "Joined with thread 1; returned value was HOLA\n"
5059 "Joined with thread 2; returned value was SALUT\n"
5060 "Joined with thread 3; returned value was SERVUS\n"
5061 msgstr ""
5062 "$B< ulimit -s>\n"
5063 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
5064 "$B< ./a.out hola salut servus>\n"
5065 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
5066 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
5067 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
5068 "Joined with thread 1; returned value was HOLA\n"
5069 "Joined with thread 2; returned value was SALUT\n"
5070 "Joined with thread 3; returned value was SERVUS\n"
5071
5072 #. type: Plain text
5073 #: build/C/man3/pthread_create.3:236
5074 msgid ""
5075 "In the next run, the program explicitly sets a stack size of 1MB (using "
5076 "B<pthread_attr_setstacksize>(3))  for the created threads:"
5077 msgstr ""
5078 "次の実行例では、プログラム内で、作成されるスレッドに対して\n"
5079 "(B<pthread_attr_setstacksize>(3) を使って1MB のスタックサイズを\n"
5080 "明示的に設定している。"
5081
5082 #. type: Plain text
5083 #: build/C/man3/pthread_create.3:246
5084 #, no-wrap
5085 msgid ""
5086 "$B< ./a.out -s 0x100000 hola salut servus>\n"
5087 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
5088 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
5089 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
5090 "Joined with thread 1; returned value was HOLA\n"
5091 "Joined with thread 2; returned value was SALUT\n"
5092 "Joined with thread 3; returned value was SERVUS\n"
5093 msgstr ""
5094 "$B< ./a.out -s 0x100000 hola salut servus>\n"
5095 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
5096 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
5097 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
5098 "Joined with thread 1; returned value was HOLA\n"
5099 "Joined with thread 2; returned value was SALUT\n"
5100 "Joined with thread 3; returned value was SERVUS\n"
5101
5102 #. type: Plain text
5103 #: build/C/man3/pthread_create.3:258
5104 #, no-wrap
5105 msgid ""
5106 "#include E<lt>pthread.hE<gt>\n"
5107 "#include E<lt>string.hE<gt>\n"
5108 "#include E<lt>stdio.hE<gt>\n"
5109 "#include E<lt>stdlib.hE<gt>\n"
5110 "#include E<lt>unistd.hE<gt>\n"
5111 "#include E<lt>errno.hE<gt>\n"
5112 "#include E<lt>ctype.hE<gt>\n"
5113 msgstr ""
5114 "#include E<lt>pthread.hE<gt>\n"
5115 "#include E<lt>string.hE<gt>\n"
5116 "#include E<lt>stdio.hE<gt>\n"
5117 "#include E<lt>stdlib.hE<gt>\n"
5118 "#include E<lt>unistd.hE<gt>\n"
5119 "#include E<lt>errno.hE<gt>\n"
5120 "#include E<lt>ctype.hE<gt>\n"
5121
5122 #. type: Plain text
5123 #: build/C/man3/pthread_create.3:264 build/C/man3/pthread_getcpuclockid.3:116
5124 #, no-wrap
5125 msgid ""
5126 "#define handle_error(msg) \\e\n"
5127 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5128 msgstr ""
5129 "#define handle_error(msg) \\e\n"
5130 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5131
5132 #. type: Plain text
5133 #: build/C/man3/pthread_create.3:270
5134 #, no-wrap
5135 msgid ""
5136 "struct thread_info {    /* Used as argument to thread_start() */\n"
5137 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
5138 "    int       thread_num;       /* Application-defined thread # */\n"
5139 "    char     *argv_string;      /* From command-line argument */\n"
5140 "};\n"
5141 msgstr ""
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
5148 #. type: Plain text
5149 #: build/C/man3/pthread_create.3:273
5150 #, no-wrap
5151 msgid ""
5152 "/* Thread start function: display address near top of our stack,\n"
5153 "   and return upper-cased copy of argv_string */\n"
5154 msgstr ""
5155 "/* Thread start function: display address near top of our stack,\n"
5156 "   and return upper-cased copy of argv_string */\n"
5157
5158 #. type: Plain text
5159 #: build/C/man3/pthread_create.3:279
5160 #, no-wrap
5161 msgid ""
5162 "static void *\n"
5163 "thread_start(void *arg)\n"
5164 "{\n"
5165 "    struct thread_info *tinfo = arg;\n"
5166 "    char *uargv, *p;\n"
5167 msgstr ""
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
5174 #. type: Plain text
5175 #: build/C/man3/pthread_create.3:282
5176 #, no-wrap
5177 msgid ""
5178 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5179 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5180 msgstr ""
5181 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5182 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5183
5184 #. type: Plain text
5185 #: build/C/man3/pthread_create.3:286
5186 #, no-wrap
5187 msgid ""
5188 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5189 "    if (uargv == NULL)\n"
5190 "        handle_error(\"strdup\");\n"
5191 msgstr ""
5192 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5193 "    if (uargv == NULL)\n"
5194 "        handle_error(\"strdup\");\n"
5195
5196 #. type: Plain text
5197 #: build/C/man3/pthread_create.3:289
5198 #, no-wrap
5199 msgid ""
5200 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5201 "        *p = toupper(*p);\n"
5202 msgstr ""
5203 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5204 "        *p = toupper(*p);\n"
5205
5206 #. type: Plain text
5207 #: build/C/man3/pthread_create.3:292
5208 #, no-wrap
5209 msgid ""
5210 "    return uargv;\n"
5211 "}\n"
5212 msgstr ""
5213 "    return uargv;\n"
5214 "}\n"
5215
5216 #. type: Plain text
5217 #: build/C/man3/pthread_create.3:301
5218 #, no-wrap
5219 msgid ""
5220 "int\n"
5221 "main(int argc, char *argv[])\n"
5222 "{\n"
5223 "    int s, tnum, opt, num_threads;\n"
5224 "    struct thread_info *tinfo;\n"
5225 "    pthread_attr_t attr;\n"
5226 "    int stack_size;\n"
5227 "    void *res;\n"
5228 msgstr ""
5229 "int\n"
5230 "main(int argc, char *argv[])\n"
5231 "{\n"
5232 "    int s, tnum, opt, num_threads;\n"
5233 "    struct thread_info *tinfo;\n"
5234 "    pthread_attr_t attr;\n"
5235 "    int stack_size;\n"
5236 "    void *res;\n"
5237
5238 #. type: Plain text
5239 #: build/C/man3/pthread_create.3:303
5240 #, no-wrap
5241 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
5242 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
5243
5244 #. type: Plain text
5245 #: build/C/man3/pthread_create.3:310
5246 #, no-wrap
5247 msgid ""
5248 "    stack_size = -1;\n"
5249 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5250 "        switch (opt) {\n"
5251 "        case \\(aqs\\(aq:\n"
5252 "            stack_size = strtoul(optarg, NULL, 0);\n"
5253 "            break;\n"
5254 msgstr ""
5255 "    stack_size = -1;\n"
5256 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5257 "        switch (opt) {\n"
5258 "        case \\(aqs\\(aq:\n"
5259 "            stack_size = strtoul(optarg, NULL, 0);\n"
5260 "            break;\n"
5261
5262 #. type: Plain text
5263 #: build/C/man3/pthread_create.3:317
5264 #, no-wrap
5265 msgid ""
5266 "        default:\n"
5267 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5268 "                    argv[0]);\n"
5269 "            exit(EXIT_FAILURE);\n"
5270 "        }\n"
5271 "    }\n"
5272 msgstr ""
5273 "        default:\n"
5274 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5275 "                    argv[0]);\n"
5276 "            exit(EXIT_FAILURE);\n"
5277 "        }\n"
5278 "    }\n"
5279
5280 #. type: Plain text
5281 #: build/C/man3/pthread_create.3:319
5282 #, no-wrap
5283 msgid "    num_threads = argc - optind;\n"
5284 msgstr "    num_threads = argc - optind;\n"
5285
5286 #. type: Plain text
5287 #: build/C/man3/pthread_create.3:321
5288 #, no-wrap
5289 msgid "    /* Initialize thread creation attributes */\n"
5290 msgstr "    /* Initialize thread creation attributes */\n"
5291
5292 #. type: Plain text
5293 #: build/C/man3/pthread_create.3:325
5294 #, no-wrap
5295 msgid ""
5296 "    s = pthread_attr_init(&attr);\n"
5297 "    if (s != 0)\n"
5298 "        handle_error_en(s, \"pthread_attr_init\");\n"
5299 msgstr ""
5300 "    s = pthread_attr_init(&attr);\n"
5301 "    if (s != 0)\n"
5302 "        handle_error_en(s, \"pthread_attr_init\");\n"
5303
5304 #. type: Plain text
5305 #: build/C/man3/pthread_create.3:331
5306 #, no-wrap
5307 msgid ""
5308 "    if (stack_size E<gt> 0) {\n"
5309 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5310 "        if (s != 0)\n"
5311 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5312 "    }\n"
5313 msgstr ""
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
5320 #. type: Plain text
5321 #: build/C/man3/pthread_create.3:333
5322 #, no-wrap
5323 msgid "    /* Allocate memory for pthread_create() arguments */\n"
5324 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
5325
5326 #. type: Plain text
5327 #: build/C/man3/pthread_create.3:337
5328 #, no-wrap
5329 msgid ""
5330 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5331 "    if (tinfo == NULL)\n"
5332 "        handle_error(\"calloc\");\n"
5333 msgstr ""
5334 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5335 "    if (tinfo == NULL)\n"
5336 "        handle_error(\"calloc\");\n"
5337
5338 #. type: Plain text
5339 #: build/C/man3/pthread_create.3:339
5340 #, no-wrap
5341 msgid "    /* Create one thread for each command-line argument */\n"
5342 msgstr "    /* Create one thread for each command-line argument */\n"
5343
5344 #. type: Plain text
5345 #: build/C/man3/pthread_create.3:343
5346 #, no-wrap
5347 msgid ""
5348 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5349 "        tinfo[tnum].thread_num = tnum + 1;\n"
5350 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5351 msgstr ""
5352 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5353 "        tinfo[tnum].thread_num = tnum + 1;\n"
5354 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5355
5356 #. type: Plain text
5357 #: build/C/man3/pthread_create.3:346
5358 #, no-wrap
5359 msgid ""
5360 "        /* The pthread_create() call stores the thread ID into\n"
5361 "           corresponding element of tinfo[] */\n"
5362 msgstr ""
5363 "        /* The pthread_create() call stores the thread ID into\n"
5364 "           corresponding element of tinfo[] */\n"
5365
5366 #. type: Plain text
5367 #: build/C/man3/pthread_create.3:352
5368 #, no-wrap
5369 msgid ""
5370 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5371 "                           &thread_start, &tinfo[tnum]);\n"
5372 "        if (s != 0)\n"
5373 "            handle_error_en(s, \"pthread_create\");\n"
5374 "    }\n"
5375 msgstr ""
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
5382 #. type: Plain text
5383 #: build/C/man3/pthread_create.3:355
5384 #, no-wrap
5385 msgid ""
5386 "    /* Destroy the thread attributes object, since it is no\n"
5387 "       longer needed */\n"
5388 msgstr ""
5389 "    /* Destroy the thread attributes object, since it is no\n"
5390 "       longer needed */\n"
5391
5392 #. type: Plain text
5393 #: build/C/man3/pthread_create.3:359
5394 #, no-wrap
5395 msgid ""
5396 "    s = pthread_attr_destroy(&attr);\n"
5397 "    if (s != 0)\n"
5398 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5399 msgstr ""
5400 "    s = pthread_attr_destroy(&attr);\n"
5401 "    if (s != 0)\n"
5402 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5403
5404 #. type: Plain text
5405 #: build/C/man3/pthread_create.3:361
5406 #, no-wrap
5407 msgid "    /* Now join with each thread, and display its returned value */\n"
5408 msgstr "    /* Now join with each thread, and display its returned value */\n"
5409
5410 #. type: Plain text
5411 #: build/C/man3/pthread_create.3:366
5412 #, no-wrap
5413 msgid ""
5414 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5415 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5416 "        if (s != 0)\n"
5417 "            handle_error_en(s, \"pthread_join\");\n"
5418 msgstr ""
5419 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5420 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5421 "        if (s != 0)\n"
5422 "            handle_error_en(s, \"pthread_join\");\n"
5423
5424 #. type: Plain text
5425 #: build/C/man3/pthread_create.3:371
5426 #, no-wrap
5427 msgid ""
5428 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5429 "                tinfo[tnum].thread_num, (char *) res);\n"
5430 "        free(res);      /* Free memory allocated by thread */\n"
5431 "    }\n"
5432 msgstr ""
5433 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5434 "                tinfo[tnum].thread_num, (char *) res);\n"
5435 "        free(res);      /* Free memory allocated by thread */\n"
5436 "    }\n"
5437
5438 #. type: Plain text
5439 #: build/C/man3/pthread_create.3:375
5440 #, no-wrap
5441 msgid ""
5442 "    free(tinfo);\n"
5443 "    exit(EXIT_SUCCESS);\n"
5444 "}\n"
5445 msgstr ""
5446 "    free(tinfo);\n"
5447 "    exit(EXIT_SUCCESS);\n"
5448 "}\n"
5449
5450 #. type: Plain text
5451 #: build/C/man3/pthread_create.3:389
5452 msgid ""
5453 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5454 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5455 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), "
5456 "B<pthreads>(7)"
5457 msgstr ""
5458 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5459 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5460 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), "
5461 "B<pthreads>(7)"
5462
5463 #. type: TH
5464 #: build/C/man3/pthread_detach.3:26
5465 #, no-wrap
5466 msgid "PTHREAD_DETACH"
5467 msgstr "PTHREAD_DETACH"
5468
5469 #. type: TH
5470 #: build/C/man3/pthread_detach.3:26 build/C/man3/pthread_join.3:26
5471 #, no-wrap
5472 msgid "2008-11-27"
5473 msgstr "2008-11-27"
5474
5475 #. type: Plain text
5476 #: build/C/man3/pthread_detach.3:29
5477 msgid "pthread_detach - detach a thread"
5478 msgstr "pthread_detach - スレッドを切り離す (detach する)"
5479
5480 #. type: Plain text
5481 #: build/C/man3/pthread_detach.3:34
5482 #, no-wrap
5483 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5484 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5485
5486 #. type: Plain text
5487 #: build/C/man3/pthread_detach.3:46
5488 msgid ""
5489 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
5490 "as detached.  When a detached thread terminates, its resources are "
5491 "automatically released back to the system without the need for another "
5492 "thread to join with the terminated thread."
5493 msgstr ""
5494 "B<pthread_detach>() 関数は I<thread> で識別されるスレッドに\n"
5495 "detached (切り離された状態) という印を付ける。\n"
5496 "detached 状態のスレッドが終了すると、\n"
5497 "別のスレッドが終了されたスレッドを join しなくても、\n"
5498 "そのスレッドのリソースは自動的に解放されてシステムに戻される。"
5499
5500 #. type: Plain text
5501 #: build/C/man3/pthread_detach.3:49
5502 msgid ""
5503 "Attempting to detach an already detached thread results in unspecified "
5504 "behavior."
5505 msgstr ""
5506 "すでに detach 状態のスレッドを detach しようとした場合に\n"
5507 "どのような結果となるかは規定されていない。"
5508
5509 #. type: Plain text
5510 #: build/C/man3/pthread_detach.3:54
5511 msgid ""
5512 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
5513 "number."
5514 msgstr ""
5515 "成功すると、B<pthread_detach>() は 0 を返す。\n"
5516 "エラーの場合、エラー番号を返す。"
5517
5518 #. type: Plain text
5519 #: build/C/man3/pthread_detach.3:59 build/C/man3/pthread_join.3:89
5520 msgid "I<thread> is not a joinable thread."
5521 msgstr "I<thread> が join 可能なスレッドではない。"
5522
5523 #. type: Plain text
5524 #: build/C/man3/pthread_detach.3:70
5525 msgid ""
5526 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
5527 "or be made joinable again."
5528 msgstr ""
5529 "いったんスレッドを detached 状態にすると、\n"
5530 "そのスレッドを B<pthread_join>(3) で join したり、\n"
5531 "もう一度 join 可能にしたりすることはできない。"
5532
5533 #. type: Plain text
5534 #: build/C/man3/pthread_detach.3:77
5535 msgid ""
5536 "A new thread can be created in a detached state using "
5537 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
5538 "I<attr> argument of B<pthread_create>(3)."
5539 msgstr ""
5540 "B<pthread_attr_setdetachstate>(3) を使って\n"
5541 "B<pthread_create>(3) の I<attr> 引き数の detached 属性を設定することで、\n"
5542 "新しいスレッドを detached 状態で作成することができる。"
5543
5544 #. type: Plain text
5545 #: build/C/man3/pthread_detach.3:84
5546 msgid ""
5547 "The detached attribute merely determines the behavior of the system when the "
5548 "thread terminates; it does not prevent the thread from being terminated if "
5549 "the process terminates using B<exit>(3)  (or equivalently, if the main "
5550 "thread returns)."
5551 msgstr ""
5552 "detached 属性は、スレッドが終了した際のシステムの動作を決めるだけである。\n"
5553 "プロセスが B<exit>(3) を使って終了した場合に、そのスレッドが終了され\n"
5554 "なくなるようなことはない (なお、メインスレッドが return した場合も\n"
5555 "プロセスが B<exit>(3) を使って終了した場合と全く同じである)。 "
5556
5557 #. type: Plain text
5558 #: build/C/man3/pthread_detach.3:93
5559 msgid ""
5560 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
5561 "thread that an application creates, so that system resources for the thread "
5562 "can be released.  (But note that the resources of all threads are freed when "
5563 "the process terminates.)"
5564 msgstr ""
5565 "アプリケーションが作成した各スレッドについて、そのスレッドが使用して\n"
5566 "いるシステムリソースを解放できるように、B<pthread_join>(3) か\n"
5567 "B<pthread_detach>() のどちらかを呼び出すべきである (ただし、プロセスが\n"
5568 "終了するときには、全てのスレッドのリソースが解放される)。"
5569
5570 #. type: Plain text
5571 #: build/C/man3/pthread_detach.3:95
5572 msgid "The following statement detaches the calling thread:"
5573 msgstr "以下の文は、呼び出したスレッド自身を detach する。"
5574
5575 #. type: Plain text
5576 #: build/C/man3/pthread_detach.3:97
5577 #, no-wrap
5578 msgid "    pthread_detach(pthread_self());\n"
5579 msgstr "    pthread_detach(pthread_self());\n"
5580
5581 #. type: Plain text
5582 #: build/C/man3/pthread_detach.3:104
5583 msgid ""
5584 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), "
5585 "B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5586 msgstr ""
5587 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), "
5588 "B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5589
5590 #. type: TH
5591 #: build/C/man3/pthread_equal.3:26
5592 #, no-wrap
5593 msgid "PTHREAD_EQUAL"
5594 msgstr "PTHREAD_EQUAL"
5595
5596 #. type: TH
5597 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
5598 #: build/C/man3/pthread_getcpuclockid.3:26
5599 #: build/C/man3/pthread_setaffinity_np.3:26
5600 #: build/C/man3/pthread_setconcurrency.3:25
5601 #, no-wrap
5602 msgid "2014-05-23"
5603 msgstr "2014-05-23"
5604
5605 #. type: Plain text
5606 #: build/C/man3/pthread_equal.3:29
5607 msgid "pthread_equal - compare thread IDs"
5608 msgstr "pthread_equal - スレッド ID を比較する"
5609
5610 #. type: Plain text
5611 #: build/C/man3/pthread_equal.3:34
5612 #, no-wrap
5613 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5614 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5615
5616 #. type: Plain text
5617 #: build/C/man3/pthread_equal.3:41
5618 msgid "The B<pthread_equal>()  function compares two thread identifiers."
5619 msgstr "B<pthread_equal>() 関数は 2 つのスレッド識別子の比較を行う。"
5620
5621 #. type: Plain text
5622 #: build/C/man3/pthread_equal.3:45
5623 msgid ""
5624 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
5625 "value; otherwise, it returns 0."
5626 msgstr ""
5627 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
5628 "そうでなければ 0 を返す。"
5629
5630 #.  SH VERSIONS
5631 #.  Available since glibc 2.0
5632 #. type: Plain text
5633 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
5634 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_testcancel.3:58
5635 msgid "This function always succeeds."
5636 msgstr "この関数は常に成功する。"
5637
5638 #. type: Plain text
5639 #: build/C/man3/pthread_equal.3:52
5640 msgid "The B<pthread_equal>()  function is thread-safe."
5641 msgstr "B<pthread_equal>() 関数はスレッドセーフである。"
5642
5643 #. type: Plain text
5644 #: build/C/man3/pthread_equal.3:61
5645 msgid ""
5646 "The B<pthread_equal>()  function is necessary because thread IDs should be "
5647 "considered opaque: there is no portable way for applications to directly "
5648 "compare two I<pthread_t> values."
5649 msgstr ""
5650 "B<pthread_equal>() 関数が必要なのは、\n"
5651 "スレッド ID はその内部構造を意識すべきではないためである。\n"
5652 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
5653 "移植性を確保できる形で比較する方法はない。"
5654
5655 #. type: Plain text
5656 #: build/C/man3/pthread_equal.3:65
5657 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5658 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5659
5660 #. type: TH
5661 #: build/C/man3/pthread_exit.3:26
5662 #, no-wrap
5663 msgid "PTHREAD_EXIT"
5664 msgstr "PTHREAD_EXIT"
5665
5666 #. type: Plain text
5667 #: build/C/man3/pthread_exit.3:29
5668 msgid "pthread_exit - terminate calling thread"
5669 msgstr "pthread_exit - 呼び出したスレッドを終了する"
5670
5671 #. type: Plain text
5672 #: build/C/man3/pthread_exit.3:34
5673 #, no-wrap
5674 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
5675 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
5676
5677 #. type: Plain text
5678 #: build/C/man3/pthread_exit.3:45
5679 msgid ""
5680 "The B<pthread_exit>()  function terminates the calling thread and returns a "
5681 "value via I<retval> that (if the thread is joinable)  is available to "
5682 "another thread in the same process that calls B<pthread_join>(3)."
5683 msgstr ""
5684 "B<pthread_exit>() 関数は、呼び出したスレッドを終了し、\n"
5685 "I<retval> 経由で値を返す。\n"
5686 "この値は (そのスレッドが join 可能な場合に) B<pthread_join>(3) を\n"
5687 "呼び出した同じプロセス内の別のスレッドが参照できる値と同じである。"
5688
5689 #. type: Plain text
5690 #: build/C/man3/pthread_exit.3:55
5691 msgid ""
5692 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
5693 "not yet been popped, are popped (in the reverse of the order in which they "
5694 "were pushed)  and executed.  If the thread has any thread-specific data, "
5695 "then, after the clean-up handlers have been executed, the corresponding "
5696 "destructor functions are called, in an unspecified order."
5697 msgstr ""
5698 "B<pthread_cleanup_push>(3) で設定されたクリーンアップハンドラのうち、\n"
5699 "まだ pop (取り出されていない) ハンドラを (push されたのと逆の順序で)\n"
5700 "取り出して実行する。そのスレッドがスレッド固有のデータを持っている\n"
5701 "場合は、クリーンアップハンドラが実行された後に、スレッド固有のデータ\n"
5702 "に対応するデストラクタ (destructor) 関数が呼び出される (呼び出し順序\n"
5703 "は規定されていない)。"
5704
5705 #. type: Plain text
5706 #: build/C/man3/pthread_exit.3:62
5707 msgid ""
5708 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
5709 "variables, semaphores, and file descriptors) are not released, and functions "
5710 "registered using B<atexit>(3)  are not called."
5711 msgstr ""
5712 "スレッドが終了する際に、プロセスの共有リソース (例えば、mutex、状態変数\n"
5713 "(condition variables)、セマフォ、ファイルディスクリプタ)が解放される。\n"
5714 "B<atexit>(3) を使って登録された関数は呼び出されない。"
5715
5716 #. type: Plain text
5717 #: build/C/man3/pthread_exit.3:71
5718 msgid ""
5719 "After the last thread in a process terminates, the process terminates as by "
5720 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
5721 "resources are released and functions registered using B<atexit>(3)  are "
5722 "called."
5723 msgstr ""
5724 "プロセスの最後のスレッドが終了すると、そのプロセスは、終了ステータス 0\n"
5725 "で B<exit>(3) を呼び出した場合と全く同じように終了する。したがって、\n"
5726 "プロセスの共有リソースは解放され、B<atexit>(3) を使って登録された関数\n"
5727 "が呼び出される。"
5728
5729 #. type: Plain text
5730 #: build/C/man3/pthread_exit.3:73
5731 msgid "This function does not return to the caller."
5732 msgstr "この関数は呼び出し側には返らない。"
5733
5734 #. type: Plain text
5735 #: build/C/man3/pthread_exit.3:80
5736 msgid "The B<pthread_exit>()  function is thread-safe."
5737 msgstr "B<pthread_exit>() 関数はスレッドセーフである。"
5738
5739 #. type: Plain text
5740 #: build/C/man3/pthread_exit.3:87
5741 msgid ""
5742 "Performing a return from the start function of any thread other than the "
5743 "main thread results in an implicit call to B<pthread_exit>(), using the "
5744 "function's return value as the thread's exit status."
5745 msgstr ""
5746 "メインスレッド以外のスレッドの開始関数 (start function) がreturn を\n"
5747 "行うと、暗黙のうちに B<pthread_exit>() が呼び出され、\n"
5748 "関数の返り値がスレッドの終了ステータスとして使用される。"
5749
5750 #. type: Plain text
5751 #: build/C/man3/pthread_exit.3:93
5752 msgid ""
5753 "To allow other threads to continue execution, the main thread should "
5754 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
5755 msgstr ""
5756 "他のスレッドが実行を継続できるように、メインスレッドは B<exit>(3) では\n"
5757 "なく B<pthread_exit>() を呼び出して終了すべきである。"
5758
5759 #. type: Plain text
5760 #: build/C/man3/pthread_exit.3:98
5761 msgid ""
5762 "The value pointed to by I<retval> should not be located on the calling "
5763 "thread's stack, since the contents of that stack are undefined after the "
5764 "thread terminates."
5765 msgstr ""
5766 "I<retval> が指す値は、呼び出したスレッドのスタックに置くべきではない。\n"
5767 "呼び出したスレッドが終了した後は、そのスタックの内容が不定となるから\n"
5768 "である。"
5769
5770 #.  Linux 2.6.27
5771 #.  FIXME . review a later kernel to see if this gets fixed
5772 #.  http://thread.gmane.org/gmane.linux.kernel/611611
5773 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
5774 #. type: Plain text
5775 #: build/C/man3/pthread_exit.3:110
5776 msgid ""
5777 "Currently, there are limitations in the kernel implementation logic for "
5778 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
5779 "This can manifest in problems such as a locked terminal if a stop signal is "
5780 "sent to a foreground process whose thread group leader has already called "
5781 "B<pthread_exit>()."
5782 msgstr ""
5783 "現在のところ、停止 (stop) されたスレッドグループを、すでに終了した\n"
5784 "(dead) スレッドグループリーダーで B<wait>(2) する場合の、\n"
5785 "カーネル実装の論理には制限がある。\n"
5786 "この制限は、すでにスレッドグループリーダーが B<pthread_exit>() を\n"
5787 "呼び出しているようなフォアグラウンドプロセスにストップシグナルが送信\n"
5788 "された場合に、端末がロックされてしまう、といった問題として表に見える\n"
5789 "場合がある。"
5790
5791 #. type: Plain text
5792 #: build/C/man3/pthread_exit.3:114
5793 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5794 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5795
5796 #. type: TH
5797 #: build/C/man3/pthread_getattr_np.3:26
5798 #, no-wrap
5799 msgid "PTHREAD_GETATTR_NP"
5800 msgstr "PTHREAD_GETATTR_NP"
5801
5802 #. type: TH
5803 #: build/C/man3/pthread_getattr_np.3:26
5804 #, no-wrap
5805 msgid "2010-09-10"
5806 msgstr "2010-09-10"
5807
5808 #. type: Plain text
5809 #: build/C/man3/pthread_getattr_np.3:29
5810 msgid "pthread_getattr_np - get attributes of created thread"
5811 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
5812
5813 #. type: Plain text
5814 #: build/C/man3/pthread_getattr_np.3:35
5815 #, no-wrap
5816 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5817 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5818
5819 #. type: Plain text
5820 #: build/C/man3/pthread_getattr_np.3:45
5821 msgid ""
5822 "The B<pthread_getattr_np>()  function initializes the thread attributes "
5823 "object referred to by I<attr> so that it contains actual attribute values "
5824 "describing the running thread I<thread>."
5825 msgstr ""
5826 "B<pthread_getattr_np>() 関数は、\n"
5827 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
5828 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
5829 "格納して返す。"
5830
5831 #. type: Plain text
5832 #: build/C/man3/pthread_getattr_np.3:52
5833 msgid ""
5834 "The returned attribute values may differ from the corresponding attribute "
5835 "values passed in the I<attr> object that was used to create the thread using "
5836 "B<pthread_create>(3).  In particular, the following attributes may differ:"
5837 msgstr ""
5838 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
5839 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
5840 "特に、以下の属性は異なる場合がある。"
5841
5842 #. type: Plain text
5843 #: build/C/man3/pthread_getattr_np.3:55
5844 msgid ""
5845 "the detach state, since a joinable thread may have detached itself after "
5846 "creation;"
5847 msgstr ""
5848 "detach state. join 可能なスレッドは作成後に自分自身を\n"
5849 "切り離す (detach する) ことができるからである。"
5850
5851 #. type: Plain text
5852 #: build/C/man3/pthread_getattr_np.3:58
5853 msgid ""
5854 "the stack size, which the implementation may align to a suitable boundary."
5855 msgstr ""
5856 "スタックサイズ。\n"
5857 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
5858
5859 #. type: Plain text
5860 #: build/C/man3/pthread_getattr_np.3:63
5861 msgid ""
5862 "and the guard size, which the implementation may round upward to a multiple "
5863 "of the page size, or ignore (i.e., treat as 0), if the application is "
5864 "allocating its own stack."
5865 msgstr ""
5866 "guard size.\n"
5867 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
5868 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
5869 "(0 として扱われる) ことがあるからである。"
5870
5871 #. type: Plain text
5872 #: build/C/man3/pthread_getattr_np.3:68
5873 msgid ""
5874 "Furthermore, if the stack address attribute was not set in the thread "
5875 "attributes object used to create the thread, then the returned thread "
5876 "attributes object will report the actual stack address that the "
5877 "implementation selected for the thread."
5878 msgstr ""
5879 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
5880 "スタックアドレスが設定されていなかった場合、\n"
5881 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
5882 "割り当てた実際のスタックアドレスが報告される。"
5883
5884 #. type: Plain text
5885 #: build/C/man3/pthread_getattr_np.3:73
5886 msgid ""
5887 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
5888 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
5889 msgstr ""
5890 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
5891 "必要なくなった際には、  B<pthread_attr_destroy>(3) を使って\n"
5892 "そのオブジェクトを破棄すべきである。"
5893
5894 #. type: Plain text
5895 #: build/C/man3/pthread_getattr_np.3:76
5896 #: build/C/man3/pthread_getcpuclockid.3:49
5897 msgid ""
5898 "On success, this function returns 0; on error, it returns a nonzero error "
5899 "number."
5900 msgstr ""
5901 "成功すると、この関数は 0 を返す。\n"
5902 "エラーの場合、 0 以外のエラー番号を返す。"
5903
5904 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
5905 #. type: Plain text
5906 #: build/C/man3/pthread_getattr_np.3:81
5907 msgid "Insufficient memory."
5908 msgstr "メモリが十分になかった。"
5909
5910 #. type: Plain text
5911 #: build/C/man3/pthread_getattr_np.3:96
5912 msgid ""
5913 "In addition, if I<thread> refers to the main thread, then "
5914 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
5915 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and "
5916 "B<getrlimit>(2), if the B<RLIMIT_STACK> resource limit is not supported."
5917 msgstr ""
5918 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
5919 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
5920 "エラーで失敗する可能性がある。\n"
5921 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
5922 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
5923 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
5924
5925 #. type: Plain text
5926 #: build/C/man3/pthread_getattr_np.3:98
5927 msgid "This function is available in glibc since version 2.2.3."
5928 msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。"
5929
5930 #. type: Plain text
5931 #: build/C/man3/pthread_getattr_np.3:101
5932 #: build/C/man3/pthread_kill_other_threads_np.3:55
5933 msgid ""
5934 "This function is a nonstandard GNU extension; hence the suffix \"_np"
5935 "\" (nonportable) in the name."
5936 msgstr ""
5937 "この関数は非標準の GNU による拡張である。\n"
5938 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
5939 "付いている。"
5940
5941 #. type: Plain text
5942 #: build/C/man3/pthread_getattr_np.3:111
5943 msgid ""
5944 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
5945 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
5946 "and display its guard size, stack address, and stack size attributes.  "
5947 "Command-line arguments can be used to set these attributes to values other "
5948 "than the default when creating the thread.  The shell sessions below "
5949 "demonstrate the use of the program."
5950 msgstr ""
5951 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
5952 "このプログラムは、スレッドを作成し、それから\n"
5953 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
5954 "スタックアドレス、スタックサイズを取得し表示する。\n"
5955 "コマンドライン引き数での指定で、スレッドを作成する際に\n"
5956 "上記の属性にデフォルト値以外の値を設定することができる。\n"
5957 "下記のシェルのセッションはこのプログラムの使用例である。"
5958
5959 #. type: Plain text
5960 #: build/C/man3/pthread_getattr_np.3:114
5961 msgid ""
5962 "In the first run, on an x86-32 system, a thread is created using default "
5963 "attributes:"
5964 msgstr ""
5965 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
5966 "(x86-32 システム上で実行)。"
5967
5968 #. type: Plain text
5969 #: build/C/man3/pthread_getattr_np.3:124
5970 #, no-wrap
5971 msgid ""
5972 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5973 "unlimited\n"
5974 "$B< ./a.out>\n"
5975 "Attributes of created thread:\n"
5976 "        Guard size          = 4096 bytes\n"
5977 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5978 "        Stack size          = 0x201000 (2101248) bytes\n"
5979 msgstr ""
5980 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5981 "unlimited\n"
5982 "$B< ./a.out>\n"
5983 "Attributes of created thread:\n"
5984 "        Guard size          = 4096 bytes\n"
5985 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5986 "        Stack size          = 0x201000 (2101248) bytes\n"
5987
5988 #. type: Plain text
5989 #: build/C/man3/pthread_getattr_np.3:130
5990 msgid ""
5991 "In the following run, we see that if a guard size is specified, it is "
5992 "rounded up to the next multiple of the system page size (4096 bytes on "
5993 "x86-32):"
5994 msgstr ""
5995 "次の実行例では、guard size が指定された場合、\n"
5996 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
5997 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
5998
5999 #. type: Plain text
6000 #: build/C/man3/pthread_getattr_np.3:138
6001 #, no-wrap
6002 msgid ""
6003 "$B< ./a.out -g 4097>\n"
6004 "Thread attributes object after initializations:\n"
6005 "        Guard size          = 4097 bytes\n"
6006 "        Stack address       = (nil)\n"
6007 "        Stack size          = 0x0 (0) bytes\n"
6008 msgstr ""
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
6015 #. type: Plain text
6016 #: build/C/man3/pthread_getattr_np.3:143
6017 #, no-wrap
6018 msgid ""
6019 "Attributes of created thread:\n"
6020 "        Guard size          = 8192 bytes\n"
6021 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
6022 "        Stack size          = 0x201000 (2101248) bytes\n"
6023 msgstr ""
6024 "Attributes of created thread:\n"
6025 "        Guard size          = 8192 bytes\n"
6026 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
6027 "        Stack size          = 0x201000 (2101248) bytes\n"
6028
6029 #. .in +4n
6030 #. .nf
6031 #. $ ./a.out \-s 0x8000
6032 #. Thread attributes object after initializations:
6033 #.         Guard size          = 4096 bytes
6034 #.         Stack address       = 0xffff8000 (EOS = (nil))
6035 #.         Stack size          = 0x8000 (32768) bytes
6036 #. Attributes of created thread:
6037 #.         Guard size          = 4096 bytes
6038 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
6039 #.         Stack size          = 0x8000 (32768) bytes
6040 #. .fi
6041 #. .in
6042 #. type: Plain text
6043 #: build/C/man3/pthread_getattr_np.3:162
6044 msgid ""
6045 "In the last run, the program manually allocates a stack for the thread.  In "
6046 "this case, the guard size attribute is ignored."
6047 msgstr ""
6048 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
6049 "この場合には、guard size 属性は無視される。"
6050
6051 #. type: Plain text
6052 #: build/C/man3/pthread_getattr_np.3:167
6053 #, no-wrap
6054 msgid ""
6055 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
6056 "Allocated thread stack at 0x804d000\n"
6057 msgstr ""
6058 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
6059 "Allocated thread stack at 0x804d000\n"
6060
6061 #. type: Plain text
6062 #: build/C/man3/pthread_getattr_np.3:172
6063 #, no-wrap
6064 msgid ""
6065 "Thread attributes object after initializations:\n"
6066 "        Guard size          = 4096 bytes\n"
6067 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6068 "        Stack size          = 0x8000 (32768) bytes\n"
6069 msgstr ""
6070 "Thread attributes object after initializations:\n"
6071 "        Guard size          = 4096 bytes\n"
6072 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6073 "        Stack size          = 0x8000 (32768) bytes\n"
6074
6075 #. type: Plain text
6076 #: build/C/man3/pthread_getattr_np.3:177
6077 #, no-wrap
6078 msgid ""
6079 "Attributes of created thread:\n"
6080 "        Guard size          = 0 bytes\n"
6081 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6082 "        Stack size          = 0x8000 (32768) bytes\n"
6083 msgstr ""
6084 "Attributes of created thread:\n"
6085 "        Guard size          = 0 bytes\n"
6086 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6087 "        Stack size          = 0x8000 (32768) bytes\n"
6088
6089 #. type: Plain text
6090 #: build/C/man3/pthread_getattr_np.3:198
6091 #, no-wrap
6092 msgid ""
6093 "static void\n"
6094 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6095 "{\n"
6096 "    int s;\n"
6097 "    size_t stack_size, guard_size;\n"
6098 "    void *stack_addr;\n"
6099 msgstr ""
6100 "static void\n"
6101 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6102 "{\n"
6103 "    int s;\n"
6104 "    size_t stack_size, guard_size;\n"
6105 "    void *stack_addr;\n"
6106
6107 #. type: Plain text
6108 #: build/C/man3/pthread_getattr_np.3:203
6109 #, no-wrap
6110 msgid ""
6111 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
6112 "    if (s != 0)\n"
6113 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6114 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
6115 msgstr ""
6116 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
6117 "    if (s != 0)\n"
6118 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6119 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
6120
6121 #. type: Plain text
6122 #: build/C/man3/pthread_getattr_np.3:214
6123 #, no-wrap
6124 msgid ""
6125 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6126 "    if (s != 0)\n"
6127 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
6128 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
6129 "    if (stack_size E<gt> 0)\n"
6130 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6131 "    printf(\"\\en\");\n"
6132 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
6133 "            prefix, stack_size, stack_size);\n"
6134 "}\n"
6135 msgstr ""
6136 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6137 "    if (s != 0)\n"
6138 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
6139 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
6140 "    if (stack_size E<gt> 0)\n"
6141 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6142 "    printf(\"\\en\");\n"
6143 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
6144 "            prefix, stack_size, stack_size);\n"
6145 "}\n"
6146
6147 #. type: Plain text
6148 #: build/C/man3/pthread_getattr_np.3:220
6149 #, no-wrap
6150 msgid ""
6151 "static void\n"
6152 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6153 "{\n"
6154 "    int s;\n"
6155 "    pthread_attr_t attr;\n"
6156 msgstr ""
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
6163 #. type: Plain text
6164 #: build/C/man3/pthread_getattr_np.3:224
6165 #, no-wrap
6166 msgid ""
6167 "    s = pthread_getattr_np(thread, &attr);\n"
6168 "    if (s != 0)\n"
6169 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6170 msgstr ""
6171 "    s = pthread_getattr_np(thread, &attr);\n"
6172 "    if (s != 0)\n"
6173 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6174
6175 #. type: Plain text
6176 #: build/C/man3/pthread_getattr_np.3:226
6177 #, no-wrap
6178 msgid "    display_stack_related_attributes(&attr, prefix);\n"
6179 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
6180
6181 #. type: Plain text
6182 #: build/C/man3/pthread_getattr_np.3:231
6183 #, no-wrap
6184 msgid ""
6185 "    s = pthread_attr_destroy(&attr);\n"
6186 "    if (s != 0)\n"
6187 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6188 "}\n"
6189 msgstr ""
6190 "    s = pthread_attr_destroy(&attr);\n"
6191 "    if (s != 0)\n"
6192 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6193 "}\n"
6194
6195 #. type: Plain text
6196 #: build/C/man3/pthread_getattr_np.3:237
6197 #, no-wrap
6198 msgid ""
6199 "static void *           /* Start function for thread we create */\n"
6200 "thread_start(void *arg)\n"
6201 "{\n"
6202 "    printf(\"Attributes of created thread:\\en\");\n"
6203 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6204 msgstr ""
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
6211 #. type: Plain text
6212 #: build/C/man3/pthread_getattr_np.3:251
6213 #, no-wrap
6214 msgid ""
6215 "static void\n"
6216 "usage(char *pname, char *msg)\n"
6217 "{\n"
6218 "    if (msg != NULL)\n"
6219 "        fputs(msg, stderr);\n"
6220 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6221 "            \" [-g guard-size]\\en\", pname);\n"
6222 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6223 "    exit(EXIT_FAILURE);\n"
6224 "}\n"
6225 msgstr ""
6226 "static void\n"
6227 "usage(char *pname, char *msg)\n"
6228 "{\n"
6229 "    if (msg != NULL)\n"
6230 "        fputs(msg, stderr);\n"
6231 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6232 "            \" [-g guard-size]\\en\", pname);\n"
6233 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6234 "    exit(EXIT_FAILURE);\n"
6235 "}\n"
6236
6237 #. type: Plain text
6238 #: build/C/man3/pthread_getattr_np.3:264
6239 #, no-wrap
6240 msgid ""
6241 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6242 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6243 "                              pthread_attr_t *attrp)\n"
6244 "{\n"
6245 "    int s, opt, allocate_stack;\n"
6246 "    long stack_size, guard_size;\n"
6247 "            void *stack_addr;\n"
6248 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6249 "                                           a thread attributes object */\n"
6250 "    allocate_stack = 0;\n"
6251 "    stack_size = -1;\n"
6252 "    guard_size = -1;\n"
6253 msgstr ""
6254 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6255 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6256 "                              pthread_attr_t *attrp)\n"
6257 "{\n"
6258 "    int s, opt, allocate_stack;\n"
6259 "    long stack_size, guard_size;\n"
6260 "            void *stack_addr;\n"
6261 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6262 "                                           a thread attributes object */\n"
6263 "    allocate_stack = 0;\n"
6264 "    stack_size = -1;\n"
6265 "    guard_size = -1;\n"
6266
6267 #. type: Plain text
6268 #: build/C/man3/pthread_getattr_np.3:273
6269 #, no-wrap
6270 msgid ""
6271 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6272 "        switch (opt) {\n"
6273 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6274 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6275 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6276 "        default:    usage(argv[0], NULL);\n"
6277 "        }\n"
6278 "    }\n"
6279 msgstr ""
6280 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6281 "        switch (opt) {\n"
6282 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6283 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6284 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6285 "        default:    usage(argv[0], NULL);\n"
6286 "        }\n"
6287 "    }\n"
6288
6289 #. type: Plain text
6290 #: build/C/man3/pthread_getattr_np.3:276
6291 #, no-wrap
6292 msgid ""
6293 "    if (allocate_stack && stack_size == -1)\n"
6294 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6295 msgstr ""
6296 "    if (allocate_stack && stack_size == -1)\n"
6297 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6298
6299 #. type: Plain text
6300 #: build/C/man3/pthread_getattr_np.3:279
6301 #, no-wrap
6302 msgid ""
6303 "    if (argc E<gt> optind)\n"
6304 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6305 msgstr ""
6306 "    if (argc E<gt> optind)\n"
6307 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6308
6309 #. type: Plain text
6310 #: build/C/man3/pthread_getattr_np.3:282
6311 #, no-wrap
6312 msgid ""
6313 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6314 "        ret_attrp = attrp;\n"
6315 msgstr ""
6316 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6317 "        ret_attrp = attrp;\n"
6318
6319 #. type: Plain text
6320 #: build/C/man3/pthread_getattr_np.3:287
6321 #, no-wrap
6322 msgid ""
6323 "        s = pthread_attr_init(attrp);\n"
6324 "        if (s != 0)\n"
6325 "            handle_error_en(s, \"pthread_attr_init\");\n"
6326 "    }\n"
6327 msgstr ""
6328 "        s = pthread_attr_init(attrp);\n"
6329 "        if (s != 0)\n"
6330 "            handle_error_en(s, \"pthread_attr_init\");\n"
6331 "    }\n"
6332
6333 #. type: Plain text
6334 #: build/C/man3/pthread_getattr_np.3:299
6335 #, no-wrap
6336 msgid ""
6337 "    if (stack_size E<gt>= 0) {\n"
6338 "        if (!allocate_stack) {\n"
6339 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6340 "            if (s != 0)\n"
6341 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6342 "        } else {\n"
6343 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6344 "                               stack_size);\n"
6345 "            if (s != 0)\n"
6346 "                handle_error_en(s, \"posix_memalign\");\n"
6347 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6348 msgstr ""
6349 "    if (stack_size E<gt>= 0) {\n"
6350 "        if (!allocate_stack) {\n"
6351 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6352 "            if (s != 0)\n"
6353 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6354 "        } else {\n"
6355 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6356 "                               stack_size);\n"
6357 "            if (s != 0)\n"
6358 "                handle_error_en(s, \"posix_memalign\");\n"
6359 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6360
6361 #. type: Plain text
6362 #: build/C/man3/pthread_getattr_np.3:305
6363 #, no-wrap
6364 msgid ""
6365 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6366 "            if (s != 0)\n"
6367 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6368 "        }\n"
6369 "    }\n"
6370 msgstr ""
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
6377 #. type: Plain text
6378 #: build/C/man3/pthread_getattr_np.3:311
6379 #, no-wrap
6380 msgid ""
6381 "    if (guard_size E<gt>= 0) {\n"
6382 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6383 "        if (s != 0)\n"
6384 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6385 "    }\n"
6386 msgstr ""
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
6393 #. type: Plain text
6394 #: build/C/man3/pthread_getattr_np.3:314
6395 #, no-wrap
6396 msgid ""
6397 "    return ret_attrp;\n"
6398 "}\n"
6399 msgstr ""
6400 "    return ret_attrp;\n"
6401 "}\n"
6402
6403 #. type: Plain text
6404 #: build/C/man3/pthread_getattr_np.3:323
6405 #, no-wrap
6406 msgid ""
6407 "int\n"
6408 "main(int argc, char *argv[])\n"
6409 "{\n"
6410 "    int s;\n"
6411 "    pthread_t thr;\n"
6412 "    pthread_attr_t attr;\n"
6413 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6414 "                                        a thread attributes object */\n"
6415 msgstr ""
6416 "int\n"
6417 "main(int argc, char *argv[])\n"
6418 "{\n"
6419 "    int s;\n"
6420 "    pthread_t thr;\n"
6421 "    pthread_attr_t attr;\n"
6422 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6423 "                                        a thread attributes object */\n"
6424
6425 #. type: Plain text
6426 #: build/C/man3/pthread_getattr_np.3:325
6427 #, no-wrap
6428 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6429 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6430
6431 #. type: Plain text
6432 #: build/C/man3/pthread_getattr_np.3:331
6433 #, no-wrap
6434 msgid ""
6435 "    if (attrp != NULL) {\n"
6436 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6437 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6438 "        printf(\"\\en\");\n"
6439 "    }\n"
6440 msgstr ""
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
6447 #. type: Plain text
6448 #: build/C/man3/pthread_getattr_np.3:361
6449 msgid ""
6450 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6451 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6452 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6453 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6454 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6455 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6456 msgstr ""
6457 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6458 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6459 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6460 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6461 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6462 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6463
6464 #. type: TH
6465 #: build/C/man3/pthread_getcpuclockid.3:26
6466 #, no-wrap
6467 msgid "PTHREAD_GETCPUCLOCKID"
6468 msgstr "PTHREAD_GETCPUCLOCKID"
6469
6470 #. type: Plain text
6471 #: build/C/man3/pthread_getcpuclockid.3:29
6472 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
6473 msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する"
6474
6475 #. type: Plain text
6476 #: build/C/man3/pthread_getcpuclockid.3:33
6477 #, no-wrap
6478 msgid ""
6479 "B<#include E<lt>pthread.hE<gt>>\n"
6480 "B<#include E<lt>time.hE<gt>>\n"
6481 msgstr ""
6482 "B<#include E<lt>pthread.hE<gt>>\n"
6483 "B<#include E<lt>time.hE<gt>>\n"
6484
6485 #. type: Plain text
6486 #: build/C/man3/pthread_getcpuclockid.3:35
6487 #, no-wrap
6488 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id>B<);>\n"
6489 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id>B<);>\n"
6490
6491 #.  The clockid is constructed as follows:
6492 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
6493 #.  where CLOCK_IDFIELD_SIZE is 3.
6494 #. type: Plain text
6495 #: build/C/man3/pthread_getcpuclockid.3:46
6496 msgid ""
6497 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
6498 "time clock of the thread I<thread>."
6499 msgstr ""
6500 "B<pthread_getcpuclockid>() 関数は、\n"
6501 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
6502
6503 #. type: TP
6504 #: build/C/man3/pthread_getcpuclockid.3:50
6505 #, no-wrap
6506 msgid "B<ENOENT>"
6507 msgstr "B<ENOENT>"
6508
6509 #.  CLOCK_THREAD_CPUTIME_ID not defined
6510 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
6511 #.  be possible if kernel thread IDs took more than 29 bits (which
6512 #.  they currently cannot).
6513 #. type: Plain text
6514 #: build/C/man3/pthread_getcpuclockid.3:58
6515 msgid "Per-thread CPU time clocks are not supported by the system."
6516 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
6517
6518 #. type: Plain text
6519 #: build/C/man3/pthread_getcpuclockid.3:65
6520 msgid "This function is available in glibc since version 2.2."
6521 msgstr "この関数は glibc バージョン 2.2 以降で利用できる。"
6522
6523 #. type: Plain text
6524 #: build/C/man3/pthread_getcpuclockid.3:70
6525 msgid "The B<pthread_getcpuclockid>()  function is thread-safe."
6526 msgstr "B<pthread_getcpuclockid>() 関数はスレッドセーフである。"
6527
6528 #. type: Plain text
6529 #: build/C/man3/pthread_getcpuclockid.3:83
6530 msgid ""
6531 "When I<thread> refers to the calling thread, this function returns an "
6532 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
6533 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
6534 msgstr ""
6535 "I<thread> が呼び出したスレッドを参照している場合、\n"
6536 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
6537 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
6538 "を参照する ID が返される。"
6539
6540 #. type: Plain text
6541 #: build/C/man3/pthread_getcpuclockid.3:89
6542 msgid ""
6543 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
6544 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
6545 "the two threads.  The following shell session shows an example run:"
6546 msgstr ""
6547 "以下のプログラムは、スレッドを作成し、それから\n"
6548 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
6549 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
6550 "スレッド毎の CPU 時間を取得する。\n"
6551 "下記のシェルのセッションは実行例である。"
6552
6553 #. type: Plain text
6554 #: build/C/man3/pthread_getcpuclockid.3:99
6555 #, no-wrap
6556 msgid ""
6557 "$ B<./a.out>\n"
6558 "Main thread sleeping\n"
6559 "Subthread starting infinite loop\n"
6560 "Main thread consuming some CPU time...\n"
6561 "Process total CPU time:    1.368\n"
6562 "Main thread CPU time:      0.376\n"
6563 "Subthread CPU time:        0.992\n"
6564 msgstr ""
6565 "$ B<./a.out>\n"
6566 "Main thread sleeping\n"
6567 "Subthread starting infinite loop\n"
6568 "Main thread consuming some CPU time...\n"
6569 "Process total CPU time:    1.368\n"
6570 "Main thread CPU time:      0.376\n"
6571 "Subthread CPU time:        0.992\n"
6572
6573 #. type: Plain text
6574 #: build/C/man3/pthread_getcpuclockid.3:105
6575 #, no-wrap
6576 msgid "/* Link with \"-lrt\" */\n"
6577 msgstr "/* \"-lrt\" でリンクする */\n"
6578
6579 #. type: Plain text
6580 #: build/C/man3/pthread_getcpuclockid.3:113
6581 #, no-wrap
6582 msgid ""
6583 "#include E<lt>time.hE<gt>\n"
6584 "#include E<lt>stdio.hE<gt>\n"
6585 "#include E<lt>stdlib.hE<gt>\n"
6586 "#include E<lt>unistd.hE<gt>\n"
6587 "#include E<lt>pthread.hE<gt>\n"
6588 "#include E<lt>string.hE<gt>\n"
6589 "#include E<lt>errno.hE<gt>\n"
6590 msgstr ""
6591 "#include E<lt>time.hE<gt>\n"
6592 "#include E<lt>stdio.hE<gt>\n"
6593 "#include E<lt>stdlib.hE<gt>\n"
6594 "#include E<lt>unistd.hE<gt>\n"
6595 "#include E<lt>pthread.hE<gt>\n"
6596 "#include E<lt>string.hE<gt>\n"
6597 "#include E<lt>errno.hE<gt>\n"
6598
6599 #. type: Plain text
6600 #: build/C/man3/pthread_getcpuclockid.3:127
6601 #, no-wrap
6602 msgid ""
6603 "static void *\n"
6604 "thread_start(void *arg)\n"
6605 "{\n"
6606 "    printf(\"Subthread starting infinite loop\\en\");\n"
6607 "    for (;;)\n"
6608 "        continue;\n"
6609 "}\n"
6610 msgstr ""
6611 "static void *\n"
6612 "thread_start(void *arg)\n"
6613 "{\n"
6614 "    printf(\"Subthread starting infinite loop\\en\");\n"
6615 "    for (;;)\n"
6616 "        continue;\n"
6617 "}\n"
6618
6619 #. type: Plain text
6620 #: build/C/man3/pthread_getcpuclockid.3:132
6621 #, no-wrap
6622 msgid ""
6623 "static void\n"
6624 "pclock(char *msg, clockid_t cid)\n"
6625 "{\n"
6626 "    struct timespec ts;\n"
6627 msgstr ""
6628 "static void\n"
6629 "pclock(char *msg, clockid_t cid)\n"
6630 "{\n"
6631 "    struct timespec ts;\n"
6632
6633 #. type: Plain text
6634 #: build/C/man3/pthread_getcpuclockid.3:138
6635 #, no-wrap
6636 msgid ""
6637 "    printf(\"%s\", msg);\n"
6638 "    if (clock_gettime(cid, &ts) == -1)\n"
6639 "        handle_error(\"clock_gettime\");\n"
6640 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6641 "}\n"
6642 msgstr ""
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
6649 #. type: Plain text
6650 #: build/C/man3/pthread_getcpuclockid.3:145
6651 #, no-wrap
6652 msgid ""
6653 "int\n"
6654 "main(int argc, char *argv[])\n"
6655 "{\n"
6656 "    pthread_t thread;\n"
6657 "    clockid_t cid;\n"
6658 "    int j, s;\n"
6659 msgstr ""
6660 "int\n"
6661 "main(int argc, char *argv[])\n"
6662 "{\n"
6663 "    pthread_t thread;\n"
6664 "    clockid_t cid;\n"
6665 "    int j, s;\n"
6666
6667 #. type: Plain text
6668 #: build/C/man3/pthread_getcpuclockid.3:149
6669 #, no-wrap
6670 msgid ""
6671 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6672 "    if (s != 0)\n"
6673 "        handle_error_en(s, \"pthread_create\");\n"
6674 msgstr ""
6675 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6676 "    if (s != 0)\n"
6677 "        handle_error_en(s, \"pthread_create\");\n"
6678
6679 #. type: Plain text
6680 #: build/C/man3/pthread_getcpuclockid.3:152
6681 #, no-wrap
6682 msgid ""
6683 "    printf(\"Main thread sleeping\\en\");\n"
6684 "    sleep(1);\n"
6685 msgstr ""
6686 "    printf(\"Main thread sleeping\\en\");\n"
6687 "    sleep(1);\n"
6688
6689 #. type: Plain text
6690 #: build/C/man3/pthread_getcpuclockid.3:156
6691 #, no-wrap
6692 msgid ""
6693 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6694 "    for (j = 0; j E<lt> 2000000; j++)\n"
6695 "        getppid();\n"
6696 msgstr ""
6697 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6698 "    for (j = 0; j E<lt> 2000000; j++)\n"
6699 "        getppid();\n"
6700
6701 #. type: Plain text
6702 #: build/C/man3/pthread_getcpuclockid.3:158
6703 #, no-wrap
6704 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6705 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6706
6707 #. type: Plain text
6708 #: build/C/man3/pthread_getcpuclockid.3:163
6709 #, no-wrap
6710 msgid ""
6711 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6712 "    if (s != 0)\n"
6713 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6714 "    pclock(\"Main thread CPU time:   \", cid);\n"
6715 msgstr ""
6716 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6717 "    if (s != 0)\n"
6718 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6719 "    pclock(\"Main thread CPU time:   \", cid);\n"
6720
6721 #. type: Plain text
6722 #: build/C/man3/pthread_getcpuclockid.3:166
6723 #, no-wrap
6724 msgid ""
6725 "    /* The preceding 4 lines of code could have been replaced by:\n"
6726 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6727 msgstr ""
6728 "    /* The preceding 4 lines of code could have been replaced by:\n"
6729 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6730
6731 #. type: Plain text
6732 #: build/C/man3/pthread_getcpuclockid.3:171
6733 #, no-wrap
6734 msgid ""
6735 "    s = pthread_getcpuclockid(thread, &cid);\n"
6736 "    if (s != 0)\n"
6737 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6738 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6739 msgstr ""
6740 "    s = pthread_getcpuclockid(thread, &cid);\n"
6741 "    if (s != 0)\n"
6742 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6743 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6744
6745 #. type: Plain text
6746 #: build/C/man3/pthread_getcpuclockid.3:174
6747 #, no-wrap
6748 msgid ""
6749 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6750 "}\n"
6751 msgstr ""
6752 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6753 "}\n"
6754
6755 #. type: Plain text
6756 #: build/C/man3/pthread_getcpuclockid.3:183
6757 msgid ""
6758 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6759 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6760 msgstr ""
6761 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6762 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6763
6764 #. type: TH
6765 #: build/C/man3/pthread_join.3:26
6766 #, no-wrap
6767 msgid "PTHREAD_JOIN"
6768 msgstr "PTHREAD_JOIN"
6769
6770 #. type: Plain text
6771 #: build/C/man3/pthread_join.3:29
6772 msgid "pthread_join - join with a terminated thread"
6773 msgstr "pthread_join - 終了したスレッドを join する"
6774
6775 #. type: Plain text
6776 #: build/C/man3/pthread_join.3:34
6777 #, no-wrap
6778 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6779 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6780
6781 #. type: Plain text
6782 #: build/C/man3/pthread_join.3:49
6783 msgid ""
6784 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
6785 "to terminate.  If that thread has already terminated, then "
6786 "B<pthread_join>()  returns immediately.  The thread specified by I<thread> "
6787 "must be joinable."
6788 msgstr ""
6789 "B<pthread_join>() 関数は、I<thread> で指定されたスレッドが\n"
6790 "終了するのを待つ。そのスレッドがすでに終了している場合、\n"
6791 "B<pthread_join>() はすぐに返る。\n"
6792 "I<thread> で指定されたスレッドは join 可能でなければならない。"
6793
6794 #. type: Plain text
6795 #: build/C/man3/pthread_join.3:63
6796 msgid ""
6797 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
6798 "the target thread (i.e., the value that the target thread supplied to "
6799 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
6800 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
6801 msgstr ""
6802 "I<retval> が NULL でない場合、 B<pthread_join>() は対象スレッドの終了\n"
6803 "ステータス (すなわち、対象スレッドが B<pthread_exit>(3) に渡した値) を\n"
6804 "I<*retval> が指す場所にコピーする。対象スレッドがキャンセルされた場合、\n"
6805 "I<*retval> には B<PTHREAD_CANCELED> が格納される。"
6806
6807 #. type: Plain text
6808 #: build/C/man3/pthread_join.3:70
6809 msgid ""
6810 "If multiple threads simultaneously try to join with the same thread, the "
6811 "results are undefined.  If the thread calling B<pthread_join>()  is "
6812 "canceled, then the target thread will remain joinable (i.e., it will not be "
6813 "detached)."
6814 msgstr ""
6815 "複数のスレッドが同時に同じスレッドを join しようとした場合、その結果\n"
6816 "は不定である。B<pthread_join>() を呼び出しているスレッドがキャンセル\n"
6817 "された場合、対象スレッドは join 可能のままとなる (detached 状態には\n"
6818 "ならない)。"
6819
6820 #. type: Plain text
6821 #: build/C/man3/pthread_join.3:75
6822 msgid ""
6823 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
6824 "number."
6825 msgstr ""
6826 "成功すると、 B<pthread_join>() は 0 を返す。\n"
6827 "エラーの場合、エラー番号を返す。"
6828
6829 #. type: TP
6830 #: build/C/man3/pthread_join.3:76
6831 #, no-wrap
6832 msgid "B<EDEADLK>"
6833 msgstr "B<EDEADLK>"
6834
6835 #.  The following verified by testing on glibc 2.8/NPTL:
6836 #.  The following verified by testing on glibc 2.8/NPTL:
6837 #. type: Plain text
6838 #: build/C/man3/pthread_join.3:85
6839 msgid ""
6840 "A deadlock was detected (e.g., two threads tried to join with each other); "
6841 "or I<thread> specifies the calling thread."
6842 msgstr ""
6843 "デッドロックが検出された (例えば、二つのスレッドが互いに join しようと\n"
6844 "した場合)、または I<thread> に呼び出したスレッドが指定されている。"
6845
6846 #.  POSIX.1-2001 does not specify this error case.
6847 #. type: Plain text
6848 #: build/C/man3/pthread_join.3:93
6849 msgid "Another thread is already waiting to join with this thread."
6850 msgstr "別のスレッドがすでにこのスレッドの join 待ちである。"
6851
6852 #. type: Plain text
6853 #: build/C/man3/pthread_join.3:104
6854 msgid ""
6855 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
6856 "the target thread has terminated."
6857 msgstr ""
6858 "B<pthread_join>() の呼び出しが成功した場合は、\n"
6859 "呼び出し側には、対象スレッドが終了していることが保証される。"
6860
6861 #. type: Plain text
6862 #: build/C/man3/pthread_join.3:107
6863 msgid ""
6864 "Joining with a thread that has previously been joined results in undefined "
6865 "behavior."
6866 msgstr "すでに join されたスレッドを join した場合の結果は不定である。"
6867
6868 #. type: Plain text
6869 #: build/C/man3/pthread_join.3:115
6870 msgid ""
6871 "Failure to join with a thread that is joinable (i.e., one that is not "
6872 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
6873 "zombie thread consumes some system resources, and when enough zombie threads "
6874 "have accumulated, it will no longer be possible to create new threads (or "
6875 "processes)."
6876 msgstr ""
6877 "join 可能なスレッド (detached 状態でないスレッド) の join に失敗した場合、\n"
6878 "\"ゾンビスレッド (zombie thread)\" が生成される。\n"
6879 "各ゾンビスレッドはシステムリソースをいくらかは消費し、\n"
6880 "ゾンビスレッドがたくさん生成されてしまうと、\n"
6881 "新しいスレッド (やプロセス) がそれ以上作成できなくなってしまうので、\n"
6882 "このようなことが起きるのは避けること。"
6883
6884 #. type: Plain text
6885 #: build/C/man3/pthread_join.3:121
6886 msgid ""
6887 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
6888 "\"join with any terminated thread\".  If you believe you need this "
6889 "functionality, you probably need to rethink your application design."
6890 msgstr ""
6891 "pthreads には、 I<waitpid(-1,\\ &status,\\ 0)>、つまり\n"
6892 "\"終了されたスレッドのどれかを join する\" といった機能はない。\n"
6893 "この機能が必要だと思うような場合には、おそらく\n"
6894 "自分のアプリケーションの設計を考え直す必要があるだろう。"
6895
6896 #. type: Plain text
6897 #: build/C/man3/pthread_join.3:124
6898 msgid ""
6899 "All of the threads in a process are peers: any thread can join with any "
6900 "other thread in the process."
6901 msgstr ""
6902 "プロセス内の全てのスレッドは対等であり、\n"
6903 "どのスレッドでもプロセス内の他のスレッドを join できる。"
6904
6905 #. type: Plain text
6906 #: build/C/man3/pthread_join.3:134
6907 msgid ""
6908 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6909 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6910 msgstr ""
6911 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6912 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6913
6914 #. type: TH
6915 #: build/C/man3/pthread_kill.3:26
6916 #, no-wrap
6917 msgid "PTHREAD_KILL"
6918 msgstr "PTHREAD_KILL"
6919
6920 #. type: TH
6921 #: build/C/man3/pthread_kill.3:26
6922 #: build/C/man3/pthread_kill_other_threads_np.3:26
6923 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setcancelstate.3:26
6924 #: build/C/man3/pthread_yield.3:25
6925 #, no-wrap
6926 msgid "2014-05-13"
6927 msgstr "2014-05-13"
6928
6929 #. type: Plain text
6930 #: build/C/man3/pthread_kill.3:29
6931 msgid "pthread_kill - send a signal to a thread"
6932 msgstr "pthread_kill - スレッドにシグナルを送信する"
6933
6934 #. type: Plain text
6935 #: build/C/man3/pthread_kill.3:32 build/C/man3/pthread_sigmask.3:32
6936 #, no-wrap
6937 msgid "B<#include E<lt>signal.hE<gt>>\n"
6938 msgstr "B<#include E<lt>signal.hE<gt>>\n"
6939
6940 #. type: Plain text
6941 #: build/C/man3/pthread_kill.3:34
6942 #, no-wrap
6943 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6944 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6945
6946 #. type: Plain text
6947 #: build/C/man3/pthread_kill.3:45
6948 msgid "B<pthread_kill>():"
6949 msgstr "B<pthread_kill>():"
6950
6951 #. type: Plain text
6952 #: build/C/man3/pthread_kill.3:47 build/C/man3/pthread_sigmask.3:48
6953 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
6954 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
6955
6956 #. type: Plain text
6957 #: build/C/man3/pthread_kill.3:59
6958 msgid ""
6959 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, a "
6960 "thread in the same process as the caller.  The signal is asynchronously "
6961 "directed to I<thread>."
6962 msgstr ""
6963 "B<pthread_kill>() 関数は、呼び出したスレッドと同じプロセスの\n"
6964 "スレッド I<thread> にシグナル I<sig> を送信する。\n"
6965 "シグナルは非同期に I<thread> へ直接送られる。"
6966
6967 #. type: Plain text
6968 #: build/C/man3/pthread_kill.3:63
6969 msgid ""
6970 "If I<sig> is 0, then no signal is sent, but error checking is still "
6971 "performed."
6972 msgstr ""
6973 "I<sig> が 0 の場合、シグナルは送信されないが、エラーチェックだけは実行され"
6974 "る。"
6975
6976 #. type: Plain text
6977 #: build/C/man3/pthread_kill.3:68
6978 msgid ""
6979 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
6980 "number, and no signal is sent."
6981 msgstr ""
6982 "成功すると、 B<pthread_kill>() は 0 を返す。\n"
6983 "エラーの場合、エラー番号を返し、シグナルの送信は行わない。"
6984
6985 #. type: Plain text
6986 #: build/C/man3/pthread_kill.3:72
6987 msgid "An invalid signal was specified."
6988 msgstr "無効なシグナルが指定された。"
6989
6990 #. type: Plain text
6991 #: build/C/man3/pthread_kill.3:77
6992 msgid "The B<pthread_kill>()  function is thread-safe."
6993 msgstr "B<pthread_kill>() 関数はスレッドセーフである。"
6994
6995 #. type: Plain text
6996 #: build/C/man3/pthread_kill.3:79
6997 msgid "POSIX.1-2008."
6998 msgstr "POSIX.1-2008."
6999
7000 #. type: Plain text
7001 #: build/C/man3/pthread_kill.3:86
7002 msgid ""
7003 "Signal dispositions are process-wide: if a signal handler is installed, the "
7004 "handler will be invoked in the thread I<thread>, but if the disposition of "
7005 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
7006 "affect the whole process."
7007 msgstr ""
7008 "シグナルの配送はプロセス全体で行われる。\n"
7009 "シグナルハンドラが設定されている場合、\n"
7010 "そのハンドラがスレッド I<thread> で起動されるが、\n"
7011 "シグナルの配送が \"stop\", \"continue\", \"terminate\" のいずれかの場合、\n"
7012 "シグナルに対するアクションはプロセス全体に影響がある。"
7013
7014 #. type: Plain text
7015 #: build/C/man3/pthread_kill.3:99
7016 msgid ""
7017 "POSIX.1-2008 recommends that if an implementation detects the use of a "
7018 "thread ID after the end of its lifetime, B<pthread_kill>()  should return "
7019 "the error B<ESRCH>.  The glibc implementation returns this error in the "
7020 "cases where an invalid thread ID can be detected.  But note also that POSIX "
7021 "says that an attempt to use a thread ID whose lifetime has ended produces "
7022 "undefined behavior, and an attempt to use an invalid thread ID in a call to "
7023 "B<pthread_kill>()  can, for example, cause a segmentation fault."
7024 msgstr ""
7025 "POSIX.1-2008 では、 スレッドが終了した後にそのスレッド ID が使用されたことを"
7026 "検出した場合に、 B<pthread_kill>() はエラー B<ESRCH> を返すことを推奨されてい"
7027 "る。 glibc の実装では、無効なスレッド ID を検出できる場合にはこのエラーを返"
7028 "す。 しかし、 POSIX では、 終了したスレッド ID を使おうとした場合の動作は不定"
7029 "であり、 B<pthread_kill>() で無効なスレッド ID を使おうとした場合には、 例え"
7030 "ば、 セグメンテーションフォールトになる可能性もある点に注意すること。"
7031
7032 #. type: Plain text
7033 #: build/C/man3/pthread_kill.3:108
7034 msgid ""
7035 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
7036 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
7037 msgstr ""
7038 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
7039 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
7040
7041 #. type: TH
7042 #: build/C/man3/pthread_kill_other_threads_np.3:26
7043 #, no-wrap
7044 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
7045 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
7046
7047 #. type: Plain text
7048 #: build/C/man3/pthread_kill_other_threads_np.3:29
7049 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
7050 msgstr "pthread_kill_other_threads_np - プロセス内の他の全スレッドを終了する"
7051
7052 #. type: Plain text
7053 #: build/C/man3/pthread_kill_other_threads_np.3:34
7054 #, no-wrap
7055 msgid "B<void pthread_kill_other_threads_np(void);>\n"
7056 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
7057
7058 #.  .SH VERSIONS
7059 #.  Available since glibc 2.0
7060 #. type: Plain text
7061 #: build/C/man3/pthread_kill_other_threads_np.3:47
7062 msgid ""
7063 "B<pthread_kill_other_threads_np>()  has an effect only in the LinuxThreads "
7064 "threading implementation.  On that implementation, calling this function "
7065 "causes the immediate termination of all threads in the application, except "
7066 "the calling thread.  The cancellation state and cancellation type of the to-"
7067 "be-terminated threads are ignored, and the cleanup handlers are not called "
7068 "in those threads."
7069 msgstr ""
7070 "B<pthread_kill_other_threads_np>() は、\n"
7071 "LinuxThreads スレッド実装においてのみ効果がある。\n"
7072 "LinuxThreads スレッド実装では、この関数を呼び出すと\n"
7073 "アプリケーション内の全てのスレッドがすぐに終了される。\n"
7074 "終了対象のスレッドの cancelability state と cancelability type は\n"
7075 "無視され、それらのスレッドのクリーンアップハンドラは呼び出されない。"
7076
7077 #. type: Plain text
7078 #: build/C/man3/pthread_kill_other_threads_np.3:52
7079 msgid "The B<pthread_kill_other_threads_np>()  function is thread-safe."
7080 msgstr "B<pthread_kill_other_threads_np>() 関数はスレッドセーフである。"
7081
7082 #. type: Plain text
7083 #: build/C/man3/pthread_kill_other_threads_np.3:64
7084 msgid ""
7085 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
7086 "thread calls B<execve>(2)  or a similar function.  This function is designed "
7087 "to address a limitation in the obsolete LinuxThreads implementation whereby "
7088 "the other threads of an application are not automatically terminated (as "
7089 "POSIX.1-2001 requires) during B<execve>(2)."
7090 msgstr ""
7091 "B<pthread_kill_other_threads_np>() は、\n"
7092 "スレッドが B<execve>(2) や同様の関数を呼び出す直前に\n"
7093 "呼ばれることを目的として用意されている。\n"
7094 "この関数は、(廃止予定の) LinuxThreads スレッド実装における、\n"
7095 "B<execve>(2) の際にアプリケーションの他のスレッドが自動的に\n"
7096 "終了されないという制限を解決するために設計された。"
7097
7098 #. type: Plain text
7099 #: build/C/man3/pthread_kill_other_threads_np.3:71
7100 msgid ""
7101 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
7102 "exists, but does nothing.  (Nothing needs to be done, because the "
7103 "implementation does the right thing during an B<execve>(2).)"
7104 msgstr ""
7105 "NPTL スレッド実装では、 B<pthread_kill_other_threads_np>() は存在するが、\n"
7106 "何もしない(NPTL 実装は B<execve>(2) の際に適切な動作をするので、\n"
7107 "何もする必要がないということだ)。"
7108
7109 #. type: Plain text
7110 #: build/C/man3/pthread_kill_other_threads_np.3:77
7111 msgid ""
7112 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7113 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7114 msgstr ""
7115 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7116 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7117
7118 #. type: TH
7119 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
7120 #, no-wrap
7121 msgid "PTHREAD_RWLOCKATTR_SETKIND_NP"
7122 msgstr "PTHREAD_RWLOCKATTR_SETKIND_NP"
7123
7124 #. type: TH
7125 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
7126 #, no-wrap
7127 msgid "2014-10-15"
7128 msgstr "2014-10-15"
7129
7130 #. type: Plain text
7131 #: build/C/man3/pthread_rwlockattr_setkind_np.3:29
7132 msgid ""
7133 "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - set/get the "
7134 "read-write lock kind of the thread read-write lock attribute object"
7135 msgstr ""
7136 "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - スレッドの読み"
7137 "書きロック属性オブジェクトの読み書きロック種別の設定、取得を行う"
7138
7139 #. type: Plain text
7140 #: build/C/man3/pthread_rwlockattr_setkind_np.3:37
7141 #, no-wrap
7142 msgid ""
7143 "B<int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *>I<attr>B<,>\n"
7144 "B<                                   int >I<pref>B<);>\n"
7145 "B<int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *>I<attr>B<,>\n"
7146 "B<                                   int *>I<pref>B<);>\n"
7147 msgstr ""
7148 "B<int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *>I<attr>B<,>\n"
7149 "B<                                   int >I<pref>B<);>\n"
7150 "B<int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *>I<attr>B<,>\n"
7151 "B<                                   int *>I<pref>B<);>\n"
7152
7153 #. type: Plain text
7154 #: build/C/man3/pthread_rwlockattr_setkind_np.3:48
7155 msgid "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
7156 msgstr ""
7157 "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
7158
7159 #. type: Plain text
7160 #: build/C/man3/pthread_rwlockattr_setkind_np.3:52
7161 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _POSIX_C_SOURCE E<gt>= 200809L"
7162 msgstr "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _POSIX_C_SOURCE E<gt>= 200809L"
7163
7164 #. type: Plain text
7165 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
7166 msgid ""
7167 "The B<pthread_rwlockattr_setkind_np>()  function sets the \"lock kind\" "
7168 "attribute of the read-write lock attribute object referred to by I<attr> to "
7169 "the value specified in I<pref>.  The argument I<pref> may be set to one of "
7170 "the following:"
7171 msgstr ""
7172 "B<pthread_rwlockattr_setkind_np>() 関数は、 I<attr> が参照する読み書きロック"
7173 "属性オブジェクトの「ロック種別 (lock kind)」を I<pref> で指定された値に設定す"
7174 "る。 引き数 I<pref> には以下のいずれか一つを設定できる。"
7175
7176 #. type: TP
7177 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
7178 #, no-wrap
7179 msgid "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
7180 msgstr "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
7181
7182 #. type: Plain text
7183 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
7184 msgid ""
7185 "This is the default.  A thread may hold multiple read locks; that is, read "
7186 "locks are recursive.  According to The Single Unix Specification, the "
7187 "behavior is unspecified when a reader tries to place a lock, and there is no "
7188 "write lock but writers are waiting.  Giving preference to the reader, as is "
7189 "set by B<PTHREAD_RWLOCK_PREFER_READER_NP>, implies that the reader will "
7190 "receive the requested lock, even if a writer is waiting.  As long as there "
7191 "are readers, the writer will be starved."
7192 msgstr ""
7193 "これがデフォルトである。 スレッドは複数の読み出しロックを保持できる。 つま"
7194 "り、読み出しロックは再帰的である。 Single Unix Specification では、 読み出し"
7195 "側がロックをかけようとした際に、書き込みロックはないが書き込み側が待っていた"
7196 "場合の、動作は規定されていない。 B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定"
7197 "し、読み出し側に優先度を与えるということは、 たとえ書き込み側が待っていたとし"
7198 "ても、読み出し側が要求したロックを受け取ることを意味する。 読み出し側がいる限"
7199 "り、書き込み側は待つことになる。"
7200
7201 #. type: TP
7202 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
7203 #, no-wrap
7204 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
7205 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
7206
7207 #. type: Plain text
7208 #: build/C/man3/pthread_rwlockattr_setkind_np.3:83
7209 msgid ""
7210 "This is intended as the write lock analog of "
7211 "B<PTHREAD_RWLOCK_PREFER_READER_NP>.  But see BUGS."
7212 msgstr ""
7213 "これは B<PTHREAD_RWLOCK_PREFER_READER_NP> の書き込みロック版である。 ただし"
7214 "「バグ」を参照のこと。"
7215
7216 #. type: TP
7217 #: build/C/man3/pthread_rwlockattr_setkind_np.3:83
7218 #, no-wrap
7219 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
7220 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
7221
7222 #. type: Plain text
7223 #: build/C/man3/pthread_rwlockattr_setkind_np.3:88
7224 msgid ""
7225 "Setting the lock kind to this avoids writer starvation as long as any read "
7226 "locking is not done in a recursive fashion."
7227 msgstr ""
7228 "ロック種別をこの値に設定すると、 読み出しロックが再帰的に行われない限りは、 "
7229 "書き込み側の待ちを避けることができる。"
7230
7231 #. type: Plain text
7232 #: build/C/man3/pthread_rwlockattr_setkind_np.3:96
7233 msgid ""
7234 "The B<pthread_rwlockattr_getkind_np>()  function returns the value of the "
7235 "lock kind attribute of the read-write lock attribute object referred to by "
7236 "I<attr> in the pointer I<pref>."
7237 msgstr ""
7238 "B<pthread_rwlockattr_getkind_np>() 関数は、 I<attr> が参照する読み書きロック"
7239 "属性オブジェクトのロック種別属性の値をポインター I<pref> に入れて返す。"
7240
7241 #. type: Plain text
7242 #: build/C/man3/pthread_rwlockattr_setkind_np.3:104
7243 msgid ""
7244 "On success, these functions return 0.  Given valid pointer arguments, "
7245 "B<pthread_rwlockattr_getkind_np>()  always succeeds.  On error, "
7246 "B<pthread_rwlockattr_setkind_np>()  returns a non-zero error number."
7247 msgstr ""
7248 "成功すると、これらの関数は 0 を返す。 有効なポインター引き数が渡された場合、 "
7249 "B<pthread_rwlockattr_getkind_np>() は常に成功する。 エラーの場合、 "
7250 "B<pthread_rwlockattr_setkind_np>() は 0 以外のエラー番号を返す。"
7251
7252 #. type: Plain text
7253 #: build/C/man3/pthread_rwlockattr_setkind_np.3:109
7254 msgid "I<pref> specifies an unsupported value."
7255 msgstr "I<pref> にサポート外の値が指定された。"
7256
7257 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7057
7258 #. type: Plain text
7259 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
7260 msgid ""
7261 "Setting the value read-write lock kind to B<PTHREAD_RWLOCK_PREFER_WRITER_NP> "
7262 "results in the same behavior as setting the value to "
7263 "B<PTHREAD_RWLOCK_PREFER_READER_NP>.  As long as a reader thread holds the "
7264 "lock, the thread holding a write lock will be starved.  Setting the lock "
7265 "kind to B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> allows writers to "
7266 "run, but, as the name implies a writer may not lock recursively."
7267 msgstr ""
7268 "読み書きロック種別の値を B<PTHREAD_RWLOCK_PREFER_WRITER_NP> に設定すること"
7269 "は、 値を B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定するのと同じ動作となる。 "
7270 "読み出しスレッドがロックを保持する限り、書き込みロックを保持しているスレッド"
7271 "は停止することになる。 ロック種別を "
7272 "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> に設定すると、 書き込み側が動"
7273 "作できるようになるが、変数名から分かるように、 書き込み側はロックを再帰的に行"
7274 "うことはできない。"
7275
7276 #. type: Plain text
7277 #: build/C/man3/pthread_rwlockattr_setkind_np.3:127
7278 msgid ""
7279 "The B<pthread_rwlockattr_getkind_np>()  and "
7280 "B<pthread_rwlockattr_setkind_np>()  functions first appeared in glibc 2.1."
7281 msgstr ""
7282 "関数 B<pthread_rwlockattr_getkind_np>() と "
7283 "B<pthread_rwlockattr_setkind_np>() は glibc 2.1 で初めて登場した。"
7284
7285 #. type: Plain text
7286 #: build/C/man3/pthread_rwlockattr_setkind_np.3:130
7287 msgid ""
7288 "These functions are non-standard GNU extensions; hence the suffix \"_np"
7289 "\" (non-portable) in the names."
7290 msgstr ""
7291 "これらの関数は非標準の GNU による拡張である。 そのため、名前に \"_np\" (non-"
7292 "portable; 移植性がない) という接尾辞が付いている。"
7293
7294 #. type: Plain text
7295 #: build/C/man3/pthread_rwlockattr_setkind_np.3:132
7296 msgid "B<pthreads>(7)"
7297 msgstr "B<pthreads>(7)"
7298
7299 #. type: TH
7300 #: build/C/man3/pthread_self.3:26
7301 #, no-wrap
7302 msgid "PTHREAD_SELF"
7303 msgstr "PTHREAD_SELF"
7304
7305 #. type: Plain text
7306 #: build/C/man3/pthread_self.3:29
7307 msgid "pthread_self - obtain ID of the calling thread"
7308 msgstr "pthread_self - 呼び出したスレッドの ID を取得する"
7309
7310 #. type: Plain text
7311 #: build/C/man3/pthread_self.3:34
7312 #, no-wrap
7313 msgid "B<pthread_t pthread_self(void);>\n"
7314 msgstr "B<pthread_t pthread_self(void);>\n"
7315
7316 #. type: Plain text
7317 #: build/C/man3/pthread_self.3:46
7318 msgid ""
7319 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
7320 "is the same value that is returned in I<*thread> in the "
7321 "B<pthread_create>(3)  call that created this thread."
7322 msgstr ""
7323 "B<pthread_self>() 関数は、呼び出したスレッドの ID を返す。\n"
7324 "得られる ID は、このスレッドが作成された B<pthread_create>(3) の\n"
7325 "呼び出しで I<*thread> で返されるのと同じ値である。"
7326
7327 #. type: Plain text
7328 #: build/C/man3/pthread_self.3:48
7329 msgid "This function always succeeds, returning the calling thread's ID."
7330 msgstr "この関数は常に成功し、呼び出したスレッドの ID を返す。"
7331
7332 #. type: Plain text
7333 #: build/C/man3/pthread_self.3:55
7334 msgid "The B<pthread_self>()  function is thread-safe."
7335 msgstr "B<pthread_self>() 関数はスレッドセーフである。"
7336
7337 #. type: Plain text
7338 #: build/C/man3/pthread_self.3:68
7339 msgid ""
7340 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
7341 "represent a thread ID; for example, representation using either an "
7342 "arithmetic type or a structure is permitted.  Therefore, variables of type "
7343 "I<pthread_t> can't portably be compared using the C equality operator "
7344 "(B<==>); use B<pthread_equal>(3)  instead."
7345 msgstr ""
7346 "POSIX.1 では、スレッド ID を表現するのに使用する型は、\n"
7347 "スレッド実装が完全に自由に選択してよいことになっている。\n"
7348 "例えば、スレッド ID を表現するのに数値型を使っても構造体を使ってもよい。\n"
7349 "そのため、移植性を確保しつつ、 C 言語の等価演算子 (B<==>) を使って、\n"
7350 "I<pthread_t> 型の変数の比較を行うことはできない。\n"
7351 "代わりに B<pthread_equal>(3) を使うこと。"
7352
7353 #. type: Plain text
7354 #: build/C/man3/pthread_self.3:72
7355 msgid ""
7356 "Thread identifiers should be considered opaque: any attempt to use a thread "
7357 "ID other than in pthreads calls is nonportable and can lead to unspecified "
7358 "results."
7359 msgstr ""
7360 "スレッド識別子はその内部構造を意識すべきではない。\n"
7361 "pthreads 関数以外でスレッド ID を利用しようとした場合、\n"
7362 "移植性がなくなり、どのような結果が得られるかも分からない。"
7363
7364 #. type: Plain text
7365 #: build/C/man3/pthread_self.3:76
7366 msgid ""
7367 "Thread IDs are guaranteed to be unique only within a process.  A thread ID "
7368 "may be reused after a terminated thread has been joined, or a detached "
7369 "thread has terminated."
7370 msgstr ""
7371 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
7372 "終了したスレッドが join されたり、\n"
7373 "切り離された (detached) スレッドが終了されたりした後は、\n"
7374 "そのスレッド ID は再利用されることがある。"
7375
7376 #. type: Plain text
7377 #: build/C/man3/pthread_self.3:81
7378 msgid ""
7379 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
7380 "kernel thread ID returned by a call to B<gettid>(2)."
7381 msgstr ""
7382 "B<pthread_self>() が返すスレッド ID は、\n"
7383 "B<gettid>(2) が返すカーネルスレッド ID とは違うものである。"
7384
7385 #. type: Plain text
7386 #: build/C/man3/pthread_self.3:85
7387 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7388 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7389
7390 #. type: TH
7391 #: build/C/man3/pthread_setaffinity_np.3:26
7392 #, no-wrap
7393 msgid "PTHREAD_SETAFFINITY_NP"
7394 msgstr "PTHREAD_SETAFFINITY_NP"
7395
7396 #. type: Plain text
7397 #: build/C/man3/pthread_setaffinity_np.3:30
7398 msgid ""
7399 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
7400 "thread"
7401 msgstr ""
7402 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
7403 "CPU affinity の設定/取得を行う"
7404
7405 #. type: Plain text
7406 #: build/C/man3/pthread_setaffinity_np.3:39
7407 #, no-wrap
7408 msgid ""
7409 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7410 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
7411 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7412 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
7413 msgstr ""
7414 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7415 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
7416 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7417 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
7418
7419 #. type: Plain text
7420 #: build/C/man3/pthread_setaffinity_np.3:54
7421 msgid ""
7422 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
7423 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
7424 "successful, and the thread is not currently running on one of the CPUs in "
7425 "I<cpuset>, then it is migrated to one of those CPUs."
7426 msgstr ""
7427 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7428 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
7429 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
7430 "場合は、スレッドは指定された CPU のいずれかに移動される。"
7431
7432 #. type: Plain text
7433 #: build/C/man3/pthread_setaffinity_np.3:61
7434 msgid ""
7435 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
7436 "the thread I<thread> in the buffer pointed to by I<cpuset>."
7437 msgstr ""
7438 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7439 "マスクを、I<cpuset> が指すバッファに入れて返す。"
7440
7441 #. type: Plain text
7442 #: build/C/man3/pthread_setaffinity_np.3:77
7443 msgid ""
7444 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
7445 "by I<cpuset>.  Typically, this argument would be specified as "
7446 "I<sizeof(cpu_set_t)>.  (It may be some other value, if using the macros "
7447 "described in B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
7448 msgstr ""
7449 "引き数 I<cpusetsize> は I<cpuset> が指すバッファの長さ (バイト単位) で\n"
7450 "ある。通常は、この引き数には I<sizeof(cpu_set_t)> を指定する\n"
7451 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
7452 "割り当てている場合には、別の値になることもある)。"
7453
7454 #. type: TP
7455 #: build/C/man3/pthread_setaffinity_np.3:81
7456 #, no-wrap
7457 msgid "B<EFAULT>"
7458 msgstr "B<EFAULT>"
7459
7460 #. type: Plain text
7461 #: build/C/man3/pthread_setaffinity_np.3:84
7462 msgid "A supplied memory address was invalid."
7463 msgstr "指定されたメモリアドレスが無効である。"
7464
7465 #. type: Plain text
7466 #: build/C/man3/pthread_setaffinity_np.3:93
7467 msgid ""
7468 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
7469 "processors that are currently physically on the system and permitted to the "
7470 "thread according to any restrictions that may be imposed by the \"cpuset\" "
7471 "mechanism described in B<cpuset>(7)."
7472 msgstr ""
7473 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
7474 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
7475 "されているプロセッサが一つも含まれていない。\n"
7476 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
7477 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
7478
7479 #.  FIXME . ?
7480 #.  Loic Domaigne commented: it seems that in the future the
7481 #.  kernel developers want to make cpumask_t dynamic, so
7482 #.  CONFIG_NR_CPUS might become obsolete in the future.
7483 #.  cpumask_t
7484 #.  The raw sched_getaffinity() system call returns the size (in bytes)
7485 #.  of the cpumask_t type.
7486 #. type: Plain text
7487 #: build/C/man3/pthread_setaffinity_np.3:109
7488 msgid ""
7489 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
7490 "the set supported by the kernel.  (The kernel configuration option "
7491 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
7492 "type used to represent CPU sets.)"
7493 msgstr ""
7494 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
7495 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
7496 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
7497 "データ型がサポートする CPU 集合の範囲が定義される。)"
7498
7499 #. type: Plain text
7500 #: build/C/man3/pthread_setaffinity_np.3:114
7501 msgid ""
7502 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
7503 "affinity mask used by the kernel."
7504 msgstr ""
7505 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
7506 "affinity マスクの大きさよりも小さい。"
7507
7508 #. type: Plain text
7509 #: build/C/man3/pthread_setaffinity_np.3:128
7510 msgid ""
7511 "The B<pthread_setaffinity_np>()  and B<pthread_getaffinity_np>()  functions "
7512 "are thread-safe."
7513 msgstr ""
7514 "関数 B<pthread_setaffinity_np>() と B<pthread_getaffinity_np>() はスレッド"
7515 "セーフである。"
7516
7517 #. type: Plain text
7518 #: build/C/man3/pthread_setaffinity_np.3:144
7519 msgid ""
7520 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
7521 "thread will actually run is the intersection of the set specified in the "
7522 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
7523 "system may further restrict the set of CPUs on which the thread runs if the "
7524 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
7525 "restrictions on the actual set of CPUs on which the thread will run are "
7526 "silently imposed by the kernel."
7527 msgstr ""
7528 "B<pthread_setaffinity_np>() を呼び出した後、\n"
7529 "そのスレッドが実際に実行される CPU 集合は、\n"
7530 "I<cpuset> 引き数で指定された集合と\n"
7531 "システムに実際に存在する CPU 集合の共通部分になる。\n"
7532 "また、 B<cpuset>(7) で説明されている \"cpuset\" 機構が使われている場合\n"
7533 "には、そのスレッドが実行される CPU 集合がシステムによってさらに制限\n"
7534 "される場合がある。そのスレッドが実行される実際の CPU 集合に対する\n"
7535 "これらの制限は、カーネルにより黙って適用される。"
7536
7537 #. type: Plain text
7538 #: build/C/man3/pthread_setaffinity_np.3:150
7539 msgid ""
7540 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
7541 "B<sched_getaffinity>(2)  system calls."
7542 msgstr ""
7543 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
7544 "B<sched_getaffinity>(2) を使って実装されている。"
7545
7546 #. type: Plain text
7547 #: build/C/man3/pthread_setaffinity_np.3:161
7548 msgid ""
7549 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
7550 "creator's CPU affinity mask."
7551 msgstr ""
7552 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
7553 "作成者の CPU affinity マスクを継承する。"
7554
7555 #. type: Plain text
7556 #: build/C/man3/pthread_setaffinity_np.3:169
7557 msgid ""
7558 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
7559 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
7560 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
7561 "check the resulting CPU affinity mask of the thread."
7562 msgstr ""
7563 "以下のプログラムでは、メインスレッドは\n"
7564 "B<pthread_setaffinity_np>() を使って自分の CPU affinity マスクに\n"
7565 "CPU 0 から 7 が含まれるように設定し\n"
7566 "(システム上には 0 から 7 に対応する CPU が全て存在するとは限らない)、\n"
7567 "その後で B<pthread_getaffinity_np>() を使って\n"
7568 "スレッドに実際に設定された CPU affinity マスクを確認している。"
7569
7570 #. type: Plain text
7571 #: build/C/man3/pthread_setaffinity_np.3:176
7572 #, no-wrap
7573 msgid ""
7574 "#define _GNU_SOURCE\n"
7575 "#include E<lt>pthread.hE<gt>\n"
7576 "#include E<lt>stdio.hE<gt>\n"
7577 "#include E<lt>stdlib.hE<gt>\n"
7578 "#include E<lt>errno.hE<gt>\n"
7579 msgstr ""
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
7586 #. type: Plain text
7587 #: build/C/man3/pthread_setaffinity_np.3:186
7588 #, no-wrap
7589 msgid ""
7590 "int\n"
7591 "main(int argc, char *argv[])\n"
7592 "{\n"
7593 "    int s, j;\n"
7594 "    cpu_set_t cpuset;\n"
7595 "    pthread_t thread;\n"
7596 msgstr ""
7597 "int\n"
7598 "main(int argc, char *argv[])\n"
7599 "{\n"
7600 "    int s, j;\n"
7601 "    cpu_set_t cpuset;\n"
7602 "    pthread_t thread;\n"
7603
7604 #. type: Plain text
7605 #: build/C/man3/pthread_setaffinity_np.3:188
7606 #, no-wrap
7607 msgid "    thread = pthread_self();\n"
7608 msgstr "    thread = pthread_self();\n"
7609
7610 #. type: Plain text
7611 #: build/C/man3/pthread_setaffinity_np.3:190
7612 #, no-wrap
7613 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7614 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7615
7616 #. type: Plain text
7617 #: build/C/man3/pthread_setaffinity_np.3:194
7618 #, no-wrap
7619 msgid ""
7620 "    CPU_ZERO(&cpuset);\n"
7621 "    for (j = 0; j E<lt> 8; j++)\n"
7622 "        CPU_SET(j, &cpuset);\n"
7623 msgstr ""
7624 "    CPU_ZERO(&cpuset);\n"
7625 "    for (j = 0; j E<lt> 8; j++)\n"
7626 "        CPU_SET(j, &cpuset);\n"
7627
7628 #. type: Plain text
7629 #: build/C/man3/pthread_setaffinity_np.3:198
7630 #, no-wrap
7631 msgid ""
7632 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7633 "    if (s != 0)\n"
7634 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7635 msgstr ""
7636 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7637 "    if (s != 0)\n"
7638 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7639
7640 #. type: Plain text
7641 #: build/C/man3/pthread_setaffinity_np.3:200
7642 #, no-wrap
7643 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
7644 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
7645
7646 #. type: Plain text
7647 #: build/C/man3/pthread_setaffinity_np.3:204
7648 #, no-wrap
7649 msgid ""
7650 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7651 "    if (s != 0)\n"
7652 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7653 msgstr ""
7654 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7655 "    if (s != 0)\n"
7656 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7657
7658 #. type: Plain text
7659 #: build/C/man3/pthread_setaffinity_np.3:209
7660 #, no-wrap
7661 msgid ""
7662 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7663 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7664 "        if (CPU_ISSET(j, &cpuset))\n"
7665 "            printf(\"    CPU %d\\en\", j);\n"
7666 msgstr ""
7667 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7668 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7669 "        if (CPU_ISSET(j, &cpuset))\n"
7670 "            printf(\"    CPU %d\\en\", j);\n"
7671
7672 #. type: Plain text
7673 #: build/C/man3/pthread_setaffinity_np.3:212
7674 #: build/C/man3/pthread_setschedparam.3:439
7675 #, no-wrap
7676 msgid ""
7677 "    exit(EXIT_SUCCESS);\n"
7678 "}\n"
7679 msgstr ""
7680 "    exit(EXIT_SUCCESS);\n"
7681 "}\n"
7682
7683 #. type: Plain text
7684 #: build/C/man3/pthread_setaffinity_np.3:221
7685 msgid ""
7686 "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), "
7687 "B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), "
7688 "B<sched>(7)"
7689 msgstr ""
7690 "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), "
7691 "B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), "
7692 "B<sched>(7)"
7693
7694 #. type: TH
7695 #: build/C/man3/pthread_setcancelstate.3:26
7696 #, no-wrap
7697 msgid "PTHREAD_SETCANCELSTATE"
7698 msgstr "PTHREAD_SETCANCELSTATE"
7699
7700 #. type: Plain text
7701 #: build/C/man3/pthread_setcancelstate.3:30
7702 msgid ""
7703 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
7704 "type"
7705 msgstr ""
7706 "pthread_setcancelstate, pthread_setcanceltype - cancelability state と "
7707 "cancelability type を設定する"
7708
7709 #. type: Plain text
7710 #: build/C/man3/pthread_setcancelstate.3:36
7711 #, no-wrap
7712 msgid ""
7713 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7714 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7715 msgstr ""
7716 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7717 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7718
7719 #. type: Plain text
7720 #: build/C/man3/pthread_setcancelstate.3:51
7721 msgid ""
7722 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
7723 "thread to the value given in I<state>.  The previous cancelability state of "
7724 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
7725 "I<state> argument must have one of the following values:"
7726 msgstr ""
7727 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
7728 "cancelability state に I<state> で指定された\n"
7729 "値を設定する。変更前のスレッドの cancelability state は\n"
7730 "I<oldstate> が指すバッファで返される。\n"
7731 "I<state> 引き数には以下の値のいずれか一つを指定しなければならない。"
7732
7733 #. type: TP
7734 #: build/C/man3/pthread_setcancelstate.3:51
7735 #, no-wrap
7736 msgid "B<PTHREAD_CANCEL_ENABLE>"
7737 msgstr "B<PTHREAD_CANCEL_ENABLE>"
7738
7739 #. type: Plain text
7740 #: build/C/man3/pthread_setcancelstate.3:58
7741 msgid ""
7742 "The thread is cancelable.  This is the default cancelability state in all "
7743 "new threads, including the initial thread.  The thread's cancelability type "
7744 "determines when a cancelable thread will respond to a cancellation request."
7745 msgstr ""
7746 "スレッドは取り消し可能 (cancelable) である。\n"
7747 "これが全ての新しく作成されるスレッドでのデフォルトの\n"
7748 "cancelability state である。これには最初のスレッドも含まれる。\n"
7749 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
7750 "取り消し要求にいつ反応するかが決まる。"
7751
7752 #. type: TP
7753 #: build/C/man3/pthread_setcancelstate.3:58
7754 #, no-wrap
7755 msgid "B<PTHREAD_CANCEL_DISABLE>"
7756 msgstr "B<PTHREAD_CANCEL_DISABLE>"
7757
7758 #. type: Plain text
7759 #: build/C/man3/pthread_setcancelstate.3:63
7760 msgid ""
7761 "The thread is not cancelable.  If a cancellation request is received, it is "
7762 "blocked until cancelability is enabled."
7763 msgstr ""
7764 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
7765 "取り消し可能に設定されるまでその要求はブロックされる。"
7766
7767 #. type: Plain text
7768 #: build/C/man3/pthread_setcancelstate.3:75
7769 msgid ""
7770 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
7771 "thread to the value given in I<type>.  The previous cancelability type of "
7772 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
7773 "argument must have one of the following values:"
7774 msgstr ""
7775 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
7776 "cancelability type に I<type> で指定された値を設定する。\n"
7777 "変更前のスレッドの cancelability type は\n"
7778 "I<oldtype> が指すバッファで返される。\n"
7779 "I<type> 引き数には以下の値のいずれか一つを指定しなければならない。"
7780
7781 #. type: TP
7782 #: build/C/man3/pthread_setcancelstate.3:75
7783 #, no-wrap
7784 msgid "B<PTHREAD_CANCEL_DEFERRED>"
7785 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
7786
7787 #. type: Plain text
7788 #: build/C/man3/pthread_setcancelstate.3:82
7789 msgid ""
7790 "A cancellation request is deferred until the thread next calls a function "
7791 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
7792 "cancelability type in all new threads, including the initial thread."
7793 msgstr ""
7794 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
7795 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
7796 "スレッドでのデフォルトの cancelability type である。\n"
7797 "これには最初のスレッドも含まれる。"
7798
7799 #. type: TP
7800 #: build/C/man3/pthread_setcancelstate.3:82
7801 #, no-wrap
7802 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7803 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7804
7805 #. type: Plain text
7806 #: build/C/man3/pthread_setcancelstate.3:88
7807 msgid ""
7808 "The thread can be canceled at any time.  (Typically, it will be canceled "
7809 "immediately upon receiving a cancellation request, but the system doesn't "
7810 "guarantee this.)"
7811 msgstr ""
7812 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
7813 "システムがそのことを保証しているわけではない)。"
7814
7815 #. type: Plain text
7816 #: build/C/man3/pthread_setcancelstate.3:92
7817 msgid ""
7818 "The set-and-get operation performed by each of these functions is atomic "
7819 "with respect to other threads in the process calling the same function."
7820 msgstr ""
7821 "これらの関数により実行される「設定と取得」操作 (set-and-get operation) は、\n"
7822 "同じ関数を呼び出したプロセス内の他のスレッドがあっても、\n"
7823 "アトミックに行われる。"
7824
7825 #. type: Plain text
7826 #: build/C/man3/pthread_setcancelstate.3:99
7827 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
7828 msgstr "B<pthread_setcancelstate>() は以下のエラーで失敗する場合がある。"
7829
7830 #. type: Plain text
7831 #: build/C/man3/pthread_setcancelstate.3:103
7832 msgid "Invalid value for I<state>."
7833 msgstr "I<state> に無効な値が指定された。"
7834
7835 #. type: Plain text
7836 #: build/C/man3/pthread_setcancelstate.3:107
7837 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
7838 msgstr "B<pthread_setcanceltype>() は以下のエラーで失敗する場合がある。"
7839
7840 #.  .SH VERSIONS
7841 #.  Available since glibc 2.0
7842 #. type: Plain text
7843 #: build/C/man3/pthread_setcancelstate.3:113
7844 msgid "Invalid value for I<type>."
7845 msgstr "I<type> に無効な値が指定された。"
7846
7847 #. type: Plain text
7848 #: build/C/man3/pthread_setcancelstate.3:120
7849 msgid ""
7850 "The B<pthread_setcancelstate>()  and B<pthread_setcanceltype>()  functions "
7851 "are thread-safe."
7852 msgstr ""
7853 "関数 B<pthread_setcancelstate>() と B<pthread_setcanceltype>() はスレッドセー"
7854 "フである。"
7855
7856 #. type: Plain text
7857 #: build/C/man3/pthread_setcancelstate.3:125
7858 msgid ""
7859 "For details of what happens when a thread is canceled, see "
7860 "B<pthread_cancel>(3)."
7861 msgstr ""
7862 "スレッドが取り消された場合に何が起こるかの詳細については\n"
7863 "B<pthread_cancel>(3) を参照。"
7864
7865 #. type: Plain text
7866 #: build/C/man3/pthread_setcancelstate.3:132
7867 msgid ""
7868 "Briefly disabling cancelability is useful if a thread performs some critical "
7869 "action that must not be interrupted by a cancellation request.  Beware of "
7870 "disabling cancelability for long periods, or around operations that may "
7871 "block for long periods, since that will render the thread unresponsive to "
7872 "cancellation requests."
7873 msgstr ""
7874 "取り消し要求により中断されてはならない重要なアクションをスレッドが\n"
7875 "実行する場合、短い時間だけ cancelability を無効にするのは有用である。\n"
7876 "長い時間 cancelability を無効にしたり、長い時間停止 (block) される\n"
7877 "可能性のある操作の前後で cancelability を無効にしたりする際には\n"
7878 "注意すること。なぜなら、無効にしてしまうと、キャンセル要求に対して\n"
7879 "スレッドが応答しない状態になってしまうからである。"
7880
7881 #. type: SS
7882 #: build/C/man3/pthread_setcancelstate.3:132
7883 #, no-wrap
7884 msgid "Asynchronous cancelability"
7885 msgstr "非同期キャンセル"
7886
7887 #. type: Plain text
7888 #: build/C/man3/pthread_setcancelstate.3:151
7889 msgid ""
7890 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
7891 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
7892 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
7893 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
7894 "because the application has no way of knowing what the state of these "
7895 "resources is when the thread is canceled; that is, did cancellation occur "
7896 "before the resources were reserved, while they were reserved, or after they "
7897 "were released? Furthermore, some internal data structures (e.g., the linked "
7898 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
7899 "left in an inconsistent state if cancellation occurs in the middle of the "
7900 "function call.  Consequently, clean-up handlers cease to be useful."
7901 msgstr ""
7902 "cancelability type を B<PTHREAD_CANCEL_ASYNCHRONOUS> に設定して役に立つことは"
7903 "めったにない。スレッドはI<いつでも>キャンセルすることができることになるので、"
7904 "スレッドが安全にリソースの確保 (例えば B<malloc>(3) でメモリを割り当てる) や "
7905 "mutex、セマフォ、ロックなどの獲得を行うことができない。アプリケーションは、ス"
7906 "レッドがキャンセルされる際に、これらのリソースがどのような状態にあるかを知る"
7907 "術はないので、リソースの確保が安全ではなくなる。つまり、キャンセルが起こった"
7908 "のが、リソースの確保前なのか、確保中なのか、確保後なのかが分からない。さら"
7909 "に、関数呼び出しの最中にキャンセルが発生すると、いくつかの内部データ構造 (例"
7910 "えば、B<malloc>(3) 関連の関数が管理している未使用ブロックのリンクリスト) が一"
7911 "貫性のない状態のままになってしまう可能性がある。その結果、クリーンアップハン"
7912 "ドラが役に立たないものになってしまう。"
7913
7914 #. type: Plain text
7915 #: build/C/man3/pthread_setcancelstate.3:162
7916 msgid ""
7917 "Functions that can be safely asynchronously canceled are called I<async-"
7918 "cancel-safe functions>.  POSIX.1-2001 requires only that "
7919 "B<pthread_cancel>(3), B<pthread_setcancelstate>(), and "
7920 "B<pthread_setcanceltype>()  be async-cancel-safe.  In general, other library "
7921 "functions can't be safely called from an asynchronously cancelable thread."
7922 msgstr ""
7923 "非同期で安全にキャンセルできる関数は I<async-cancel-safe functions> と呼ばれ"
7924 "る。 POSIX.1-2001 で、非同期で安全にキャンセルできるように求められている関数"
7925 "は B<pthread_cancel>(3), B<pthread_setcancelstate>(), "
7926 "B<pthread_setcanceltype>() だけである。 一般的には、それ以外のライブラリ関数"
7927 "は、非同期にキャンセルできるスレッドから安全に呼び出すことはできない。"
7928
7929 #. type: Plain text
7930 #: build/C/man3/pthread_setcancelstate.3:165
7931 msgid ""
7932 "One of the few circumstances in which asynchronous cancelability is useful "
7933 "is for cancellation of a thread that is in a pure compute-bound loop."
7934 msgstr ""
7935 "非同期でのキャンセルが有効な数少ない状況としては、純粋に計算だけを行うループ"
7936 "に入っているスレッドをキャンセルするといった場面がある。"
7937
7938 #. type: SS
7939 #: build/C/man3/pthread_setcancelstate.3:165
7940 #, no-wrap
7941 msgid "Portability notes"
7942 msgstr "移植性に関する注意"
7943
7944 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
7945 #. type: Plain text
7946 #: build/C/man3/pthread_setcancelstate.3:183
7947 msgid ""
7948 "The Linux threading implementations permit the I<oldstate> argument of "
7949 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
7950 "the previous cancelability state is not returned to the caller.  Many other "
7951 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
7952 "does not specify this point, so portable applications should always specify "
7953 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
7954 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
7955 msgstr ""
7956 "Linux のスレッド実装では、 B<pthread_setcancelstate>() の I<oldstate>\n"
7957 "引き数に NULL を指定することを認めている。 NULL が指定された場合、\n"
7958 "変更前の cancelability state の情報が呼び出し側に返されない。\n"
7959 "他の多くの実装でも I<oldstate> 引き数に NULL を指定することを認めて\n"
7960 "いるが、 POSIX.1-2001 ではこの点については規定されていない。\n"
7961 "したがって、移植性が必要なアプリケーションでは常に I<oldstate> に\n"
7962 "NULL 以外の値を指定するようにすべきである。\n"
7963 "B<pthread_setcanceltype>() の I<oldtype> 引き数についても、\n"
7964 "全く同じことが言える。"
7965
7966 #. type: Plain text
7967 #: build/C/man3/pthread_setcancelstate.3:186
7968 msgid "See B<pthread_cancel>(3)."
7969 msgstr "B<pthread_cancel>(3) を参照。"
7970
7971 #. type: Plain text
7972 #: build/C/man3/pthread_setcancelstate.3:191
7973 msgid ""
7974 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7975 "B<pthreads>(7)"
7976 msgstr ""
7977 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7978 "B<pthreads>(7)"
7979
7980 #. type: TH
7981 #: build/C/man3/pthread_setconcurrency.3:25
7982 #, no-wrap
7983 msgid "PTHREAD_SETCONCURRENCY"
7984 msgstr "PTHREAD_SETCONCURRENCY"
7985
7986 #. type: Plain text
7987 #: build/C/man3/pthread_setconcurrency.3:29
7988 msgid ""
7989 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
7990 "level"
7991 msgstr ""
7992 "pthread_setconcurrency, pthread_getconcurrency - 並列処理レベルの設定/取得を"
7993 "行う"
7994
7995 #. type: Plain text
7996 #: build/C/man3/pthread_setconcurrency.3:35
7997 #, no-wrap
7998 msgid ""
7999 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
8000 "B<int pthread_getconcurrency(void);>\n"
8001 msgstr ""
8002 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
8003 "B<int pthread_getconcurrency(void);>\n"
8004
8005 #. type: Plain text
8006 #: build/C/man3/pthread_setconcurrency.3:48
8007 msgid ""
8008 "The B<pthread_setconcurrency>()  function informs the implementation of the "
8009 "application's desired concurrency level, specified in I<new_level>.  The "
8010 "implementation takes this only as a hint: POSIX.1 does not specify the level "
8011 "of concurrency that should be provided as a result of calling "
8012 "B<pthread_setconcurrency>()."
8013 msgstr ""
8014 "B<pthread_setconcurrency>() 関数は、アプリケーションが希望する\n"
8015 "並列処理レベル (concurrency level) をスレッド実装に通知する。\n"
8016 "希望する並列処理レベルは I<new_level> で指定する。\n"
8017 "スレッド実装はこの情報をヒントとしてのみ利用する。\n"
8018 "POSIX.1 では、 B<pthread_setconcurrency>() の呼び出した結果、\n"
8019 "どのような並列度になるべきかは規定されていない。"
8020
8021 #. type: Plain text
8022 #: build/C/man3/pthread_setconcurrency.3:53
8023 msgid ""
8024 "Specifying I<new_level> as 0 instructs the implementation to manage the "
8025 "concurrency level as it deems appropriate."
8026 msgstr ""
8027 "I<new_level> に 0 を指定すると、スレッド実装は並列処理レベルを\n"
8028 "実装側で適切とみなしたレベルに設定するようになる。"
8029
8030 #. type: Plain text
8031 #: build/C/man3/pthread_setconcurrency.3:56
8032 msgid ""
8033 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
8034 "level for this process."
8035 msgstr ""
8036 "B<pthread_getconcurrency>() は、このプロセスの concurrency level\n"
8037 "の現在値を返す。"
8038
8039 #. type: Plain text
8040 #: build/C/man3/pthread_setconcurrency.3:61
8041 msgid ""
8042 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
8043 "nonzero error number."
8044 msgstr ""
8045 "成功すると、 B<pthread_setconcurrency>() は 0 を返す。\n"
8046 "エラーの場合、 0 以外のエラー番号を返す。"
8047
8048 #. type: Plain text
8049 #: build/C/man3/pthread_setconcurrency.3:68
8050 msgid ""
8051 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
8052 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
8053 "B<pthread_setconcurrency>()  has not previously been called."
8054 msgstr ""
8055 "B<pthread_getconcurrency>() は常に成功し、最後の\n"
8056 "B<pthread_getconcurrency>() の呼び出しで設定された \n"
8057 "concurrency level を返す。 B<pthread_getconcurrency>() が\n"
8058 "それまでに一度も呼び出されていない場合は 0 が返る。"
8059
8060 #. type: Plain text
8061 #: build/C/man3/pthread_setconcurrency.3:71
8062 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
8063 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
8064
8065 #. type: Plain text
8066 #: build/C/man3/pthread_setconcurrency.3:75
8067 msgid "I<new_level> is negative."
8068 msgstr "I<new_level> が負である。"
8069
8070 #. type: Plain text
8071 #: build/C/man3/pthread_setconcurrency.3:81
8072 msgid ""
8073 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
8074 "I<new_level> would cause a system resource to be exceeded\")."
8075 msgstr ""
8076 "POSIX.1-2001 には、エラー B<EAGAIN> も記載されている\n"
8077 "(「I<new_level> に指定された値を適用すると、システムリソースが\n"
8078 "超過してしまう」)。"
8079
8080 #. type: Plain text
8081 #: build/C/man3/pthread_setconcurrency.3:83
8082 msgid "These functions are available in glibc since version 2.1."
8083 msgstr "これらの関数は glibc バージョン 2.1 以降で利用できる。"
8084
8085 #. type: Plain text
8086 #: build/C/man3/pthread_setconcurrency.3:90
8087 msgid ""
8088 "The B<pthread_setconcurrency>()  and B<pthread_getconcurrency>()  functions "
8089 "are thread-safe."
8090 msgstr ""
8091 "関数 B<pthread_setconcurrency>() と B<pthread_getconcurrency>() はスレッド"
8092 "セーフである。"
8093
8094 #. type: Plain text
8095 #: build/C/man3/pthread_setconcurrency.3:94
8096 msgid "The default concurrency level is 0."
8097 msgstr "デフォルトの concurrency level は 0 である。"
8098
8099 #. type: Plain text
8100 #: build/C/man3/pthread_setconcurrency.3:101
8101 msgid ""
8102 "Concurrency levels are meaningful only for M:N threading implementations, "
8103 "where at any moment a subset of a process's set of user-level threads may be "
8104 "bound to a smaller number of kernel-scheduling entities.  Setting the "
8105 "concurrency level allows the application to give the system a hint as to the "
8106 "number of kernel-scheduling entities that should be provided for efficient "
8107 "execution of the application."
8108 msgstr ""
8109 "並列処理レベルが意味を持つのは M:N スレッド実装の場合のみである。\n"
8110 "M:N スレッド実装では、ある瞬間において、あるプロセスのユーザレベルスレッ\n"
8111 "ドの集合のサブ集合が、そのサブ集合のサイズよりも少ない数のカーネルの\n"
8112 "スケジューリング実体 (kernel-scheduling entity) に結び付けられる。\n"
8113 "並列処理レベルを設定すると、そのアプリケーションの効率的な実行に必要な\n"
8114 "カーネルのスケジューリング実体の数のヒントを、アプリケーションはシステ\n"
8115 "ムに伝えることができる。"
8116
8117 #. type: Plain text
8118 #: build/C/man3/pthread_setconcurrency.3:107
8119 msgid ""
8120 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
8121 "concurrency level has no meaning.  In other words, on Linux these functions "
8122 "merely exist for compatibility with other systems, and they have no effect "
8123 "on the execution of a program."
8124 msgstr ""
8125 "LinuxThreads と NPTL のどちらも 1:1 スレッド実装であり、\n"
8126 "並列処理レベルを設定しても何の意味もない。\n"
8127 "言い換えると、 Linux では、これらの関数は、\n"
8128 "他のシステムとの互換性のためだけに存在し、\n"
8129 "プログラムの実行には何の影響も与えないということである。"
8130
8131 #. type: Plain text
8132 #: build/C/man3/pthread_setconcurrency.3:110
8133 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
8134 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
8135
8136 #. type: TH
8137 #: build/C/man3/pthread_setname_np.3:26
8138 #, no-wrap
8139 msgid "PTHREAD_SETNAME_NP"
8140 msgstr "PTHREAD_SETNAME_NP"
8141
8142 #. type: Plain text
8143 #: build/C/man3/pthread_setname_np.3:29
8144 msgid "pthread_setname_np, pthread_getname_np - set/get the name of a thread"
8145 msgstr "pthread_setname_np, pthread_getname_np - スレッド名の設定/取得を行う"
8146
8147 #. type: Plain text
8148 #: build/C/man3/pthread_setname_np.3:36
8149 #, no-wrap
8150 msgid ""
8151 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
8152 "B<#include E<lt>pthread.hE<gt>>\n"
8153 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
8154 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
8155 "B<                       char *>I<name>B<, size_t >I<len>B<);>\n"
8156 msgstr ""
8157 "B<#define _GNU_SOURCE>             /* 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
8163 #. type: Plain text
8164 #: build/C/man3/pthread_setname_np.3:55
8165 msgid ""
8166 "By default, all the threads created using B<pthread_create>()  inherit the "
8167 "program name.  The B<pthread_setname_np>()  function can be used to set a "
8168 "unique name for a thread, which can be useful for debugging multithreaded "
8169 "applications.  The thread name is a meaningful C language string, whose "
8170 "length is restricted to 16 characters, including the terminating null byte "
8171 "(\\(aq\\e0\\(aq).  The I<thread> argument specifies the thread whose name is "
8172 "to be changed; I<name> specifies the new name."
8173 msgstr ""
8174 "デフォルトでは、 B<pthread_create>() で作成されたすべてのスレッドはプログラム"
8175 "名を継承する。 B<pthread_setname_np>() 関数を使うとスレッドに固有の名前を設定"
8176 "することができる。 スレッド固有の名前はマルチスレッド・アプリケーションのデ"
8177 "バッグに便利である。 スレッド名は意味のある C 言語の文字列である。 その長さ"
8178 "は 16 文字に限定されており、 終端のヌルバイト (\\(aq\\e0\\(aq) も 16 文字に含"
8179 "まれる。 I<thread> 引き数で名前を変更するスレッドを指定する。 I<name> には新"
8180 "しい名前を指定する。"
8181
8182 #. type: Plain text
8183 #: build/C/man3/pthread_setname_np.3:72
8184 msgid ""
8185 "The B<pthread_getname_np>()  function can be used to retrieve the name of "
8186 "the thread.  The I<thread> argument specifies the thread whose name is to be "
8187 "retrieved.  The buffer I<name> is used to return the thread name; I<len> "
8188 "specifies the number of bytes available in I<name>.  The buffer specified by "
8189 "I<name> should be at least 16 characters in length.  The returned thread "
8190 "name in the output buffer will be null terminated."
8191 msgstr ""
8192 "B<pthread_getname_np>() 関数を使うと、 スレッド名を取得することができる。 "
8193 "I<thread> 引き数は名前を取得するスレッドを指定する。 バッファ I<name> はス"
8194 "レッド名を返すのに使用される。 I<len> には I<name> の大きさをバイトで指定す"
8195 "る。 I<name> で指定されたバッファの大きさは最低でも 16 文字とすべきである。 "
8196 "出力バッファに返されたスレッド名はヌル終端される。"
8197
8198 #. type: Plain text
8199 #: build/C/man3/pthread_setname_np.3:79
8200 msgid ""
8201 "The B<pthread_setname_np>()  function can fail with the following error:"
8202 msgstr "B<pthread_setname_np>() は以下のエラーで失敗する場合がある。"
8203
8204 #. type: TP
8205 #: build/C/man3/pthread_setname_np.3:79 build/C/man3/pthread_setname_np.3:88
8206 #, no-wrap
8207 msgid "B<ERANGE>"
8208 msgstr "B<ERANGE>"
8209
8210 #. type: Plain text
8211 #: build/C/man3/pthread_setname_np.3:84
8212 msgid ""
8213 "The length of the string specified pointed to by I<name> exceeds the allowed "
8214 "limit."
8215 msgstr "I<name> で指定された文字列の長さが、許可されている上限を超えている。"
8216
8217 #. type: Plain text
8218 #: build/C/man3/pthread_setname_np.3:88
8219 msgid ""
8220 "The B<pthread_getname_np>()  function can fail with the following error:"
8221 msgstr "B<pthread_getname_np>() は以下のエラーで失敗する場合がある。"
8222
8223 #. type: Plain text
8224 #: build/C/man3/pthread_setname_np.3:95
8225 msgid ""
8226 "The buffer specified by I<name> and I<len> is too small to hold the thread "
8227 "name."
8228 msgstr ""
8229 "I<name> と I<len> で指定されたバッファが、 スレッド名を格納するには短かすぎ"
8230 "る。"
8231
8232 #. type: Plain text
8233 #: build/C/man3/pthread_setname_np.3:100
8234 msgid ""
8235 "If either of these functions fails to open I</proc/self/task/[tid]/comm>, "
8236 "then the call may fail with one of the errors described in B<open>(2)."
8237 msgstr ""
8238 "I</proc/self/task/[tid]/comm> のオープンに失敗した場合、 これらの関数は "
8239 "B<open>(2) で説明されているエラーのいずれかで失敗する。"
8240
8241 #. type: Plain text
8242 #: build/C/man3/pthread_setname_np.3:102
8243 msgid "These functions first appeared in glibc in version 2.12."
8244 msgstr "これらの関数は glibc バージョン 2.12 で初めて登場した。"
8245
8246 #. type: Plain text
8247 #: build/C/man3/pthread_setname_np.3:104
8248 msgid "These functions are nonstandard GNU extensions."
8249 msgstr "これらの関数は非標準の GNU による拡張である。"
8250
8251 #. type: Plain text
8252 #: build/C/man3/pthread_setname_np.3:114
8253 msgid ""
8254 "B<pthread_setname_np>()  internally writes to the thread-specific I<comm> "
8255 "file under the I</proc> filesystem: I</proc/self/task/[tid]/comm>.  "
8256 "B<pthread_getname_np>()  retrieves it from the same location."
8257 msgstr ""
8258 "B<pthread_setname_np>() は内部で I</proc> ファイルシステムのスレッド固有の "
8259 "I<comm> ファイル (I</proc/self/task/[tid]/comm>) に書き込みを行う。 "
8260 "B<pthread_getname_np>() はこのファイルから読み出しを行う。"
8261
8262 #. type: Plain text
8263 #: build/C/man3/pthread_setname_np.3:120
8264 msgid ""
8265 "The program below demonstrates the use of B<pthread_setname_np>()  and "
8266 "B<pthread_getname_np>()."
8267 msgstr ""
8268 "以下のプログラムは、 B<pthread_setname_np>() と B<pthread_getname_np>()\n"
8269 "の使用例を示している。"
8270
8271 #. type: Plain text
8272 #: build/C/man3/pthread_setname_np.3:122
8273 msgid "The following shell session shows a sample run of the program:"
8274 msgstr "以下のシェルセッションは、このプログラムの実行例である。"
8275
8276 #. type: Plain text
8277 #: build/C/man3/pthread_setname_np.3:138
8278 #, no-wrap
8279 msgid ""
8280 "$B< ./a.out>\n"
8281 "Created a thread. Default name is: a.out\n"
8282 "The thread name after setting it is THREADFOO.\n"
8283 "B<^Z>                           # Suspend the program\n"
8284 "[1]+  Stopped           ./a.out\n"
8285 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
8286 "  PID   TID CMD                         COMMAND\n"
8287 " 5990  5990 ./a.out                     a.out\n"
8288 " 5990  5991 ./a.out                     THREADFOO\n"
8289 "$ B<cat /proc/5990/task/5990/comm>\n"
8290 "a.out\n"
8291 "$ B<cat /proc/5990/task/5991/comm>\n"
8292 "THREADFOO\n"
8293 msgstr ""
8294 "$B< ./a.out>\n"
8295 "Created a thread. Default name is: a.out\n"
8296 "The thread name after setting it is THREADFOO.\n"
8297 "B<^Z>                           # Suspend the program\n"
8298 "[1]+  Stopped           ./a.out\n"
8299 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
8300 "  PID   TID CMD                         COMMAND\n"
8301 " 5990  5990 ./a.out                     a.out\n"
8302 " 5990  5991 ./a.out                     THREADFOO\n"
8303 "$ B<cat /proc/5990/task/5990/comm>\n"
8304 "a.out\n"
8305 "$ B<cat /proc/5990/task/5991/comm>\n"
8306 "THREADFOO\n"
8307
8308 #. type: Plain text
8309 #: build/C/man3/pthread_setname_np.3:150
8310 #, no-wrap
8311 msgid ""
8312 "#define _GNU_SOURCE\n"
8313 "#include E<lt>pthread.hE<gt>\n"
8314 "#include E<lt>stdio.hE<gt>\n"
8315 "#include E<lt>string.hE<gt>\n"
8316 "#include E<lt>unistd.hE<gt>\n"
8317 "#include E<lt>errno.hE<gt>\n"
8318 "#include E<lt>stdlib.hE<gt>\n"
8319 msgstr ""
8320 "#define _GNU_SOURCE\n"
8321 "#include E<lt>pthread.hE<gt>\n"
8322 "#include E<lt>stdio.hE<gt>\n"
8323 "#include E<lt>string.hE<gt>\n"
8324 "#include E<lt>unistd.hE<gt>\n"
8325 "#include E<lt>errno.hE<gt>\n"
8326 "#include E<lt>stdlib.hE<gt>\n"
8327
8328 #. type: Plain text
8329 #: build/C/man3/pthread_setname_np.3:152
8330 #, no-wrap
8331 msgid "#define NAMELEN 16\n"
8332 msgstr "#define NAMELEN 16\n"
8333
8334 #. type: Plain text
8335 #: build/C/man3/pthread_setname_np.3:156
8336 #, no-wrap
8337 msgid ""
8338 "#define errExitEN(en, msg) \\e\n"
8339 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
8340 "        } while (0)\n"
8341 msgstr ""
8342 "#define errExitEN(en, msg) \\e\n"
8343 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
8344 "        } while (0)\n"
8345
8346 #. type: Plain text
8347 #: build/C/man3/pthread_setname_np.3:163
8348 #, no-wrap
8349 msgid ""
8350 "static void *\n"
8351 "threadfunc(void *parm)\n"
8352 "{\n"
8353 "    sleep(5);          // allow main program to set the thread name\n"
8354 "    return NULL;\n"
8355 "}\n"
8356 msgstr ""
8357 "static void *\n"
8358 "threadfunc(void *parm)\n"
8359 "{\n"
8360 "    sleep(5);          // allow main program to set the thread name\n"
8361 "    return NULL;\n"
8362 "}\n"
8363
8364 #. type: Plain text
8365 #: build/C/man3/pthread_setname_np.3:170
8366 #, no-wrap
8367 msgid ""
8368 "int\n"
8369 "main(int argc, char **argv)\n"
8370 "{\n"
8371 "    pthread_t thread;\n"
8372 "    int rc;\n"
8373 "    char thread_name[NAMELEN];\n"
8374 msgstr ""
8375 "int\n"
8376 "main(int argc, char **argv)\n"
8377 "{\n"
8378 "    pthread_t thread;\n"
8379 "    int rc;\n"
8380 "    char thread_name[NAMELEN];\n"
8381
8382 #. type: Plain text
8383 #: build/C/man3/pthread_setname_np.3:174
8384 #, no-wrap
8385 msgid ""
8386 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8387 "    if (rc != 0)\n"
8388 "        errExitEN(rc, \"pthread_create\");\n"
8389 msgstr ""
8390 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8391 "    if (rc != 0)\n"
8392 "        errExitEN(rc, \"pthread_create\");\n"
8393
8394 #. type: Plain text
8395 #: build/C/man3/pthread_setname_np.3:178
8396 #, no-wrap
8397 msgid ""
8398 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8399 "    if (rc != 0)\n"
8400 "        errExitEN(rc, \"pthread_getname_np\");\n"
8401 msgstr ""
8402 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8403 "    if (rc != 0)\n"
8404 "        errExitEN(rc, \"pthread_getname_np\");\n"
8405
8406 #. type: Plain text
8407 #: build/C/man3/pthread_setname_np.3:183
8408 #, no-wrap
8409 msgid ""
8410 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8411 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8412 "    if (rc != 0)\n"
8413 "        errExitEN(rc, \"pthread_setname_np\");\n"
8414 msgstr ""
8415 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8416 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8417 "    if (rc != 0)\n"
8418 "        errExitEN(rc, \"pthread_setname_np\");\n"
8419
8420 #. type: Plain text
8421 #: build/C/man3/pthread_setname_np.3:185
8422 #, no-wrap
8423 msgid "    sleep(2);\n"
8424 msgstr "    sleep(2);\n"
8425
8426 #. type: Plain text
8427 #: build/C/man3/pthread_setname_np.3:191
8428 #, no-wrap
8429 msgid ""
8430 "    rc = pthread_getname_np(thread, thread_name,\n"
8431 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8432 "    if (rc != 0)\n"
8433 "        errExitEN(rc, \"pthread_getname_np\");\n"
8434 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8435 msgstr ""
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
8442 #. type: Plain text
8443 #: build/C/man3/pthread_setname_np.3:195
8444 #, no-wrap
8445 msgid ""
8446 "    rc = pthread_join(thread, NULL);\n"
8447 "    if (rc != 0)\n"
8448 "        errExitEN(rc, \"pthread_join\");\n"
8449 msgstr ""
8450 "    rc = pthread_join(thread, NULL);\n"
8451 "    if (rc != 0)\n"
8452 "        errExitEN(rc, \"pthread_join\");\n"
8453
8454 #. type: Plain text
8455 #: build/C/man3/pthread_setname_np.3:199
8456 #, no-wrap
8457 msgid ""
8458 "    printf(\"Done\\en\");\n"
8459 "    exit(EXIT_SUCCESS);\n"
8460 "}\n"
8461 msgstr ""
8462 "    printf(\"Done\\en\");\n"
8463 "    exit(EXIT_SUCCESS);\n"
8464 "}\n"
8465
8466 #. type: Plain text
8467 #: build/C/man3/pthread_setname_np.3:206
8468 msgid "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8469 msgstr "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8470
8471 #. type: TH
8472 #: build/C/man3/pthread_setschedparam.3:26
8473 #, no-wrap
8474 msgid "PTHREAD_SETSCHEDPARAM"
8475 msgstr "PTHREAD_SETSCHEDPARAM"
8476
8477 #. type: TH
8478 #: build/C/man3/pthread_setschedparam.3:26
8479 #, no-wrap
8480 msgid "2014-12-31"
8481 msgstr "2014-12-31"
8482
8483 #. type: Plain text
8484 #: build/C/man3/pthread_setschedparam.3:30
8485 msgid ""
8486 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
8487 "parameters of a thread"
8488 msgstr ""
8489 "pthread_setschedparam, pthread_getschedparam - スレッドの\n"
8490 "スケジューリングポリシーとパラメータを設定/取得する"
8491
8492 #. type: Plain text
8493 #: build/C/man3/pthread_setschedparam.3:38
8494 #, no-wrap
8495 msgid ""
8496 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8497 "B<                          const struct sched_param *>I<param>B<);>\n"
8498 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8499 "B<                          struct sched_param *>I<param>B<);>\n"
8500 msgstr ""
8501 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8502 "B<                          const struct sched_param *>I<param>B<);>\n"
8503 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8504 "B<                          struct sched_param *>I<param>B<);>\n"
8505
8506 #. type: Plain text
8507 #: build/C/man3/pthread_setschedparam.3:46
8508 msgid ""
8509 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
8510 "parameters of the thread I<thread>."
8511 msgstr ""
8512 "B<pthread_setschedparam>() 関数は、スレッド I<thread> の\n"
8513 "スケジューリングポリシーとスケジューリングパラメータを設定する。"
8514
8515 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
8516 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
8517 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
8518 #. type: Plain text
8519 #: build/C/man3/pthread_setschedparam.3:57
8520 msgid ""
8521 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
8522 "values for I<policy>, and their semantics, are described in B<sched>(7)."
8523 msgstr ""
8524 "I<policy> は I<thread> の新しいスケジューリングポリシーを指定する。 "
8525 "I<policy> に指定できる値とその意味は B<sched>(7) で説明されている。"
8526
8527 #. type: Plain text
8528 #: build/C/man3/pthread_setschedparam.3:63
8529 msgid ""
8530 "The structure pointed to by I<param> specifies the new scheduling parameters "
8531 "for I<thread>.  Scheduling parameters are maintained in the following "
8532 "structure:"
8533 msgstr ""
8534 "I<param> が指す構造体は I<thread> の新しいスケジューリングパラメータを\n"
8535 "指定する。スケジューリングパラメータは以下の構造体で管理される。"
8536
8537 #.  FIXME . nptl/pthread_setschedparam.c has the following
8538 #.    /* If the thread should have higher priority because of some
8539 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
8540 #.  Eventually (perhaps after writing the mutexattr pages), we
8541 #.  may want to add something on the topic to this page.
8542 #. type: Plain text
8543 #: build/C/man3/pthread_setschedparam.3:104
8544 msgid ""
8545 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
8546 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
8547 "and I<param>, respectively.  The returned priority value is that set by the "
8548 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
8549 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
8550 "does not reflect any temporary priority adjustments as a result of calls to "
8551 "any priority inheritance or priority ceiling functions (see, for example, "
8552 "B<pthread_mutexattr_setprioceiling>(3)  and "
8553 "B<pthread_mutexattr_setprotocol>(3))."
8554 msgstr ""
8555 "B<pthread_getschedparam>() 関数は、スレッド I<thread> の\n"
8556 "スケジューリングポリシーとパラメータを、\n"
8557 "それぞれ I<policy> と I<param> が指すバッファに入れて返す。\n"
8558 "返された優先度の値は、最も最近実行した I<thread> に影響を与える\n"
8559 "B<pthread_setschedparam>(), B<pthread_setschedprio>,\n"
8560 "B<pthread_create> で設定された値となる。\n"
8561 "返された優先度は、優先度の継承や優先度の上限を設定する関数\n"
8562 "(例えば B<pthread_mutexattr_setprioceiling>(3) や\n"
8563 "B<pthread_mutexattr_setprotocol>(3) を参照) の呼び出しの結果\n"
8564 "行われる一時的な優先度の調整の影響を受けない。"
8565
8566 #. type: Plain text
8567 #: build/C/man3/pthread_setschedparam.3:112
8568 msgid ""
8569 "On success, these functions return 0; on error, they return a nonzero error "
8570 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
8571 "parameters of I<thread> are not changed."
8572 msgstr ""
8573 "成功すると、これらの関数は 0 を返す。\n"
8574 "エラーの場合、0 以外のエラー番号を返す。\n"
8575 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
8576 "スケジューリングポリシーとパラメータは変更されない。"
8577
8578 #. type: Plain text
8579 #: build/C/man3/pthread_setschedparam.3:114
8580 msgid "Both of these functions can fail with the following error:"
8581 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
8582
8583 #. type: Plain text
8584 #: build/C/man3/pthread_setschedparam.3:122
8585 msgid ""
8586 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
8587 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
8588
8589 #. type: Plain text
8590 #: build/C/man3/pthread_setschedparam.3:129
8591 msgid ""
8592 "I<policy> is not a recognized policy, or I<param> does not make sense for "
8593 "the I<policy>."
8594 msgstr ""
8595 "I<policy> が認識できないポリシーであるか、\n"
8596 "I<param> が I<policy> では意味を持たない値である。"
8597
8598 #. type: Plain text
8599 #: build/C/man3/pthread_setschedparam.3:133
8600 msgid ""
8601 "The caller does not have appropriate privileges to set the specified "
8602 "scheduling policy and parameters."
8603 msgstr ""
8604 "呼び出し側が、指定されたスケジューリングポリシーやパラメータを設定する\n"
8605 "のに必要な特権を持たない。"
8606
8607 #.  .SH VERSIONS
8608 #.  Available since glibc 2.0
8609 #. type: Plain text
8610 #: build/C/man3/pthread_setschedparam.3:141
8611 msgid ""
8612 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
8613 "policy or scheduling parameters to an unsupported value\") error for "
8614 "B<pthread_setschedparam>()."
8615 msgstr ""
8616 "POSIX.1-2001 では、 B<pthread_setschedparam>() に関して\n"
8617 "エラー B<ENOTSUP> (\"サポートされていない値をスケジューリングポリシーや\n"
8618 "パラメータに設定しようとした\") も追加で規定されている。"
8619
8620 #. type: Plain text
8621 #: build/C/man3/pthread_setschedparam.3:148
8622 msgid ""
8623 "The B<pthread_setschedparam>()  and B<pthread_getschedparam>()  functions "
8624 "are thread-safe."
8625 msgstr ""
8626 "関数 B<pthread_setschedparam>() と B<pthread_getschedparam>() はスレッドセー"
8627 "フである。"
8628
8629 #. type: Plain text
8630 #: build/C/man3/pthread_setschedparam.3:156
8631 msgid ""
8632 "For a description of the permissions required to, and the effect of, "
8633 "changing a thread's scheduling policy and priority, and details of the "
8634 "permitted ranges for priorities in each scheduling policy, see B<sched>(7)."
8635 msgstr ""
8636 "スレッドのスケジューリングポリシーや優先度を変更するために必要な許可や変更し"
8637 "た場合の影響、および各スケジューリングポリシーで認められる優先度の範囲の詳細"
8638 "については、 B<sched>(7) を参照。"
8639
8640 #. type: Plain text
8641 #: build/C/man3/pthread_setschedparam.3:163
8642 msgid ""
8643 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
8644 "B<pthread_getschedparam>(), as well as the use of a number of other "
8645 "scheduling-related pthreads functions."
8646 msgstr ""
8647 "以下のプログラムは B<pthread_setschedparam>() と\n"
8648 "B<pthread_getschedparam>() やスケジューリングに関連する pthreads の\n"
8649 "他のいろいろな関数の使用例を示すものである。"
8650
8651 #. type: Plain text
8652 #: build/C/man3/pthread_setschedparam.3:179
8653 msgid ""
8654 "In the following run, the main thread sets its scheduling policy to "
8655 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
8656 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
8657 "priority attribute of 20.  The program then sets (using "
8658 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
8659 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
8660 "created using this attributes object should take their scheduling attributes "
8661 "from the thread attributes object.  The program then creates a thread using "
8662 "the thread attributes object, and that thread displays its scheduling policy "
8663 "and priority."
8664 msgstr ""
8665 "以下の実行例では、メインスレッドは、自分のスケジューリングポリシーを\n"
8666 "優先度 10 の B<SCHED_FIFO> を設定し、スレッド属性オブジェクトを\n"
8667 "スケジューリングポリシー属性 B<SCHED_RR> とスケジューリング優先度\n"
8668 "属性 20 で初期化する。\n"
8669 "次に、このプログラムは (B<pthread_attr_setinheritsched>(3) を使って) \n"
8670 "そのスレッド属性オブジェクトの inherit scheduler 属性に\n"
8671 "B<PTHREAD_EXPLICIT_SCHED> を設定する。B<PTHREAD_EXPLICIT_SCHED> は、\n"
8672 "そのスレッド属性オブジェクトを使って作成されたスレッドはスレッド属性\n"
8673 "オブジェクトからスケジューリング属性を取得して使うことを意味する。\n"
8674 "それから、このスレッド属性オブジェクトを使ってスレッドを作成し、\n"
8675 "作成したスレッドのスケジューリングポリシーと優先度を表示する。"
8676
8677 #. type: Plain text
8678 #: build/C/man3/pthread_setschedparam.3:187
8679 #, no-wrap
8680 msgid ""
8681 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
8682 "Password:\n"
8683 "# B<./a.out -mf10 -ar20 -i e>\n"
8684 "Scheduler settings of main thread\n"
8685 "    policy=SCHED_FIFO, priority=10\n"
8686 msgstr ""
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
8693 #. type: Plain text
8694 #: build/C/man3/pthread_setschedparam.3:191
8695 #, no-wrap
8696 msgid ""
8697 "Scheduler settings in \\(aqattr\\(aq\n"
8698 "    policy=SCHED_RR, priority=20\n"
8699 "    inheritsched is EXPLICIT\n"
8700 msgstr ""
8701 "Scheduler settings in \\(aqattr\\(aq\n"
8702 "    policy=SCHED_RR, priority=20\n"
8703 "    inheritsched is EXPLICIT\n"
8704
8705 #. type: Plain text
8706 #: build/C/man3/pthread_setschedparam.3:194
8707 #, no-wrap
8708 msgid ""
8709 "Scheduler attributes of new thread\n"
8710 "    policy=SCHED_RR, priority=20\n"
8711 msgstr ""
8712 "Scheduler attributes of new thread\n"
8713 "    policy=SCHED_RR, priority=20\n"
8714
8715 #. type: Plain text
8716 #: build/C/man3/pthread_setschedparam.3:199
8717 msgid ""
8718 "In the above output, one can see that the scheduling policy and priority "
8719 "were taken from the values specified in the thread attributes object."
8720 msgstr ""
8721 "上記の出力では、スケジューリングポリシーと優先度がスレッド属性\n"
8722 "オブジェクトで指定された値から取られていることが分かる。"
8723
8724 #. type: Plain text
8725 #: build/C/man3/pthread_setschedparam.3:206
8726 msgid ""
8727 "The next run is the same as the previous, except that the inherit scheduler "
8728 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
8729 "using the thread attributes object should ignore the scheduling attributes "
8730 "specified in the attributes object and instead take their scheduling "
8731 "attributes from the creating thread."
8732 msgstr ""
8733 "次の実行例は前のものと同じだが、 inherit scheduler 属性が \n"
8734 "B<PTHREAD_INHERIT_SCHED> に設定される点が異なる。\n"
8735 "B<PTHREAD_INHERIT_SCHED> は、そのスレッド属性オブジェクトを使って作成\n"
8736 "されたスレッドは、スレッド属性オブジェクトからスケジューリング属性を\n"
8737 "無視し、代わりに呼び出したスレッドからスケジューリング属性を取得する\n"
8738 "ことを意味する。"
8739
8740 #. type: Plain text
8741 #: build/C/man3/pthread_setschedparam.3:212
8742 #, no-wrap
8743 msgid ""
8744 "# B<./a.out -mf10 -ar20 -i i>\n"
8745 "Scheduler settings of main thread\n"
8746 "    policy=SCHED_FIFO, priority=10\n"
8747 msgstr ""
8748 "# B<./a.out -mf10 -ar20 -i i>\n"
8749 "Scheduler settings of main thread\n"
8750 "    policy=SCHED_FIFO, priority=10\n"
8751
8752 #. type: Plain text
8753 #: build/C/man3/pthread_setschedparam.3:216
8754 #, no-wrap
8755 msgid ""
8756 "Scheduler settings in \\(aqattr\\(aq\n"
8757 "    policy=SCHED_RR, priority=20\n"
8758 "    inheritsched is INHERIT\n"
8759 msgstr ""
8760 "Scheduler settings in \\(aqattr\\(aq\n"
8761 "    policy=SCHED_RR, priority=20\n"
8762 "    inheritsched is INHERIT\n"
8763
8764 #. type: Plain text
8765 #: build/C/man3/pthread_setschedparam.3:219
8766 #, no-wrap
8767 msgid ""
8768 "Scheduler attributes of new thread\n"
8769 "    policy=SCHED_FIFO, priority=10\n"
8770 msgstr ""
8771 "Scheduler attributes of new thread\n"
8772 "    policy=SCHED_FIFO, priority=10\n"
8773
8774 #. type: Plain text
8775 #: build/C/man3/pthread_setschedparam.3:225
8776 msgid ""
8777 "In the above output, one can see that the scheduling policy and priority "
8778 "were taken from the creating thread, rather than the thread attributes "
8779 "object."
8780 msgstr ""
8781 "上記の出力では、スケジューリングポリシーと優先度が、\n"
8782 "スレッド属性オブジェクトからではなく、\n"
8783 "スレッドを作成したスレッドから取れれていることが分かる。"
8784
8785 #. type: Plain text
8786 #: build/C/man3/pthread_setschedparam.3:231
8787 msgid ""
8788 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
8789 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
8790 "scheduler attribute."
8791 msgstr ""
8792 "なお、 I<-i\\ i> を省略した場合でも、\n"
8793 "B<PTHREAD_INHERIT_SCHED> が inherit scheduler 属性のデフォルト値なので、\n"
8794 "出力は同じになる。"
8795
8796 #. type: Plain text
8797 #: build/C/man3/pthread_setschedparam.3:235
8798 #, no-wrap
8799 msgid "/* pthreads_sched_test.c */\n"
8800 msgstr "/* pthreads_sched_test.c */\n"
8801
8802 #. type: Plain text
8803 #: build/C/man3/pthread_setschedparam.3:241
8804 #, no-wrap
8805 msgid ""
8806 "#include E<lt>pthread.hE<gt>\n"
8807 "#include E<lt>stdio.hE<gt>\n"
8808 "#include E<lt>stdlib.hE<gt>\n"
8809 "#include E<lt>unistd.hE<gt>\n"
8810 "#include E<lt>errno.hE<gt>\n"
8811 msgstr ""
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
8818 #. type: Plain text
8819 #: build/C/man3/pthread_setschedparam.3:250
8820 #, no-wrap
8821 msgid ""
8822 "static void\n"
8823 "usage(char *prog_name, char *msg)\n"
8824 "{\n"
8825 "    if (msg != NULL)\n"
8826 "        fputs(msg, stderr);\n"
8827 msgstr ""
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
8834 #. type: Plain text
8835 #: build/C/man3/pthread_setschedparam.3:267
8836 #, no-wrap
8837 msgid ""
8838 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
8839 "    fprintf(stderr, \"Options are:\\en\");\n"
8840 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
8841 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
8842 "    fpe(\"                 thread attributes object\\en\");\n"
8843 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8844 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8845 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8846 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8847 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8848 "    fpe(\"-i {e|i}         Set inherit scheduler attribute to\\en\");\n"
8849 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8850 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8851 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8852 "    exit(EXIT_FAILURE);\n"
8853 "}\n"
8854 msgstr ""
8855 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
8856 "    fprintf(stderr, \"Options are:\\en\");\n"
8857 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
8858 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
8859 "    fpe(\"                 thread attributes object\\en\");\n"
8860 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8861 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8862 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8863 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8864 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8865 "    fpe(\"-i {e|i}         Set inherit scheduler attribute to\\en\");\n"
8866 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8867 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8868 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8869 "    exit(EXIT_FAILURE);\n"
8870 "}\n"
8871
8872 #. type: Plain text
8873 #: build/C/man3/pthread_setschedparam.3:278
8874 #, no-wrap
8875 msgid ""
8876 "static int\n"
8877 "get_policy(char p, int *policy)\n"
8878 "{\n"
8879 "    switch (p) {\n"
8880 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8881 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8882 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8883 "    default:  return 0;\n"
8884 "    }\n"
8885 "}\n"
8886 msgstr ""
8887 "static int\n"
8888 "get_policy(char p, int *policy)\n"
8889 "{\n"
8890 "    switch (p) {\n"
8891 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8892 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8893 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8894 "    default:  return 0;\n"
8895 "    }\n"
8896 "}\n"
8897
8898 #. type: Plain text
8899 #: build/C/man3/pthread_setschedparam.3:289
8900 #, no-wrap
8901 msgid ""
8902 "static void\n"
8903 "display_sched_attr(int policy, struct sched_param *param)\n"
8904 "{\n"
8905 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8906 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8907 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8908 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8909 "            \"???\",\n"
8910 "            param-E<gt>sched_priority);\n"
8911 "}\n"
8912 msgstr ""
8913 "static void\n"
8914 "display_sched_attr(int policy, struct sched_param *param)\n"
8915 "{\n"
8916 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8917 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8918 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8919 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8920 "            \"???\",\n"
8921 "            param-E<gt>sched_priority);\n"
8922 "}\n"
8923
8924 #. type: Plain text
8925 #: build/C/man3/pthread_setschedparam.3:295
8926 #, no-wrap
8927 msgid ""
8928 "static void\n"
8929 "display_thread_sched_attr(char *msg)\n"
8930 "{\n"
8931 "    int policy, s;\n"
8932 "    struct sched_param param;\n"
8933 msgstr ""
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
8940 #. type: Plain text
8941 #: build/C/man3/pthread_setschedparam.3:299
8942 #, no-wrap
8943 msgid ""
8944 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8945 "    if (s != 0)\n"
8946 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8947 msgstr ""
8948 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8949 "    if (s != 0)\n"
8950 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8951
8952 #. type: Plain text
8953 #: build/C/man3/pthread_setschedparam.3:303
8954 #, no-wrap
8955 msgid ""
8956 "    printf(\"%s\\en\", msg);\n"
8957 "    display_sched_attr(policy, &param);\n"
8958 "}\n"
8959 msgstr ""
8960 "    printf(\"%s\\en\", msg);\n"
8961 "    display_sched_attr(policy, &param);\n"
8962 "}\n"
8963
8964 #. type: Plain text
8965 #: build/C/man3/pthread_setschedparam.3:308
8966 #, no-wrap
8967 msgid ""
8968 "static void *\n"
8969 "thread_start(void *arg)\n"
8970 "{\n"
8971 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8972 msgstr ""
8973 "static void *\n"
8974 "thread_start(void *arg)\n"
8975 "{\n"
8976 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8977
8978 #. type: Plain text
8979 #: build/C/man3/pthread_setschedparam.3:311
8980 #, no-wrap
8981 msgid ""
8982 "    return NULL;\n"
8983 "}\n"
8984 msgstr ""
8985 "    return NULL;\n"
8986 "}\n"
8987
8988 #. type: Plain text
8989 #: build/C/man3/pthread_setschedparam.3:321
8990 #, no-wrap
8991 msgid ""
8992 "int\n"
8993 "main(int argc, char *argv[])\n"
8994 "{\n"
8995 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
8996 "    pthread_t thread;\n"
8997 "    pthread_attr_t attr;\n"
8998 "    pthread_attr_t *attrp;\n"
8999 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
9000 "    struct sched_param param;\n"
9001 msgstr ""
9002 "int\n"
9003 "main(int argc, char *argv[])\n"
9004 "{\n"
9005 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
9006 "    pthread_t thread;\n"
9007 "    pthread_attr_t attr;\n"
9008 "    pthread_attr_t *attrp;\n"
9009 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
9010 "    struct sched_param param;\n"
9011
9012 #. type: Plain text
9013 #: build/C/man3/pthread_setschedparam.3:323
9014 #, no-wrap
9015 msgid "    /* Process command-line options */\n"
9016 msgstr "    /* Process command-line options */\n"
9017
9018 #. type: Plain text
9019 #: build/C/man3/pthread_setschedparam.3:328
9020 #, no-wrap
9021 msgid ""
9022 "    use_null_attrib = 0;\n"
9023 "    attr_sched_str = NULL;\n"
9024 "    main_sched_str = NULL;\n"
9025 "    inheritsched_str = NULL;\n"
9026 msgstr ""
9027 "    use_null_attrib = 0;\n"
9028 "    attr_sched_str = NULL;\n"
9029 "    main_sched_str = NULL;\n"
9030 "    inheritsched_str = NULL;\n"
9031
9032 #. type: Plain text
9033 #: build/C/man3/pthread_setschedparam.3:338
9034 #, no-wrap
9035 msgid ""
9036 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
9037 "        switch (opt) {\n"
9038 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
9039 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
9040 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
9041 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
9042 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
9043 "        }\n"
9044 "    }\n"
9045 msgstr ""
9046 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
9047 "        switch (opt) {\n"
9048 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
9049 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
9050 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
9051 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
9052 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
9053 "        }\n"
9054 "    }\n"
9055
9056 #. type: Plain text
9057 #: build/C/man3/pthread_setschedparam.3:342
9058 #, no-wrap
9059 msgid ""
9060 "    if (use_null_attrib &&\n"
9061 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
9062 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
9063 msgstr ""
9064 "    if (use_null_attrib &&\n"
9065 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
9066 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
9067
9068 #. type: Plain text
9069 #: build/C/man3/pthread_setschedparam.3:345
9070 #, no-wrap
9071 msgid ""
9072 "    /* Optionally set scheduling attributes of main thread,\n"
9073 "       and display the attributes */\n"
9074 msgstr ""
9075 "    /* Optionally set scheduling attributes of main thread,\n"
9076 "       and display the attributes */\n"
9077
9078 #. type: Plain text
9079 #: build/C/man3/pthread_setschedparam.3:350
9080 #, no-wrap
9081 msgid ""
9082 "    if (main_sched_str != NULL) {\n"
9083 "        if (!get_policy(main_sched_str[0], &policy))\n"
9084 "            usage(argv[0], \"Bad policy for main thread (-m)\\en\");\n"
9085 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
9086 msgstr ""
9087 "    if (main_sched_str != NULL) {\n"
9088 "        if (!get_policy(main_sched_str[0], &policy))\n"
9089 "            usage(argv[0], \"Bad policy for main thread (-m)\\en\");\n"
9090 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
9091
9092 #. type: Plain text
9093 #: build/C/man3/pthread_setschedparam.3:355
9094 #, no-wrap
9095 msgid ""
9096 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
9097 "        if (s != 0)\n"
9098 "            handle_error_en(s, \"pthread_setschedparam\");\n"
9099 "    }\n"
9100 msgstr ""
9101 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
9102 "        if (s != 0)\n"
9103 "            handle_error_en(s, \"pthread_setschedparam\");\n"
9104 "    }\n"
9105
9106 #. type: Plain text
9107 #: build/C/man3/pthread_setschedparam.3:358
9108 #, no-wrap
9109 msgid ""
9110 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
9111 "    printf(\"\\en\");\n"
9112 msgstr ""
9113 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
9114 "    printf(\"\\en\");\n"
9115
9116 #. type: Plain text
9117 #: build/C/man3/pthread_setschedparam.3:360
9118 #, no-wrap
9119 msgid "    /* Initialize thread attributes object according to options */\n"
9120 msgstr "    /* Initialize thread attributes object according to options */\n"
9121
9122 #. type: Plain text
9123 #: build/C/man3/pthread_setschedparam.3:369
9124 #, no-wrap
9125 msgid ""
9126 "    if (!use_null_attrib) {\n"
9127 "        s = pthread_attr_init(&attr);\n"
9128 "        if (s != 0)\n"
9129 "            handle_error_en(s, \"pthread_attr_init\");\n"
9130 "        attrp = &attr;\n"
9131 "    }\n"
9132 msgstr ""
9133 "    if (!use_null_attrib) {\n"
9134 "        s = pthread_attr_init(&attr);\n"
9135 "        if (s != 0)\n"
9136 "            handle_error_en(s, \"pthread_attr_init\");\n"
9137 "        attrp = &attr;\n"
9138 "    }\n"
9139
9140 #. type: Plain text
9141 #: build/C/man3/pthread_setschedparam.3:377
9142 #, no-wrap
9143 msgid ""
9144 "    if (inheritsched_str != NULL) {\n"
9145 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
9146 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
9147 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
9148 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
9149 "        else\n"
9150 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
9151 msgstr ""
9152 "    if (inheritsched_str != NULL) {\n"
9153 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
9154 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
9155 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
9156 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
9157 "        else\n"
9158 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
9159
9160 #. type: Plain text
9161 #: build/C/man3/pthread_setschedparam.3:382
9162 #, no-wrap
9163 msgid ""
9164 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
9165 "        if (s != 0)\n"
9166 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
9167 "    }\n"
9168 msgstr ""
9169 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
9170 "        if (s != 0)\n"
9171 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
9172 "    }\n"
9173
9174 #. type: Plain text
9175 #: build/C/man3/pthread_setschedparam.3:388
9176 #, no-wrap
9177 msgid ""
9178 "    if (attr_sched_str != NULL) {\n"
9179 "        if (!get_policy(attr_sched_str[0], &policy))\n"
9180 "            usage(argv[0],\n"
9181 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
9182 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
9183 msgstr ""
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
9190 #. type: Plain text
9191 #: build/C/man3/pthread_setschedparam.3:396
9192 #, no-wrap
9193 msgid ""
9194 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
9195 "        if (s != 0)\n"
9196 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
9197 "        s = pthread_attr_setschedparam(&attr, &param);\n"
9198 "        if (s != 0)\n"
9199 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
9200 "    }\n"
9201 msgstr ""
9202 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
9203 "        if (s != 0)\n"
9204 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
9205 "        s = pthread_attr_setschedparam(&attr, &param);\n"
9206 "        if (s != 0)\n"
9207 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
9208 "    }\n"
9209
9210 #. type: Plain text
9211 #: build/C/man3/pthread_setschedparam.3:399
9212 #, no-wrap
9213 msgid ""
9214 "    /* If we initialized a thread attributes object, display\n"
9215 "       the scheduling attributes that were set in the object */\n"
9216 msgstr ""
9217 "    /* If we initialized a thread attributes object, display\n"
9218 "       the scheduling attributes that were set in the object */\n"
9219
9220 #. type: Plain text
9221 #: build/C/man3/pthread_setschedparam.3:407
9222 #, no-wrap
9223 msgid ""
9224 "    if (attrp != NULL) {\n"
9225 "        s = pthread_attr_getschedparam(&attr, &param);\n"
9226 "        if (s != 0)\n"
9227 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
9228 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
9229 "        if (s != 0)\n"
9230 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
9231 msgstr ""
9232 "    if (attrp != NULL) {\n"
9233 "        s = pthread_attr_getschedparam(&attr, &param);\n"
9234 "        if (s != 0)\n"
9235 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
9236 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
9237 "        if (s != 0)\n"
9238 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
9239
9240 #. type: Plain text
9241 #: build/C/man3/pthread_setschedparam.3:410
9242 #, no-wrap
9243 msgid ""
9244 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
9245 "        display_sched_attr(policy, &param);\n"
9246 msgstr ""
9247 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
9248 "        display_sched_attr(policy, &param);\n"
9249
9250 #. type: Plain text
9251 #: build/C/man3/pthread_setschedparam.3:418
9252 #, no-wrap
9253 msgid ""
9254 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
9255 "        printf(\"    inheritsched is %s\\en\",\n"
9256 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
9257 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
9258 "                \"???\");\n"
9259 "        printf(\"\\en\");\n"
9260 "    }\n"
9261 msgstr ""
9262 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
9263 "        printf(\"    inheritsched is %s\\en\",\n"
9264 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
9265 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
9266 "                \"???\");\n"
9267 "        printf(\"\\en\");\n"
9268 "    }\n"
9269
9270 #. type: Plain text
9271 #: build/C/man3/pthread_setschedparam.3:420
9272 #, no-wrap
9273 msgid "    /* Create a thread that will display its scheduling attributes */\n"
9274 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
9275
9276 #. type: Plain text
9277 #: build/C/man3/pthread_setschedparam.3:424
9278 #, no-wrap
9279 msgid ""
9280 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
9281 "    if (s != 0)\n"
9282 "        handle_error_en(s, \"pthread_create\");\n"
9283 msgstr ""
9284 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
9285 "    if (s != 0)\n"
9286 "        handle_error_en(s, \"pthread_create\");\n"
9287
9288 #. type: Plain text
9289 #: build/C/man3/pthread_setschedparam.3:426
9290 #, no-wrap
9291 msgid "    /* Destroy unneeded thread attributes object */\n"
9292 msgstr "    /* Destroy unneeded thread attributes object */\n"
9293
9294 #. type: Plain text
9295 #: build/C/man3/pthread_setschedparam.3:432
9296 #, no-wrap
9297 msgid ""
9298 "    if (!use_null_attrib) {\n"
9299 "      s = pthread_attr_destroy(&attr);\n"
9300 "      if (s != 0)\n"
9301 "          handle_error_en(s, \"pthread_attr_destroy\");\n"
9302 "    }\n"
9303 msgstr ""
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
9310 #. type: Plain text
9311 #: build/C/man3/pthread_setschedparam.3:436
9312 #, no-wrap
9313 msgid ""
9314 "    s = pthread_join(thread, NULL);\n"
9315 "    if (s != 0)\n"
9316 "        handle_error_en(s, \"pthread_join\");\n"
9317 msgstr ""
9318 "    s = pthread_join(thread, NULL);\n"
9319 "    if (s != 0)\n"
9320 "        handle_error_en(s, \"pthread_join\");\n"
9321
9322 #. type: Plain text
9323 #: build/C/man3/pthread_setschedparam.3:454
9324 msgid ""
9325 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9326 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9327 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9328 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
9329 msgstr ""
9330 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9331 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9332 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9333 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
9334
9335 #. type: TH
9336 #: build/C/man3/pthread_setschedprio.3:26
9337 #, no-wrap
9338 msgid "PTHREAD_SETSCHEDPRIO"
9339 msgstr "PTHREAD_SETSCHEDPRIO"
9340
9341 #. type: Plain text
9342 #: build/C/man3/pthread_setschedprio.3:29
9343 msgid "pthread_setschedprio - set scheduling priority of a thread"
9344 msgstr "pthread_setschedprio - スレッドのスケジューリング優先度を設定する"
9345
9346 #. type: Plain text
9347 #: build/C/man3/pthread_setschedprio.3:34
9348 #, no-wrap
9349 msgid "B<int pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
9350 msgstr "B<int pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
9351
9352 #.  FIXME . nptl/pthread_setschedprio.c has the following
9353 #.    /* If the thread should have higher priority because of some
9354 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
9355 #.  Eventually (perhaps after writing the mutexattr pages), we
9356 #.  may want to add something on the topic to this page.
9357 #.  nptl/pthread_setschedparam.c has a similar case.
9358 #. type: Plain text
9359 #: build/C/man3/pthread_setschedprio.3:53
9360 msgid ""
9361 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
9362 "thread I<thread> to the value specified in I<prio>.  (By contrast "
9363 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
9364 "of a thread.)"
9365 msgstr ""
9366 "B<pthread_setschedprio>() 関数は、スレッド I<thread> のスケジューリング\n"
9367 "優先度に I<prio> で指定された値を設定する\n"
9368 "(一方、B<pthread_setschedparam>(3) はスレッドのスケジューリングポリシー\n"
9369 "と優先度の両方を変更する)。"
9370
9371 #. type: Plain text
9372 #: build/C/man3/pthread_setschedprio.3:61
9373 msgid ""
9374 "On success, this function returns 0; on error, it returns a nonzero error "
9375 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
9376 "I<thread> is not changed."
9377 msgstr ""
9378 "成功すると、この関数は 0 を返す。\n"
9379 "エラーの場合、0 以外のエラー番号を返す。\n"
9380 "B<pthread_setschedprio>() が失敗した場合、 I<thread> の\n"
9381 "スケジューリング優先度は変更されない。"
9382
9383 #. type: Plain text
9384 #: build/C/man3/pthread_setschedprio.3:66
9385 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
9386 msgstr ""
9387 "指定されたスレッドのスケジューリングポリシーでは、 I<prio> は無効である。"
9388
9389 #. type: Plain text
9390 #: build/C/man3/pthread_setschedprio.3:70
9391 msgid ""
9392 "The caller does not have appropriate privileges to set the specified "
9393 "priority."
9394 msgstr "呼び出し側が、指定された優先度を設定するのに必要な特権を持っていない。"
9395
9396 #. type: Plain text
9397 #: build/C/man3/pthread_setschedprio.3:81
9398 msgid ""
9399 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
9400 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
9401 msgstr ""
9402 "POSIX.1-2001 では、 B<pthread_setschedprio>() に関して\n"
9403 "エラー B<ENOTSUP> (\"サポートされていない値を優先度\n"
9404 "に設定しようとした\") も追加で規定されている。"
9405
9406 #. type: Plain text
9407 #: build/C/man3/pthread_setschedprio.3:83
9408 msgid "This function is available in glibc since version 2.3.4."
9409 msgstr "この関数は glibc バージョン 2.3.4 以降で利用できる。"
9410
9411 #. type: Plain text
9412 #: build/C/man3/pthread_setschedprio.3:88
9413 msgid "The B<pthread_setschedprio>()  function is thread-safe."
9414 msgstr "B<pthread_setschedprio>() 関数はスレッドセーフである。"
9415
9416 #. type: Plain text
9417 #: build/C/man3/pthread_setschedprio.3:96
9418 msgid ""
9419 "For a description of the permissions required to, and the effect of, "
9420 "changing a thread's scheduling priority, and details of the permitted ranges "
9421 "for priorities in each scheduling policy, see B<sched>(7)."
9422 msgstr ""
9423 "スレッドのスケジューリング優先度を変更するために必要な許可や変更した場合の影"
9424 "響、および各スケジューリングポリシーで認められる優先度の範囲の詳細について"
9425 "は、 B<sched>(7) を参照。"
9426
9427 #. type: Plain text
9428 #: build/C/man3/pthread_setschedprio.3:110
9429 msgid ""
9430 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9431 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9432 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9433 "B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
9434 msgstr ""
9435 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9436 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9437 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9438 "B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
9439
9440 #. type: TH
9441 #: build/C/man3/pthread_sigmask.3:26
9442 #, no-wrap
9443 msgid "PTHREAD_SIGMASK"
9444 msgstr "PTHREAD_SIGMASK"
9445
9446 #. type: TH
9447 #: build/C/man3/pthread_sigmask.3:26 build/C/man3/pthread_testcancel.3:26
9448 #, no-wrap
9449 msgid "2014-05-19"
9450 msgstr "2014-05-19"
9451
9452 #. type: Plain text
9453 #: build/C/man3/pthread_sigmask.3:29
9454 msgid "pthread_sigmask - examine and change mask of blocked signals"
9455 msgstr "pthread_sigmask - 禁止するシグナルマスクの確認と変更を行う"
9456
9457 #. type: Plain text
9458 #: build/C/man3/pthread_sigmask.3:35
9459 #, no-wrap
9460 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9461 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9462
9463 #. type: Plain text
9464 #: build/C/man3/pthread_sigmask.3:46
9465 msgid "B<pthread_sigmask>():"
9466 msgstr "B<pthread_sigmask>():"
9467
9468 #. type: Plain text
9469 #: build/C/man3/pthread_sigmask.3:58
9470 msgid ""
9471 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
9472 "difference that its use in multithreaded programs is explicitly specified by "
9473 "POSIX.1-2001.  Other differences are noted in this page."
9474 msgstr ""
9475 "B<pthread_sigmask>() 関数は B<sigprocmask>(2) と全く同様だが、\n"
9476 "マルチスレッドプログラムでの利用が POSIX.1-2001 で明示的に規定されて\n"
9477 "いる点が異なる。他の違いはこのマニュアルページで説明する。"
9478
9479 #. type: Plain text
9480 #: build/C/man3/pthread_sigmask.3:61
9481 msgid ""
9482 "For a description of the arguments and operation of this function, see "
9483 "B<sigprocmask>(2)."
9484 msgstr "この関数の引き数と動作の説明は B<sigprocmask>(2) を参照。"
9485
9486 #. type: Plain text
9487 #: build/C/man3/pthread_sigmask.3:66
9488 msgid ""
9489 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
9490 "number."
9491 msgstr ""
9492 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9493 "エラーの場合、エラー番号を返す。"
9494
9495 #. type: Plain text
9496 #: build/C/man3/pthread_sigmask.3:69
9497 msgid "See B<sigprocmask>(2)."
9498 msgstr "B<sigprocmask>(2) を参照。"
9499
9500 #. type: Plain text
9501 #: build/C/man3/pthread_sigmask.3:74
9502 msgid "The B<pthread_sigmask>()  function is thread-safe."
9503 msgstr "B<pthread_sigmask>() 関数はスレッドセーフである。"
9504
9505 #. type: Plain text
9506 #: build/C/man3/pthread_sigmask.3:78
9507 msgid "A new thread inherits a copy of its creator's signal mask."
9508 msgstr ""
9509 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスクのコピーを\n"
9510 "継承する。"
9511
9512 #. type: Plain text
9513 #: build/C/man3/pthread_sigmask.3:83
9514 msgid ""
9515 "The program below blocks some signals in the main thread, and then creates a "
9516 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
9517 "shell session demonstrates its use:"
9518 msgstr ""
9519 "以下のプログラムは、メインスレッドでシグナルのいくつかを禁止 (block)\n"
9520 "するように設定を行い、 B<sigwait>(3) 経由でそれらのシグナルを集める\n"
9521 "専用のスレッドを作成する。\n"
9522 "下記のシェルのセッションはその利用例を示したものである。"
9523
9524 #. type: Plain text
9525 #: build/C/man3/pthread_sigmask.3:94
9526 #, no-wrap
9527 msgid ""
9528 "$B< ./a.out &>\n"
9529 "[1] 5423\n"
9530 "$B< kill -QUIT %1>\n"
9531 "Signal handling thread got signal 3\n"
9532 "$B< kill -USR1 %1>\n"
9533 "Signal handling thread got signal 10\n"
9534 "$B< kill -TERM %1>\n"
9535 "[1]+  Terminated              ./a.out\n"
9536 msgstr ""
9537 "$B< ./a.out &>\n"
9538 "[1] 5423\n"
9539 "$B< kill -QUIT %1>\n"
9540 "Signal handling thread got signal 3\n"
9541 "$B< kill -USR1 %1>\n"
9542 "Signal handling thread got signal 10\n"
9543 "$B< kill -TERM %1>\n"
9544 "[1]+  Terminated              ./a.out\n"
9545
9546 #. type: Plain text
9547 #: build/C/man3/pthread_sigmask.3:105
9548 #, no-wrap
9549 msgid ""
9550 "#include E<lt>pthread.hE<gt>\n"
9551 "#include E<lt>stdio.hE<gt>\n"
9552 "#include E<lt>stdlib.hE<gt>\n"
9553 "#include E<lt>unistd.hE<gt>\n"
9554 "#include E<lt>signal.hE<gt>\n"
9555 "#include E<lt>errno.hE<gt>\n"
9556 msgstr ""
9557 "#include E<lt>pthread.hE<gt>\n"
9558 "#include E<lt>stdio.hE<gt>\n"
9559 "#include E<lt>stdlib.hE<gt>\n"
9560 "#include E<lt>unistd.hE<gt>\n"
9561 "#include E<lt>signal.hE<gt>\n"
9562 "#include E<lt>errno.hE<gt>\n"
9563
9564 #. type: Plain text
9565 #: build/C/man3/pthread_sigmask.3:107
9566 #, no-wrap
9567 msgid "/* Simple error handling functions */\n"
9568 msgstr "/* Simple error handling functions */\n"
9569
9570 #. type: Plain text
9571 #: build/C/man3/pthread_sigmask.3:116
9572 #, no-wrap
9573 msgid ""
9574 "static void *\n"
9575 "sig_thread(void *arg)\n"
9576 "{\n"
9577 "    sigset_t *set = arg;\n"
9578 "    int s, sig;\n"
9579 msgstr ""
9580 "static void *\n"
9581 "sig_thread(void *arg)\n"
9582 "{\n"
9583 "    sigset_t *set = arg;\n"
9584 "    int s, sig;\n"
9585
9586 #. type: Plain text
9587 #: build/C/man3/pthread_sigmask.3:124
9588 #, no-wrap
9589 msgid ""
9590 "    for (;;) {\n"
9591 "        s = sigwait(set, &sig);\n"
9592 "        if (s != 0)\n"
9593 "            handle_error_en(s, \"sigwait\");\n"
9594 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
9595 "    }\n"
9596 "}\n"
9597 msgstr ""
9598 "    for (;;) {\n"
9599 "        s = sigwait(set, &sig);\n"
9600 "        if (s != 0)\n"
9601 "            handle_error_en(s, \"sigwait\");\n"
9602 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
9603 "    }\n"
9604 "}\n"
9605
9606 #. type: Plain text
9607 #: build/C/man3/pthread_sigmask.3:131
9608 #, no-wrap
9609 msgid ""
9610 "int\n"
9611 "main(int argc, char *argv[])\n"
9612 "{\n"
9613 "    pthread_t thread;\n"
9614 "    sigset_t set;\n"
9615 "    int s;\n"
9616 msgstr ""
9617 "int\n"
9618 "main(int argc, char *argv[])\n"
9619 "{\n"
9620 "    pthread_t thread;\n"
9621 "    sigset_t set;\n"
9622 "    int s;\n"
9623
9624 #. type: Plain text
9625 #: build/C/man3/pthread_sigmask.3:134
9626 #, no-wrap
9627 msgid ""
9628 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
9629 "       will inherit a copy of the signal mask. */\n"
9630 msgstr ""
9631 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
9632 "       will inherit a copy of the signal mask. */\n"
9633
9634 #. type: Plain text
9635 #: build/C/man3/pthread_sigmask.3:141
9636 #, no-wrap
9637 msgid ""
9638 "    sigemptyset(&set);\n"
9639 "    sigaddset(&set, SIGQUIT);\n"
9640 "    sigaddset(&set, SIGUSR1);\n"
9641 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
9642 "    if (s != 0)\n"
9643 "        handle_error_en(s, \"pthread_sigmask\");\n"
9644 msgstr ""
9645 "    sigemptyset(&set);\n"
9646 "    sigaddset(&set, SIGQUIT);\n"
9647 "    sigaddset(&set, SIGUSR1);\n"
9648 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
9649 "    if (s != 0)\n"
9650 "        handle_error_en(s, \"pthread_sigmask\");\n"
9651
9652 #. type: Plain text
9653 #: build/C/man3/pthread_sigmask.3:145
9654 #, no-wrap
9655 msgid ""
9656 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
9657 "    if (s != 0)\n"
9658 "        handle_error_en(s, \"pthread_create\");\n"
9659 msgstr ""
9660 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
9661 "    if (s != 0)\n"
9662 "        handle_error_en(s, \"pthread_create\");\n"
9663
9664 #. type: Plain text
9665 #: build/C/man3/pthread_sigmask.3:148
9666 #, no-wrap
9667 msgid ""
9668 "    /* Main thread carries on to create other threads and/or do\n"
9669 "       other work */\n"
9670 msgstr ""
9671 "    /* Main thread carries on to create other threads and/or do\n"
9672 "       other work */\n"
9673
9674 #. type: Plain text
9675 #: build/C/man3/pthread_sigmask.3:151
9676 #, no-wrap
9677 msgid ""
9678 "    pause();            /* Dummy pause so we can test program */\n"
9679 "}\n"
9680 msgstr ""
9681 "    pause();            /* Dummy pause so we can test program */\n"
9682 "}\n"
9683
9684 #. type: Plain text
9685 #: build/C/man3/pthread_sigmask.3:161
9686 msgid ""
9687 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), "
9688 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
9689 msgstr ""
9690 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), "
9691 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
9692
9693 #. type: TH
9694 #: build/C/man3/pthread_sigqueue.3:25
9695 #, no-wrap
9696 msgid "PTHREAD_SIGQUEUE"
9697 msgstr "PTHREAD_SIGQUEUE"
9698
9699 #. type: Plain text
9700 #: build/C/man3/pthread_sigqueue.3:28
9701 msgid "pthread_sigqueue - queue a signal and data to a thread"
9702 msgstr "pthread_sigqueue - スレッドに対するシグナルとデータをキューに入れる"
9703
9704 #. type: Plain text
9705 #: build/C/man3/pthread_sigqueue.3:32
9706 #, no-wrap
9707 msgid ""
9708 "B<#include E<lt>signal.hE<gt>>\n"
9709 "B<#include E<lt>pthread.hE<gt>>\n"
9710 msgstr ""
9711 "B<#include E<lt>signal.hE<gt>>\n"
9712 "B<#include E<lt>pthread.hE<gt>>\n"
9713
9714 #. type: Plain text
9715 #: build/C/man3/pthread_sigqueue.3:35
9716 #, no-wrap
9717 msgid ""
9718 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
9719 "B<                     const union sigval >I<value>B<);>\n"
9720 msgstr ""
9721 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
9722 "B<                     const union sigval >I<value>B<);>\n"
9723
9724 #. type: Plain text
9725 #: build/C/man3/pthread_sigqueue.3:46
9726 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
9727 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
9728
9729 #. type: Plain text
9730 #: build/C/man3/pthread_sigqueue.3:54
9731 msgid ""
9732 "The B<pthread_sigqueue>()  function performs a similar task to "
9733 "B<sigqueue>(3), but, rather than sending a signal to a process, it sends a "
9734 "signal to a thread in the same process as the calling thread."
9735 msgstr ""
9736 "B<pthread_sigqueue>() 関数は B<sigqueue>(3) と同様の処理を実行するが、\n"
9737 "プロセスにシグナルを送信するのではなく、呼び出したスレッドと\n"
9738 "同じプロセス内のスレッドにシグナルを送信する。"
9739
9740 #. type: Plain text
9741 #: build/C/man3/pthread_sigqueue.3:66
9742 msgid ""
9743 "The I<thread> argument is the ID of a thread in the same process as the "
9744 "caller.  The I<sig> argument specifies the signal to be sent.  The I<value> "
9745 "argument specifies data to accompany the signal; see B<sigqueue>(3)  for "
9746 "details."
9747 msgstr ""
9748 "I<thread> 引き数は、呼び出し側と同じプロセスのスレッドの ID である。\n"
9749 "I<sig> 引き数は送信するシグナルを指定する。\n"
9750 "I<value> 引き数はシグナルと一緒に渡すデータを指定する。\n"
9751 "詳細は B<sigqueue>(3) を参照。"
9752
9753 #. type: Plain text
9754 #: build/C/man3/pthread_sigqueue.3:71
9755 msgid ""
9756 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
9757 "number."
9758 msgstr ""
9759 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9760 "エラーの場合、エラー番号を返す。"
9761
9762 #. type: Plain text
9763 #: build/C/man3/pthread_sigqueue.3:78
9764 msgid ""
9765 "The limit of signals which may be queued has been reached.  (See "
9766 "B<signal>(7)  for further information.)"
9767 msgstr ""
9768 "キューに入れられるシグナル数が上限に達していた\n"
9769 "(詳しい情報は (B<signal>(7) を参照)。"
9770
9771 #. type: Plain text
9772 #: build/C/man3/pthread_sigqueue.3:82
9773 msgid "I<sig> was invalid."
9774 msgstr "I<sig> が無効であった。"
9775
9776 #. type: TP
9777 #: build/C/man3/pthread_sigqueue.3:82
9778 #, no-wrap
9779 msgid "B<ENOSYS>"
9780 msgstr "B<ENOSYS>"
9781
9782 #. type: Plain text
9783 #: build/C/man3/pthread_sigqueue.3:86
9784 msgid "B<pthread_sigqueue>()  is not supported on this system."
9785 msgstr "B<pthread_sigqueue>() がこのシステムではサポートされていない。"
9786
9787 #. type: Plain text
9788 #: build/C/man3/pthread_sigqueue.3:90
9789 msgid "I<thread> is not valid."
9790 msgstr "I<thread> が無効である。"
9791
9792 #. type: Plain text
9793 #: build/C/man3/pthread_sigqueue.3:94
9794 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
9795 msgstr "B<pthread_sigqueue>() 関数は glibc 2.11 で初めて登場した。"
9796
9797 #. type: Plain text
9798 #: build/C/man3/pthread_sigqueue.3:99
9799 msgid "The B<pthread_sigqueue>()  function is thread-safe."
9800 msgstr "B<pthread_sigqueue>() 関数はスレッドセーフである。"
9801
9802 #. type: Plain text
9803 #: build/C/man3/pthread_sigqueue.3:101
9804 msgid "This function is a GNU extension."
9805 msgstr "この関数は GNU による拡張である。"
9806
9807 #. type: Plain text
9808 #: build/C/man3/pthread_sigqueue.3:109
9809 msgid ""
9810 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), "
9811 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
9812 msgstr ""
9813 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
9814 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
9815
9816 #. type: TH
9817 #: build/C/man3/pthread_testcancel.3:26
9818 #, no-wrap
9819 msgid "PTHREAD_TESTCANCEL"
9820 msgstr "PTHREAD_TESTCANCEL"
9821
9822 #. type: Plain text
9823 #: build/C/man3/pthread_testcancel.3:29
9824 msgid ""
9825 "pthread_testcancel - request delivery of any pending cancellation request"
9826 msgstr "pthread_testcancel - 処理待ちの取り消し要求の配送を要求する"
9827
9828 #. type: Plain text
9829 #: build/C/man3/pthread_testcancel.3:34
9830 #, no-wrap
9831 msgid "B<void pthread_testcancel(void);>\n"
9832 msgstr "B<void pthread_testcancel(void);>\n"
9833
9834 #. type: Plain text
9835 #: build/C/man3/pthread_testcancel.3:43
9836 msgid ""
9837 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
9838 "calling thread, so that a thread that is otherwise executing code that "
9839 "contains no cancellation points will respond to a cancellation request."
9840 msgstr ""
9841 "B<pthread_testcancel>() を呼び出すと、呼び出したスレッド内に取り消し\n"
9842 "ポイント (cancellation point) が作成される。\n"
9843 "これにより、これ以外には取り消しポイントを含まないコードを実行して\n"
9844 "いるスレッドが取り消し要求に対応することができるようになる。"
9845
9846 #. type: Plain text
9847 #: build/C/man3/pthread_testcancel.3:50
9848 msgid ""
9849 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
9850 "cancellation request is pending, then a call to B<pthread_testcancel>()  has "
9851 "no effect."
9852 msgstr ""
9853 "(B<pthread_setcancelstate>(3) を使って) キャンセルが無効になっている\n"
9854 "場合や処理待ちの取り消し要求がない場合は、B<pthread_testcancel>() を\n"
9855 "呼び出しても何の影響もない。"
9856
9857 #. type: Plain text
9858 #: build/C/man3/pthread_testcancel.3:54
9859 msgid ""
9860 "This function does not return a value.  If the calling thread is canceled as "
9861 "a consequence of a call to this function, then the function does not return."
9862 msgstr ""
9863 "この関数は値を返さない。この関数の呼び出しの結果、呼び出したスレッドが\n"
9864 "キャンセルされた場合、この関数が返ることはない。"
9865
9866 #. type: Plain text
9867 #: build/C/man3/pthread_testcancel.3:63
9868 msgid "The B<pthread_testcancel>()  function is thread-safe."
9869 msgstr "B<pthread_testcancel>() 関数はスレッドセーフである。"
9870
9871 #. type: Plain text
9872 #: build/C/man3/pthread_testcancel.3:68
9873 msgid "See B<pthread_cleanup_push>(3)."
9874 msgstr "B<pthread_cleanup_push>(3) を参照。"
9875
9876 #. type: Plain text
9877 #: build/C/man3/pthread_testcancel.3:73
9878 msgid ""
9879 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9880 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
9881 msgstr ""
9882 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9883 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
9884
9885 #. type: TH
9886 #: build/C/man3/pthread_tryjoin_np.3:26
9887 #, no-wrap
9888 msgid "PTHREAD_TRYJOIN_NP"
9889 msgstr "PTHREAD_TRYJOIN_NP"
9890
9891 #. type: TH
9892 #: build/C/man3/pthread_tryjoin_np.3:26
9893 #, no-wrap
9894 msgid "2015-01-10"
9895 msgstr "2015-01-10"
9896
9897 #. type: Plain text
9898 #: build/C/man3/pthread_tryjoin_np.3:30
9899 msgid ""
9900 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
9901 "thread"
9902 msgstr ""
9903 "pthread_tryjoin_np, pthread_timedjoin_np - 終了したスレッドの join を\n"
9904 "試みる"
9905
9906 #. type: Plain text
9907 #: build/C/man3/pthread_tryjoin_np.3:36
9908 #, no-wrap
9909 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9910 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9911
9912 #. type: Plain text
9913 #: build/C/man3/pthread_tryjoin_np.3:39
9914 #, no-wrap
9915 msgid ""
9916 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9917 "B<                         const struct timespec *>I<abstime>B<);>\n"
9918 msgstr ""
9919 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9920 "B<                         const struct timespec *>I<abstime>B<);>\n"
9921
9922 #. type: Plain text
9923 #: build/C/man3/pthread_tryjoin_np.3:46
9924 msgid ""
9925 "These functions operate in the same way as B<pthread_join>(3), except for "
9926 "the differences described on this page."
9927 msgstr ""
9928 "これらの関数は B<pthread_join>(3) と同じように動作するが、\n"
9929 "このページで説明する違いがある。"
9930
9931 #. type: Plain text
9932 #: build/C/man3/pthread_tryjoin_np.3:58
9933 msgid ""
9934 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
9935 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
9936 "I<thread> has not yet terminated, then instead of blocking, as is done by "
9937 "B<pthread_join>(3), the call returns an error."
9938 msgstr ""
9939 "B<pthread_tryjoin_np>() 関数は、スレッド I<thread> の非停止\n"
9940 "(nonblocking) での join を実行し、スレッドの終了ステータスを\n"
9941 "I<*retval> に入れて返す。I<thread> がまだ終了していない場合は、\n"
9942 "B<pthread_join>(3) のように停止 (block) せずに、エラーを返す。"
9943
9944 #. type: Plain text
9945 #: build/C/man3/pthread_tryjoin_np.3:76
9946 msgid ""
9947 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
9948 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
9949 "specified in I<abstime>.  If the timeout expires before I<thread> "
9950 "terminates, the call returns an error.  The I<abstime> argument is a "
9951 "structure of the following form, specifying an absolute time measured since "
9952 "the Epoch (see B<time>(2)):"
9953 msgstr ""
9954 "B<pthread_timedjoin_np>() 関数は、タイムアウト付きの join を行う。\n"
9955 "I<thread> がまだ終了していない場合、 I<abstime> で指定された最大時間\n"
9956 "まで停止する。 I<thread> が終了する前にタイムアウト時間が経過した場合は、\n"
9957 "エラーを返す。I<abstime> 引き数は以下に示す構造体であり、\n"
9958 "Epoch (時刻紀元; B<time>(2) 参照) から測った絶対時刻を指定する。"
9959
9960 #. type: Plain text
9961 #: build/C/man3/pthread_tryjoin_np.3:83
9962 #, no-wrap
9963 msgid ""
9964 "struct timespec {\n"
9965 "    time_t tv_sec;     /* seconds */\n"
9966 "    long   tv_nsec;    /* nanoseconds */\n"
9967 "};\n"
9968 msgstr ""
9969 "struct timespec {\n"
9970 "    time_t tv_sec;     /* seconds */\n"
9971 "    long   tv_nsec;    /* nanoseconds */\n"
9972 "};\n"
9973
9974 #. type: Plain text
9975 #: build/C/man3/pthread_tryjoin_np.3:89
9976 msgid ""
9977 "On success, these functions return 0; on error, they return an error number."
9978 msgstr ""
9979 "成功すると、これらの関数は 0 を返す。\n"
9980 "エラーの場合、エラー番号を返す。"
9981
9982 #. type: Plain text
9983 #: build/C/man3/pthread_tryjoin_np.3:94
9984 msgid ""
9985 "These functions can fail with the same errors as B<pthread_join>(3).  "
9986 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
9987 msgstr ""
9988 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
9989 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
9990
9991 #. type: TP
9992 #: build/C/man3/pthread_tryjoin_np.3:94
9993 #, no-wrap
9994 msgid "B<EBUSY>"
9995 msgstr "B<EBUSY>"
9996
9997 #. type: Plain text
9998 #: build/C/man3/pthread_tryjoin_np.3:98
9999 msgid "I<thread> had not yet terminated at the time of the call."
10000 msgstr "呼び出しを行った時点では I<thread> はまだ終了していない。"
10001
10002 #. type: Plain text
10003 #: build/C/man3/pthread_tryjoin_np.3:101
10004 msgid ""
10005 "B<pthread_timedjoin_np>()  can in addition fail with the following errors:"
10006 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
10007
10008 #. type: TP
10009 #: build/C/man3/pthread_tryjoin_np.3:101
10010 #, no-wrap
10011 msgid "B<ETIMEDOUT>"
10012 msgstr "B<ETIMEDOUT>"
10013
10014 #. type: Plain text
10015 #: build/C/man3/pthread_tryjoin_np.3:106
10016 msgid "The call timed out before I<thread> terminated."
10017 msgstr "I<thread> が終了する前に呼び出しがタイムアウトとなった。"
10018
10019 #. type: Plain text
10020 #: build/C/man3/pthread_tryjoin_np.3:114
10021 msgid ""
10022 "I<abstime> value is invalid (I<tv_sec> is less than 0 or I<tv_nsec> is "
10023 "greater than 1e9)."
10024 msgstr ""
10025 "I<abstime> の値が無効である (I<tv_sec> が 0 より小さいか、 I<tv_nsec> 1e9 が"
10026 "より大きい)。"
10027
10028 #. type: Plain text
10029 #: build/C/man3/pthread_tryjoin_np.3:118
10030 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
10031 msgstr "B<pthread_timedjoin_np>() がエラー B<EINTR> を返すことはない。"
10032
10033 #. type: Plain text
10034 #: build/C/man3/pthread_tryjoin_np.3:120
10035 msgid "These functions first appeared in glibc in version 2.3.3."
10036 msgstr "これらの関数は glibc バージョン 2.3.3 で初めて登場した。"
10037
10038 #. type: Plain text
10039 #: build/C/man3/pthread_tryjoin_np.3:125
10040 msgid "The following code waits to join for up to 5 seconds:"
10041 msgstr "以下のコードは、最大 5 秒まで join を待つ。"
10042
10043 #. type: Plain text
10044 #: build/C/man3/pthread_tryjoin_np.3:129
10045 #, no-wrap
10046 msgid ""
10047 "    struct timespec ts;\n"
10048 "    int s;\n"
10049 msgstr ""
10050 "    struct timespec ts;\n"
10051 "    int s;\n"
10052
10053 #. type: Plain text
10054 #: build/C/man3/pthread_tryjoin_np.3:131
10055 #, no-wrap
10056 msgid "    ...\n"
10057 msgstr "    ...\n"
10058
10059 #. type: Plain text
10060 #: build/C/man3/pthread_tryjoin_np.3:135
10061 #, no-wrap
10062 msgid ""
10063 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
10064 "\t/* Handle error */\n"
10065 "    }\n"
10066 msgstr ""
10067 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
10068 "\t/* Handle error */\n"
10069 "    }\n"
10070
10071 #. type: Plain text
10072 #: build/C/man3/pthread_tryjoin_np.3:137
10073 #, no-wrap
10074 msgid "    ts.tv_sec += 5;\n"
10075 msgstr "    ts.tv_sec += 5;\n"
10076
10077 #. type: Plain text
10078 #: build/C/man3/pthread_tryjoin_np.3:142
10079 #, no-wrap
10080 msgid ""
10081 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
10082 "    if (s != 0) {\n"
10083 "        /* Handle error */\n"
10084 "    }\n"
10085 msgstr ""
10086 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
10087 "    if (s != 0) {\n"
10088 "        /* Handle error */\n"
10089 "    }\n"
10090
10091 #. type: Plain text
10092 #: build/C/man3/pthread_tryjoin_np.3:148
10093 msgid ""
10094 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
10095 msgstr ""
10096 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
10097
10098 #. type: TH
10099 #: build/C/man3/pthread_yield.3:25
10100 #, no-wrap
10101 msgid "PTHREAD_YIELD"
10102 msgstr "PTHREAD_YIELD"
10103
10104 #. type: Plain text
10105 #: build/C/man3/pthread_yield.3:28
10106 msgid "pthread_yield - yield the processor"
10107 msgstr "pthread_yield - プロセッサを明け渡す (yield)"
10108
10109 #. type: Plain text
10110 #: build/C/man3/pthread_yield.3:34
10111 #, no-wrap
10112 msgid "B<int pthread_yield(void);>\n"
10113 msgstr "B<int pthread_yield(void);>\n"
10114
10115 #. type: Plain text
10116 #: build/C/man3/pthread_yield.3:44
10117 msgid ""
10118 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
10119 "thread is placed at the end of the run queue for its static priority and "
10120 "another thread is scheduled to run.  For further details, see "
10121 "B<sched_yield>(2)"
10122 msgstr ""
10123 "B<pthread_yield>() を呼び出すと、呼び出したスレッドは CPU を手放す。\n"
10124 "スレッドはそのスレッドの静的優先度の実行キューの末尾に回り、\n"
10125 "別のスレッドが実行されるようにスケジューリングされる。\n"
10126 "詳細は B<sched_yield>(2) を参照。"
10127
10128 #. type: Plain text
10129 #: build/C/man3/pthread_yield.3:49
10130 msgid ""
10131 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
10132 "number."
10133 msgstr ""
10134 "成功すると、 B<pthread_yield>() は 0 を返す。\n"
10135 "エラーの場合、エラー番号を返す。"
10136
10137 #. type: Plain text
10138 #: build/C/man3/pthread_yield.3:53
10139 msgid ""
10140 "On Linux, this call always succeeds (but portable and future-proof "
10141 "applications should nevertheless handle a possible error return)."
10142 msgstr ""
10143 "Linux では、この関数の呼び出しは常に成功する\n"
10144 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
10145 "正のエラーの返り値を処理するようにすべきである)。"
10146
10147 #. type: Plain text
10148 #: build/C/man3/pthread_yield.3:58
10149 msgid "The B<pthread_yield>()  function is thread-safe."
10150 msgstr "B<pthread_yield>() 関数はスレッドセーフである。"
10151
10152 #.  e.g., the BSDs, Tru64, AIX, and Irix.
10153 #. type: Plain text
10154 #: build/C/man3/pthread_yield.3:64
10155 msgid ""
10156 "This call is nonstandard, but present on several other systems.  Use the "
10157 "standardized B<sched_yield>(2)  instead."
10158 msgstr ""
10159 "この関数は非標準だが、他のいくつかのシステムにも存在する。\n"
10160 "代わりに、標準化されている B<sched_yield>(2) を使うこと。"
10161
10162 #. type: Plain text
10163 #: build/C/man3/pthread_yield.3:67
10164 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
10165 msgstr ""
10166 "Linux では、この関数は B<sched_yield>(2) を呼び出す形で実装されている。"
10167
10168 #. type: Plain text
10169 #: build/C/man3/pthread_yield.3:71
10170 msgid "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
10171 msgstr "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
10172
10173 #. type: TH
10174 #: build/C/man7/pthreads.7:26
10175 #, no-wrap
10176 msgid "PTHREADS"
10177 msgstr "PTHREADS"
10178
10179 #. type: Plain text
10180 #: build/C/man7/pthreads.7:29
10181 msgid "pthreads - POSIX threads"
10182 msgstr "pthreads - POSIX スレッド"
10183
10184 #. type: Plain text
10185 #: build/C/man7/pthreads.7:36
10186 msgid ""
10187 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
10188 "programming commonly known as POSIX threads, or Pthreads.  A single process "
10189 "can contain multiple threads, all of which are executing the same program.  "
10190 "These threads share the same global memory (data and heap segments), but "
10191 "each thread has its own stack (automatic variables)."
10192 msgstr ""
10193 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
10194 "ラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロ"
10195 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
10196 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
10197 "スレッドは自分専用のスタック (自動変数) を持つ。"
10198
10199 #. type: Plain text
10200 #: build/C/man7/pthreads.7:39
10201 msgid ""
10202 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
10203 "these attributes are process-wide rather than per-thread):"
10204 msgstr ""
10205 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
10206 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
10207
10208 #. type: IP
10209 #: build/C/man7/pthreads.7:39 build/C/man7/pthreads.7:41
10210 #: build/C/man7/pthreads.7:43 build/C/man7/pthreads.7:45
10211 #: build/C/man7/pthreads.7:47 build/C/man7/pthreads.7:49
10212 #: build/C/man7/pthreads.7:51 build/C/man7/pthreads.7:54
10213 #: build/C/man7/pthreads.7:56 build/C/man7/pthreads.7:59
10214 #: build/C/man7/pthreads.7:65 build/C/man7/pthreads.7:70
10215 #: build/C/man7/pthreads.7:73 build/C/man7/pthreads.7:76
10216 #: build/C/man7/pthreads.7:84 build/C/man7/pthreads.7:88
10217 #: build/C/man7/pthreads.7:91 build/C/man7/pthreads.7:95
10218 #: build/C/man7/pthreads.7:98 build/C/man7/pthreads.7:103
10219 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
10220 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
10221 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
10222 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
10223 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
10224 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
10225 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
10226 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
10227 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
10228 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
10229 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
10230 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
10231 #: build/C/man7/pthreads.7:833
10232 #, no-wrap
10233 msgid "-"
10234 msgstr "-"
10235
10236 #. type: Plain text
10237 #: build/C/man7/pthreads.7:41
10238 msgid "process ID"
10239 msgstr "プロセス ID"
10240
10241 #. type: Plain text
10242 #: build/C/man7/pthreads.7:43
10243 msgid "parent process ID"
10244 msgstr "親プロセス ID"
10245
10246 #. type: Plain text
10247 #: build/C/man7/pthreads.7:45
10248 msgid "process group ID and session ID"
10249 msgstr "プロセスグループ ID とセッション ID"
10250
10251 #. type: Plain text
10252 #: build/C/man7/pthreads.7:47
10253 msgid "controlling terminal"
10254 msgstr "制御端末"
10255
10256 #. type: Plain text
10257 #: build/C/man7/pthreads.7:49
10258 msgid "user and group IDs"
10259 msgstr "ユーザ ID とグループ ID"
10260
10261 #. type: Plain text
10262 #: build/C/man7/pthreads.7:51
10263 msgid "open file descriptors"
10264 msgstr "オープンするファイルディスクリプタ"
10265
10266 #. type: Plain text
10267 #: build/C/man7/pthreads.7:54
10268 msgid "record locks (see B<fcntl>(2))"
10269 msgstr "レコードのロック (B<fcntl>(3)  参照)"
10270
10271 #. type: Plain text
10272 #: build/C/man7/pthreads.7:56
10273 msgid "signal dispositions"
10274 msgstr "シグナルの配置"
10275
10276 #. type: Plain text
10277 #: build/C/man7/pthreads.7:59
10278 msgid "file mode creation mask (B<umask>(2))"
10279 msgstr "ファイルモード作成マスク (B<umask>(2))"
10280
10281 #. type: Plain text
10282 #: build/C/man7/pthreads.7:65
10283 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
10284 msgstr ""
10285 "カレント・ディレクトリ (B<chdir>(2))  とルート・ディレクトリ (B<chroot>(2))"
10286
10287 #. type: Plain text
10288 #: build/C/man7/pthreads.7:70
10289 msgid ""
10290 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
10291 msgstr ""
10292 "インターバル・タイマ (B<setitimer>(2))  と POSIX タイマ (B<timer_create>(2))"
10293
10294 #. type: Plain text
10295 #: build/C/man7/pthreads.7:73
10296 msgid "nice value (B<setpriority>(2))"
10297 msgstr "nice 値 (B<setpriority>(2))"
10298
10299 #. type: Plain text
10300 #: build/C/man7/pthreads.7:76
10301 msgid "resource limits (B<setrlimit>(2))"
10302 msgstr "リソース制限 (B<setrlimit>(2))"
10303
10304 #. type: Plain text
10305 #: build/C/man7/pthreads.7:81
10306 msgid ""
10307 "measurements of the consumption of CPU time (B<times>(2))  and resources "
10308 "(B<getrusage>(2))"
10309 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
10310
10311 #. type: Plain text
10312 #: build/C/man7/pthreads.7:84
10313 msgid ""
10314 "As well as the stack, POSIX.1 specifies that various other attributes are "
10315 "distinct for each thread, including:"
10316 msgstr ""
10317 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
10318 "るかを規定している:"
10319
10320 #. type: Plain text
10321 #: build/C/man7/pthreads.7:88
10322 msgid "thread ID (the I<pthread_t> data type)"
10323 msgstr "スレッド ID (B<pthread_t> データ型)"
10324
10325 #. type: Plain text
10326 #: build/C/man7/pthreads.7:91
10327 msgid "signal mask (B<pthread_sigmask>(3))"
10328 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
10329
10330 #. type: Plain text
10331 #: build/C/man7/pthreads.7:95
10332 msgid "the I<errno> variable"
10333 msgstr "I<errno> 変数"
10334
10335 #. type: Plain text
10336 #: build/C/man7/pthreads.7:98
10337 msgid "alternate signal stack (B<sigaltstack>(2))"
10338 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
10339
10340 #. type: Plain text
10341 #: build/C/man7/pthreads.7:101
10342 msgid "real-time scheduling policy and priority (B<sched>(7))"
10343 msgstr "リアルタイム・スケジューリングのポリシーと優先度 (B<sched>(7))"
10344
10345 #. type: Plain text
10346 #: build/C/man7/pthreads.7:103
10347 msgid "The following Linux-specific features are also per-thread:"
10348 msgstr "以下の Linux 特有の機能もスレッド単位である:"
10349
10350 #. type: Plain text
10351 #: build/C/man7/pthreads.7:106
10352 msgid "capabilities (see B<capabilities>(7))"
10353 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
10354
10355 #. type: Plain text
10356 #: build/C/man7/pthreads.7:109
10357 msgid "CPU affinity (B<sched_setaffinity>(2))"
10358 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
10359
10360 #. type: SS
10361 #: build/C/man7/pthreads.7:109
10362 #, no-wrap
10363 msgid "Pthreads function return values"
10364 msgstr "pthreads 関数の返り値"
10365
10366 #. type: Plain text
10367 #: build/C/man7/pthreads.7:116
10368 msgid ""
10369 "Most pthreads functions return 0 on success, and an error number of "
10370 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
10371 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
10372 "the function can never fail with the error B<EINTR>."
10373 msgstr ""
10374 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
10375 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
10376 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
10377 "は決してないと規定している。"
10378
10379 #. type: SS
10380 #: build/C/man7/pthreads.7:116
10381 #, no-wrap
10382 msgid "Thread IDs"
10383 msgstr "スレッド ID"
10384
10385 #. type: Plain text
10386 #: build/C/man7/pthreads.7:130
10387 msgid ""
10388 "Each of the threads in a process has a unique thread identifier (stored in "
10389 "the type I<pthread_t>).  This identifier is returned to the caller of "
10390 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
10391 "using B<pthread_self>(3).  Thread IDs are guaranteed to be unique only "
10392 "within a process.  A thread ID may be reused after a terminated thread has "
10393 "been joined, or a detached thread has terminated.  In all pthreads functions "
10394 "that accept a thread ID as an argument, that ID by definition refers to a "
10395 "thread in the same process as the caller."
10396 msgstr ""
10397 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
10398 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
10399 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
10400 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
10401 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
10402 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
10403 "じプロセス内の一つのスレッドを参照する。"
10404
10405 #. type: SS
10406 #: build/C/man7/pthreads.7:130
10407 #, no-wrap
10408 msgid "Thread-safe functions"
10409 msgstr "スレッドセーフな関数"
10410
10411 #. type: Plain text
10412 #: build/C/man7/pthreads.7:134
10413 msgid ""
10414 "A thread-safe function is one that can be safely (i.e., it will deliver the "
10415 "same results regardless of whether it is)  called from multiple threads at "
10416 "the same time."
10417 msgstr ""
10418 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
10419 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
10420
10421 #. type: Plain text
10422 #: build/C/man7/pthreads.7:138
10423 msgid ""
10424 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
10425 "standard shall be thread-safe, except for the following functions:"
10426 msgstr ""
10427 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
10428 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
10429
10430 #. type: Plain text
10431 #: build/C/man7/pthreads.7:232
10432 #, no-wrap
10433 msgid ""
10434 "asctime()\n"
10435 "basename()\n"
10436 "catgets()\n"
10437 "crypt()\n"
10438 "ctermid() if passed a non-NULL argument\n"
10439 "ctime()\n"
10440 "dbm_clearerr()\n"
10441 "dbm_close()\n"
10442 "dbm_delete()\n"
10443 "dbm_error()\n"
10444 "dbm_fetch()\n"
10445 "dbm_firstkey()\n"
10446 "dbm_nextkey()\n"
10447 "dbm_open()\n"
10448 "dbm_store()\n"
10449 "dirname()\n"
10450 "dlerror()\n"
10451 "drand48()\n"
10452 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10453 "encrypt()\n"
10454 "endgrent()\n"
10455 "endpwent()\n"
10456 "endutxent()\n"
10457 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10458 "ftw()\n"
10459 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10460 "getc_unlocked()\n"
10461 "getchar_unlocked()\n"
10462 "getdate()\n"
10463 "getenv()\n"
10464 "getgrent()\n"
10465 "getgrgid()\n"
10466 "getgrnam()\n"
10467 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10468 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10469 "gethostent()\n"
10470 "getlogin()\n"
10471 "getnetbyaddr()\n"
10472 "getnetbyname()\n"
10473 "getnetent()\n"
10474 "getopt()\n"
10475 "getprotobyname()\n"
10476 "getprotobynumber()\n"
10477 "getprotoent()\n"
10478 "getpwent()\n"
10479 "getpwnam()\n"
10480 "getpwuid()\n"
10481 "getservbyname()\n"
10482 "getservbyport()\n"
10483 "getservent()\n"
10484 "getutxent()\n"
10485 "getutxid()\n"
10486 "getutxline()\n"
10487 "gmtime()\n"
10488 "hcreate()\n"
10489 "hdestroy()\n"
10490 "hsearch()\n"
10491 "inet_ntoa()\n"
10492 "l64a()\n"
10493 "lgamma()\n"
10494 "lgammaf()\n"
10495 "lgammal()\n"
10496 "localeconv()\n"
10497 "localtime()\n"
10498 "lrand48()\n"
10499 "mrand48()\n"
10500 "nftw()\n"
10501 "nl_langinfo()\n"
10502 "ptsname()\n"
10503 "putc_unlocked()\n"
10504 "putchar_unlocked()\n"
10505 "putenv()\n"
10506 "pututxline()\n"
10507 "rand()\n"
10508 "readdir()\n"
10509 "setenv()\n"
10510 "setgrent()\n"
10511 "setkey()\n"
10512 "setpwent()\n"
10513 "setutxent()\n"
10514 "strerror()\n"
10515 "strsignal() [Added in POSIX.1-2008]\n"
10516 "strtok()\n"
10517 "system() [Added in POSIX.1-2008]\n"
10518 "tmpnam() if passed a non-NULL argument\n"
10519 "ttyname()\n"
10520 "unsetenv()\n"
10521 "wcrtomb() if its final argument is NULL\n"
10522 "wcsrtombs() if its final argument is NULL\n"
10523 "wcstombs()\n"
10524 "wctomb()\n"
10525 msgstr ""
10526 "asctime()\n"
10527 "basename()\n"
10528 "catgets()\n"
10529 "crypt()\n"
10530 "ctermid() (NULL でない引き数を渡された場合)\n"
10531 "ctime()\n"
10532 "dbm_clearerr()\n"
10533 "dbm_close()\n"
10534 "dbm_delete()\n"
10535 "dbm_error()\n"
10536 "dbm_fetch()\n"
10537 "dbm_firstkey()\n"
10538 "dbm_nextkey()\n"
10539 "dbm_open()\n"
10540 "dbm_store()\n"
10541 "dirname()\n"
10542 "dlerror()\n"
10543 "drand48()\n"
10544 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10545 "encrypt()\n"
10546 "endgrent()\n"
10547 "endpwent()\n"
10548 "endutxent()\n"
10549 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10550 "ftw()\n"
10551 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10552 "getc_unlocked()\n"
10553 "getchar_unlocked()\n"
10554 "getdate()\n"
10555 "getenv()\n"
10556 "getgrent()\n"
10557 "getgrgid()\n"
10558 "getgrnam()\n"
10559 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10560 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10561 "gethostent()\n"
10562 "getlogin()\n"
10563 "getnetbyaddr()\n"
10564 "getnetbyname()\n"
10565 "getnetent()\n"
10566 "getopt()\n"
10567 "getprotobyname()\n"
10568 "getprotobynumber()\n"
10569 "getprotoent()\n"
10570 "getpwent()\n"
10571 "getpwnam()\n"
10572 "getpwuid()\n"
10573 "getservbyname()\n"
10574 "getservbyport()\n"
10575 "getservent()\n"
10576 "getutxent()\n"
10577 "getutxid()\n"
10578 "getutxline()\n"
10579 "gmtime()\n"
10580 "hcreate()\n"
10581 "hdestroy()\n"
10582 "hsearch()\n"
10583 "inet_ntoa()\n"
10584 "l64a()\n"
10585 "lgamma()\n"
10586 "lgammaf()\n"
10587 "lgammal()\n"
10588 "localeconv()\n"
10589 "localtime()\n"
10590 "lrand48()\n"
10591 "mrand48()\n"
10592 "nftw()\n"
10593 "nl_langinfo()\n"
10594 "ptsname()\n"
10595 "putc_unlocked()\n"
10596 "putchar_unlocked()\n"
10597 "putenv()\n"
10598 "pututxline()\n"
10599 "rand()\n"
10600 "readdir()\n"
10601 "setenv()\n"
10602 "setgrent()\n"
10603 "setkey()\n"
10604 "setpwent()\n"
10605 "setutxent()\n"
10606 "strerror()\n"
10607 "strsignal() [POSIX.1-2008 で追加された]\n"
10608 "strtok()\n"
10609 "system() [POSIX.1-2008 で追加された]\n"
10610 "tmpnam() (NULL でない引き数を渡された場合)\n"
10611 "ttyname()\n"
10612 "unsetenv()\n"
10613 "wcrtomb() (最後の引き数が NULL の場合)\n"
10614 "wcsrtombs() (最後の引き数が NULL の場合)\n"
10615 "wcstombs()\n"
10616 "wctomb()\n"
10617
10618 #. type: SS
10619 #: build/C/man7/pthreads.7:234
10620 #, no-wrap
10621 msgid "Async-cancel-safe functions"
10622 msgstr "async-cancel-safe 関数"
10623
10624 #. type: Plain text
10625 #: build/C/man7/pthreads.7:238
10626 msgid ""
10627 "An async-cancel-safe function is one that can be safely called in an "
10628 "application where asynchronous cancelability is enabled (see "
10629 "B<pthread_setcancelstate>(3))."
10630 msgstr ""
10631 "async-cancel-safe 関数は、\n"
10632 "非同期キャンセル機能が有効になっているアプリケーションで\n"
10633 "安全に呼び出すことができる関数のことである\n"
10634 "(B<pthread_setcancelstate>(3) を参照)。"
10635
10636 #. type: Plain text
10637 #: build/C/man7/pthreads.7:241
10638 msgid ""
10639 "Only the following functions are required to be async-cancel-safe by "
10640 "POSIX.1-2001 and POSIX.1-2008:"
10641 msgstr ""
10642 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
10643 "なければならないとされている。"
10644
10645 #. type: Plain text
10646 #: build/C/man7/pthreads.7:247
10647 #, no-wrap
10648 msgid ""
10649 "pthread_cancel()\n"
10650 "pthread_setcancelstate()\n"
10651 "pthread_setcanceltype()\n"
10652 msgstr ""
10653 "pthread_cancel()\n"
10654 "pthread_setcancelstate()\n"
10655 "pthread_setcanceltype()\n"
10656
10657 #. type: SS
10658 #: build/C/man7/pthreads.7:249
10659 #, no-wrap
10660 msgid "Cancellation points"
10661 msgstr "取り消しポイント (cancellation points)"
10662
10663 #. type: Plain text
10664 #: build/C/man7/pthreads.7:256
10665 msgid ""
10666 "POSIX.1 specifies that certain functions must, and certain other functions "
10667 "may, be cancellation points.  If a thread is cancelable, its cancelability "
10668 "type is deferred, and a cancellation request is pending for the thread, then "
10669 "the thread is canceled when it calls a function that is a cancellation point."
10670 msgstr ""
10671 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
10672 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
10673 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
10674 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
10675 "時点で、そのスレッドのキャンセルが 行われる。"
10676
10677 #. type: Plain text
10678 #: build/C/man7/pthreads.7:259
10679 msgid ""
10680 "The following functions are required to be cancellation points by "
10681 "POSIX.1-2001 and/or POSIX.1-2008:"
10682 msgstr ""
10683 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
10684 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
10685
10686 #. type: Plain text
10687 #: build/C/man7/pthreads.7:322
10688 #, no-wrap
10689 msgid ""
10690 "accept()\n"
10691 "aio_suspend()\n"
10692 "clock_nanosleep()\n"
10693 "close()\n"
10694 "connect()\n"
10695 "creat()\n"
10696 "fcntl() F_SETLKW\n"
10697 "fdatasync()\n"
10698 "fsync()\n"
10699 "getmsg()\n"
10700 "getpmsg()\n"
10701 "lockf() F_LOCK\n"
10702 "mq_receive()\n"
10703 "mq_send()\n"
10704 "mq_timedreceive()\n"
10705 "mq_timedsend()\n"
10706 "msgrcv()\n"
10707 "msgsnd()\n"
10708 "msync()\n"
10709 "nanosleep()\n"
10710 "open()\n"
10711 "openat() [Added in POSIX.1-2008]\n"
10712 "pause()\n"
10713 "poll()\n"
10714 "pread()\n"
10715 "pselect()\n"
10716 "pthread_cond_timedwait()\n"
10717 "pthread_cond_wait()\n"
10718 "pthread_join()\n"
10719 "pthread_testcancel()\n"
10720 "putmsg()\n"
10721 "putpmsg()\n"
10722 "pwrite()\n"
10723 "read()\n"
10724 "readv()\n"
10725 "recv()\n"
10726 "recvfrom()\n"
10727 "recvmsg()\n"
10728 "select()\n"
10729 "sem_timedwait()\n"
10730 "sem_wait()\n"
10731 "send()\n"
10732 "sendmsg()\n"
10733 "sendto()\n"
10734 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
10735 "sigsuspend()\n"
10736 "sigtimedwait()\n"
10737 "sigwait()\n"
10738 "sigwaitinfo()\n"
10739 "sleep()\n"
10740 "system()\n"
10741 "tcdrain()\n"
10742 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10743 "wait()\n"
10744 "waitid()\n"
10745 "waitpid()\n"
10746 "write()\n"
10747 "writev()\n"
10748 msgstr ""
10749 "accept()\n"
10750 "aio_suspend()\n"
10751 "clock_nanosleep()\n"
10752 "close()\n"
10753 "connect()\n"
10754 "creat()\n"
10755 "fcntl() F_SETLKW\n"
10756 "fdatasync()\n"
10757 "fsync()\n"
10758 "getmsg()\n"
10759 "getpmsg()\n"
10760 "lockf() F_LOCK\n"
10761 "mq_receive()\n"
10762 "mq_send()\n"
10763 "mq_timedreceive()\n"
10764 "mq_timedsend()\n"
10765 "msgrcv()\n"
10766 "msgsnd()\n"
10767 "msync()\n"
10768 "nanosleep()\n"
10769 "open()\n"
10770 "openat() [POSIX.1-2008 で追加された]\n"
10771 "pause()\n"
10772 "poll()\n"
10773 "pread()\n"
10774 "pselect()\n"
10775 "pthread_cond_timedwait()\n"
10776 "pthread_cond_wait()\n"
10777 "pthread_join()\n"
10778 "pthread_testcancel()\n"
10779 "putmsg()\n"
10780 "putpmsg()\n"
10781 "pwrite()\n"
10782 "read()\n"
10783 "readv()\n"
10784 "recv()\n"
10785 "recvfrom()\n"
10786 "recvmsg()\n"
10787 "select()\n"
10788 "sem_timedwait()\n"
10789 "sem_wait()\n"
10790 "send()\n"
10791 "sendmsg()\n"
10792 "sendto()\n"
10793 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
10794 "sigsuspend()\n"
10795 "sigtimedwait()\n"
10796 "sigwait()\n"
10797 "sigwaitinfo()\n"
10798 "sleep()\n"
10799 "system()\n"
10800 "tcdrain()\n"
10801 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10802 "wait()\n"
10803 "waitid()\n"
10804 "waitpid()\n"
10805 "write()\n"
10806 "writev()\n"
10807
10808 #. type: Plain text
10809 #: build/C/man7/pthreads.7:327
10810 msgid ""
10811 "The following functions may be cancellation points according to POSIX.1-2001 "
10812 "and/or POSIX.1-2008:"
10813 msgstr ""
10814 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
10815 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
10816
10817 #. type: Plain text
10818 #: build/C/man7/pthreads.7:555
10819 #, no-wrap
10820 msgid ""
10821 "access()\n"
10822 "asctime()\n"
10823 "asctime_r()\n"
10824 "catclose()\n"
10825 "catgets()\n"
10826 "catopen()\n"
10827 "chmod() [Added in POSIX.1-2008]\n"
10828 "chown() [Added in POSIX.1-2008]\n"
10829 "closedir()\n"
10830 "closelog()\n"
10831 "ctermid()\n"
10832 "ctime()\n"
10833 "ctime_r()\n"
10834 "dbm_close()\n"
10835 "dbm_delete()\n"
10836 "dbm_fetch()\n"
10837 "dbm_nextkey()\n"
10838 "dbm_open()\n"
10839 "dbm_store()\n"
10840 "dlclose()\n"
10841 "dlopen()\n"
10842 "dprintf() [Added in POSIX.1-2008]\n"
10843 "endgrent()\n"
10844 "endhostent()\n"
10845 "endnetent()\n"
10846 "endprotoent()\n"
10847 "endpwent()\n"
10848 "endservent()\n"
10849 "endutxent()\n"
10850 "faccessat() [Added in POSIX.1-2008]\n"
10851 "fchmod() [Added in POSIX.1-2008]\n"
10852 "fchmodat() [Added in POSIX.1-2008]\n"
10853 "fchown() [Added in POSIX.1-2008]\n"
10854 "fchownat() [Added in POSIX.1-2008]\n"
10855 "fclose()\n"
10856 "fcntl() (for any value of cmd argument)\n"
10857 "fflush()\n"
10858 "fgetc()\n"
10859 "fgetpos()\n"
10860 "fgets()\n"
10861 "fgetwc()\n"
10862 "fgetws()\n"
10863 "fmtmsg()\n"
10864 "fopen()\n"
10865 "fpathconf()\n"
10866 "fprintf()\n"
10867 "fputc()\n"
10868 "fputs()\n"
10869 "fputwc()\n"
10870 "fputws()\n"
10871 "fread()\n"
10872 "freopen()\n"
10873 "fscanf()\n"
10874 "fseek()\n"
10875 "fseeko()\n"
10876 "fsetpos()\n"
10877 "fstat()\n"
10878 "fstatat() [Added in POSIX.1-2008]\n"
10879 "ftell()\n"
10880 "ftello()\n"
10881 "ftw()\n"
10882 "futimens() [Added in POSIX.1-2008]\n"
10883 "fwprintf()\n"
10884 "fwrite()\n"
10885 "fwscanf()\n"
10886 "getaddrinfo()\n"
10887 "getc()\n"
10888 "getc_unlocked()\n"
10889 "getchar()\n"
10890 "getchar_unlocked()\n"
10891 "getcwd()\n"
10892 "getdate()\n"
10893 "getdelim() [Added in POSIX.1-2008]\n"
10894 "getgrent()\n"
10895 "getgrgid()\n"
10896 "getgrgid_r()\n"
10897 "getgrnam()\n"
10898 "getgrnam_r()\n"
10899 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10900 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10901 "gethostent()\n"
10902 "gethostid()\n"
10903 "gethostname()\n"
10904 "getline() [Added in POSIX.1-2008]\n"
10905 "getlogin()\n"
10906 "getlogin_r()\n"
10907 "getnameinfo()\n"
10908 "getnetbyaddr()\n"
10909 "getnetbyname()\n"
10910 "getnetent()\n"
10911 "getopt() (if opterr is nonzero)\n"
10912 "getprotobyname()\n"
10913 "getprotobynumber()\n"
10914 "getprotoent()\n"
10915 "getpwent()\n"
10916 "getpwnam()\n"
10917 "getpwnam_r()\n"
10918 "getpwuid()\n"
10919 "getpwuid_r()\n"
10920 "gets()\n"
10921 "getservbyname()\n"
10922 "getservbyport()\n"
10923 "getservent()\n"
10924 "getutxent()\n"
10925 "getutxid()\n"
10926 "getutxline()\n"
10927 "getwc()\n"
10928 "getwchar()\n"
10929 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10930 "glob()\n"
10931 "iconv_close()\n"
10932 "iconv_open()\n"
10933 "ioctl()\n"
10934 "link()\n"
10935 "linkat() [Added in POSIX.1-2008]\n"
10936 "lio_listio() [Added in POSIX.1-2008]\n"
10937 "localtime()\n"
10938 "localtime_r()\n"
10939 "lockf() [Added in POSIX.1-2008]\n"
10940 "lseek()\n"
10941 "lstat()\n"
10942 "mkdir() [Added in POSIX.1-2008]\n"
10943 "mkdirat() [Added in POSIX.1-2008]\n"
10944 "mkdtemp() [Added in POSIX.1-2008]\n"
10945 "mkfifo() [Added in POSIX.1-2008]\n"
10946 "mkfifoat() [Added in POSIX.1-2008]\n"
10947 "mknod() [Added in POSIX.1-2008]\n"
10948 "mknodat() [Added in POSIX.1-2008]\n"
10949 "mkstemp()\n"
10950 "mktime()\n"
10951 "nftw()\n"
10952 "opendir()\n"
10953 "openlog()\n"
10954 "pathconf()\n"
10955 "pclose()\n"
10956 "perror()\n"
10957 "popen()\n"
10958 "posix_fadvise()\n"
10959 "posix_fallocate()\n"
10960 "posix_madvise()\n"
10961 "posix_openpt()\n"
10962 "posix_spawn()\n"
10963 "posix_spawnp()\n"
10964 "posix_trace_clear()\n"
10965 "posix_trace_close()\n"
10966 "posix_trace_create()\n"
10967 "posix_trace_create_withlog()\n"
10968 "posix_trace_eventtypelist_getnext_id()\n"
10969 "posix_trace_eventtypelist_rewind()\n"
10970 "posix_trace_flush()\n"
10971 "posix_trace_get_attr()\n"
10972 "posix_trace_get_filter()\n"
10973 "posix_trace_get_status()\n"
10974 "posix_trace_getnext_event()\n"
10975 "posix_trace_open()\n"
10976 "posix_trace_rewind()\n"
10977 "posix_trace_set_filter()\n"
10978 "posix_trace_shutdown()\n"
10979 "posix_trace_timedgetnext_event()\n"
10980 "posix_typed_mem_open()\n"
10981 "printf()\n"
10982 "psiginfo() [Added in POSIX.1-2008]\n"
10983 "psignal() [Added in POSIX.1-2008]\n"
10984 "pthread_rwlock_rdlock()\n"
10985 "pthread_rwlock_timedrdlock()\n"
10986 "pthread_rwlock_timedwrlock()\n"
10987 "pthread_rwlock_wrlock()\n"
10988 "putc()\n"
10989 "putc_unlocked()\n"
10990 "putchar()\n"
10991 "putchar_unlocked()\n"
10992 "puts()\n"
10993 "pututxline()\n"
10994 "putwc()\n"
10995 "putwchar()\n"
10996 "readdir()\n"
10997 "readdir_r()\n"
10998 "readlink() [Added in POSIX.1-2008]\n"
10999 "readlinkat() [Added in POSIX.1-2008]\n"
11000 "remove()\n"
11001 "rename()\n"
11002 "renameat() [Added in POSIX.1-2008]\n"
11003 "rewind()\n"
11004 "rewinddir()\n"
11005 "scandir() [Added in POSIX.1-2008]\n"
11006 "scanf()\n"
11007 "seekdir()\n"
11008 "semop()\n"
11009 "setgrent()\n"
11010 "sethostent()\n"
11011 "setnetent()\n"
11012 "setprotoent()\n"
11013 "setpwent()\n"
11014 "setservent()\n"
11015 "setutxent()\n"
11016 "sigpause() [Added in POSIX.1-2008]\n"
11017 "stat()\n"
11018 "strerror()\n"
11019 "strerror_r()\n"
11020 "strftime()\n"
11021 "symlink()\n"
11022 "symlinkat() [Added in POSIX.1-2008]\n"
11023 "sync()\n"
11024 "syslog()\n"
11025 "tmpfile()\n"
11026 "tmpnam()\n"
11027 "ttyname()\n"
11028 "ttyname_r()\n"
11029 "tzset()\n"
11030 "ungetc()\n"
11031 "ungetwc()\n"
11032 "unlink()\n"
11033 "unlinkat() [Added in POSIX.1-2008]\n"
11034 "utime() [Added in POSIX.1-2008]\n"
11035 "utimensat() [Added in POSIX.1-2008]\n"
11036 "utimes() [Added in POSIX.1-2008]\n"
11037 "vdprintf() [Added in POSIX.1-2008]\n"
11038 "vfprintf()\n"
11039 "vfwprintf()\n"
11040 "vprintf()\n"
11041 "vwprintf()\n"
11042 "wcsftime()\n"
11043 "wordexp()\n"
11044 "wprintf()\n"
11045 "wscanf()\n"
11046 msgstr ""
11047 "access()\n"
11048 "asctime()\n"
11049 "asctime_r()\n"
11050 "catclose()\n"
11051 "catgets()\n"
11052 "catopen()\n"
11053 "chmod() [POSIX.1-2008 で追加された]\n"
11054 "chown() [POSIX.1-2008 で追加された]\n"
11055 "closedir()\n"
11056 "closelog()\n"
11057 "ctermid()\n"
11058 "ctime()\n"
11059 "ctime_r()\n"
11060 "dbm_close()\n"
11061 "dbm_delete()\n"
11062 "dbm_fetch()\n"
11063 "dbm_nextkey()\n"
11064 "dbm_open()\n"
11065 "dbm_store()\n"
11066 "dlclose()\n"
11067 "dlopen()\n"
11068 "dprintf() [POSIX.1-2008 で追加された]\n"
11069 "endgrent()\n"
11070 "endhostent()\n"
11071 "endnetent()\n"
11072 "endprotoent()\n"
11073 "endpwent()\n"
11074 "endservent()\n"
11075 "endutxent()\n"
11076 "faccessat() [POSIX.1-2008 で追加された]\n"
11077 "fchmod() [POSIX.1-2008 で追加された]\n"
11078 "fchmodat() [POSIX.1-2008 で追加された]\n"
11079 "fchown() [POSIX.1-2008 で追加された]\n"
11080 "fchownat() [POSIX.1-2008 で追加された]\n"
11081 "fclose()\n"
11082 "fcntl() (cmd 引き数が何であっても)\n"
11083 "fflush()\n"
11084 "fgetc()\n"
11085 "fgetpos()\n"
11086 "fgets()\n"
11087 "fgetwc()\n"
11088 "fgetws()\n"
11089 "fmtmsg()\n"
11090 "fopen()\n"
11091 "fpathconf()\n"
11092 "fprintf()\n"
11093 "fputc()\n"
11094 "fputs()\n"
11095 "fputwc()\n"
11096 "fputws()\n"
11097 "fread()\n"
11098 "freopen()\n"
11099 "fscanf()\n"
11100 "fseek()\n"
11101 "fseeko()\n"
11102 "fsetpos()\n"
11103 "fstat()\n"
11104 "fstatat() [POSIX.1-2008 で追加された]\n"
11105 "ftell()\n"
11106 "ftello()\n"
11107 "ftw()\n"
11108 "futimens() [POSIX.1-2008 で追加された]\n"
11109 "fwprintf()\n"
11110 "fwrite()\n"
11111 "fwscanf()\n"
11112 "getaddrinfo()\n"
11113 "getc()\n"
11114 "getc_unlocked()\n"
11115 "getchar()\n"
11116 "getchar_unlocked()\n"
11117 "getcwd()\n"
11118 "getdate()\n"
11119 "getdelim() [POSIX.1-2008 で追加された]\n"
11120 "getgrent()\n"
11121 "getgrgid()\n"
11122 "getgrgid_r()\n"
11123 "getgrnam()\n"
11124 "getgrnam_r()\n"
11125 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
11126 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
11127 "gethostent()\n"
11128 "gethostid()\n"
11129 "gethostname()\n"
11130 "getline() [POSIX.1-2008 で追加された]\n"
11131 "getlogin()\n"
11132 "getlogin_r()\n"
11133 "getnameinfo()\n"
11134 "getnetbyaddr()\n"
11135 "getnetbyname()\n"
11136 "getnetent()\n"
11137 "getopt() (opterr が 0 以外の場合)\n"
11138 "getprotobyname()\n"
11139 "getprotobynumber()\n"
11140 "getprotoent()\n"
11141 "getpwent()\n"
11142 "getpwnam()\n"
11143 "getpwnam_r()\n"
11144 "getpwuid()\n"
11145 "getpwuid_r()\n"
11146 "gets()\n"
11147 "getservbyname()\n"
11148 "getservbyport()\n"
11149 "getservent()\n"
11150 "getutxent()\n"
11151 "getutxid()\n"
11152 "getutxline()\n"
11153 "getwc()\n"
11154 "getwchar()\n"
11155 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
11156 "glob()\n"
11157 "iconv_close()\n"
11158 "iconv_open()\n"
11159 "ioctl()\n"
11160 "link()\n"
11161 "linkat() [POSIX.1-2008 で追加された]\n"
11162 "lio_listio() [POSIX.1-2008 で追加された]\n"
11163 "localtime()\n"
11164 "localtime_r()\n"
11165 "lockf() [POSIX.1-2008 で追加された]\n"
11166 "lseek()\n"
11167 "lstat()\n"
11168 "mkdir() [POSIX.1-2008 で追加された]\n"
11169 "mkdirat() [POSIX.1-2008 で追加された]\n"
11170 "mkdtemp() [POSIX.1-2008 で追加された]\n"
11171 "mkfifo() [POSIX.1-2008 で追加された]\n"
11172 "mkfifoat() [POSIX.1-2008 で追加された]\n"
11173 "mknod() [POSIX.1-2008 で追加された]\n"
11174 "mknodat() [POSIX.1-2008 で追加された]\n"
11175 "mkstemp()\n"
11176 "mktime()\n"
11177 "nftw()\n"
11178 "opendir()\n"
11179 "openlog()\n"
11180 "pathconf()\n"
11181 "pclose()\n"
11182 "perror()\n"
11183 "popen()\n"
11184 "posix_fadvise()\n"
11185 "posix_fallocate()\n"
11186 "posix_madvise()\n"
11187 "posix_openpt()\n"
11188 "posix_spawn()\n"
11189 "posix_spawnp()\n"
11190 "posix_trace_clear()\n"
11191 "posix_trace_close()\n"
11192 "posix_trace_create()\n"
11193 "posix_trace_create_withlog()\n"
11194 "posix_trace_eventtypelist_getnext_id()\n"
11195 "posix_trace_eventtypelist_rewind()\n"
11196 "posix_trace_flush()\n"
11197 "posix_trace_get_attr()\n"
11198 "posix_trace_get_filter()\n"
11199 "posix_trace_get_status()\n"
11200 "posix_trace_getnext_event()\n"
11201 "posix_trace_open()\n"
11202 "posix_trace_rewind()\n"
11203 "posix_trace_set_filter()\n"
11204 "posix_trace_shutdown()\n"
11205 "posix_trace_timedgetnext_event()\n"
11206 "posix_typed_mem_open()\n"
11207 "printf()\n"
11208 "psiginfo() [POSIX.1-2008 で追加された]\n"
11209 "psignal() [POSIX.1-2008 で追加された]\n"
11210 "pthread_rwlock_rdlock()\n"
11211 "pthread_rwlock_timedrdlock()\n"
11212 "pthread_rwlock_timedwrlock()\n"
11213 "pthread_rwlock_wrlock()\n"
11214 "putc()\n"
11215 "putc_unlocked()\n"
11216 "putchar()\n"
11217 "putchar_unlocked()\n"
11218 "puts()\n"
11219 "pututxline()\n"
11220 "putwc()\n"
11221 "putwchar()\n"
11222 "readdir()\n"
11223 "readdir_r()\n"
11224 "readlink() [POSIX.1-2008 で追加された]\n"
11225 "readlinkat() [POSIX.1-2008 で追加された]\n"
11226 "remove()\n"
11227 "rename()\n"
11228 "renameat() [POSIX.1-2008 で追加された]\n"
11229 "rewind()\n"
11230 "rewinddir()\n"
11231 "scandir() [POSIX.1-2008 で追加された]\n"
11232 "scanf()\n"
11233 "seekdir()\n"
11234 "semop()\n"
11235 "setgrent()\n"
11236 "sethostent()\n"
11237 "setnetent()\n"
11238 "setprotoent()\n"
11239 "setpwent()\n"
11240 "setservent()\n"
11241 "setutxent()\n"
11242 "sigpause() [POSIX.1-2008 で追加された]\n"
11243 "stat()\n"
11244 "strerror()\n"
11245 "strerror_r()\n"
11246 "strftime()\n"
11247 "symlink()\n"
11248 "symlinkat() [POSIX.1-2008 で追加された]\n"
11249 "sync()\n"
11250 "syslog()\n"
11251 "tmpfile()\n"
11252 "tmpnam()\n"
11253 "ttyname()\n"
11254 "ttyname_r()\n"
11255 "tzset()\n"
11256 "ungetc()\n"
11257 "ungetwc()\n"
11258 "unlink()\n"
11259 "unlinkat() [POSIX.1-2008 で追加された]\n"
11260 "utime() [POSIX.1-2008 で追加された]\n"
11261 "utimensat() [POSIX.1-2008 で追加された]\n"
11262 "utimes() [POSIX.1-2008 で追加された]\n"
11263 "vdprintf() [POSIX.1-2008 で追加された]\n"
11264 "vfprintf()\n"
11265 "vfwprintf()\n"
11266 "vprintf()\n"
11267 "vwprintf()\n"
11268 "wcsftime()\n"
11269 "wordexp()\n"
11270 "wprintf()\n"
11271 "wscanf()\n"
11272
11273 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
11274 #.  files, it looks as though at least the following nonstandard
11275 #.  functions are cancellation points:
11276 #.  endnetgrent
11277 #.  endspent
11278 #.  epoll_pwait
11279 #.  epoll_wait
11280 #.  fcloseall
11281 #.  fdopendir
11282 #.  fflush_unlocked
11283 #.  fgetc_unlocked
11284 #.  fgetgrent
11285 #.  fgetgrent_r
11286 #.  fgetpwent
11287 #.  fgetpwent_r
11288 #.  fgets_unlocked
11289 #.  fgetspent
11290 #.  fgetspent_r
11291 #.  fgetwc_unlocked
11292 #.  fgetws_unlocked
11293 #.  fputc_unlocked
11294 #.  fputs_unlocked
11295 #.  fputwc_unlocked
11296 #.  fputws_unlocked
11297 #.  fread_unlocked
11298 #.  fwrite_unlocked
11299 #.  gai_suspend
11300 #.  getaddrinfo_a
11301 #.  getdate_r
11302 #.  getgrent_r
11303 #.  getgrouplist
11304 #.  gethostbyaddr_r
11305 #.  gethostbyname2
11306 #.  gethostbyname2_r
11307 #.  gethostbyname_r
11308 #.  gethostent_r
11309 #.  getnetbyaddr_r
11310 #.  getnetbyname_r
11311 #.  getnetent_r
11312 #.  getnetgrent
11313 #.  getnetgrent_r
11314 #.  getprotobyname_r
11315 #.  getprotobynumber_r
11316 #.  getprotoent_r
11317 #.  getpw
11318 #.  getpwent_r
11319 #.  getservbyname_r
11320 #.  getservbyport_r
11321 #.  getservent_r
11322 #.  getspent
11323 #.  getspent_r
11324 #.  getspnam
11325 #.  getspnam_r
11326 #.  getutmp
11327 #.  getutmpx
11328 #.  getw
11329 #.  getwc_unlocked
11330 #.  getwchar_unlocked
11331 #.  initgroups
11332 #.  innetgr
11333 #.  mkostemp
11334 #.  mkostemp64
11335 #.  mkstemp64
11336 #.  ppoll
11337 #.  pthread_timedjoin_np
11338 #.  putgrent
11339 #.  putpwent
11340 #.  putspent
11341 #.  putw
11342 #.  putwc_unlocked
11343 #.  putwchar_unlocked
11344 #.  rcmd
11345 #.  rcmd_af
11346 #.  rexec
11347 #.  rexec_af
11348 #.  rresvport
11349 #.  rresvport_af
11350 #.  ruserok
11351 #.  ruserok_af
11352 #.  setnetgrent
11353 #.  setspent
11354 #.  sgetspent
11355 #.  sgetspent_r
11356 #.  updwtmpx
11357 #.  utmpxname
11358 #.  vfscanf
11359 #.  vfwscanf
11360 #.  vscanf
11361 #.  vsyslog
11362 #.  vwscanf
11363 #. type: Plain text
11364 #: build/C/man7/pthreads.7:653
11365 msgid ""
11366 "An implementation may also mark other functions not specified in the "
11367 "standard as cancellation points.  In particular, an implementation is likely "
11368 "to mark any nonstandard function that may block as a cancellation point.  "
11369 "(This includes most functions that can touch files.)"
11370 msgstr ""
11371 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
11372 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
11373 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
11374 "関数がこれに含まれる)。"
11375
11376 #. type: SS
11377 #: build/C/man7/pthreads.7:653
11378 #, no-wrap
11379 msgid "Compiling on Linux"
11380 msgstr "Linux でのコンパイル"
11381
11382 #. type: Plain text
11383 #: build/C/man7/pthreads.7:656
11384 msgid ""
11385 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
11386 "pthread>."
11387 msgstr ""
11388 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
11389 "きである。"
11390
11391 #. type: SS
11392 #: build/C/man7/pthreads.7:656
11393 #, no-wrap
11394 msgid "Linux implementations of POSIX threads"
11395 msgstr "POSIX スレッドの Linux での実装"
11396
11397 #. type: Plain text
11398 #: build/C/man7/pthreads.7:659
11399 msgid ""
11400 "Over time, two threading implementations have been provided by the GNU C "
11401 "library on Linux:"
11402 msgstr ""
11403 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
11404 "た。"
11405
11406 #. type: TP
11407 #: build/C/man7/pthreads.7:659
11408 #, no-wrap
11409 msgid "B<LinuxThreads>"
11410 msgstr "B<LinuxThreads>"
11411
11412 #. type: Plain text
11413 #: build/C/man7/pthreads.7:663
11414 msgid ""
11415 "This is the original Pthreads implementation.  Since glibc 2.4, this "
11416 "implementation is no longer supported."
11417 msgstr ""
11418 "最初の Pthreads の実装。\n"
11419 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
11420
11421 #. type: TP
11422 #: build/C/man7/pthreads.7:663
11423 #, no-wrap
11424 msgid "B<NPTL> (Native POSIX Threads Library)"
11425 msgstr "B<NPTL> (Native POSIX Threads Library)"
11426
11427 #. type: Plain text
11428 #: build/C/man7/pthreads.7:671
11429 msgid ""
11430 "This is the modern Pthreads implementation.  By comparison with "
11431 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
11432 "POSIX.1 specification and better performance when creating large numbers of "
11433 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
11434 "are present in the Linux 2.6 kernel."
11435 msgstr ""
11436 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
11437 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
11438 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
11439 "装されている機能が必要である。"
11440
11441 #. type: Plain text
11442 #: build/C/man7/pthreads.7:681
11443 msgid ""
11444 "Both of these are so-called 1:1 implementations, meaning that each thread "
11445 "maps to a kernel scheduling entity.  Both threading implementations employ "
11446 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
11447 "primitives (mutexes, thread joining, and so on) are implemented using the "
11448 "Linux B<futex>(2)  system call."
11449 msgstr ""
11450 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
11451 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
11452 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
11453 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
11454 "使って実装されている。"
11455
11456 #. type: SS
11457 #: build/C/man7/pthreads.7:681
11458 #, no-wrap
11459 msgid "LinuxThreads"
11460 msgstr "LinuxThreads"
11461
11462 #. type: Plain text
11463 #: build/C/man7/pthreads.7:683
11464 msgid "The notable features of this implementation are the following:"
11465 msgstr "この実装の大きな特徴は以下の通りである:"
11466
11467 #. type: Plain text
11468 #: build/C/man7/pthreads.7:690
11469 msgid ""
11470 "In addition to the main (initial) thread, and the threads that the program "
11471 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
11472 "thread.  This thread handles thread creation and termination.  (Problems can "
11473 "result if this thread is inadvertently killed.)"
11474 msgstr ""
11475 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
11476 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
11477 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
11478 "kill されると、問題が起こることがある)。"
11479
11480 #. type: Plain text
11481 #: build/C/man7/pthreads.7:702
11482 msgid ""
11483 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
11484 "the first three real-time signals are used (see also B<signal>(7)).  On "
11485 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
11486 "avoid the use of whichever set of signals is employed by the implementation."
11487 msgstr ""
11488 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
11489 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
11490 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
11491 "用されているシグナルを どれも使わないようにしなければならない。"
11492
11493 #. type: Plain text
11494 #: build/C/man7/pthreads.7:709
11495 msgid ""
11496 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
11497 "implemented as processes which share more information than usual, but which "
11498 "do not share a common process ID.)  LinuxThreads threads (including the "
11499 "manager thread)  are visible as separate processes using B<ps>(1)."
11500 msgstr ""
11501 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
11502 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
11503 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
11504 "を使うと別のプロセスのように見える。"
11505
11506 #. type: Plain text
11507 #: build/C/man7/pthreads.7:712
11508 msgid ""
11509 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
11510 "number of ways, including the following:"
11511 msgstr ""
11512 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
11513 "示すような点がある:"
11514
11515 #. type: Plain text
11516 #: build/C/man7/pthreads.7:716
11517 msgid "Calls to B<getpid>(2)  return a different value in each thread."
11518 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
11519
11520 #. type: Plain text
11521 #: build/C/man7/pthreads.7:725
11522 msgid ""
11523 "Calls to B<getppid>(2)  in threads other than the main thread return the "
11524 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
11525 "should return the same value as B<getppid>(2)  in the main thread."
11526 msgstr ""
11527 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
11528 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
11529 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
11530
11531 #. type: Plain text
11532 #: build/C/man7/pthreads.7:735
11533 msgid ""
11534 "When one thread creates a new child process using B<fork>(2), any thread "
11535 "should be able to B<wait>(2)  on the child.  However, the implementation "
11536 "only allows the thread that created the child to B<wait>(2)  on it."
11537 msgstr ""
11538 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
11539 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
11540 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
11541 "る。"
11542
11543 #. type: Plain text
11544 #: build/C/man7/pthreads.7:742
11545 msgid ""
11546 "When a thread calls B<execve>(2), all other threads are terminated (as "
11547 "required by POSIX.1).  However, the resulting process has the same PID as "
11548 "the thread that called B<execve>(2): it should have the same PID as the main "
11549 "thread."
11550 msgstr ""
11551 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
11552 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
11553 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
11554 "る。"
11555
11556 #. type: Plain text
11557 #: build/C/man7/pthreads.7:749
11558 msgid ""
11559 "Threads do not share user and group IDs.  This can cause complications with "
11560 "set-user-ID programs and can cause failures in Pthreads functions if an "
11561 "application changes its credentials using B<seteuid>(2)  or similar."
11562 msgstr ""
11563 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
11564 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使っ"
11565 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
11566
11567 #. type: Plain text
11568 #: build/C/man7/pthreads.7:751
11569 msgid "Threads do not share a common session ID and process group ID."
11570 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
11571
11572 #. type: Plain text
11573 #: build/C/man7/pthreads.7:754
11574 msgid "Threads do not share record locks created using B<fcntl>(2)."
11575 msgstr ""
11576 "スレッド間で B<fcntl>(2)  を使って作成されるレコード・ロックを共有しない。"
11577
11578 #. type: Plain text
11579 #: build/C/man7/pthreads.7:760
11580 msgid ""
11581 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
11582 "rather than process-wide."
11583 msgstr ""
11584 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
11585 "単位の情報である。"
11586
11587 #. type: Plain text
11588 #: build/C/man7/pthreads.7:763
11589 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
11590 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
11591
11592 #. type: Plain text
11593 #: build/C/man7/pthreads.7:765
11594 msgid "Threads do not share interval timers."
11595 msgstr "スレッド間でインターバル・タイマを共有しない。"
11596
11597 #.  FIXME . bug report filed for NPTL nice nonconformance
11598 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
11599 #.  Sep 08: there is a patch by Denys Vlasenko to address this
11600 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
11601 #.  Monitor this to see if it makes it into mainline.
11602 #. type: Plain text
11603 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
11604 msgid "Threads do not share a common nice value."
11605 msgstr "スレッドは共通の nice 値を共有しない。"
11606
11607 #. type: Plain text
11608 #: build/C/man7/pthreads.7:777
11609 msgid ""
11610 "POSIX.1 distinguishes the notions of signals that are directed to the "
11611 "process as a whole and signals that are directed to individual threads.  "
11612 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
11613 "example) should be handled by a single, arbitrarily selected thread within "
11614 "the process.  LinuxThreads does not support the notion of process-directed "
11615 "signals: signals may be sent only to specific threads."
11616 msgstr ""
11617 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
11618 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
11619 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
11620 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
11621 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
11622 "ルは特定のスレッドにだけ送ることができる。"
11623
11624 #. type: Plain text
11625 #: build/C/man7/pthreads.7:786
11626 msgid ""
11627 "Threads have distinct alternate signal stack settings.  However, a new "
11628 "thread's alternate signal stack settings are copied from the thread that "
11629 "created it, so that the threads initially share an alternate signal stack.  "
11630 "(A new thread should start with no alternate signal stack defined.  If two "
11631 "threads handle signals on their shared alternate signal stack at the same "
11632 "time, unpredictable program failures are likely to occur.)"
11633 msgstr ""
11634 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
11635 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
11636 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
11637 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
11638 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
11639 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
11640
11641 #. type: SS
11642 #: build/C/man7/pthreads.7:786
11643 #, no-wrap
11644 msgid "NPTL"
11645 msgstr "NPTL"
11646
11647 #. type: Plain text
11648 #: build/C/man7/pthreads.7:795
11649 msgid ""
11650 "With NPTL, all of the threads in a process are placed in the same thread "
11651 "group; all members of a thread group share the same PID.  NPTL does not "
11652 "employ a manager thread.  NPTL makes internal use of the first two real-time "
11653 "signals (see also B<signal>(7)); these signals cannot be used in "
11654 "applications."
11655 msgstr ""
11656 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
11657 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
11658 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
11659 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
11660 "ションでは使用できない。"
11661
11662 #. type: Plain text
11663 #: build/C/man7/pthreads.7:797
11664 msgid "NPTL still has at least one nonconformance with POSIX.1:"
11665 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
11666
11667 #. type: Plain text
11668 #: build/C/man7/pthreads.7:806
11669 msgid "Some NPTL nonconformances occur only with older kernels:"
11670 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
11671
11672 #. type: Plain text
11673 #: build/C/man7/pthreads.7:812
11674 msgid ""
11675 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
11676 "rather than process-wide (fixed in kernel 2.6.9)."
11677 msgstr ""
11678 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
11679 "単位の情報である (カーネル 2.6.9 で修正された)。"
11680
11681 #. type: Plain text
11682 #: build/C/man7/pthreads.7:814
11683 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
11684 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
11685
11686 #. type: Plain text
11687 #: build/C/man7/pthreads.7:816
11688 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
11689 msgstr ""
11690 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
11691
11692 #. type: Plain text
11693 #: build/C/man7/pthreads.7:820
11694 msgid ""
11695 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
11696 "(fixed in kernel 2.6.16)."
11697 msgstr ""
11698 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
11699 "きる (カーネル 2.6.16 で修正された)。"
11700
11701 #. type: Plain text
11702 #: build/C/man7/pthreads.7:825
11703 msgid ""
11704 "Only the main thread is permitted to make the process into a process group "
11705 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
11706 msgstr ""
11707 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセス・グルー"
11708 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
11709
11710 #. type: Plain text
11711 #: build/C/man7/pthreads.7:831
11712 msgid ""
11713 "Threads have distinct alternate signal stack settings.  However, a new "
11714 "thread's alternate signal stack settings are copied from the thread that "
11715 "created it, so that the threads initially share an alternate signal stack "
11716 "(fixed in kernel 2.6.16)."
11717 msgstr ""
11718 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
11719 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
11720 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
11721 "ル 2.6.16 で修正された)。"
11722
11723 #. type: Plain text
11724 #: build/C/man7/pthreads.7:833
11725 msgid "Note the following further points about the NPTL implementation:"
11726 msgstr "NPTL の実装では以下の点についても注意すること:"
11727
11728 #. type: Plain text
11729 #: build/C/man7/pthreads.7:847
11730 msgid ""
11731 "If the stack size soft resource limit (see the description of "
11732 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
11733 "I<unlimited>, then this value defines the default stack size for new "
11734 "threads.  To be effective, this limit must be set before the program is "
11735 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
11736 "stacksize> in the C shell)."
11737 msgstr ""
11738 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2)  の "
11739 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
11740 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
11741 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
11742 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
11743 "は I<limit stacksize>)  を使って設定する。"
11744
11745 #. type: SS
11746 #: build/C/man7/pthreads.7:847
11747 #, no-wrap
11748 msgid "Determining the threading implementation"
11749 msgstr "スレッド実装の判定"
11750
11751 #. type: Plain text
11752 #: build/C/man7/pthreads.7:852
11753 msgid ""
11754 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
11755 "system's threading implementation, for example:"
11756 msgstr ""
11757 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
11758 "装を判定することができる。 以下に例を示す:"
11759
11760 #. type: Plain text
11761 #: build/C/man7/pthreads.7:857
11762 #, no-wrap
11763 msgid ""
11764 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
11765 "NPTL 2.3.4\n"
11766 msgstr ""
11767 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
11768 "NPTL 2.3.4\n"
11769
11770 #. type: Plain text
11771 #: build/C/man7/pthreads.7:862
11772 msgid ""
11773 "With older glibc versions, a command such as the following should be "
11774 "sufficient to determine the default threading implementation:"
11775 msgstr ""
11776 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
11777 "ド実装を判定することができる。"
11778
11779 #. type: Plain text
11780 #: build/C/man7/pthreads.7:868
11781 #, no-wrap
11782 msgid ""
11783 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
11784 "                egrep -i \\(aqthreads|nptl\\(aq\n"
11785 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
11786 msgstr ""
11787 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
11788 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
11789 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
11790
11791 #. type: SS
11792 #: build/C/man7/pthreads.7:870
11793 #, no-wrap
11794 msgid "Selecting the threading implementation: LD_ASSUME_KERNEL"
11795 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
11796
11797 #. type: Plain text
11798 #: build/C/man7/pthreads.7:885
11799 msgid ""
11800 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
11801 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
11802 "override the dynamic linker's default choice of threading implementation.  "
11803 "This variable tells the dynamic linker to assume that it is running on top "
11804 "of a particular kernel version.  By specifying a kernel version that does "
11805 "not provide the support required by NPTL, we can force the use of "
11806 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
11807 "application that depends on some nonconformant behavior in LinuxThreads.)  "
11808 "For example:"
11809 msgstr ""
11810 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
11811 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
11812 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
11813 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
11814 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
11815 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
11816 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
11817 "ン を動作させる場合だろう)。 以下に例を示す:"
11818
11819 #. type: Plain text
11820 #: build/C/man7/pthreads.7:891
11821 #, no-wrap
11822 msgid ""
11823 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
11824 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|nptl\\(aq\n"
11825 "        linuxthreads-0.10 by Xavier Leroy\n"
11826 msgstr ""
11827 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
11828 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|nptl\\(aq\n"
11829 "        linuxthreads-0.10 by Xavier Leroy\n"
11830
11831 #. type: Plain text
11832 #: build/C/man7/pthreads.7:903
11833 msgid ""
11834 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), "
11835 "B<sigevent>(7), B<signal>(7),"
11836 msgstr ""
11837 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
11838 "B<signal>(7),"
11839
11840 #. type: Plain text
11841 #: build/C/man7/pthreads.7:927
11842 msgid ""
11843 "Various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
11844 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
11845 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
11846 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
11847 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
11848 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), "
11849 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), "
11850 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3), "
11851 "and B<pthread_testcancel>(3)"
11852 msgstr ""
11853 "pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
11854 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
11855 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
11856 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
11857 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
11858 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
11859 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
11860 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
11861 "and B<pthread_testcancel>(3)"