OSDN Git Service

(split) LDP: Translation snapshots for LDP 3.65
[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-04-24 00:51+0900\n"
10 "PO-Revision-Date: 2014-04-24 04:38+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 "る。 呼び出しに成功すると返らない。 このコンテキストは、以前に B<getcontext>"
302 "()  または 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> から返ると、 B<makecontext>"
327 "(3)  呼び出しの第一引数で指定されていた I<ucp> 構造体の I<uc_link> メンバで継"
328 "続する。 このメンバが NULL だった場合は、そのスレッドは終了する。"
329
330 #. type: Plain text
331 #: build/C/man3/getcontext.3:142
332 msgid ""
333 "If the context was obtained by a call to a signal handler, then old standard "
334 "text says that \"program execution continues with the program instruction "
335 "following the instruction interrupted by the signal\".  However, this "
336 "sentence was removed in SUSv2, and the present verdict is \"the result is "
337 "unspecified\"."
338 msgstr ""
339 "コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 古"
340 "い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命令"
341 "から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結果"
342 "は定義されていない」である。"
343
344 #. type: SH
345 #: build/C/man3/getcontext.3:142 build/C/man3/makecontext.3:84
346 #: build/C/man3/pthread_attr_init.3:68
347 #: build/C/man3/pthread_attr_setaffinity_np.3:76
348 #: build/C/man3/pthread_attr_setdetachstate.3:77
349 #: build/C/man3/pthread_attr_setguardsize.3:90
350 #: build/C/man3/pthread_attr_setinheritsched.3:93
351 #: build/C/man3/pthread_attr_setschedparam.3:85
352 #: build/C/man3/pthread_attr_setschedpolicy.3:83
353 #: build/C/man3/pthread_attr_setscope.3:103
354 #: build/C/man3/pthread_attr_setstack.3:85
355 #: build/C/man3/pthread_attr_setstackaddr.3:74
356 #: build/C/man3/pthread_attr_setstacksize.3:61
357 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_cleanup_push.3:121
358 #: build/C/man3/pthread_create.3:115 build/C/man3/pthread_detach.3:49
359 #: build/C/man3/pthread_equal.3:41 build/C/man3/pthread_exit.3:71
360 #: build/C/man3/pthread_getattr_np.3:73
361 #: build/C/man3/pthread_getcpuclockid.3:46 build/C/man3/pthread_join.3:70
362 #: build/C/man3/pthread_kill.3:63 build/C/man3/pthread_self.3:46
363 #: build/C/man3/pthread_setaffinity_np.3:77
364 #: build/C/man3/pthread_setcancelstate.3:92
365 #: build/C/man3/pthread_setconcurrency.3:56
366 #: build/C/man3/pthread_setname_np.3:72
367 #: build/C/man3/pthread_setschedparam.3:104
368 #: build/C/man3/pthread_setschedprio.3:53 build/C/man3/pthread_sigmask.3:61
369 #: build/C/man3/pthread_sigqueue.3:65 build/C/man3/pthread_testcancel.3:50
370 #: build/C/man3/pthread_tryjoin_np.3:85 build/C/man3/pthread_yield.3:44
371 #, no-wrap
372 msgid "RETURN VALUE"
373 msgstr "返り値"
374
375 #. type: Plain text
376 #: build/C/man3/getcontext.3:151
377 msgid ""
378 "When successful, B<getcontext>()  returns 0 and B<setcontext>()  does not "
379 "return.  On error, both return -1 and set I<errno> appropriately."
380 msgstr ""
381 "成功すると、 B<getcontext>()  は 0 を返し、 B<setcontext>()  は返らない。 失"
382 "敗すると、両者とも -1 を返し、I<errno> をエラーに応じて設定する。"
383
384 #. type: SH
385 #: build/C/man3/getcontext.3:151 build/C/man3/makecontext.3:96
386 #: build/C/man3/pthread_attr_init.3:71
387 #: build/C/man3/pthread_attr_setaffinity_np.3:79
388 #: build/C/man3/pthread_attr_setdetachstate.3:80
389 #: build/C/man3/pthread_attr_setguardsize.3:93
390 #: build/C/man3/pthread_attr_setinheritsched.3:96
391 #: build/C/man3/pthread_attr_setschedparam.3:88
392 #: build/C/man3/pthread_attr_setschedpolicy.3:86
393 #: build/C/man3/pthread_attr_setscope.3:106
394 #: build/C/man3/pthread_attr_setstack.3:88
395 #: build/C/man3/pthread_attr_setstackaddr.3:77
396 #: build/C/man3/pthread_attr_setstacksize.3:64
397 #: build/C/man3/pthread_cancel.3:117 build/C/man3/pthread_cleanup_push.3:123
398 #: build/C/man3/pthread_create.3:122 build/C/man3/pthread_detach.3:54
399 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
400 #: build/C/man3/pthread_getattr_np.3:76
401 #: build/C/man3/pthread_getcpuclockid.3:49 build/C/man3/pthread_join.3:75
402 #: build/C/man3/pthread_kill.3:68 build/C/man3/pthread_self.3:48
403 #: build/C/man3/pthread_setaffinity_np.3:80
404 #: build/C/man3/pthread_setcancelstate.3:95
405 #: build/C/man3/pthread_setconcurrency.3:68
406 #: build/C/man3/pthread_setname_np.3:75
407 #: build/C/man3/pthread_setschedparam.3:112
408 #: build/C/man3/pthread_setschedprio.3:61 build/C/man3/pthread_sigmask.3:66
409 #: build/C/man3/pthread_sigqueue.3:70 build/C/man3/pthread_testcancel.3:54
410 #: build/C/man3/pthread_tryjoin_np.3:89 build/C/man3/pthread_yield.3:49
411 #, no-wrap
412 msgid "ERRORS"
413 msgstr "エラー"
414
415 #. type: Plain text
416 #: build/C/man3/getcontext.3:153
417 msgid "None defined."
418 msgstr "定義されていない。"
419
420 #. type: SH
421 #: build/C/man3/getcontext.3:153 build/C/man3/makecontext.3:105
422 #: build/C/man3/pthread_attr_setdetachstate.3:87
423 #: build/C/man3/pthread_attr_setguardsize.3:106
424 #, no-wrap
425 msgid "ATTRIBUTES"
426 msgstr "属性"
427
428 #. type: SS
429 #: build/C/man3/getcontext.3:154 build/C/man3/makecontext.3:106
430 #: build/C/man3/pthread_attr_setdetachstate.3:88
431 #: build/C/man3/pthread_attr_setguardsize.3:107
432 #, no-wrap
433 msgid "Multithreading (see pthreads(7))"
434 msgstr "マルチスレッディング (pthreads(7) 参照)"
435
436 #. type: Plain text
437 #: build/C/man3/getcontext.3:160
438 msgid "The B<getcontext>()  and B<setcontext>()  functions are thread-safe."
439 msgstr "関数 B<getcontext>() と B<setcontext>() はスレッドセーフである。"
440
441 #. type: SH
442 #: build/C/man3/getcontext.3:160 build/C/man3/makecontext.3:112
443 #: build/C/man3/pthread_attr_init.3:79
444 #: build/C/man3/pthread_attr_setaffinity_np.3:108
445 #: build/C/man3/pthread_attr_setdetachstate.3:94
446 #: build/C/man3/pthread_attr_setguardsize.3:113
447 #: build/C/man3/pthread_attr_setinheritsched.3:110
448 #: build/C/man3/pthread_attr_setschedparam.3:100
449 #: build/C/man3/pthread_attr_setschedpolicy.3:100
450 #: build/C/man3/pthread_attr_setscope.3:119
451 #: build/C/man3/pthread_attr_setstack.3:112
452 #: build/C/man3/pthread_attr_setstackaddr.3:83
453 #: build/C/man3/pthread_attr_setstacksize.3:83
454 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_cleanup_push.3:127
455 #: build/C/man3/pthread_cleanup_push_defer_np.3:101
456 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
457 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
458 #: build/C/man3/pthread_getattr_np.3:98
459 #: build/C/man3/pthread_getcpuclockid.3:65 build/C/man3/pthread_join.3:98
460 #: build/C/man3/pthread_kill.3:72
461 #: build/C/man3/pthread_kill_other_threads_np.3:47
462 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_setaffinity_np.3:121
463 #: build/C/man3/pthread_setcancelstate.3:113
464 #: build/C/man3/pthread_setconcurrency.3:83
465 #: build/C/man3/pthread_setname_np.3:102
466 #: build/C/man3/pthread_setschedparam.3:141
467 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:69
468 #: build/C/man3/pthread_sigqueue.3:93 build/C/man3/pthread_testcancel.3:58
469 #: build/C/man3/pthread_tryjoin_np.3:112 build/C/man3/pthread_yield.3:53
470 #, no-wrap
471 msgid "CONFORMING TO"
472 msgstr "準拠"
473
474 #. type: Plain text
475 #: build/C/man3/getcontext.3:166
476 msgid ""
477 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specification of B<getcontext>"
478 "(), citing portability issues, and recommending that applications be "
479 "rewritten to use POSIX threads instead."
480 msgstr ""
481 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<getcontext>()  の"
482 "仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直"
483 "すことが 推奨されている。"
484
485 #. type: SH
486 #: build/C/man3/getcontext.3:166 build/C/man3/makecontext.3:120
487 #: build/C/man3/pthread_attr_init.3:81
488 #: build/C/man3/pthread_attr_setaffinity_np.3:111
489 #: build/C/man3/pthread_attr_setdetachstate.3:96
490 #: build/C/man3/pthread_attr_setguardsize.3:115
491 #: build/C/man3/pthread_attr_setschedparam.3:102
492 #: build/C/man3/pthread_attr_setscope.3:121
493 #: build/C/man3/pthread_attr_setstack.3:114
494 #: build/C/man3/pthread_attr_setstackaddr.3:86
495 #: build/C/man3/pthread_attr_setstacksize.3:85
496 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129
497 #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_detach.3:66
498 #: build/C/man3/pthread_equal.3:49 build/C/man3/pthread_exit.3:77
499 #: build/C/man3/pthread_getcpuclockid.3:67 build/C/man3/pthread_join.3:100
500 #: build/C/man3/pthread_kill.3:74
501 #: build/C/man3/pthread_kill_other_threads_np.3:50
502 #: build/C/man3/pthread_self.3:52 build/C/man3/pthread_setaffinity_np.3:124
503 #: build/C/man3/pthread_setcancelstate.3:115
504 #: build/C/man3/pthread_setconcurrency.3:85
505 #: build/C/man3/pthread_setname_np.3:104
506 #: build/C/man3/pthread_setschedparam.3:143
507 #: build/C/man3/pthread_setschedprio.3:85 build/C/man3/pthread_sigmask.3:71
508 #: build/C/man3/pthread_yield.3:59
509 #, no-wrap
510 msgid "NOTES"
511 msgstr "注意"
512
513 #. type: Plain text
514 #: build/C/man3/getcontext.3:183
515 msgid ""
516 "The earliest incarnation of this mechanism was the B<setjmp>(3)/B<longjmp>"
517 "(3)  mechanism.  Since that does not define the handling of the signal "
518 "context, the next stage was the B<sigsetjmp>(3)/B<siglongjmp>(3)  pair.  The "
519 "present mechanism gives much more control.  On the other hand, there is no "
520 "easy way to detect whether a return from B<getcontext>()  is from the first "
521 "call, or via a B<setcontext>()  call.  The user has to invent her own "
522 "bookkeeping device, and a register variable won't do since registers are "
523 "restored."
524 msgstr ""
525 "このメカニズムの最古の実装は、 B<setjmp>(3)/B<longjmp>(3)  機構であった。 こ"
526 "れらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階で"
527 "は B<sigsetjmp>(3)/B<siglongjmp>(3)  のペアが現われた。 現在の機構ではずっと"
528 "細かな制御ができる。 一方 B<getcontext>()  から返ったとき、 これが最初の呼び"
529 "出しであったか、 それとも B<setcontext>()  呼び出しからのものであるかを 区別"
530 "する容易な方法がなくなってしまった。 ユーザは「しおり」機構を自分で作らなけれ"
531 "ばならない。 レジスタ変数は (レジスタはリストアされてしまうので) これをやって"
532 "くれない。"
533
534 #. type: Plain text
535 #: build/C/man3/getcontext.3:194
536 msgid ""
537 "When a signal occurs, the current user context is saved and a new context is "
538 "created by the kernel for the signal handler.  Do not leave the handler "
539 "using B<longjmp>(3): it is undefined what would happen with contexts.  Use "
540 "B<siglongjmp>(3)  or B<setcontext>()  instead."
541 msgstr ""
542 "シグナルが発生すると、 現在のユーザコンテキストは保存され、 シグナルハンドラ"
543 "用のコンテキストがカーネルによって生成される。 今後はハンドラに B<longjmp>"
544 "(3)  を使わせないこと: この関数のコンテキスト下での動作は定義されていない。 "
545 "代わりに B<siglongjmp>(3)  か B<setcontext>()  を使うこと。"
546
547 #. type: SH
548 #: build/C/man3/getcontext.3:194 build/C/man3/makecontext.3:227
549 #: build/C/man3/pthread_attr_init.3:297
550 #: build/C/man3/pthread_attr_setaffinity_np.3:118
551 #: build/C/man3/pthread_attr_setdetachstate.3:118
552 #: build/C/man3/pthread_attr_setguardsize.3:165
553 #: build/C/man3/pthread_attr_setinheritsched.3:131
554 #: build/C/man3/pthread_attr_setschedparam.3:109
555 #: build/C/man3/pthread_attr_setschedpolicy.3:105
556 #: build/C/man3/pthread_attr_setscope.3:132
557 #: build/C/man3/pthread_attr_setstack.3:155
558 #: build/C/man3/pthread_attr_setstackaddr.3:110
559 #: build/C/man3/pthread_attr_setstacksize.3:111
560 #: build/C/man3/pthread_cancel.3:226 build/C/man3/pthread_cleanup_push.3:315
561 #: build/C/man3/pthread_cleanup_push_defer_np.3:104
562 #: build/C/man3/pthread_create.3:369 build/C/man3/pthread_detach.3:97
563 #: build/C/man3/pthread_equal.3:56 build/C/man3/pthread_exit.3:105
564 #: build/C/man3/pthread_getattr_np.3:345
565 #: build/C/man3/pthread_getcpuclockid.3:170 build/C/man3/pthread_join.3:127
566 #: build/C/man3/pthread_kill.3:94
567 #: build/C/man3/pthread_kill_other_threads_np.3:66
568 #: build/C/man3/pthread_self.3:76 build/C/man3/pthread_setaffinity_np.3:206
569 #: build/C/man3/pthread_setcancelstate.3:177
570 #: build/C/man3/pthread_setconcurrency.3:100
571 #: build/C/man3/pthread_setname_np.3:200
572 #: build/C/man3/pthread_setschedparam.3:431
573 #: build/C/man3/pthread_setschedprio.3:91 build/C/man3/pthread_sigmask.3:147
574 #: build/C/man3/pthread_sigqueue.3:95 build/C/man3/pthread_testcancel.3:63
575 #: build/C/man3/pthread_tryjoin_np.3:135 build/C/man3/pthread_yield.3:62
576 #: build/C/man7/pthreads.7:895
577 #, no-wrap
578 msgid "SEE ALSO"
579 msgstr "関連項目"
580
581 #. type: Plain text
582 #: build/C/man3/getcontext.3:201
583 msgid ""
584 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
585 "B<makecontext>(3), B<sigsetjmp>(3)"
586 msgstr ""
587 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
588 "B<makecontext>(3), B<sigsetjmp>(3)"
589
590 #. type: SH
591 #: build/C/man3/getcontext.3:201 build/C/man3/makecontext.3:233
592 #: build/C/man3/pthread_attr_init.3:313
593 #: build/C/man3/pthread_attr_setaffinity_np.3:124
594 #: build/C/man3/pthread_attr_setdetachstate.3:124
595 #: build/C/man3/pthread_attr_setguardsize.3:173
596 #: build/C/man3/pthread_attr_setinheritsched.3:143
597 #: build/C/man3/pthread_attr_setschedparam.3:121
598 #: build/C/man3/pthread_attr_setschedpolicy.3:116
599 #: build/C/man3/pthread_attr_setscope.3:142
600 #: build/C/man3/pthread_attr_setstack.3:167
601 #: build/C/man3/pthread_attr_setstackaddr.3:116
602 #: build/C/man3/pthread_attr_setstacksize.3:118
603 #: build/C/man3/pthread_cancel.3:238 build/C/man3/pthread_cleanup_push.3:321
604 #: build/C/man3/pthread_cleanup_push_defer_np.3:110
605 #: build/C/man3/pthread_create.3:382 build/C/man3/pthread_detach.3:104
606 #: build/C/man3/pthread_equal.3:60 build/C/man3/pthread_exit.3:109
607 #: build/C/man3/pthread_getattr_np.3:361
608 #: build/C/man3/pthread_getcpuclockid.3:178 build/C/man3/pthread_join.3:134
609 #: build/C/man3/pthread_kill.3:103
610 #: build/C/man3/pthread_kill_other_threads_np.3:72
611 #: build/C/man3/pthread_self.3:80 build/C/man3/pthread_setaffinity_np.3:214
612 #: build/C/man3/pthread_setcancelstate.3:182
613 #: build/C/man3/pthread_setconcurrency.3:103
614 #: build/C/man3/pthread_setname_np.3:206
615 #: build/C/man3/pthread_setschedparam.3:445
616 #: build/C/man3/pthread_setschedprio.3:105 build/C/man3/pthread_sigmask.3:156
617 #: build/C/man3/pthread_sigqueue.3:103 build/C/man3/pthread_testcancel.3:68
618 #: build/C/man3/pthread_tryjoin_np.3:140 build/C/man3/pthread_yield.3:66
619 #: build/C/man7/pthreads.7:929
620 #, no-wrap
621 msgid "COLOPHON"
622 msgstr "この文書について"
623
624 #. type: Plain text
625 #: build/C/man3/getcontext.3:208 build/C/man3/makecontext.3:240
626 #: build/C/man3/pthread_attr_init.3:320
627 #: build/C/man3/pthread_attr_setaffinity_np.3:131
628 #: build/C/man3/pthread_attr_setdetachstate.3:131
629 #: build/C/man3/pthread_attr_setguardsize.3:180
630 #: build/C/man3/pthread_attr_setinheritsched.3:150
631 #: build/C/man3/pthread_attr_setschedparam.3:128
632 #: build/C/man3/pthread_attr_setschedpolicy.3:123
633 #: build/C/man3/pthread_attr_setscope.3:149
634 #: build/C/man3/pthread_attr_setstack.3:174
635 #: build/C/man3/pthread_attr_setstackaddr.3:123
636 #: build/C/man3/pthread_attr_setstacksize.3:125
637 #: build/C/man3/pthread_cancel.3:245 build/C/man3/pthread_cleanup_push.3:328
638 #: build/C/man3/pthread_cleanup_push_defer_np.3:117
639 #: build/C/man3/pthread_create.3:389 build/C/man3/pthread_detach.3:111
640 #: build/C/man3/pthread_equal.3:67 build/C/man3/pthread_exit.3:116
641 #: build/C/man3/pthread_getattr_np.3:368
642 #: build/C/man3/pthread_getcpuclockid.3:185 build/C/man3/pthread_join.3:141
643 #: build/C/man3/pthread_kill.3:110
644 #: build/C/man3/pthread_kill_other_threads_np.3:79
645 #: build/C/man3/pthread_self.3:87 build/C/man3/pthread_setaffinity_np.3:221
646 #: build/C/man3/pthread_setcancelstate.3:189
647 #: build/C/man3/pthread_setconcurrency.3:110
648 #: build/C/man3/pthread_setname_np.3:213
649 #: build/C/man3/pthread_setschedparam.3:452
650 #: build/C/man3/pthread_setschedprio.3:112 build/C/man3/pthread_sigmask.3:163
651 #: build/C/man3/pthread_sigqueue.3:110 build/C/man3/pthread_testcancel.3:75
652 #: build/C/man3/pthread_tryjoin_np.3:147 build/C/man3/pthread_yield.3:73
653 #: build/C/man7/pthreads.7:936
654 msgid ""
655 "This page is part of release 3.65 of the Linux I<man-pages> project.  A "
656 "description of the project, and information about reporting bugs, can be "
657 "found at \\%http://www.kernel.org/doc/man-pages/."
658 msgstr ""
659 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.65 の一部\n"
660 "である。プロジェクトの説明とバグ報告に関する情報は\n"
661 "http://www.kernel.org/doc/man-pages/ に書かれている。"
662
663 #. type: TH
664 #: build/C/man3/makecontext.3:28
665 #, no-wrap
666 msgid "MAKECONTEXT"
667 msgstr "MAKECONTEXT"
668
669 #. type: TH
670 #: build/C/man3/makecontext.3:28 build/C/man3/pthread_attr_setdetachstate.3:26
671 #: build/C/man3/pthread_attr_setguardsize.3:26
672 #, no-wrap
673 msgid "2014-04-14"
674 msgstr "2014-04-14"
675
676 #. type: TH
677 #: build/C/man3/makecontext.3:28
678 #, no-wrap
679 msgid "GNU"
680 msgstr "GNU"
681
682 #. type: Plain text
683 #: build/C/man3/makecontext.3:31
684 msgid "makecontext, swapcontext - manipulate user context"
685 msgstr "makecontext, swapcontext - ユーザコンテキストを操作する"
686
687 #. type: Plain text
688 #: build/C/man3/makecontext.3:36
689 msgid ""
690 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
691 ">I<argc>B<, ...);>"
692 msgstr ""
693 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
694 ">I<argc>B<, ...);>"
695
696 #. type: Plain text
697 #: build/C/man3/makecontext.3:38
698 msgid "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
699 msgstr "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
700
701 #. type: Plain text
702 #: build/C/man3/makecontext.3:49
703 msgid ""
704 "In a System V-like environment, one has the type I<ucontext_t> defined in "
705 "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(3), "
706 "B<setcontext>(3), B<makecontext>()  and B<swapcontext>()  that allow user-"
707 "level context switching between multiple threads of control within a process."
708 msgstr ""
709 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
710 "と、 B<getcontext>(3), B<setcontext>(3), B<makecontext>(), B<swapcontext>()  "
711 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
712 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
713 "ようになっている。"
714
715 #. type: Plain text
716 #: build/C/man3/makecontext.3:52
717 msgid "For the type and the first two functions, see B<getcontext>(3)."
718 msgstr ""
719 "これらの型と、最初の 2 つの関数については、 B<getcontext>(3) を参照のこと。"
720
721 #. type: Plain text
722 #: build/C/man3/makecontext.3:64
723 msgid ""
724 "The B<makecontext>()  function modifies the context pointed to by I<ucp> "
725 "(which was obtained from a call to B<getcontext>(3)).  Before invoking "
726 "B<makecontext>(), the caller must allocate a new stack for this context and "
727 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
728 "and assign its address to I<ucp-E<gt>uc_link>."
729 msgstr ""
730 "B<makecontext>()  関数は、ポインタ I<ucp> が指すコンテキストを変更する "
731 "(I<ucp> は以前の B<getcontext>(3)  呼び出しで得られたものである)。 "
732 "B<makecontext>()  を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
733 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
734 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
735 "らない。"
736
737 #. type: Plain text
738 #: build/C/man3/makecontext.3:78
739 msgid ""
740 "When this context is later activated (using B<setcontext>(3)  or "
741 "B<swapcontext>())  the function I<func> is called, and passed the series of "
742 "integer (I<int>)  arguments that follow I<argc>; the caller must specify the "
743 "number of these arguments in I<argc>.  When this function returns, the "
744 "successor context is activated.  If the successor context pointer is NULL, "
745 "the thread exits."
746 msgstr ""
747 "このコンテキストが将来 (B<setcontext>(3)  または B<swapcontext>()  によっ"
748 "て)  有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 "
749 "(I<int>)  引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数"
750 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
751 "る。 後継コンテキストのポインタが NULL の場合、そのスレッドが終了する。"
752
753 #. type: Plain text
754 #: build/C/man3/makecontext.3:84
755 msgid ""
756 "The B<swapcontext>()  function saves the current context in the structure "
757 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
758 msgstr ""
759 "B<swapcontext>()  関数は現在のコンテキストを ポインタ I<oucp> が指す構造体に"
760 "保存し、 ポインタ I<ucp> が指すコンテキストを有効にする。"
761
762 #. type: Plain text
763 #: build/C/man3/makecontext.3:96
764 msgid ""
765 "When successful, B<swapcontext>()  does not return.  (But we may return "
766 "later, in case I<oucp> is activated, in which case it looks like "
767 "B<swapcontext>()  returns 0.)  On error, B<swapcontext>()  returns -1 and "
768 "sets I<errno> appropriately."
769 msgstr ""
770 "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった"
771 "場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見え"
772 "る。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じ"
773 "て設定する。"
774
775 #. type: TP
776 #: build/C/man3/makecontext.3:97
777 #: build/C/man3/pthread_attr_setaffinity_np.3:102
778 #: build/C/man3/pthread_getattr_np.3:77
779 #, no-wrap
780 msgid "B<ENOMEM>"
781 msgstr "B<ENOMEM>"
782
783 #. type: Plain text
784 #: build/C/man3/makecontext.3:100
785 msgid "Insufficient stack space left."
786 msgstr "スタックに割り当てる空間が残っていない。"
787
788 #. type: SH
789 #: build/C/man3/makecontext.3:100
790 #: build/C/man3/pthread_attr_setaffinity_np.3:106
791 #: build/C/man3/pthread_attr_setguardsize.3:104
792 #: build/C/man3/pthread_attr_setstack.3:110
793 #: build/C/man3/pthread_attr_setstackaddr.3:81
794 #: build/C/man3/pthread_attr_setstacksize.3:81
795 #: build/C/man3/pthread_getattr_np.3:96
796 #: build/C/man3/pthread_getcpuclockid.3:63
797 #: build/C/man3/pthread_setaffinity_np.3:119
798 #: build/C/man3/pthread_setconcurrency.3:81
799 #: build/C/man3/pthread_setname_np.3:100
800 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigqueue.3:89
801 #: build/C/man3/pthread_tryjoin_np.3:110
802 #, no-wrap
803 msgid "VERSIONS"
804 msgstr "バージョン"
805
806 #. type: Plain text
807 #: build/C/man3/makecontext.3:105
808 msgid ""
809 "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version "
810 "2.1."
811 msgstr ""
812 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
813 "されている。"
814
815 #. type: Plain text
816 #: build/C/man3/makecontext.3:112
817 msgid "The B<makecontext>()  and B<swapcontext>()  functions are thread-safe."
818 msgstr "関数 B<makecontext>() と B<swapcontext>() はスレッドセーフである。"
819
820 #. type: Plain text
821 #: build/C/man3/makecontext.3:120
822 msgid ""
823 "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specifications of "
824 "B<makecontext>()  and B<swapcontext>(), citing portability issues, and "
825 "recommending that applications be rewritten to use POSIX threads instead."
826 msgstr ""
827 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  "
828 "と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを "
829 "POSIX スレッドを使って書き直すことが 推奨されている。"
830
831 #. type: Plain text
832 #: build/C/man3/makecontext.3:128
833 msgid ""
834 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
835 "namely, this struct contains the start and length of a memory area to be "
836 "used as the stack, regardless of the direction of growth of the stack.  "
837 "Thus, it is not necessary for the user program to worry about this direction."
838 msgstr ""
839 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわ"
840 "ちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含"
841 "まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
842 "て、ユーザプログラムはこの件については心配しなくてよい。"
843
844 #. type: Plain text
845 #: build/C/man3/makecontext.3:144
846 msgid ""
847 "On architectures where I<int> and pointer types are the same size (e.g., "
848 "x86-32, where both types are 32 bits), you may be able to get away with "
849 "passing pointers as arguments to B<makecontext>()  following I<argc>.  "
850 "However, doing this is not guaranteed to be portable, is undefined according "
851 "to the standards, and won't work on architectures where pointers are larger "
852 "than I<int>s.  Nevertheless, starting with version 2.8, glibc makes some "
853 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
854 "g., x86-64)."
855 msgstr ""
856 "I<int> とポインタ型が同じ大きさであるアーキテクチャでは (x86-32 はその例であ"
857 "り、両方の型とも 32 ビットである)、 B<makecontext>()  の I<argc> 以降の引き数"
858 "としてポインタを渡してもうまく動くかもしれない。 しかしながら、このようにする"
859 "と、移植性は保証されず、 標準に従えば動作は未定義であり、ポインタが I<int> よ"
860 "りも大きいアーキテクチャでは正しく動作しないことだろう。 それにも関わらず、"
861 "バージョン 2.8 以降の glibc では、 B<makecontext>()  に変更が行われ、(x86-64 "
862 "などの) いくつかの 64 ビットアーキテクチャで 引き数としてポインタを渡すことが"
863 "できるようになっている。"
864
865 #. type: SH
866 #: build/C/man3/makecontext.3:144 build/C/man3/pthread_attr_init.3:87
867 #: build/C/man3/pthread_attr_setdetachstate.3:115
868 #: build/C/man3/pthread_attr_setguardsize.3:162
869 #: build/C/man3/pthread_attr_setinheritsched.3:128
870 #: build/C/man3/pthread_attr_setschedparam.3:106
871 #: build/C/man3/pthread_attr_setschedpolicy.3:102
872 #: build/C/man3/pthread_attr_setstack.3:152
873 #: build/C/man3/pthread_attr_setstacksize.3:108
874 #: build/C/man3/pthread_cancel.3:135 build/C/man3/pthread_cleanup_push.3:155
875 #: build/C/man3/pthread_create.3:202 build/C/man3/pthread_detach.3:93
876 #: build/C/man3/pthread_getattr_np.3:101
877 #: build/C/man3/pthread_getcpuclockid.3:78 build/C/man3/pthread_join.3:124
878 #: build/C/man3/pthread_setaffinity_np.3:154
879 #: build/C/man3/pthread_setcancelstate.3:174
880 #: build/C/man3/pthread_setname_np.3:114
881 #: build/C/man3/pthread_setschedparam.3:149 build/C/man3/pthread_sigmask.3:73
882 #: build/C/man3/pthread_testcancel.3:60 build/C/man3/pthread_tryjoin_np.3:115
883 #, no-wrap
884 msgid "EXAMPLE"
885 msgstr "例"
886
887 #. type: Plain text
888 #: build/C/man3/makecontext.3:152
889 msgid ""
890 "The example program below demonstrates the use of B<getcontext>(3), "
891 "B<makecontext>(), and B<swapcontext>().  Running the program produces the "
892 "following output:"
893 msgstr ""
894 "以下のサンプル・プログラムは、 B<getcontext>(3), B<makecontext>(), "
895 "B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行する"
896 "と、以下のような出力が得られる:"
897
898 #. type: Plain text
899 #: build/C/man3/makecontext.3:164
900 #, no-wrap
901 msgid ""
902 "$B< ./a.out>\n"
903 "main: swapcontext(&uctx_main, &uctx_func2)\n"
904 "func2: started\n"
905 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
906 "func1: started\n"
907 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
908 "func2: returning\n"
909 "func1: returning\n"
910 "main: exiting\n"
911 msgstr ""
912 "$B< ./a.out>\n"
913 "main: swapcontext(&uctx_main, &uctx_func2)\n"
914 "func2: started\n"
915 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
916 "func1: started\n"
917 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
918 "func2: returning\n"
919 "func1: returning\n"
920 "main: exiting\n"
921
922 #. type: SS
923 #: build/C/man3/makecontext.3:166 build/C/man3/pthread_attr_init.3:148
924 #: build/C/man3/pthread_cancel.3:151 build/C/man3/pthread_cleanup_push.3:231
925 #: build/C/man3/pthread_create.3:241 build/C/man3/pthread_getattr_np.3:179
926 #: build/C/man3/pthread_getcpuclockid.3:96
927 #: build/C/man3/pthread_setname_np.3:140
928 #: build/C/man3/pthread_setschedparam.3:224 build/C/man3/pthread_sigmask.3:91
929 #, no-wrap
930 msgid "Program source"
931 msgstr "プログラムのソース"
932
933 #. type: Plain text
934 #: build/C/man3/makecontext.3:172
935 #, no-wrap
936 msgid ""
937 "#include E<lt>ucontext.hE<gt>\n"
938 "#include E<lt>stdio.hE<gt>\n"
939 "#include E<lt>stdlib.hE<gt>\n"
940 msgstr ""
941 "#include E<lt>ucontext.hE<gt>\n"
942 "#include E<lt>stdio.hE<gt>\n"
943 "#include E<lt>stdlib.hE<gt>\n"
944
945 #. type: Plain text
946 #: build/C/man3/makecontext.3:174
947 #, no-wrap
948 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
949 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
950
951 #. type: Plain text
952 #: build/C/man3/makecontext.3:177
953 #, no-wrap
954 msgid ""
955 "#define handle_error(msg) \\e\n"
956 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
957 msgstr ""
958 "#define handle_error(msg) \\e\n"
959 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
960
961 #. type: Plain text
962 #: build/C/man3/makecontext.3:187
963 #, no-wrap
964 msgid ""
965 "static void\n"
966 "func1(void)\n"
967 "{\n"
968 "    printf(\"func1: started\\en\");\n"
969 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
970 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
971 "        handle_error(\"swapcontext\");\n"
972 "    printf(\"func1: returning\\en\");\n"
973 "}\n"
974 msgstr ""
975 "static void\n"
976 "func1(void)\n"
977 "{\n"
978 "    printf(\"func1: started\\en\");\n"
979 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
980 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
981 "        handle_error(\"swapcontext\");\n"
982 "    printf(\"func1: returning\\en\");\n"
983 "}\n"
984
985 #. type: Plain text
986 #: build/C/man3/makecontext.3:197
987 #, no-wrap
988 msgid ""
989 "static void\n"
990 "func2(void)\n"
991 "{\n"
992 "    printf(\"func2: started\\en\");\n"
993 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
994 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
995 "        handle_error(\"swapcontext\");\n"
996 "    printf(\"func2: returning\\en\");\n"
997 "}\n"
998 msgstr ""
999 "static void\n"
1000 "func2(void)\n"
1001 "{\n"
1002 "    printf(\"func2: started\\en\");\n"
1003 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1004 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1005 "        handle_error(\"swapcontext\");\n"
1006 "    printf(\"func2: returning\\en\");\n"
1007 "}\n"
1008
1009 #. type: Plain text
1010 #: build/C/man3/makecontext.3:203
1011 #, no-wrap
1012 msgid ""
1013 "int\n"
1014 "main(int argc, char *argv[])\n"
1015 "{\n"
1016 "    char func1_stack[16384];\n"
1017 "    char func2_stack[16384];\n"
1018 msgstr ""
1019 "int\n"
1020 "main(int argc, char *argv[])\n"
1021 "{\n"
1022 "    char func1_stack[16384];\n"
1023 "    char func2_stack[16384];\n"
1024
1025 #. type: Plain text
1026 #: build/C/man3/makecontext.3:210
1027 #, no-wrap
1028 msgid ""
1029 "    if (getcontext(&uctx_func1) == -1)\n"
1030 "        handle_error(\"getcontext\");\n"
1031 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1032 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1033 "    uctx_func1.uc_link = &uctx_main;\n"
1034 "    makecontext(&uctx_func1, func1, 0);\n"
1035 msgstr ""
1036 "    if (getcontext(&uctx_func1) == -1)\n"
1037 "        handle_error(\"getcontext\");\n"
1038 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1039 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1040 "    uctx_func1.uc_link = &uctx_main;\n"
1041 "    makecontext(&uctx_func1, func1, 0);\n"
1042
1043 #. type: Plain text
1044 #: build/C/man3/makecontext.3:218
1045 #, no-wrap
1046 msgid ""
1047 "    if (getcontext(&uctx_func2) == -1)\n"
1048 "        handle_error(\"getcontext\");\n"
1049 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1050 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1051 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1052 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1053 "    makecontext(&uctx_func2, func2, 0);\n"
1054 msgstr ""
1055 "    if (getcontext(&uctx_func2) == -1)\n"
1056 "        handle_error(\"getcontext\");\n"
1057 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1058 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1059 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
1060 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1061 "    makecontext(&uctx_func2, func2, 0);\n"
1062
1063 #. type: Plain text
1064 #: build/C/man3/makecontext.3:222
1065 #, no-wrap
1066 msgid ""
1067 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1068 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1069 "        handle_error(\"swapcontext\");\n"
1070 msgstr ""
1071 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1072 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1073 "        handle_error(\"swapcontext\");\n"
1074
1075 #. type: Plain text
1076 #: build/C/man3/makecontext.3:226
1077 #, no-wrap
1078 msgid ""
1079 "    printf(\"main: exiting\\en\");\n"
1080 "    exit(EXIT_SUCCESS);\n"
1081 "}\n"
1082 msgstr ""
1083 "    printf(\"main: exiting\\en\");\n"
1084 "    exit(EXIT_SUCCESS);\n"
1085 "}\n"
1086
1087 #. type: Plain text
1088 #: build/C/man3/makecontext.3:233
1089 msgid ""
1090 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1091 "B<sigsetjmp>(3)"
1092 msgstr ""
1093 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1094 "B<sigsetjmp>(3)"
1095
1096 #. type: TH
1097 #: build/C/man3/pthread_attr_init.3:26
1098 #, no-wrap
1099 msgid "PTHREAD_ATTR_INIT"
1100 msgstr "PTHREAD_ATTR_INIT"
1101
1102 #. type: TH
1103 #: build/C/man3/pthread_attr_init.3:26
1104 #, no-wrap
1105 msgid "2008-11-11"
1106 msgstr "2008-11-11"
1107
1108 #. type: Plain text
1109 #: build/C/man3/pthread_attr_init.3:30
1110 msgid ""
1111 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1112 "attributes object"
1113 msgstr ""
1114 "pthread_attr_init, pthread_attr_destroy - \n"
1115 "スレッド属性オブジェクトの初期化と破棄を行う"
1116
1117 #. type: Plain text
1118 #: build/C/man3/pthread_attr_init.3:33
1119 #: build/C/man3/pthread_attr_setdetachstate.3:33
1120 #: build/C/man3/pthread_attr_setguardsize.3:33
1121 #: build/C/man3/pthread_attr_setinheritsched.3:33
1122 #: build/C/man3/pthread_attr_setschedparam.3:33
1123 #: build/C/man3/pthread_attr_setschedpolicy.3:33
1124 #: build/C/man3/pthread_attr_setscope.3:33
1125 #: build/C/man3/pthread_attr_setstack.3:33
1126 #: build/C/man3/pthread_attr_setstackaddr.3:33
1127 #: build/C/man3/pthread_attr_setstacksize.3:33
1128 #: build/C/man3/pthread_cancel.3:32 build/C/man3/pthread_cleanup_push.3:33
1129 #: build/C/man3/pthread_cleanup_push_defer_np.3:33
1130 #: build/C/man3/pthread_create.3:32 build/C/man3/pthread_detach.3:32
1131 #: build/C/man3/pthread_equal.3:32 build/C/man3/pthread_exit.3:32
1132 #: build/C/man3/pthread_join.3:32
1133 #: build/C/man3/pthread_kill_other_threads_np.3:32
1134 #: build/C/man3/pthread_self.3:32 build/C/man3/pthread_setcancelstate.3:33
1135 #: build/C/man3/pthread_setconcurrency.3:32
1136 #: build/C/man3/pthread_setschedparam.3:33
1137 #: build/C/man3/pthread_setschedprio.3:32 build/C/man3/pthread_sigqueue.3:31
1138 #: build/C/man3/pthread_testcancel.3:32
1139 #, no-wrap
1140 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1141 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1142
1143 #. type: Plain text
1144 #: build/C/man3/pthread_attr_init.3:36
1145 #, no-wrap
1146 msgid ""
1147 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1148 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1149 msgstr ""
1150 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1151 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1152
1153 #. type: Plain text
1154 #: build/C/man3/pthread_attr_init.3:38
1155 #: build/C/man3/pthread_attr_setaffinity_np.3:41
1156 #: build/C/man3/pthread_attr_setdetachstate.3:40
1157 #: build/C/man3/pthread_attr_setguardsize.3:40
1158 #: build/C/man3/pthread_attr_setinheritsched.3:40
1159 #: build/C/man3/pthread_attr_setschedparam.3:40
1160 #: build/C/man3/pthread_attr_setschedpolicy.3:40
1161 #: build/C/man3/pthread_attr_setscope.3:40
1162 #: build/C/man3/pthread_attr_setstack.3:40
1163 #: build/C/man3/pthread_attr_setstackaddr.3:40
1164 #: build/C/man3/pthread_attr_setstacksize.3:40
1165 #: build/C/man3/pthread_cancel.3:36 build/C/man3/pthread_cleanup_push.3:39
1166 #: build/C/man3/pthread_equal.3:36 build/C/man3/pthread_exit.3:36
1167 #: build/C/man3/pthread_getattr_np.3:37
1168 #: build/C/man3/pthread_getcpuclockid.3:37 build/C/man3/pthread_self.3:36
1169 #: build/C/man3/pthread_setaffinity_np.3:41
1170 #: build/C/man3/pthread_setcancelstate.3:38
1171 #: build/C/man3/pthread_setconcurrency.3:37
1172 #: build/C/man3/pthread_setschedparam.3:40
1173 #: build/C/man3/pthread_setschedprio.3:36 build/C/man3/pthread_testcancel.3:36
1174 #, no-wrap
1175 msgid "Compile and link with I<-pthread>.\n"
1176 msgstr "I<-pthread> でコンパイルしてリンクする。\n"
1177
1178 #. type: Plain text
1179 #: build/C/man3/pthread_attr_init.3:50
1180 msgid ""
1181 "The B<pthread_attr_init>()  function initializes the thread attributes "
1182 "object pointed to by I<attr> with default attribute values.  After this "
1183 "call, individual attributes of the object can be set using various related "
1184 "functions (listed under SEE ALSO), and then the object can be used in one or "
1185 "more B<pthread_create>(3)  calls that create threads."
1186 msgstr ""
1187 "B<pthread_attr_init>() 関数は I<attr> が指すスレッド属性オブジェクト\n"
1188 "(thread attributes object) をデフォルトの属性値で初期化する。\n"
1189 "この呼び出しの後、オブジェクトの各属性は (関連項目に載っている) 種々の\n"
1190 "関数を使って設定することができ、このオブジェクトはスレッドの作成を行う\n"
1191 "B<pthread_create>(3) の呼び出しにおいて使用することができる (一つの\n"
1192 "オブジェクトを複数の B<pthread_create>(3) に渡してもよい)。"
1193
1194 #. type: Plain text
1195 #: build/C/man3/pthread_attr_init.3:55
1196 msgid ""
1197 "Calling B<pthread_attr_init>()  on a thread attributes object that has "
1198 "already been initialized results in undefined behavior."
1199 msgstr ""
1200 "すでに初期化されているスレッド属性オブジェクトに対して\n"
1201 "B<pthread_attr_init>() を呼び出した場合、\n"
1202 "どのような動作になるかは不定である。"
1203
1204 #. type: Plain text
1205 #: build/C/man3/pthread_attr_init.3:62
1206 msgid ""
1207 "When a thread attributes object is no longer required, it should be "
1208 "destroyed using the B<pthread_attr_destroy>()  function.  Destroying a "
1209 "thread attributes object has no effect on threads that were created using "
1210 "that object."
1211 msgstr ""
1212 "スレッド属性オブジェクトがもはや必要なくなった際には、\n"
1213 "そのオブジェクトは B<pthread_attr_destroy>() 関数を使って破棄すべきである。\n"
1214 "スレッド属性オブジェクトを破棄しても、\n"
1215 "そのオブジェクトを使って作成されたスレッドには影響はない。"
1216
1217 #. type: Plain text
1218 #: build/C/man3/pthread_attr_init.3:68
1219 msgid ""
1220 "Once a thread attributes object has been destroyed, it can be reinitialized "
1221 "using B<pthread_attr_init>().  Any other use of a destroyed thread "
1222 "attributes object has undefined results."
1223 msgstr ""
1224 "いったん破棄したスレッド属性オブジェクトは、\n"
1225 "B<pthread_attr_init>() を使って再初期化することができる。\n"
1226 "破棄したスレッド属性オブジェクトをこれ以外の用途で\n"
1227 "使った場合の結果は不定である。"
1228
1229 #. type: Plain text
1230 #: build/C/man3/pthread_attr_init.3:71
1231 #: build/C/man3/pthread_attr_setaffinity_np.3:79
1232 #: build/C/man3/pthread_attr_setdetachstate.3:80
1233 #: build/C/man3/pthread_attr_setguardsize.3:93
1234 #: build/C/man3/pthread_attr_setinheritsched.3:96
1235 #: build/C/man3/pthread_attr_setschedparam.3:88
1236 #: build/C/man3/pthread_attr_setschedpolicy.3:86
1237 #: build/C/man3/pthread_attr_setscope.3:106
1238 #: build/C/man3/pthread_attr_setstack.3:88
1239 #: build/C/man3/pthread_attr_setstackaddr.3:77
1240 #: build/C/man3/pthread_attr_setstacksize.3:64
1241 #: build/C/man3/pthread_setaffinity_np.3:80
1242 #: build/C/man3/pthread_setcancelstate.3:95
1243 #: build/C/man3/pthread_setname_np.3:75
1244 msgid ""
1245 "On success, these functions return 0; on error, they return a nonzero error "
1246 "number."
1247 msgstr ""
1248 "成功すると、これらの関数は 0 を返す。\n"
1249 "エラーの場合、0 以外のエラー番号を返す。"
1250
1251 #. type: Plain text
1252 #: build/C/man3/pthread_attr_init.3:79
1253 msgid ""
1254 "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on "
1255 "Linux these functions always succeed (but portable and future-proof "
1256 "applications should nevertheless handle a possible error return)."
1257 msgstr ""
1258 "POSIX.1-2001 では B<pthread_attr_init>() にはエラー B<ENOMEM> が\n"
1259 "記載されている。\n"
1260 "Linux では、これらの関数は常に成功する\n"
1261 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
1262 "正のエラーの返り値を処理するようにすべきである)。"
1263
1264 #. type: Plain text
1265 #: build/C/man3/pthread_attr_init.3:81
1266 #: build/C/man3/pthread_attr_setdetachstate.3:96
1267 #: build/C/man3/pthread_attr_setguardsize.3:115
1268 #: build/C/man3/pthread_attr_setinheritsched.3:112
1269 #: build/C/man3/pthread_attr_setschedparam.3:102
1270 #: build/C/man3/pthread_attr_setschedpolicy.3:102
1271 #: build/C/man3/pthread_attr_setscope.3:121
1272 #: build/C/man3/pthread_attr_setstack.3:114
1273 #: build/C/man3/pthread_attr_setstacksize.3:85
1274 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129
1275 #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_detach.3:66
1276 #: build/C/man3/pthread_equal.3:49 build/C/man3/pthread_exit.3:77
1277 #: build/C/man3/pthread_getcpuclockid.3:67 build/C/man3/pthread_join.3:100
1278 #: build/C/man3/pthread_self.3:52 build/C/man3/pthread_setcancelstate.3:115
1279 #: build/C/man3/pthread_setconcurrency.3:85
1280 #: build/C/man3/pthread_setschedparam.3:143
1281 #: build/C/man3/pthread_setschedprio.3:85 build/C/man3/pthread_sigmask.3:71
1282 #: build/C/man3/pthread_testcancel.3:60
1283 msgid "POSIX.1-2001."
1284 msgstr "POSIX.1-2001."
1285
1286 #. type: Plain text
1287 #: build/C/man3/pthread_attr_init.3:87
1288 msgid ""
1289 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1290 "object other than via pthreads functions is nonportable and produces "
1291 "undefined results."
1292 msgstr ""
1293 "I<pthread_attr_t> 型の内部構造は意識すべきではない。\n"
1294 "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n"
1295 "どのような結果が得られるかも分からない。"
1296
1297 #. type: Plain text
1298 #: build/C/man3/pthread_attr_init.3:96
1299 msgid ""
1300 "The program below optionally makes use of B<pthread_attr_init>()  and "
1301 "various related functions to initialize a thread attributes object that is "
1302 "used to create a single thread.  Once created, the thread uses the "
1303 "B<pthread_getattr_np>(3)  function (a nonstandard GNU extension) to retrieve "
1304 "the thread's attributes, and then displays those attributes."
1305 msgstr ""
1306 "下記のプログラムは、B<pthread_attr_init>() と種々の関連関数を使って、\n"
1307 "スレッド属性オブジェクトの初期化を行い、\n"
1308 "そのオブジェクトを使ってスレッドを一つ作成する。\n"
1309 "作成されたスレッドは、作成後に B<pthread_getattr_np>(3) 関数 \n"
1310 "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n"
1311 "取得した属性を表示する。"
1312
1313 #. type: Plain text
1314 #: build/C/man3/pthread_attr_init.3:105
1315 msgid ""
1316 "If the program is run with no command-line argument, then it passes NULL as "
1317 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1318 "with default attributes.  Running the program on Linux/x86-32 with the NPTL "
1319 "threading implementation, we see the following:"
1320 msgstr ""
1321 "コマンドライン引き数なしでプログラムを実行した場合、\n"
1322 "B<pthread_create>(3) の I<attr> 引き数には NULL が渡される。\n"
1323 "この場合、スレッドはデフォルトの属性で作成される。\n"
1324 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1325 "動作させると、以下のような出力が得られる。"
1326
1327 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1328 #. type: Plain text
1329 #: build/C/man3/pthread_attr_init.3:121
1330 #, no-wrap
1331 msgid ""
1332 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1333 "unlimited\n"
1334 "$B< ./a.out>\n"
1335 "Thread attributes:\n"
1336 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1337 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1338 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1339 "        Scheduling policy   = SCHED_OTHER\n"
1340 "        Scheduling priority = 0\n"
1341 "        Guard size          = 4096 bytes\n"
1342 "        Stack address       = 0x40196000\n"
1343 "        Stack size          = 0x201000 bytes\n"
1344 msgstr ""
1345 "$B< ulimit -s>       # No stack imit ==E<gt> default stack size is 2MB\n"
1346 "unlimited\n"
1347 "$B< ./a.out>\n"
1348 "Thread attributes:\n"
1349 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1350 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1351 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1352 "        Scheduling policy   = SCHED_OTHER\n"
1353 "        Scheduling priority = 0\n"
1354 "        Guard size          = 4096 bytes\n"
1355 "        Stack address       = 0x40196000\n"
1356 "        Stack size          = 0x201000 bytes\n"
1357
1358 #. type: Plain text
1359 #: build/C/man3/pthread_attr_init.3:131
1360 msgid ""
1361 "When we supply a stack size as a command-line argument, the program "
1362 "initializes a thread attributes object, sets various attributes in that "
1363 "object, and passes a pointer to the object in the call to B<pthread_create>"
1364 "(3).  Running the program on Linux/x86-32 with the NPTL threading "
1365 "implementation, we see the following:"
1366 msgstr ""
1367 "コマンドライン引き数でスタックサイズが与えられた場合、\n"
1368 "このプログラムは、スレッド属性オブジェクトを初期化し、\n"
1369 "そのオブジェクトの各種属性を設定し、\n"
1370 "B<pthread_create>(3) の呼び出しでこのオブジェクトへのポインタを渡す。\n"
1371 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1372 "動作させると、以下のような出力が得られる。"
1373
1374 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1375 #. type: Plain text
1376 #: build/C/man3/pthread_attr_init.3:146
1377 #, no-wrap
1378 msgid ""
1379 "$B< ./a.out 0x3000000>\n"
1380 "posix_memalign() allocated at 0x40197000\n"
1381 "Thread attributes:\n"
1382 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1383 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1384 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1385 "        Scheduling policy   = SCHED_OTHER\n"
1386 "        Scheduling priority = 0\n"
1387 "        Guard size          = 0 bytes\n"
1388 "        Stack address       = 0x40197000\n"
1389 "        Stack size          = 0x3000000 bytes\n"
1390 msgstr ""
1391 "$B< ./a.out 0x3000000>\n"
1392 "posix_memalign() allocated at 0x40197000\n"
1393 "Thread attributes:\n"
1394 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1395 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1396 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1397 "        Scheduling policy   = SCHED_OTHER\n"
1398 "        Scheduling priority = 0\n"
1399 "        Guard size          = 0 bytes\n"
1400 "        Stack address       = 0x40197000\n"
1401 "        Stack size          = 0x3000000 bytes\n"
1402
1403 #. type: Plain text
1404 #: build/C/man3/pthread_attr_init.3:157 build/C/man3/pthread_getattr_np.3:188
1405 #, no-wrap
1406 msgid ""
1407 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1408 "#include E<lt>pthread.hE<gt>\n"
1409 "#include E<lt>stdio.hE<gt>\n"
1410 "#include E<lt>stdlib.hE<gt>\n"
1411 "#include E<lt>unistd.hE<gt>\n"
1412 "#include E<lt>errno.hE<gt>\n"
1413 msgstr ""
1414 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1415 "#include E<lt>pthread.hE<gt>\n"
1416 "#include E<lt>stdio.hE<gt>\n"
1417 "#include E<lt>stdlib.hE<gt>\n"
1418 "#include E<lt>unistd.hE<gt>\n"
1419 "#include E<lt>errno.hE<gt>\n"
1420
1421 #. type: Plain text
1422 #: build/C/man3/pthread_attr_init.3:160 build/C/man3/pthread_cancel.3:162
1423 #: build/C/man3/pthread_cleanup_push.3:243 build/C/man3/pthread_create.3:254
1424 #: build/C/man3/pthread_getattr_np.3:191
1425 #: build/C/man3/pthread_getcpuclockid.3:114
1426 #: build/C/man3/pthread_setaffinity_np.3:172
1427 #: build/C/man3/pthread_setschedparam.3:237 build/C/man3/pthread_sigmask.3:105
1428 #, no-wrap
1429 msgid ""
1430 "#define handle_error_en(en, msg) \\e\n"
1431 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1432 msgstr ""
1433 "#define handle_error_en(en, msg) \\e\n"
1434 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1435
1436 #. type: Plain text
1437 #: build/C/man3/pthread_attr_init.3:168
1438 #, no-wrap
1439 msgid ""
1440 "static void\n"
1441 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1442 "{\n"
1443 "    int s, i;\n"
1444 "    size_t v;\n"
1445 "    void *stkaddr;\n"
1446 "    struct sched_param sp;\n"
1447 msgstr ""
1448 "static void\n"
1449 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1450 "{\n"
1451 "    int s, i;\n"
1452 "    size_t v;\n"
1453 "    void *stkaddr;\n"
1454 "    struct sched_param sp;\n"
1455
1456 #. type: Plain text
1457 #: build/C/man3/pthread_attr_init.3:176
1458 #, no-wrap
1459 msgid ""
1460 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1461 "    if (s != 0)\n"
1462 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1463 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1464 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1465 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1466 "            \"???\");\n"
1467 msgstr ""
1468 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1469 "    if (s != 0)\n"
1470 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1471 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1472 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1473 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1474 "            \"???\");\n"
1475
1476 #. type: Plain text
1477 #: build/C/man3/pthread_attr_init.3:184
1478 #, no-wrap
1479 msgid ""
1480 "    s = pthread_attr_getscope(attr, &i);\n"
1481 "    if (s != 0)\n"
1482 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1483 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1484 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1485 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1486 "            \"???\");\n"
1487 msgstr ""
1488 "    s = pthread_attr_getscope(attr, &i);\n"
1489 "    if (s != 0)\n"
1490 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1491 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1492 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1493 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1494 "            \"???\");\n"
1495
1496 #. type: Plain text
1497 #: build/C/man3/pthread_attr_init.3:192
1498 #, no-wrap
1499 msgid ""
1500 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1501 "    if (s != 0)\n"
1502 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1503 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1504 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1505 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1506 "            \"???\");\n"
1507 msgstr ""
1508 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1509 "    if (s != 0)\n"
1510 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1511 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1512 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1513 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1514 "            \"???\");\n"
1515
1516 #. type: Plain text
1517 #: build/C/man3/pthread_attr_init.3:201
1518 #, no-wrap
1519 msgid ""
1520 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1521 "    if (s != 0)\n"
1522 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1523 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1524 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1525 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1526 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1527 "            \"???\");\n"
1528 msgstr ""
1529 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1530 "    if (s != 0)\n"
1531 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1532 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1533 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1534 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1535 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1536 "            \"???\");\n"
1537
1538 #. type: Plain text
1539 #: build/C/man3/pthread_attr_init.3:206
1540 #, no-wrap
1541 msgid ""
1542 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1543 "    if (s != 0)\n"
1544 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1545 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1546 msgstr ""
1547 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1548 "    if (s != 0)\n"
1549 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1550 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1551
1552 #. type: Plain text
1553 #: build/C/man3/pthread_attr_init.3:211
1554 #, no-wrap
1555 msgid ""
1556 "    s = pthread_attr_getguardsize(attr, &v);\n"
1557 "    if (s != 0)\n"
1558 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1559 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1560 msgstr ""
1561 "    s = pthread_attr_getguardsize(attr, &v);\n"
1562 "    if (s != 0)\n"
1563 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1564 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1565
1566 #. type: Plain text
1567 #: build/C/man3/pthread_attr_init.3:218
1568 #, no-wrap
1569 msgid ""
1570 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1571 "    if (s != 0)\n"
1572 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1573 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1574 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1575 "}\n"
1576 msgstr ""
1577 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1578 "    if (s != 0)\n"
1579 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1580 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1581 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1582 "}\n"
1583
1584 #. type: Plain text
1585 #: build/C/man3/pthread_attr_init.3:224
1586 #, no-wrap
1587 msgid ""
1588 "static void *\n"
1589 "thread_start(void *arg)\n"
1590 "{\n"
1591 "    int s;\n"
1592 "    pthread_attr_t gattr;\n"
1593 msgstr ""
1594 "static void *\n"
1595 "thread_start(void *arg)\n"
1596 "{\n"
1597 "    int s;\n"
1598 "    pthread_attr_t gattr;\n"
1599
1600 #. type: Plain text
1601 #: build/C/man3/pthread_attr_init.3:228
1602 #, no-wrap
1603 msgid ""
1604 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1605 "       retrieves the attributes of the thread specified in its\n"
1606 "       first argument */\n"
1607 msgstr ""
1608 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1609 "       retrieves the attributes of the thread specified in its\n"
1610 "       first argument */\n"
1611
1612 #. type: Plain text
1613 #: build/C/man3/pthread_attr_init.3:232
1614 #, no-wrap
1615 msgid ""
1616 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1617 "    if (s != 0)\n"
1618 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1619 msgstr ""
1620 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1621 "    if (s != 0)\n"
1622 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1623
1624 #. type: Plain text
1625 #: build/C/man3/pthread_attr_init.3:235
1626 #, no-wrap
1627 msgid ""
1628 "    printf(\"Thread attributes:\\en\");\n"
1629 "    display_pthread_attr(&gattr, \"\\et\");\n"
1630 msgstr ""
1631 "    printf(\"Thread attributes:\\en\");\n"
1632 "    display_pthread_attr(&gattr, \"\\et\");\n"
1633
1634 #. type: Plain text
1635 #: build/C/man3/pthread_attr_init.3:238 build/C/man3/pthread_getattr_np.3:240
1636 #, no-wrap
1637 msgid ""
1638 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1639 "}\n"
1640 msgstr ""
1641 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1642 "}\n"
1643
1644 #. type: Plain text
1645 #: build/C/man3/pthread_attr_init.3:246
1646 #, no-wrap
1647 msgid ""
1648 "int\n"
1649 "main(int argc, char *argv[])\n"
1650 "{\n"
1651 "    pthread_t thr;\n"
1652 "    pthread_attr_t attr;\n"
1653 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1654 "    int s;\n"
1655 msgstr ""
1656 "int\n"
1657 "main(int argc, char *argv[])\n"
1658 "{\n"
1659 "    pthread_t thr;\n"
1660 "    pthread_attr_t attr;\n"
1661 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1662 "    int s;\n"
1663
1664 #. type: Plain text
1665 #: build/C/man3/pthread_attr_init.3:248
1666 #: build/C/man3/pthread_setschedparam.3:355
1667 #, no-wrap
1668 msgid "    attrp = NULL;\n"
1669 msgstr "    attrp = NULL;\n"
1670
1671 #. type: Plain text
1672 #: build/C/man3/pthread_attr_init.3:252
1673 #, no-wrap
1674 msgid ""
1675 "    /* If a command-line argument was supplied, use it to set the\n"
1676 "       stack-size attribute and set a few other thread attributes,\n"
1677 "       and set attrp pointing to thread attributes object */\n"
1678 msgstr ""
1679 "    /* If a command-line argument was supplied, use it to set the\n"
1680 "       stack-size attribute and set a few other thread attributes,\n"
1681 "       and set attrp pointing to thread attributes object */\n"
1682
1683 #. type: Plain text
1684 #: build/C/man3/pthread_attr_init.3:256
1685 #, no-wrap
1686 msgid ""
1687 "    if (argc E<gt> 1) {\n"
1688 "        int stack_size;\n"
1689 "        void *sp;\n"
1690 msgstr ""
1691 "    if (argc E<gt> 1) {\n"
1692 "        int stack_size;\n"
1693 "        void *sp;\n"
1694
1695 #. type: Plain text
1696 #: build/C/man3/pthread_attr_init.3:258
1697 #, no-wrap
1698 msgid "        attrp = &attr;\n"
1699 msgstr "        attrp = &attr;\n"
1700
1701 #. type: Plain text
1702 #: build/C/man3/pthread_attr_init.3:262
1703 #, no-wrap
1704 msgid ""
1705 "        s = pthread_attr_init(&attr);\n"
1706 "        if (s != 0)\n"
1707 "            handle_error_en(s, \"pthread_attr_init\");\n"
1708 msgstr ""
1709 "        s = pthread_attr_init(&attr);\n"
1710 "        if (s != 0)\n"
1711 "            handle_error_en(s, \"pthread_attr_init\");\n"
1712
1713 #. type: Plain text
1714 #: build/C/man3/pthread_attr_init.3:266
1715 #, no-wrap
1716 msgid ""
1717 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1718 "        if (s != 0)\n"
1719 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1720 msgstr ""
1721 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1722 "        if (s != 0)\n"
1723 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1724
1725 #. type: Plain text
1726 #: build/C/man3/pthread_attr_init.3:270
1727 #, no-wrap
1728 msgid ""
1729 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1730 "        if (s != 0)\n"
1731 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1732 msgstr ""
1733 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1734 "        if (s != 0)\n"
1735 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1736
1737 #. type: Plain text
1738 #: build/C/man3/pthread_attr_init.3:272
1739 #, no-wrap
1740 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1741 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
1742
1743 #. type: Plain text
1744 #: build/C/man3/pthread_attr_init.3:276
1745 #, no-wrap
1746 msgid ""
1747 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1748 "        if (s != 0)\n"
1749 "            handle_error_en(s, \"posix_memalign\");\n"
1750 msgstr ""
1751 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1752 "        if (s != 0)\n"
1753 "            handle_error_en(s, \"posix_memalign\");\n"
1754
1755 #. type: Plain text
1756 #: build/C/man3/pthread_attr_init.3:278
1757 #, no-wrap
1758 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1759 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1760
1761 #. type: Plain text
1762 #: build/C/man3/pthread_attr_init.3:283
1763 #, no-wrap
1764 msgid ""
1765 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1766 "        if (s != 0)\n"
1767 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1768 "    }\n"
1769 msgstr ""
1770 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1771 "        if (s != 0)\n"
1772 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1773 "    }\n"
1774
1775 #. type: Plain text
1776 #: build/C/man3/pthread_attr_init.3:287 build/C/man3/pthread_getattr_np.3:335
1777 #, no-wrap
1778 msgid ""
1779 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1780 "    if (s != 0)\n"
1781 "        handle_error_en(s, \"pthread_create\");\n"
1782 msgstr ""
1783 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1784 "    if (s != 0)\n"
1785 "        handle_error_en(s, \"pthread_create\");\n"
1786
1787 #. type: Plain text
1788 #: build/C/man3/pthread_attr_init.3:293 build/C/man3/pthread_getattr_np.3:341
1789 #, no-wrap
1790 msgid ""
1791 "    if (attrp != NULL) {\n"
1792 "        s = pthread_attr_destroy(attrp);\n"
1793 "        if (s != 0)\n"
1794 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1795 "    }\n"
1796 msgstr ""
1797 "    if (attrp != NULL) {\n"
1798 "        s = pthread_attr_destroy(attrp);\n"
1799 "        if (s != 0)\n"
1800 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1801 "    }\n"
1802
1803 #. type: Plain text
1804 #: build/C/man3/pthread_attr_init.3:296 build/C/man3/pthread_getattr_np.3:344
1805 #, no-wrap
1806 msgid ""
1807 "    pause();    /* Terminates when other thread calls exit() */\n"
1808 "}\n"
1809 msgstr ""
1810 "    pause();    /* Terminates when other thread calls exit() */\n"
1811 "}\n"
1812
1813 #. type: Plain text
1814 #: build/C/man3/pthread_attr_init.3:313
1815 msgid ""
1816 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1817 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1818 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1819 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1820 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1821 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1822 msgstr ""
1823 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1824 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1825 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1826 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1827 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1828 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1829
1830 #. type: TH
1831 #: build/C/man3/pthread_attr_setaffinity_np.3:26
1832 #, no-wrap
1833 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1834 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1835
1836 #. type: TH
1837 #: build/C/man3/pthread_attr_setaffinity_np.3:26
1838 #: build/C/man3/pthread_getattr_np.3:26
1839 #: build/C/man3/pthread_setaffinity_np.3:26
1840 #: build/C/man3/pthread_tryjoin_np.3:26
1841 #, no-wrap
1842 msgid "2010-09-10"
1843 msgstr "2010-09-10"
1844
1845 #. type: Plain text
1846 #: build/C/man3/pthread_attr_setaffinity_np.3:30
1847 msgid ""
1848 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1849 "affinity attribute in thread attributes object"
1850 msgstr ""
1851 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
1852 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
1853
1854 #. type: Plain text
1855 #: build/C/man3/pthread_attr_setaffinity_np.3:34
1856 #: build/C/man3/pthread_getattr_np.3:33
1857 #: build/C/man3/pthread_setaffinity_np.3:34
1858 #: build/C/man3/pthread_tryjoin_np.3:34 build/C/man3/pthread_yield.3:32
1859 #, no-wrap
1860 msgid ""
1861 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1862 "B<#include E<lt>pthread.hE<gt>>\n"
1863 msgstr ""
1864 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1865 "B<#include E<lt>pthread.hE<gt>>\n"
1866
1867 #. type: Plain text
1868 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1869 #, no-wrap
1870 msgid ""
1871 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1872 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1873 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1874 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1875 msgstr ""
1876 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1877 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1878 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1879 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1880
1881 #. type: Plain text
1882 #: build/C/man3/pthread_attr_setaffinity_np.3:54
1883 msgid ""
1884 "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask "
1885 "attribute of the thread attributes object referred to by I<attr> to the "
1886 "value specified in I<cpuset>.  This attribute determines the CPU affinity "
1887 "mask of a thread created using the thread attributes object I<attr>."
1888 msgstr ""
1889 "B<pthread_attr_setaffinity_np>() 関数は、\n"
1890 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
1891 "I<cpuset> で指定された値に設定する。\n"
1892 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
1893 "作成されたスレッドの CPU affinity マスクが決定される。"
1894
1895 #. type: Plain text
1896 #: build/C/man3/pthread_attr_setaffinity_np.3:63
1897 msgid ""
1898 "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask "
1899 "attribute of the thread attributes object referred to by I<attr> in the "
1900 "buffer pointed to by I<cpuset>."
1901 msgstr ""
1902 "B<pthread_attr_getaffinity_np>() 関数は、 I<attr> が参照する\n"
1903 "スレッド属性オブジェクトの CPU affinity マスク属性を\n"
1904 "I<cpuset> が指すバッファに入れて返す。"
1905
1906 #. type: Plain text
1907 #: build/C/man3/pthread_attr_setaffinity_np.3:70
1908 msgid ""
1909 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1910 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
1911 "(cpu_set_t)>."
1912 msgstr ""
1913 "I<cpusetsize> 引き数は I<cpuset> が指すバッファの (バイト単位の)\n"
1914 "大きさである。通常は、この引き数には I<sizeof(cpu_set_t)> を\n"
1915 "指定することだろう。"
1916
1917 #. type: Plain text
1918 #: build/C/man3/pthread_attr_setaffinity_np.3:76
1919 #: build/C/man3/pthread_setaffinity_np.3:67
1920 msgid ""
1921 "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a "
1922 "description of a set of macros that can be used to manipulate and inspect "
1923 "CPU sets, see B<CPU_SET>(3)."
1924 msgstr ""
1925 "CPU affinity マスクの詳細については、 \n"
1926 "B<sched_setaffinity>(2) を参照してほしい。\n"
1927 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
1928 "B<CPU_SET>(3) を参照してほしい。"
1929
1930 #. type: TP
1931 #: build/C/man3/pthread_attr_setaffinity_np.3:80
1932 #: build/C/man3/pthread_attr_setaffinity_np.3:92
1933 #: build/C/man3/pthread_attr_setdetachstate.3:83
1934 #: build/C/man3/pthread_attr_setinheritsched.3:99
1935 #: build/C/man3/pthread_attr_setschedpolicy.3:89
1936 #: build/C/man3/pthread_attr_setscope.3:109
1937 #: build/C/man3/pthread_attr_setstack.3:91
1938 #: build/C/man3/pthread_attr_setstacksize.3:67
1939 #: build/C/man3/pthread_create.3:137 build/C/man3/pthread_detach.3:55
1940 #: build/C/man3/pthread_join.3:85 build/C/man3/pthread_join.3:89
1941 #: build/C/man3/pthread_kill.3:69 build/C/man3/pthread_setaffinity_np.3:84
1942 #: build/C/man3/pthread_setaffinity_np.3:93
1943 #: build/C/man3/pthread_setaffinity_np.3:109
1944 #: build/C/man3/pthread_setcancelstate.3:99
1945 #: build/C/man3/pthread_setcancelstate.3:107
1946 #: build/C/man3/pthread_setconcurrency.3:71
1947 #: build/C/man3/pthread_setschedparam.3:122
1948 #: build/C/man3/pthread_setschedprio.3:62 build/C/man3/pthread_sigqueue.3:77
1949 #, no-wrap
1950 msgid "B<EINVAL>"
1951 msgstr "B<EINVAL>"
1952
1953 #.  cpumask_t
1954 #.  The raw sched_getaffinity() system call returns the size (in bytes)
1955 #.  of the cpumask_t type.
1956 #. type: Plain text
1957 #: build/C/man3/pthread_attr_setaffinity_np.3:92
1958 msgid ""
1959 "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was "
1960 "outside the set supported by the kernel.  (The kernel configuration option "
1961 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
1962 "type used to represent CPU sets.)"
1963 msgstr ""
1964 "(B<pthread_attr_setaffinity_np>())\n"
1965 "I<cpuset> がカーネルがサポートする CPU 集合にない CPU を指定していた。\n"
1966 "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲"
1967 "は、\n"
1968 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
1969
1970 #. type: Plain text
1971 #: build/C/man3/pthread_attr_setaffinity_np.3:102
1972 msgid ""
1973 "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread "
1974 "attributes object referred to by I<attr> lies outside the range specified by "
1975 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
1976 msgstr ""
1977 "(B<pthread_attr_getaffinity_np>())\n"
1978 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
1979 "I<cpusetsize> により指定された範囲の中になかった\n"
1980 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
1981
1982 #. type: Plain text
1983 #: build/C/man3/pthread_attr_setaffinity_np.3:106
1984 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
1985 msgstr ""
1986 "(B<pthread_attr_setaffinity_np>()) メモリを割り当てることができなかった。"
1987
1988 #. type: Plain text
1989 #: build/C/man3/pthread_attr_setaffinity_np.3:108
1990 #: build/C/man3/pthread_setaffinity_np.3:121
1991 msgid "These functions are provided by glibc since version 2.3.4."
1992 msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。"
1993
1994 #. type: Plain text
1995 #: build/C/man3/pthread_attr_setaffinity_np.3:111
1996 #: build/C/man3/pthread_cleanup_push_defer_np.3:104
1997 #: build/C/man3/pthread_setaffinity_np.3:124
1998 #: build/C/man3/pthread_tryjoin_np.3:115
1999 msgid ""
2000 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
2001 "\" (nonportable) in the names."
2002 msgstr ""
2003 "これらの関数は非標準の GNU による拡張である。\n"
2004 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
2005 "付いている。"
2006
2007 #. type: Plain text
2008 #: build/C/man3/pthread_attr_setaffinity_np.3:118
2009 #: build/C/man3/pthread_setaffinity_np.3:150
2010 msgid ""
2011 "In glibc 2.3.3 only, versions of these functions were provided that did not "
2012 "have a I<cpusetsize> argument.  Instead the CPU set size given to the "
2013 "underlying system calls was always I<sizeof(cpu_set_t)>."
2014 msgstr ""
2015 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
2016 "これらの関数は I<cpusetsize> 引き数を持っていなかった。\n"
2017 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
2018 "常に I<sizeof(cpu_set_t)> であった。"
2019
2020 #. type: Plain text
2021 #: build/C/man3/pthread_attr_setaffinity_np.3:124
2022 msgid ""
2023 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
2024 "(3), B<cpuset>(7), B<pthreads>(7)"
2025 msgstr ""
2026 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
2027 "(3), B<cpuset>(7), B<pthreads>(7)"
2028
2029 #. type: TH
2030 #: build/C/man3/pthread_attr_setdetachstate.3:26
2031 #, no-wrap
2032 msgid "PTHREAD_ATTR_SETDETACHSTATE"
2033 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
2034
2035 #. type: Plain text
2036 #: build/C/man3/pthread_attr_setdetachstate.3:30
2037 msgid ""
2038 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
2039 "state attribute in thread attributes object"
2040 msgstr ""
2041 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
2042 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
2043
2044 #. type: Plain text
2045 #: build/C/man3/pthread_attr_setdetachstate.3:38
2046 #, no-wrap
2047 msgid ""
2048 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2049 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2050 msgstr ""
2051 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2052 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2053
2054 #. type: Plain text
2055 #: build/C/man3/pthread_attr_setdetachstate.3:53
2056 msgid ""
2057 "The B<pthread_attr_setdetachstate>()  function sets the detach state "
2058 "attribute of the thread attributes object referred to by I<attr> to the "
2059 "value specified in I<detachstate>.  The detach state attribute determines "
2060 "whether a thread created using the thread attributes object I<attr> will be "
2061 "created in a joinable or a detached state."
2062 msgstr ""
2063 "B<pthread_attr_setdetachstate>() 関数は、\n"
2064 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
2065 "I<detachstate> で指定された値に設定する。\n"
2066 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2067 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
2068 "detached (切り離された) 状態で作成されるかが決定される。"
2069
2070 #. type: Plain text
2071 #: build/C/man3/pthread_attr_setdetachstate.3:56
2072 msgid "The following values may be specified in I<detachstate>:"
2073 msgstr "I<detachstate> には以下の値を指定できる。"
2074
2075 #. type: TP
2076 #: build/C/man3/pthread_attr_setdetachstate.3:56
2077 #, no-wrap
2078 msgid "B<PTHREAD_CREATE_DETACHED>"
2079 msgstr "B<PTHREAD_CREATE_DETACHED>"
2080
2081 #. type: Plain text
2082 #: build/C/man3/pthread_attr_setdetachstate.3:61
2083 msgid ""
2084 "Threads that are created using I<attr> will be created in a detached state."
2085 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
2086
2087 #. type: TP
2088 #: build/C/man3/pthread_attr_setdetachstate.3:61
2089 #, no-wrap
2090 msgid "B<PTHREAD_CREATE_JOINABLE>"
2091 msgstr "B<PTHREAD_CREATE_JOINABLE>"
2092
2093 #. type: Plain text
2094 #: build/C/man3/pthread_attr_setdetachstate.3:66
2095 msgid ""
2096 "Threads that are created using I<attr> will be created in a joinable state."
2097 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
2098
2099 #. type: Plain text
2100 #: build/C/man3/pthread_attr_setdetachstate.3:70
2101 msgid ""
2102 "The default setting of the detach state attribute in a newly initialized "
2103 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
2104 msgstr ""
2105 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
2106 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
2107
2108 #. type: Plain text
2109 #: build/C/man3/pthread_attr_setdetachstate.3:77
2110 msgid ""
2111 "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of "
2112 "the thread attributes object I<attr> in the buffer pointed to by "
2113 "I<detachstate>."
2114 msgstr ""
2115 "B<pthread_attr_getdetachstate>() は、\n"
2116 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
2117 "I<detachstate> が指すバッファに入れて返す。"
2118
2119 #. type: Plain text
2120 #: build/C/man3/pthread_attr_setdetachstate.3:83
2121 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
2122 msgstr "B<pthread_attr_setdetachstate>() は以下のエラーで失敗する場合がある。"
2123
2124 #. type: Plain text
2125 #: build/C/man3/pthread_attr_setdetachstate.3:87
2126 msgid "An invalid value was specified in I<detachstate>."
2127 msgstr "無効な値が I<detachstate> で指定された。"
2128
2129 #. type: Plain text
2130 #: build/C/man3/pthread_attr_setdetachstate.3:94
2131 msgid ""
2132 "The B<pthread_attr_setdetachstate>()  and B<pthread_attr_getdetachstate>()  "
2133 "functions are thread-safe."
2134 msgstr "関数 B<pthread_attr_setdetachstate>() と B<pthread_attr_getdetachstate>() はスレッドセーフである。"
2135
2136 #. type: Plain text
2137 #: build/C/man3/pthread_attr_setdetachstate.3:100
2138 msgid ""
2139 "See B<pthread_create>(3)  for more details on detached and joinable threads."
2140 msgstr ""
2141 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
2142 "B<pthread_create>(3) を参照。"
2143
2144 #. type: Plain text
2145 #: build/C/man3/pthread_attr_setdetachstate.3:108
2146 msgid ""
2147 "A thread that is created in a joinable state should eventually either be "
2148 "joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see "
2149 "B<pthread_create>(3)."
2150 msgstr ""
2151 "join 可能状態で作成されたスレッドは、最終的に\n"
2152 "B<pthread_join>(3) を使って join するか、\n"
2153 "B<pthread_detach>(3) を使って切り離すか、\n"
2154 "のどちらかを行うべきである。"
2155
2156 #. type: Plain text
2157 #: build/C/man3/pthread_attr_setdetachstate.3:115
2158 msgid ""
2159 "It is an error to specify the thread ID of a thread that was created in a "
2160 "detached state in a later call to B<pthread_detach>(3)  or B<pthread_join>"
2161 "(3)."
2162 msgstr ""
2163 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
2164 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
2165 "エラーである。"
2166
2167 #. type: Plain text
2168 #: build/C/man3/pthread_attr_setdetachstate.3:118
2169 #: build/C/man3/pthread_attr_setstack.3:155
2170 msgid "See B<pthread_attr_init>(3)."
2171 msgstr "B<pthread_attr_init>(3) を参照。"
2172
2173 #. type: Plain text
2174 #: build/C/man3/pthread_attr_setdetachstate.3:124
2175 msgid ""
2176 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2177 "B<pthread_join>(3), B<pthreads>(7)"
2178 msgstr ""
2179 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2180 "B<pthread_join>(3), B<pthreads>(7)"
2181
2182 #. type: TH
2183 #: build/C/man3/pthread_attr_setguardsize.3:26
2184 #, no-wrap
2185 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2186 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2187
2188 #. type: Plain text
2189 #: build/C/man3/pthread_attr_setguardsize.3:30
2190 msgid ""
2191 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2192 "attribute in thread attributes object"
2193 msgstr ""
2194 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
2195 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
2196
2197 #. type: Plain text
2198 #: build/C/man3/pthread_attr_setguardsize.3:38
2199 #, no-wrap
2200 msgid ""
2201 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2202 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2203 msgstr ""
2204 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2205 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2206
2207 #. type: Plain text
2208 #: build/C/man3/pthread_attr_setguardsize.3:49
2209 msgid ""
2210 "The B<pthread_attr_setguardsize>()  function sets the guard size attribute "
2211 "of the thread attributes object referred to by I<attr> to the value "
2212 "specified in I<guardsize>."
2213 msgstr ""
2214 "B<pthread_attr_setguardsize>() 関数は、\n"
2215 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
2216 "I<guardsize> で指定された値に設定する。"
2217
2218 #. type: Plain text
2219 #: build/C/man3/pthread_attr_setguardsize.3:59
2220 msgid ""
2221 "If I<guardsize> is greater than 0, then for each new thread created using "
2222 "I<attr> the system allocates an additional region of at least I<guardsize> "
2223 "bytes at the end of the thread's stack to act as the guard area for the "
2224 "stack (but see BUGS)."
2225 msgstr ""
2226 "I<guardsize> が 0 より大きい場合、\n"
2227 "I<attr> を使って新しく作成された各スレッドに対して、\n"
2228 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
2229 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
2230 "機能する (ただし「バグ」の節も参照)。"
2231
2232 #. type: Plain text
2233 #: build/C/man3/pthread_attr_setguardsize.3:65
2234 msgid ""
2235 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2236 "guard area."
2237 msgstr ""
2238 "I<guardsize> が 0 の場合、\n"
2239 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
2240
2241 #. type: Plain text
2242 #: build/C/man3/pthread_attr_setguardsize.3:67
2243 msgid "The default guard size is the same as the system page size."
2244 msgstr "デフォルトの guard size はシステムのページサイズと同じである。"
2245
2246 #. type: Plain text
2247 #: build/C/man3/pthread_attr_setguardsize.3:82
2248 msgid ""
2249 "If the stack address attribute has been set in I<attr> (using "
2250 "B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning "
2251 "that the caller is allocating the thread's stack, then the guard size "
2252 "attribute is ignored (i.e., no guard area is created by the system): it is "
2253 "the application's responsibility to handle stack overflow (perhaps by using "
2254 "B<mprotect>(2)  to manually define a guard area at the end of the stack that "
2255 "it has allocated)."
2256 msgstr ""
2257 "(B<pthread_attr_setstack>(3) や B<pthread_attr_setstackaddr>(3)を使って)\n"
2258 "I<attr> でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n"
2259 "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n"
2260 "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n"
2261 "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n"
2262 "ケーション側の責任となる (おそらく B<mprotect>(2) を使って、割り当て\n"
2263 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
2264
2265 #. type: Plain text
2266 #: build/C/man3/pthread_attr_setguardsize.3:90
2267 msgid ""
2268 "The B<pthread_attr_getguardsize>()  function returns the guard size "
2269 "attribute of the thread attributes object referred to by I<attr> in the "
2270 "buffer pointed to by I<guardsize>."
2271 msgstr ""
2272 "B<pthread_attr_getguardsize>() は、\n"
2273 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
2274 "I<guardsize> が指すバッファに入れて返す。"
2275
2276 #. type: Plain text
2277 #: build/C/man3/pthread_attr_setguardsize.3:104
2278 msgid ""
2279 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2280 "invalid.  On Linux these functions always succeed (but portable and future-"
2281 "proof applications should nevertheless handle a possible error return)."
2282 msgstr ""
2283 "POSIX.1-2001 では、エラー B<EINVAL> が\n"
2284 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2285 "Linux では、これらの関数は常に成功する\n"
2286 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2287 "正のエラーの返り値を処理するようにすべきである)。"
2288
2289 #. type: Plain text
2290 #: build/C/man3/pthread_attr_setguardsize.3:106
2291 #: build/C/man3/pthread_attr_setstackaddr.3:83
2292 #: build/C/man3/pthread_attr_setstacksize.3:83
2293 msgid "These functions are provided by glibc since version 2.1."
2294 msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。"
2295
2296 #. type: Plain text
2297 #: build/C/man3/pthread_attr_setguardsize.3:113
2298 msgid ""
2299 "The B<pthread_attr_setguardsize>()  and B<pthread_attr_getguardsize>()  "
2300 "functions are thread-safe."
2301 msgstr "関数e B<pthread_attr_setguardsize>() と B<pthread_attr_getguardsize>() はスレッドセーフである。"
2302
2303 #. type: Plain text
2304 #: build/C/man3/pthread_attr_setguardsize.3:129
2305 msgid ""
2306 "A guard area consists of virtual memory pages that are protected to prevent "
2307 "read and write access.  If a thread overflows its stack into the guard area, "
2308 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2309 "notifying it of the overflow.  Guard areas start on page boundaries, and the "
2310 "guard size is internally rounded up to the system page size when creating a "
2311 "thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard "
2312 "size that was set by B<pthread_attr_setguardsize>().)"
2313 msgstr ""
2314 "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n"
2315 "られた仮想メモリページで構成で構成される。スレッドがスタックをガード\n"
2316 "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャ\n"
2317 "では、スレッドに B<SIGSEGV> シグナルが送られ、オーバーフローが発生した\n"
2318 "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n"
2319 "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n"
2320 "(その場合も B<pthread_attr_getguardsize>() では\n"
2321 "B<pthread_attr_setguardsize>() で設定された guard size が返される)。"
2322
2323 #. type: Plain text
2324 #: build/C/man3/pthread_attr_setguardsize.3:133
2325 msgid ""
2326 "Setting a guard size of 0 may be useful to save memory in an application "
2327 "that creates many threads and knows that stack overflow can never occur."
2328 msgstr ""
2329 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2330 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2331 "することで、メモリを節約できることもある。"
2332
2333 #. type: Plain text
2334 #: build/C/man3/pthread_attr_setguardsize.3:137
2335 msgid ""
2336 "Choosing a guard size larger than the default size may be necessary for "
2337 "detecting stack overflows if a thread allocates large data structures on the "
2338 "stack."
2339 msgstr ""
2340 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2341 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2342 "大きな guard size を選ぶ必要があるかもしれない。"
2343
2344 #. type: SH
2345 #: build/C/man3/pthread_attr_setguardsize.3:137
2346 #: build/C/man3/pthread_attr_setinheritsched.3:112
2347 #: build/C/man3/pthread_attr_setstacksize.3:96
2348 #: build/C/man3/pthread_create.3:196 build/C/man3/pthread_exit.3:93
2349 #, no-wrap
2350 msgid "BUGS"
2351 msgstr "バグ"
2352
2353 #. type: Plain text
2354 #: build/C/man3/pthread_attr_setguardsize.3:148
2355 msgid ""
2356 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2357 "within the stack size allocation, rather than allocating extra space at the "
2358 "end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> "
2359 "error from B<pthread_create>(3)  if the guard size value is too large, "
2360 "leaving no space for the actual stack.)"
2361 msgstr ""
2362 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2363 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2364 "末尾に追加の領域を割り当てることが求められている。\n"
2365 "(このため、ガード領域が大きすぎて、\n"
2366 "実際のスタック用の場所がなくなってしまう場合、\n"
2367 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2368
2369 #.  glibc includes the guardsize within the allocated stack size,
2370 #.  which looks pretty clearly to be in violation of POSIX.
2371 #.  Filed bug, 22 Oct 2008:
2372 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2373 #.  Older reports:
2374 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2375 #.  Reportedly, LinuxThreads did the right thing, allocating
2376 #.  extra space at the end of the stack:
2377 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2378 #. type: Plain text
2379 #: build/C/man3/pthread_attr_setguardsize.3:162
2380 msgid ""
2381 "The obsolete LinuxThreads implementation did the right thing, allocating "
2382 "extra space at the end of the stack for the guard area."
2383 msgstr ""
2384 "廃止予定の LinuxThreads 実装では、\n"
2385 "POSIX.1 で求められている通りの動作で、\n"
2386 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2387
2388 #. type: Plain text
2389 #: build/C/man3/pthread_attr_setguardsize.3:165
2390 msgid "See B<pthread_getattr_np>(3)."
2391 msgstr "B<pthread_getattr_np>(3) を参照。"
2392
2393 #. type: Plain text
2394 #: build/C/man3/pthread_attr_setguardsize.3:173
2395 msgid ""
2396 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2397 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2398 msgstr ""
2399 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2400 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2401
2402 #. type: TH
2403 #: build/C/man3/pthread_attr_setinheritsched.3:26
2404 #, no-wrap
2405 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2406 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2407
2408 #. type: TH
2409 #: build/C/man3/pthread_attr_setinheritsched.3:26
2410 #: build/C/man3/pthread_attr_setscope.3:26
2411 #, no-wrap
2412 msgid "2013-04-19"
2413 msgstr "2013-04-19"
2414
2415 #. type: Plain text
2416 #: build/C/man3/pthread_attr_setinheritsched.3:30
2417 msgid ""
2418 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit-"
2419 "scheduler attribute in thread attributes object"
2420 msgstr ""
2421 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - スレッド属性オブ"
2422 "ジェクトの inherit-scheduler 属性の設定/取得を行う"
2423
2424 #. type: Plain text
2425 #: build/C/man3/pthread_attr_setinheritsched.3:38
2426 #, no-wrap
2427 msgid ""
2428 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2429 "B<                                 int >I<inheritsched>B<);>\n"
2430 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2431 "B<                                 int *>I<inheritsched>B<);>\n"
2432 msgstr ""
2433 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2434 "B<                                 int >I<inheritsched>B<);>\n"
2435 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2436 "B<                                 int *>I<inheritsched>B<);>\n"
2437
2438 #. type: Plain text
2439 #: build/C/man3/pthread_attr_setinheritsched.3:55
2440 msgid ""
2441 "The B<pthread_attr_setinheritsched>()  function sets the inherit-scheduler "
2442 "attribute of the thread attributes object referred to by I<attr> to the "
2443 "value specified in I<inheritsched>.  The inherit-scheduler attribute "
2444 "determines whether a thread created using the thread attributes object "
2445 "I<attr> will inherit its scheduling attributes from the calling thread or "
2446 "whether it will take them from I<attr>."
2447 msgstr ""
2448 "B<pthread_attr_setinheritsched>() 関数は、 I<attr> が参照するスレッド属性オブ"
2449 "ジェクトの inherit-scheduler 属性を I<inheritsched> で指定された値に設定す"
2450 "る。 inherit-scheduler 属性により、スレッド属性オブジェクト I<attr> を使って"
2451 "作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承するか、 "
2452 "I<attr> からスケジューリング属性を取得するかが決定される。"
2453
2454 #. type: Plain text
2455 #: build/C/man3/pthread_attr_setinheritsched.3:64
2456 msgid ""
2457 "The following scheduling attributes are affected by the inherit-scheduler "
2458 "attribute: scheduling policy (B<pthread_attr_setschedpolicy>(3)), scheduling "
2459 "priority (B<pthread_attr_setschedparam>(3)), and contention scope "
2460 "(B<pthread_attr_setscope>(3))."
2461 msgstr ""
2462 "次に挙げるスケジューリング属性は inherit-scheduler 属性の影響を受ける: スケ"
2463 "ジューリングポリシー (B<pthread_attr_setschedpolicy>(3))、 スケジューリング優"
2464 "先度 (B<pthread_attr_setschedparam>(3))、 contention scope "
2465 "(B<pthread_attr_setscope>(3))。"
2466
2467 #. type: Plain text
2468 #: build/C/man3/pthread_attr_setinheritsched.3:67
2469 msgid "The following values may be specified in I<inheritsched>:"
2470 msgstr "以下の値を I<inheritsched> に指定できる。"
2471
2472 #. type: TP
2473 #: build/C/man3/pthread_attr_setinheritsched.3:67
2474 #, no-wrap
2475 msgid "B<PTHREAD_INHERIT_SCHED>"
2476 msgstr "B<PTHREAD_INHERIT_SCHED>"
2477
2478 #. type: Plain text
2479 #: build/C/man3/pthread_attr_setinheritsched.3:75
2480 msgid ""
2481 "Threads that are created using I<attr> inherit scheduling attributes from "
2482 "the creating thread; the scheduling attributes in I<attr> are ignored."
2483 msgstr ""
2484 "I<attr> を使って作成されたスレッドは、\n"
2485 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2486 "I<attr> 内のスケジューリング属性は無視される。"
2487
2488 #. type: TP
2489 #: build/C/man3/pthread_attr_setinheritsched.3:75
2490 #, no-wrap
2491 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2492 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2493
2494 #.  FIXME what are the defaults for scheduler settings?
2495 #. type: Plain text
2496 #: build/C/man3/pthread_attr_setinheritsched.3:82
2497 msgid ""
2498 "Threads that are created using I<attr> take their scheduling attributes from "
2499 "the values specified by the attributes object."
2500 msgstr ""
2501 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2502 "指定された値からスケジューリング属性を取得する。"
2503
2504 #. type: Plain text
2505 #: build/C/man3/pthread_attr_setinheritsched.3:86
2506 msgid ""
2507 "The default setting of the inherit-scheduler attribute in a newly "
2508 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2509 msgstr ""
2510 "新たに初期化されたスレッド属性オブジェクトの inherit-scheduler 属性のデフォル"
2511 "ト設定は B<PTHREAD_INHERIT_SCHED> である。"
2512
2513 #. type: Plain text
2514 #: build/C/man3/pthread_attr_setinheritsched.3:93
2515 msgid ""
2516 "The B<pthread_attr_getinheritsched>()  returns the inherit-scheduler "
2517 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2518 "by I<inheritsched>."
2519 msgstr ""
2520 "B<pthread_attr_getinheritsched>() は、 スレッド属性オブジェクト I<attr> の "
2521 "inherit-scheduler 属性を I<inheritsched> が指すバッファに入れて返す。"
2522
2523 #. type: Plain text
2524 #: build/C/man3/pthread_attr_setinheritsched.3:99
2525 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2526 msgstr "B<pthread_attr_setinheritsched>() は以下のエラーで失敗する場合がある。"
2527
2528 #. type: Plain text
2529 #: build/C/man3/pthread_attr_setinheritsched.3:103
2530 msgid "Invalid value in I<inheritsched>."
2531 msgstr "I<inheritsched> に無効な値が指定された。"
2532
2533 #.  .SH VERSIONS
2534 #.  Available since glibc 2.0.
2535 #. type: Plain text
2536 #: build/C/man3/pthread_attr_setinheritsched.3:110
2537 msgid ""
2538 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2539 "to set the attribute to an unsupported value\") for "
2540 "B<pthread_attr_setinheritsched>()."
2541 msgstr ""
2542 "POSIX.1-2001 では、 B<pthread_attr_setinheritsched>() に関して\n"
2543 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2544 "も追加で規定されている。"
2545
2546 #.  FIXME . Track status of the following bug:
2547 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2548 #. type: Plain text
2549 #: build/C/man3/pthread_attr_setinheritsched.3:128
2550 msgid ""
2551 "As at glibc 2.8, if a thread attributes object is initialized using "
2552 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2553 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, "
2554 "if the inherit-scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2555 "then a thread created using the attribute object wrongly inherits its "
2556 "scheduling attributes from the creating thread.  This bug does not occur if "
2557 "either the scheduling policy or scheduling priority attribute is explicitly "
2558 "set in the thread attributes object before calling B<pthread_create>(3)."
2559 msgstr ""
2560 "glibc 2.8 の時点では、スレッド属性オブジェクトが B<pthread_attr_init>(3) を"
2561 "使って初期化された場合、 スレッド属性オブジェクトのスケジューリングポリシー"
2562 "が B<SCHED_OTHER> に、 スケジューリング優先度が 0 に設定される。一方、その後 "
2563 "inherit-scheduler 属性に B<PTHREAD_EXPLICIT_SCHED> が設定されると、このスレッ"
2564 "ド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するスレッド"
2565 "のスケジューリング属性が間違って継承されてしまう。 B<pthread_create>(3) を呼"
2566 "び出す前にスケジューリングポリシー属性かスケジューリング優先度属性のどちらか"
2567 "が明示的に設定された場合には、 このバグは発生しない。"
2568
2569 #. type: Plain text
2570 #: build/C/man3/pthread_attr_setinheritsched.3:131
2571 #: build/C/man3/pthread_attr_setschedparam.3:109
2572 #: build/C/man3/pthread_attr_setschedpolicy.3:105
2573 msgid "See B<pthread_setschedparam>(3)."
2574 msgstr "B<pthread_setschedparam>(3) を参照。"
2575
2576 #. type: Plain text
2577 #: build/C/man3/pthread_attr_setinheritsched.3:143
2578 msgid ""
2579 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2580 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2581 "B<pthread_attr_setscope>(3), B<pthread_create>(3), B<pthread_setschedparam>"
2582 "(3), B<pthread_setschedprio>(3), B<pthreads>(7)"
2583 msgstr ""
2584 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2585 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2586 "B<pthread_attr_setscope>(3), B<pthread_create>(3), B<pthread_setschedparam>"
2587 "(3), B<pthread_setschedprio>(3), B<pthreads>(7)"
2588
2589 #. type: TH
2590 #: build/C/man3/pthread_attr_setschedparam.3:26
2591 #, no-wrap
2592 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2593 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2594
2595 #. type: TH
2596 #: build/C/man3/pthread_attr_setschedparam.3:26
2597 #: build/C/man3/pthread_attr_setschedpolicy.3:26
2598 #: build/C/man3/pthread_setname_np.3:26
2599 #, no-wrap
2600 msgid "2013-06-21"
2601 msgstr "2013-06-21"
2602
2603 #. type: Plain text
2604 #: build/C/man3/pthread_attr_setschedparam.3:30
2605 msgid ""
2606 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2607 "parameter attributes in thread attributes object"
2608 msgstr ""
2609 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
2610 "スレッド属性オブジェクトのスケジューリングパラメータ属性の設定/取得を行う"
2611
2612 #. type: Plain text
2613 #: build/C/man3/pthread_attr_setschedparam.3:38
2614 #, no-wrap
2615 msgid ""
2616 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2617 "B<                               const struct sched_param *>I<param>B<);>\n"
2618 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2619 "B<                               struct sched_param *>I<param>B<);>\n"
2620 msgstr ""
2621 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2622 "B<                               const struct sched_param *>I<param>B<);>\n"
2623 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2624 "B<                               struct sched_param *>I<param>B<);>\n"
2625
2626 #. type: Plain text
2627 #: build/C/man3/pthread_attr_setschedparam.3:52
2628 msgid ""
2629 "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter "
2630 "attributes of the thread attributes object referred to by I<attr> to the "
2631 "values specified in the buffer pointed to by I<param>.  These attributes "
2632 "determine the scheduling parameters of a thread created using the thread "
2633 "attributes object I<attr>."
2634 msgstr ""
2635 "B<pthread_attr_setschedparam>() 関数は、\n"
2636 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2637 "パラメータ属性を I<param> が指すバッファで指定された値に設定する。\n"
2638 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2639 "作成されるスレッドのスケジューリングパラメータが決定される。"
2640
2641 #. type: Plain text
2642 #: build/C/man3/pthread_attr_setschedparam.3:59
2643 msgid ""
2644 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
2645 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2646 "by I<param>."
2647 msgstr ""
2648 "B<pthread_attr_getschedparam>() は、\n"
2649 "スレッド属性オブジェクト I<attr> のスケジューリングパラメータ属性を\n"
2650 "I<param> が指すバッファに入れて返す。"
2651
2652 #. type: Plain text
2653 #: build/C/man3/pthread_attr_setschedparam.3:61
2654 msgid "Scheduling parameters are maintained in the following structure:"
2655 msgstr "スケジューリングパラメータは以下の構造体で管理される。"
2656
2657 #. type: Plain text
2658 #: build/C/man3/pthread_attr_setschedparam.3:67
2659 #: build/C/man3/pthread_setschedparam.3:69
2660 #, no-wrap
2661 msgid ""
2662 "struct sched_param {\n"
2663 "    int sched_priority;     /* Scheduling priority */\n"
2664 "};\n"
2665 msgstr ""
2666 "struct sched_param {\n"
2667 "    int sched_priority;     /* Scheduling priority */\n"
2668 "};\n"
2669
2670 #. type: Plain text
2671 #: build/C/man3/pthread_attr_setschedparam.3:74
2672 #: build/C/man3/pthread_setschedparam.3:76
2673 msgid ""
2674 "As can be seen, only one scheduling parameter is supported.  For details of "
2675 "the permitted ranges for scheduling priorities in each scheduling policy, "
2676 "see B<sched_setscheduler>(2)."
2677 msgstr ""
2678 "見て分かる通り、サポートされているスケジューリングパラメータは一つだけ\n"
2679 "である。各スケジューリングポリシーで許可されるスケジューリング優先度の\n"
2680 "詳細については、B<sched_setscheduler>(2) を参照のこと。"
2681
2682 #. type: Plain text
2683 #: build/C/man3/pthread_attr_setschedparam.3:85
2684 msgid ""
2685 "In order for the parameter setting made by B<pthread_attr_setschedparam>()  "
2686 "to have effect when calling B<pthread_create>(3), the caller must use "
2687 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2688 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2689 msgstr ""
2690 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedparam>() で行っ"
2691 "たパラメータ設定を有効にするには、 呼び出し側で "
2692 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
2693 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
2694 "ない。"
2695
2696 #.  .SH VERSIONS
2697 #.  Available since glibc 2.0.
2698 #. type: Plain text
2699 #: build/C/man3/pthread_attr_setschedparam.3:100
2700 msgid ""
2701 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2702 "B<pthread_attr_setschedparam>().  On Linux these functions always succeed "
2703 "(but portable and future-proof applications should nevertheless handle a "
2704 "possible error return)."
2705 msgstr ""
2706 "POSIX.1 では、\n"
2707 "B<pthread_attr_setschedparam>() について\n"
2708 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
2709 "Linux では、これらの関数は常に成功する\n"
2710 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2711 "正のエラーの返り値を処理するようにすべきである)。"
2712
2713 #. type: Plain text
2714 #: build/C/man3/pthread_attr_setschedparam.3:106
2715 msgid ""
2716 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
2717 "policies supported on Linux."
2718 msgstr ""
2719 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
2720 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
2721
2722 #. type: Plain text
2723 #: build/C/man3/pthread_attr_setschedparam.3:121
2724 msgid ""
2725 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2726 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2727 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2728 "(3), B<pthreads>(7)"
2729 msgstr ""
2730 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2731 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2732 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2733 "(3), B<pthreads>(7)"
2734
2735 #. type: TH
2736 #: build/C/man3/pthread_attr_setschedpolicy.3:26
2737 #, no-wrap
2738 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2739 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2740
2741 #. type: Plain text
2742 #: build/C/man3/pthread_attr_setschedpolicy.3:30
2743 msgid ""
2744 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2745 "scheduling policy attribute in thread attributes object"
2746 msgstr ""
2747 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
2748 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
2749
2750 #. type: Plain text
2751 #: build/C/man3/pthread_attr_setschedpolicy.3:38
2752 #, no-wrap
2753 msgid ""
2754 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2755 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2756 msgstr ""
2757 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2758 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2759
2760 #. type: Plain text
2761 #: build/C/man3/pthread_attr_setschedpolicy.3:52
2762 msgid ""
2763 "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy "
2764 "attribute of the thread attributes object referred to by I<attr> to the "
2765 "value specified in I<policy>.  This attribute determines the scheduling "
2766 "policy of a thread created using the thread attributes object I<attr>."
2767 msgstr ""
2768 "B<pthread_attr_setschedpolicy>() 関数は、\n"
2769 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2770 "ポリシー属性を I<policy> で指定された値に設定する。\n"
2771 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2772 "作成されるスレッドのスケジューリングポリシーが決定される。"
2773
2774 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2775 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2776 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2777 #. type: Plain text
2778 #: build/C/man3/pthread_attr_setschedpolicy.3:65
2779 msgid ""
2780 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2781 "B<SCHED_OTHER>, with the semantics described in B<sched_setscheduler>(2)."
2782 msgstr ""
2783 "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER>\n"
2784 "である。それぞれの意味は B<sched_setscheduler>(2) で説明している通り\n"
2785 "である。"
2786
2787 #. type: Plain text
2788 #: build/C/man3/pthread_attr_setschedpolicy.3:72
2789 msgid ""
2790 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
2791 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2792 "by I<policy>."
2793 msgstr ""
2794 "B<pthread_attr_getschedpolicy>() は、\n"
2795 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
2796 "I<policy> が指すバッファに入れて返す。"
2797
2798 #. type: Plain text
2799 #: build/C/man3/pthread_attr_setschedpolicy.3:83
2800 msgid ""
2801 "In order for the policy setting made by B<pthread_attr_setschedpolicy>()  to "
2802 "have effect when calling B<pthread_create>(3), the caller must use "
2803 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2804 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2805 msgstr ""
2806 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedpolicy>() で行っ"
2807 "たポリシー設定を有効にするには、 呼び出し側で B<pthread_attr_setinheritsched>"
2808 "(3) を使って 属性オブジェクト I<attr> の inherit-scheduler 属性を "
2809 "B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければならない。"
2810
2811 #. type: Plain text
2812 #: build/C/man3/pthread_attr_setschedpolicy.3:89
2813 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2814 msgstr "B<pthread_attr_setschedpolicy>() は以下のエラーで失敗する場合がある。"
2815
2816 #. type: Plain text
2817 #: build/C/man3/pthread_attr_setschedpolicy.3:93
2818 msgid "Invalid value in I<policy>."
2819 msgstr "I<policy> に無効な値が指定された。"
2820
2821 #.  .SH VERSIONS
2822 #.  Available since glibc 2.0.
2823 #. type: Plain text
2824 #: build/C/man3/pthread_attr_setschedpolicy.3:100
2825 msgid ""
2826 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2827 "to set the attribute to an unsupported value\") for "
2828 "B<pthread_attr_setschedpolicy>()."
2829 msgstr ""
2830 "POSIX.1-2001 では、 B<pthread_attr_setschedpolicy>() に関して\n"
2831 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2832 "も追加で規定されている。"
2833
2834 #. type: Plain text
2835 #: build/C/man3/pthread_attr_setschedpolicy.3:116
2836 msgid ""
2837 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2838 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2839 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2840 "(3), B<pthreads>(7)"
2841 msgstr ""
2842 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2843 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2844 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2845 "(3), B<pthreads>(7)"
2846
2847 #. type: TH
2848 #: build/C/man3/pthread_attr_setscope.3:26
2849 #, no-wrap
2850 msgid "PTHREAD_ATTR_SETSCOPE"
2851 msgstr "PTHREAD_ATTR_SETSCOPE"
2852
2853 #. type: Plain text
2854 #: build/C/man3/pthread_attr_setscope.3:30
2855 msgid ""
2856 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2857 "attribute in thread attributes object"
2858 msgstr ""
2859 "pthread_attr_setscope, pthread_attr_getscope - \n"
2860 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
2861
2862 #. type: Plain text
2863 #: build/C/man3/pthread_attr_setscope.3:38
2864 #, no-wrap
2865 msgid ""
2866 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2867 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2868 msgstr ""
2869 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2870 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2871
2872 #. type: Plain text
2873 #: build/C/man3/pthread_attr_setscope.3:53
2874 msgid ""
2875 "The B<pthread_attr_setscope>()  function sets the contention scope attribute "
2876 "of the thread attributes object referred to by I<attr> to the value "
2877 "specified in I<scope>.  The contention scope attribute defines the set of "
2878 "threads against which a thread competes for resources such as the CPU.  "
2879 "POSIX.1-2001 specifies two possible values for I<scope>:"
2880 msgstr ""
2881 "B<pthread_attr_setscope>() 関数は、\n"
2882 "I<attr> が参照するスレッド属性オブジェクトの contention scope\n"
2883 "属性を I<scope> で指定された値に設定する。\n"
2884 "contention scope 属性により、\n"
2885 "スレッドが CPU などのリソースを取り合うスレッド集合が規定される。\n"
2886 "POSIX.1-2001 では I<scope> に指定する値として 2 つの値が規定されている。"
2887
2888 #. type: TP
2889 #: build/C/man3/pthread_attr_setscope.3:53
2890 #, no-wrap
2891 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2892 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2893
2894 #. type: Plain text
2895 #: build/C/man3/pthread_attr_setscope.3:61
2896 msgid ""
2897 "The thread competes for resources with all other threads in all processes on "
2898 "the system that are in the same scheduling allocation domain (a group of one "
2899 "or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2900 "to one another according to their scheduling policy and priority."
2901 msgstr ""
2902 "スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ\n"
2903 "のグループ) にある、システム上の全てのプロセスの自分以外の全ての\n"
2904 "スレッドとリソースを取り合う。 \n"
2905 "B<PTHREAD_SCOPE_SYSTEM> のスレッドは、スケジューリングポリシーと\n"
2906 "優先度に基づき、互いに相対的にスケジューリングされる。"
2907
2908 #. type: TP
2909 #: build/C/man3/pthread_attr_setscope.3:61
2910 #, no-wrap
2911 msgid "B<PTHREAD_SCOPE_PROCESS>"
2912 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2913
2914 #. type: Plain text
2915 #: build/C/man3/pthread_attr_setscope.3:76
2916 msgid ""
2917 "The thread competes for resources with all other threads in the same process "
2918 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  "
2919 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2920 "the process according to their scheduling policy and priority.  POSIX.1-2001 "
2921 "leaves it unspecified how these threads contend with other threads in other "
2922 "process on the system or with other threads in the same process that were "
2923 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
2924 msgstr ""
2925 "スレッドは、contention scope が B<PTHREAD_SCOPE_PROCESS> で作成された\n"
2926 "同じプロセスの自分以外の全てのスレッドとリソースを取り合う。\n"
2927 "B<PTHREAD_SCOPE_PROCESS> のスレッドは、スケジューリングポリシーと優先度\n"
2928 "に基づき、同じプロセスの他のスレッドと相対的にスケジューリングされる。\n"
2929 "POSIX.1-2001 では、これらのスレッドがシステム上の他のプロセスのスレッド\n"
2930 "や同じプロセス内の contention scope が B<PTHREAD_SCOPE_SYSTEM> で作成\n"
2931 "された他のスレッドとどのようにリソースを取り合うかは、\n"
2932 "規定されないままになっている。"
2933
2934 #. type: Plain text
2935 #: build/C/man3/pthread_attr_setscope.3:83
2936 msgid ""
2937 "POSIX.1-2001 requires that an implementation support at least one of these "
2938 "contention scopes.  Linux supports B<PTHREAD_SCOPE_SYSTEM>, but not "
2939 "B<PTHREAD_SCOPE_PROCESS>."
2940 msgstr ""
2941 "POSIX.1-2001 で求められているのは、スレッド実装がこれらの contention scope の"
2942 "うち少なくとも 1 つをサポートすることだけである。 Linux は "
2943 "B<PTHREAD_SCOPE_SYSTEM> をサポートしているが、 B<PTHREAD_SCOPE_PROCESS> はサ"
2944 "ポートしていない。"
2945
2946 #. type: Plain text
2947 #: build/C/man3/pthread_attr_setscope.3:95
2948 msgid ""
2949 "On systems that support multiple contention scopes, then, in order for the "
2950 "parameter setting made by B<pthread_attr_setscope>()  to have effect when "
2951 "calling B<pthread_create>(3), the caller must use "
2952 "B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute "
2953 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2954 msgstr ""
2955 "複数の contention scope をサポートしているシステムで、 B<pthread_create>(3) "
2956 "を呼び出した際に B<pthread_attr_setscope>() で行ったパラメータ設定を有効にす"
2957 "るには、 呼び出し側で B<pthread_attr_setinheritsched>(3) を使って 属性オブ"
2958 "ジェクト I<attr> の inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定"
2959 "しておかなければならない。"
2960
2961 #. type: Plain text
2962 #: build/C/man3/pthread_attr_setscope.3:103
2963 msgid ""
2964 "The B<pthread_attr_getscope>()  function returns the contention scope "
2965 "attribute of the thread attributes object referred to by I<attr> in the "
2966 "buffer pointed to by I<scope>."
2967 msgstr ""
2968 "B<pthread_attr_getscope>() は、\n"
2969 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
2970 "I<scope> が指すバッファに入れて返す。"
2971
2972 #. type: Plain text
2973 #: build/C/man3/pthread_attr_setscope.3:109
2974 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
2975 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
2976
2977 #. type: Plain text
2978 #: build/C/man3/pthread_attr_setscope.3:113
2979 msgid "An invalid value was specified in I<scope>."
2980 msgstr "I<scope> に無効な値が指定された。"
2981
2982 #. type: TP
2983 #: build/C/man3/pthread_attr_setscope.3:113
2984 #, no-wrap
2985 msgid "B<ENOTSUP>"
2986 msgstr "B<ENOTSUP>"
2987
2988 #. type: Plain text
2989 #: build/C/man3/pthread_attr_setscope.3:119
2990 msgid ""
2991 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
2992 "supported on Linux."
2993 msgstr ""
2994 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
2995 "この値は Linux でサポートされていない。"
2996
2997 #. type: Plain text
2998 #: build/C/man3/pthread_attr_setscope.3:129
2999 msgid ""
3000 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a user-"
3001 "space thread is bound directly to a single kernel-scheduling entity.  This "
3002 "is the case on Linux for the obsolete LinuxThreads implementation and the "
3003 "modern NPTL implementation, which are both 1:1 threading implementations."
3004 msgstr ""
3005 "B<PTHREAD_SCOPE_SYSTEM> contention scope では、通常は、一つの\n"
3006 "ユーザ空間スレッドは一つのカーネルスケジューリング・エンティティに\n"
3007 "直接結び付けられる。\n"
3008 "Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに\n"
3009 "該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。"
3010
3011 #. type: Plain text
3012 #: build/C/man3/pthread_attr_setscope.3:132
3013 msgid ""
3014 "POSIX.1-2001 specifies that the default contention scope is implementation-"
3015 "defined."
3016 msgstr ""
3017 "POSIX.1-2001 では、 contention scope 属性のデフォルト値は\n"
3018 "実装時で定義されるものと規定されている。"
3019
3020 #. type: Plain text
3021 #: build/C/man3/pthread_attr_setscope.3:142
3022 msgid ""
3023 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3024 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3025 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3026 msgstr ""
3027 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3028 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3029 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3030
3031 #. type: TH
3032 #: build/C/man3/pthread_attr_setstack.3:26
3033 #, no-wrap
3034 msgid "PTHREAD_ATTR_SETSTACK"
3035 msgstr "PTHREAD_ATTR_SETSTACK"
3036
3037 #. type: TH
3038 #: build/C/man3/pthread_attr_setstack.3:26
3039 #: build/C/man3/pthread_attr_setstackaddr.3:26 build/C/man3/pthread_self.3:26
3040 #, no-wrap
3041 msgid "2008-10-24"
3042 msgstr "2008-10-24"
3043
3044 #. type: Plain text
3045 #: build/C/man3/pthread_attr_setstack.3:30
3046 msgid ""
3047 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
3048 "thread attributes object"
3049 msgstr ""
3050 "pthread_attr_setstack, pthread_attr_getstack - \n"
3051 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
3052
3053 #. type: Plain text
3054 #: build/C/man3/pthread_attr_setstack.3:38
3055 #, no-wrap
3056 msgid ""
3057 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3058 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3059 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
3060 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3061 msgstr ""
3062 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3063 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3064 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
3065 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3066
3067 #. type: Plain text
3068 #: build/C/man3/pthread_attr_setstack.3:45 build/C/man3/pthread_kill.3:41
3069 #: build/C/man3/pthread_sigmask.3:42 build/C/man3/pthread_sigqueue.3:41
3070 msgid ""
3071 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3072 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
3073
3074 #. type: Plain text
3075 #: build/C/man3/pthread_attr_setstack.3:50
3076 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3077 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3078
3079 #. type: Plain text
3080 #: build/C/man3/pthread_attr_setstack.3:52
3081 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
3082 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
3083
3084 #. type: Plain text
3085 #: build/C/man3/pthread_attr_setstack.3:68
3086 msgid ""
3087 "The B<pthread_attr_setstack>()  function sets the stack address and stack "
3088 "size attributes of the thread attributes object referred to by I<attr> to "
3089 "the values specified in I<stackaddr> and I<stacksize>, respectively.  These "
3090 "attributes specify the location and size of the stack that should be used by "
3091 "a thread that is created using the thread attributes object I<attr>."
3092 msgstr ""
3093 "B<pthread_attr_setstack>() 関数は、\n"
3094 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
3095 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
3096 "指定された値に設定する。\n"
3097 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
3098 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
3099
3100 #. type: Plain text
3101 #: build/C/man3/pthread_attr_setstack.3:74
3102 msgid ""
3103 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
3104 "I<stacksize> bytes that was allocated by the caller.  The pages of the "
3105 "allocated buffer should be both readable and writable."
3106 msgstr ""
3107 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
3108 "バッファ内の指定できる最小のアドレスバイトを指すべきである。\n"
3109 "割り当てられたバッファのページは読み書き両方が可能なページとなっている\n"
3110 "べきである。"
3111
3112 #. type: Plain text
3113 #: build/C/man3/pthread_attr_setstack.3:85
3114 msgid ""
3115 "The B<pthread_attr_getstack>()  function returns the stack address and stack "
3116 "size attributes of the thread attributes object referred to by I<attr> in "
3117 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
3118 msgstr ""
3119 "B<pthread_attr_getstack>() 関数は、\n"
3120 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
3121 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
3122 "指すバッファに入れて返す。"
3123
3124 #. type: Plain text
3125 #: build/C/man3/pthread_attr_setstack.3:91
3126 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
3127 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
3128
3129 #. type: Plain text
3130 #: build/C/man3/pthread_attr_setstack.3:102
3131 msgid ""
3132 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some "
3133 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
3134 "stacksize> is not suitably aligned."
3135 msgstr ""
3136 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
3137 "システムによっては、 I<stackaddr> か\n"
3138 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
3139 "このエラーが発生する。"
3140
3141 #. type: Plain text
3142 #: build/C/man3/pthread_attr_setstack.3:110
3143 msgid ""
3144 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
3145 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
3146 "caller."
3147 msgstr ""
3148 "POSIX.1-2001 では エラー B<EACCES> も規定されており、\n"
3149 "このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に\n"
3150 "呼び出し側から読み書き両方のアクセスができない状況を表す。"
3151
3152 #. type: Plain text
3153 #: build/C/man3/pthread_attr_setstack.3:112
3154 msgid "These functions are provided by glibc since version 2.2."
3155 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
3156
3157 #. type: Plain text
3158 #: build/C/man3/pthread_attr_setstack.3:122
3159 msgid ""
3160 "These functions are provided for applications that must ensure that a "
3161 "thread's stack is placed in a particular location.  For most applications, "
3162 "this is not necessary, and the use of these functions should be avoided.  "
3163 "(Use B<pthread_attr_setstacksize>(3)  if an application simply requires a "
3164 "stack size other than the default.)"
3165 msgstr ""
3166 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
3167 "しなければならないアプリケーションのために提供されている。\n"
3168 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
3169 "これらの関数を使うのは避けるべきである。\n"
3170 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
3171 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
3172
3173 #. type: Plain text
3174 #: build/C/man3/pthread_attr_setstack.3:133
3175 msgid ""
3176 "When an application employs B<pthread_attr_setstack>(), it takes over the "
3177 "responsibility of allocating the stack.  Any guard size value that was set "
3178 "using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it "
3179 "is the application's responsibility to allocate a guard area (one or more "
3180 "pages protected against reading and writing)  to handle the possibility of "
3181 "stack overflow."
3182 msgstr ""
3183 "アプリケーションが B<pthread_attr_setstack>() を利用する際には、\n"
3184 "スタックの割り当てに責任を持つ必要がある。\n"
3185 "B<pthread_attr_setguardsize>(3) を使って設定された\n"
3186 "guard size の値は無視される。\n"
3187 "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n"
3188 "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n"
3189 "スタックオーバーフローの可能性に対処するようにする必要がある。"
3190
3191 #. type: Plain text
3192 #: build/C/man3/pthread_attr_setstack.3:144
3193 msgid ""
3194 "The address specified in I<stackaddr> should be suitably aligned: for full "
3195 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  "
3196 "B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> "
3197 "should also be a multiple of the system page size."
3198 msgstr ""
3199 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
3200 "完全な移植性を持たせるためには、\n"
3201 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
3202 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
3203 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
3204
3205 #. type: Plain text
3206 #: build/C/man3/pthread_attr_setstack.3:152
3207 msgid ""
3208 "If I<attr> is used to create multiple threads, then the caller must change "
3209 "the stack address attribute between calls to B<pthread_create>(3); "
3210 "otherwise, the threads will attempt to use the same memory area for their "
3211 "stacks, and chaos will ensue."
3212 msgstr ""
3213 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
3214 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
3215 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
3216 "さもなければ、複数のスレッドがスタックとして同じメモリ領域を\n"
3217 "使おうとするため、訳の分からない状況が発生してしまう。"
3218
3219 #. type: Plain text
3220 #: build/C/man3/pthread_attr_setstack.3:167
3221 msgid ""
3222 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3223 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3224 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3225 msgstr ""
3226 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3227 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3228 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3229
3230 #. type: TH
3231 #: build/C/man3/pthread_attr_setstackaddr.3:26
3232 #, no-wrap
3233 msgid "PTHREAD_ATTR_SETSTACKADDR"
3234 msgstr "PTHREAD_ATTR_SETSTACKADDR"
3235
3236 #. type: Plain text
3237 #: build/C/man3/pthread_attr_setstackaddr.3:30
3238 msgid ""
3239 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
3240 "attribute in thread attributes object"
3241 msgstr ""
3242 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
3243 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
3244
3245 #. type: Plain text
3246 #: build/C/man3/pthread_attr_setstackaddr.3:38
3247 #, no-wrap
3248 msgid ""
3249 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3250 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3251 msgstr ""
3252 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3253 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3254
3255 #. type: Plain text
3256 #: build/C/man3/pthread_attr_setstackaddr.3:49
3257 msgid ""
3258 "These functions are obsolete: B<do not use them.> Use "
3259 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
3260 msgstr ""
3261 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
3262 "代わりに Use B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使"
3263 "うこと。"
3264
3265 #. type: Plain text
3266 #: build/C/man3/pthread_attr_setstackaddr.3:60
3267 msgid ""
3268 "The B<pthread_attr_setstackaddr>()  function sets the stack address "
3269 "attribute of the thread attributes object referred to by I<attr> to the "
3270 "value specified in I<stackaddr>.  This attribute specifies the location of "
3271 "the stack that should be used by a thread that is created using the thread "
3272 "attributes object I<attr>."
3273 msgstr ""
3274 "B<pthread_attr_setstackaddr>() 関数は、\n"
3275 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3276 "属性を I<stackaddr> で指定された値に設定する。\n"
3277 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3278 "作成されるスレッドが使用すべきスタックの位置が指定される。"
3279
3280 #. type: Plain text
3281 #: build/C/man3/pthread_attr_setstackaddr.3:66
3282 msgid ""
3283 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
3284 "that was allocated by the caller.  The pages of the allocated buffer should "
3285 "be both readable and writable."
3286 msgstr ""
3287 "I<stackaddr> は呼び出し側が割り当てたバッファ (大きさは\n"
3288 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
3289 "割り当てられたバッファのページは読み書き両方が可能なページと\n"
3290 "なっているべきである。"
3291
3292 #. type: Plain text
3293 #: build/C/man3/pthread_attr_setstackaddr.3:74
3294 msgid ""
3295 "The B<pthread_attr_getstackaddr>()  function returns the stack address "
3296 "attribute of the thread attributes object referred to by I<attr> in the "
3297 "buffer pointed to by I<stackaddr>."
3298 msgstr ""
3299 "B<pthread_attr_getstackaddr>() は、\n"
3300 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3301 "I<stackaddr> が指すバッファに入れて返す。"
3302
3303 #. type: Plain text
3304 #: build/C/man3/pthread_attr_setstackaddr.3:81
3305 msgid ""
3306 "No errors are defined (but applications should nevertheless handle a "
3307 "possible error return)."
3308 msgstr ""
3309 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
3310 "返り値を処理するようにすべきである)。"
3311
3312 #. type: Plain text
3313 #: build/C/man3/pthread_attr_setstackaddr.3:86
3314 msgid ""
3315 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
3316 "POSIX.1-2008 removes the specification of these functions."
3317 msgstr ""
3318 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
3319 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
3320
3321 #. type: Plain text
3322 #: build/C/man3/pthread_attr_setstackaddr.3:110
3323 msgid ""
3324 "I<Do not use these functions!> They cannot be portably used, since they "
3325 "provide no way of specifying the direction of growth or the range of the "
3326 "stack.  For example, on architectures with a stack that grows downward, "
3327 "I<stackaddr> specifies the next address past the I<highest> address of the "
3328 "allocated stack area.  However, on architectures with a stack that grows "
3329 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
3330 "area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  "
3331 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
3332 "in the allocated stack area (and the I<stacksize> argument specifies the "
3333 "range of the stack)."
3334 msgstr ""
3335 "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n"
3336 "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n"
3337 "かを指定する手段が提供されていないからである。\n"
3338 "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャ\n"
3339 "では、I<stackaddr> には割り当てられたスタック領域のI<最も大きな>アドレ\n"
3340 "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n"
3341 "方向) に伸びるアーキテクチャでは、I<stackaddr> には割り当てられた\n"
3342 "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n"
3343 "B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) が使用する\n"
3344 "I<stackaddr> は、常に割り当てられたスタック領域の最も小さいアドレス\n"
3345 "へのポインタである (I<stacksize> 引き数はスタックの範囲を指定する)。"
3346
3347 #. type: Plain text
3348 #: build/C/man3/pthread_attr_setstackaddr.3:116
3349 msgid ""
3350 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3351 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3352 msgstr ""
3353 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3354 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3355
3356 #. type: TH
3357 #: build/C/man3/pthread_attr_setstacksize.3:26
3358 #, no-wrap
3359 msgid "PTHREAD_ATTR_SETSTACKSIZE"
3360 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
3361
3362 #. type: TH
3363 #: build/C/man3/pthread_attr_setstacksize.3:26
3364 #, no-wrap
3365 msgid "2012-03-15"
3366 msgstr "2012-03-15"
3367
3368 #. type: Plain text
3369 #: build/C/man3/pthread_attr_setstacksize.3:30
3370 msgid ""
3371 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
3372 "attribute in thread attributes object"
3373 msgstr ""
3374 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
3375 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
3376
3377 #. type: Plain text
3378 #: build/C/man3/pthread_attr_setstacksize.3:38
3379 #, no-wrap
3380 msgid ""
3381 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3382 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3383 msgstr ""
3384 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3385 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3386
3387 #. type: Plain text
3388 #: build/C/man3/pthread_attr_setstacksize.3:49
3389 msgid ""
3390 "The B<pthread_attr_setstacksize>()  function sets the stack size attribute "
3391 "of the thread attributes object referred to by I<attr> to the value "
3392 "specified in I<stacksize>."
3393 msgstr ""
3394 "B<pthread_attr_setstacksize>() 関数は、\n"
3395 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3396 "属性を I<stacksize> で指定された値に設定する。"
3397
3398 #. type: Plain text
3399 #: build/C/man3/pthread_attr_setstacksize.3:53
3400 msgid ""
3401 "The stack size attribute determines the minimum size (in bytes) that will be "
3402 "allocated for threads created using the thread attributes object I<attr>."
3403 msgstr ""
3404 "スタックサイズ属性により、\n"
3405 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
3406 "に割り当てられる最小サイズ (バイト単位) が決定される。"
3407
3408 #. type: Plain text
3409 #: build/C/man3/pthread_attr_setstacksize.3:61
3410 msgid ""
3411 "The B<pthread_attr_getstacksize>()  function returns the stack size "
3412 "attribute of the thread attributes object referred to by I<attr> in the "
3413 "buffer pointed to by I<stacksize>."
3414 msgstr ""
3415 "B<pthread_attr_getstacksize>() は、\n"
3416 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3417 "I<stacksize> が指すバッファに入れて返す。"
3418
3419 #. type: Plain text
3420 #: build/C/man3/pthread_attr_setstacksize.3:67
3421 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
3422 msgstr "B<pthread_attr_setstacksize>() は以下のエラーで失敗する場合がある。"
3423
3424 #. type: Plain text
3425 #: build/C/man3/pthread_attr_setstacksize.3:72
3426 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
3427 msgstr "スタックサイズが B<PTHREAD_STACK_MIN> (16384) バイト未満である。"
3428
3429 #.  e.g., MacOS
3430 #. type: Plain text
3431 #: build/C/man3/pthread_attr_setstacksize.3:81
3432 msgid ""
3433 "On some systems, B<pthread_attr_setstacksize>()  can fail with the error "
3434 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
3435 msgstr ""
3436 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
3437 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
3438 "エラー B<EINVAL> で失敗する。"
3439
3440 #. type: Plain text
3441 #: build/C/man3/pthread_attr_setstacksize.3:88
3442 msgid ""
3443 "For details on the default stack size of new threads, see B<pthread_create>"
3444 "(3)."
3445 msgstr ""
3446 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
3447 "B<pthread_create>(3) を参照。"
3448
3449 #. type: Plain text
3450 #: build/C/man3/pthread_attr_setstacksize.3:91
3451 msgid ""
3452 "A thread's stack size is fixed at the time of thread creation.  Only the "
3453 "main thread can dynamically grow its stack."
3454 msgstr ""
3455 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
3456 "メインスレッドだけがスタックを動的に伸ばすことができる。"
3457
3458 #. type: Plain text
3459 #: build/C/man3/pthread_attr_setstacksize.3:96
3460 msgid ""
3461 "The B<pthread_attr_setstack>(3)  function allows an application to set both "
3462 "the size and location of a caller-allocated stack that is to be used by a "
3463 "thread."
3464 msgstr ""
3465 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
3466 "アプリケーションは、スレッドが使用するスタックとして、\n"
3467 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
3468
3469 #. type: Plain text
3470 #: build/C/man3/pthread_attr_setstacksize.3:108
3471 msgid ""
3472 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
3473 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
3474 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
3475 "stack will be at least I<stacksize> bytes."
3476 msgstr ""
3477 "glibc 2.8 の時点では、指定された I<stacksize> が B<STACK_ALIGN> \n"
3478 "(ほとんどのアーキテクチャでは 16 バイト) の倍数でない場合、\n"
3479 "I<stacksize> はI<小さくなる方向に>に丸められる。\n"
3480 "これは POSIX.1-2001 に違反している。\n"
3481 "POSIX.1-2001 では、割り当てらたスタックの大きさは\n"
3482 "少なくとも I<stacksize> バイトになると書かれている。"
3483
3484 #. type: Plain text
3485 #: build/C/man3/pthread_attr_setstacksize.3:111
3486 #: build/C/man3/pthread_join.3:127
3487 msgid "See B<pthread_create>(3)."
3488 msgstr "B<pthread_create>(3) を参照。"
3489
3490 #. type: Plain text
3491 #: build/C/man3/pthread_attr_setstacksize.3:118
3492 msgid ""
3493 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3494 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3495 msgstr ""
3496 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3497 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3498
3499 #. type: TH
3500 #: build/C/man3/pthread_cancel.3:26
3501 #, no-wrap
3502 msgid "PTHREAD_CANCEL"
3503 msgstr "PTHREAD_CANCEL"
3504
3505 #. type: TH
3506 #: build/C/man3/pthread_cancel.3:26 build/C/man3/pthread_setschedparam.3:26
3507 #, no-wrap
3508 msgid "2008-11-17"
3509 msgstr "2008-11-17"
3510
3511 #. type: Plain text
3512 #: build/C/man3/pthread_cancel.3:29
3513 msgid "pthread_cancel - send a cancellation request to a thread"
3514 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
3515
3516 #. type: Plain text
3517 #: build/C/man3/pthread_cancel.3:34
3518 #, no-wrap
3519 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3520 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3521
3522 #. type: Plain text
3523 #: build/C/man3/pthread_cancel.3:49
3524 msgid ""
3525 "The B<pthread_cancel>()  function sends a cancellation request to the thread "
3526 "I<thread>.  Whether and when the target thread reacts to the cancellation "
3527 "request depends on two attributes that are under the control of that thread: "
3528 "its cancelability I<state> and I<type>."
3529 msgstr ""
3530 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
3531 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
3532 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
3533 "I<state> と I<type>により決まる。"
3534
3535 #. type: Plain text
3536 #: build/C/man3/pthread_cancel.3:61
3537 msgid ""
3538 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
3539 "can be I<enabled> (the default for new threads) or I<disabled>.  If a thread "
3540 "has disabled cancellation, then a cancellation request remains queued until "
3541 "the thread enables cancellation.  If a thread has enabled cancellation, then "
3542 "its cancelability type determines when cancellation occurs."
3543 msgstr ""
3544 "あるスレッドの cancelability state は B<pthread_setcancelstate>(3) で\n"
3545 "設定され、I<enabled> と I<disabled> のいずれとなる (I<enabled> が新しい\n"
3546 "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n"
3547 "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n"
3548 "れたままになる。スレッドがキャンセルを有効にしていた場合、\n"
3549 "cancelability type によって、いつキャンセルが発生するかが決まる。"
3550
3551 #. type: Plain text
3552 #: build/C/man3/pthread_cancel.3:77
3553 msgid ""
3554 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3555 "be either I<asynchronous> or I<deferred> (the default for new threads).  "
3556 "Asynchronous cancelability means that the thread can be canceled at any time "
3557 "(usually immediately, but the system does not guarantee this).  Deferred "
3558 "cancelability means that cancellation will be delayed until the thread next "
3559 "calls a function that is a I<cancellation point>.  A list of functions that "
3560 "are or may be cancellation points is provided in B<pthreads>(7)."
3561 msgstr ""
3562 "スレッドのキャンセル種別 (cancelability type) は\n"
3563 "B<pthread_setcanceltype>(3) で設定され、I<asynchronous> か I<deferred>\n"
3564 "のいずれかとなる(I<deferred> が新しいスレッドのデフォルト値である)。\n"
3565 "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつで\n"
3566 "もキャンセルされることを意味する (通常はすぐにキャンセルされるが、\n"
3567 "システムがそのことを保証しているわけではない)。遅延キャンセル\n"
3568 "(deferred cancelability) では、そのスレッドが I<取り消しポイント\n"
3569 "(cancellation point)> となっている関数を次に呼び出すまでキャンセルが\n"
3570 "遅延される。取り消しポイントに設定されていたり設定\n"
3571 "したりできる関数のリストは B<pthreads>(7) に記載している。"
3572
3573 #. type: Plain text
3574 #: build/C/man3/pthread_cancel.3:81
3575 msgid ""
3576 "When a cancellation requested is acted on, the following steps occur for "
3577 "I<thread> (in this order):"
3578 msgstr ""
3579 "キャンセル要求が実行されると、\n"
3580 "I<thread> では以下のステップが (この順序で) 行われる。"
3581
3582 #. type: IP
3583 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:69
3584 #, no-wrap
3585 msgid "1."
3586 msgstr "1."
3587
3588 #. type: Plain text
3589 #: build/C/man3/pthread_cancel.3:86
3590 msgid ""
3591 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3592 "which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
3593 msgstr ""
3594 "キャンセルクリーンアップハンドラが (push されたのと逆順で)\n"
3595 "取り出され (pop され)、呼び出される。\n"
3596 "(B<pthread_cleanup_push>(3) 参照)"
3597
3598 #. type: IP
3599 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:73
3600 #, no-wrap
3601 msgid "2."
3602 msgstr "2."
3603
3604 #. type: Plain text
3605 #: build/C/man3/pthread_cancel.3:91
3606 msgid ""
3607 "Thread-specific data destructors are called, in an unspecified order.  (See "
3608 "B<pthread_key_create>(3).)"
3609 msgstr ""
3610 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
3611 "呼び出し順序は規定されていない。\n"
3612 "(B<pthread_key_create>(3) 参照)"
3613
3614 #. type: IP
3615 #: build/C/man3/pthread_cancel.3:91 build/C/man3/pthread_cleanup_push.3:83
3616 #, no-wrap
3617 msgid "3."
3618 msgstr "3."
3619
3620 #. type: Plain text
3621 #: build/C/man3/pthread_cancel.3:95
3622 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3623 msgstr "スレッドが終了される。 (B<pthread_exit>(3) 参照)"
3624
3625 #. type: Plain text
3626 #: build/C/man3/pthread_cancel.3:103
3627 msgid ""
3628 "The above steps happen asynchronously with respect to the B<pthread_cancel>"
3629 "()  call; the return status of B<pthread_cancel>()  merely informs the "
3630 "caller whether the cancellation request was successfully queued."
3631 msgstr ""
3632 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
3633 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
3634 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
3635
3636 #. type: Plain text
3637 #: build/C/man3/pthread_cancel.3:112
3638 msgid ""
3639 "After a canceled thread has terminated, a join with that thread using "
3640 "B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit "
3641 "status.  (Joining with a thread is the only way to know that cancellation "
3642 "has completed.)"
3643 msgstr ""
3644 "キャンセルされたスレッドが終了された後に、\n"
3645 "B<pthread_join>(3) でそのスレッドを join すると、\n"
3646 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
3647 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
3648
3649 #. type: Plain text
3650 #: build/C/man3/pthread_cancel.3:117
3651 msgid ""
3652 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
3653 "error number."
3654 msgstr ""
3655 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
3656 "エラーの場合、0 以外のエラー番号を返す。"
3657
3658 #. type: TP
3659 #: build/C/man3/pthread_cancel.3:118 build/C/man3/pthread_detach.3:59
3660 #: build/C/man3/pthread_getcpuclockid.3:58 build/C/man3/pthread_join.3:93
3661 #: build/C/man3/pthread_setaffinity_np.3:114
3662 #: build/C/man3/pthread_setschedparam.3:114
3663 #: build/C/man3/pthread_setschedprio.3:70 build/C/man3/pthread_sigqueue.3:85
3664 #, no-wrap
3665 msgid "B<ESRCH>"
3666 msgstr "B<ESRCH>"
3667
3668 #. type: Plain text
3669 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_detach.3:64
3670 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:98
3671 #: build/C/man3/pthread_setaffinity_np.3:119
3672 #: build/C/man3/pthread_setschedparam.3:119
3673 #: build/C/man3/pthread_setschedprio.3:75
3674 msgid "No thread with the ID I<thread> could be found."
3675 msgstr "ID が I<thread> のスレッドが見つからなかった。"
3676
3677 #. type: Plain text
3678 #: build/C/man3/pthread_cancel.3:135
3679 msgid ""
3680 "On Linux, cancellation is implemented using signals.  Under the NPTL "
3681 "threading implementation, the first real-time signal (i.e., signal 32) is "
3682 "used for this purpose.  On LinuxThreads, the second real-time signal is "
3683 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3684 msgstr ""
3685 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装で"
3686 "は、\n"
3687 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
3688 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイ"
3689 "ム\n"
3690 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
3691
3692 #. type: Plain text
3693 #: build/C/man3/pthread_cancel.3:141
3694 msgid ""
3695 "The program below creates a thread and then cancels it.  The main thread "
3696 "joins with the canceled thread to check that its exit status was "
3697 "B<PTHREAD_CANCELED>.  The following shell session shows what happens when we "
3698 "run the program:"
3699 msgstr ""
3700 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルす"
3701 "る。\n"
3702 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
3703 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
3704 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
3705
3706 #. type: Plain text
3707 #: build/C/man3/pthread_cancel.3:149
3708 #, no-wrap
3709 msgid ""
3710 "$ ./a.out\n"
3711 "thread_func(): started; cancellation disabled\n"
3712 "main(): sending cancellation request\n"
3713 "thread_func(): about to enable cancellation\n"
3714 "main(): thread was canceled\n"
3715 msgstr ""
3716 "$ ./a.out\n"
3717 "thread_func(): started; cancellation disabled\n"
3718 "main(): sending cancellation request\n"
3719 "thread_func(): about to enable cancellation\n"
3720 "main(): thread was canceled\n"
3721
3722 #. type: Plain text
3723 #: build/C/man3/pthread_cancel.3:159
3724 #, no-wrap
3725 msgid ""
3726 "#include E<lt>pthread.hE<gt>\n"
3727 "#include E<lt>stdio.hE<gt>\n"
3728 "#include E<lt>errno.hE<gt>\n"
3729 "#include E<lt>stdlib.hE<gt>\n"
3730 "#include E<lt>unistd.hE<gt>\n"
3731 msgstr ""
3732 "#include E<lt>pthread.hE<gt>\n"
3733 "#include E<lt>stdio.hE<gt>\n"
3734 "#include E<lt>errno.hE<gt>\n"
3735 "#include E<lt>stdlib.hE<gt>\n"
3736 "#include E<lt>unistd.hE<gt>\n"
3737
3738 #. type: Plain text
3739 #: build/C/man3/pthread_cancel.3:167
3740 #, no-wrap
3741 msgid ""
3742 "static void *\n"
3743 "thread_func(void *ignored_argument)\n"
3744 "{\n"
3745 "    int s;\n"
3746 msgstr ""
3747 "static void *\n"
3748 "thread_func(void *ignored_argument)\n"
3749 "{\n"
3750 "    int s;\n"
3751
3752 #. type: Plain text
3753 #: build/C/man3/pthread_cancel.3:170
3754 #, no-wrap
3755 msgid ""
3756 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3757 "       immediately react to a cancellation request */\n"
3758 msgstr ""
3759 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3760 "       immediately react to a cancellation request */\n"
3761
3762 #. type: Plain text
3763 #: build/C/man3/pthread_cancel.3:174
3764 #, no-wrap
3765 msgid ""
3766 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3767 "    if (s != 0)\n"
3768 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3769 msgstr ""
3770 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3771 "    if (s != 0)\n"
3772 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3773
3774 #. type: Plain text
3775 #: build/C/man3/pthread_cancel.3:178
3776 #, no-wrap
3777 msgid ""
3778 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3779 "    sleep(5);\n"
3780 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3781 msgstr ""
3782 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3783 "    sleep(5);\n"
3784 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3785
3786 #. type: Plain text
3787 #: build/C/man3/pthread_cancel.3:182
3788 #, no-wrap
3789 msgid ""
3790 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3791 "    if (s != 0)\n"
3792 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3793 msgstr ""
3794 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3795 "    if (s != 0)\n"
3796 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3797
3798 #. type: Plain text
3799 #: build/C/man3/pthread_cancel.3:184
3800 #, no-wrap
3801 msgid "    /* sleep() is a cancellation point */\n"
3802 msgstr "    /* sleep() is a cancellation point */\n"
3803
3804 #. type: Plain text
3805 #: build/C/man3/pthread_cancel.3:186
3806 #, no-wrap
3807 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3808 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3809
3810 #. type: Plain text
3811 #: build/C/man3/pthread_cancel.3:188
3812 #, no-wrap
3813 msgid "    /* Should never get here */\n"
3814 msgstr "    /* Should never get here */\n"
3815
3816 #. type: Plain text
3817 #: build/C/man3/pthread_cancel.3:192
3818 #, no-wrap
3819 msgid ""
3820 "    printf(\"thread_func(): not canceled!\\en\");\n"
3821 "    return NULL;\n"
3822 "}\n"
3823 msgstr ""
3824 "    printf(\"thread_func(): not canceled!\\en\");\n"
3825 "    return NULL;\n"
3826 "}\n"
3827
3828 #. type: Plain text
3829 #: build/C/man3/pthread_cancel.3:199
3830 #, no-wrap
3831 msgid ""
3832 "int\n"
3833 "main(void)\n"
3834 "{\n"
3835 "    pthread_t thr;\n"
3836 "    void *res;\n"
3837 "    int s;\n"
3838 msgstr ""
3839 "int\n"
3840 "main(void)\n"
3841 "{\n"
3842 "    pthread_t thr;\n"
3843 "    void *res;\n"
3844 "    int s;\n"
3845
3846 #. type: Plain text
3847 #: build/C/man3/pthread_cancel.3:201
3848 #, no-wrap
3849 msgid "    /* Start a thread and then send it a cancellation request */\n"
3850 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3851
3852 #. type: Plain text
3853 #: build/C/man3/pthread_cancel.3:205
3854 #, no-wrap
3855 msgid ""
3856 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3857 "    if (s != 0)\n"
3858 "        handle_error_en(s, \"pthread_create\");\n"
3859 msgstr ""
3860 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3861 "    if (s != 0)\n"
3862 "        handle_error_en(s, \"pthread_create\");\n"
3863
3864 #. type: Plain text
3865 #: build/C/man3/pthread_cancel.3:207
3866 #, no-wrap
3867 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3868 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3869
3870 #. type: Plain text
3871 #: build/C/man3/pthread_cancel.3:212
3872 #, no-wrap
3873 msgid ""
3874 "    printf(\"main(): sending cancellation request\\en\");\n"
3875 "    s = pthread_cancel(thr);\n"
3876 "    if (s != 0)\n"
3877 "        handle_error_en(s, \"pthread_cancel\");\n"
3878 msgstr ""
3879 "    printf(\"main(): sending cancellation request\\en\");\n"
3880 "    s = pthread_cancel(thr);\n"
3881 "    if (s != 0)\n"
3882 "        handle_error_en(s, \"pthread_cancel\");\n"
3883
3884 #. type: Plain text
3885 #: build/C/man3/pthread_cancel.3:214
3886 #, no-wrap
3887 msgid "    /* Join with thread to see what its exit status was */\n"
3888 msgstr "    /* Join with thread to see what its exit status was */\n"
3889
3890 #. type: Plain text
3891 #: build/C/man3/pthread_cancel.3:218 build/C/man3/pthread_cleanup_push.3:307
3892 #, no-wrap
3893 msgid ""
3894 "    s = pthread_join(thr, &res);\n"
3895 "    if (s != 0)\n"
3896 "        handle_error_en(s, \"pthread_join\");\n"
3897 msgstr ""
3898 "    s = pthread_join(thr, &res);\n"
3899 "    if (s != 0)\n"
3900 "        handle_error_en(s, \"pthread_join\");\n"
3901
3902 #. type: Plain text
3903 #: build/C/man3/pthread_cancel.3:225
3904 #, no-wrap
3905 msgid ""
3906 "    if (res == PTHREAD_CANCELED)\n"
3907 "        printf(\"main(): thread was canceled\\en\");\n"
3908 "    else\n"
3909 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3910 "    exit(EXIT_SUCCESS);\n"
3911 "}\n"
3912 msgstr ""
3913 "    if (res == PTHREAD_CANCELED)\n"
3914 "        printf(\"main(): thread was canceled\\en\");\n"
3915 "    else\n"
3916 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3917 "    exit(EXIT_SUCCESS);\n"
3918 "}\n"
3919
3920 #. type: Plain text
3921 #: build/C/man3/pthread_cancel.3:238
3922 msgid ""
3923 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3924 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3925 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3926 msgstr ""
3927 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3928 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3929 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3930
3931 #. type: TH
3932 #: build/C/man3/pthread_cleanup_push.3:26
3933 #, no-wrap
3934 msgid "PTHREAD_CLEANUP_PUSH"
3935 msgstr "PTHREAD_CLEANUP_PUSH"
3936
3937 #. type: TH
3938 #: build/C/man3/pthread_cleanup_push.3:26
3939 #: build/C/man3/pthread_setcancelstate.3:26
3940 #, no-wrap
3941 msgid "2008-11-24"
3942 msgstr "2008-11-24"
3943
3944 #. type: Plain text
3945 #: build/C/man3/pthread_cleanup_push.3:30
3946 msgid ""
3947 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
3948 "clean-up handlers"
3949 msgstr ""
3950 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
3951 "キャンセルクリーンアップハンドラの push/pop を行う"
3952
3953 #. type: Plain text
3954 #: build/C/man3/pthread_cleanup_push.3:37
3955 #, no-wrap
3956 msgid ""
3957 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3958 "B<                          void *>I<arg>B<);>\n"
3959 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3960 msgstr ""
3961 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3962 "B<                          void *>I<arg>B<);>\n"
3963 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3964
3965 #. type: Plain text
3966 #: build/C/man3/pthread_cleanup_push.3:48
3967 msgid ""
3968 "These functions manipulate the calling thread's stack of thread-cancellation "
3969 "clean-up handlers.  A clean-up handler is a function that is automatically "
3970 "executed when a thread is canceled (or in various other circumstances "
3971 "described below); it might, for example, unlock a mutex so that it becomes "
3972 "available to other threads in the process."
3973 msgstr ""
3974 "これらの関数は、呼び出したスレッドのスレッドキャンセル時のクリーンアッ\n"
3975 "プハンドラのスタックの操作を行う。クリーンアップハンドラは、スレッドが\n"
3976 "キャンセルされた場合 (や以下で説明する他の種々の状況において) 自動的に\n"
3977 "実行される関数である。例えば、mutex のロック解除を行い、プロセス内の\n"
3978 "他のスレッドが利用できるようにする関数などが考えられる。"
3979
3980 #. type: Plain text
3981 #: build/C/man3/pthread_cleanup_push.3:59
3982 msgid ""
3983 "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of "
3984 "the stack of clean-up handlers.  When I<routine> is later invoked, it will "
3985 "be given I<arg> as its argument."
3986 msgstr ""
3987 "B<pthread_cleanup_push>() 関数は、 I<routine> をクリーンアップ\n"
3988 "ハンドラのスタックの一番上にプッシュする。 I<routine> が後で\n"
3989 "起動される際には、 I<arg> が関数の引き数と渡される。"
3990
3991 #. type: Plain text
3992 #: build/C/man3/pthread_cleanup_push.3:66
3993 msgid ""
3994 "The B<pthread_cleanup_pop>()  function removes the routine at the top of the "
3995 "stack of clean-up handlers, and optionally executes it if I<execute> is "
3996 "nonzero."
3997 msgstr ""
3998 "B<pthread_cleanup_pop>() 関数は、クリーンアップハンドラの\n"
3999 "スタックの一番上のルーチンを削除する。\n"
4000 "I<execute> が 0 以外の場合にはそのルーチンを追加で実行する。"
4001
4002 #. type: Plain text
4003 #: build/C/man3/pthread_cleanup_push.3:69
4004 msgid ""
4005 "A cancellation clean-up handler is popped from the stack and executed in the "
4006 "following circumstances:"
4007 msgstr ""
4008 "キャンセルクリーンアップハンドラは、以下に示す場合に\n"
4009 "スタックから取り出され実行される。"
4010
4011 #. type: Plain text
4012 #: build/C/man3/pthread_cleanup_push.3:73
4013 msgid ""
4014 "When a thread is canceled, all of the stacked clean-up handlers are popped "
4015 "and executed in the reverse of the order in which they were pushed onto the "
4016 "stack."
4017 msgstr ""
4018 "スレッドがキャンセルされた際に、スタックに登録された全てのクリーン\n"
4019 "アップハンドラが取り出されて、実行される。クリーンアップハンドラの\n"
4020 "実行は、スタックに登録されたのと逆の順序で行われる。"
4021
4022 #. type: Plain text
4023 #: build/C/man3/pthread_cleanup_push.3:83
4024 msgid ""
4025 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
4026 "handlers are executed as described in the preceding point.  (Clean-up "
4027 "handlers are I<not> called if the thread terminates by performing a "
4028 "I<return> from the thread start function.)"
4029 msgstr ""
4030 "スレッドが B<pthread_exit>(3) を呼び出して終了する際に、全てのクリーン\n"
4031 "アップハンドラが上の項目で述べたのと同様に実行される。\n"
4032 "(スレッドがスレッド開始関数からの I<return> の実行により終了する場合に\n"
4033 "は、クリーンアップハンドラはI<呼び出されない>。)"
4034
4035 #. type: Plain text
4036 #: build/C/man3/pthread_cleanup_push.3:89
4037 msgid ""
4038 "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> "
4039 "argument, the top-most clean-up handler is popped and executed."
4040 msgstr ""
4041 "スレッドが 0 以外の I<execute> 引き数で B<pthread_cleanup_pop>() を\n"
4042 "呼び出した際に、スタックの一番上のクリーンアップハンドラが取り出されて\n"
4043 "実行される。"
4044
4045 #. type: Plain text
4046 #: build/C/man3/pthread_cleanup_push.3:101
4047 msgid ""
4048 "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to "
4049 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
4050 "\\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that "
4051 "calls to these functions are paired within the same function, and at the "
4052 "same lexical nesting level.  (In other words, a clean-up handler is "
4053 "established only during the execution of a specified section of code.)"
4054 msgstr ""
4055 "POSIX.1 では、 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>() を\n"
4056 "それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開するマクロと\n"
4057 "して実装することを許容している。\n"
4058 "このため、呼び出し側では、これらの関数の呼び出しが同じ関数の中で対と\n"
4059 "なり、かつ文法的に同じネストレベル (nesting level) になることを保証\n"
4060 "しなければならない。 (言い換えると、クリーンアップハンドラは、コード\n"
4061 "の特定のセクションの実行の中でのみ設定するものであると言える。)"
4062
4063 #. type: Plain text
4064 #: build/C/man3/pthread_cleanup_push.3:121
4065 msgid ""
4066 "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any "
4067 "call has been made to B<pthread_cleanup_push>()  or B<pthread_cleanup_pop>"
4068 "()  without the matching call of the pair since the jump buffer was filled "
4069 "by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, calling B<longjmp>(3)  "
4070 "(B<siglongjmp>(3))  from inside a clean-up handler produces undefined "
4071 "results unless the jump buffer was also filled by B<setjmp>(3)  (B<sigsetjmp>"
4072 "(3))  inside the handler."
4073 msgstr ""
4074 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しは、\n"
4075 "B<pthread_cleanup_push>() や B<pthread_cleanup_pop>() の呼び出しが対と\n"
4076 "なる呼び出しがない状態で行われた場合には、どのような結果になるかは不定\n"
4077 "である。これは jump バッファは B<setjmp>(3) (B<sigsetjmp>(3)) により設\n"
4078 "定されるからである。同様に、クリーンアップハンドラ内からの\n"
4079 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しも、jump バッファがハンドラ\n"
4080 "内で B<setjmp>(3) (B<sigsetjmp>(3)) で設定されていない限り、どのような\n"
4081 "結果になるかは不定である。"
4082
4083 #. type: Plain text
4084 #: build/C/man3/pthread_cleanup_push.3:123
4085 msgid "These functions do not return a value."
4086 msgstr "これらの関数は値を返さない。"
4087
4088 #.  SH VERSIONS
4089 #.  Available since glibc 2.0
4090 #. type: Plain text
4091 #: build/C/man3/pthread_cleanup_push.3:127
4092 msgid "There are no errors."
4093 msgstr "エラーはない。"
4094
4095 #. type: Plain text
4096 #: build/C/man3/pthread_cleanup_push.3:140
4097 msgid ""
4098 "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  "
4099 "functions I<are> implemented as macros that expand to text containing \\(aqB<"
4100 "{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables "
4101 "declared within the scope of paired calls to these functions will be visible "
4102 "within only that scope."
4103 msgstr ""
4104 "Linux では、関数 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>()\n"
4105 "は、それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開する\n"
4106 "マクロとして実装されている。このことは、これらの関数を対で呼び出した\n"
4107 "スコープ内で宣言された変数は、そのスコープの中でしか参照できない\n"
4108 "ということを意味している。"
4109
4110 #.  The text was actually added in the 2004 TC2
4111 #. type: Plain text
4112 #: build/C/man3/pthread_cleanup_push.3:155
4113 msgid ""
4114 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
4115 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  "
4116 "and B<pthread_cleanup_pop>()  is undefined.  Portable applications should "
4117 "avoid doing this."
4118 msgstr ""
4119 "POSIX.1 には、括弧を含む B<pthread_cleanup_push>() と\n"
4120 "B<pthread_cleanup_pop>() のブロックをそのままにしたままで、 \n"
4121 "I<return>, I<break>, I<continue>, I<goto> を使った場合の影響は\n"
4122 "不定であると書かれている。\n"
4123 "移植性が必要なアプリケーションではこれを行うのは避けるべきである。"
4124
4125 #. type: Plain text
4126 #: build/C/man3/pthread_cleanup_push.3:170
4127 msgid ""
4128 "The program below provides a simple example of the use of the functions "
4129 "described in this page.  The program creates a thread that executes a loop "
4130 "bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This "
4131 "loop increments a global variable, I<cnt>, once each second.  Depending on "
4132 "what command-line arguments are supplied, the main thread sends the other "
4133 "thread a cancellation request, or sets a global variable that causes the "
4134 "other thread to exit its loop and terminate normally (by doing a I<return>)."
4135 msgstr ""
4136 "以下のプログラムは、このページで説明した関数の簡単な使用例を示すもので\n"
4137 "ある。このプログラムは B<pthread_cleanup_push>() と\n"
4138 "B<pthread_cleanup_pop>() で囲まれたループを実行するスレッドを作成する。\n"
4139 "このループではグローバル変数 I<cnt> を 1 秒に 1 ずつ増やしていく。\n"
4140 "指定されたコマンドライン引き数の内容に基づいて、メインスレッドはもう一\n"
4141 "つのスレッドにキャンセル要求を送ったり、もう一つのスレッドがループを\n"
4142 "抜けて (I<return> を呼び出して) 正常終了するようにグローバル変数を\n"
4143 "設定したりする。"
4144
4145 #. type: Plain text
4146 #: build/C/man3/pthread_cleanup_push.3:173
4147 msgid ""
4148 "In the following shell session, the main thread sends a cancellation request "
4149 "to the other thread:"
4150 msgstr ""
4151 "以下のシェルセッションでは、メインスレッドはもう一つのスレッドに\n"
4152 "キャンセル要求を送信する。"
4153
4154 #. type: Plain text
4155 #: build/C/man3/pthread_cleanup_push.3:183
4156 #, no-wrap
4157 msgid ""
4158 "$ B<./a.out>\n"
4159 "New thread started\n"
4160 "cnt = 0\n"
4161 "cnt = 1\n"
4162 "Canceling thread\n"
4163 "Called clean-up handler\n"
4164 "Thread was canceled; cnt = 0\n"
4165 msgstr ""
4166 "$ B<./a.out>\n"
4167 "New thread started\n"
4168 "cnt = 0\n"
4169 "cnt = 1\n"
4170 "Canceling thread\n"
4171 "Called clean-up handler\n"
4172 "Thread was canceled; cnt = 0\n"
4173
4174 #. type: Plain text
4175 #: build/C/man3/pthread_cleanup_push.3:191
4176 msgid ""
4177 "From the above, we see that the thread was canceled, and that the "
4178 "cancellation clean-up handler was called and it reset the value of the "
4179 "global variable I<cnt> to 0."
4180 msgstr ""
4181 "上記の実行例から、スレッドがキャンセルされ、\n"
4182 "キャンセルクリーンアップハンドラが呼び出され、\n"
4183 "グローバル変数 I<cnt> の値が 0 にリセットされていることが確認できる。"
4184
4185 #. type: Plain text
4186 #: build/C/man3/pthread_cleanup_push.3:194
4187 msgid ""
4188 "In the next run, the main program sets a global variable that causes other "
4189 "thread to terminate normally:"
4190 msgstr ""
4191 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4192 "もう一つのスレッドが正常終了するようにしている。"
4193
4194 #. type: Plain text
4195 #: build/C/man3/pthread_cleanup_push.3:202
4196 #, no-wrap
4197 msgid ""
4198 "$ B<./a.out x>\n"
4199 "New thread started\n"
4200 "cnt = 0\n"
4201 "cnt = 1\n"
4202 "Thread terminated normally; cnt = 2\n"
4203 msgstr ""
4204 "$ B<./a.out x>\n"
4205 "New thread started\n"
4206 "cnt = 0\n"
4207 "cnt = 1\n"
4208 "Thread terminated normally; cnt = 2\n"
4209
4210 #. type: Plain text
4211 #: build/C/man3/pthread_cleanup_push.3:210
4212 msgid ""
4213 "From the above, we see that the clean-up handler was not executed (because "
4214 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
4215 msgstr ""
4216 "上記では、 (I<cleanup_pop_arg> が 0 なので) クリーンアップハンドラは\n"
4217 "実行されておらず、その結果 I<cnt> の値はリセットされていないことが\n"
4218 "分かる。"
4219
4220 #. type: Plain text
4221 #: build/C/man3/pthread_cleanup_push.3:215
4222 msgid ""
4223 "In the next run, the main program sets a global variable that causes the "
4224 "other thread to terminate normally, and supplies a nonzero value for "
4225 "I<cleanup_pop_arg>:"
4226 msgstr ""
4227 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4228 "もう一つのスレッドが正常終了するようにし、さらに\n"
4229 "I<cleanup_pop_arg> に 0 以外の値を渡している。"
4230
4231 #. type: Plain text
4232 #: build/C/man3/pthread_cleanup_push.3:224
4233 #, no-wrap
4234 msgid ""
4235 "$ B<./a.out x 1>\n"
4236 "New thread started\n"
4237 "cnt = 0\n"
4238 "cnt = 1\n"
4239 "Called clean-up handler\n"
4240 "Thread terminated normally; cnt = 0\n"
4241 msgstr ""
4242 "$ B<./a.out x 1>\n"
4243 "New thread started\n"
4244 "cnt = 0\n"
4245 "cnt = 1\n"
4246 "Called clean-up handler\n"
4247 "Thread terminated normally; cnt = 0\n"
4248
4249 #. type: Plain text
4250 #: build/C/man3/pthread_cleanup_push.3:231
4251 msgid ""
4252 "In the above, we see that although the thread was not canceled, the clean-up "
4253 "handler was executed, because the argument given to B<pthread_cleanup_pop>"
4254 "()  was nonzero."
4255 msgstr ""
4256 "上記では、スレッドはキャンセルされていないが、クリーンアップハンドラが\n"
4257 "実行されていないことが分かる。これは B<pthread_cleanup_pop>() の引き数\n"
4258 "に 0 以外を渡したからである。"
4259
4260 #. type: Plain text
4261 #: build/C/man3/pthread_cleanup_push.3:240
4262 #, no-wrap
4263 msgid ""
4264 "#include E<lt>pthread.hE<gt>\n"
4265 "#include E<lt>sys/types.hE<gt>\n"
4266 "#include E<lt>stdio.hE<gt>\n"
4267 "#include E<lt>stdlib.hE<gt>\n"
4268 "#include E<lt>unistd.hE<gt>\n"
4269 "#include E<lt>errno.hE<gt>\n"
4270 msgstr ""
4271 "#include E<lt>pthread.hE<gt>\n"
4272 "#include E<lt>sys/types.hE<gt>\n"
4273 "#include E<lt>stdio.hE<gt>\n"
4274 "#include E<lt>stdlib.hE<gt>\n"
4275 "#include E<lt>unistd.hE<gt>\n"
4276 "#include E<lt>errno.hE<gt>\n"
4277
4278 #. type: Plain text
4279 #: build/C/man3/pthread_cleanup_push.3:247
4280 #, no-wrap
4281 msgid ""
4282 "static int done = 0;\n"
4283 "static int cleanup_pop_arg = 0;\n"
4284 "static int cnt = 0;\n"
4285 msgstr ""
4286 "static int done = 0;\n"
4287 "static int cleanup_pop_arg = 0;\n"
4288 "static int cnt = 0;\n"
4289
4290 #. type: Plain text
4291 #: build/C/man3/pthread_cleanup_push.3:254
4292 #, no-wrap
4293 msgid ""
4294 "static void\n"
4295 "cleanup_handler(void *arg)\n"
4296 "{\n"
4297 "    printf(\"Called clean-up handler\\en\");\n"
4298 "    cnt = 0;\n"
4299 "}\n"
4300 msgstr ""
4301 "static void\n"
4302 "cleanup_handler(void *arg)\n"
4303 "{\n"
4304 "    printf(\"Called clean-up handler\\en\");\n"
4305 "    cnt = 0;\n"
4306 "}\n"
4307
4308 #. type: Plain text
4309 #: build/C/man3/pthread_cleanup_push.3:259
4310 #, no-wrap
4311 msgid ""
4312 "static void *\n"
4313 "thread_start(void *arg)\n"
4314 "{\n"
4315 "    time_t start, curr;\n"
4316 msgstr ""
4317 "static void *\n"
4318 "thread_start(void *arg)\n"
4319 "{\n"
4320 "    time_t start, curr;\n"
4321
4322 #. type: Plain text
4323 #: build/C/man3/pthread_cleanup_push.3:261
4324 #, no-wrap
4325 msgid "    printf(\"New thread started\\en\");\n"
4326 msgstr "    printf(\"New thread started\\en\");\n"
4327
4328 #. type: Plain text
4329 #: build/C/man3/pthread_cleanup_push.3:263
4330 #, no-wrap
4331 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4332 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4333
4334 #. type: Plain text
4335 #: build/C/man3/pthread_cleanup_push.3:265
4336 #, no-wrap
4337 msgid "    curr = start = time(NULL);\n"
4338 msgstr "    curr = start = time(NULL);\n"
4339
4340 #. type: Plain text
4341 #: build/C/man3/pthread_cleanup_push.3:274
4342 #, no-wrap
4343 msgid ""
4344 "    while (!done) {\n"
4345 "        pthread_testcancel();           /* A cancellation point */\n"
4346 "        if (curr E<lt> time(NULL)) {\n"
4347 "            curr = time(NULL);\n"
4348 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4349 "            cnt++;\n"
4350 "        }\n"
4351 "    }\n"
4352 msgstr ""
4353 "    while (!done) {\n"
4354 "        pthread_testcancel();           /* A cancellation point */\n"
4355 "        if (curr E<lt> time(NULL)) {\n"
4356 "            curr = time(NULL);\n"
4357 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
4358 "            cnt++;\n"
4359 "        }\n"
4360 "    }\n"
4361
4362 #. type: Plain text
4363 #: build/C/man3/pthread_cleanup_push.3:278
4364 #, no-wrap
4365 msgid ""
4366 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4367 "    return NULL;\n"
4368 "}\n"
4369 msgstr ""
4370 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4371 "    return NULL;\n"
4372 "}\n"
4373
4374 #. type: Plain text
4375 #: build/C/man3/pthread_cleanup_push.3:285
4376 #, no-wrap
4377 msgid ""
4378 "int\n"
4379 "main(int argc, char *argv[])\n"
4380 "{\n"
4381 "    pthread_t thr;\n"
4382 "    int s;\n"
4383 "    void *res;\n"
4384 msgstr ""
4385 "int\n"
4386 "main(int argc, char *argv[])\n"
4387 "{\n"
4388 "    pthread_t thr;\n"
4389 "    int s;\n"
4390 "    void *res;\n"
4391
4392 #. type: Plain text
4393 #: build/C/man3/pthread_cleanup_push.3:289
4394 #, no-wrap
4395 msgid ""
4396 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4397 "    if (s != 0)\n"
4398 "        handle_error_en(s, \"pthread_create\");\n"
4399 msgstr ""
4400 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4401 "    if (s != 0)\n"
4402 "        handle_error_en(s, \"pthread_create\");\n"
4403
4404 #. type: Plain text
4405 #: build/C/man3/pthread_cleanup_push.3:291
4406 #, no-wrap
4407 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
4408 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
4409
4410 #. type: Plain text
4411 #: build/C/man3/pthread_cleanup_push.3:296
4412 #, no-wrap
4413 msgid ""
4414 "    if (argc E<gt> 1) {\n"
4415 "        if (argc E<gt> 2)\n"
4416 "            cleanup_pop_arg = atoi(argv[2]);\n"
4417 "        done = 1;\n"
4418 msgstr ""
4419 "    if (argc E<gt> 1) {\n"
4420 "        if (argc E<gt> 2)\n"
4421 "            cleanup_pop_arg = atoi(argv[2]);\n"
4422 "        done = 1;\n"
4423
4424 #. type: Plain text
4425 #: build/C/man3/pthread_cleanup_push.3:303
4426 #, no-wrap
4427 msgid ""
4428 "    } else {\n"
4429 "        printf(\"Canceling thread\\en\");\n"
4430 "        s = pthread_cancel(thr);\n"
4431 "        if (s != 0)\n"
4432 "            handle_error_en(s, \"pthread_cancel\");\n"
4433 "    }\n"
4434 msgstr ""
4435 "    } else {\n"
4436 "        printf(\"Canceling thread\\en\");\n"
4437 "        s = pthread_cancel(thr);\n"
4438 "        if (s != 0)\n"
4439 "            handle_error_en(s, \"pthread_cancel\");\n"
4440 "    }\n"
4441
4442 #. type: Plain text
4443 #: build/C/man3/pthread_cleanup_push.3:314
4444 #, no-wrap
4445 msgid ""
4446 "    if (res == PTHREAD_CANCELED)\n"
4447 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4448 "    else\n"
4449 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4450 "    exit(EXIT_SUCCESS);\n"
4451 "}\n"
4452 msgstr ""
4453 "    if (res == PTHREAD_CANCELED)\n"
4454 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4455 "    else\n"
4456 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4457 "    exit(EXIT_SUCCESS);\n"
4458 "}\n"
4459
4460 #. type: Plain text
4461 #: build/C/man3/pthread_cleanup_push.3:321
4462 msgid ""
4463 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4464 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4465 msgstr ""
4466 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4467 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4468
4469 #. type: TH
4470 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
4471 #, no-wrap
4472 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4473 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4474
4475 #. type: TH
4476 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
4477 #, no-wrap
4478 msgid "2008-12-04"
4479 msgstr "2008-12-04"
4480
4481 #. type: Plain text
4482 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
4483 msgid ""
4484 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
4485 "thread cancellation clean-up handlers while saving cancelability type"
4486 msgstr ""
4487 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - "
4488 "cancelability type を保持したままでスレッドのキャンセルクリーンアップハンドラ"
4489 "の push/pop を行う"
4490
4491 #. type: Plain text
4492 #: build/C/man3/pthread_cleanup_push_defer_np.3:37
4493 #, no-wrap
4494 msgid ""
4495 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4496 "B<                                   void *>I<arg>B<);>\n"
4497 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4498 msgstr ""
4499 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4500 "B<                                   void *>I<arg>B<);>\n"
4501 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4502
4503 #. type: Plain text
4504 #: build/C/man3/pthread_cleanup_push_defer_np.3:40
4505 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
4506 #: build/C/man3/pthread_join.3:37 build/C/man3/pthread_kill.3:37
4507 #: build/C/man3/pthread_setname_np.3:39 build/C/man3/pthread_sigmask.3:38
4508 #: build/C/man3/pthread_sigqueue.3:37 build/C/man3/pthread_tryjoin_np.3:42
4509 #: build/C/man3/pthread_yield.3:37
4510 msgid "Compile and link with I<-pthread>."
4511 msgstr "I<-pthread> を付けてコンパイルとリンクを行う。"
4512
4513 #. type: Plain text
4514 #: build/C/man3/pthread_cleanup_push_defer_np.3:46
4515 msgid ""
4516 "These functions are the same as B<pthread_cleanup_push>(3)  and "
4517 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
4518 msgstr ""
4519 "これらの関数は B<pthread_cleanup_push>(3) と B<pthread_cleanup_pop>(3) と同じ"
4520 "だが、このページで説明する点が異なる。"
4521
4522 #. type: Plain text
4523 #: build/C/man3/pthread_cleanup_push_defer_np.3:59
4524 msgid ""
4525 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes "
4526 "I<routine> onto the thread's stack of cancellation clean-up handlers.  In "
4527 "addition, it also saves the thread's current cancelability type, and sets "
4528 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
4529 "this ensures that cancellation clean-up will occur even if the thread's "
4530 "cancelability type was \"asynchronous\" before the call."
4531 msgstr ""
4532 "B<pthread_cleanup_push>(3) と同様に、\n"
4533 "B<pthread_cleanup_push_defer_np>() は I<routine> をそのスレッドの\n"
4534 "クリーンアップハンドラのスタックに追加する。これに加えて、\n"
4535 "B<pthread_cleanup_push_defer_np>() は現在の cancelability type も\n"
4536 "保存し、cancelability type は \"deferred\" に設定する\n"
4537 "(B<pthread_setcanceltype>(3) 参照)。\n"
4538 "これにより、この関数が呼び出される前のスレッドの cancelability type が\n"
4539 "\"asynchronous\" であったとしても、キャンセルクリーンアップが行われること\n"
4540 "が保証される。"
4541
4542 #. type: Plain text
4543 #: build/C/man3/pthread_cleanup_push_defer_np.3:68
4544 msgid ""
4545 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops "
4546 "the top-most clean-up handler from the thread's stack of cancellation clean-"
4547 "up handlers.  In addition, it restores the thread's cancelability type to "
4548 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
4549 msgstr ""
4550 "B<pthread_cleanup_pop>(3) と同様に、\n"
4551 "B<pthread_cleanup_pop_restore_np>() はそのスレッドのキャンセル\n"
4552 "クリーンアップハンドラのスタックから一番上にあるクリーンアップハンドラ\n"
4553 "を取り出す。これに加えて、そのスレッドの cancelability type を、対応\n"
4554 "する B<pthread_cleanup_push_defer_np>() が呼ばれた時点の値に戻す。"
4555
4556 #. type: Plain text
4557 #: build/C/man3/pthread_cleanup_push_defer_np.3:74
4558 msgid ""
4559 "The caller must ensure that calls to these functions are paired within the "
4560 "same function, and at the same lexical nesting level.  Other restrictions "
4561 "apply, as described in B<pthread_cleanup_push>(3)."
4562 msgstr ""
4563 "呼び出し側では、これらの関数の呼び出しが同じ関数の中で対となり、かつ\n"
4564 "文法的に同じネストレベル (nesting level) になることを保証しなければ\n"
4565 "ならない。 B<pthread_cleanup_push>(3) で説明されている他の制限も\n"
4566 "適用される。"
4567
4568 #. type: Plain text
4569 #: build/C/man3/pthread_cleanup_push_defer_np.3:76
4570 msgid "This sequence of calls:"
4571 msgstr "以下の一連の呼び出し"
4572
4573 #. type: Plain text
4574 #: build/C/man3/pthread_cleanup_push_defer_np.3:81
4575 #, no-wrap
4576 msgid ""
4577 "pthread_cleanup_push_defer_np(routine, arg);\n"
4578 "pthread_cleanup_pop_restore_np(execute);\n"
4579 msgstr ""
4580 "pthread_cleanup_push_defer_np(routine, arg);\n"
4581 "pthread_cleanup_pop_restore_np(execute);\n"
4582
4583 #. type: Plain text
4584 #: build/C/man3/pthread_cleanup_push_defer_np.3:85
4585 msgid "is equivalent to (but shorter and more efficient than):"
4586 msgstr "と以下は等価である (但し、上の方がより簡潔で効率的である)。"
4587
4588 #. type: Plain text
4589 #: build/C/man3/pthread_cleanup_push_defer_np.3:91
4590 #, no-wrap
4591 msgid "int oldtype;\n"
4592 msgstr "int oldtype;\n"
4593
4594 #. type: Plain text
4595 #: build/C/man3/pthread_cleanup_push_defer_np.3:97
4596 #, no-wrap
4597 msgid ""
4598 "pthread_cleanup_push(routine, arg);\n"
4599 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4600 "\\&...\n"
4601 "pthread_setcanceltype(oldtype, NULL);\n"
4602 "pthread_cleanup_pop(execute);\n"
4603 msgstr ""
4604 "pthread_cleanup_push(routine, arg);\n"
4605 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4606 "\\&...\n"
4607 "pthread_setcanceltype(oldtype, NULL);\n"
4608 "pthread_cleanup_pop(execute);\n"
4609
4610 #. type: Plain text
4611 #: build/C/man3/pthread_cleanup_push_defer_np.3:110
4612 msgid ""
4613 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
4614 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4615 msgstr ""
4616 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
4617 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4618
4619 #. type: TH
4620 #: build/C/man3/pthread_create.3:26
4621 #, no-wrap
4622 msgid "PTHREAD_CREATE"
4623 msgstr "PTHREAD_CREATE"
4624
4625 #. type: TH
4626 #: build/C/man3/pthread_create.3:26
4627 #, no-wrap
4628 msgid "2012-08-03"
4629 msgstr "2012-08-03"
4630
4631 #. type: Plain text
4632 #: build/C/man3/pthread_create.3:29
4633 msgid "pthread_create - create a new thread"
4634 msgstr "pthread_create - 新しいスレッドを作成する"
4635
4636 #. type: Plain text
4637 #: build/C/man3/pthread_create.3:35
4638 #, no-wrap
4639 msgid ""
4640 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4641 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4642 msgstr ""
4643 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4644 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4645
4646 #. type: Plain text
4647 #: build/C/man3/pthread_create.3:47
4648 msgid ""
4649 "The B<pthread_create>()  function starts a new thread in the calling "
4650 "process.  The new thread starts execution by invoking I<start_routine>(); "
4651 "I<arg> is passed as the sole argument of I<start_routine>()."
4652 msgstr ""
4653 "B<pthread_create>() 関数は、呼び出したプロセス内に新しいスレッドを作成す"
4654 "る。\n"
4655 "新しいスレッドの実行は、 I<start_routine>() を起動することで開始される。\n"
4656 "I<start_routine>() は引き数を一つだけ取り、\n"
4657 "I<arg> が I<start_routine>() の引き数として渡される。"
4658
4659 #. type: Plain text
4660 #: build/C/man3/pthread_create.3:49
4661 msgid "The new thread terminates in one of the following ways:"
4662 msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。"
4663
4664 #. type: IP
4665 #: build/C/man3/pthread_create.3:49 build/C/man3/pthread_create.3:55
4666 #: build/C/man3/pthread_create.3:63 build/C/man3/pthread_create.3:66
4667 #: build/C/man3/pthread_getattr_np.3:52 build/C/man3/pthread_getattr_np.3:55
4668 #: build/C/man3/pthread_getattr_np.3:58
4669 #, no-wrap
4670 msgid "*"
4671 msgstr "*"
4672
4673 #. type: Plain text
4674 #: build/C/man3/pthread_create.3:55
4675 msgid ""
4676 "It calls B<pthread_exit>(3), specifying an exit status value that is "
4677 "available to another thread in the same process that calls B<pthread_join>"
4678 "(3)."
4679 msgstr ""
4680 "スレッドが B<pthread_exit>(3) を呼び出す。\n"
4681 "B<pthread_exit>(3) を呼び出す際には終了ステータス値を指定する。\n"
4682 "この値は B<pthread_join>(3) を呼び出した同じプロセス内の\n"
4683 "別のスレッドで参照できる。"
4684
4685 #. type: Plain text
4686 #: build/C/man3/pthread_create.3:63
4687 msgid ""
4688 "It returns from I<start_routine>().  This is equivalent to calling "
4689 "B<pthread_exit>(3)  with the value supplied in the I<return> statement."
4690 msgstr ""
4691 "スレッドが I<start_routine>() から返る。これは、\n"
4692 "I<return> 文に渡した値で B<pthread_exit>(3) を呼び出すのと等価である。"
4693
4694 #. type: Plain text
4695 #: build/C/man3/pthread_create.3:66
4696 msgid "It is canceled (see B<pthread_cancel>(3))."
4697 msgstr "スレッドがキャンセルされる (B<pthread_cancel>(3) 参照)。"
4698
4699 #. type: Plain text
4700 #: build/C/man3/pthread_create.3:72
4701 msgid ""
4702 "Any of the threads in the process calls B<exit>(3), or the main thread "
4703 "performs a return from I<main>().  This causes the termination of all "
4704 "threads in the process."
4705 msgstr ""
4706 "プロセス内のいずれかのスレッドで B<exit>(3) が呼ばれるか、\n"
4707 "メインスレッドで I<main>() 内で return が実行される。\n"
4708 "この場合は、プロセス内の全てのスレッドが終了される。"
4709
4710 #. type: Plain text
4711 #: build/C/man3/pthread_create.3:86
4712 msgid ""
4713 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4714 "are used at thread creation time to determine attributes for the new thread; "
4715 "this structure is initialized using B<pthread_attr_init>(3)  and related "
4716 "functions.  If I<attr> is NULL, then the thread is created with default "
4717 "attributes."
4718 msgstr ""
4719 "I<attr> 引き数は I<pthread_attr_t> 構造体へのポインタであり、\n"
4720 "I<pthread_attr_t> 構造体の内容を使用して、スレッド作成時に\n"
4721 "新しいスレッドの属性が決定される。\n"
4722 "この構造体は B<pthread_attr_init>(3) や関連の関数を使って初期化される。\n"
4723 "I<attr> が NULL の場合、新しいスレッドはデフォルトの属性で作成される。"
4724
4725 #. type: Plain text
4726 #: build/C/man3/pthread_create.3:93
4727 msgid ""
4728 "Before returning, a successful call to B<pthread_create>()  stores the ID of "
4729 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4730 "used to refer to the thread in subsequent calls to other pthreads functions."
4731 msgstr ""
4732 "成功した場合は、 B<pthread_create>() は返る前に新しいスレッドの ID を\n"
4733 "I<thread> が指すバッファに格納する。この ID は、これ以降に他の\n"
4734 "pthreads 関数の呼び出しでスレッドを参照するのに使用される。"
4735
4736 #. type: Plain text
4737 #: build/C/man3/pthread_create.3:101
4738 msgid ""
4739 "The new thread inherits a copy of the creating thread's signal mask "
4740 "(B<pthread_sigmask>(3)).  The set of pending signals for the new thread is "
4741 "empty (B<sigpending>(2)).  The new thread does not inherit the creating "
4742 "thread's alternate signal stack (B<sigaltstack>(2))."
4743 msgstr ""
4744 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスク\n"
4745 "(B<pthread_sigmask>(3) 参照) のコピーを継承する。\n"
4746 "新しいスレッドの処理待ちシグナル (B<sigpending>(2)) の集合は空となる。\n"
4747 "新しいスレッドはスレッドを作成したスレッドの代替シグナルスタック\n"
4748 "(B<sigaltstack>(2)) を継承しない。"
4749
4750 #. type: Plain text
4751 #: build/C/man3/pthread_create.3:104
4752 msgid ""
4753 "The new thread inherits the calling thread's floating-point environment "
4754 "(B<fenv>(3))."
4755 msgstr ""
4756 "新しいスレッドは呼び出したスレッドの浮動小数点環境 (B<fenv>(3))\n"
4757 "を継承する。"
4758
4759 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4760 #. type: Plain text
4761 #: build/C/man3/pthread_create.3:109
4762 msgid ""
4763 "The initial value of the new thread's CPU-time clock is 0 (see "
4764 "B<pthread_getcpuclockid>(3))."
4765 msgstr ""
4766 "新しいスレッドの CPU 時間時計の初期値は 0 である\n"
4767 "(B<pthread_getcpuclockid>(3) 参照)。"
4768
4769 #. type: SS
4770 #: build/C/man3/pthread_create.3:109
4771 #, no-wrap
4772 msgid "Linux-specific details"
4773 msgstr "Linux 固有の詳細"
4774
4775 #. type: Plain text
4776 #: build/C/man3/pthread_create.3:115
4777 msgid ""
4778 "The new thread inherits copies of the calling thread's capability sets (see "
4779 "B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4780 msgstr ""
4781 "新しいスレッドは、呼び出したスレッドの\n"
4782 "ケーパビリティセット (B<capabilities>(7) 参照) と \n"
4783 "CPU affinity マスク (B<sched_setaffinity>(2) 参照) の\n"
4784 "コピーをを継承しない。"
4785
4786 #. type: Plain text
4787 #: build/C/man3/pthread_create.3:122
4788 msgid ""
4789 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
4790 "number, and the contents of I<*thread> are undefined."
4791 msgstr ""
4792 "成功すると、 B<pthread_create>() は 0 を返す。\n"
4793 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
4794
4795 #. type: TP
4796 #: build/C/man3/pthread_create.3:123 build/C/man3/pthread_sigqueue.3:71
4797 #, no-wrap
4798 msgid "B<EAGAIN>"
4799 msgstr "B<EAGAIN>"
4800
4801 #. type: Plain text
4802 #: build/C/man3/pthread_create.3:137
4803 msgid ""
4804 "Insufficient resources to create another thread, or a system-imposed limit "
4805 "on the number of threads was encountered.  The latter case may occur in two "
4806 "ways: the B<RLIMIT_NPROC> soft resource limit (set via B<setrlimit>(2)), "
4807 "which limits the number of process for a real user ID, was reached; or the "
4808 "kernel's system-wide limit on the number of threads, I</proc/sys/kernel/"
4809 "threads-max>, was reached."
4810 msgstr ""
4811 "別のスレッドを作成するのに十分なリソースがないか、システムで設定された\n"
4812 "スレッド数の上限に達していた。後者が起こるのは 2 つの場合がある。\n"
4813 "一つは、実ユーザ ID 当たりのプロセス数の上限である、B<RLIMIT_NPROC> \n"
4814 "ソフトリソース上限 (B<setrlimit>(2) で設定できる) に達していた場合\n"
4815 "である。もう一つはカーネルのシステム全体のスレッド数の上限である\n"
4816 "I</proc/sys/kernel/threads-max> が達していた場合である。"
4817
4818 #. type: Plain text
4819 #: build/C/man3/pthread_create.3:141
4820 msgid "Invalid settings in I<attr>."
4821 msgstr "I<attr> で指定された設定が不正である。"
4822
4823 #. type: TP
4824 #: build/C/man3/pthread_create.3:141 build/C/man3/pthread_setschedparam.3:129
4825 #: build/C/man3/pthread_setschedprio.3:66
4826 #, no-wrap
4827 msgid "B<EPERM>"
4828 msgstr "B<EPERM>"
4829
4830 #. type: Plain text
4831 #: build/C/man3/pthread_create.3:146
4832 msgid ""
4833 "No permission to set the scheduling policy and parameters specified in "
4834 "I<attr>."
4835 msgstr ""
4836 "I<attr> に指定されたスケジューリングポリシーとパラメータを\n"
4837 "設定する許可がない。"
4838
4839 #. type: Plain text
4840 #: build/C/man3/pthread_create.3:160
4841 msgid ""
4842 "See B<pthread_self>(3)  for further information on the thread ID returned in "
4843 "I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are "
4844 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4845 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4846 msgstr ""
4847 "B<pthread_create>() が I<*thread> で返すスレッド ID についての\n"
4848 "詳しい情報は B<pthread_self>(3) を参照のこと。\n"
4849 "リアルタイムスケジューリングポリシーが使用されない限り、\n"
4850 "B<pthread_create>() の呼び出し後に、\n"
4851 "どのスレッドが\\(em呼び出したスレッドか新しいスレッドか\\(em\n"
4852 "次に実行されるかは決まっていない。"
4853
4854 #. type: Plain text
4855 #: build/C/man3/pthread_create.3:180
4856 msgid ""
4857 "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, "
4858 "then another thread can call B<pthread_join>(3)  to wait for the thread to "
4859 "terminate and fetch its exit status.  Only when a terminated joinable thread "
4860 "has been joined are the last of its resources released back to the system.  "
4861 "When a detached thread terminates, its resources are automatically released "
4862 "back to the system: it is not possible to join with the thread in order to "
4863 "obtain its exit status.  Making a thread detached is useful for some types "
4864 "of daemon threads whose exit status the application does not need to care "
4865 "about.  By default, a new thread is created in a joinable state, unless "
4866 "I<attr> was set to create the thread in a detached state (using "
4867 "B<pthread_attr_setdetachstate>(3))."
4868 msgstr ""
4869 "スレッドは I<join 可能>か I<detached (切り離された状態)> のどちらかに\n"
4870 "することができる。スレッドが join 可能な場合、別のスレッドが\n"
4871 "B<pthread_join>(3) を使って終了したスレッドを待ち、終了ステータスを取得\n"
4872 "することができる。終了した join 可能なスレッドは join された場合にのみ、\n"
4873 "そのスレッドの最後に残ったリソースが解放されシステムに戻される。\n"
4874 "detached 状態のスレッドが終了すると、そのスレッドのリソースは自動的に\n"
4875 "システムに戻される。detached 状態のスレッドを join して、その終了\n"
4876 "ステータスを取得することはできない。スレッドを detached 状態にするのは、\n"
4877 "その終了ステータスをアプリケーションが気にする必要がないある種の\n"
4878 "デーモン (daemon) スレッドでは有用である。\n"
4879 "デフォルトでは、新しいスレッドは join 可能な状態で作成される。\n"
4880 "(B<pthread_attr_setdetachstate>(3) を使って) I<attr> でスレッドが\n"
4881 "detached 状態で作成されるように設定されていない限り、join 可能な状態で\n"
4882 "作成される。"
4883
4884 #.  FIXME . Perhaps some of the following detail should be in
4885 #.  a future pthread_attr_setstacksize(3) page.
4886 #. type: Plain text
4887 #: build/C/man3/pthread_create.3:196
4888 msgid ""
4889 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  "
4890 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
4891 "resource limit I<at the time the program started> has any value other than "
4892 "\"unlimited\", then it determines the default stack size of new threads.  "
4893 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
4894 "explicitly set in the I<attr> argument used to create a thread, in order to "
4895 "obtain a stack size other than the default."
4896 msgstr ""
4897 "Linux/x86-32 では、新しいスレッドのデフォルトのスタックサイズは 2MB で\n"
4898 "ある。NPTL スレッド実装の下では、I<プログラム開始時の> B<RLIMIT_STACK>\n"
4899 "ソフトリソース上限が\"unlimited\" 以外の場合、その値が新しいスレッドのデ\n"
4900 "フォルトのスタックサイズとなる。\n"
4901 "B<pthread_attr_setstacksize>(3) を使って、スレッドを作成する際の\n"
4902 "I<attr> 引き数に明示的にスタックサイズ属性を設定することで、\n"
4903 "デフォルト値以外のスタックサイズを得ることができる。"
4904
4905 #. type: Plain text
4906 #: build/C/man3/pthread_create.3:202
4907 msgid ""
4908 "In the obsolete LinuxThreads implementation, each of the threads in a "
4909 "process has a different process ID.  This is in violation of the POSIX "
4910 "threads specification, and is the source of many other nonconformances to "
4911 "the standard; see B<pthreads>(7)."
4912 msgstr ""
4913 "廃止予定の LinuxThreads 実装では、プロセス内の各スレッドは異なる\n"
4914 "プロセス ID を持つ。これは POSIX スレッドの規格に違反しており、\n"
4915 "他の多くの標準非準拠の点の原因になっている。\n"
4916 "B<pthreads>(7) を参照のこと。"
4917
4918 #. type: Plain text
4919 #: build/C/man3/pthread_create.3:206
4920 msgid ""
4921 "The program below demonstrates the use of B<pthread_create>(), as well as a "
4922 "number of other functions in the pthreads API."
4923 msgstr ""
4924 "以下のプログラムは、 B<pthread_create>() や\n"
4925 "pthreads API の他のいろいろな関数の使用例を示している。"
4926
4927 #. type: Plain text
4928 #: build/C/man3/pthread_create.3:211
4929 msgid ""
4930 "In the following run, on a system providing the NPTL threading "
4931 "implementation, the stack size defaults to the value given by the \"stack "
4932 "size\" resource limit:"
4933 msgstr ""
4934 "以下の実行例は、 NPTL スレッド実装が提供されているシステムでのもので、\n"
4935 "スタックサイズがデフォルト値の \"stack size\" リソース上限で指定される値\n"
4936 "になる。"
4937
4938 #. type: Plain text
4939 #: build/C/man3/pthread_create.3:223
4940 #, no-wrap
4941 msgid ""
4942 "$B< ulimit -s>\n"
4943 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
4944 "$B< ./a.out hola salut servus>\n"
4945 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4946 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4947 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4948 "Joined with thread 1; returned value was HOLA\n"
4949 "Joined with thread 2; returned value was SALUT\n"
4950 "Joined with thread 3; returned value was SERVUS\n"
4951 msgstr ""
4952 "$B< ulimit -s>\n"
4953 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
4954 "$B< ./a.out hola salut servus>\n"
4955 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4956 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4957 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4958 "Joined with thread 1; returned value was HOLA\n"
4959 "Joined with thread 2; returned value was SALUT\n"
4960 "Joined with thread 3; returned value was SERVUS\n"
4961
4962 #. type: Plain text
4963 #: build/C/man3/pthread_create.3:229
4964 msgid ""
4965 "In the next run, the program explicitly sets a stack size of 1MB (using "
4966 "B<pthread_attr_setstacksize>(3))  for the created threads:"
4967 msgstr ""
4968 "次の実行例では、プログラム内で、作成されるスレッドに対して\n"
4969 "(B<pthread_attr_setstacksize>(3) を使って1MB のスタックサイズを\n"
4970 "明示的に設定している。"
4971
4972 #. type: Plain text
4973 #: build/C/man3/pthread_create.3:239
4974 #, no-wrap
4975 msgid ""
4976 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4977 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4978 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4979 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4980 "Joined with thread 1; returned value was HOLA\n"
4981 "Joined with thread 2; returned value was SALUT\n"
4982 "Joined with thread 3; returned value was SERVUS\n"
4983 msgstr ""
4984 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4985 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4986 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4987 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4988 "Joined with thread 1; returned value was HOLA\n"
4989 "Joined with thread 2; returned value was SALUT\n"
4990 "Joined with thread 3; returned value was SERVUS\n"
4991
4992 #. type: Plain text
4993 #: build/C/man3/pthread_create.3:251
4994 #, no-wrap
4995 msgid ""
4996 "#include E<lt>pthread.hE<gt>\n"
4997 "#include E<lt>string.hE<gt>\n"
4998 "#include E<lt>stdio.hE<gt>\n"
4999 "#include E<lt>stdlib.hE<gt>\n"
5000 "#include E<lt>unistd.hE<gt>\n"
5001 "#include E<lt>errno.hE<gt>\n"
5002 "#include E<lt>ctype.hE<gt>\n"
5003 msgstr ""
5004 "#include E<lt>pthread.hE<gt>\n"
5005 "#include E<lt>string.hE<gt>\n"
5006 "#include E<lt>stdio.hE<gt>\n"
5007 "#include E<lt>stdlib.hE<gt>\n"
5008 "#include E<lt>unistd.hE<gt>\n"
5009 "#include E<lt>errno.hE<gt>\n"
5010 "#include E<lt>ctype.hE<gt>\n"
5011
5012 #. type: Plain text
5013 #: build/C/man3/pthread_create.3:257 build/C/man3/pthread_getcpuclockid.3:111
5014 #, no-wrap
5015 msgid ""
5016 "#define handle_error(msg) \\e\n"
5017 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5018 msgstr ""
5019 "#define handle_error(msg) \\e\n"
5020 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5021
5022 #. type: Plain text
5023 #: build/C/man3/pthread_create.3:263
5024 #, no-wrap
5025 msgid ""
5026 "struct thread_info {    /* Used as argument to thread_start() */\n"
5027 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
5028 "    int       thread_num;       /* Application-defined thread # */\n"
5029 "    char     *argv_string;      /* From command-line argument */\n"
5030 "};\n"
5031 msgstr ""
5032 "struct thread_info {    /* Used as argument to thread_start() */\n"
5033 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
5034 "    int       thread_num;       /* Application-defined thread # */\n"
5035 "    char     *argv_string;      /* From command-line argument */\n"
5036 "};\n"
5037
5038 #. type: Plain text
5039 #: build/C/man3/pthread_create.3:266
5040 #, no-wrap
5041 msgid ""
5042 "/* Thread start function: display address near top of our stack,\n"
5043 "   and return upper-cased copy of argv_string */\n"
5044 msgstr ""
5045 "/* Thread start function: display address near top of our stack,\n"
5046 "   and return upper-cased copy of argv_string */\n"
5047
5048 #. type: Plain text
5049 #: build/C/man3/pthread_create.3:272
5050 #, no-wrap
5051 msgid ""
5052 "static void *\n"
5053 "thread_start(void *arg)\n"
5054 "{\n"
5055 "    struct thread_info *tinfo = arg;\n"
5056 "    char *uargv, *p;\n"
5057 msgstr ""
5058 "static void *\n"
5059 "thread_start(void *arg)\n"
5060 "{\n"
5061 "    struct thread_info *tinfo = arg;\n"
5062 "    char *uargv, *p;\n"
5063
5064 #. type: Plain text
5065 #: build/C/man3/pthread_create.3:275
5066 #, no-wrap
5067 msgid ""
5068 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5069 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5070 msgstr ""
5071 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5072 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5073
5074 #. type: Plain text
5075 #: build/C/man3/pthread_create.3:279
5076 #, no-wrap
5077 msgid ""
5078 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5079 "    if (uargv == NULL)\n"
5080 "        handle_error(\"strdup\");\n"
5081 msgstr ""
5082 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5083 "    if (uargv == NULL)\n"
5084 "        handle_error(\"strdup\");\n"
5085
5086 #. type: Plain text
5087 #: build/C/man3/pthread_create.3:282
5088 #, no-wrap
5089 msgid ""
5090 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5091 "        *p = toupper(*p);\n"
5092 msgstr ""
5093 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5094 "        *p = toupper(*p);\n"
5095
5096 #. type: Plain text
5097 #: build/C/man3/pthread_create.3:285
5098 #, no-wrap
5099 msgid ""
5100 "    return uargv;\n"
5101 "}\n"
5102 msgstr ""
5103 "    return uargv;\n"
5104 "}\n"
5105
5106 #. type: Plain text
5107 #: build/C/man3/pthread_create.3:294
5108 #, no-wrap
5109 msgid ""
5110 "int\n"
5111 "main(int argc, char *argv[])\n"
5112 "{\n"
5113 "    int s, tnum, opt, num_threads;\n"
5114 "    struct thread_info *tinfo;\n"
5115 "    pthread_attr_t attr;\n"
5116 "    int stack_size;\n"
5117 "    void *res;\n"
5118 msgstr ""
5119 "int\n"
5120 "main(int argc, char *argv[])\n"
5121 "{\n"
5122 "    int s, tnum, opt, num_threads;\n"
5123 "    struct thread_info *tinfo;\n"
5124 "    pthread_attr_t attr;\n"
5125 "    int stack_size;\n"
5126 "    void *res;\n"
5127
5128 #. type: Plain text
5129 #: build/C/man3/pthread_create.3:296
5130 #, no-wrap
5131 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
5132 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
5133
5134 #. type: Plain text
5135 #: build/C/man3/pthread_create.3:303
5136 #, no-wrap
5137 msgid ""
5138 "    stack_size = -1;\n"
5139 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5140 "        switch (opt) {\n"
5141 "        case \\(aqs\\(aq:\n"
5142 "            stack_size = strtoul(optarg, NULL, 0);\n"
5143 "            break;\n"
5144 msgstr ""
5145 "    stack_size = -1;\n"
5146 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5147 "        switch (opt) {\n"
5148 "        case \\(aqs\\(aq:\n"
5149 "            stack_size = strtoul(optarg, NULL, 0);\n"
5150 "            break;\n"
5151
5152 #. type: Plain text
5153 #: build/C/man3/pthread_create.3:310
5154 #, no-wrap
5155 msgid ""
5156 "        default:\n"
5157 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5158 "                    argv[0]);\n"
5159 "            exit(EXIT_FAILURE);\n"
5160 "        }\n"
5161 "    }\n"
5162 msgstr ""
5163 "        default:\n"
5164 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5165 "                    argv[0]);\n"
5166 "            exit(EXIT_FAILURE);\n"
5167 "        }\n"
5168 "    }\n"
5169
5170 #. type: Plain text
5171 #: build/C/man3/pthread_create.3:312
5172 #, no-wrap
5173 msgid "    num_threads = argc - optind;\n"
5174 msgstr "    num_threads = argc - optind;\n"
5175
5176 #. type: Plain text
5177 #: build/C/man3/pthread_create.3:314
5178 #, no-wrap
5179 msgid "    /* Initialize thread creation attributes */\n"
5180 msgstr "    /* Initialize thread creation attributes */\n"
5181
5182 #. type: Plain text
5183 #: build/C/man3/pthread_create.3:318
5184 #, no-wrap
5185 msgid ""
5186 "    s = pthread_attr_init(&attr);\n"
5187 "    if (s != 0)\n"
5188 "        handle_error_en(s, \"pthread_attr_init\");\n"
5189 msgstr ""
5190 "    s = pthread_attr_init(&attr);\n"
5191 "    if (s != 0)\n"
5192 "        handle_error_en(s, \"pthread_attr_init\");\n"
5193
5194 #. type: Plain text
5195 #: build/C/man3/pthread_create.3:324
5196 #, no-wrap
5197 msgid ""
5198 "    if (stack_size E<gt> 0) {\n"
5199 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5200 "        if (s != 0)\n"
5201 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5202 "    }\n"
5203 msgstr ""
5204 "    if (stack_size E<gt> 0) {\n"
5205 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5206 "        if (s != 0)\n"
5207 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5208 "    }\n"
5209
5210 #. type: Plain text
5211 #: build/C/man3/pthread_create.3:326
5212 #, no-wrap
5213 msgid "    /* Allocate memory for pthread_create() arguments */\n"
5214 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
5215
5216 #. type: Plain text
5217 #: build/C/man3/pthread_create.3:330
5218 #, no-wrap
5219 msgid ""
5220 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5221 "    if (tinfo == NULL)\n"
5222 "        handle_error(\"calloc\");\n"
5223 msgstr ""
5224 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
5225 "    if (tinfo == NULL)\n"
5226 "        handle_error(\"calloc\");\n"
5227
5228 #. type: Plain text
5229 #: build/C/man3/pthread_create.3:332
5230 #, no-wrap
5231 msgid "    /* Create one thread for each command-line argument */\n"
5232 msgstr "    /* Create one thread for each command-line argument */\n"
5233
5234 #. type: Plain text
5235 #: build/C/man3/pthread_create.3:336
5236 #, no-wrap
5237 msgid ""
5238 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5239 "        tinfo[tnum].thread_num = tnum + 1;\n"
5240 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5241 msgstr ""
5242 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5243 "        tinfo[tnum].thread_num = tnum + 1;\n"
5244 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
5245
5246 #. type: Plain text
5247 #: build/C/man3/pthread_create.3:339
5248 #, no-wrap
5249 msgid ""
5250 "        /* The pthread_create() call stores the thread ID into\n"
5251 "           corresponding element of tinfo[] */\n"
5252 msgstr ""
5253 "        /* The pthread_create() call stores the thread ID into\n"
5254 "           corresponding element of tinfo[] */\n"
5255
5256 #. type: Plain text
5257 #: build/C/man3/pthread_create.3:345
5258 #, no-wrap
5259 msgid ""
5260 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5261 "                           &thread_start, &tinfo[tnum]);\n"
5262 "        if (s != 0)\n"
5263 "            handle_error_en(s, \"pthread_create\");\n"
5264 "    }\n"
5265 msgstr ""
5266 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5267 "                           &thread_start, &tinfo[tnum]);\n"
5268 "        if (s != 0)\n"
5269 "            handle_error_en(s, \"pthread_create\");\n"
5270 "    }\n"
5271
5272 #. type: Plain text
5273 #: build/C/man3/pthread_create.3:348
5274 #, no-wrap
5275 msgid ""
5276 "    /* Destroy the thread attributes object, since it is no\n"
5277 "       longer needed */\n"
5278 msgstr ""
5279 "    /* Destroy the thread attributes object, since it is no\n"
5280 "       longer needed */\n"
5281
5282 #. type: Plain text
5283 #: build/C/man3/pthread_create.3:352 build/C/man3/pthread_setschedparam.3:423
5284 #, no-wrap
5285 msgid ""
5286 "    s = pthread_attr_destroy(&attr);\n"
5287 "    if (s != 0)\n"
5288 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5289 msgstr ""
5290 "    s = pthread_attr_destroy(&attr);\n"
5291 "    if (s != 0)\n"
5292 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5293
5294 #. type: Plain text
5295 #: build/C/man3/pthread_create.3:354
5296 #, no-wrap
5297 msgid "    /* Now join with each thread, and display its returned value */\n"
5298 msgstr "    /* Now join with each thread, and display its returned value */\n"
5299
5300 #. type: Plain text
5301 #: build/C/man3/pthread_create.3:359
5302 #, no-wrap
5303 msgid ""
5304 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5305 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5306 "        if (s != 0)\n"
5307 "            handle_error_en(s, \"pthread_join\");\n"
5308 msgstr ""
5309 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5310 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5311 "        if (s != 0)\n"
5312 "            handle_error_en(s, \"pthread_join\");\n"
5313
5314 #. type: Plain text
5315 #: build/C/man3/pthread_create.3:364
5316 #, no-wrap
5317 msgid ""
5318 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5319 "                tinfo[tnum].thread_num, (char *) res);\n"
5320 "        free(res);      /* Free memory allocated by thread */\n"
5321 "    }\n"
5322 msgstr ""
5323 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5324 "                tinfo[tnum].thread_num, (char *) res);\n"
5325 "        free(res);      /* Free memory allocated by thread */\n"
5326 "    }\n"
5327
5328 #. type: Plain text
5329 #: build/C/man3/pthread_create.3:368
5330 #, no-wrap
5331 msgid ""
5332 "    free(tinfo);\n"
5333 "    exit(EXIT_SUCCESS);\n"
5334 "}\n"
5335 msgstr ""
5336 "    free(tinfo);\n"
5337 "    exit(EXIT_SUCCESS);\n"
5338 "}\n"
5339
5340 #. type: Plain text
5341 #: build/C/man3/pthread_create.3:382
5342 msgid ""
5343 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5344 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5345 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
5346 "(7)"
5347 msgstr ""
5348 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5349 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5350 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
5351 "(7)"
5352
5353 #. type: TH
5354 #: build/C/man3/pthread_detach.3:26
5355 #, no-wrap
5356 msgid "PTHREAD_DETACH"
5357 msgstr "PTHREAD_DETACH"
5358
5359 #. type: TH
5360 #: build/C/man3/pthread_detach.3:26 build/C/man3/pthread_join.3:26
5361 #, no-wrap
5362 msgid "2008-11-27"
5363 msgstr "2008-11-27"
5364
5365 #. type: Plain text
5366 #: build/C/man3/pthread_detach.3:29
5367 msgid "pthread_detach - detach a thread"
5368 msgstr "pthread_detach - スレッドを切り離す (detach する)"
5369
5370 #. type: Plain text
5371 #: build/C/man3/pthread_detach.3:34
5372 #, no-wrap
5373 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5374 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5375
5376 #. type: Plain text
5377 #: build/C/man3/pthread_detach.3:46
5378 msgid ""
5379 "The B<pthread_detach>()  function marks the thread identified by I<thread> "
5380 "as detached.  When a detached thread terminates, its resources are "
5381 "automatically released back to the system without the need for another "
5382 "thread to join with the terminated thread."
5383 msgstr ""
5384 "B<pthread_detach>() 関数は I<thread> で識別されるスレッドに\n"
5385 "detached (切り離された状態) という印を付ける。\n"
5386 "detached 状態のスレッドが終了すると、\n"
5387 "別のスレッドが終了されたスレッドを join しなくても、\n"
5388 "そのスレッドのリソースは自動的に解放されてシステムに戻される。"
5389
5390 #. type: Plain text
5391 #: build/C/man3/pthread_detach.3:49
5392 msgid ""
5393 "Attempting to detach an already detached thread results in unspecified "
5394 "behavior."
5395 msgstr ""
5396 "すでに detach 状態のスレッドを detach しようとした場合に\n"
5397 "どのような結果となるかは規定されていない。"
5398
5399 #. type: Plain text
5400 #: build/C/man3/pthread_detach.3:54
5401 msgid ""
5402 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
5403 "number."
5404 msgstr ""
5405 "成功すると、B<pthread_detach>() は 0 を返す。\n"
5406 "エラーの場合、エラー番号を返す。"
5407
5408 #. type: Plain text
5409 #: build/C/man3/pthread_detach.3:59 build/C/man3/pthread_join.3:89
5410 msgid "I<thread> is not a joinable thread."
5411 msgstr "I<thread> が join 可能なスレッドではない。"
5412
5413 #. type: Plain text
5414 #: build/C/man3/pthread_detach.3:70
5415 msgid ""
5416 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
5417 "or be made joinable again."
5418 msgstr ""
5419 "いったんスレッドを detached 状態にすると、\n"
5420 "そのスレッドを B<pthread_join>(3) で join したり、\n"
5421 "もう一度 join 可能にしたりすることはできない。"
5422
5423 #. type: Plain text
5424 #: build/C/man3/pthread_detach.3:77
5425 msgid ""
5426 "A new thread can be created in a detached state using "
5427 "B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the "
5428 "I<attr> argument of B<pthread_create>(3)."
5429 msgstr ""
5430 "B<pthread_attr_setdetachstate>(3) を使って\n"
5431 "B<pthread_create>(3) の I<attr> 引き数の detached 属性を設定することで、\n"
5432 "新しいスレッドを detached 状態で作成することができる。"
5433
5434 #. type: Plain text
5435 #: build/C/man3/pthread_detach.3:84
5436 msgid ""
5437 "The detached attribute merely determines the behavior of the system when the "
5438 "thread terminates; it does not prevent the thread from being terminated if "
5439 "the process terminates using B<exit>(3)  (or equivalently, if the main "
5440 "thread returns)."
5441 msgstr ""
5442 "detached 属性は、スレッドが終了した際のシステムの動作を決めるだけである。\n"
5443 "プロセスが B<exit>(3) を使って終了した場合に、そのスレッドが終了され\n"
5444 "なくなるようなことはない (なお、メインスレッドが return した場合も\n"
5445 "プロセスが B<exit>(3) を使って終了した場合と全く同じである)。 "
5446
5447 #. type: Plain text
5448 #: build/C/man3/pthread_detach.3:93
5449 msgid ""
5450 "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each "
5451 "thread that an application creates, so that system resources for the thread "
5452 "can be released.  (But note that the resources of all threads are freed when "
5453 "the process terminates.)"
5454 msgstr ""
5455 "アプリケーションが作成した各スレッドについて、そのスレッドが使用して\n"
5456 "いるシステムリソースを解放できるように、B<pthread_join>(3) か\n"
5457 "B<pthread_detach>() のどちらかを呼び出すべきである (ただし、プロセスが\n"
5458 "終了するときには、全てのスレッドのリソースが解放される)。"
5459
5460 #. type: Plain text
5461 #: build/C/man3/pthread_detach.3:95
5462 msgid "The following statement detaches the calling thread:"
5463 msgstr "以下の文は、呼び出したスレッド自身を detach する。"
5464
5465 #. type: Plain text
5466 #: build/C/man3/pthread_detach.3:97
5467 #, no-wrap
5468 msgid "    pthread_detach(pthread_self());\n"
5469 msgstr "    pthread_detach(pthread_self());\n"
5470
5471 #. type: Plain text
5472 #: build/C/man3/pthread_detach.3:104
5473 msgid ""
5474 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
5475 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5476 msgstr ""
5477 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
5478 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5479
5480 #. type: TH
5481 #: build/C/man3/pthread_equal.3:26
5482 #, no-wrap
5483 msgid "PTHREAD_EQUAL"
5484 msgstr "PTHREAD_EQUAL"
5485
5486 #. type: TH
5487 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
5488 #, no-wrap
5489 msgid "2009-03-30"
5490 msgstr "2009-03-30"
5491
5492 #. type: Plain text
5493 #: build/C/man3/pthread_equal.3:29
5494 msgid "pthread_equal - compare thread IDs"
5495 msgstr "pthread_equal - スレッド ID を比較する"
5496
5497 #. type: Plain text
5498 #: build/C/man3/pthread_equal.3:34
5499 #, no-wrap
5500 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5501 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5502
5503 #. type: Plain text
5504 #: build/C/man3/pthread_equal.3:41
5505 msgid "The B<pthread_equal>()  function compares two thread identifiers."
5506 msgstr "B<pthread_equal>() 関数は 2 つのスレッド識別子の比較を行う。"
5507
5508 #. type: Plain text
5509 #: build/C/man3/pthread_equal.3:45
5510 msgid ""
5511 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
5512 "value; otherwise, it returns 0."
5513 msgstr ""
5514 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
5515 "そうでなければ 0 を返す。"
5516
5517 #.  SH VERSIONS
5518 #.  Available since glibc 2.0
5519 #. type: Plain text
5520 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
5521 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_testcancel.3:58
5522 msgid "This function always succeeds."
5523 msgstr "この関数は常に成功する。"
5524
5525 #. type: Plain text
5526 #: build/C/man3/pthread_equal.3:56
5527 msgid ""
5528 "The B<pthread_equal>()  function is necessary because thread IDs should be "
5529 "considered opaque: there is no portable way for applications to directly "
5530 "compare two I<pthread_t> values."
5531 msgstr ""
5532 "B<pthread_equal>() 関数が必要なのは、\n"
5533 "スレッド ID はその内部構造を意識すべきではないためである。\n"
5534 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
5535 "移植性を確保できる形で比較する方法はない。"
5536
5537 #. type: Plain text
5538 #: build/C/man3/pthread_equal.3:60
5539 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5540 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5541
5542 #. type: TH
5543 #: build/C/man3/pthread_exit.3:26
5544 #, no-wrap
5545 msgid "PTHREAD_EXIT"
5546 msgstr "PTHREAD_EXIT"
5547
5548 #. type: Plain text
5549 #: build/C/man3/pthread_exit.3:29
5550 msgid "pthread_exit - terminate calling thread"
5551 msgstr "pthread_exit - 呼び出したスレッドを終了する"
5552
5553 #. type: Plain text
5554 #: build/C/man3/pthread_exit.3:34
5555 #, no-wrap
5556 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
5557 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
5558
5559 #. type: Plain text
5560 #: build/C/man3/pthread_exit.3:45
5561 msgid ""
5562 "The B<pthread_exit>()  function terminates the calling thread and returns a "
5563 "value via I<retval> that (if the thread is joinable)  is available to "
5564 "another thread in the same process that calls B<pthread_join>(3)."
5565 msgstr ""
5566 "B<pthread_exit>() 関数は、呼び出したスレッドを終了し、\n"
5567 "I<retval> 経由で値を返す。\n"
5568 "この値は (そのスレッドが join 可能な場合に) B<pthread_join>(3) を\n"
5569 "呼び出した同じプロセス内の別のスレッドが参照できる値と同じである。"
5570
5571 #. type: Plain text
5572 #: build/C/man3/pthread_exit.3:55
5573 msgid ""
5574 "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have "
5575 "not yet been popped, are popped (in the reverse of the order in which they "
5576 "were pushed)  and executed.  If the thread has any thread-specific data, "
5577 "then, after the clean-up handlers have been executed, the corresponding "
5578 "destructor functions are called, in an unspecified order."
5579 msgstr ""
5580 "B<pthread_cleanup_push>(3) で設定されたクリーンアップハンドラのうち、\n"
5581 "まだ pop (取り出されていない) ハンドラを (push されたのと逆の順序で)\n"
5582 "取り出して実行する。そのスレッドがスレッド固有のデータを持っている\n"
5583 "場合は、クリーンアップハンドラが実行された後に、スレッド固有のデータ\n"
5584 "に対応するデストラクタ (destructor) 関数が呼び出される (呼び出し順序\n"
5585 "は規定されていない)。"
5586
5587 #. type: Plain text
5588 #: build/C/man3/pthread_exit.3:62
5589 msgid ""
5590 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
5591 "variables, semaphores, and file descriptors) are not released, and functions "
5592 "registered using B<atexit>(3)  are not called."
5593 msgstr ""
5594 "スレッドが終了する際に、プロセスの共有リソース (例えば、mutex、状態変数\n"
5595 "(condition variables)、セマフォ、ファイルディスクリプタ)が解放される。\n"
5596 "B<atexit>(3) を使って登録された関数は呼び出されない。"
5597
5598 #. type: Plain text
5599 #: build/C/man3/pthread_exit.3:71
5600 msgid ""
5601 "After the last thread in a process terminates, the process terminates as by "
5602 "calling B<exit>(3)  with an exit status of zero; thus, process-shared "
5603 "resources are released and functions registered using B<atexit>(3)  are "
5604 "called."
5605 msgstr ""
5606 "プロセスの最後のスレッドが終了すると、そのプロセスは、終了ステータス 0\n"
5607 "で B<exit>(3) を呼び出した場合と全く同じように終了する。したがって、\n"
5608 "プロセスの共有リソースは解放され、B<atexit>(3) を使って登録された関数\n"
5609 "が呼び出される。"
5610
5611 #. type: Plain text
5612 #: build/C/man3/pthread_exit.3:73
5613 msgid "This function does not return to the caller."
5614 msgstr "この関数は呼び出し側には返らない。"
5615
5616 #. type: Plain text
5617 #: build/C/man3/pthread_exit.3:82
5618 msgid ""
5619 "Performing a return from the start function of any thread other than the "
5620 "main thread results in an implicit call to B<pthread_exit>(), using the "
5621 "function's return value as the thread's exit status."
5622 msgstr ""
5623 "メインスレッド以外のスレッドの開始関数 (start function) がreturn を\n"
5624 "行うと、暗黙のうちに B<pthread_exit>() が呼び出され、\n"
5625 "関数の返り値がスレッドの終了ステータスとして使用される。"
5626
5627 #. type: Plain text
5628 #: build/C/man3/pthread_exit.3:88
5629 msgid ""
5630 "To allow other threads to continue execution, the main thread should "
5631 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
5632 msgstr ""
5633 "他のスレッドが実行を継続できるように、メインスレッドは B<exit>(3) では\n"
5634 "なく B<pthread_exit>() を呼び出して終了すべきである。"
5635
5636 #. type: Plain text
5637 #: build/C/man3/pthread_exit.3:93
5638 msgid ""
5639 "The value pointed to by I<retval> should not be located on the calling "
5640 "thread's stack, since the contents of that stack are undefined after the "
5641 "thread terminates."
5642 msgstr ""
5643 "I<retval> が指す値は、呼び出したスレッドのスタックに置くべきではない。\n"
5644 "呼び出したスレッドが終了した後は、そのスタックの内容が不定となるから\n"
5645 "である。"
5646
5647 #.  Linux 2.6.27
5648 #.  FIXME . review a later kernel to see if this gets fixed
5649 #.  http://thread.gmane.org/gmane.linux.kernel/611611
5650 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
5651 #. type: Plain text
5652 #: build/C/man3/pthread_exit.3:105
5653 msgid ""
5654 "Currently, there are limitations in the kernel implementation logic for "
5655 "B<wait>(2)ing on a stopped thread group with a dead thread group leader.  "
5656 "This can manifest in problems such as a locked terminal if a stop signal is "
5657 "sent to a foreground process whose thread group leader has already called "
5658 "B<pthread_exit>()."
5659 msgstr ""
5660 "現在のところ、停止 (stop) されたスレッドグループを、すでに終了した\n"
5661 "(dead) スレッドグループリーダーで B<wait>(2) する場合の、\n"
5662 "カーネル実装の論理には制限がある。\n"
5663 "この制限は、すでにスレッドグループリーダーが B<pthread_exit>() を\n"
5664 "呼び出しているようなフォアグラウンドプロセスにストップシグナルが送信\n"
5665 "された場合に、端末がロックされてしまう、といった問題として表に見える\n"
5666 "場合がある。"
5667
5668 #. type: Plain text
5669 #: build/C/man3/pthread_exit.3:109
5670 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5671 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5672
5673 #. type: TH
5674 #: build/C/man3/pthread_getattr_np.3:26
5675 #, no-wrap
5676 msgid "PTHREAD_GETATTR_NP"
5677 msgstr "PTHREAD_GETATTR_NP"
5678
5679 #. type: Plain text
5680 #: build/C/man3/pthread_getattr_np.3:29
5681 msgid "pthread_getattr_np - get attributes of created thread"
5682 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
5683
5684 #. type: Plain text
5685 #: build/C/man3/pthread_getattr_np.3:35
5686 #, no-wrap
5687 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5688 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5689
5690 #. type: Plain text
5691 #: build/C/man3/pthread_getattr_np.3:45
5692 msgid ""
5693 "The B<pthread_getattr_np>()  function initializes the thread attributes "
5694 "object referred to by I<attr> so that it contains actual attribute values "
5695 "describing the running thread I<thread>."
5696 msgstr ""
5697 "B<pthread_getattr_np>() 関数は、\n"
5698 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
5699 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
5700 "格納して返す。"
5701
5702 #. type: Plain text
5703 #: build/C/man3/pthread_getattr_np.3:52
5704 msgid ""
5705 "The returned attribute values may differ from the corresponding attribute "
5706 "values passed in the I<attr> object that was used to create the thread using "
5707 "B<pthread_create>(3).  In particular, the following attributes may differ:"
5708 msgstr ""
5709 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
5710 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
5711 "特に、以下の属性は異なる場合がある。"
5712
5713 #. type: Plain text
5714 #: build/C/man3/pthread_getattr_np.3:55
5715 msgid ""
5716 "the detach state, since a joinable thread may have detached itself after "
5717 "creation;"
5718 msgstr ""
5719 "detach state. join 可能なスレッドは作成後に自分自身を\n"
5720 "切り離す (detach する) ことができるからである。"
5721
5722 #. type: Plain text
5723 #: build/C/man3/pthread_getattr_np.3:58
5724 msgid ""
5725 "the stack size, which the implementation may align to a suitable boundary."
5726 msgstr ""
5727 "スタックサイズ。\n"
5728 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
5729
5730 #. type: Plain text
5731 #: build/C/man3/pthread_getattr_np.3:63
5732 msgid ""
5733 "and the guard size, which the implementation may round upward to a multiple "
5734 "of the page size, or ignore (i.e., treat as 0), if the application is "
5735 "allocating its own stack."
5736 msgstr ""
5737 "guard size.\n"
5738 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
5739 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
5740 "(0 として扱われる) ことがあるからである。"
5741
5742 #. type: Plain text
5743 #: build/C/man3/pthread_getattr_np.3:68
5744 msgid ""
5745 "Furthermore, if the stack address attribute was not set in the thread "
5746 "attributes object used to create the thread, then the returned thread "
5747 "attributes object will report the actual stack address that the "
5748 "implementation selected for the thread."
5749 msgstr ""
5750 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
5751 "スタックアドレスが設定されていなかった場合、\n"
5752 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
5753 "割り当てた実際のスタックアドレスが報告される。"
5754
5755 #. type: Plain text
5756 #: build/C/man3/pthread_getattr_np.3:73
5757 msgid ""
5758 "When the thread attributes object returned by B<pthread_getattr_np>()  is no "
5759 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
5760 msgstr ""
5761 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
5762 "必要なくなった際には、  B<pthread_attr_destroy>(3) を使って\n"
5763 "そのオブジェクトを破棄すべきである。"
5764
5765 #. type: Plain text
5766 #: build/C/man3/pthread_getattr_np.3:76
5767 #: build/C/man3/pthread_getcpuclockid.3:49
5768 msgid ""
5769 "On success, this function returns 0; on error, it returns a nonzero error "
5770 "number."
5771 msgstr ""
5772 "成功すると、この関数は 0 を返す。\n"
5773 "エラーの場合、 0 以外のエラー番号を返す。"
5774
5775 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
5776 #. type: Plain text
5777 #: build/C/man3/pthread_getattr_np.3:81
5778 msgid "Insufficient memory."
5779 msgstr "メモリが十分になかった。"
5780
5781 #. type: Plain text
5782 #: build/C/man3/pthread_getattr_np.3:96
5783 msgid ""
5784 "In addition, if I<thread> refers to the main thread, then "
5785 "B<pthread_getattr_np>()  can fail because of errors from various underlying "
5786 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and B<getrlimit>"
5787 "(2), if the B<RLIMIT_STACK> resource limit is not supported."
5788 msgstr ""
5789 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
5790 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
5791 "エラーで失敗する可能性がある。\n"
5792 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
5793 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
5794 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
5795
5796 #. type: Plain text
5797 #: build/C/man3/pthread_getattr_np.3:98
5798 msgid "This function is available in glibc since version 2.2.3."
5799 msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。"
5800
5801 #. type: Plain text
5802 #: build/C/man3/pthread_getattr_np.3:101
5803 #: build/C/man3/pthread_kill_other_threads_np.3:50
5804 msgid ""
5805 "This function is a nonstandard GNU extension; hence the suffix \"_np"
5806 "\" (nonportable) in the name."
5807 msgstr ""
5808 "この関数は非標準の GNU による拡張である。\n"
5809 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
5810 "付いている。"
5811
5812 #. type: Plain text
5813 #: build/C/man3/pthread_getattr_np.3:111
5814 msgid ""
5815 "The program below demonstrates the use of B<pthread_getattr_np>().  The "
5816 "program creates a thread that then uses B<pthread_getattr_np>()  to retrieve "
5817 "and display its guard size, stack address, and stack size attributes.  "
5818 "Command-line arguments can be used to set these attributes to values other "
5819 "than the default when creating the thread.  The shell sessions below "
5820 "demonstrate the use of the program."
5821 msgstr ""
5822 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
5823 "このプログラムは、スレッドを作成し、それから\n"
5824 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
5825 "スタックアドレス、スタックサイズを取得し表示する。\n"
5826 "コマンドライン引き数での指定で、スレッドを作成する際に\n"
5827 "上記の属性にデフォルト値以外の値を設定することができる。\n"
5828 "下記のシェルのセッションはこのプログラムの使用例である。"
5829
5830 #. type: Plain text
5831 #: build/C/man3/pthread_getattr_np.3:114
5832 msgid ""
5833 "In the first run, on an x86-32 system, a thread is created using default "
5834 "attributes:"
5835 msgstr ""
5836 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
5837 "(x86-32 システム上で実行)。"
5838
5839 #. type: Plain text
5840 #: build/C/man3/pthread_getattr_np.3:124
5841 #, no-wrap
5842 msgid ""
5843 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5844 "unlimited\n"
5845 "$B< ./a.out>\n"
5846 "Attributes of created thread:\n"
5847 "        Guard size          = 4096 bytes\n"
5848 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5849 "        Stack size          = 0x201000 (2101248) bytes\n"
5850 msgstr ""
5851 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
5852 "unlimited\n"
5853 "$B< ./a.out>\n"
5854 "Attributes of created thread:\n"
5855 "        Guard size          = 4096 bytes\n"
5856 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5857 "        Stack size          = 0x201000 (2101248) bytes\n"
5858
5859 #. type: Plain text
5860 #: build/C/man3/pthread_getattr_np.3:130
5861 msgid ""
5862 "In the following run, we see that if a guard size is specified, it is "
5863 "rounded up to the next multiple of the system page size (4096 bytes on "
5864 "x86-32):"
5865 msgstr ""
5866 "次の実行例では、guard size が指定された場合、\n"
5867 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
5868 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
5869
5870 #. type: Plain text
5871 #: build/C/man3/pthread_getattr_np.3:138
5872 #, no-wrap
5873 msgid ""
5874 "$B< ./a.out -g 4097>\n"
5875 "Thread attributes object after initializations:\n"
5876 "        Guard size          = 4097 bytes\n"
5877 "        Stack address       = (nil)\n"
5878 "        Stack size          = 0x0 (0) bytes\n"
5879 msgstr ""
5880 "$B< ./a.out -g 4097>\n"
5881 "Thread attributes object after initializations:\n"
5882 "        Guard size          = 4097 bytes\n"
5883 "        Stack address       = (nil)\n"
5884 "        Stack size          = 0x0 (0) bytes\n"
5885
5886 #. type: Plain text
5887 #: build/C/man3/pthread_getattr_np.3:143
5888 #, no-wrap
5889 msgid ""
5890 "Attributes of created thread:\n"
5891 "        Guard size          = 8192 bytes\n"
5892 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5893 "        Stack size          = 0x201000 (2101248) bytes\n"
5894 msgstr ""
5895 "Attributes of created thread:\n"
5896 "        Guard size          = 8192 bytes\n"
5897 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5898 "        Stack size          = 0x201000 (2101248) bytes\n"
5899
5900 #. .in +4n
5901 #. .nf
5902 #. $ ./a.out \-s 0x8000
5903 #. Thread attributes object after initializations:
5904 #.         Guard size          = 4096 bytes
5905 #.         Stack address       = 0xffff8000 (EOS = (nil))
5906 #.         Stack size          = 0x8000 (32768) bytes
5907 #. Attributes of created thread:
5908 #.         Guard size          = 4096 bytes
5909 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
5910 #.         Stack size          = 0x8000 (32768) bytes
5911 #. .fi
5912 #. .in
5913 #. type: Plain text
5914 #: build/C/man3/pthread_getattr_np.3:162
5915 msgid ""
5916 "In the last run, the program manually allocates a stack for the thread.  In "
5917 "this case, the guard size attribute is ignored."
5918 msgstr ""
5919 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
5920 "この場合には、guard size 属性は無視される。"
5921
5922 #. type: Plain text
5923 #: build/C/man3/pthread_getattr_np.3:167
5924 #, no-wrap
5925 msgid ""
5926 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5927 "Allocated thread stack at 0x804d000\n"
5928 msgstr ""
5929 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5930 "Allocated thread stack at 0x804d000\n"
5931
5932 #. type: Plain text
5933 #: build/C/man3/pthread_getattr_np.3:172
5934 #, no-wrap
5935 msgid ""
5936 "Thread attributes object after initializations:\n"
5937 "        Guard size          = 4096 bytes\n"
5938 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5939 "        Stack size          = 0x8000 (32768) bytes\n"
5940 msgstr ""
5941 "Thread attributes object after initializations:\n"
5942 "        Guard size          = 4096 bytes\n"
5943 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5944 "        Stack size          = 0x8000 (32768) bytes\n"
5945
5946 #. type: Plain text
5947 #: build/C/man3/pthread_getattr_np.3:177
5948 #, no-wrap
5949 msgid ""
5950 "Attributes of created thread:\n"
5951 "        Guard size          = 0 bytes\n"
5952 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5953 "        Stack size          = 0x8000 (32768) bytes\n"
5954 msgstr ""
5955 "Attributes of created thread:\n"
5956 "        Guard size          = 0 bytes\n"
5957 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5958 "        Stack size          = 0x8000 (32768) bytes\n"
5959
5960 #. type: Plain text
5961 #: build/C/man3/pthread_getattr_np.3:198
5962 #, no-wrap
5963 msgid ""
5964 "static void\n"
5965 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5966 "{\n"
5967 "    int s;\n"
5968 "    size_t stack_size, guard_size;\n"
5969 "    void *stack_addr;\n"
5970 msgstr ""
5971 "static void\n"
5972 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5973 "{\n"
5974 "    int s;\n"
5975 "    size_t stack_size, guard_size;\n"
5976 "    void *stack_addr;\n"
5977
5978 #. type: Plain text
5979 #: build/C/man3/pthread_getattr_np.3:203
5980 #, no-wrap
5981 msgid ""
5982 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5983 "    if (s != 0)\n"
5984 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5985 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5986 msgstr ""
5987 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5988 "    if (s != 0)\n"
5989 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5990 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5991
5992 #. type: Plain text
5993 #: build/C/man3/pthread_getattr_np.3:214
5994 #, no-wrap
5995 msgid ""
5996 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5997 "    if (s != 0)\n"
5998 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5999 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
6000 "    if (stack_size E<gt> 0)\n"
6001 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6002 "    printf(\"\\en\");\n"
6003 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
6004 "            prefix, stack_size, stack_size);\n"
6005 "}\n"
6006 msgstr ""
6007 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6008 "    if (s != 0)\n"
6009 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
6010 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
6011 "    if (stack_size E<gt> 0)\n"
6012 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6013 "    printf(\"\\en\");\n"
6014 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
6015 "            prefix, stack_size, stack_size);\n"
6016 "}\n"
6017
6018 #. type: Plain text
6019 #: build/C/man3/pthread_getattr_np.3:220
6020 #, no-wrap
6021 msgid ""
6022 "static void\n"
6023 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6024 "{\n"
6025 "    int s;\n"
6026 "    pthread_attr_t attr;\n"
6027 msgstr ""
6028 "static void\n"
6029 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6030 "{\n"
6031 "    int s;\n"
6032 "    pthread_attr_t attr;\n"
6033
6034 #. type: Plain text
6035 #: build/C/man3/pthread_getattr_np.3:224
6036 #, no-wrap
6037 msgid ""
6038 "    s = pthread_getattr_np(thread, &attr);\n"
6039 "    if (s != 0)\n"
6040 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6041 msgstr ""
6042 "    s = pthread_getattr_np(thread, &attr);\n"
6043 "    if (s != 0)\n"
6044 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6045
6046 #. type: Plain text
6047 #: build/C/man3/pthread_getattr_np.3:226
6048 #, no-wrap
6049 msgid "    display_stack_related_attributes(&attr, prefix);\n"
6050 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
6051
6052 #. type: Plain text
6053 #: build/C/man3/pthread_getattr_np.3:231
6054 #, no-wrap
6055 msgid ""
6056 "    s = pthread_attr_destroy(&attr);\n"
6057 "    if (s != 0)\n"
6058 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6059 "}\n"
6060 msgstr ""
6061 "    s = pthread_attr_destroy(&attr);\n"
6062 "    if (s != 0)\n"
6063 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6064 "}\n"
6065
6066 #. type: Plain text
6067 #: build/C/man3/pthread_getattr_np.3:237
6068 #, no-wrap
6069 msgid ""
6070 "static void *           /* Start function for thread we create */\n"
6071 "thread_start(void *arg)\n"
6072 "{\n"
6073 "    printf(\"Attributes of created thread:\\en\");\n"
6074 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6075 msgstr ""
6076 "static void *           /* Start function for thread we create */\n"
6077 "thread_start(void *arg)\n"
6078 "{\n"
6079 "    printf(\"Attributes of created thread:\\en\");\n"
6080 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6081
6082 #. type: Plain text
6083 #: build/C/man3/pthread_getattr_np.3:251
6084 #, no-wrap
6085 msgid ""
6086 "static void\n"
6087 "usage(char *pname, char *msg)\n"
6088 "{\n"
6089 "    if (msg != NULL)\n"
6090 "        fputs(msg, stderr);\n"
6091 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6092 "            \" [-g guard-size]\\en\", pname);\n"
6093 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6094 "    exit(EXIT_FAILURE);\n"
6095 "}\n"
6096 msgstr ""
6097 "static void\n"
6098 "usage(char *pname, char *msg)\n"
6099 "{\n"
6100 "    if (msg != NULL)\n"
6101 "        fputs(msg, stderr);\n"
6102 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6103 "            \" [-g guard-size]\\en\", pname);\n"
6104 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6105 "    exit(EXIT_FAILURE);\n"
6106 "}\n"
6107
6108 #. type: Plain text
6109 #: build/C/man3/pthread_getattr_np.3:264
6110 #, no-wrap
6111 msgid ""
6112 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6113 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6114 "                              pthread_attr_t *attrp)\n"
6115 "{\n"
6116 "    int s, opt, allocate_stack;\n"
6117 "    long stack_size, guard_size;\n"
6118 "            void *stack_addr;\n"
6119 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6120 "                                           a thread attributes object */\n"
6121 "    allocate_stack = 0;\n"
6122 "    stack_size = -1;\n"
6123 "    guard_size = -1;\n"
6124 msgstr ""
6125 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
6126 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6127 "                              pthread_attr_t *attrp)\n"
6128 "{\n"
6129 "    int s, opt, allocate_stack;\n"
6130 "    long stack_size, guard_size;\n"
6131 "            void *stack_addr;\n"
6132 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
6133 "                                           a thread attributes object */\n"
6134 "    allocate_stack = 0;\n"
6135 "    stack_size = -1;\n"
6136 "    guard_size = -1;\n"
6137
6138 #. type: Plain text
6139 #: build/C/man3/pthread_getattr_np.3:273
6140 #, no-wrap
6141 msgid ""
6142 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6143 "        switch (opt) {\n"
6144 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6145 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6146 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6147 "        default:    usage(argv[0], NULL);\n"
6148 "        }\n"
6149 "    }\n"
6150 msgstr ""
6151 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6152 "        switch (opt) {\n"
6153 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
6154 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
6155 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
6156 "        default:    usage(argv[0], NULL);\n"
6157 "        }\n"
6158 "    }\n"
6159
6160 #. type: Plain text
6161 #: build/C/man3/pthread_getattr_np.3:276
6162 #, no-wrap
6163 msgid ""
6164 "    if (allocate_stack && stack_size == -1)\n"
6165 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6166 msgstr ""
6167 "    if (allocate_stack && stack_size == -1)\n"
6168 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6169
6170 #. type: Plain text
6171 #: build/C/man3/pthread_getattr_np.3:279
6172 #, no-wrap
6173 msgid ""
6174 "    if (argc E<gt> optind)\n"
6175 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6176 msgstr ""
6177 "    if (argc E<gt> optind)\n"
6178 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6179
6180 #. type: Plain text
6181 #: build/C/man3/pthread_getattr_np.3:282
6182 #, no-wrap
6183 msgid ""
6184 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6185 "        ret_attrp = attrp;\n"
6186 msgstr ""
6187 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6188 "        ret_attrp = attrp;\n"
6189
6190 #. type: Plain text
6191 #: build/C/man3/pthread_getattr_np.3:287
6192 #, no-wrap
6193 msgid ""
6194 "        s = pthread_attr_init(attrp);\n"
6195 "        if (s != 0)\n"
6196 "            handle_error_en(s, \"pthread_attr_init\");\n"
6197 "    }\n"
6198 msgstr ""
6199 "        s = pthread_attr_init(attrp);\n"
6200 "        if (s != 0)\n"
6201 "            handle_error_en(s, \"pthread_attr_init\");\n"
6202 "    }\n"
6203
6204 #. type: Plain text
6205 #: build/C/man3/pthread_getattr_np.3:299
6206 #, no-wrap
6207 msgid ""
6208 "    if (stack_size E<gt>= 0) {\n"
6209 "        if (!allocate_stack) {\n"
6210 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6211 "            if (s != 0)\n"
6212 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6213 "        } else {\n"
6214 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6215 "                               stack_size);\n"
6216 "            if (s != 0)\n"
6217 "                handle_error_en(s, \"posix_memalign\");\n"
6218 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6219 msgstr ""
6220 "    if (stack_size E<gt>= 0) {\n"
6221 "        if (!allocate_stack) {\n"
6222 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6223 "            if (s != 0)\n"
6224 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6225 "        } else {\n"
6226 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6227 "                               stack_size);\n"
6228 "            if (s != 0)\n"
6229 "                handle_error_en(s, \"posix_memalign\");\n"
6230 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6231
6232 #. type: Plain text
6233 #: build/C/man3/pthread_getattr_np.3:305
6234 #, no-wrap
6235 msgid ""
6236 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6237 "            if (s != 0)\n"
6238 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6239 "        }\n"
6240 "    }\n"
6241 msgstr ""
6242 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6243 "            if (s != 0)\n"
6244 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6245 "        }\n"
6246 "    }\n"
6247
6248 #. type: Plain text
6249 #: build/C/man3/pthread_getattr_np.3:311
6250 #, no-wrap
6251 msgid ""
6252 "    if (guard_size E<gt>= 0) {\n"
6253 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6254 "        if (s != 0)\n"
6255 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6256 "    }\n"
6257 msgstr ""
6258 "    if (guard_size E<gt>= 0) {\n"
6259 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6260 "        if (s != 0)\n"
6261 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6262 "    }\n"
6263
6264 #. type: Plain text
6265 #: build/C/man3/pthread_getattr_np.3:314
6266 #, no-wrap
6267 msgid ""
6268 "    return ret_attrp;\n"
6269 "}\n"
6270 msgstr ""
6271 "    return ret_attrp;\n"
6272 "}\n"
6273
6274 #. type: Plain text
6275 #: build/C/man3/pthread_getattr_np.3:323
6276 #, no-wrap
6277 msgid ""
6278 "int\n"
6279 "main(int argc, char *argv[])\n"
6280 "{\n"
6281 "    int s;\n"
6282 "    pthread_t thr;\n"
6283 "    pthread_attr_t attr;\n"
6284 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6285 "                                        a thread attributes object */\n"
6286 msgstr ""
6287 "int\n"
6288 "main(int argc, char *argv[])\n"
6289 "{\n"
6290 "    int s;\n"
6291 "    pthread_t thr;\n"
6292 "    pthread_attr_t attr;\n"
6293 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
6294 "                                        a thread attributes object */\n"
6295
6296 #. type: Plain text
6297 #: build/C/man3/pthread_getattr_np.3:325
6298 #, no-wrap
6299 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6300 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6301
6302 #. type: Plain text
6303 #: build/C/man3/pthread_getattr_np.3:331
6304 #, no-wrap
6305 msgid ""
6306 "    if (attrp != NULL) {\n"
6307 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6308 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6309 "        printf(\"\\en\");\n"
6310 "    }\n"
6311 msgstr ""
6312 "    if (attrp != NULL) {\n"
6313 "        printf(\"Thread attributes object after initializations:\\en\");\n"
6314 "        display_stack_related_attributes(attrp, \"\\et\");\n"
6315 "        printf(\"\\en\");\n"
6316 "    }\n"
6317
6318 #. type: Plain text
6319 #: build/C/man3/pthread_getattr_np.3:361
6320 msgid ""
6321 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6322 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6323 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6324 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6325 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6326 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6327 msgstr ""
6328 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6329 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6330 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6331 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6332 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6333 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6334
6335 #. type: TH
6336 #: build/C/man3/pthread_getcpuclockid.3:26
6337 #, no-wrap
6338 msgid "PTHREAD_GETCPUCLOCKID"
6339 msgstr "PTHREAD_GETCPUCLOCKID"
6340
6341 #. type: TH
6342 #: build/C/man3/pthread_getcpuclockid.3:26
6343 #, no-wrap
6344 msgid "2009-02-08"
6345 msgstr "2009-02-08"
6346
6347 #. type: Plain text
6348 #: build/C/man3/pthread_getcpuclockid.3:29
6349 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
6350 msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する"
6351
6352 #. type: Plain text
6353 #: build/C/man3/pthread_getcpuclockid.3:33
6354 #, no-wrap
6355 msgid ""
6356 "B<#include E<lt>pthread.hE<gt>>\n"
6357 "B<#include E<lt>time.hE<gt>>\n"
6358 msgstr ""
6359 "B<#include E<lt>pthread.hE<gt>>\n"
6360 "B<#include E<lt>time.hE<gt>>\n"
6361
6362 #. type: Plain text
6363 #: build/C/man3/pthread_getcpuclockid.3:35
6364 #, no-wrap
6365 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
6366 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
6367
6368 #.  The clockid is constructed as follows:
6369 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
6370 #.  where CLOCK_IDFIELD_SIZE is 3.
6371 #. type: Plain text
6372 #: build/C/man3/pthread_getcpuclockid.3:46
6373 msgid ""
6374 "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
6375 "time clock of the thread I<thread>."
6376 msgstr ""
6377 "B<pthread_getcpuclockid>() 関数は、\n"
6378 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
6379
6380 #. type: TP
6381 #: build/C/man3/pthread_getcpuclockid.3:50
6382 #, no-wrap
6383 msgid "B<ENOENT>"
6384 msgstr "B<ENOENT>"
6385
6386 #.  CLOCK_THREAD_CPUTIME_ID not defined
6387 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
6388 #.  be possible if kernel thread IDs took more than 29 bits (which
6389 #.  they currently cannot).
6390 #. type: Plain text
6391 #: build/C/man3/pthread_getcpuclockid.3:58
6392 msgid "Per-thread CPU time clocks are not supported by the system."
6393 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
6394
6395 #. type: Plain text
6396 #: build/C/man3/pthread_getcpuclockid.3:65
6397 msgid "This function is available in glibc since version 2.2."
6398 msgstr "この関数は glibc バージョン 2.2 以降で利用できる。"
6399
6400 #. type: Plain text
6401 #: build/C/man3/pthread_getcpuclockid.3:78
6402 msgid ""
6403 "When I<thread> refers to the calling thread, this function returns an "
6404 "identifier that refers to the same clock manipulated by B<clock_gettime>(2)  "
6405 "and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
6406 msgstr ""
6407 "I<thread> が呼び出したスレッドを参照している場合、\n"
6408 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
6409 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
6410 "を参照する ID が返される。"
6411
6412 #. type: Plain text
6413 #: build/C/man3/pthread_getcpuclockid.3:84
6414 msgid ""
6415 "The program below creates a thread and then uses B<clock_gettime>(2)  to "
6416 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
6417 "the two threads.  The following shell session shows an example run:"
6418 msgstr ""
6419 "以下のプログラムは、スレッドを作成し、それから\n"
6420 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
6421 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
6422 "スレッド毎の CPU 時間を取得する。\n"
6423 "下記のシェルのセッションは実行例である。"
6424
6425 #. type: Plain text
6426 #: build/C/man3/pthread_getcpuclockid.3:94
6427 #, no-wrap
6428 msgid ""
6429 "$ B<./a.out>\n"
6430 "Main thread sleeping\n"
6431 "Subthread starting infinite loop\n"
6432 "Main thread consuming some CPU time...\n"
6433 "Process total CPU time:    1.368\n"
6434 "Main thread CPU time:      0.376\n"
6435 "Subthread CPU time:        0.992\n"
6436 msgstr ""
6437 "$ B<./a.out>\n"
6438 "Main thread sleeping\n"
6439 "Subthread starting infinite loop\n"
6440 "Main thread consuming some CPU time...\n"
6441 "Process total CPU time:    1.368\n"
6442 "Main thread CPU time:      0.376\n"
6443 "Subthread CPU time:        0.992\n"
6444
6445 #. type: Plain text
6446 #: build/C/man3/pthread_getcpuclockid.3:100
6447 #, no-wrap
6448 msgid "/* Link with \"-lrt\" */\n"
6449 msgstr "/* \"-lrt\" でリンクする */\n"
6450
6451 #. type: Plain text
6452 #: build/C/man3/pthread_getcpuclockid.3:108
6453 #, no-wrap
6454 msgid ""
6455 "#include E<lt>time.hE<gt>\n"
6456 "#include E<lt>stdio.hE<gt>\n"
6457 "#include E<lt>stdlib.hE<gt>\n"
6458 "#include E<lt>unistd.hE<gt>\n"
6459 "#include E<lt>pthread.hE<gt>\n"
6460 "#include E<lt>string.hE<gt>\n"
6461 "#include E<lt>errno.hE<gt>\n"
6462 msgstr ""
6463 "#include E<lt>time.hE<gt>\n"
6464 "#include E<lt>stdio.hE<gt>\n"
6465 "#include E<lt>stdlib.hE<gt>\n"
6466 "#include E<lt>unistd.hE<gt>\n"
6467 "#include E<lt>pthread.hE<gt>\n"
6468 "#include E<lt>string.hE<gt>\n"
6469 "#include E<lt>errno.hE<gt>\n"
6470
6471 #. type: Plain text
6472 #: build/C/man3/pthread_getcpuclockid.3:122
6473 #, no-wrap
6474 msgid ""
6475 "static void *\n"
6476 "thread_start(void *arg)\n"
6477 "{\n"
6478 "    printf(\"Subthread starting infinite loop\\en\");\n"
6479 "    for (;;)\n"
6480 "        continue;\n"
6481 "}\n"
6482 msgstr ""
6483 "static void *\n"
6484 "thread_start(void *arg)\n"
6485 "{\n"
6486 "    printf(\"Subthread starting infinite loop\\en\");\n"
6487 "    for (;;)\n"
6488 "        continue;\n"
6489 "}\n"
6490
6491 #. type: Plain text
6492 #: build/C/man3/pthread_getcpuclockid.3:127
6493 #, no-wrap
6494 msgid ""
6495 "static void\n"
6496 "pclock(char *msg, clockid_t cid)\n"
6497 "{\n"
6498 "    struct timespec ts;\n"
6499 msgstr ""
6500 "static void\n"
6501 "pclock(char *msg, clockid_t cid)\n"
6502 "{\n"
6503 "    struct timespec ts;\n"
6504
6505 #. type: Plain text
6506 #: build/C/man3/pthread_getcpuclockid.3:133
6507 #, no-wrap
6508 msgid ""
6509 "    printf(\"%s\", msg);\n"
6510 "    if (clock_gettime(cid, &ts) == -1)\n"
6511 "        handle_error(\"clock_gettime\");\n"
6512 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6513 "}\n"
6514 msgstr ""
6515 "    printf(\"%s\", msg);\n"
6516 "    if (clock_gettime(cid, &ts) == -1)\n"
6517 "        handle_error(\"clock_gettime\");\n"
6518 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6519 "}\n"
6520
6521 #. type: Plain text
6522 #: build/C/man3/pthread_getcpuclockid.3:140
6523 #, no-wrap
6524 msgid ""
6525 "int\n"
6526 "main(int argc, char *argv[])\n"
6527 "{\n"
6528 "    pthread_t thread;\n"
6529 "    clockid_t cid;\n"
6530 "    int j, s;\n"
6531 msgstr ""
6532 "int\n"
6533 "main(int argc, char *argv[])\n"
6534 "{\n"
6535 "    pthread_t thread;\n"
6536 "    clockid_t cid;\n"
6537 "    int j, s;\n"
6538
6539 #. type: Plain text
6540 #: build/C/man3/pthread_getcpuclockid.3:144
6541 #, no-wrap
6542 msgid ""
6543 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6544 "    if (s != 0)\n"
6545 "        handle_error_en(s, \"pthread_create\");\n"
6546 msgstr ""
6547 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6548 "    if (s != 0)\n"
6549 "        handle_error_en(s, \"pthread_create\");\n"
6550
6551 #. type: Plain text
6552 #: build/C/man3/pthread_getcpuclockid.3:147
6553 #, no-wrap
6554 msgid ""
6555 "    printf(\"Main thread sleeping\\en\");\n"
6556 "    sleep(1);\n"
6557 msgstr ""
6558 "    printf(\"Main thread sleeping\\en\");\n"
6559 "    sleep(1);\n"
6560
6561 #. type: Plain text
6562 #: build/C/man3/pthread_getcpuclockid.3:151
6563 #, no-wrap
6564 msgid ""
6565 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6566 "    for (j = 0; j E<lt> 2000000; j++)\n"
6567 "        getppid();\n"
6568 msgstr ""
6569 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
6570 "    for (j = 0; j E<lt> 2000000; j++)\n"
6571 "        getppid();\n"
6572
6573 #. type: Plain text
6574 #: build/C/man3/pthread_getcpuclockid.3:153
6575 #, no-wrap
6576 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6577 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6578
6579 #. type: Plain text
6580 #: build/C/man3/pthread_getcpuclockid.3:158
6581 #, no-wrap
6582 msgid ""
6583 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6584 "    if (s != 0)\n"
6585 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6586 "    pclock(\"Main thread CPU time:   \", cid);\n"
6587 msgstr ""
6588 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6589 "    if (s != 0)\n"
6590 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6591 "    pclock(\"Main thread CPU time:   \", cid);\n"
6592
6593 #. type: Plain text
6594 #: build/C/man3/pthread_getcpuclockid.3:161
6595 #, no-wrap
6596 msgid ""
6597 "    /* The preceding 4 lines of code could have been replaced by:\n"
6598 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6599 msgstr ""
6600 "    /* The preceding 4 lines of code could have been replaced by:\n"
6601 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
6602
6603 #. type: Plain text
6604 #: build/C/man3/pthread_getcpuclockid.3:166
6605 #, no-wrap
6606 msgid ""
6607 "    s = pthread_getcpuclockid(thread, &cid);\n"
6608 "    if (s != 0)\n"
6609 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6610 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6611 msgstr ""
6612 "    s = pthread_getcpuclockid(thread, &cid);\n"
6613 "    if (s != 0)\n"
6614 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
6615 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
6616
6617 #. type: Plain text
6618 #: build/C/man3/pthread_getcpuclockid.3:169
6619 #, no-wrap
6620 msgid ""
6621 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6622 "}\n"
6623 msgstr ""
6624 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
6625 "}\n"
6626
6627 #. type: Plain text
6628 #: build/C/man3/pthread_getcpuclockid.3:178
6629 msgid ""
6630 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6631 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6632 msgstr ""
6633 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6634 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6635
6636 #. type: TH
6637 #: build/C/man3/pthread_join.3:26
6638 #, no-wrap
6639 msgid "PTHREAD_JOIN"
6640 msgstr "PTHREAD_JOIN"
6641
6642 #. type: Plain text
6643 #: build/C/man3/pthread_join.3:29
6644 msgid "pthread_join - join with a terminated thread"
6645 msgstr "pthread_join - 終了したスレッドを join する"
6646
6647 #. type: Plain text
6648 #: build/C/man3/pthread_join.3:34
6649 #, no-wrap
6650 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6651 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6652
6653 #. type: Plain text
6654 #: build/C/man3/pthread_join.3:49
6655 msgid ""
6656 "The B<pthread_join>()  function waits for the thread specified by I<thread> "
6657 "to terminate.  If that thread has already terminated, then B<pthread_join>"
6658 "()  returns immediately.  The thread specified by I<thread> must be joinable."
6659 msgstr ""
6660 "B<pthread_join>() 関数は、I<thread> で指定されたスレッドが\n"
6661 "終了するのを待つ。そのスレッドがすでに終了している場合、\n"
6662 "B<pthread_join>() はすぐに返る。\n"
6663 "I<thread> で指定されたスレッドは join 可能でなければならない。"
6664
6665 #. type: Plain text
6666 #: build/C/man3/pthread_join.3:63
6667 msgid ""
6668 "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of "
6669 "the target thread (i.e., the value that the target thread supplied to "
6670 "B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the "
6671 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
6672 msgstr ""
6673 "I<retval> が NULL でない場合、 B<pthread_join>() は対象スレッドの終了\n"
6674 "ステータス (すなわち、対象スレッドが B<pthread_exit>(3) に渡した値) を\n"
6675 "I<*retval> が指す場所にコピーする。対象スレッドがキャンセルされた場合、\n"
6676 "I<*retval> には B<PTHREAD_CANCELED> が格納される。"
6677
6678 #. type: Plain text
6679 #: build/C/man3/pthread_join.3:70
6680 msgid ""
6681 "If multiple threads simultaneously try to join with the same thread, the "
6682 "results are undefined.  If the thread calling B<pthread_join>()  is "
6683 "canceled, then the target thread will remain joinable (i.e., it will not be "
6684 "detached)."
6685 msgstr ""
6686 "複数のスレッドが同時に同じスレッドを join しようとした場合、その結果\n"
6687 "は不定である。B<pthread_join>() を呼び出しているスレッドがキャンセル\n"
6688 "された場合、対象スレッドは join 可能のままとなる (detached 状態には\n"
6689 "ならない)。"
6690
6691 #. type: Plain text
6692 #: build/C/man3/pthread_join.3:75
6693 msgid ""
6694 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
6695 "number."
6696 msgstr ""
6697 "成功すると、 B<pthread_join>() は 0 を返す。\n"
6698 "エラーの場合、エラー番号を返す。"
6699
6700 #. type: TP
6701 #: build/C/man3/pthread_join.3:76
6702 #, no-wrap
6703 msgid "B<EDEADLK>"
6704 msgstr "B<EDEADLK>"
6705
6706 #.  The following verified by testing on glibc 2.8/NPTL:
6707 #.  The following verified by testing on glibc 2.8/NPTL:
6708 #. type: Plain text
6709 #: build/C/man3/pthread_join.3:85
6710 msgid ""
6711 "A deadlock was detected (e.g., two threads tried to join with each other); "
6712 "or I<thread> specifies the calling thread."
6713 msgstr ""
6714 "デッドロックが検出された (例えば、二つのスレッドが互いに join しようと\n"
6715 "した場合)、または I<thread> に呼び出したスレッドが指定されている。"
6716
6717 #.  POSIX.1-2001 does not specify this error case.
6718 #. type: Plain text
6719 #: build/C/man3/pthread_join.3:93
6720 msgid "Another thread is already waiting to join with this thread."
6721 msgstr "別のスレッドがすでにこのスレッドの join 待ちである。"
6722
6723 #. type: Plain text
6724 #: build/C/man3/pthread_join.3:104
6725 msgid ""
6726 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
6727 "the target thread has terminated."
6728 msgstr ""
6729 "B<pthread_join>() の呼び出しが成功した場合は、\n"
6730 "呼び出し側には、対象スレッドが終了していることが保証される。"
6731
6732 #. type: Plain text
6733 #: build/C/man3/pthread_join.3:107
6734 msgid ""
6735 "Joining with a thread that has previously been joined results in undefined "
6736 "behavior."
6737 msgstr "すでに join されたスレッドを join した場合の結果は不定である。"
6738
6739 #. type: Plain text
6740 #: build/C/man3/pthread_join.3:115
6741 msgid ""
6742 "Failure to join with a thread that is joinable (i.e., one that is not "
6743 "detached), produces a \"zombie thread\".  Avoid doing this, since each "
6744 "zombie thread consumes some system resources, and when enough zombie threads "
6745 "have accumulated, it will no longer be possible to create new threads (or "
6746 "processes)."
6747 msgstr ""
6748 "join 可能なスレッド (detached 状態でないスレッド) の join に失敗した場合、\n"
6749 "\"ゾンビスレッド (zombie thread)\" が生成される。\n"
6750 "各ゾンビスレッドはシステムリソースをいくらかは消費し、\n"
6751 "ゾンビスレッドがたくさん生成されてしまうと、\n"
6752 "新しいスレッド (やプロセス) がそれ以上作成できなくなってしまうので、\n"
6753 "このようなことが起きるのは避けること。"
6754
6755 #. type: Plain text
6756 #: build/C/man3/pthread_join.3:121
6757 msgid ""
6758 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
6759 "\"join with any terminated thread\".  If you believe you need this "
6760 "functionality, you probably need to rethink your application design."
6761 msgstr ""
6762 "pthreads には、 I<waitpid(-1,\\ &status,\\ 0)>、つまり\n"
6763 "\"終了されたスレッドのどれかを join する\" といった機能はない。\n"
6764 "この機能が必要だと思うような場合には、おそらく\n"
6765 "自分のアプリケーションの設計を考え直す必要があるだろう。"
6766
6767 #. type: Plain text
6768 #: build/C/man3/pthread_join.3:124
6769 msgid ""
6770 "All of the threads in a process are peers: any thread can join with any "
6771 "other thread in the process."
6772 msgstr ""
6773 "プロセス内の全てのスレッドは対等であり、\n"
6774 "どのスレッドでもプロセス内の他のスレッドを join できる。"
6775
6776 #. type: Plain text
6777 #: build/C/man3/pthread_join.3:134
6778 msgid ""
6779 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6780 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6781 msgstr ""
6782 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6783 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6784
6785 #. type: TH
6786 #: build/C/man3/pthread_kill.3:26
6787 #, no-wrap
6788 msgid "PTHREAD_KILL"
6789 msgstr "PTHREAD_KILL"
6790
6791 #. type: TH
6792 #: build/C/man3/pthread_kill.3:26 build/C/man3/pthread_sigmask.3:26
6793 #, no-wrap
6794 msgid "2014-02-04"
6795 msgstr "2014-02-04"
6796
6797 #. type: Plain text
6798 #: build/C/man3/pthread_kill.3:29
6799 msgid "pthread_kill - send a signal to a thread"
6800 msgstr "pthread_kill - スレッドにシグナルを送信する"
6801
6802 #. type: Plain text
6803 #: build/C/man3/pthread_kill.3:32 build/C/man3/pthread_sigmask.3:32
6804 #, no-wrap
6805 msgid "B<#include E<lt>signal.hE<gt>>\n"
6806 msgstr "B<#include E<lt>signal.hE<gt>>\n"
6807
6808 #. type: Plain text
6809 #: build/C/man3/pthread_kill.3:34
6810 #, no-wrap
6811 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6812 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6813
6814 #. type: Plain text
6815 #: build/C/man3/pthread_kill.3:45
6816 msgid "B<pthread_kill>():"
6817 msgstr "B<pthread_kill>():"
6818
6819 #. type: Plain text
6820 #: build/C/man3/pthread_kill.3:47 build/C/man3/pthread_sigmask.3:48
6821 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
6822 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
6823
6824 #. type: Plain text
6825 #: build/C/man3/pthread_kill.3:59
6826 msgid ""
6827 "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, a "
6828 "thread in the same process as the caller.  The signal is asynchronously "
6829 "directed to I<thread>."
6830 msgstr ""
6831 "B<pthread_kill>() 関数は、呼び出したスレッドと同じプロセスの\n"
6832 "スレッド I<thread> にシグナル I<sig> を送信する。\n"
6833 "シグナルは非同期に I<thread> へ直接送られる。"
6834
6835 #. type: Plain text
6836 #: build/C/man3/pthread_kill.3:63
6837 msgid ""
6838 "If I<sig> is 0, then no signal is sent, but error checking is still "
6839 "performed."
6840 msgstr ""
6841 "I<sig> が 0 の場合、シグナルは送信されないが、エラーチェックだけは実行され"
6842 "る。"
6843
6844 #. type: Plain text
6845 #: build/C/man3/pthread_kill.3:68
6846 msgid ""
6847 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
6848 "number, and no signal is sent."
6849 msgstr ""
6850 "成功すると、 B<pthread_kill>() は 0 を返す。\n"
6851 "エラーの場合、エラー番号を返し、シグナルの送信は行わない。"
6852
6853 #. type: Plain text
6854 #: build/C/man3/pthread_kill.3:72
6855 msgid "An invalid signal was specified."
6856 msgstr "無効なシグナルが指定された。"
6857
6858 #. type: Plain text
6859 #: build/C/man3/pthread_kill.3:74
6860 msgid "POSIX.1-2008."
6861 msgstr "POSIX.1-2008."
6862
6863 #. type: Plain text
6864 #: build/C/man3/pthread_kill.3:81
6865 msgid ""
6866 "Signal dispositions are process-wide: if a signal handler is installed, the "
6867 "handler will be invoked in the thread I<thread>, but if the disposition of "
6868 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
6869 "affect the whole process."
6870 msgstr ""
6871 "シグナルの配送はプロセス全体で行われる。\n"
6872 "シグナルハンドラが設定されている場合、\n"
6873 "そのハンドラがスレッド I<thread> で起動されるが、\n"
6874 "シグナルの配送が \"stop\", \"continue\", \"terminate\" のいずれかの場合、\n"
6875 "シグナルに対するアクションはプロセス全体に影響がある。"
6876
6877 #. type: Plain text
6878 #: build/C/man3/pthread_kill.3:94
6879 msgid ""
6880 "POSIX.1-2008 recommends that if an implementation detects the use of a "
6881 "thread ID after the end of its lifetime, B<pthread_kill>()  should return "
6882 "the error B<ESRCH>.  The glibc implementation returns this error in the "
6883 "cases where an invalid thread ID can be detected.  But note also that POSIX "
6884 "says that an attempt to use a thread ID whose lifetime has ended produces "
6885 "undefined behavior, and an attempt to use an invalid thread ID in a call to "
6886 "B<pthread_kill>()  can, for example, cause a segmentation fault."
6887 msgstr "POSIX.1-2008 では、 スレッドが終了した後にそのスレッド ID が使用されたことを検出した場合に、 B<pthread_kill>() はエラー B<ESRCH> を返すことを推奨されている。 glibc の実装では、無効なスレッド ID を検出できる場合にはこのエラーを返す。 しかし、 POSIX では、 終了したスレッド ID を使おうとした場合の動作は不定であり、 B<pthread_kill>() で無効なスレッド ID を使おうとした場合には、 例えば、 セグメンテーションフォールトになる可能性もある点に注意すること。"
6888
6889 #. type: Plain text
6890 #: build/C/man3/pthread_kill.3:103
6891 msgid ""
6892 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
6893 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
6894 msgstr ""
6895 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
6896 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
6897
6898 #. type: TH
6899 #: build/C/man3/pthread_kill_other_threads_np.3:26
6900 #, no-wrap
6901 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
6902 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
6903
6904 #. type: TH
6905 #: build/C/man3/pthread_kill_other_threads_np.3:26
6906 #, no-wrap
6907 msgid "2010-09-09"
6908 msgstr "2010-09-09"
6909
6910 #. type: Plain text
6911 #: build/C/man3/pthread_kill_other_threads_np.3:29
6912 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
6913 msgstr "pthread_kill_other_threads_np - プロセス内の他の全スレッドを終了する"
6914
6915 #. type: Plain text
6916 #: build/C/man3/pthread_kill_other_threads_np.3:34
6917 #, no-wrap
6918 msgid "B<void pthread_kill_other_threads_np(void);>\n"
6919 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
6920
6921 #.  .SH VERSIONS
6922 #.  Available since glibc 2.0
6923 #. type: Plain text
6924 #: build/C/man3/pthread_kill_other_threads_np.3:47
6925 msgid ""
6926 "B<pthread_kill_other_threads_np>()  has an effect only in the LinuxThreads "
6927 "threading implementation.  On that implementation, calling this function "
6928 "causes the immediate termination of all threads in the application, except "
6929 "the calling thread.  The cancellation state and cancellation type of the to-"
6930 "be-terminated threads are ignored, and the cleanup handlers are not called "
6931 "in those threads."
6932 msgstr ""
6933 "B<pthread_kill_other_threads_np>() は、\n"
6934 "LinuxThreads スレッド実装においてのみ効果がある。\n"
6935 "LinuxThreads スレッド実装では、この関数を呼び出すと\n"
6936 "アプリケーション内の全てのスレッドがすぐに終了される。\n"
6937 "終了対象のスレッドの cancelability state と cancelability type は\n"
6938 "無視され、それらのスレッドのクリーンアップハンドラは呼び出されない。"
6939
6940 #. type: Plain text
6941 #: build/C/man3/pthread_kill_other_threads_np.3:59
6942 msgid ""
6943 "B<pthread_kill_other_threads_np>()  is intended to be called just before a "
6944 "thread calls B<execve>(2)  or a similar function.  This function is designed "
6945 "to address a limitation in the obsolete LinuxThreads implementation whereby "
6946 "the other threads of an application are not automatically terminated (as "
6947 "POSIX.1-2001 requires) during B<execve>(2)."
6948 msgstr ""
6949 "B<pthread_kill_other_threads_np>() は、\n"
6950 "スレッドが B<execve>(2) や同様の関数を呼び出す直前に\n"
6951 "呼ばれることを目的として用意されている。\n"
6952 "この関数は、(廃止予定の) LinuxThreads スレッド実装における、\n"
6953 "B<execve>(2) の際にアプリケーションの他のスレッドが自動的に\n"
6954 "終了されないという制限を解決するために設計された。"
6955
6956 #. type: Plain text
6957 #: build/C/man3/pthread_kill_other_threads_np.3:66
6958 msgid ""
6959 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  "
6960 "exists, but does nothing.  (Nothing needs to be done, because the "
6961 "implementation does the right thing during an B<execve>(2).)"
6962 msgstr ""
6963 "NPTL スレッド実装では、 B<pthread_kill_other_threads_np>() は存在するが、\n"
6964 "何もしない(NPTL 実装は B<execve>(2) の際に適切な動作をするので、\n"
6965 "何もする必要がないということだ)。"
6966
6967 #. type: Plain text
6968 #: build/C/man3/pthread_kill_other_threads_np.3:72
6969 msgid ""
6970 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
6971 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
6972 msgstr ""
6973 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
6974 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
6975
6976 #. type: TH
6977 #: build/C/man3/pthread_self.3:26
6978 #, no-wrap
6979 msgid "PTHREAD_SELF"
6980 msgstr "PTHREAD_SELF"
6981
6982 #. type: Plain text
6983 #: build/C/man3/pthread_self.3:29
6984 msgid "pthread_self - obtain ID of the calling thread"
6985 msgstr "pthread_self - 呼び出したスレッドの ID を取得する"
6986
6987 #. type: Plain text
6988 #: build/C/man3/pthread_self.3:34
6989 #, no-wrap
6990 msgid "B<pthread_t pthread_self(void);>\n"
6991 msgstr "B<pthread_t pthread_self(void);>\n"
6992
6993 #. type: Plain text
6994 #: build/C/man3/pthread_self.3:46
6995 msgid ""
6996 "The B<pthread_self>()  function returns the ID of the calling thread.  This "
6997 "is the same value that is returned in I<*thread> in the B<pthread_create>"
6998 "(3)  call that created this thread."
6999 msgstr ""
7000 "B<pthread_self>() 関数は、呼び出したスレッドの ID を返す。\n"
7001 "得られる ID は、このスレッドが作成された B<pthread_create>(3) の\n"
7002 "呼び出しで I<*thread> で返されるのと同じ値である。"
7003
7004 #. type: Plain text
7005 #: build/C/man3/pthread_self.3:48
7006 msgid "This function always succeeds, returning the calling thread's ID."
7007 msgstr "この関数は常に成功し、呼び出したスレッドの ID を返す。"
7008
7009 #. type: Plain text
7010 #: build/C/man3/pthread_self.3:63
7011 msgid ""
7012 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
7013 "represent a thread ID; for example, representation using either an "
7014 "arithmetic type or a structure is permitted.  Therefore, variables of type "
7015 "I<pthread_t> can't portably be compared using the C equality operator "
7016 "(B<==>); use B<pthread_equal>(3)  instead."
7017 msgstr ""
7018 "POSIX.1 では、スレッド ID を表現するのに使用する型は、\n"
7019 "スレッド実装が完全に自由に選択してよいことになっている。\n"
7020 "例えば、スレッド ID を表現するのに数値型を使っても構造体を使ってもよい。\n"
7021 "そのため、移植性を確保しつつ、 C 言語の等価演算子 (B<==>) を使って、\n"
7022 "I<pthread_t> 型の変数の比較を行うことはできない。\n"
7023 "代わりに B<pthread_equal>(3) を使うこと。"
7024
7025 #. type: Plain text
7026 #: build/C/man3/pthread_self.3:67
7027 msgid ""
7028 "Thread identifiers should be considered opaque: any attempt to use a thread "
7029 "ID other than in pthreads calls is nonportable and can lead to unspecified "
7030 "results."
7031 msgstr ""
7032 "スレッド識別子はその内部構造を意識すべきではない。\n"
7033 "pthreads 関数以外でスレッド ID を利用しようとした場合、\n"
7034 "移植性がなくなり、どのような結果が得られるかも分からない。"
7035
7036 #. type: Plain text
7037 #: build/C/man3/pthread_self.3:71
7038 msgid ""
7039 "Thread IDs are guaranteed to be unique only within a process.  A thread ID "
7040 "may be reused after a terminated thread has been joined, or a detached "
7041 "thread has terminated."
7042 msgstr ""
7043 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
7044 "終了したスレッドが join されたり、\n"
7045 "切り離された (detached) スレッドが終了されたりした後は、\n"
7046 "そのスレッド ID は再利用されることがある。"
7047
7048 #. type: Plain text
7049 #: build/C/man3/pthread_self.3:76
7050 msgid ""
7051 "The thread ID returned by B<pthread_self>()  is not the same thing as the "
7052 "kernel thread ID returned by a call to B<gettid>(2)."
7053 msgstr ""
7054 "B<pthread_self>() が返すスレッド ID は、\n"
7055 "B<gettid>(2) が返すカーネルスレッド ID とは違うものである。"
7056
7057 #. type: Plain text
7058 #: build/C/man3/pthread_self.3:80
7059 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7060 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7061
7062 #. type: TH
7063 #: build/C/man3/pthread_setaffinity_np.3:26
7064 #, no-wrap
7065 msgid "PTHREAD_SETAFFINITY_NP"
7066 msgstr "PTHREAD_SETAFFINITY_NP"
7067
7068 #. type: Plain text
7069 #: build/C/man3/pthread_setaffinity_np.3:30
7070 msgid ""
7071 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
7072 "thread"
7073 msgstr ""
7074 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
7075 "CPU affinity の設定/取得を行う"
7076
7077 #. type: Plain text
7078 #: build/C/man3/pthread_setaffinity_np.3:39
7079 #, no-wrap
7080 msgid ""
7081 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7082 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
7083 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7084 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
7085 msgstr ""
7086 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7087 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
7088 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7089 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
7090
7091 #. type: Plain text
7092 #: build/C/man3/pthread_setaffinity_np.3:54
7093 msgid ""
7094 "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the "
7095 "thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is "
7096 "successful, and the thread is not currently running on one of the CPUs in "
7097 "I<cpuset>, then it is migrated to one of those CPUs."
7098 msgstr ""
7099 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7100 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
7101 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
7102 "場合は、スレッドは指定された CPU のいずれかに移動される。"
7103
7104 #. type: Plain text
7105 #: build/C/man3/pthread_setaffinity_np.3:61
7106 msgid ""
7107 "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of "
7108 "the thread I<thread> in the buffer pointed to by I<cpuset>."
7109 msgstr ""
7110 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7111 "マスクを、I<cpuset> が指すバッファに入れて返す。"
7112
7113 #. type: Plain text
7114 #: build/C/man3/pthread_setaffinity_np.3:77
7115 msgid ""
7116 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
7117 "by I<cpuset>.  Typically, this argument would be specified as I<sizeof"
7118 "(cpu_set_t)>.  (It may be some other value, if using the macros described in "
7119 "B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
7120 msgstr ""
7121 "引き数 I<cpusetsize> は I<cpuset> が指すバッファの長さ (バイト単位) で\n"
7122 "ある。通常は、この引き数には I<sizeof(cpu_set_t)> を指定する\n"
7123 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
7124 "割り当てている場合には、別の値になることもある)。"
7125
7126 #. type: TP
7127 #: build/C/man3/pthread_setaffinity_np.3:81
7128 #, no-wrap
7129 msgid "B<EFAULT>"
7130 msgstr "B<EFAULT>"
7131
7132 #. type: Plain text
7133 #: build/C/man3/pthread_setaffinity_np.3:84
7134 msgid "A supplied memory address was invalid."
7135 msgstr "指定されたメモリアドレスが無効である。"
7136
7137 #. type: Plain text
7138 #: build/C/man3/pthread_setaffinity_np.3:93
7139 msgid ""
7140 "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no "
7141 "processors that are currently physically on the system and permitted to the "
7142 "thread according to any restrictions that may be imposed by the \"cpuset\" "
7143 "mechanism described in B<cpuset>(7)."
7144 msgstr ""
7145 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
7146 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
7147 "されているプロセッサが一つも含まれていない。\n"
7148 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
7149 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
7150
7151 #.  FIXME . ?
7152 #.  Loic Domaigne commented: it seems that in the future the
7153 #.  kernel developers want to make cpumask_t dynamic, so
7154 #.  CONFIG_NR_CPUS might become obsolete in the future.
7155 #.  cpumask_t
7156 #.  The raw sched_getaffinity() system call returns the size (in bytes)
7157 #.  of the cpumask_t type.
7158 #. type: Plain text
7159 #: build/C/man3/pthread_setaffinity_np.3:109
7160 msgid ""
7161 "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside "
7162 "the set supported by the kernel.  (The kernel configuration option "
7163 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
7164 "type used to represent CPU sets.)"
7165 msgstr ""
7166 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
7167 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
7168 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
7169 "データ型がサポートする CPU 集合の範囲が定義される。)"
7170
7171 #. type: Plain text
7172 #: build/C/man3/pthread_setaffinity_np.3:114
7173 msgid ""
7174 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
7175 "affinity mask used by the kernel."
7176 msgstr ""
7177 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
7178 "affinity マスクの大きさよりも小さい。"
7179
7180 #. type: Plain text
7181 #: build/C/man3/pthread_setaffinity_np.3:137
7182 msgid ""
7183 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
7184 "thread will actually run is the intersection of the set specified in the "
7185 "I<cpuset> argument and the set of CPUs actually present on the system.  The "
7186 "system may further restrict the set of CPUs on which the thread runs if the "
7187 "\"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These "
7188 "restrictions on the actual set of CPUs on which the thread will run are "
7189 "silently imposed by the kernel."
7190 msgstr ""
7191 "B<pthread_setaffinity_np>() を呼び出した後、\n"
7192 "そのスレッドが実際に実行される CPU 集合は、\n"
7193 "I<cpuset> 引き数で指定された集合と\n"
7194 "システムに実際に存在する CPU 集合の共通部分になる。\n"
7195 "また、 B<cpuset>(7) で説明されている \"cpuset\" 機構が使われている場合\n"
7196 "には、そのスレッドが実行される CPU 集合がシステムによってさらに制限\n"
7197 "される場合がある。そのスレッドが実行される実際の CPU 集合に対する\n"
7198 "これらの制限は、カーネルにより黙って適用される。"
7199
7200 #. type: Plain text
7201 #: build/C/man3/pthread_setaffinity_np.3:143
7202 msgid ""
7203 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
7204 "B<sched_getaffinity>(2)  system calls."
7205 msgstr ""
7206 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
7207 "B<sched_getaffinity>(2) を使って実装されている。"
7208
7209 #. type: Plain text
7210 #: build/C/man3/pthread_setaffinity_np.3:154
7211 msgid ""
7212 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
7213 "creator's CPU affinity mask."
7214 msgstr ""
7215 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
7216 "作成者の CPU affinity マスクを継承する。"
7217
7218 #. type: Plain text
7219 #: build/C/man3/pthread_setaffinity_np.3:162
7220 msgid ""
7221 "In the following program, the main thread uses B<pthread_setaffinity_np>()  "
7222 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
7223 "available on the system), and then calls B<pthread_getaffinity_np>()  to "
7224 "check the resulting CPU affinity mask of the thread."
7225 msgstr ""
7226 "以下のプログラムでは、メインスレッドは\n"
7227 "B<pthread_setaffinity_np>() を使って自分の CPU affinity マスクに\n"
7228 "CPU 0 から 7 が含まれるように設定し\n"
7229 "(システム上には 0 から 7 に対応する CPU が全て存在するとは限らない)、\n"
7230 "その後で B<pthread_getaffinity_np>() を使って\n"
7231 "スレッドに実際に設定された CPU affinity マスクを確認している。"
7232
7233 #. type: Plain text
7234 #: build/C/man3/pthread_setaffinity_np.3:169
7235 #, no-wrap
7236 msgid ""
7237 "#define _GNU_SOURCE\n"
7238 "#include E<lt>pthread.hE<gt>\n"
7239 "#include E<lt>stdio.hE<gt>\n"
7240 "#include E<lt>stdlib.hE<gt>\n"
7241 "#include E<lt>errno.hE<gt>\n"
7242 msgstr ""
7243 "#define _GNU_SOURCE\n"
7244 "#include E<lt>pthread.hE<gt>\n"
7245 "#include E<lt>stdio.hE<gt>\n"
7246 "#include E<lt>stdlib.hE<gt>\n"
7247 "#include E<lt>errno.hE<gt>\n"
7248
7249 #. type: Plain text
7250 #: build/C/man3/pthread_setaffinity_np.3:179
7251 #, no-wrap
7252 msgid ""
7253 "int\n"
7254 "main(int argc, char *argv[])\n"
7255 "{\n"
7256 "    int s, j;\n"
7257 "    cpu_set_t cpuset;\n"
7258 "    pthread_t thread;\n"
7259 msgstr ""
7260 "int\n"
7261 "main(int argc, char *argv[])\n"
7262 "{\n"
7263 "    int s, j;\n"
7264 "    cpu_set_t cpuset;\n"
7265 "    pthread_t thread;\n"
7266
7267 #. type: Plain text
7268 #: build/C/man3/pthread_setaffinity_np.3:181
7269 #, no-wrap
7270 msgid "    thread = pthread_self();\n"
7271 msgstr "    thread = pthread_self();\n"
7272
7273 #. type: Plain text
7274 #: build/C/man3/pthread_setaffinity_np.3:183
7275 #, no-wrap
7276 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7277 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
7278
7279 #. type: Plain text
7280 #: build/C/man3/pthread_setaffinity_np.3:187
7281 #, no-wrap
7282 msgid ""
7283 "    CPU_ZERO(&cpuset);\n"
7284 "    for (j = 0; j E<lt> 8; j++)\n"
7285 "        CPU_SET(j, &cpuset);\n"
7286 msgstr ""
7287 "    CPU_ZERO(&cpuset);\n"
7288 "    for (j = 0; j E<lt> 8; j++)\n"
7289 "        CPU_SET(j, &cpuset);\n"
7290
7291 #. type: Plain text
7292 #: build/C/man3/pthread_setaffinity_np.3:191
7293 #, no-wrap
7294 msgid ""
7295 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7296 "    if (s != 0)\n"
7297 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7298 msgstr ""
7299 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7300 "    if (s != 0)\n"
7301 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
7302
7303 #. type: Plain text
7304 #: build/C/man3/pthread_setaffinity_np.3:193
7305 #, no-wrap
7306 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
7307 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
7308
7309 #. type: Plain text
7310 #: build/C/man3/pthread_setaffinity_np.3:197
7311 #, no-wrap
7312 msgid ""
7313 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7314 "    if (s != 0)\n"
7315 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7316 msgstr ""
7317 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
7318 "    if (s != 0)\n"
7319 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
7320
7321 #. type: Plain text
7322 #: build/C/man3/pthread_setaffinity_np.3:202
7323 #, no-wrap
7324 msgid ""
7325 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7326 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7327 "        if (CPU_ISSET(j, &cpuset))\n"
7328 "            printf(\"    CPU %d\\en\", j);\n"
7329 msgstr ""
7330 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
7331 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
7332 "        if (CPU_ISSET(j, &cpuset))\n"
7333 "            printf(\"    CPU %d\\en\", j);\n"
7334
7335 #. type: Plain text
7336 #: build/C/man3/pthread_setaffinity_np.3:205
7337 #: build/C/man3/pthread_setschedparam.3:430
7338 #, no-wrap
7339 msgid ""
7340 "    exit(EXIT_SUCCESS);\n"
7341 "}\n"
7342 msgstr ""
7343 "    exit(EXIT_SUCCESS);\n"
7344 "}\n"
7345
7346 #. type: Plain text
7347 #: build/C/man3/pthread_setaffinity_np.3:214
7348 msgid ""
7349 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
7350 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
7351 "B<cpuset>(7), B<pthreads>(7)"
7352 msgstr ""
7353 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
7354 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
7355 "B<cpuset>(7), B<pthreads>(7)"
7356
7357 #. type: TH
7358 #: build/C/man3/pthread_setcancelstate.3:26
7359 #, no-wrap
7360 msgid "PTHREAD_SETCANCELSTATE"
7361 msgstr "PTHREAD_SETCANCELSTATE"
7362
7363 #. type: Plain text
7364 #: build/C/man3/pthread_setcancelstate.3:30
7365 msgid ""
7366 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
7367 "type"
7368 msgstr ""
7369 "pthread_setcancelstate, pthread_setcanceltype - cancelability state と "
7370 "cancelability type を設定する"
7371
7372 #. type: Plain text
7373 #: build/C/man3/pthread_setcancelstate.3:36
7374 #, no-wrap
7375 msgid ""
7376 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7377 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7378 msgstr ""
7379 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
7380 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
7381
7382 #. type: Plain text
7383 #: build/C/man3/pthread_setcancelstate.3:51
7384 msgid ""
7385 "The B<pthread_setcancelstate>()  sets the cancelability state of the calling "
7386 "thread to the value given in I<state>.  The previous cancelability state of "
7387 "the thread is returned in the buffer pointed to by I<oldstate>.  The "
7388 "I<state> argument must have one of the following values:"
7389 msgstr ""
7390 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
7391 "cancelability state に I<state> で指定された\n"
7392 "値を設定する。変更前のスレッドの cancelability state は\n"
7393 "I<oldstate> が指すバッファで返される。\n"
7394 "I<state> 引き数には以下の値のいずれか一つを指定しなければならない。"
7395
7396 #. type: TP
7397 #: build/C/man3/pthread_setcancelstate.3:51
7398 #, no-wrap
7399 msgid "B<PTHREAD_CANCEL_ENABLE>"
7400 msgstr "B<PTHREAD_CANCEL_ENABLE>"
7401
7402 #. type: Plain text
7403 #: build/C/man3/pthread_setcancelstate.3:58
7404 msgid ""
7405 "The thread is cancelable.  This is the default cancelability state in all "
7406 "new threads, including the initial thread.  The thread's cancelability type "
7407 "determines when a cancelable thread will respond to a cancellation request."
7408 msgstr ""
7409 "スレッドは取り消し可能 (cancelable) である。\n"
7410 "これが全ての新しく作成されるスレッドでのデフォルトの\n"
7411 "cancelability state である。これには最初のスレッドも含まれる。\n"
7412 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
7413 "取り消し要求にいつ反応するかが決まる。"
7414
7415 #. type: TP
7416 #: build/C/man3/pthread_setcancelstate.3:58
7417 #, no-wrap
7418 msgid "B<PTHREAD_CANCEL_DISABLE>"
7419 msgstr "B<PTHREAD_CANCEL_DISABLE>"
7420
7421 #. type: Plain text
7422 #: build/C/man3/pthread_setcancelstate.3:63
7423 msgid ""
7424 "The thread is not cancelable.  If a cancellation request is received, it is "
7425 "blocked until cancelability is enabled."
7426 msgstr ""
7427 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
7428 "取り消し可能に設定されるまでその要求はブロックされる。"
7429
7430 #. type: Plain text
7431 #: build/C/man3/pthread_setcancelstate.3:75
7432 msgid ""
7433 "The B<pthread_setcanceltype>()  sets the cancelability type of the calling "
7434 "thread to the value given in I<type>.  The previous cancelability type of "
7435 "the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> "
7436 "argument must have one of the following values:"
7437 msgstr ""
7438 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
7439 "cancelability type に I<type> で指定された値を設定する。\n"
7440 "変更前のスレッドの cancelability type は\n"
7441 "I<oldtype> が指すバッファで返される。\n"
7442 "I<type> 引き数には以下の値のいずれか一つを指定しなければならない。"
7443
7444 #. type: TP
7445 #: build/C/man3/pthread_setcancelstate.3:75
7446 #, no-wrap
7447 msgid "B<PTHREAD_CANCEL_DEFERRED>"
7448 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
7449
7450 #. type: Plain text
7451 #: build/C/man3/pthread_setcancelstate.3:82
7452 msgid ""
7453 "A cancellation request is deferred until the thread next calls a function "
7454 "that is a cancellation point (see B<pthreads>(7)).  This is the default "
7455 "cancelability type in all new threads, including the initial thread."
7456 msgstr ""
7457 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
7458 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
7459 "スレッドでのデフォルトの cancelability type である。\n"
7460 "これには最初のスレッドも含まれる。"
7461
7462 #. type: TP
7463 #: build/C/man3/pthread_setcancelstate.3:82
7464 #, no-wrap
7465 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7466 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
7467
7468 #. type: Plain text
7469 #: build/C/man3/pthread_setcancelstate.3:88
7470 msgid ""
7471 "The thread can be canceled at any time.  (Typically, it will be canceled "
7472 "immediately upon receiving a cancellation request, but the system doesn't "
7473 "guarantee this.)"
7474 msgstr ""
7475 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
7476 "システムがそのことを保証しているわけではない)。"
7477
7478 #. type: Plain text
7479 #: build/C/man3/pthread_setcancelstate.3:92
7480 msgid ""
7481 "The set-and-get operation performed by each of these functions is atomic "
7482 "with respect to other threads in the process calling the same function."
7483 msgstr ""
7484 "これらの関数により実行される「設定と取得」操作 (set-and-get operation) は、\n"
7485 "同じ関数を呼び出したプロセス内の他のスレッドがあっても、\n"
7486 "アトミックに行われる。"
7487
7488 #. type: Plain text
7489 #: build/C/man3/pthread_setcancelstate.3:99
7490 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
7491 msgstr "B<pthread_setcancelstate>() は以下のエラーで失敗する場合がある。"
7492
7493 #. type: Plain text
7494 #: build/C/man3/pthread_setcancelstate.3:103
7495 msgid "Invalid value for I<state>."
7496 msgstr "I<state> に無効な値が指定された。"
7497
7498 #. type: Plain text
7499 #: build/C/man3/pthread_setcancelstate.3:107
7500 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
7501 msgstr "B<pthread_setcanceltype>() は以下のエラーで失敗する場合がある。"
7502
7503 #.  .SH VERSIONS
7504 #.  Available since glibc 2.0
7505 #. type: Plain text
7506 #: build/C/man3/pthread_setcancelstate.3:113
7507 msgid "Invalid value for I<type>."
7508 msgstr "I<type> に無効な値が指定された。"
7509
7510 #. type: Plain text
7511 #: build/C/man3/pthread_setcancelstate.3:118
7512 msgid ""
7513 "For details of what happens when a thread is canceled, see B<pthread_cancel>"
7514 "(3)."
7515 msgstr ""
7516 "スレッドが取り消された場合に何が起こるかの詳細については\n"
7517 "B<pthread_cancel>(3) を参照。"
7518
7519 #. type: Plain text
7520 #: build/C/man3/pthread_setcancelstate.3:125
7521 msgid ""
7522 "Briefly disabling cancelability is useful if a thread performs some critical "
7523 "action that must not be interrupted by a cancellation request.  Beware of "
7524 "disabling cancelability for long periods, or around operations that may "
7525 "block for long periods, since that will render the thread unresponsive to "
7526 "cancellation requests."
7527 msgstr ""
7528 "取り消し要求により中断されてはならない重要なアクションをスレッドが\n"
7529 "実行する場合、短い時間だけ cancelability を無効にするのは有用である。\n"
7530 "長い時間 cancelability を無効にしたり、長い時間停止 (block) される\n"
7531 "可能性のある操作の前後で cancelability を無効にしたりする際には\n"
7532 "注意すること。なぜなら、無効にしてしまうと、キャンセル要求に対して\n"
7533 "スレッドが応答しない状態になってしまうからである。"
7534
7535 #. type: Plain text
7536 #: build/C/man3/pthread_setcancelstate.3:156
7537 msgid ""
7538 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
7539 "useful.  Since the thread could be canceled at I<any> time, it cannot safely "
7540 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
7541 "mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe "
7542 "because the application has no way of knowing what the state of these "
7543 "resources is when the thread is canceled; that is, did cancellation occur "
7544 "before the resources were reserved, while they were reserved, or after they "
7545 "were released? Furthermore, some internal data structures (e.g., the linked "
7546 "list of free blocks managed by the B<malloc>(3)  family of functions) may be "
7547 "left in an inconsistent state if cancellation occurs in the middle of the "
7548 "function call.  Consequently, clean-up handlers cease to be useful.  "
7549 "Functions that can be safely asynchronously canceled are called I<async-"
7550 "cancel-safe functions>.  POSIX.1-2001 requires only that B<pthread_cancel>"
7551 "(3), B<pthread_setcancelstate>(), and B<pthread_setcanceltype>()  be async-"
7552 "cancel-safe.  In general, other library functions can't be safely called "
7553 "from an asynchronously cancelable thread.  One of the few circumstances in "
7554 "which asynchronous cancelability is useful is for cancellation of a thread "
7555 "that is in a pure compute-bound loop."
7556 msgstr ""
7557 "cancelability type を B<PTHREAD_CANCEL_ASYNCHRONOUS> に設定して役に立つ\n"
7558 "ことはめったにない。スレッドはI<いつでも>キャンセルすることができること\n"
7559 "になるので、スレッドが安全にリソースの確保 (例えば B<malloc>(3) で\n"
7560 "メモリを割り当てる) や mutex、セマフォ、ロックなどの獲得を行うことがで\n"
7561 "きない。アプリケーションは、スレッドがキャンセルされる際に、これらのリ\n"
7562 "ソースがどのような状態にあるかを知る術はないので、リソースの確保が安全\n"
7563 "ではなくなる。つまり、キャンセルが起こったのが、リソースの確保前なのか、\n"
7564 "確保中なのか、確保後なのかが分からない。さらに、関数呼び出しの最中に\n"
7565 "キャンセルが発生すると、いくつかの内部データ構造 (例えば、B<malloc>(3)\n"
7566 "関連の関数が管理している未使用ブロックのリンクリスト) が一貫性のない\n"
7567 "状態のままになってしまう可能性がある。その結果、クリーンアップハンドラ\n"
7568 "が役に立たないものになってしまう。\n"
7569 "非同期で安全にキャンセルできる関数は I<async-cancel-safe functions> と\n"
7570 "呼ばれる。 POSIX.1-2001 で、非同期で安全にキャンセルできるように求めら\n"
7571 "れている関数は B<pthread_cancel>(3), B<pthread_setcancelstate>(),\n"
7572 "B<pthread_setcanceltype>() だけである。一般的には、それ以外のライブラリ\n"
7573 "関数は、非同期にキャンセルできるスレッドから安全に呼び出すことはできな\n"
7574 "い。非同期でのキャンセルが有効な数少ない状況としては、純粋に計算だけを\n"
7575 "行うループに入っているスレッドをキャンセルするといった場面がある。"
7576
7577 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
7578 #. type: Plain text
7579 #: build/C/man3/pthread_setcancelstate.3:174
7580 msgid ""
7581 "The Linux threading implementations permit the I<oldstate> argument of "
7582 "B<pthread_setcancelstate>()  to be NULL, in which case the information about "
7583 "the previous cancelability state is not returned to the caller.  Many other "
7584 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
7585 "does not specify this point, so portable applications should always specify "
7586 "a non-NULL value in I<oldstate>.  A precisely analogous set of statements "
7587 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
7588 msgstr ""
7589 "Linux のスレッド実装では、 B<pthread_setcancelstate>() の I<oldstate>\n"
7590 "引き数に NULL を指定することを認めている。 NULL が指定された場合、\n"
7591 "変更前の cancelability state の情報が呼び出し側に返されない。\n"
7592 "他の多くの実装でも I<oldstate> 引き数に NULL を指定することを認めて\n"
7593 "いるが、 POSIX.1-2001 ではこの点については規定されていない。\n"
7594 "したがって、移植性が必要なアプリケーションでは常に I<oldstate> に\n"
7595 "NULL 以外の値を指定するようにすべきである。\n"
7596 "B<pthread_setcanceltype>() の I<oldtype> 引き数についても、\n"
7597 "全く同じことが言える。"
7598
7599 #. type: Plain text
7600 #: build/C/man3/pthread_setcancelstate.3:177
7601 msgid "See B<pthread_cancel>(3)."
7602 msgstr "B<pthread_cancel>(3) を参照。"
7603
7604 #. type: Plain text
7605 #: build/C/man3/pthread_setcancelstate.3:182
7606 msgid ""
7607 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7608 "B<pthreads>(7)"
7609 msgstr ""
7610 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7611 "B<pthreads>(7)"
7612
7613 #. type: TH
7614 #: build/C/man3/pthread_setconcurrency.3:25
7615 #, no-wrap
7616 msgid "PTHREAD_SETCONCURRENCY"
7617 msgstr "PTHREAD_SETCONCURRENCY"
7618
7619 #. type: TH
7620 #: build/C/man3/pthread_setconcurrency.3:25
7621 #, no-wrap
7622 msgid "2009-04-10"
7623 msgstr "2009-04-10"
7624
7625 #. type: Plain text
7626 #: build/C/man3/pthread_setconcurrency.3:29
7627 msgid ""
7628 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
7629 "level"
7630 msgstr ""
7631 "pthread_setconcurrency, pthread_getconcurrency - 並列処理レベルの設定/取得を"
7632 "行う"
7633
7634 #. type: Plain text
7635 #: build/C/man3/pthread_setconcurrency.3:35
7636 #, no-wrap
7637 msgid ""
7638 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7639 "B<int pthread_getconcurrency(void);>\n"
7640 msgstr ""
7641 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7642 "B<int pthread_getconcurrency(void);>\n"
7643
7644 #. type: Plain text
7645 #: build/C/man3/pthread_setconcurrency.3:48
7646 msgid ""
7647 "The B<pthread_setconcurrency>()  function informs the implementation of the "
7648 "application's desired concurrency level, specified in I<new_level>.  The "
7649 "implementation takes this only as a hint: POSIX.1 does not specify the level "
7650 "of concurrency that should be provided as a result of calling "
7651 "B<pthread_setconcurrency>()."
7652 msgstr ""
7653 "B<pthread_setconcurrency>() 関数は、アプリケーションが希望する\n"
7654 "並列処理レベル (concurrency level) をスレッド実装に通知する。\n"
7655 "希望する並列処理レベルは I<new_level> で指定する。\n"
7656 "スレッド実装はこの情報をヒントとしてのみ利用する。\n"
7657 "POSIX.1 では、 B<pthread_setconcurrency>() の呼び出した結果、\n"
7658 "どのような並列度になるべきかは規定されていない。"
7659
7660 #. type: Plain text
7661 #: build/C/man3/pthread_setconcurrency.3:53
7662 msgid ""
7663 "Specifying I<new_level> as 0 instructs the implementation to manage the "
7664 "concurrency level as it deems appropriate."
7665 msgstr ""
7666 "I<new_level> に 0 を指定すると、スレッド実装は並列処理レベルを\n"
7667 "実装側で適切とみなしたレベルに設定するようになる。"
7668
7669 #. type: Plain text
7670 #: build/C/man3/pthread_setconcurrency.3:56
7671 msgid ""
7672 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
7673 "level for this process."
7674 msgstr ""
7675 "B<pthread_getconcurrency>() は、このプロセスの concurrency level\n"
7676 "の現在値を返す。"
7677
7678 #. type: Plain text
7679 #: build/C/man3/pthread_setconcurrency.3:61
7680 msgid ""
7681 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
7682 "nonzero error number."
7683 msgstr ""
7684 "成功すると、 B<pthread_setconcurrency>() は 0 を返す。\n"
7685 "エラーの場合、 0 以外のエラー番号を返す。"
7686
7687 #. type: Plain text
7688 #: build/C/man3/pthread_setconcurrency.3:68
7689 msgid ""
7690 "B<pthread_getconcurrency>()  always succeeds, returning the concurrency "
7691 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
7692 "B<pthread_setconcurrency>()  has not previously been called."
7693 msgstr ""
7694 "B<pthread_getconcurrency>() は常に成功し、最後の\n"
7695 "B<pthread_getconcurrency>() の呼び出しで設定された \n"
7696 "concurrency level を返す。 B<pthread_getconcurrency>() が\n"
7697 "それまでに一度も呼び出されていない場合は 0 が返る。"
7698
7699 #. type: Plain text
7700 #: build/C/man3/pthread_setconcurrency.3:71
7701 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
7702 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
7703
7704 #. type: Plain text
7705 #: build/C/man3/pthread_setconcurrency.3:75
7706 msgid "I<new_level> is negative."
7707 msgstr "I<new_level> が負である。"
7708
7709 #. type: Plain text
7710 #: build/C/man3/pthread_setconcurrency.3:81
7711 msgid ""
7712 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
7713 "I<new_level> would cause a system resource to be exceeded\")."
7714 msgstr ""
7715 "POSIX.1-2001 には、エラー B<EAGAIN> も記載されている\n"
7716 "(「I<new_level> に指定された値を適用すると、システムリソースが\n"
7717 "超過してしまう」)。"
7718
7719 #. type: Plain text
7720 #: build/C/man3/pthread_setconcurrency.3:83
7721 msgid "These functions are available in glibc since version 2.1."
7722 msgstr "これらの関数は glibc バージョン 2.1 以降で利用できる。"
7723
7724 #. type: Plain text
7725 #: build/C/man3/pthread_setconcurrency.3:87
7726 msgid "The default concurrency level is 0."
7727 msgstr "デフォルトの concurrency level は 0 である。"
7728
7729 #. type: Plain text
7730 #: build/C/man3/pthread_setconcurrency.3:94
7731 msgid ""
7732 "Concurrency levels are meaningful only for M:N threading implementations, "
7733 "where at any moment a subset of a process's set of user-level threads may be "
7734 "bound to a smaller number of kernel-scheduling entities.  Setting the "
7735 "concurrency level allows the application to give the system a hint as to the "
7736 "number of kernel-scheduling entities that should be provided for efficient "
7737 "execution of the application."
7738 msgstr ""
7739 "並列処理レベルが意味を持つのは M:N スレッド実装の場合のみである。\n"
7740 "M:N スレッド実装では、ある瞬間において、あるプロセスのユーザレベルスレッ\n"
7741 "ドの集合のサブ集合が、そのサブ集合のサイズよりも少ない数のカーネルの\n"
7742 "スケジューリング実体 (kernel-scheduling entity) に結び付けられる。\n"
7743 "並列処理レベルを設定すると、そのアプリケーションの効率的な実行に必要な\n"
7744 "カーネルのスケジューリング実体の数のヒントを、アプリケーションはシステ\n"
7745 "ムに伝えることができる。"
7746
7747 #. type: Plain text
7748 #: build/C/man3/pthread_setconcurrency.3:100
7749 msgid ""
7750 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
7751 "concurrency level has no meaning.  In other words, on Linux these functions "
7752 "merely exist for compatibility with other systems, and they have no effect "
7753 "on the execution of a program."
7754 msgstr ""
7755 "LinuxThreads と NPTL のどちらも 1:1 スレッド実装であり、\n"
7756 "並列処理レベルを設定しても何の意味もない。\n"
7757 "言い換えると、 Linux では、これらの関数は、\n"
7758 "他のシステムとの互換性のためだけに存在し、\n"
7759 "プログラムの実行には何の影響も与えないということである。"
7760
7761 #. type: Plain text
7762 #: build/C/man3/pthread_setconcurrency.3:103
7763 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
7764 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
7765
7766 #. type: TH
7767 #: build/C/man3/pthread_setname_np.3:26
7768 #, no-wrap
7769 msgid "PTHREAD_SETNAME_NP"
7770 msgstr "PTHREAD_SETNAME_NP"
7771
7772 #. type: Plain text
7773 #: build/C/man3/pthread_setname_np.3:29
7774 msgid "pthread_setname_np, pthread_getname_np - set/get the name of a thread"
7775 msgstr "pthread_setname_np, pthread_getname_np - スレッド名の設定/取得を行う"
7776
7777 #. type: Plain text
7778 #: build/C/man3/pthread_setname_np.3:36
7779 #, no-wrap
7780 msgid ""
7781 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
7782 "B<#include E<lt>pthread.hE<gt>>\n"
7783 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
7784 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
7785 "B<                       const char *>I<name>B<, size_t >I<len>B<);>\n"
7786 msgstr ""
7787 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
7788 "B<#include E<lt>pthread.hE<gt>>\n"
7789 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
7790 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
7791 "B<                       const char *>I<name>B<, size_t >I<len>B<);>\n"
7792
7793 #. type: Plain text
7794 #: build/C/man3/pthread_setname_np.3:55
7795 msgid ""
7796 "By default, all the threads created using B<pthread_create>()  inherit the "
7797 "program name.  The B<pthread_setname_np>()  function can be used to set a "
7798 "unique name for a thread, which can be useful for debugging multithreaded "
7799 "applications.  The thread name is a meaningful C language string, whose "
7800 "length is restricted to 16 characters, including the terminating null byte "
7801 "(\\(aq\\e0\\(aq).  The I<thread> argument specifies the thread whose name is "
7802 "to be changed; I<name> specifies the new name."
7803 msgstr ""
7804 "デフォルトでは、 B<pthread_create>() で作成されたすべてのスレッドはプログラム"
7805 "名を継承する。 B<pthread_setname_np>() 関数を使うとスレッドに固有の名前を設定"
7806 "することができる。 スレッド固有の名前はマルチスレッド・アプリケーションのデ"
7807 "バッグに便利である。 スレッド名は意味のある C 言語の文字列である。 その長さ"
7808 "は 16 文字に限定されており、 終端の NULL バイト (\\(aq\\e0\\(aq) も 16 文字に"
7809 "含まれる。 I<thread> 引き数で名前を変更するスレッドを指定する。 I<name> には"
7810 "新しい名前を指定する。"
7811
7812 #. type: Plain text
7813 #: build/C/man3/pthread_setname_np.3:72
7814 msgid ""
7815 "The B<pthread_getname_np>()  function can be used to retrieve the name of "
7816 "the thread.  The I<thread> argument specifies the thread whose name is to be "
7817 "retrieved.  The buffer I<name> is used to return the thread name; I<len> "
7818 "specifies the number of bytes available in I<name>.  The buffer specified by "
7819 "I<name> should be at least 16 characters in length.  The returned thread "
7820 "name in the output buffer will be null terminated."
7821 msgstr ""
7822 "B<pthread_getname_np>() 関数を使うと、 スレッド名を取得することができる。 "
7823 "I<thread> 引き数は名前を取得するスレッドを指定する。 バッファ I<name> はス"
7824 "レッド名を返すのに使用される。 I<len> には I<name> の大きさをバイトで指定す"
7825 "る。 I<name> で指定されたバッファの大きさは最低でも 16 文字とすべきである。 "
7826 "出力バッファに返されたスレッド名は NULL 終端される。"
7827
7828 #. type: Plain text
7829 #: build/C/man3/pthread_setname_np.3:79
7830 msgid ""
7831 "The B<pthread_setname_np>()  function can fail with the following error:"
7832 msgstr "B<pthread_setname_np>() は以下のエラーで失敗する場合がある。"
7833
7834 #. type: TP
7835 #: build/C/man3/pthread_setname_np.3:79 build/C/man3/pthread_setname_np.3:88
7836 #, no-wrap
7837 msgid "B<ERANGE>"
7838 msgstr "B<ERANGE>"
7839
7840 #. type: Plain text
7841 #: build/C/man3/pthread_setname_np.3:84
7842 msgid ""
7843 "The length of the string specified pointed to by I<name> exceeds the allowed "
7844 "limit."
7845 msgstr "I<name> で指定された文字列の長さが、許可されている上限を超えている。"
7846
7847 #. type: Plain text
7848 #: build/C/man3/pthread_setname_np.3:88
7849 msgid ""
7850 "The B<pthread_getname_np>()  function can fail with the following error:"
7851 msgstr "B<pthread_getname_np>() は以下のエラーで失敗する場合がある。"
7852
7853 #. type: Plain text
7854 #: build/C/man3/pthread_setname_np.3:95
7855 msgid ""
7856 "The buffer specified by I<name> and I<len> is too small to hold the thread "
7857 "name."
7858 msgstr ""
7859 "I<name> と I<len> で指定されたバッファが、 スレッド名を格納するには短かすぎ"
7860 "る。"
7861
7862 #. type: Plain text
7863 #: build/C/man3/pthread_setname_np.3:100
7864 msgid ""
7865 "If either of these functions fails to open I</proc/self/task/[tid]/comm>, "
7866 "then the call may fail with one of the errors described in B<open>(2)."
7867 msgstr ""
7868 "I</proc/self/task/[tid]/comm> のオープンに失敗した場合、 これらの関数は "
7869 "B<open>(2) で説明されているエラーのいずれかで失敗する。"
7870
7871 #. type: Plain text
7872 #: build/C/man3/pthread_setname_np.3:102
7873 msgid "These functions first appeared in glibc in version 2.12."
7874 msgstr "これらの関数は glibc バージョン 2.12 で初めて登場した。"
7875
7876 #. type: Plain text
7877 #: build/C/man3/pthread_setname_np.3:104
7878 msgid "These functions are nonstandard GNU extensions."
7879 msgstr "これらの関数は非標準の GNU による拡張である。"
7880
7881 #. type: Plain text
7882 #: build/C/man3/pthread_setname_np.3:114
7883 msgid ""
7884 "B<pthread_setname_np>()  internally writes to the thread-specific I<comm> "
7885 "file under the I</proc> filesystem: I</proc/self/task/[tid]/comm>.  "
7886 "B<pthread_getname_np>()  retrieves it from the same location."
7887 msgstr ""
7888 "B<pthread_setname_np>() は内部で I</proc> ファイルシステムのスレッド固有の "
7889 "I<comm> ファイル (I</proc/self/task/[tid]/comm>) に書き込みを行う。 "
7890 "B<pthread_getname_np>() はこのファイルから読み出しを行う。"
7891
7892 #. type: Plain text
7893 #: build/C/man3/pthread_setname_np.3:120
7894 msgid ""
7895 "The program below demonstrates the use of B<pthread_setname_np>()  and "
7896 "B<pthread_getname_np>()."
7897 msgstr ""
7898 "以下のプログラムは、 B<pthread_setname_np>() と B<pthread_getname_np>()\n"
7899 "の使用例を示している。"
7900
7901 #. type: Plain text
7902 #: build/C/man3/pthread_setname_np.3:122
7903 msgid "The following shell session shows a sample run of the program:"
7904 msgstr "以下のシェルセッションは、このプログラムの実行例である。"
7905
7906 #. type: Plain text
7907 #: build/C/man3/pthread_setname_np.3:138
7908 #, no-wrap
7909 msgid ""
7910 "$B< ./a.out>\n"
7911 "Created a thread. Default name is: a.out\n"
7912 "The thread name after setting it is THREADFOO.\n"
7913 "B<^Z>                           # Suspend the program\n"
7914 "[1]+  Stopped           ./a.out\n"
7915 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
7916 "  PID   TID CMD                         COMMAND\n"
7917 " 5990  5990 ./a.out                     a.out\n"
7918 " 5990  5991 ./a.out                     THREADFOO\n"
7919 "$ B<cat /proc/5990/task/5990/comm>\n"
7920 "a.out\n"
7921 "$ B<cat /proc/5990/task/5991/comm>\n"
7922 "THREADFOO\n"
7923 msgstr ""
7924 "$B< ./a.out>\n"
7925 "Created a thread. Default name is: a.out\n"
7926 "The thread name after setting it is THREADFOO.\n"
7927 "B<^Z>                           # Suspend the program\n"
7928 "[1]+  Stopped           ./a.out\n"
7929 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
7930 "  PID   TID CMD                         COMMAND\n"
7931 " 5990  5990 ./a.out                     a.out\n"
7932 " 5990  5991 ./a.out                     THREADFOO\n"
7933 "$ B<cat /proc/5990/task/5990/comm>\n"
7934 "a.out\n"
7935 "$ B<cat /proc/5990/task/5991/comm>\n"
7936 "THREADFOO\n"
7937
7938 #. type: Plain text
7939 #: build/C/man3/pthread_setname_np.3:150
7940 #, no-wrap
7941 msgid ""
7942 "#define _GNU_SOURCE\n"
7943 "#include E<lt>pthread.hE<gt>\n"
7944 "#include E<lt>stdio.hE<gt>\n"
7945 "#include E<lt>string.hE<gt>\n"
7946 "#include E<lt>unistd.hE<gt>\n"
7947 "#include E<lt>errno.hE<gt>\n"
7948 "#include E<lt>stdlib.hE<gt>\n"
7949 msgstr ""
7950 "#define _GNU_SOURCE\n"
7951 "#include E<lt>pthread.hE<gt>\n"
7952 "#include E<lt>stdio.hE<gt>\n"
7953 "#include E<lt>string.hE<gt>\n"
7954 "#include E<lt>unistd.hE<gt>\n"
7955 "#include E<lt>errno.hE<gt>\n"
7956 "#include E<lt>stdlib.hE<gt>\n"
7957
7958 #. type: Plain text
7959 #: build/C/man3/pthread_setname_np.3:152
7960 #, no-wrap
7961 msgid "#define NAMELEN 16\n"
7962 msgstr "#define NAMELEN 16\n"
7963
7964 #. type: Plain text
7965 #: build/C/man3/pthread_setname_np.3:156
7966 #, no-wrap
7967 msgid ""
7968 "#define errExitEN(en, msg) \\e\n"
7969 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
7970 "        } while (0)\n"
7971 msgstr ""
7972 "#define errExitEN(en, msg) \\e\n"
7973 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
7974 "        } while (0)\n"
7975
7976 #. type: Plain text
7977 #: build/C/man3/pthread_setname_np.3:163
7978 #, no-wrap
7979 msgid ""
7980 "static void *\n"
7981 "threadfunc(void *parm)\n"
7982 "{\n"
7983 "    sleep(5);          // allow main program to set the thread name\n"
7984 "    return NULL;\n"
7985 "}\n"
7986 msgstr ""
7987 "static void *\n"
7988 "threadfunc(void *parm)\n"
7989 "{\n"
7990 "    sleep(5);          // allow main program to set the thread name\n"
7991 "    return NULL;\n"
7992 "}\n"
7993
7994 #. type: Plain text
7995 #: build/C/man3/pthread_setname_np.3:170
7996 #, no-wrap
7997 msgid ""
7998 "int\n"
7999 "main(int argc, char **argv)\n"
8000 "{\n"
8001 "    pthread_t thread;\n"
8002 "    int rc;\n"
8003 "    char thread_name[NAMELEN];\n"
8004 msgstr ""
8005 "int\n"
8006 "main(int argc, char **argv)\n"
8007 "{\n"
8008 "    pthread_t thread;\n"
8009 "    int rc;\n"
8010 "    char thread_name[NAMELEN];\n"
8011
8012 #. type: Plain text
8013 #: build/C/man3/pthread_setname_np.3:174
8014 #, no-wrap
8015 msgid ""
8016 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8017 "    if (rc != 0)\n"
8018 "        errExitEN(rc, \"pthread_create\");\n"
8019 msgstr ""
8020 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8021 "    if (rc != 0)\n"
8022 "        errExitEN(rc, \"pthread_create\");\n"
8023
8024 #. type: Plain text
8025 #: build/C/man3/pthread_setname_np.3:178
8026 #, no-wrap
8027 msgid ""
8028 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8029 "    if (rc != 0)\n"
8030 "        errExitEN(rc, \"pthread_getname_np\");\n"
8031 msgstr ""
8032 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8033 "    if (rc != 0)\n"
8034 "        errExitEN(rc, \"pthread_getname_np\");\n"
8035
8036 #. type: Plain text
8037 #: build/C/man3/pthread_setname_np.3:183
8038 #, no-wrap
8039 msgid ""
8040 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8041 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8042 "    if (rc != 0)\n"
8043 "        errExitEN(rc, \"pthread_setname_np\");\n"
8044 msgstr ""
8045 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8046 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8047 "    if (rc != 0)\n"
8048 "        errExitEN(rc, \"pthread_setname_np\");\n"
8049
8050 #. type: Plain text
8051 #: build/C/man3/pthread_setname_np.3:185
8052 #, no-wrap
8053 msgid "    sleep(2);\n"
8054 msgstr "    sleep(2);\n"
8055
8056 #. type: Plain text
8057 #: build/C/man3/pthread_setname_np.3:191
8058 #, no-wrap
8059 msgid ""
8060 "    rc = pthread_getname_np(thread, thread_name,\n"
8061 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8062 "    if (rc != 0)\n"
8063 "        errExitEN(rc, \"pthread_getname_np\");\n"
8064 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8065 msgstr ""
8066 "    rc = pthread_getname_np(thread, thread_name,\n"
8067 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8068 "    if (rc != 0)\n"
8069 "        errExitEN(rc, \"pthread_getname_np\");\n"
8070 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8071
8072 #. type: Plain text
8073 #: build/C/man3/pthread_setname_np.3:195
8074 #, no-wrap
8075 msgid ""
8076 "    rc = pthread_join(thread, NULL);\n"
8077 "    if (rc != 0)\n"
8078 "        errExitEN(rc, \"pthread_join\");\n"
8079 msgstr ""
8080 "    rc = pthread_join(thread, NULL);\n"
8081 "    if (rc != 0)\n"
8082 "        errExitEN(rc, \"pthread_join\");\n"
8083
8084 #. type: Plain text
8085 #: build/C/man3/pthread_setname_np.3:199
8086 #, no-wrap
8087 msgid ""
8088 "    printf(\"Done\\en\");\n"
8089 "    exit(EXIT_SUCCESS);\n"
8090 "}\n"
8091 msgstr ""
8092 "    printf(\"Done\\en\");\n"
8093 "    exit(EXIT_SUCCESS);\n"
8094 "}\n"
8095
8096 #. type: Plain text
8097 #: build/C/man3/pthread_setname_np.3:206
8098 msgid "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8099 msgstr "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8100
8101 #. type: TH
8102 #: build/C/man3/pthread_setschedparam.3:26
8103 #, no-wrap
8104 msgid "PTHREAD_SETSCHEDPARAM"
8105 msgstr "PTHREAD_SETSCHEDPARAM"
8106
8107 #. type: Plain text
8108 #: build/C/man3/pthread_setschedparam.3:30
8109 msgid ""
8110 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
8111 "parameters of a thread"
8112 msgstr ""
8113 "pthread_setschedparam, pthread_getschedparam - スレッドの\n"
8114 "スケジューリングポリシーとパラメータを設定/取得する"
8115
8116 #. type: Plain text
8117 #: build/C/man3/pthread_setschedparam.3:38
8118 #, no-wrap
8119 msgid ""
8120 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8121 "B<                      const struct sched_param *>I<param>B<);>\n"
8122 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8123 "B<                      struct sched_param *>I<param>B<);>\n"
8124 msgstr ""
8125 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8126 "B<                      const struct sched_param *>I<param>B<);>\n"
8127 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8128 "B<                      struct sched_param *>I<param>B<);>\n"
8129
8130 #. type: Plain text
8131 #: build/C/man3/pthread_setschedparam.3:46
8132 msgid ""
8133 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
8134 "parameters of the thread I<thread>."
8135 msgstr ""
8136 "B<pthread_setschedparam>() 関数は、スレッド I<thread> の\n"
8137 "スケジューリングポリシーとスケジューリングパラメータを設定する。"
8138
8139 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
8140 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
8141 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
8142 #. type: Plain text
8143 #: build/C/man3/pthread_setschedparam.3:57
8144 msgid ""
8145 "I<policy> specifies the new scheduling policy for I<thread>.  The supported "
8146 "values for I<policy>, and their semantics, are described in "
8147 "B<sched_setscheduler>(2)."
8148 msgstr ""
8149 "I<policy> は I<thread> の新しいスケジューリングポリシーを指定する。\n"
8150 "I<policy> に指定できる値とその意味は B<sched_setscheduler>(2) で\n"
8151 "説明されている。"
8152
8153 #. type: Plain text
8154 #: build/C/man3/pthread_setschedparam.3:63
8155 msgid ""
8156 "The structure pointed to by I<param> specifies the new scheduling parameters "
8157 "for I<thread>.  Scheduling parameters are maintained in the following "
8158 "structure:"
8159 msgstr ""
8160 "I<param> が指す構造体は I<thread> の新しいスケジューリングパラメータを\n"
8161 "指定する。スケジューリングパラメータは以下の構造体で管理される。"
8162
8163 #.  FIXME . nptl/pthread_setschedparam.c has the following
8164 #.    /* If the thread should have higher priority because of some
8165 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
8166 #.  Eventually (perhaps after writing the mutexattr pages), we
8167 #.  may want to add something on the topic to this page.
8168 #. type: Plain text
8169 #: build/C/man3/pthread_setschedparam.3:104
8170 msgid ""
8171 "The B<pthread_getschedparam>()  function returns the scheduling policy and "
8172 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
8173 "and I<param>, respectively.  The returned priority value is that set by the "
8174 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
8175 "B<pthread_create>(3)  call that affected I<thread>.  The returned priority "
8176 "does not reflect any temporary priority adjustments as a result of calls to "
8177 "any priority inheritance or priority ceiling functions (see, for example, "
8178 "B<pthread_mutexattr_setprioceiling>(3)  and B<pthread_mutexattr_setprotocol>"
8179 "(3))."
8180 msgstr ""
8181 "B<pthread_getschedparam>() 関数は、スレッド I<thread> の\n"
8182 "スケジューリングポリシーとパラメータを、\n"
8183 "それぞれ I<policy> と I<param> が指すバッファに入れて返す。\n"
8184 "返された優先度の値は、最も最近実行した I<thread> に影響を与える\n"
8185 "B<pthread_setschedparam>(), B<pthread_setschedprio>,\n"
8186 "B<pthread_create> で設定された値となる。\n"
8187 "返された優先度は、優先度の継承や優先度の上限を設定する関数\n"
8188 "(例えば B<pthread_mutexattr_setprioceiling>(3) や\n"
8189 "B<pthread_mutexattr_setprotocol>(3) を参照) の呼び出しの結果\n"
8190 "行われる一時的な優先度の調整の影響を受けない。"
8191
8192 #. type: Plain text
8193 #: build/C/man3/pthread_setschedparam.3:112
8194 msgid ""
8195 "On success, these functions return 0; on error, they return a nonzero error "
8196 "number.  If B<pthread_setschedparam>()  fails, the scheduling policy and "
8197 "parameters of I<thread> are not changed."
8198 msgstr ""
8199 "成功すると、これらの関数は 0 を返す。\n"
8200 "エラーの場合、0 以外のエラー番号を返す。\n"
8201 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
8202 "スケジューリングポリシーとパラメータは変更されない。"
8203
8204 #. type: Plain text
8205 #: build/C/man3/pthread_setschedparam.3:114
8206 msgid "Both of these functions can fail with the following error:"
8207 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
8208
8209 #. type: Plain text
8210 #: build/C/man3/pthread_setschedparam.3:122
8211 msgid ""
8212 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
8213 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
8214
8215 #. type: Plain text
8216 #: build/C/man3/pthread_setschedparam.3:129
8217 msgid ""
8218 "I<policy> is not a recognized policy, or I<param> does not make sense for "
8219 "the I<policy>."
8220 msgstr ""
8221 "I<policy> が認識できないポリシーであるか、\n"
8222 "I<param> が I<policy> では意味を持たない値である。"
8223
8224 #. type: Plain text
8225 #: build/C/man3/pthread_setschedparam.3:133
8226 msgid ""
8227 "The caller does not have appropriate privileges to set the specified "
8228 "scheduling policy and parameters."
8229 msgstr ""
8230 "呼び出し側が、指定されたスケジューリングポリシーやパラメータを設定する\n"
8231 "のに必要な特権を持たない。"
8232
8233 #.  .SH VERSIONS
8234 #.  Available since glibc 2.0
8235 #. type: Plain text
8236 #: build/C/man3/pthread_setschedparam.3:141
8237 msgid ""
8238 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
8239 "policy or scheduling parameters to an unsupported value\") error for "
8240 "B<pthread_setschedparam>()."
8241 msgstr ""
8242 "POSIX.1-2001 では、 B<pthread_setschedparam>() に関して\n"
8243 "エラー B<ENOTSUP> (\"サポートされていない値をスケジューリングポリシーや\n"
8244 "パラメータに設定しようとした\") も追加で規定されている。"
8245
8246 #. type: Plain text
8247 #: build/C/man3/pthread_setschedparam.3:149
8248 msgid ""
8249 "For a description of the permissions required to, and the effect of, "
8250 "changing a thread's scheduling policy and priority, and details of the "
8251 "permitted ranges for priorities in each scheduling policy, see "
8252 "B<sched_setscheduler>(2)."
8253 msgstr ""
8254 "スレッドのスケジューリングポリシーや優先度を変更するために必要な許可や\n"
8255 "変更した場合の影響、および各スケジューリングポリシーで認められる優先度\n"
8256 "の範囲の詳細については、 B<sched_setscheduler>(2) を参照。"
8257
8258 #. type: Plain text
8259 #: build/C/man3/pthread_setschedparam.3:156
8260 msgid ""
8261 "The program below demonstrates the use of B<pthread_setschedparam>()  and "
8262 "B<pthread_getschedparam>(), as well as the use of a number of other "
8263 "scheduling-related pthreads functions."
8264 msgstr ""
8265 "以下のプログラムは B<pthread_setschedparam>() と\n"
8266 "B<pthread_getschedparam>() やスケジューリングに関連する pthreads の\n"
8267 "他のいろいろな関数の使用例を示すものである。"
8268
8269 #. type: Plain text
8270 #: build/C/man3/pthread_setschedparam.3:172
8271 msgid ""
8272 "In the following run, the main thread sets its scheduling policy to "
8273 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
8274 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
8275 "priority attribute of 20.  The program then sets (using "
8276 "B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the "
8277 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
8278 "created using this attributes object should take their scheduling attributes "
8279 "from the thread attributes object.  The program then creates a thread using "
8280 "the thread attributes object, and that thread displays its scheduling policy "
8281 "and priority."
8282 msgstr ""
8283 "以下の実行例では、メインスレッドは、自分のスケジューリングポリシーを\n"
8284 "優先度 10 の B<SCHED_FIFO> を設定し、スレッド属性オブジェクトを\n"
8285 "スケジューリングポリシー属性 B<SCHED_RR> とスケジューリング優先度\n"
8286 "属性 20 で初期化する。\n"
8287 "次に、このプログラムは (B<pthread_attr_setinheritsched>(3) を使って) \n"
8288 "そのスレッド属性オブジェクトの inherit scheduler 属性に\n"
8289 "B<PTHREAD_EXPLICIT_SCHED> を設定する。B<PTHREAD_EXPLICIT_SCHED> は、\n"
8290 "そのスレッド属性オブジェクトを使って作成されたスレッドはスレッド属性\n"
8291 "オブジェクトからスケジューリング属性を取得して使うことを意味する。\n"
8292 "それから、このスレッド属性オブジェクトを使ってスレッドを作成し、\n"
8293 "作成したスレッドのスケジューリングポリシーと優先度を表示する。"
8294
8295 #. type: Plain text
8296 #: build/C/man3/pthread_setschedparam.3:180
8297 #, no-wrap
8298 msgid ""
8299 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
8300 "Password:\n"
8301 "# B<./a.out -mf10 -ar20 -i e>\n"
8302 "Scheduler settings of main thread\n"
8303 "    policy=SCHED_FIFO, priority=10\n"
8304 msgstr ""
8305 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
8306 "Password:\n"
8307 "# B<./a.out -mf10 -ar20 -i e>\n"
8308 "Scheduler settings of main thread\n"
8309 "    policy=SCHED_FIFO, priority=10\n"
8310
8311 #. type: Plain text
8312 #: build/C/man3/pthread_setschedparam.3:184
8313 #, no-wrap
8314 msgid ""
8315 "Scheduler settings in \\(aqattr\\(aq\n"
8316 "    policy=SCHED_RR, priority=20\n"
8317 "    inheritsched is EXPLICIT\n"
8318 msgstr ""
8319 "Scheduler settings in \\(aqattr\\(aq\n"
8320 "    policy=SCHED_RR, priority=20\n"
8321 "    inheritsched is EXPLICIT\n"
8322
8323 #. type: Plain text
8324 #: build/C/man3/pthread_setschedparam.3:187
8325 #, no-wrap
8326 msgid ""
8327 "Scheduler attributes of new thread\n"
8328 "    policy=SCHED_RR, priority=20\n"
8329 msgstr ""
8330 "Scheduler attributes of new thread\n"
8331 "    policy=SCHED_RR, priority=20\n"
8332
8333 #. type: Plain text
8334 #: build/C/man3/pthread_setschedparam.3:192
8335 msgid ""
8336 "In the above output, one can see that the scheduling policy and priority "
8337 "were taken from the values specified in the thread attributes object."
8338 msgstr ""
8339 "上記の出力では、スケジューリングポリシーと優先度がスレッド属性\n"
8340 "オブジェクトで指定された値から取られていることが分かる。"
8341
8342 #. type: Plain text
8343 #: build/C/man3/pthread_setschedparam.3:199
8344 msgid ""
8345 "The next run is the same as the previous, except that the inherit scheduler "
8346 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
8347 "using the thread attributes object should ignore the scheduling attributes "
8348 "specified in the attributes object and instead take their scheduling "
8349 "attributes from the creating thread."
8350 msgstr ""
8351 "次の実行例は前のものと同じだが、 inherit scheduler 属性が \n"
8352 "B<PTHREAD_INHERIT_SCHED> に設定される点が異なる。\n"
8353 "B<PTHREAD_INHERIT_SCHED> は、そのスレッド属性オブジェクトを使って作成\n"
8354 "されたスレッドは、スレッド属性オブジェクトからスケジューリング属性を\n"
8355 "無視し、代わりに呼び出したスレッドからスケジューリング属性を取得する\n"
8356 "ことを意味する。"
8357
8358 #. type: Plain text
8359 #: build/C/man3/pthread_setschedparam.3:205
8360 #, no-wrap
8361 msgid ""
8362 "# B<./a.out -mf10 -ar20 -i i>\n"
8363 "Scheduler settings of main thread\n"
8364 "    policy=SCHED_FIFO, priority=10\n"
8365 msgstr ""
8366 "# B<./a.out -mf10 -ar20 -i i>\n"
8367 "Scheduler settings of main thread\n"
8368 "    policy=SCHED_FIFO, priority=10\n"
8369
8370 #. type: Plain text
8371 #: build/C/man3/pthread_setschedparam.3:209
8372 #, no-wrap
8373 msgid ""
8374 "Scheduler settings in \\(aqattr\\(aq\n"
8375 "    policy=SCHED_RR, priority=20\n"
8376 "    inheritsched is INHERIT\n"
8377 msgstr ""
8378 "Scheduler settings in \\(aqattr\\(aq\n"
8379 "    policy=SCHED_RR, priority=20\n"
8380 "    inheritsched is INHERIT\n"
8381
8382 #. type: Plain text
8383 #: build/C/man3/pthread_setschedparam.3:212
8384 #, no-wrap
8385 msgid ""
8386 "Scheduler attributes of new thread\n"
8387 "    policy=SCHED_FIFO, priority=10\n"
8388 msgstr ""
8389 "Scheduler attributes of new thread\n"
8390 "    policy=SCHED_FIFO, priority=10\n"
8391
8392 #. type: Plain text
8393 #: build/C/man3/pthread_setschedparam.3:218
8394 msgid ""
8395 "In the above output, one can see that the scheduling policy and priority "
8396 "were taken from the creating thread, rather than the thread attributes "
8397 "object."
8398 msgstr ""
8399 "上記の出力では、スケジューリングポリシーと優先度が、\n"
8400 "スレッド属性オブジェクトからではなく、\n"
8401 "スレッドを作成したスレッドから取れれていることが分かる。"
8402
8403 #. type: Plain text
8404 #: build/C/man3/pthread_setschedparam.3:224
8405 msgid ""
8406 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
8407 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
8408 "scheduler attribute."
8409 msgstr ""
8410 "なお、 I<-i\\ i> を省略した場合でも、\n"
8411 "B<PTHREAD_INHERIT_SCHED> が inherit scheduler 属性のデフォルト値なので、\n"
8412 "出力は同じになる。"
8413
8414 #. type: Plain text
8415 #: build/C/man3/pthread_setschedparam.3:228
8416 #, no-wrap
8417 msgid "/* pthreads_sched_test.c */\n"
8418 msgstr "/* pthreads_sched_test.c */\n"
8419
8420 #. type: Plain text
8421 #: build/C/man3/pthread_setschedparam.3:234
8422 #, no-wrap
8423 msgid ""
8424 "#include E<lt>pthread.hE<gt>\n"
8425 "#include E<lt>stdio.hE<gt>\n"
8426 "#include E<lt>stdlib.hE<gt>\n"
8427 "#include E<lt>unistd.hE<gt>\n"
8428 "#include E<lt>errno.hE<gt>\n"
8429 msgstr ""
8430 "#include E<lt>pthread.hE<gt>\n"
8431 "#include E<lt>stdio.hE<gt>\n"
8432 "#include E<lt>stdlib.hE<gt>\n"
8433 "#include E<lt>unistd.hE<gt>\n"
8434 "#include E<lt>errno.hE<gt>\n"
8435
8436 #. type: Plain text
8437 #: build/C/man3/pthread_setschedparam.3:243
8438 #, no-wrap
8439 msgid ""
8440 "static void\n"
8441 "usage(char *prog_name, char *msg)\n"
8442 "{\n"
8443 "    if (msg != NULL)\n"
8444 "        fputs(msg, stderr);\n"
8445 msgstr ""
8446 "static void\n"
8447 "usage(char *prog_name, char *msg)\n"
8448 "{\n"
8449 "    if (msg != NULL)\n"
8450 "        fputs(msg, stderr);\n"
8451
8452 #. type: Plain text
8453 #: build/C/man3/pthread_setschedparam.3:260
8454 #, no-wrap
8455 msgid ""
8456 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
8457 "    fprintf(stderr, \"Options are:\\en\");\n"
8458 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
8459 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
8460 "    fpe(\"                 thread attributes object\\en\");\n"
8461 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8462 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8463 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8464 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8465 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8466 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
8467 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8468 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8469 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8470 "    exit(EXIT_FAILURE);\n"
8471 "}\n"
8472 msgstr ""
8473 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
8474 "    fprintf(stderr, \"Options are:\\en\");\n"
8475 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
8476 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
8477 "    fpe(\"                 thread attributes object\\en\");\n"
8478 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
8479 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
8480 "    fpe(\"                     r  SCHED_RR\\en\");\n"
8481 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
8482 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
8483 "    fpe(\"-i {e|s}         Set inherit scheduler attribute to\\en\");\n"
8484 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
8485 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
8486 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
8487 "    exit(EXIT_FAILURE);\n"
8488 "}\n"
8489
8490 #. type: Plain text
8491 #: build/C/man3/pthread_setschedparam.3:271
8492 #, no-wrap
8493 msgid ""
8494 "static int\n"
8495 "get_policy(char p, int *policy)\n"
8496 "{\n"
8497 "    switch (p) {\n"
8498 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8499 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8500 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8501 "    default:  return 0;\n"
8502 "    }\n"
8503 "}\n"
8504 msgstr ""
8505 "static int\n"
8506 "get_policy(char p, int *policy)\n"
8507 "{\n"
8508 "    switch (p) {\n"
8509 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
8510 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
8511 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
8512 "    default:  return 0;\n"
8513 "    }\n"
8514 "}\n"
8515
8516 #. type: Plain text
8517 #: build/C/man3/pthread_setschedparam.3:282
8518 #, no-wrap
8519 msgid ""
8520 "static void\n"
8521 "display_sched_attr(int policy, struct sched_param *param)\n"
8522 "{\n"
8523 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8524 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8525 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8526 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8527 "            \"???\",\n"
8528 "            param-E<gt>sched_priority);\n"
8529 "}\n"
8530 msgstr ""
8531 "static void\n"
8532 "display_sched_attr(int policy, struct sched_param *param)\n"
8533 "{\n"
8534 "    printf(\"    policy=%s, priority=%d\\en\",\n"
8535 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
8536 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
8537 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
8538 "            \"???\",\n"
8539 "            param-E<gt>sched_priority);\n"
8540 "}\n"
8541
8542 #. type: Plain text
8543 #: build/C/man3/pthread_setschedparam.3:288
8544 #, no-wrap
8545 msgid ""
8546 "static void\n"
8547 "display_thread_sched_attr(char *msg)\n"
8548 "{\n"
8549 "    int policy, s;\n"
8550 "    struct sched_param param;\n"
8551 msgstr ""
8552 "static void\n"
8553 "display_thread_sched_attr(char *msg)\n"
8554 "{\n"
8555 "    int policy, s;\n"
8556 "    struct sched_param param;\n"
8557
8558 #. type: Plain text
8559 #: build/C/man3/pthread_setschedparam.3:292
8560 #, no-wrap
8561 msgid ""
8562 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8563 "    if (s != 0)\n"
8564 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8565 msgstr ""
8566 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
8567 "    if (s != 0)\n"
8568 "        handle_error_en(s, \"pthread_getschedparam\");\n"
8569
8570 #. type: Plain text
8571 #: build/C/man3/pthread_setschedparam.3:296
8572 #, no-wrap
8573 msgid ""
8574 "    printf(\"%s\\en\", msg);\n"
8575 "    display_sched_attr(policy, &param);\n"
8576 "}\n"
8577 msgstr ""
8578 "    printf(\"%s\\en\", msg);\n"
8579 "    display_sched_attr(policy, &param);\n"
8580 "}\n"
8581
8582 #. type: Plain text
8583 #: build/C/man3/pthread_setschedparam.3:301
8584 #, no-wrap
8585 msgid ""
8586 "static void *\n"
8587 "thread_start(void *arg)\n"
8588 "{\n"
8589 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8590 msgstr ""
8591 "static void *\n"
8592 "thread_start(void *arg)\n"
8593 "{\n"
8594 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
8595
8596 #. type: Plain text
8597 #: build/C/man3/pthread_setschedparam.3:304
8598 #, no-wrap
8599 msgid ""
8600 "    return NULL;\n"
8601 "}\n"
8602 msgstr ""
8603 "    return NULL;\n"
8604 "}\n"
8605
8606 #. type: Plain text
8607 #: build/C/man3/pthread_setschedparam.3:314
8608 #, no-wrap
8609 msgid ""
8610 "int\n"
8611 "main(int argc, char *argv[])\n"
8612 "{\n"
8613 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
8614 "    pthread_t thread;\n"
8615 "    pthread_attr_t attr;\n"
8616 "    pthread_attr_t *attrp;\n"
8617 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
8618 "    struct sched_param param;\n"
8619 msgstr ""
8620 "int\n"
8621 "main(int argc, char *argv[])\n"
8622 "{\n"
8623 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
8624 "    pthread_t thread;\n"
8625 "    pthread_attr_t attr;\n"
8626 "    pthread_attr_t *attrp;\n"
8627 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
8628 "    struct sched_param param;\n"
8629
8630 #. type: Plain text
8631 #: build/C/man3/pthread_setschedparam.3:316
8632 #, no-wrap
8633 msgid "    /* Process command-line options */\n"
8634 msgstr "    /* Process command-line options */\n"
8635
8636 #. type: Plain text
8637 #: build/C/man3/pthread_setschedparam.3:321
8638 #, no-wrap
8639 msgid ""
8640 "    use_null_attrib = 0;\n"
8641 "    attr_sched_str = NULL;\n"
8642 "    main_sched_str = NULL;\n"
8643 "    inheritsched_str = NULL;\n"
8644 msgstr ""
8645 "    use_null_attrib = 0;\n"
8646 "    attr_sched_str = NULL;\n"
8647 "    main_sched_str = NULL;\n"
8648 "    inheritsched_str = NULL;\n"
8649
8650 #. type: Plain text
8651 #: build/C/man3/pthread_setschedparam.3:331
8652 #, no-wrap
8653 msgid ""
8654 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
8655 "        switch (opt) {\n"
8656 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
8657 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
8658 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
8659 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
8660 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
8661 "        }\n"
8662 "    }\n"
8663 msgstr ""
8664 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
8665 "        switch (opt) {\n"
8666 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
8667 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
8668 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
8669 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
8670 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
8671 "        }\n"
8672 "    }\n"
8673
8674 #. type: Plain text
8675 #: build/C/man3/pthread_setschedparam.3:335
8676 #, no-wrap
8677 msgid ""
8678 "    if (use_null_attrib &&\n"
8679 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
8680 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
8681 msgstr ""
8682 "    if (use_null_attrib &&\n"
8683 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
8684 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
8685
8686 #. type: Plain text
8687 #: build/C/man3/pthread_setschedparam.3:338
8688 #, no-wrap
8689 msgid ""
8690 "    /* Optionally set scheduling attributes of main thread,\n"
8691 "       and display the attributes */\n"
8692 msgstr ""
8693 "    /* Optionally set scheduling attributes of main thread,\n"
8694 "       and display the attributes */\n"
8695
8696 #. type: Plain text
8697 #: build/C/man3/pthread_setschedparam.3:343
8698 #, no-wrap
8699 msgid ""
8700 "    if (main_sched_str != NULL) {\n"
8701 "        if (!get_policy(main_sched_str[0], &policy))\n"
8702 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
8703 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
8704 msgstr ""
8705 "    if (main_sched_str != NULL) {\n"
8706 "        if (!get_policy(main_sched_str[0], &policy))\n"
8707 "            usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
8708 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
8709
8710 #. type: Plain text
8711 #: build/C/man3/pthread_setschedparam.3:348
8712 #, no-wrap
8713 msgid ""
8714 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
8715 "        if (s != 0)\n"
8716 "            handle_error_en(s, \"pthread_setschedparam\");\n"
8717 "    }\n"
8718 msgstr ""
8719 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
8720 "        if (s != 0)\n"
8721 "            handle_error_en(s, \"pthread_setschedparam\");\n"
8722 "    }\n"
8723
8724 #. type: Plain text
8725 #: build/C/man3/pthread_setschedparam.3:351
8726 #, no-wrap
8727 msgid ""
8728 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
8729 "    printf(\"\\en\");\n"
8730 msgstr ""
8731 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
8732 "    printf(\"\\en\");\n"
8733
8734 #. type: Plain text
8735 #: build/C/man3/pthread_setschedparam.3:353
8736 #, no-wrap
8737 msgid "    /* Initialize thread attributes object according to options */\n"
8738 msgstr "    /* Initialize thread attributes object according to options */\n"
8739
8740 #. type: Plain text
8741 #: build/C/man3/pthread_setschedparam.3:362
8742 #, no-wrap
8743 msgid ""
8744 "    if (!use_null_attrib) {\n"
8745 "        s = pthread_attr_init(&attr);\n"
8746 "        if (s != 0)\n"
8747 "            handle_error_en(s, \"pthread_attr_init\");\n"
8748 "        attrp = &attr;\n"
8749 "    }\n"
8750 msgstr ""
8751 "    if (!use_null_attrib) {\n"
8752 "        s = pthread_attr_init(&attr);\n"
8753 "        if (s != 0)\n"
8754 "            handle_error_en(s, \"pthread_attr_init\");\n"
8755 "        attrp = &attr;\n"
8756 "    }\n"
8757
8758 #. type: Plain text
8759 #: build/C/man3/pthread_setschedparam.3:370
8760 #, no-wrap
8761 msgid ""
8762 "    if (inheritsched_str != NULL) {\n"
8763 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
8764 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
8765 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
8766 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
8767 "        else\n"
8768 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
8769 msgstr ""
8770 "    if (inheritsched_str != NULL) {\n"
8771 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
8772 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
8773 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
8774 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
8775 "        else\n"
8776 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
8777
8778 #. type: Plain text
8779 #: build/C/man3/pthread_setschedparam.3:375
8780 #, no-wrap
8781 msgid ""
8782 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
8783 "        if (s != 0)\n"
8784 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
8785 "    }\n"
8786 msgstr ""
8787 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
8788 "        if (s != 0)\n"
8789 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
8790 "    }\n"
8791
8792 #. type: Plain text
8793 #: build/C/man3/pthread_setschedparam.3:381
8794 #, no-wrap
8795 msgid ""
8796 "    if (attr_sched_str != NULL) {\n"
8797 "        if (!get_policy(attr_sched_str[0], &policy))\n"
8798 "            usage(argv[0],\n"
8799 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
8800 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
8801 msgstr ""
8802 "    if (attr_sched_str != NULL) {\n"
8803 "        if (!get_policy(attr_sched_str[0], &policy))\n"
8804 "            usage(argv[0],\n"
8805 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
8806 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
8807
8808 #. type: Plain text
8809 #: build/C/man3/pthread_setschedparam.3:389
8810 #, no-wrap
8811 msgid ""
8812 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
8813 "        if (s != 0)\n"
8814 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
8815 "        s = pthread_attr_setschedparam(&attr, &param);\n"
8816 "        if (s != 0)\n"
8817 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
8818 "    }\n"
8819 msgstr ""
8820 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
8821 "        if (s != 0)\n"
8822 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
8823 "        s = pthread_attr_setschedparam(&attr, &param);\n"
8824 "        if (s != 0)\n"
8825 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
8826 "    }\n"
8827
8828 #. type: Plain text
8829 #: build/C/man3/pthread_setschedparam.3:392
8830 #, no-wrap
8831 msgid ""
8832 "    /* If we initialized a thread attributes object, display\n"
8833 "       the scheduling attributes that were set in the object */\n"
8834 msgstr ""
8835 "    /* If we initialized a thread attributes object, display\n"
8836 "       the scheduling attributes that were set in the object */\n"
8837
8838 #. type: Plain text
8839 #: build/C/man3/pthread_setschedparam.3:400
8840 #, no-wrap
8841 msgid ""
8842 "    if (attrp != NULL) {\n"
8843 "        s = pthread_attr_getschedparam(&attr, &param);\n"
8844 "        if (s != 0)\n"
8845 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
8846 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
8847 "        if (s != 0)\n"
8848 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
8849 msgstr ""
8850 "    if (attrp != NULL) {\n"
8851 "        s = pthread_attr_getschedparam(&attr, &param);\n"
8852 "        if (s != 0)\n"
8853 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
8854 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
8855 "        if (s != 0)\n"
8856 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
8857
8858 #. type: Plain text
8859 #: build/C/man3/pthread_setschedparam.3:403
8860 #, no-wrap
8861 msgid ""
8862 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
8863 "        display_sched_attr(policy, &param);\n"
8864 msgstr ""
8865 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
8866 "        display_sched_attr(policy, &param);\n"
8867
8868 #. type: Plain text
8869 #: build/C/man3/pthread_setschedparam.3:411
8870 #, no-wrap
8871 msgid ""
8872 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
8873 "        printf(\"    inheritsched is %s\\en\",\n"
8874 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
8875 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
8876 "                \"???\");\n"
8877 "        printf(\"\\en\");\n"
8878 "    }\n"
8879 msgstr ""
8880 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
8881 "        printf(\"    inheritsched is %s\\en\",\n"
8882 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
8883 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
8884 "                \"???\");\n"
8885 "        printf(\"\\en\");\n"
8886 "    }\n"
8887
8888 #. type: Plain text
8889 #: build/C/man3/pthread_setschedparam.3:413
8890 #, no-wrap
8891 msgid "    /* Create a thread that will display its scheduling attributes */\n"
8892 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
8893
8894 #. type: Plain text
8895 #: build/C/man3/pthread_setschedparam.3:417
8896 #, no-wrap
8897 msgid ""
8898 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
8899 "    if (s != 0)\n"
8900 "        handle_error_en(s, \"pthread_create\");\n"
8901 msgstr ""
8902 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
8903 "    if (s != 0)\n"
8904 "        handle_error_en(s, \"pthread_create\");\n"
8905
8906 #. type: Plain text
8907 #: build/C/man3/pthread_setschedparam.3:419
8908 #, no-wrap
8909 msgid "    /* Destroy unneeded thread attributes object */\n"
8910 msgstr "    /* Destroy unneeded thread attributes object */\n"
8911
8912 #. type: Plain text
8913 #: build/C/man3/pthread_setschedparam.3:427
8914 #, no-wrap
8915 msgid ""
8916 "    s = pthread_join(thread, NULL);\n"
8917 "    if (s != 0)\n"
8918 "        handle_error_en(s, \"pthread_join\");\n"
8919 msgstr ""
8920 "    s = pthread_join(thread, NULL);\n"
8921 "    if (s != 0)\n"
8922 "        handle_error_en(s, \"pthread_join\");\n"
8923
8924 #. type: Plain text
8925 #: build/C/man3/pthread_setschedparam.3:445
8926 msgid ""
8927 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
8928 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
8929 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
8930 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
8931 "B<pthreads>(7)"
8932 msgstr ""
8933 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
8934 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
8935 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
8936 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
8937 "B<pthreads>(7)"
8938
8939 #. type: TH
8940 #: build/C/man3/pthread_setschedprio.3:26
8941 #, no-wrap
8942 msgid "PTHREAD_SETSCHEDPRIO"
8943 msgstr "PTHREAD_SETSCHEDPRIO"
8944
8945 #. type: TH
8946 #: build/C/man3/pthread_setschedprio.3:26
8947 #, no-wrap
8948 msgid "2008-11-06"
8949 msgstr "2008-11-06"
8950
8951 #. type: Plain text
8952 #: build/C/man3/pthread_setschedprio.3:29
8953 msgid "pthread_setschedprio - set scheduling priority of a thread"
8954 msgstr "pthread_setschedprio - スレッドのスケジューリング優先度を設定する"
8955
8956 #. type: Plain text
8957 #: build/C/man3/pthread_setschedprio.3:34
8958 #, no-wrap
8959 msgid "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
8960 msgstr "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
8961
8962 #.  FIXME . nptl/pthread_setschedprio.c has the following
8963 #.    /* If the thread should have higher priority because of some
8964 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
8965 #.  Eventually (perhaps after writing the mutexattr pages), we
8966 #.  may want to add something on the topic to this page.
8967 #.  nptl/pthread_setschedparam.c has a similar case.
8968 #. type: Plain text
8969 #: build/C/man3/pthread_setschedprio.3:53
8970 msgid ""
8971 "The B<pthread_setschedprio>()  function sets the scheduling priority of the "
8972 "thread I<thread> to the value specified in I<prio>.  (By contrast "
8973 "B<pthread_setschedparam>(3)  changes both the scheduling policy and priority "
8974 "of a thread.)"
8975 msgstr ""
8976 "B<pthread_setschedprio>() 関数は、スレッド I<thread> のスケジューリング\n"
8977 "優先度に I<prio> で指定された値を設定する\n"
8978 "(一方、B<pthread_setschedparam>(3) はスレッドのスケジューリングポリシー\n"
8979 "と優先度の両方を変更する)。"
8980
8981 #. type: Plain text
8982 #: build/C/man3/pthread_setschedprio.3:61
8983 msgid ""
8984 "On success, this function returns 0; on error, it returns a nonzero error "
8985 "number.  If B<pthread_setschedprio>()  fails, the scheduling priority of "
8986 "I<thread> is not changed."
8987 msgstr ""
8988 "成功すると、この関数は 0 を返す。\n"
8989 "エラーの場合、0 以外のエラー番号を返す。\n"
8990 "B<pthread_setschedprio>() が失敗した場合、 I<thread> の\n"
8991 "スケジューリング優先度は変更されない。"
8992
8993 #. type: Plain text
8994 #: build/C/man3/pthread_setschedprio.3:66
8995 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
8996 msgstr ""
8997 "指定されたスレッドのスケジューリングポリシーでは、 I<prio> は無効である。"
8998
8999 #. type: Plain text
9000 #: build/C/man3/pthread_setschedprio.3:70
9001 msgid ""
9002 "The caller does not have appropriate privileges to set the specified "
9003 "priority."
9004 msgstr "呼び出し側が、指定された優先度を設定するのに必要な特権を持っていない。"
9005
9006 #. type: Plain text
9007 #: build/C/man3/pthread_setschedprio.3:81
9008 msgid ""
9009 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
9010 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
9011 msgstr ""
9012 "POSIX.1-2001 では、 B<pthread_setschedprio>() に関して\n"
9013 "エラー B<ENOTSUP> (\"サポートされていない値を優先度\n"
9014 "に設定しようとした\") も追加で規定されている。"
9015
9016 #. type: Plain text
9017 #: build/C/man3/pthread_setschedprio.3:83
9018 msgid "This function is available in glibc since version 2.3.4."
9019 msgstr "この関数は glibc バージョン 2.3.4 以降で利用できる。"
9020
9021 #. type: Plain text
9022 #: build/C/man3/pthread_setschedprio.3:91
9023 msgid ""
9024 "For a description of the permissions required to, and the effect of, "
9025 "changing a thread's scheduling priority, and details of the permitted ranges "
9026 "for priorities in each scheduling policy, see B<sched_setscheduler>(2)."
9027 msgstr ""
9028 "スレッドのスケジューリング優先度を変更するために必要な許可や\n"
9029 "変更した場合の影響、および各スケジューリングポリシーで認められる優先度\n"
9030 "の範囲の詳細については、 B<sched_setscheduler>(2) を参照。"
9031
9032 #. type: Plain text
9033 #: build/C/man3/pthread_setschedprio.3:105
9034 msgid ""
9035 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
9036 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
9037 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
9038 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
9039 "B<pthreads>(7)"
9040 msgstr ""
9041 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
9042 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
9043 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
9044 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
9045 "B<pthreads>(7)"
9046
9047 #. type: TH
9048 #: build/C/man3/pthread_sigmask.3:26
9049 #, no-wrap
9050 msgid "PTHREAD_SIGMASK"
9051 msgstr "PTHREAD_SIGMASK"
9052
9053 #. type: Plain text
9054 #: build/C/man3/pthread_sigmask.3:29
9055 msgid "pthread_sigmask - examine and change mask of blocked signals"
9056 msgstr "pthread_sigmask - 禁止するシグナルマスクの確認と変更を行う"
9057
9058 #. type: Plain text
9059 #: build/C/man3/pthread_sigmask.3:35
9060 #, no-wrap
9061 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9062 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9063
9064 #. type: Plain text
9065 #: build/C/man3/pthread_sigmask.3:46
9066 msgid "B<pthread_sigmask>():"
9067 msgstr "B<pthread_sigmask>():"
9068
9069 #. type: Plain text
9070 #: build/C/man3/pthread_sigmask.3:58
9071 msgid ""
9072 "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the "
9073 "difference that its use in multithreaded programs is explicitly specified by "
9074 "POSIX.1-2001.  Other differences are noted in this page."
9075 msgstr ""
9076 "B<pthread_sigmask>() 関数は B<sigprocmask>(2) と全く同様だが、\n"
9077 "マルチスレッドプログラムでの利用が POSIX.1-2001 で明示的に規定されて\n"
9078 "いる点が異なる。他の違いはこのマニュアルページで説明する。"
9079
9080 #. type: Plain text
9081 #: build/C/man3/pthread_sigmask.3:61
9082 msgid ""
9083 "For a description of the arguments and operation of this function, see "
9084 "B<sigprocmask>(2)."
9085 msgstr "この関数の引き数と動作の説明は B<sigprocmask>(2) を参照。"
9086
9087 #. type: Plain text
9088 #: build/C/man3/pthread_sigmask.3:66
9089 msgid ""
9090 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
9091 "number."
9092 msgstr ""
9093 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9094 "エラーの場合、エラー番号を返す。"
9095
9096 #. type: Plain text
9097 #: build/C/man3/pthread_sigmask.3:69
9098 msgid "See B<sigprocmask>(2)."
9099 msgstr "B<sigprocmask>(2) を参照。"
9100
9101 #. type: Plain text
9102 #: build/C/man3/pthread_sigmask.3:73
9103 msgid "A new thread inherits a copy of its creator's signal mask."
9104 msgstr ""
9105 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスクのコピーを\n"
9106 "継承する。"
9107
9108 #. type: Plain text
9109 #: build/C/man3/pthread_sigmask.3:78
9110 msgid ""
9111 "The program below blocks some signals in the main thread, and then creates a "
9112 "dedicated thread to fetch those signals via B<sigwait>(3).  The following "
9113 "shell session demonstrates its use:"
9114 msgstr ""
9115 "以下のプログラムは、メインスレッドでシグナルのいくつかを禁止 (block)\n"
9116 "するように設定を行い、 B<sigwait>(3) 経由でそれらのシグナルを集める\n"
9117 "専用のスレッドを作成する。\n"
9118 "下記のシェルのセッションはその利用例を示したものである。"
9119
9120 #. type: Plain text
9121 #: build/C/man3/pthread_sigmask.3:89
9122 #, no-wrap
9123 msgid ""
9124 "$B< ./a.out &>\n"
9125 "[1] 5423\n"
9126 "$B< kill -QUIT %1>\n"
9127 "Signal handling thread got signal 3\n"
9128 "$B< kill -USR1 %1>\n"
9129 "Signal handling thread got signal 10\n"
9130 "$B< kill -TERM %1>\n"
9131 "[1]+  Terminated              ./a.out\n"
9132 msgstr ""
9133 "$B< ./a.out &>\n"
9134 "[1] 5423\n"
9135 "$B< kill -QUIT %1>\n"
9136 "Signal handling thread got signal 3\n"
9137 "$B< kill -USR1 %1>\n"
9138 "Signal handling thread got signal 10\n"
9139 "$B< kill -TERM %1>\n"
9140 "[1]+  Terminated              ./a.out\n"
9141
9142 #. type: Plain text
9143 #: build/C/man3/pthread_sigmask.3:100
9144 #, no-wrap
9145 msgid ""
9146 "#include E<lt>pthread.hE<gt>\n"
9147 "#include E<lt>stdio.hE<gt>\n"
9148 "#include E<lt>stdlib.hE<gt>\n"
9149 "#include E<lt>unistd.hE<gt>\n"
9150 "#include E<lt>signal.hE<gt>\n"
9151 "#include E<lt>errno.hE<gt>\n"
9152 msgstr ""
9153 "#include E<lt>pthread.hE<gt>\n"
9154 "#include E<lt>stdio.hE<gt>\n"
9155 "#include E<lt>stdlib.hE<gt>\n"
9156 "#include E<lt>unistd.hE<gt>\n"
9157 "#include E<lt>signal.hE<gt>\n"
9158 "#include E<lt>errno.hE<gt>\n"
9159
9160 #. type: Plain text
9161 #: build/C/man3/pthread_sigmask.3:102
9162 #, no-wrap
9163 msgid "/* Simple error handling functions */\n"
9164 msgstr "/* Simple error handling functions */\n"
9165
9166 #. type: Plain text
9167 #: build/C/man3/pthread_sigmask.3:111
9168 #, no-wrap
9169 msgid ""
9170 "static void *\n"
9171 "sig_thread(void *arg)\n"
9172 "{\n"
9173 "    sigset_t *set = arg;\n"
9174 "    int s, sig;\n"
9175 msgstr ""
9176 "static void *\n"
9177 "sig_thread(void *arg)\n"
9178 "{\n"
9179 "    sigset_t *set = arg;\n"
9180 "    int s, sig;\n"
9181
9182 #. type: Plain text
9183 #: build/C/man3/pthread_sigmask.3:119
9184 #, no-wrap
9185 msgid ""
9186 "    for (;;) {\n"
9187 "        s = sigwait(set, &sig);\n"
9188 "        if (s != 0)\n"
9189 "            handle_error_en(s, \"sigwait\");\n"
9190 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
9191 "    }\n"
9192 "}\n"
9193 msgstr ""
9194 "    for (;;) {\n"
9195 "        s = sigwait(set, &sig);\n"
9196 "        if (s != 0)\n"
9197 "            handle_error_en(s, \"sigwait\");\n"
9198 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
9199 "    }\n"
9200 "}\n"
9201
9202 #. type: Plain text
9203 #: build/C/man3/pthread_sigmask.3:126
9204 #, no-wrap
9205 msgid ""
9206 "int\n"
9207 "main(int argc, char *argv[])\n"
9208 "{\n"
9209 "    pthread_t thread;\n"
9210 "    sigset_t set;\n"
9211 "    int s;\n"
9212 msgstr ""
9213 "int\n"
9214 "main(int argc, char *argv[])\n"
9215 "{\n"
9216 "    pthread_t thread;\n"
9217 "    sigset_t set;\n"
9218 "    int s;\n"
9219
9220 #. type: Plain text
9221 #: build/C/man3/pthread_sigmask.3:129
9222 #, no-wrap
9223 msgid ""
9224 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
9225 "       will inherit a copy of the signal mask. */\n"
9226 msgstr ""
9227 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
9228 "       will inherit a copy of the signal mask. */\n"
9229
9230 #. type: Plain text
9231 #: build/C/man3/pthread_sigmask.3:136
9232 #, no-wrap
9233 msgid ""
9234 "    sigemptyset(&set);\n"
9235 "    sigaddset(&set, SIGQUIT);\n"
9236 "    sigaddset(&set, SIGUSR1);\n"
9237 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
9238 "    if (s != 0)\n"
9239 "        handle_error_en(s, \"pthread_sigmask\");\n"
9240 msgstr ""
9241 "    sigemptyset(&set);\n"
9242 "    sigaddset(&set, SIGQUIT);\n"
9243 "    sigaddset(&set, SIGUSR1);\n"
9244 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
9245 "    if (s != 0)\n"
9246 "        handle_error_en(s, \"pthread_sigmask\");\n"
9247
9248 #. type: Plain text
9249 #: build/C/man3/pthread_sigmask.3:140
9250 #, no-wrap
9251 msgid ""
9252 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
9253 "    if (s != 0)\n"
9254 "        handle_error_en(s, \"pthread_create\");\n"
9255 msgstr ""
9256 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
9257 "    if (s != 0)\n"
9258 "        handle_error_en(s, \"pthread_create\");\n"
9259
9260 #. type: Plain text
9261 #: build/C/man3/pthread_sigmask.3:143
9262 #, no-wrap
9263 msgid ""
9264 "    /* Main thread carries on to create other threads and/or do\n"
9265 "       other work */\n"
9266 msgstr ""
9267 "    /* Main thread carries on to create other threads and/or do\n"
9268 "       other work */\n"
9269
9270 #. type: Plain text
9271 #: build/C/man3/pthread_sigmask.3:146
9272 #, no-wrap
9273 msgid ""
9274 "    pause();            /* Dummy pause so we can test program */\n"
9275 "}\n"
9276 msgstr ""
9277 "    pause();            /* Dummy pause so we can test program */\n"
9278 "}\n"
9279
9280 #. type: Plain text
9281 #: build/C/man3/pthread_sigmask.3:156
9282 msgid ""
9283 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), "
9284 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
9285 msgstr ""
9286 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), "
9287 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
9288
9289 #. type: TH
9290 #: build/C/man3/pthread_sigqueue.3:25
9291 #, no-wrap
9292 msgid "PTHREAD_SIGQUEUE"
9293 msgstr "PTHREAD_SIGQUEUE"
9294
9295 #. type: TH
9296 #: build/C/man3/pthread_sigqueue.3:25
9297 #, no-wrap
9298 msgid "2012-08-19"
9299 msgstr "2012-08-19"
9300
9301 #. type: Plain text
9302 #: build/C/man3/pthread_sigqueue.3:28
9303 msgid "pthread_sigqueue - queue a signal and data to a thread"
9304 msgstr "pthread_sigqueue - スレッドに対するシグナルとデータをキューに入れる"
9305
9306 #. type: Plain text
9307 #: build/C/man3/pthread_sigqueue.3:34
9308 #, no-wrap
9309 msgid ""
9310 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
9311 "B<                     const union sigval >I<value>B<);>\n"
9312 msgstr ""
9313 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
9314 "B<                     const union sigval >I<value>B<);>\n"
9315
9316 #. type: Plain text
9317 #: build/C/man3/pthread_sigqueue.3:45
9318 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
9319 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
9320
9321 #. type: Plain text
9322 #: build/C/man3/pthread_sigqueue.3:53
9323 msgid ""
9324 "The B<pthread_sigqueue>()  function performs a similar task to B<sigqueue>"
9325 "(3), but, rather than sending a signal to a process, it sends a signal to a "
9326 "thread in the same process as the calling thread."
9327 msgstr ""
9328 "B<pthread_sigqueue>() 関数は B<sigqueue>(3) と同様の処理を実行するが、\n"
9329 "プロセスにシグナルを送信するのではなく、呼び出したスレッドと\n"
9330 "同じプロセス内のスレッドにシグナルを送信する。"
9331
9332 #. type: Plain text
9333 #: build/C/man3/pthread_sigqueue.3:65
9334 msgid ""
9335 "The I<thread> argument is the ID of a thread in the same process as the "
9336 "caller.  The I<sig> argument specifies the signal to be sent.  The I<value> "
9337 "argument specifies data to accompany the signal; see B<sigqueue>(3)  for "
9338 "details."
9339 msgstr ""
9340 "I<thread> 引き数は、呼び出し側と同じプロセスのスレッドの ID である。\n"
9341 "I<sig> 引き数は送信するシグナルを指定する。\n"
9342 "I<value> 引き数はシグナルと一緒に渡すデータを指定する。\n"
9343 "詳細は B<sigqueue>(3) を参照。"
9344
9345 #. type: Plain text
9346 #: build/C/man3/pthread_sigqueue.3:70
9347 msgid ""
9348 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
9349 "number."
9350 msgstr ""
9351 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9352 "エラーの場合、エラー番号を返す。"
9353
9354 #. type: Plain text
9355 #: build/C/man3/pthread_sigqueue.3:77
9356 msgid ""
9357 "The limit of signals which may be queued has been reached.  (See B<signal>"
9358 "(7)  for further information.)"
9359 msgstr ""
9360 "キューに入れられるシグナル数が上限に達していた\n"
9361 "(詳しい情報は (B<signal>(7) を参照)。"
9362
9363 #. type: Plain text
9364 #: build/C/man3/pthread_sigqueue.3:81
9365 msgid "I<sig> was invalid."
9366 msgstr "I<sig> が無効であった。"
9367
9368 #. type: TP
9369 #: build/C/man3/pthread_sigqueue.3:81
9370 #, no-wrap
9371 msgid "B<ENOSYS>"
9372 msgstr "B<ENOSYS>"
9373
9374 #. type: Plain text
9375 #: build/C/man3/pthread_sigqueue.3:85
9376 msgid "B<pthread_sigqueue>()  is not supported on this system."
9377 msgstr "B<pthread_sigqueue>() がこのシステムではサポートされていない。"
9378
9379 #. type: Plain text
9380 #: build/C/man3/pthread_sigqueue.3:89
9381 msgid "I<thread> is not valid."
9382 msgstr "I<thread> が無効である。"
9383
9384 #. type: Plain text
9385 #: build/C/man3/pthread_sigqueue.3:93
9386 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
9387 msgstr "B<pthread_sigqueue>() 関数は glibc 2.11 で初めて登場した。"
9388
9389 #. type: Plain text
9390 #: build/C/man3/pthread_sigqueue.3:95
9391 msgid "This function is a GNU extension."
9392 msgstr "この関数は GNU による拡張である。"
9393
9394 #. type: Plain text
9395 #: build/C/man3/pthread_sigqueue.3:103
9396 msgid ""
9397 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), B<sigqueue>"
9398 "(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
9399 msgstr ""
9400 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
9401 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
9402
9403 #. type: TH
9404 #: build/C/man3/pthread_testcancel.3:26
9405 #, no-wrap
9406 msgid "PTHREAD_TESTCANCEL"
9407 msgstr "PTHREAD_TESTCANCEL"
9408
9409 #. type: TH
9410 #: build/C/man3/pthread_testcancel.3:26
9411 #, no-wrap
9412 msgid "2012-04-14"
9413 msgstr "2012-04-14"
9414
9415 #. type: Plain text
9416 #: build/C/man3/pthread_testcancel.3:29
9417 msgid ""
9418 "pthread_testcancel - request delivery of any pending cancellation request"
9419 msgstr "pthread_testcancel - 処理待ちの取り消し要求の配送を要求する"
9420
9421 #. type: Plain text
9422 #: build/C/man3/pthread_testcancel.3:34
9423 #, no-wrap
9424 msgid "B<void pthread_testcancel(void);>\n"
9425 msgstr "B<void pthread_testcancel(void);>\n"
9426
9427 #. type: Plain text
9428 #: build/C/man3/pthread_testcancel.3:43
9429 msgid ""
9430 "Calling B<pthread_testcancel>()  creates a cancellation point within the "
9431 "calling thread, so that a thread that is otherwise executing code that "
9432 "contains no cancellation points will respond to a cancellation request."
9433 msgstr ""
9434 "B<pthread_testcancel>() を呼び出すと、呼び出したスレッド内に取り消し\n"
9435 "ポイント (cancellation point) が作成される。\n"
9436 "これにより、これ以外には取り消しポイントを含まないコードを実行して\n"
9437 "いるスレッドが取り消し要求に対応することができるようになる。"
9438
9439 #. type: Plain text
9440 #: build/C/man3/pthread_testcancel.3:50
9441 msgid ""
9442 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
9443 "cancellation request is pending, then a call to B<pthread_testcancel>()  has "
9444 "no effect."
9445 msgstr ""
9446 "(B<pthread_setcancelstate>(3) を使って) キャンセルが無効になっている\n"
9447 "場合や処理待ちの取り消し要求がない場合は、B<pthread_testcancel>() を\n"
9448 "呼び出しても何の影響もない。"
9449
9450 #. type: Plain text
9451 #: build/C/man3/pthread_testcancel.3:54
9452 msgid ""
9453 "This function does not return a value.  If the calling thread is canceled as "
9454 "a consequence of a call to this function, then the function does not return."
9455 msgstr ""
9456 "この関数は値を返さない。この関数の呼び出しの結果、呼び出したスレッドが\n"
9457 "キャンセルされた場合、この関数が返ることはない。"
9458
9459 #. type: Plain text
9460 #: build/C/man3/pthread_testcancel.3:63
9461 msgid "See B<pthread_cleanup_push>(3)."
9462 msgstr "B<pthread_cleanup_push>(3) を参照。"
9463
9464 #. type: Plain text
9465 #: build/C/man3/pthread_testcancel.3:68
9466 msgid ""
9467 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
9468 "(3), B<pthreads>(7)"
9469 msgstr ""
9470 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
9471 "(3), B<pthreads>(7)"
9472
9473 #. type: TH
9474 #: build/C/man3/pthread_tryjoin_np.3:26
9475 #, no-wrap
9476 msgid "PTHREAD_TRYJOIN_NP"
9477 msgstr "PTHREAD_TRYJOIN_NP"
9478
9479 #. type: Plain text
9480 #: build/C/man3/pthread_tryjoin_np.3:30
9481 msgid ""
9482 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
9483 "thread"
9484 msgstr ""
9485 "pthread_tryjoin_np, pthread_timedjoin_np - 終了したスレッドの join を\n"
9486 "試みる"
9487
9488 #. type: Plain text
9489 #: build/C/man3/pthread_tryjoin_np.3:36
9490 #, no-wrap
9491 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9492 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
9493
9494 #. type: Plain text
9495 #: build/C/man3/pthread_tryjoin_np.3:39
9496 #, no-wrap
9497 msgid ""
9498 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9499 "B<                         const struct timespec *>I<abstime>B<);>\n"
9500 msgstr ""
9501 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
9502 "B<                         const struct timespec *>I<abstime>B<);>\n"
9503
9504 #. type: Plain text
9505 #: build/C/man3/pthread_tryjoin_np.3:46
9506 msgid ""
9507 "These functions operate in the same way as B<pthread_join>(3), except for "
9508 "the differences described on this page."
9509 msgstr ""
9510 "これらの関数は B<pthread_join>(3) と同じように動作するが、\n"
9511 "このページで説明する違いがある。"
9512
9513 #. type: Plain text
9514 #: build/C/man3/pthread_tryjoin_np.3:58
9515 msgid ""
9516 "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the "
9517 "thread I<thread>, returning the exit status of the thread in I<*retval>.  If "
9518 "I<thread> has not yet terminated, then instead of blocking, as is done by "
9519 "B<pthread_join>(3), the call returns an error."
9520 msgstr ""
9521 "B<pthread_tryjoin_np>() 関数は、スレッド I<thread> の非停止\n"
9522 "(nonblocking) での join を実行し、スレッドの終了ステータスを\n"
9523 "I<*retval> に入れて返す。I<thread> がまだ終了していない場合は、\n"
9524 "B<pthread_join>(3) のように停止 (block) せずに、エラーを返す。"
9525
9526 #. type: Plain text
9527 #: build/C/man3/pthread_tryjoin_np.3:76
9528 msgid ""
9529 "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If "
9530 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
9531 "specified in I<abstime>.  If the timeout expires before I<thread> "
9532 "terminates, the call returns an error.  The I<abstime> argument is a "
9533 "structure of the following form, specifying an absolute time measured since "
9534 "the Epoch (see B<time>(2)):"
9535 msgstr ""
9536 "B<pthread_timedjoin_np>() 関数は、タイムアウト付きの join を行う。\n"
9537 "I<thread> がまだ終了していない場合、 I<abstime> で指定された最大時間\n"
9538 "まで停止する。 I<thread> が終了する前にタイムアウト時間が経過した場合は、\n"
9539 "エラーを返す。I<abstime> 引き数は以下に示す構造体であり、\n"
9540 "Epoch (時刻紀元; B<time>(2) 参照) から測った絶対時刻を指定する。"
9541
9542 #. type: Plain text
9543 #: build/C/man3/pthread_tryjoin_np.3:83
9544 #, no-wrap
9545 msgid ""
9546 "struct timespec {\n"
9547 "    time_t tv_sec;     /* seconds */\n"
9548 "    long   tv_nsec;    /* nanoseconds */\n"
9549 "};\n"
9550 msgstr ""
9551 "struct timespec {\n"
9552 "    time_t tv_sec;     /* seconds */\n"
9553 "    long   tv_nsec;    /* nanoseconds */\n"
9554 "};\n"
9555
9556 #. type: Plain text
9557 #: build/C/man3/pthread_tryjoin_np.3:89
9558 msgid ""
9559 "On success, these functions return 0; on error, they return an error number."
9560 msgstr ""
9561 "成功すると、これらの関数は 0 を返す。\n"
9562 "エラーの場合、エラー番号を返す。"
9563
9564 #. type: Plain text
9565 #: build/C/man3/pthread_tryjoin_np.3:94
9566 msgid ""
9567 "These functions can fail with the same errors as B<pthread_join>(3).  "
9568 "B<pthread_tryjoin_np>()  can in addition fail with the following error:"
9569 msgstr ""
9570 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
9571 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
9572
9573 #. type: TP
9574 #: build/C/man3/pthread_tryjoin_np.3:94
9575 #, no-wrap
9576 msgid "B<EBUSY>"
9577 msgstr "B<EBUSY>"
9578
9579 #. type: Plain text
9580 #: build/C/man3/pthread_tryjoin_np.3:98
9581 msgid "I<thread> had not yet terminated at the time of the call."
9582 msgstr "呼び出しを行った時点では I<thread> はまだ終了していない。"
9583
9584 #. type: Plain text
9585 #: build/C/man3/pthread_tryjoin_np.3:101
9586 msgid ""
9587 "B<pthread_timedjoin_np>()  can in addition fail with the following error:"
9588 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
9589
9590 #. type: TP
9591 #: build/C/man3/pthread_tryjoin_np.3:101
9592 #, no-wrap
9593 msgid "B<ETIMEDOUT>"
9594 msgstr "B<ETIMEDOUT>"
9595
9596 #. type: Plain text
9597 #: build/C/man3/pthread_tryjoin_np.3:106
9598 msgid "The call timed out before I<thread> terminated."
9599 msgstr "I<thread> が終了する前に呼び出しがタイムアウトとなった。"
9600
9601 #. type: Plain text
9602 #: build/C/man3/pthread_tryjoin_np.3:110
9603 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
9604 msgstr "B<pthread_timedjoin_np>() がエラー B<EINTR> を返すことはない。"
9605
9606 #. type: Plain text
9607 #: build/C/man3/pthread_tryjoin_np.3:112
9608 msgid "These functions first appeared in glibc in version 2.3.3."
9609 msgstr "これらの関数は glibc バージョン 2.3.3 で初めて登場した。"
9610
9611 #. type: Plain text
9612 #: build/C/man3/pthread_tryjoin_np.3:117
9613 msgid "The following code waits to join for up to 5 seconds:"
9614 msgstr "以下のコードは、最大 5 秒まで join を待つ。"
9615
9616 #. type: Plain text
9617 #: build/C/man3/pthread_tryjoin_np.3:121
9618 #, no-wrap
9619 msgid ""
9620 "    struct timespec ts;\n"
9621 "    int s;\n"
9622 msgstr ""
9623 "    struct timespec ts;\n"
9624 "    int s;\n"
9625
9626 #. type: Plain text
9627 #: build/C/man3/pthread_tryjoin_np.3:123
9628 #, no-wrap
9629 msgid "    ...\n"
9630 msgstr "    ...\n"
9631
9632 #. type: Plain text
9633 #: build/C/man3/pthread_tryjoin_np.3:127
9634 #, no-wrap
9635 msgid ""
9636 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
9637 "\t/* Handle error */\n"
9638 "    }\n"
9639 msgstr ""
9640 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
9641 "\t/* Handle error */\n"
9642 "    }\n"
9643
9644 #. type: Plain text
9645 #: build/C/man3/pthread_tryjoin_np.3:129
9646 #, no-wrap
9647 msgid "    ts.tv_sec += 5;\n"
9648 msgstr "    ts.tv_sec += 5;\n"
9649
9650 #. type: Plain text
9651 #: build/C/man3/pthread_tryjoin_np.3:134
9652 #, no-wrap
9653 msgid ""
9654 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
9655 "    if (s != 0) {\n"
9656 "        /* Handle error */\n"
9657 "    }\n"
9658 msgstr ""
9659 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
9660 "    if (s != 0) {\n"
9661 "        /* Handle error */\n"
9662 "    }\n"
9663
9664 #. type: Plain text
9665 #: build/C/man3/pthread_tryjoin_np.3:140
9666 msgid ""
9667 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
9668 msgstr ""
9669 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
9670
9671 #. type: TH
9672 #: build/C/man3/pthread_yield.3:25
9673 #, no-wrap
9674 msgid "PTHREAD_YIELD"
9675 msgstr "PTHREAD_YIELD"
9676
9677 #. type: TH
9678 #: build/C/man3/pthread_yield.3:25
9679 #, no-wrap
9680 msgid "2013-03-05"
9681 msgstr "2013-03-05"
9682
9683 #. type: Plain text
9684 #: build/C/man3/pthread_yield.3:28
9685 msgid "pthread_yield - yield the processor"
9686 msgstr "pthread_yield - プロセッサを明け渡す (yield)"
9687
9688 #. type: Plain text
9689 #: build/C/man3/pthread_yield.3:34
9690 #, no-wrap
9691 msgid "B<int pthread_yield(void);>\n"
9692 msgstr "B<int pthread_yield(void);>\n"
9693
9694 #. type: Plain text
9695 #: build/C/man3/pthread_yield.3:44
9696 msgid ""
9697 "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The "
9698 "thread is placed at the end of the run queue for its static priority and "
9699 "another thread is scheduled to run.  For further details, see B<sched_yield>"
9700 "(2)"
9701 msgstr ""
9702 "B<pthread_yield>() を呼び出すと、呼び出したスレッドは CPU を手放す。\n"
9703 "スレッドはそのスレッドの静的優先度の実行キューの末尾に回り、\n"
9704 "別のスレッドが実行されるようにスケジューリングされる。\n"
9705 "詳細は B<sched_yield>(2) を参照。"
9706
9707 #. type: Plain text
9708 #: build/C/man3/pthread_yield.3:49
9709 msgid ""
9710 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
9711 "number."
9712 msgstr ""
9713 "成功すると、 B<pthread_yield>() は 0 を返す。\n"
9714 "エラーの場合、エラー番号を返す。"
9715
9716 #. type: Plain text
9717 #: build/C/man3/pthread_yield.3:53
9718 msgid ""
9719 "On Linux, this call always succeeds (but portable and future-proof "
9720 "applications should nevertheless handle a possible error return)."
9721 msgstr ""
9722 "Linux では、この関数の呼び出しは常に成功する\n"
9723 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
9724 "正のエラーの返り値を処理するようにすべきである)。"
9725
9726 #.  e.g., the BSDs, Tru64, AIX, and Irix.
9727 #. type: Plain text
9728 #: build/C/man3/pthread_yield.3:59
9729 msgid ""
9730 "This call is nonstandard, but present on several other systems.  Use the "
9731 "standardized B<sched_yield>(2)  instead."
9732 msgstr ""
9733 "この関数は非標準だが、他のいくつかのシステムにも存在する。\n"
9734 "代わりに、標準化されている B<sched_yield>(2) を使うこと。"
9735
9736 #. type: Plain text
9737 #: build/C/man3/pthread_yield.3:62
9738 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
9739 msgstr ""
9740 "Linux では、この関数は B<sched_yield>(2) を呼び出す形で実装されている。"
9741
9742 #. type: Plain text
9743 #: build/C/man3/pthread_yield.3:66
9744 msgid "B<sched_setscheduler>(2), B<sched_yield>(2), B<pthreads>(7)"
9745 msgstr "B<sched_setscheduler>(2), B<sched_yield>(2), B<pthreads>(7)"
9746
9747 #. type: TH
9748 #: build/C/man7/pthreads.7:26
9749 #, no-wrap
9750 msgid "PTHREADS"
9751 msgstr "PTHREADS"
9752
9753 #. type: TH
9754 #: build/C/man7/pthreads.7:26
9755 #, no-wrap
9756 msgid "2010-11-14"
9757 msgstr "2010-11-14"
9758
9759 #. type: Plain text
9760 #: build/C/man7/pthreads.7:29
9761 msgid "pthreads - POSIX threads"
9762 msgstr "pthreads - POSIX スレッド"
9763
9764 #. type: Plain text
9765 #: build/C/man7/pthreads.7:36
9766 msgid ""
9767 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
9768 "programming commonly known as POSIX threads, or Pthreads.  A single process "
9769 "can contain multiple threads, all of which are executing the same program.  "
9770 "These threads share the same global memory (data and heap segments), but "
9771 "each thread has its own stack (automatic variables)."
9772 msgstr ""
9773 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
9774 "ラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロ"
9775 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
9776 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
9777 "スレッドは自分専用のスタック (自動変数) を持つ。"
9778
9779 #. type: Plain text
9780 #: build/C/man7/pthreads.7:39
9781 msgid ""
9782 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
9783 "these attributes are process-wide rather than per-thread):"
9784 msgstr ""
9785 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
9786 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
9787
9788 #. type: IP
9789 #: build/C/man7/pthreads.7:39 build/C/man7/pthreads.7:41
9790 #: build/C/man7/pthreads.7:43 build/C/man7/pthreads.7:45
9791 #: build/C/man7/pthreads.7:47 build/C/man7/pthreads.7:49
9792 #: build/C/man7/pthreads.7:51 build/C/man7/pthreads.7:54
9793 #: build/C/man7/pthreads.7:56 build/C/man7/pthreads.7:59
9794 #: build/C/man7/pthreads.7:65 build/C/man7/pthreads.7:70
9795 #: build/C/man7/pthreads.7:73 build/C/man7/pthreads.7:76
9796 #: build/C/man7/pthreads.7:84 build/C/man7/pthreads.7:88
9797 #: build/C/man7/pthreads.7:91 build/C/man7/pthreads.7:95
9798 #: build/C/man7/pthreads.7:98 build/C/man7/pthreads.7:105
9799 #: build/C/man7/pthreads.7:108 build/C/man7/pthreads.7:685
9800 #: build/C/man7/pthreads.7:692 build/C/man7/pthreads.7:704
9801 #: build/C/man7/pthreads.7:714 build/C/man7/pthreads.7:718
9802 #: build/C/man7/pthreads.7:727 build/C/man7/pthreads.7:737
9803 #: build/C/man7/pthreads.7:744 build/C/man7/pthreads.7:751
9804 #: build/C/man7/pthreads.7:753 build/C/man7/pthreads.7:756
9805 #: build/C/man7/pthreads.7:762 build/C/man7/pthreads.7:765
9806 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:769
9807 #: build/C/man7/pthreads.7:779 build/C/man7/pthreads.7:799
9808 #: build/C/man7/pthreads.7:808 build/C/man7/pthreads.7:814
9809 #: build/C/man7/pthreads.7:816 build/C/man7/pthreads.7:818
9810 #: build/C/man7/pthreads.7:822 build/C/man7/pthreads.7:827
9811 #: build/C/man7/pthreads.7:835
9812 #, no-wrap
9813 msgid "-"
9814 msgstr "-"
9815
9816 #. type: Plain text
9817 #: build/C/man7/pthreads.7:41
9818 msgid "process ID"
9819 msgstr "プロセス ID"
9820
9821 #. type: Plain text
9822 #: build/C/man7/pthreads.7:43
9823 msgid "parent process ID"
9824 msgstr "親プロセス ID"
9825
9826 #. type: Plain text
9827 #: build/C/man7/pthreads.7:45
9828 msgid "process group ID and session ID"
9829 msgstr "プロセスグループ ID とセッション ID"
9830
9831 #. type: Plain text
9832 #: build/C/man7/pthreads.7:47
9833 msgid "controlling terminal"
9834 msgstr "制御端末"
9835
9836 #. type: Plain text
9837 #: build/C/man7/pthreads.7:49
9838 msgid "user and group IDs"
9839 msgstr "ユーザ ID とグループ ID"
9840
9841 #. type: Plain text
9842 #: build/C/man7/pthreads.7:51
9843 msgid "open file descriptors"
9844 msgstr "オープンするファイルディスクリプタ"
9845
9846 #. type: Plain text
9847 #: build/C/man7/pthreads.7:54
9848 msgid "record locks (see B<fcntl>(2))"
9849 msgstr "レコードのロック (B<fcntl>(3)  参照)"
9850
9851 #. type: Plain text
9852 #: build/C/man7/pthreads.7:56
9853 msgid "signal dispositions"
9854 msgstr "シグナルの配置"
9855
9856 #. type: Plain text
9857 #: build/C/man7/pthreads.7:59
9858 msgid "file mode creation mask (B<umask>(2))"
9859 msgstr "ファイルモード作成マスク (B<umask>(2))"
9860
9861 #. type: Plain text
9862 #: build/C/man7/pthreads.7:65
9863 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
9864 msgstr ""
9865 "カレント・ディレクトリ (B<chdir>(2))  とルート・ディレクトリ (B<chroot>(2))"
9866
9867 #. type: Plain text
9868 #: build/C/man7/pthreads.7:70
9869 msgid ""
9870 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
9871 msgstr ""
9872 "インターバル・タイマ (B<setitimer>(2))  と POSIX タイマ (B<timer_create>(2))"
9873
9874 #. type: Plain text
9875 #: build/C/man7/pthreads.7:73
9876 msgid "nice value (B<setpriority>(2))"
9877 msgstr "nice 値 (B<setpriority>(2))"
9878
9879 #. type: Plain text
9880 #: build/C/man7/pthreads.7:76
9881 msgid "resource limits (B<setrlimit>(2))"
9882 msgstr "リソース制限 (B<setrlimit>(2))"
9883
9884 #. type: Plain text
9885 #: build/C/man7/pthreads.7:81
9886 msgid ""
9887 "measurements of the consumption of CPU time (B<times>(2))  and resources "
9888 "(B<getrusage>(2))"
9889 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
9890
9891 #. type: Plain text
9892 #: build/C/man7/pthreads.7:84
9893 msgid ""
9894 "As well as the stack, POSIX.1 specifies that various other attributes are "
9895 "distinct for each thread, including:"
9896 msgstr ""
9897 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
9898 "るかを規定している:"
9899
9900 #. type: Plain text
9901 #: build/C/man7/pthreads.7:88
9902 msgid "thread ID (the I<pthread_t> data type)"
9903 msgstr "スレッド ID (B<pthread_t> データ型)"
9904
9905 #. type: Plain text
9906 #: build/C/man7/pthreads.7:91
9907 msgid "signal mask (B<pthread_sigmask>(3))"
9908 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
9909
9910 #. type: Plain text
9911 #: build/C/man7/pthreads.7:95
9912 msgid "the I<errno> variable"
9913 msgstr "I<errno> 変数"
9914
9915 #. type: Plain text
9916 #: build/C/man7/pthreads.7:98
9917 msgid "alternate signal stack (B<sigaltstack>(2))"
9918 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
9919
9920 #. type: Plain text
9921 #: build/C/man7/pthreads.7:103
9922 msgid ""
9923 "real-time scheduling policy and priority (B<sched_setscheduler>(2)  and "
9924 "B<sched_setparam>(2))"
9925 msgstr ""
9926 "リアルタイム・スケジューリングのポリシーと優先度 (B<sched_setscheduler>(2)  "
9927 "と B<sched_setparam>(2))"
9928
9929 #. type: Plain text
9930 #: build/C/man7/pthreads.7:105
9931 msgid "The following Linux-specific features are also per-thread:"
9932 msgstr "以下の Linux 特有の機能もスレッド単位である:"
9933
9934 #. type: Plain text
9935 #: build/C/man7/pthreads.7:108
9936 msgid "capabilities (see B<capabilities>(7))"
9937 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
9938
9939 #. type: Plain text
9940 #: build/C/man7/pthreads.7:111
9941 msgid "CPU affinity (B<sched_setaffinity>(2))"
9942 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
9943
9944 #. type: SS
9945 #: build/C/man7/pthreads.7:111
9946 #, no-wrap
9947 msgid "Pthreads function return values"
9948 msgstr "pthreads 関数の返り値"
9949
9950 #. type: Plain text
9951 #: build/C/man7/pthreads.7:118
9952 msgid ""
9953 "Most pthreads functions return 0 on success, and an error number of "
9954 "failure.  Note that the pthreads functions do not set I<errno>.  For each of "
9955 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
9956 "the function can never fail with the error B<EINTR>."
9957 msgstr ""
9958 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
9959 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
9960 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
9961 "は決してないと規定している。"
9962
9963 #. type: SS
9964 #: build/C/man7/pthreads.7:118
9965 #, no-wrap
9966 msgid "Thread IDs"
9967 msgstr "スレッド ID"
9968
9969 #. type: Plain text
9970 #: build/C/man7/pthreads.7:132
9971 msgid ""
9972 "Each of the threads in a process has a unique thread identifier (stored in "
9973 "the type I<pthread_t>).  This identifier is returned to the caller of "
9974 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
9975 "using B<pthread_self>(3).  Thread IDs are guaranteed to be unique only "
9976 "within a process.  A thread ID may be reused after a terminated thread has "
9977 "been joined, or a detached thread has terminated.  In all pthreads functions "
9978 "that accept a thread ID as an argument, that ID by definition refers to a "
9979 "thread in the same process as the caller."
9980 msgstr ""
9981 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
9982 "つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、ス"
9983 "レッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 ス"
9984 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
9985 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
9986 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
9987 "じプロセス内の一つのスレッドを参照する。"
9988
9989 #. type: SS
9990 #: build/C/man7/pthreads.7:132
9991 #, no-wrap
9992 msgid "Thread-safe functions"
9993 msgstr "スレッドセーフな関数"
9994
9995 #. type: Plain text
9996 #: build/C/man7/pthreads.7:136
9997 msgid ""
9998 "A thread-safe function is one that can be safely (i.e., it will deliver the "
9999 "same results regardless of whether it is)  called from multiple threads at "
10000 "the same time."
10001 msgstr ""
10002 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
10003 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
10004
10005 #. type: Plain text
10006 #: build/C/man7/pthreads.7:140
10007 msgid ""
10008 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
10009 "standard shall be thread-safe, except for the following functions:"
10010 msgstr ""
10011 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
10012 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
10013
10014 #. type: Plain text
10015 #: build/C/man7/pthreads.7:234
10016 #, no-wrap
10017 msgid ""
10018 "asctime()\n"
10019 "basename()\n"
10020 "catgets()\n"
10021 "crypt()\n"
10022 "ctermid() if passed a non-NULL argument\n"
10023 "ctime()\n"
10024 "dbm_clearerr()\n"
10025 "dbm_close()\n"
10026 "dbm_delete()\n"
10027 "dbm_error()\n"
10028 "dbm_fetch()\n"
10029 "dbm_firstkey()\n"
10030 "dbm_nextkey()\n"
10031 "dbm_open()\n"
10032 "dbm_store()\n"
10033 "dirname()\n"
10034 "dlerror()\n"
10035 "drand48()\n"
10036 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10037 "encrypt()\n"
10038 "endgrent()\n"
10039 "endpwent()\n"
10040 "endutxent()\n"
10041 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10042 "ftw()\n"
10043 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10044 "getc_unlocked()\n"
10045 "getchar_unlocked()\n"
10046 "getdate()\n"
10047 "getenv()\n"
10048 "getgrent()\n"
10049 "getgrgid()\n"
10050 "getgrnam()\n"
10051 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10052 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10053 "gethostent()\n"
10054 "getlogin()\n"
10055 "getnetbyaddr()\n"
10056 "getnetbyname()\n"
10057 "getnetent()\n"
10058 "getopt()\n"
10059 "getprotobyname()\n"
10060 "getprotobynumber()\n"
10061 "getprotoent()\n"
10062 "getpwent()\n"
10063 "getpwnam()\n"
10064 "getpwuid()\n"
10065 "getservbyname()\n"
10066 "getservbyport()\n"
10067 "getservent()\n"
10068 "getutxent()\n"
10069 "getutxid()\n"
10070 "getutxline()\n"
10071 "gmtime()\n"
10072 "hcreate()\n"
10073 "hdestroy()\n"
10074 "hsearch()\n"
10075 "inet_ntoa()\n"
10076 "l64a()\n"
10077 "lgamma()\n"
10078 "lgammaf()\n"
10079 "lgammal()\n"
10080 "localeconv()\n"
10081 "localtime()\n"
10082 "lrand48()\n"
10083 "mrand48()\n"
10084 "nftw()\n"
10085 "nl_langinfo()\n"
10086 "ptsname()\n"
10087 "putc_unlocked()\n"
10088 "putchar_unlocked()\n"
10089 "putenv()\n"
10090 "pututxline()\n"
10091 "rand()\n"
10092 "readdir()\n"
10093 "setenv()\n"
10094 "setgrent()\n"
10095 "setkey()\n"
10096 "setpwent()\n"
10097 "setutxent()\n"
10098 "strerror()\n"
10099 "strsignal() [Added in POSIX.1-2008]\n"
10100 "strtok()\n"
10101 "system() [Added in POSIX.1-2008]\n"
10102 "tmpnam() if passed a non-NULL argument\n"
10103 "ttyname()\n"
10104 "unsetenv()\n"
10105 "wcrtomb() if its final argument is NULL\n"
10106 "wcsrtombs() if its final argument is NULL\n"
10107 "wcstombs()\n"
10108 "wctomb()\n"
10109 msgstr ""
10110 "asctime()\n"
10111 "basename()\n"
10112 "catgets()\n"
10113 "crypt()\n"
10114 "ctermid() (NULL でない引き数を渡された場合)\n"
10115 "ctime()\n"
10116 "dbm_clearerr()\n"
10117 "dbm_close()\n"
10118 "dbm_delete()\n"
10119 "dbm_error()\n"
10120 "dbm_fetch()\n"
10121 "dbm_firstkey()\n"
10122 "dbm_nextkey()\n"
10123 "dbm_open()\n"
10124 "dbm_store()\n"
10125 "dirname()\n"
10126 "dlerror()\n"
10127 "drand48()\n"
10128 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10129 "encrypt()\n"
10130 "endgrent()\n"
10131 "endpwent()\n"
10132 "endutxent()\n"
10133 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10134 "ftw()\n"
10135 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10136 "getc_unlocked()\n"
10137 "getchar_unlocked()\n"
10138 "getdate()\n"
10139 "getenv()\n"
10140 "getgrent()\n"
10141 "getgrgid()\n"
10142 "getgrnam()\n"
10143 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10144 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10145 "gethostent()\n"
10146 "getlogin()\n"
10147 "getnetbyaddr()\n"
10148 "getnetbyname()\n"
10149 "getnetent()\n"
10150 "getopt()\n"
10151 "getprotobyname()\n"
10152 "getprotobynumber()\n"
10153 "getprotoent()\n"
10154 "getpwent()\n"
10155 "getpwnam()\n"
10156 "getpwuid()\n"
10157 "getservbyname()\n"
10158 "getservbyport()\n"
10159 "getservent()\n"
10160 "getutxent()\n"
10161 "getutxid()\n"
10162 "getutxline()\n"
10163 "gmtime()\n"
10164 "hcreate()\n"
10165 "hdestroy()\n"
10166 "hsearch()\n"
10167 "inet_ntoa()\n"
10168 "l64a()\n"
10169 "lgamma()\n"
10170 "lgammaf()\n"
10171 "lgammal()\n"
10172 "localeconv()\n"
10173 "localtime()\n"
10174 "lrand48()\n"
10175 "mrand48()\n"
10176 "nftw()\n"
10177 "nl_langinfo()\n"
10178 "ptsname()\n"
10179 "putc_unlocked()\n"
10180 "putchar_unlocked()\n"
10181 "putenv()\n"
10182 "pututxline()\n"
10183 "rand()\n"
10184 "readdir()\n"
10185 "setenv()\n"
10186 "setgrent()\n"
10187 "setkey()\n"
10188 "setpwent()\n"
10189 "setutxent()\n"
10190 "strerror()\n"
10191 "strsignal() [POSIX.1-2008 で追加された]\n"
10192 "strtok()\n"
10193 "system() [POSIX.1-2008 で追加された]\n"
10194 "tmpnam() (NULL でない引き数を渡された場合)\n"
10195 "ttyname()\n"
10196 "unsetenv()\n"
10197 "wcrtomb() (最後の引き数が NULL の場合)\n"
10198 "wcsrtombs() (最後の引き数が NULL の場合)\n"
10199 "wcstombs()\n"
10200 "wctomb()\n"
10201
10202 #. type: SS
10203 #: build/C/man7/pthreads.7:236
10204 #, no-wrap
10205 msgid "Async-cancel-safe functions"
10206 msgstr "async-cancel-safe 関数"
10207
10208 #. type: Plain text
10209 #: build/C/man7/pthreads.7:240
10210 msgid ""
10211 "An async-cancel-safe function is one that can be safely called in an "
10212 "application where asynchronous cancelability is enabled (see "
10213 "B<pthread_setcancelstate>(3))."
10214 msgstr ""
10215 "async-cancel-safe 関数は、\n"
10216 "非同期キャンセル機能が有効になっているアプリケーションで\n"
10217 "安全に呼び出すことができる関数のことである\n"
10218 "(B<pthread_setcancelstate>(3) を参照)。"
10219
10220 #. type: Plain text
10221 #: build/C/man7/pthreads.7:243
10222 msgid ""
10223 "Only the following functions are required to be async-cancel-safe by "
10224 "POSIX.1-2001 and POSIX.1-2008:"
10225 msgstr ""
10226 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
10227 "なければならないとされている。"
10228
10229 #. type: Plain text
10230 #: build/C/man7/pthreads.7:249
10231 #, no-wrap
10232 msgid ""
10233 "pthread_cancel()\n"
10234 "pthread_setcancelstate()\n"
10235 "pthread_setcanceltype()\n"
10236 msgstr ""
10237 "pthread_cancel()\n"
10238 "pthread_setcancelstate()\n"
10239 "pthread_setcanceltype()\n"
10240
10241 #. type: SS
10242 #: build/C/man7/pthreads.7:251
10243 #, no-wrap
10244 msgid "Cancellation points"
10245 msgstr "取り消しポイント (cancellation points)"
10246
10247 #. type: Plain text
10248 #: build/C/man7/pthreads.7:258
10249 msgid ""
10250 "POSIX.1 specifies that certain functions must, and certain other functions "
10251 "may, be cancellation points.  If a thread is cancelable, its cancelability "
10252 "type is deferred, and a cancellation request is pending for the thread, then "
10253 "the thread is canceled when it calls a function that is a cancellation point."
10254 msgstr ""
10255 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
10256 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
10257 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
10258 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
10259 "時点で、そのスレッドのキャンセルが 行われる。"
10260
10261 #. type: Plain text
10262 #: build/C/man7/pthreads.7:261
10263 msgid ""
10264 "The following functions are required to be cancellation points by "
10265 "POSIX.1-2001 and/or POSIX.1-2008:"
10266 msgstr ""
10267 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
10268 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
10269
10270 #. type: Plain text
10271 #: build/C/man7/pthreads.7:324
10272 #, no-wrap
10273 msgid ""
10274 "accept()\n"
10275 "aio_suspend()\n"
10276 "clock_nanosleep()\n"
10277 "close()\n"
10278 "connect()\n"
10279 "creat()\n"
10280 "fcntl() F_SETLKW\n"
10281 "fdatasync()\n"
10282 "fsync()\n"
10283 "getmsg()\n"
10284 "getpmsg()\n"
10285 "lockf() F_LOCK\n"
10286 "mq_receive()\n"
10287 "mq_send()\n"
10288 "mq_timedreceive()\n"
10289 "mq_timedsend()\n"
10290 "msgrcv()\n"
10291 "msgsnd()\n"
10292 "msync()\n"
10293 "nanosleep()\n"
10294 "open()\n"
10295 "openat() [Added in POSIX.1-2008]\n"
10296 "pause()\n"
10297 "poll()\n"
10298 "pread()\n"
10299 "pselect()\n"
10300 "pthread_cond_timedwait()\n"
10301 "pthread_cond_wait()\n"
10302 "pthread_join()\n"
10303 "pthread_testcancel()\n"
10304 "putmsg()\n"
10305 "putpmsg()\n"
10306 "pwrite()\n"
10307 "read()\n"
10308 "readv()\n"
10309 "recv()\n"
10310 "recvfrom()\n"
10311 "recvmsg()\n"
10312 "select()\n"
10313 "sem_timedwait()\n"
10314 "sem_wait()\n"
10315 "send()\n"
10316 "sendmsg()\n"
10317 "sendto()\n"
10318 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
10319 "sigsuspend()\n"
10320 "sigtimedwait()\n"
10321 "sigwait()\n"
10322 "sigwaitinfo()\n"
10323 "sleep()\n"
10324 "system()\n"
10325 "tcdrain()\n"
10326 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
10327 "wait()\n"
10328 "waitid()\n"
10329 "waitpid()\n"
10330 "write()\n"
10331 "writev()\n"
10332 msgstr ""
10333 "accept()\n"
10334 "aio_suspend()\n"
10335 "clock_nanosleep()\n"
10336 "close()\n"
10337 "connect()\n"
10338 "creat()\n"
10339 "fcntl() F_SETLKW\n"
10340 "fdatasync()\n"
10341 "fsync()\n"
10342 "getmsg()\n"
10343 "getpmsg()\n"
10344 "lockf() F_LOCK\n"
10345 "mq_receive()\n"
10346 "mq_send()\n"
10347 "mq_timedreceive()\n"
10348 "mq_timedsend()\n"
10349 "msgrcv()\n"
10350 "msgsnd()\n"
10351 "msync()\n"
10352 "nanosleep()\n"
10353 "open()\n"
10354 "openat() [POSIX.1-2008 で追加された]\n"
10355 "pause()\n"
10356 "poll()\n"
10357 "pread()\n"
10358 "pselect()\n"
10359 "pthread_cond_timedwait()\n"
10360 "pthread_cond_wait()\n"
10361 "pthread_join()\n"
10362 "pthread_testcancel()\n"
10363 "putmsg()\n"
10364 "putpmsg()\n"
10365 "pwrite()\n"
10366 "read()\n"
10367 "readv()\n"
10368 "recv()\n"
10369 "recvfrom()\n"
10370 "recvmsg()\n"
10371 "select()\n"
10372 "sem_timedwait()\n"
10373 "sem_wait()\n"
10374 "send()\n"
10375 "sendmsg()\n"
10376 "sendto()\n"
10377 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
10378 "sigsuspend()\n"
10379 "sigtimedwait()\n"
10380 "sigwait()\n"
10381 "sigwaitinfo()\n"
10382 "sleep()\n"
10383 "system()\n"
10384 "tcdrain()\n"
10385 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
10386 "wait()\n"
10387 "waitid()\n"
10388 "waitpid()\n"
10389 "write()\n"
10390 "writev()\n"
10391
10392 #. type: Plain text
10393 #: build/C/man7/pthreads.7:329
10394 msgid ""
10395 "The following functions may be cancellation points according to POSIX.1-2001 "
10396 "and/or POSIX.1-2008:"
10397 msgstr ""
10398 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
10399 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
10400
10401 #. type: Plain text
10402 #: build/C/man7/pthreads.7:557
10403 #, no-wrap
10404 msgid ""
10405 "access()\n"
10406 "asctime()\n"
10407 "asctime_r()\n"
10408 "catclose()\n"
10409 "catgets()\n"
10410 "catopen()\n"
10411 "chmod() [Added in POSIX.1-2008]\n"
10412 "chown() [Added in POSIX.1-2008]\n"
10413 "closedir()\n"
10414 "closelog()\n"
10415 "ctermid()\n"
10416 "ctime()\n"
10417 "ctime_r()\n"
10418 "dbm_close()\n"
10419 "dbm_delete()\n"
10420 "dbm_fetch()\n"
10421 "dbm_nextkey()\n"
10422 "dbm_open()\n"
10423 "dbm_store()\n"
10424 "dlclose()\n"
10425 "dlopen()\n"
10426 "dprintf() [Added in POSIX.1-2008]\n"
10427 "endgrent()\n"
10428 "endhostent()\n"
10429 "endnetent()\n"
10430 "endprotoent()\n"
10431 "endpwent()\n"
10432 "endservent()\n"
10433 "endutxent()\n"
10434 "faccessat() [Added in POSIX.1-2008]\n"
10435 "fchmod() [Added in POSIX.1-2008]\n"
10436 "fchmodat() [Added in POSIX.1-2008]\n"
10437 "fchown() [Added in POSIX.1-2008]\n"
10438 "fchownat() [Added in POSIX.1-2008]\n"
10439 "fclose()\n"
10440 "fcntl() (for any value of cmd argument)\n"
10441 "fflush()\n"
10442 "fgetc()\n"
10443 "fgetpos()\n"
10444 "fgets()\n"
10445 "fgetwc()\n"
10446 "fgetws()\n"
10447 "fmtmsg()\n"
10448 "fopen()\n"
10449 "fpathconf()\n"
10450 "fprintf()\n"
10451 "fputc()\n"
10452 "fputs()\n"
10453 "fputwc()\n"
10454 "fputws()\n"
10455 "fread()\n"
10456 "freopen()\n"
10457 "fscanf()\n"
10458 "fseek()\n"
10459 "fseeko()\n"
10460 "fsetpos()\n"
10461 "fstat()\n"
10462 "fstatat() [Added in POSIX.1-2008]\n"
10463 "ftell()\n"
10464 "ftello()\n"
10465 "ftw()\n"
10466 "futimens() [Added in POSIX.1-2008]\n"
10467 "fwprintf()\n"
10468 "fwrite()\n"
10469 "fwscanf()\n"
10470 "getaddrinfo()\n"
10471 "getc()\n"
10472 "getc_unlocked()\n"
10473 "getchar()\n"
10474 "getchar_unlocked()\n"
10475 "getcwd()\n"
10476 "getdate()\n"
10477 "getdelim() [Added in POSIX.1-2008]\n"
10478 "getgrent()\n"
10479 "getgrgid()\n"
10480 "getgrgid_r()\n"
10481 "getgrnam()\n"
10482 "getgrnam_r()\n"
10483 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10484 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10485 "gethostent()\n"
10486 "gethostid()\n"
10487 "gethostname()\n"
10488 "getline() [Added in POSIX.1-2008]\n"
10489 "getlogin()\n"
10490 "getlogin_r()\n"
10491 "getnameinfo()\n"
10492 "getnetbyaddr()\n"
10493 "getnetbyname()\n"
10494 "getnetent()\n"
10495 "getopt() (if opterr is nonzero)\n"
10496 "getprotobyname()\n"
10497 "getprotobynumber()\n"
10498 "getprotoent()\n"
10499 "getpwent()\n"
10500 "getpwnam()\n"
10501 "getpwnam_r()\n"
10502 "getpwuid()\n"
10503 "getpwuid_r()\n"
10504 "gets()\n"
10505 "getservbyname()\n"
10506 "getservbyport()\n"
10507 "getservent()\n"
10508 "getutxent()\n"
10509 "getutxid()\n"
10510 "getutxline()\n"
10511 "getwc()\n"
10512 "getwchar()\n"
10513 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
10514 "glob()\n"
10515 "iconv_close()\n"
10516 "iconv_open()\n"
10517 "ioctl()\n"
10518 "link()\n"
10519 "linkat() [Added in POSIX.1-2008]\n"
10520 "lio_listio() [Added in POSIX.1-2008]\n"
10521 "localtime()\n"
10522 "localtime_r()\n"
10523 "lockf() [Added in POSIX.1-2008]\n"
10524 "lseek()\n"
10525 "lstat()\n"
10526 "mkdir() [Added in POSIX.1-2008]\n"
10527 "mkdirat() [Added in POSIX.1-2008]\n"
10528 "mkdtemp() [Added in POSIX.1-2008]\n"
10529 "mkfifo() [Added in POSIX.1-2008]\n"
10530 "mkfifoat() [Added in POSIX.1-2008]\n"
10531 "mknod() [Added in POSIX.1-2008]\n"
10532 "mknodat() [Added in POSIX.1-2008]\n"
10533 "mkstemp()\n"
10534 "mktime()\n"
10535 "nftw()\n"
10536 "opendir()\n"
10537 "openlog()\n"
10538 "pathconf()\n"
10539 "pclose()\n"
10540 "perror()\n"
10541 "popen()\n"
10542 "posix_fadvise()\n"
10543 "posix_fallocate()\n"
10544 "posix_madvise()\n"
10545 "posix_openpt()\n"
10546 "posix_spawn()\n"
10547 "posix_spawnp()\n"
10548 "posix_trace_clear()\n"
10549 "posix_trace_close()\n"
10550 "posix_trace_create()\n"
10551 "posix_trace_create_withlog()\n"
10552 "posix_trace_eventtypelist_getnext_id()\n"
10553 "posix_trace_eventtypelist_rewind()\n"
10554 "posix_trace_flush()\n"
10555 "posix_trace_get_attr()\n"
10556 "posix_trace_get_filter()\n"
10557 "posix_trace_get_status()\n"
10558 "posix_trace_getnext_event()\n"
10559 "posix_trace_open()\n"
10560 "posix_trace_rewind()\n"
10561 "posix_trace_set_filter()\n"
10562 "posix_trace_shutdown()\n"
10563 "posix_trace_timedgetnext_event()\n"
10564 "posix_typed_mem_open()\n"
10565 "printf()\n"
10566 "psiginfo() [Added in POSIX.1-2008]\n"
10567 "psignal() [Added in POSIX.1-2008]\n"
10568 "pthread_rwlock_rdlock()\n"
10569 "pthread_rwlock_timedrdlock()\n"
10570 "pthread_rwlock_timedwrlock()\n"
10571 "pthread_rwlock_wrlock()\n"
10572 "putc()\n"
10573 "putc_unlocked()\n"
10574 "putchar()\n"
10575 "putchar_unlocked()\n"
10576 "puts()\n"
10577 "pututxline()\n"
10578 "putwc()\n"
10579 "putwchar()\n"
10580 "readdir()\n"
10581 "readdir_r()\n"
10582 "readlink() [Added in POSIX.1-2008]\n"
10583 "readlinkat() [Added in POSIX.1-2008]\n"
10584 "remove()\n"
10585 "rename()\n"
10586 "renameat() [Added in POSIX.1-2008]\n"
10587 "rewind()\n"
10588 "rewinddir()\n"
10589 "scandir() [Added in POSIX.1-2008]\n"
10590 "scanf()\n"
10591 "seekdir()\n"
10592 "semop()\n"
10593 "setgrent()\n"
10594 "sethostent()\n"
10595 "setnetent()\n"
10596 "setprotoent()\n"
10597 "setpwent()\n"
10598 "setservent()\n"
10599 "setutxent()\n"
10600 "sigpause() [Added in POSIX.1-2008]\n"
10601 "stat()\n"
10602 "strerror()\n"
10603 "strerror_r()\n"
10604 "strftime()\n"
10605 "symlink()\n"
10606 "symlinkat() [Added in POSIX.1-2008]\n"
10607 "sync()\n"
10608 "syslog()\n"
10609 "tmpfile()\n"
10610 "tmpnam()\n"
10611 "ttyname()\n"
10612 "ttyname_r()\n"
10613 "tzset()\n"
10614 "ungetc()\n"
10615 "ungetwc()\n"
10616 "unlink()\n"
10617 "unlinkat() [Added in POSIX.1-2008]\n"
10618 "utime() [Added in POSIX.1-2008]\n"
10619 "utimensat() [Added in POSIX.1-2008]\n"
10620 "utimes() [Added in POSIX.1-2008]\n"
10621 "vdprintf() [Added in POSIX.1-2008]\n"
10622 "vfprintf()\n"
10623 "vfwprintf()\n"
10624 "vprintf()\n"
10625 "vwprintf()\n"
10626 "wcsftime()\n"
10627 "wordexp()\n"
10628 "wprintf()\n"
10629 "wscanf()\n"
10630 msgstr ""
10631 "access()\n"
10632 "asctime()\n"
10633 "asctime_r()\n"
10634 "catclose()\n"
10635 "catgets()\n"
10636 "catopen()\n"
10637 "chmod() [POSIX.1-2008 で追加された]\n"
10638 "chown() [POSIX.1-2008 で追加された]\n"
10639 "closedir()\n"
10640 "closelog()\n"
10641 "ctermid()\n"
10642 "ctime()\n"
10643 "ctime_r()\n"
10644 "dbm_close()\n"
10645 "dbm_delete()\n"
10646 "dbm_fetch()\n"
10647 "dbm_nextkey()\n"
10648 "dbm_open()\n"
10649 "dbm_store()\n"
10650 "dlclose()\n"
10651 "dlopen()\n"
10652 "dprintf() [POSIX.1-2008 で追加された]\n"
10653 "endgrent()\n"
10654 "endhostent()\n"
10655 "endnetent()\n"
10656 "endprotoent()\n"
10657 "endpwent()\n"
10658 "endservent()\n"
10659 "endutxent()\n"
10660 "faccessat() [POSIX.1-2008 で追加された]\n"
10661 "fchmod() [POSIX.1-2008 で追加された]\n"
10662 "fchmodat() [POSIX.1-2008 で追加された]\n"
10663 "fchown() [POSIX.1-2008 で追加された]\n"
10664 "fchownat() [POSIX.1-2008 で追加された]\n"
10665 "fclose()\n"
10666 "fcntl() (cmd 引き数が何であっても)\n"
10667 "fflush()\n"
10668 "fgetc()\n"
10669 "fgetpos()\n"
10670 "fgets()\n"
10671 "fgetwc()\n"
10672 "fgetws()\n"
10673 "fmtmsg()\n"
10674 "fopen()\n"
10675 "fpathconf()\n"
10676 "fprintf()\n"
10677 "fputc()\n"
10678 "fputs()\n"
10679 "fputwc()\n"
10680 "fputws()\n"
10681 "fread()\n"
10682 "freopen()\n"
10683 "fscanf()\n"
10684 "fseek()\n"
10685 "fseeko()\n"
10686 "fsetpos()\n"
10687 "fstat()\n"
10688 "fstatat() [POSIX.1-2008 で追加された]\n"
10689 "ftell()\n"
10690 "ftello()\n"
10691 "ftw()\n"
10692 "futimens() [POSIX.1-2008 で追加された]\n"
10693 "fwprintf()\n"
10694 "fwrite()\n"
10695 "fwscanf()\n"
10696 "getaddrinfo()\n"
10697 "getc()\n"
10698 "getc_unlocked()\n"
10699 "getchar()\n"
10700 "getchar_unlocked()\n"
10701 "getcwd()\n"
10702 "getdate()\n"
10703 "getdelim() [POSIX.1-2008 で追加された]\n"
10704 "getgrent()\n"
10705 "getgrgid()\n"
10706 "getgrgid_r()\n"
10707 "getgrnam()\n"
10708 "getgrnam_r()\n"
10709 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
10710 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
10711 "gethostent()\n"
10712 "gethostid()\n"
10713 "gethostname()\n"
10714 "getline() [POSIX.1-2008 で追加された]\n"
10715 "getlogin()\n"
10716 "getlogin_r()\n"
10717 "getnameinfo()\n"
10718 "getnetbyaddr()\n"
10719 "getnetbyname()\n"
10720 "getnetent()\n"
10721 "getopt() (opterr が 0 以外の場合)\n"
10722 "getprotobyname()\n"
10723 "getprotobynumber()\n"
10724 "getprotoent()\n"
10725 "getpwent()\n"
10726 "getpwnam()\n"
10727 "getpwnam_r()\n"
10728 "getpwuid()\n"
10729 "getpwuid_r()\n"
10730 "gets()\n"
10731 "getservbyname()\n"
10732 "getservbyport()\n"
10733 "getservent()\n"
10734 "getutxent()\n"
10735 "getutxid()\n"
10736 "getutxline()\n"
10737 "getwc()\n"
10738 "getwchar()\n"
10739 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
10740 "glob()\n"
10741 "iconv_close()\n"
10742 "iconv_open()\n"
10743 "ioctl()\n"
10744 "link()\n"
10745 "linkat() [POSIX.1-2008 で追加された]\n"
10746 "lio_listio() [POSIX.1-2008 で追加された]\n"
10747 "localtime()\n"
10748 "localtime_r()\n"
10749 "lockf() [POSIX.1-2008 で追加された]\n"
10750 "lseek()\n"
10751 "lstat()\n"
10752 "mkdir() [POSIX.1-2008 で追加された]\n"
10753 "mkdirat() [POSIX.1-2008 で追加された]\n"
10754 "mkdtemp() [POSIX.1-2008 で追加された]\n"
10755 "mkfifo() [POSIX.1-2008 で追加された]\n"
10756 "mkfifoat() [POSIX.1-2008 で追加された]\n"
10757 "mknod() [POSIX.1-2008 で追加された]\n"
10758 "mknodat() [POSIX.1-2008 で追加された]\n"
10759 "mkstemp()\n"
10760 "mktime()\n"
10761 "nftw()\n"
10762 "opendir()\n"
10763 "openlog()\n"
10764 "pathconf()\n"
10765 "pclose()\n"
10766 "perror()\n"
10767 "popen()\n"
10768 "posix_fadvise()\n"
10769 "posix_fallocate()\n"
10770 "posix_madvise()\n"
10771 "posix_openpt()\n"
10772 "posix_spawn()\n"
10773 "posix_spawnp()\n"
10774 "posix_trace_clear()\n"
10775 "posix_trace_close()\n"
10776 "posix_trace_create()\n"
10777 "posix_trace_create_withlog()\n"
10778 "posix_trace_eventtypelist_getnext_id()\n"
10779 "posix_trace_eventtypelist_rewind()\n"
10780 "posix_trace_flush()\n"
10781 "posix_trace_get_attr()\n"
10782 "posix_trace_get_filter()\n"
10783 "posix_trace_get_status()\n"
10784 "posix_trace_getnext_event()\n"
10785 "posix_trace_open()\n"
10786 "posix_trace_rewind()\n"
10787 "posix_trace_set_filter()\n"
10788 "posix_trace_shutdown()\n"
10789 "posix_trace_timedgetnext_event()\n"
10790 "posix_typed_mem_open()\n"
10791 "printf()\n"
10792 "psiginfo() [POSIX.1-2008 で追加された]\n"
10793 "psignal() [POSIX.1-2008 で追加された]\n"
10794 "pthread_rwlock_rdlock()\n"
10795 "pthread_rwlock_timedrdlock()\n"
10796 "pthread_rwlock_timedwrlock()\n"
10797 "pthread_rwlock_wrlock()\n"
10798 "putc()\n"
10799 "putc_unlocked()\n"
10800 "putchar()\n"
10801 "putchar_unlocked()\n"
10802 "puts()\n"
10803 "pututxline()\n"
10804 "putwc()\n"
10805 "putwchar()\n"
10806 "readdir()\n"
10807 "readdir_r()\n"
10808 "readlink() [POSIX.1-2008 で追加された]\n"
10809 "readlinkat() [POSIX.1-2008 で追加された]\n"
10810 "remove()\n"
10811 "rename()\n"
10812 "renameat() [POSIX.1-2008 で追加された]\n"
10813 "rewind()\n"
10814 "rewinddir()\n"
10815 "scandir() [POSIX.1-2008 で追加された]\n"
10816 "scanf()\n"
10817 "seekdir()\n"
10818 "semop()\n"
10819 "setgrent()\n"
10820 "sethostent()\n"
10821 "setnetent()\n"
10822 "setprotoent()\n"
10823 "setpwent()\n"
10824 "setservent()\n"
10825 "setutxent()\n"
10826 "sigpause() [POSIX.1-2008 で追加された]\n"
10827 "stat()\n"
10828 "strerror()\n"
10829 "strerror_r()\n"
10830 "strftime()\n"
10831 "symlink()\n"
10832 "symlinkat() [POSIX.1-2008 で追加された]\n"
10833 "sync()\n"
10834 "syslog()\n"
10835 "tmpfile()\n"
10836 "tmpnam()\n"
10837 "ttyname()\n"
10838 "ttyname_r()\n"
10839 "tzset()\n"
10840 "ungetc()\n"
10841 "ungetwc()\n"
10842 "unlink()\n"
10843 "unlinkat() [POSIX.1-2008 で追加された]\n"
10844 "utime() [POSIX.1-2008 で追加された]\n"
10845 "utimensat() [POSIX.1-2008 で追加された]\n"
10846 "utimes() [POSIX.1-2008 で追加された]\n"
10847 "vdprintf() [POSIX.1-2008 で追加された]\n"
10848 "vfprintf()\n"
10849 "vfwprintf()\n"
10850 "vprintf()\n"
10851 "vwprintf()\n"
10852 "wcsftime()\n"
10853 "wordexp()\n"
10854 "wprintf()\n"
10855 "wscanf()\n"
10856
10857 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
10858 #.  files, it looks as though at least the following nonstandard
10859 #.  functions are cancellation points:
10860 #.  endnetgrent
10861 #.  endspent
10862 #.  epoll_pwait
10863 #.  epoll_wait
10864 #.  fcloseall
10865 #.  fdopendir
10866 #.  fflush_unlocked
10867 #.  fgetc_unlocked
10868 #.  fgetgrent
10869 #.  fgetgrent_r
10870 #.  fgetpwent
10871 #.  fgetpwent_r
10872 #.  fgets_unlocked
10873 #.  fgetspent
10874 #.  fgetspent_r
10875 #.  fgetwc_unlocked
10876 #.  fgetws_unlocked
10877 #.  fputc_unlocked
10878 #.  fputs_unlocked
10879 #.  fputwc_unlocked
10880 #.  fputws_unlocked
10881 #.  fread_unlocked
10882 #.  fwrite_unlocked
10883 #.  gai_suspend
10884 #.  getaddrinfo_a
10885 #.  getdate_r
10886 #.  getgrent_r
10887 #.  getgrouplist
10888 #.  gethostbyaddr_r
10889 #.  gethostbyname2
10890 #.  gethostbyname2_r
10891 #.  gethostbyname_r
10892 #.  gethostent_r
10893 #.  getnetbyaddr_r
10894 #.  getnetbyname_r
10895 #.  getnetent_r
10896 #.  getnetgrent
10897 #.  getnetgrent_r
10898 #.  getprotobyname_r
10899 #.  getprotobynumber_r
10900 #.  getprotoent_r
10901 #.  getpw
10902 #.  getpwent_r
10903 #.  getservbyname_r
10904 #.  getservbyport_r
10905 #.  getservent_r
10906 #.  getspent
10907 #.  getspent_r
10908 #.  getspnam
10909 #.  getspnam_r
10910 #.  getutmp
10911 #.  getutmpx
10912 #.  getw
10913 #.  getwc_unlocked
10914 #.  getwchar_unlocked
10915 #.  initgroups
10916 #.  innetgr
10917 #.  mkostemp
10918 #.  mkostemp64
10919 #.  mkstemp64
10920 #.  ppoll
10921 #.  pthread_timedjoin_np
10922 #.  putgrent
10923 #.  putpwent
10924 #.  putspent
10925 #.  putw
10926 #.  putwc_unlocked
10927 #.  putwchar_unlocked
10928 #.  rcmd
10929 #.  rcmd_af
10930 #.  rexec
10931 #.  rexec_af
10932 #.  rresvport
10933 #.  rresvport_af
10934 #.  ruserok
10935 #.  ruserok_af
10936 #.  setnetgrent
10937 #.  setspent
10938 #.  sgetspent
10939 #.  sgetspent_r
10940 #.  updwtmpx
10941 #.  utmpxname
10942 #.  vfscanf
10943 #.  vfwscanf
10944 #.  vscanf
10945 #.  vsyslog
10946 #.  vwscanf
10947 #. type: Plain text
10948 #: build/C/man7/pthreads.7:655
10949 msgid ""
10950 "An implementation may also mark other functions not specified in the "
10951 "standard as cancellation points.  In particular, an implementation is likely "
10952 "to mark any nonstandard function that may block as a cancellation point.  "
10953 "(This includes most functions that can touch files.)"
10954 msgstr ""
10955 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
10956 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
10957 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
10958 "関数がこれに含まれる)。"
10959
10960 #. type: SS
10961 #: build/C/man7/pthreads.7:655
10962 #, no-wrap
10963 msgid "Compiling on Linux"
10964 msgstr "Linux でのコンパイル"
10965
10966 #. type: Plain text
10967 #: build/C/man7/pthreads.7:658
10968 msgid ""
10969 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
10970 "pthread>."
10971 msgstr ""
10972 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
10973 "きである。"
10974
10975 #. type: SS
10976 #: build/C/man7/pthreads.7:658
10977 #, no-wrap
10978 msgid "Linux implementations of POSIX threads"
10979 msgstr "POSIX スレッドの Linux での実装"
10980
10981 #. type: Plain text
10982 #: build/C/man7/pthreads.7:661
10983 msgid ""
10984 "Over time, two threading implementations have been provided by the GNU C "
10985 "library on Linux:"
10986 msgstr ""
10987 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
10988 "た。"
10989
10990 #. type: TP
10991 #: build/C/man7/pthreads.7:661
10992 #, no-wrap
10993 msgid "B<LinuxThreads>"
10994 msgstr "B<LinuxThreads>"
10995
10996 #. type: Plain text
10997 #: build/C/man7/pthreads.7:665
10998 msgid ""
10999 "This is the original Pthreads implementation.  Since glibc 2.4, this "
11000 "implementation is no longer supported."
11001 msgstr ""
11002 "最初の Pthreads の実装。\n"
11003 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
11004
11005 #. type: TP
11006 #: build/C/man7/pthreads.7:665
11007 #, no-wrap
11008 msgid "B<NPTL> (Native POSIX Threads Library)"
11009 msgstr "B<NPTL> (Native POSIX Threads Library)"
11010
11011 #. type: Plain text
11012 #: build/C/man7/pthreads.7:673
11013 msgid ""
11014 "This is the modern Pthreads implementation.  By comparison with "
11015 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
11016 "POSIX.1 specification and better performance when creating large numbers of "
11017 "threads.  NPTL is available since glibc 2.3.2, and requires features that "
11018 "are present in the Linux 2.6 kernel."
11019 msgstr ""
11020 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
11021 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
11022 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
11023 "装されている機能が必要である。"
11024
11025 #. type: Plain text
11026 #: build/C/man7/pthreads.7:683
11027 msgid ""
11028 "Both of these are so-called 1:1 implementations, meaning that each thread "
11029 "maps to a kernel scheduling entity.  Both threading implementations employ "
11030 "the Linux B<clone>(2)  system call.  In NPTL, thread synchronization "
11031 "primitives (mutexes, thread joining, and so on) are implemented using the "
11032 "Linux B<futex>(2)  system call."
11033 msgstr ""
11034 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
11035 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
11036 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
11037 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
11038 "使って実装されている。"
11039
11040 #. type: SS
11041 #: build/C/man7/pthreads.7:683
11042 #, no-wrap
11043 msgid "LinuxThreads"
11044 msgstr "LinuxThreads"
11045
11046 #. type: Plain text
11047 #: build/C/man7/pthreads.7:685
11048 msgid "The notable features of this implementation are the following:"
11049 msgstr "この実装の大きな特徴は以下の通りである:"
11050
11051 #. type: Plain text
11052 #: build/C/man7/pthreads.7:692
11053 msgid ""
11054 "In addition to the main (initial) thread, and the threads that the program "
11055 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
11056 "thread.  This thread handles thread creation and termination.  (Problems can "
11057 "result if this thread is inadvertently killed.)"
11058 msgstr ""
11059 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
11060 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
11061 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
11062 "kill されると、問題が起こることがある)。"
11063
11064 #. type: Plain text
11065 #: build/C/man7/pthreads.7:704
11066 msgid ""
11067 "Signals are used internally by the implementation.  On Linux 2.2 and later, "
11068 "the first three real-time signals are used (see also B<signal>(7)).  On "
11069 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must "
11070 "avoid the use of whichever set of signals is employed by the implementation."
11071 msgstr ""
11072 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
11073 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
11074 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
11075 "用されているシグナルを どれも使わないようにしなければならない。"
11076
11077 #. type: Plain text
11078 #: build/C/man7/pthreads.7:711
11079 msgid ""
11080 "Threads do not share process IDs.  (In effect, LinuxThreads threads are "
11081 "implemented as processes which share more information than usual, but which "
11082 "do not share a common process ID.)  LinuxThreads threads (including the "
11083 "manager thread)  are visible as separate processes using B<ps>(1)."
11084 msgstr ""
11085 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
11086 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
11087 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
11088 "を使うと別のプロセスのように見える。"
11089
11090 #. type: Plain text
11091 #: build/C/man7/pthreads.7:714
11092 msgid ""
11093 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
11094 "number of ways, including the following:"
11095 msgstr ""
11096 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
11097 "示すような点がある:"
11098
11099 #. type: Plain text
11100 #: build/C/man7/pthreads.7:718
11101 msgid "Calls to B<getpid>(2)  return a different value in each thread."
11102 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
11103
11104 #. type: Plain text
11105 #: build/C/man7/pthreads.7:727
11106 msgid ""
11107 "Calls to B<getppid>(2)  in threads other than the main thread return the "
11108 "process ID of the manager thread; instead B<getppid>(2)  in these threads "
11109 "should return the same value as B<getppid>(2)  in the main thread."
11110 msgstr ""
11111 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
11112 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
11113 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
11114
11115 #. type: Plain text
11116 #: build/C/man7/pthreads.7:737
11117 msgid ""
11118 "When one thread creates a new child process using B<fork>(2), any thread "
11119 "should be able to B<wait>(2)  on the child.  However, the implementation "
11120 "only allows the thread that created the child to B<wait>(2)  on it."
11121 msgstr ""
11122 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
11123 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
11124 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
11125 "る。"
11126
11127 #. type: Plain text
11128 #: build/C/man7/pthreads.7:744
11129 msgid ""
11130 "When a thread calls B<execve>(2), all other threads are terminated (as "
11131 "required by POSIX.1).  However, the resulting process has the same PID as "
11132 "the thread that called B<execve>(2): it should have the same PID as the main "
11133 "thread."
11134 msgstr ""
11135 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
11136 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
11137 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
11138 "る。"
11139
11140 #. type: Plain text
11141 #: build/C/man7/pthreads.7:751
11142 msgid ""
11143 "Threads do not share user and group IDs.  This can cause complications with "
11144 "set-user-ID programs and can cause failures in Pthreads functions if an "
11145 "application changes its credentials using B<seteuid>(2)  or similar."
11146 msgstr ""
11147 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
11148 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使っ"
11149 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
11150
11151 #. type: Plain text
11152 #: build/C/man7/pthreads.7:753
11153 msgid "Threads do not share a common session ID and process group ID."
11154 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
11155
11156 #. type: Plain text
11157 #: build/C/man7/pthreads.7:756
11158 msgid "Threads do not share record locks created using B<fcntl>(2)."
11159 msgstr ""
11160 "スレッド間で B<fcntl>(2)  を使って作成されるレコード・ロックを共有しない。"
11161
11162 #. type: Plain text
11163 #: build/C/man7/pthreads.7:762
11164 msgid ""
11165 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
11166 "rather than process-wide."
11167 msgstr ""
11168 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
11169 "単位の情報である。"
11170
11171 #. type: Plain text
11172 #: build/C/man7/pthreads.7:765
11173 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
11174 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
11175
11176 #. type: Plain text
11177 #: build/C/man7/pthreads.7:767
11178 msgid "Threads do not share interval timers."
11179 msgstr "スレッド間でインターバル・タイマを共有しない。"
11180
11181 #.  FIXME . bug report filed for NPTL nice nonconformance
11182 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
11183 #.  Sep 08: there is a patch by Denys Vlasenko to address this
11184 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
11185 #.  Monitor this to see if it makes it into mainline.
11186 #. type: Plain text
11187 #: build/C/man7/pthreads.7:769 build/C/man7/pthreads.7:806
11188 msgid "Threads do not share a common nice value."
11189 msgstr "スレッドは共通の nice 値を共有しない。"
11190
11191 #. type: Plain text
11192 #: build/C/man7/pthreads.7:779
11193 msgid ""
11194 "POSIX.1 distinguishes the notions of signals that are directed to the "
11195 "process as a whole and signals that are directed to individual threads.  "
11196 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
11197 "example) should be handled by a single, arbitrarily selected thread within "
11198 "the process.  LinuxThreads does not support the notion of process-directed "
11199 "signals: signals may be sent only to specific threads."
11200 msgstr ""
11201 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
11202 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
11203 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
11204 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
11205 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
11206 "ルは特定のスレッドにだけ送ることができる。"
11207
11208 #. type: Plain text
11209 #: build/C/man7/pthreads.7:788
11210 msgid ""
11211 "Threads have distinct alternate signal stack settings.  However, a new "
11212 "thread's alternate signal stack settings are copied from the thread that "
11213 "created it, so that the threads initially share an alternate signal stack.  "
11214 "(A new thread should start with no alternate signal stack defined.  If two "
11215 "threads handle signals on their shared alternate signal stack at the same "
11216 "time, unpredictable program failures are likely to occur.)"
11217 msgstr ""
11218 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
11219 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
11220 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
11221 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
11222 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
11223 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
11224
11225 #. type: SS
11226 #: build/C/man7/pthreads.7:788
11227 #, no-wrap
11228 msgid "NPTL"
11229 msgstr "NPTL"
11230
11231 #. type: Plain text
11232 #: build/C/man7/pthreads.7:797
11233 msgid ""
11234 "With NPTL, all of the threads in a process are placed in the same thread "
11235 "group; all members of a thread group share the same PID.  NPTL does not "
11236 "employ a manager thread.  NPTL makes internal use of the first two real-time "
11237 "signals (see also B<signal>(7)); these signals cannot be used in "
11238 "applications."
11239 msgstr ""
11240 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
11241 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
11242 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
11243 "の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケー"
11244 "ションでは使用できない。"
11245
11246 #. type: Plain text
11247 #: build/C/man7/pthreads.7:799
11248 msgid "NPTL still has at least one nonconformance with POSIX.1:"
11249 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
11250
11251 #. type: Plain text
11252 #: build/C/man7/pthreads.7:808
11253 msgid "Some NPTL nonconformances occur only with older kernels:"
11254 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
11255
11256 #. type: Plain text
11257 #: build/C/man7/pthreads.7:814
11258 msgid ""
11259 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
11260 "rather than process-wide (fixed in kernel 2.6.9)."
11261 msgstr ""
11262 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
11263 "単位の情報である (カーネル 2.6.9 で修正された)。"
11264
11265 #. type: Plain text
11266 #: build/C/man7/pthreads.7:816
11267 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
11268 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
11269
11270 #. type: Plain text
11271 #: build/C/man7/pthreads.7:818
11272 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
11273 msgstr ""
11274 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
11275
11276 #. type: Plain text
11277 #: build/C/man7/pthreads.7:822
11278 msgid ""
11279 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
11280 "(fixed in kernel 2.6.16)."
11281 msgstr ""
11282 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
11283 "きる (カーネル 2.6.16 で修正された)。"
11284
11285 #. type: Plain text
11286 #: build/C/man7/pthreads.7:827
11287 msgid ""
11288 "Only the main thread is permitted to make the process into a process group "
11289 "leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
11290 msgstr ""
11291 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセス・グルー"
11292 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
11293
11294 #. type: Plain text
11295 #: build/C/man7/pthreads.7:833
11296 msgid ""
11297 "Threads have distinct alternate signal stack settings.  However, a new "
11298 "thread's alternate signal stack settings are copied from the thread that "
11299 "created it, so that the threads initially share an alternate signal stack "
11300 "(fixed in kernel 2.6.16)."
11301 msgstr ""
11302 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
11303 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
11304 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
11305 "ル 2.6.16 で修正された)。"
11306
11307 #. type: Plain text
11308 #: build/C/man7/pthreads.7:835
11309 msgid "Note the following further points about the NPTL implementation:"
11310 msgstr "NPTL の実装では以下の点についても注意すること:"
11311
11312 #. type: Plain text
11313 #: build/C/man7/pthreads.7:849
11314 msgid ""
11315 "If the stack size soft resource limit (see the description of "
11316 "B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than "
11317 "I<unlimited>, then this value defines the default stack size for new "
11318 "threads.  To be effective, this limit must be set before the program is "
11319 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
11320 "stacksize> in the C shell)."
11321 msgstr ""
11322 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2)  の "
11323 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
11324 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
11325 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
11326 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
11327 "は I<limit stacksize>)  を使って設定する。"
11328
11329 #. type: SS
11330 #: build/C/man7/pthreads.7:849
11331 #, no-wrap
11332 msgid "Determining the threading implementation"
11333 msgstr "スレッド実装の判定"
11334
11335 #. type: Plain text
11336 #: build/C/man7/pthreads.7:854
11337 msgid ""
11338 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
11339 "system's threading implementation, for example:"
11340 msgstr ""
11341 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
11342 "装を判定することができる。 以下に例を示す:"
11343
11344 #. type: Plain text
11345 #: build/C/man7/pthreads.7:859
11346 #, no-wrap
11347 msgid ""
11348 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
11349 "NPTL 2.3.4\n"
11350 msgstr ""
11351 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
11352 "NPTL 2.3.4\n"
11353
11354 #. type: Plain text
11355 #: build/C/man7/pthreads.7:864
11356 msgid ""
11357 "With older glibc versions, a command such as the following should be "
11358 "sufficient to determine the default threading implementation:"
11359 msgstr ""
11360 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
11361 "ド実装を判定することができる。"
11362
11363 #. type: Plain text
11364 #: build/C/man7/pthreads.7:870
11365 #, no-wrap
11366 msgid ""
11367 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
11368 "                egrep -i \\(aqthreads|nptl\\(aq\n"
11369 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
11370 msgstr ""
11371 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
11372 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
11373 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
11374
11375 #. type: SS
11376 #: build/C/man7/pthreads.7:872
11377 #, no-wrap
11378 msgid "Selecting the threading implementation: LD_ASSUME_KERNEL"
11379 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
11380
11381 #. type: Plain text
11382 #: build/C/man7/pthreads.7:887
11383 msgid ""
11384 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
11385 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
11386 "override the dynamic linker's default choice of threading implementation.  "
11387 "This variable tells the dynamic linker to assume that it is running on top "
11388 "of a particular kernel version.  By specifying a kernel version that does "
11389 "not provide the support required by NPTL, we can force the use of "
11390 "LinuxThreads.  (The most likely reason for doing this is to run a (broken) "
11391 "application that depends on some nonconformant behavior in LinuxThreads.)  "
11392 "For example:"
11393 msgstr ""
11394 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
11395 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
11396 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
11397 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
11398 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
11399 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
11400 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
11401 "ン を動作させる場合だろう)。 以下に例を示す:"
11402
11403 #. type: Plain text
11404 #: build/C/man7/pthreads.7:893
11405 #, no-wrap
11406 msgid ""
11407 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
11408 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
11409 "        linuxthreads-0.10 by Xavier Leroy\n"
11410 msgstr ""
11411 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
11412 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
11413 "        linuxthreads-0.10 by Xavier Leroy\n"
11414
11415 #. type: Plain text
11416 #: build/C/man7/pthreads.7:905
11417 msgid ""
11418 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), B<sigevent>"
11419 "(7), B<signal>(7),"
11420 msgstr ""
11421 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
11422 "B<signal>(7),"
11423
11424 #. type: Plain text
11425 #: build/C/man7/pthreads.7:929
11426 msgid ""
11427 "Various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
11428 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
11429 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
11430 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
11431 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
11432 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>"
11433 "(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), "
11434 "B<pthread_sigmask>(3), B<pthread_sigqueue>(3), and B<pthread_testcancel>(3)"
11435 msgstr ""
11436 "pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
11437 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
11438 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
11439 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
11440 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
11441 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
11442 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
11443 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
11444 "and B<pthread_testcancel>(3)"