OSDN Git Service

Update the version to 3.67 and minor changes in ja.po
[linuxjm/LDP_man-pages.git] / po4a / pthread / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2014-06-03 01:29+0900\n"
10 "PO-Revision-Date: 2014-06-03 12:56+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_self.3:26 build/C/man3/pthread_setaffinity_np.3:26
85 #: build/C/man3/pthread_setcancelstate.3:26
86 #: build/C/man3/pthread_setconcurrency.3:25
87 #: build/C/man3/pthread_setname_np.3:26
88 #: build/C/man3/pthread_setschedparam.3:26
89 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigmask.3:26
90 #: build/C/man3/pthread_sigqueue.3:25 build/C/man3/pthread_testcancel.3:26
91 #: build/C/man3/pthread_tryjoin_np.3:26 build/C/man3/pthread_yield.3:25
92 #: build/C/man7/pthreads.7:26
93 #, no-wrap
94 msgid "Linux Programmer's Manual"
95 msgstr "Linux Programmer's Manual"
96
97 #. type: SH
98 #: build/C/man3/getcontext.3:26 build/C/man3/makecontext.3:29
99 #: build/C/man3/pthread_attr_init.3:27
100 #: build/C/man3/pthread_attr_setaffinity_np.3:27
101 #: build/C/man3/pthread_attr_setdetachstate.3:27
102 #: build/C/man3/pthread_attr_setguardsize.3:27
103 #: build/C/man3/pthread_attr_setinheritsched.3:27
104 #: build/C/man3/pthread_attr_setschedparam.3:27
105 #: build/C/man3/pthread_attr_setschedpolicy.3:27
106 #: build/C/man3/pthread_attr_setscope.3:27
107 #: build/C/man3/pthread_attr_setstack.3:27
108 #: build/C/man3/pthread_attr_setstackaddr.3:27
109 #: build/C/man3/pthread_attr_setstacksize.3:27
110 #: build/C/man3/pthread_cancel.3:27 build/C/man3/pthread_cleanup_push.3:27
111 #: build/C/man3/pthread_cleanup_push_defer_np.3:27
112 #: build/C/man3/pthread_create.3:27 build/C/man3/pthread_detach.3:27
113 #: build/C/man3/pthread_equal.3:27 build/C/man3/pthread_exit.3:27
114 #: build/C/man3/pthread_getattr_np.3:27
115 #: build/C/man3/pthread_getcpuclockid.3:27 build/C/man3/pthread_join.3:27
116 #: build/C/man3/pthread_kill.3:27
117 #: build/C/man3/pthread_kill_other_threads_np.3:27
118 #: build/C/man3/pthread_self.3:27 build/C/man3/pthread_setaffinity_np.3:27
119 #: build/C/man3/pthread_setcancelstate.3:27
120 #: build/C/man3/pthread_setconcurrency.3:26
121 #: build/C/man3/pthread_setname_np.3:27
122 #: build/C/man3/pthread_setschedparam.3:27
123 #: build/C/man3/pthread_setschedprio.3:27 build/C/man3/pthread_sigmask.3:27
124 #: build/C/man3/pthread_sigqueue.3:26 build/C/man3/pthread_testcancel.3:27
125 #: build/C/man3/pthread_tryjoin_np.3:27 build/C/man3/pthread_yield.3:26
126 #: build/C/man7/pthreads.7:27
127 #, no-wrap
128 msgid "NAME"
129 msgstr "名前"
130
131 #. type: Plain text
132 #: build/C/man3/getcontext.3:28
133 msgid "getcontext, setcontext - get or set the user context"
134 msgstr "getcontext, setcontext - ユーザコンテキストを取得/設定する"
135
136 #. type: SH
137 #: build/C/man3/getcontext.3:28 build/C/man3/makecontext.3:31
138 #: build/C/man3/pthread_attr_init.3:30
139 #: build/C/man3/pthread_attr_setaffinity_np.3:30
140 #: build/C/man3/pthread_attr_setdetachstate.3:30
141 #: build/C/man3/pthread_attr_setguardsize.3:30
142 #: build/C/man3/pthread_attr_setinheritsched.3:30
143 #: build/C/man3/pthread_attr_setschedparam.3:30
144 #: build/C/man3/pthread_attr_setschedpolicy.3:30
145 #: build/C/man3/pthread_attr_setscope.3:30
146 #: build/C/man3/pthread_attr_setstack.3:30
147 #: build/C/man3/pthread_attr_setstackaddr.3:30
148 #: build/C/man3/pthread_attr_setstacksize.3:30
149 #: build/C/man3/pthread_cancel.3:29 build/C/man3/pthread_cleanup_push.3:30
150 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
151 #: build/C/man3/pthread_create.3:29 build/C/man3/pthread_detach.3:29
152 #: build/C/man3/pthread_equal.3:29 build/C/man3/pthread_exit.3:29
153 #: build/C/man3/pthread_getattr_np.3:29
154 #: build/C/man3/pthread_getcpuclockid.3:29 build/C/man3/pthread_join.3:29
155 #: build/C/man3/pthread_kill.3:29
156 #: build/C/man3/pthread_kill_other_threads_np.3:29
157 #: build/C/man3/pthread_self.3:29 build/C/man3/pthread_setaffinity_np.3:30
158 #: build/C/man3/pthread_setcancelstate.3:30
159 #: build/C/man3/pthread_setconcurrency.3:29
160 #: build/C/man3/pthread_setname_np.3:29
161 #: build/C/man3/pthread_setschedparam.3:30
162 #: build/C/man3/pthread_setschedprio.3:29 build/C/man3/pthread_sigmask.3:29
163 #: build/C/man3/pthread_sigqueue.3:28 build/C/man3/pthread_testcancel.3:29
164 #: build/C/man3/pthread_tryjoin_np.3:30 build/C/man3/pthread_yield.3:28
165 #, no-wrap
166 msgid "SYNOPSIS"
167 msgstr "書式"
168
169 #. type: Plain text
170 #: build/C/man3/getcontext.3:30 build/C/man3/makecontext.3:33
171 msgid "B<#include E<lt>ucontext.hE<gt>>"
172 msgstr "B<#include E<lt>ucontext.hE<gt>>"
173
174 #. type: Plain text
175 #: build/C/man3/getcontext.3:32
176 msgid "B<int getcontext(ucontext_t *>I<ucp>B<);>"
177 msgstr "B<int getcontext(ucontext_t *>I<ucp>B<);>"
178
179 #. type: Plain text
180 #: build/C/man3/getcontext.3:34
181 msgid "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
182 msgstr "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
183
184 #. type: SH
185 #: build/C/man3/getcontext.3:34 build/C/man3/makecontext.3:38
186 #: build/C/man3/pthread_attr_init.3:39
187 #: build/C/man3/pthread_attr_setaffinity_np.3:42
188 #: build/C/man3/pthread_attr_setdetachstate.3:41
189 #: build/C/man3/pthread_attr_setguardsize.3:41
190 #: build/C/man3/pthread_attr_setinheritsched.3:41
191 #: build/C/man3/pthread_attr_setschedparam.3:41
192 #: build/C/man3/pthread_attr_setschedpolicy.3:41
193 #: build/C/man3/pthread_attr_setscope.3:41
194 #: build/C/man3/pthread_attr_setstack.3:54
195 #: build/C/man3/pthread_attr_setstackaddr.3:41
196 #: build/C/man3/pthread_attr_setstacksize.3:41
197 #: build/C/man3/pthread_cancel.3:37 build/C/man3/pthread_cleanup_push.3:40
198 #: build/C/man3/pthread_cleanup_push_defer_np.3:40
199 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
200 #: build/C/man3/pthread_equal.3:37 build/C/man3/pthread_exit.3:37
201 #: build/C/man3/pthread_getattr_np.3:38
202 #: build/C/man3/pthread_getcpuclockid.3:38 build/C/man3/pthread_join.3:37
203 #: build/C/man3/pthread_kill.3:49
204 #: build/C/man3/pthread_kill_other_threads_np.3:35
205 #: build/C/man3/pthread_self.3:37 build/C/man3/pthread_setaffinity_np.3:42
206 #: build/C/man3/pthread_setcancelstate.3:39
207 #: build/C/man3/pthread_setconcurrency.3:38
208 #: build/C/man3/pthread_setname_np.3:39
209 #: build/C/man3/pthread_setschedparam.3:41
210 #: build/C/man3/pthread_setschedprio.3:37 build/C/man3/pthread_sigmask.3:50
211 #: build/C/man3/pthread_sigqueue.3:45 build/C/man3/pthread_testcancel.3:37
212 #: build/C/man3/pthread_tryjoin_np.3:42 build/C/man3/pthread_yield.3:37
213 #: build/C/man7/pthreads.7:29
214 #, no-wrap
215 msgid "DESCRIPTION"
216 msgstr "説明"
217
218 #. type: Plain text
219 #: build/C/man3/getcontext.3:49
220 msgid ""
221 "In a System V-like environment, one has the two types I<mcontext_t> and "
222 "I<ucontext_t> defined in I<E<lt>ucontext.hE<gt>> and the four functions "
223 "B<getcontext>(), B<setcontext>(), B<makecontext>(3)  and B<swapcontext>(3)  "
224 "that allow user-level context switching between multiple threads of control "
225 "within a process."
226 msgstr ""
227 "System V 的な環境では、 I<mcontext_t> および I<ucontext_t> という 2 つの型"
228 "と、 B<getcontext>(), B<setcontext>(), B<makecontext>(3), B<swapcontext>(3)  "
229 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
230 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
231 "ようになっている。"
232
233 #. type: Plain text
234 #: build/C/man3/getcontext.3:57
235 msgid ""
236 "The I<mcontext_t> type is machine-dependent and opaque.  The I<ucontext_t> "
237 "type is a structure that has at least the following fields:"
238 msgstr ""
239 "I<mcontext_t> 型はマシン依存で、外部からは隠蔽されている。 I<ucontext_t> 型は"
240 "構造体で、少なくとも以下の 4 つのフィールドを持つ。"
241
242 #. type: Plain text
243 #: build/C/man3/getcontext.3:67
244 #, no-wrap
245 msgid ""
246 "typedef struct ucontext {\n"
247 "    struct ucontext *uc_link;\n"
248 "    sigset_t         uc_sigmask;\n"
249 "    stack_t          uc_stack;\n"
250 "    mcontext_t       uc_mcontext;\n"
251 "    ...\n"
252 "} ucontext_t;\n"
253 msgstr ""
254 "typedef struct ucontext {\n"
255 "    struct ucontext *uc_link;\n"
256 "    sigset_t         uc_sigmask;\n"
257 "    stack_t          uc_stack;\n"
258 "    mcontext_t       uc_mcontext;\n"
259 "    ...\n"
260 "} ucontext_t;\n"
261
262 #. type: Plain text
263 #: build/C/man3/getcontext.3:94
264 msgid ""
265 "with I<sigset_t> and I<stack_t> defined in I<E<lt>signal.hE<gt>>.  Here "
266 "I<uc_link> points to the context that will be resumed when the current "
267 "context terminates (in case the current context was created using "
268 "B<makecontext>(3)), I<uc_sigmask> is the set of signals blocked in this "
269 "context (see B<sigprocmask>(2)), I<uc_stack> is the stack used by this "
270 "context (see B<sigaltstack>(2)), and I<uc_mcontext> is the machine-specific "
271 "representation of the saved context, that includes the calling thread's "
272 "machine registers."
273 msgstr ""
274 "I<sigset_t> と I<stack_t> は I<E<lt>signal.hE<gt>> で定義されている。 ここで "
275 "I<uc_link> は、 現在のコンテキストが終了したとき、 続いて切り替わるコンテキス"
276 "トへのポインタである (現在のコンテキストが B<makecontext>(3)  で生成されたも"
277 "のの場合)。 I<uc_sigmask> はこのコンテキストでブロックされている シグナル群で"
278 "ある (B<sigprocmask>(2)  を見よ)。 I<uc_stack> はこのコンテキストが用いている"
279 "スタックである (B<signalstack>(2)  を見よ)。 I<uc_mcontext> は保存されている"
280 "コンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマシ"
281 "ンレジスタが格納される。"
282
283 #. type: Plain text
284 #: build/C/man3/getcontext.3:101
285 msgid ""
286 "The function B<getcontext>()  initializes the structure pointed at by I<ucp> "
287 "to the currently active context."
288 msgstr ""
289 "B<getcontext>()  関数は、 ポインタ I<ucp> が指す構造体を、 現在アクティブなコ"
290 "ンテキストに初期化する。"
291
292 #. type: Plain text
293 #: build/C/man3/getcontext.3:114
294 msgid ""
295 "The function B<setcontext>()  restores the user context pointed at by "
296 "I<ucp>.  A successful call does not return.  The context should have been "
297 "obtained by a call of B<getcontext>(), or B<makecontext>(3), or passed as "
298 "third argument to a signal handler."
299 msgstr ""
300 "B<setcontext>()  関数は、ポインタ I<ucp> が指すユーザコンテキストをリストアす"
301 "る。 呼び出しに成功すると返らない。 このコンテキストは、以前に "
302 "B<getcontext>()  または B<makecontext>(3)  で得られたものか、 あるいはシグナ"
303 "ルの第三引数として与えられたものになる。"
304
305 #. type: Plain text
306 #: build/C/man3/getcontext.3:118
307 msgid ""
308 "If the context was obtained by a call of B<getcontext>(), program execution "
309 "continues as if this call just returned."
310 msgstr ""
311 "コンテキストが B<getcontext>()  の呼び出しによって得られていたものの場合は、 "
312 "プログラムはこの呼び出しから返った直後からのように実行を継続する。"
313
314 #. type: Plain text
315 #: build/C/man3/getcontext.3:135
316 msgid ""
317 "If the context was obtained by a call of B<makecontext>(3), program "
318 "execution continues by a call to the function I<func> specified as the "
319 "second argument of that call to B<makecontext>(3).  When the function "
320 "I<func> returns, we continue with the I<uc_link> member of the structure "
321 "I<ucp> specified as the first argument of that call to B<makecontext>(3).  "
322 "When this member is NULL, the thread exits."
323 msgstr ""
324 "コンテキストが B<makecontext>(3)  の呼び出しによって得られていたものの場合"
325 "は、 プログラムの実行はその B<makecontext>(3)  呼び出しの第二引数で指定された"
326 "関数 I<func> を呼び出すかたちで継続する。 I<func> から返ると、 "
327 "B<makecontext>(3)  呼び出しの第一引数で指定されていた I<ucp> 構造体の "
328 "I<uc_link> メンバで継続する。 このメンバが NULL だった場合は、そのスレッドは"
329 "終了する。"
330
331 #. type: Plain text
332 #: build/C/man3/getcontext.3:142
333 msgid ""
334 "If the context was obtained by a call to a signal handler, then old standard "
335 "text says that \"program execution continues with the program instruction "
336 "following the instruction interrupted by the signal\".  However, this "
337 "sentence was removed in SUSv2, and the present verdict is \"the result is "
338 "unspecified\"."
339 msgstr ""
340 "コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 古"
341 "い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命令"
342 "から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結果"
343 "は定義されていない」である。"
344
345 #. type: SH
346 #: build/C/man3/getcontext.3:142 build/C/man3/makecontext.3:84
347 #: build/C/man3/pthread_attr_init.3:68
348 #: build/C/man3/pthread_attr_setaffinity_np.3:76
349 #: build/C/man3/pthread_attr_setdetachstate.3:77
350 #: build/C/man3/pthread_attr_setguardsize.3:90
351 #: build/C/man3/pthread_attr_setinheritsched.3:93
352 #: build/C/man3/pthread_attr_setschedparam.3:85
353 #: build/C/man3/pthread_attr_setschedpolicy.3:83
354 #: build/C/man3/pthread_attr_setscope.3:103
355 #: build/C/man3/pthread_attr_setstack.3:85
356 #: build/C/man3/pthread_attr_setstackaddr.3:74
357 #: build/C/man3/pthread_attr_setstacksize.3:61
358 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_cleanup_push.3:121
359 #: build/C/man3/pthread_create.3:115 build/C/man3/pthread_detach.3:49
360 #: build/C/man3/pthread_equal.3:41 build/C/man3/pthread_exit.3:71
361 #: build/C/man3/pthread_getattr_np.3:73
362 #: build/C/man3/pthread_getcpuclockid.3:46 build/C/man3/pthread_join.3:70
363 #: build/C/man3/pthread_kill.3:63 build/C/man3/pthread_self.3:46
364 #: build/C/man3/pthread_setaffinity_np.3:77
365 #: build/C/man3/pthread_setcancelstate.3:92
366 #: build/C/man3/pthread_setconcurrency.3:56
367 #: build/C/man3/pthread_setname_np.3:72
368 #: build/C/man3/pthread_setschedparam.3:104
369 #: build/C/man3/pthread_setschedprio.3:53 build/C/man3/pthread_sigmask.3:61
370 #: build/C/man3/pthread_sigqueue.3:65 build/C/man3/pthread_testcancel.3:50
371 #: build/C/man3/pthread_tryjoin_np.3:85 build/C/man3/pthread_yield.3:44
372 #, no-wrap
373 msgid "RETURN VALUE"
374 msgstr "返り値"
375
376 #. type: Plain text
377 #: build/C/man3/getcontext.3:151
378 msgid ""
379 "When successful, B<getcontext>()  returns 0 and B<setcontext>()  does not "
380 "return.  On error, both return -1 and set I<errno> appropriately."
381 msgstr ""
382 "成功すると、 B<getcontext>()  は 0 を返し、 B<setcontext>()  は返らない。 失"
383 "敗すると、両者とも -1 を返し、I<errno> をエラーに応じて設定する。"
384
385 #. type: SH
386 #: build/C/man3/getcontext.3:151 build/C/man3/makecontext.3:96
387 #: build/C/man3/pthread_attr_init.3:71
388 #: build/C/man3/pthread_attr_setaffinity_np.3:79
389 #: build/C/man3/pthread_attr_setdetachstate.3:80
390 #: build/C/man3/pthread_attr_setguardsize.3:93
391 #: build/C/man3/pthread_attr_setinheritsched.3:96
392 #: build/C/man3/pthread_attr_setschedparam.3:88
393 #: build/C/man3/pthread_attr_setschedpolicy.3:86
394 #: build/C/man3/pthread_attr_setscope.3:106
395 #: build/C/man3/pthread_attr_setstack.3:88
396 #: build/C/man3/pthread_attr_setstackaddr.3:77
397 #: build/C/man3/pthread_attr_setstacksize.3:64
398 #: build/C/man3/pthread_cancel.3:117 build/C/man3/pthread_cleanup_push.3:123
399 #: build/C/man3/pthread_create.3:122 build/C/man3/pthread_detach.3:54
400 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
401 #: build/C/man3/pthread_getattr_np.3:76
402 #: build/C/man3/pthread_getcpuclockid.3:49 build/C/man3/pthread_join.3:75
403 #: build/C/man3/pthread_kill.3:68 build/C/man3/pthread_self.3:48
404 #: build/C/man3/pthread_setaffinity_np.3:80
405 #: build/C/man3/pthread_setcancelstate.3:95
406 #: build/C/man3/pthread_setconcurrency.3:68
407 #: build/C/man3/pthread_setname_np.3:75
408 #: build/C/man3/pthread_setschedparam.3:112
409 #: build/C/man3/pthread_setschedprio.3:61 build/C/man3/pthread_sigmask.3:66
410 #: build/C/man3/pthread_sigqueue.3:70 build/C/man3/pthread_testcancel.3:54
411 #: build/C/man3/pthread_tryjoin_np.3:89 build/C/man3/pthread_yield.3:49
412 #, no-wrap
413 msgid "ERRORS"
414 msgstr "エラー"
415
416 #. type: Plain text
417 #: build/C/man3/getcontext.3:153
418 msgid "None defined."
419 msgstr "定義されていない。"
420
421 #. type: SH
422 #: build/C/man3/getcontext.3:153 build/C/man3/makecontext.3:105
423 #: build/C/man3/pthread_attr_setdetachstate.3:87
424 #: build/C/man3/pthread_attr_setguardsize.3:106
425 #: build/C/man3/pthread_attr_setinheritsched.3:110
426 #: build/C/man3/pthread_attr_setschedparam.3:100
427 #: build/C/man3/pthread_attr_setschedpolicy.3:100
428 #: build/C/man3/pthread_attr_setscope.3:119
429 #: build/C/man3/pthread_attr_setstack.3:112
430 #: build/C/man3/pthread_attr_setstackaddr.3:83
431 #: build/C/man3/pthread_attr_setstacksize.3:83 build/C/man3/pthread_kill.3:72
432 #: build/C/man3/pthread_kill_other_threads_np.3:47
433 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_setcancelstate.3:113
434 #: build/C/man3/pthread_setschedparam.3:141
435 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:69
436 #: build/C/man3/pthread_sigqueue.3:93 build/C/man3/pthread_testcancel.3:58
437 #: build/C/man3/pthread_yield.3:53
438 #, no-wrap
439 msgid "ATTRIBUTES"
440 msgstr "属性"
441
442 #. type: SS
443 #: build/C/man3/getcontext.3:154 build/C/man3/makecontext.3:106
444 #: build/C/man3/pthread_attr_setdetachstate.3:88
445 #: build/C/man3/pthread_attr_setguardsize.3:107
446 #: build/C/man3/pthread_attr_setinheritsched.3:111
447 #: build/C/man3/pthread_attr_setschedparam.3:101
448 #: build/C/man3/pthread_attr_setschedpolicy.3:101
449 #: build/C/man3/pthread_attr_setscope.3:120
450 #: build/C/man3/pthread_attr_setstack.3:113
451 #: build/C/man3/pthread_attr_setstackaddr.3:84
452 #: build/C/man3/pthread_attr_setstacksize.3:84 build/C/man3/pthread_kill.3:73
453 #: build/C/man3/pthread_kill_other_threads_np.3:48
454 #: build/C/man3/pthread_self.3:51 build/C/man3/pthread_setcancelstate.3:114
455 #: build/C/man3/pthread_setschedparam.3:142
456 #: build/C/man3/pthread_setschedprio.3:84 build/C/man3/pthread_sigmask.3:70
457 #: build/C/man3/pthread_sigqueue.3:94 build/C/man3/pthread_testcancel.3:59
458 #: build/C/man3/pthread_yield.3:54
459 #, no-wrap
460 msgid "Multithreading (see pthreads(7))"
461 msgstr "マルチスレッディング (pthreads(7) 参照)"
462
463 #. type: Plain text
464 #: build/C/man3/getcontext.3:160
465 msgid "The B<getcontext>()  and B<setcontext>()  functions are thread-safe."
466 msgstr "関数 B<getcontext>() と B<setcontext>() はスレッドセーフである。"
467
468 #. type: SH
469 #: build/C/man3/getcontext.3:160 build/C/man3/makecontext.3:112
470 #: build/C/man3/pthread_attr_init.3:79
471 #: build/C/man3/pthread_attr_setaffinity_np.3:108
472 #: build/C/man3/pthread_attr_setdetachstate.3:94
473 #: build/C/man3/pthread_attr_setguardsize.3:113
474 #: build/C/man3/pthread_attr_setinheritsched.3:117
475 #: build/C/man3/pthread_attr_setschedparam.3:107
476 #: build/C/man3/pthread_attr_setschedpolicy.3:107
477 #: build/C/man3/pthread_attr_setscope.3:126
478 #: build/C/man3/pthread_attr_setstack.3:119
479 #: build/C/man3/pthread_attr_setstackaddr.3:90
480 #: build/C/man3/pthread_attr_setstacksize.3:90
481 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_cleanup_push.3:127
482 #: build/C/man3/pthread_cleanup_push_defer_np.3:101
483 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
484 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
485 #: build/C/man3/pthread_getattr_np.3:98
486 #: build/C/man3/pthread_getcpuclockid.3:65 build/C/man3/pthread_join.3:98
487 #: build/C/man3/pthread_kill.3:77
488 #: build/C/man3/pthread_kill_other_threads_np.3:52
489 #: build/C/man3/pthread_self.3:55 build/C/man3/pthread_setaffinity_np.3:121
490 #: build/C/man3/pthread_setcancelstate.3:120
491 #: build/C/man3/pthread_setconcurrency.3:83
492 #: build/C/man3/pthread_setname_np.3:102
493 #: build/C/man3/pthread_setschedparam.3:148
494 #: build/C/man3/pthread_setschedprio.3:88 build/C/man3/pthread_sigmask.3:74
495 #: build/C/man3/pthread_sigqueue.3:98 build/C/man3/pthread_testcancel.3:63
496 #: build/C/man3/pthread_tryjoin_np.3:112 build/C/man3/pthread_yield.3:58
497 #, no-wrap
498 msgid "CONFORMING TO"
499 msgstr "準拠"
500
501 #. type: Plain text
502 #: build/C/man3/getcontext.3:166
503 msgid ""
504 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specification of "
505 "B<getcontext>(), citing portability issues, and recommending that "
506 "applications be rewritten to use POSIX threads instead."
507 msgstr ""
508 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<getcontext>()  の"
509 "仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直"
510 "すことが 推奨されている。"
511
512 #. type: SH
513 #: build/C/man3/getcontext.3:166 build/C/man3/makecontext.3:120
514 #: build/C/man3/pthread_attr_init.3:81
515 #: build/C/man3/pthread_attr_setaffinity_np.3:111
516 #: build/C/man3/pthread_attr_setdetachstate.3:96
517 #: build/C/man3/pthread_attr_setguardsize.3:115
518 #: build/C/man3/pthread_attr_setschedparam.3:109
519 #: build/C/man3/pthread_attr_setscope.3:128
520 #: build/C/man3/pthread_attr_setstack.3:121
521 #: build/C/man3/pthread_attr_setstackaddr.3:93
522 #: build/C/man3/pthread_attr_setstacksize.3:92
523 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129
524 #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_detach.3:66
525 #: build/C/man3/pthread_equal.3:49 build/C/man3/pthread_exit.3:77
526 #: build/C/man3/pthread_getcpuclockid.3:67 build/C/man3/pthread_join.3:100
527 #: build/C/man3/pthread_kill.3:79
528 #: build/C/man3/pthread_kill_other_threads_np.3:55
529 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setaffinity_np.3:124
530 #: build/C/man3/pthread_setcancelstate.3:122
531 #: build/C/man3/pthread_setconcurrency.3:85
532 #: build/C/man3/pthread_setname_np.3:104
533 #: build/C/man3/pthread_setschedparam.3:150
534 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
535 #: build/C/man3/pthread_yield.3:64
536 #, no-wrap
537 msgid "NOTES"
538 msgstr "注意"
539
540 #. type: Plain text
541 #: build/C/man3/getcontext.3:183
542 msgid ""
543 "The earliest incarnation of this mechanism was the B<setjmp>(3)/"
544 "B<longjmp>(3)  mechanism.  Since that does not define the handling of the "
545 "signal context, the next stage was the B<sigsetjmp>(3)/B<siglongjmp>(3)  "
546 "pair.  The present mechanism gives much more control.  On the other hand, "
547 "there is no easy way to detect whether a return from B<getcontext>()  is "
548 "from the first call, or via a B<setcontext>()  call.  The user has to invent "
549 "her own bookkeeping device, and a register variable won't do since registers "
550 "are restored."
551 msgstr ""
552 "このメカニズムの最古の実装は、 B<setjmp>(3)/B<longjmp>(3)  機構であった。 こ"
553 "れらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階で"
554 "は B<sigsetjmp>(3)/B<siglongjmp>(3)  のペアが現われた。 現在の機構ではずっと"
555 "細かな制御ができる。 一方 B<getcontext>()  から返ったとき、 これが最初の呼び"
556 "出しであったか、 それとも B<setcontext>()  呼び出しからのものであるかを 区別"
557 "する容易な方法がなくなってしまった。 ユーザは「しおり」機構を自分で作らなけれ"
558 "ばならない。 レジスタ変数は (レジスタはリストアされてしまうので) これをやって"
559 "くれない。"
560
561 #. type: Plain text
562 #: build/C/man3/getcontext.3:194
563 msgid ""
564 "When a signal occurs, the current user context is saved and a new context is "
565 "created by the kernel for the signal handler.  Do not leave the handler "
566 "using B<longjmp>(3): it is undefined what would happen with contexts.  Use "
567 "B<siglongjmp>(3)  or B<setcontext>()  instead."
568 msgstr ""
569 "シグナルが発生すると、 現在のユーザコンテキストは保存され、 シグナルハンドラ"
570 "用のコンテキストがカーネルによって生成される。 今後はハンドラに "
571 "B<longjmp>(3)  を使わせないこと: この関数のコンテキスト下での動作は定義されて"
572 "いない。 代わりに B<siglongjmp>(3)  か B<setcontext>()  を使うこと。"
573
574 #. type: SH
575 #: build/C/man3/getcontext.3:194 build/C/man3/makecontext.3:227
576 #: build/C/man3/pthread_attr_init.3:297
577 #: build/C/man3/pthread_attr_setaffinity_np.3:118
578 #: build/C/man3/pthread_attr_setdetachstate.3:118
579 #: build/C/man3/pthread_attr_setguardsize.3:165
580 #: build/C/man3/pthread_attr_setinheritsched.3:138
581 #: build/C/man3/pthread_attr_setschedparam.3:116
582 #: build/C/man3/pthread_attr_setschedpolicy.3:112
583 #: build/C/man3/pthread_attr_setscope.3:139
584 #: build/C/man3/pthread_attr_setstack.3:162
585 #: build/C/man3/pthread_attr_setstackaddr.3:117
586 #: build/C/man3/pthread_attr_setstacksize.3:118
587 #: build/C/man3/pthread_cancel.3:226 build/C/man3/pthread_cleanup_push.3:315
588 #: build/C/man3/pthread_cleanup_push_defer_np.3:104
589 #: build/C/man3/pthread_create.3:369 build/C/man3/pthread_detach.3:97
590 #: build/C/man3/pthread_equal.3:56 build/C/man3/pthread_exit.3:105
591 #: build/C/man3/pthread_getattr_np.3:345
592 #: build/C/man3/pthread_getcpuclockid.3:170 build/C/man3/pthread_join.3:127
593 #: build/C/man3/pthread_kill.3:99
594 #: build/C/man3/pthread_kill_other_threads_np.3:71
595 #: build/C/man3/pthread_self.3:81 build/C/man3/pthread_setaffinity_np.3:206
596 #: build/C/man3/pthread_setcancelstate.3:186
597 #: build/C/man3/pthread_setconcurrency.3:100
598 #: build/C/man3/pthread_setname_np.3:200
599 #: build/C/man3/pthread_setschedparam.3:438
600 #: build/C/man3/pthread_setschedprio.3:96 build/C/man3/pthread_sigmask.3:152
601 #: build/C/man3/pthread_sigqueue.3:100 build/C/man3/pthread_testcancel.3:68
602 #: build/C/man3/pthread_tryjoin_np.3:135 build/C/man3/pthread_yield.3:67
603 #: build/C/man7/pthreads.7:893
604 #, no-wrap
605 msgid "SEE ALSO"
606 msgstr "関連項目"
607
608 #. type: Plain text
609 #: build/C/man3/getcontext.3:201
610 msgid ""
611 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
612 "B<makecontext>(3), B<sigsetjmp>(3)"
613 msgstr ""
614 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
615 "B<makecontext>(3), B<sigsetjmp>(3)"
616
617 #. type: SH
618 #: build/C/man3/getcontext.3:201 build/C/man3/makecontext.3:233
619 #: build/C/man3/pthread_attr_init.3:313
620 #: build/C/man3/pthread_attr_setaffinity_np.3:124
621 #: build/C/man3/pthread_attr_setdetachstate.3:124
622 #: build/C/man3/pthread_attr_setguardsize.3:173
623 #: build/C/man3/pthread_attr_setinheritsched.3:150
624 #: build/C/man3/pthread_attr_setschedparam.3:128
625 #: build/C/man3/pthread_attr_setschedpolicy.3:123
626 #: build/C/man3/pthread_attr_setscope.3:149
627 #: build/C/man3/pthread_attr_setstack.3:174
628 #: build/C/man3/pthread_attr_setstackaddr.3:123
629 #: build/C/man3/pthread_attr_setstacksize.3:125
630 #: build/C/man3/pthread_cancel.3:238 build/C/man3/pthread_cleanup_push.3:321
631 #: build/C/man3/pthread_cleanup_push_defer_np.3:110
632 #: build/C/man3/pthread_create.3:382 build/C/man3/pthread_detach.3:104
633 #: build/C/man3/pthread_equal.3:60 build/C/man3/pthread_exit.3:109
634 #: build/C/man3/pthread_getattr_np.3:361
635 #: build/C/man3/pthread_getcpuclockid.3:178 build/C/man3/pthread_join.3:134
636 #: build/C/man3/pthread_kill.3:108
637 #: build/C/man3/pthread_kill_other_threads_np.3:77
638 #: build/C/man3/pthread_self.3:85 build/C/man3/pthread_setaffinity_np.3:214
639 #: build/C/man3/pthread_setcancelstate.3:191
640 #: build/C/man3/pthread_setconcurrency.3:103
641 #: build/C/man3/pthread_setname_np.3:206
642 #: build/C/man3/pthread_setschedparam.3:452
643 #: build/C/man3/pthread_setschedprio.3:110 build/C/man3/pthread_sigmask.3:161
644 #: build/C/man3/pthread_sigqueue.3:108 build/C/man3/pthread_testcancel.3:73
645 #: build/C/man3/pthread_tryjoin_np.3:140 build/C/man3/pthread_yield.3:71
646 #: build/C/man7/pthreads.7:927
647 #, no-wrap
648 msgid "COLOPHON"
649 msgstr "この文書について"
650
651 #. type: Plain text
652 #: build/C/man3/getcontext.3:209 build/C/man3/makecontext.3:241
653 #: build/C/man3/pthread_attr_init.3:321
654 #: build/C/man3/pthread_attr_setaffinity_np.3:132
655 #: build/C/man3/pthread_attr_setdetachstate.3:132
656 #: build/C/man3/pthread_attr_setguardsize.3:181
657 #: build/C/man3/pthread_attr_setinheritsched.3:158
658 #: build/C/man3/pthread_attr_setschedparam.3:136
659 #: build/C/man3/pthread_attr_setschedpolicy.3:131
660 #: build/C/man3/pthread_attr_setscope.3:157
661 #: build/C/man3/pthread_attr_setstack.3:182
662 #: build/C/man3/pthread_attr_setstackaddr.3:131
663 #: build/C/man3/pthread_attr_setstacksize.3:133
664 #: build/C/man3/pthread_cancel.3:246 build/C/man3/pthread_cleanup_push.3:329
665 #: build/C/man3/pthread_cleanup_push_defer_np.3:118
666 #: build/C/man3/pthread_create.3:390 build/C/man3/pthread_detach.3:112
667 #: build/C/man3/pthread_equal.3:68 build/C/man3/pthread_exit.3:117
668 #: build/C/man3/pthread_getattr_np.3:369
669 #: build/C/man3/pthread_getcpuclockid.3:186 build/C/man3/pthread_join.3:142
670 #: build/C/man3/pthread_kill.3:116
671 #: build/C/man3/pthread_kill_other_threads_np.3:85
672 #: build/C/man3/pthread_self.3:93 build/C/man3/pthread_setaffinity_np.3:222
673 #: build/C/man3/pthread_setcancelstate.3:199
674 #: build/C/man3/pthread_setconcurrency.3:111
675 #: build/C/man3/pthread_setname_np.3:214
676 #: build/C/man3/pthread_setschedparam.3:460
677 #: build/C/man3/pthread_setschedprio.3:118 build/C/man3/pthread_sigmask.3:169
678 #: build/C/man3/pthread_sigqueue.3:116 build/C/man3/pthread_testcancel.3:81
679 #: build/C/man3/pthread_tryjoin_np.3:148 build/C/man3/pthread_yield.3:79
680 #: build/C/man7/pthreads.7:935
681 msgid ""
682 "This page is part of release 3.67 of the Linux I<man-pages> project.  A "
683 "description of the project, information about reporting bugs, and the latest "
684 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
685 "pages/."
686 msgstr ""
687 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.67 の一部\n"
688 "である。プロジェクトの説明とバグ報告に関する情報は\n"
689 "http://www.kernel.org/doc/man-pages/ に書かれている。"
690
691 #. type: TH
692 #: build/C/man3/makecontext.3:28
693 #, no-wrap
694 msgid "MAKECONTEXT"
695 msgstr "MAKECONTEXT"
696
697 #. type: TH
698 #: build/C/man3/makecontext.3:28 build/C/man3/pthread_attr_setdetachstate.3:26
699 #: build/C/man3/pthread_attr_setguardsize.3:26
700 #, no-wrap
701 msgid "2014-04-14"
702 msgstr "2014-04-14"
703
704 #. type: TH
705 #: build/C/man3/makecontext.3:28
706 #, no-wrap
707 msgid "GNU"
708 msgstr "GNU"
709
710 #. type: Plain text
711 #: build/C/man3/makecontext.3:31
712 msgid "makecontext, swapcontext - manipulate user context"
713 msgstr "makecontext, swapcontext - ユーザコンテキストを操作する"
714
715 #. type: Plain text
716 #: build/C/man3/makecontext.3:36
717 msgid ""
718 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
719 ">I<argc>B<, ...);>"
720 msgstr ""
721 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
722 ">I<argc>B<, ...);>"
723
724 #. type: Plain text
725 #: build/C/man3/makecontext.3:38
726 msgid "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
727 msgstr "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
728
729 #. type: Plain text
730 #: build/C/man3/makecontext.3:49
731 msgid ""
732 "In a System V-like environment, one has the type I<ucontext_t> defined in "
733 "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(3), "
734 "B<setcontext>(3), B<makecontext>()  and B<swapcontext>()  that allow user-"
735 "level context switching between multiple threads of control within a process."
736 msgstr ""
737 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
738 "と、 B<getcontext>(3), B<setcontext>(3), B<makecontext>(), B<swapcontext>()  "
739 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
740 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
741 "ようになっている。"
742
743 #. type: Plain text
744 #: build/C/man3/makecontext.3:52
745 msgid "For the type and the first two functions, see B<getcontext>(3)."
746 msgstr ""
747 "これらの型と、最初の 2 つの関数については、 B<getcontext>(3) を参照のこと。"
748
749 #. type: Plain text
750 #: build/C/man3/makecontext.3:64
751 msgid ""
752 "The B<makecontext>()  function modifies the context pointed to by I<ucp> "
753 "(which was obtained from a call to B<getcontext>(3)).  Before invoking "
754 "B<makecontext>(), the caller must allocate a new stack for this context and "
755 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
756 "and assign its address to I<ucp-E<gt>uc_link>."
757 msgstr ""
758 "B<makecontext>()  関数は、ポインタ I<ucp> が指すコンテキストを変更する "
759 "(I<ucp> は以前の B<getcontext>(3)  呼び出しで得られたものである)。 "
760 "B<makecontext>()  を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
761 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
762 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
763 "らない。"
764
765 #. type: Plain text
766 #: build/C/man3/makecontext.3:78
767 msgid ""
768 "When this context is later activated (using B<setcontext>(3)  or "
769 "B<swapcontext>())  the function I<func> is called, and passed the series of "
770 "integer (I<int>)  arguments that follow I<argc>; the caller must specify the "
771 "number of these arguments in I<argc>.  When this function returns, the "
772 "successor context is activated.  If the successor context pointer is NULL, "
773 "the thread exits."
774 msgstr ""
775 "このコンテキストが将来 (B<setcontext>(3)  または B<swapcontext>()  によっ"
776 "て)  有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 "
777 "(I<int>)  引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数"
778 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
779 "る。 後継コンテキストのポインタが NULL の場合、そのスレッドが終了する。"
780
781 #. type: Plain text
782 #: build/C/man3/makecontext.3:84
783 msgid ""
784 "The B<swapcontext>()  function saves the current context in the structure "
785 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
786 msgstr ""
787 "B<swapcontext>()  関数は現在のコンテキストを ポインタ I<oucp> が指す構造体に"
788 "保存し、 ポインタ I<ucp> が指すコンテキストを有効にする。"
789
790 #. type: Plain text
791 #: build/C/man3/makecontext.3:96
792 msgid ""
793 "When successful, B<swapcontext>()  does not return.  (But we may return "
794 "later, in case I<oucp> is activated, in which case it looks like "
795 "B<swapcontext>()  returns 0.)  On error, B<swapcontext>()  returns -1 and "
796 "sets I<errno> appropriately."
797 msgstr ""
798 "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった"
799 "場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見え"
800 "る。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じ"
801 "て設定する。"
802
803 #. type: TP
804 #: build/C/man3/makecontext.3:97
805 #: build/C/man3/pthread_attr_setaffinity_np.3:102
806 #: build/C/man3/pthread_getattr_np.3:77
807 #, no-wrap
808 msgid "B<ENOMEM>"
809 msgstr "B<ENOMEM>"
810
811 #. type: Plain text
812 #: build/C/man3/makecontext.3:100
813 msgid "Insufficient stack space left."
814 msgstr "スタックに割り当てる空間が残っていない。"
815
816 #. type: SH
817 #: build/C/man3/makecontext.3:100
818 #: build/C/man3/pthread_attr_setaffinity_np.3:106
819 #: build/C/man3/pthread_attr_setguardsize.3:104
820 #: build/C/man3/pthread_attr_setstack.3:110
821 #: build/C/man3/pthread_attr_setstackaddr.3:81
822 #: build/C/man3/pthread_attr_setstacksize.3:81
823 #: build/C/man3/pthread_getattr_np.3:96
824 #: build/C/man3/pthread_getcpuclockid.3:63
825 #: build/C/man3/pthread_setaffinity_np.3:119
826 #: build/C/man3/pthread_setconcurrency.3:81
827 #: build/C/man3/pthread_setname_np.3:100
828 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigqueue.3:89
829 #: build/C/man3/pthread_tryjoin_np.3:110
830 #, no-wrap
831 msgid "VERSIONS"
832 msgstr "バージョン"
833
834 #. type: Plain text
835 #: build/C/man3/makecontext.3:105
836 msgid ""
837 "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version "
838 "2.1."
839 msgstr ""
840 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
841 "されている。"
842
843 #. type: Plain text
844 #: build/C/man3/makecontext.3:112
845 msgid "The B<makecontext>()  and B<swapcontext>()  functions are thread-safe."
846 msgstr "関数 B<makecontext>() と B<swapcontext>() はスレッドセーフである。"
847
848 #. type: Plain text
849 #: build/C/man3/makecontext.3:120
850 msgid ""
851 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specifications of "
852 "B<makecontext>()  and B<swapcontext>(), citing portability issues, and "
853 "recommending that applications be rewritten to use POSIX threads instead."
854 msgstr ""
855 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  "
856 "と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを "
857 "POSIX スレッドを使って書き直すことが 推奨されている。"
858
859 #. type: Plain text
860 #: build/C/man3/makecontext.3:128
861 msgid ""
862 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
863 "namely, this struct contains the start and length of a memory area to be "
864 "used as the stack, regardless of the direction of growth of the stack.  "
865 "Thus, it is not necessary for the user program to worry about this direction."
866 msgstr ""
867 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわ"
868 "ちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含"
869 "まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
870 "て、ユーザプログラムはこの件については心配しなくてよい。"
871
872 #. type: Plain text
873 #: build/C/man3/makecontext.3:144
874 msgid ""
875 "On architectures where I<int> and pointer types are the same size (e.g., "
876 "x86-32, where both types are 32 bits), you may be able to get away with "
877 "passing pointers as arguments to B<makecontext>()  following I<argc>.  "
878 "However, doing this is not guaranteed to be portable, is undefined according "
879 "to the standards, and won't work on architectures where pointers are larger "
880 "than I<int>s.  Nevertheless, starting with version 2.8, glibc makes some "
881 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
882 "g., x86-64)."
883 msgstr ""
884 "I<int> とポインタ型が同じ大きさであるアーキテクチャでは (x86-32 はその例であ"
885 "り、両方の型とも 32 ビットである)、 B<makecontext>()  の I<argc> 以降の引き数"
886 "としてポインタを渡してもうまく動くかもしれない。 しかしながら、このようにする"
887 "と、移植性は保証されず、 標準に従えば動作は未定義であり、ポインタが I<int> よ"
888 "りも大きいアーキテクチャでは正しく動作しないことだろう。 それにも関わらず、"
889 "バージョン 2.8 以降の glibc では、 B<makecontext>()  に変更が行われ、(x86-64 "
890 "などの) いくつかの 64 ビットアーキテクチャで 引き数としてポインタを渡すことが"
891 "できるようになっている。"
892
893 #. type: SH
894 #: build/C/man3/makecontext.3:144 build/C/man3/pthread_attr_init.3:87
895 #: build/C/man3/pthread_attr_setdetachstate.3:115
896 #: build/C/man3/pthread_attr_setguardsize.3:162
897 #: build/C/man3/pthread_attr_setinheritsched.3:135
898 #: build/C/man3/pthread_attr_setschedparam.3:113
899 #: build/C/man3/pthread_attr_setschedpolicy.3:109
900 #: build/C/man3/pthread_attr_setstack.3:159
901 #: build/C/man3/pthread_attr_setstacksize.3:115
902 #: build/C/man3/pthread_cancel.3:135 build/C/man3/pthread_cleanup_push.3:155
903 #: build/C/man3/pthread_create.3:202 build/C/man3/pthread_detach.3:93
904 #: build/C/man3/pthread_getattr_np.3:101
905 #: build/C/man3/pthread_getcpuclockid.3:78 build/C/man3/pthread_join.3:124
906 #: build/C/man3/pthread_setaffinity_np.3:154
907 #: build/C/man3/pthread_setcancelstate.3:183
908 #: build/C/man3/pthread_setname_np.3:114
909 #: build/C/man3/pthread_setschedparam.3:156 build/C/man3/pthread_sigmask.3:78
910 #: build/C/man3/pthread_testcancel.3:65 build/C/man3/pthread_tryjoin_np.3:115
911 #, no-wrap
912 msgid "EXAMPLE"
913 msgstr "例"
914
915 #. type: Plain text
916 #: build/C/man3/makecontext.3:152
917 msgid ""
918 "The example program below demonstrates the use of B<getcontext>(3), "
919 "B<makecontext>(), and B<swapcontext>().  Running the program produces the "
920 "following output:"
921 msgstr ""
922 "以下のサンプル・プログラムは、 B<getcontext>(3), B<makecontext>(), "
923 "B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行する"
924 "と、以下のような出力が得られる:"
925
926 #. type: Plain text
927 #: build/C/man3/makecontext.3:164
928 #, no-wrap
929 msgid ""
930 "$B< ./a.out>\n"
931 "main: swapcontext(&uctx_main, &uctx_func2)\n"
932 "func2: started\n"
933 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
934 "func1: started\n"
935 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
936 "func2: returning\n"
937 "func1: returning\n"
938 "main: exiting\n"
939 msgstr ""
940 "$B< ./a.out>\n"
941 "main: swapcontext(&uctx_main, &uctx_func2)\n"
942 "func2: started\n"
943 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
944 "func1: started\n"
945 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
946 "func2: returning\n"
947 "func1: returning\n"
948 "main: exiting\n"
949
950 #. type: SS
951 #: build/C/man3/makecontext.3:166 build/C/man3/pthread_attr_init.3:148
952 #: build/C/man3/pthread_cancel.3:151 build/C/man3/pthread_cleanup_push.3:231
953 #: build/C/man3/pthread_create.3:241 build/C/man3/pthread_getattr_np.3:179
954 #: build/C/man3/pthread_getcpuclockid.3:96
955 #: build/C/man3/pthread_setname_np.3:140
956 #: build/C/man3/pthread_setschedparam.3:231 build/C/man3/pthread_sigmask.3:96
957 #, no-wrap
958 msgid "Program source"
959 msgstr "プログラムのソース"
960
961 #. type: Plain text
962 #: build/C/man3/makecontext.3:172
963 #, no-wrap
964 msgid ""
965 "#include E<lt>ucontext.hE<gt>\n"
966 "#include E<lt>stdio.hE<gt>\n"
967 "#include E<lt>stdlib.hE<gt>\n"
968 msgstr ""
969 "#include E<lt>ucontext.hE<gt>\n"
970 "#include E<lt>stdio.hE<gt>\n"
971 "#include E<lt>stdlib.hE<gt>\n"
972
973 #. type: Plain text
974 #: build/C/man3/makecontext.3:174
975 #, no-wrap
976 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
977 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
978
979 #. type: Plain text
980 #: build/C/man3/makecontext.3:177
981 #, no-wrap
982 msgid ""
983 "#define handle_error(msg) \\e\n"
984 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
985 msgstr ""
986 "#define handle_error(msg) \\e\n"
987 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
988
989 #. type: Plain text
990 #: build/C/man3/makecontext.3:187
991 #, no-wrap
992 msgid ""
993 "static void\n"
994 "func1(void)\n"
995 "{\n"
996 "    printf(\"func1: started\\en\");\n"
997 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
998 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
999 "        handle_error(\"swapcontext\");\n"
1000 "    printf(\"func1: returning\\en\");\n"
1001 "}\n"
1002 msgstr ""
1003 "static void\n"
1004 "func1(void)\n"
1005 "{\n"
1006 "    printf(\"func1: started\\en\");\n"
1007 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
1008 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
1009 "        handle_error(\"swapcontext\");\n"
1010 "    printf(\"func1: returning\\en\");\n"
1011 "}\n"
1012
1013 #. type: Plain text
1014 #: build/C/man3/makecontext.3:197
1015 #, no-wrap
1016 msgid ""
1017 "static void\n"
1018 "func2(void)\n"
1019 "{\n"
1020 "    printf(\"func2: started\\en\");\n"
1021 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1022 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1023 "        handle_error(\"swapcontext\");\n"
1024 "    printf(\"func2: returning\\en\");\n"
1025 "}\n"
1026 msgstr ""
1027 "static void\n"
1028 "func2(void)\n"
1029 "{\n"
1030 "    printf(\"func2: started\\en\");\n"
1031 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1032 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1033 "        handle_error(\"swapcontext\");\n"
1034 "    printf(\"func2: returning\\en\");\n"
1035 "}\n"
1036
1037 #. type: Plain text
1038 #: build/C/man3/makecontext.3:203
1039 #, no-wrap
1040 msgid ""
1041 "int\n"
1042 "main(int argc, char *argv[])\n"
1043 "{\n"
1044 "    char func1_stack[16384];\n"
1045 "    char func2_stack[16384];\n"
1046 msgstr ""
1047 "int\n"
1048 "main(int argc, char *argv[])\n"
1049 "{\n"
1050 "    char func1_stack[16384];\n"
1051 "    char func2_stack[16384];\n"
1052
1053 #. type: Plain text
1054 #: build/C/man3/makecontext.3:210
1055 #, no-wrap
1056 msgid ""
1057 "    if (getcontext(&uctx_func1) == -1)\n"
1058 "        handle_error(\"getcontext\");\n"
1059 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1060 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1061 "    uctx_func1.uc_link = &uctx_main;\n"
1062 "    makecontext(&uctx_func1, func1, 0);\n"
1063 msgstr ""
1064 "    if (getcontext(&uctx_func1) == -1)\n"
1065 "        handle_error(\"getcontext\");\n"
1066 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1067 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1068 "    uctx_func1.uc_link = &uctx_main;\n"
1069 "    makecontext(&uctx_func1, func1, 0);\n"
1070
1071 #. type: Plain text
1072 #: build/C/man3/makecontext.3:218
1073 #, no-wrap
1074 msgid ""
1075 "    if (getcontext(&uctx_func2) == -1)\n"
1076 "        handle_error(\"getcontext\");\n"
1077 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1078 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1079 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1080 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1081 "    makecontext(&uctx_func2, func2, 0);\n"
1082 msgstr ""
1083 "    if (getcontext(&uctx_func2) == -1)\n"
1084 "        handle_error(\"getcontext\");\n"
1085 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1086 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1087 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1088 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1089 "    makecontext(&uctx_func2, func2, 0);\n"
1090
1091 #. type: Plain text
1092 #: build/C/man3/makecontext.3:222
1093 #, no-wrap
1094 msgid ""
1095 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1096 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1097 "        handle_error(\"swapcontext\");\n"
1098 msgstr ""
1099 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1100 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1101 "        handle_error(\"swapcontext\");\n"
1102
1103 #. type: Plain text
1104 #: build/C/man3/makecontext.3:226
1105 #, no-wrap
1106 msgid ""
1107 "    printf(\"main: exiting\\en\");\n"
1108 "    exit(EXIT_SUCCESS);\n"
1109 "}\n"
1110 msgstr ""
1111 "    printf(\"main: exiting\\en\");\n"
1112 "    exit(EXIT_SUCCESS);\n"
1113 "}\n"
1114
1115 #. type: Plain text
1116 #: build/C/man3/makecontext.3:233
1117 msgid ""
1118 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1119 "B<sigsetjmp>(3)"
1120 msgstr ""
1121 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1122 "B<sigsetjmp>(3)"
1123
1124 #. type: TH
1125 #: build/C/man3/pthread_attr_init.3:26
1126 #, no-wrap
1127 msgid "PTHREAD_ATTR_INIT"
1128 msgstr "PTHREAD_ATTR_INIT"
1129
1130 #. type: TH
1131 #: build/C/man3/pthread_attr_init.3:26
1132 #, no-wrap
1133 msgid "2008-11-11"
1134 msgstr "2008-11-11"
1135
1136 #. type: Plain text
1137 #: build/C/man3/pthread_attr_init.3:30
1138 msgid ""
1139 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1140 "attributes object"
1141 msgstr ""
1142 "pthread_attr_init, pthread_attr_destroy - \n"
1143 "スレッド属性オブジェクトの初期化と破棄を行う"
1144
1145 #. type: Plain text
1146 #: build/C/man3/pthread_attr_init.3:33
1147 #: build/C/man3/pthread_attr_setdetachstate.3:33
1148 #: build/C/man3/pthread_attr_setguardsize.3:33
1149 #: build/C/man3/pthread_attr_setinheritsched.3:33
1150 #: build/C/man3/pthread_attr_setschedparam.3:33
1151 #: build/C/man3/pthread_attr_setschedpolicy.3:33
1152 #: build/C/man3/pthread_attr_setscope.3:33
1153 #: build/C/man3/pthread_attr_setstack.3:33
1154 #: build/C/man3/pthread_attr_setstackaddr.3:33
1155 #: build/C/man3/pthread_attr_setstacksize.3:33
1156 #: build/C/man3/pthread_cancel.3:32 build/C/man3/pthread_cleanup_push.3:33
1157 #: build/C/man3/pthread_cleanup_push_defer_np.3:33
1158 #: build/C/man3/pthread_create.3:32 build/C/man3/pthread_detach.3:32
1159 #: build/C/man3/pthread_equal.3:32 build/C/man3/pthread_exit.3:32
1160 #: build/C/man3/pthread_join.3:32
1161 #: build/C/man3/pthread_kill_other_threads_np.3:32
1162 #: build/C/man3/pthread_self.3:32 build/C/man3/pthread_setcancelstate.3:33
1163 #: build/C/man3/pthread_setconcurrency.3:32
1164 #: build/C/man3/pthread_setschedparam.3:33
1165 #: build/C/man3/pthread_setschedprio.3:32 build/C/man3/pthread_sigqueue.3:31
1166 #: build/C/man3/pthread_testcancel.3:32
1167 #, no-wrap
1168 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1169 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1170
1171 #. type: Plain text
1172 #: build/C/man3/pthread_attr_init.3:36
1173 #, no-wrap
1174 msgid ""
1175 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1176 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1177 msgstr ""
1178 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1179 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1180
1181 #. type: Plain text
1182 #: build/C/man3/pthread_attr_init.3:38
1183 #: build/C/man3/pthread_attr_setaffinity_np.3:41
1184 #: build/C/man3/pthread_attr_setdetachstate.3:40
1185 #: build/C/man3/pthread_attr_setguardsize.3:40
1186 #: build/C/man3/pthread_attr_setinheritsched.3:40
1187 #: build/C/man3/pthread_attr_setschedparam.3:40
1188 #: build/C/man3/pthread_attr_setschedpolicy.3:40
1189 #: build/C/man3/pthread_attr_setscope.3:40
1190 #: build/C/man3/pthread_attr_setstack.3:40
1191 #: build/C/man3/pthread_attr_setstackaddr.3:40
1192 #: build/C/man3/pthread_attr_setstacksize.3:40
1193 #: build/C/man3/pthread_cancel.3:36 build/C/man3/pthread_cleanup_push.3:39
1194 #: build/C/man3/pthread_equal.3:36 build/C/man3/pthread_exit.3:36
1195 #: build/C/man3/pthread_getattr_np.3:37
1196 #: build/C/man3/pthread_getcpuclockid.3:37 build/C/man3/pthread_self.3:36
1197 #: build/C/man3/pthread_setaffinity_np.3:41
1198 #: build/C/man3/pthread_setcancelstate.3:38
1199 #: build/C/man3/pthread_setconcurrency.3:37
1200 #: build/C/man3/pthread_setschedparam.3:40
1201 #: build/C/man3/pthread_setschedprio.3:36 build/C/man3/pthread_testcancel.3:36
1202 #, no-wrap
1203 msgid "Compile and link with I<-pthread>.\n"
1204 msgstr "I<-pthread> でコンパイルしてリンクする。\n"
1205
1206 #. type: Plain text
1207 #: build/C/man3/pthread_attr_init.3:50
1208 msgid ""
1209 "The B<pthread_attr_init>()  function initializes the thread attributes "
1210 "object pointed to by I<attr> with default attribute values.  After this "
1211 "call, individual attributes of the object can be set using various related "
1212 "functions (listed under SEE ALSO), and then the object can be used in one or "
1213 "more B<pthread_create>(3)  calls that create threads."
1214 msgstr ""
1215 "B<pthread_attr_init>() 関数は I<attr> が指すスレッド属性オブジェクト\n"
1216 "(thread attributes object) をデフォルトの属性値で初期化する。\n"
1217 "この呼び出しの後、オブジェクトの各属性は (関連項目に載っている) 種々の\n"
1218 "関数を使って設定することができ、このオブジェクトはスレッドの作成を行う\n"
1219 "B<pthread_create>(3) の呼び出しにおいて使用することができる (一つの\n"
1220 "オブジェクトを複数の B<pthread_create>(3) に渡してもよい)。"
1221
1222 #. type: Plain text
1223 #: build/C/man3/pthread_attr_init.3:55
1224 msgid ""
1225 "Calling B<pthread_attr_init>()  on a thread attributes object that has "
1226 "already been initialized results in undefined behavior."
1227 msgstr ""
1228 "すでに初期化されているスレッド属性オブジェクトに対して\n"
1229 "B<pthread_attr_init>() を呼び出した場合、\n"
1230 "どのような動作になるかは不定である。"
1231
1232 #. type: Plain text
1233 #: build/C/man3/pthread_attr_init.3:62
1234 msgid ""
1235 "When a thread attributes object is no longer required, it should be "
1236 "destroyed using the B<pthread_attr_destroy>()  function.  Destroying a "
1237 "thread attributes object has no effect on threads that were created using "
1238 "that object."
1239 msgstr ""
1240 "スレッド属性オブジェクトがもはや必要なくなった際には、\n"
1241 "そのオブジェクトは B<pthread_attr_destroy>() 関数を使って破棄すべきである。\n"
1242 "スレッド属性オブジェクトを破棄しても、\n"
1243 "そのオブジェクトを使って作成されたスレッドには影響はない。"
1244
1245 #. type: Plain text
1246 #: build/C/man3/pthread_attr_init.3:68
1247 msgid ""
1248 "Once a thread attributes object has been destroyed, it can be reinitialized "
1249 "using B<pthread_attr_init>().  Any other use of a destroyed thread "
1250 "attributes object has undefined results."
1251 msgstr ""
1252 "いったん破棄したスレッド属性オブジェクトは、\n"
1253 "B<pthread_attr_init>() を使って再初期化することができる。\n"
1254 "破棄したスレッド属性オブジェクトをこれ以外の用途で\n"
1255 "使った場合の結果は不定である。"
1256
1257 #. type: Plain text
1258 #: build/C/man3/pthread_attr_init.3:71
1259 #: build/C/man3/pthread_attr_setaffinity_np.3:79
1260 #: build/C/man3/pthread_attr_setdetachstate.3:80
1261 #: build/C/man3/pthread_attr_setguardsize.3:93
1262 #: build/C/man3/pthread_attr_setinheritsched.3:96
1263 #: build/C/man3/pthread_attr_setschedparam.3:88
1264 #: build/C/man3/pthread_attr_setschedpolicy.3:86
1265 #: build/C/man3/pthread_attr_setscope.3:106
1266 #: build/C/man3/pthread_attr_setstack.3:88
1267 #: build/C/man3/pthread_attr_setstackaddr.3:77
1268 #: build/C/man3/pthread_attr_setstacksize.3:64
1269 #: build/C/man3/pthread_setaffinity_np.3:80
1270 #: build/C/man3/pthread_setcancelstate.3:95
1271 #: build/C/man3/pthread_setname_np.3:75
1272 msgid ""
1273 "On success, these functions return 0; on error, they return a nonzero error "
1274 "number."
1275 msgstr ""
1276 "成功すると、これらの関数は 0 を返す。\n"
1277 "エラーの場合、0 以外のエラー番号を返す。"
1278
1279 #. type: Plain text
1280 #: build/C/man3/pthread_attr_init.3:79
1281 msgid ""
1282 "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on "
1283 "Linux these functions always succeed (but portable and future-proof "
1284 "applications should nevertheless handle a possible error return)."
1285 msgstr ""
1286 "POSIX.1-2001 では B<pthread_attr_init>() にはエラー B<ENOMEM> が\n"
1287 "記載されている。\n"
1288 "Linux では、これらの関数は常に成功する\n"
1289 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
1290 "正のエラーの返り値を処理するようにすべきである)。"
1291
1292 #. type: Plain text
1293 #: build/C/man3/pthread_attr_init.3:81
1294 #: build/C/man3/pthread_attr_setdetachstate.3:96
1295 #: build/C/man3/pthread_attr_setguardsize.3:115
1296 #: build/C/man3/pthread_attr_setinheritsched.3:119
1297 #: build/C/man3/pthread_attr_setschedparam.3:109
1298 #: build/C/man3/pthread_attr_setschedpolicy.3:109
1299 #: build/C/man3/pthread_attr_setscope.3:128
1300 #: build/C/man3/pthread_attr_setstack.3:121
1301 #: build/C/man3/pthread_attr_setstacksize.3:92
1302 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129
1303 #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_detach.3:66
1304 #: build/C/man3/pthread_equal.3:49 build/C/man3/pthread_exit.3:77
1305 #: build/C/man3/pthread_getcpuclockid.3:67 build/C/man3/pthread_join.3:100
1306 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setcancelstate.3:122
1307 #: build/C/man3/pthread_setconcurrency.3:85
1308 #: build/C/man3/pthread_setschedparam.3:150
1309 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
1310 #: build/C/man3/pthread_testcancel.3:65
1311 msgid "POSIX.1-2001."
1312 msgstr "POSIX.1-2001."
1313
1314 #. type: Plain text
1315 #: build/C/man3/pthread_attr_init.3:87
1316 msgid ""
1317 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1318 "object other than via pthreads functions is nonportable and produces "
1319 "undefined results."
1320 msgstr ""
1321 "I<pthread_attr_t> 型の内部構造は意識すべきではない。\n"
1322 "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n"
1323 "どのような結果が得られるかも分からない。"
1324
1325 #. type: Plain text
1326 #: build/C/man3/pthread_attr_init.3:96
1327 msgid ""
1328 "The program below optionally makes use of B<pthread_attr_init>()  and "
1329 "various related functions to initialize a thread attributes object that is "
1330 "used to create a single thread.  Once created, the thread uses the "
1331 "B<pthread_getattr_np>(3)  function (a nonstandard GNU extension) to retrieve "
1332 "the thread's attributes, and then displays those attributes."
1333 msgstr ""
1334 "下記のプログラムは、B<pthread_attr_init>() と種々の関連関数を使って、\n"
1335 "スレッド属性オブジェクトの初期化を行い、\n"
1336 "そのオブジェクトを使ってスレッドを一つ作成する。\n"
1337 "作成されたスレッドは、作成後に B<pthread_getattr_np>(3) 関数 \n"
1338 "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n"
1339 "取得した属性を表示する。"
1340
1341 #. type: Plain text
1342 #: build/C/man3/pthread_attr_init.3:105
1343 msgid ""
1344 "If the program is run with no command-line argument, then it passes NULL as "
1345 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1346 "with default attributes.  Running the program on Linux/x86-32 with the NPTL "
1347 "threading implementation, we see the following:"
1348 msgstr ""
1349 "コマンドライン引き数なしでプログラムを実行した場合、\n"
1350 "B<pthread_create>(3) の I<attr> 引き数には NULL が渡される。\n"
1351 "この場合、スレッドはデフォルトの属性で作成される。\n"
1352 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1353 "動作させると、以下のような出力が得られる。"
1354
1355 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1356 #. type: Plain text
1357 #: build/C/man3/pthread_attr_init.3:121
1358 #, no-wrap
1359 msgid ""
1360 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1361 "unlimited\n"
1362 "$B< ./a.out>\n"
1363 "Thread attributes:\n"
1364 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1365 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1366 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1367 "        Scheduling policy   = SCHED_OTHER\n"
1368 "        Scheduling priority = 0\n"
1369 "        Guard size          = 4096 bytes\n"
1370 "        Stack address       = 0x40196000\n"
1371 "        Stack size          = 0x201000 bytes\n"
1372 msgstr ""
1373 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1374 "unlimited\n"
1375 "$B< ./a.out>\n"
1376 "Thread attributes:\n"
1377 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1378 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1379 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1380 "        Scheduling policy   = SCHED_OTHER\n"
1381 "        Scheduling priority = 0\n"
1382 "        Guard size          = 4096 bytes\n"
1383 "        Stack address       = 0x40196000\n"
1384 "        Stack size          = 0x201000 bytes\n"
1385
1386 #. type: Plain text
1387 #: build/C/man3/pthread_attr_init.3:131
1388 msgid ""
1389 "When we supply a stack size as a command-line argument, the program "
1390 "initializes a thread attributes object, sets various attributes in that "
1391 "object, and passes a pointer to the object in the call to "
1392 "B<pthread_create>(3).  Running the program on Linux/x86-32 with the NPTL "
1393 "threading implementation, we see the following:"
1394 msgstr ""
1395 "コマンドライン引き数でスタックサイズが与えられた場合、\n"
1396 "このプログラムは、スレッド属性オブジェクトを初期化し、\n"
1397 "そのオブジェクトの各種属性を設定し、\n"
1398 "B<pthread_create>(3) の呼び出しでこのオブジェクトへのポインタを渡す。\n"
1399 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1400 "動作させると、以下のような出力が得られる。"
1401
1402 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1403 #. type: Plain text
1404 #: build/C/man3/pthread_attr_init.3:146
1405 #, no-wrap
1406 msgid ""
1407 "$B< ./a.out 0x3000000>\n"
1408 "posix_memalign() allocated at 0x40197000\n"
1409 "Thread attributes:\n"
1410 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1411 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1412 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1413 "        Scheduling policy   = SCHED_OTHER\n"
1414 "        Scheduling priority = 0\n"
1415 "        Guard size          = 0 bytes\n"
1416 "        Stack address       = 0x40197000\n"
1417 "        Stack size          = 0x3000000 bytes\n"
1418 msgstr ""
1419 "$B< ./a.out 0x3000000>\n"
1420 "posix_memalign() allocated at 0x40197000\n"
1421 "Thread attributes:\n"
1422 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1423 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1424 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1425 "        Scheduling policy   = SCHED_OTHER\n"
1426 "        Scheduling priority = 0\n"
1427 "        Guard size          = 0 bytes\n"
1428 "        Stack address       = 0x40197000\n"
1429 "        Stack size          = 0x3000000 bytes\n"
1430
1431 #. type: Plain text
1432 #: build/C/man3/pthread_attr_init.3:157 build/C/man3/pthread_getattr_np.3:188
1433 #, no-wrap
1434 msgid ""
1435 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1436 "#include E<lt>pthread.hE<gt>\n"
1437 "#include E<lt>stdio.hE<gt>\n"
1438 "#include E<lt>stdlib.hE<gt>\n"
1439 "#include E<lt>unistd.hE<gt>\n"
1440 "#include E<lt>errno.hE<gt>\n"
1441 msgstr ""
1442 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1443 "#include E<lt>pthread.hE<gt>\n"
1444 "#include E<lt>stdio.hE<gt>\n"
1445 "#include E<lt>stdlib.hE<gt>\n"
1446 "#include E<lt>unistd.hE<gt>\n"
1447 "#include E<lt>errno.hE<gt>\n"
1448
1449 #. type: Plain text
1450 #: build/C/man3/pthread_attr_init.3:160 build/C/man3/pthread_cancel.3:162
1451 #: build/C/man3/pthread_cleanup_push.3:243 build/C/man3/pthread_create.3:254
1452 #: build/C/man3/pthread_getattr_np.3:191
1453 #: build/C/man3/pthread_getcpuclockid.3:114
1454 #: build/C/man3/pthread_setaffinity_np.3:172
1455 #: build/C/man3/pthread_setschedparam.3:244 build/C/man3/pthread_sigmask.3:110
1456 #, no-wrap
1457 msgid ""
1458 "#define handle_error_en(en, msg) \\e\n"
1459 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1460 msgstr ""
1461 "#define handle_error_en(en, msg) \\e\n"
1462 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1463
1464 #. type: Plain text
1465 #: build/C/man3/pthread_attr_init.3:168
1466 #, no-wrap
1467 msgid ""
1468 "static void\n"
1469 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1470 "{\n"
1471 "    int s, i;\n"
1472 "    size_t v;\n"
1473 "    void *stkaddr;\n"
1474 "    struct sched_param sp;\n"
1475 msgstr ""
1476 "static void\n"
1477 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1478 "{\n"
1479 "    int s, i;\n"
1480 "    size_t v;\n"
1481 "    void *stkaddr;\n"
1482 "    struct sched_param sp;\n"
1483
1484 #. type: Plain text
1485 #: build/C/man3/pthread_attr_init.3:176
1486 #, no-wrap
1487 msgid ""
1488 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1489 "    if (s != 0)\n"
1490 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1491 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1492 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1493 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1494 "            \"???\");\n"
1495 msgstr ""
1496 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1497 "    if (s != 0)\n"
1498 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1499 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1500 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1501 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1502 "            \"???\");\n"
1503
1504 #. type: Plain text
1505 #: build/C/man3/pthread_attr_init.3:184
1506 #, no-wrap
1507 msgid ""
1508 "    s = pthread_attr_getscope(attr, &i);\n"
1509 "    if (s != 0)\n"
1510 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1511 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1512 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1513 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1514 "            \"???\");\n"
1515 msgstr ""
1516 "    s = pthread_attr_getscope(attr, &i);\n"
1517 "    if (s != 0)\n"
1518 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1519 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1520 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1521 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1522 "            \"???\");\n"
1523
1524 #. type: Plain text
1525 #: build/C/man3/pthread_attr_init.3:192
1526 #, no-wrap
1527 msgid ""
1528 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1529 "    if (s != 0)\n"
1530 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1531 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1532 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1533 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1534 "            \"???\");\n"
1535 msgstr ""
1536 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1537 "    if (s != 0)\n"
1538 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1539 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1540 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1541 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1542 "            \"???\");\n"
1543
1544 #. type: Plain text
1545 #: build/C/man3/pthread_attr_init.3:201
1546 #, no-wrap
1547 msgid ""
1548 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1549 "    if (s != 0)\n"
1550 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1551 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1552 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1553 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1554 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1555 "            \"???\");\n"
1556 msgstr ""
1557 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1558 "    if (s != 0)\n"
1559 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1560 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1561 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1562 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1563 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1564 "            \"???\");\n"
1565
1566 #. type: Plain text
1567 #: build/C/man3/pthread_attr_init.3:206
1568 #, no-wrap
1569 msgid ""
1570 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1571 "    if (s != 0)\n"
1572 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1573 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1574 msgstr ""
1575 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1576 "    if (s != 0)\n"
1577 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1578 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1579
1580 #. type: Plain text
1581 #: build/C/man3/pthread_attr_init.3:211
1582 #, no-wrap
1583 msgid ""
1584 "    s = pthread_attr_getguardsize(attr, &v);\n"
1585 "    if (s != 0)\n"
1586 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1587 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1588 msgstr ""
1589 "    s = pthread_attr_getguardsize(attr, &v);\n"
1590 "    if (s != 0)\n"
1591 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1592 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1593
1594 #. type: Plain text
1595 #: build/C/man3/pthread_attr_init.3:218
1596 #, no-wrap
1597 msgid ""
1598 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1599 "    if (s != 0)\n"
1600 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1601 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1602 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1603 "}\n"
1604 msgstr ""
1605 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1606 "    if (s != 0)\n"
1607 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1608 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1609 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1610 "}\n"
1611
1612 #. type: Plain text
1613 #: build/C/man3/pthread_attr_init.3:224
1614 #, no-wrap
1615 msgid ""
1616 "static void *\n"
1617 "thread_start(void *arg)\n"
1618 "{\n"
1619 "    int s;\n"
1620 "    pthread_attr_t gattr;\n"
1621 msgstr ""
1622 "static void *\n"
1623 "thread_start(void *arg)\n"
1624 "{\n"
1625 "    int s;\n"
1626 "    pthread_attr_t gattr;\n"
1627
1628 #. type: Plain text
1629 #: build/C/man3/pthread_attr_init.3:228
1630 #, no-wrap
1631 msgid ""
1632 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1633 "       retrieves the attributes of the thread specified in its\n"
1634 "       first argument */\n"
1635 msgstr ""
1636 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1637 "       retrieves the attributes of the thread specified in its\n"
1638 "       first argument */\n"
1639
1640 #. type: Plain text
1641 #: build/C/man3/pthread_attr_init.3:232
1642 #, no-wrap
1643 msgid ""
1644 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1645 "    if (s != 0)\n"
1646 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1647 msgstr ""
1648 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1649 "    if (s != 0)\n"
1650 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1651
1652 #. type: Plain text
1653 #: build/C/man3/pthread_attr_init.3:235
1654 #, no-wrap
1655 msgid ""
1656 "    printf(\"Thread attributes:\\en\");\n"
1657 "    display_pthread_attr(&gattr, \"\\et\");\n"
1658 msgstr ""
1659 "    printf(\"Thread attributes:\\en\");\n"
1660 "    display_pthread_attr(&gattr, \"\\et\");\n"
1661
1662 #. type: Plain text
1663 #: build/C/man3/pthread_attr_init.3:238 build/C/man3/pthread_getattr_np.3:240
1664 #, no-wrap
1665 msgid ""
1666 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1667 "}\n"
1668 msgstr ""
1669 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1670 "}\n"
1671
1672 #. type: Plain text
1673 #: build/C/man3/pthread_attr_init.3:246
1674 #, no-wrap
1675 msgid ""
1676 "int\n"
1677 "main(int argc, char *argv[])\n"
1678 "{\n"
1679 "    pthread_t thr;\n"
1680 "    pthread_attr_t attr;\n"
1681 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1682 "    int s;\n"
1683 msgstr ""
1684 "int\n"
1685 "main(int argc, char *argv[])\n"
1686 "{\n"
1687 "    pthread_t thr;\n"
1688 "    pthread_attr_t attr;\n"
1689 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1690 "    int s;\n"
1691
1692 #. type: Plain text
1693 #: build/C/man3/pthread_attr_init.3:248
1694 #: build/C/man3/pthread_setschedparam.3:362
1695 #, no-wrap
1696 msgid "    attrp = NULL;\n"
1697 msgstr "    attrp = NULL;\n"
1698
1699 #. type: Plain text
1700 #: build/C/man3/pthread_attr_init.3:252
1701 #, no-wrap
1702 msgid ""
1703 "    /* If a command-line argument was supplied, use it to set the\n"
1704 "       stack-size attribute and set a few other thread attributes,\n"
1705 "       and set attrp pointing to thread attributes object */\n"
1706 msgstr ""
1707 "    /* If a command-line argument was supplied, use it to set the\n"
1708 "       stack-size attribute and set a few other thread attributes,\n"
1709 "       and set attrp pointing to thread attributes object */\n"
1710
1711 #. type: Plain text
1712 #: build/C/man3/pthread_attr_init.3:256
1713 #, no-wrap
1714 msgid ""
1715 "    if (argc E<gt> 1) {\n"
1716 "        int stack_size;\n"
1717 "        void *sp;\n"
1718 msgstr ""
1719 "    if (argc E<gt> 1) {\n"
1720 "        int stack_size;\n"
1721 "        void *sp;\n"
1722
1723 #. type: Plain text
1724 #: build/C/man3/pthread_attr_init.3:258
1725 #, no-wrap
1726 msgid "        attrp = &attr;\n"
1727 msgstr "        attrp = &attr;\n"
1728
1729 #. type: Plain text
1730 #: build/C/man3/pthread_attr_init.3:262
1731 #, no-wrap
1732 msgid ""
1733 "        s = pthread_attr_init(&attr);\n"
1734 "        if (s != 0)\n"
1735 "            handle_error_en(s, \"pthread_attr_init\");\n"
1736 msgstr ""
1737 "        s = pthread_attr_init(&attr);\n"
1738 "        if (s != 0)\n"
1739 "            handle_error_en(s, \"pthread_attr_init\");\n"
1740
1741 #. type: Plain text
1742 #: build/C/man3/pthread_attr_init.3:266
1743 #, no-wrap
1744 msgid ""
1745 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1746 "        if (s != 0)\n"
1747 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1748 msgstr ""
1749 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1750 "        if (s != 0)\n"
1751 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1752
1753 #. type: Plain text
1754 #: build/C/man3/pthread_attr_init.3:270
1755 #, no-wrap
1756 msgid ""
1757 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1758 "        if (s != 0)\n"
1759 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1760 msgstr ""
1761 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1762 "        if (s != 0)\n"
1763 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1764
1765 #. type: Plain text
1766 #: build/C/man3/pthread_attr_init.3:272
1767 #, no-wrap
1768 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1769 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
1770
1771 #. type: Plain text
1772 #: build/C/man3/pthread_attr_init.3:276
1773 #, no-wrap
1774 msgid ""
1775 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1776 "        if (s != 0)\n"
1777 "            handle_error_en(s, \"posix_memalign\");\n"
1778 msgstr ""
1779 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1780 "        if (s != 0)\n"
1781 "            handle_error_en(s, \"posix_memalign\");\n"
1782
1783 #. type: Plain text
1784 #: build/C/man3/pthread_attr_init.3:278
1785 #, no-wrap
1786 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1787 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1788
1789 #. type: Plain text
1790 #: build/C/man3/pthread_attr_init.3:283
1791 #, no-wrap
1792 msgid ""
1793 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1794 "        if (s != 0)\n"
1795 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1796 "    }\n"
1797 msgstr ""
1798 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1799 "        if (s != 0)\n"
1800 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1801 "    }\n"
1802
1803 #. type: Plain text
1804 #: build/C/man3/pthread_attr_init.3:287 build/C/man3/pthread_getattr_np.3:335
1805 #, no-wrap
1806 msgid ""
1807 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1808 "    if (s != 0)\n"
1809 "        handle_error_en(s, \"pthread_create\");\n"
1810 msgstr ""
1811 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1812 "    if (s != 0)\n"
1813 "        handle_error_en(s, \"pthread_create\");\n"
1814
1815 #. type: Plain text
1816 #: build/C/man3/pthread_attr_init.3:293 build/C/man3/pthread_getattr_np.3:341
1817 #, no-wrap
1818 msgid ""
1819 "    if (attrp != NULL) {\n"
1820 "        s = pthread_attr_destroy(attrp);\n"
1821 "        if (s != 0)\n"
1822 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1823 "    }\n"
1824 msgstr ""
1825 "    if (attrp != NULL) {\n"
1826 "        s = pthread_attr_destroy(attrp);\n"
1827 "        if (s != 0)\n"
1828 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1829 "    }\n"
1830
1831 #. type: Plain text
1832 #: build/C/man3/pthread_attr_init.3:296 build/C/man3/pthread_getattr_np.3:344
1833 #, no-wrap
1834 msgid ""
1835 "    pause();    /* Terminates when other thread calls exit() */\n"
1836 "}\n"
1837 msgstr ""
1838 "    pause();    /* Terminates when other thread calls exit() */\n"
1839 "}\n"
1840
1841 #. type: Plain text
1842 #: build/C/man3/pthread_attr_init.3:313
1843 msgid ""
1844 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1845 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1846 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1847 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1848 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1849 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1850 msgstr ""
1851 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1852 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1853 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1854 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1855 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1856 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1857
1858 #. type: TH
1859 #: build/C/man3/pthread_attr_setaffinity_np.3:26
1860 #, no-wrap
1861 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1862 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1863
1864 #. type: TH
1865 #: build/C/man3/pthread_attr_setaffinity_np.3:26
1866 #: build/C/man3/pthread_getattr_np.3:26 build/C/man3/pthread_tryjoin_np.3:26
1867 #, no-wrap
1868 msgid "2010-09-10"
1869 msgstr "2010-09-10"
1870
1871 #. type: Plain text
1872 #: build/C/man3/pthread_attr_setaffinity_np.3:30
1873 msgid ""
1874 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1875 "affinity attribute in thread attributes object"
1876 msgstr ""
1877 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
1878 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
1879
1880 #. type: Plain text
1881 #: build/C/man3/pthread_attr_setaffinity_np.3:34
1882 #: build/C/man3/pthread_getattr_np.3:33
1883 #: build/C/man3/pthread_setaffinity_np.3:34
1884 #: build/C/man3/pthread_tryjoin_np.3:34 build/C/man3/pthread_yield.3:32
1885 #, no-wrap
1886 msgid ""
1887 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1888 "B<#include E<lt>pthread.hE<gt>>\n"
1889 msgstr ""
1890 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1891 "B<#include E<lt>pthread.hE<gt>>\n"
1892
1893 #. type: Plain text
1894 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1895 #, no-wrap
1896 msgid ""
1897 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1898 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1899 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1900 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1901 msgstr ""
1902 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1903 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1904 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1905 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1906
1907 #. type: Plain text
1908 #: build/C/man3/pthread_attr_setaffinity_np.3:54
1909 msgid ""
1910 "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask "
1911 "attribute of the thread attributes object referred to by I<attr> to the "
1912 "value specified in I<cpuset>.  This attribute determines the CPU affinity "
1913 "mask of a thread created using the thread attributes object I<attr>."
1914 msgstr ""
1915 "B<pthread_attr_setaffinity_np>() 関数は、\n"
1916 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
1917 "I<cpuset> で指定された値に設定する。\n"
1918 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
1919 "作成されたスレッドの CPU affinity マスクが決定される。"
1920
1921 #. type: Plain text
1922 #: build/C/man3/pthread_attr_setaffinity_np.3:63
1923 msgid ""
1924 "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask "
1925 "attribute of the thread attributes object referred to by I<attr> in the "
1926 "buffer pointed to by I<cpuset>."
1927 msgstr ""
1928 "B<pthread_attr_getaffinity_np>() 関数は、 I<attr> が参照する\n"
1929 "スレッド属性オブジェクトの CPU affinity マスク属性を\n"
1930 "I<cpuset> が指すバッファに入れて返す。"
1931
1932 #. type: Plain text
1933 #: build/C/man3/pthread_attr_setaffinity_np.3:70
1934 msgid ""
1935 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1936 "by I<cpuset>.  Typically, this argument would be specified as "
1937 "I<sizeof(cpu_set_t)>."
1938 msgstr ""
1939 "I<cpusetsize> 引き数は I<cpuset> が指すバッファの (バイト単位の)\n"
1940 "大きさである。通常は、この引き数には I<sizeof(cpu_set_t)> を\n"
1941 "指定することだろう。"
1942
1943 #. type: Plain text
1944 #: build/C/man3/pthread_attr_setaffinity_np.3:76
1945 #: build/C/man3/pthread_setaffinity_np.3:67
1946 msgid ""
1947 "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a "
1948 "description of a set of macros that can be used to manipulate and inspect "
1949 "CPU sets, see B<CPU_SET>(3)."
1950 msgstr ""
1951 "CPU affinity マスクの詳細については、 \n"
1952 "B<sched_setaffinity>(2) を参照してほしい。\n"
1953 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
1954 "B<CPU_SET>(3) を参照してほしい。"
1955
1956 #. type: TP
1957 #: build/C/man3/pthread_attr_setaffinity_np.3:80
1958 #: build/C/man3/pthread_attr_setaffinity_np.3:92
1959 #: build/C/man3/pthread_attr_setdetachstate.3:83
1960 #: build/C/man3/pthread_attr_setinheritsched.3:99
1961 #: build/C/man3/pthread_attr_setschedpolicy.3:89
1962 #: build/C/man3/pthread_attr_setscope.3:109
1963 #: build/C/man3/pthread_attr_setstack.3:91
1964 #: build/C/man3/pthread_attr_setstacksize.3:67
1965 #: build/C/man3/pthread_create.3:137 build/C/man3/pthread_detach.3:55
1966 #: build/C/man3/pthread_join.3:85 build/C/man3/pthread_join.3:89
1967 #: build/C/man3/pthread_kill.3:69 build/C/man3/pthread_setaffinity_np.3:84
1968 #: build/C/man3/pthread_setaffinity_np.3:93
1969 #: build/C/man3/pthread_setaffinity_np.3:109
1970 #: build/C/man3/pthread_setcancelstate.3:99
1971 #: build/C/man3/pthread_setcancelstate.3:107
1972 #: build/C/man3/pthread_setconcurrency.3:71
1973 #: build/C/man3/pthread_setschedparam.3:122
1974 #: build/C/man3/pthread_setschedprio.3:62 build/C/man3/pthread_sigqueue.3:77
1975 #, no-wrap
1976 msgid "B<EINVAL>"
1977 msgstr "B<EINVAL>"
1978
1979 #.  cpumask_t
1980 #.  The raw sched_getaffinity() system call returns the size (in bytes)
1981 #.  of the cpumask_t type.
1982 #. type: Plain text
1983 #: build/C/man3/pthread_attr_setaffinity_np.3:92
1984 msgid ""
1985 "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was "
1986 "outside the set supported by the kernel.  (The kernel configuration option "
1987 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
1988 "type used to represent CPU sets.)"
1989 msgstr ""
1990 "(B<pthread_attr_setaffinity_np>())\n"
1991 "I<cpuset> がカーネルがサポートする CPU 集合にない CPU を指定していた。\n"
1992 "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲"
1993 "は、\n"
1994 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
1995
1996 #. type: Plain text
1997 #: build/C/man3/pthread_attr_setaffinity_np.3:102
1998 msgid ""
1999 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
2000 "attributes object referred to by I<attr> lies outside the range specified by "
2001 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
2002 msgstr ""
2003 "(B<pthread_attr_getaffinity_np>())\n"
2004 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
2005 "I<cpusetsize> により指定された範囲の中になかった\n"
2006 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
2007
2008 #. type: Plain text
2009 #: build/C/man3/pthread_attr_setaffinity_np.3:106
2010 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
2011 msgstr ""
2012 "(B<pthread_attr_setaffinity_np>()) メモリを割り当てることができなかった。"
2013
2014 #. type: Plain text
2015 #: build/C/man3/pthread_attr_setaffinity_np.3:108
2016 #: build/C/man3/pthread_setaffinity_np.3:121
2017 msgid "These functions are provided by glibc since version 2.3.4."
2018 msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。"
2019
2020 #. type: Plain text
2021 #: build/C/man3/pthread_attr_setaffinity_np.3:111
2022 #: build/C/man3/pthread_cleanup_push_defer_np.3:104
2023 #: build/C/man3/pthread_setaffinity_np.3:124
2024 #: build/C/man3/pthread_tryjoin_np.3:115
2025 msgid ""
2026 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
2027 "\" (nonportable) in the names."
2028 msgstr ""
2029 "これらの関数は非標準の GNU による拡張である。\n"
2030 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
2031 "付いている。"
2032
2033 #. type: Plain text
2034 #: build/C/man3/pthread_attr_setaffinity_np.3:118
2035 #: build/C/man3/pthread_setaffinity_np.3:150
2036 msgid ""
2037 "In glibc 2.3.3 only, versions of these functions were provided that did not "
2038 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
2039 "underlying system calls was always I<sizeof(cpu_set_t)>."
2040 msgstr ""
2041 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
2042 "これらの関数は I<cpusetsize> 引き数を持っていなかった。\n"
2043 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
2044 "常に I<sizeof(cpu_set_t)> であった。"
2045
2046 #. type: Plain text
2047 #: build/C/man3/pthread_attr_setaffinity_np.3:124
2048 msgid ""
2049 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2050 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2051 msgstr ""
2052 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2053 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2054
2055 #. type: TH
2056 #: build/C/man3/pthread_attr_setdetachstate.3:26
2057 #, no-wrap
2058 msgid "PTHREAD_ATTR_SETDETACHSTATE"
2059 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
2060
2061 #. type: Plain text
2062 #: build/C/man3/pthread_attr_setdetachstate.3:30
2063 msgid ""
2064 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
2065 "state attribute in thread attributes object"
2066 msgstr ""
2067 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
2068 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
2069
2070 #. type: Plain text
2071 #: build/C/man3/pthread_attr_setdetachstate.3:38
2072 #, no-wrap
2073 msgid ""
2074 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2075 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2076 msgstr ""
2077 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2078 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2079
2080 #. type: Plain text
2081 #: build/C/man3/pthread_attr_setdetachstate.3:53
2082 msgid ""
2083 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
2084 "attribute of the thread attributes object referred to by I<attr> to the "
2085 "value specified in I<detachstate>.  The detach state attribute determines "
2086 "whether a thread created using the thread attributes object I<attr> will be "
2087 "created in a joinable or a detached state."
2088 msgstr ""
2089 "B<pthread_attr_setdetachstate>() 関数は、\n"
2090 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
2091 "I<detachstate> で指定された値に設定する。\n"
2092 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2093 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
2094 "detached (切り離された) 状態で作成されるかが決定される。"
2095
2096 #. type: Plain text
2097 #: build/C/man3/pthread_attr_setdetachstate.3:56
2098 msgid "The following values may be specified in I<detachstate>:"
2099 msgstr "I<detachstate> には以下の値を指定できる。"
2100
2101 #. type: TP
2102 #: build/C/man3/pthread_attr_setdetachstate.3:56
2103 #, no-wrap
2104 msgid "B<PTHREAD_CREATE_DETACHED>"
2105 msgstr "B<PTHREAD_CREATE_DETACHED>"
2106
2107 #. type: Plain text
2108 #: build/C/man3/pthread_attr_setdetachstate.3:61
2109 msgid ""
2110 "Threads that are created using I<attr> will be created in a detached state."
2111 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
2112
2113 #. type: TP
2114 #: build/C/man3/pthread_attr_setdetachstate.3:61
2115 #, no-wrap
2116 msgid "B<PTHREAD_CREATE_JOINABLE>"
2117 msgstr "B<PTHREAD_CREATE_JOINABLE>"
2118
2119 #. type: Plain text
2120 #: build/C/man3/pthread_attr_setdetachstate.3:66
2121 msgid ""
2122 "Threads that are created using I<attr> will be created in a joinable state."
2123 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
2124
2125 #. type: Plain text
2126 #: build/C/man3/pthread_attr_setdetachstate.3:70
2127 msgid ""
2128 "The default setting of the detach state attribute in a newly initialized "
2129 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
2130 msgstr ""
2131 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
2132 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
2133
2134 #. type: Plain text
2135 #: build/C/man3/pthread_attr_setdetachstate.3:77
2136 msgid ""
2137 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
2138 "the thread attributes object I<attr> in the buffer pointed to by "
2139 "I<detachstate>."
2140 msgstr ""
2141 "B<pthread_attr_getdetachstate>() は、\n"
2142 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
2143 "I<detachstate> が指すバッファに入れて返す。"
2144
2145 #. type: Plain text
2146 #: build/C/man3/pthread_attr_setdetachstate.3:83
2147 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
2148 msgstr "B<pthread_attr_setdetachstate>() は以下のエラーで失敗する場合がある。"
2149
2150 #. type: Plain text
2151 #: build/C/man3/pthread_attr_setdetachstate.3:87
2152 msgid "An invalid value was specified in I<detachstate>."
2153 msgstr "無効な値が I<detachstate> で指定された。"
2154
2155 #. type: Plain text
2156 #: build/C/man3/pthread_attr_setdetachstate.3:94
2157 msgid ""
2158 "The B<pthread_attr_setdetachstate>()  and B<pthread_attr_getdetachstate>()  "
2159 "functions are thread-safe."
2160 msgstr ""
2161 "関数 B<pthread_attr_setdetachstate>() と B<pthread_attr_getdetachstate>() は"
2162 "スレッドセーフである。"
2163
2164 #. type: Plain text
2165 #: build/C/man3/pthread_attr_setdetachstate.3:100
2166 msgid ""
2167 "See B<pthread_create>(3)  for more details on detached and joinable threads."
2168 msgstr ""
2169 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
2170 "B<pthread_create>(3) を参照。"
2171
2172 #. type: Plain text
2173 #: build/C/man3/pthread_attr_setdetachstate.3:108
2174 msgid ""
2175 "A thread that is created in a joinable state should eventually either be "
2176 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
2177 "B<pthread_create>(3)."
2178 msgstr ""
2179 "join 可能状態で作成されたスレッドは、最終的に\n"
2180 "B<pthread_join>(3) を使って join するか、\n"
2181 "B<pthread_detach>(3) を使って切り離すか、\n"
2182 "のどちらかを行うべきである。"
2183
2184 #. type: Plain text
2185 #: build/C/man3/pthread_attr_setdetachstate.3:115
2186 msgid ""
2187 "It is an error to specify the thread ID of a thread that was created in a "
2188 "detached state in a later call to B<pthread_detach>(3)  or "
2189 "B<pthread_join>(3)."
2190 msgstr ""
2191 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
2192 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
2193 "エラーである。"
2194
2195 #. type: Plain text
2196 #: build/C/man3/pthread_attr_setdetachstate.3:118
2197 #: build/C/man3/pthread_attr_setstack.3:162
2198 msgid "See B<pthread_attr_init>(3)."
2199 msgstr "B<pthread_attr_init>(3) を参照。"
2200
2201 #. type: Plain text
2202 #: build/C/man3/pthread_attr_setdetachstate.3:124
2203 msgid ""
2204 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2205 "B<pthread_join>(3), B<pthreads>(7)"
2206 msgstr ""
2207 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2208 "B<pthread_join>(3), B<pthreads>(7)"
2209
2210 #. type: TH
2211 #: build/C/man3/pthread_attr_setguardsize.3:26
2212 #, no-wrap
2213 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2214 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2215
2216 #. type: Plain text
2217 #: build/C/man3/pthread_attr_setguardsize.3:30
2218 msgid ""
2219 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2220 "attribute in thread attributes object"
2221 msgstr ""
2222 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
2223 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
2224
2225 #. type: Plain text
2226 #: build/C/man3/pthread_attr_setguardsize.3:38
2227 #, no-wrap
2228 msgid ""
2229 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2230 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2231 msgstr ""
2232 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2233 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2234
2235 #. type: Plain text
2236 #: build/C/man3/pthread_attr_setguardsize.3:49
2237 msgid ""
2238 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
2239 "of the thread attributes object referred to by I<attr> to the value "
2240 "specified in I<guardsize>."
2241 msgstr ""
2242 "B<pthread_attr_setguardsize>() 関数は、\n"
2243 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
2244 "I<guardsize> で指定された値に設定する。"
2245
2246 #. type: Plain text
2247 #: build/C/man3/pthread_attr_setguardsize.3:59
2248 msgid ""
2249 "If I<guardsize> is greater than 0, then for each new thread created using "
2250 "I<attr> the system allocates an additional region of at least I<guardsize> "
2251 "bytes at the end of the thread's stack to act as the guard area for the "
2252 "stack (but see BUGS)."
2253 msgstr ""
2254 "I<guardsize> が 0 より大きい場合、\n"
2255 "I<attr> を使って新しく作成された各スレッドに対して、\n"
2256 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
2257 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
2258 "機能する (ただし「バグ」の節も参照)。"
2259
2260 #. type: Plain text
2261 #: build/C/man3/pthread_attr_setguardsize.3:65
2262 msgid ""
2263 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2264 "guard area."
2265 msgstr ""
2266 "I<guardsize> が 0 の場合、\n"
2267 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
2268
2269 #. type: Plain text
2270 #: build/C/man3/pthread_attr_setguardsize.3:67
2271 msgid "The default guard size is the same as the system page size."
2272 msgstr "デフォルトの guard size はシステムのページサイズと同じである。"
2273
2274 #. type: Plain text
2275 #: build/C/man3/pthread_attr_setguardsize.3:82
2276 msgid ""
2277 "If the stack address attribute has been set in I<attr> (using "
2278 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
2279 "that the caller is allocating the thread's stack, then the guard size "
2280 "attribute is ignored (i.e., no guard area is created by the system): it is "
2281 "the application's responsibility to handle stack overflow (perhaps by using "
2282 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
2283 "it has allocated)."
2284 msgstr ""
2285 "(B<pthread_attr_setstack>(3) や B<pthread_attr_setstackaddr>(3)を使って)\n"
2286 "I<attr> でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n"
2287 "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n"
2288 "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n"
2289 "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n"
2290 "ケーション側の責任となる (おそらく B<mprotect>(2) を使って、割り当て\n"
2291 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
2292
2293 #. type: Plain text
2294 #: build/C/man3/pthread_attr_setguardsize.3:90
2295 msgid ""
2296 "The B<pthread_attr_getguardsize>()  function returns the guard size "
2297 "attribute of the thread attributes object referred to by I<attr> in the "
2298 "buffer pointed to by I<guardsize>."
2299 msgstr ""
2300 "B<pthread_attr_getguardsize>() は、\n"
2301 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
2302 "I<guardsize> が指すバッファに入れて返す。"
2303
2304 #. type: Plain text
2305 #: build/C/man3/pthread_attr_setguardsize.3:104
2306 msgid ""
2307 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2308 "invalid.  On Linux these functions always succeed (but portable and future-"
2309 "proof applications should nevertheless handle a possible error return)."
2310 msgstr ""
2311 "POSIX.1-2001 では、エラー B<EINVAL> が\n"
2312 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2313 "Linux では、これらの関数は常に成功する\n"
2314 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2315 "正のエラーの返り値を処理するようにすべきである)。"
2316
2317 #. type: Plain text
2318 #: build/C/man3/pthread_attr_setguardsize.3:106
2319 #: build/C/man3/pthread_attr_setstackaddr.3:83
2320 #: build/C/man3/pthread_attr_setstacksize.3:83
2321 msgid "These functions are provided by glibc since version 2.1."
2322 msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。"
2323
2324 #. type: Plain text
2325 #: build/C/man3/pthread_attr_setguardsize.3:113
2326 msgid ""
2327 "The B<pthread_attr_setguardsize>()  and B<pthread_attr_getguardsize>()  "
2328 "functions are thread-safe."
2329 msgstr "関数 B<pthread_attr_setguardsize>() と B<pthread_attr_getguardsize>() はスレッドセーフである。"
2330
2331 #. type: Plain text
2332 #: build/C/man3/pthread_attr_setguardsize.3:129
2333 msgid ""
2334 "A guard area consists of virtual memory pages that are protected to prevent "
2335 "read and write access.  If a thread overflows its stack into the guard area, "
2336 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2337 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
2338 "guard size is internally rounded up to the system page size when creating a "
2339 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
2340 "size that was set by B<pthread_attr_setguardsize>().)"
2341 msgstr ""
2342 "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n"
2343 "られた仮想メモリページで構成で構成される。スレッドがスタックをガード\n"
2344 "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャ\n"
2345 "では、スレッドに B<SIGSEGV> シグナルが送られ、オーバーフローが発生した\n"
2346 "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n"
2347 "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n"
2348 "(その場合も B<pthread_attr_getguardsize>() では\n"
2349 "B<pthread_attr_setguardsize>() で設定された guard size が返される)。"
2350
2351 #. type: Plain text
2352 #: build/C/man3/pthread_attr_setguardsize.3:133
2353 msgid ""
2354 "Setting a guard size of 0 may be useful to save memory in an application "
2355 "that creates many threads and knows that stack overflow can never occur."
2356 msgstr ""
2357 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2358 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2359 "することで、メモリを節約できることもある。"
2360
2361 #. type: Plain text
2362 #: build/C/man3/pthread_attr_setguardsize.3:137
2363 msgid ""
2364 "Choosing a guard size larger than the default size may be necessary for "
2365 "detecting stack overflows if a thread allocates large data structures on the "
2366 "stack."
2367 msgstr ""
2368 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2369 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2370 "大きな guard size を選ぶ必要があるかもしれない。"
2371
2372 #. type: SH
2373 #: build/C/man3/pthread_attr_setguardsize.3:137
2374 #: build/C/man3/pthread_attr_setinheritsched.3:119
2375 #: build/C/man3/pthread_attr_setstacksize.3:103
2376 #: build/C/man3/pthread_create.3:196 build/C/man3/pthread_exit.3:93
2377 #, no-wrap
2378 msgid "BUGS"
2379 msgstr "バグ"
2380
2381 #. type: Plain text
2382 #: build/C/man3/pthread_attr_setguardsize.3:148
2383 msgid ""
2384 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2385 "within the stack size allocation, rather than allocating extra space at the "
2386 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2387 "error from B<pthread_create>(3)  if the guard size value is too large, "
2388 "leaving no space for the actual stack.)"
2389 msgstr ""
2390 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2391 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2392 "末尾に追加の領域を割り当てることが求められている。\n"
2393 "(このため、ガード領域が大きすぎて、\n"
2394 "実際のスタック用の場所がなくなってしまう場合、\n"
2395 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2396
2397 #.  glibc includes the guardsize within the allocated stack size,
2398 #.  which looks pretty clearly to be in violation of POSIX.
2399 #.  Filed bug, 22 Oct 2008:
2400 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2401 #.  Older reports:
2402 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2403 #.  Reportedly, LinuxThreads did the right thing, allocating
2404 #.  extra space at the end of the stack:
2405 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2406 #. type: Plain text
2407 #: build/C/man3/pthread_attr_setguardsize.3:162
2408 msgid ""
2409 "The obsolete LinuxThreads implementation did the right thing, allocating "
2410 "extra space at the end of the stack for the guard area."
2411 msgstr ""
2412 "廃止予定の LinuxThreads 実装では、\n"
2413 "POSIX.1 で求められている通りの動作で、\n"
2414 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2415
2416 #. type: Plain text
2417 #: build/C/man3/pthread_attr_setguardsize.3:165
2418 msgid "See B<pthread_getattr_np>(3)."
2419 msgstr "B<pthread_getattr_np>(3) を参照。"
2420
2421 #. type: Plain text
2422 #: build/C/man3/pthread_attr_setguardsize.3:173
2423 msgid ""
2424 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), "
2425 "B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), "
2426 "B<pthread_create>(3), B<pthreads>(7)"
2427 msgstr ""
2428 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), "
2429 "B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), "
2430 "B<pthread_create>(3), B<pthreads>(7)"
2431
2432 #. type: TH
2433 #: build/C/man3/pthread_attr_setinheritsched.3:26
2434 #, no-wrap
2435 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2436 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2437
2438 #. type: TH
2439 #: build/C/man3/pthread_attr_setinheritsched.3:26
2440 #: build/C/man3/pthread_attr_setschedparam.3:26
2441 #: build/C/man3/pthread_attr_setschedpolicy.3:26
2442 #: build/C/man3/pthread_setaffinity_np.3:26 build/C/man7/pthreads.7:26
2443 #, no-wrap
2444 msgid "2014-05-21"
2445 msgstr "2014-05-21"
2446
2447 #. type: Plain text
2448 #: build/C/man3/pthread_attr_setinheritsched.3:30
2449 msgid ""
2450 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit-"
2451 "scheduler attribute in thread attributes object"
2452 msgstr ""
2453 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - スレッド属性オブ"
2454 "ジェクトの inherit-scheduler 属性の設定/取得を行う"
2455
2456 #. type: Plain text
2457 #: build/C/man3/pthread_attr_setinheritsched.3:38
2458 #, no-wrap
2459 msgid ""
2460 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2461 "B<                                 int >I<inheritsched>B<);>\n"
2462 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2463 "B<                                 int *>I<inheritsched>B<);>\n"
2464 msgstr ""
2465 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2466 "B<                                 int >I<inheritsched>B<);>\n"
2467 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2468 "B<                                 int *>I<inheritsched>B<);>\n"
2469
2470 #. type: Plain text
2471 #: build/C/man3/pthread_attr_setinheritsched.3:55
2472 msgid ""
2473 "The B<pthread_attr_setinheritsched>()  function sets the inherit-scheduler "
2474 "attribute of the thread attributes object referred to by I<attr> to the "
2475 "value specified in I<inheritsched>.  The inherit-scheduler attribute "
2476 "determines whether a thread created using the thread attributes object "
2477 "I<attr> will inherit its scheduling attributes from the calling thread or "
2478 "whether it will take them from I<attr>."
2479 msgstr ""
2480 "B<pthread_attr_setinheritsched>() 関数は、 I<attr> が参照するスレッド属性オブ"
2481 "ジェクトの inherit-scheduler 属性を I<inheritsched> で指定された値に設定す"
2482 "る。 inherit-scheduler 属性により、スレッド属性オブジェクト I<attr> を使って"
2483 "作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承するか、 "
2484 "I<attr> からスケジューリング属性を取得するかが決定される。"
2485
2486 #. type: Plain text
2487 #: build/C/man3/pthread_attr_setinheritsched.3:64
2488 msgid ""
2489 "The following scheduling attributes are affected by the inherit-scheduler "
2490 "attribute: scheduling policy (B<pthread_attr_setschedpolicy>(3)), scheduling "
2491 "priority (B<pthread_attr_setschedparam>(3)), and contention scope "
2492 "(B<pthread_attr_setscope>(3))."
2493 msgstr ""
2494 "次に挙げるスケジューリング属性は inherit-scheduler 属性の影響を受ける: スケ"
2495 "ジューリングポリシー (B<pthread_attr_setschedpolicy>(3))、 スケジューリング優"
2496 "先度 (B<pthread_attr_setschedparam>(3))、 contention scope "
2497 "(B<pthread_attr_setscope>(3))。"
2498
2499 #. type: Plain text
2500 #: build/C/man3/pthread_attr_setinheritsched.3:67
2501 msgid "The following values may be specified in I<inheritsched>:"
2502 msgstr "以下の値を I<inheritsched> に指定できる。"
2503
2504 #. type: TP
2505 #: build/C/man3/pthread_attr_setinheritsched.3:67
2506 #, no-wrap
2507 msgid "B<PTHREAD_INHERIT_SCHED>"
2508 msgstr "B<PTHREAD_INHERIT_SCHED>"
2509
2510 #. type: Plain text
2511 #: build/C/man3/pthread_attr_setinheritsched.3:75
2512 msgid ""
2513 "Threads that are created using I<attr> inherit scheduling attributes from "
2514 "the creating thread; the scheduling attributes in I<attr> are ignored."
2515 msgstr ""
2516 "I<attr> を使って作成されたスレッドは、\n"
2517 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2518 "I<attr> 内のスケジューリング属性は無視される。"
2519
2520 #. type: TP
2521 #: build/C/man3/pthread_attr_setinheritsched.3:75
2522 #, no-wrap
2523 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2524 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2525
2526 #.  FIXME what are the defaults for scheduler settings?
2527 #. type: Plain text
2528 #: build/C/man3/pthread_attr_setinheritsched.3:82
2529 msgid ""
2530 "Threads that are created using I<attr> take their scheduling attributes from "
2531 "the values specified by the attributes object."
2532 msgstr ""
2533 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2534 "指定された値からスケジューリング属性を取得する。"
2535
2536 #. type: Plain text
2537 #: build/C/man3/pthread_attr_setinheritsched.3:86
2538 msgid ""
2539 "The default setting of the inherit-scheduler attribute in a newly "
2540 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2541 msgstr ""
2542 "新たに初期化されたスレッド属性オブジェクトの inherit-scheduler 属性のデフォル"
2543 "ト設定は B<PTHREAD_INHERIT_SCHED> である。"
2544
2545 #. type: Plain text
2546 #: build/C/man3/pthread_attr_setinheritsched.3:93
2547 msgid ""
2548 "The B<pthread_attr_getinheritsched>()  returns the inherit-scheduler "
2549 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2550 "by I<inheritsched>."
2551 msgstr ""
2552 "B<pthread_attr_getinheritsched>() は、 スレッド属性オブジェクト I<attr> の "
2553 "inherit-scheduler 属性を I<inheritsched> が指すバッファに入れて返す。"
2554
2555 #. type: Plain text
2556 #: build/C/man3/pthread_attr_setinheritsched.3:99
2557 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2558 msgstr "B<pthread_attr_setinheritsched>() は以下のエラーで失敗する場合がある。"
2559
2560 #. type: Plain text
2561 #: build/C/man3/pthread_attr_setinheritsched.3:103
2562 msgid "Invalid value in I<inheritsched>."
2563 msgstr "I<inheritsched> に無効な値が指定された。"
2564
2565 #.  .SH VERSIONS
2566 #.  Available since glibc 2.0.
2567 #. type: Plain text
2568 #: build/C/man3/pthread_attr_setinheritsched.3:110
2569 msgid ""
2570 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2571 "to set the attribute to an unsupported value\") for "
2572 "B<pthread_attr_setinheritsched>()."
2573 msgstr ""
2574 "POSIX.1-2001 では、 B<pthread_attr_setinheritsched>() に関して\n"
2575 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2576 "も追加で規定されている。"
2577
2578 #. type: Plain text
2579 #: build/C/man3/pthread_attr_setinheritsched.3:117
2580 msgid ""
2581 "The B<pthread_attr_setinheritsched>()  and "
2582 "B<pthread_attr_getinheritsched>()  functions are thread-safe."
2583 msgstr "関数 B<pthread_attr_setinheritsched>() と B<pthread_attr_getinheritsched>() はスレッドセーフである。"
2584
2585 #.  FIXME . Track status of the following bug:
2586 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2587 #. type: Plain text
2588 #: build/C/man3/pthread_attr_setinheritsched.3:135
2589 msgid ""
2590 "As at glibc 2.8, if a thread attributes object is initialized using "
2591 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2592 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2593 "if the inherit-scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2594 "then a thread created using the attribute object wrongly inherits its "
2595 "scheduling attributes from the creating thread.  This bug does not occur if "
2596 "either the scheduling policy or scheduling priority attribute is explicitly "
2597 "set in the thread attributes object before calling B<pthread_create>(3)."
2598 msgstr ""
2599 "glibc 2.8 の時点では、スレッド属性オブジェクトが B<pthread_attr_init>(3) を"
2600 "使って初期化された場合、 スレッド属性オブジェクトのスケジューリングポリシー"
2601 "が B<SCHED_OTHER> に、 スケジューリング優先度が 0 に設定される。一方、その後 "
2602 "inherit-scheduler 属性に B<PTHREAD_EXPLICIT_SCHED> が設定されると、このスレッ"
2603 "ド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するスレッド"
2604 "のスケジューリング属性が間違って継承されてしまう。 B<pthread_create>(3) を呼"
2605 "び出す前にスケジューリングポリシー属性かスケジューリング優先度属性のどちらか"
2606 "が明示的に設定された場合には、 このバグは発生しない。"
2607
2608 #. type: Plain text
2609 #: build/C/man3/pthread_attr_setinheritsched.3:138
2610 #: build/C/man3/pthread_attr_setschedparam.3:116
2611 #: build/C/man3/pthread_attr_setschedpolicy.3:112
2612 msgid "See B<pthread_setschedparam>(3)."
2613 msgstr "B<pthread_setschedparam>(3) を参照。"
2614
2615 #. type: Plain text
2616 #: build/C/man3/pthread_attr_setinheritsched.3:150
2617 msgid ""
2618 "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), "
2619 "B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), "
2620 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2621 "B<pthread_setschedprio>(3), B<pthreads>,(7)  B<sched>(7)"
2622 msgstr "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>,(7)  B<sched>(7)"
2623
2624 #. type: TH
2625 #: build/C/man3/pthread_attr_setschedparam.3:26
2626 #, no-wrap
2627 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2628 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2629
2630 #. type: Plain text
2631 #: build/C/man3/pthread_attr_setschedparam.3:30
2632 msgid ""
2633 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2634 "parameter attributes in thread attributes object"
2635 msgstr ""
2636 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
2637 "スレッド属性オブジェクトのスケジューリングパラメータ属性の設定/取得を行う"
2638
2639 #. type: Plain text
2640 #: build/C/man3/pthread_attr_setschedparam.3:38
2641 #, no-wrap
2642 msgid ""
2643 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2644 "B<                               const struct sched_param *>I<param>B<);>\n"
2645 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2646 "B<                               struct sched_param *>I<param>B<);>\n"
2647 msgstr ""
2648 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2649 "B<                               const struct sched_param *>I<param>B<);>\n"
2650 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2651 "B<                               struct sched_param *>I<param>B<);>\n"
2652
2653 #. type: Plain text
2654 #: build/C/man3/pthread_attr_setschedparam.3:52
2655 msgid ""
2656 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2657 "attributes of the thread attributes object referred to by I<attr> to the "
2658 "values specified in the buffer pointed to by I<param>.  These attributes "
2659 "determine the scheduling parameters of a thread created using the thread "
2660 "attributes object I<attr>."
2661 msgstr ""
2662 "B<pthread_attr_setschedparam>() 関数は、\n"
2663 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2664 "パラメータ属性を I<param> が指すバッファで指定された値に設定する。\n"
2665 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2666 "作成されるスレッドのスケジューリングパラメータが決定される。"
2667
2668 #. type: Plain text
2669 #: build/C/man3/pthread_attr_setschedparam.3:59
2670 msgid ""
2671 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2672 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2673 "by I<param>."
2674 msgstr ""
2675 "B<pthread_attr_getschedparam>() は、\n"
2676 "スレッド属性オブジェクト I<attr> のスケジューリングパラメータ属性を\n"
2677 "I<param> が指すバッファに入れて返す。"
2678
2679 #. type: Plain text
2680 #: build/C/man3/pthread_attr_setschedparam.3:61
2681 msgid "Scheduling parameters are maintained in the following structure:"
2682 msgstr "スケジューリングパラメータは以下の構造体で管理される。"
2683
2684 #. type: Plain text
2685 #: build/C/man3/pthread_attr_setschedparam.3:67
2686 #: build/C/man3/pthread_setschedparam.3:69
2687 #, no-wrap
2688 msgid ""
2689 "struct sched_param {\n"
2690 "    int sched_priority;     /* Scheduling priority */\n"
2691 "};\n"
2692 msgstr ""
2693 "struct sched_param {\n"
2694 "    int sched_priority;     /* Scheduling priority */\n"
2695 "};\n"
2696
2697 #. type: Plain text
2698 #: build/C/man3/pthread_attr_setschedparam.3:74
2699 #: build/C/man3/pthread_setschedparam.3:76
2700 msgid ""
2701 "As can be seen, only one scheduling parameter is supported.  For details of "
2702 "the permitted ranges for scheduling priorities in each scheduling policy, "
2703 "see B<sched>(7)."
2704 msgstr "見て分かる通り、サポートされているスケジューリングパラメータは一つだけである。各スケジューリングポリシーで許可されるスケジューリング優先度の詳細については、B<sched>(7) を参照のこと。"
2705
2706 #. type: Plain text
2707 #: build/C/man3/pthread_attr_setschedparam.3:85
2708 msgid ""
2709 "In order for the parameter setting made by B<pthread_attr_setschedparam>()  "
2710 "to have effect when calling B<pthread_create>(3), the caller must use "
2711 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2712 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2713 msgstr ""
2714 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedparam>() で行っ"
2715 "たパラメータ設定を有効にするには、 呼び出し側で "
2716 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
2717 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
2718 "ない。"
2719
2720 #.  .SH VERSIONS
2721 #.  Available since glibc 2.0.
2722 #. type: Plain text
2723 #: build/C/man3/pthread_attr_setschedparam.3:100
2724 msgid ""
2725 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2726 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2727 "(but portable and future-proof applications should nevertheless handle a "
2728 "possible error return)."
2729 msgstr ""
2730 "POSIX.1 では、\n"
2731 "B<pthread_attr_setschedparam>() について\n"
2732 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
2733 "Linux では、これらの関数は常に成功する\n"
2734 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2735 "正のエラーの返り値を処理するようにすべきである)。"
2736
2737 #. type: Plain text
2738 #: build/C/man3/pthread_attr_setschedparam.3:107
2739 msgid ""
2740 "The B<pthread_attr_setschedparam>()  and B<pthread_attr_getschedparam>()  "
2741 "functions are thread-safe."
2742 msgstr "関数 B<pthread_attr_setschedparam>() と B<pthread_attr_getschedparam>() はスレッドセーフである。"
2743
2744 #. type: Plain text
2745 #: build/C/man3/pthread_attr_setschedparam.3:113
2746 msgid ""
2747 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2748 "policies supported on Linux."
2749 msgstr ""
2750 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
2751 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
2752
2753 #. type: Plain text
2754 #: build/C/man3/pthread_attr_setschedparam.3:128
2755 msgid ""
2756 "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
2757 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2758 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
2759 "B<pthread_setschedprio>(3), B<pthreads>(7).  B<sched>(7)"
2760 msgstr "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7).  B<sched>(7)"
2761
2762 #. type: TH
2763 #: build/C/man3/pthread_attr_setschedpolicy.3:26
2764 #, no-wrap
2765 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2766 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2767
2768 #. type: Plain text
2769 #: build/C/man3/pthread_attr_setschedpolicy.3:30
2770 msgid ""
2771 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2772 "scheduling policy attribute in thread attributes object"
2773 msgstr ""
2774 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
2775 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
2776
2777 #. type: Plain text
2778 #: build/C/man3/pthread_attr_setschedpolicy.3:38
2779 #, no-wrap
2780 msgid ""
2781 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2782 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2783 msgstr ""
2784 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2785 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2786
2787 #. type: Plain text
2788 #: build/C/man3/pthread_attr_setschedpolicy.3:52
2789 msgid ""
2790 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2791 "attribute of the thread attributes object referred to by I<attr> to the "
2792 "value specified in I<policy>.  This attribute determines the scheduling "
2793 "policy of a thread created using the thread attributes object I<attr>."
2794 msgstr ""
2795 "B<pthread_attr_setschedpolicy>() 関数は、\n"
2796 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2797 "ポリシー属性を I<policy> で指定された値に設定する。\n"
2798 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2799 "作成されるスレッドのスケジューリングポリシーが決定される。"
2800
2801 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2802 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2803 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2804 #. type: Plain text
2805 #: build/C/man3/pthread_attr_setschedpolicy.3:65
2806 msgid ""
2807 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2808 "B<SCHED_OTHER>, with the semantics described in B<sched>(7)."
2809 msgstr "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER> である。それぞれの意味は B<sched>(7) で説明している通りである。"
2810
2811 #. type: Plain text
2812 #: build/C/man3/pthread_attr_setschedpolicy.3:72
2813 msgid ""
2814 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2815 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2816 "by I<policy>."
2817 msgstr ""
2818 "B<pthread_attr_getschedpolicy>() は、\n"
2819 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
2820 "I<policy> が指すバッファに入れて返す。"
2821
2822 #. type: Plain text
2823 #: build/C/man3/pthread_attr_setschedpolicy.3:83
2824 msgid ""
2825 "In order for the policy setting made by B<pthread_attr_setschedpolicy>()  to "
2826 "have effect when calling B<pthread_create>(3), the caller must use "
2827 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2828 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2829 msgstr ""
2830 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedpolicy>() で行っ"
2831 "たポリシー設定を有効にするには、 呼び出し側で "
2832 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
2833 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
2834 "ない。"
2835
2836 #. type: Plain text
2837 #: build/C/man3/pthread_attr_setschedpolicy.3:89
2838 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2839 msgstr "B<pthread_attr_setschedpolicy>() は以下のエラーで失敗する場合がある。"
2840
2841 #. type: Plain text
2842 #: build/C/man3/pthread_attr_setschedpolicy.3:93
2843 msgid "Invalid value in I<policy>."
2844 msgstr "I<policy> に無効な値が指定された。"
2845
2846 #.  .SH VERSIONS
2847 #.  Available since glibc 2.0.
2848 #. type: Plain text
2849 #: build/C/man3/pthread_attr_setschedpolicy.3:100
2850 msgid ""
2851 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2852 "to set the attribute to an unsupported value\") for "
2853 "B<pthread_attr_setschedpolicy>()."
2854 msgstr ""
2855 "POSIX.1-2001 では、 B<pthread_attr_setschedpolicy>() に関して\n"
2856 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2857 "も追加で規定されている。"
2858
2859 #. type: Plain text
2860 #: build/C/man3/pthread_attr_setschedpolicy.3:107
2861 msgid ""
2862 "The B<pthread_attr_setschedpolicy>()  and B<pthread_attr_getschedpolicy>()  "
2863 "functions are thread-safe."
2864 msgstr "関数 B<pthread_attr_setschedpolicy>() と B<pthread_attr_getschedpolicy>() はスレッドセーフである。"
2865
2866 #. type: Plain text
2867 #: build/C/man3/pthread_attr_setschedpolicy.3:123
2868 msgid ""
2869 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
2870 "B<pthread_attr_setschedparam>(3), B<pthread_create>(3), "
2871 "B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), "
2872 "B<sched>(7)"
2873 msgstr "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2874
2875 #. type: TH
2876 #: build/C/man3/pthread_attr_setscope.3:26
2877 #, no-wrap
2878 msgid "PTHREAD_ATTR_SETSCOPE"
2879 msgstr "PTHREAD_ATTR_SETSCOPE"
2880
2881 #. type: TH
2882 #: build/C/man3/pthread_attr_setscope.3:26
2883 #: build/C/man3/pthread_attr_setstack.3:26
2884 #, no-wrap
2885 msgid "2014-04-21"
2886 msgstr "2014-04-21"
2887
2888 #. type: Plain text
2889 #: build/C/man3/pthread_attr_setscope.3:30
2890 msgid ""
2891 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2892 "attribute in thread attributes object"
2893 msgstr ""
2894 "pthread_attr_setscope, pthread_attr_getscope - \n"
2895 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
2896
2897 #. type: Plain text
2898 #: build/C/man3/pthread_attr_setscope.3:38
2899 #, no-wrap
2900 msgid ""
2901 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2902 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2903 msgstr ""
2904 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2905 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2906
2907 #. type: Plain text
2908 #: build/C/man3/pthread_attr_setscope.3:53
2909 msgid ""
2910 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2911 "of the thread attributes object referred to by I<attr> to the value "
2912 "specified in I<scope>.  The contention scope attribute defines the set of "
2913 "threads against which a thread competes for resources such as the CPU.  "
2914 "POSIX.1-2001 specifies two possible values for I<scope>:"
2915 msgstr ""
2916 "B<pthread_attr_setscope>() 関数は、\n"
2917 "I<attr> が参照するスレッド属性オブジェクトの contention scope\n"
2918 "属性を I<scope> で指定された値に設定する。\n"
2919 "contention scope 属性により、\n"
2920 "スレッドが CPU などのリソースを取り合うスレッド集合が規定される。\n"
2921 "POSIX.1-2001 では I<scope> に指定する値として 2 つの値が規定されている。"
2922
2923 #. type: TP
2924 #: build/C/man3/pthread_attr_setscope.3:53
2925 #, no-wrap
2926 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2927 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2928
2929 #. type: Plain text
2930 #: build/C/man3/pthread_attr_setscope.3:61
2931 msgid ""
2932 "The thread competes for resources with all other threads in all processes on "
2933 "the system that are in the same scheduling allocation domain (a group of one "
2934 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2935 "to one another according to their scheduling policy and priority."
2936 msgstr ""
2937 "スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ\n"
2938 "のグループ) にある、システム上の全てのプロセスの自分以外の全ての\n"
2939 "スレッドとリソースを取り合う。 \n"
2940 "B<PTHREAD_SCOPE_SYSTEM> のスレッドは、スケジューリングポリシーと\n"
2941 "優先度に基づき、互いに相対的にスケジューリングされる。"
2942
2943 #. type: TP
2944 #: build/C/man3/pthread_attr_setscope.3:61
2945 #, no-wrap
2946 msgid "B<PTHREAD_SCOPE_PROCESS>"
2947 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2948
2949 #. type: Plain text
2950 #: build/C/man3/pthread_attr_setscope.3:76
2951 msgid ""
2952 "The thread competes for resources with all other threads in the same process "
2953 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
2954 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2955 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
2956 "leaves it unspecified how these threads contend with other threads in other "
2957 "process on the system or with other threads in the same process that were "
2958 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
2959 msgstr ""
2960 "スレッドは、contention scope が B<PTHREAD_SCOPE_PROCESS> で作成された\n"
2961 "同じプロセスの自分以外の全てのスレッドとリソースを取り合う。\n"
2962 "B<PTHREAD_SCOPE_PROCESS> のスレッドは、スケジューリングポリシーと優先度\n"
2963 "に基づき、同じプロセスの他のスレッドと相対的にスケジューリングされる。\n"
2964 "POSIX.1-2001 では、これらのスレッドがシステム上の他のプロセスのスレッド\n"
2965 "や同じプロセス内の contention scope が B<PTHREAD_SCOPE_SYSTEM> で作成\n"
2966 "された他のスレッドとどのようにリソースを取り合うかは、\n"
2967 "規定されないままになっている。"
2968
2969 #. type: Plain text
2970 #: build/C/man3/pthread_attr_setscope.3:83
2971 msgid ""
2972 "POSIX.1-2001 requires that an implementation support at least one of these "
2973 "contention scopes.  Linux supports B<PTHREAD_SCOPE_SYSTEM>, but not "
2974 "B<PTHREAD_SCOPE_PROCESS>."
2975 msgstr ""
2976 "POSIX.1-2001 で求められているのは、スレッド実装がこれらの contention scope の"
2977 "うち少なくとも 1 つをサポートすることだけである。 Linux は "
2978 "B<PTHREAD_SCOPE_SYSTEM> をサポートしているが、 B<PTHREAD_SCOPE_PROCESS> はサ"
2979 "ポートしていない。"
2980
2981 #. type: Plain text
2982 #: build/C/man3/pthread_attr_setscope.3:95
2983 msgid ""
2984 "On systems that support multiple contention scopes, then, in order for the "
2985 "parameter setting made by B<pthread_attr_setscope>()  to have effect when "
2986 "calling B<pthread_create>(3), the caller must use "
2987 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2988 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2989 msgstr ""
2990 "複数の contention scope をサポートしているシステムで、 B<pthread_create>(3) "
2991 "を呼び出した際に B<pthread_attr_setscope>() で行ったパラメータ設定を有効にす"
2992 "るには、 呼び出し側で B<pthread_attr_setinheritsched>(3) を使って 属性オブ"
2993 "ジェクト I<attr> の inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定"
2994 "しておかなければならない。"
2995
2996 #. type: Plain text
2997 #: build/C/man3/pthread_attr_setscope.3:103
2998 msgid ""
2999 "The B<pthread_attr_getscope>()  function returns the contention scope "
3000 "attribute of the thread attributes object referred to by I<attr> in the "
3001 "buffer pointed to by I<scope>."
3002 msgstr ""
3003 "B<pthread_attr_getscope>() は、\n"
3004 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
3005 "I<scope> が指すバッファに入れて返す。"
3006
3007 #. type: Plain text
3008 #: build/C/man3/pthread_attr_setscope.3:109
3009 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
3010 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
3011
3012 #. type: Plain text
3013 #: build/C/man3/pthread_attr_setscope.3:113
3014 msgid "An invalid value was specified in I<scope>."
3015 msgstr "I<scope> に無効な値が指定された。"
3016
3017 #. type: TP
3018 #: build/C/man3/pthread_attr_setscope.3:113
3019 #, no-wrap
3020 msgid "B<ENOTSUP>"
3021 msgstr "B<ENOTSUP>"
3022
3023 #. type: Plain text
3024 #: build/C/man3/pthread_attr_setscope.3:119
3025 msgid ""
3026 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
3027 "supported on Linux."
3028 msgstr ""
3029 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
3030 "この値は Linux でサポートされていない。"
3031
3032 #. type: Plain text
3033 #: build/C/man3/pthread_attr_setscope.3:126
3034 msgid ""
3035 "The B<pthread_attr_setscope>()  and B<pthread_attr_getscope>()  functions "
3036 "are thread-safe."
3037 msgstr "関数 B<pthread_attr_setscope>() と B<pthread_attr_getscope>() はスレッドセーフである。"
3038
3039 #. type: Plain text
3040 #: build/C/man3/pthread_attr_setscope.3:136
3041 msgid ""
3042 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a user-"
3043 "space thread is bound directly to a single kernel-scheduling entity.  This "
3044 "is the case on Linux for the obsolete LinuxThreads implementation and the "
3045 "modern NPTL implementation, which are both 1:1 threading implementations."
3046 msgstr ""
3047 "B<PTHREAD_SCOPE_SYSTEM> contention scope では、通常は、一つの\n"
3048 "ユーザ空間スレッドは一つのカーネルスケジューリング・エンティティに\n"
3049 "直接結び付けられる。\n"
3050 "Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに\n"
3051 "該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。"
3052
3053 #. type: Plain text
3054 #: build/C/man3/pthread_attr_setscope.3:139
3055 msgid ""
3056 "POSIX.1-2001 specifies that the default contention scope is implementation-"
3057 "defined."
3058 msgstr ""
3059 "POSIX.1-2001 では、 contention scope 属性のデフォルト値は\n"
3060 "実装時で定義されるものと規定されている。"
3061
3062 #. type: Plain text
3063 #: build/C/man3/pthread_attr_setscope.3:149
3064 msgid ""
3065 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3066 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3067 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3068 msgstr ""
3069 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3070 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3071 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3072
3073 #. type: TH
3074 #: build/C/man3/pthread_attr_setstack.3:26
3075 #, no-wrap
3076 msgid "PTHREAD_ATTR_SETSTACK"
3077 msgstr "PTHREAD_ATTR_SETSTACK"
3078
3079 #. type: Plain text
3080 #: build/C/man3/pthread_attr_setstack.3:30
3081 msgid ""
3082 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
3083 "thread attributes object"
3084 msgstr ""
3085 "pthread_attr_setstack, pthread_attr_getstack - \n"
3086 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
3087
3088 #. type: Plain text
3089 #: build/C/man3/pthread_attr_setstack.3:38
3090 #, no-wrap
3091 msgid ""
3092 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3093 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3094 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
3095 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3096 msgstr ""
3097 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3098 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3099 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
3100 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3101
3102 #. type: Plain text
3103 #: build/C/man3/pthread_attr_setstack.3:45 build/C/man3/pthread_kill.3:41
3104 #: build/C/man3/pthread_sigmask.3:42 build/C/man3/pthread_sigqueue.3:41
3105 msgid ""
3106 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3107 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
3108
3109 #. type: Plain text
3110 #: build/C/man3/pthread_attr_setstack.3:50
3111 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3112 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3113
3114 #. type: Plain text
3115 #: build/C/man3/pthread_attr_setstack.3:52
3116 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
3117 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
3118
3119 #. type: Plain text
3120 #: build/C/man3/pthread_attr_setstack.3:68
3121 msgid ""
3122 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
3123 "size attributes of the thread attributes object referred to by I<attr> to "
3124 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
3125 "attributes specify the location and size of the stack that should be used by "
3126 "a thread that is created using the thread attributes object I<attr>."
3127 msgstr ""
3128 "B<pthread_attr_setstack>() 関数は、\n"
3129 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
3130 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
3131 "指定された値に設定する。\n"
3132 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
3133 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
3134
3135 #. type: Plain text
3136 #: build/C/man3/pthread_attr_setstack.3:74
3137 msgid ""
3138 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
3139 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
3140 "allocated buffer should be both readable and writable."
3141 msgstr ""
3142 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
3143 "バッファ内の指定できる最小のアドレスバイトを指すべきである。\n"
3144 "割り当てられたバッファのページは読み書き両方が可能なページとなっている\n"
3145 "べきである。"
3146
3147 #. type: Plain text
3148 #: build/C/man3/pthread_attr_setstack.3:85
3149 msgid ""
3150 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
3151 "size attributes of the thread attributes object referred to by I<attr> in "
3152 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
3153 msgstr ""
3154 "B<pthread_attr_getstack>() 関数は、\n"
3155 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
3156 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
3157 "指すバッファに入れて返す。"
3158
3159 #. type: Plain text
3160 #: build/C/man3/pthread_attr_setstack.3:91
3161 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
3162 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
3163
3164 #. type: Plain text
3165 #: build/C/man3/pthread_attr_setstack.3:102
3166 msgid ""
3167 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
3168 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
3169 "stacksize> is not suitably aligned."
3170 msgstr ""
3171 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
3172 "システムによっては、 I<stackaddr> か\n"
3173 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
3174 "このエラーが発生する。"
3175
3176 #. type: Plain text
3177 #: build/C/man3/pthread_attr_setstack.3:110
3178 msgid ""
3179 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
3180 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
3181 "caller."
3182 msgstr ""
3183 "POSIX.1-2001 では エラー B<EACCES> も規定されており、\n"
3184 "このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に\n"
3185 "呼び出し側から読み書き両方のアクセスができない状況を表す。"
3186
3187 #. type: Plain text
3188 #: build/C/man3/pthread_attr_setstack.3:112
3189 msgid "These functions are provided by glibc since version 2.2."
3190 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
3191
3192 #. type: Plain text
3193 #: build/C/man3/pthread_attr_setstack.3:119
3194 msgid ""
3195 "The B<pthread_attr_setstack>()  and B<pthread_attr_getstack>()  functions "
3196 "are thread-safe."
3197 msgstr "関数 B<pthread_attr_setstack>() と B<pthread_attr_getstack>() はスレッドセーフである。"
3198
3199 #. type: Plain text
3200 #: build/C/man3/pthread_attr_setstack.3:129
3201 msgid ""
3202 "These functions are provided for applications that must ensure that a "
3203 "thread's stack is placed in a particular location.  For most applications, "
3204 "this is not necessary, and the use of these functions should be avoided.  "
3205 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
3206 "stack size other than the default.)"
3207 msgstr ""
3208 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
3209 "しなければならないアプリケーションのために提供されている。\n"
3210 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
3211 "これらの関数を使うのは避けるべきである。\n"
3212 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
3213 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
3214
3215 #. type: Plain text
3216 #: build/C/man3/pthread_attr_setstack.3:140
3217 msgid ""
3218 "When an application employs B<pthread_attr_setstack>(), it takes over the "
3219 "responsibility of allocating the stack.  Any guard size value that was set "
3220 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
3221 "is the application's responsibility to allocate a guard area (one or more "
3222 "pages protected against reading and writing)  to handle the possibility of "
3223 "stack overflow."
3224 msgstr ""
3225 "アプリケーションが B<pthread_attr_setstack>() を利用する際には、\n"
3226 "スタックの割り当てに責任を持つ必要がある。\n"
3227 "B<pthread_attr_setguardsize>(3) を使って設定された\n"
3228 "guard size の値は無視される。\n"
3229 "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n"
3230 "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n"
3231 "スタックオーバーフローの可能性に対処するようにする必要がある。"
3232
3233 #. type: Plain text
3234 #: build/C/man3/pthread_attr_setstack.3:151
3235 msgid ""
3236 "The address specified in I<stackaddr> should be suitably aligned: for full "
3237 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
3238 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
3239 "should also be a multiple of the system page size."
3240 msgstr ""
3241 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
3242 "完全な移植性を持たせるためには、\n"
3243 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
3244 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
3245 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
3246
3247 #. type: Plain text
3248 #: build/C/man3/pthread_attr_setstack.3:159
3249 msgid ""
3250 "If I<attr> is used to create multiple threads, then the caller must change "
3251 "the stack address attribute between calls to B<pthread_create>(3); "
3252 "otherwise, the threads will attempt to use the same memory area for their "
3253 "stacks, and chaos will ensue."
3254 msgstr ""
3255 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
3256 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
3257 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
3258 "さもなければ、複数のスレッドがスタックとして同じメモリ領域を\n"
3259 "使おうとするため、訳の分からない状況が発生してしまう。"
3260
3261 #. type: Plain text
3262 #: build/C/man3/pthread_attr_setstack.3:174
3263 msgid ""
3264 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3265 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3266 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3267 msgstr ""
3268 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3269 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3270 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3271
3272 #. type: TH
3273 #: build/C/man3/pthread_attr_setstackaddr.3:26
3274 #, no-wrap
3275 msgid "PTHREAD_ATTR_SETSTACKADDR"
3276 msgstr "PTHREAD_ATTR_SETSTACKADDR"
3277
3278 #. type: TH
3279 #: build/C/man3/pthread_attr_setstackaddr.3:26
3280 #: build/C/man3/pthread_attr_setstacksize.3:26
3281 #, no-wrap
3282 msgid "2014-05-10"
3283 msgstr "2014-05-10"
3284
3285 #. type: Plain text
3286 #: build/C/man3/pthread_attr_setstackaddr.3:30
3287 msgid ""
3288 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
3289 "attribute in thread attributes object"
3290 msgstr ""
3291 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
3292 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
3293
3294 #. type: Plain text
3295 #: build/C/man3/pthread_attr_setstackaddr.3:38
3296 #, no-wrap
3297 msgid ""
3298 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3299 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3300 msgstr ""
3301 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3302 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3303
3304 #. type: Plain text
3305 #: build/C/man3/pthread_attr_setstackaddr.3:49
3306 msgid ""
3307 "These functions are obsolete: B<do not use them.> Use "
3308 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
3309 msgstr ""
3310 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
3311 "代わりに B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使うこと。"
3312
3313 #. type: Plain text
3314 #: build/C/man3/pthread_attr_setstackaddr.3:60
3315 msgid ""
3316 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
3317 "attribute of the thread attributes object referred to by I<attr> to the "
3318 "value specified in I<stackaddr>.  This attribute specifies the location of "
3319 "the stack that should be used by a thread that is created using the thread "
3320 "attributes object I<attr>."
3321 msgstr ""
3322 "B<pthread_attr_setstackaddr>() 関数は、\n"
3323 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3324 "属性を I<stackaddr> で指定された値に設定する。\n"
3325 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3326 "作成されるスレッドが使用すべきスタックの位置が指定される。"
3327
3328 #. type: Plain text
3329 #: build/C/man3/pthread_attr_setstackaddr.3:66
3330 msgid ""
3331 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
3332 "that was allocated by the caller.  The pages of the allocated buffer should "
3333 "be both readable and writable."
3334 msgstr ""
3335 "I<stackaddr> は呼び出し側が割り当てたバッファ (大きさは\n"
3336 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
3337 "割り当てられたバッファのページは読み書き両方が可能なページと\n"
3338 "なっているべきである。"
3339
3340 #. type: Plain text
3341 #: build/C/man3/pthread_attr_setstackaddr.3:74
3342 msgid ""
3343 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
3344 "attribute of the thread attributes object referred to by I<attr> in the "
3345 "buffer pointed to by I<stackaddr>."
3346 msgstr ""
3347 "B<pthread_attr_getstackaddr>() は、\n"
3348 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3349 "I<stackaddr> が指すバッファに入れて返す。"
3350
3351 #. type: Plain text
3352 #: build/C/man3/pthread_attr_setstackaddr.3:81
3353 msgid ""
3354 "No errors are defined (but applications should nevertheless handle a "
3355 "possible error return)."
3356 msgstr ""
3357 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
3358 "返り値を処理するようにすべきである)。"
3359
3360 #. type: Plain text
3361 #: build/C/man3/pthread_attr_setstackaddr.3:90
3362 msgid ""
3363 "The B<pthread_attr_setstackaddr>()  and B<pthread_attr_getstackaddr>()  "
3364 "functions are thread-safe."
3365 msgstr "関数 B<pthread_attr_setstackaddr>() と B<pthread_attr_getstackaddr>() はスレッドセーフである。"
3366
3367 #. type: Plain text
3368 #: build/C/man3/pthread_attr_setstackaddr.3:93
3369 msgid ""
3370 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
3371 "POSIX.1-2008 removes the specification of these functions."
3372 msgstr ""
3373 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
3374 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
3375
3376 #. type: Plain text
3377 #: build/C/man3/pthread_attr_setstackaddr.3:117
3378 msgid ""
3379 "I<Do not use these functions!> They cannot be portably used, since they "
3380 "provide no way of specifying the direction of growth or the range of the "
3381 "stack.  For example, on architectures with a stack that grows downward, "
3382 "I<stackaddr> specifies the next address past the I<highest> address of the "
3383 "allocated stack area.  However, on architectures with a stack that grows "
3384 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
3385 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
3386 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
3387 "in the allocated stack area (and the I<stacksize> argument specifies the "
3388 "range of the stack)."
3389 msgstr ""
3390 "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n"
3391 "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n"
3392 "かを指定する手段が提供されていないからである。\n"
3393 "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャ\n"
3394 "では、I<stackaddr> には割り当てられたスタック領域のI<最も大きな>アドレ\n"
3395 "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n"
3396 "方向) に伸びるアーキテクチャでは、I<stackaddr> には割り当てられた\n"
3397 "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n"
3398 "B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) が使用する\n"
3399 "I<stackaddr> は、常に割り当てられたスタック領域の最も小さいアドレス\n"
3400 "へのポインタである (I<stacksize> 引き数はスタックの範囲を指定する)。"
3401
3402 #. type: Plain text
3403 #: build/C/man3/pthread_attr_setstackaddr.3:123
3404 msgid ""
3405 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3406 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3407 msgstr ""
3408 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3409 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3410
3411 #. type: TH
3412 #: build/C/man3/pthread_attr_setstacksize.3:26
3413 #, no-wrap
3414 msgid "PTHREAD_ATTR_SETSTACKSIZE"
3415 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
3416
3417 #. type: Plain text
3418 #: build/C/man3/pthread_attr_setstacksize.3:30
3419 msgid ""
3420 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
3421 "attribute in thread attributes object"
3422 msgstr ""
3423 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
3424 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
3425
3426 #. type: Plain text
3427 #: build/C/man3/pthread_attr_setstacksize.3:38
3428 #, no-wrap
3429 msgid ""
3430 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3431 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3432 msgstr ""
3433 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3434 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3435
3436 #. type: Plain text
3437 #: build/C/man3/pthread_attr_setstacksize.3:49
3438 msgid ""
3439 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
3440 "of the thread attributes object referred to by I<attr> to the value "
3441 "specified in I<stacksize>."
3442 msgstr ""
3443 "B<pthread_attr_setstacksize>() 関数は、\n"
3444 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3445 "属性を I<stacksize> で指定された値に設定する。"
3446
3447 #. type: Plain text
3448 #: build/C/man3/pthread_attr_setstacksize.3:53
3449 msgid ""
3450 "The stack size attribute determines the minimum size (in bytes) that will be "
3451 "allocated for threads created using the thread attributes object I<attr>."
3452 msgstr ""
3453 "スタックサイズ属性により、\n"
3454 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
3455 "に割り当てられる最小サイズ (バイト単位) が決定される。"
3456
3457 #. type: Plain text
3458 #: build/C/man3/pthread_attr_setstacksize.3:61
3459 msgid ""
3460 "The B<pthread_attr_getstacksize>()  function returns the stack size "
3461 "attribute of the thread attributes object referred to by I<attr> in the "
3462 "buffer pointed to by I<stacksize>."
3463 msgstr ""
3464 "B<pthread_attr_getstacksize>() は、\n"
3465 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3466 "I<stacksize> が指すバッファに入れて返す。"
3467
3468 #. type: Plain text
3469 #: build/C/man3/pthread_attr_setstacksize.3:67
3470 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
3471 msgstr "B<pthread_attr_setstacksize>() は以下のエラーで失敗する場合がある。"
3472
3473 #. type: Plain text
3474 #: build/C/man3/pthread_attr_setstacksize.3:72
3475 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
3476 msgstr "スタックサイズが B<PTHREAD_STACK_MIN> (16384) バイト未満である。"
3477
3478 #.  e.g., MacOS
3479 #. type: Plain text
3480 #: build/C/man3/pthread_attr_setstacksize.3:81
3481 msgid ""
3482 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
3483 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
3484 msgstr ""
3485 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
3486 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
3487 "エラー B<EINVAL> で失敗する。"
3488
3489 #. type: Plain text
3490 #: build/C/man3/pthread_attr_setstacksize.3:90
3491 msgid ""
3492 "The B<pthread_attr_setstacksize>()  and B<pthread_attr_getstacksize>()  "
3493 "functions are thread-safe."
3494 msgstr "関数 B<pthread_attr_setstacksize>() と B<pthread_attr_getstacksize>() はスレッドセーフである。"
3495
3496 #. type: Plain text
3497 #: build/C/man3/pthread_attr_setstacksize.3:95
3498 msgid ""
3499 "For details on the default stack size of new threads, see "
3500 "B<pthread_create>(3)."
3501 msgstr ""
3502 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
3503 "B<pthread_create>(3) を参照。"
3504
3505 #. type: Plain text
3506 #: build/C/man3/pthread_attr_setstacksize.3:98
3507 msgid ""
3508 "A thread's stack size is fixed at the time of thread creation.  Only the "
3509 "main thread can dynamically grow its stack."
3510 msgstr ""
3511 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
3512 "メインスレッドだけがスタックを動的に伸ばすことができる。"
3513
3514 #. type: Plain text
3515 #: build/C/man3/pthread_attr_setstacksize.3:103
3516 msgid ""
3517 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
3518 "the size and location of a caller-allocated stack that is to be used by a "
3519 "thread."
3520 msgstr ""
3521 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
3522 "アプリケーションは、スレッドが使用するスタックとして、\n"
3523 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
3524
3525 #. type: Plain text
3526 #: build/C/man3/pthread_attr_setstacksize.3:115
3527 msgid ""
3528 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
3529 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
3530 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
3531 "stack will be at least I<stacksize> bytes."
3532 msgstr ""
3533 "glibc 2.8 の時点では、指定された I<stacksize> が B<STACK_ALIGN> \n"
3534 "(ほとんどのアーキテクチャでは 16 バイト) の倍数でない場合、\n"
3535 "I<stacksize> はI<小さくなる方向に>に丸められる。\n"
3536 "これは POSIX.1-2001 に違反している。\n"
3537 "POSIX.1-2001 では、割り当てらたスタックの大きさは\n"
3538 "少なくとも I<stacksize> バイトになると書かれている。"
3539
3540 #. type: Plain text
3541 #: build/C/man3/pthread_attr_setstacksize.3:118
3542 #: build/C/man3/pthread_join.3:127
3543 msgid "See B<pthread_create>(3)."
3544 msgstr "B<pthread_create>(3) を参照。"
3545
3546 #. type: Plain text
3547 #: build/C/man3/pthread_attr_setstacksize.3:125
3548 msgid ""
3549 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3550 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3551 msgstr ""
3552 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3553 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3554
3555 #. type: TH
3556 #: build/C/man3/pthread_cancel.3:26
3557 #, no-wrap
3558 msgid "PTHREAD_CANCEL"
3559 msgstr "PTHREAD_CANCEL"
3560
3561 #. type: TH
3562 #: build/C/man3/pthread_cancel.3:26
3563 #, no-wrap
3564 msgid "2008-11-17"
3565 msgstr "2008-11-17"
3566
3567 #. type: Plain text
3568 #: build/C/man3/pthread_cancel.3:29
3569 msgid "pthread_cancel - send a cancellation request to a thread"
3570 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
3571
3572 #. type: Plain text
3573 #: build/C/man3/pthread_cancel.3:34
3574 #, no-wrap
3575 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3576 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3577
3578 #. type: Plain text
3579 #: build/C/man3/pthread_cancel.3:49
3580 msgid ""
3581 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
3582 "I<thread>.  Whether and when the target thread reacts to the cancellation "
3583 "request depends on two attributes that are under the control of that thread: "
3584 "its cancelability I<state> and I<type>."
3585 msgstr ""
3586 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
3587 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
3588 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
3589 "I<state> と I<type>により決まる。"
3590
3591 #. type: Plain text
3592 #: build/C/man3/pthread_cancel.3:61
3593 msgid ""
3594 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
3595 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
3596 "has disabled cancellation, then a cancellation request remains queued until "
3597 "the thread enables cancellation.  If a thread has enabled cancellation, then "
3598 "its cancelability type determines when cancellation occurs."
3599 msgstr ""
3600 "あるスレッドの cancelability state は B<pthread_setcancelstate>(3) で\n"
3601 "設定され、I<enabled> と I<disabled> のいずれとなる (I<enabled> が新しい\n"
3602 "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n"
3603 "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n"
3604 "れたままになる。スレッドがキャンセルを有効にしていた場合、\n"
3605 "cancelability type によって、いつキャンセルが発生するかが決まる。"
3606
3607 #. type: Plain text
3608 #: build/C/man3/pthread_cancel.3:77
3609 msgid ""
3610 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3611 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
3612 "Asynchronous cancelability means that the thread can be canceled at any time "
3613 "(usually immediately, but the system does not guarantee this).  Deferred "
3614 "cancelability means that cancellation will be delayed until the thread next "
3615 "calls a function that is a I<cancellation point>.  A list of functions that "
3616 "are or may be cancellation points is provided in B<pthreads>(7)."
3617 msgstr ""
3618 "スレッドのキャンセル種別 (cancelability type) は\n"
3619 "B<pthread_setcanceltype>(3) で設定され、I<asynchronous> か I<deferred>\n"
3620 "のいずれかとなる(I<deferred> が新しいスレッドのデフォルト値である)。\n"
3621 "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつで\n"
3622 "もキャンセルされることを意味する (通常はすぐにキャンセルされるが、\n"
3623 "システムがそのことを保証しているわけではない)。遅延キャンセル\n"
3624 "(deferred cancelability) では、そのスレッドが I<取り消しポイント\n"
3625 "(cancellation point)> となっている関数を次に呼び出すまでキャンセルが\n"
3626 "遅延される。取り消しポイントに設定されていたり設定\n"
3627 "したりできる関数のリストは B<pthreads>(7) に記載している。"
3628
3629 #. type: Plain text
3630 #: build/C/man3/pthread_cancel.3:81
3631 msgid ""
3632 "When a cancellation requested is acted on, the following steps occur for "
3633 "I<thread> (in this order):"
3634 msgstr ""
3635 "キャンセル要求が実行されると、\n"
3636 "I<thread> では以下のステップが (この順序で) 行われる。"
3637
3638 #. type: IP
3639 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:69
3640 #, no-wrap
3641 msgid "1."
3642 msgstr "1."
3643
3644 #. type: Plain text
3645 #: build/C/man3/pthread_cancel.3:86
3646 msgid ""
3647 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3648 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
3649 msgstr ""
3650 "キャンセルクリーンアップハンドラが (push されたのと逆順で)\n"
3651 "取り出され (pop され)、呼び出される。\n"
3652 "(B<pthread_cleanup_push>(3) 参照)"
3653
3654 #. type: IP
3655 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:73
3656 #, no-wrap
3657 msgid "2."
3658 msgstr "2."
3659
3660 #. type: Plain text
3661 #: build/C/man3/pthread_cancel.3:91
3662 msgid ""
3663 "Thread-specific data destructors are called, in an unspecified order.  (See "
3664 "B<pthread_key_create>(3).)"
3665 msgstr ""
3666 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
3667 "呼び出し順序は規定されていない。\n"
3668 "(B<pthread_key_create>(3) 参照)"
3669
3670 #. type: IP
3671 #: build/C/man3/pthread_cancel.3:91 build/C/man3/pthread_cleanup_push.3:83
3672 #, no-wrap
3673 msgid "3."
3674 msgstr "3."
3675
3676 #. type: Plain text
3677 #: build/C/man3/pthread_cancel.3:95
3678 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3679 msgstr "スレッドが終了される。 (B<pthread_exit>(3) 参照)"
3680
3681 #. type: Plain text
3682 #: build/C/man3/pthread_cancel.3:103
3683 msgid ""
3684 "The above steps happen asynchronously with respect to the "
3685 "B<pthread_cancel>()  call; the return status of B<pthread_cancel>()  merely "
3686 "informs the caller whether the cancellation request was successfully queued."
3687 msgstr ""
3688 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
3689 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
3690 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
3691
3692 #. type: Plain text
3693 #: build/C/man3/pthread_cancel.3:112
3694 msgid ""
3695 "After a canceled thread has terminated, a join with that thread using "
3696 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
3697 "status.  (Joining with a thread is the only way to know that cancellation "
3698 "has completed.)"
3699 msgstr ""
3700 "キャンセルされたスレッドが終了された後に、\n"
3701 "B<pthread_join>(3) でそのスレッドを join すると、\n"
3702 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
3703 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
3704
3705 #. type: Plain text
3706 #: build/C/man3/pthread_cancel.3:117
3707 msgid ""
3708 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
3709 "error number."
3710 msgstr ""
3711 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
3712 "エラーの場合、0 以外のエラー番号を返す。"
3713
3714 #. type: TP
3715 #: build/C/man3/pthread_cancel.3:118 build/C/man3/pthread_detach.3:59
3716 #: build/C/man3/pthread_getcpuclockid.3:58 build/C/man3/pthread_join.3:93
3717 #: build/C/man3/pthread_setaffinity_np.3:114
3718 #: build/C/man3/pthread_setschedparam.3:114
3719 #: build/C/man3/pthread_setschedprio.3:70 build/C/man3/pthread_sigqueue.3:85
3720 #, no-wrap
3721 msgid "B<ESRCH>"
3722 msgstr "B<ESRCH>"
3723
3724 #. type: Plain text
3725 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_detach.3:64
3726 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:98
3727 #: build/C/man3/pthread_setaffinity_np.3:119
3728 #: build/C/man3/pthread_setschedparam.3:119
3729 #: build/C/man3/pthread_setschedprio.3:75
3730 msgid "No thread with the ID I<thread> could be found."
3731 msgstr "ID が I<thread> のスレッドが見つからなかった。"
3732
3733 #. type: Plain text
3734 #: build/C/man3/pthread_cancel.3:135
3735 msgid ""
3736 "On Linux, cancellation is implemented using signals.  Under the NPTL "
3737 "threading implementation, the first real-time signal (i.e., signal 32) is "
3738 "used for this purpose.  On LinuxThreads, the second real-time signal is "
3739 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3740 msgstr ""
3741 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装で"
3742 "は、\n"
3743 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
3744 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイ"
3745 "ム\n"
3746 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
3747
3748 #. type: Plain text
3749 #: build/C/man3/pthread_cancel.3:141
3750 msgid ""
3751 "The program below creates a thread and then cancels it.  The main thread "
3752 "joins with the canceled thread to check that its exit status was "
3753 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
3754 "run the program:"
3755 msgstr ""
3756 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルす"
3757 "る。\n"
3758 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
3759 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
3760 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
3761
3762 #. type: Plain text
3763 #: build/C/man3/pthread_cancel.3:149
3764 #, no-wrap
3765 msgid ""
3766 "$ ./a.out\n"
3767 "thread_func(): started; cancellation disabled\n"
3768 "main(): sending cancellation request\n"
3769 "thread_func(): about to enable cancellation\n"
3770 "main(): thread was canceled\n"
3771 msgstr ""
3772 "$ ./a.out\n"
3773 "thread_func(): started; cancellation disabled\n"
3774 "main(): sending cancellation request\n"
3775 "thread_func(): about to enable cancellation\n"
3776 "main(): thread was canceled\n"
3777
3778 #. type: Plain text
3779 #: build/C/man3/pthread_cancel.3:159
3780 #, no-wrap
3781 msgid ""
3782 "#include E<lt>pthread.hE<gt>\n"
3783 "#include E<lt>stdio.hE<gt>\n"
3784 "#include E<lt>errno.hE<gt>\n"
3785 "#include E<lt>stdlib.hE<gt>\n"
3786 "#include E<lt>unistd.hE<gt>\n"
3787 msgstr ""
3788 "#include E<lt>pthread.hE<gt>\n"
3789 "#include E<lt>stdio.hE<gt>\n"
3790 "#include E<lt>errno.hE<gt>\n"
3791 "#include E<lt>stdlib.hE<gt>\n"
3792 "#include E<lt>unistd.hE<gt>\n"
3793
3794 #. type: Plain text
3795 #: build/C/man3/pthread_cancel.3:167
3796 #, no-wrap
3797 msgid ""
3798 "static void *\n"
3799 "thread_func(void *ignored_argument)\n"
3800 "{\n"
3801 "    int s;\n"
3802 msgstr ""
3803 "static void *\n"
3804 "thread_func(void *ignored_argument)\n"
3805 "{\n"
3806 "    int s;\n"
3807
3808 #. type: Plain text
3809 #: build/C/man3/pthread_cancel.3:170
3810 #, no-wrap
3811 msgid ""
3812 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3813 "       immediately react to a cancellation request */\n"
3814 msgstr ""
3815 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3816 "       immediately react to a cancellation request */\n"
3817
3818 #. type: Plain text
3819 #: build/C/man3/pthread_cancel.3:174
3820 #, no-wrap
3821 msgid ""
3822 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3823 "    if (s != 0)\n"
3824 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3825 msgstr ""
3826 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3827 "    if (s != 0)\n"
3828 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3829
3830 #. type: Plain text
3831 #: build/C/man3/pthread_cancel.3:178
3832 #, no-wrap
3833 msgid ""
3834 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3835 "    sleep(5);\n"
3836 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3837 msgstr ""
3838 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3839 "    sleep(5);\n"
3840 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3841
3842 #. type: Plain text
3843 #: build/C/man3/pthread_cancel.3:182
3844 #, no-wrap
3845 msgid ""
3846 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3847 "    if (s != 0)\n"
3848 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3849 msgstr ""
3850 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3851 "    if (s != 0)\n"
3852 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3853
3854 #. type: Plain text
3855 #: build/C/man3/pthread_cancel.3:184
3856 #, no-wrap
3857 msgid "    /* sleep() is a cancellation point */\n"
3858 msgstr "    /* sleep() is a cancellation point */\n"
3859
3860 #. type: Plain text
3861 #: build/C/man3/pthread_cancel.3:186
3862 #, no-wrap
3863 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3864 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3865
3866 #. type: Plain text
3867 #: build/C/man3/pthread_cancel.3:188
3868 #, no-wrap
3869 msgid "    /* Should never get here */\n"
3870 msgstr "    /* Should never get here */\n"
3871
3872 #. type: Plain text
3873 #: build/C/man3/pthread_cancel.3:192
3874 #, no-wrap
3875 msgid ""
3876 "    printf(\"thread_func(): not canceled!\\en\");\n"
3877 "    return NULL;\n"
3878 "}\n"
3879 msgstr ""
3880 "    printf(\"thread_func(): not canceled!\\en\");\n"
3881 "    return NULL;\n"
3882 "}\n"
3883
3884 #. type: Plain text
3885 #: build/C/man3/pthread_cancel.3:199
3886 #, no-wrap
3887 msgid ""
3888 "int\n"
3889 "main(void)\n"
3890 "{\n"
3891 "    pthread_t thr;\n"
3892 "    void *res;\n"
3893 "    int s;\n"
3894 msgstr ""
3895 "int\n"
3896 "main(void)\n"
3897 "{\n"
3898 "    pthread_t thr;\n"
3899 "    void *res;\n"
3900 "    int s;\n"
3901
3902 #. type: Plain text
3903 #: build/C/man3/pthread_cancel.3:201
3904 #, no-wrap
3905 msgid "    /* Start a thread and then send it a cancellation request */\n"
3906 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3907
3908 #. type: Plain text
3909 #: build/C/man3/pthread_cancel.3:205
3910 #, no-wrap
3911 msgid ""
3912 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3913 "    if (s != 0)\n"
3914 "        handle_error_en(s, \"pthread_create\");\n"
3915 msgstr ""
3916 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3917 "    if (s != 0)\n"
3918 "        handle_error_en(s, \"pthread_create\");\n"
3919
3920 #. type: Plain text
3921 #: build/C/man3/pthread_cancel.3:207
3922 #, no-wrap
3923 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3924 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3925
3926 #. type: Plain text
3927 #: build/C/man3/pthread_cancel.3:212
3928 #, no-wrap
3929 msgid ""
3930 "    printf(\"main(): sending cancellation request\\en\");\n"
3931 "    s = pthread_cancel(thr);\n"
3932 "    if (s != 0)\n"
3933 "        handle_error_en(s, \"pthread_cancel\");\n"
3934 msgstr ""
3935 "    printf(\"main(): sending cancellation request\\en\");\n"
3936 "    s = pthread_cancel(thr);\n"
3937 "    if (s != 0)\n"
3938 "        handle_error_en(s, \"pthread_cancel\");\n"
3939
3940 #. type: Plain text
3941 #: build/C/man3/pthread_cancel.3:214
3942 #, no-wrap
3943 msgid "    /* Join with thread to see what its exit status was */\n"
3944 msgstr "    /* Join with thread to see what its exit status was */\n"
3945
3946 #. type: Plain text
3947 #: build/C/man3/pthread_cancel.3:218 build/C/man3/pthread_cleanup_push.3:307
3948 #, no-wrap
3949 msgid ""
3950 "    s = pthread_join(thr, &res);\n"
3951 "    if (s != 0)\n"
3952 "        handle_error_en(s, \"pthread_join\");\n"
3953 msgstr ""
3954 "    s = pthread_join(thr, &res);\n"
3955 "    if (s != 0)\n"
3956 "        handle_error_en(s, \"pthread_join\");\n"
3957
3958 #. type: Plain text
3959 #: build/C/man3/pthread_cancel.3:225
3960 #, no-wrap
3961 msgid ""
3962 "    if (res == PTHREAD_CANCELED)\n"
3963 "        printf(\"main(): thread was canceled\\en\");\n"
3964 "    else\n"
3965 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3966 "    exit(EXIT_SUCCESS);\n"
3967 "}\n"
3968 msgstr ""
3969 "    if (res == PTHREAD_CANCELED)\n"
3970 "        printf(\"main(): thread was canceled\\en\");\n"
3971 "    else\n"
3972 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3973 "    exit(EXIT_SUCCESS);\n"
3974 "}\n"
3975
3976 #. type: Plain text
3977 #: build/C/man3/pthread_cancel.3:238
3978 msgid ""
3979 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3980 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3981 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3982 msgstr ""
3983 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3984 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3985 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3986
3987 #. type: TH
3988 #: build/C/man3/pthread_cleanup_push.3:26
3989 #, no-wrap
3990 msgid "PTHREAD_CLEANUP_PUSH"
3991 msgstr "PTHREAD_CLEANUP_PUSH"
3992
3993 #. type: TH
3994 #: build/C/man3/pthread_cleanup_push.3:26
3995 #, no-wrap
3996 msgid "2008-11-24"
3997 msgstr "2008-11-24"
3998
3999 #. type: Plain text
4000 #: build/C/man3/pthread_cleanup_push.3:30
4001 msgid ""
4002 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
4003 "clean-up handlers"
4004 msgstr ""
4005 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
4006 "キャンセルクリーンアップハンドラの push/pop を行う"
4007
4008 #. type: Plain text
4009 #: build/C/man3/pthread_cleanup_push.3:37
4010 #, no-wrap
4011 msgid ""
4012 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
4013 "B<                          void *>I<arg>B<);>\n"
4014 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
4015 msgstr ""
4016 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
4017 "B<                          void *>I<arg>B<);>\n"
4018 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
4019
4020 #. type: Plain text
4021 #: build/C/man3/pthread_cleanup_push.3:48
4022 msgid ""
4023 "These functions manipulate the calling thread's stack of thread-cancellation "
4024 "clean-up handlers.  A clean-up handler is a function that is automatically "
4025 "executed when a thread is canceled (or in various other circumstances "
4026 "described below); it might, for example, unlock a mutex so that it becomes "
4027 "available to other threads in the process."
4028 msgstr ""
4029 "これらの関数は、呼び出したスレッドのスレッドキャンセル時のクリーンアッ\n"
4030 "プハンドラのスタックの操作を行う。クリーンアップハンドラは、スレッドが\n"
4031 "キャンセルされた場合 (や以下で説明する他の種々の状況において) 自動的に\n"
4032 "実行される関数である。例えば、mutex のロック解除を行い、プロセス内の\n"
4033 "他のスレッドが利用できるようにする関数などが考えられる。"
4034
4035 #. type: Plain text
4036 #: build/C/man3/pthread_cleanup_push.3:59
4037 msgid ""
4038 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
4039 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
4040 "be given I<arg> as its argument."
4041 msgstr ""
4042 "B<pthread_cleanup_push>() 関数は、 I<routine> をクリーンアップ\n"
4043 "ハンドラのスタックの一番上にプッシュする。 I<routine> が後で\n"
4044 "起動される際には、 I<arg> が関数の引き数と渡される。"
4045
4046 #. type: Plain text
4047 #: build/C/man3/pthread_cleanup_push.3:66
4048 msgid ""
4049 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
4050 "stack of clean-up handlers, and optionally executes it if I<execute> is "
4051 "nonzero."
4052 msgstr ""
4053 "B<pthread_cleanup_pop>() 関数は、クリーンアップハンドラの\n"
4054 "スタックの一番上のルーチンを削除する。\n"
4055 "I<execute> が 0 以外の場合にはそのルーチンを追加で実行する。"
4056
4057 #. type: Plain text
4058 #: build/C/man3/pthread_cleanup_push.3:69
4059 msgid ""
4060 "A cancellation clean-up handler is popped from the stack and executed in the "
4061 "following circumstances:"
4062 msgstr ""
4063 "キャンセルクリーンアップハンドラは、以下に示す場合に\n"
4064 "スタックから取り出され実行される。"
4065
4066 #. type: Plain text
4067 #: build/C/man3/pthread_cleanup_push.3:73
4068 msgid ""
4069 "When a thread is canceled, all of the stacked clean-up handlers are popped "
4070 "and executed in the reverse of the order in which they were pushed onto the "
4071 "stack."
4072 msgstr ""
4073 "スレッドがキャンセルされた際に、スタックに登録された全てのクリーン\n"
4074 "アップハンドラが取り出されて、実行される。クリーンアップハンドラの\n"
4075 "実行は、スタックに登録されたのと逆の順序で行われる。"
4076
4077 #. type: Plain text
4078 #: build/C/man3/pthread_cleanup_push.3:83
4079 msgid ""
4080 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
4081 "handlers are executed as described in the preceding point.  (Clean-up "
4082 "handlers are I<not> called if the thread terminates by performing a "
4083 "I<return> from the thread start function.)"
4084 msgstr ""
4085 "スレッドが B<pthread_exit>(3) を呼び出して終了する際に、全てのクリーン\n"
4086 "アップハンドラが上の項目で述べたのと同様に実行される。\n"
4087 "(スレッドがスレッド開始関数からの I<return> の実行により終了する場合に\n"
4088 "は、クリーンアップハンドラはI<呼び出されない>。)"
4089
4090 #. type: Plain text
4091 #: build/C/man3/pthread_cleanup_push.3:89
4092 msgid ""
4093 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
4094 "argument, the top-most clean-up handler is popped and executed."
4095 msgstr ""
4096 "スレッドが 0 以外の I<execute> 引き数で B<pthread_cleanup_pop>() を\n"
4097 "呼び出した際に、スタックの一番上のクリーンアップハンドラが取り出されて\n"
4098 "実行される。"
4099
4100 #. type: Plain text
4101 #: build/C/man3/pthread_cleanup_push.3:101
4102 msgid ""
4103 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
4104 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
4105 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
4106 "calls to these functions are paired within the same function, and at the "
4107 "same lexical nesting level.  (In other words, a clean-up handler is "
4108 "established only during the execution of a specified section of code.)"
4109 msgstr ""
4110 "POSIX.1 では、 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>() を\n"
4111 "それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開するマクロと\n"
4112 "して実装することを許容している。\n"
4113 "このため、呼び出し側では、これらの関数の呼び出しが同じ関数の中で対と\n"
4114 "なり、かつ文法的に同じネストレベル (nesting level) になることを保証\n"
4115 "しなければならない。 (言い換えると、クリーンアップハンドラは、コード\n"
4116 "の特定のセクションの実行の中でのみ設定するものであると言える。)"
4117
4118 #. type: Plain text
4119 #: build/C/man3/pthread_cleanup_push.3:121
4120 msgid ""
4121 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
4122 "call has been made to B<pthread_cleanup_push>()  or "
4123 "B<pthread_cleanup_pop>()  without the matching call of the pair since the "
4124 "jump buffer was filled by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, "
4125 "calling B<longjmp>(3)  (B<siglongjmp>(3))  from inside a clean-up handler "
4126 "produces undefined results unless the jump buffer was also filled by "
4127 "B<setjmp>(3)  (B<sigsetjmp>(3))  inside the handler."
4128 msgstr ""
4129 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しは、\n"
4130 "B<pthread_cleanup_push>() や B<pthread_cleanup_pop>() の呼び出しが対と\n"
4131 "なる呼び出しがない状態で行われた場合には、どのような結果になるかは不定\n"
4132 "である。これは jump バッファは B<setjmp>(3) (B<sigsetjmp>(3)) により設\n"
4133 "定されるからである。同様に、クリーンアップハンドラ内からの\n"
4134 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しも、jump バッファがハンドラ\n"
4135 "内で B<setjmp>(3) (B<sigsetjmp>(3)) で設定されていない限り、どのような\n"
4136 "結果になるかは不定である。"
4137
4138 #. type: Plain text
4139 #: build/C/man3/pthread_cleanup_push.3:123
4140 msgid "These functions do not return a value."
4141 msgstr "これらの関数は値を返さない。"
4142
4143 #.  SH VERSIONS
4144 #.  Available since glibc 2.0
4145 #. type: Plain text
4146 #: build/C/man3/pthread_cleanup_push.3:127
4147 msgid "There are no errors."
4148 msgstr "エラーはない。"
4149
4150 #. type: Plain text
4151 #: build/C/man3/pthread_cleanup_push.3:140
4152 msgid ""
4153 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
4154 "functions I<are> implemented as macros that expand to text containing "
4155 "\\(aqB<{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
4156 "declared within the scope of paired calls to these functions will be visible "
4157 "within only that scope."
4158 msgstr ""
4159 "Linux では、関数 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>()\n"
4160 "は、それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開する\n"
4161 "マクロとして実装されている。このことは、これらの関数を対で呼び出した\n"
4162 "スコープ内で宣言された変数は、そのスコープの中でしか参照できない\n"
4163 "ということを意味している。"
4164
4165 #.  The text was actually added in the 2004 TC2
4166 #. type: Plain text
4167 #: build/C/man3/pthread_cleanup_push.3:155
4168 msgid ""
4169 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
4170 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
4171 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
4172 "avoid doing this."
4173 msgstr ""
4174 "POSIX.1 には、括弧を含む B<pthread_cleanup_push>() と\n"
4175 "B<pthread_cleanup_pop>() のブロックをそのままにしたままで、 \n"
4176 "I<return>, I<break>, I<continue>, I<goto> を使った場合の影響は\n"
4177 "不定であると書かれている。\n"
4178 "移植性が必要なアプリケーションではこれを行うのは避けるべきである。"
4179
4180 #. type: Plain text
4181 #: build/C/man3/pthread_cleanup_push.3:170
4182 msgid ""
4183 "The program below provides a simple example of the use of the functions "
4184 "described in this page.  The program creates a thread that executes a loop "
4185 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
4186 "loop increments a global variable, I<cnt>, once each second.  Depending on "
4187 "what command-line arguments are supplied, the main thread sends the other "
4188 "thread a cancellation request, or sets a global variable that causes the "
4189 "other thread to exit its loop and terminate normally (by doing a I<return>)."
4190 msgstr ""
4191 "以下のプログラムは、このページで説明した関数の簡単な使用例を示すもので\n"
4192 "ある。このプログラムは B<pthread_cleanup_push>() と\n"
4193 "B<pthread_cleanup_pop>() で囲まれたループを実行するスレッドを作成する。\n"
4194 "このループではグローバル変数 I<cnt> を 1 秒に 1 ずつ増やしていく。\n"
4195 "指定されたコマンドライン引き数の内容に基づいて、メインスレッドはもう一\n"
4196 "つのスレッドにキャンセル要求を送ったり、もう一つのスレッドがループを\n"
4197 "抜けて (I<return> を呼び出して) 正常終了するようにグローバル変数を\n"
4198 "設定したりする。"
4199
4200 #. type: Plain text
4201 #: build/C/man3/pthread_cleanup_push.3:173
4202 msgid ""
4203 "In the following shell session, the main thread sends a cancellation request "
4204 "to the other thread:"
4205 msgstr ""
4206 "以下のシェルセッションでは、メインスレッドはもう一つのスレッドに\n"
4207 "キャンセル要求を送信する。"
4208
4209 #. type: Plain text
4210 #: build/C/man3/pthread_cleanup_push.3:183
4211 #, no-wrap
4212 msgid ""
4213 "$ B<./a.out>\n"
4214 "New thread started\n"
4215 "cnt = 0\n"
4216 "cnt = 1\n"
4217 "Canceling thread\n"
4218 "Called clean-up handler\n"
4219 "Thread was canceled; cnt = 0\n"
4220 msgstr ""
4221 "$ B<./a.out>\n"
4222 "New thread started\n"
4223 "cnt = 0\n"
4224 "cnt = 1\n"
4225 "Canceling thread\n"
4226 "Called clean-up handler\n"
4227 "Thread was canceled; cnt = 0\n"
4228
4229 #. type: Plain text
4230 #: build/C/man3/pthread_cleanup_push.3:191
4231 msgid ""
4232 "From the above, we see that the thread was canceled, and that the "
4233 "cancellation clean-up handler was called and it reset the value of the "
4234 "global variable I<cnt> to 0."
4235 msgstr ""
4236 "上記の実行例から、スレッドがキャンセルされ、\n"
4237 "キャンセルクリーンアップハンドラが呼び出され、\n"
4238 "グローバル変数 I<cnt> の値が 0 にリセットされていることが確認できる。"
4239
4240 #. type: Plain text
4241 #: build/C/man3/pthread_cleanup_push.3:194
4242 msgid ""
4243 "In the next run, the main program sets a global variable that causes other "
4244 "thread to terminate normally:"
4245 msgstr ""
4246 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4247 "もう一つのスレッドが正常終了するようにしている。"
4248
4249 #. type: Plain text
4250 #: build/C/man3/pthread_cleanup_push.3:202
4251 #, no-wrap
4252 msgid ""
4253 "$ B<./a.out x>\n"
4254 "New thread started\n"
4255 "cnt = 0\n"
4256 "cnt = 1\n"
4257 "Thread terminated normally; cnt = 2\n"
4258 msgstr ""
4259 "$ B<./a.out x>\n"
4260 "New thread started\n"
4261 "cnt = 0\n"
4262 "cnt = 1\n"
4263 "Thread terminated normally; cnt = 2\n"
4264
4265 #. type: Plain text
4266 #: build/C/man3/pthread_cleanup_push.3:210
4267 msgid ""
4268 "From the above, we see that the clean-up handler was not executed (because "
4269 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
4270 msgstr ""
4271 "上記では、 (I<cleanup_pop_arg> が 0 なので) クリーンアップハンドラは\n"
4272 "実行されておらず、その結果 I<cnt> の値はリセットされていないことが\n"
4273 "分かる。"
4274
4275 #. type: Plain text
4276 #: build/C/man3/pthread_cleanup_push.3:215
4277 msgid ""
4278 "In the next run, the main program sets a global variable that causes the "
4279 "other thread to terminate normally, and supplies a nonzero value for "
4280 "I<cleanup_pop_arg>:"
4281 msgstr ""
4282 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4283 "もう一つのスレッドが正常終了するようにし、さらに\n"
4284 "I<cleanup_pop_arg> に 0 以外の値を渡している。"
4285
4286 #. type: Plain text
4287 #: build/C/man3/pthread_cleanup_push.3:224
4288 #, no-wrap
4289 msgid ""
4290 "$ B<./a.out x 1>\n"
4291 "New thread started\n"
4292 "cnt = 0\n"
4293 "cnt = 1\n"
4294 "Called clean-up handler\n"
4295 "Thread terminated normally; cnt = 0\n"
4296 msgstr ""
4297 "$ B<./a.out x 1>\n"
4298 "New thread started\n"
4299 "cnt = 0\n"
4300 "cnt = 1\n"
4301 "Called clean-up handler\n"
4302 "Thread terminated normally; cnt = 0\n"
4303
4304 #. type: Plain text
4305 #: build/C/man3/pthread_cleanup_push.3:231
4306 msgid ""
4307 "In the above, we see that although the thread was not canceled, the clean-up "
4308 "handler was executed, because the argument given to "
4309 "B<pthread_cleanup_pop>()  was nonzero."
4310 msgstr ""
4311 "上記では、スレッドはキャンセルされていないが、クリーンアップハンドラが\n"
4312 "実行されていないことが分かる。これは B<pthread_cleanup_pop>() の引き数\n"
4313 "に 0 以外を渡したからである。"
4314
4315 #. type: Plain text
4316 #: build/C/man3/pthread_cleanup_push.3:240
4317 #, no-wrap
4318 msgid ""
4319 "#include E<lt>pthread.hE<gt>\n"
4320 "#include E<lt>sys/types.hE<gt>\n"
4321 "#include E<lt>stdio.hE<gt>\n"
4322 "#include E<lt>stdlib.hE<gt>\n"
4323 "#include E<lt>unistd.hE<gt>\n"
4324 "#include E<lt>errno.hE<gt>\n"
4325 msgstr ""
4326 "#include E<lt>pthread.hE<gt>\n"
4327 "#include E<lt>sys/types.hE<gt>\n"
4328 "#include E<lt>stdio.hE<gt>\n"
4329 "#include E<lt>stdlib.hE<gt>\n"
4330 "#include E<lt>unistd.hE<gt>\n"
4331 "#include E<lt>errno.hE<gt>\n"
4332
4333 #. type: Plain text
4334 #: build/C/man3/pthread_cleanup_push.3:247
4335 #, no-wrap
4336 msgid ""
4337 "static int done = 0;\n"
4338 "static int cleanup_pop_arg = 0;\n"
4339 "static int cnt = 0;\n"
4340 msgstr ""
4341 "static int done = 0;\n"
4342 "static int cleanup_pop_arg = 0;\n"
4343 "static int cnt = 0;\n"
4344
4345 #. type: Plain text
4346 #: build/C/man3/pthread_cleanup_push.3:254
4347 #, no-wrap
4348 msgid ""
4349 "static void\n"
4350 "cleanup_handler(void *arg)\n"
4351 "{\n"
4352 "    printf(\"Called clean-up handler\\en\");\n"
4353 "    cnt = 0;\n"
4354 "}\n"
4355 msgstr ""
4356 "static void\n"
4357 "cleanup_handler(void *arg)\n"
4358 "{\n"
4359 "    printf(\"Called clean-up handler\\en\");\n"
4360 "    cnt = 0;\n"
4361 "}\n"
4362
4363 #. type: Plain text
4364 #: build/C/man3/pthread_cleanup_push.3:259
4365 #, no-wrap
4366 msgid ""
4367 "static void *\n"
4368 "thread_start(void *arg)\n"
4369 "{\n"
4370 "    time_t start, curr;\n"
4371 msgstr ""
4372 "static void *\n"
4373 "thread_start(void *arg)\n"
4374 "{\n"
4375 "    time_t start, curr;\n"
4376
4377 #. type: Plain text
4378 #: build/C/man3/pthread_cleanup_push.3:261
4379 #, no-wrap
4380 msgid "    printf(\"New thread started\\en\");\n"
4381 msgstr "    printf(\"New thread started\\en\");\n"
4382
4383 #. type: Plain text
4384 #: build/C/man3/pthread_cleanup_push.3:263
4385 #, no-wrap
4386 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4387 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4388
4389 #. type: Plain text
4390 #: build/C/man3/pthread_cleanup_push.3:265
4391 #, no-wrap
4392 msgid "    curr = start = time(NULL);\n"
4393 msgstr "    curr = start = time(NULL);\n"
4394
4395 #. type: Plain text
4396 #: build/C/man3/pthread_cleanup_push.3:274
4397 #, no-wrap
4398 msgid ""
4399 "    while (!done) {\n"
4400 "        pthread_testcancel();           /* A cancellation point */\n"
4401 "        if (curr E<lt> time(NULL)) {\n"
4402 "            curr = time(NULL);\n"
4403 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4404 "            cnt++;\n"
4405 "        }\n"
4406 "    }\n"
4407 msgstr ""
4408 "    while (!done) {\n"
4409 "        pthread_testcancel();           /* A cancellation point */\n"
4410 "        if (curr E<lt> time(NULL)) {\n"
4411 "            curr = time(NULL);\n"
4412 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4413 "            cnt++;\n"
4414 "        }\n"
4415 "    }\n"
4416
4417 #. type: Plain text
4418 #: build/C/man3/pthread_cleanup_push.3:278
4419 #, no-wrap
4420 msgid ""
4421 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4422 "    return NULL;\n"
4423 "}\n"
4424 msgstr ""
4425 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4426 "    return NULL;\n"
4427 "}\n"
4428
4429 #. type: Plain text
4430 #: build/C/man3/pthread_cleanup_push.3:285
4431 #, no-wrap
4432 msgid ""
4433 "int\n"
4434 "main(int argc, char *argv[])\n"
4435 "{\n"
4436 "    pthread_t thr;\n"
4437 "    int s;\n"
4438 "    void *res;\n"
4439 msgstr ""
4440 "int\n"
4441 "main(int argc, char *argv[])\n"
4442 "{\n"
4443 "    pthread_t thr;\n"
4444 "    int s;\n"
4445 "    void *res;\n"
4446
4447 #. type: Plain text
4448 #: build/C/man3/pthread_cleanup_push.3:289
4449 #, no-wrap
4450 msgid ""
4451 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4452 "    if (s != 0)\n"
4453 "        handle_error_en(s, \"pthread_create\");\n"
4454 msgstr ""
4455 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4456 "    if (s != 0)\n"
4457 "        handle_error_en(s, \"pthread_create\");\n"
4458
4459 #. type: Plain text
4460 #: build/C/man3/pthread_cleanup_push.3:291
4461 #, no-wrap
4462 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
4463 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
4464
4465 #. type: Plain text
4466 #: build/C/man3/pthread_cleanup_push.3:296
4467 #, no-wrap
4468 msgid ""
4469 "    if (argc E<gt> 1) {\n"
4470 "        if (argc E<gt> 2)\n"
4471 "            cleanup_pop_arg = atoi(argv[2]);\n"
4472 "        done = 1;\n"
4473 msgstr ""
4474 "    if (argc E<gt> 1) {\n"
4475 "        if (argc E<gt> 2)\n"
4476 "            cleanup_pop_arg = atoi(argv[2]);\n"
4477 "        done = 1;\n"
4478
4479 #. type: Plain text
4480 #: build/C/man3/pthread_cleanup_push.3:303
4481 #, no-wrap
4482 msgid ""
4483 "    } else {\n"
4484 "        printf(\"Canceling thread\\en\");\n"
4485 "        s = pthread_cancel(thr);\n"
4486 "        if (s != 0)\n"
4487 "            handle_error_en(s, \"pthread_cancel\");\n"
4488 "    }\n"
4489 msgstr ""
4490 "    } else {\n"
4491 "        printf(\"Canceling thread\\en\");\n"
4492 "        s = pthread_cancel(thr);\n"
4493 "        if (s != 0)\n"
4494 "            handle_error_en(s, \"pthread_cancel\");\n"
4495 "    }\n"
4496
4497 #. type: Plain text
4498 #: build/C/man3/pthread_cleanup_push.3:314
4499 #, no-wrap
4500 msgid ""
4501 "    if (res == PTHREAD_CANCELED)\n"
4502 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4503 "    else\n"
4504 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4505 "    exit(EXIT_SUCCESS);\n"
4506 "}\n"
4507 msgstr ""
4508 "    if (res == PTHREAD_CANCELED)\n"
4509 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4510 "    else\n"
4511 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4512 "    exit(EXIT_SUCCESS);\n"
4513 "}\n"
4514
4515 #. type: Plain text
4516 #: build/C/man3/pthread_cleanup_push.3:321
4517 msgid ""
4518 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4519 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4520 msgstr ""
4521 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4522 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4523
4524 #. type: TH
4525 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
4526 #, no-wrap
4527 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4528 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4529
4530 #. type: TH
4531 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
4532 #, no-wrap
4533 msgid "2008-12-04"
4534 msgstr "2008-12-04"
4535
4536 #. type: Plain text
4537 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
4538 msgid ""
4539 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
4540 "thread cancellation clean-up handlers while saving cancelability type"
4541 msgstr ""
4542 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - "
4543 "cancelability type を保持したままでスレッドのキャンセルクリーンアップハンドラ"
4544 "の push/pop を行う"
4545
4546 #. type: Plain text
4547 #: build/C/man3/pthread_cleanup_push_defer_np.3:37
4548 #, no-wrap
4549 msgid ""
4550 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4551 "B<                                   void *>I<arg>B<);>\n"
4552 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4553 msgstr ""
4554 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4555 "B<                                   void *>I<arg>B<);>\n"
4556 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4557
4558 #. type: Plain text
4559 #: build/C/man3/pthread_cleanup_push_defer_np.3:40
4560 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
4561 #: build/C/man3/pthread_join.3:37 build/C/man3/pthread_kill.3:37
4562 #: build/C/man3/pthread_setname_np.3:39 build/C/man3/pthread_sigmask.3:38
4563 #: build/C/man3/pthread_sigqueue.3:37 build/C/man3/pthread_tryjoin_np.3:42
4564 #: build/C/man3/pthread_yield.3:37
4565 msgid "Compile and link with I<-pthread>."
4566 msgstr "I<-pthread> を付けてコンパイルとリンクを行う。"
4567
4568 #. type: Plain text
4569 #: build/C/man3/pthread_cleanup_push_defer_np.3:46
4570 msgid ""
4571 "These functions are the same as B<pthread_cleanup_push>(3)  and "
4572 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
4573 msgstr ""
4574 "これらの関数は B<pthread_cleanup_push>(3) と B<pthread_cleanup_pop>(3) と同じ"
4575 "だが、このページで説明する点が異なる。"
4576
4577 #. type: Plain text
4578 #: build/C/man3/pthread_cleanup_push_defer_np.3:59
4579 msgid ""
4580 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
4581 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
4582 "addition, it also saves the thread's current cancelability type, and sets "
4583 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
4584 "this ensures that cancellation clean-up will occur even if the thread's "
4585 "cancelability type was \"asynchronous\" before the call."
4586 msgstr ""
4587 "B<pthread_cleanup_push>(3) と同様に、\n"
4588 "B<pthread_cleanup_push_defer_np>() は I<routine> をそのスレッドの\n"
4589 "クリーンアップハンドラのスタックに追加する。これに加えて、\n"
4590 "B<pthread_cleanup_push_defer_np>() は現在の cancelability type も\n"
4591 "保存し、cancelability type は \"deferred\" に設定する\n"
4592 "(B<pthread_setcanceltype>(3) 参照)。\n"
4593 "これにより、この関数が呼び出される前のスレッドの cancelability type が\n"
4594 "\"asynchronous\" であったとしても、キャンセルクリーンアップが行われること\n"
4595 "が保証される。"
4596
4597 #. type: Plain text
4598 #: build/C/man3/pthread_cleanup_push_defer_np.3:68
4599 msgid ""
4600 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
4601 "the top-most clean-up handler from the thread's stack of cancellation clean-"
4602 "up handlers.  In addition, it restores the thread's cancelability type to "
4603 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
4604 msgstr ""
4605 "B<pthread_cleanup_pop>(3) と同様に、\n"
4606 "B<pthread_cleanup_pop_restore_np>() はそのスレッドのキャンセル\n"
4607 "クリーンアップハンドラのスタックから一番上にあるクリーンアップハンドラ\n"
4608 "を取り出す。これに加えて、そのスレッドの cancelability type を、対応\n"
4609 "する B<pthread_cleanup_push_defer_np>() が呼ばれた時点の値に戻す。"
4610
4611 #. type: Plain text
4612 #: build/C/man3/pthread_cleanup_push_defer_np.3:74
4613 msgid ""
4614 "The caller must ensure that calls to these functions are paired within the "
4615 "same function, and at the same lexical nesting level.  Other restrictions "
4616 "apply, as described in B<pthread_cleanup_push>(3)."
4617 msgstr ""
4618 "呼び出し側では、これらの関数の呼び出しが同じ関数の中で対となり、かつ\n"
4619 "文法的に同じネストレベル (nesting level) になることを保証しなければ\n"
4620 "ならない。 B<pthread_cleanup_push>(3) で説明されている他の制限も\n"
4621 "適用される。"
4622
4623 #. type: Plain text
4624 #: build/C/man3/pthread_cleanup_push_defer_np.3:76
4625 msgid "This sequence of calls:"
4626 msgstr "以下の一連の呼び出し"
4627
4628 #. type: Plain text
4629 #: build/C/man3/pthread_cleanup_push_defer_np.3:81
4630 #, no-wrap
4631 msgid ""
4632 "pthread_cleanup_push_defer_np(routine, arg);\n"
4633 "pthread_cleanup_pop_restore_np(execute);\n"
4634 msgstr ""
4635 "pthread_cleanup_push_defer_np(routine, arg);\n"
4636 "pthread_cleanup_pop_restore_np(execute);\n"
4637
4638 #. type: Plain text
4639 #: build/C/man3/pthread_cleanup_push_defer_np.3:85
4640 msgid "is equivalent to (but shorter and more efficient than):"
4641 msgstr "と以下は等価である (但し、上の方がより簡潔で効率的である)。"
4642
4643 #. type: Plain text
4644 #: build/C/man3/pthread_cleanup_push_defer_np.3:91
4645 #, no-wrap
4646 msgid "int oldtype;\n"
4647 msgstr "int oldtype;\n"
4648
4649 #. type: Plain text
4650 #: build/C/man3/pthread_cleanup_push_defer_np.3:97
4651 #, no-wrap
4652 msgid ""
4653 "pthread_cleanup_push(routine, arg);\n"
4654 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4655 "\\&...\n"
4656 "pthread_setcanceltype(oldtype, NULL);\n"
4657 "pthread_cleanup_pop(execute);\n"
4658 msgstr ""
4659 "pthread_cleanup_push(routine, arg);\n"
4660 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4661 "\\&...\n"
4662 "pthread_setcanceltype(oldtype, NULL);\n"
4663 "pthread_cleanup_pop(execute);\n"
4664
4665 #. type: Plain text
4666 #: build/C/man3/pthread_cleanup_push_defer_np.3:110
4667 msgid ""
4668 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
4669 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4670 msgstr ""
4671 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
4672 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4673
4674 #. type: TH
4675 #: build/C/man3/pthread_create.3:26
4676 #, no-wrap
4677 msgid "PTHREAD_CREATE"
4678 msgstr "PTHREAD_CREATE"
4679
4680 #. type: TH
4681 #: build/C/man3/pthread_create.3:26
4682 #, no-wrap
4683 msgid "2012-08-03"
4684 msgstr "2012-08-03"
4685
4686 #. type: Plain text
4687 #: build/C/man3/pthread_create.3:29
4688 msgid "pthread_create - create a new thread"
4689 msgstr "pthread_create - 新しいスレッドを作成する"
4690
4691 #. type: Plain text
4692 #: build/C/man3/pthread_create.3:35
4693 #, no-wrap
4694 msgid ""
4695 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4696 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4697 msgstr ""
4698 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4699 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4700
4701 #. type: Plain text
4702 #: build/C/man3/pthread_create.3:47
4703 msgid ""
4704 "The B<pthread_create>()  function starts a new thread in the calling "
4705 "process.  The new thread starts execution by invoking I<start_routine>(); "
4706 "I<arg> is passed as the sole argument of I<start_routine>()."
4707 msgstr ""
4708 "B<pthread_create>() 関数は、呼び出したプロセス内に新しいスレッドを作成す"
4709 "る。\n"
4710 "新しいスレッドの実行は、 I<start_routine>() を起動することで開始される。\n"
4711 "I<start_routine>() は引き数を一つだけ取り、\n"
4712 "I<arg> が I<start_routine>() の引き数として渡される。"
4713
4714 #. type: Plain text
4715 #: build/C/man3/pthread_create.3:49
4716 msgid "The new thread terminates in one of the following ways:"
4717 msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。"
4718
4719 #. type: IP
4720 #: build/C/man3/pthread_create.3:49 build/C/man3/pthread_create.3:55
4721 #: build/C/man3/pthread_create.3:63 build/C/man3/pthread_create.3:66
4722 #: build/C/man3/pthread_getattr_np.3:52 build/C/man3/pthread_getattr_np.3:55
4723 #: build/C/man3/pthread_getattr_np.3:58
4724 #, no-wrap
4725 msgid "*"
4726 msgstr "*"
4727
4728 #. type: Plain text
4729 #: build/C/man3/pthread_create.3:55
4730 msgid ""
4731 "It calls B<pthread_exit>(3), specifying an exit status value that is "
4732 "available to another thread in the same process that calls "
4733 "B<pthread_join>(3)."
4734 msgstr ""
4735 "スレッドが B<pthread_exit>(3) を呼び出す。\n"
4736 "B<pthread_exit>(3) を呼び出す際には終了ステータス値を指定する。\n"
4737 "この値は B<pthread_join>(3) を呼び出した同じプロセス内の\n"
4738 "別のスレッドで参照できる。"
4739
4740 #. type: Plain text
4741 #: build/C/man3/pthread_create.3:63
4742 msgid ""
4743 "It returns from I<start_routine>().  This is equivalent to calling "
4744 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
4745 msgstr ""
4746 "スレッドが I<start_routine>() から返る。これは、\n"
4747 "I<return> 文に渡した値で B<pthread_exit>(3) を呼び出すのと等価である。"
4748
4749 #. type: Plain text
4750 #: build/C/man3/pthread_create.3:66
4751 msgid "It is canceled (see B<pthread_cancel>(3))."
4752 msgstr "スレッドがキャンセルされる (B<pthread_cancel>(3) 参照)。"
4753
4754 #. type: Plain text
4755 #: build/C/man3/pthread_create.3:72
4756 msgid ""
4757 "Any of the threads in the process calls B<exit>(3), or the main thread "
4758 "performs a return from I<main>().  This causes the termination of all "
4759 "threads in the process."
4760 msgstr ""
4761 "プロセス内のいずれかのスレッドで B<exit>(3) が呼ばれるか、\n"
4762 "メインスレッドで I<main>() 内で return が実行される。\n"
4763 "この場合は、プロセス内の全てのスレッドが終了される。"
4764
4765 #. type: Plain text
4766 #: build/C/man3/pthread_create.3:86
4767 msgid ""
4768 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4769 "are used at thread creation time to determine attributes for the new thread; "
4770 "this structure is initialized using B<pthread_attr_init>(3)  and related "
4771 "functions.  If I<attr> is NULL, then the thread is created with default "
4772 "attributes."
4773 msgstr ""
4774 "I<attr> 引き数は I<pthread_attr_t> 構造体へのポインタであり、\n"
4775 "I<pthread_attr_t> 構造体の内容を使用して、スレッド作成時に\n"
4776 "新しいスレッドの属性が決定される。\n"
4777 "この構造体は B<pthread_attr_init>(3) や関連の関数を使って初期化される。\n"
4778 "I<attr> が NULL の場合、新しいスレッドはデフォルトの属性で作成される。"
4779
4780 #. type: Plain text
4781 #: build/C/man3/pthread_create.3:93
4782 msgid ""
4783 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
4784 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4785 "used to refer to the thread in subsequent calls to other pthreads functions."
4786 msgstr ""
4787 "成功した場合は、 B<pthread_create>() は返る前に新しいスレッドの ID を\n"
4788 "I<thread> が指すバッファに格納する。この ID は、これ以降に他の\n"
4789 "pthreads 関数の呼び出しでスレッドを参照するのに使用される。"
4790
4791 #. type: Plain text
4792 #: build/C/man3/pthread_create.3:101
4793 msgid ""
4794 "The new thread inherits a copy of the creating thread's signal mask "
4795 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
4796 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
4797 "thread's alternate signal stack (B<sigaltstack>(2))."
4798 msgstr ""
4799 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスク\n"
4800 "(B<pthread_sigmask>(3) 参照) のコピーを継承する。\n"
4801 "新しいスレッドの処理待ちシグナル (B<sigpending>(2)) の集合は空となる。\n"
4802 "新しいスレッドはスレッドを作成したスレッドの代替シグナルスタック\n"
4803 "(B<sigaltstack>(2)) を継承しない。"
4804
4805 #. type: Plain text
4806 #: build/C/man3/pthread_create.3:104
4807 msgid ""
4808 "The new thread inherits the calling thread's floating-point environment "
4809 "(B<fenv>(3))."
4810 msgstr ""
4811 "新しいスレッドは呼び出したスレッドの浮動小数点環境 (B<fenv>(3))\n"
4812 "を継承する。"
4813
4814 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4815 #. type: Plain text
4816 #: build/C/man3/pthread_create.3:109
4817 msgid ""
4818 "The initial value of the new thread's CPU-time clock is 0 (see "
4819 "B<pthread_getcpuclockid>(3))."
4820 msgstr ""
4821 "新しいスレッドの CPU 時間時計の初期値は 0 である\n"
4822 "(B<pthread_getcpuclockid>(3) 参照)。"
4823
4824 #. type: SS
4825 #: build/C/man3/pthread_create.3:109
4826 #, no-wrap
4827 msgid "Linux-specific details"
4828 msgstr "Linux 固有の詳細"
4829
4830 #. type: Plain text
4831 #: build/C/man3/pthread_create.3:115
4832 msgid ""
4833 "The new thread inherits copies of the calling thread's capability sets (see "
4834 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4835 msgstr ""
4836 "新しいスレッドは、呼び出したスレッドの\n"
4837 "ケーパビリティセット (B<capabilities>(7) 参照) と \n"
4838 "CPU affinity マスク (B<sched_setaffinity>(2) 参照) の\n"
4839 "コピーをを継承しない。"
4840
4841 #. type: Plain text
4842 #: build/C/man3/pthread_create.3:122
4843 msgid ""
4844 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
4845 "number, and the contents of I<*thread> are undefined."
4846 msgstr ""
4847 "成功すると、 B<pthread_create>() は 0 を返す。\n"
4848 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
4849
4850 #. type: TP
4851 #: build/C/man3/pthread_create.3:123 build/C/man3/pthread_sigqueue.3:71
4852 #, no-wrap
4853 msgid "B<EAGAIN>"
4854 msgstr "B<EAGAIN>"
4855
4856 #. type: Plain text
4857 #: build/C/man3/pthread_create.3:137
4858 msgid ""
4859 "Insufficient resources to create another thread, or a system-imposed limit "
4860 "on the number of threads was encountered.  The latter case may occur in two "
4861 "ways: the B<RLIMIT_NPROC> soft resource limit (set via B<setrlimit>(2)), "
4862 "which limits the number of process for a real user ID, was reached; or the "
4863 "kernel's system-wide limit on the number of threads, I</proc/sys/kernel/"
4864 "threads-max>, was reached."
4865 msgstr ""
4866 "別のスレッドを作成するのに十分なリソースがないか、システムで設定された\n"
4867 "スレッド数の上限に達していた。後者が起こるのは 2 つの場合がある。\n"
4868 "一つは、実ユーザ ID 当たりのプロセス数の上限である、B<RLIMIT_NPROC> \n"
4869 "ソフトリソース上限 (B<setrlimit>(2) で設定できる) に達していた場合\n"
4870 "である。もう一つはカーネルのシステム全体のスレッド数の上限である\n"
4871 "I</proc/sys/kernel/threads-max> が達していた場合である。"
4872
4873 #. type: Plain text
4874 #: build/C/man3/pthread_create.3:141
4875 msgid "Invalid settings in I<attr>."
4876 msgstr "I<attr> で指定された設定が不正である。"
4877
4878 #. type: TP
4879 #: build/C/man3/pthread_create.3:141 build/C/man3/pthread_setschedparam.3:129
4880 #: build/C/man3/pthread_setschedprio.3:66
4881 #, no-wrap
4882 msgid "B<EPERM>"
4883 msgstr "B<EPERM>"
4884
4885 #. type: Plain text
4886 #: build/C/man3/pthread_create.3:146
4887 msgid ""
4888 "No permission to set the scheduling policy and parameters specified in "
4889 "I<attr>."
4890 msgstr ""
4891 "I<attr> に指定されたスケジューリングポリシーとパラメータを\n"
4892 "設定する許可がない。"
4893
4894 #. type: Plain text
4895 #: build/C/man3/pthread_create.3:160
4896 msgid ""
4897 "See B<pthread_self>(3)  for further information on the thread ID returned in "
4898 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
4899 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4900 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4901 msgstr ""
4902 "B<pthread_create>() が I<*thread> で返すスレッド ID についての\n"
4903 "詳しい情報は B<pthread_self>(3) を参照のこと。\n"
4904 "リアルタイムスケジューリングポリシーが使用されない限り、\n"
4905 "B<pthread_create>() の呼び出し後に、\n"
4906 "どのスレッドが\\(em呼び出したスレッドか新しいスレッドか\\(em\n"
4907 "次に実行されるかは決まっていない。"
4908
4909 #. type: Plain text
4910 #: build/C/man3/pthread_create.3:180
4911 msgid ""
4912 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
4913 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
4914 "terminate and fetch its exit status.  Only when a terminated joinable thread "
4915 "has been joined are the last of its resources released back to the system.  "
4916 "When a detached thread terminates, its resources are automatically released "
4917 "back to the system: it is not possible to join with the thread in order to "
4918 "obtain its exit status.  Making a thread detached is useful for some types "
4919 "of daemon threads whose exit status the application does not need to care "
4920 "about.  By default, a new thread is created in a joinable state, unless "
4921 "I<attr> was set to create the thread in a detached state (using "
4922 "B<pthread_attr_setdetachstate>(3))."
4923 msgstr ""
4924 "スレッドは I<join 可能>か I<detached (切り離された状態)> のどちらかに\n"
4925 "することができる。スレッドが join 可能な場合、別のスレッドが\n"
4926 "B<pthread_join>(3) を使って終了したスレッドを待ち、終了ステータスを取得\n"
4927 "することができる。終了した join 可能なスレッドは join された場合にのみ、\n"
4928 "そのスレッドの最後に残ったリソースが解放されシステムに戻される。\n"
4929 "detached 状態のスレッドが終了すると、そのスレッドのリソースは自動的に\n"
4930 "システムに戻される。detached 状態のスレッドを join して、その終了\n"
4931 "ステータスを取得することはできない。スレッドを detached 状態にするのは、\n"
4932 "その終了ステータスをアプリケーションが気にする必要がないある種の\n"
4933 "デーモン (daemon) スレッドでは有用である。\n"
4934 "デフォルトでは、新しいスレッドは join 可能な状態で作成される。\n"
4935 "(B<pthread_attr_setdetachstate>(3) を使って) I<attr> でスレッドが\n"
4936 "detached 状態で作成されるように設定されていない限り、join 可能な状態で\n"
4937 "作成される。"
4938
4939 #.  FIXME . Perhaps some of the following detail should be in
4940 #.  a future pthread_attr_setstacksize(3) page.
4941 #. type: Plain text
4942 #: build/C/man3/pthread_create.3:196
4943 msgid ""
4944 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
4945 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
4946 "resource limit I<at the time the program started> has any value other than "
4947 "\"unlimited\", then it determines the default stack size of new threads.  "
4948 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
4949 "explicitly set in the I<attr> argument used to create a thread, in order to "
4950 "obtain a stack size other than the default."
4951 msgstr ""
4952 "Linux/x86-32 では、新しいスレッドのデフォルトのスタックサイズは 2MB で\n"
4953 "ある。NPTL スレッド実装の下では、I<プログラム開始時の> B<RLIMIT_STACK>\n"
4954 "ソフトリソース上限が\"unlimited\" 以外の場合、その値が新しいスレッドのデ\n"
4955 "フォルトのスタックサイズとなる。\n"
4956 "B<pthread_attr_setstacksize>(3) を使って、スレッドを作成する際の\n"
4957 "I<attr> 引き数に明示的にスタックサイズ属性を設定することで、\n"
4958 "デフォルト値以外のスタックサイズを得ることができる。"
4959
4960 #. type: Plain text
4961 #: build/C/man3/pthread_create.3:202
4962 msgid ""
4963 "In the obsolete LinuxThreads implementation, each of the threads in a "
4964 "process has a different process ID.  This is in violation of the POSIX "
4965 "threads specification, and is the source of many other nonconformances to "
4966 "the standard; see B<pthreads>(7)."
4967 msgstr ""
4968 "廃止予定の LinuxThreads 実装では、プロセス内の各スレッドは異なる\n"
4969 "プロセス ID を持つ。これは POSIX スレッドの規格に違反しており、\n"
4970 "他の多くの標準非準拠の点の原因になっている。\n"
4971 "B<pthreads>(7) を参照のこと。"
4972
4973 #. type: Plain text
4974 #: build/C/man3/pthread_create.3:206
4975 msgid ""
4976 "The program below demonstrates the use of B<pthread_create>(), as well as a "
4977 "number of other functions in the pthreads API."
4978 msgstr ""
4979 "以下のプログラムは、 B<pthread_create>() や\n"
4980 "pthreads API の他のいろいろな関数の使用例を示している。"
4981
4982 #. type: Plain text
4983 #: build/C/man3/pthread_create.3:211
4984 msgid ""
4985 "In the following run, on a system providing the NPTL threading "
4986 "implementation, the stack size defaults to the value given by the \"stack "
4987 "size\" resource limit:"
4988 msgstr ""
4989 "以下の実行例は、 NPTL スレッド実装が提供されているシステムでのもので、\n"
4990 "スタックサイズがデフォルト値の \"stack size\" リソース上限で指定される値\n"
4991 "になる。"
4992
4993 #. type: Plain text
4994 #: build/C/man3/pthread_create.3:223
4995 #, no-wrap
4996 msgid ""
4997 "$B< ulimit -s>\n"
4998 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
4999 "$B< ./a.out hola salut servus>\n"
5000 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
5001 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
5002 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
5003 "Joined with thread 1; returned value was HOLA\n"
5004 "Joined with thread 2; returned value was SALUT\n"
5005 "Joined with thread 3; returned value was SERVUS\n"
5006 msgstr ""
5007 "$B< ulimit -s>\n"
5008 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
5009 "$B< ./a.out hola salut servus>\n"
5010 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
5011 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
5012 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
5013 "Joined with thread 1; returned value was HOLA\n"
5014 "Joined with thread 2; returned value was SALUT\n"
5015 "Joined with thread 3; returned value was SERVUS\n"
5016
5017 #. type: Plain text
5018 #: build/C/man3/pthread_create.3:229
5019 msgid ""
5020 "In the next run, the program explicitly sets a stack size of 1MB (using "
5021 "B<pthread_attr_setstacksize>(3))  for the created threads:"
5022 msgstr ""
5023 "次の実行例では、プログラム内で、作成されるスレッドに対して\n"
5024 "(B<pthread_attr_setstacksize>(3) を使って1MB のスタックサイズを\n"
5025 "明示的に設定している。"
5026
5027 #. type: Plain text
5028 #: build/C/man3/pthread_create.3:239
5029 #, no-wrap
5030 msgid ""
5031 "$B< ./a.out -s 0x100000 hola salut servus>\n"
5032 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
5033 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
5034 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
5035 "Joined with thread 1; returned value was HOLA\n"
5036 "Joined with thread 2; returned value was SALUT\n"
5037 "Joined with thread 3; returned value was SERVUS\n"
5038 msgstr ""
5039 "$B< ./a.out -s 0x100000 hola salut servus>\n"
5040 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
5041 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
5042 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
5043 "Joined with thread 1; returned value was HOLA\n"
5044 "Joined with thread 2; returned value was SALUT\n"
5045 "Joined with thread 3; returned value was SERVUS\n"
5046
5047 #. type: Plain text
5048 #: build/C/man3/pthread_create.3:251
5049 #, no-wrap
5050 msgid ""
5051 "#include E<lt>pthread.hE<gt>\n"
5052 "#include E<lt>string.hE<gt>\n"
5053 "#include E<lt>stdio.hE<gt>\n"
5054 "#include E<lt>stdlib.hE<gt>\n"
5055 "#include E<lt>unistd.hE<gt>\n"
5056 "#include E<lt>errno.hE<gt>\n"
5057 "#include E<lt>ctype.hE<gt>\n"
5058 msgstr ""
5059 "#include E<lt>pthread.hE<gt>\n"
5060 "#include E<lt>string.hE<gt>\n"
5061 "#include E<lt>stdio.hE<gt>\n"
5062 "#include E<lt>stdlib.hE<gt>\n"
5063 "#include E<lt>unistd.hE<gt>\n"
5064 "#include E<lt>errno.hE<gt>\n"
5065 "#include E<lt>ctype.hE<gt>\n"
5066
5067 #. type: Plain text
5068 #: build/C/man3/pthread_create.3:257 build/C/man3/pthread_getcpuclockid.3:111
5069 #, no-wrap
5070 msgid ""
5071 "#define handle_error(msg) \\e\n"
5072 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5073 msgstr ""
5074 "#define handle_error(msg) \\e\n"
5075 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5076
5077 #. type: Plain text
5078 #: build/C/man3/pthread_create.3:263
5079 #, no-wrap
5080 msgid ""
5081 "struct thread_info {    /* Used as argument to thread_start() */\n"
5082 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
5083 "    int       thread_num;       /* Application-defined thread # */\n"
5084 "    char     *argv_string;      /* From command-line argument */\n"
5085 "};\n"
5086 msgstr ""
5087 "struct thread_info {    /* Used as argument to thread_start() */\n"
5088 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
5089 "    int       thread_num;       /* Application-defined thread # */\n"
5090 "    char     *argv_string;      /* From command-line argument */\n"
5091 "};\n"
5092
5093 #. type: Plain text
5094 #: build/C/man3/pthread_create.3:266
5095 #, no-wrap
5096 msgid ""
5097 "/* Thread start function: display address near top of our stack,\n"
5098 "   and return upper-cased copy of argv_string */\n"
5099 msgstr ""
5100 "/* Thread start function: display address near top of our stack,\n"
5101 "   and return upper-cased copy of argv_string */\n"
5102
5103 #. type: Plain text
5104 #: build/C/man3/pthread_create.3:272
5105 #, no-wrap
5106 msgid ""
5107 "static void *\n"
5108 "thread_start(void *arg)\n"
5109 "{\n"
5110 "    struct thread_info *tinfo = arg;\n"
5111 "    char *uargv, *p;\n"
5112 msgstr ""
5113 "static void *\n"
5114 "thread_start(void *arg)\n"
5115 "{\n"
5116 "    struct thread_info *tinfo = arg;\n"
5117 "    char *uargv, *p;\n"
5118
5119 #. type: Plain text
5120 #: build/C/man3/pthread_create.3:275
5121 #, no-wrap
5122 msgid ""
5123 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5124 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5125 msgstr ""
5126 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5127 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5128
5129 #. type: Plain text
5130 #: build/C/man3/pthread_create.3:279
5131 #, no-wrap
5132 msgid ""
5133 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5134 "    if (uargv == NULL)\n"
5135 "        handle_error(\"strdup\");\n"
5136 msgstr ""
5137 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5138 "    if (uargv == NULL)\n"
5139 "        handle_error(\"strdup\");\n"
5140
5141 #. type: Plain text
5142 #: build/C/man3/pthread_create.3:282
5143 #, no-wrap
5144 msgid ""
5145 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5146 "        *p = toupper(*p);\n"
5147 msgstr ""
5148 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5149 "        *p = toupper(*p);\n"
5150
5151 #. type: Plain text
5152 #: build/C/man3/pthread_create.3:285
5153 #, no-wrap
5154 msgid ""
5155 "    return uargv;\n"
5156 "}\n"
5157 msgstr ""
5158 "    return uargv;\n"
5159 "}\n"
5160
5161 #. type: Plain text
5162 #: build/C/man3/pthread_create.3:294
5163 #, no-wrap
5164 msgid ""
5165 "int\n"
5166 "main(int argc, char *argv[])\n"
5167 "{\n"
5168 "    int s, tnum, opt, num_threads;\n"
5169 "    struct thread_info *tinfo;\n"
5170 "    pthread_attr_t attr;\n"
5171 "    int stack_size;\n"
5172 "    void *res;\n"
5173 msgstr ""
5174 "int\n"
5175 "main(int argc, char *argv[])\n"
5176 "{\n"
5177 "    int s, tnum, opt, num_threads;\n"
5178 "    struct thread_info *tinfo;\n"
5179 "    pthread_attr_t attr;\n"
5180 "    int stack_size;\n"
5181 "    void *res;\n"
5182
5183 #. type: Plain text
5184 #: build/C/man3/pthread_create.3:296
5185 #, no-wrap
5186 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
5187 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
5188
5189 #. type: Plain text
5190 #: build/C/man3/pthread_create.3:303
5191 #, no-wrap
5192 msgid ""
5193 "    stack_size = -1;\n"
5194 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5195 "        switch (opt) {\n"
5196 "        case \\(aqs\\(aq:\n"
5197 "            stack_size = strtoul(optarg, NULL, 0);\n"
5198 "            break;\n"
5199 msgstr ""
5200 "    stack_size = -1;\n"
5201 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5202 "        switch (opt) {\n"
5203 "        case \\(aqs\\(aq:\n"
5204 "            stack_size = strtoul(optarg, NULL, 0);\n"
5205 "            break;\n"
5206
5207 #. type: Plain text
5208 #: build/C/man3/pthread_create.3:310
5209 #, no-wrap
5210 msgid ""
5211 "        default:\n"
5212 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5213 "                    argv[0]);\n"
5214 "            exit(EXIT_FAILURE);\n"
5215 "        }\n"
5216 "    }\n"
5217 msgstr ""
5218 "        default:\n"
5219 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5220 "                    argv[0]);\n"
5221 "            exit(EXIT_FAILURE);\n"
5222 "        }\n"
5223 "    }\n"
5224
5225 #. type: Plain text
5226 #: build/C/man3/pthread_create.3:312
5227 #, no-wrap
5228 msgid "    num_threads = argc - optind;\n"
5229 msgstr "    num_threads = argc - optind;\n"
5230
5231 #. type: Plain text
5232 #: build/C/man3/pthread_create.3:314
5233 #, no-wrap
5234 msgid "    /* Initialize thread creation attributes */\n"
5235 msgstr "    /* Initialize thread creation attributes */\n"
5236
5237 #. type: Plain text
5238 #: build/C/man3/pthread_create.3:318
5239 #, no-wrap
5240 msgid ""
5241 "    s = pthread_attr_init(&attr);\n"
5242 "    if (s != 0)\n"
5243 "        handle_error_en(s, \"pthread_attr_init\");\n"
5244 msgstr ""
5245 "    s = pthread_attr_init(&attr);\n"
5246 "    if (s != 0)\n"
5247 "        handle_error_en(s, \"pthread_attr_init\");\n"
5248
5249 #. type: Plain text
5250 #: build/C/man3/pthread_create.3:324
5251 #, no-wrap
5252 msgid ""
5253 "    if (stack_size E<gt> 0) {\n"
5254 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5255 "        if (s != 0)\n"
5256 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5257 "    }\n"
5258 msgstr ""
5259 "    if (stack_size E<gt> 0) {\n"
5260 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5261 "        if (s != 0)\n"
5262 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5263 "    }\n"
5264
5265 #. type: Plain text
5266 #: build/C/man3/pthread_create.3:326
5267 #, no-wrap
5268 msgid "    /* Allocate memory for pthread_create() arguments */\n"
5269 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
5270
5271 #. type: Plain text
5272 #: build/C/man3/pthread_create.3:330
5273 #, no-wrap
5274 msgid ""
5275 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5276 "    if (tinfo == NULL)\n"
5277 "        handle_error(\"calloc\");\n"
5278 msgstr ""
5279 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5280 "    if (tinfo == NULL)\n"
5281 "        handle_error(\"calloc\");\n"
5282
5283 #. type: Plain text
5284 #: build/C/man3/pthread_create.3:332
5285 #, no-wrap
5286 msgid "    /* Create one thread for each command-line argument */\n"
5287 msgstr "    /* Create one thread for each command-line argument */\n"
5288
5289 #. type: Plain text
5290 #: build/C/man3/pthread_create.3:336
5291 #, no-wrap
5292 msgid ""
5293 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5294 "        tinfo[tnum].thread_num = tnum + 1;\n"
5295 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5296 msgstr ""
5297 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5298 "        tinfo[tnum].thread_num = tnum + 1;\n"
5299 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5300
5301 #. type: Plain text
5302 #: build/C/man3/pthread_create.3:339
5303 #, no-wrap
5304 msgid ""
5305 "        /* The pthread_create() call stores the thread ID into\n"
5306 "           corresponding element of tinfo[] */\n"
5307 msgstr ""
5308 "        /* The pthread_create() call stores the thread ID into\n"
5309 "           corresponding element of tinfo[] */\n"
5310
5311 #. type: Plain text
5312 #: build/C/man3/pthread_create.3:345
5313 #, no-wrap
5314 msgid ""
5315 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5316 "                           &thread_start, &tinfo[tnum]);\n"
5317 "        if (s != 0)\n"
5318 "            handle_error_en(s, \"pthread_create\");\n"
5319 "    }\n"
5320 msgstr ""
5321 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5322 "                           &thread_start, &tinfo[tnum]);\n"
5323 "        if (s != 0)\n"
5324 "            handle_error_en(s, \"pthread_create\");\n"
5325 "    }\n"
5326
5327 #. type: Plain text
5328 #: build/C/man3/pthread_create.3:348
5329 #, no-wrap
5330 msgid ""
5331 "    /* Destroy the thread attributes object, since it is no\n"
5332 "       longer needed */\n"
5333 msgstr ""
5334 "    /* Destroy the thread attributes object, since it is no\n"
5335 "       longer needed */\n"
5336
5337 #. type: Plain text
5338 #: build/C/man3/pthread_create.3:352 build/C/man3/pthread_setschedparam.3:430
5339 #, no-wrap
5340 msgid ""
5341 "    s = pthread_attr_destroy(&attr);\n"
5342 "    if (s != 0)\n"
5343 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5344 msgstr ""
5345 "    s = pthread_attr_destroy(&attr);\n"
5346 "    if (s != 0)\n"
5347 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5348
5349 #. type: Plain text
5350 #: build/C/man3/pthread_create.3:354
5351 #, no-wrap
5352 msgid "    /* Now join with each thread, and display its returned value */\n"
5353 msgstr "    /* Now join with each thread, and display its returned value */\n"
5354
5355 #. type: Plain text
5356 #: build/C/man3/pthread_create.3:359
5357 #, no-wrap
5358 msgid ""
5359 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5360 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5361 "        if (s != 0)\n"
5362 "            handle_error_en(s, \"pthread_join\");\n"
5363 msgstr ""
5364 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5365 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5366 "        if (s != 0)\n"
5367 "            handle_error_en(s, \"pthread_join\");\n"
5368
5369 #. type: Plain text
5370 #: build/C/man3/pthread_create.3:364
5371 #, no-wrap
5372 msgid ""
5373 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5374 "                tinfo[tnum].thread_num, (char *) res);\n"
5375 "        free(res);      /* Free memory allocated by thread */\n"
5376 "    }\n"
5377 msgstr ""
5378 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5379 "                tinfo[tnum].thread_num, (char *) res);\n"
5380 "        free(res);      /* Free memory allocated by thread */\n"
5381 "    }\n"
5382
5383 #. type: Plain text
5384 #: build/C/man3/pthread_create.3:368
5385 #, no-wrap
5386 msgid ""
5387 "    free(tinfo);\n"
5388 "    exit(EXIT_SUCCESS);\n"
5389 "}\n"
5390 msgstr ""
5391 "    free(tinfo);\n"
5392 "    exit(EXIT_SUCCESS);\n"
5393 "}\n"
5394
5395 #. type: Plain text
5396 #: build/C/man3/pthread_create.3:382
5397 msgid ""
5398 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5399 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5400 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), "
5401 "B<pthreads>(7)"
5402 msgstr ""
5403 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5404 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5405 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), "
5406 "B<pthreads>(7)"
5407
5408 #. type: TH
5409 #: build/C/man3/pthread_detach.3:26
5410 #, no-wrap
5411 msgid "PTHREAD_DETACH"
5412 msgstr "PTHREAD_DETACH"
5413
5414 #. type: TH
5415 #: build/C/man3/pthread_detach.3:26 build/C/man3/pthread_join.3:26
5416 #, no-wrap
5417 msgid "2008-11-27"
5418 msgstr "2008-11-27"
5419
5420 #. type: Plain text
5421 #: build/C/man3/pthread_detach.3:29
5422 msgid "pthread_detach - detach a thread"
5423 msgstr "pthread_detach - スレッドを切り離す (detach する)"
5424
5425 #. type: Plain text
5426 #: build/C/man3/pthread_detach.3:34
5427 #, no-wrap
5428 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5429 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5430
5431 #. type: Plain text
5432 #: build/C/man3/pthread_detach.3:46
5433 msgid ""
5434 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
5435 "as detached.  When a detached thread terminates, its resources are "
5436 "automatically released back to the system without the need for another "
5437 "thread to join with the terminated thread."
5438 msgstr ""
5439 "B<pthread_detach>() 関数は I<thread> で識別されるスレッドに\n"
5440 "detached (切り離された状態) という印を付ける。\n"
5441 "detached 状態のスレッドが終了すると、\n"
5442 "別のスレッドが終了されたスレッドを join しなくても、\n"
5443 "そのスレッドのリソースは自動的に解放されてシステムに戻される。"
5444
5445 #. type: Plain text
5446 #: build/C/man3/pthread_detach.3:49
5447 msgid ""
5448 "Attempting to detach an already detached thread results in unspecified "
5449 "behavior."
5450 msgstr ""
5451 "すでに detach 状態のスレッドを detach しようとした場合に\n"
5452 "どのような結果となるかは規定されていない。"
5453
5454 #. type: Plain text
5455 #: build/C/man3/pthread_detach.3:54
5456 msgid ""
5457 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
5458 "number."
5459 msgstr ""
5460 "成功すると、B<pthread_detach>() は 0 を返す。\n"
5461 "エラーの場合、エラー番号を返す。"
5462
5463 #. type: Plain text
5464 #: build/C/man3/pthread_detach.3:59 build/C/man3/pthread_join.3:89
5465 msgid "I<thread> is not a joinable thread."
5466 msgstr "I<thread> が join 可能なスレッドではない。"
5467
5468 #. type: Plain text
5469 #: build/C/man3/pthread_detach.3:70
5470 msgid ""
5471 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
5472 "or be made joinable again."
5473 msgstr ""
5474 "いったんスレッドを detached 状態にすると、\n"
5475 "そのスレッドを B<pthread_join>(3) で join したり、\n"
5476 "もう一度 join 可能にしたりすることはできない。"
5477
5478 #. type: Plain text
5479 #: build/C/man3/pthread_detach.3:77
5480 msgid ""
5481 "A new thread can be created in a detached state using "
5482 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
5483 "I<attr> argument of B<pthread_create>(3)."
5484 msgstr ""
5485 "B<pthread_attr_setdetachstate>(3) を使って\n"
5486 "B<pthread_create>(3) の I<attr> 引き数の detached 属性を設定することで、\n"
5487 "新しいスレッドを detached 状態で作成することができる。"
5488
5489 #. type: Plain text
5490 #: build/C/man3/pthread_detach.3:84
5491 msgid ""
5492 "The detached attribute merely determines the behavior of the system when the "
5493 "thread terminates; it does not prevent the thread from being terminated if "
5494 "the process terminates using B<exit>(3)  (or equivalently, if the main "
5495 "thread returns)."
5496 msgstr ""
5497 "detached 属性は、スレッドが終了した際のシステムの動作を決めるだけである。\n"
5498 "プロセスが B<exit>(3) を使って終了した場合に、そのスレッドが終了され\n"
5499 "なくなるようなことはない (なお、メインスレッドが return した場合も\n"
5500 "プロセスが B<exit>(3) を使って終了した場合と全く同じである)。 "
5501
5502 #. type: Plain text
5503 #: build/C/man3/pthread_detach.3:93
5504 msgid ""
5505 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
5506 "thread that an application creates, so that system resources for the thread "
5507 "can be released.  (But note that the resources of all threads are freed when "
5508 "the process terminates.)"
5509 msgstr ""
5510 "アプリケーションが作成した各スレッドについて、そのスレッドが使用して\n"
5511 "いるシステムリソースを解放できるように、B<pthread_join>(3) か\n"
5512 "B<pthread_detach>() のどちらかを呼び出すべきである (ただし、プロセスが\n"
5513 "終了するときには、全てのスレッドのリソースが解放される)。"
5514
5515 #. type: Plain text
5516 #: build/C/man3/pthread_detach.3:95
5517 msgid "The following statement detaches the calling thread:"
5518 msgstr "以下の文は、呼び出したスレッド自身を detach する。"
5519
5520 #. type: Plain text
5521 #: build/C/man3/pthread_detach.3:97
5522 #, no-wrap
5523 msgid "    pthread_detach(pthread_self());\n"
5524 msgstr "    pthread_detach(pthread_self());\n"
5525
5526 #. type: Plain text
5527 #: build/C/man3/pthread_detach.3:104
5528 msgid ""
5529 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), "
5530 "B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5531 msgstr ""
5532 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), "
5533 "B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5534
5535 #. type: TH
5536 #: build/C/man3/pthread_equal.3:26
5537 #, no-wrap
5538 msgid "PTHREAD_EQUAL"
5539 msgstr "PTHREAD_EQUAL"
5540
5541 #. type: TH
5542 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
5543 #, no-wrap
5544 msgid "2009-03-30"
5545 msgstr "2009-03-30"
5546
5547 #. type: Plain text
5548 #: build/C/man3/pthread_equal.3:29
5549 msgid "pthread_equal - compare thread IDs"
5550 msgstr "pthread_equal - スレッド ID を比較する"
5551
5552 #. type: Plain text
5553 #: build/C/man3/pthread_equal.3:34
5554 #, no-wrap
5555 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5556 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5557
5558 #. type: Plain text
5559 #: build/C/man3/pthread_equal.3:41
5560 msgid "The B<pthread_equal>()  function compares two thread identifiers."
5561 msgstr "B<pthread_equal>() 関数は 2 つのスレッド識別子の比較を行う。"
5562
5563 #. type: Plain text
5564 #: build/C/man3/pthread_equal.3:45
5565 msgid ""
5566 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
5567 "value; otherwise, it returns 0."
5568 msgstr ""
5569 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
5570 "そうでなければ 0 を返す。"
5571
5572 #.  SH VERSIONS
5573 #.  Available since glibc 2.0
5574 #. type: Plain text
5575 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
5576 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_testcancel.3:58
5577 msgid "This function always succeeds."
5578 msgstr "この関数は常に成功する。"
5579
5580 #. type: Plain text
5581 #: build/C/man3/pthread_equal.3:56
5582 msgid ""
5583 "The B<pthread_equal>()  function is necessary because thread IDs should be "
5584 "considered opaque: there is no portable way for applications to directly "
5585 "compare two I<pthread_t> values."
5586 msgstr ""
5587 "B<pthread_equal>() 関数が必要なのは、\n"
5588 "スレッド ID はその内部構造を意識すべきではないためである。\n"
5589 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
5590 "移植性を確保できる形で比較する方法はない。"
5591
5592 #. type: Plain text
5593 #: build/C/man3/pthread_equal.3:60
5594 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5595 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5596
5597 #. type: TH
5598 #: build/C/man3/pthread_exit.3:26
5599 #, no-wrap
5600 msgid "PTHREAD_EXIT"
5601 msgstr "PTHREAD_EXIT"
5602
5603 #. type: Plain text
5604 #: build/C/man3/pthread_exit.3:29
5605 msgid "pthread_exit - terminate calling thread"
5606 msgstr "pthread_exit - 呼び出したスレッドを終了する"
5607
5608 #. type: Plain text
5609 #: build/C/man3/pthread_exit.3:34
5610 #, no-wrap
5611 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
5612 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
5613
5614 #. type: Plain text
5615 #: build/C/man3/pthread_exit.3:45
5616 msgid ""
5617 "The B<pthread_exit>()  function terminates the calling thread and returns a "
5618 "value via I<retval> that (if the thread is joinable)  is available to "
5619 "another thread in the same process that calls B<pthread_join>(3)."
5620 msgstr ""
5621 "B<pthread_exit>() 関数は、呼び出したスレッドを終了し、\n"
5622 "I<retval> 経由で値を返す。\n"
5623 "この値は (そのスレッドが join 可能な場合に) B<pthread_join>(3) を\n"
5624 "呼び出した同じプロセス内の別のスレッドが参照できる値と同じである。"
5625
5626 #. type: Plain text
5627 #: build/C/man3/pthread_exit.3:55
5628 msgid ""
5629 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
5630 "not yet been popped, are popped (in the reverse of the order in which they "
5631 "were pushed)  and executed.  If the thread has any thread-specific data, "
5632 "then, after the clean-up handlers have been executed, the corresponding "
5633 "destructor functions are called, in an unspecified order."
5634 msgstr ""
5635 "B<pthread_cleanup_push>(3) で設定されたクリーンアップハンドラのうち、\n"
5636 "まだ pop (取り出されていない) ハンドラを (push されたのと逆の順序で)\n"
5637 "取り出して実行する。そのスレッドがスレッド固有のデータを持っている\n"
5638 "場合は、クリーンアップハンドラが実行された後に、スレッド固有のデータ\n"
5639 "に対応するデストラクタ (destructor) 関数が呼び出される (呼び出し順序\n"
5640 "は規定されていない)。"
5641
5642 #. type: Plain text
5643 #: build/C/man3/pthread_exit.3:62
5644 msgid ""
5645 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
5646 "variables, semaphores, and file descriptors) are not released, and functions "
5647 "registered using B<atexit>(3)  are not called."
5648 msgstr ""
5649 "スレッドが終了する際に、プロセスの共有リソース (例えば、mutex、状態変数\n"
5650 "(condition variables)、セマフォ、ファイルディスクリプタ)が解放される。\n"
5651 "B<atexit>(3) を使って登録された関数は呼び出されない。"
5652
5653 #. type: Plain text
5654 #: build/C/man3/pthread_exit.3:71
5655 msgid ""
5656 "After the last thread in a process terminates, the process terminates as by "
5657 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
5658 "resources are released and functions registered using B<atexit>(3)  are "
5659 "called."
5660 msgstr ""
5661 "プロセスの最後のスレッドが終了すると、そのプロセスは、終了ステータス 0\n"
5662 "で B<exit>(3) を呼び出した場合と全く同じように終了する。したがって、\n"
5663 "プロセスの共有リソースは解放され、B<atexit>(3) を使って登録された関数\n"
5664 "が呼び出される。"
5665
5666 #. type: Plain text
5667 #: build/C/man3/pthread_exit.3:73
5668 msgid "This function does not return to the caller."
5669 msgstr "この関数は呼び出し側には返らない。"
5670
5671 #. type: Plain text
5672 #: build/C/man3/pthread_exit.3:82
5673 msgid ""
5674 "Performing a return from the start function of any thread other than the "
5675 "main thread results in an implicit call to B<pthread_exit>(), using the "
5676 "function's return value as the thread's exit status."
5677 msgstr ""
5678 "メインスレッド以外のスレッドの開始関数 (start function) がreturn を\n"
5679 "行うと、暗黙のうちに B<pthread_exit>() が呼び出され、\n"
5680 "関数の返り値がスレッドの終了ステータスとして使用される。"
5681
5682 #. type: Plain text
5683 #: build/C/man3/pthread_exit.3:88
5684 msgid ""
5685 "To allow other threads to continue execution, the main thread should "
5686 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
5687 msgstr ""
5688 "他のスレッドが実行を継続できるように、メインスレッドは B<exit>(3) では\n"
5689 "なく B<pthread_exit>() を呼び出して終了すべきである。"
5690
5691 #. type: Plain text
5692 #: build/C/man3/pthread_exit.3:93
5693 msgid ""
5694 "The value pointed to by I<retval> should not be located on the calling "
5695 "thread's stack, since the contents of that stack are undefined after the "
5696 "thread terminates."
5697 msgstr ""
5698 "I<retval> が指す値は、呼び出したスレッドのスタックに置くべきではない。\n"
5699 "呼び出したスレッドが終了した後は、そのスタックの内容が不定となるから\n"
5700 "である。"
5701
5702 #.  Linux 2.6.27
5703 #.  FIXME . review a later kernel to see if this gets fixed
5704 #.  http://thread.gmane.org/gmane.linux.kernel/611611
5705 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
5706 #. type: Plain text
5707 #: build/C/man3/pthread_exit.3:105
5708 msgid ""
5709 "Currently, there are limitations in the kernel implementation logic for "
5710 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
5711 "This can manifest in problems such as a locked terminal if a stop signal is "
5712 "sent to a foreground process whose thread group leader has already called "
5713 "B<pthread_exit>()."
5714 msgstr ""
5715 "現在のところ、停止 (stop) されたスレッドグループを、すでに終了した\n"
5716 "(dead) スレッドグループリーダーで B<wait>(2) する場合の、\n"
5717 "カーネル実装の論理には制限がある。\n"
5718 "この制限は、すでにスレッドグループリーダーが B<pthread_exit>() を\n"
5719 "呼び出しているようなフォアグラウンドプロセスにストップシグナルが送信\n"
5720 "された場合に、端末がロックされてしまう、といった問題として表に見える\n"
5721 "場合がある。"
5722
5723 #. type: Plain text
5724 #: build/C/man3/pthread_exit.3:109
5725 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5726 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5727
5728 #. type: TH
5729 #: build/C/man3/pthread_getattr_np.3:26
5730 #, no-wrap
5731 msgid "PTHREAD_GETATTR_NP"
5732 msgstr "PTHREAD_GETATTR_NP"
5733
5734 #. type: Plain text
5735 #: build/C/man3/pthread_getattr_np.3:29
5736 msgid "pthread_getattr_np - get attributes of created thread"
5737 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
5738
5739 #. type: Plain text
5740 #: build/C/man3/pthread_getattr_np.3:35
5741 #, no-wrap
5742 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5743 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5744
5745 #. type: Plain text
5746 #: build/C/man3/pthread_getattr_np.3:45
5747 msgid ""
5748 "The B<pthread_getattr_np>()  function initializes the thread attributes "
5749 "object referred to by I<attr> so that it contains actual attribute values "
5750 "describing the running thread I<thread>."
5751 msgstr ""
5752 "B<pthread_getattr_np>() 関数は、\n"
5753 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
5754 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
5755 "格納して返す。"
5756
5757 #. type: Plain text
5758 #: build/C/man3/pthread_getattr_np.3:52
5759 msgid ""
5760 "The returned attribute values may differ from the corresponding attribute "
5761 "values passed in the I<attr> object that was used to create the thread using "
5762 "B<pthread_create>(3).  In particular, the following attributes may differ:"
5763 msgstr ""
5764 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
5765 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
5766 "特に、以下の属性は異なる場合がある。"
5767
5768 #. type: Plain text
5769 #: build/C/man3/pthread_getattr_np.3:55
5770 msgid ""
5771 "the detach state, since a joinable thread may have detached itself after "
5772 "creation;"
5773 msgstr ""
5774 "detach state. join 可能なスレッドは作成後に自分自身を\n"
5775 "切り離す (detach する) ことができるからである。"
5776
5777 #. type: Plain text
5778 #: build/C/man3/pthread_getattr_np.3:58
5779 msgid ""
5780 "the stack size, which the implementation may align to a suitable boundary."
5781 msgstr ""
5782 "スタックサイズ。\n"
5783 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
5784
5785 #. type: Plain text
5786 #: build/C/man3/pthread_getattr_np.3:63
5787 msgid ""
5788 "and the guard size, which the implementation may round upward to a multiple "
5789 "of the page size, or ignore (i.e., treat as 0), if the application is "
5790 "allocating its own stack."
5791 msgstr ""
5792 "guard size.\n"
5793 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
5794 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
5795 "(0 として扱われる) ことがあるからである。"
5796
5797 #. type: Plain text
5798 #: build/C/man3/pthread_getattr_np.3:68
5799 msgid ""
5800 "Furthermore, if the stack address attribute was not set in the thread "
5801 "attributes object used to create the thread, then the returned thread "
5802 "attributes object will report the actual stack address that the "
5803 "implementation selected for the thread."
5804 msgstr ""
5805 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
5806 "スタックアドレスが設定されていなかった場合、\n"
5807 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
5808 "割り当てた実際のスタックアドレスが報告される。"
5809
5810 #. type: Plain text
5811 #: build/C/man3/pthread_getattr_np.3:73
5812 msgid ""
5813 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
5814 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
5815 msgstr ""
5816 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
5817 "必要なくなった際には、  B<pthread_attr_destroy>(3) を使って\n"
5818 "そのオブジェクトを破棄すべきである。"
5819
5820 #. type: Plain text
5821 #: build/C/man3/pthread_getattr_np.3:76
5822 #: build/C/man3/pthread_getcpuclockid.3:49
5823 msgid ""
5824 "On success, this function returns 0; on error, it returns a nonzero error "
5825 "number."
5826 msgstr ""
5827 "成功すると、この関数は 0 を返す。\n"
5828 "エラーの場合、 0 以外のエラー番号を返す。"
5829
5830 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
5831 #. type: Plain text
5832 #: build/C/man3/pthread_getattr_np.3:81
5833 msgid "Insufficient memory."
5834 msgstr "メモリが十分になかった。"
5835
5836 #. type: Plain text
5837 #: build/C/man3/pthread_getattr_np.3:96
5838 msgid ""
5839 "In addition, if I<thread> refers to the main thread, then "
5840 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
5841 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and "
5842 "B<getrlimit>(2), if the B<RLIMIT_STACK> resource limit is not supported."
5843 msgstr ""
5844 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
5845 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
5846 "エラーで失敗する可能性がある。\n"
5847 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
5848 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
5849 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
5850
5851 #. type: Plain text
5852 #: build/C/man3/pthread_getattr_np.3:98
5853 msgid "This function is available in glibc since version 2.2.3."
5854 msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。"
5855
5856 #. type: Plain text
5857 #: build/C/man3/pthread_getattr_np.3:101
5858 #: build/C/man3/pthread_kill_other_threads_np.3:55
5859 msgid ""
5860 "This function is a nonstandard GNU extension; hence the suffix \"_np"
5861 "\" (nonportable) in the name."
5862 msgstr ""
5863 "この関数は非標準の GNU による拡張である。\n"
5864 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
5865 "付いている。"
5866
5867 #. type: Plain text
5868 #: build/C/man3/pthread_getattr_np.3:111
5869 msgid ""
5870 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
5871 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
5872 "and display its guard size, stack address, and stack size attributes.  "
5873 "Command-line arguments can be used to set these attributes to values other "
5874 "than the default when creating the thread.  The shell sessions below "
5875 "demonstrate the use of the program."
5876 msgstr ""
5877 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
5878 "このプログラムは、スレッドを作成し、それから\n"
5879 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
5880 "スタックアドレス、スタックサイズを取得し表示する。\n"
5881 "コマンドライン引き数での指定で、スレッドを作成する際に\n"
5882 "上記の属性にデフォルト値以外の値を設定することができる。\n"
5883 "下記のシェルのセッションはこのプログラムの使用例である。"
5884
5885 #. type: Plain text
5886 #: build/C/man3/pthread_getattr_np.3:114
5887 msgid ""
5888 "In the first run, on an x86-32 system, a thread is created using default "
5889 "attributes:"
5890 msgstr ""
5891 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
5892 "(x86-32 システム上で実行)。"
5893
5894 #. type: Plain text
5895 #: build/C/man3/pthread_getattr_np.3:124
5896 #, no-wrap
5897 msgid ""
5898 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5899 "unlimited\n"
5900 "$B< ./a.out>\n"
5901 "Attributes of created thread:\n"
5902 "        Guard size          = 4096 bytes\n"
5903 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5904 "        Stack size          = 0x201000 (2101248) bytes\n"
5905 msgstr ""
5906 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5907 "unlimited\n"
5908 "$B< ./a.out>\n"
5909 "Attributes of created thread:\n"
5910 "        Guard size          = 4096 bytes\n"
5911 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5912 "        Stack size          = 0x201000 (2101248) bytes\n"
5913
5914 #. type: Plain text
5915 #: build/C/man3/pthread_getattr_np.3:130
5916 msgid ""
5917 "In the following run, we see that if a guard size is specified, it is "
5918 "rounded up to the next multiple of the system page size (4096 bytes on "
5919 "x86-32):"
5920 msgstr ""
5921 "次の実行例では、guard size が指定された場合、\n"
5922 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
5923 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
5924
5925 #. type: Plain text
5926 #: build/C/man3/pthread_getattr_np.3:138
5927 #, no-wrap
5928 msgid ""
5929 "$B< ./a.out -g 4097>\n"
5930 "Thread attributes object after initializations:\n"
5931 "        Guard size          = 4097 bytes\n"
5932 "        Stack address       = (nil)\n"
5933 "        Stack size          = 0x0 (0) bytes\n"
5934 msgstr ""
5935 "$B< ./a.out -g 4097>\n"
5936 "Thread attributes object after initializations:\n"
5937 "        Guard size          = 4097 bytes\n"
5938 "        Stack address       = (nil)\n"
5939 "        Stack size          = 0x0 (0) bytes\n"
5940
5941 #. type: Plain text
5942 #: build/C/man3/pthread_getattr_np.3:143
5943 #, no-wrap
5944 msgid ""
5945 "Attributes of created thread:\n"
5946 "        Guard size          = 8192 bytes\n"
5947 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5948 "        Stack size          = 0x201000 (2101248) bytes\n"
5949 msgstr ""
5950 "Attributes of created thread:\n"
5951 "        Guard size          = 8192 bytes\n"
5952 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5953 "        Stack size          = 0x201000 (2101248) bytes\n"
5954
5955 #. .in +4n
5956 #. .nf
5957 #. $ ./a.out \-s 0x8000
5958 #. Thread attributes object after initializations:
5959 #.         Guard size          = 4096 bytes
5960 #.         Stack address       = 0xffff8000 (EOS = (nil))
5961 #.         Stack size          = 0x8000 (32768) bytes
5962 #. Attributes of created thread:
5963 #.         Guard size          = 4096 bytes
5964 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
5965 #.         Stack size          = 0x8000 (32768) bytes
5966 #. .fi
5967 #. .in
5968 #. type: Plain text
5969 #: build/C/man3/pthread_getattr_np.3:162
5970 msgid ""
5971 "In the last run, the program manually allocates a stack for the thread.  In "
5972 "this case, the guard size attribute is ignored."
5973 msgstr ""
5974 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
5975 "この場合には、guard size 属性は無視される。"
5976
5977 #. type: Plain text
5978 #: build/C/man3/pthread_getattr_np.3:167
5979 #, no-wrap
5980 msgid ""
5981 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5982 "Allocated thread stack at 0x804d000\n"
5983 msgstr ""
5984 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5985 "Allocated thread stack at 0x804d000\n"
5986
5987 #. type: Plain text
5988 #: build/C/man3/pthread_getattr_np.3:172
5989 #, no-wrap
5990 msgid ""
5991 "Thread attributes object after initializations:\n"
5992 "        Guard size          = 4096 bytes\n"
5993 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5994 "        Stack size          = 0x8000 (32768) bytes\n"
5995 msgstr ""
5996 "Thread attributes object after initializations:\n"
5997 "        Guard size          = 4096 bytes\n"
5998 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5999 "        Stack size          = 0x8000 (32768) bytes\n"
6000
6001 #. type: Plain text
6002 #: build/C/man3/pthread_getattr_np.3:177
6003 #, no-wrap
6004 msgid ""
6005 "Attributes of created thread:\n"
6006 "        Guard size          = 0 bytes\n"
6007 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6008 "        Stack size          = 0x8000 (32768) bytes\n"
6009 msgstr ""
6010 "Attributes of created thread:\n"
6011 "        Guard size          = 0 bytes\n"
6012 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
6013 "        Stack size          = 0x8000 (32768) bytes\n"
6014
6015 #. type: Plain text
6016 #: build/C/man3/pthread_getattr_np.3:198
6017 #, no-wrap
6018 msgid ""
6019 "static void\n"
6020 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6021 "{\n"
6022 "    int s;\n"
6023 "    size_t stack_size, guard_size;\n"
6024 "    void *stack_addr;\n"
6025 msgstr ""
6026 "static void\n"
6027 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6028 "{\n"
6029 "    int s;\n"
6030 "    size_t stack_size, guard_size;\n"
6031 "    void *stack_addr;\n"
6032
6033 #. type: Plain text
6034 #: build/C/man3/pthread_getattr_np.3:203
6035 #, no-wrap
6036 msgid ""
6037 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
6038 "    if (s != 0)\n"
6039 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6040 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
6041 msgstr ""
6042 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
6043 "    if (s != 0)\n"
6044 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6045 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
6046
6047 #. type: Plain text
6048 #: build/C/man3/pthread_getattr_np.3:214
6049 #, no-wrap
6050 msgid ""
6051 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6052 "    if (s != 0)\n"
6053 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
6054 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
6055 "    if (stack_size E<gt> 0)\n"
6056 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6057 "    printf(\"\\en\");\n"
6058 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
6059 "            prefix, stack_size, stack_size);\n"
6060 "}\n"
6061 msgstr ""
6062 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6063 "    if (s != 0)\n"
6064 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
6065 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
6066 "    if (stack_size E<gt> 0)\n"
6067 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6068 "    printf(\"\\en\");\n"
6069 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
6070 "            prefix, stack_size, stack_size);\n"
6071 "}\n"
6072
6073 #. type: Plain text
6074 #: build/C/man3/pthread_getattr_np.3:220
6075 #, no-wrap
6076 msgid ""
6077 "static void\n"
6078 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6079 "{\n"
6080 "    int s;\n"
6081 "    pthread_attr_t attr;\n"
6082 msgstr ""
6083 "static void\n"
6084 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6085 "{\n"
6086 "    int s;\n"
6087 "    pthread_attr_t attr;\n"
6088
6089 #. type: Plain text
6090 #: build/C/man3/pthread_getattr_np.3:224
6091 #, no-wrap
6092 msgid ""
6093 "    s = pthread_getattr_np(thread, &attr);\n"
6094 "    if (s != 0)\n"
6095 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6096 msgstr ""
6097 "    s = pthread_getattr_np(thread, &attr);\n"
6098 "    if (s != 0)\n"
6099 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6100
6101 #. type: Plain text
6102 #: build/C/man3/pthread_getattr_np.3:226
6103 #, no-wrap
6104 msgid "    display_stack_related_attributes(&attr, prefix);\n"
6105 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
6106
6107 #. type: Plain text
6108 #: build/C/man3/pthread_getattr_np.3:231
6109 #, no-wrap
6110 msgid ""
6111 "    s = pthread_attr_destroy(&attr);\n"
6112 "    if (s != 0)\n"
6113 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6114 "}\n"
6115 msgstr ""
6116 "    s = pthread_attr_destroy(&attr);\n"
6117 "    if (s != 0)\n"
6118 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6119 "}\n"
6120
6121 #. type: Plain text
6122 #: build/C/man3/pthread_getattr_np.3:237
6123 #, no-wrap
6124 msgid ""
6125 "static void *           /* Start function for thread we create */\n"
6126 "thread_start(void *arg)\n"
6127 "{\n"
6128 "    printf(\"Attributes of created thread:\\en\");\n"
6129 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6130 msgstr ""
6131 "static void *           /* Start function for thread we create */\n"
6132 "thread_start(void *arg)\n"
6133 "{\n"
6134 "    printf(\"Attributes of created thread:\\en\");\n"
6135 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6136
6137 #. type: Plain text
6138 #: build/C/man3/pthread_getattr_np.3:251
6139 #, no-wrap
6140 msgid ""
6141 "static void\n"
6142 "usage(char *pname, char *msg)\n"
6143 "{\n"
6144 "    if (msg != NULL)\n"
6145 "        fputs(msg, stderr);\n"
6146 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6147 "            \" [-g guard-size]\\en\", pname);\n"
6148 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6149 "    exit(EXIT_FAILURE);\n"
6150 "}\n"
6151 msgstr ""
6152 "static void\n"
6153 "usage(char *pname, char *msg)\n"
6154 "{\n"
6155 "    if (msg != NULL)\n"
6156 "        fputs(msg, stderr);\n"
6157 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6158 "            \" [-g guard-size]\\en\", pname);\n"
6159 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6160 "    exit(EXIT_FAILURE);\n"
6161 "}\n"
6162
6163 #. type: Plain text
6164 #: build/C/man3/pthread_getattr_np.3:264
6165 #, no-wrap
6166 msgid ""
6167 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6168 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6169 "                              pthread_attr_t *attrp)\n"
6170 "{\n"
6171 "    int s, opt, allocate_stack;\n"
6172 "    long stack_size, guard_size;\n"
6173 "            void *stack_addr;\n"
6174 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6175 "                                           a thread attributes object */\n"
6176 "    allocate_stack = 0;\n"
6177 "    stack_size = -1;\n"
6178 "    guard_size = -1;\n"
6179 msgstr ""
6180 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6181 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6182 "                              pthread_attr_t *attrp)\n"
6183 "{\n"
6184 "    int s, opt, allocate_stack;\n"
6185 "    long stack_size, guard_size;\n"
6186 "            void *stack_addr;\n"
6187 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6188 "                                           a thread attributes object */\n"
6189 "    allocate_stack = 0;\n"
6190 "    stack_size = -1;\n"
6191 "    guard_size = -1;\n"
6192
6193 #. type: Plain text
6194 #: build/C/man3/pthread_getattr_np.3:273
6195 #, no-wrap
6196 msgid ""
6197 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6198 "        switch (opt) {\n"
6199 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6200 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6201 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6202 "        default:    usage(argv[0], NULL);\n"
6203 "        }\n"
6204 "    }\n"
6205 msgstr ""
6206 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6207 "        switch (opt) {\n"
6208 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6209 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6210 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6211 "        default:    usage(argv[0], NULL);\n"
6212 "        }\n"
6213 "    }\n"
6214
6215 #. type: Plain text
6216 #: build/C/man3/pthread_getattr_np.3:276
6217 #, no-wrap
6218 msgid ""
6219 "    if (allocate_stack && stack_size == -1)\n"
6220 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6221 msgstr ""
6222 "    if (allocate_stack && stack_size == -1)\n"
6223 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6224
6225 #. type: Plain text
6226 #: build/C/man3/pthread_getattr_np.3:279
6227 #, no-wrap
6228 msgid ""
6229 "    if (argc E<gt> optind)\n"
6230 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6231 msgstr ""
6232 "    if (argc E<gt> optind)\n"
6233 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6234
6235 #. type: Plain text
6236 #: build/C/man3/pthread_getattr_np.3:282
6237 #, no-wrap
6238 msgid ""
6239 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6240 "        ret_attrp = attrp;\n"
6241 msgstr ""
6242 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6243 "        ret_attrp = attrp;\n"
6244
6245 #. type: Plain text
6246 #: build/C/man3/pthread_getattr_np.3:287
6247 #, no-wrap
6248 msgid ""
6249 "        s = pthread_attr_init(attrp);\n"
6250 "        if (s != 0)\n"
6251 "            handle_error_en(s, \"pthread_attr_init\");\n"
6252 "    }\n"
6253 msgstr ""
6254 "        s = pthread_attr_init(attrp);\n"
6255 "        if (s != 0)\n"
6256 "            handle_error_en(s, \"pthread_attr_init\");\n"
6257 "    }\n"
6258
6259 #. type: Plain text
6260 #: build/C/man3/pthread_getattr_np.3:299
6261 #, no-wrap
6262 msgid ""
6263 "    if (stack_size E<gt>= 0) {\n"
6264 "        if (!allocate_stack) {\n"
6265 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6266 "            if (s != 0)\n"
6267 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6268 "        } else {\n"
6269 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6270 "                               stack_size);\n"
6271 "            if (s != 0)\n"
6272 "                handle_error_en(s, \"posix_memalign\");\n"
6273 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6274 msgstr ""
6275 "    if (stack_size E<gt>= 0) {\n"
6276 "        if (!allocate_stack) {\n"
6277 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6278 "            if (s != 0)\n"
6279 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6280 "        } else {\n"
6281 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6282 "                               stack_size);\n"
6283 "            if (s != 0)\n"
6284 "                handle_error_en(s, \"posix_memalign\");\n"
6285 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6286
6287 #. type: Plain text
6288 #: build/C/man3/pthread_getattr_np.3:305
6289 #, no-wrap
6290 msgid ""
6291 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6292 "            if (s != 0)\n"
6293 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6294 "        }\n"
6295 "    }\n"
6296 msgstr ""
6297 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6298 "            if (s != 0)\n"
6299 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6300 "        }\n"
6301 "    }\n"
6302
6303 #. type: Plain text
6304 #: build/C/man3/pthread_getattr_np.3:311
6305 #, no-wrap
6306 msgid ""
6307 "    if (guard_size E<gt>= 0) {\n"
6308 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6309 "        if (s != 0)\n"
6310 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6311 "    }\n"
6312 msgstr ""
6313 "    if (guard_size E<gt>= 0) {\n"
6314 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6315 "        if (s != 0)\n"
6316 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6317 "    }\n"
6318
6319 #. type: Plain text
6320 #: build/C/man3/pthread_getattr_np.3:314
6321 #, no-wrap
6322 msgid ""
6323 "    return ret_attrp;\n"
6324 "}\n"
6325 msgstr ""
6326 "    return ret_attrp;\n"
6327 "}\n"
6328
6329 #. type: Plain text
6330 #: build/C/man3/pthread_getattr_np.3:323
6331 #, no-wrap
6332 msgid ""
6333 "int\n"
6334 "main(int argc, char *argv[])\n"
6335 "{\n"
6336 "    int s;\n"
6337 "    pthread_t thr;\n"
6338 "    pthread_attr_t attr;\n"
6339 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6340 "                                        a thread attributes object */\n"
6341 msgstr ""
6342 "int\n"
6343 "main(int argc, char *argv[])\n"
6344 "{\n"
6345 "    int s;\n"
6346 "    pthread_t thr;\n"
6347 "    pthread_attr_t attr;\n"
6348 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6349 "                                        a thread attributes object */\n"
6350
6351 #. type: Plain text
6352 #: build/C/man3/pthread_getattr_np.3:325
6353 #, no-wrap
6354 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6355 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6356
6357 #. type: Plain text
6358 #: build/C/man3/pthread_getattr_np.3:331
6359 #, no-wrap
6360 msgid ""
6361 "    if (attrp != NULL) {\n"
6362 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6363 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6364 "        printf(\"\\en\");\n"
6365 "    }\n"
6366 msgstr ""
6367 "    if (attrp != NULL) {\n"
6368 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6369 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6370 "        printf(\"\\en\");\n"
6371 "    }\n"
6372
6373 #. type: Plain text
6374 #: build/C/man3/pthread_getattr_np.3:361
6375 msgid ""
6376 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6377 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6378 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6379 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6380 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6381 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6382 msgstr ""
6383 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6384 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6385 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6386 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6387 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6388 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6389
6390 #. type: TH
6391 #: build/C/man3/pthread_getcpuclockid.3:26
6392 #, no-wrap
6393 msgid "PTHREAD_GETCPUCLOCKID"
6394 msgstr "PTHREAD_GETCPUCLOCKID"
6395
6396 #. type: TH
6397 #: build/C/man3/pthread_getcpuclockid.3:26
6398 #, no-wrap
6399 msgid "2009-02-08"
6400 msgstr "2009-02-08"
6401
6402 #. type: Plain text
6403 #: build/C/man3/pthread_getcpuclockid.3:29
6404 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
6405 msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する"
6406
6407 #. type: Plain text
6408 #: build/C/man3/pthread_getcpuclockid.3:33
6409 #, no-wrap
6410 msgid ""
6411 "B<#include E<lt>pthread.hE<gt>>\n"
6412 "B<#include E<lt>time.hE<gt>>\n"
6413 msgstr ""
6414 "B<#include E<lt>pthread.hE<gt>>\n"
6415 "B<#include E<lt>time.hE<gt>>\n"
6416
6417 #. type: Plain text
6418 #: build/C/man3/pthread_getcpuclockid.3:35
6419 #, no-wrap
6420 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
6421 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
6422
6423 #.  The clockid is constructed as follows:
6424 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
6425 #.  where CLOCK_IDFIELD_SIZE is 3.
6426 #. type: Plain text
6427 #: build/C/man3/pthread_getcpuclockid.3:46
6428 msgid ""
6429 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
6430 "time clock of the thread I<thread>."
6431 msgstr ""
6432 "B<pthread_getcpuclockid>() 関数は、\n"
6433 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
6434
6435 #. type: TP
6436 #: build/C/man3/pthread_getcpuclockid.3:50
6437 #, no-wrap
6438 msgid "B<ENOENT>"
6439 msgstr "B<ENOENT>"
6440
6441 #.  CLOCK_THREAD_CPUTIME_ID not defined
6442 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
6443 #.  be possible if kernel thread IDs took more than 29 bits (which
6444 #.  they currently cannot).
6445 #. type: Plain text
6446 #: build/C/man3/pthread_getcpuclockid.3:58
6447 msgid "Per-thread CPU time clocks are not supported by the system."
6448 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
6449
6450 #. type: Plain text
6451 #: build/C/man3/pthread_getcpuclockid.3:65
6452 msgid "This function is available in glibc since version 2.2."
6453 msgstr "この関数は glibc バージョン 2.2 以降で利用できる。"
6454
6455 #. type: Plain text
6456 #: build/C/man3/pthread_getcpuclockid.3:78
6457 msgid ""
6458 "When I<thread> refers to the calling thread, this function returns an "
6459 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
6460 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
6461 msgstr ""
6462 "I<thread> が呼び出したスレッドを参照している場合、\n"
6463 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
6464 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
6465 "を参照する ID が返される。"
6466
6467 #. type: Plain text
6468 #: build/C/man3/pthread_getcpuclockid.3:84
6469 msgid ""
6470 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
6471 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
6472 "the two threads.  The following shell session shows an example run:"
6473 msgstr ""
6474 "以下のプログラムは、スレッドを作成し、それから\n"
6475 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
6476 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
6477 "スレッド毎の CPU 時間を取得する。\n"
6478 "下記のシェルのセッションは実行例である。"
6479
6480 #. type: Plain text
6481 #: build/C/man3/pthread_getcpuclockid.3:94
6482 #, no-wrap
6483 msgid ""
6484 "$ B<./a.out>\n"
6485 "Main thread sleeping\n"
6486 "Subthread starting infinite loop\n"
6487 "Main thread consuming some CPU time...\n"
6488 "Process total CPU time:    1.368\n"
6489 "Main thread CPU time:      0.376\n"
6490 "Subthread CPU time:        0.992\n"
6491 msgstr ""
6492 "$ B<./a.out>\n"
6493 "Main thread sleeping\n"
6494 "Subthread starting infinite loop\n"
6495 "Main thread consuming some CPU time...\n"
6496 "Process total CPU time:    1.368\n"
6497 "Main thread CPU time:      0.376\n"
6498 "Subthread CPU time:        0.992\n"
6499
6500 #. type: Plain text
6501 #: build/C/man3/pthread_getcpuclockid.3:100
6502 #, no-wrap
6503 msgid "/* Link with \"-lrt\" */\n"
6504 msgstr "/* \"-lrt\" でリンクする */\n"
6505
6506 #. type: Plain text
6507 #: build/C/man3/pthread_getcpuclockid.3:108
6508 #, no-wrap
6509 msgid ""
6510 "#include E<lt>time.hE<gt>\n"
6511 "#include E<lt>stdio.hE<gt>\n"
6512 "#include E<lt>stdlib.hE<gt>\n"
6513 "#include E<lt>unistd.hE<gt>\n"
6514 "#include E<lt>pthread.hE<gt>\n"
6515 "#include E<lt>string.hE<gt>\n"
6516 "#include E<lt>errno.hE<gt>\n"
6517 msgstr ""
6518 "#include E<lt>time.hE<gt>\n"
6519 "#include E<lt>stdio.hE<gt>\n"
6520 "#include E<lt>stdlib.hE<gt>\n"
6521 "#include E<lt>unistd.hE<gt>\n"
6522 "#include E<lt>pthread.hE<gt>\n"
6523 "#include E<lt>string.hE<gt>\n"
6524 "#include E<lt>errno.hE<gt>\n"
6525
6526 #. type: Plain text
6527 #: build/C/man3/pthread_getcpuclockid.3:122
6528 #, no-wrap
6529 msgid ""
6530 "static void *\n"
6531 "thread_start(void *arg)\n"
6532 "{\n"
6533 "    printf(\"Subthread starting infinite loop\\en\");\n"
6534 "    for (;;)\n"
6535 "        continue;\n"
6536 "}\n"
6537 msgstr ""
6538 "static void *\n"
6539 "thread_start(void *arg)\n"
6540 "{\n"
6541 "    printf(\"Subthread starting infinite loop\\en\");\n"
6542 "    for (;;)\n"
6543 "        continue;\n"
6544 "}\n"
6545
6546 #. type: Plain text
6547 #: build/C/man3/pthread_getcpuclockid.3:127
6548 #, no-wrap
6549 msgid ""
6550 "static void\n"
6551 "pclock(char *msg, clockid_t cid)\n"
6552 "{\n"
6553 "    struct timespec ts;\n"
6554 msgstr ""
6555 "static void\n"
6556 "pclock(char *msg, clockid_t cid)\n"
6557 "{\n"
6558 "    struct timespec ts;\n"
6559
6560 #. type: Plain text
6561 #: build/C/man3/pthread_getcpuclockid.3:133
6562 #, no-wrap
6563 msgid ""
6564 "    printf(\"%s\", msg);\n"
6565 "    if (clock_gettime(cid, &ts) == -1)\n"
6566 "        handle_error(\"clock_gettime\");\n"
6567 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6568 "}\n"
6569 msgstr ""
6570 "    printf(\"%s\", msg);\n"
6571 "    if (clock_gettime(cid, &ts) == -1)\n"
6572 "        handle_error(\"clock_gettime\");\n"
6573 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6574 "}\n"
6575
6576 #. type: Plain text
6577 #: build/C/man3/pthread_getcpuclockid.3:140
6578 #, no-wrap
6579 msgid ""
6580 "int\n"
6581 "main(int argc, char *argv[])\n"
6582 "{\n"
6583 "    pthread_t thread;\n"
6584 "    clockid_t cid;\n"
6585 "    int j, s;\n"
6586 msgstr ""
6587 "int\n"
6588 "main(int argc, char *argv[])\n"
6589 "{\n"
6590 "    pthread_t thread;\n"
6591 "    clockid_t cid;\n"
6592 "    int j, s;\n"
6593
6594 #. type: Plain text
6595 #: build/C/man3/pthread_getcpuclockid.3:144
6596 #, no-wrap
6597 msgid ""
6598 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6599 "    if (s != 0)\n"
6600 "        handle_error_en(s, \"pthread_create\");\n"
6601 msgstr ""
6602 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6603 "    if (s != 0)\n"
6604 "        handle_error_en(s, \"pthread_create\");\n"
6605
6606 #. type: Plain text
6607 #: build/C/man3/pthread_getcpuclockid.3:147
6608 #, no-wrap
6609 msgid ""
6610 "    printf(\"Main thread sleeping\\en\");\n"
6611 "    sleep(1);\n"
6612 msgstr ""
6613 "    printf(\"Main thread sleeping\\en\");\n"
6614 "    sleep(1);\n"
6615
6616 #. type: Plain text
6617 #: build/C/man3/pthread_getcpuclockid.3:151
6618 #, no-wrap
6619 msgid ""
6620 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6621 "    for (j = 0; j E<lt> 2000000; j++)\n"
6622 "        getppid();\n"
6623 msgstr ""
6624 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6625 "    for (j = 0; j E<lt> 2000000; j++)\n"
6626 "        getppid();\n"
6627
6628 #. type: Plain text
6629 #: build/C/man3/pthread_getcpuclockid.3:153
6630 #, no-wrap
6631 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6632 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6633
6634 #. type: Plain text
6635 #: build/C/man3/pthread_getcpuclockid.3:158
6636 #, no-wrap
6637 msgid ""
6638 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6639 "    if (s != 0)\n"
6640 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6641 "    pclock(\"Main thread CPU time:   \", cid);\n"
6642 msgstr ""
6643 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6644 "    if (s != 0)\n"
6645 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6646 "    pclock(\"Main thread CPU time:   \", cid);\n"
6647
6648 #. type: Plain text
6649 #: build/C/man3/pthread_getcpuclockid.3:161
6650 #, no-wrap
6651 msgid ""
6652 "    /* The preceding 4 lines of code could have been replaced by:\n"
6653 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6654 msgstr ""
6655 "    /* The preceding 4 lines of code could have been replaced by:\n"
6656 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6657
6658 #. type: Plain text
6659 #: build/C/man3/pthread_getcpuclockid.3:166
6660 #, no-wrap
6661 msgid ""
6662 "    s = pthread_getcpuclockid(thread, &cid);\n"
6663 "    if (s != 0)\n"
6664 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6665 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6666 msgstr ""
6667 "    s = pthread_getcpuclockid(thread, &cid);\n"
6668 "    if (s != 0)\n"
6669 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6670 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6671
6672 #. type: Plain text
6673 #: build/C/man3/pthread_getcpuclockid.3:169
6674 #, no-wrap
6675 msgid ""
6676 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6677 "}\n"
6678 msgstr ""
6679 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6680 "}\n"
6681
6682 #. type: Plain text
6683 #: build/C/man3/pthread_getcpuclockid.3:178
6684 msgid ""
6685 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6686 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6687 msgstr ""
6688 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6689 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6690
6691 #. type: TH
6692 #: build/C/man3/pthread_join.3:26
6693 #, no-wrap
6694 msgid "PTHREAD_JOIN"
6695 msgstr "PTHREAD_JOIN"
6696
6697 #. type: Plain text
6698 #: build/C/man3/pthread_join.3:29
6699 msgid "pthread_join - join with a terminated thread"
6700 msgstr "pthread_join - 終了したスレッドを join する"
6701
6702 #. type: Plain text
6703 #: build/C/man3/pthread_join.3:34
6704 #, no-wrap
6705 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6706 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6707
6708 #. type: Plain text
6709 #: build/C/man3/pthread_join.3:49
6710 msgid ""
6711 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
6712 "to terminate.  If that thread has already terminated, then "
6713 "B<pthread_join>()  returns immediately.  The thread specified by I<thread> "
6714 "must be joinable."
6715 msgstr ""
6716 "B<pthread_join>() 関数は、I<thread> で指定されたスレッドが\n"
6717 "終了するのを待つ。そのスレッドがすでに終了している場合、\n"
6718 "B<pthread_join>() はすぐに返る。\n"
6719 "I<thread> で指定されたスレッドは join 可能でなければならない。"
6720
6721 #. type: Plain text
6722 #: build/C/man3/pthread_join.3:63
6723 msgid ""
6724 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
6725 "the target thread (i.e., the value that the target thread supplied to "
6726 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
6727 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
6728 msgstr ""
6729 "I<retval> が NULL でない場合、 B<pthread_join>() は対象スレッドの終了\n"
6730 "ステータス (すなわち、対象スレッドが B<pthread_exit>(3) に渡した値) を\n"
6731 "I<*retval> が指す場所にコピーする。対象スレッドがキャンセルされた場合、\n"
6732 "I<*retval> には B<PTHREAD_CANCELED> が格納される。"
6733
6734 #. type: Plain text
6735 #: build/C/man3/pthread_join.3:70
6736 msgid ""
6737 "If multiple threads simultaneously try to join with the same thread, the "
6738 "results are undefined.  If the thread calling B<pthread_join>()  is "
6739 "canceled, then the target thread will remain joinable (i.e., it will not be "
6740 "detached)."
6741 msgstr ""
6742 "複数のスレッドが同時に同じスレッドを join しようとした場合、その結果\n"
6743 "は不定である。B<pthread_join>() を呼び出しているスレッドがキャンセル\n"
6744 "された場合、対象スレッドは join 可能のままとなる (detached 状態には\n"
6745 "ならない)。"
6746
6747 #. type: Plain text
6748 #: build/C/man3/pthread_join.3:75
6749 msgid ""
6750 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
6751 "number."
6752 msgstr ""
6753 "成功すると、 B<pthread_join>() は 0 を返す。\n"
6754 "エラーの場合、エラー番号を返す。"
6755
6756 #. type: TP
6757 #: build/C/man3/pthread_join.3:76
6758 #, no-wrap
6759 msgid "B<EDEADLK>"
6760 msgstr "B<EDEADLK>"
6761
6762 #.  The following verified by testing on glibc 2.8/NPTL:
6763 #.  The following verified by testing on glibc 2.8/NPTL:
6764 #. type: Plain text
6765 #: build/C/man3/pthread_join.3:85
6766 msgid ""
6767 "A deadlock was detected (e.g., two threads tried to join with each other); "
6768 "or I<thread> specifies the calling thread."
6769 msgstr ""
6770 "デッドロックが検出された (例えば、二つのスレッドが互いに join しようと\n"
6771 "した場合)、または I<thread> に呼び出したスレッドが指定されている。"
6772
6773 #.  POSIX.1-2001 does not specify this error case.
6774 #. type: Plain text
6775 #: build/C/man3/pthread_join.3:93
6776 msgid "Another thread is already waiting to join with this thread."
6777 msgstr "別のスレッドがすでにこのスレッドの join 待ちである。"
6778
6779 #. type: Plain text
6780 #: build/C/man3/pthread_join.3:104
6781 msgid ""
6782 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
6783 "the target thread has terminated."
6784 msgstr ""
6785 "B<pthread_join>() の呼び出しが成功した場合は、\n"
6786 "呼び出し側には、対象スレッドが終了していることが保証される。"
6787
6788 #. type: Plain text
6789 #: build/C/man3/pthread_join.3:107
6790 msgid ""
6791 "Joining with a thread that has previously been joined results in undefined "
6792 "behavior."
6793 msgstr "すでに join されたスレッドを join した場合の結果は不定である。"
6794
6795 #. type: Plain text
6796 #: build/C/man3/pthread_join.3:115
6797 msgid ""
6798 "Failure to join with a thread that is joinable (i.e., one that is not "
6799 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
6800 "zombie thread consumes some system resources, and when enough zombie threads "
6801 "have accumulated, it will no longer be possible to create new threads (or "
6802 "processes)."
6803 msgstr ""
6804 "join 可能なスレッド (detached 状態でないスレッド) の join に失敗した場合、\n"
6805 "\"ゾンビスレッド (zombie thread)\" が生成される。\n"
6806 "各ゾンビスレッドはシステムリソースをいくらかは消費し、\n"
6807 "ゾンビスレッドがたくさん生成されてしまうと、\n"
6808 "新しいスレッド (やプロセス) がそれ以上作成できなくなってしまうので、\n"
6809 "このようなことが起きるのは避けること。"
6810
6811 #. type: Plain text
6812 #: build/C/man3/pthread_join.3:121
6813 msgid ""
6814 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
6815 "\"join with any terminated thread\".  If you believe you need this "
6816 "functionality, you probably need to rethink your application design."
6817 msgstr ""
6818 "pthreads には、 I<waitpid(-1,\\ &status,\\ 0)>、つまり\n"
6819 "\"終了されたスレッドのどれかを join する\" といった機能はない。\n"
6820 "この機能が必要だと思うような場合には、おそらく\n"
6821 "自分のアプリケーションの設計を考え直す必要があるだろう。"
6822
6823 #. type: Plain text
6824 #: build/C/man3/pthread_join.3:124
6825 msgid ""
6826 "All of the threads in a process are peers: any thread can join with any "
6827 "other thread in the process."
6828 msgstr ""
6829 "プロセス内の全てのスレッドは対等であり、\n"
6830 "どのスレッドでもプロセス内の他のスレッドを join できる。"
6831
6832 #. type: Plain text
6833 #: build/C/man3/pthread_join.3:134
6834 msgid ""
6835 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6836 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6837 msgstr ""
6838 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6839 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6840
6841 #. type: TH
6842 #: build/C/man3/pthread_kill.3:26
6843 #, no-wrap
6844 msgid "PTHREAD_KILL"
6845 msgstr "PTHREAD_KILL"
6846
6847 #. type: TH
6848 #: build/C/man3/pthread_kill.3:26
6849 #: build/C/man3/pthread_kill_other_threads_np.3:26
6850 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setcancelstate.3:26
6851 #: build/C/man3/pthread_yield.3:25
6852 #, no-wrap
6853 msgid "2014-05-13"
6854 msgstr "2014-05-13"
6855
6856 #. type: Plain text
6857 #: build/C/man3/pthread_kill.3:29
6858 msgid "pthread_kill - send a signal to a thread"
6859 msgstr "pthread_kill - スレッドにシグナルを送信する"
6860
6861 #. type: Plain text
6862 #: build/C/man3/pthread_kill.3:32 build/C/man3/pthread_sigmask.3:32
6863 #, no-wrap
6864 msgid "B<#include E<lt>signal.hE<gt>>\n"
6865 msgstr "B<#include E<lt>signal.hE<gt>>\n"
6866
6867 #. type: Plain text
6868 #: build/C/man3/pthread_kill.3:34
6869 #, no-wrap
6870 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6871 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6872
6873 #. type: Plain text
6874 #: build/C/man3/pthread_kill.3:45
6875 msgid "B<pthread_kill>():"
6876 msgstr "B<pthread_kill>():"
6877
6878 #. type: Plain text
6879 #: build/C/man3/pthread_kill.3:47 build/C/man3/pthread_sigmask.3:48
6880 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
6881 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
6882
6883 #. type: Plain text
6884 #: build/C/man3/pthread_kill.3:59
6885 msgid ""
6886 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, a "
6887 "thread in the same process as the caller.  The signal is asynchronously "
6888 "directed to I<thread>."
6889 msgstr ""
6890 "B<pthread_kill>() 関数は、呼び出したスレッドと同じプロセスの\n"
6891 "スレッド I<thread> にシグナル I<sig> を送信する。\n"
6892 "シグナルは非同期に I<thread> へ直接送られる。"
6893
6894 #. type: Plain text
6895 #: build/C/man3/pthread_kill.3:63
6896 msgid ""
6897 "If I<sig> is 0, then no signal is sent, but error checking is still "
6898 "performed."
6899 msgstr ""
6900 "I<sig> が 0 の場合、シグナルは送信されないが、エラーチェックだけは実行され"
6901 "る。"
6902
6903 #. type: Plain text
6904 #: build/C/man3/pthread_kill.3:68
6905 msgid ""
6906 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
6907 "number, and no signal is sent."
6908 msgstr ""
6909 "成功すると、 B<pthread_kill>() は 0 を返す。\n"
6910 "エラーの場合、エラー番号を返し、シグナルの送信は行わない。"
6911
6912 #. type: Plain text
6913 #: build/C/man3/pthread_kill.3:72
6914 msgid "An invalid signal was specified."
6915 msgstr "無効なシグナルが指定された。"
6916
6917 #. type: Plain text
6918 #: build/C/man3/pthread_kill.3:77
6919 msgid "The B<pthread_kill>()  function is thread-safe."
6920 msgstr "B<pthread_kill>() 関数はスレッドセーフである。"
6921
6922 #. type: Plain text
6923 #: build/C/man3/pthread_kill.3:79
6924 msgid "POSIX.1-2008."
6925 msgstr "POSIX.1-2008."
6926
6927 #. type: Plain text
6928 #: build/C/man3/pthread_kill.3:86
6929 msgid ""
6930 "Signal dispositions are process-wide: if a signal handler is installed, the "
6931 "handler will be invoked in the thread I<thread>, but if the disposition of "
6932 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
6933 "affect the whole process."
6934 msgstr ""
6935 "シグナルの配送はプロセス全体で行われる。\n"
6936 "シグナルハンドラが設定されている場合、\n"
6937 "そのハンドラがスレッド I<thread> で起動されるが、\n"
6938 "シグナルの配送が \"stop\", \"continue\", \"terminate\" のいずれかの場合、\n"
6939 "シグナルに対するアクションはプロセス全体に影響がある。"
6940
6941 #. type: Plain text
6942 #: build/C/man3/pthread_kill.3:99
6943 msgid ""
6944 "POSIX.1-2008 recommends that if an implementation detects the use of a "
6945 "thread ID after the end of its lifetime, B<pthread_kill>()  should return "
6946 "the error B<ESRCH>.  The glibc implementation returns this error in the "
6947 "cases where an invalid thread ID can be detected.  But note also that POSIX "
6948 "says that an attempt to use a thread ID whose lifetime has ended produces "
6949 "undefined behavior, and an attempt to use an invalid thread ID in a call to "
6950 "B<pthread_kill>()  can, for example, cause a segmentation fault."
6951 msgstr ""
6952 "POSIX.1-2008 では、 スレッドが終了した後にそのスレッド ID が使用されたことを"
6953 "検出した場合に、 B<pthread_kill>() はエラー B<ESRCH> を返すことを推奨されてい"
6954 "る。 glibc の実装では、無効なスレッド ID を検出できる場合にはこのエラーを返"
6955 "す。 しかし、 POSIX では、 終了したスレッド ID を使おうとした場合の動作は不定"
6956 "であり、 B<pthread_kill>() で無効なスレッド ID を使おうとした場合には、 例え"
6957 "ば、 セグメンテーションフォールトになる可能性もある点に注意すること。"
6958
6959 #. type: Plain text
6960 #: build/C/man3/pthread_kill.3:108
6961 msgid ""
6962 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
6963 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
6964 msgstr ""
6965 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
6966 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
6967
6968 #. type: TH
6969 #: build/C/man3/pthread_kill_other_threads_np.3:26
6970 #, no-wrap
6971 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
6972 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
6973
6974 #. type: Plain text
6975 #: build/C/man3/pthread_kill_other_threads_np.3:29
6976 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
6977 msgstr "pthread_kill_other_threads_np - プロセス内の他の全スレッドを終了する"
6978
6979 #. type: Plain text
6980 #: build/C/man3/pthread_kill_other_threads_np.3:34
6981 #, no-wrap
6982 msgid "B<void pthread_kill_other_threads_np(void);>\n"
6983 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
6984
6985 #.  .SH VERSIONS
6986 #.  Available since glibc 2.0
6987 #. type: Plain text
6988 #: build/C/man3/pthread_kill_other_threads_np.3:47
6989 msgid ""
6990 "B<pthread_kill_other_threads_np>()  has an effect only in the LinuxThreads "
6991 "threading implementation.  On that implementation, calling this function "
6992 "causes the immediate termination of all threads in the application, except "
6993 "the calling thread.  The cancellation state and cancellation type of the to-"
6994 "be-terminated threads are ignored, and the cleanup handlers are not called "
6995 "in those threads."
6996 msgstr ""
6997 "B<pthread_kill_other_threads_np>() は、\n"
6998 "LinuxThreads スレッド実装においてのみ効果がある。\n"
6999 "LinuxThreads スレッド実装では、この関数を呼び出すと\n"
7000 "アプリケーション内の全てのスレッドがすぐに終了される。\n"
7001 "終了対象のスレッドの cancelability state と cancelability type は\n"
7002 "無視され、それらのスレッドのクリーンアップハンドラは呼び出されない。"
7003
7004 #. type: Plain text
7005 #: build/C/man3/pthread_kill_other_threads_np.3:52
7006 msgid "The B<pthread_kill_other_threads_np>()  function is thread-safe."
7007 msgstr "B<pthread_kill_other_threads_np>() 関数はスレッドセーフである。"
7008
7009 #. type: Plain text
7010 #: build/C/man3/pthread_kill_other_threads_np.3:64
7011 msgid ""
7012 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
7013 "thread calls B<execve>(2)  or a similar function.  This function is designed "
7014 "to address a limitation in the obsolete LinuxThreads implementation whereby "
7015 "the other threads of an application are not automatically terminated (as "
7016 "POSIX.1-2001 requires) during B<execve>(2)."
7017 msgstr ""
7018 "B<pthread_kill_other_threads_np>() は、\n"
7019 "スレッドが B<execve>(2) や同様の関数を呼び出す直前に\n"
7020 "呼ばれることを目的として用意されている。\n"
7021 "この関数は、(廃止予定の) LinuxThreads スレッド実装における、\n"
7022 "B<execve>(2) の際にアプリケーションの他のスレッドが自動的に\n"
7023 "終了されないという制限を解決するために設計された。"
7024
7025 #. type: Plain text
7026 #: build/C/man3/pthread_kill_other_threads_np.3:71
7027 msgid ""
7028 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
7029 "exists, but does nothing.  (Nothing needs to be done, because the "
7030 "implementation does the right thing during an B<execve>(2).)"
7031 msgstr ""
7032 "NPTL スレッド実装では、 B<pthread_kill_other_threads_np>() は存在するが、\n"
7033 "何もしない(NPTL 実装は B<execve>(2) の際に適切な動作をするので、\n"
7034 "何もする必要がないということだ)。"
7035
7036 #. type: Plain text
7037 #: build/C/man3/pthread_kill_other_threads_np.3:77
7038 msgid ""
7039 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7040 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7041 msgstr ""
7042 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7043 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7044
7045 #. type: TH
7046 #: build/C/man3/pthread_self.3:26
7047 #, no-wrap
7048 msgid "PTHREAD_SELF"
7049 msgstr "PTHREAD_SELF"
7050
7051 #. type: Plain text
7052 #: build/C/man3/pthread_self.3:29
7053 msgid "pthread_self - obtain ID of the calling thread"
7054 msgstr "pthread_self - 呼び出したスレッドの ID を取得する"
7055
7056 #. type: Plain text
7057 #: build/C/man3/pthread_self.3:34
7058 #, no-wrap
7059 msgid "B<pthread_t pthread_self(void);>\n"
7060 msgstr "B<pthread_t pthread_self(void);>\n"
7061
7062 #. type: Plain text
7063 #: build/C/man3/pthread_self.3:46
7064 msgid ""
7065 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
7066 "is the same value that is returned in I<*thread> in the "
7067 "B<pthread_create>(3)  call that created this thread."
7068 msgstr ""
7069 "B<pthread_self>() 関数は、呼び出したスレッドの ID を返す。\n"
7070 "得られる ID は、このスレッドが作成された B<pthread_create>(3) の\n"
7071 "呼び出しで I<*thread> で返されるのと同じ値である。"
7072
7073 #. type: Plain text
7074 #: build/C/man3/pthread_self.3:48
7075 msgid "This function always succeeds, returning the calling thread's ID."
7076 msgstr "この関数は常に成功し、呼び出したスレッドの ID を返す。"
7077
7078 #. type: Plain text
7079 #: build/C/man3/pthread_self.3:55
7080 msgid "The B<pthread_self>()  function is thread-safe."
7081 msgstr "B<pthread_self>() 関数はスレッドセーフである。"
7082
7083 #. type: Plain text
7084 #: build/C/man3/pthread_self.3:68
7085 msgid ""
7086 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
7087 "represent a thread ID; for example, representation using either an "
7088 "arithmetic type or a structure is permitted.  Therefore, variables of type "
7089 "I<pthread_t> can't portably be compared using the C equality operator "
7090 "(B<==>); use B<pthread_equal>(3)  instead."
7091 msgstr ""
7092 "POSIX.1 では、スレッド ID を表現するのに使用する型は、\n"
7093 "スレッド実装が完全に自由に選択してよいことになっている。\n"
7094 "例えば、スレッド ID を表現するのに数値型を使っても構造体を使ってもよい。\n"
7095 "そのため、移植性を確保しつつ、 C 言語の等価演算子 (B<==>) を使って、\n"
7096 "I<pthread_t> 型の変数の比較を行うことはできない。\n"
7097 "代わりに B<pthread_equal>(3) を使うこと。"
7098
7099 #. type: Plain text
7100 #: build/C/man3/pthread_self.3:72
7101 msgid ""
7102 "Thread identifiers should be considered opaque: any attempt to use a thread "
7103 "ID other than in pthreads calls is nonportable and can lead to unspecified "
7104 "results."
7105 msgstr ""
7106 "スレッド識別子はその内部構造を意識すべきではない。\n"
7107 "pthreads 関数以外でスレッド ID を利用しようとした場合、\n"
7108 "移植性がなくなり、どのような結果が得られるかも分からない。"
7109
7110 #. type: Plain text
7111 #: build/C/man3/pthread_self.3:76
7112 msgid ""
7113 "Thread IDs are guaranteed to be unique only within a process.  A thread ID "
7114 "may be reused after a terminated thread has been joined, or a detached "
7115 "thread has terminated."
7116 msgstr ""
7117 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
7118 "終了したスレッドが join されたり、\n"
7119 "切り離された (detached) スレッドが終了されたりした後は、\n"
7120 "そのスレッド ID は再利用されることがある。"
7121
7122 #. type: Plain text
7123 #: build/C/man3/pthread_self.3:81
7124 msgid ""
7125 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
7126 "kernel thread ID returned by a call to B<gettid>(2)."
7127 msgstr ""
7128 "B<pthread_self>() が返すスレッド ID は、\n"
7129 "B<gettid>(2) が返すカーネルスレッド ID とは違うものである。"
7130
7131 #. type: Plain text
7132 #: build/C/man3/pthread_self.3:85
7133 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7134 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7135
7136 #. type: TH
7137 #: build/C/man3/pthread_setaffinity_np.3:26
7138 #, no-wrap
7139 msgid "PTHREAD_SETAFFINITY_NP"
7140 msgstr "PTHREAD_SETAFFINITY_NP"
7141
7142 #. type: Plain text
7143 #: build/C/man3/pthread_setaffinity_np.3:30
7144 msgid ""
7145 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
7146 "thread"
7147 msgstr ""
7148 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
7149 "CPU affinity の設定/取得を行う"
7150
7151 #. type: Plain text
7152 #: build/C/man3/pthread_setaffinity_np.3:39
7153 #, no-wrap
7154 msgid ""
7155 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7156 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
7157 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7158 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
7159 msgstr ""
7160 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7161 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
7162 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7163 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
7164
7165 #. type: Plain text
7166 #: build/C/man3/pthread_setaffinity_np.3:54
7167 msgid ""
7168 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
7169 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
7170 "successful, and the thread is not currently running on one of the CPUs in "
7171 "I<cpuset>, then it is migrated to one of those CPUs."
7172 msgstr ""
7173 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7174 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
7175 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
7176 "場合は、スレッドは指定された CPU のいずれかに移動される。"
7177
7178 #. type: Plain text
7179 #: build/C/man3/pthread_setaffinity_np.3:61
7180 msgid ""
7181 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
7182 "the thread I<thread> in the buffer pointed to by I<cpuset>."
7183 msgstr ""
7184 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7185 "マスクを、I<cpuset> が指すバッファに入れて返す。"
7186
7187 #. type: Plain text
7188 #: build/C/man3/pthread_setaffinity_np.3:77
7189 msgid ""
7190 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
7191 "by I<cpuset>.  Typically, this argument would be specified as "
7192 "I<sizeof(cpu_set_t)>.  (It may be some other value, if using the macros "
7193 "described in B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
7194 msgstr ""
7195 "引き数 I<cpusetsize> は I<cpuset> が指すバッファの長さ (バイト単位) で\n"
7196 "ある。通常は、この引き数には I<sizeof(cpu_set_t)> を指定する\n"
7197 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
7198 "割り当てている場合には、別の値になることもある)。"
7199
7200 #. type: TP
7201 #: build/C/man3/pthread_setaffinity_np.3:81
7202 #, no-wrap
7203 msgid "B<EFAULT>"
7204 msgstr "B<EFAULT>"
7205
7206 #. type: Plain text
7207 #: build/C/man3/pthread_setaffinity_np.3:84
7208 msgid "A supplied memory address was invalid."
7209 msgstr "指定されたメモリアドレスが無効である。"
7210
7211 #. type: Plain text
7212 #: build/C/man3/pthread_setaffinity_np.3:93
7213 msgid ""
7214 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
7215 "processors that are currently physically on the system and permitted to the "
7216 "thread according to any restrictions that may be imposed by the \"cpuset\" "
7217 "mechanism described in B<cpuset>(7)."
7218 msgstr ""
7219 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
7220 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
7221 "されているプロセッサが一つも含まれていない。\n"
7222 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
7223 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
7224
7225 #.  FIXME . ?
7226 #.  Loic Domaigne commented: it seems that in the future the
7227 #.  kernel developers want to make cpumask_t dynamic, so
7228 #.  CONFIG_NR_CPUS might become obsolete in the future.
7229 #.  cpumask_t
7230 #.  The raw sched_getaffinity() system call returns the size (in bytes)
7231 #.  of the cpumask_t type.
7232 #. type: Plain text
7233 #: build/C/man3/pthread_setaffinity_np.3:109
7234 msgid ""
7235 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
7236 "the set supported by the kernel.  (The kernel configuration option "
7237 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
7238 "type used to represent CPU sets.)"
7239 msgstr ""
7240 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
7241 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
7242 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
7243 "データ型がサポートする CPU 集合の範囲が定義される。)"
7244
7245 #. type: Plain text
7246 #: build/C/man3/pthread_setaffinity_np.3:114
7247 msgid ""
7248 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
7249 "affinity mask used by the kernel."
7250 msgstr ""
7251 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
7252 "affinity マスクの大きさよりも小さい。"
7253
7254 #. type: Plain text
7255 #: build/C/man3/pthread_setaffinity_np.3:137
7256 msgid ""
7257 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
7258 "thread will actually run is the intersection of the set specified in the "
7259 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
7260 "system may further restrict the set of CPUs on which the thread runs if the "
7261 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
7262 "restrictions on the actual set of CPUs on which the thread will run are "
7263 "silently imposed by the kernel."
7264 msgstr ""
7265 "B<pthread_setaffinity_np>() を呼び出した後、\n"
7266 "そのスレッドが実際に実行される CPU 集合は、\n"
7267 "I<cpuset> 引き数で指定された集合と\n"
7268 "システムに実際に存在する CPU 集合の共通部分になる。\n"
7269 "また、 B<cpuset>(7) で説明されている \"cpuset\" 機構が使われている場合\n"
7270 "には、そのスレッドが実行される CPU 集合がシステムによってさらに制限\n"
7271 "される場合がある。そのスレッドが実行される実際の CPU 集合に対する\n"
7272 "これらの制限は、カーネルにより黙って適用される。"
7273
7274 #. type: Plain text
7275 #: build/C/man3/pthread_setaffinity_np.3:143
7276 msgid ""
7277 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
7278 "B<sched_getaffinity>(2)  system calls."
7279 msgstr ""
7280 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
7281 "B<sched_getaffinity>(2) を使って実装されている。"
7282
7283 #. type: Plain text
7284 #: build/C/man3/pthread_setaffinity_np.3:154
7285 msgid ""
7286 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
7287 "creator's CPU affinity mask."
7288 msgstr ""
7289 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
7290 "作成者の CPU affinity マスクを継承する。"
7291
7292 #. type: Plain text
7293 #: build/C/man3/pthread_setaffinity_np.3:162
7294 msgid ""
7295 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
7296 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
7297 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
7298 "check the resulting CPU affinity mask of the thread."
7299 msgstr ""
7300 "以下のプログラムでは、メインスレッドは\n"
7301 "B<pthread_setaffinity_np>() を使って自分の CPU affinity マスクに\n"
7302 "CPU 0 から 7 が含まれるように設定し\n"
7303 "(システム上には 0 から 7 に対応する CPU が全て存在するとは限らない)、\n"
7304 "その後で B<pthread_getaffinity_np>() を使って\n"
7305 "スレッドに実際に設定された CPU affinity マスクを確認している。"
7306
7307 #. type: Plain text
7308 #: build/C/man3/pthread_setaffinity_np.3:169
7309 #, no-wrap
7310 msgid ""
7311 "#define _GNU_SOURCE\n"
7312 "#include E<lt>pthread.hE<gt>\n"
7313 "#include E<lt>stdio.hE<gt>\n"
7314 "#include E<lt>stdlib.hE<gt>\n"
7315 "#include E<lt>errno.hE<gt>\n"
7316 msgstr ""
7317 "#define _GNU_SOURCE\n"
7318 "#include E<lt>pthread.hE<gt>\n"
7319 "#include E<lt>stdio.hE<gt>\n"
7320 "#include E<lt>stdlib.hE<gt>\n"
7321 "#include E<lt>errno.hE<gt>\n"
7322
7323 #. type: Plain text
7324 #: build/C/man3/pthread_setaffinity_np.3:179
7325 #, no-wrap
7326 msgid ""
7327 "int\n"
7328 "main(int argc, char *argv[])\n"
7329 "{\n"
7330 "    int s, j;\n"
7331 "    cpu_set_t cpuset;\n"
7332 "    pthread_t thread;\n"
7333 msgstr ""
7334 "int\n"
7335 "main(int argc, char *argv[])\n"
7336 "{\n"
7337 "    int s, j;\n"
7338 "    cpu_set_t cpuset;\n"
7339 "    pthread_t thread;\n"
7340
7341 #. type: Plain text
7342 #: build/C/man3/pthread_setaffinity_np.3:181
7343 #, no-wrap
7344 msgid "    thread = pthread_self();\n"
7345 msgstr "    thread = pthread_self();\n"
7346
7347 #. type: Plain text
7348 #: build/C/man3/pthread_setaffinity_np.3:183
7349 #, no-wrap
7350 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7351 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7352
7353 #. type: Plain text
7354 #: build/C/man3/pthread_setaffinity_np.3:187
7355 #, no-wrap
7356 msgid ""
7357 "    CPU_ZERO(&cpuset);\n"
7358 "    for (j = 0; j E<lt> 8; j++)\n"
7359 "        CPU_SET(j, &cpuset);\n"
7360 msgstr ""
7361 "    CPU_ZERO(&cpuset);\n"
7362 "    for (j = 0; j E<lt> 8; j++)\n"
7363 "        CPU_SET(j, &cpuset);\n"
7364
7365 #. type: Plain text
7366 #: build/C/man3/pthread_setaffinity_np.3:191
7367 #, no-wrap
7368 msgid ""
7369 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7370 "    if (s != 0)\n"
7371 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7372 msgstr ""
7373 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7374 "    if (s != 0)\n"
7375 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7376
7377 #. type: Plain text
7378 #: build/C/man3/pthread_setaffinity_np.3:193
7379 #, no-wrap
7380 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
7381 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
7382
7383 #. type: Plain text
7384 #: build/C/man3/pthread_setaffinity_np.3:197
7385 #, no-wrap
7386 msgid ""
7387 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7388 "    if (s != 0)\n"
7389 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7390 msgstr ""
7391 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7392 "    if (s != 0)\n"
7393 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7394
7395 #. type: Plain text
7396 #: build/C/man3/pthread_setaffinity_np.3:202
7397 #, no-wrap
7398 msgid ""
7399 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7400 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7401 "        if (CPU_ISSET(j, &cpuset))\n"
7402 "            printf(\"    CPU %d\\en\", j);\n"
7403 msgstr ""
7404 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7405 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7406 "        if (CPU_ISSET(j, &cpuset))\n"
7407 "            printf(\"    CPU %d\\en\", j);\n"
7408
7409 #. type: Plain text
7410 #: build/C/man3/pthread_setaffinity_np.3:205
7411 #: build/C/man3/pthread_setschedparam.3:437
7412 #, no-wrap
7413 msgid ""
7414 "    exit(EXIT_SUCCESS);\n"
7415 "}\n"
7416 msgstr ""
7417 "    exit(EXIT_SUCCESS);\n"
7418 "}\n"
7419
7420 #. type: Plain text
7421 #: build/C/man3/pthread_setaffinity_np.3:214
7422 msgid ""
7423 "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), "
7424 "B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), "
7425 "B<sched>(7)"
7426 msgstr "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), B<sched>(7)"
7427
7428 #. type: TH
7429 #: build/C/man3/pthread_setcancelstate.3:26
7430 #, no-wrap
7431 msgid "PTHREAD_SETCANCELSTATE"
7432 msgstr "PTHREAD_SETCANCELSTATE"
7433
7434 #. type: Plain text
7435 #: build/C/man3/pthread_setcancelstate.3:30
7436 msgid ""
7437 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
7438 "type"
7439 msgstr ""
7440 "pthread_setcancelstate, pthread_setcanceltype - cancelability state と "
7441 "cancelability type を設定する"
7442
7443 #. type: Plain text
7444 #: build/C/man3/pthread_setcancelstate.3:36
7445 #, no-wrap
7446 msgid ""
7447 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7448 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7449 msgstr ""
7450 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7451 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7452
7453 #. type: Plain text
7454 #: build/C/man3/pthread_setcancelstate.3:51
7455 msgid ""
7456 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
7457 "thread to the value given in I<state>.  The previous cancelability state of "
7458 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
7459 "I<state> argument must have one of the following values:"
7460 msgstr ""
7461 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
7462 "cancelability state に I<state> で指定された\n"
7463 "値を設定する。変更前のスレッドの cancelability state は\n"
7464 "I<oldstate> が指すバッファで返される。\n"
7465 "I<state> 引き数には以下の値のいずれか一つを指定しなければならない。"
7466
7467 #. type: TP
7468 #: build/C/man3/pthread_setcancelstate.3:51
7469 #, no-wrap
7470 msgid "B<PTHREAD_CANCEL_ENABLE>"
7471 msgstr "B<PTHREAD_CANCEL_ENABLE>"
7472
7473 #. type: Plain text
7474 #: build/C/man3/pthread_setcancelstate.3:58
7475 msgid ""
7476 "The thread is cancelable.  This is the default cancelability state in all "
7477 "new threads, including the initial thread.  The thread's cancelability type "
7478 "determines when a cancelable thread will respond to a cancellation request."
7479 msgstr ""
7480 "スレッドは取り消し可能 (cancelable) である。\n"
7481 "これが全ての新しく作成されるスレッドでのデフォルトの\n"
7482 "cancelability state である。これには最初のスレッドも含まれる。\n"
7483 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
7484 "取り消し要求にいつ反応するかが決まる。"
7485
7486 #. type: TP
7487 #: build/C/man3/pthread_setcancelstate.3:58
7488 #, no-wrap
7489 msgid "B<PTHREAD_CANCEL_DISABLE>"
7490 msgstr "B<PTHREAD_CANCEL_DISABLE>"
7491
7492 #. type: Plain text
7493 #: build/C/man3/pthread_setcancelstate.3:63
7494 msgid ""
7495 "The thread is not cancelable.  If a cancellation request is received, it is "
7496 "blocked until cancelability is enabled."
7497 msgstr ""
7498 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
7499 "取り消し可能に設定されるまでその要求はブロックされる。"
7500
7501 #. type: Plain text
7502 #: build/C/man3/pthread_setcancelstate.3:75
7503 msgid ""
7504 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
7505 "thread to the value given in I<type>.  The previous cancelability type of "
7506 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
7507 "argument must have one of the following values:"
7508 msgstr ""
7509 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
7510 "cancelability type に I<type> で指定された値を設定する。\n"
7511 "変更前のスレッドの cancelability type は\n"
7512 "I<oldtype> が指すバッファで返される。\n"
7513 "I<type> 引き数には以下の値のいずれか一つを指定しなければならない。"
7514
7515 #. type: TP
7516 #: build/C/man3/pthread_setcancelstate.3:75
7517 #, no-wrap
7518 msgid "B<PTHREAD_CANCEL_DEFERRED>"
7519 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
7520
7521 #. type: Plain text
7522 #: build/C/man3/pthread_setcancelstate.3:82
7523 msgid ""
7524 "A cancellation request is deferred until the thread next calls a function "
7525 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
7526 "cancelability type in all new threads, including the initial thread."
7527 msgstr ""
7528 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
7529 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
7530 "スレッドでのデフォルトの cancelability type である。\n"
7531 "これには最初のスレッドも含まれる。"
7532
7533 #. type: TP
7534 #: build/C/man3/pthread_setcancelstate.3:82
7535 #, no-wrap
7536 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7537 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7538
7539 #. type: Plain text
7540 #: build/C/man3/pthread_setcancelstate.3:88
7541 msgid ""
7542 "The thread can be canceled at any time.  (Typically, it will be canceled "
7543 "immediately upon receiving a cancellation request, but the system doesn't "
7544 "guarantee this.)"
7545 msgstr ""
7546 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
7547 "システムがそのことを保証しているわけではない)。"
7548
7549 #. type: Plain text
7550 #: build/C/man3/pthread_setcancelstate.3:92
7551 msgid ""
7552 "The set-and-get operation performed by each of these functions is atomic "
7553 "with respect to other threads in the process calling the same function."
7554 msgstr ""
7555 "これらの関数により実行される「設定と取得」操作 (set-and-get operation) は、\n"
7556 "同じ関数を呼び出したプロセス内の他のスレッドがあっても、\n"
7557 "アトミックに行われる。"
7558
7559 #. type: Plain text
7560 #: build/C/man3/pthread_setcancelstate.3:99
7561 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
7562 msgstr "B<pthread_setcancelstate>() は以下のエラーで失敗する場合がある。"
7563
7564 #. type: Plain text
7565 #: build/C/man3/pthread_setcancelstate.3:103
7566 msgid "Invalid value for I<state>."
7567 msgstr "I<state> に無効な値が指定された。"
7568
7569 #. type: Plain text
7570 #: build/C/man3/pthread_setcancelstate.3:107
7571 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
7572 msgstr "B<pthread_setcanceltype>() は以下のエラーで失敗する場合がある。"
7573
7574 #.  .SH VERSIONS
7575 #.  Available since glibc 2.0
7576 #. type: Plain text
7577 #: build/C/man3/pthread_setcancelstate.3:113
7578 msgid "Invalid value for I<type>."
7579 msgstr "I<type> に無効な値が指定された。"
7580
7581 #. type: Plain text
7582 #: build/C/man3/pthread_setcancelstate.3:120
7583 msgid ""
7584 "The B<pthread_setcancelstate>()  and B<pthread_setcanceltype>()  functions "
7585 "are thread-safe."
7586 msgstr "関数 B<pthread_setcancelstate>() と B<pthread_setcanceltype>() はスレッドセーフである。"
7587
7588 #. type: Plain text
7589 #: build/C/man3/pthread_setcancelstate.3:125
7590 msgid ""
7591 "For details of what happens when a thread is canceled, see "
7592 "B<pthread_cancel>(3)."
7593 msgstr ""
7594 "スレッドが取り消された場合に何が起こるかの詳細については\n"
7595 "B<pthread_cancel>(3) を参照。"
7596
7597 #. type: Plain text
7598 #: build/C/man3/pthread_setcancelstate.3:132
7599 msgid ""
7600 "Briefly disabling cancelability is useful if a thread performs some critical "
7601 "action that must not be interrupted by a cancellation request.  Beware of "
7602 "disabling cancelability for long periods, or around operations that may "
7603 "block for long periods, since that will render the thread unresponsive to "
7604 "cancellation requests."
7605 msgstr ""
7606 "取り消し要求により中断されてはならない重要なアクションをスレッドが\n"
7607 "実行する場合、短い時間だけ cancelability を無効にするのは有用である。\n"
7608 "長い時間 cancelability を無効にしたり、長い時間停止 (block) される\n"
7609 "可能性のある操作の前後で cancelability を無効にしたりする際には\n"
7610 "注意すること。なぜなら、無効にしてしまうと、キャンセル要求に対して\n"
7611 "スレッドが応答しない状態になってしまうからである。"
7612
7613 #. type: SS
7614 #: build/C/man3/pthread_setcancelstate.3:132
7615 #, no-wrap
7616 msgid "Asynchronous cancelability"
7617 msgstr ""
7618
7619 #. type: Plain text
7620 #: build/C/man3/pthread_setcancelstate.3:151
7621 msgid ""
7622 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
7623 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
7624 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
7625 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
7626 "because the application has no way of knowing what the state of these "
7627 "resources is when the thread is canceled; that is, did cancellation occur "
7628 "before the resources were reserved, while they were reserved, or after they "
7629 "were released? Furthermore, some internal data structures (e.g., the linked "
7630 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
7631 "left in an inconsistent state if cancellation occurs in the middle of the "
7632 "function call.  Consequently, clean-up handlers cease to be useful."
7633 msgstr "cancelability type を B<PTHREAD_CANCEL_ASYNCHRONOUS> に設定して役に立つことはめったにない。スレッドはI<いつでも>キャンセルすることができることになるので、スレッドが安全にリソースの確保 (例えば B<malloc>(3) でメモリを割り当てる) や mutex、セマフォ、ロックなどの獲得を行うことができない。アプリケーションは、スレッドがキャンセルされる際に、これらのリソースがどのような状態にあるかを知る術はないので、リソースの確保が安全ではなくなる。つまり、キャンセルが起こったのが、リソースの確保前なのか、確保中なのか、確保後なのかが分からない。さらに、関数呼び出しの最中にキャンセルが発生すると、いくつかの内部データ構造 (例えば、B<malloc>(3) 関連の関数が管理している未使用ブロックのリンクリスト) が一貫性のない状態のままになってしまう可能性がある。その結果、クリーンアップハンドラが役に立たないものになってしまう。"
7634
7635 #. type: Plain text
7636 #: build/C/man3/pthread_setcancelstate.3:162
7637 msgid ""
7638 "Functions that can be safely asynchronously canceled are called I<async-"
7639 "cancel-safe functions>.  POSIX.1-2001 requires only that "
7640 "B<pthread_cancel>(3), B<pthread_setcancelstate>(), and "
7641 "B<pthread_setcanceltype>()  be async-cancel-safe.  In general, other library "
7642 "functions can't be safely called from an asynchronously cancelable thread."
7643 msgstr "非同期で安全にキャンセルできる関数は I<async-cancel-safe functions> と呼ばれる。 POSIX.1-2001 で、非同期で安全にキャンセルできるように求められている関数は B<pthread_cancel>(3), B<pthread_setcancelstate>(), B<pthread_setcanceltype>() だけである。 一般的には、それ以外のライブラリ関数は、非同期にキャンセルできるスレッドから安全に呼び出すことはできない。"
7644
7645 #. type: Plain text
7646 #: build/C/man3/pthread_setcancelstate.3:165
7647 msgid ""
7648 "One of the few circumstances in which asynchronous cancelability is useful "
7649 "is for cancellation of a thread that is in a pure compute-bound loop."
7650 msgstr "非同期でのキャンセルが有効な数少ない状況としては、純粋に計算だけを行うループに入っているスレッドをキャンセルするといった場面がある。"
7651
7652 #. type: SS
7653 #: build/C/man3/pthread_setcancelstate.3:165
7654 #, no-wrap
7655 msgid "Portability notes"
7656 msgstr ""
7657
7658 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
7659 #. type: Plain text
7660 #: build/C/man3/pthread_setcancelstate.3:183
7661 msgid ""
7662 "The Linux threading implementations permit the I<oldstate> argument of "
7663 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
7664 "the previous cancelability state is not returned to the caller.  Many other "
7665 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
7666 "does not specify this point, so portable applications should always specify "
7667 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
7668 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
7669 msgstr ""
7670 "Linux のスレッド実装では、 B<pthread_setcancelstate>() の I<oldstate>\n"
7671 "引き数に NULL を指定することを認めている。 NULL が指定された場合、\n"
7672 "変更前の cancelability state の情報が呼び出し側に返されない。\n"
7673 "他の多くの実装でも I<oldstate> 引き数に NULL を指定することを認めて\n"
7674 "いるが、 POSIX.1-2001 ではこの点については規定されていない。\n"
7675 "したがって、移植性が必要なアプリケーションでは常に I<oldstate> に\n"
7676 "NULL 以外の値を指定するようにすべきである。\n"
7677 "B<pthread_setcanceltype>() の I<oldtype> 引き数についても、\n"
7678 "全く同じことが言える。"
7679
7680 #. type: Plain text
7681 #: build/C/man3/pthread_setcancelstate.3:186
7682 msgid "See B<pthread_cancel>(3)."
7683 msgstr "B<pthread_cancel>(3) を参照。"
7684
7685 #. type: Plain text
7686 #: build/C/man3/pthread_setcancelstate.3:191
7687 msgid ""
7688 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7689 "B<pthreads>(7)"
7690 msgstr ""
7691 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7692 "B<pthreads>(7)"
7693
7694 #. type: TH
7695 #: build/C/man3/pthread_setconcurrency.3:25
7696 #, no-wrap
7697 msgid "PTHREAD_SETCONCURRENCY"
7698 msgstr "PTHREAD_SETCONCURRENCY"
7699
7700 #. type: TH
7701 #: build/C/man3/pthread_setconcurrency.3:25
7702 #, no-wrap
7703 msgid "2009-04-10"
7704 msgstr "2009-04-10"
7705
7706 #. type: Plain text
7707 #: build/C/man3/pthread_setconcurrency.3:29
7708 msgid ""
7709 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
7710 "level"
7711 msgstr ""
7712 "pthread_setconcurrency, pthread_getconcurrency - 並列処理レベルの設定/取得を"
7713 "行う"
7714
7715 #. type: Plain text
7716 #: build/C/man3/pthread_setconcurrency.3:35
7717 #, no-wrap
7718 msgid ""
7719 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7720 "B<int pthread_getconcurrency(void);>\n"
7721 msgstr ""
7722 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7723 "B<int pthread_getconcurrency(void);>\n"
7724
7725 #. type: Plain text
7726 #: build/C/man3/pthread_setconcurrency.3:48
7727 msgid ""
7728 "The B<pthread_setconcurrency>()  function informs the implementation of the "
7729 "application's desired concurrency level, specified in I<new_level>.  The "
7730 "implementation takes this only as a hint: POSIX.1 does not specify the level "
7731 "of concurrency that should be provided as a result of calling "
7732 "B<pthread_setconcurrency>()."
7733 msgstr ""
7734 "B<pthread_setconcurrency>() 関数は、アプリケーションが希望する\n"
7735 "並列処理レベル (concurrency level) をスレッド実装に通知する。\n"
7736 "希望する並列処理レベルは I<new_level> で指定する。\n"
7737 "スレッド実装はこの情報をヒントとしてのみ利用する。\n"
7738 "POSIX.1 では、 B<pthread_setconcurrency>() の呼び出した結果、\n"
7739 "どのような並列度になるべきかは規定されていない。"
7740
7741 #. type: Plain text
7742 #: build/C/man3/pthread_setconcurrency.3:53
7743 msgid ""
7744 "Specifying I<new_level> as 0 instructs the implementation to manage the "
7745 "concurrency level as it deems appropriate."
7746 msgstr ""
7747 "I<new_level> に 0 を指定すると、スレッド実装は並列処理レベルを\n"
7748 "実装側で適切とみなしたレベルに設定するようになる。"
7749
7750 #. type: Plain text
7751 #: build/C/man3/pthread_setconcurrency.3:56
7752 msgid ""
7753 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
7754 "level for this process."
7755 msgstr ""
7756 "B<pthread_getconcurrency>() は、このプロセスの concurrency level\n"
7757 "の現在値を返す。"
7758
7759 #. type: Plain text
7760 #: build/C/man3/pthread_setconcurrency.3:61
7761 msgid ""
7762 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
7763 "nonzero error number."
7764 msgstr ""
7765 "成功すると、 B<pthread_setconcurrency>() は 0 を返す。\n"
7766 "エラーの場合、 0 以外のエラー番号を返す。"
7767
7768 #. type: Plain text
7769 #: build/C/man3/pthread_setconcurrency.3:68
7770 msgid ""
7771 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
7772 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
7773 "B<pthread_setconcurrency>()  has not previously been called."
7774 msgstr ""
7775 "B<pthread_getconcurrency>() は常に成功し、最後の\n"
7776 "B<pthread_getconcurrency>() の呼び出しで設定された \n"
7777 "concurrency level を返す。 B<pthread_getconcurrency>() が\n"
7778 "それまでに一度も呼び出されていない場合は 0 が返る。"
7779
7780 #. type: Plain text
7781 #: build/C/man3/pthread_setconcurrency.3:71
7782 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
7783 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
7784
7785 #. type: Plain text
7786 #: build/C/man3/pthread_setconcurrency.3:75
7787 msgid "I<new_level> is negative."
7788 msgstr "I<new_level> が負である。"
7789
7790 #. type: Plain text
7791 #: build/C/man3/pthread_setconcurrency.3:81
7792 msgid ""
7793 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
7794 "I<new_level> would cause a system resource to be exceeded\")."
7795 msgstr ""
7796 "POSIX.1-2001 には、エラー B<EAGAIN> も記載されている\n"
7797 "(「I<new_level> に指定された値を適用すると、システムリソースが\n"
7798 "超過してしまう」)。"
7799
7800 #. type: Plain text
7801 #: build/C/man3/pthread_setconcurrency.3:83
7802 msgid "These functions are available in glibc since version 2.1."
7803 msgstr "これらの関数は glibc バージョン 2.1 以降で利用できる。"
7804
7805 #. type: Plain text
7806 #: build/C/man3/pthread_setconcurrency.3:87
7807 msgid "The default concurrency level is 0."
7808 msgstr "デフォルトの concurrency level は 0 である。"
7809
7810 #. type: Plain text
7811 #: build/C/man3/pthread_setconcurrency.3:94
7812 msgid ""
7813 "Concurrency levels are meaningful only for M:N threading implementations, "
7814 "where at any moment a subset of a process's set of user-level threads may be "
7815 "bound to a smaller number of kernel-scheduling entities.  Setting the "
7816 "concurrency level allows the application to give the system a hint as to the "
7817 "number of kernel-scheduling entities that should be provided for efficient "
7818 "execution of the application."
7819 msgstr ""
7820 "並列処理レベルが意味を持つのは M:N スレッド実装の場合のみである。\n"
7821 "M:N スレッド実装では、ある瞬間において、あるプロセスのユーザレベルスレッ\n"
7822 "ドの集合のサブ集合が、そのサブ集合のサイズよりも少ない数のカーネルの\n"
7823 "スケジューリング実体 (kernel-scheduling entity) に結び付けられる。\n"
7824 "並列処理レベルを設定すると、そのアプリケーションの効率的な実行に必要な\n"
7825 "カーネルのスケジューリング実体の数のヒントを、アプリケーションはシステ\n"
7826 "ムに伝えることができる。"
7827
7828 #. type: Plain text
7829 #: build/C/man3/pthread_setconcurrency.3:100
7830 msgid ""
7831 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
7832 "concurrency level has no meaning.  In other words, on Linux these functions "
7833 "merely exist for compatibility with other systems, and they have no effect "
7834 "on the execution of a program."
7835 msgstr ""
7836 "LinuxThreads と NPTL のどちらも 1:1 スレッド実装であり、\n"
7837 "並列処理レベルを設定しても何の意味もない。\n"
7838 "言い換えると、 Linux では、これらの関数は、\n"
7839 "他のシステムとの互換性のためだけに存在し、\n"
7840 "プログラムの実行には何の影響も与えないということである。"
7841
7842 #. type: Plain text
7843 #: build/C/man3/pthread_setconcurrency.3:103
7844 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
7845 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
7846
7847 #. type: TH
7848 #: build/C/man3/pthread_setname_np.3:26
7849 #, no-wrap
7850 msgid "PTHREAD_SETNAME_NP"
7851 msgstr "PTHREAD_SETNAME_NP"
7852
7853 #. type: TH
7854 #: build/C/man3/pthread_setname_np.3:26
7855 #, no-wrap
7856 msgid "2013-06-21"
7857 msgstr "2013-06-21"
7858
7859 #. type: Plain text
7860 #: build/C/man3/pthread_setname_np.3:29
7861 msgid "pthread_setname_np, pthread_getname_np - set/get the name of a thread"
7862 msgstr "pthread_setname_np, pthread_getname_np - スレッド名の設定/取得を行う"
7863
7864 #. type: Plain text
7865 #: build/C/man3/pthread_setname_np.3:36
7866 #, no-wrap
7867 msgid ""
7868 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
7869 "B<#include E<lt>pthread.hE<gt>>\n"
7870 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
7871 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
7872 "B<                       const char *>I<name>B<, size_t >I<len>B<);>\n"
7873 msgstr ""
7874 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
7875 "B<#include E<lt>pthread.hE<gt>>\n"
7876 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
7877 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
7878 "B<                       const char *>I<name>B<, size_t >I<len>B<);>\n"
7879
7880 #. type: Plain text
7881 #: build/C/man3/pthread_setname_np.3:55
7882 msgid ""
7883 "By default, all the threads created using B<pthread_create>()  inherit the "
7884 "program name.  The B<pthread_setname_np>()  function can be used to set a "
7885 "unique name for a thread, which can be useful for debugging multithreaded "
7886 "applications.  The thread name is a meaningful C language string, whose "
7887 "length is restricted to 16 characters, including the terminating null byte "
7888 "(\\(aq\\e0\\(aq).  The I<thread> argument specifies the thread whose name is "
7889 "to be changed; I<name> specifies the new name."
7890 msgstr ""
7891 "デフォルトでは、 B<pthread_create>() で作成されたすべてのスレッドはプログラム"
7892 "名を継承する。 B<pthread_setname_np>() 関数を使うとスレッドに固有の名前を設定"
7893 "することができる。 スレッド固有の名前はマルチスレッド・アプリケーションのデ"
7894 "バッグに便利である。 スレッド名は意味のある C 言語の文字列である。 その長さ"
7895 "は 16 文字に限定されており、 終端のヌルバイト (\\(aq\\e0\\(aq) も 16 文字に含"
7896 "まれる。 I<thread> 引き数で名前を変更するスレッドを指定する。 I<name> には新"
7897 "しい名前を指定する。"
7898
7899 #. type: Plain text
7900 #: build/C/man3/pthread_setname_np.3:72
7901 msgid ""
7902 "The B<pthread_getname_np>()  function can be used to retrieve the name of "
7903 "the thread.  The I<thread> argument specifies the thread whose name is to be "
7904 "retrieved.  The buffer I<name> is used to return the thread name; I<len> "
7905 "specifies the number of bytes available in I<name>.  The buffer specified by "
7906 "I<name> should be at least 16 characters in length.  The returned thread "
7907 "name in the output buffer will be null terminated."
7908 msgstr ""
7909 "B<pthread_getname_np>() 関数を使うと、 スレッド名を取得することができる。 "
7910 "I<thread> 引き数は名前を取得するスレッドを指定する。 バッファ I<name> はス"
7911 "レッド名を返すのに使用される。 I<len> には I<name> の大きさをバイトで指定す"
7912 "る。 I<name> で指定されたバッファの大きさは最低でも 16 文字とすべきである。 "
7913 "出力バッファに返されたスレッド名はヌル終端される。"
7914
7915 #. type: Plain text
7916 #: build/C/man3/pthread_setname_np.3:79
7917 msgid ""
7918 "The B<pthread_setname_np>()  function can fail with the following error:"
7919 msgstr "B<pthread_setname_np>() は以下のエラーで失敗する場合がある。"
7920
7921 #. type: TP
7922 #: build/C/man3/pthread_setname_np.3:79 build/C/man3/pthread_setname_np.3:88
7923 #, no-wrap
7924 msgid "B<ERANGE>"
7925 msgstr "B<ERANGE>"
7926
7927 #. type: Plain text
7928 #: build/C/man3/pthread_setname_np.3:84
7929 msgid ""
7930 "The length of the string specified pointed to by I<name> exceeds the allowed "
7931 "limit."
7932 msgstr "I<name> で指定された文字列の長さが、許可されている上限を超えている。"
7933
7934 #. type: Plain text
7935 #: build/C/man3/pthread_setname_np.3:88
7936 msgid ""
7937 "The B<pthread_getname_np>()  function can fail with the following error:"
7938 msgstr "B<pthread_getname_np>() は以下のエラーで失敗する場合がある。"
7939
7940 #. type: Plain text
7941 #: build/C/man3/pthread_setname_np.3:95
7942 msgid ""
7943 "The buffer specified by I<name> and I<len> is too small to hold the thread "
7944 "name."
7945 msgstr ""
7946 "I<name> と I<len> で指定されたバッファが、 スレッド名を格納するには短かすぎ"
7947 "る。"
7948
7949 #. type: Plain text
7950 #: build/C/man3/pthread_setname_np.3:100
7951 msgid ""
7952 "If either of these functions fails to open I</proc/self/task/[tid]/comm>, "
7953 "then the call may fail with one of the errors described in B<open>(2)."
7954 msgstr ""
7955 "I</proc/self/task/[tid]/comm> のオープンに失敗した場合、 これらの関数は "
7956 "B<open>(2) で説明されているエラーのいずれかで失敗する。"
7957
7958 #. type: Plain text
7959 #: build/C/man3/pthread_setname_np.3:102
7960 msgid "These functions first appeared in glibc in version 2.12."
7961 msgstr "これらの関数は glibc バージョン 2.12 で初めて登場した。"
7962
7963 #. type: Plain text
7964 #: build/C/man3/pthread_setname_np.3:104
7965 msgid "These functions are nonstandard GNU extensions."
7966 msgstr "これらの関数は非標準の GNU による拡張である。"
7967
7968 #. type: Plain text
7969 #: build/C/man3/pthread_setname_np.3:114
7970 msgid ""
7971 "B<pthread_setname_np>()  internally writes to the thread-specific I<comm> "
7972 "file under the I</proc> filesystem: I</proc/self/task/[tid]/comm>.  "
7973 "B<pthread_getname_np>()  retrieves it from the same location."
7974 msgstr ""
7975 "B<pthread_setname_np>() は内部で I</proc> ファイルシステムのスレッド固有の "
7976 "I<comm> ファイル (I</proc/self/task/[tid]/comm>) に書き込みを行う。 "
7977 "B<pthread_getname_np>() はこのファイルから読み出しを行う。"
7978
7979 #. type: Plain text
7980 #: build/C/man3/pthread_setname_np.3:120
7981 msgid ""
7982 "The program below demonstrates the use of B<pthread_setname_np>()  and "
7983 "B<pthread_getname_np>()."
7984 msgstr ""
7985 "以下のプログラムは、 B<pthread_setname_np>() と B<pthread_getname_np>()\n"
7986 "の使用例を示している。"
7987
7988 #. type: Plain text
7989 #: build/C/man3/pthread_setname_np.3:122
7990 msgid "The following shell session shows a sample run of the program:"
7991 msgstr "以下のシェルセッションは、このプログラムの実行例である。"
7992
7993 #. type: Plain text
7994 #: build/C/man3/pthread_setname_np.3:138
7995 #, no-wrap
7996 msgid ""
7997 "$B< ./a.out>\n"
7998 "Created a thread. Default name is: a.out\n"
7999 "The thread name after setting it is THREADFOO.\n"
8000 "B<^Z>                           # Suspend the program\n"
8001 "[1]+  Stopped           ./a.out\n"
8002 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
8003 "  PID   TID CMD                         COMMAND\n"
8004 " 5990  5990 ./a.out                     a.out\n"
8005 " 5990  5991 ./a.out                     THREADFOO\n"
8006 "$ B<cat /proc/5990/task/5990/comm>\n"
8007 "a.out\n"
8008 "$ B<cat /proc/5990/task/5991/comm>\n"
8009 "THREADFOO\n"
8010 msgstr ""
8011 "$B< ./a.out>\n"
8012 "Created a thread. Default name is: a.out\n"
8013 "The thread name after setting it is THREADFOO.\n"
8014 "B<^Z>                           # Suspend the program\n"
8015 "[1]+  Stopped           ./a.out\n"
8016 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
8017 "  PID   TID CMD                         COMMAND\n"
8018 " 5990  5990 ./a.out                     a.out\n"
8019 " 5990  5991 ./a.out                     THREADFOO\n"
8020 "$ B<cat /proc/5990/task/5990/comm>\n"
8021 "a.out\n"
8022 "$ B<cat /proc/5990/task/5991/comm>\n"
8023 "THREADFOO\n"
8024
8025 #. type: Plain text
8026 #: build/C/man3/pthread_setname_np.3:150
8027 #, no-wrap
8028 msgid ""
8029 "#define _GNU_SOURCE\n"
8030 "#include E<lt>pthread.hE<gt>\n"
8031 "#include E<lt>stdio.hE<gt>\n"
8032 "#include E<lt>string.hE<gt>\n"
8033 "#include E<lt>unistd.hE<gt>\n"
8034 "#include E<lt>errno.hE<gt>\n"
8035 "#include E<lt>stdlib.hE<gt>\n"
8036 msgstr ""
8037 "#define _GNU_SOURCE\n"
8038 "#include E<lt>pthread.hE<gt>\n"
8039 "#include E<lt>stdio.hE<gt>\n"
8040 "#include E<lt>string.hE<gt>\n"
8041 "#include E<lt>unistd.hE<gt>\n"
8042 "#include E<lt>errno.hE<gt>\n"
8043 "#include E<lt>stdlib.hE<gt>\n"
8044
8045 #. type: Plain text
8046 #: build/C/man3/pthread_setname_np.3:152
8047 #, no-wrap
8048 msgid "#define NAMELEN 16\n"
8049 msgstr "#define NAMELEN 16\n"
8050
8051 #. type: Plain text
8052 #: build/C/man3/pthread_setname_np.3:156
8053 #, no-wrap
8054 msgid ""
8055 "#define errExitEN(en, msg) \\e\n"
8056 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
8057 "        } while (0)\n"
8058 msgstr ""
8059 "#define errExitEN(en, msg) \\e\n"
8060 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
8061 "        } while (0)\n"
8062
8063 #. type: Plain text
8064 #: build/C/man3/pthread_setname_np.3:163
8065 #, no-wrap
8066 msgid ""
8067 "static void *\n"
8068 "threadfunc(void *parm)\n"
8069 "{\n"
8070 "    sleep(5);          // allow main program to set the thread name\n"
8071 "    return NULL;\n"
8072 "}\n"
8073 msgstr ""
8074 "static void *\n"
8075 "threadfunc(void *parm)\n"
8076 "{\n"
8077 "    sleep(5);          // allow main program to set the thread name\n"
8078 "    return NULL;\n"
8079 "}\n"
8080
8081 #. type: Plain text
8082 #: build/C/man3/pthread_setname_np.3:170
8083 #, no-wrap
8084 msgid ""
8085 "int\n"
8086 "main(int argc, char **argv)\n"
8087 "{\n"
8088 "    pthread_t thread;\n"
8089 "    int rc;\n"
8090 "    char thread_name[NAMELEN];\n"
8091 msgstr ""
8092 "int\n"
8093 "main(int argc, char **argv)\n"
8094 "{\n"
8095 "    pthread_t thread;\n"
8096 "    int rc;\n"
8097 "    char thread_name[NAMELEN];\n"
8098
8099 #. type: Plain text
8100 #: build/C/man3/pthread_setname_np.3:174
8101 #, no-wrap
8102 msgid ""
8103 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8104 "    if (rc != 0)\n"
8105 "        errExitEN(rc, \"pthread_create\");\n"
8106 msgstr ""
8107 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8108 "    if (rc != 0)\n"
8109 "        errExitEN(rc, \"pthread_create\");\n"
8110
8111 #. type: Plain text
8112 #: build/C/man3/pthread_setname_np.3:178
8113 #, no-wrap
8114 msgid ""
8115 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8116 "    if (rc != 0)\n"
8117 "        errExitEN(rc, \"pthread_getname_np\");\n"
8118 msgstr ""
8119 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8120 "    if (rc != 0)\n"
8121 "        errExitEN(rc, \"pthread_getname_np\");\n"
8122
8123 #. type: Plain text
8124 #: build/C/man3/pthread_setname_np.3:183
8125 #, no-wrap
8126 msgid ""
8127 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8128 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8129 "    if (rc != 0)\n"
8130 "        errExitEN(rc, \"pthread_setname_np\");\n"
8131 msgstr ""
8132 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8133 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8134 "    if (rc != 0)\n"
8135 "        errExitEN(rc, \"pthread_setname_np\");\n"
8136
8137 #. type: Plain text
8138 #: build/C/man3/pthread_setname_np.3:185
8139 #, no-wrap
8140 msgid "    sleep(2);\n"
8141 msgstr "    sleep(2);\n"
8142
8143 #. type: Plain text
8144 #: build/C/man3/pthread_setname_np.3:191
8145 #, no-wrap
8146 msgid ""
8147 "    rc = pthread_getname_np(thread, thread_name,\n"
8148 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8149 "    if (rc != 0)\n"
8150 "        errExitEN(rc, \"pthread_getname_np\");\n"
8151 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8152 msgstr ""
8153 "    rc = pthread_getname_np(thread, thread_name,\n"
8154 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8155 "    if (rc != 0)\n"
8156 "        errExitEN(rc, \"pthread_getname_np\");\n"
8157 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8158
8159 #. type: Plain text
8160 #: build/C/man3/pthread_setname_np.3:195
8161 #, no-wrap
8162 msgid ""
8163 "    rc = pthread_join(thread, NULL);\n"
8164 "    if (rc != 0)\n"
8165 "        errExitEN(rc, \"pthread_join\");\n"
8166 msgstr ""
8167 "    rc = pthread_join(thread, NULL);\n"
8168 "    if (rc != 0)\n"
8169 "        errExitEN(rc, \"pthread_join\");\n"
8170
8171 #. type: Plain text
8172 #: build/C/man3/pthread_setname_np.3:199
8173 #, no-wrap
8174 msgid ""
8175 "    printf(\"Done\\en\");\n"
8176 "    exit(EXIT_SUCCESS);\n"
8177 "}\n"
8178 msgstr ""
8179 "    printf(\"Done\\en\");\n"
8180 "    exit(EXIT_SUCCESS);\n"
8181 "}\n"
8182
8183 #. type: Plain text
8184 #: build/C/man3/pthread_setname_np.3:206
8185 msgid "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8186 msgstr "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8187
8188 #. type: TH
8189 #: build/C/man3/pthread_setschedparam.3:26
8190 #, no-wrap
8191 msgid "PTHREAD_SETSCHEDPARAM"
8192 msgstr "PTHREAD_SETSCHEDPARAM"
8193
8194 #. type: TH
8195 #: build/C/man3/pthread_setschedparam.3:26
8196 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigmask.3:26
8197 #: build/C/man3/pthread_sigqueue.3:25 build/C/man3/pthread_testcancel.3:26
8198 #, no-wrap
8199 msgid "2014-05-19"
8200 msgstr "2014-05-19"
8201
8202 #. type: Plain text
8203 #: build/C/man3/pthread_setschedparam.3:30
8204 msgid ""
8205 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
8206 "parameters of a thread"
8207 msgstr ""
8208 "pthread_setschedparam, pthread_getschedparam - スレッドの\n"
8209 "スケジューリングポリシーとパラメータを設定/取得する"
8210
8211 #. type: Plain text
8212 #: build/C/man3/pthread_setschedparam.3:38
8213 #, no-wrap
8214 msgid ""
8215 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8216 "B<                      const struct sched_param *>I<param>B<);>\n"
8217 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8218 "B<                      struct sched_param *>I<param>B<);>\n"
8219 msgstr ""
8220 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8221 "B<                      const struct sched_param *>I<param>B<);>\n"
8222 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8223 "B<                      struct sched_param *>I<param>B<);>\n"
8224
8225 #. type: Plain text
8226 #: build/C/man3/pthread_setschedparam.3:46
8227 msgid ""
8228 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
8229 "parameters of the thread I<thread>."
8230 msgstr ""
8231 "B<pthread_setschedparam>() 関数は、スレッド I<thread> の\n"
8232 "スケジューリングポリシーとスケジューリングパラメータを設定する。"
8233
8234 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
8235 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
8236 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
8237 #. type: Plain text
8238 #: build/C/man3/pthread_setschedparam.3:57
8239 msgid ""
8240 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
8241 "values for I<policy>, and their semantics, are described in B<sched>(7)."
8242 msgstr "I<policy> は I<thread> の新しいスケジューリングポリシーを指定する。 I<policy> に指定できる値とその意味は B<sched>(7) で説明されている。"
8243
8244 #. type: Plain text
8245 #: build/C/man3/pthread_setschedparam.3:63
8246 msgid ""
8247 "The structure pointed to by I<param> specifies the new scheduling parameters "
8248 "for I<thread>.  Scheduling parameters are maintained in the following "
8249 "structure:"
8250 msgstr ""
8251 "I<param> が指す構造体は I<thread> の新しいスケジューリングパラメータを\n"
8252 "指定する。スケジューリングパラメータは以下の構造体で管理される。"
8253
8254 #.  FIXME . nptl/pthread_setschedparam.c has the following
8255 #.    /* If the thread should have higher priority because of some
8256 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
8257 #.  Eventually (perhaps after writing the mutexattr pages), we
8258 #.  may want to add something on the topic to this page.
8259 #. type: Plain text
8260 #: build/C/man3/pthread_setschedparam.3:104
8261 msgid ""
8262 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
8263 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
8264 "and I<param>, respectively.  The returned priority value is that set by the "
8265 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
8266 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
8267 "does not reflect any temporary priority adjustments as a result of calls to "
8268 "any priority inheritance or priority ceiling functions (see, for example, "
8269 "B<pthread_mutexattr_setprioceiling>(3)  and "
8270 "B<pthread_mutexattr_setprotocol>(3))."
8271 msgstr ""
8272 "B<pthread_getschedparam>() 関数は、スレッド I<thread> の\n"
8273 "スケジューリングポリシーとパラメータを、\n"
8274 "それぞれ I<policy> と I<param> が指すバッファに入れて返す。\n"
8275 "返された優先度の値は、最も最近実行した I<thread> に影響を与える\n"
8276 "B<pthread_setschedparam>(), B<pthread_setschedprio>,\n"
8277 "B<pthread_create> で設定された値となる。\n"
8278 "返された優先度は、優先度の継承や優先度の上限を設定する関数\n"
8279 "(例えば B<pthread_mutexattr_setprioceiling>(3) や\n"
8280 "B<pthread_mutexattr_setprotocol>(3) を参照) の呼び出しの結果\n"
8281 "行われる一時的な優先度の調整の影響を受けない。"
8282
8283 #. type: Plain text
8284 #: build/C/man3/pthread_setschedparam.3:112
8285 msgid ""
8286 "On success, these functions return 0; on error, they return a nonzero error "
8287 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
8288 "parameters of I<thread> are not changed."
8289 msgstr ""
8290 "成功すると、これらの関数は 0 を返す。\n"
8291 "エラーの場合、0 以外のエラー番号を返す。\n"
8292 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
8293 "スケジューリングポリシーとパラメータは変更されない。"
8294
8295 #. type: Plain text
8296 #: build/C/man3/pthread_setschedparam.3:114
8297 msgid "Both of these functions can fail with the following error:"
8298 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
8299
8300 #. type: Plain text
8301 #: build/C/man3/pthread_setschedparam.3:122
8302 msgid ""
8303 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
8304 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
8305
8306 #. type: Plain text
8307 #: build/C/man3/pthread_setschedparam.3:129
8308 msgid ""
8309 "I<policy> is not a recognized policy, or I<param> does not make sense for "
8310 "the I<policy>."
8311 msgstr ""
8312 "I<policy> が認識できないポリシーであるか、\n"
8313 "I<param> が I<policy> では意味を持たない値である。"
8314
8315 #. type: Plain text
8316 #: build/C/man3/pthread_setschedparam.3:133
8317 msgid ""
8318 "The caller does not have appropriate privileges to set the specified "
8319 "scheduling policy and parameters."
8320 msgstr ""
8321 "呼び出し側が、指定されたスケジューリングポリシーやパラメータを設定する\n"
8322 "のに必要な特権を持たない。"
8323
8324 #.  .SH VERSIONS
8325 #.  Available since glibc 2.0
8326 #. type: Plain text
8327 #: build/C/man3/pthread_setschedparam.3:141
8328 msgid ""
8329 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
8330 "policy or scheduling parameters to an unsupported value\") error for "
8331 "B<pthread_setschedparam>()."
8332 msgstr ""
8333 "POSIX.1-2001 では、 B<pthread_setschedparam>() に関して\n"
8334 "エラー B<ENOTSUP> (\"サポートされていない値をスケジューリングポリシーや\n"
8335 "パラメータに設定しようとした\") も追加で規定されている。"
8336
8337 #. type: Plain text
8338 #: build/C/man3/pthread_setschedparam.3:148
8339 msgid ""
8340 "The B<pthread_setschedparam>()  and B<pthread_getschedparam>()  functions "
8341 "are thread-safe."
8342 msgstr "関数 B<pthread_setschedparam>() と B<pthread_getschedparam>() はスレッドセーフである。"
8343
8344 #. type: Plain text
8345 #: build/C/man3/pthread_setschedparam.3:156
8346 msgid ""
8347 "For a description of the permissions required to, and the effect of, "
8348 "changing a thread's scheduling policy and priority, and details of the "
8349 "permitted ranges for priorities in each scheduling policy, see B<sched>(7)."
8350 msgstr "スレッドのスケジューリングポリシーや優先度を変更するために必要な許可や変更した場合の影響、および各スケジューリングポリシーで認められる優先度の範囲の詳細については、 B<sched>(7) を参照。"
8351
8352 #. type: Plain text
8353 #: build/C/man3/pthread_setschedparam.3:163
8354 msgid ""
8355 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
8356 "B<pthread_getschedparam>(), as well as the use of a number of other "
8357 "scheduling-related pthreads functions."
8358 msgstr ""
8359 "以下のプログラムは B<pthread_setschedparam>() と\n"
8360 "B<pthread_getschedparam>() やスケジューリングに関連する pthreads の\n"
8361 "他のいろいろな関数の使用例を示すものである。"
8362
8363 #. type: Plain text
8364 #: build/C/man3/pthread_setschedparam.3:179
8365 msgid ""
8366 "In the following run, the main thread sets its scheduling policy to "
8367 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
8368 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
8369 "priority attribute of 20.  The program then sets (using "
8370 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
8371 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
8372 "created using this attributes object should take their scheduling attributes "
8373 "from the thread attributes object.  The program then creates a thread using "
8374 "the thread attributes object, and that thread displays its scheduling policy "
8375 "and priority."
8376 msgstr ""
8377 "以下の実行例では、メインスレッドは、自分のスケジューリングポリシーを\n"
8378 "優先度 10 の B<SCHED_FIFO> を設定し、スレッド属性オブジェクトを\n"
8379 "スケジューリングポリシー属性 B<SCHED_RR> とスケジューリング優先度\n"
8380 "属性 20 で初期化する。\n"
8381 "次に、このプログラムは (B<pthread_attr_setinheritsched>(3) を使って) \n"
8382 "そのスレッド属性オブジェクトの inherit scheduler 属性に\n"
8383 "B<PTHREAD_EXPLICIT_SCHED> を設定する。B<PTHREAD_EXPLICIT_SCHED> は、\n"
8384 "そのスレッド属性オブジェクトを使って作成されたスレッドはスレッド属性\n"
8385 "オブジェクトからスケジューリング属性を取得して使うことを意味する。\n"
8386 "それから、このスレッド属性オブジェクトを使ってスレッドを作成し、\n"
8387 "作成したスレッドのスケジューリングポリシーと優先度を表示する。"
8388
8389 #. type: Plain text
8390 #: build/C/man3/pthread_setschedparam.3:187
8391 #, no-wrap
8392 msgid ""
8393 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
8394 "Password:\n"
8395 "# B<./a.out -mf10 -ar20 -i e>\n"
8396 "Scheduler settings of main thread\n"
8397 "    policy=SCHED_FIFO, priority=10\n"
8398 msgstr ""
8399 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
8400 "Password:\n"
8401 "# B<./a.out -mf10 -ar20 -i e>\n"
8402 "Scheduler settings of main thread\n"
8403 "    policy=SCHED_FIFO, priority=10\n"
8404
8405 #. type: Plain text
8406 #: build/C/man3/pthread_setschedparam.3:191
8407 #, no-wrap
8408 msgid ""
8409 "Scheduler settings in \\(aqattr\\(aq\n"
8410 "    policy=SCHED_RR, priority=20\n"
8411 "    inheritsched is EXPLICIT\n"
8412 msgstr ""
8413 "Scheduler settings in \\(aqattr\\(aq\n"
8414 "    policy=SCHED_RR, priority=20\n"
8415 "    inheritsched is EXPLICIT\n"
8416
8417 #. type: Plain text
8418 #: build/C/man3/pthread_setschedparam.3:194
8419 #, no-wrap
8420 msgid ""
8421 "Scheduler attributes of new thread\n"
8422 "    policy=SCHED_RR, priority=20\n"
8423 msgstr ""
8424 "Scheduler attributes of new thread\n"
8425 "    policy=SCHED_RR, priority=20\n"
8426
8427 #. type: Plain text
8428 #: build/C/man3/pthread_setschedparam.3:199
8429 msgid ""
8430 "In the above output, one can see that the scheduling policy and priority "
8431 "were taken from the values specified in the thread attributes object."
8432 msgstr ""
8433 "上記の出力では、スケジューリングポリシーと優先度がスレッド属性\n"
8434 "オブジェクトで指定された値から取られていることが分かる。"
8435
8436 #. type: Plain text
8437 #: build/C/man3/pthread_setschedparam.3:206
8438 msgid ""
8439 "The next run is the same as the previous, except that the inherit scheduler "
8440 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
8441 "using the thread attributes object should ignore the scheduling attributes "
8442 "specified in the attributes object and instead take their scheduling "
8443 "attributes from the creating thread."
8444 msgstr ""
8445 "次の実行例は前のものと同じだが、 inherit scheduler 属性が \n"
8446 "B<PTHREAD_INHERIT_SCHED> に設定される点が異なる。\n"
8447 "B<PTHREAD_INHERIT_SCHED> は、そのスレッド属性オブジェクトを使って作成\n"
8448 "されたスレッドは、スレッド属性オブジェクトからスケジューリング属性を\n"
8449 "無視し、代わりに呼び出したスレッドからスケジューリング属性を取得する\n"
8450 "ことを意味する。"
8451
8452 #. type: Plain text
8453 #: build/C/man3/pthread_setschedparam.3:212
8454 #, no-wrap
8455 msgid ""
8456 "# B<./a.out -mf10 -ar20 -i i>\n"
8457 "Scheduler settings of main thread\n"
8458 "    policy=SCHED_FIFO, priority=10\n"
8459 msgstr ""
8460 "# B<./a.out -mf10 -ar20 -i i>\n"
8461 "Scheduler settings of main thread\n"
8462 "    policy=SCHED_FIFO, priority=10\n"
8463
8464 #. type: Plain text
8465 #: build/C/man3/pthread_setschedparam.3:216
8466 #, no-wrap
8467 msgid ""
8468 "Scheduler settings in \\(aqattr\\(aq\n"
8469 "    policy=SCHED_RR, priority=20\n"
8470 "    inheritsched is INHERIT\n"
8471 msgstr ""
8472 "Scheduler settings in \\(aqattr\\(aq\n"
8473 "    policy=SCHED_RR, priority=20\n"
8474 "    inheritsched is INHERIT\n"
8475
8476 #. type: Plain text
8477 #: build/C/man3/pthread_setschedparam.3:219
8478 #, no-wrap
8479 msgid ""
8480 "Scheduler attributes of new thread\n"
8481 "    policy=SCHED_FIFO, priority=10\n"
8482 msgstr ""
8483 "Scheduler attributes of new thread\n"
8484 "    policy=SCHED_FIFO, priority=10\n"
8485
8486 #. type: Plain text
8487 #: build/C/man3/pthread_setschedparam.3:225
8488 msgid ""
8489 "In the above output, one can see that the scheduling policy and priority "
8490 "were taken from the creating thread, rather than the thread attributes "
8491 "object."
8492 msgstr ""
8493 "上記の出力では、スケジューリングポリシーと優先度が、\n"
8494 "スレッド属性オブジェクトからではなく、\n"
8495 "スレッドを作成したスレッドから取れれていることが分かる。"
8496
8497 #. type: Plain text
8498 #: build/C/man3/pthread_setschedparam.3:231
8499 msgid ""
8500 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
8501 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
8502 "scheduler attribute."
8503 msgstr ""
8504 "なお、 I<-i\\ i> を省略した場合でも、\n"
8505 "B<PTHREAD_INHERIT_SCHED> が inherit scheduler 属性のデフォルト値なので、\n"
8506 "出力は同じになる。"
8507
8508 #. type: Plain text
8509 #: build/C/man3/pthread_setschedparam.3:235
8510 #, no-wrap
8511 msgid "/* pthreads_sched_test.c */\n"
8512 msgstr "/* pthreads_sched_test.c */\n"
8513
8514 #. type: Plain text
8515 #: build/C/man3/pthread_setschedparam.3:241
8516 #, no-wrap
8517 msgid ""
8518 "#include E<lt>pthread.hE<gt>\n"
8519 "#include E<lt>stdio.hE<gt>\n"
8520 "#include E<lt>stdlib.hE<gt>\n"
8521 "#include E<lt>unistd.hE<gt>\n"
8522 "#include E<lt>errno.hE<gt>\n"
8523 msgstr ""
8524 "#include E<lt>pthread.hE<gt>\n"
8525 "#include E<lt>stdio.hE<gt>\n"
8526 "#include E<lt>stdlib.hE<gt>\n"
8527 "#include E<lt>unistd.hE<gt>\n"
8528 "#include E<lt>errno.hE<gt>\n"
8529
8530 #. type: Plain text
8531 #: build/C/man3/pthread_setschedparam.3:250
8532 #, no-wrap
8533 msgid ""
8534 "static void\n"
8535 "usage(char *prog_name, char *msg)\n"
8536 "{\n"
8537 "    if (msg != NULL)\n"
8538 "        fputs(msg, stderr);\n"
8539 msgstr ""
8540 "static void\n"
8541 "usage(char *prog_name, char *msg)\n"
8542 "{\n"
8543 "    if (msg != NULL)\n"
8544 "        fputs(msg, stderr);\n"
8545
8546 #. type: Plain text
8547 #: build/C/man3/pthread_setschedparam.3:267
8548 #, no-wrap
8549 msgid ""
8550 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
8551 "    fprintf(stderr, \"Options are:\\en\");\n"
8552 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
8553 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
8554 "    fpe(\"                 thread attributes object\\en\");\n"
8555 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8556 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8557 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8558 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8559 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8560 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
8561 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8562 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8563 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8564 "    exit(EXIT_FAILURE);\n"
8565 "}\n"
8566 msgstr ""
8567 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
8568 "    fprintf(stderr, \"Options are:\\en\");\n"
8569 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
8570 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
8571 "    fpe(\"                 thread attributes object\\en\");\n"
8572 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8573 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8574 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8575 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8576 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8577 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
8578 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8579 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8580 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8581 "    exit(EXIT_FAILURE);\n"
8582 "}\n"
8583
8584 #. type: Plain text
8585 #: build/C/man3/pthread_setschedparam.3:278
8586 #, no-wrap
8587 msgid ""
8588 "static int\n"
8589 "get_policy(char p, int *policy)\n"
8590 "{\n"
8591 "    switch (p) {\n"
8592 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8593 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8594 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8595 "    default:  return 0;\n"
8596 "    }\n"
8597 "}\n"
8598 msgstr ""
8599 "static int\n"
8600 "get_policy(char p, int *policy)\n"
8601 "{\n"
8602 "    switch (p) {\n"
8603 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8604 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8605 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8606 "    default:  return 0;\n"
8607 "    }\n"
8608 "}\n"
8609
8610 #. type: Plain text
8611 #: build/C/man3/pthread_setschedparam.3:289
8612 #, no-wrap
8613 msgid ""
8614 "static void\n"
8615 "display_sched_attr(int policy, struct sched_param *param)\n"
8616 "{\n"
8617 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8618 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8619 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8620 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8621 "            \"???\",\n"
8622 "            param-E<gt>sched_priority);\n"
8623 "}\n"
8624 msgstr ""
8625 "static void\n"
8626 "display_sched_attr(int policy, struct sched_param *param)\n"
8627 "{\n"
8628 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8629 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8630 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8631 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8632 "            \"???\",\n"
8633 "            param-E<gt>sched_priority);\n"
8634 "}\n"
8635
8636 #. type: Plain text
8637 #: build/C/man3/pthread_setschedparam.3:295
8638 #, no-wrap
8639 msgid ""
8640 "static void\n"
8641 "display_thread_sched_attr(char *msg)\n"
8642 "{\n"
8643 "    int policy, s;\n"
8644 "    struct sched_param param;\n"
8645 msgstr ""
8646 "static void\n"
8647 "display_thread_sched_attr(char *msg)\n"
8648 "{\n"
8649 "    int policy, s;\n"
8650 "    struct sched_param param;\n"
8651
8652 #. type: Plain text
8653 #: build/C/man3/pthread_setschedparam.3:299
8654 #, no-wrap
8655 msgid ""
8656 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8657 "    if (s != 0)\n"
8658 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8659 msgstr ""
8660 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8661 "    if (s != 0)\n"
8662 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8663
8664 #. type: Plain text
8665 #: build/C/man3/pthread_setschedparam.3:303
8666 #, no-wrap
8667 msgid ""
8668 "    printf(\"%s\\en\", msg);\n"
8669 "    display_sched_attr(policy, &param);\n"
8670 "}\n"
8671 msgstr ""
8672 "    printf(\"%s\\en\", msg);\n"
8673 "    display_sched_attr(policy, &param);\n"
8674 "}\n"
8675
8676 #. type: Plain text
8677 #: build/C/man3/pthread_setschedparam.3:308
8678 #, no-wrap
8679 msgid ""
8680 "static void *\n"
8681 "thread_start(void *arg)\n"
8682 "{\n"
8683 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8684 msgstr ""
8685 "static void *\n"
8686 "thread_start(void *arg)\n"
8687 "{\n"
8688 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8689
8690 #. type: Plain text
8691 #: build/C/man3/pthread_setschedparam.3:311
8692 #, no-wrap
8693 msgid ""
8694 "    return NULL;\n"
8695 "}\n"
8696 msgstr ""
8697 "    return NULL;\n"
8698 "}\n"
8699
8700 #. type: Plain text
8701 #: build/C/man3/pthread_setschedparam.3:321
8702 #, no-wrap
8703 msgid ""
8704 "int\n"
8705 "main(int argc, char *argv[])\n"
8706 "{\n"
8707 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
8708 "    pthread_t thread;\n"
8709 "    pthread_attr_t attr;\n"
8710 "    pthread_attr_t *attrp;\n"
8711 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
8712 "    struct sched_param param;\n"
8713 msgstr ""
8714 "int\n"
8715 "main(int argc, char *argv[])\n"
8716 "{\n"
8717 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
8718 "    pthread_t thread;\n"
8719 "    pthread_attr_t attr;\n"
8720 "    pthread_attr_t *attrp;\n"
8721 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
8722 "    struct sched_param param;\n"
8723
8724 #. type: Plain text
8725 #: build/C/man3/pthread_setschedparam.3:323
8726 #, no-wrap
8727 msgid "    /* Process command-line options */\n"
8728 msgstr "    /* Process command-line options */\n"
8729
8730 #. type: Plain text
8731 #: build/C/man3/pthread_setschedparam.3:328
8732 #, no-wrap
8733 msgid ""
8734 "    use_null_attrib = 0;\n"
8735 "    attr_sched_str = NULL;\n"
8736 "    main_sched_str = NULL;\n"
8737 "    inheritsched_str = NULL;\n"
8738 msgstr ""
8739 "    use_null_attrib = 0;\n"
8740 "    attr_sched_str = NULL;\n"
8741 "    main_sched_str = NULL;\n"
8742 "    inheritsched_str = NULL;\n"
8743
8744 #. type: Plain text
8745 #: build/C/man3/pthread_setschedparam.3:338
8746 #, no-wrap
8747 msgid ""
8748 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
8749 "        switch (opt) {\n"
8750 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
8751 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
8752 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
8753 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
8754 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
8755 "        }\n"
8756 "    }\n"
8757 msgstr ""
8758 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
8759 "        switch (opt) {\n"
8760 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
8761 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
8762 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
8763 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
8764 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
8765 "        }\n"
8766 "    }\n"
8767
8768 #. type: Plain text
8769 #: build/C/man3/pthread_setschedparam.3:342
8770 #, no-wrap
8771 msgid ""
8772 "    if (use_null_attrib &&\n"
8773 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
8774 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
8775 msgstr ""
8776 "    if (use_null_attrib &&\n"
8777 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
8778 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
8779
8780 #. type: Plain text
8781 #: build/C/man3/pthread_setschedparam.3:345
8782 #, no-wrap
8783 msgid ""
8784 "    /* Optionally set scheduling attributes of main thread,\n"
8785 "       and display the attributes */\n"
8786 msgstr ""
8787 "    /* Optionally set scheduling attributes of main thread,\n"
8788 "       and display the attributes */\n"
8789
8790 #. type: Plain text
8791 #: build/C/man3/pthread_setschedparam.3:350
8792 #, no-wrap
8793 msgid ""
8794 "    if (main_sched_str != NULL) {\n"
8795 "        if (!get_policy(main_sched_str[0], &policy))\n"
8796 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
8797 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
8798 msgstr ""
8799 "    if (main_sched_str != NULL) {\n"
8800 "        if (!get_policy(main_sched_str[0], &policy))\n"
8801 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
8802 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
8803
8804 #. type: Plain text
8805 #: build/C/man3/pthread_setschedparam.3:355
8806 #, no-wrap
8807 msgid ""
8808 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
8809 "        if (s != 0)\n"
8810 "            handle_error_en(s, \"pthread_setschedparam\");\n"
8811 "    }\n"
8812 msgstr ""
8813 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
8814 "        if (s != 0)\n"
8815 "            handle_error_en(s, \"pthread_setschedparam\");\n"
8816 "    }\n"
8817
8818 #. type: Plain text
8819 #: build/C/man3/pthread_setschedparam.3:358
8820 #, no-wrap
8821 msgid ""
8822 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
8823 "    printf(\"\\en\");\n"
8824 msgstr ""
8825 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
8826 "    printf(\"\\en\");\n"
8827
8828 #. type: Plain text
8829 #: build/C/man3/pthread_setschedparam.3:360
8830 #, no-wrap
8831 msgid "    /* Initialize thread attributes object according to options */\n"
8832 msgstr "    /* Initialize thread attributes object according to options */\n"
8833
8834 #. type: Plain text
8835 #: build/C/man3/pthread_setschedparam.3:369
8836 #, no-wrap
8837 msgid ""
8838 "    if (!use_null_attrib) {\n"
8839 "        s = pthread_attr_init(&attr);\n"
8840 "        if (s != 0)\n"
8841 "            handle_error_en(s, \"pthread_attr_init\");\n"
8842 "        attrp = &attr;\n"
8843 "    }\n"
8844 msgstr ""
8845 "    if (!use_null_attrib) {\n"
8846 "        s = pthread_attr_init(&attr);\n"
8847 "        if (s != 0)\n"
8848 "            handle_error_en(s, \"pthread_attr_init\");\n"
8849 "        attrp = &attr;\n"
8850 "    }\n"
8851
8852 #. type: Plain text
8853 #: build/C/man3/pthread_setschedparam.3:377
8854 #, no-wrap
8855 msgid ""
8856 "    if (inheritsched_str != NULL) {\n"
8857 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
8858 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
8859 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
8860 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
8861 "        else\n"
8862 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
8863 msgstr ""
8864 "    if (inheritsched_str != NULL) {\n"
8865 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
8866 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
8867 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
8868 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
8869 "        else\n"
8870 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
8871
8872 #. type: Plain text
8873 #: build/C/man3/pthread_setschedparam.3:382
8874 #, no-wrap
8875 msgid ""
8876 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
8877 "        if (s != 0)\n"
8878 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
8879 "    }\n"
8880 msgstr ""
8881 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
8882 "        if (s != 0)\n"
8883 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
8884 "    }\n"
8885
8886 #. type: Plain text
8887 #: build/C/man3/pthread_setschedparam.3:388
8888 #, no-wrap
8889 msgid ""
8890 "    if (attr_sched_str != NULL) {\n"
8891 "        if (!get_policy(attr_sched_str[0], &policy))\n"
8892 "            usage(argv[0],\n"
8893 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
8894 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
8895 msgstr ""
8896 "    if (attr_sched_str != NULL) {\n"
8897 "        if (!get_policy(attr_sched_str[0], &policy))\n"
8898 "            usage(argv[0],\n"
8899 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
8900 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
8901
8902 #. type: Plain text
8903 #: build/C/man3/pthread_setschedparam.3:396
8904 #, no-wrap
8905 msgid ""
8906 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
8907 "        if (s != 0)\n"
8908 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
8909 "        s = pthread_attr_setschedparam(&attr, &param);\n"
8910 "        if (s != 0)\n"
8911 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
8912 "    }\n"
8913 msgstr ""
8914 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
8915 "        if (s != 0)\n"
8916 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
8917 "        s = pthread_attr_setschedparam(&attr, &param);\n"
8918 "        if (s != 0)\n"
8919 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
8920 "    }\n"
8921
8922 #. type: Plain text
8923 #: build/C/man3/pthread_setschedparam.3:399
8924 #, no-wrap
8925 msgid ""
8926 "    /* If we initialized a thread attributes object, display\n"
8927 "       the scheduling attributes that were set in the object */\n"
8928 msgstr ""
8929 "    /* If we initialized a thread attributes object, display\n"
8930 "       the scheduling attributes that were set in the object */\n"
8931
8932 #. type: Plain text
8933 #: build/C/man3/pthread_setschedparam.3:407
8934 #, no-wrap
8935 msgid ""
8936 "    if (attrp != NULL) {\n"
8937 "        s = pthread_attr_getschedparam(&attr, &param);\n"
8938 "        if (s != 0)\n"
8939 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
8940 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
8941 "        if (s != 0)\n"
8942 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
8943 msgstr ""
8944 "    if (attrp != NULL) {\n"
8945 "        s = pthread_attr_getschedparam(&attr, &param);\n"
8946 "        if (s != 0)\n"
8947 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
8948 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
8949 "        if (s != 0)\n"
8950 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
8951
8952 #. type: Plain text
8953 #: build/C/man3/pthread_setschedparam.3:410
8954 #, no-wrap
8955 msgid ""
8956 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
8957 "        display_sched_attr(policy, &param);\n"
8958 msgstr ""
8959 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
8960 "        display_sched_attr(policy, &param);\n"
8961
8962 #. type: Plain text
8963 #: build/C/man3/pthread_setschedparam.3:418
8964 #, no-wrap
8965 msgid ""
8966 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
8967 "        printf(\"    inheritsched is %s\\en\",\n"
8968 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
8969 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
8970 "                \"???\");\n"
8971 "        printf(\"\\en\");\n"
8972 "    }\n"
8973 msgstr ""
8974 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
8975 "        printf(\"    inheritsched is %s\\en\",\n"
8976 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
8977 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
8978 "                \"???\");\n"
8979 "        printf(\"\\en\");\n"
8980 "    }\n"
8981
8982 #. type: Plain text
8983 #: build/C/man3/pthread_setschedparam.3:420
8984 #, no-wrap
8985 msgid "    /* Create a thread that will display its scheduling attributes */\n"
8986 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
8987
8988 #. type: Plain text
8989 #: build/C/man3/pthread_setschedparam.3:424
8990 #, no-wrap
8991 msgid ""
8992 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
8993 "    if (s != 0)\n"
8994 "        handle_error_en(s, \"pthread_create\");\n"
8995 msgstr ""
8996 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
8997 "    if (s != 0)\n"
8998 "        handle_error_en(s, \"pthread_create\");\n"
8999
9000 #. type: Plain text
9001 #: build/C/man3/pthread_setschedparam.3:426
9002 #, no-wrap
9003 msgid "    /* Destroy unneeded thread attributes object */\n"
9004 msgstr "    /* Destroy unneeded thread attributes object */\n"
9005
9006 #. type: Plain text
9007 #: build/C/man3/pthread_setschedparam.3:434
9008 #, no-wrap
9009 msgid ""
9010 "    s = pthread_join(thread, NULL);\n"
9011 "    if (s != 0)\n"
9012 "        handle_error_en(s, \"pthread_join\");\n"
9013 msgstr ""
9014 "    s = pthread_join(thread, NULL);\n"
9015 "    if (s != 0)\n"
9016 "        handle_error_en(s, \"pthread_join\");\n"
9017
9018 #. type: Plain text
9019 #: build/C/man3/pthread_setschedparam.3:452
9020 msgid ""
9021 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9022 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9023 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9024 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
9025 msgstr "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
9026
9027 #. type: TH
9028 #: build/C/man3/pthread_setschedprio.3:26
9029 #, no-wrap
9030 msgid "PTHREAD_SETSCHEDPRIO"
9031 msgstr "PTHREAD_SETSCHEDPRIO"
9032
9033 #. type: Plain text
9034 #: build/C/man3/pthread_setschedprio.3:29
9035 msgid "pthread_setschedprio - set scheduling priority of a thread"
9036 msgstr "pthread_setschedprio - スレッドのスケジューリング優先度を設定する"
9037
9038 #. type: Plain text
9039 #: build/C/man3/pthread_setschedprio.3:34
9040 #, no-wrap
9041 msgid "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
9042 msgstr "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
9043
9044 #.  FIXME . nptl/pthread_setschedprio.c has the following
9045 #.    /* If the thread should have higher priority because of some
9046 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
9047 #.  Eventually (perhaps after writing the mutexattr pages), we
9048 #.  may want to add something on the topic to this page.
9049 #.  nptl/pthread_setschedparam.c has a similar case.
9050 #. type: Plain text
9051 #: build/C/man3/pthread_setschedprio.3:53
9052 msgid ""
9053 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
9054 "thread I<thread> to the value specified in I<prio>.  (By contrast "
9055 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
9056 "of a thread.)"
9057 msgstr ""
9058 "B<pthread_setschedprio>() 関数は、スレッド I<thread> のスケジューリング\n"
9059 "優先度に I<prio> で指定された値を設定する\n"
9060 "(一方、B<pthread_setschedparam>(3) はスレッドのスケジューリングポリシー\n"
9061 "と優先度の両方を変更する)。"
9062
9063 #. type: Plain text
9064 #: build/C/man3/pthread_setschedprio.3:61
9065 msgid ""
9066 "On success, this function returns 0; on error, it returns a nonzero error "
9067 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
9068 "I<thread> is not changed."
9069 msgstr ""
9070 "成功すると、この関数は 0 を返す。\n"
9071 "エラーの場合、0 以外のエラー番号を返す。\n"
9072 "B<pthread_setschedprio>() が失敗した場合、 I<thread> の\n"
9073 "スケジューリング優先度は変更されない。"
9074
9075 #. type: Plain text
9076 #: build/C/man3/pthread_setschedprio.3:66
9077 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
9078 msgstr ""
9079 "指定されたスレッドのスケジューリングポリシーでは、 I<prio> は無効である。"
9080
9081 #. type: Plain text
9082 #: build/C/man3/pthread_setschedprio.3:70
9083 msgid ""
9084 "The caller does not have appropriate privileges to set the specified "
9085 "priority."
9086 msgstr "呼び出し側が、指定された優先度を設定するのに必要な特権を持っていない。"
9087
9088 #. type: Plain text
9089 #: build/C/man3/pthread_setschedprio.3:81
9090 msgid ""
9091 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
9092 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
9093 msgstr ""
9094 "POSIX.1-2001 では、 B<pthread_setschedprio>() に関して\n"
9095 "エラー B<ENOTSUP> (\"サポートされていない値を優先度\n"
9096 "に設定しようとした\") も追加で規定されている。"
9097
9098 #. type: Plain text
9099 #: build/C/man3/pthread_setschedprio.3:83
9100 msgid "This function is available in glibc since version 2.3.4."
9101 msgstr "この関数は glibc バージョン 2.3.4 以降で利用できる。"
9102
9103 #. type: Plain text
9104 #: build/C/man3/pthread_setschedprio.3:88
9105 msgid "The B<pthread_setschedprio>()  function is thread-safe."
9106 msgstr "B<pthread_setschedprio>() 関数はスレッドセーフである。"
9107
9108 #. type: Plain text
9109 #: build/C/man3/pthread_setschedprio.3:96
9110 msgid ""
9111 "For a description of the permissions required to, and the effect of, "
9112 "changing a thread's scheduling priority, and details of the permitted ranges "
9113 "for priorities in each scheduling policy, see B<sched>(7)."
9114 msgstr "スレッドのスケジューリング優先度を変更するために必要な許可や変更した場合の影響、および各スケジューリングポリシーで認められる優先度の範囲の詳細については、 B<sched>(7) を参照。"
9115
9116 #. type: Plain text
9117 #: build/C/man3/pthread_setschedprio.3:110
9118 msgid ""
9119 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9120 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9121 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9122 "B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
9123 msgstr "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
9124
9125 #. type: TH
9126 #: build/C/man3/pthread_sigmask.3:26
9127 #, no-wrap
9128 msgid "PTHREAD_SIGMASK"
9129 msgstr "PTHREAD_SIGMASK"
9130
9131 #. type: Plain text
9132 #: build/C/man3/pthread_sigmask.3:29
9133 msgid "pthread_sigmask - examine and change mask of blocked signals"
9134 msgstr "pthread_sigmask - 禁止するシグナルマスクの確認と変更を行う"
9135
9136 #. type: Plain text
9137 #: build/C/man3/pthread_sigmask.3:35
9138 #, no-wrap
9139 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9140 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9141
9142 #. type: Plain text
9143 #: build/C/man3/pthread_sigmask.3:46
9144 msgid "B<pthread_sigmask>():"
9145 msgstr "B<pthread_sigmask>():"
9146
9147 #. type: Plain text
9148 #: build/C/man3/pthread_sigmask.3:58
9149 msgid ""
9150 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
9151 "difference that its use in multithreaded programs is explicitly specified by "
9152 "POSIX.1-2001.  Other differences are noted in this page."
9153 msgstr ""
9154 "B<pthread_sigmask>() 関数は B<sigprocmask>(2) と全く同様だが、\n"
9155 "マルチスレッドプログラムでの利用が POSIX.1-2001 で明示的に規定されて\n"
9156 "いる点が異なる。他の違いはこのマニュアルページで説明する。"
9157
9158 #. type: Plain text
9159 #: build/C/man3/pthread_sigmask.3:61
9160 msgid ""
9161 "For a description of the arguments and operation of this function, see "
9162 "B<sigprocmask>(2)."
9163 msgstr "この関数の引き数と動作の説明は B<sigprocmask>(2) を参照。"
9164
9165 #. type: Plain text
9166 #: build/C/man3/pthread_sigmask.3:66
9167 msgid ""
9168 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
9169 "number."
9170 msgstr ""
9171 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9172 "エラーの場合、エラー番号を返す。"
9173
9174 #. type: Plain text
9175 #: build/C/man3/pthread_sigmask.3:69
9176 msgid "See B<sigprocmask>(2)."
9177 msgstr "B<sigprocmask>(2) を参照。"
9178
9179 #. type: Plain text
9180 #: build/C/man3/pthread_sigmask.3:74
9181 msgid "The B<pthread_sigmask>()  function is thread-safe."
9182 msgstr "B<pthread_sigmask>() 関数はスレッドセーフである。"
9183
9184 #. type: Plain text
9185 #: build/C/man3/pthread_sigmask.3:78
9186 msgid "A new thread inherits a copy of its creator's signal mask."
9187 msgstr ""
9188 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスクのコピーを\n"
9189 "継承する。"
9190
9191 #. type: Plain text
9192 #: build/C/man3/pthread_sigmask.3:83
9193 msgid ""
9194 "The program below blocks some signals in the main thread, and then creates a "
9195 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
9196 "shell session demonstrates its use:"
9197 msgstr ""
9198 "以下のプログラムは、メインスレッドでシグナルのいくつかを禁止 (block)\n"
9199 "するように設定を行い、 B<sigwait>(3) 経由でそれらのシグナルを集める\n"
9200 "専用のスレッドを作成する。\n"
9201 "下記のシェルのセッションはその利用例を示したものである。"
9202
9203 #. type: Plain text
9204 #: build/C/man3/pthread_sigmask.3:94
9205 #, no-wrap
9206 msgid ""
9207 "$B< ./a.out &>\n"
9208 "[1] 5423\n"
9209 "$B< kill -QUIT %1>\n"
9210 "Signal handling thread got signal 3\n"
9211 "$B< kill -USR1 %1>\n"
9212 "Signal handling thread got signal 10\n"
9213 "$B< kill -TERM %1>\n"
9214 "[1]+  Terminated              ./a.out\n"
9215 msgstr ""
9216 "$B< ./a.out &>\n"
9217 "[1] 5423\n"
9218 "$B< kill -QUIT %1>\n"
9219 "Signal handling thread got signal 3\n"
9220 "$B< kill -USR1 %1>\n"
9221 "Signal handling thread got signal 10\n"
9222 "$B< kill -TERM %1>\n"
9223 "[1]+  Terminated              ./a.out\n"
9224
9225 #. type: Plain text
9226 #: build/C/man3/pthread_sigmask.3:105
9227 #, no-wrap
9228 msgid ""
9229 "#include E<lt>pthread.hE<gt>\n"
9230 "#include E<lt>stdio.hE<gt>\n"
9231 "#include E<lt>stdlib.hE<gt>\n"
9232 "#include E<lt>unistd.hE<gt>\n"
9233 "#include E<lt>signal.hE<gt>\n"
9234 "#include E<lt>errno.hE<gt>\n"
9235 msgstr ""
9236 "#include E<lt>pthread.hE<gt>\n"
9237 "#include E<lt>stdio.hE<gt>\n"
9238 "#include E<lt>stdlib.hE<gt>\n"
9239 "#include E<lt>unistd.hE<gt>\n"
9240 "#include E<lt>signal.hE<gt>\n"
9241 "#include E<lt>errno.hE<gt>\n"
9242
9243 #. type: Plain text
9244 #: build/C/man3/pthread_sigmask.3:107
9245 #, no-wrap
9246 msgid "/* Simple error handling functions */\n"
9247 msgstr "/* Simple error handling functions */\n"
9248
9249 #. type: Plain text
9250 #: build/C/man3/pthread_sigmask.3:116
9251 #, no-wrap
9252 msgid ""
9253 "static void *\n"
9254 "sig_thread(void *arg)\n"
9255 "{\n"
9256 "    sigset_t *set = arg;\n"
9257 "    int s, sig;\n"
9258 msgstr ""
9259 "static void *\n"
9260 "sig_thread(void *arg)\n"
9261 "{\n"
9262 "    sigset_t *set = arg;\n"
9263 "    int s, sig;\n"
9264
9265 #. type: Plain text
9266 #: build/C/man3/pthread_sigmask.3:124
9267 #, no-wrap
9268 msgid ""
9269 "    for (;;) {\n"
9270 "        s = sigwait(set, &sig);\n"
9271 "        if (s != 0)\n"
9272 "            handle_error_en(s, \"sigwait\");\n"
9273 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
9274 "    }\n"
9275 "}\n"
9276 msgstr ""
9277 "    for (;;) {\n"
9278 "        s = sigwait(set, &sig);\n"
9279 "        if (s != 0)\n"
9280 "            handle_error_en(s, \"sigwait\");\n"
9281 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
9282 "    }\n"
9283 "}\n"
9284
9285 #. type: Plain text
9286 #: build/C/man3/pthread_sigmask.3:131
9287 #, no-wrap
9288 msgid ""
9289 "int\n"
9290 "main(int argc, char *argv[])\n"
9291 "{\n"
9292 "    pthread_t thread;\n"
9293 "    sigset_t set;\n"
9294 "    int s;\n"
9295 msgstr ""
9296 "int\n"
9297 "main(int argc, char *argv[])\n"
9298 "{\n"
9299 "    pthread_t thread;\n"
9300 "    sigset_t set;\n"
9301 "    int s;\n"
9302
9303 #. type: Plain text
9304 #: build/C/man3/pthread_sigmask.3:134
9305 #, no-wrap
9306 msgid ""
9307 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
9308 "       will inherit a copy of the signal mask. */\n"
9309 msgstr ""
9310 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
9311 "       will inherit a copy of the signal mask. */\n"
9312
9313 #. type: Plain text
9314 #: build/C/man3/pthread_sigmask.3:141
9315 #, no-wrap
9316 msgid ""
9317 "    sigemptyset(&set);\n"
9318 "    sigaddset(&set, SIGQUIT);\n"
9319 "    sigaddset(&set, SIGUSR1);\n"
9320 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
9321 "    if (s != 0)\n"
9322 "        handle_error_en(s, \"pthread_sigmask\");\n"
9323 msgstr ""
9324 "    sigemptyset(&set);\n"
9325 "    sigaddset(&set, SIGQUIT);\n"
9326 "    sigaddset(&set, SIGUSR1);\n"
9327 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
9328 "    if (s != 0)\n"
9329 "        handle_error_en(s, \"pthread_sigmask\");\n"
9330
9331 #. type: Plain text
9332 #: build/C/man3/pthread_sigmask.3:145
9333 #, no-wrap
9334 msgid ""
9335 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
9336 "    if (s != 0)\n"
9337 "        handle_error_en(s, \"pthread_create\");\n"
9338 msgstr ""
9339 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
9340 "    if (s != 0)\n"
9341 "        handle_error_en(s, \"pthread_create\");\n"
9342
9343 #. type: Plain text
9344 #: build/C/man3/pthread_sigmask.3:148
9345 #, no-wrap
9346 msgid ""
9347 "    /* Main thread carries on to create other threads and/or do\n"
9348 "       other work */\n"
9349 msgstr ""
9350 "    /* Main thread carries on to create other threads and/or do\n"
9351 "       other work */\n"
9352
9353 #. type: Plain text
9354 #: build/C/man3/pthread_sigmask.3:151
9355 #, no-wrap
9356 msgid ""
9357 "    pause();            /* Dummy pause so we can test program */\n"
9358 "}\n"
9359 msgstr ""
9360 "    pause();            /* Dummy pause so we can test program */\n"
9361 "}\n"
9362
9363 #. type: Plain text
9364 #: build/C/man3/pthread_sigmask.3:161
9365 msgid ""
9366 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), "
9367 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
9368 msgstr ""
9369 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), "
9370 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
9371
9372 #. type: TH
9373 #: build/C/man3/pthread_sigqueue.3:25
9374 #, no-wrap
9375 msgid "PTHREAD_SIGQUEUE"
9376 msgstr "PTHREAD_SIGQUEUE"
9377
9378 #. type: Plain text
9379 #: build/C/man3/pthread_sigqueue.3:28
9380 msgid "pthread_sigqueue - queue a signal and data to a thread"
9381 msgstr "pthread_sigqueue - スレッドに対するシグナルとデータをキューに入れる"
9382
9383 #. type: Plain text
9384 #: build/C/man3/pthread_sigqueue.3:34
9385 #, no-wrap
9386 msgid ""
9387 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
9388 "B<                     const union sigval >I<value>B<);>\n"
9389 msgstr ""
9390 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
9391 "B<                     const union sigval >I<value>B<);>\n"
9392
9393 #. type: Plain text
9394 #: build/C/man3/pthread_sigqueue.3:45
9395 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
9396 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
9397
9398 #. type: Plain text
9399 #: build/C/man3/pthread_sigqueue.3:53
9400 msgid ""
9401 "The B<pthread_sigqueue>()  function performs a similar task to "
9402 "B<sigqueue>(3), but, rather than sending a signal to a process, it sends a "
9403 "signal to a thread in the same process as the calling thread."
9404 msgstr ""
9405 "B<pthread_sigqueue>() 関数は B<sigqueue>(3) と同様の処理を実行するが、\n"
9406 "プロセスにシグナルを送信するのではなく、呼び出したスレッドと\n"
9407 "同じプロセス内のスレッドにシグナルを送信する。"
9408
9409 #. type: Plain text
9410 #: build/C/man3/pthread_sigqueue.3:65
9411 msgid ""
9412 "The I<thread> argument is the ID of a thread in the same process as the "
9413 "caller.  The I<sig> argument specifies the signal to be sent.  The I<value> "
9414 "argument specifies data to accompany the signal; see B<sigqueue>(3)  for "
9415 "details."
9416 msgstr ""
9417 "I<thread> 引き数は、呼び出し側と同じプロセスのスレッドの ID である。\n"
9418 "I<sig> 引き数は送信するシグナルを指定する。\n"
9419 "I<value> 引き数はシグナルと一緒に渡すデータを指定する。\n"
9420 "詳細は B<sigqueue>(3) を参照。"
9421
9422 #. type: Plain text
9423 #: build/C/man3/pthread_sigqueue.3:70
9424 msgid ""
9425 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
9426 "number."
9427 msgstr ""
9428 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9429 "エラーの場合、エラー番号を返す。"
9430
9431 #. type: Plain text
9432 #: build/C/man3/pthread_sigqueue.3:77
9433 msgid ""
9434 "The limit of signals which may be queued has been reached.  (See "
9435 "B<signal>(7)  for further information.)"
9436 msgstr ""
9437 "キューに入れられるシグナル数が上限に達していた\n"
9438 "(詳しい情報は (B<signal>(7) を参照)。"
9439
9440 #. type: Plain text
9441 #: build/C/man3/pthread_sigqueue.3:81
9442 msgid "I<sig> was invalid."
9443 msgstr "I<sig> が無効であった。"
9444
9445 #. type: TP
9446 #: build/C/man3/pthread_sigqueue.3:81
9447 #, no-wrap
9448 msgid "B<ENOSYS>"
9449 msgstr "B<ENOSYS>"
9450
9451 #. type: Plain text
9452 #: build/C/man3/pthread_sigqueue.3:85
9453 msgid "B<pthread_sigqueue>()  is not supported on this system."
9454 msgstr "B<pthread_sigqueue>() がこのシステムではサポートされていない。"
9455
9456 #. type: Plain text
9457 #: build/C/man3/pthread_sigqueue.3:89
9458 msgid "I<thread> is not valid."
9459 msgstr "I<thread> が無効である。"
9460
9461 #. type: Plain text
9462 #: build/C/man3/pthread_sigqueue.3:93
9463 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
9464 msgstr "B<pthread_sigqueue>() 関数は glibc 2.11 で初めて登場した。"
9465
9466 #. type: Plain text
9467 #: build/C/man3/pthread_sigqueue.3:98
9468 msgid "The B<pthread_sigqueue>()  function is thread-safe."
9469 msgstr "B<pthread_sigqueue>() 関数はスレッドセーフである。"
9470
9471 #. type: Plain text
9472 #: build/C/man3/pthread_sigqueue.3:100
9473 msgid "This function is a GNU extension."
9474 msgstr "この関数は GNU による拡張である。"
9475
9476 #. type: Plain text
9477 #: build/C/man3/pthread_sigqueue.3:108
9478 msgid ""
9479 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), "
9480 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
9481 msgstr ""
9482 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
9483 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
9484
9485 #. type: TH
9486 #: build/C/man3/pthread_testcancel.3:26
9487 #, no-wrap
9488 msgid "PTHREAD_TESTCANCEL"
9489 msgstr "PTHREAD_TESTCANCEL"
9490
9491 #. type: Plain text
9492 #: build/C/man3/pthread_testcancel.3:29
9493 msgid ""
9494 "pthread_testcancel - request delivery of any pending cancellation request"
9495 msgstr "pthread_testcancel - 処理待ちの取り消し要求の配送を要求する"
9496
9497 #. type: Plain text
9498 #: build/C/man3/pthread_testcancel.3:34
9499 #, no-wrap
9500 msgid "B<void pthread_testcancel(void);>\n"
9501 msgstr "B<void pthread_testcancel(void);>\n"
9502
9503 #. type: Plain text
9504 #: build/C/man3/pthread_testcancel.3:43
9505 msgid ""
9506 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
9507 "calling thread, so that a thread that is otherwise executing code that "
9508 "contains no cancellation points will respond to a cancellation request."
9509 msgstr ""
9510 "B<pthread_testcancel>() を呼び出すと、呼び出したスレッド内に取り消し\n"
9511 "ポイント (cancellation point) が作成される。\n"
9512 "これにより、これ以外には取り消しポイントを含まないコードを実行して\n"
9513 "いるスレッドが取り消し要求に対応することができるようになる。"
9514
9515 #. type: Plain text
9516 #: build/C/man3/pthread_testcancel.3:50
9517 msgid ""
9518 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
9519 "cancellation request is pending, then a call to B<pthread_testcancel>()  has "
9520 "no effect."
9521 msgstr ""
9522 "(B<pthread_setcancelstate>(3) を使って) キャンセルが無効になっている\n"
9523 "場合や処理待ちの取り消し要求がない場合は、B<pthread_testcancel>() を\n"
9524 "呼び出しても何の影響もない。"
9525
9526 #. type: Plain text
9527 #: build/C/man3/pthread_testcancel.3:54
9528 msgid ""
9529 "This function does not return a value.  If the calling thread is canceled as "
9530 "a consequence of a call to this function, then the function does not return."
9531 msgstr ""
9532 "この関数は値を返さない。この関数の呼び出しの結果、呼び出したスレッドが\n"
9533 "キャンセルされた場合、この関数が返ることはない。"
9534
9535 #. type: Plain text
9536 #: build/C/man3/pthread_testcancel.3:63
9537 msgid "The B<pthread_testcancel>()  function is thread-safe."
9538 msgstr "B<pthread_testcancel>() 関数はスレッドセーフである。"
9539
9540 #. type: Plain text
9541 #: build/C/man3/pthread_testcancel.3:68
9542 msgid "See B<pthread_cleanup_push>(3)."
9543 msgstr "B<pthread_cleanup_push>(3) を参照。"
9544
9545 #. type: Plain text
9546 #: build/C/man3/pthread_testcancel.3:73
9547 msgid ""
9548 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9549 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
9550 msgstr ""
9551 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
9552 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
9553
9554 #. type: TH
9555 #: build/C/man3/pthread_tryjoin_np.3:26
9556 #, no-wrap
9557 msgid "PTHREAD_TRYJOIN_NP"
9558 msgstr "PTHREAD_TRYJOIN_NP"
9559
9560 #. type: Plain text
9561 #: build/C/man3/pthread_tryjoin_np.3:30
9562 msgid ""
9563 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
9564 "thread"
9565 msgstr ""
9566 "pthread_tryjoin_np, pthread_timedjoin_np - 終了したスレッドの join を\n"
9567 "試みる"
9568
9569 #. type: Plain text
9570 #: build/C/man3/pthread_tryjoin_np.3:36
9571 #, no-wrap
9572 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9573 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9574
9575 #. type: Plain text
9576 #: build/C/man3/pthread_tryjoin_np.3:39
9577 #, no-wrap
9578 msgid ""
9579 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9580 "B<                         const struct timespec *>I<abstime>B<);>\n"
9581 msgstr ""
9582 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9583 "B<                         const struct timespec *>I<abstime>B<);>\n"
9584
9585 #. type: Plain text
9586 #: build/C/man3/pthread_tryjoin_np.3:46
9587 msgid ""
9588 "These functions operate in the same way as B<pthread_join>(3), except for "
9589 "the differences described on this page."
9590 msgstr ""
9591 "これらの関数は B<pthread_join>(3) と同じように動作するが、\n"
9592 "このページで説明する違いがある。"
9593
9594 #. type: Plain text
9595 #: build/C/man3/pthread_tryjoin_np.3:58
9596 msgid ""
9597 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
9598 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
9599 "I<thread> has not yet terminated, then instead of blocking, as is done by "
9600 "B<pthread_join>(3), the call returns an error."
9601 msgstr ""
9602 "B<pthread_tryjoin_np>() 関数は、スレッド I<thread> の非停止\n"
9603 "(nonblocking) での join を実行し、スレッドの終了ステータスを\n"
9604 "I<*retval> に入れて返す。I<thread> がまだ終了していない場合は、\n"
9605 "B<pthread_join>(3) のように停止 (block) せずに、エラーを返す。"
9606
9607 #. type: Plain text
9608 #: build/C/man3/pthread_tryjoin_np.3:76
9609 msgid ""
9610 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
9611 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
9612 "specified in I<abstime>.  If the timeout expires before I<thread> "
9613 "terminates, the call returns an error.  The I<abstime> argument is a "
9614 "structure of the following form, specifying an absolute time measured since "
9615 "the Epoch (see B<time>(2)):"
9616 msgstr ""
9617 "B<pthread_timedjoin_np>() 関数は、タイムアウト付きの join を行う。\n"
9618 "I<thread> がまだ終了していない場合、 I<abstime> で指定された最大時間\n"
9619 "まで停止する。 I<thread> が終了する前にタイムアウト時間が経過した場合は、\n"
9620 "エラーを返す。I<abstime> 引き数は以下に示す構造体であり、\n"
9621 "Epoch (時刻紀元; B<time>(2) 参照) から測った絶対時刻を指定する。"
9622
9623 #. type: Plain text
9624 #: build/C/man3/pthread_tryjoin_np.3:83
9625 #, no-wrap
9626 msgid ""
9627 "struct timespec {\n"
9628 "    time_t tv_sec;     /* seconds */\n"
9629 "    long   tv_nsec;    /* nanoseconds */\n"
9630 "};\n"
9631 msgstr ""
9632 "struct timespec {\n"
9633 "    time_t tv_sec;     /* seconds */\n"
9634 "    long   tv_nsec;    /* nanoseconds */\n"
9635 "};\n"
9636
9637 #. type: Plain text
9638 #: build/C/man3/pthread_tryjoin_np.3:89
9639 msgid ""
9640 "On success, these functions return 0; on error, they return an error number."
9641 msgstr ""
9642 "成功すると、これらの関数は 0 を返す。\n"
9643 "エラーの場合、エラー番号を返す。"
9644
9645 #. type: Plain text
9646 #: build/C/man3/pthread_tryjoin_np.3:94
9647 msgid ""
9648 "These functions can fail with the same errors as B<pthread_join>(3).  "
9649 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
9650 msgstr ""
9651 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
9652 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
9653
9654 #. type: TP
9655 #: build/C/man3/pthread_tryjoin_np.3:94
9656 #, no-wrap
9657 msgid "B<EBUSY>"
9658 msgstr "B<EBUSY>"
9659
9660 #. type: Plain text
9661 #: build/C/man3/pthread_tryjoin_np.3:98
9662 msgid "I<thread> had not yet terminated at the time of the call."
9663 msgstr "呼び出しを行った時点では I<thread> はまだ終了していない。"
9664
9665 #. type: Plain text
9666 #: build/C/man3/pthread_tryjoin_np.3:101
9667 msgid ""
9668 "B<pthread_timedjoin_np>()  can in addition fail with the following error:"
9669 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
9670
9671 #. type: TP
9672 #: build/C/man3/pthread_tryjoin_np.3:101
9673 #, no-wrap
9674 msgid "B<ETIMEDOUT>"
9675 msgstr "B<ETIMEDOUT>"
9676
9677 #. type: Plain text
9678 #: build/C/man3/pthread_tryjoin_np.3:106
9679 msgid "The call timed out before I<thread> terminated."
9680 msgstr "I<thread> が終了する前に呼び出しがタイムアウトとなった。"
9681
9682 #. type: Plain text
9683 #: build/C/man3/pthread_tryjoin_np.3:110
9684 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
9685 msgstr "B<pthread_timedjoin_np>() がエラー B<EINTR> を返すことはない。"
9686
9687 #. type: Plain text
9688 #: build/C/man3/pthread_tryjoin_np.3:112
9689 msgid "These functions first appeared in glibc in version 2.3.3."
9690 msgstr "これらの関数は glibc バージョン 2.3.3 で初めて登場した。"
9691
9692 #. type: Plain text
9693 #: build/C/man3/pthread_tryjoin_np.3:117
9694 msgid "The following code waits to join for up to 5 seconds:"
9695 msgstr "以下のコードは、最大 5 秒まで join を待つ。"
9696
9697 #. type: Plain text
9698 #: build/C/man3/pthread_tryjoin_np.3:121
9699 #, no-wrap
9700 msgid ""
9701 "    struct timespec ts;\n"
9702 "    int s;\n"
9703 msgstr ""
9704 "    struct timespec ts;\n"
9705 "    int s;\n"
9706
9707 #. type: Plain text
9708 #: build/C/man3/pthread_tryjoin_np.3:123
9709 #, no-wrap
9710 msgid "    ...\n"
9711 msgstr "    ...\n"
9712
9713 #. type: Plain text
9714 #: build/C/man3/pthread_tryjoin_np.3:127
9715 #, no-wrap
9716 msgid ""
9717 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
9718 "\t/* Handle error */\n"
9719 "    }\n"
9720 msgstr ""
9721 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
9722 "\t/* Handle error */\n"
9723 "    }\n"
9724
9725 #. type: Plain text
9726 #: build/C/man3/pthread_tryjoin_np.3:129
9727 #, no-wrap
9728 msgid "    ts.tv_sec += 5;\n"
9729 msgstr "    ts.tv_sec += 5;\n"
9730
9731 #. type: Plain text
9732 #: build/C/man3/pthread_tryjoin_np.3:134
9733 #, no-wrap
9734 msgid ""
9735 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
9736 "    if (s != 0) {\n"
9737 "        /* Handle error */\n"
9738 "    }\n"
9739 msgstr ""
9740 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
9741 "    if (s != 0) {\n"
9742 "        /* Handle error */\n"
9743 "    }\n"
9744
9745 #. type: Plain text
9746 #: build/C/man3/pthread_tryjoin_np.3:140
9747 msgid ""
9748 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
9749 msgstr ""
9750 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
9751
9752 #. type: TH
9753 #: build/C/man3/pthread_yield.3:25
9754 #, no-wrap
9755 msgid "PTHREAD_YIELD"
9756 msgstr "PTHREAD_YIELD"
9757
9758 #. type: Plain text
9759 #: build/C/man3/pthread_yield.3:28
9760 msgid "pthread_yield - yield the processor"
9761 msgstr "pthread_yield - プロセッサを明け渡す (yield)"
9762
9763 #. type: Plain text
9764 #: build/C/man3/pthread_yield.3:34
9765 #, no-wrap
9766 msgid "B<int pthread_yield(void);>\n"
9767 msgstr "B<int pthread_yield(void);>\n"
9768
9769 #. type: Plain text
9770 #: build/C/man3/pthread_yield.3:44
9771 msgid ""
9772 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
9773 "thread is placed at the end of the run queue for its static priority and "
9774 "another thread is scheduled to run.  For further details, see "
9775 "B<sched_yield>(2)"
9776 msgstr ""
9777 "B<pthread_yield>() を呼び出すと、呼び出したスレッドは CPU を手放す。\n"
9778 "スレッドはそのスレッドの静的優先度の実行キューの末尾に回り、\n"
9779 "別のスレッドが実行されるようにスケジューリングされる。\n"
9780 "詳細は B<sched_yield>(2) を参照。"
9781
9782 #. type: Plain text
9783 #: build/C/man3/pthread_yield.3:49
9784 msgid ""
9785 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
9786 "number."
9787 msgstr ""
9788 "成功すると、 B<pthread_yield>() は 0 を返す。\n"
9789 "エラーの場合、エラー番号を返す。"
9790
9791 #. type: Plain text
9792 #: build/C/man3/pthread_yield.3:53
9793 msgid ""
9794 "On Linux, this call always succeeds (but portable and future-proof "
9795 "applications should nevertheless handle a possible error return)."
9796 msgstr ""
9797 "Linux では、この関数の呼び出しは常に成功する\n"
9798 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
9799 "正のエラーの返り値を処理するようにすべきである)。"
9800
9801 #. type: Plain text
9802 #: build/C/man3/pthread_yield.3:58
9803 msgid "The B<pthread_yield>()  function is thread-safe."
9804 msgstr "B<pthread_yield>() 関数はスレッドセーフである。"
9805
9806 #.  e.g., the BSDs, Tru64, AIX, and Irix.
9807 #. type: Plain text
9808 #: build/C/man3/pthread_yield.3:64
9809 msgid ""
9810 "This call is nonstandard, but present on several other systems.  Use the "
9811 "standardized B<sched_yield>(2)  instead."
9812 msgstr ""
9813 "この関数は非標準だが、他のいくつかのシステムにも存在する。\n"
9814 "代わりに、標準化されている B<sched_yield>(2) を使うこと。"
9815
9816 #. type: Plain text
9817 #: build/C/man3/pthread_yield.3:67
9818 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
9819 msgstr ""
9820 "Linux では、この関数は B<sched_yield>(2) を呼び出す形で実装されている。"
9821
9822 #. type: Plain text
9823 #: build/C/man3/pthread_yield.3:71
9824 msgid "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
9825 msgstr "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
9826
9827 #. type: TH
9828 #: build/C/man7/pthreads.7:26
9829 #, no-wrap
9830 msgid "PTHREADS"
9831 msgstr "PTHREADS"
9832
9833 #. type: Plain text
9834 #: build/C/man7/pthreads.7:29
9835 msgid "pthreads - POSIX threads"
9836 msgstr "pthreads - POSIX スレッド"
9837
9838 #. type: Plain text
9839 #: build/C/man7/pthreads.7:36
9840 msgid ""
9841 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
9842 "programming commonly known as POSIX threads, or Pthreads.  A single process "
9843 "can contain multiple threads, all of which are executing the same program.  "
9844 "These threads share the same global memory (data and heap segments), but "
9845 "each thread has its own stack (automatic variables)."
9846 msgstr ""
9847 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
9848 "ラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロ"
9849 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
9850 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
9851 "スレッドは自分専用のスタック (自動変数) を持つ。"
9852
9853 #. type: Plain text
9854 #: build/C/man7/pthreads.7:39
9855 msgid ""
9856 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
9857 "these attributes are process-wide rather than per-thread):"
9858 msgstr ""
9859 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
9860 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
9861
9862 #. type: IP
9863 #: build/C/man7/pthreads.7:39 build/C/man7/pthreads.7:41
9864 #: build/C/man7/pthreads.7:43 build/C/man7/pthreads.7:45
9865 #: build/C/man7/pthreads.7:47 build/C/man7/pthreads.7:49
9866 #: build/C/man7/pthreads.7:51 build/C/man7/pthreads.7:54
9867 #: build/C/man7/pthreads.7:56 build/C/man7/pthreads.7:59
9868 #: build/C/man7/pthreads.7:65 build/C/man7/pthreads.7:70
9869 #: build/C/man7/pthreads.7:73 build/C/man7/pthreads.7:76
9870 #: build/C/man7/pthreads.7:84 build/C/man7/pthreads.7:88
9871 #: build/C/man7/pthreads.7:91 build/C/man7/pthreads.7:95
9872 #: build/C/man7/pthreads.7:98 build/C/man7/pthreads.7:103
9873 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
9874 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
9875 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
9876 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
9877 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
9878 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
9879 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
9880 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
9881 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
9882 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
9883 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
9884 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
9885 #: build/C/man7/pthreads.7:833
9886 #, no-wrap
9887 msgid "-"
9888 msgstr "-"
9889
9890 #. type: Plain text
9891 #: build/C/man7/pthreads.7:41
9892 msgid "process ID"
9893 msgstr "プロセス ID"
9894
9895 #. type: Plain text
9896 #: build/C/man7/pthreads.7:43
9897 msgid "parent process ID"
9898 msgstr "親プロセス ID"
9899
9900 #. type: Plain text
9901 #: build/C/man7/pthreads.7:45
9902 msgid "process group ID and session ID"
9903 msgstr "プロセスグループ ID とセッション ID"
9904
9905 #. type: Plain text
9906 #: build/C/man7/pthreads.7:47
9907 msgid "controlling terminal"
9908 msgstr "制御端末"
9909
9910 #. type: Plain text
9911 #: build/C/man7/pthreads.7:49
9912 msgid "user and group IDs"
9913 msgstr "ユーザ ID とグループ ID"
9914
9915 #. type: Plain text
9916 #: build/C/man7/pthreads.7:51
9917 msgid "open file descriptors"
9918 msgstr "オープンするファイルディスクリプタ"
9919
9920 #. type: Plain text
9921 #: build/C/man7/pthreads.7:54
9922 msgid "record locks (see B<fcntl>(2))"
9923 msgstr "レコードのロック (B<fcntl>(3)  参照)"
9924
9925 #. type: Plain text
9926 #: build/C/man7/pthreads.7:56
9927 msgid "signal dispositions"
9928 msgstr "シグナルの配置"
9929
9930 #. type: Plain text
9931 #: build/C/man7/pthreads.7:59
9932 msgid "file mode creation mask (B<umask>(2))"
9933 msgstr "ファイルモード作成マスク (B<umask>(2))"
9934
9935 #. type: Plain text
9936 #: build/C/man7/pthreads.7:65
9937 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
9938 msgstr ""
9939 "カレント・ディレクトリ (B<chdir>(2))  とルート・ディレクトリ (B<chroot>(2))"
9940
9941 #. type: Plain text
9942 #: build/C/man7/pthreads.7:70
9943 msgid ""
9944 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
9945 msgstr ""
9946 "インターバル・タイマ (B<setitimer>(2))  と POSIX タイマ (B<timer_create>(2))"
9947
9948 #. type: Plain text
9949 #: build/C/man7/pthreads.7:73
9950 msgid "nice value (B<setpriority>(2))"
9951 msgstr "nice 値 (B<setpriority>(2))"
9952
9953 #. type: Plain text
9954 #: build/C/man7/pthreads.7:76
9955 msgid "resource limits (B<setrlimit>(2))"
9956 msgstr "リソース制限 (B<setrlimit>(2))"
9957
9958 #. type: Plain text
9959 #: build/C/man7/pthreads.7:81
9960 msgid ""
9961 "measurements of the consumption of CPU time (B<times>(2))  and resources "
9962 "(B<getrusage>(2))"
9963 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
9964
9965 #. type: Plain text
9966 #: build/C/man7/pthreads.7:84
9967 msgid ""
9968 "As well as the stack, POSIX.1 specifies that various other attributes are "
9969 "distinct for each thread, including:"
9970 msgstr ""
9971 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
9972 "るかを規定している:"
9973
9974 #. type: Plain text
9975 #: build/C/man7/pthreads.7:88
9976 msgid "thread ID (the I<pthread_t> data type)"
9977 msgstr "スレッド ID (B<pthread_t> データ型)"
9978
9979 #. type: Plain text
9980 #: build/C/man7/pthreads.7:91
9981 msgid "signal mask (B<pthread_sigmask>(3))"
9982 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
9983
9984 #. type: Plain text
9985 #: build/C/man7/pthreads.7:95
9986 msgid "the I<errno> variable"
9987 msgstr "I<errno> 変数"
9988
9989 #. type: Plain text
9990 #: build/C/man7/pthreads.7:98
9991 msgid "alternate signal stack (B<sigaltstack>(2))"
9992 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
9993
9994 #. type: Plain text
9995 #: build/C/man7/pthreads.7:101
9996 msgid "real-time scheduling policy and priority (B<sched>(7))"
9997 msgstr "リアルタイム・スケジューリングのポリシーと優先度 (B<sched>(7))"
9998
9999 #. type: Plain text
10000 #: build/C/man7/pthreads.7:103
10001 msgid "The following Linux-specific features are also per-thread:"
10002 msgstr "以下の Linux 特有の機能もスレッド単位である:"
10003
10004 #. type: Plain text
10005 #: build/C/man7/pthreads.7:106
10006 msgid "capabilities (see B<capabilities>(7))"
10007 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
10008
10009 #. type: Plain text
10010 #: build/C/man7/pthreads.7:109
10011 msgid "CPU affinity (B<sched_setaffinity>(2))"
10012 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
10013
10014 #. type: SS
10015 #: build/C/man7/pthreads.7:109
10016 #, no-wrap
10017 msgid "Pthreads function return values"
10018 msgstr "pthreads 関数の返り値"
10019
10020 #. type: Plain text
10021 #: build/C/man7/pthreads.7:116
10022 msgid ""
10023 "Most pthreads functions return 0 on success, and an error number of "
10024 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
10025 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
10026 "the function can never fail with the error B<EINTR>."
10027 msgstr ""
10028 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
10029 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
10030 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
10031 "は決してないと規定している。"
10032
10033 #. type: SS
10034 #: build/C/man7/pthreads.7:116
10035 #, no-wrap
10036 msgid "Thread IDs"
10037 msgstr "スレッド ID"
10038
10039 #. type: Plain text
10040 #: build/C/man7/pthreads.7:130
10041 msgid ""
10042 "Each of the threads in a process has a unique thread identifier (stored in "
10043 "the type I<pthread_t>).  This identifier is returned to the caller of "
10044 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
10045 "using B<pthread_self>(3).  Thread IDs are guaranteed to be unique only "
10046 "within a process.  A thread ID may be reused after a terminated thread has "
10047 "been joined, or a detached thread has terminated.  In all pthreads functions "
10048 "that accept a thread ID as an argument, that ID by definition refers to a "
10049 "thread in the same process as the caller."
10050 msgstr ""
10051 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
10052 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
10053 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
10054 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
10055 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
10056 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
10057 "じプロセス内の一つのスレッドを参照する。"
10058
10059 #. type: SS
10060 #: build/C/man7/pthreads.7:130
10061 #, no-wrap
10062 msgid "Thread-safe functions"
10063 msgstr "スレッドセーフな関数"
10064
10065 #. type: Plain text
10066 #: build/C/man7/pthreads.7:134
10067 msgid ""
10068 "A thread-safe function is one that can be safely (i.e., it will deliver the "
10069 "same results regardless of whether it is)  called from multiple threads at "
10070 "the same time."
10071 msgstr ""
10072 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
10073 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
10074
10075 #. type: Plain text
10076 #: build/C/man7/pthreads.7:138
10077 msgid ""
10078 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
10079 "standard shall be thread-safe, except for the following functions:"
10080 msgstr ""
10081 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
10082 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
10083
10084 #. type: Plain text
10085 #: build/C/man7/pthreads.7:232
10086 #, no-wrap
10087 msgid ""
10088 "asctime()\n"
10089 "basename()\n"
10090 "catgets()\n"
10091 "crypt()\n"
10092 "ctermid() if passed a non-NULL argument\n"
10093 "ctime()\n"
10094 "dbm_clearerr()\n"
10095 "dbm_close()\n"
10096 "dbm_delete()\n"
10097 "dbm_error()\n"
10098 "dbm_fetch()\n"
10099 "dbm_firstkey()\n"
10100 "dbm_nextkey()\n"
10101 "dbm_open()\n"
10102 "dbm_store()\n"
10103 "dirname()\n"
10104 "dlerror()\n"
10105 "drand48()\n"
10106 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10107 "encrypt()\n"
10108 "endgrent()\n"
10109 "endpwent()\n"
10110 "endutxent()\n"
10111 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10112 "ftw()\n"
10113 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10114 "getc_unlocked()\n"
10115 "getchar_unlocked()\n"
10116 "getdate()\n"
10117 "getenv()\n"
10118 "getgrent()\n"
10119 "getgrgid()\n"
10120 "getgrnam()\n"
10121 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10122 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10123 "gethostent()\n"
10124 "getlogin()\n"
10125 "getnetbyaddr()\n"
10126 "getnetbyname()\n"
10127 "getnetent()\n"
10128 "getopt()\n"
10129 "getprotobyname()\n"
10130 "getprotobynumber()\n"
10131 "getprotoent()\n"
10132 "getpwent()\n"
10133 "getpwnam()\n"
10134 "getpwuid()\n"
10135 "getservbyname()\n"
10136 "getservbyport()\n"
10137 "getservent()\n"
10138 "getutxent()\n"
10139 "getutxid()\n"
10140 "getutxline()\n"
10141 "gmtime()\n"
10142 "hcreate()\n"
10143 "hdestroy()\n"
10144 "hsearch()\n"
10145 "inet_ntoa()\n"
10146 "l64a()\n"
10147 "lgamma()\n"
10148 "lgammaf()\n"
10149 "lgammal()\n"
10150 "localeconv()\n"
10151 "localtime()\n"
10152 "lrand48()\n"
10153 "mrand48()\n"
10154 "nftw()\n"
10155 "nl_langinfo()\n"
10156 "ptsname()\n"
10157 "putc_unlocked()\n"
10158 "putchar_unlocked()\n"
10159 "putenv()\n"
10160 "pututxline()\n"
10161 "rand()\n"
10162 "readdir()\n"
10163 "setenv()\n"
10164 "setgrent()\n"
10165 "setkey()\n"
10166 "setpwent()\n"
10167 "setutxent()\n"
10168 "strerror()\n"
10169 "strsignal() [Added in POSIX.1-2008]\n"
10170 "strtok()\n"
10171 "system() [Added in POSIX.1-2008]\n"
10172 "tmpnam() if passed a non-NULL argument\n"
10173 "ttyname()\n"
10174 "unsetenv()\n"
10175 "wcrtomb() if its final argument is NULL\n"
10176 "wcsrtombs() if its final argument is NULL\n"
10177 "wcstombs()\n"
10178 "wctomb()\n"
10179 msgstr ""
10180 "asctime()\n"
10181 "basename()\n"
10182 "catgets()\n"
10183 "crypt()\n"
10184 "ctermid() (NULL でない引き数を渡された場合)\n"
10185 "ctime()\n"
10186 "dbm_clearerr()\n"
10187 "dbm_close()\n"
10188 "dbm_delete()\n"
10189 "dbm_error()\n"
10190 "dbm_fetch()\n"
10191 "dbm_firstkey()\n"
10192 "dbm_nextkey()\n"
10193 "dbm_open()\n"
10194 "dbm_store()\n"
10195 "dirname()\n"
10196 "dlerror()\n"
10197 "drand48()\n"
10198 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10199 "encrypt()\n"
10200 "endgrent()\n"
10201 "endpwent()\n"
10202 "endutxent()\n"
10203 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10204 "ftw()\n"
10205 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10206 "getc_unlocked()\n"
10207 "getchar_unlocked()\n"
10208 "getdate()\n"
10209 "getenv()\n"
10210 "getgrent()\n"
10211 "getgrgid()\n"
10212 "getgrnam()\n"
10213 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10214 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10215 "gethostent()\n"
10216 "getlogin()\n"
10217 "getnetbyaddr()\n"
10218 "getnetbyname()\n"
10219 "getnetent()\n"
10220 "getopt()\n"
10221 "getprotobyname()\n"
10222 "getprotobynumber()\n"
10223 "getprotoent()\n"
10224 "getpwent()\n"
10225 "getpwnam()\n"
10226 "getpwuid()\n"
10227 "getservbyname()\n"
10228 "getservbyport()\n"
10229 "getservent()\n"
10230 "getutxent()\n"
10231 "getutxid()\n"
10232 "getutxline()\n"
10233 "gmtime()\n"
10234 "hcreate()\n"
10235 "hdestroy()\n"
10236 "hsearch()\n"
10237 "inet_ntoa()\n"
10238 "l64a()\n"
10239 "lgamma()\n"
10240 "lgammaf()\n"
10241 "lgammal()\n"
10242 "localeconv()\n"
10243 "localtime()\n"
10244 "lrand48()\n"
10245 "mrand48()\n"
10246 "nftw()\n"
10247 "nl_langinfo()\n"
10248 "ptsname()\n"
10249 "putc_unlocked()\n"
10250 "putchar_unlocked()\n"
10251 "putenv()\n"
10252 "pututxline()\n"
10253 "rand()\n"
10254 "readdir()\n"
10255 "setenv()\n"
10256 "setgrent()\n"
10257 "setkey()\n"
10258 "setpwent()\n"
10259 "setutxent()\n"
10260 "strerror()\n"
10261 "strsignal() [POSIX.1-2008 で追加された]\n"
10262 "strtok()\n"
10263 "system() [POSIX.1-2008 で追加された]\n"
10264 "tmpnam() (NULL でない引き数を渡された場合)\n"
10265 "ttyname()\n"
10266 "unsetenv()\n"
10267 "wcrtomb() (最後の引き数が NULL の場合)\n"
10268 "wcsrtombs() (最後の引き数が NULL の場合)\n"
10269 "wcstombs()\n"
10270 "wctomb()\n"
10271
10272 #. type: SS
10273 #: build/C/man7/pthreads.7:234
10274 #, no-wrap
10275 msgid "Async-cancel-safe functions"
10276 msgstr "async-cancel-safe 関数"
10277
10278 #. type: Plain text
10279 #: build/C/man7/pthreads.7:238
10280 msgid ""
10281 "An async-cancel-safe function is one that can be safely called in an "
10282 "application where asynchronous cancelability is enabled (see "
10283 "B<pthread_setcancelstate>(3))."
10284 msgstr ""
10285 "async-cancel-safe 関数は、\n"
10286 "非同期キャンセル機能が有効になっているアプリケーションで\n"
10287 "安全に呼び出すことができる関数のことである\n"
10288 "(B<pthread_setcancelstate>(3) を参照)。"
10289
10290 #. type: Plain text
10291 #: build/C/man7/pthreads.7:241
10292 msgid ""
10293 "Only the following functions are required to be async-cancel-safe by "
10294 "POSIX.1-2001 and POSIX.1-2008:"
10295 msgstr ""
10296 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
10297 "なければならないとされている。"
10298
10299 #. type: Plain text
10300 #: build/C/man7/pthreads.7:247
10301 #, no-wrap
10302 msgid ""
10303 "pthread_cancel()\n"
10304 "pthread_setcancelstate()\n"
10305 "pthread_setcanceltype()\n"
10306 msgstr ""
10307 "pthread_cancel()\n"
10308 "pthread_setcancelstate()\n"
10309 "pthread_setcanceltype()\n"
10310
10311 #. type: SS
10312 #: build/C/man7/pthreads.7:249
10313 #, no-wrap
10314 msgid "Cancellation points"
10315 msgstr "取り消しポイント (cancellation points)"
10316
10317 #. type: Plain text
10318 #: build/C/man7/pthreads.7:256
10319 msgid ""
10320 "POSIX.1 specifies that certain functions must, and certain other functions "
10321 "may, be cancellation points.  If a thread is cancelable, its cancelability "
10322 "type is deferred, and a cancellation request is pending for the thread, then "
10323 "the thread is canceled when it calls a function that is a cancellation point."
10324 msgstr ""
10325 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
10326 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
10327 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
10328 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
10329 "時点で、そのスレッドのキャンセルが 行われる。"
10330
10331 #. type: Plain text
10332 #: build/C/man7/pthreads.7:259
10333 msgid ""
10334 "The following functions are required to be cancellation points by "
10335 "POSIX.1-2001 and/or POSIX.1-2008:"
10336 msgstr ""
10337 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
10338 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
10339
10340 #. type: Plain text
10341 #: build/C/man7/pthreads.7:322
10342 #, no-wrap
10343 msgid ""
10344 "accept()\n"
10345 "aio_suspend()\n"
10346 "clock_nanosleep()\n"
10347 "close()\n"
10348 "connect()\n"
10349 "creat()\n"
10350 "fcntl() F_SETLKW\n"
10351 "fdatasync()\n"
10352 "fsync()\n"
10353 "getmsg()\n"
10354 "getpmsg()\n"
10355 "lockf() F_LOCK\n"
10356 "mq_receive()\n"
10357 "mq_send()\n"
10358 "mq_timedreceive()\n"
10359 "mq_timedsend()\n"
10360 "msgrcv()\n"
10361 "msgsnd()\n"
10362 "msync()\n"
10363 "nanosleep()\n"
10364 "open()\n"
10365 "openat() [Added in POSIX.1-2008]\n"
10366 "pause()\n"
10367 "poll()\n"
10368 "pread()\n"
10369 "pselect()\n"
10370 "pthread_cond_timedwait()\n"
10371 "pthread_cond_wait()\n"
10372 "pthread_join()\n"
10373 "pthread_testcancel()\n"
10374 "putmsg()\n"
10375 "putpmsg()\n"
10376 "pwrite()\n"
10377 "read()\n"
10378 "readv()\n"
10379 "recv()\n"
10380 "recvfrom()\n"
10381 "recvmsg()\n"
10382 "select()\n"
10383 "sem_timedwait()\n"
10384 "sem_wait()\n"
10385 "send()\n"
10386 "sendmsg()\n"
10387 "sendto()\n"
10388 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
10389 "sigsuspend()\n"
10390 "sigtimedwait()\n"
10391 "sigwait()\n"
10392 "sigwaitinfo()\n"
10393 "sleep()\n"
10394 "system()\n"
10395 "tcdrain()\n"
10396 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10397 "wait()\n"
10398 "waitid()\n"
10399 "waitpid()\n"
10400 "write()\n"
10401 "writev()\n"
10402 msgstr ""
10403 "accept()\n"
10404 "aio_suspend()\n"
10405 "clock_nanosleep()\n"
10406 "close()\n"
10407 "connect()\n"
10408 "creat()\n"
10409 "fcntl() F_SETLKW\n"
10410 "fdatasync()\n"
10411 "fsync()\n"
10412 "getmsg()\n"
10413 "getpmsg()\n"
10414 "lockf() F_LOCK\n"
10415 "mq_receive()\n"
10416 "mq_send()\n"
10417 "mq_timedreceive()\n"
10418 "mq_timedsend()\n"
10419 "msgrcv()\n"
10420 "msgsnd()\n"
10421 "msync()\n"
10422 "nanosleep()\n"
10423 "open()\n"
10424 "openat() [POSIX.1-2008 で追加された]\n"
10425 "pause()\n"
10426 "poll()\n"
10427 "pread()\n"
10428 "pselect()\n"
10429 "pthread_cond_timedwait()\n"
10430 "pthread_cond_wait()\n"
10431 "pthread_join()\n"
10432 "pthread_testcancel()\n"
10433 "putmsg()\n"
10434 "putpmsg()\n"
10435 "pwrite()\n"
10436 "read()\n"
10437 "readv()\n"
10438 "recv()\n"
10439 "recvfrom()\n"
10440 "recvmsg()\n"
10441 "select()\n"
10442 "sem_timedwait()\n"
10443 "sem_wait()\n"
10444 "send()\n"
10445 "sendmsg()\n"
10446 "sendto()\n"
10447 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
10448 "sigsuspend()\n"
10449 "sigtimedwait()\n"
10450 "sigwait()\n"
10451 "sigwaitinfo()\n"
10452 "sleep()\n"
10453 "system()\n"
10454 "tcdrain()\n"
10455 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10456 "wait()\n"
10457 "waitid()\n"
10458 "waitpid()\n"
10459 "write()\n"
10460 "writev()\n"
10461
10462 #. type: Plain text
10463 #: build/C/man7/pthreads.7:327
10464 msgid ""
10465 "The following functions may be cancellation points according to POSIX.1-2001 "
10466 "and/or POSIX.1-2008:"
10467 msgstr ""
10468 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
10469 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
10470
10471 #. type: Plain text
10472 #: build/C/man7/pthreads.7:555
10473 #, no-wrap
10474 msgid ""
10475 "access()\n"
10476 "asctime()\n"
10477 "asctime_r()\n"
10478 "catclose()\n"
10479 "catgets()\n"
10480 "catopen()\n"
10481 "chmod() [Added in POSIX.1-2008]\n"
10482 "chown() [Added in POSIX.1-2008]\n"
10483 "closedir()\n"
10484 "closelog()\n"
10485 "ctermid()\n"
10486 "ctime()\n"
10487 "ctime_r()\n"
10488 "dbm_close()\n"
10489 "dbm_delete()\n"
10490 "dbm_fetch()\n"
10491 "dbm_nextkey()\n"
10492 "dbm_open()\n"
10493 "dbm_store()\n"
10494 "dlclose()\n"
10495 "dlopen()\n"
10496 "dprintf() [Added in POSIX.1-2008]\n"
10497 "endgrent()\n"
10498 "endhostent()\n"
10499 "endnetent()\n"
10500 "endprotoent()\n"
10501 "endpwent()\n"
10502 "endservent()\n"
10503 "endutxent()\n"
10504 "faccessat() [Added in POSIX.1-2008]\n"
10505 "fchmod() [Added in POSIX.1-2008]\n"
10506 "fchmodat() [Added in POSIX.1-2008]\n"
10507 "fchown() [Added in POSIX.1-2008]\n"
10508 "fchownat() [Added in POSIX.1-2008]\n"
10509 "fclose()\n"
10510 "fcntl() (for any value of cmd argument)\n"
10511 "fflush()\n"
10512 "fgetc()\n"
10513 "fgetpos()\n"
10514 "fgets()\n"
10515 "fgetwc()\n"
10516 "fgetws()\n"
10517 "fmtmsg()\n"
10518 "fopen()\n"
10519 "fpathconf()\n"
10520 "fprintf()\n"
10521 "fputc()\n"
10522 "fputs()\n"
10523 "fputwc()\n"
10524 "fputws()\n"
10525 "fread()\n"
10526 "freopen()\n"
10527 "fscanf()\n"
10528 "fseek()\n"
10529 "fseeko()\n"
10530 "fsetpos()\n"
10531 "fstat()\n"
10532 "fstatat() [Added in POSIX.1-2008]\n"
10533 "ftell()\n"
10534 "ftello()\n"
10535 "ftw()\n"
10536 "futimens() [Added in POSIX.1-2008]\n"
10537 "fwprintf()\n"
10538 "fwrite()\n"
10539 "fwscanf()\n"
10540 "getaddrinfo()\n"
10541 "getc()\n"
10542 "getc_unlocked()\n"
10543 "getchar()\n"
10544 "getchar_unlocked()\n"
10545 "getcwd()\n"
10546 "getdate()\n"
10547 "getdelim() [Added in POSIX.1-2008]\n"
10548 "getgrent()\n"
10549 "getgrgid()\n"
10550 "getgrgid_r()\n"
10551 "getgrnam()\n"
10552 "getgrnam_r()\n"
10553 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10554 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10555 "gethostent()\n"
10556 "gethostid()\n"
10557 "gethostname()\n"
10558 "getline() [Added in POSIX.1-2008]\n"
10559 "getlogin()\n"
10560 "getlogin_r()\n"
10561 "getnameinfo()\n"
10562 "getnetbyaddr()\n"
10563 "getnetbyname()\n"
10564 "getnetent()\n"
10565 "getopt() (if opterr is nonzero)\n"
10566 "getprotobyname()\n"
10567 "getprotobynumber()\n"
10568 "getprotoent()\n"
10569 "getpwent()\n"
10570 "getpwnam()\n"
10571 "getpwnam_r()\n"
10572 "getpwuid()\n"
10573 "getpwuid_r()\n"
10574 "gets()\n"
10575 "getservbyname()\n"
10576 "getservbyport()\n"
10577 "getservent()\n"
10578 "getutxent()\n"
10579 "getutxid()\n"
10580 "getutxline()\n"
10581 "getwc()\n"
10582 "getwchar()\n"
10583 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10584 "glob()\n"
10585 "iconv_close()\n"
10586 "iconv_open()\n"
10587 "ioctl()\n"
10588 "link()\n"
10589 "linkat() [Added in POSIX.1-2008]\n"
10590 "lio_listio() [Added in POSIX.1-2008]\n"
10591 "localtime()\n"
10592 "localtime_r()\n"
10593 "lockf() [Added in POSIX.1-2008]\n"
10594 "lseek()\n"
10595 "lstat()\n"
10596 "mkdir() [Added in POSIX.1-2008]\n"
10597 "mkdirat() [Added in POSIX.1-2008]\n"
10598 "mkdtemp() [Added in POSIX.1-2008]\n"
10599 "mkfifo() [Added in POSIX.1-2008]\n"
10600 "mkfifoat() [Added in POSIX.1-2008]\n"
10601 "mknod() [Added in POSIX.1-2008]\n"
10602 "mknodat() [Added in POSIX.1-2008]\n"
10603 "mkstemp()\n"
10604 "mktime()\n"
10605 "nftw()\n"
10606 "opendir()\n"
10607 "openlog()\n"
10608 "pathconf()\n"
10609 "pclose()\n"
10610 "perror()\n"
10611 "popen()\n"
10612 "posix_fadvise()\n"
10613 "posix_fallocate()\n"
10614 "posix_madvise()\n"
10615 "posix_openpt()\n"
10616 "posix_spawn()\n"
10617 "posix_spawnp()\n"
10618 "posix_trace_clear()\n"
10619 "posix_trace_close()\n"
10620 "posix_trace_create()\n"
10621 "posix_trace_create_withlog()\n"
10622 "posix_trace_eventtypelist_getnext_id()\n"
10623 "posix_trace_eventtypelist_rewind()\n"
10624 "posix_trace_flush()\n"
10625 "posix_trace_get_attr()\n"
10626 "posix_trace_get_filter()\n"
10627 "posix_trace_get_status()\n"
10628 "posix_trace_getnext_event()\n"
10629 "posix_trace_open()\n"
10630 "posix_trace_rewind()\n"
10631 "posix_trace_set_filter()\n"
10632 "posix_trace_shutdown()\n"
10633 "posix_trace_timedgetnext_event()\n"
10634 "posix_typed_mem_open()\n"
10635 "printf()\n"
10636 "psiginfo() [Added in POSIX.1-2008]\n"
10637 "psignal() [Added in POSIX.1-2008]\n"
10638 "pthread_rwlock_rdlock()\n"
10639 "pthread_rwlock_timedrdlock()\n"
10640 "pthread_rwlock_timedwrlock()\n"
10641 "pthread_rwlock_wrlock()\n"
10642 "putc()\n"
10643 "putc_unlocked()\n"
10644 "putchar()\n"
10645 "putchar_unlocked()\n"
10646 "puts()\n"
10647 "pututxline()\n"
10648 "putwc()\n"
10649 "putwchar()\n"
10650 "readdir()\n"
10651 "readdir_r()\n"
10652 "readlink() [Added in POSIX.1-2008]\n"
10653 "readlinkat() [Added in POSIX.1-2008]\n"
10654 "remove()\n"
10655 "rename()\n"
10656 "renameat() [Added in POSIX.1-2008]\n"
10657 "rewind()\n"
10658 "rewinddir()\n"
10659 "scandir() [Added in POSIX.1-2008]\n"
10660 "scanf()\n"
10661 "seekdir()\n"
10662 "semop()\n"
10663 "setgrent()\n"
10664 "sethostent()\n"
10665 "setnetent()\n"
10666 "setprotoent()\n"
10667 "setpwent()\n"
10668 "setservent()\n"
10669 "setutxent()\n"
10670 "sigpause() [Added in POSIX.1-2008]\n"
10671 "stat()\n"
10672 "strerror()\n"
10673 "strerror_r()\n"
10674 "strftime()\n"
10675 "symlink()\n"
10676 "symlinkat() [Added in POSIX.1-2008]\n"
10677 "sync()\n"
10678 "syslog()\n"
10679 "tmpfile()\n"
10680 "tmpnam()\n"
10681 "ttyname()\n"
10682 "ttyname_r()\n"
10683 "tzset()\n"
10684 "ungetc()\n"
10685 "ungetwc()\n"
10686 "unlink()\n"
10687 "unlinkat() [Added in POSIX.1-2008]\n"
10688 "utime() [Added in POSIX.1-2008]\n"
10689 "utimensat() [Added in POSIX.1-2008]\n"
10690 "utimes() [Added in POSIX.1-2008]\n"
10691 "vdprintf() [Added in POSIX.1-2008]\n"
10692 "vfprintf()\n"
10693 "vfwprintf()\n"
10694 "vprintf()\n"
10695 "vwprintf()\n"
10696 "wcsftime()\n"
10697 "wordexp()\n"
10698 "wprintf()\n"
10699 "wscanf()\n"
10700 msgstr ""
10701 "access()\n"
10702 "asctime()\n"
10703 "asctime_r()\n"
10704 "catclose()\n"
10705 "catgets()\n"
10706 "catopen()\n"
10707 "chmod() [POSIX.1-2008 で追加された]\n"
10708 "chown() [POSIX.1-2008 で追加された]\n"
10709 "closedir()\n"
10710 "closelog()\n"
10711 "ctermid()\n"
10712 "ctime()\n"
10713 "ctime_r()\n"
10714 "dbm_close()\n"
10715 "dbm_delete()\n"
10716 "dbm_fetch()\n"
10717 "dbm_nextkey()\n"
10718 "dbm_open()\n"
10719 "dbm_store()\n"
10720 "dlclose()\n"
10721 "dlopen()\n"
10722 "dprintf() [POSIX.1-2008 で追加された]\n"
10723 "endgrent()\n"
10724 "endhostent()\n"
10725 "endnetent()\n"
10726 "endprotoent()\n"
10727 "endpwent()\n"
10728 "endservent()\n"
10729 "endutxent()\n"
10730 "faccessat() [POSIX.1-2008 で追加された]\n"
10731 "fchmod() [POSIX.1-2008 で追加された]\n"
10732 "fchmodat() [POSIX.1-2008 で追加された]\n"
10733 "fchown() [POSIX.1-2008 で追加された]\n"
10734 "fchownat() [POSIX.1-2008 で追加された]\n"
10735 "fclose()\n"
10736 "fcntl() (cmd 引き数が何であっても)\n"
10737 "fflush()\n"
10738 "fgetc()\n"
10739 "fgetpos()\n"
10740 "fgets()\n"
10741 "fgetwc()\n"
10742 "fgetws()\n"
10743 "fmtmsg()\n"
10744 "fopen()\n"
10745 "fpathconf()\n"
10746 "fprintf()\n"
10747 "fputc()\n"
10748 "fputs()\n"
10749 "fputwc()\n"
10750 "fputws()\n"
10751 "fread()\n"
10752 "freopen()\n"
10753 "fscanf()\n"
10754 "fseek()\n"
10755 "fseeko()\n"
10756 "fsetpos()\n"
10757 "fstat()\n"
10758 "fstatat() [POSIX.1-2008 で追加された]\n"
10759 "ftell()\n"
10760 "ftello()\n"
10761 "ftw()\n"
10762 "futimens() [POSIX.1-2008 で追加された]\n"
10763 "fwprintf()\n"
10764 "fwrite()\n"
10765 "fwscanf()\n"
10766 "getaddrinfo()\n"
10767 "getc()\n"
10768 "getc_unlocked()\n"
10769 "getchar()\n"
10770 "getchar_unlocked()\n"
10771 "getcwd()\n"
10772 "getdate()\n"
10773 "getdelim() [POSIX.1-2008 で追加された]\n"
10774 "getgrent()\n"
10775 "getgrgid()\n"
10776 "getgrgid_r()\n"
10777 "getgrnam()\n"
10778 "getgrnam_r()\n"
10779 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
10780 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
10781 "gethostent()\n"
10782 "gethostid()\n"
10783 "gethostname()\n"
10784 "getline() [POSIX.1-2008 で追加された]\n"
10785 "getlogin()\n"
10786 "getlogin_r()\n"
10787 "getnameinfo()\n"
10788 "getnetbyaddr()\n"
10789 "getnetbyname()\n"
10790 "getnetent()\n"
10791 "getopt() (opterr が 0 以外の場合)\n"
10792 "getprotobyname()\n"
10793 "getprotobynumber()\n"
10794 "getprotoent()\n"
10795 "getpwent()\n"
10796 "getpwnam()\n"
10797 "getpwnam_r()\n"
10798 "getpwuid()\n"
10799 "getpwuid_r()\n"
10800 "gets()\n"
10801 "getservbyname()\n"
10802 "getservbyport()\n"
10803 "getservent()\n"
10804 "getutxent()\n"
10805 "getutxid()\n"
10806 "getutxline()\n"
10807 "getwc()\n"
10808 "getwchar()\n"
10809 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
10810 "glob()\n"
10811 "iconv_close()\n"
10812 "iconv_open()\n"
10813 "ioctl()\n"
10814 "link()\n"
10815 "linkat() [POSIX.1-2008 で追加された]\n"
10816 "lio_listio() [POSIX.1-2008 で追加された]\n"
10817 "localtime()\n"
10818 "localtime_r()\n"
10819 "lockf() [POSIX.1-2008 で追加された]\n"
10820 "lseek()\n"
10821 "lstat()\n"
10822 "mkdir() [POSIX.1-2008 で追加された]\n"
10823 "mkdirat() [POSIX.1-2008 で追加された]\n"
10824 "mkdtemp() [POSIX.1-2008 で追加された]\n"
10825 "mkfifo() [POSIX.1-2008 で追加された]\n"
10826 "mkfifoat() [POSIX.1-2008 で追加された]\n"
10827 "mknod() [POSIX.1-2008 で追加された]\n"
10828 "mknodat() [POSIX.1-2008 で追加された]\n"
10829 "mkstemp()\n"
10830 "mktime()\n"
10831 "nftw()\n"
10832 "opendir()\n"
10833 "openlog()\n"
10834 "pathconf()\n"
10835 "pclose()\n"
10836 "perror()\n"
10837 "popen()\n"
10838 "posix_fadvise()\n"
10839 "posix_fallocate()\n"
10840 "posix_madvise()\n"
10841 "posix_openpt()\n"
10842 "posix_spawn()\n"
10843 "posix_spawnp()\n"
10844 "posix_trace_clear()\n"
10845 "posix_trace_close()\n"
10846 "posix_trace_create()\n"
10847 "posix_trace_create_withlog()\n"
10848 "posix_trace_eventtypelist_getnext_id()\n"
10849 "posix_trace_eventtypelist_rewind()\n"
10850 "posix_trace_flush()\n"
10851 "posix_trace_get_attr()\n"
10852 "posix_trace_get_filter()\n"
10853 "posix_trace_get_status()\n"
10854 "posix_trace_getnext_event()\n"
10855 "posix_trace_open()\n"
10856 "posix_trace_rewind()\n"
10857 "posix_trace_set_filter()\n"
10858 "posix_trace_shutdown()\n"
10859 "posix_trace_timedgetnext_event()\n"
10860 "posix_typed_mem_open()\n"
10861 "printf()\n"
10862 "psiginfo() [POSIX.1-2008 で追加された]\n"
10863 "psignal() [POSIX.1-2008 で追加された]\n"
10864 "pthread_rwlock_rdlock()\n"
10865 "pthread_rwlock_timedrdlock()\n"
10866 "pthread_rwlock_timedwrlock()\n"
10867 "pthread_rwlock_wrlock()\n"
10868 "putc()\n"
10869 "putc_unlocked()\n"
10870 "putchar()\n"
10871 "putchar_unlocked()\n"
10872 "puts()\n"
10873 "pututxline()\n"
10874 "putwc()\n"
10875 "putwchar()\n"
10876 "readdir()\n"
10877 "readdir_r()\n"
10878 "readlink() [POSIX.1-2008 で追加された]\n"
10879 "readlinkat() [POSIX.1-2008 で追加された]\n"
10880 "remove()\n"
10881 "rename()\n"
10882 "renameat() [POSIX.1-2008 で追加された]\n"
10883 "rewind()\n"
10884 "rewinddir()\n"
10885 "scandir() [POSIX.1-2008 で追加された]\n"
10886 "scanf()\n"
10887 "seekdir()\n"
10888 "semop()\n"
10889 "setgrent()\n"
10890 "sethostent()\n"
10891 "setnetent()\n"
10892 "setprotoent()\n"
10893 "setpwent()\n"
10894 "setservent()\n"
10895 "setutxent()\n"
10896 "sigpause() [POSIX.1-2008 で追加された]\n"
10897 "stat()\n"
10898 "strerror()\n"
10899 "strerror_r()\n"
10900 "strftime()\n"
10901 "symlink()\n"
10902 "symlinkat() [POSIX.1-2008 で追加された]\n"
10903 "sync()\n"
10904 "syslog()\n"
10905 "tmpfile()\n"
10906 "tmpnam()\n"
10907 "ttyname()\n"
10908 "ttyname_r()\n"
10909 "tzset()\n"
10910 "ungetc()\n"
10911 "ungetwc()\n"
10912 "unlink()\n"
10913 "unlinkat() [POSIX.1-2008 で追加された]\n"
10914 "utime() [POSIX.1-2008 で追加された]\n"
10915 "utimensat() [POSIX.1-2008 で追加された]\n"
10916 "utimes() [POSIX.1-2008 で追加された]\n"
10917 "vdprintf() [POSIX.1-2008 で追加された]\n"
10918 "vfprintf()\n"
10919 "vfwprintf()\n"
10920 "vprintf()\n"
10921 "vwprintf()\n"
10922 "wcsftime()\n"
10923 "wordexp()\n"
10924 "wprintf()\n"
10925 "wscanf()\n"
10926
10927 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
10928 #.  files, it looks as though at least the following nonstandard
10929 #.  functions are cancellation points:
10930 #.  endnetgrent
10931 #.  endspent
10932 #.  epoll_pwait
10933 #.  epoll_wait
10934 #.  fcloseall
10935 #.  fdopendir
10936 #.  fflush_unlocked
10937 #.  fgetc_unlocked
10938 #.  fgetgrent
10939 #.  fgetgrent_r
10940 #.  fgetpwent
10941 #.  fgetpwent_r
10942 #.  fgets_unlocked
10943 #.  fgetspent
10944 #.  fgetspent_r
10945 #.  fgetwc_unlocked
10946 #.  fgetws_unlocked
10947 #.  fputc_unlocked
10948 #.  fputs_unlocked
10949 #.  fputwc_unlocked
10950 #.  fputws_unlocked
10951 #.  fread_unlocked
10952 #.  fwrite_unlocked
10953 #.  gai_suspend
10954 #.  getaddrinfo_a
10955 #.  getdate_r
10956 #.  getgrent_r
10957 #.  getgrouplist
10958 #.  gethostbyaddr_r
10959 #.  gethostbyname2
10960 #.  gethostbyname2_r
10961 #.  gethostbyname_r
10962 #.  gethostent_r
10963 #.  getnetbyaddr_r
10964 #.  getnetbyname_r
10965 #.  getnetent_r
10966 #.  getnetgrent
10967 #.  getnetgrent_r
10968 #.  getprotobyname_r
10969 #.  getprotobynumber_r
10970 #.  getprotoent_r
10971 #.  getpw
10972 #.  getpwent_r
10973 #.  getservbyname_r
10974 #.  getservbyport_r
10975 #.  getservent_r
10976 #.  getspent
10977 #.  getspent_r
10978 #.  getspnam
10979 #.  getspnam_r
10980 #.  getutmp
10981 #.  getutmpx
10982 #.  getw
10983 #.  getwc_unlocked
10984 #.  getwchar_unlocked
10985 #.  initgroups
10986 #.  innetgr
10987 #.  mkostemp
10988 #.  mkostemp64
10989 #.  mkstemp64
10990 #.  ppoll
10991 #.  pthread_timedjoin_np
10992 #.  putgrent
10993 #.  putpwent
10994 #.  putspent
10995 #.  putw
10996 #.  putwc_unlocked
10997 #.  putwchar_unlocked
10998 #.  rcmd
10999 #.  rcmd_af
11000 #.  rexec
11001 #.  rexec_af
11002 #.  rresvport
11003 #.  rresvport_af
11004 #.  ruserok
11005 #.  ruserok_af
11006 #.  setnetgrent
11007 #.  setspent
11008 #.  sgetspent
11009 #.  sgetspent_r
11010 #.  updwtmpx
11011 #.  utmpxname
11012 #.  vfscanf
11013 #.  vfwscanf
11014 #.  vscanf
11015 #.  vsyslog
11016 #.  vwscanf
11017 #. type: Plain text
11018 #: build/C/man7/pthreads.7:653
11019 msgid ""
11020 "An implementation may also mark other functions not specified in the "
11021 "standard as cancellation points.  In particular, an implementation is likely "
11022 "to mark any nonstandard function that may block as a cancellation point.  "
11023 "(This includes most functions that can touch files.)"
11024 msgstr ""
11025 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
11026 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
11027 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
11028 "関数がこれに含まれる)。"
11029
11030 #. type: SS
11031 #: build/C/man7/pthreads.7:653
11032 #, no-wrap
11033 msgid "Compiling on Linux"
11034 msgstr "Linux でのコンパイル"
11035
11036 #. type: Plain text
11037 #: build/C/man7/pthreads.7:656
11038 msgid ""
11039 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
11040 "pthread>."
11041 msgstr ""
11042 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
11043 "きである。"
11044
11045 #. type: SS
11046 #: build/C/man7/pthreads.7:656
11047 #, no-wrap
11048 msgid "Linux implementations of POSIX threads"
11049 msgstr "POSIX スレッドの Linux での実装"
11050
11051 #. type: Plain text
11052 #: build/C/man7/pthreads.7:659
11053 msgid ""
11054 "Over time, two threading implementations have been provided by the GNU C "
11055 "library on Linux:"
11056 msgstr ""
11057 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
11058 "た。"
11059
11060 #. type: TP
11061 #: build/C/man7/pthreads.7:659
11062 #, no-wrap
11063 msgid "B<LinuxThreads>"
11064 msgstr "B<LinuxThreads>"
11065
11066 #. type: Plain text
11067 #: build/C/man7/pthreads.7:663
11068 msgid ""
11069 "This is the original Pthreads implementation.  Since glibc 2.4, this "
11070 "implementation is no longer supported."
11071 msgstr ""
11072 "最初の Pthreads の実装。\n"
11073 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
11074
11075 #. type: TP
11076 #: build/C/man7/pthreads.7:663
11077 #, no-wrap
11078 msgid "B<NPTL> (Native POSIX Threads Library)"
11079 msgstr "B<NPTL> (Native POSIX Threads Library)"
11080
11081 #. type: Plain text
11082 #: build/C/man7/pthreads.7:671
11083 msgid ""
11084 "This is the modern Pthreads implementation.  By comparison with "
11085 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
11086 "POSIX.1 specification and better performance when creating large numbers of "
11087 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
11088 "are present in the Linux 2.6 kernel."
11089 msgstr ""
11090 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
11091 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
11092 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
11093 "装されている機能が必要である。"
11094
11095 #. type: Plain text
11096 #: build/C/man7/pthreads.7:681
11097 msgid ""
11098 "Both of these are so-called 1:1 implementations, meaning that each thread "
11099 "maps to a kernel scheduling entity.  Both threading implementations employ "
11100 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
11101 "primitives (mutexes, thread joining, and so on) are implemented using the "
11102 "Linux B<futex>(2)  system call."
11103 msgstr ""
11104 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
11105 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
11106 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
11107 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
11108 "使って実装されている。"
11109
11110 #. type: SS
11111 #: build/C/man7/pthreads.7:681
11112 #, no-wrap
11113 msgid "LinuxThreads"
11114 msgstr "LinuxThreads"
11115
11116 #. type: Plain text
11117 #: build/C/man7/pthreads.7:683
11118 msgid "The notable features of this implementation are the following:"
11119 msgstr "この実装の大きな特徴は以下の通りである:"
11120
11121 #. type: Plain text
11122 #: build/C/man7/pthreads.7:690
11123 msgid ""
11124 "In addition to the main (initial) thread, and the threads that the program "
11125 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
11126 "thread.  This thread handles thread creation and termination.  (Problems can "
11127 "result if this thread is inadvertently killed.)"
11128 msgstr ""
11129 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
11130 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
11131 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
11132 "kill されると、問題が起こることがある)。"
11133
11134 #. type: Plain text
11135 #: build/C/man7/pthreads.7:702
11136 msgid ""
11137 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
11138 "the first three real-time signals are used (see also B<signal>(7)).  On "
11139 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
11140 "avoid the use of whichever set of signals is employed by the implementation."
11141 msgstr ""
11142 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
11143 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
11144 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
11145 "用されているシグナルを どれも使わないようにしなければならない。"
11146
11147 #. type: Plain text
11148 #: build/C/man7/pthreads.7:709
11149 msgid ""
11150 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
11151 "implemented as processes which share more information than usual, but which "
11152 "do not share a common process ID.)  LinuxThreads threads (including the "
11153 "manager thread)  are visible as separate processes using B<ps>(1)."
11154 msgstr ""
11155 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
11156 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
11157 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
11158 "を使うと別のプロセスのように見える。"
11159
11160 #. type: Plain text
11161 #: build/C/man7/pthreads.7:712
11162 msgid ""
11163 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
11164 "number of ways, including the following:"
11165 msgstr ""
11166 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
11167 "示すような点がある:"
11168
11169 #. type: Plain text
11170 #: build/C/man7/pthreads.7:716
11171 msgid "Calls to B<getpid>(2)  return a different value in each thread."
11172 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
11173
11174 #. type: Plain text
11175 #: build/C/man7/pthreads.7:725
11176 msgid ""
11177 "Calls to B<getppid>(2)  in threads other than the main thread return the "
11178 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
11179 "should return the same value as B<getppid>(2)  in the main thread."
11180 msgstr ""
11181 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
11182 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
11183 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
11184
11185 #. type: Plain text
11186 #: build/C/man7/pthreads.7:735
11187 msgid ""
11188 "When one thread creates a new child process using B<fork>(2), any thread "
11189 "should be able to B<wait>(2)  on the child.  However, the implementation "
11190 "only allows the thread that created the child to B<wait>(2)  on it."
11191 msgstr ""
11192 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
11193 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
11194 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
11195 "る。"
11196
11197 #. type: Plain text
11198 #: build/C/man7/pthreads.7:742
11199 msgid ""
11200 "When a thread calls B<execve>(2), all other threads are terminated (as "
11201 "required by POSIX.1).  However, the resulting process has the same PID as "
11202 "the thread that called B<execve>(2): it should have the same PID as the main "
11203 "thread."
11204 msgstr ""
11205 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
11206 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
11207 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
11208 "る。"
11209
11210 #. type: Plain text
11211 #: build/C/man7/pthreads.7:749
11212 msgid ""
11213 "Threads do not share user and group IDs.  This can cause complications with "
11214 "set-user-ID programs and can cause failures in Pthreads functions if an "
11215 "application changes its credentials using B<seteuid>(2)  or similar."
11216 msgstr ""
11217 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
11218 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使っ"
11219 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
11220
11221 #. type: Plain text
11222 #: build/C/man7/pthreads.7:751
11223 msgid "Threads do not share a common session ID and process group ID."
11224 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
11225
11226 #. type: Plain text
11227 #: build/C/man7/pthreads.7:754
11228 msgid "Threads do not share record locks created using B<fcntl>(2)."
11229 msgstr ""
11230 "スレッド間で B<fcntl>(2)  を使って作成されるレコード・ロックを共有しない。"
11231
11232 #. type: Plain text
11233 #: build/C/man7/pthreads.7:760
11234 msgid ""
11235 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
11236 "rather than process-wide."
11237 msgstr ""
11238 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
11239 "単位の情報である。"
11240
11241 #. type: Plain text
11242 #: build/C/man7/pthreads.7:763
11243 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
11244 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
11245
11246 #. type: Plain text
11247 #: build/C/man7/pthreads.7:765
11248 msgid "Threads do not share interval timers."
11249 msgstr "スレッド間でインターバル・タイマを共有しない。"
11250
11251 #.  FIXME . bug report filed for NPTL nice nonconformance
11252 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
11253 #.  Sep 08: there is a patch by Denys Vlasenko to address this
11254 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
11255 #.  Monitor this to see if it makes it into mainline.
11256 #. type: Plain text
11257 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
11258 msgid "Threads do not share a common nice value."
11259 msgstr "スレッドは共通の nice 値を共有しない。"
11260
11261 #. type: Plain text
11262 #: build/C/man7/pthreads.7:777
11263 msgid ""
11264 "POSIX.1 distinguishes the notions of signals that are directed to the "
11265 "process as a whole and signals that are directed to individual threads.  "
11266 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
11267 "example) should be handled by a single, arbitrarily selected thread within "
11268 "the process.  LinuxThreads does not support the notion of process-directed "
11269 "signals: signals may be sent only to specific threads."
11270 msgstr ""
11271 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
11272 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
11273 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
11274 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
11275 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
11276 "ルは特定のスレッドにだけ送ることができる。"
11277
11278 #. type: Plain text
11279 #: build/C/man7/pthreads.7:786
11280 msgid ""
11281 "Threads have distinct alternate signal stack settings.  However, a new "
11282 "thread's alternate signal stack settings are copied from the thread that "
11283 "created it, so that the threads initially share an alternate signal stack.  "
11284 "(A new thread should start with no alternate signal stack defined.  If two "
11285 "threads handle signals on their shared alternate signal stack at the same "
11286 "time, unpredictable program failures are likely to occur.)"
11287 msgstr ""
11288 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
11289 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
11290 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
11291 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
11292 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
11293 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
11294
11295 #. type: SS
11296 #: build/C/man7/pthreads.7:786
11297 #, no-wrap
11298 msgid "NPTL"
11299 msgstr "NPTL"
11300
11301 #. type: Plain text
11302 #: build/C/man7/pthreads.7:795
11303 msgid ""
11304 "With NPTL, all of the threads in a process are placed in the same thread "
11305 "group; all members of a thread group share the same PID.  NPTL does not "
11306 "employ a manager thread.  NPTL makes internal use of the first two real-time "
11307 "signals (see also B<signal>(7)); these signals cannot be used in "
11308 "applications."
11309 msgstr ""
11310 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
11311 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
11312 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
11313 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
11314 "ションでは使用できない。"
11315
11316 #. type: Plain text
11317 #: build/C/man7/pthreads.7:797
11318 msgid "NPTL still has at least one nonconformance with POSIX.1:"
11319 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
11320
11321 #. type: Plain text
11322 #: build/C/man7/pthreads.7:806
11323 msgid "Some NPTL nonconformances occur only with older kernels:"
11324 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
11325
11326 #. type: Plain text
11327 #: build/C/man7/pthreads.7:812
11328 msgid ""
11329 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
11330 "rather than process-wide (fixed in kernel 2.6.9)."
11331 msgstr ""
11332 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
11333 "単位の情報である (カーネル 2.6.9 で修正された)。"
11334
11335 #. type: Plain text
11336 #: build/C/man7/pthreads.7:814
11337 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
11338 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
11339
11340 #. type: Plain text
11341 #: build/C/man7/pthreads.7:816
11342 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
11343 msgstr ""
11344 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
11345
11346 #. type: Plain text
11347 #: build/C/man7/pthreads.7:820
11348 msgid ""
11349 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
11350 "(fixed in kernel 2.6.16)."
11351 msgstr ""
11352 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
11353 "きる (カーネル 2.6.16 で修正された)。"
11354
11355 #. type: Plain text
11356 #: build/C/man7/pthreads.7:825
11357 msgid ""
11358 "Only the main thread is permitted to make the process into a process group "
11359 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
11360 msgstr ""
11361 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセス・グルー"
11362 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
11363
11364 #. type: Plain text
11365 #: build/C/man7/pthreads.7:831
11366 msgid ""
11367 "Threads have distinct alternate signal stack settings.  However, a new "
11368 "thread's alternate signal stack settings are copied from the thread that "
11369 "created it, so that the threads initially share an alternate signal stack "
11370 "(fixed in kernel 2.6.16)."
11371 msgstr ""
11372 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
11373 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
11374 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
11375 "ル 2.6.16 で修正された)。"
11376
11377 #. type: Plain text
11378 #: build/C/man7/pthreads.7:833
11379 msgid "Note the following further points about the NPTL implementation:"
11380 msgstr "NPTL の実装では以下の点についても注意すること:"
11381
11382 #. type: Plain text
11383 #: build/C/man7/pthreads.7:847
11384 msgid ""
11385 "If the stack size soft resource limit (see the description of "
11386 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
11387 "I<unlimited>, then this value defines the default stack size for new "
11388 "threads.  To be effective, this limit must be set before the program is "
11389 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
11390 "stacksize> in the C shell)."
11391 msgstr ""
11392 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2)  の "
11393 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
11394 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
11395 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
11396 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
11397 "は I<limit stacksize>)  を使って設定する。"
11398
11399 #. type: SS
11400 #: build/C/man7/pthreads.7:847
11401 #, no-wrap
11402 msgid "Determining the threading implementation"
11403 msgstr "スレッド実装の判定"
11404
11405 #. type: Plain text
11406 #: build/C/man7/pthreads.7:852
11407 msgid ""
11408 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
11409 "system's threading implementation, for example:"
11410 msgstr ""
11411 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
11412 "装を判定することができる。 以下に例を示す:"
11413
11414 #. type: Plain text
11415 #: build/C/man7/pthreads.7:857
11416 #, no-wrap
11417 msgid ""
11418 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
11419 "NPTL 2.3.4\n"
11420 msgstr ""
11421 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
11422 "NPTL 2.3.4\n"
11423
11424 #. type: Plain text
11425 #: build/C/man7/pthreads.7:862
11426 msgid ""
11427 "With older glibc versions, a command such as the following should be "
11428 "sufficient to determine the default threading implementation:"
11429 msgstr ""
11430 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
11431 "ド実装を判定することができる。"
11432
11433 #. type: Plain text
11434 #: build/C/man7/pthreads.7:868
11435 #, no-wrap
11436 msgid ""
11437 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
11438 "                egrep -i \\(aqthreads|nptl\\(aq\n"
11439 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
11440 msgstr ""
11441 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
11442 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
11443 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
11444
11445 #. type: SS
11446 #: build/C/man7/pthreads.7:870
11447 #, no-wrap
11448 msgid "Selecting the threading implementation: LD_ASSUME_KERNEL"
11449 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
11450
11451 #. type: Plain text
11452 #: build/C/man7/pthreads.7:885
11453 msgid ""
11454 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
11455 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
11456 "override the dynamic linker's default choice of threading implementation.  "
11457 "This variable tells the dynamic linker to assume that it is running on top "
11458 "of a particular kernel version.  By specifying a kernel version that does "
11459 "not provide the support required by NPTL, we can force the use of "
11460 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
11461 "application that depends on some nonconformant behavior in LinuxThreads.)  "
11462 "For example:"
11463 msgstr ""
11464 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
11465 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
11466 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
11467 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
11468 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
11469 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
11470 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
11471 "ン を動作させる場合だろう)。 以下に例を示す:"
11472
11473 #. type: Plain text
11474 #: build/C/man7/pthreads.7:891
11475 #, no-wrap
11476 msgid ""
11477 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
11478 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
11479 "        linuxthreads-0.10 by Xavier Leroy\n"
11480 msgstr ""
11481 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
11482 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
11483 "        linuxthreads-0.10 by Xavier Leroy\n"
11484
11485 #. type: Plain text
11486 #: build/C/man7/pthreads.7:903
11487 msgid ""
11488 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), "
11489 "B<sigevent>(7), B<signal>(7),"
11490 msgstr ""
11491 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
11492 "B<signal>(7),"
11493
11494 #. type: Plain text
11495 #: build/C/man7/pthreads.7:927
11496 msgid ""
11497 "Various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
11498 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
11499 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
11500 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
11501 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
11502 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), "
11503 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), "
11504 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3), "
11505 "and B<pthread_testcancel>(3)"
11506 msgstr ""
11507 "pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
11508 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
11509 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
11510 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
11511 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
11512 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
11513 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
11514 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
11515 "and B<pthread_testcancel>(3)"