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.
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2012-05-01 04:22+0900\n"
10 "PO-Revision-Date: 2012-05-03 17:42+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
19 #: build/C/man2/getcontext.2:23
25 #: build/C/man2/getcontext.2:23
31 #: build/C/man2/getcontext.2:23 build/C/man3/pthread_attr_init.3:24
32 #: build/C/man3/pthread_attr_setaffinity_np.3:24
33 #: build/C/man3/pthread_attr_setdetachstate.3:24
34 #: build/C/man3/pthread_attr_setguardsize.3:24
35 #: build/C/man3/pthread_attr_setinheritsched.3:24
36 #: build/C/man3/pthread_attr_setschedparam.3:24
37 #: build/C/man3/pthread_attr_setschedpolicy.3:24
38 #: build/C/man3/pthread_attr_setscope.3:24
39 #: build/C/man3/pthread_attr_setstack.3:24
40 #: build/C/man3/pthread_attr_setstackaddr.3:24
41 #: build/C/man3/pthread_attr_setstacksize.3:24
42 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_cleanup_push.3:24
43 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
44 #: build/C/man3/pthread_create.3:24 build/C/man3/pthread_detach.3:24
45 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
46 #: build/C/man3/pthread_getattr_np.3:24
47 #: build/C/man3/pthread_getcpuclockid.3:24 build/C/man3/pthread_join.3:24
48 #: build/C/man3/pthread_kill.3:24
49 #: build/C/man3/pthread_kill_other_threads_np.3:24
50 #: build/C/man3/pthread_self.3:24 build/C/man3/pthread_setaffinity_np.3:24
51 #: build/C/man3/pthread_setcancelstate.3:24
52 #: build/C/man3/pthread_setconcurrency.3:23
53 #: build/C/man3/pthread_setschedparam.3:24
54 #: build/C/man3/pthread_setschedprio.3:24 build/C/man3/pthread_sigmask.3:24
55 #: build/C/man3/pthread_sigqueue.3:23 build/C/man3/pthread_testcancel.3:24
56 #: build/C/man3/pthread_tryjoin_np.3:24 build/C/man3/pthread_yield.3:23
57 #: build/C/man7/pthreads.7:24
63 #: build/C/man2/getcontext.2:23 build/C/man3/makecontext.3:25
64 #: build/C/man3/pthread_attr_init.3:24
65 #: build/C/man3/pthread_attr_setaffinity_np.3:24
66 #: build/C/man3/pthread_attr_setdetachstate.3:24
67 #: build/C/man3/pthread_attr_setguardsize.3:24
68 #: build/C/man3/pthread_attr_setinheritsched.3:24
69 #: build/C/man3/pthread_attr_setschedparam.3:24
70 #: build/C/man3/pthread_attr_setschedpolicy.3:24
71 #: build/C/man3/pthread_attr_setscope.3:24
72 #: build/C/man3/pthread_attr_setstack.3:24
73 #: build/C/man3/pthread_attr_setstackaddr.3:24
74 #: build/C/man3/pthread_attr_setstacksize.3:24
75 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_cleanup_push.3:24
76 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
77 #: build/C/man3/pthread_create.3:24 build/C/man3/pthread_detach.3:24
78 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
79 #: build/C/man3/pthread_getattr_np.3:24
80 #: build/C/man3/pthread_getcpuclockid.3:24 build/C/man3/pthread_join.3:24
81 #: build/C/man3/pthread_kill.3:24
82 #: build/C/man3/pthread_kill_other_threads_np.3:24
83 #: build/C/man3/pthread_self.3:24 build/C/man3/pthread_setaffinity_np.3:24
84 #: build/C/man3/pthread_setcancelstate.3:24
85 #: build/C/man3/pthread_setconcurrency.3:23
86 #: build/C/man3/pthread_setschedparam.3:24
87 #: build/C/man3/pthread_setschedprio.3:24 build/C/man3/pthread_sigmask.3:24
88 #: build/C/man3/pthread_sigqueue.3:23 build/C/man3/pthread_testcancel.3:24
89 #: build/C/man3/pthread_tryjoin_np.3:24 build/C/man3/pthread_yield.3:23
90 #: build/C/man7/pthreads.7:24
92 msgid "Linux Programmer's Manual"
93 msgstr "Linux Programmer's Manual"
96 #: build/C/man2/getcontext.2:24 build/C/man3/makecontext.3:26
97 #: build/C/man3/pthread_attr_init.3:25
98 #: build/C/man3/pthread_attr_setaffinity_np.3:25
99 #: build/C/man3/pthread_attr_setdetachstate.3:25
100 #: build/C/man3/pthread_attr_setguardsize.3:25
101 #: build/C/man3/pthread_attr_setinheritsched.3:25
102 #: build/C/man3/pthread_attr_setschedparam.3:25
103 #: build/C/man3/pthread_attr_setschedpolicy.3:25
104 #: build/C/man3/pthread_attr_setscope.3:25
105 #: build/C/man3/pthread_attr_setstack.3:25
106 #: build/C/man3/pthread_attr_setstackaddr.3:25
107 #: build/C/man3/pthread_attr_setstacksize.3:25
108 #: build/C/man3/pthread_cancel.3:25 build/C/man3/pthread_cleanup_push.3:25
109 #: build/C/man3/pthread_cleanup_push_defer_np.3:25
110 #: build/C/man3/pthread_create.3:25 build/C/man3/pthread_detach.3:25
111 #: build/C/man3/pthread_equal.3:25 build/C/man3/pthread_exit.3:25
112 #: build/C/man3/pthread_getattr_np.3:25
113 #: build/C/man3/pthread_getcpuclockid.3:25 build/C/man3/pthread_join.3:25
114 #: build/C/man3/pthread_kill.3:25
115 #: build/C/man3/pthread_kill_other_threads_np.3:25
116 #: build/C/man3/pthread_self.3:25 build/C/man3/pthread_setaffinity_np.3:25
117 #: build/C/man3/pthread_setcancelstate.3:25
118 #: build/C/man3/pthread_setconcurrency.3:24
119 #: build/C/man3/pthread_setschedparam.3:25
120 #: build/C/man3/pthread_setschedprio.3:25 build/C/man3/pthread_sigmask.3:25
121 #: build/C/man3/pthread_sigqueue.3:24 build/C/man3/pthread_testcancel.3:25
122 #: build/C/man3/pthread_tryjoin_np.3:25 build/C/man3/pthread_yield.3:24
123 #: build/C/man7/pthreads.7:25
129 #: build/C/man2/getcontext.2:26
130 msgid "getcontext, setcontext - get or set the user context"
131 msgstr "getcontext, setcontext - ユーザコンテキストを取得/設定する"
134 #: build/C/man2/getcontext.2:26 build/C/man3/makecontext.3:28
135 #: build/C/man3/pthread_attr_init.3:28
136 #: build/C/man3/pthread_attr_setaffinity_np.3:28
137 #: build/C/man3/pthread_attr_setdetachstate.3:28
138 #: build/C/man3/pthread_attr_setguardsize.3:28
139 #: build/C/man3/pthread_attr_setinheritsched.3:28
140 #: build/C/man3/pthread_attr_setschedparam.3:28
141 #: build/C/man3/pthread_attr_setschedpolicy.3:28
142 #: build/C/man3/pthread_attr_setscope.3:28
143 #: build/C/man3/pthread_attr_setstack.3:28
144 #: build/C/man3/pthread_attr_setstackaddr.3:28
145 #: build/C/man3/pthread_attr_setstacksize.3:28
146 #: build/C/man3/pthread_cancel.3:27 build/C/man3/pthread_cleanup_push.3:28
147 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
148 #: build/C/man3/pthread_create.3:27 build/C/man3/pthread_detach.3:27
149 #: build/C/man3/pthread_equal.3:27 build/C/man3/pthread_exit.3:27
150 #: build/C/man3/pthread_getattr_np.3:27
151 #: build/C/man3/pthread_getcpuclockid.3:27 build/C/man3/pthread_join.3:27
152 #: build/C/man3/pthread_kill.3:27
153 #: build/C/man3/pthread_kill_other_threads_np.3:27
154 #: build/C/man3/pthread_self.3:27 build/C/man3/pthread_setaffinity_np.3:28
155 #: build/C/man3/pthread_setcancelstate.3:28
156 #: build/C/man3/pthread_setconcurrency.3:27
157 #: build/C/man3/pthread_setschedparam.3:28
158 #: build/C/man3/pthread_setschedprio.3:27 build/C/man3/pthread_sigmask.3:27
159 #: build/C/man3/pthread_sigqueue.3:26 build/C/man3/pthread_testcancel.3:27
160 #: build/C/man3/pthread_tryjoin_np.3:28 build/C/man3/pthread_yield.3:26
166 #: build/C/man2/getcontext.2:28 build/C/man3/makecontext.3:30
167 msgid "B<#include E<lt>ucontext.hE<gt>>"
168 msgstr "B<#include E<lt>ucontext.hE<gt>>"
171 #: build/C/man2/getcontext.2:30
172 msgid "B<int getcontext(ucontext_t *>I<ucp>B<);>"
173 msgstr "B<int getcontext(ucontext_t *>I<ucp>B<);>"
176 #: build/C/man2/getcontext.2:32
177 msgid "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
178 msgstr "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
181 #: build/C/man2/getcontext.2:32 build/C/man3/makecontext.3:35
182 #: build/C/man3/pthread_attr_init.3:37
183 #: build/C/man3/pthread_attr_setaffinity_np.3:40
184 #: build/C/man3/pthread_attr_setdetachstate.3:39
185 #: build/C/man3/pthread_attr_setguardsize.3:39
186 #: build/C/man3/pthread_attr_setinheritsched.3:39
187 #: build/C/man3/pthread_attr_setschedparam.3:39
188 #: build/C/man3/pthread_attr_setschedpolicy.3:39
189 #: build/C/man3/pthread_attr_setscope.3:39
190 #: build/C/man3/pthread_attr_setstack.3:52
191 #: build/C/man3/pthread_attr_setstackaddr.3:39
192 #: build/C/man3/pthread_attr_setstacksize.3:39
193 #: build/C/man3/pthread_cancel.3:35 build/C/man3/pthread_cleanup_push.3:38
194 #: build/C/man3/pthread_cleanup_push_defer_np.3:38
195 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
196 #: build/C/man3/pthread_equal.3:35 build/C/man3/pthread_exit.3:35
197 #: build/C/man3/pthread_getattr_np.3:36
198 #: build/C/man3/pthread_getcpuclockid.3:36 build/C/man3/pthread_join.3:35
199 #: build/C/man3/pthread_kill.3:35
200 #: build/C/man3/pthread_kill_other_threads_np.3:33
201 #: build/C/man3/pthread_self.3:35 build/C/man3/pthread_setaffinity_np.3:40
202 #: build/C/man3/pthread_setcancelstate.3:37
203 #: build/C/man3/pthread_setconcurrency.3:36
204 #: build/C/man3/pthread_setschedparam.3:39
205 #: build/C/man3/pthread_setschedprio.3:35 build/C/man3/pthread_sigmask.3:36
206 #: build/C/man3/pthread_sigqueue.3:43 build/C/man3/pthread_testcancel.3:35
207 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
208 #: build/C/man7/pthreads.7:27
214 #: build/C/man2/getcontext.2:44
216 "In a System V-like environment, one has the two types I<mcontext_t> and "
217 "I<ucontext_t> defined in I<E<lt>ucontext.hE<gt>> and the four functions "
218 "B<getcontext>(), B<setcontext>(), B<makecontext>(3) and B<swapcontext>(3) "
219 "that allow user-level context switching between multiple threads of control "
222 "System V 的な環境では、 I<mcontext_t> および I<ucontext_t> という 2 つの型"
223 "と、 B<getcontext>(), B<setcontext>(), B<makecontext>(3), B<swapcontext>(3) "
224 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
225 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
229 #: build/C/man2/getcontext.2:48
231 "The I<mcontext_t> type is machine-dependent and opaque. The I<ucontext_t> "
232 "type is a structure that has at least the following fields:"
234 "I<mcontext_t> 型はマシン依存で、外部からは隠蔽されている。 I<ucontext_t> 型は"
235 "構造体で、少なくとも以下の 4 つのフィールドを持つ。"
238 #: build/C/man2/getcontext.2:58
241 "typedef struct ucontext {\n"
242 " struct ucontext *uc_link;\n"
243 " sigset_t uc_sigmask;\n"
244 " stack_t uc_stack;\n"
245 " mcontext_t uc_mcontext;\n"
249 "typedef struct ucontext {\n"
250 " struct ucontext *uc_link;\n"
251 " sigset_t uc_sigmask;\n"
252 " stack_t uc_stack;\n"
253 " mcontext_t uc_mcontext;\n"
258 #: build/C/man2/getcontext.2:75
260 "with I<sigset_t> and I<stack_t> defined in I<E<lt>signal.hE<gt>>. Here "
261 "I<uc_link> points to the context that will be resumed when the current "
262 "context terminates (in case the current context was created using "
263 "B<makecontext>(3)), I<uc_sigmask> is the set of signals blocked in this "
264 "context (see B<sigprocmask>(2)), I<uc_stack> is the stack used by this "
265 "context (see B<sigaltstack>(2)), and I<uc_mcontext> is the machine-specific "
266 "representation of the saved context, that includes the calling thread's "
269 "I<sigset_t> と I<stack_t> は I<E<lt>signal.hE<gt>> で定義されている。 ここで "
270 "I<uc_link> は、 現在のコンテキストが終了したとき、 続いて切り替わるコンテキス"
271 "トへのポインタである (現在のコンテキストが B<makecontext>(3) で生成されたも"
272 "のの場合)。 I<uc_sigmask> はこのコンテキストでブロックされている シグナル群で"
273 "ある (B<sigprocmask>(2) を見よ)。 I<uc_stack> はこのコンテキストが用いている"
274 "スタックである (B<signalstack>(2) を見よ)。 I<uc_mcontext> は保存されている"
275 "コンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマシ"
279 #: build/C/man2/getcontext.2:80
281 "The function B<getcontext>() initializes the structure pointed at by I<ucp> "
282 "to the currently active context."
284 "B<getcontext>() 関数は、 ポインタ I<ucp> が指す構造体を、 現在アクティブなコ"
288 #: build/C/man2/getcontext.2:92
290 "The function B<setcontext>() restores the user context pointed at by "
291 "I<ucp>. A successful call does not return. The context should have been "
292 "obtained by a call of B<getcontext>(), or B<makecontext>(3), or passed as "
293 "third argument to a signal handler."
295 "B<setcontext>() 関数は、ポインタ I<ucp> が指すユーザコンテキストをリストアす"
296 "る。 呼び出しに成功すると返らない。 このコンテキストは、以前に B<getcontext>"
297 "() または B<makecontext>(3) で得られたものか、 あるいはシグナルの第三引数と"
301 #: build/C/man2/getcontext.2:96
303 "If the context was obtained by a call of B<getcontext>(), program execution "
304 "continues as if this call just returned."
306 "コンテキストが B<getcontext>() の呼び出しによって得られていたものの場合は、 "
307 "プログラムはこの呼び出しから返った直後からのように実行を継続する。"
310 #: build/C/man2/getcontext.2:107
312 "If the context was obtained by a call of B<makecontext>(3), program "
313 "execution continues by a call to the function I<func> specified as the "
314 "second argument of that call to B<makecontext>(3). When the function "
315 "I<func> returns, we continue with the I<uc_link> member of the structure "
316 "I<ucp> specified as the first argument of that call to B<makecontext>(3). "
317 "When this member is NULL, the thread exits."
319 "コンテキストが B<makecontext>(3) の呼び出しによって得られていたものの場合"
320 "は、 プログラムの実行はその B<makecontext>(3) 呼び出しの第二引数で指定された"
321 "関数 I<func> を呼び出すかたちで継続する。 I<func> から返ると、 B<makecontext>"
322 "(3) 呼び出しの第一引数で指定されていた I<ucp> 構造体の I<uc_link> メンバで継"
323 "続する。 このメンバが NULL だった場合は、そのスレッドは終了する。"
326 #: build/C/man2/getcontext.2:114
328 "If the context was obtained by a call to a signal handler, then old standard "
329 "text says that \"program execution continues with the program instruction "
330 "following the instruction interrupted by the signal\". However, this "
331 "sentence was removed in SUSv2, and the present verdict is \"the result is "
334 "コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 古"
335 "い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命令"
336 "から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結果"
340 #: build/C/man2/getcontext.2:114 build/C/man3/makecontext.3:81
341 #: build/C/man3/pthread_attr_init.3:66
342 #: build/C/man3/pthread_attr_setaffinity_np.3:74
343 #: build/C/man3/pthread_attr_setdetachstate.3:75
344 #: build/C/man3/pthread_attr_setguardsize.3:88
345 #: build/C/man3/pthread_attr_setinheritsched.3:82
346 #: build/C/man3/pthread_attr_setschedparam.3:72
347 #: build/C/man3/pthread_attr_setschedpolicy.3:70
348 #: build/C/man3/pthread_attr_setscope.3:89
349 #: build/C/man3/pthread_attr_setstack.3:83
350 #: build/C/man3/pthread_attr_setstackaddr.3:72
351 #: build/C/man3/pthread_attr_setstacksize.3:59
352 #: build/C/man3/pthread_cancel.3:107 build/C/man3/pthread_cleanup_push.3:117
353 #: build/C/man3/pthread_create.3:113 build/C/man3/pthread_detach.3:47
354 #: build/C/man3/pthread_equal.3:39 build/C/man3/pthread_exit.3:69
355 #: build/C/man3/pthread_getattr_np.3:71
356 #: build/C/man3/pthread_getcpuclockid.3:44 build/C/man3/pthread_join.3:68
357 #: build/C/man3/pthread_kill.3:50 build/C/man3/pthread_self.3:44
358 #: build/C/man3/pthread_setaffinity_np.3:75
359 #: build/C/man3/pthread_setcancelstate.3:90
360 #: build/C/man3/pthread_setconcurrency.3:54
361 #: build/C/man3/pthread_setschedparam.3:102
362 #: build/C/man3/pthread_setschedprio.3:51 build/C/man3/pthread_sigmask.3:47
363 #: build/C/man3/pthread_sigqueue.3:63 build/C/man3/pthread_testcancel.3:48
364 #: build/C/man3/pthread_tryjoin_np.3:83 build/C/man3/pthread_yield.3:41
370 #: build/C/man2/getcontext.2:122
372 "When successful, B<getcontext>() returns 0 and B<setcontext>() does not "
373 "return. On error, both return -1 and set I<errno> appropriately."
375 "成功すると、 B<getcontext>() は 0 を返し、 B<setcontext>() は返らない。 失"
376 "敗すると、両者とも -1 を返し、I<errno> をエラーに応じて設定する。"
379 #: build/C/man2/getcontext.2:122 build/C/man3/makecontext.3:93
380 #: build/C/man3/pthread_attr_init.3:69
381 #: build/C/man3/pthread_attr_setaffinity_np.3:77
382 #: build/C/man3/pthread_attr_setdetachstate.3:78
383 #: build/C/man3/pthread_attr_setguardsize.3:91
384 #: build/C/man3/pthread_attr_setinheritsched.3:85
385 #: build/C/man3/pthread_attr_setschedparam.3:75
386 #: build/C/man3/pthread_attr_setschedpolicy.3:73
387 #: build/C/man3/pthread_attr_setscope.3:92
388 #: build/C/man3/pthread_attr_setstack.3:86
389 #: build/C/man3/pthread_attr_setstackaddr.3:75
390 #: build/C/man3/pthread_attr_setstacksize.3:62
391 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_cleanup_push.3:119
392 #: build/C/man3/pthread_create.3:120 build/C/man3/pthread_detach.3:52
393 #: build/C/man3/pthread_equal.3:43 build/C/man3/pthread_exit.3:71
394 #: build/C/man3/pthread_getattr_np.3:74
395 #: build/C/man3/pthread_getcpuclockid.3:47 build/C/man3/pthread_join.3:73
396 #: build/C/man3/pthread_kill.3:55 build/C/man3/pthread_self.3:46
397 #: build/C/man3/pthread_setaffinity_np.3:78
398 #: build/C/man3/pthread_setcancelstate.3:93
399 #: build/C/man3/pthread_setconcurrency.3:66
400 #: build/C/man3/pthread_setschedparam.3:110
401 #: build/C/man3/pthread_setschedprio.3:59 build/C/man3/pthread_sigmask.3:52
402 #: build/C/man3/pthread_sigqueue.3:68 build/C/man3/pthread_testcancel.3:52
403 #: build/C/man3/pthread_tryjoin_np.3:87 build/C/man3/pthread_yield.3:46
409 #: build/C/man2/getcontext.2:124
410 msgid "None defined."
414 #: build/C/man2/getcontext.2:124 build/C/man3/makecontext.3:102
415 #: build/C/man3/pthread_attr_init.3:77
416 #: build/C/man3/pthread_attr_setaffinity_np.3:106
417 #: build/C/man3/pthread_attr_setdetachstate.3:85
418 #: build/C/man3/pthread_attr_setguardsize.3:104
419 #: build/C/man3/pthread_attr_setinheritsched.3:99
420 #: build/C/man3/pthread_attr_setschedparam.3:87
421 #: build/C/man3/pthread_attr_setschedpolicy.3:87
422 #: build/C/man3/pthread_attr_setscope.3:105
423 #: build/C/man3/pthread_attr_setstack.3:110
424 #: build/C/man3/pthread_attr_setstackaddr.3:81
425 #: build/C/man3/pthread_attr_setstacksize.3:81
426 #: build/C/man3/pthread_cancel.3:120 build/C/man3/pthread_cleanup_push.3:123
427 #: build/C/man3/pthread_cleanup_push_defer_np.3:99
428 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:62
429 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
430 #: build/C/man3/pthread_getattr_np.3:96
431 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:96
432 #: build/C/man3/pthread_kill.3:64
433 #: build/C/man3/pthread_kill_other_threads_np.3:45
434 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_setaffinity_np.3:119
435 #: build/C/man3/pthread_setcancelstate.3:111
436 #: build/C/man3/pthread_setconcurrency.3:81
437 #: build/C/man3/pthread_setschedparam.3:139
438 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigmask.3:55
439 #: build/C/man3/pthread_sigqueue.3:91 build/C/man3/pthread_testcancel.3:56
440 #: build/C/man3/pthread_tryjoin_np.3:110 build/C/man3/pthread_yield.3:50
442 msgid "CONFORMING TO"
446 #: build/C/man2/getcontext.2:130
448 "SUSv2, POSIX.1-2001. POSIX.1-2008 removes the specification of B<getcontext>"
449 "(), citing portability issues, and recommending that applications be "
450 "rewritten to use POSIX threads instead."
452 "SUSv2, POSIX.1-2001. POSIX.1-2008 では、移植性の問題から B<getcontext>() の"
453 "仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直"
457 #: build/C/man2/getcontext.2:130 build/C/man3/makecontext.3:110
458 #: build/C/man3/pthread_attr_init.3:79
459 #: build/C/man3/pthread_attr_setaffinity_np.3:109
460 #: build/C/man3/pthread_attr_setdetachstate.3:87
461 #: build/C/man3/pthread_attr_setguardsize.3:106
462 #: build/C/man3/pthread_attr_setschedparam.3:89
463 #: build/C/man3/pthread_attr_setscope.3:107
464 #: build/C/man3/pthread_attr_setstack.3:112
465 #: build/C/man3/pthread_attr_setstackaddr.3:84
466 #: build/C/man3/pthread_attr_setstacksize.3:83
467 #: build/C/man3/pthread_cancel.3:122 build/C/man3/pthread_cleanup_push.3:125
468 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
469 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
470 #: build/C/man3/pthread_getcpuclockid.3:65 build/C/man3/pthread_join.3:98
471 #: build/C/man3/pthread_kill.3:66
472 #: build/C/man3/pthread_kill_other_threads_np.3:48
473 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_setaffinity_np.3:122
474 #: build/C/man3/pthread_setcancelstate.3:113
475 #: build/C/man3/pthread_setconcurrency.3:83
476 #: build/C/man3/pthread_setschedparam.3:141
477 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:57
478 #: build/C/man3/pthread_yield.3:56
484 #: build/C/man2/getcontext.2:147
486 "The earliest incarnation of this mechanism was the B<setjmp>(3)/B<longjmp>"
487 "(3) mechanism. Since that does not define the handling of the signal "
488 "context, the next stage was the B<sigsetjmp>(3)/B<siglongjmp>(3) pair. The "
489 "present mechanism gives much more control. On the other hand, there is no "
490 "easy way to detect whether a return from B<getcontext>() is from the first "
491 "call, or via a B<setcontext>() call. The user has to invent her own "
492 "bookkeeping device, and a register variable won't do since registers are "
495 "このメカニズムの最古の実装は、 B<setjmp>(3)/B<longjmp>(3) 機構であった。 こ"
496 "れらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階で"
497 "は B<sigsetjmp>(3)/B<siglongjmp>(3) のペアが現われた。 現在の機構ではずっと"
498 "細かな制御ができる。 一方 B<getcontext>() から返ったとき、 これが最初の呼び"
499 "出しであったか、 それとも B<setcontext>() 呼び出しからのものであるかを 区別"
500 "する容易な方法がなくなってしまった。 ユーザは「しおり」機構を自分で作らなけれ"
501 "ばならない。 レジスタ変数は (レジスタはリストアされてしまうので) これをやって"
505 #: build/C/man2/getcontext.2:158
507 "When a signal occurs, the current user context is saved and a new context is "
508 "created by the kernel for the signal handler. Do not leave the handler "
509 "using B<longjmp>(3): it is undefined what would happen with contexts. Use "
510 "B<siglongjmp>(3) or B<setcontext>() instead."
512 "シグナルが発生すると、 現在のユーザコンテキストは保存され、 シグナルハンドラ"
513 "用のコンテキストがカーネルによって生成される。 今後はハンドラに B<longjmp>"
514 "(3) を使わせないこと: この関数のコンテキスト下での動作は定義されていない。 "
515 "代わりに B<siglongjmp>(3) か B<setcontext>() を使うこと。"
518 #: build/C/man2/getcontext.2:158 build/C/man3/makecontext.3:217
519 #: build/C/man3/pthread_attr_init.3:295
520 #: build/C/man3/pthread_attr_setaffinity_np.3:116
521 #: build/C/man3/pthread_attr_setdetachstate.3:109
522 #: build/C/man3/pthread_attr_setguardsize.3:156
523 #: build/C/man3/pthread_attr_setinheritsched.3:120
524 #: build/C/man3/pthread_attr_setschedparam.3:96
525 #: build/C/man3/pthread_attr_setschedpolicy.3:92
526 #: build/C/man3/pthread_attr_setscope.3:118
527 #: build/C/man3/pthread_attr_setstack.3:154
528 #: build/C/man3/pthread_attr_setstackaddr.3:108
529 #: build/C/man3/pthread_attr_setstacksize.3:109
530 #: build/C/man3/pthread_cancel.3:221 build/C/man3/pthread_cleanup_push.3:309
531 #: build/C/man3/pthread_cleanup_push_defer_np.3:102
532 #: build/C/man3/pthread_create.3:367 build/C/man3/pthread_detach.3:95
533 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:103
534 #: build/C/man3/pthread_getattr_np.3:343
535 #: build/C/man3/pthread_getcpuclockid.3:167 build/C/man3/pthread_join.3:125
536 #: build/C/man3/pthread_kill.3:73
537 #: build/C/man3/pthread_kill_other_threads_np.3:64
538 #: build/C/man3/pthread_self.3:74 build/C/man3/pthread_setaffinity_np.3:204
539 #: build/C/man3/pthread_setcancelstate.3:175
540 #: build/C/man3/pthread_setconcurrency.3:98
541 #: build/C/man3/pthread_setschedparam.3:429
542 #: build/C/man3/pthread_setschedprio.3:89 build/C/man3/pthread_sigmask.3:133
543 #: build/C/man3/pthread_sigqueue.3:93 build/C/man3/pthread_testcancel.3:61
544 #: build/C/man3/pthread_tryjoin_np.3:133 build/C/man3/pthread_yield.3:59
545 #: build/C/man7/pthreads.7:893
551 #: build/C/man2/getcontext.2:165
553 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
554 "B<makecontext>(3), B<sigsetjmp>(3)"
556 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
557 "B<makecontext>(3), B<sigsetjmp>(3)"
560 #: build/C/man2/getcontext.2:165 build/C/man3/makecontext.3:223
561 #: build/C/man3/pthread_attr_init.3:309
562 #: build/C/man3/pthread_attr_setaffinity_np.3:122
563 #: build/C/man3/pthread_attr_setdetachstate.3:115
564 #: build/C/man3/pthread_attr_setguardsize.3:164
565 #: build/C/man3/pthread_attr_setinheritsched.3:129
566 #: build/C/man3/pthread_attr_setschedparam.3:106
567 #: build/C/man3/pthread_attr_setschedpolicy.3:101
568 #: build/C/man3/pthread_attr_setscope.3:126
569 #: build/C/man3/pthread_attr_setstack.3:164
570 #: build/C/man3/pthread_attr_setstackaddr.3:114
571 #: build/C/man3/pthread_attr_setstacksize.3:116
572 #: build/C/man3/pthread_cancel.3:231 build/C/man3/pthread_cleanup_push.3:315
573 #: build/C/man3/pthread_cleanup_push_defer_np.3:108
574 #: build/C/man3/pthread_create.3:378 build/C/man3/pthread_detach.3:102
575 #: build/C/man3/pthread_equal.3:58 build/C/man3/pthread_exit.3:107
576 #: build/C/man3/pthread_getattr_np.3:357
577 #: build/C/man3/pthread_getcpuclockid.3:175 build/C/man3/pthread_join.3:132
578 #: build/C/man3/pthread_kill.3:82
579 #: build/C/man3/pthread_kill_other_threads_np.3:70
580 #: build/C/man3/pthread_self.3:78 build/C/man3/pthread_setaffinity_np.3:212
581 #: build/C/man3/pthread_setcancelstate.3:180
582 #: build/C/man3/pthread_setconcurrency.3:101
583 #: build/C/man3/pthread_setschedparam.3:441
584 #: build/C/man3/pthread_setschedprio.3:101 build/C/man3/pthread_sigmask.3:142
585 #: build/C/man3/pthread_sigqueue.3:101 build/C/man3/pthread_testcancel.3:66
586 #: build/C/man3/pthread_tryjoin_np.3:138 build/C/man3/pthread_yield.3:63
587 #: build/C/man7/pthreads.7:927
593 #: build/C/man2/getcontext.2:172 build/C/man3/makecontext.3:230
594 #: build/C/man3/pthread_attr_init.3:316
595 #: build/C/man3/pthread_attr_setaffinity_np.3:129
596 #: build/C/man3/pthread_attr_setdetachstate.3:122
597 #: build/C/man3/pthread_attr_setguardsize.3:171
598 #: build/C/man3/pthread_attr_setinheritsched.3:136
599 #: build/C/man3/pthread_attr_setschedparam.3:113
600 #: build/C/man3/pthread_attr_setschedpolicy.3:108
601 #: build/C/man3/pthread_attr_setscope.3:133
602 #: build/C/man3/pthread_attr_setstack.3:171
603 #: build/C/man3/pthread_attr_setstackaddr.3:121
604 #: build/C/man3/pthread_attr_setstacksize.3:123
605 #: build/C/man3/pthread_cancel.3:238 build/C/man3/pthread_cleanup_push.3:322
606 #: build/C/man3/pthread_cleanup_push_defer_np.3:115
607 #: build/C/man3/pthread_create.3:385 build/C/man3/pthread_detach.3:109
608 #: build/C/man3/pthread_equal.3:65 build/C/man3/pthread_exit.3:114
609 #: build/C/man3/pthread_getattr_np.3:364
610 #: build/C/man3/pthread_getcpuclockid.3:182 build/C/man3/pthread_join.3:139
611 #: build/C/man3/pthread_kill.3:89
612 #: build/C/man3/pthread_kill_other_threads_np.3:77
613 #: build/C/man3/pthread_self.3:85 build/C/man3/pthread_setaffinity_np.3:219
614 #: build/C/man3/pthread_setcancelstate.3:187
615 #: build/C/man3/pthread_setconcurrency.3:108
616 #: build/C/man3/pthread_setschedparam.3:448
617 #: build/C/man3/pthread_setschedprio.3:108 build/C/man3/pthread_sigmask.3:149
618 #: build/C/man3/pthread_sigqueue.3:108 build/C/man3/pthread_testcancel.3:73
619 #: build/C/man3/pthread_tryjoin_np.3:145 build/C/man3/pthread_yield.3:70
620 #: build/C/man7/pthreads.7:934
622 "This page is part of release 3.40 of the Linux I<man-pages> project. A "
623 "description of the project, and information about reporting bugs, can be "
624 "found at http://www.kernel.org/doc/man-pages/."
626 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.40 の一部\n"
627 "である。プロジェクトの説明とバグ報告に関する情報は\n"
628 "http://www.kernel.org/doc/man-pages/ に書かれている。"
631 #: build/C/man3/makecontext.3:25
637 #: build/C/man3/makecontext.3:25
643 #: build/C/man3/makecontext.3:25
649 #: build/C/man3/makecontext.3:28
650 msgid "makecontext, swapcontext - manipulate user context"
651 msgstr "makecontext, swapcontext - ユーザコンテキストを操作する"
654 #: build/C/man3/makecontext.3:33
656 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
659 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
663 #: build/C/man3/makecontext.3:35
664 msgid "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
665 msgstr "B<int swapcontext(ucontext_t *>I<oucp>B<, ucontext_t *>I<ucp>B<);>"
668 #: build/C/man3/makecontext.3:46
670 "In a System V-like environment, one has the type I<ucontext_t> defined in "
671 "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(2), "
672 "B<setcontext>(2), B<makecontext>() and B<swapcontext>() that allow user-"
673 "level context switching between multiple threads of control within a process."
675 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
676 "と、 B<getcontext>(2), B<setcontext>(2), B<makecontext>(), B<swapcontext>() "
677 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
678 "部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができる"
682 #: build/C/man3/makecontext.3:49
683 msgid "For the type and the first two functions, see B<getcontext>(2)."
685 "これらの型と、最初の 2 つの関数については、 B<getcontext>(2) を参照のこと。"
688 #: build/C/man3/makecontext.3:61
690 "The B<makecontext>() function modifies the context pointed to by I<ucp> "
691 "(which was obtained from a call to B<getcontext>(2)). Before invoking "
692 "B<makecontext>(), the caller must allocate a new stack for this context and "
693 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
694 "and assign its address to I<ucp-E<gt>uc_link>."
696 "B<makecontext>() 関数は、ポインタ I<ucp> が指すコンテキストを変更する "
697 "(I<ucp> は以前の B<getcontext>(2) 呼び出しで得られたものである)。 "
698 "B<makecontext>() を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
699 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
700 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
704 #: build/C/man3/makecontext.3:75
706 "When this context is later activated (using B<setcontext>(2) or "
707 "B<swapcontext>()) the function I<func> is called, and passed the series of "
708 "integer (I<int>) arguments that follow I<argc>; the caller must specify the "
709 "number of these arguments in I<argc>. When this function returns, the "
710 "successor context is activated. If the successor context pointer is NULL, "
713 "このコンテキストが将来 (B<setcontext>(2) または B<swapcontext>() によっ"
714 "て) 有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 "
715 "(I<int>) 引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数"
716 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
717 "る。 後継コンテキストのポインタが NULL の場合、そのスレッドが終了する。"
720 #: build/C/man3/makecontext.3:81
722 "The B<swapcontext>() function saves the current context in the structure "
723 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
725 "B<swapcontext>() 関数は現在のコンテキストを ポインタ I<oucp> が指す構造体に"
726 "保存し、 ポインタ I<ucp> が指すコンテキストを有効にする。"
729 #: build/C/man3/makecontext.3:93
731 "When successful, B<swapcontext>() does not return. (But we may return "
732 "later, in case I<oucp> is activated, in which case it looks like "
733 "B<swapcontext>() returns 0.) On error, B<swapcontext>() returns -1 and "
734 "sets I<errno> appropriately."
736 "成功すると、 B<swapcontext>() は返らない (しかし後に I<oucp> が有効になった"
737 "場合には返ることがある。 このときには B<swapcontext>() は 0 を返すように見え"
738 "る。) 失敗すると、 B<swapcontext>() は -1 を返し、 I<errno> をエラーに応じ"
742 #: build/C/man3/makecontext.3:94
743 #: build/C/man3/pthread_attr_setaffinity_np.3:100
744 #: build/C/man3/pthread_getattr_np.3:75
750 #: build/C/man3/makecontext.3:97
751 msgid "Insufficient stack space left."
752 msgstr "スタックに割り当てる空間が残っていない。"
755 #: build/C/man3/makecontext.3:97
756 #: build/C/man3/pthread_attr_setaffinity_np.3:104
757 #: build/C/man3/pthread_attr_setguardsize.3:102
758 #: build/C/man3/pthread_attr_setstack.3:108
759 #: build/C/man3/pthread_attr_setstackaddr.3:79
760 #: build/C/man3/pthread_attr_setstacksize.3:79
761 #: build/C/man3/pthread_getattr_np.3:94
762 #: build/C/man3/pthread_getcpuclockid.3:61
763 #: build/C/man3/pthread_setaffinity_np.3:117
764 #: build/C/man3/pthread_setconcurrency.3:79
765 #: build/C/man3/pthread_setschedprio.3:79 build/C/man3/pthread_sigqueue.3:87
766 #: build/C/man3/pthread_tryjoin_np.3:108
772 #: build/C/man3/makecontext.3:102
774 "B<makecontext>() and B<swapcontext>() are provided in glibc since version "
777 "B<makecontext>() と B<swapcontext>() は、バージョン 2.1 以降の glibc で提供"
781 #: build/C/man3/makecontext.3:110
783 "SUSv2, POSIX.1-2001. POSIX.1-2008 removes the specifications of "
784 "B<makecontext>() and B<swapcontext>(), citing portability issues, and "
785 "recommending that applications be rewritten to use POSIX threads instead."
787 "SUSv2, POSIX.1-2001. POSIX.1-2008 では、移植性の問題から B<makecontext>() "
788 "と B<swapcontext>() の仕様が削除されている。 代わりに、アプリケーションを "
789 "POSIX スレッドを使って書き直すことが 推奨されている。"
792 #: build/C/man3/makecontext.3:118
794 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
795 "namely, this struct contains the start and length of a memory area to be "
796 "used as the stack, regardless of the direction of growth of the stack. "
797 "Thus, it is not necessary for the user program to worry about this direction."
799 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2) の場合と同じである。 すなわ"
800 "ちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含"
801 "まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
802 "て、ユーザプログラムはこの件については心配しなくてよい。"
805 #: build/C/man3/makecontext.3:134
807 "On architectures where I<int> and pointer types are the same size (e.g., "
808 "x86-32, where both types are 32 bits), you may be able to get away with "
809 "passing pointers as arguments to B<makecontext>() following I<argc>. "
810 "However, doing this is not guaranteed to be portable, is undefined according "
811 "to the standards, and won't work on architectures where pointers are larger "
812 "than I<int>s. Nevertheless, starting with version 2.8, glibc makes some "
813 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
816 "I<int> とポインタ型が同じ大きさであるアーキテクチャでは (x86-32 はその例であ"
817 "り、両方の型とも 32 ビットである)、 B<makecontext>() の I<argc> 以降の引き数"
818 "としてポインタを渡してもうまく動くかもしれない。 しかしながら、このようにする"
819 "と、移植性は保証されず、 標準に従えば動作は未定義であり、ポインタが I<int> よ"
820 "りも大きいアーキテクチャでは正しく動作しないことだろう。 それにも関わらず、"
821 "バージョン 2.8 以降の glibc では、 B<makecontext>() に変更が行われ、(x86-64 "
822 "などの) いくつかの 64 ビットアーキテクチャで 引き数としてポインタを渡すことが"
826 #: build/C/man3/makecontext.3:134 build/C/man3/pthread_attr_init.3:85
827 #: build/C/man3/pthread_attr_setdetachstate.3:106
828 #: build/C/man3/pthread_attr_setguardsize.3:153
829 #: build/C/man3/pthread_attr_setinheritsched.3:117
830 #: build/C/man3/pthread_attr_setschedparam.3:93
831 #: build/C/man3/pthread_attr_setschedpolicy.3:89
832 #: build/C/man3/pthread_attr_setstack.3:151
833 #: build/C/man3/pthread_attr_setstacksize.3:106
834 #: build/C/man3/pthread_cancel.3:130 build/C/man3/pthread_cleanup_push.3:149
835 #: build/C/man3/pthread_create.3:200 build/C/man3/pthread_detach.3:91
836 #: build/C/man3/pthread_getattr_np.3:99
837 #: build/C/man3/pthread_getcpuclockid.3:76 build/C/man3/pthread_join.3:122
838 #: build/C/man3/pthread_setaffinity_np.3:152
839 #: build/C/man3/pthread_setcancelstate.3:172
840 #: build/C/man3/pthread_setschedparam.3:147 build/C/man3/pthread_sigmask.3:59
841 #: build/C/man3/pthread_testcancel.3:58 build/C/man3/pthread_tryjoin_np.3:113
847 #: build/C/man3/makecontext.3:142
849 "The example program below demonstrates the use of B<getcontext>(2), "
850 "B<makecontext>(), and B<swapcontext>(). Running the program produces the "
853 "以下のサンプル・プログラムは、 B<getcontext>(2), B<makecontext>(), "
854 "B<swapcontext>() の使用方法の例を示すものである。 このプログラムを実行する"
858 #: build/C/man3/makecontext.3:154
862 "main: swapcontext(&uctx_main, &uctx_func2)\n"
864 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
866 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
872 "main: swapcontext(&uctx_main, &uctx_func2)\n"
874 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
876 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
882 #: build/C/man3/makecontext.3:156 build/C/man3/pthread_attr_init.3:146
883 #: build/C/man3/pthread_cancel.3:146 build/C/man3/pthread_cleanup_push.3:225
884 #: build/C/man3/pthread_create.3:239 build/C/man3/pthread_getattr_np.3:177
885 #: build/C/man3/pthread_getcpuclockid.3:93
886 #: build/C/man3/pthread_setschedparam.3:222 build/C/man3/pthread_sigmask.3:77
888 msgid "Program source"
892 #: build/C/man3/makecontext.3:162
895 "#include E<lt>ucontext.hE<gt>\n"
896 "#include E<lt>stdio.hE<gt>\n"
897 "#include E<lt>stdlib.hE<gt>\n"
899 "#include E<lt>ucontext.hE<gt>\n"
900 "#include E<lt>stdio.hE<gt>\n"
901 "#include E<lt>stdlib.hE<gt>\n"
904 #: build/C/man3/makecontext.3:164
906 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
907 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
910 #: build/C/man3/makecontext.3:167
913 "#define handle_error(msg) \\e\n"
914 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
916 "#define handle_error(msg) \\e\n"
917 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
920 #: build/C/man3/makecontext.3:177
926 " printf(\"func1: started\\en\");\n"
927 " printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
928 " if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
929 " handle_error(\"swapcontext\");\n"
930 " printf(\"func1: returning\\en\");\n"
936 " printf(\"func1: started\\en\");\n"
937 " printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
938 " if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
939 " handle_error(\"swapcontext\");\n"
940 " printf(\"func1: returning\\en\");\n"
944 #: build/C/man3/makecontext.3:187
950 " printf(\"func2: started\\en\");\n"
951 " printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
952 " if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
953 " handle_error(\"swapcontext\");\n"
954 " printf(\"func2: returning\\en\");\n"
960 " printf(\"func2: started\\en\");\n"
961 " printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
962 " if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
963 " handle_error(\"swapcontext\");\n"
964 " printf(\"func2: returning\\en\");\n"
968 #: build/C/man3/makecontext.3:193
972 "main(int argc, char *argv[])\n"
974 " char func1_stack[16384];\n"
975 " char func2_stack[16384];\n"
978 "main(int argc, char *argv[])\n"
980 " char func1_stack[16384];\n"
981 " char func2_stack[16384];\n"
984 #: build/C/man3/makecontext.3:200
987 " if (getcontext(&uctx_func1) == -1)\n"
988 " handle_error(\"getcontext\");\n"
989 " uctx_func1.uc_stack.ss_sp = func1_stack;\n"
990 " uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
991 " uctx_func1.uc_link = &uctx_main;\n"
992 " makecontext(&uctx_func1, func1, 0);\n"
994 " if (getcontext(&uctx_func1) == -1)\n"
995 " handle_error(\"getcontext\");\n"
996 " uctx_func1.uc_stack.ss_sp = func1_stack;\n"
997 " uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
998 " uctx_func1.uc_link = &uctx_main;\n"
999 " makecontext(&uctx_func1, func1, 0);\n"
1002 #: build/C/man3/makecontext.3:208
1005 " if (getcontext(&uctx_func2) == -1)\n"
1006 " handle_error(\"getcontext\");\n"
1007 " uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1008 " uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1009 " /* Successor context is f1(), unless argc E<gt> 1 */\n"
1010 " uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1011 " makecontext(&uctx_func2, func2, 0);\n"
1013 " if (getcontext(&uctx_func2) == -1)\n"
1014 " handle_error(\"getcontext\");\n"
1015 " uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1016 " uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1017 " /* Successor context is f1(), unless argc E<gt> 1 */\n"
1018 " uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1019 " makecontext(&uctx_func2, func2, 0);\n"
1022 #: build/C/man3/makecontext.3:212
1025 " printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1026 " if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1027 " handle_error(\"swapcontext\");\n"
1029 " printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1030 " if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1031 " handle_error(\"swapcontext\");\n"
1034 #: build/C/man3/makecontext.3:216
1037 " printf(\"main: exiting\\en\");\n"
1038 " exit(EXIT_SUCCESS);\n"
1041 " printf(\"main: exiting\\en\");\n"
1042 " exit(EXIT_SUCCESS);\n"
1046 #: build/C/man3/makecontext.3:223
1048 "B<getcontext>(2), B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), "
1051 "B<getcontext>(2), B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), "
1055 #: build/C/man3/pthread_attr_init.3:24
1057 msgid "PTHREAD_ATTR_INIT"
1058 msgstr "PTHREAD_ATTR_INIT"
1061 #: build/C/man3/pthread_attr_init.3:24
1067 #: build/C/man3/pthread_attr_init.3:28
1069 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1072 "pthread_attr_init, pthread_attr_destroy - \n"
1073 "スレッド属性オブジェクトの初期化と破棄を行う"
1076 #: build/C/man3/pthread_attr_init.3:31
1077 #: build/C/man3/pthread_attr_setdetachstate.3:31
1078 #: build/C/man3/pthread_attr_setguardsize.3:31
1079 #: build/C/man3/pthread_attr_setinheritsched.3:31
1080 #: build/C/man3/pthread_attr_setschedparam.3:31
1081 #: build/C/man3/pthread_attr_setschedpolicy.3:31
1082 #: build/C/man3/pthread_attr_setscope.3:31
1083 #: build/C/man3/pthread_attr_setstack.3:31
1084 #: build/C/man3/pthread_attr_setstackaddr.3:31
1085 #: build/C/man3/pthread_attr_setstacksize.3:31
1086 #: build/C/man3/pthread_cancel.3:30 build/C/man3/pthread_cleanup_push.3:31
1087 #: build/C/man3/pthread_cleanup_push_defer_np.3:31
1088 #: build/C/man3/pthread_create.3:30 build/C/man3/pthread_detach.3:30
1089 #: build/C/man3/pthread_equal.3:30 build/C/man3/pthread_exit.3:30
1090 #: build/C/man3/pthread_join.3:30
1091 #: build/C/man3/pthread_kill_other_threads_np.3:30
1092 #: build/C/man3/pthread_self.3:30 build/C/man3/pthread_setcancelstate.3:31
1093 #: build/C/man3/pthread_setconcurrency.3:30
1094 #: build/C/man3/pthread_setschedparam.3:31
1095 #: build/C/man3/pthread_setschedprio.3:30 build/C/man3/pthread_sigqueue.3:29
1096 #: build/C/man3/pthread_testcancel.3:30 build/C/man3/pthread_yield.3:29
1098 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1099 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1102 #: build/C/man3/pthread_attr_init.3:34
1105 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1106 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1108 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1109 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1112 #: build/C/man3/pthread_attr_init.3:36
1113 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1114 #: build/C/man3/pthread_attr_setdetachstate.3:38
1115 #: build/C/man3/pthread_attr_setguardsize.3:38
1116 #: build/C/man3/pthread_attr_setinheritsched.3:38
1117 #: build/C/man3/pthread_attr_setschedparam.3:38
1118 #: build/C/man3/pthread_attr_setschedpolicy.3:38
1119 #: build/C/man3/pthread_attr_setscope.3:38
1120 #: build/C/man3/pthread_attr_setstack.3:38
1121 #: build/C/man3/pthread_attr_setstackaddr.3:38
1122 #: build/C/man3/pthread_attr_setstacksize.3:38
1123 #: build/C/man3/pthread_cancel.3:34 build/C/man3/pthread_cleanup_push.3:37
1124 #: build/C/man3/pthread_equal.3:34 build/C/man3/pthread_exit.3:34
1125 #: build/C/man3/pthread_getattr_np.3:35
1126 #: build/C/man3/pthread_getcpuclockid.3:35 build/C/man3/pthread_self.3:34
1127 #: build/C/man3/pthread_setaffinity_np.3:39
1128 #: build/C/man3/pthread_setcancelstate.3:36
1129 #: build/C/man3/pthread_setconcurrency.3:35
1130 #: build/C/man3/pthread_setschedparam.3:38
1131 #: build/C/man3/pthread_setschedprio.3:34 build/C/man3/pthread_testcancel.3:34
1133 msgid "Compile and link with I<-pthread>.\n"
1134 msgstr "I<-pthread> でコンパイルしてリンクする。\n"
1137 #: build/C/man3/pthread_attr_init.3:48
1139 "The B<pthread_attr_init>() function initializes the thread attributes "
1140 "object pointed to by I<attr> with default attribute values. After this "
1141 "call, individual attributes of the object can be set using various related "
1142 "functions (listed under SEE ALSO), and then the object can be used in one or "
1143 "more B<pthread_create>(3) calls that create threads."
1145 "B<pthread_attr_init>() 関数は I<attr> が指すスレッド属性オブジェクト\n"
1146 "(thread attributes object) をデフォルトの属性値で初期化する。\n"
1147 "この呼び出しの後、オブジェクトの各属性は (関連項目に載っている) 種々の\n"
1148 "関数を使って設定することができ、このオブジェクトはスレッドの作成を行う\n"
1149 "B<pthread_create>(3) の呼び出しにおいて使用することができる (一つの\n"
1150 "オブジェクトを複数の B<pthread_create>(3) に渡してもよい)。"
1153 #: build/C/man3/pthread_attr_init.3:53
1155 "Calling B<pthread_attr_init>() on a thread attributes object that has "
1156 "already been initialized results in undefined behavior."
1158 "すでに初期化されているスレッド属性オブジェクトに対して\n"
1159 "B<pthread_attr_init>() を呼び出した場合、\n"
1160 "どのような動作になるかは不定である。"
1163 #: build/C/man3/pthread_attr_init.3:60
1165 "When a thread attributes object is no longer required, it should be "
1166 "destroyed using the B<pthread_attr_destroy>() function. Destroying a "
1167 "thread attributes object has no effect on threads that were created using "
1170 "スレッド属性オブジェクトがもはや必要なくなった際には、\n"
1171 "そのオブジェクトは B<pthread_attr_destroy>() 関数を使って破棄すべきである。\n"
1172 "スレッド属性オブジェクトを破棄しても、\n"
1173 "そのオブジェクトを使って作成されたスレッドには影響はない。"
1176 #: build/C/man3/pthread_attr_init.3:66
1178 "Once a thread attributes object has been destroyed, it can be reinitialized "
1179 "using B<pthread_attr_init>(). Any other use of a destroyed thread "
1180 "attributes object has undefined results."
1182 "いったん破棄したスレッド属性オブジェクトは、\n"
1183 "B<pthread_attr_init>() を使って再初期化することができる。\n"
1184 "破棄したスレッド属性オブジェクトをこれ以外の用途で\n"
1188 #: build/C/man3/pthread_attr_init.3:69
1189 #: build/C/man3/pthread_attr_setaffinity_np.3:77
1190 #: build/C/man3/pthread_attr_setdetachstate.3:78
1191 #: build/C/man3/pthread_attr_setguardsize.3:91
1192 #: build/C/man3/pthread_attr_setinheritsched.3:85
1193 #: build/C/man3/pthread_attr_setschedparam.3:75
1194 #: build/C/man3/pthread_attr_setschedpolicy.3:73
1195 #: build/C/man3/pthread_attr_setscope.3:92
1196 #: build/C/man3/pthread_attr_setstack.3:86
1197 #: build/C/man3/pthread_attr_setstackaddr.3:75
1198 #: build/C/man3/pthread_attr_setstacksize.3:62
1199 #: build/C/man3/pthread_setaffinity_np.3:78
1200 #: build/C/man3/pthread_setcancelstate.3:93
1202 "On success, these functions return 0; on error, they return a nonzero error "
1205 "成功すると、これらの関数は 0 を返す。\n"
1206 "エラーの場合、0 以外のエラー番号を返す。"
1209 #: build/C/man3/pthread_attr_init.3:77
1211 "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on "
1212 "Linux these functions always succeed (but portable and future-proof "
1213 "applications should nevertheless handle a possible error return)."
1215 "POSIX.1-2001 では B<pthread_attr_init>() にはエラー B<ENOMEM> が\n"
1217 "Linux では、これらの関数は常に作成する\n"
1218 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
1219 "正のエラーの返り値を処理するようにすべきである)。"
1222 #: build/C/man3/pthread_attr_init.3:79
1223 #: build/C/man3/pthread_attr_setdetachstate.3:87
1224 #: build/C/man3/pthread_attr_setguardsize.3:106
1225 #: build/C/man3/pthread_attr_setinheritsched.3:101
1226 #: build/C/man3/pthread_attr_setschedparam.3:89
1227 #: build/C/man3/pthread_attr_setschedpolicy.3:89
1228 #: build/C/man3/pthread_attr_setscope.3:107
1229 #: build/C/man3/pthread_attr_setstack.3:112
1230 #: build/C/man3/pthread_attr_setstacksize.3:83
1231 #: build/C/man3/pthread_cancel.3:122 build/C/man3/pthread_cleanup_push.3:125
1232 #: build/C/man3/pthread_create.3:146 build/C/man3/pthread_detach.3:64
1233 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
1234 #: build/C/man3/pthread_getcpuclockid.3:65 build/C/man3/pthread_join.3:98
1235 #: build/C/man3/pthread_kill.3:66 build/C/man3/pthread_self.3:50
1236 #: build/C/man3/pthread_setcancelstate.3:113
1237 #: build/C/man3/pthread_setconcurrency.3:83
1238 #: build/C/man3/pthread_setschedparam.3:141
1239 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:57
1240 #: build/C/man3/pthread_testcancel.3:58
1241 msgid "POSIX.1-2001."
1242 msgstr "POSIX.1-2001."
1245 #: build/C/man3/pthread_attr_init.3:85
1247 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1248 "object other than via pthreads functions is nonportable and produces "
1249 "undefined results."
1251 "I<pthread_attr_t> 型の内部構造は意識すべきではない。\n"
1252 "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n"
1253 "どのような結果が得られるかも分からない。"
1256 #: build/C/man3/pthread_attr_init.3:94
1258 "The program below optionally makes use of B<pthread_attr_init>() and "
1259 "various related functions to initialize a thread attributes object that is "
1260 "used to create a single thread. Once created, the thread uses the "
1261 "B<pthread_getattr_np>(3) function (a nonstandard GNU extension) to retrieve "
1262 "the thread's attributes, and then displays those attributes."
1264 "下記のプログラムは、B<pthread_attr_init>() と種々の関連関数を使って、\n"
1265 "スレッド属性オブジェクトの初期化を行い、\n"
1266 "そのオブジェクトを使ってスレッドを一つ作成する。\n"
1267 "作成されたスレッドは、作成後に B<pthread_getattr_np>(3) 関数 \n"
1268 "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n"
1272 #: build/C/man3/pthread_attr_init.3:103
1274 "If the program is run with no command-line argument, then it passes NULL as "
1275 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1276 "with default attributes. Running the program on Linux/x86-32 with the NPTL "
1277 "threading implementation, we see the following:"
1279 "コマンドライン引き数なしでプログラムを実行した場合、\n"
1280 "B<pthread_create>(3) の I<attr> 引き数には NULL が渡される。\n"
1281 "この場合、スレッドはデフォルトの属性で作成される。\n"
1282 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1283 "動作させると、以下のような出力が得られる。"
1285 #. Results from glibc 2.8, SUSE 11.0; Oct 2008
1287 #: build/C/man3/pthread_attr_init.3:119
1290 "$B< ulimit -s> # No stack imit ==E<gt> default stack size is 2MB\n"
1293 "Thread attributes:\n"
1294 " Detach state = PTHREAD_CREATE_JOINABLE\n"
1295 " Scope = PTHREAD_SCOPE_SYSTEM\n"
1296 " Inherit scheduler = PTHREAD_INHERIT_SCHED\n"
1297 " Scheduling policy = SCHED_OTHER\n"
1298 " Scheduling priority = 0\n"
1299 " Guard size = 4096 bytes\n"
1300 " Stack address = 0x40196000\n"
1301 " Stack size = 0x201000 bytes\n"
1303 "$B< ulimit -s> # No stack imit ==E<gt> default stack size is 2MB\n"
1306 "Thread attributes:\n"
1307 " Detach state = PTHREAD_CREATE_JOINABLE\n"
1308 " Scope = PTHREAD_SCOPE_SYSTEM\n"
1309 " Inherit scheduler = PTHREAD_INHERIT_SCHED\n"
1310 " Scheduling policy = SCHED_OTHER\n"
1311 " Scheduling priority = 0\n"
1312 " Guard size = 4096 bytes\n"
1313 " Stack address = 0x40196000\n"
1314 " Stack size = 0x201000 bytes\n"
1317 #: build/C/man3/pthread_attr_init.3:129
1319 "When we supply a stack size as a command-line argument, the program "
1320 "initializes a thread attributes object, sets various attributes in that "
1321 "object, and passes a pointer to the object in the call to B<pthread_create>"
1322 "(3). Running the program on Linux/x86-32 with the NPTL threading "
1323 "implementation, we see the following:"
1325 "コマンドライン引き数でスタックサイズが与えられた場合、\n"
1326 "このプログラムは、スレッド属性オブジェクトを初期化し、\n"
1327 "そのオブジェクトの各種属性を設定し、\n"
1328 "B<pthread_create>(3) の呼び出しでこのオブジェクトへのポインタを渡す。\n"
1329 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1330 "動作させると、以下のような出力が得られる。"
1332 #. Results from glibc 2.8, SUSE 11.0; Oct 2008
1334 #: build/C/man3/pthread_attr_init.3:144
1337 "$B< ./a.out 0x3000000>\n"
1338 "posix_memalign() allocated at 0x40197000\n"
1339 "Thread attributes:\n"
1340 " Detach state = PTHREAD_CREATE_DETACHED\n"
1341 " Scope = PTHREAD_SCOPE_SYSTEM\n"
1342 " Inherit scheduler = PTHREAD_EXPLICIT_SCHED\n"
1343 " Scheduling policy = SCHED_OTHER\n"
1344 " Scheduling priority = 0\n"
1345 " Guard size = 0 bytes\n"
1346 " Stack address = 0x40197000\n"
1347 " Stack size = 0x3000000 bytes\n"
1349 "$B< ./a.out 0x3000000>\n"
1350 "posix_memalign() allocated at 0x40197000\n"
1351 "Thread attributes:\n"
1352 " Detach state = PTHREAD_CREATE_DETACHED\n"
1353 " Scope = PTHREAD_SCOPE_SYSTEM\n"
1354 " Inherit scheduler = PTHREAD_EXPLICIT_SCHED\n"
1355 " Scheduling policy = SCHED_OTHER\n"
1356 " Scheduling priority = 0\n"
1357 " Guard size = 0 bytes\n"
1358 " Stack address = 0x40197000\n"
1359 " Stack size = 0x3000000 bytes\n"
1362 #: build/C/man3/pthread_attr_init.3:155 build/C/man3/pthread_getattr_np.3:186
1365 "#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */\n"
1366 "#include E<lt>pthread.hE<gt>\n"
1367 "#include E<lt>stdio.hE<gt>\n"
1368 "#include E<lt>stdlib.hE<gt>\n"
1369 "#include E<lt>unistd.hE<gt>\n"
1370 "#include E<lt>errno.hE<gt>\n"
1372 "#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */\n"
1373 "#include E<lt>pthread.hE<gt>\n"
1374 "#include E<lt>stdio.hE<gt>\n"
1375 "#include E<lt>stdlib.hE<gt>\n"
1376 "#include E<lt>unistd.hE<gt>\n"
1377 "#include E<lt>errno.hE<gt>\n"
1380 #: build/C/man3/pthread_attr_init.3:158 build/C/man3/pthread_cancel.3:157
1381 #: build/C/man3/pthread_cleanup_push.3:237 build/C/man3/pthread_create.3:252
1382 #: build/C/man3/pthread_getattr_np.3:189
1383 #: build/C/man3/pthread_getcpuclockid.3:111
1384 #: build/C/man3/pthread_setaffinity_np.3:170
1385 #: build/C/man3/pthread_setschedparam.3:235 build/C/man3/pthread_sigmask.3:91
1388 "#define handle_error_en(en, msg) \\e\n"
1389 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1391 "#define handle_error_en(en, msg) \\e\n"
1392 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1395 #: build/C/man3/pthread_attr_init.3:166
1399 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1404 " struct sched_param sp;\n"
1407 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1412 " struct sched_param sp;\n"
1415 #: build/C/man3/pthread_attr_init.3:174
1418 " s = pthread_attr_getdetachstate(attr, &i);\n"
1420 " handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1421 " printf(\"%sDetach state = %s\\en\", prefix,\n"
1422 " (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1423 " (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1426 " s = pthread_attr_getdetachstate(attr, &i);\n"
1428 " handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1429 " printf(\"%sDetach state = %s\\en\", prefix,\n"
1430 " (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1431 " (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1435 #: build/C/man3/pthread_attr_init.3:182
1438 " s = pthread_attr_getscope(attr, &i);\n"
1440 " handle_error_en(s, \"pthread_attr_getscope\");\n"
1441 " printf(\"%sScope = %s\\en\", prefix,\n"
1442 " (i == PTHREAD_SCOPE_SYSTEM) ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1443 " (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1446 " s = pthread_attr_getscope(attr, &i);\n"
1448 " handle_error_en(s, \"pthread_attr_getscope\");\n"
1449 " printf(\"%sScope = %s\\en\", prefix,\n"
1450 " (i == PTHREAD_SCOPE_SYSTEM) ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1451 " (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1455 #: build/C/man3/pthread_attr_init.3:190
1458 " s = pthread_attr_getinheritsched(attr, &i);\n"
1460 " handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1461 " printf(\"%sInherit scheduler = %s\\en\", prefix,\n"
1462 " (i == PTHREAD_INHERIT_SCHED) ? \"PTHREAD_INHERIT_SCHED\" :\n"
1463 " (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1466 " s = pthread_attr_getinheritsched(attr, &i);\n"
1468 " handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1469 " printf(\"%sInherit scheduler = %s\\en\", prefix,\n"
1470 " (i == PTHREAD_INHERIT_SCHED) ? \"PTHREAD_INHERIT_SCHED\" :\n"
1471 " (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1475 #: build/C/man3/pthread_attr_init.3:199
1478 " s = pthread_attr_getschedpolicy(attr, &i);\n"
1480 " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1481 " printf(\"%sScheduling policy = %s\\en\", prefix,\n"
1482 " (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1483 " (i == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
1484 " (i == SCHED_RR) ? \"SCHED_RR\" :\n"
1487 " s = pthread_attr_getschedpolicy(attr, &i);\n"
1489 " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1490 " printf(\"%sScheduling policy = %s\\en\", prefix,\n"
1491 " (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1492 " (i == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
1493 " (i == SCHED_RR) ? \"SCHED_RR\" :\n"
1497 #: build/C/man3/pthread_attr_init.3:204
1500 " s = pthread_attr_getschedparam(attr, &sp);\n"
1502 " handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1503 " printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1505 " s = pthread_attr_getschedparam(attr, &sp);\n"
1507 " handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1508 " printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1511 #: build/C/man3/pthread_attr_init.3:209
1514 " s = pthread_attr_getguardsize(attr, &v);\n"
1516 " handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1517 " printf(\"%sGuard size = %d bytes\\en\", prefix, v);\n"
1519 " s = pthread_attr_getguardsize(attr, &v);\n"
1521 " handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1522 " printf(\"%sGuard size = %d bytes\\en\", prefix, v);\n"
1525 #: build/C/man3/pthread_attr_init.3:216
1528 " s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1530 " handle_error_en(s, \"pthread_attr_getstack\");\n"
1531 " printf(\"%sStack address = %p\\en\", prefix, stkaddr);\n"
1532 " printf(\"%sStack size = 0x%x bytes\\en\", prefix, v);\n"
1535 " s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1537 " handle_error_en(s, \"pthread_attr_getstack\");\n"
1538 " printf(\"%sStack address = %p\\en\", prefix, stkaddr);\n"
1539 " printf(\"%sStack size = 0x%x bytes\\en\", prefix, v);\n"
1543 #: build/C/man3/pthread_attr_init.3:222
1547 "thread_start(void *arg)\n"
1550 " pthread_attr_t gattr;\n"
1553 "thread_start(void *arg)\n"
1556 " pthread_attr_t gattr;\n"
1559 #: build/C/man3/pthread_attr_init.3:226
1562 " /* pthread_getattr_np() is a non-standard GNU extension that\n"
1563 " retrieves the attributes of the thread specified in its\n"
1564 " first argument */\n"
1566 " /* pthread_getattr_np() is a non-standard GNU extension that\n"
1567 " retrieves the attributes of the thread specified in its\n"
1568 " first argument */\n"
1571 #: build/C/man3/pthread_attr_init.3:230
1574 " s = pthread_getattr_np(pthread_self(), &gattr);\n"
1576 " handle_error_en(s, \"pthread_getattr_np\");\n"
1578 " s = pthread_getattr_np(pthread_self(), &gattr);\n"
1580 " handle_error_en(s, \"pthread_getattr_np\");\n"
1583 #: build/C/man3/pthread_attr_init.3:233
1586 " printf(\"Thread attributes:\\en\");\n"
1587 " display_pthread_attr(&gattr, \"\\et\");\n"
1589 " printf(\"Thread attributes:\\en\");\n"
1590 " display_pthread_attr(&gattr, \"\\et\");\n"
1593 #: build/C/man3/pthread_attr_init.3:236 build/C/man3/pthread_getattr_np.3:238
1596 " exit(EXIT_SUCCESS); /* Terminate all threads */\n"
1599 " exit(EXIT_SUCCESS); /* Terminate all threads */\n"
1603 #: build/C/man3/pthread_attr_init.3:244
1607 "main(int argc, char *argv[])\n"
1610 " pthread_attr_t attr;\n"
1611 " pthread_attr_t *attrp; /* NULL or &attr */\n"
1615 "main(int argc, char *argv[])\n"
1618 " pthread_attr_t attr;\n"
1619 " pthread_attr_t *attrp; /* NULL or &attr */\n"
1623 #: build/C/man3/pthread_attr_init.3:246
1624 #: build/C/man3/pthread_setschedparam.3:353
1626 msgid " attrp = NULL;\n"
1627 msgstr " attrp = NULL;\n"
1630 #: build/C/man3/pthread_attr_init.3:250
1633 " /* If a command-line argument was supplied, use it to set the\n"
1634 " stack-size attribute and set a few other thread attributes,\n"
1635 " and set attrp pointing to thread attributes object */\n"
1637 " /* If a command-line argument was supplied, use it to set the\n"
1638 " stack-size attribute and set a few other thread attributes,\n"
1639 " and set attrp pointing to thread attributes object */\n"
1642 #: build/C/man3/pthread_attr_init.3:254
1645 " if (argc E<gt> 1) {\n"
1646 " int stack_size;\n"
1649 " if (argc E<gt> 1) {\n"
1650 " int stack_size;\n"
1654 #: build/C/man3/pthread_attr_init.3:256
1656 msgid " attrp = &attr;\n"
1657 msgstr " attrp = &attr;\n"
1660 #: build/C/man3/pthread_attr_init.3:260
1663 " s = pthread_attr_init(&attr);\n"
1665 " handle_error_en(s, \"pthread_attr_init\");\n"
1667 " s = pthread_attr_init(&attr);\n"
1669 " handle_error_en(s, \"pthread_attr_init\");\n"
1672 #: build/C/man3/pthread_attr_init.3:264
1675 " s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1677 " handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1679 " s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1681 " handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1684 #: build/C/man3/pthread_attr_init.3:268
1687 " s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1689 " handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1691 " s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1693 " handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1696 #: build/C/man3/pthread_attr_init.3:270
1698 msgid " stack_size = strtoul(argv[1], NULL, 0);\n"
1699 msgstr " stack_size = strtoul(argv[1], NULL, 0);\n"
1702 #: build/C/man3/pthread_attr_init.3:274
1705 " s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1707 " handle_error_en(s, \"posix_memalign\");\n"
1709 " s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1711 " handle_error_en(s, \"posix_memalign\");\n"
1714 #: build/C/man3/pthread_attr_init.3:276
1716 msgid " printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1717 msgstr " printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1720 #: build/C/man3/pthread_attr_init.3:281
1723 " s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1725 " handle_error_en(s, \"pthread_attr_setstack\");\n"
1728 " s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1730 " handle_error_en(s, \"pthread_attr_setstack\");\n"
1734 #: build/C/man3/pthread_attr_init.3:285 build/C/man3/pthread_getattr_np.3:333
1737 " s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1739 " handle_error_en(s, \"pthread_create\");\n"
1741 " s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1743 " handle_error_en(s, \"pthread_create\");\n"
1746 #: build/C/man3/pthread_attr_init.3:291 build/C/man3/pthread_getattr_np.3:339
1749 " if (attrp != NULL) {\n"
1750 " s = pthread_attr_destroy(attrp);\n"
1752 " handle_error_en(s, \"pthread_attr_destroy\");\n"
1755 " if (attrp != NULL) {\n"
1756 " s = pthread_attr_destroy(attrp);\n"
1758 " handle_error_en(s, \"pthread_attr_destroy\");\n"
1762 #: build/C/man3/pthread_attr_init.3:294 build/C/man3/pthread_getattr_np.3:342
1765 " pause(); /* Terminates when other thread calls exit() */\n"
1768 " pause(); /* Terminates when other thread calls exit() */\n"
1772 #: build/C/man3/pthread_attr_init.3:309
1774 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1775 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1776 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1777 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1778 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1779 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1781 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
1782 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
1783 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
1784 "B<pthread_attr_setscope>(3), B<pthread_attr_setstack>(3), "
1785 "B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), "
1786 "B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1789 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1791 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1792 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1795 #: build/C/man3/pthread_attr_setaffinity_np.3:24
1796 #: build/C/man3/pthread_getattr_np.3:24
1797 #: build/C/man3/pthread_setaffinity_np.3:24
1798 #: build/C/man3/pthread_tryjoin_np.3:24
1804 #: build/C/man3/pthread_attr_setaffinity_np.3:28
1806 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
1807 "affinity attribute in thread attributes object"
1809 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
1810 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
1813 #: build/C/man3/pthread_attr_setaffinity_np.3:32
1814 #: build/C/man3/pthread_getattr_np.3:31
1815 #: build/C/man3/pthread_setaffinity_np.3:32
1816 #: build/C/man3/pthread_tryjoin_np.3:32
1819 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
1820 "B<#include E<lt>pthread.hE<gt>>\n"
1822 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
1823 "B<#include E<lt>pthread.hE<gt>>\n"
1826 #: build/C/man3/pthread_attr_setaffinity_np.3:37
1829 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1830 "B< size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1831 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1832 "B< size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1834 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1835 "B< size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1836 "B<int pthread_attr_getaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1837 "B< size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1840 #: build/C/man3/pthread_attr_setaffinity_np.3:52
1842 "The B<pthread_attr_setaffinity_np>() function sets the CPU affinity mask "
1843 "attribute of the thread attributes object referred to by I<attr> to the "
1844 "value specified in I<cpuset>. This attribute determines the CPU affinity "
1845 "mask of a thread created using the thread attributes object I<attr>."
1847 "B<pthread_attr_setaffinity_np>() 関数は、\n"
1848 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
1849 "I<cpuset> で指定された値に設定する。\n"
1850 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
1851 "作成されたスレッドの CPU affinity マスクが決定される。"
1854 #: build/C/man3/pthread_attr_setaffinity_np.3:61
1856 "The B<pthread_attr_getaffinity_np>() function returns the CPU affinity mask "
1857 "attribute of the thread attributes object referred to by I<attr> in the "
1858 "buffer pointed to by I<cpuset>."
1860 "B<pthread_attr_getaffinity_np>() 関数は、 I<attr> が参照する\n"
1861 "スレッド属性オブジェクトの CPU affinity マスク属性を\n"
1862 "I<cpuset> が指すバッファに入れて返す。"
1865 #: build/C/man3/pthread_attr_setaffinity_np.3:68
1867 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
1868 "by I<cpuset>. Typically, this argument would be specified as I<sizeof"
1871 "I<cpusetsize> 引き数は I<cpuset> が指すバッファの (バイト単位の)\n"
1872 "大きさである。通常は、この引き数には I<sizeof(cpu_set_t)> を\n"
1876 #: build/C/man3/pthread_attr_setaffinity_np.3:74
1877 #: build/C/man3/pthread_setaffinity_np.3:65
1879 "For more details on CPU affinity masks, see B<sched_setaffinity>(2). For a "
1880 "description of a set of macros that can be used to manipulate and inspect "
1881 "CPU sets, see B<CPU_SET>(3)."
1883 "CPU affinity マスクの詳細については、 \n"
1884 "B<sched_setaffinity>(2) を参照してほしい。\n"
1885 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
1886 "B<CPU_SET>(3) を参照してほしい。"
1889 #: build/C/man3/pthread_attr_setaffinity_np.3:78
1890 #: build/C/man3/pthread_attr_setaffinity_np.3:90
1891 #: build/C/man3/pthread_attr_setdetachstate.3:81
1892 #: build/C/man3/pthread_attr_setinheritsched.3:88
1893 #: build/C/man3/pthread_attr_setschedpolicy.3:76
1894 #: build/C/man3/pthread_attr_setscope.3:95
1895 #: build/C/man3/pthread_attr_setstack.3:89
1896 #: build/C/man3/pthread_attr_setstacksize.3:65
1897 #: build/C/man3/pthread_create.3:135 build/C/man3/pthread_detach.3:53
1898 #: build/C/man3/pthread_join.3:83 build/C/man3/pthread_join.3:87
1899 #: build/C/man3/pthread_kill.3:56 build/C/man3/pthread_setaffinity_np.3:82
1900 #: build/C/man3/pthread_setaffinity_np.3:91
1901 #: build/C/man3/pthread_setaffinity_np.3:107
1902 #: build/C/man3/pthread_setcancelstate.3:97
1903 #: build/C/man3/pthread_setcancelstate.3:105
1904 #: build/C/man3/pthread_setconcurrency.3:69
1905 #: build/C/man3/pthread_setschedparam.3:120
1906 #: build/C/man3/pthread_setschedprio.3:60 build/C/man3/pthread_sigqueue.3:75
1912 #. The raw sched_getaffinity() system call returns the size (in bytes)
1913 #. of the cpumask_t type.
1915 #: build/C/man3/pthread_attr_setaffinity_np.3:90
1917 "(B<pthread_attr_setaffinity_np>()) I<cpuset> specified a CPU that was "
1918 "outside the set supported by the kernel. (The kernel configuration option "
1919 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
1920 "type used to represent CPU sets.)"
1922 "(B<pthread_attr_setaffinity_np>())\n"
1923 "I<cpuset> がカーネルがサポートする CPU 集合にない CPU を指定していた。\n"
1924 "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲は、\n"
1925 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
1928 #: build/C/man3/pthread_attr_setaffinity_np.3:100
1930 "(B<pthread_attr_getaffinity_np>()) A CPU in the affinity mask of the thread "
1931 "attributes object referred to by I<attr> lies outside the range specified by "
1932 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
1934 "(B<pthread_attr_getaffinity_np>())\n"
1935 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
1936 "I<cpusetsize> により指定された範囲の中になかった\n"
1937 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
1940 #: build/C/man3/pthread_attr_setaffinity_np.3:104
1941 msgid "(B<pthread_attr_setaffinity_np>()) Could not allocate memory."
1942 msgstr "(B<pthread_attr_setaffinity_np>()) メモリを割り当てることができなかった。"
1945 #: build/C/man3/pthread_attr_setaffinity_np.3:106
1946 #: build/C/man3/pthread_setaffinity_np.3:119
1947 msgid "These functions are provided by glibc since version 2.3.4."
1948 msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。"
1951 #: build/C/man3/pthread_attr_setaffinity_np.3:109
1952 #: build/C/man3/pthread_cleanup_push_defer_np.3:102
1953 #: build/C/man3/pthread_setaffinity_np.3:122
1954 #: build/C/man3/pthread_tryjoin_np.3:113
1956 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
1957 "\" (nonportable) in the names."
1959 "これらの関数は非標準の GNU による拡張である。\n"
1960 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
1964 #: build/C/man3/pthread_attr_setaffinity_np.3:116
1965 #: build/C/man3/pthread_setaffinity_np.3:148
1967 "In glibc 2.3.3 only, versions of these functions were provided that did not "
1968 "have a I<cpusetsize> argument. Instead the CPU set size given to the "
1969 "underlying system calls was always I<sizeof(cpu_set_t)>."
1971 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
1972 "これらの関数は I<cpusetsize> 引き数を持っていなかった。\n"
1973 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
1974 "常に I<sizeof(cpu_set_t)> であった。"
1977 #: build/C/man3/pthread_attr_setaffinity_np.3:122
1979 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1980 "(3), B<cpuset>(7), B<pthreads>(7)"
1982 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>"
1983 "(3), B<cpuset>(7), B<pthreads>(7)"
1986 #: build/C/man3/pthread_attr_setdetachstate.3:24
1988 msgid "PTHREAD_ATTR_SETDETACHSTATE"
1989 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
1992 #: build/C/man3/pthread_attr_setdetachstate.3:24
1993 #: build/C/man3/pthread_attr_setschedpolicy.3:24
1999 #: build/C/man3/pthread_attr_setdetachstate.3:28
2001 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
2002 "state attribute in thread attributes object"
2004 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
2005 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
2008 #: build/C/man3/pthread_attr_setdetachstate.3:36
2011 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2012 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2014 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2015 "B<int pthread_attr_getdetachstate(pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
2018 #: build/C/man3/pthread_attr_setdetachstate.3:51
2020 "The B<pthread_attr_setdetachstate>() function sets the detach state "
2021 "attribute of the thread attributes object referred to by I<attr> to the "
2022 "value specified in I<detachstate>. The detach state attribute determines "
2023 "whether a thread created using the thread attributes object I<attr> will be "
2024 "created in a joinable or a detached state."
2026 "B<pthread_attr_setdetachstate>() 関数は、\n"
2027 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
2028 "I<detachstate> で指定された値に設定する。\n"
2029 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2030 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
2031 "detached (切り離された) 状態で作成されるかが決定される。"
2034 #: build/C/man3/pthread_attr_setdetachstate.3:54
2035 msgid "The following values may be specified in I<detachstate>:"
2036 msgstr "I<detachstate> には以下の値を指定できる。"
2039 #: build/C/man3/pthread_attr_setdetachstate.3:54
2041 msgid "B<PTHREAD_CREATE_DETACHED>"
2042 msgstr "B<PTHREAD_CREATE_DETACHED>"
2045 #: build/C/man3/pthread_attr_setdetachstate.3:59
2047 "Threads that are created using I<attr> will be created in a detached state."
2048 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
2051 #: build/C/man3/pthread_attr_setdetachstate.3:59
2053 msgid "B<PTHREAD_CREATE_JOINABLE>"
2054 msgstr "B<PTHREAD_CREATE_JOINABLE>"
2057 #: build/C/man3/pthread_attr_setdetachstate.3:64
2059 "Threads that are created using I<attr> will be created in a joinable state."
2060 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
2063 #: build/C/man3/pthread_attr_setdetachstate.3:68
2065 "The default setting of the detach state attribute in a newly initialized "
2066 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
2068 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
2069 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
2072 #: build/C/man3/pthread_attr_setdetachstate.3:75
2074 "The B<pthread_attr_getdetachstate>() returns the detach state attribute of "
2075 "the thread attributes object I<attr> in the buffer pointed to by "
2078 "B<pthread_attr_getdetachstate>() は、\n"
2079 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
2080 "I<detachstate> が指すバッファに入れて返す。"
2083 #: build/C/man3/pthread_attr_setdetachstate.3:81
2084 msgid "B<pthread_attr_setdetachstate>() can fail with the following error:"
2085 msgstr "B<pthread_attr_setdetachstate>() は以下のエラーで失敗する場合がある。"
2088 #: build/C/man3/pthread_attr_setdetachstate.3:85
2089 msgid "An invalid value was specified in I<detachstate>."
2090 msgstr "無効な値が I<detachstate> で指定された。"
2093 #: build/C/man3/pthread_attr_setdetachstate.3:91
2095 "See B<pthread_create>(3) for more details on detached and joinable threads."
2097 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
2098 "B<pthread_create>(3) を参照。"
2101 #: build/C/man3/pthread_attr_setdetachstate.3:99
2103 "A thread that is created in a joinable state should eventually either be "
2104 "joined using B<pthread_join>(3) or detached using B<pthread_detach>(3); see "
2105 "B<pthread_create>(3)."
2107 "join 可能状態で作成されたスレッドは、最終的に\n"
2108 "B<pthread_join>(3) を使って join するか、\n"
2109 "B<pthread_detach>(3) を使って切り離すか、\n"
2113 #: build/C/man3/pthread_attr_setdetachstate.3:106
2115 "It is an error to specify the thread ID of a thread that was created in a "
2116 "detached state in a later call to B<pthread_detach>(3) or B<pthread_join>"
2119 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
2120 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
2124 #: build/C/man3/pthread_attr_setdetachstate.3:109
2125 #: build/C/man3/pthread_attr_setstack.3:154
2126 msgid "See B<pthread_attr_init>(3)."
2127 msgstr "B<pthread_attr_init>(3) を参照。"
2130 #: build/C/man3/pthread_attr_setdetachstate.3:115
2132 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2133 "B<pthread_join>(3), B<pthreads>(7)"
2135 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2136 "B<pthread_join>(3), B<pthreads>(7)"
2139 #: build/C/man3/pthread_attr_setguardsize.3:24
2141 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2142 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2145 #: build/C/man3/pthread_attr_setguardsize.3:24
2146 #: build/C/man3/pthread_attr_setscope.3:24
2147 #: build/C/man3/pthread_attr_setstack.3:24
2148 #: build/C/man3/pthread_attr_setstackaddr.3:24 build/C/man3/pthread_self.3:24
2154 #: build/C/man3/pthread_attr_setguardsize.3:28
2156 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2157 "attribute in thread attributes object"
2159 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
2160 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
2163 #: build/C/man3/pthread_attr_setguardsize.3:36
2166 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2167 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2169 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2170 "B<int pthread_attr_getguardsize(pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
2173 #: build/C/man3/pthread_attr_setguardsize.3:47
2175 "The B<pthread_attr_setguardsize>() function sets the guard size attribute "
2176 "of the thread attributes object referred to by I<attr> to the value "
2177 "specified in I<guardsize>."
2179 "B<pthread_attr_setguardsize>() 関数は、\n"
2180 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
2181 "I<guardsize> で指定された値に設定する。"
2184 #: build/C/man3/pthread_attr_setguardsize.3:57
2186 "If I<guardsize> is greater than 0, then for each new thread created using "
2187 "I<attr> the system allocates an additional region of at least I<guardsize> "
2188 "bytes at the end of the thread's stack to act as the guard area for the "
2189 "stack (but see BUGS)."
2191 "I<guardsize> が 0 より大きい場合、\n"
2192 "I<attr> を使って新しく作成された各スレッドに対して、\n"
2193 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
2194 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
2195 "機能する (ただし「バグ」の節も参照)。"
2198 #: build/C/man3/pthread_attr_setguardsize.3:63
2200 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2203 "I<guardsize> が 0 の場合、\n"
2204 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
2207 #: build/C/man3/pthread_attr_setguardsize.3:65
2208 msgid "The default guard size is the same as the system page size."
2209 msgstr "デフォルトの guard size はシステムのページサイズと同じである。"
2212 #: build/C/man3/pthread_attr_setguardsize.3:80
2214 "If the stack address attribute has been set in I<attr> (using "
2215 "B<pthread_attr_setstack>(3) or B<pthread_attr_setstackaddr>(3)), meaning "
2216 "that the caller is allocating the thread's stack, then the guard size "
2217 "attribute is ignored (i.e., no guard area is created by the system): it is "
2218 "the application's responsibility to handle stack overflow (perhaps by using "
2219 "B<mprotect>(2) to manually define a guard area at the end of the stack that "
2220 "it has allocated)."
2222 "(B<pthread_attr_setstack>(3) や B<pthread_attr_setstackaddr>(3)を使って)\n"
2223 "I<attr> でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n"
2224 "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n"
2225 "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n"
2226 "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n"
2227 "ケーション側の責任となる (おそらく B<mprotect>(2) を使って、割り当て\n"
2228 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
2231 #: build/C/man3/pthread_attr_setguardsize.3:88
2233 "The B<pthread_attr_getguardsize>() function returns the guard size "
2234 "attribute of the thread attributes object referred to by I<attr> in the "
2235 "buffer pointed to by I<guardsize>."
2237 "B<pthread_attr_getguardsize>() は、\n"
2238 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
2239 "I<guardsize> が指すバッファに入れて返す。"
2242 #: build/C/man3/pthread_attr_setguardsize.3:102
2244 "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is "
2245 "invalid. On Linux these functions always succeed (but portable and future-"
2246 "proof applications should nevertheless handle a possible error return)."
2248 "POSIX.1-2001 では、エラー B<EINVAL> が\n"
2249 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2250 "Linux では、これらの関数は常に作成する\n"
2251 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2252 "正のエラーの返り値を処理するようにすべきである)。"
2255 #: build/C/man3/pthread_attr_setguardsize.3:104
2256 #: build/C/man3/pthread_attr_setstackaddr.3:81
2257 #: build/C/man3/pthread_attr_setstacksize.3:81
2258 msgid "These functions are provided by glibc since version 2.1."
2259 msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。"
2262 #: build/C/man3/pthread_attr_setguardsize.3:120
2264 "A guard area consists of virtual memory pages that are protected to prevent "
2265 "read and write access. If a thread overflows its stack into the guard area, "
2266 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2267 "notifying it of the overflow. Guard areas start on page boundaries, and the "
2268 "guard size is internally rounded up to the system page size when creating a "
2269 "thread. (Nevertheless, B<pthread_attr_getguardsize>() returns the guard "
2270 "size that was set by B<pthread_attr_setguardsize>().)"
2272 "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n"
2273 "られた仮想メモリページで構成で構成される。スレッドがスタックをガード\n"
2274 "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャ\n"
2275 "では、スレッドに B<SIGSEGV> シグナルが送られ、オーバーフローが発生した\n"
2276 "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n"
2277 "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n"
2278 "(その場合も B<pthread_attr_getguardsize>() では\n"
2279 "B<pthread_attr_setguardsize>() で設定された guard size が返される)。"
2282 #: build/C/man3/pthread_attr_setguardsize.3:124
2284 "Setting a guard size of 0 may be useful to save memory in an application "
2285 "that creates many threads and knows that stack overflow can never occur."
2287 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2288 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2289 "することで、メモリを節約できることもある。"
2292 #: build/C/man3/pthread_attr_setguardsize.3:128
2294 "Choosing a guard size larger than the default size may be necessary for "
2295 "detecting stack overflows if a thread allocates large data structures on the "
2298 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2299 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2300 "大きな guard size を選ぶ必要があるかもしれない。"
2303 #: build/C/man3/pthread_attr_setguardsize.3:128
2304 #: build/C/man3/pthread_attr_setinheritsched.3:101
2305 #: build/C/man3/pthread_attr_setstacksize.3:94
2306 #: build/C/man3/pthread_create.3:194 build/C/man3/pthread_exit.3:91
2312 #: build/C/man3/pthread_attr_setguardsize.3:139
2314 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2315 "within the stack size allocation, rather than allocating extra space at the "
2316 "end of the stack, as POSIX.1 requires. (This can result in an B<EINVAL> "
2317 "error from B<pthread_create>(3) if the guard size value is too large, "
2318 "leaving no space for the actual stack.)"
2320 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2321 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2322 "末尾に追加の領域を割り当てることが求められている。\n"
2323 "(このため、ガード領域が大きすぎて、\n"
2324 "実際のスタック用の場所がなくなってしまう場合、\n"
2325 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2327 #. glibc includes the guardsize within the allocated stack size,
2328 #. which looks pretty clearly to be in violation of POSIX.
2329 #. Filed bug, 22 Oct 2008:
2330 #. http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2332 #. https//bugzilla.redhat.com/show_bug.cgi?id=435337
2333 #. Reportedly, LinuxThreads did the right thing, allocating
2334 #. extra space at the end of the stack:
2335 #. http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2337 #: build/C/man3/pthread_attr_setguardsize.3:153
2339 "The obsolete LinuxThreads implementation did the right thing, allocating "
2340 "extra space at the end of the stack for the guard area."
2342 "廃止予定の LinuxThreads 実装では、\n"
2343 "POSIX.1 で求められている通りの動作で、\n"
2344 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2347 #: build/C/man3/pthread_attr_setguardsize.3:156
2348 msgid "See B<pthread_getattr_np>(3)."
2349 msgstr "B<pthread_getattr_np>(3) を参照。"
2352 #: build/C/man3/pthread_attr_setguardsize.3:164
2354 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2355 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2357 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>"
2358 "(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2361 #: build/C/man3/pthread_attr_setinheritsched.3:24
2363 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2364 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2367 #: build/C/man3/pthread_attr_setinheritsched.3:24
2368 #: build/C/man3/pthread_attr_setschedparam.3:24
2369 #: build/C/man3/pthread_attr_setstacksize.3:24
2370 #: build/C/man3/pthread_create.3:24
2376 #: build/C/man3/pthread_attr_setinheritsched.3:28
2378 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit "
2379 "scheduler attribute in thread attributes object"
2381 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - \n"
2382 "スレッド属性オブジェクトの inherit scheduler 属性の設定/取得を行う"
2385 #: build/C/man3/pthread_attr_setinheritsched.3:36
2388 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2389 "B< int >I<inheritsched>B<);>\n"
2390 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2391 "B< int *>I<inheritsched>B<);>\n"
2393 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2394 "B< int >I<inheritsched>B<);>\n"
2395 "B<int pthread_attr_getinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2396 "B< int *>I<inheritsched>B<);>\n"
2399 #: build/C/man3/pthread_attr_setinheritsched.3:53
2401 "The B<pthread_attr_setinheritsched>() function sets the inherit scheduler "
2402 "attribute of the thread attributes object referred to by I<attr> to the "
2403 "value specified in I<inheritsched>. The inherit scheduler attribute "
2404 "determines whether a thread created using the thread attributes object "
2405 "I<attr> will inherit its scheduling attributes from the calling thread or "
2406 "whether it will take them from I<attr>."
2408 "B<pthread_attr_setinheritsched>() 関数は、\n"
2409 "I<attr> が参照するスレッド属性オブジェクトの inherit scheduler 属性を\n"
2410 "I<inheritsched> で指定された値に設定する。\n"
2411 "inherit scheduler 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2412 "作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承\n"
2413 "するか、I<attr> からスケジューリング属性を取得するかが決定される。"
2416 #: build/C/man3/pthread_attr_setinheritsched.3:56
2417 msgid "The following values may be specified in I<inheritsched>:"
2418 msgstr "以下の値を I<inheritsched> に指定できる。"
2421 #: build/C/man3/pthread_attr_setinheritsched.3:56
2423 msgid "B<PTHREAD_INHERIT_SCHED>"
2424 msgstr "B<PTHREAD_INHERIT_SCHED>"
2427 #: build/C/man3/pthread_attr_setinheritsched.3:64
2429 "Threads that are created using I<attr> inherit scheduling attributes from "
2430 "the creating thread; the scheduling attributes in I<attr> are ignored."
2432 "I<attr> を使って作成されたスレッドは、\n"
2433 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2434 "I<attr> 内のスケジューリング属性は無視される。"
2437 #: build/C/man3/pthread_attr_setinheritsched.3:64
2439 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2440 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2442 #. FIXME what are the defaults for scheduler settings?
2444 #: build/C/man3/pthread_attr_setinheritsched.3:71
2446 "Threads that are created using I<attr> take their scheduling attributes from "
2447 "the values specified by the attributes object."
2449 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2450 "指定された値からスケジューリング属性を取得する。"
2453 #: build/C/man3/pthread_attr_setinheritsched.3:75
2455 "The default setting of the inherit scheduler attribute in a newly "
2456 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2458 "新たに初期化されたスレッド属性オブジェクトの inherit scheduler 属性の\n"
2459 "デフォルト設定は B<PTHREAD_INHERIT_SCHED> である。"
2462 #: build/C/man3/pthread_attr_setinheritsched.3:82
2464 "The B<pthread_attr_getinheritsched>() returns the inherit scheduler "
2465 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2466 "by I<inheritsched>."
2468 "B<pthread_attr_getinheritsched>() は、\n"
2469 "スレッド属性オブジェクト I<attr> の inherit scheduler 属性を\n"
2470 "I<inheritsched> が指すバッファに入れて返す。"
2473 #: build/C/man3/pthread_attr_setinheritsched.3:88
2474 msgid "B<pthread_attr_setinheritsched>() can fail with the following error:"
2475 msgstr "B<pthread_attr_setinheritsched>() は以下のエラーで失敗する場合がある。"
2478 #: build/C/man3/pthread_attr_setinheritsched.3:92
2479 msgid "Invalid value in I<inheritsched>."
2480 msgstr "I<inheritsched> に無効な値が指定された。"
2483 #. Available since glibc 2.0.
2485 #: build/C/man3/pthread_attr_setinheritsched.3:99
2487 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2488 "to set the attribute to an unsupported value\") for "
2489 "B<pthread_attr_setinheritsched>()."
2491 "POSIX.1-2001 では、 B<pthread_attr_setinheritsched>() に関して\n"
2492 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2495 #. FIXME . Track status of the following bug:
2496 #. http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2498 #: build/C/man3/pthread_attr_setinheritsched.3:117
2500 "As at glibc 2.8, if a thread attributes object is initialized using "
2501 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2502 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0. However, "
2503 "if the inherit scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2504 "then a thread created using the attribute object wrongly inherits its "
2505 "scheduling attributes from the creating thread. This bug does not occur if "
2506 "either the scheduling policy or scheduling priority attribute is explicitly "
2507 "set in the thread attributes object before calling B<pthread_create>(3)."
2509 "glibc 2.8 の時点では、スレッド属性オブジェクトが\n"
2510 "B<pthread_attr_init>(3) を使って初期化された場合、\n"
2511 "スレッド属性オブジェクトのスケジューリングポリシーが B<SCHED_OTHER> に、\n"
2512 "スケジューリング優先度が 0 に設定される。一方、その後 inherit\n"
2513 "scheduling 属性に B<PTHREAD_EXPLICIT_SCHED> が設定されると、このスレッ\n"
2514 "ド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するス\n"
2515 "レッドのスケジューリング属性が間違って継承されてしまう。\n"
2516 "B<pthread_create>(3) を呼び出す前にスケジューリングポリシー属性か\n"
2517 "スケジューリング優先度属性のどちらかが明示的に設定された場合には、\n"
2521 #: build/C/man3/pthread_attr_setinheritsched.3:120
2522 #: build/C/man3/pthread_attr_setschedparam.3:96
2523 #: build/C/man3/pthread_attr_setschedpolicy.3:92
2524 msgid "See B<pthread_setschedparam>(3)."
2525 msgstr "B<pthread_setschedparam>(3) を参照。"
2528 #: build/C/man3/pthread_attr_setinheritsched.3:129
2530 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2531 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2532 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2533 "(3), B<pthreads>(7)"
2535 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2536 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2537 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2538 "(3), B<pthreads>(7)"
2541 #: build/C/man3/pthread_attr_setschedparam.3:24
2543 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2544 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2547 #: build/C/man3/pthread_attr_setschedparam.3:28
2549 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
2550 "parameter attributes in thread attributes object"
2552 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
2553 "スレッド属性オブジェクトのスケジューリングパラメータ属性の設定/取得を行う"
2556 #: build/C/man3/pthread_attr_setschedparam.3:36
2559 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2560 "B< const struct sched_param *>I<param>B<);>\n"
2561 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2562 "B< struct sched_param *>I<param>B<);>\n"
2564 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2565 "B< const struct sched_param *>I<param>B<);>\n"
2566 "B<int pthread_attr_getschedparam(pthread_attr_t *>I<attr>B<,>\n"
2567 "B< struct sched_param *>I<param>B<);>\n"
2570 #: build/C/man3/pthread_attr_setschedparam.3:50
2572 "The B<pthread_attr_setschedparam>() function sets the scheduling parameter "
2573 "attributes of the thread attributes object referred to by I<attr> to the "
2574 "values specified in the buffer pointed to by I<param>. These attributes "
2575 "determine the scheduling parameters of a thread created using the thread "
2576 "attributes object I<attr>."
2578 "B<pthread_attr_setschedparam>() 関数は、\n"
2579 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2580 "パラメータ属性を I<param> が指すバッファで指定された値に設定する。\n"
2581 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2582 "作成されるスレッドのスケジューリングパラメータが決定される。"
2585 #: build/C/man3/pthread_attr_setschedparam.3:57
2587 "The B<pthread_attr_getschedparam>() returns the scheduling parameter "
2588 "attributes of the thread attributes object I<attr> in the buffer pointed to "
2591 "B<pthread_attr_getschedparam>() は、\n"
2592 "スレッド属性オブジェクト I<attr> のスケジューリングパラメータ属性を\n"
2593 "I<param> が指すバッファに入れて返す。"
2596 #: build/C/man3/pthread_attr_setschedparam.3:59
2597 msgid "Scheduling parameters are maintained in the following structure:"
2598 msgstr "スケジューリングパラメータは以下の構造体で管理される。"
2601 #: build/C/man3/pthread_attr_setschedparam.3:65
2602 #: build/C/man3/pthread_setschedparam.3:67
2605 "struct sched_param {\n"
2606 " int sched_priority; /* Scheduling priority */\n"
2609 "struct sched_param {\n"
2610 " int sched_priority; /* Scheduling priority */\n"
2614 #: build/C/man3/pthread_attr_setschedparam.3:72
2615 #: build/C/man3/pthread_setschedparam.3:74
2617 "As can be seen, only one scheduling parameter is supported. For details of "
2618 "the permitted ranges for scheduling priorities in each scheduling policy, "
2619 "see B<sched_setscheduler>(2)."
2621 "見て分かる通り、サポートされているスケジューリングパラメータは一つだけ\n"
2622 "である。各スケジューリングポリシーで許可されるスケジューリング優先度の\n"
2623 "詳細については、B<sched_setscheduler>(2) を参照のこと。"
2626 #. Available since glibc 2.0.
2628 #: build/C/man3/pthread_attr_setschedparam.3:87
2630 "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
2631 "B<pthread_attr_setschedparam>(). On Linux these functions always succeed "
2632 "(but portable and future-proof applications should nevertheless handle a "
2633 "possible error return)."
2636 "B<pthread_attr_setschedparam>() について\n"
2637 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
2638 "Linux では、これらの関数は常に作成する\n"
2639 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2640 "正のエラーの返り値を処理するようにすべきである)。"
2643 #: build/C/man3/pthread_attr_setschedparam.3:93
2645 "See B<pthread_attr_setschedpolicy>(3) for a list of the thread scheduling "
2646 "policies supported on Linux."
2648 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
2649 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
2652 #: build/C/man3/pthread_attr_setschedparam.3:106
2654 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2655 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2656 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2657 "(3), B<pthreads>(7)"
2659 "B<sched_get_priority_min>(2), B<sched_setscheduler>(2), B<pthread_attr_init>"
2660 "(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
2661 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2662 "(3), B<pthreads>(7)"
2665 #: build/C/man3/pthread_attr_setschedpolicy.3:24
2667 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2668 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2671 #: build/C/man3/pthread_attr_setschedpolicy.3:28
2673 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
2674 "scheduling policy attribute in thread attributes object"
2676 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
2677 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
2680 #: build/C/man3/pthread_attr_setschedpolicy.3:36
2683 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2684 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2686 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2687 "B<int pthread_attr_getschedpolicy(pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2690 #: build/C/man3/pthread_attr_setschedpolicy.3:50
2692 "The B<pthread_attr_setschedpolicy>() function sets the scheduling policy "
2693 "attribute of the thread attributes object referred to by I<attr> to the "
2694 "value specified in I<policy>. This attribute determines the scheduling "
2695 "policy of a thread created using the thread attributes object I<attr>."
2697 "B<pthread_attr_setschedpolicy>() 関数は、\n"
2698 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2699 "ポリシー属性を I<policy> で指定された値に設定する。\n"
2700 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2701 "作成されるスレッドのスケジューリングポリシーが決定される。"
2703 #. FIXME . pthread_setschedparam() places no restriction on the policy,
2704 #. but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2705 #. http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2707 #: build/C/man3/pthread_attr_setschedpolicy.3:63
2709 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
2710 "B<SCHED_OTHER>, with the semantics described in B<sched_setscheduler>(2)."
2712 "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER>\n"
2713 "である。それぞれの意味は B<sched_setscheduler>(2) で説明している通り\n"
2717 #: build/C/man3/pthread_attr_setschedpolicy.3:70
2719 "The B<pthread_attr_getschedpolicy>() returns the scheduling policy "
2720 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2723 "B<pthread_attr_getschedpolicy>() は、\n"
2724 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
2725 "I<policy> が指すバッファに入れて返す。"
2728 #: build/C/man3/pthread_attr_setschedpolicy.3:76
2729 msgid "B<pthread_attr_setschedpolicy>() can fail with the following error:"
2730 msgstr "B<pthread_attr_setschedpolicy>() は以下のエラーで失敗する場合がある。"
2733 #: build/C/man3/pthread_attr_setschedpolicy.3:80
2734 msgid "Invalid value in I<policy>."
2735 msgstr "I<policy> に無効な値が指定された。"
2738 #. Available since glibc 2.0.
2740 #: build/C/man3/pthread_attr_setschedpolicy.3:87
2742 "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made "
2743 "to set the attribute to an unsupported value\") for "
2744 "B<pthread_attr_setschedpolicy>()."
2746 "POSIX.1-2001 では、 B<pthread_attr_setschedpolicy>() に関して\n"
2747 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2751 #: build/C/man3/pthread_attr_setschedpolicy.3:101
2753 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2754 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2755 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2756 "(3), B<pthreads>(7)"
2758 "B<sched_setscheduler>(2), B<pthread_attr_init>(3), "
2759 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2760 "B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>"
2761 "(3), B<pthreads>(7)"
2764 #: build/C/man3/pthread_attr_setscope.3:24
2766 msgid "PTHREAD_ATTR_SETSCOPE"
2767 msgstr "PTHREAD_ATTR_SETSCOPE"
2770 #: build/C/man3/pthread_attr_setscope.3:28
2772 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
2773 "attribute in thread attributes object"
2775 "pthread_attr_setscope, pthread_attr_getscope - \n"
2776 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
2779 #: build/C/man3/pthread_attr_setscope.3:36
2782 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2783 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2785 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2786 "B<int pthread_attr_getscope(pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2789 #: build/C/man3/pthread_attr_setscope.3:51
2791 "The B<pthread_attr_setscope>() function sets the contention scope attribute "
2792 "of the thread attributes object referred to by I<attr> to the value "
2793 "specified in I<scope>. The contention scope attribute defines the set of "
2794 "threads against which a thread competes for resources such as the CPU. "
2795 "POSIX.1-2001 specifies two possible values for I<scope>:"
2797 "B<pthread_attr_setscope>() 関数は、\n"
2798 "I<attr> が参照するスレッド属性オブジェクトの contention scope\n"
2799 "属性を I<scope> で指定された値に設定する。\n"
2800 "contention scope 属性により、\n"
2801 "スレッドが CPU などのリソースを取り合うスレッド集合が規定される。\n"
2802 "POSIX.1-2001 では I<scope> に指定する値として 2 つの値が規定されている。"
2805 #: build/C/man3/pthread_attr_setscope.3:51
2807 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2808 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2811 #: build/C/man3/pthread_attr_setscope.3:59
2813 "The thread competes for resources with all other threads in all processes on "
2814 "the system that are in the same scheduling allocation domain (a group of one "
2815 "or more processors). B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
2816 "to one another according to their scheduling policy and priority."
2820 #: build/C/man3/pthread_attr_setscope.3:59
2822 msgid "B<PTHREAD_SCOPE_PROCESS>"
2823 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2826 #: build/C/man3/pthread_attr_setscope.3:74
2828 "The thread competes for resources with all other threads in the same process "
2829 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope. "
2830 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
2831 "the process according to their scheduling policy and priority. POSIX.1-2001 "
2832 "leaves it unspecified how these threads contend with other threads in other "
2833 "process on the system or with other threads in the same process that were "
2834 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
2838 #: build/C/man3/pthread_attr_setscope.3:81
2840 "POSIX.1-2001 only requires that an implementation support one of these "
2841 "contention scopes, but permits both to be supported. Linux supports "
2842 "B<PTHREAD_SCOPE_SYSTEM>, but not B<PTHREAD_SCOPE_PROCESS>."
2846 #: build/C/man3/pthread_attr_setscope.3:89
2848 "The B<pthread_attr_getscope>() function returns the contention scope "
2849 "attribute of the thread attributes object referred to by I<attr> in the "
2850 "buffer pointed to by I<scope>."
2852 "B<pthread_attr_getscope>() は、\n"
2853 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
2854 "I<scope> が指すバッファに入れて返す。"
2857 #: build/C/man3/pthread_attr_setscope.3:95
2858 msgid "B<pthread_attr_setscope>() can fail with the following errors:"
2859 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
2862 #: build/C/man3/pthread_attr_setscope.3:99
2863 msgid "An invalid value was specified in I<scope>."
2864 msgstr "I<scope> に無効な値が指定された。"
2867 #: build/C/man3/pthread_attr_setscope.3:99
2873 #: build/C/man3/pthread_attr_setscope.3:105
2875 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
2876 "supported on Linux."
2878 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
2879 "この値は Linux でサポートされていない。"
2882 #: build/C/man3/pthread_attr_setscope.3:115
2884 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a "
2885 "userspace thread is bound directly to a single kernel-scheduling entity. "
2886 "This is the case on Linux for the obsolete LinuxThreads implementation and "
2887 "the modern NPTL implementation, which are both 1:1 threading implementations."
2891 #: build/C/man3/pthread_attr_setscope.3:118
2893 "POSIX.1-2001 specifies that the default contention scope is implementation-"
2896 "POSIX.1-2001 では、 contention scope 属性のデフォルト値は\n"
2897 "実装時で定義されるものと規定されている。"
2900 #: build/C/man3/pthread_attr_setscope.3:126
2902 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2903 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2904 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2906 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
2907 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
2908 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2911 #: build/C/man3/pthread_attr_setstack.3:24
2913 msgid "PTHREAD_ATTR_SETSTACK"
2914 msgstr "PTHREAD_ATTR_SETSTACK"
2917 #: build/C/man3/pthread_attr_setstack.3:28
2919 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
2920 "thread attributes object"
2922 "pthread_attr_setstack, pthread_attr_getstack - \n"
2923 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
2926 #: build/C/man3/pthread_attr_setstack.3:36
2929 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2930 "B< void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2931 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2932 "B< void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2934 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2935 "B< void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2936 "B<int pthread_attr_getstack(pthread_attr_t *>I<attr>B<,>\n"
2937 "B< void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2940 #: build/C/man3/pthread_attr_setstack.3:43 build/C/man3/pthread_sigqueue.3:39
2942 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
2943 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7) 参照):"
2946 #: build/C/man3/pthread_attr_setstack.3:48
2947 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2948 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2951 #: build/C/man3/pthread_attr_setstack.3:50
2952 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2953 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2956 #: build/C/man3/pthread_attr_setstack.3:66
2958 "The B<pthread_attr_setstack>() function sets the stack address and stack "
2959 "size attributes of the thread attributes object referred to by I<attr> to "
2960 "the values specified in I<stackaddr> and I<stacksize>, respectively. These "
2961 "attributes specify the location and size of the stack that should be used by "
2962 "a thread that is created using the thread attributes object I<attr>."
2964 "B<pthread_attr_setstack>() 関数は、\n"
2965 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
2966 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
2968 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2969 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
2972 #: build/C/man3/pthread_attr_setstack.3:72
2974 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
2975 "I<stacksize> bytes that was allocated by the caller. The pages of the "
2976 "allocated buffer should be both readable and writable."
2978 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
2979 "バッファ内の指定できる最小のアドレスバイトを指すべきである。\n"
2980 "割り当てられたバッファのページは読み書き両方が可能なページとなっている\n"
2984 #: build/C/man3/pthread_attr_setstack.3:83
2986 "The B<pthread_attr_getstack>() function returns the stack address and stack "
2987 "size attributes of the thread attributes object referred to by I<attr> in "
2988 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
2990 "B<pthread_attr_getstack>() 関数は、\n"
2991 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
2992 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
2996 #: build/C/man3/pthread_attr_setstack.3:89
2997 msgid "B<pthread_attr_setstack>() can fail with the following error:"
2998 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
3001 #: build/C/man3/pthread_attr_setstack.3:100
3003 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes. On some "
3004 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
3005 "stacksize> is not suitably aligned."
3007 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
3008 "システムによっては、 I<stackaddr> か\n"
3009 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
3013 #: build/C/man3/pthread_attr_setstack.3:108
3015 "POSIX.1-2001 also documents an B<EACCES> error if the stack area described "
3016 "by I<stackaddr> and I<stacksize> is not both readable and writable by the "
3019 "POSIX.1-2001 では エラー B<EACCES> も規定されており、\n"
3020 "このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に\n"
3021 "呼び出し側から読み書き両方のアクセスができない状況を表す。"
3024 #: build/C/man3/pthread_attr_setstack.3:110
3025 msgid "These functions are provided by glibc since version 2.2."
3026 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
3029 #: build/C/man3/pthread_attr_setstack.3:120
3031 "These functions are provided for applications that must ensure that a "
3032 "thread's stack is placed in a particular location. For most applications, "
3033 "this is not necessary, and the use of these functions should be avoided. "
3034 "(Use B<pthread_attr_setstacksize>(3) if an application simply requires a "
3035 "stack size other than the default.)"
3037 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
3038 "しなければならないアプリケーションのために提供されている。\n"
3039 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
3040 "これらの関数を使うのは避けるべきである。\n"
3041 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
3042 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
3045 #: build/C/man3/pthread_attr_setstack.3:131
3047 "When an application employs B<pthread_attr_setstack>(), it takes over the "
3048 "responsibility of allocating the stack. Any guard size value that was set "
3049 "using B<pthread_attr_setguardsize>(3) is ignored. If deemed necessary, it "
3050 "is the application's responsibility to allocate a guard area (one or more "
3051 "pages protected against reading and writing) to handle the possibility of "
3054 "アプリケーションが B<pthread_attr_setstack>() を利用する際には、\n"
3055 "スタックの割り当てに責任を持つ必要がある。\n"
3056 "B<pthread_attr_setguardsize>(3) を使って設定された\n"
3057 "guard size の値は無視される。\n"
3058 "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n"
3059 "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n"
3060 "スタックオーバーフローの可能性に対処するようにする必要がある。"
3063 #: build/C/man3/pthread_attr_setstack.3:142
3065 "The address specified in I<stackaddr> should be suitably aligned: for full "
3066 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>). "
3067 "B<posix_memalign>(3) may be useful for allocation. Probably, I<stacksize> "
3068 "should also be a multiple of the system page size."
3070 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
3071 "完全な移植性を持たせるためには、\n"
3072 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
3073 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
3074 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
3077 #: build/C/man3/pthread_attr_setstack.3:151
3079 "If I<attr> is used to create multiple threads, then the caller must change "
3080 "the stack address attribute between calls to B<pthread_create>(3); "
3081 "otherwise, the threads will attempt to use the same memory area for their "
3082 "stacks, and chaos will ensue."
3084 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
3085 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
3086 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
3087 "さもなければ、複数のスレッドがスタックとして同じメモリ領域を\n"
3088 "使おうとするため、訳の分からない状況が発生してしまう。"
3091 #: build/C/man3/pthread_attr_setstack.3:164
3093 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3094 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3095 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3097 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3098 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3099 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3102 #: build/C/man3/pthread_attr_setstackaddr.3:24
3104 msgid "PTHREAD_ATTR_SETSTACKADDR"
3105 msgstr "PTHREAD_ATTR_SETSTACKADDR"
3108 #: build/C/man3/pthread_attr_setstackaddr.3:28
3110 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
3111 "attribute in thread attributes object"
3113 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
3114 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
3117 #: build/C/man3/pthread_attr_setstackaddr.3:36
3120 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3121 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3123 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3124 "B<int pthread_attr_getstackaddr(pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
3127 #: build/C/man3/pthread_attr_setstackaddr.3:47
3129 "These functions are obsolete: B<do not use them.> Use "
3130 "B<pthread_attr_setstack>(3) and B<pthread_attr_getstack>(3) instead."
3132 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
3133 "代わりに Use B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使うこと。"
3136 #: build/C/man3/pthread_attr_setstackaddr.3:58
3138 "The B<pthread_attr_setstackaddr>() function sets the stack address "
3139 "attribute of the thread attributes object referred to by I<attr> to the "
3140 "value specified in I<stackaddr>. This attribute specifies the location of "
3141 "the stack that should be used by a thread that is created using the thread "
3142 "attributes object I<attr>."
3144 "B<pthread_attr_setstackaddr>() 関数は、\n"
3145 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3146 "属性を I<stackaddr> で指定された値に設定する。\n"
3147 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3148 "作成されるスレッドが使用すべきスタックの位置が指定される。"
3151 #: build/C/man3/pthread_attr_setstackaddr.3:64
3153 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
3154 "that was allocated by the caller. The pages of the allocated buffer should "
3155 "be both readable and writable."
3157 "I<stackaddr> は呼び出し側が割り当てたバッファ (大きさは\n"
3158 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
3159 "割り当てられたバッファのページは読み書き両方が可能なページと\n"
3163 #: build/C/man3/pthread_attr_setstackaddr.3:72
3165 "The B<pthread_attr_getstackaddr>() function returns the stack address "
3166 "attribute of the thread attributes object referred to by I<attr> in the "
3167 "buffer pointed to by I<stackaddr>."
3169 "B<pthread_attr_getstackaddr>() は、\n"
3170 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3171 "I<stackaddr> が指すバッファに入れて返す。"
3174 #: build/C/man3/pthread_attr_setstackaddr.3:79
3176 "No errors are defined (but applications should nevertheless handle a "
3177 "possible error return)."
3179 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
3180 "返り値を処理するようにすべきである)。"
3183 #: build/C/man3/pthread_attr_setstackaddr.3:84
3185 "POSIX.1-2001 specifies these functions but marks them as obsolete. "
3186 "POSIX.1-2008 removes the specification of these functions."
3188 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
3189 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
3192 #: build/C/man3/pthread_attr_setstackaddr.3:108
3194 "I<Do not use these functions!> They cannot be portably used, since they "
3195 "provide no way of specifying the direction of growth or the range of the "
3196 "stack. For example, on architectures with a stack that grows downward, "
3197 "I<stackaddr> specifies the next address past the I<highest> address of the "
3198 "allocated stack area. However, on architectures with a stack that grows "
3199 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
3200 "area. By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3) "
3201 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
3202 "in the allocated stack area (and the I<stacksize> argument specifies the "
3203 "range of the stack)."
3205 "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n"
3206 "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n"
3207 "かを指定する手段が提供されていないからである。\n"
3208 "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャ\n"
3209 "では、I<stackaddr> には割り当てられたスタック領域のI<最も大きな>アドレ\n"
3210 "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n"
3211 "方向) に伸びるアーキテクチャでは、I<stackaddr> には割り当てられた\n"
3212 "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n"
3213 "B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) が使用する\n"
3214 "I<stackaddr> は、常に割り当てられたスタック領域の最も小さいアドレス\n"
3215 "へのポインタである (I<stacksize> 引き数はスタックの範囲を指定する)。"
3218 #: build/C/man3/pthread_attr_setstackaddr.3:114
3220 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3221 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3223 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3224 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3227 #: build/C/man3/pthread_attr_setstacksize.3:24
3229 msgid "PTHREAD_ATTR_SETSTACKSIZE"
3230 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
3233 #: build/C/man3/pthread_attr_setstacksize.3:28
3235 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
3236 "attribute in thread attributes object"
3238 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
3239 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
3242 #: build/C/man3/pthread_attr_setstacksize.3:36
3245 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3246 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3248 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3249 "B<int pthread_attr_getstacksize(pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
3252 #: build/C/man3/pthread_attr_setstacksize.3:47
3254 "The B<pthread_attr_setstacksize>() function sets the stack size attribute "
3255 "of the thread attributes object referred to by I<attr> to the value "
3256 "specified in I<stacksize>."
3258 "B<pthread_attr_setstacksize>() 関数は、\n"
3259 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3260 "属性を I<stacksize> で指定された値に設定する。"
3263 #: build/C/man3/pthread_attr_setstacksize.3:51
3265 "The stack size attribute determines the minimum size (in bytes) that will be "
3266 "allocated for threads created using the thread attributes object I<attr>."
3269 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
3270 "に割り当てられる最小サイズ (バイト単位) が決定される。"
3273 #: build/C/man3/pthread_attr_setstacksize.3:59
3275 "The B<pthread_attr_getstacksize>() function returns the stack size "
3276 "attribute of the thread attributes object referred to by I<attr> in the "
3277 "buffer pointed to by I<stacksize>."
3279 "B<pthread_attr_getstacksize>() は、\n"
3280 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3281 "I<stacksize> が指すバッファに入れて返す。"
3284 #: build/C/man3/pthread_attr_setstacksize.3:65
3285 msgid "B<pthread_attr_setstacksize>() can fail with the following error:"
3286 msgstr "B<pthread_attr_setstacksize>() は以下のエラーで失敗する場合がある。"
3289 #: build/C/man3/pthread_attr_setstacksize.3:70
3290 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
3291 msgstr "スタックサイズが B<PTHREAD_STACK_MIN> (16384) バイト未満である。"
3295 #: build/C/man3/pthread_attr_setstacksize.3:79
3297 "On some systems, B<pthread_attr_setstacksize>() can fail with the error "
3298 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
3300 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
3301 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
3302 "エラー B<EINVAL> で失敗する。"
3305 #: build/C/man3/pthread_attr_setstacksize.3:86
3307 "For details on the default stack size of new threads, see B<pthread_create>"
3310 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
3311 "B<pthread_create>(3) を参照。"
3314 #: build/C/man3/pthread_attr_setstacksize.3:89
3316 "A thread's stack size is fixed at the time of thread creation. Only the "
3317 "main thread can dynamically grow its stack."
3319 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
3320 "メインスレッドだけがスタックを動的に伸ばすことができる。"
3323 #: build/C/man3/pthread_attr_setstacksize.3:94
3325 "The B<pthread_attr_setstack>(3) function allows an application to set both "
3326 "the size and location of a caller-allocated stack that is to be used by a "
3329 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
3330 "アプリケーションは、スレッドが使用するスタックとして、\n"
3331 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
3334 #: build/C/man3/pthread_attr_setstacksize.3:106
3336 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
3337 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
3338 "I<downward>, in violation of POSIX.1-2001, which says that the allocated "
3339 "stack will be at least I<stacksize> bytes."
3341 "glibc 2.8 の時点では、指定された I<stacksize> が B<STACK_ALIGN> \n"
3342 "(ほとんどのアーキテクチャでは 16 バイト) の倍数でない場合、\n"
3343 "I<stacksize> はI<小さくなる方向に>に丸められる。\n"
3344 "これは POSIX.1-2001 に違反している。\n"
3345 "POSIX.1-2001 では、割り当てらたスタックの大きさは\n"
3346 "少なくとも I<stacksize> バイトになると書かれている。"
3349 #: build/C/man3/pthread_attr_setstacksize.3:109
3350 #: build/C/man3/pthread_join.3:125
3351 msgid "See B<pthread_create>(3)."
3352 msgstr "B<pthread_create>(3) を参照。"
3355 #: build/C/man3/pthread_attr_setstacksize.3:116
3357 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3358 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3360 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3361 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3364 #: build/C/man3/pthread_cancel.3:24
3366 msgid "PTHREAD_CANCEL"
3367 msgstr "PTHREAD_CANCEL"
3370 #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_setschedparam.3:24
3376 #: build/C/man3/pthread_cancel.3:27
3377 msgid "pthread_cancel - send a cancellation request to a thread"
3378 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
3381 #: build/C/man3/pthread_cancel.3:32
3383 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3384 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3387 #: build/C/man3/pthread_cancel.3:44
3389 "The B<pthread_cancel>() function sends a cancellation request to the thread "
3390 "I<thread>. Whether and when the target thread reacts to the cancellation "
3391 "request depends on two attributes that are under the control of that thread: "
3392 "its cancelability I<state> and I<type>."
3394 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
3395 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
3396 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
3397 "I<state> と I<type>により決まる。"
3400 #: build/C/man3/pthread_cancel.3:56
3402 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
3403 "can be I<enabled> (the default for new threads) or I<disabled>. If a thread "
3404 "has disabled cancellation, then a cancellation request remains queued until "
3405 "the thread enables cancellation. If a thread has enabled cancellation, then "
3406 "its cancelability type determines when cancellation occurs."
3408 "あるスレッドの cancelability state は B<pthread_setcancelstate>(3) で\n"
3409 "設定され、I<enabled> と I<disabled> のいずれとなる (I<enabled> が新しい\n"
3410 "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n"
3411 "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n"
3412 "れたままになる。スレッドがキャンセルを有効にしていた場合、\n"
3413 "cancelability type によって、いつキャンセルが発生するかが決まる。"
3416 #: build/C/man3/pthread_cancel.3:72
3418 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
3419 "be either I<asynchronous> or I<deferred> (the default for new threads). "
3420 "Asynchronous cancelability means that the thread can be canceled at any time "
3421 "(usually immediately, but the system does not guarantee this). Deferred "
3422 "cancelability means that cancellation will be delayed until the thread next "
3423 "calls a function that is a I<cancellation point>. A list of functions that "
3424 "are or may be cancellation points is provided in I<pthreads>(7)."
3426 "スレッドの cancellation type は B<pthread_setcanceltype>(3) で設定され、\n"
3427 "I<asynchronous> か I<deferred> のいずれかとなる(I<deferred> が新しいスレッド\n"
3429 "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつでも\n"
3430 "キャンセルされることを意味する (通常はすぐにキャンセルされるが、システムが\n"
3431 "そのことを保証しているわけではない)。\n"
3432 "遅延キャンセル (deferred cancelability) では、そのスレッドが I<cancellation\n"
3433 "point> となっている関数を次に呼び出すまでキャンセルが遅延される。\n"
3434 "取り消しポイント (cancellation point) に設定されていたり設定したりできる\n"
3435 "関数のリストは I<pthreads>(7) に記載している。"
3438 #: build/C/man3/pthread_cancel.3:76
3440 "When a cancellation requested is acted on, the following steps occur for "
3441 "I<thread> (in this order):"
3444 "I<thread> では以下のステップが (この順序で) 行われる。"
3447 #: build/C/man3/pthread_cancel.3:76 build/C/man3/pthread_cleanup_push.3:67
3453 #: build/C/man3/pthread_cancel.3:81
3455 "Cancellation clean-up handlers are popped (in the reverse of the order in "
3456 "which they were pushed) and called. (See B<pthread_cleanup_push>(3).)"
3458 "キャンセルクリーンアップハンドラが (push されたのと逆順で)\n"
3459 "取り出され (pop され)、呼び出される。\n"
3460 "(B<pthread_cleanup_push>(3) 参照)"
3463 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:71
3469 #: build/C/man3/pthread_cancel.3:86
3471 "Thread-specific data destructors are called, in an unspecified order. (See "
3472 "B<pthread_key_create>(3).)"
3474 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
3475 "呼び出し順序は規定されていない。\n"
3476 "(B<pthread_key_create>(3) 参照)"
3479 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:79
3485 #: build/C/man3/pthread_cancel.3:90
3486 msgid "The thread is terminated. (See B<pthread_exit>(3).)"
3487 msgstr "スレッドが終了される。 (B<pthread_exit>(3) 参照)"
3490 #: build/C/man3/pthread_cancel.3:98
3492 "The above steps happen asynchronously with respect to the B<pthread_cancel>"
3493 "() call; the return status of B<pthread_cancel>() merely informs the "
3494 "caller whether the cancellation request was successfully queued."
3496 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
3497 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
3498 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
3501 #: build/C/man3/pthread_cancel.3:107
3503 "After a canceled thread has terminated, a join with that thread using "
3504 "B<pthread_join>(3) obtains B<PTHREAD_CANCELED> as the thread's exit "
3505 "status. (Joining with a thread is the only way to know that cancellation "
3508 "キャンセルされたスレッドが終了された後に、\n"
3509 "B<pthread_join>(3) でそのスレッドを join すると、\n"
3510 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
3511 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
3514 #: build/C/man3/pthread_cancel.3:112
3516 "On success, B<pthread_cancel>() returns 0; on error, it returns a nonzero "
3519 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
3520 "エラーの場合、0 以外のエラー番号を返す。"
3523 #: build/C/man3/pthread_cancel.3:113 build/C/man3/pthread_detach.3:57
3524 #: build/C/man3/pthread_getcpuclockid.3:56 build/C/man3/pthread_join.3:91
3525 #: build/C/man3/pthread_kill.3:59 build/C/man3/pthread_setaffinity_np.3:112
3526 #: build/C/man3/pthread_setschedparam.3:112
3527 #: build/C/man3/pthread_setschedprio.3:68 build/C/man3/pthread_sigqueue.3:83
3533 #: build/C/man3/pthread_cancel.3:120 build/C/man3/pthread_detach.3:62
3534 #: build/C/man3/pthread_getcpuclockid.3:61 build/C/man3/pthread_join.3:96
3535 #: build/C/man3/pthread_kill.3:64 build/C/man3/pthread_setaffinity_np.3:117
3536 #: build/C/man3/pthread_setschedparam.3:117
3537 #: build/C/man3/pthread_setschedprio.3:73
3538 msgid "No thread with the ID I<thread> could be found."
3539 msgstr "ID が I<thread> のスレッドが見つからなかった。"
3542 #: build/C/man3/pthread_cancel.3:130
3544 "On Linux, cancellation is implemented using signals. Under the NPTL "
3545 "threading implementation, the first real-time signal (i.e., signal 32) is "
3546 "used for this purpose. On LinuxThreads, the second real-time signal is "
3547 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3549 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装で"
3551 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
3552 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイ"
3554 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
3557 #: build/C/man3/pthread_cancel.3:136
3559 "The program below creates a thread and then cancels it. The main thread "
3560 "joins with the canceled thread to check that its exit status was "
3561 "B<PTHREAD_CANCELED>. The following shell session shows what happens when we "
3564 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルす"
3566 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
3567 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
3568 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
3571 #: build/C/man3/pthread_cancel.3:144
3575 "thread_func(): started; cancellation disabled\n"
3576 "main(): sending cancellation request\n"
3577 "thread_func(): about to enable cancellation\n"
3578 "main(): thread was canceled\n"
3581 "thread_func(): started; cancellation disabled\n"
3582 "main(): sending cancellation request\n"
3583 "thread_func(): about to enable cancellation\n"
3584 "main(): thread was canceled\n"
3587 #: build/C/man3/pthread_cancel.3:154
3590 "#include E<lt>pthread.hE<gt>\n"
3591 "#include E<lt>stdio.hE<gt>\n"
3592 "#include E<lt>errno.hE<gt>\n"
3593 "#include E<lt>stdlib.hE<gt>\n"
3594 "#include E<lt>unistd.hE<gt>\n"
3596 "#include E<lt>pthread.hE<gt>\n"
3597 "#include E<lt>stdio.hE<gt>\n"
3598 "#include E<lt>errno.hE<gt>\n"
3599 "#include E<lt>stdlib.hE<gt>\n"
3600 "#include E<lt>unistd.hE<gt>\n"
3603 #: build/C/man3/pthread_cancel.3:162
3607 "thread_func(void *ignored_argument)\n"
3612 "thread_func(void *ignored_argument)\n"
3617 #: build/C/man3/pthread_cancel.3:165
3620 " /* Disable cancellation for a while, so that we don\\(aqt\n"
3621 " immediately react to a cancellation request */\n"
3623 " /* Disable cancellation for a while, so that we don\\(aqt\n"
3624 " immediately react to a cancellation request */\n"
3627 #: build/C/man3/pthread_cancel.3:169
3630 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3632 " handle_error_en(s, \"pthread_setcancelstate\");\n"
3634 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3636 " handle_error_en(s, \"pthread_setcancelstate\");\n"
3639 #: build/C/man3/pthread_cancel.3:173
3642 " printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3644 " printf(\"thread_func(): about to enable cancellation\\en\");\n"
3646 " printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3648 " printf(\"thread_func(): about to enable cancellation\\en\");\n"
3651 #: build/C/man3/pthread_cancel.3:177
3654 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3656 " handle_error_en(s, \"pthread_setcancelstate\");\n"
3658 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3660 " handle_error_en(s, \"pthread_setcancelstate\");\n"
3663 #: build/C/man3/pthread_cancel.3:179
3665 msgid " /* sleep() is a cancellation point */\n"
3666 msgstr " /* sleep() is a cancellation point */\n"
3669 #: build/C/man3/pthread_cancel.3:181
3671 msgid " sleep(1000); /* Should get canceled while we sleep */\n"
3672 msgstr " sleep(1000); /* Should get canceled while we sleep */\n"
3675 #: build/C/man3/pthread_cancel.3:183
3677 msgid " /* Should never get here */\n"
3678 msgstr " /* Should never get here */\n"
3681 #: build/C/man3/pthread_cancel.3:187
3684 " printf(\"thread_func(): not canceled!\\en\");\n"
3688 " printf(\"thread_func(): not canceled!\\en\");\n"
3693 #: build/C/man3/pthread_cancel.3:194
3711 #: build/C/man3/pthread_cancel.3:196
3713 msgid " /* Start a thread and then send it a cancellation request */\n"
3714 msgstr " /* Start a thread and then send it a cancellation request */\n"
3717 #: build/C/man3/pthread_cancel.3:200
3720 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3722 " handle_error_en(s, \"pthread_create\");\n"
3724 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3726 " handle_error_en(s, \"pthread_create\");\n"
3729 #: build/C/man3/pthread_cancel.3:202
3731 msgid " sleep(2); /* Give thread a chance to get started */\n"
3732 msgstr " sleep(2); /* Give thread a chance to get started */\n"
3735 #: build/C/man3/pthread_cancel.3:207
3738 " printf(\"main(): sending cancellation request\\en\");\n"
3739 " s = pthread_cancel(thr);\n"
3741 " handle_error_en(s, \"pthread_cancel\");\n"
3743 " printf(\"main(): sending cancellation request\\en\");\n"
3744 " s = pthread_cancel(thr);\n"
3746 " handle_error_en(s, \"pthread_cancel\");\n"
3749 #: build/C/man3/pthread_cancel.3:209
3751 msgid " /* Join with thread to see what its exit status was */\n"
3752 msgstr " /* Join with thread to see what its exit status was */\n"
3755 #: build/C/man3/pthread_cancel.3:213 build/C/man3/pthread_cleanup_push.3:301
3758 " s = pthread_join(thr, &res);\n"
3760 " handle_error_en(s, \"pthread_join\");\n"
3762 " s = pthread_join(thr, &res);\n"
3764 " handle_error_en(s, \"pthread_join\");\n"
3767 #: build/C/man3/pthread_cancel.3:220
3770 " if (res == PTHREAD_CANCELED)\n"
3771 " printf(\"main(): thread was canceled\\en\");\n"
3773 " printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3774 " exit(EXIT_SUCCESS);\n"
3777 " if (res == PTHREAD_CANCELED)\n"
3778 " printf(\"main(): thread was canceled\\en\");\n"
3780 " printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3781 " exit(EXIT_SUCCESS);\n"
3785 #: build/C/man3/pthread_cancel.3:231
3787 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3788 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3789 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3791 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
3792 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
3793 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3796 #: build/C/man3/pthread_cleanup_push.3:24
3798 msgid "PTHREAD_CLEANUP_PUSH"
3799 msgstr "PTHREAD_CLEANUP_PUSH"
3802 #: build/C/man3/pthread_cleanup_push.3:24
3803 #: build/C/man3/pthread_setcancelstate.3:24
3809 #: build/C/man3/pthread_cleanup_push.3:28
3811 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
3814 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
3815 "キャンセルクリーンアップハンドラの push/pop を行う"
3818 #: build/C/man3/pthread_cleanup_push.3:35
3821 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3822 "B< void *>I<arg>B<);>\n"
3823 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3825 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3826 "B< void *>I<arg>B<);>\n"
3827 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3830 #: build/C/man3/pthread_cleanup_push.3:46
3832 "These functions manipulate the calling thread's stack of thread-cancellation "
3833 "clean-up handlers. A clean-up handler is a function that is automatically "
3834 "executed when a thread is canceled (or in various other circumstances "
3835 "described below); it might, for example, unlock a mutex so that it becomes "
3836 "available to other threads in the process."
3840 #: build/C/man3/pthread_cleanup_push.3:57
3842 "The B<pthread_cleanup_push>() function pushes I<routine> onto the top of "
3843 "the stack of clean-up handlers. When I<routine> is later invoked, it will "
3844 "be given I<arg> as its argument."
3848 #: build/C/man3/pthread_cleanup_push.3:64
3850 "The B<pthread_cleanup_pop>() function removes the routine at the top of the "
3851 "stack of clean-up handlers, and optionally executes it if I<execute> is "
3856 #: build/C/man3/pthread_cleanup_push.3:67
3858 "A cancellation clean-up handler is popped from the stack and executed in the "
3859 "following circumstances:"
3863 #: build/C/man3/pthread_cleanup_push.3:71
3865 "When a thread is canceled, all of the stacked clean-up handlers are popped "
3866 "and executed in the reverse of the order in which they were pushed onto the "
3871 #: build/C/man3/pthread_cleanup_push.3:79
3873 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
3874 "handlers are executed as described in the preceding point. (Clean-up "
3875 "handlers are I<not> called if the thread terminates by performing a "
3876 "I<return> from the thread start function.)"
3880 #: build/C/man3/pthread_cleanup_push.3:85
3882 "When a thread calls B<pthread_cleanup_pop>() with a nonzero I<execute> "
3883 "argument, the top-most clean-up handler is popped and executed."
3887 #: build/C/man3/pthread_cleanup_push.3:97
3889 "POSIX.1 permits B<pthread_cleanup_push>() and B<pthread_cleanup_pop>() to "
3890 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
3891 "\\(aqB<}>\\(aq, respectively. For this reason, the caller must ensure that "
3892 "calls to these functions are paired within the same function, and at the "
3893 "same lexical nesting level. (In other words, a clean-up handler is only "
3894 "established during the execution of a specified section of code.)"
3898 #: build/C/man3/pthread_cleanup_push.3:117
3900 "Calling B<longjmp>(3) (B<siglongjmp>(3)) produces undefined results if any "
3901 "call has been made to B<pthread_cleanup_push>() or B<pthread_cleanup_pop>"
3902 "() without the matching call of the pair since the jump buffer was filled "
3903 "by B<setjmp>(3) (B<sigsetjmp>(3)). Likewise, calling B<longjmp>(3) "
3904 "(B<siglongjmp>(3)) from inside a clean-up handler produces undefined "
3905 "results unless the jump buffer was also filled by B<setjmp>(3) (B<sigsetjmp>"
3906 "(3)) inside the handler."
3910 #: build/C/man3/pthread_cleanup_push.3:119
3911 msgid "These functions do not return a value."
3912 msgstr "これらの関数は値を返さない。"
3915 #. Available since glibc 2.0
3917 #: build/C/man3/pthread_cleanup_push.3:123
3918 msgid "There are no errors."
3922 #: build/C/man3/pthread_cleanup_push.3:134
3924 "On Linux, the B<pthread_cleanup_push>() and B<pthread_cleanup_pop>() "
3925 "functions I<are> implemented as macros that expand to text containing \\(aqB<"
3926 "{>\\(aq and \\(aqB<}>\\(aq, respectively. This means that variables "
3927 "declared within the scope of paired calls to these functions will only be "
3928 "visible within that scope."
3931 #. The text was actually added in the 2004 TC2
3933 #: build/C/man3/pthread_cleanup_push.3:149
3935 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
3936 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>() "
3937 "and B<pthread_cleanup_pop>() is undefined. Portable applications should "
3942 #: build/C/man3/pthread_cleanup_push.3:164
3944 "The program below provides a simple example of the use of the functions "
3945 "described in this page. The program creates a thread that executes a loop "
3946 "bracketed by B<pthread_cleanup_push>() and B<pthread_cleanup_pop>(). This "
3947 "loop increments a global variable, I<cnt>, once each second. Depending on "
3948 "what command-line arguments are supplied, the main thread sends the other "
3949 "thread a cancellation request, or sets a global variable that causes the "
3950 "other thread to exit its loop and terminate normally (by doing a I<return>)."
3954 #: build/C/man3/pthread_cleanup_push.3:167
3956 "In the following shell session, the main thread sends a cancellation request "
3957 "to the other thread:"
3961 #: build/C/man3/pthread_cleanup_push.3:177
3965 "New thread started\n"
3968 "Canceling thread\n"
3969 "Called clean-up handler\n"
3970 "Thread was canceled; cnt = 0\n"
3973 "New thread started\n"
3976 "Canceling thread\n"
3977 "Called clean-up handler\n"
3978 "Thread was canceled; cnt = 0\n"
3981 #: build/C/man3/pthread_cleanup_push.3:185
3983 "From the above, we see that the thread was canceled, and that the "
3984 "cancellation clean-up handler was called and it reset the value of the "
3985 "global variable I<cnt> to 0."
3989 #: build/C/man3/pthread_cleanup_push.3:188
3991 "In the next run, the main program sets a global variable that causes other "
3992 "thread to terminate normally:"
3996 #: build/C/man3/pthread_cleanup_push.3:196
4000 "New thread started\n"
4003 "Thread terminated normally; cnt = 2\n"
4006 "New thread started\n"
4009 "Thread terminated normally; cnt = 2\n"
4012 #: build/C/man3/pthread_cleanup_push.3:204
4014 "From the above, we see that the clean-up handler was not executed (because "
4015 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
4019 #: build/C/man3/pthread_cleanup_push.3:209
4021 "In the next run, the main program sets a global variable that causes the "
4022 "other thread to terminate normally, and supplies a nonzero value for "
4023 "I<cleanup_pop_arg>:"
4027 #: build/C/man3/pthread_cleanup_push.3:218
4030 "$ B<./a.out x 1>\n"
4031 "New thread started\n"
4034 "Called clean-up handler\n"
4035 "Thread terminated normally; cnt = 0\n"
4037 "$ B<./a.out x 1>\n"
4038 "New thread started\n"
4041 "Called clean-up handler\n"
4042 "Thread terminated normally; cnt = 0\n"
4045 #: build/C/man3/pthread_cleanup_push.3:225
4047 "In the above, we see that although the thread was not canceled, the clean-up "
4048 "handler was executed, because the argument given to B<pthread_cleanup_pop>"
4053 #: build/C/man3/pthread_cleanup_push.3:234
4056 "#include E<lt>pthread.hE<gt>\n"
4057 "#include E<lt>sys/types.hE<gt>\n"
4058 "#include E<lt>stdio.hE<gt>\n"
4059 "#include E<lt>stdlib.hE<gt>\n"
4060 "#include E<lt>unistd.hE<gt>\n"
4061 "#include E<lt>errno.hE<gt>\n"
4063 "#include E<lt>pthread.hE<gt>\n"
4064 "#include E<lt>sys/types.hE<gt>\n"
4065 "#include E<lt>stdio.hE<gt>\n"
4066 "#include E<lt>stdlib.hE<gt>\n"
4067 "#include E<lt>unistd.hE<gt>\n"
4068 "#include E<lt>errno.hE<gt>\n"
4071 #: build/C/man3/pthread_cleanup_push.3:241
4074 "static int done = 0;\n"
4075 "static int cleanup_pop_arg = 0;\n"
4076 "static int cnt = 0;\n"
4078 "static int done = 0;\n"
4079 "static int cleanup_pop_arg = 0;\n"
4080 "static int cnt = 0;\n"
4083 #: build/C/man3/pthread_cleanup_push.3:248
4087 "cleanup_handler(void *arg)\n"
4089 " printf(\"Called clean-up handler\\en\");\n"
4094 "cleanup_handler(void *arg)\n"
4096 " printf(\"Called clean-up handler\\en\");\n"
4101 #: build/C/man3/pthread_cleanup_push.3:253
4105 "thread_start(void *arg)\n"
4107 " time_t start, curr;\n"
4110 "thread_start(void *arg)\n"
4112 " time_t start, curr;\n"
4115 #: build/C/man3/pthread_cleanup_push.3:255
4117 msgid " printf(\"New thread started\\en\");\n"
4118 msgstr " printf(\"New thread started\\en\");\n"
4121 #: build/C/man3/pthread_cleanup_push.3:257
4123 msgid " pthread_cleanup_push(cleanup_handler, NULL);\n"
4124 msgstr " pthread_cleanup_push(cleanup_handler, NULL);\n"
4127 #: build/C/man3/pthread_cleanup_push.3:259
4129 msgid " curr = start = time(NULL);\n"
4130 msgstr " curr = start = time(NULL);\n"
4133 #: build/C/man3/pthread_cleanup_push.3:268
4136 " while (!done) {\n"
4137 " pthread_testcancel(); /* A cancellation point */\n"
4138 " if (curr E<lt> time(NULL)) {\n"
4139 " curr = time(NULL);\n"
4140 " printf(\"cnt = %d\\en\", cnt); /* A cancellation point */\n"
4145 " while (!done) {\n"
4146 " pthread_testcancel(); /* A cancellation point */\n"
4147 " if (curr E<lt> time(NULL)) {\n"
4148 " curr = time(NULL);\n"
4149 " printf(\"cnt = %d\\en\", cnt); /* A cancellation point */\n"
4155 #: build/C/man3/pthread_cleanup_push.3:272
4158 " pthread_cleanup_pop(cleanup_pop_arg);\n"
4162 " pthread_cleanup_pop(cleanup_pop_arg);\n"
4167 #: build/C/man3/pthread_cleanup_push.3:279
4171 "main(int argc, char *argv[])\n"
4178 "main(int argc, char *argv[])\n"
4185 #: build/C/man3/pthread_cleanup_push.3:283
4188 " s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4190 " handle_error_en(s, \"pthread_create\");\n"
4192 " s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4194 " handle_error_en(s, \"pthread_create\");\n"
4197 #: build/C/man3/pthread_cleanup_push.3:285
4199 msgid " sleep(2); /* Allow new thread to run a while */\n"
4200 msgstr " sleep(2); /* Allow new thread to run a while */\n"
4203 #: build/C/man3/pthread_cleanup_push.3:290
4206 " if (argc E<gt> 1) {\n"
4207 " if (argc E<gt> 2)\n"
4208 " cleanup_pop_arg = atoi(argv[2]);\n"
4211 " if (argc E<gt> 1) {\n"
4212 " if (argc E<gt> 2)\n"
4213 " cleanup_pop_arg = atoi(argv[2]);\n"
4217 #: build/C/man3/pthread_cleanup_push.3:297
4221 " printf(\"Canceling thread\\en\");\n"
4222 " s = pthread_cancel(thr);\n"
4224 " handle_error_en(s, \"pthread_cancel\");\n"
4228 " printf(\"Canceling thread\\en\");\n"
4229 " s = pthread_cancel(thr);\n"
4231 " handle_error_en(s, \"pthread_cancel\");\n"
4235 #: build/C/man3/pthread_cleanup_push.3:308
4238 " if (res == PTHREAD_CANCELED)\n"
4239 " printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4241 " printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4242 " exit(EXIT_SUCCESS);\n"
4245 " if (res == PTHREAD_CANCELED)\n"
4246 " printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4248 " printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4249 " exit(EXIT_SUCCESS);\n"
4253 #: build/C/man3/pthread_cleanup_push.3:315
4255 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4256 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4258 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4259 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4262 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
4264 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4265 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4268 #: build/C/man3/pthread_cleanup_push_defer_np.3:24
4274 #: build/C/man3/pthread_cleanup_push_defer_np.3:28
4276 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
4277 "thread cancellation clean-up handlers while saving cancelability type"
4281 #: build/C/man3/pthread_cleanup_push_defer_np.3:35
4284 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4285 "B< void *>I<arg>B<);>\n"
4286 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4288 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4289 "B< void *>I<arg>B<);>\n"
4290 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4293 #: build/C/man3/pthread_cleanup_push_defer_np.3:38
4294 #: build/C/man3/pthread_create.3:36 build/C/man3/pthread_detach.3:35
4295 #: build/C/man3/pthread_join.3:35 build/C/man3/pthread_kill.3:35
4296 #: build/C/man3/pthread_sigmask.3:36 build/C/man3/pthread_sigqueue.3:35
4297 #: build/C/man3/pthread_tryjoin_np.3:40 build/C/man3/pthread_yield.3:34
4298 msgid "Compile and link with I<-pthread>."
4302 #: build/C/man3/pthread_cleanup_push_defer_np.3:44
4304 "These functions are the same as B<pthread_cleanup_push>(3) and "
4305 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
4309 #: build/C/man3/pthread_cleanup_push_defer_np.3:57
4311 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>() pushes "
4312 "I<routine> onto the thread's stack of cancellation clean-up handlers. In "
4313 "addition, it also saves the thread's current cancelability type, and sets "
4314 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
4315 "this ensures that cancellation clean-up will occur even if the thread's "
4316 "cancelability type was \"asynchronous\" before the call."
4320 #: build/C/man3/pthread_cleanup_push_defer_np.3:66
4322 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>() pops "
4323 "the top-most clean-up handler from the thread's stack of cancellation clean-"
4324 "up handlers. In addition, it restores the thread's cancelability type to "
4325 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
4329 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
4331 "The caller must ensure that calls to these functions are paired within the "
4332 "same function, and at the same lexical nesting level. Other restrictions "
4333 "apply, as described in B<pthread_cleanup_push>(3)."
4337 #: build/C/man3/pthread_cleanup_push_defer_np.3:74
4338 msgid "This sequence of calls:"
4342 #: build/C/man3/pthread_cleanup_push_defer_np.3:79
4345 "pthread_cleanup_push_defer_np(routine, arg);\n"
4346 "pthread_cleanup_pop_restore_np(execute);\n"
4350 #: build/C/man3/pthread_cleanup_push_defer_np.3:83
4351 msgid "is equivalent to (but shorter and more efficient than):"
4355 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
4357 msgid "int oldtype;\n"
4358 msgstr "int oldtype;\n"
4361 #: build/C/man3/pthread_cleanup_push_defer_np.3:95
4364 "pthread_cleanup_push(routine, arg);\n"
4365 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4367 "pthread_setcanceltype(oldtype, NULL);\n"
4368 "pthread_cleanup_pop(execute);\n"
4370 "pthread_cleanup_push(routine, arg);\n"
4371 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
4373 "pthread_setcanceltype(oldtype, NULL);\n"
4374 "pthread_cleanup_pop(execute);\n"
4377 #: build/C/man3/pthread_cleanup_push_defer_np.3:108
4379 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
4380 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4382 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
4383 "(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4386 #: build/C/man3/pthread_create.3:24
4388 msgid "PTHREAD_CREATE"
4389 msgstr "PTHREAD_CREATE"
4392 #: build/C/man3/pthread_create.3:27
4393 msgid "pthread_create - create a new thread"
4394 msgstr "pthread_create - 新しいスレッドを作成する"
4397 #: build/C/man3/pthread_create.3:33
4400 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4401 "B< void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4403 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
4404 "B< void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
4407 #: build/C/man3/pthread_create.3:45
4409 "The B<pthread_create>() function starts a new thread in the calling "
4410 "process. The new thread starts execution by invoking I<start_routine>(); "
4411 "I<arg> is passed as the sole argument of I<start_routine>()."
4415 #: build/C/man3/pthread_create.3:47
4416 msgid "The new thread terminates in one of the following ways:"
4420 #: build/C/man3/pthread_create.3:47 build/C/man3/pthread_create.3:53
4421 #: build/C/man3/pthread_create.3:61 build/C/man3/pthread_create.3:64
4422 #: build/C/man3/pthread_getattr_np.3:50 build/C/man3/pthread_getattr_np.3:53
4423 #: build/C/man3/pthread_getattr_np.3:56
4429 #: build/C/man3/pthread_create.3:53
4431 "It calls B<pthread_exit>(3), specifying an exit status value that is "
4432 "available to another thread in the same process that calls B<pthread_join>"
4437 #: build/C/man3/pthread_create.3:61
4439 "It returns from I<start_routine>(). This is equivalent to calling "
4440 "B<pthread_exit>(3) with the value supplied in the I<return> statement."
4444 #: build/C/man3/pthread_create.3:64
4445 msgid "It is canceled (see B<pthread_cancel>(3))."
4449 #: build/C/man3/pthread_create.3:70
4451 "Any of the threads in the process calls B<exit>(3), or the main thread "
4452 "performs a return from I<main>(). This causes the termination of all "
4453 "threads in the process."
4457 #: build/C/man3/pthread_create.3:84
4459 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
4460 "are used at thread creation time to determine attributes for the new thread; "
4461 "this structure is initialized using B<pthread_attr_init>(3) and related "
4462 "functions. If I<attr> is NULL, then the thread is created with default "
4467 #: build/C/man3/pthread_create.3:91
4469 "Before returning, a successful call to B<pthread_create>() stores the ID of "
4470 "the new thread in the buffer pointed to by I<thread>; this identifier is "
4471 "used to refer to the thread in subsequent calls to other pthreads functions."
4475 #: build/C/man3/pthread_create.3:99
4477 "The new thread inherits a copy of the creating thread's signal mask "
4478 "(B<pthread_sigmask>(3)). The set of pending signals for the new thread is "
4479 "empty (B<sigpending>(2)). The new thread does not inherit the creating "
4480 "thread's alternate signal stack (B<sigaltstack>(2))."
4484 #: build/C/man3/pthread_create.3:102
4486 "The new thread inherits the calling thread's floating-point environment "
4490 #. CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4492 #: build/C/man3/pthread_create.3:107
4494 "The initial value of the new thread's CPU-time clock is 0 (see "
4495 "B<pthread_getcpuclockid>(3))."
4499 #: build/C/man3/pthread_create.3:107
4501 msgid "Linux-specific details"
4505 #: build/C/man3/pthread_create.3:113
4507 "The new thread inherits copies of the calling thread's capability sets (see "
4508 "B<capabilities>(7)) and CPU affinity mask (see B<sched_setaffinity>(2))."
4512 #: build/C/man3/pthread_create.3:120
4514 "On success, B<pthread_create>() returns 0; on error, it returns an error "
4515 "number, and the contents of I<*thread> are undefined."
4519 #: build/C/man3/pthread_create.3:121 build/C/man3/pthread_sigqueue.3:69
4525 #: build/C/man3/pthread_create.3:135
4527 "Insufficient resources to create another thread, or a system-imposed limit "
4528 "on the number of threads was encountered. The latter case may occur in two "
4529 "ways: the B<RLIMIT_NPROC> soft resource limit (set via B<setrlimit>(2)), "
4530 "which limits the number of process for a real user ID, was reached; or the "
4531 "kernel's system-wide limit on the number of threads, I</proc/sys/kernel/"
4532 "threads-max>, was reached."
4536 #: build/C/man3/pthread_create.3:139
4537 msgid "Invalid settings in I<attr>."
4541 #: build/C/man3/pthread_create.3:139 build/C/man3/pthread_setschedparam.3:127
4542 #: build/C/man3/pthread_setschedprio.3:64
4548 #: build/C/man3/pthread_create.3:144
4550 "No permission to set the scheduling policy and parameters specified in "
4555 #: build/C/man3/pthread_create.3:158
4557 "See B<pthread_self>(3) for further information on the thread ID returned in "
4558 "I<*thread> by B<pthread_create>(). Unless real-time scheduling policies are "
4559 "being employed, after a call to B<pthread_create>(), it is indeterminate "
4560 "which thread\\(emthe caller or the new thread\\(emwill next execute."
4564 #: build/C/man3/pthread_create.3:178
4566 "A thread may either be I<joinable> or I<detached>. If a thread is joinable, "
4567 "then another thread can call B<pthread_join>(3) to wait for the thread to "
4568 "terminate and fetch its exit status. Only when a terminated joinable thread "
4569 "has been joined are the last of its resources released back to the system. "
4570 "When a detached thread terminates, its resources are automatically released "
4571 "back to the system: it is not possible to join with the thread in order to "
4572 "obtain its exit status. Making a thread detached is useful for some types "
4573 "of daemon threads whose exit status the application does not need to care "
4574 "about. By default, a new thread is created in a joinable state, unless "
4575 "I<attr> was set to create the thread in a detached state (using "
4576 "B<pthread_attr_setdetachstate>(3))."
4579 #. FIXME . Perhaps some of the following detail should be in
4580 #. a future pthread_attr_setstacksize(3) page.
4582 #: build/C/man3/pthread_create.3:194
4584 "On Linux/x86-32, the default stack size for a new thread is 2 megabytes. "
4585 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
4586 "resource limit I<at the time the program started> has any value other than "
4587 "\"unlimited\", then it determines the default stack size of new threads. "
4588 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
4589 "explicitly set in the I<attr> argument used to create a thread, in order to "
4590 "obtain a stack size other than the default."
4594 #: build/C/man3/pthread_create.3:200
4596 "In the obsolete LinuxThreads implementation, each of the threads in a "
4597 "process has a different process ID. This is in violation of the POSIX "
4598 "threads specification, and is the source of many other nonconformances to "
4599 "the standard; see B<pthreads>(7)."
4603 #: build/C/man3/pthread_create.3:204
4605 "The program below demonstrates the use of B<pthread_create>(), as well as a "
4606 "number of other functions in the pthreads API."
4610 #: build/C/man3/pthread_create.3:209
4612 "In the following run, on a system providing the NPTL threading "
4613 "implementation, the stack size defaults to the value given by the \"stack "
4614 "size\" resource limit:"
4618 #: build/C/man3/pthread_create.3:221
4622 "8192 # The stack size limit is 8 MB (0x80000 bytes)\n"
4623 "$B< ./a.out hola salut servus>\n"
4624 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4625 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4626 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4627 "Joined with thread 1; returned value was HOLA\n"
4628 "Joined with thread 2; returned value was SALUT\n"
4629 "Joined with thread 3; returned value was SERVUS\n"
4632 "8192 # The stack size limit is 8 MB (0x80000 bytes)\n"
4633 "$B< ./a.out hola salut servus>\n"
4634 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4635 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4636 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4637 "Joined with thread 1; returned value was HOLA\n"
4638 "Joined with thread 2; returned value was SALUT\n"
4639 "Joined with thread 3; returned value was SERVUS\n"
4642 #: build/C/man3/pthread_create.3:227
4644 "In the next run, the program explicitly sets a stack size of 1MB (using "
4645 "B<pthread_attr_setstacksize>(3)) for the created threads:"
4649 #: build/C/man3/pthread_create.3:237
4652 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4653 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4654 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4655 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4656 "Joined with thread 1; returned value was HOLA\n"
4657 "Joined with thread 2; returned value was SALUT\n"
4658 "Joined with thread 3; returned value was SERVUS\n"
4660 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4661 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4662 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4663 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4664 "Joined with thread 1; returned value was HOLA\n"
4665 "Joined with thread 2; returned value was SALUT\n"
4666 "Joined with thread 3; returned value was SERVUS\n"
4669 #: build/C/man3/pthread_create.3:249
4672 "#include E<lt>pthread.hE<gt>\n"
4673 "#include E<lt>string.hE<gt>\n"
4674 "#include E<lt>stdio.hE<gt>\n"
4675 "#include E<lt>stdlib.hE<gt>\n"
4676 "#include E<lt>unistd.hE<gt>\n"
4677 "#include E<lt>errno.hE<gt>\n"
4678 "#include E<lt>ctype.hE<gt>\n"
4680 "#include E<lt>pthread.hE<gt>\n"
4681 "#include E<lt>string.hE<gt>\n"
4682 "#include E<lt>stdio.hE<gt>\n"
4683 "#include E<lt>stdlib.hE<gt>\n"
4684 "#include E<lt>unistd.hE<gt>\n"
4685 "#include E<lt>errno.hE<gt>\n"
4686 "#include E<lt>ctype.hE<gt>\n"
4689 #: build/C/man3/pthread_create.3:255 build/C/man3/pthread_getcpuclockid.3:108
4692 "#define handle_error(msg) \\e\n"
4693 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4695 "#define handle_error(msg) \\e\n"
4696 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4699 #: build/C/man3/pthread_create.3:261
4702 "struct thread_info { /* Used as argument to thread_start() */\n"
4703 " pthread_t thread_id; /* ID returned by pthread_create() */\n"
4704 " int thread_num; /* Application-defined thread # */\n"
4705 " char *argv_string; /* From command-line argument */\n"
4708 "struct thread_info { /* Used as argument to thread_start() */\n"
4709 " pthread_t thread_id; /* ID returned by pthread_create() */\n"
4710 " int thread_num; /* Application-defined thread # */\n"
4711 " char *argv_string; /* From command-line argument */\n"
4715 #: build/C/man3/pthread_create.3:264
4718 "/* Thread start function: display address near top of our stack,\n"
4719 " and return upper-cased copy of argv_string */\n"
4721 "/* Thread start function: display address near top of our stack,\n"
4722 " and return upper-cased copy of argv_string */\n"
4725 #: build/C/man3/pthread_create.3:270
4729 "thread_start(void *arg)\n"
4731 " struct thread_info *tinfo = (struct thread_info *) arg;\n"
4732 " char *uargv, *p;\n"
4735 "thread_start(void *arg)\n"
4737 " struct thread_info *tinfo = (struct thread_info *) arg;\n"
4738 " char *uargv, *p;\n"
4741 #: build/C/man3/pthread_create.3:273
4744 " printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4745 " tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4747 " printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4748 " tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4751 #: build/C/man3/pthread_create.3:277
4754 " uargv = strdup(tinfo-E<gt>argv_string);\n"
4755 " if (uargv == NULL)\n"
4756 " handle_error(\"strdup\");\n"
4758 " uargv = strdup(tinfo-E<gt>argv_string);\n"
4759 " if (uargv == NULL)\n"
4760 " handle_error(\"strdup\");\n"
4763 #: build/C/man3/pthread_create.3:280
4766 " for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4767 " *p = toupper(*p);\n"
4769 " for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4770 " *p = toupper(*p);\n"
4773 #: build/C/man3/pthread_create.3:283
4783 #: build/C/man3/pthread_create.3:292
4787 "main(int argc, char *argv[])\n"
4789 " int s, tnum, opt, num_threads;\n"
4790 " struct thread_info *tinfo;\n"
4791 " pthread_attr_t attr;\n"
4792 " int stack_size;\n"
4796 "main(int argc, char *argv[])\n"
4798 " int s, tnum, opt, num_threads;\n"
4799 " struct thread_info *tinfo;\n"
4800 " pthread_attr_t attr;\n"
4801 " int stack_size;\n"
4805 #: build/C/man3/pthread_create.3:294
4807 msgid " /* The \"-s\" option specifies a stack size for our threads */\n"
4808 msgstr " /* The \"-s\" option specifies a stack size for our threads */\n"
4811 #: build/C/man3/pthread_create.3:301
4814 " stack_size = -1;\n"
4815 " while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4817 " case \\(aqs\\(aq:\n"
4818 " stack_size = strtoul(optarg, NULL, 0);\n"
4821 " stack_size = -1;\n"
4822 " while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4824 " case \\(aqs\\(aq:\n"
4825 " stack_size = strtoul(optarg, NULL, 0);\n"
4829 #: build/C/man3/pthread_create.3:308
4833 " fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4835 " exit(EXIT_FAILURE);\n"
4840 " fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4842 " exit(EXIT_FAILURE);\n"
4847 #: build/C/man3/pthread_create.3:310
4849 msgid " num_threads = argc - optind;\n"
4850 msgstr " num_threads = argc - optind;\n"
4853 #: build/C/man3/pthread_create.3:312
4855 msgid " /* Initialize thread creation attributes */\n"
4856 msgstr " /* Initialize thread creation attributes */\n"
4859 #: build/C/man3/pthread_create.3:316
4862 " s = pthread_attr_init(&attr);\n"
4864 " handle_error_en(s, \"pthread_attr_init\");\n"
4866 " s = pthread_attr_init(&attr);\n"
4868 " handle_error_en(s, \"pthread_attr_init\");\n"
4871 #: build/C/man3/pthread_create.3:322
4874 " if (stack_size E<gt> 0) {\n"
4875 " s = pthread_attr_setstacksize(&attr, stack_size);\n"
4877 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4880 " if (stack_size E<gt> 0) {\n"
4881 " s = pthread_attr_setstacksize(&attr, stack_size);\n"
4883 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4887 #: build/C/man3/pthread_create.3:324
4889 msgid " /* Allocate memory for pthread_create() arguments */\n"
4890 msgstr " /* Allocate memory for pthread_create() arguments */\n"
4893 #: build/C/man3/pthread_create.3:328
4896 " tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4897 " if (tinfo == NULL)\n"
4898 " handle_error(\"calloc\");\n"
4900 " tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4901 " if (tinfo == NULL)\n"
4902 " handle_error(\"calloc\");\n"
4905 #: build/C/man3/pthread_create.3:330
4907 msgid " /* Create one thread for each command-line argument */\n"
4908 msgstr " /* Create one thread for each command-line argument */\n"
4911 #: build/C/man3/pthread_create.3:334
4914 " for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4915 " tinfo[tnum].thread_num = tnum + 1;\n"
4916 " tinfo[tnum].argv_string = argv[optind + tnum];\n"
4918 " for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4919 " tinfo[tnum].thread_num = tnum + 1;\n"
4920 " tinfo[tnum].argv_string = argv[optind + tnum];\n"
4923 #: build/C/man3/pthread_create.3:337
4926 " /* The pthread_create() call stores the thread ID into\n"
4927 " corresponding element of tinfo[] */\n"
4929 " /* The pthread_create() call stores the thread ID into\n"
4930 " corresponding element of tinfo[] */\n"
4933 #: build/C/man3/pthread_create.3:343
4936 " s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4937 " &thread_start, &tinfo[tnum]);\n"
4939 " handle_error_en(s, \"pthread_create\");\n"
4942 " s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4943 " &thread_start, &tinfo[tnum]);\n"
4945 " handle_error_en(s, \"pthread_create\");\n"
4949 #: build/C/man3/pthread_create.3:346
4952 " /* Destroy the thread attributes object, since it is no\n"
4953 " longer needed */\n"
4955 " /* Destroy the thread attributes object, since it is no\n"
4956 " longer needed */\n"
4959 #: build/C/man3/pthread_create.3:350 build/C/man3/pthread_setschedparam.3:421
4962 " s = pthread_attr_destroy(&attr);\n"
4964 " handle_error_en(s, \"pthread_attr_destroy\");\n"
4966 " s = pthread_attr_destroy(&attr);\n"
4968 " handle_error_en(s, \"pthread_attr_destroy\");\n"
4971 #: build/C/man3/pthread_create.3:352
4973 msgid " /* Now join with each thread, and display its returned value */\n"
4974 msgstr " /* Now join with each thread, and display its returned value */\n"
4977 #: build/C/man3/pthread_create.3:357
4980 " for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4981 " s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4983 " handle_error_en(s, \"pthread_join\");\n"
4985 " for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4986 " s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4988 " handle_error_en(s, \"pthread_join\");\n"
4991 #: build/C/man3/pthread_create.3:362
4994 " printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4995 " tinfo[tnum].thread_num, (char *) res);\n"
4996 " free(res); /* Free memory allocated by thread */\n"
4999 " printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5000 " tinfo[tnum].thread_num, (char *) res);\n"
5001 " free(res); /* Free memory allocated by thread */\n"
5005 #: build/C/man3/pthread_create.3:366
5009 " exit(EXIT_SUCCESS);\n"
5013 " exit(EXIT_SUCCESS);\n"
5017 #: build/C/man3/pthread_create.3:378
5019 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5020 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5021 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
5024 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5025 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5026 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthreads>"
5030 #: build/C/man3/pthread_detach.3:24
5032 msgid "PTHREAD_DETACH"
5033 msgstr "PTHREAD_DETACH"
5036 #: build/C/man3/pthread_detach.3:24 build/C/man3/pthread_join.3:24
5042 #: build/C/man3/pthread_detach.3:27
5043 msgid "pthread_detach - detach a thread"
5044 msgstr "pthread_detach - スレッドを切り離す"
5047 #: build/C/man3/pthread_detach.3:32
5049 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5050 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5053 #: build/C/man3/pthread_detach.3:44
5055 "The B<pthread_detach>() function marks the thread identified by I<thread> "
5056 "as detached. When a detached thread terminates, its resources are "
5057 "automatically released back to the system without the need for another "
5058 "thread to join with the terminated thread."
5062 #: build/C/man3/pthread_detach.3:47
5064 "Attempting to detach an already detached thread results in unspecified "
5069 #: build/C/man3/pthread_detach.3:52
5071 "On success, B<pthread_detach>() returns 0; on error, it returns an error "
5076 #: build/C/man3/pthread_detach.3:57 build/C/man3/pthread_join.3:87
5077 msgid "I<thread> is not a joinable thread."
5081 #: build/C/man3/pthread_detach.3:68
5083 "Once a thread has been detached, it can't be joined with B<pthread_join>(3) "
5084 "or be made joinable again."
5088 #: build/C/man3/pthread_detach.3:75
5090 "A new thread can be created in a detached state using "
5091 "B<pthread_attr_setdetachstate>(3) to set the detached attribute of the "
5092 "I<attr> argument of B<pthread_create>(3)."
5096 #: build/C/man3/pthread_detach.3:82
5098 "The detached attribute merely determines the behavior of the system when the "
5099 "thread terminates; it does not prevent the thread from being terminated if "
5100 "the process terminates using B<exit>(3) (or equivalently, if the main "
5105 #: build/C/man3/pthread_detach.3:91
5107 "Either B<pthread_join>(3) or B<pthread_detach>() should be called for each "
5108 "thread that an application creates, so that system resources for the thread "
5109 "can be released. (But note that the resources of all threads are freed when "
5110 "the process terminates.)"
5114 #: build/C/man3/pthread_detach.3:93
5115 msgid "The following statement detaches the calling thread:"
5119 #: build/C/man3/pthread_detach.3:95
5121 msgid " pthread_detach(pthread_self());\n"
5122 msgstr " pthread_detach(pthread_self());\n"
5125 #: build/C/man3/pthread_detach.3:102
5127 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
5128 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5130 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>"
5131 "(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
5134 #: build/C/man3/pthread_equal.3:24
5136 msgid "PTHREAD_EQUAL"
5137 msgstr "PTHREAD_EQUAL"
5140 #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24
5146 #: build/C/man3/pthread_equal.3:27
5147 msgid "pthread_equal - compare thread IDs"
5148 msgstr "pthread_equal - スレッド ID を比較する"
5151 #: build/C/man3/pthread_equal.3:32
5153 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5154 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
5157 #: build/C/man3/pthread_equal.3:39
5158 msgid "The B<pthread_equal>() function compares two thread identifiers."
5159 msgstr "B<pthread_equal>() 関数は 2 つのスレッド識別子の比較を行う。"
5162 #: build/C/man3/pthread_equal.3:43
5164 "If the two thread IDs are equal, B<pthread_equal>() returns a nonzero "
5165 "value; otherwise, it returns 0."
5167 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
5171 #. Available since glibc 2.0
5173 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
5174 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_testcancel.3:56
5175 msgid "This function always succeeds."
5176 msgstr "この関数は常に成功する。"
5179 #: build/C/man3/pthread_equal.3:54
5181 "The B<pthread_equal>() function is necessary because thread IDs should be "
5182 "considered opaque: there is no portable way for applications to directly "
5183 "compare two I<pthread_t> values."
5185 "B<pthread_equal>() 関数が必要なのは、\n"
5186 "スレッド ID はその内部構造を意識すべきではないためである。\n"
5187 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
5188 "移植性を確保できる形で比較する方法はない。"
5191 #: build/C/man3/pthread_equal.3:58
5192 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5193 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
5196 #: build/C/man3/pthread_exit.3:24
5198 msgid "PTHREAD_EXIT"
5199 msgstr "PTHREAD_EXIT"
5202 #: build/C/man3/pthread_exit.3:27
5203 msgid "pthread_exit - terminate calling thread"
5204 msgstr "pthread_exit - 呼び出したスレッドを終了する"
5207 #: build/C/man3/pthread_exit.3:32
5209 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
5210 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
5213 #: build/C/man3/pthread_exit.3:43
5215 "The B<pthread_exit>() function terminates the calling thread and returns a "
5216 "value via I<retval> that (if the thread is joinable) is available to "
5217 "another thread in the same process that calls B<pthread_join>(3)."
5221 #: build/C/man3/pthread_exit.3:53
5223 "Any clean-up handlers established by B<pthread_cleanup_push>(3) that have "
5224 "not yet been popped, are popped (in the reverse of the order in which they "
5225 "were pushed) and executed. If the thread has any thread-specific data, "
5226 "then, after the clean-up handlers have been executed, the corresponding "
5227 "destructor functions are called, in an unspecified order."
5231 #: build/C/man3/pthread_exit.3:60
5233 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
5234 "variables, semaphores, and file descriptors) are not released, and functions "
5235 "registered using B<atexit>(3) are not called."
5239 #: build/C/man3/pthread_exit.3:69
5241 "After the last thread in a process terminates, the process terminates as by "
5242 "calling B<exit>(3) with an exit status of zero; thus, process-shared "
5243 "resources are released and functions registered using B<atexit>(3) are "
5248 #: build/C/man3/pthread_exit.3:71
5249 msgid "This function does not return to the caller."
5253 #: build/C/man3/pthread_exit.3:80
5255 "Performing a return from the start function of any thread other than the "
5256 "main thread results in an implicit call to B<pthread_exit>(), using the "
5257 "function's return value as the thread's exit status."
5261 #: build/C/man3/pthread_exit.3:86
5263 "To allow other threads to continue execution, the main thread should "
5264 "terminate by calling B<pthread_exit>() rather than B<exit>(3)."
5268 #: build/C/man3/pthread_exit.3:91
5270 "The value pointed to by I<retval> should not be located on the calling "
5271 "thread's stack, since the contents of that stack are undefined after the "
5272 "thread terminates."
5276 #. FIXME . review a later kernel to see if this gets fixed
5277 #. http://thread.gmane.org/gmane.linux.kernel/611611
5278 #. http://marc.info/?l=linux-kernel&m=122525468300823&w=2
5280 #: build/C/man3/pthread_exit.3:103
5282 "Currently, there are limitations in the kernel implementation logic for "
5283 "B<wait>(2)ing on a stopped thread group with a dead thread group leader. "
5284 "This can manifest in problems such as a locked terminal if a stop signal is "
5285 "sent to a foreground process whose thread group leader has already called "
5286 "B<pthread_exit>()."
5290 #: build/C/man3/pthread_exit.3:107
5291 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5292 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
5295 #: build/C/man3/pthread_getattr_np.3:24
5297 msgid "PTHREAD_GETATTR_NP"
5298 msgstr "PTHREAD_GETATTR_NP"
5301 #: build/C/man3/pthread_getattr_np.3:27
5302 msgid "pthread_getattr_np - get attributes of created thread"
5303 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
5306 #: build/C/man3/pthread_getattr_np.3:33
5308 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5309 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
5312 #: build/C/man3/pthread_getattr_np.3:43
5314 "The B<pthread_getattr_np>() function initializes the thread attributes "
5315 "object referred to by I<attr> so that it contains actual attribute values "
5316 "describing the running thread I<thread>."
5318 "B<pthread_getattr_np>() 関数は、\n"
5319 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
5320 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
5324 #: build/C/man3/pthread_getattr_np.3:50
5326 "The returned attribute values may differ from the corresponding attribute "
5327 "values passed in the I<attr> object that was used to create the thread using "
5328 "B<pthread_create>(3). In particular, the following attributes may differ:"
5330 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
5331 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
5332 "特に、以下の属性は異なる場合がある。"
5335 #: build/C/man3/pthread_getattr_np.3:53
5337 "the detach state, since a joinable thread may have detached itself after "
5340 "detach state. join 可能なスレッドは作成後に自分自身を\n"
5341 "切り離す (detach する) ことができるからである。"
5344 #: build/C/man3/pthread_getattr_np.3:56
5346 "the stack size, which the implementation may align to a suitable boundary."
5349 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
5352 #: build/C/man3/pthread_getattr_np.3:61
5354 "and the guard size, which the implementation may round upward to a multiple "
5355 "of the page size, or ignore (i.e., treat as 0), if the application is "
5356 "allocating its own stack."
5359 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
5360 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
5361 "(0 として扱われる) ことがあるからである。"
5364 #: build/C/man3/pthread_getattr_np.3:66
5366 "Furthermore, if the stack address attribute was not set in the thread "
5367 "attributes object used to create the thread, then the returned thread "
5368 "attributes object will report the actual stack address that the "
5369 "implementation selected for the thread."
5371 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
5372 "スタックアドレスが設定されていなかった場合、\n"
5373 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
5374 "割り当てた実際のスタックアドレスが報告される。"
5377 #: build/C/man3/pthread_getattr_np.3:71
5379 "When the thread attributes object returned by B<pthread_getattr_np>() is no "
5380 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
5382 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
5383 "必要なくなった際には、 B<pthread_attr_destroy>(3) を使って\n"
5384 "そのオブジェクトを破棄すべきである。"
5387 #: build/C/man3/pthread_getattr_np.3:74
5388 #: build/C/man3/pthread_getcpuclockid.3:47
5390 "On success, this function returns 0; on error, it returns a nonzero error "
5393 "成功すると、この関数は 0 を返す。\n"
5394 "エラーの場合、 0 以外のエラー番号を返す。"
5396 #. Can happen (but unlikely) while trying to allocate memory for cpuset
5398 #: build/C/man3/pthread_getattr_np.3:79
5399 msgid "Insufficient memory."
5400 msgstr "メモリが十分になかった。"
5403 #: build/C/man3/pthread_getattr_np.3:94
5405 "In addition, if I<thread> refers to the main thread, then "
5406 "B<pthread_getattr_np>() can fail because of errors from various underlying "
5407 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and B<getrlimit>"
5408 "(2), if the B<RLIMIT_STACK> resource limit is not supported."
5410 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
5411 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
5413 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
5414 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
5415 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
5418 #: build/C/man3/pthread_getattr_np.3:96
5419 msgid "This function is available in glibc since version 2.2.3."
5420 msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。"
5423 #: build/C/man3/pthread_getattr_np.3:99
5424 #: build/C/man3/pthread_kill_other_threads_np.3:48
5426 "This function is a nonstandard GNU extension; hence the suffix \"_np"
5427 "\" (nonportable) in the name."
5429 "この関数は非標準の GNU による拡張である。\n"
5430 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
5434 #: build/C/man3/pthread_getattr_np.3:109
5436 "The program below demonstrates the use of B<pthread_getattr_np>(). The "
5437 "program creates a thread that then uses B<pthread_getattr_np>() to retrieve "
5438 "and display its guard size, stack address, and stack size attributes. "
5439 "Command-line arguments can be used to set these attributes to values other "
5440 "than the default when creating the thread. The shell sessions below "
5441 "demonstrate the use of the program."
5443 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
5444 "このプログラムは、スレッドを作成し、それから\n"
5445 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
5446 "スタックアドレス、スタックサイズを取得し表示する。\n"
5447 "コマンドライン引き数での指定で、スレッドを作成する際に\n"
5448 "上記の属性にデフォルト値以外の値を設定することができる。\n"
5449 "下記のシェルのセッションはこのプログラムの使用例である。"
5452 #: build/C/man3/pthread_getattr_np.3:112
5454 "In the first run, on an x86-32 system, a thread is created using default "
5457 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
5458 "(x86-32 システム上で実行)。"
5461 #: build/C/man3/pthread_getattr_np.3:122
5464 "$B< ulimit -s> # No stack limit ==E<gt> default stack size is 2MB\n"
5467 "Attributes of created thread:\n"
5468 " Guard size = 4096 bytes\n"
5469 " Stack address = 0x40196000 (EOS = 0x40397000)\n"
5470 " Stack size = 0x201000 (2101248) bytes\n"
5472 "$B< ulimit -s> # No stack limit ==E<gt> default stack size is 2MB\n"
5475 "Attributes of created thread:\n"
5476 " Guard size = 4096 bytes\n"
5477 " Stack address = 0x40196000 (EOS = 0x40397000)\n"
5478 " Stack size = 0x201000 (2101248) bytes\n"
5481 #: build/C/man3/pthread_getattr_np.3:128
5483 "In the following run, we see that if a guard size is specified, it is "
5484 "rounded up to the next multiple of the system page size (4096 bytes on "
5487 "次の実行例では、guard size が指定された場合、\n"
5488 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
5489 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
5492 #: build/C/man3/pthread_getattr_np.3:136
5495 "$B< ./a.out -g 4097>\n"
5496 "Thread attributes object after initializations:\n"
5497 " Guard size = 4097 bytes\n"
5498 " Stack address = (nil)\n"
5499 " Stack size = 0x0 (0) bytes\n"
5501 "$B< ./a.out -g 4097>\n"
5502 "Thread attributes object after initializations:\n"
5503 " Guard size = 4097 bytes\n"
5504 " Stack address = (nil)\n"
5505 " Stack size = 0x0 (0) bytes\n"
5508 #: build/C/man3/pthread_getattr_np.3:141
5511 "Attributes of created thread:\n"
5512 " Guard size = 8192 bytes\n"
5513 " Stack address = 0x40196000 (EOS = 0x40397000)\n"
5514 " Stack size = 0x201000 (2101248) bytes\n"
5516 "Attributes of created thread:\n"
5517 " Guard size = 8192 bytes\n"
5518 " Stack address = 0x40196000 (EOS = 0x40397000)\n"
5519 " Stack size = 0x201000 (2101248) bytes\n"
5523 #. $ ./a.out \-s 0x8000
5524 #. Thread attributes object after initializations:
5525 #. Guard size = 4096 bytes
5526 #. Stack address = 0xffff8000 (EOS = (nil))
5527 #. Stack size = 0x8000 (32768) bytes
5528 #. Attributes of created thread:
5529 #. Guard size = 4096 bytes
5530 #. Stack address = 0x4001e000 (EOS = 0x40026000)
5531 #. Stack size = 0x8000 (32768) bytes
5535 #: build/C/man3/pthread_getattr_np.3:160
5537 "In the last run, the program manually allocates a stack for the thread. In "
5538 "this case, the guard size attribute is ignored."
5540 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
5541 "この場合には、guard size 属性は無視される。"
5544 #: build/C/man3/pthread_getattr_np.3:165
5547 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5548 "Allocated thread stack at 0x804d000\n"
5550 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5551 "Allocated thread stack at 0x804d000\n"
5554 #: build/C/man3/pthread_getattr_np.3:170
5557 "Thread attributes object after initializations:\n"
5558 " Guard size = 4096 bytes\n"
5559 " Stack address = 0x804d000 (EOS = 0x8055000)\n"
5560 " Stack size = 0x8000 (32768) bytes\n"
5562 "Thread attributes object after initializations:\n"
5563 " Guard size = 4096 bytes\n"
5564 " Stack address = 0x804d000 (EOS = 0x8055000)\n"
5565 " Stack size = 0x8000 (32768) bytes\n"
5568 #: build/C/man3/pthread_getattr_np.3:175
5571 "Attributes of created thread:\n"
5572 " Guard size = 0 bytes\n"
5573 " Stack address = 0x804d000 (EOS = 0x8055000)\n"
5574 " Stack size = 0x8000 (32768) bytes\n"
5576 "Attributes of created thread:\n"
5577 " Guard size = 0 bytes\n"
5578 " Stack address = 0x804d000 (EOS = 0x8055000)\n"
5579 " Stack size = 0x8000 (32768) bytes\n"
5582 #: build/C/man3/pthread_getattr_np.3:196
5586 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5589 " size_t stack_size, guard_size;\n"
5590 " void *stack_addr;\n"
5593 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5596 " size_t stack_size, guard_size;\n"
5597 " void *stack_addr;\n"
5600 #: build/C/man3/pthread_getattr_np.3:201
5603 " s = pthread_attr_getguardsize(attr, &guard_size);\n"
5605 " handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5606 " printf(\"%sGuard size = %d bytes\\en\", prefix, guard_size);\n"
5608 " s = pthread_attr_getguardsize(attr, &guard_size);\n"
5610 " handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5611 " printf(\"%sGuard size = %d bytes\\en\", prefix, guard_size);\n"
5614 #: build/C/man3/pthread_getattr_np.3:212
5617 " s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5619 " handle_error_en(s, \"pthread_attr_getstack\");\n"
5620 " printf(\"%sStack address = %p\", prefix, stack_addr);\n"
5621 " if (stack_size E<gt> 0)\n"
5622 " printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5623 " printf(\"\\en\");\n"
5624 " printf(\"%sStack size = 0x%x (%d) bytes\\en\",\n"
5625 " prefix, stack_size, stack_size);\n"
5628 " s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5630 " handle_error_en(s, \"pthread_attr_getstack\");\n"
5631 " printf(\"%sStack address = %p\", prefix, stack_addr);\n"
5632 " if (stack_size E<gt> 0)\n"
5633 " printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5634 " printf(\"\\en\");\n"
5635 " printf(\"%sStack size = 0x%x (%d) bytes\\en\",\n"
5636 " prefix, stack_size, stack_size);\n"
5640 #: build/C/man3/pthread_getattr_np.3:218
5644 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5647 " pthread_attr_t attr;\n"
5650 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5653 " pthread_attr_t attr;\n"
5656 #: build/C/man3/pthread_getattr_np.3:222
5659 " s = pthread_getattr_np(thread, &attr);\n"
5661 " handle_error_en(s, \"pthread_getattr_np\");\n"
5663 " s = pthread_getattr_np(thread, &attr);\n"
5665 " handle_error_en(s, \"pthread_getattr_np\");\n"
5668 #: build/C/man3/pthread_getattr_np.3:224
5670 msgid " display_stack_related_attributes(&attr, prefix);\n"
5671 msgstr " display_stack_related_attributes(&attr, prefix);\n"
5674 #: build/C/man3/pthread_getattr_np.3:229
5677 " s = pthread_attr_destroy(&attr);\n"
5679 " handle_error_en(s, \"pthread_attr_destroy\");\n"
5682 " s = pthread_attr_destroy(&attr);\n"
5684 " handle_error_en(s, \"pthread_attr_destroy\");\n"
5688 #: build/C/man3/pthread_getattr_np.3:235
5691 "static void * /* Start function for thread we create */\n"
5692 "thread_start(void *arg)\n"
5694 " printf(\"Attributes of created thread:\\en\");\n"
5695 " display_thread_attributes(pthread_self(), \"\\et\");\n"
5697 "static void * /* Start function for thread we create */\n"
5698 "thread_start(void *arg)\n"
5700 " printf(\"Attributes of created thread:\\en\");\n"
5701 " display_thread_attributes(pthread_self(), \"\\et\");\n"
5704 #: build/C/man3/pthread_getattr_np.3:249
5708 "usage(char *pname, char *msg)\n"
5710 " if (msg != NULL)\n"
5711 " fputs(msg, stderr);\n"
5712 " fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5713 " \" [-g guard-size]\\en\", pname);\n"
5714 " fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5715 " exit(EXIT_FAILURE);\n"
5719 "usage(char *pname, char *msg)\n"
5721 " if (msg != NULL)\n"
5722 " fputs(msg, stderr);\n"
5723 " fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5724 " \" [-g guard-size]\\en\", pname);\n"
5725 " fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5726 " exit(EXIT_FAILURE);\n"
5730 #: build/C/man3/pthread_getattr_np.3:262
5733 "static pthread_attr_t * /* Get thread attributes from command line */\n"
5734 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5735 " pthread_attr_t *attrp)\n"
5737 " int s, opt, allocate_stack;\n"
5738 " long stack_size, guard_size;\n"
5739 " void *stack_addr;\n"
5740 " pthread_attr_t *ret_attrp = NULL; /* Set to attrp if we initialize\n"
5741 " a thread attributes object */\n"
5742 " allocate_stack = 0;\n"
5743 " stack_size = -1;\n"
5744 " guard_size = -1;\n"
5746 "static pthread_attr_t * /* Get thread attributes from command line */\n"
5747 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5748 " pthread_attr_t *attrp)\n"
5750 " int s, opt, allocate_stack;\n"
5751 " long stack_size, guard_size;\n"
5752 " void *stack_addr;\n"
5753 " pthread_attr_t *ret_attrp = NULL; /* Set to attrp if we initialize\n"
5754 " a thread attributes object */\n"
5755 " allocate_stack = 0;\n"
5756 " stack_size = -1;\n"
5757 " guard_size = -1;\n"
5760 #: build/C/man3/pthread_getattr_np.3:271
5763 " while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5765 " case \\(aqa\\(aq: allocate_stack = 1; break;\n"
5766 " case \\(aqg\\(aq: guard_size = strtoul(optarg, NULL, 0); break;\n"
5767 " case \\(aqs\\(aq: stack_size = strtoul(optarg, NULL, 0); break;\n"
5768 " default: usage(argv[0], NULL);\n"
5772 " while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5774 " case \\(aqa\\(aq: allocate_stack = 1; break;\n"
5775 " case \\(aqg\\(aq: guard_size = strtoul(optarg, NULL, 0); break;\n"
5776 " case \\(aqs\\(aq: stack_size = strtoul(optarg, NULL, 0); break;\n"
5777 " default: usage(argv[0], NULL);\n"
5782 #: build/C/man3/pthread_getattr_np.3:274
5785 " if (allocate_stack && stack_size == -1)\n"
5786 " usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5788 " if (allocate_stack && stack_size == -1)\n"
5789 " usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5792 #: build/C/man3/pthread_getattr_np.3:277
5795 " if (argc E<gt> optind)\n"
5796 " usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5798 " if (argc E<gt> optind)\n"
5799 " usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5802 #: build/C/man3/pthread_getattr_np.3:280
5805 " if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5806 " ret_attrp = attrp;\n"
5808 " if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5809 " ret_attrp = attrp;\n"
5812 #: build/C/man3/pthread_getattr_np.3:285
5815 " s = pthread_attr_init(attrp);\n"
5817 " handle_error_en(s, \"pthread_attr_init\");\n"
5820 " s = pthread_attr_init(attrp);\n"
5822 " handle_error_en(s, \"pthread_attr_init\");\n"
5826 #: build/C/man3/pthread_getattr_np.3:297
5829 " if (stack_size E<gt>= 0) {\n"
5830 " if (!allocate_stack) {\n"
5831 " s = pthread_attr_setstacksize(attrp, stack_size);\n"
5833 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5835 " s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5838 " handle_error_en(s, \"posix_memalign\");\n"
5839 " printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5841 " if (stack_size E<gt>= 0) {\n"
5842 " if (!allocate_stack) {\n"
5843 " s = pthread_attr_setstacksize(attrp, stack_size);\n"
5845 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5847 " s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5850 " handle_error_en(s, \"posix_memalign\");\n"
5851 " printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5854 #: build/C/man3/pthread_getattr_np.3:303
5857 " s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5859 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5863 " s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5865 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5870 #: build/C/man3/pthread_getattr_np.3:309
5873 " if (guard_size E<gt>= 0) {\n"
5874 " s = pthread_attr_setguardsize(attrp, guard_size);\n"
5876 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5879 " if (guard_size E<gt>= 0) {\n"
5880 " s = pthread_attr_setguardsize(attrp, guard_size);\n"
5882 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5886 #: build/C/man3/pthread_getattr_np.3:312
5889 " return ret_attrp;\n"
5892 " return ret_attrp;\n"
5896 #: build/C/man3/pthread_getattr_np.3:321
5900 "main(int argc, char *argv[])\n"
5904 " pthread_attr_t attr;\n"
5905 " pthread_attr_t *attrp = NULL; /* Set to &attr if we initialize\n"
5906 " a thread attributes object */\n"
5909 "main(int argc, char *argv[])\n"
5913 " pthread_attr_t attr;\n"
5914 " pthread_attr_t *attrp = NULL; /* Set to &attr if we initialize\n"
5915 " a thread attributes object */\n"
5918 #: build/C/man3/pthread_getattr_np.3:323
5920 msgid " attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5921 msgstr " attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5924 #: build/C/man3/pthread_getattr_np.3:329
5927 " if (attrp != NULL) {\n"
5928 " printf(\"Thread attributes object after initializations:\\en\");\n"
5929 " display_stack_related_attributes(attrp, \"\\et\");\n"
5930 " printf(\"\\en\");\n"
5933 " if (attrp != NULL) {\n"
5934 " printf(\"Thread attributes object after initializations:\\en\");\n"
5935 " display_stack_related_attributes(attrp, \"\\et\");\n"
5936 " printf(\"\\en\");\n"
5940 #: build/C/man3/pthread_getattr_np.3:357
5942 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
5943 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
5944 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
5945 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
5946 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
5947 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5949 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
5950 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
5951 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
5952 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
5953 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
5954 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5957 #: build/C/man3/pthread_getcpuclockid.3:24
5959 msgid "PTHREAD_GETCPUCLOCKID"
5960 msgstr "PTHREAD_GETCPUCLOCKID"
5963 #: build/C/man3/pthread_getcpuclockid.3:24
5969 #: build/C/man3/pthread_getcpuclockid.3:27
5970 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
5971 msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する"
5974 #: build/C/man3/pthread_getcpuclockid.3:31
5977 "B<#include E<lt>pthread.hE<gt>>\n"
5978 "B<#include E<lt>time.hE<gt>>\n"
5980 "B<#include E<lt>pthread.hE<gt>>\n"
5981 "B<#include E<lt>time.hE<gt>>\n"
5984 #: build/C/man3/pthread_getcpuclockid.3:33
5986 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
5987 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id);>\n"
5989 #. The clockid is constructed as follows:
5990 #. *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
5991 #. where CLOCK_IDFIELD_SIZE is 3.
5993 #: build/C/man3/pthread_getcpuclockid.3:44
5995 "The B<pthread_getcpuclockid>() function returns the clock ID for the CPU "
5996 "time clock of the thread I<thread>."
5998 "B<pthread_getcpuclockid>() 関数は、\n"
5999 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
6002 #: build/C/man3/pthread_getcpuclockid.3:48
6007 #. CLOCK_THREAD_CPUTIME_ID not defined
6008 #. Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
6009 #. be possible if kernel thread IDs took more than 29 bits (which
6010 #. they currently cannot).
6012 #: build/C/man3/pthread_getcpuclockid.3:56
6013 msgid "Per-thread CPU time clocks are not supported by the system."
6014 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
6017 #: build/C/man3/pthread_getcpuclockid.3:63
6018 msgid "This function is available in glibc since version 2.2."
6019 msgstr "この関数は glibc バージョン 2.2 以降で利用できる。"
6022 #: build/C/man3/pthread_getcpuclockid.3:76
6024 "When I<thread> refers to the calling thread, this function returns an "
6025 "identifier that refers to the same clock manipulated by B<clock_gettime>(2) "
6026 "and B<clock_settime>(2) when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
6028 "I<thread> が呼び出したスレッドを参照している場合、\n"
6029 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
6030 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
6034 #: build/C/man3/pthread_getcpuclockid.3:82
6036 "The program below creates a thread and then uses B<clock_gettime>(2) to "
6037 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
6038 "the two threads. The following shell session shows an example run:"
6040 "以下のプログラムは、スレッドを作成し、それから\n"
6041 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
6042 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
6043 "スレッド毎の CPU 時間を取得する。\n"
6044 "下記のシェルのセッションは実行例である。"
6047 #: build/C/man3/pthread_getcpuclockid.3:91
6051 "Main thread sleeping\n"
6052 "Subthread starting infinite loop\n"
6053 "Main thread consuming some CPU time...\n"
6054 "Process total CPU time: 1.368\n"
6055 "Main thread CPU time: 0.376\n"
6056 "Subthread CPU time: 0.992\n"
6059 "Main thread sleeping\n"
6060 "Subthread starting infinite loop\n"
6061 "Main thread consuming some CPU time...\n"
6062 "Process total CPU time: 1.368\n"
6063 "Main thread CPU time: 0.376\n"
6064 "Subthread CPU time: 0.992\n"
6067 #: build/C/man3/pthread_getcpuclockid.3:97
6069 msgid "/* Link with \"-lrt\" */\n"
6070 msgstr "/* \"-lrt\" でリンクする */\n"
6073 #: build/C/man3/pthread_getcpuclockid.3:105
6076 "#include E<lt>time.hE<gt>\n"
6077 "#include E<lt>stdio.hE<gt>\n"
6078 "#include E<lt>stdlib.hE<gt>\n"
6079 "#include E<lt>unistd.hE<gt>\n"
6080 "#include E<lt>pthread.hE<gt>\n"
6081 "#include E<lt>string.hE<gt>\n"
6082 "#include E<lt>errno.hE<gt>\n"
6084 "#include E<lt>time.hE<gt>\n"
6085 "#include E<lt>stdio.hE<gt>\n"
6086 "#include E<lt>stdlib.hE<gt>\n"
6087 "#include E<lt>unistd.hE<gt>\n"
6088 "#include E<lt>pthread.hE<gt>\n"
6089 "#include E<lt>string.hE<gt>\n"
6090 "#include E<lt>errno.hE<gt>\n"
6093 #: build/C/man3/pthread_getcpuclockid.3:119
6097 "thread_start(void *arg)\n"
6099 " printf(\"Subthread starting infinite loop\\en\");\n"
6105 "thread_start(void *arg)\n"
6107 " printf(\"Subthread starting infinite loop\\en\");\n"
6113 #: build/C/man3/pthread_getcpuclockid.3:124
6117 "pclock(char *msg, clockid_t cid)\n"
6119 " struct timespec ts;\n"
6122 "pclock(char *msg, clockid_t cid)\n"
6124 " struct timespec ts;\n"
6127 #: build/C/man3/pthread_getcpuclockid.3:130
6130 " printf(\"%s\", msg);\n"
6131 " if (clock_gettime(cid, &ts) == -1)\n"
6132 " handle_error(\"clock_gettime\");\n"
6133 " printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6136 " printf(\"%s\", msg);\n"
6137 " if (clock_gettime(cid, &ts) == -1)\n"
6138 " handle_error(\"clock_gettime\");\n"
6139 " printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
6143 #: build/C/man3/pthread_getcpuclockid.3:137
6147 "main(int argc, char *argv[])\n"
6149 " pthread_t thread;\n"
6154 "main(int argc, char *argv[])\n"
6156 " pthread_t thread;\n"
6161 #: build/C/man3/pthread_getcpuclockid.3:141
6164 " s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6166 " handle_error_en(s, \"pthread_create\");\n"
6168 " s = pthread_create(&thread, NULL, thread_start, NULL);\n"
6170 " handle_error_en(s, \"pthread_create\");\n"
6173 #: build/C/man3/pthread_getcpuclockid.3:144
6176 " printf(\"Main thread sleeping\\en\");\n"
6179 " printf(\"Main thread sleeping\\en\");\n"
6183 #: build/C/man3/pthread_getcpuclockid.3:148
6186 " printf(\"Main thread consuming some CPU time...\\en\");\n"
6187 " for (j = 0; j E<lt> 2000000; j++)\n"
6190 " printf(\"Main thread consuming some CPU time...\\en\");\n"
6191 " for (j = 0; j E<lt> 2000000; j++)\n"
6195 #: build/C/man3/pthread_getcpuclockid.3:150
6197 msgid " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6198 msgstr " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
6201 #: build/C/man3/pthread_getcpuclockid.3:155
6204 " s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6206 " handle_error_en(s, \"pthread_getcpuclockid\");\n"
6207 " pclock(\"Main thread CPU time: \", cid);\n"
6209 " s = pthread_getcpuclockid(pthread_self(), &cid);\n"
6211 " handle_error_en(s, \"pthread_getcpuclockid\");\n"
6212 " pclock(\"Main thread CPU time: \", cid);\n"
6215 #: build/C/man3/pthread_getcpuclockid.3:158
6218 " /* The preceding 4 lines of code could have been replaced by:\n"
6219 " pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n"
6221 " /* The preceding 4 lines of code could have been replaced by:\n"
6222 " pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n"
6225 #: build/C/man3/pthread_getcpuclockid.3:163
6228 " s = pthread_getcpuclockid(thread, &cid);\n"
6230 " handle_error_en(s, \"pthread_getcpuclockid\");\n"
6231 " pclock(\"Subthread CPU time: 1 \", cid);\n"
6233 " s = pthread_getcpuclockid(thread, &cid);\n"
6235 " handle_error_en(s, \"pthread_getcpuclockid\");\n"
6236 " pclock(\"Subthread CPU time: 1 \", cid);\n"
6239 #: build/C/man3/pthread_getcpuclockid.3:166
6242 " exit(EXIT_SUCCESS); /* Terminates both threads */\n"
6245 " exit(EXIT_SUCCESS); /* Terminates both threads */\n"
6249 #: build/C/man3/pthread_getcpuclockid.3:175
6251 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6252 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6254 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
6255 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
6258 #: build/C/man3/pthread_join.3:24
6260 msgid "PTHREAD_JOIN"
6261 msgstr "PTHREAD_JOIN"
6264 #: build/C/man3/pthread_join.3:27
6265 msgid "pthread_join - join with a terminated thread"
6269 #: build/C/man3/pthread_join.3:32
6271 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6272 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
6275 #: build/C/man3/pthread_join.3:47
6277 "The B<pthread_join>() function waits for the thread specified by I<thread> "
6278 "to terminate. If that thread has already terminated, then B<pthread_join>"
6279 "() returns immediately. The thread specified by I<thread> must be joinable."
6283 #: build/C/man3/pthread_join.3:61
6285 "If I<retval> is not NULL, then B<pthread_join>() copies the exit status of "
6286 "the target thread (i.e., the value that the target thread supplied to "
6287 "B<pthread_exit>(3)) into the location pointed to by I<*retval>. If the "
6288 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
6292 #: build/C/man3/pthread_join.3:68
6294 "If multiple threads simultaneously try to join with the same thread, the "
6295 "results are undefined. If the thread calling B<pthread_join>() is "
6296 "canceled, then the target thread will remain joinable (i.e., it will not be "
6301 #: build/C/man3/pthread_join.3:73
6303 "On success, B<pthread_join>() returns 0; on error, it returns an error "
6308 #: build/C/man3/pthread_join.3:74
6313 #. The following verified by testing on glibc 2.8/NPTL:
6314 #. The following verified by testing on glibc 2.8/NPTL:
6316 #: build/C/man3/pthread_join.3:83
6318 "A deadlock was detected (e.g., two threads tried to join with each other); "
6319 "or I<thread> specifies the calling thread."
6322 #. POSIX.1-2001 does not specify this error case.
6324 #: build/C/man3/pthread_join.3:91
6325 msgid "Another thread is already waiting to join with this thread."
6329 #: build/C/man3/pthread_join.3:102
6331 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
6332 "the target thread has terminated."
6336 #: build/C/man3/pthread_join.3:105
6338 "Joining with a thread that has previously been joined results in undefined "
6343 #: build/C/man3/pthread_join.3:113
6345 "Failure to join with a thread that is joinable (i.e., one that is not "
6346 "detached), produces a \"zombie thread\". Avoid doing this, since each "
6347 "zombie thread consumes some system resources, and when enough zombie threads "
6348 "have accumulated, it will no longer be possible to create new threads (or "
6353 #: build/C/man3/pthread_join.3:119
6355 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
6356 "\"join with any terminated thread\". If you believe you need this "
6357 "functionality, you probably need to rethink your application design."
6361 #: build/C/man3/pthread_join.3:122
6363 "All of the threads in a process are peers: any thread can join with any "
6364 "other thread in the process."
6368 #: build/C/man3/pthread_join.3:132
6370 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6371 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6373 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
6374 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
6377 #: build/C/man3/pthread_kill.3:24
6379 msgid "PTHREAD_KILL"
6380 msgstr "PTHREAD_KILL"
6383 #: build/C/man3/pthread_kill.3:24
6389 #: build/C/man3/pthread_kill.3:27
6390 msgid "pthread_kill - send a signal to a thread"
6394 #: build/C/man3/pthread_kill.3:30 build/C/man3/pthread_sigmask.3:30
6396 msgid "B<#include E<lt>signal.hE<gt>>\n"
6397 msgstr "B<#include E<lt>signal.hE<gt>>\n"
6400 #: build/C/man3/pthread_kill.3:32
6402 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6403 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
6406 #: build/C/man3/pthread_kill.3:45
6408 "The B<pthread_kill>() function sends the signal I<sig> to I<thread>, "
6409 "another thread in the same process as the caller. The signal is "
6410 "asynchronously directed to I<thread>."
6414 #: build/C/man3/pthread_kill.3:50
6416 "If I<sig> is 0, then no signal is sent, but error checking is still "
6417 "performed; this can be used to check for the existence of a thread ID."
6421 #: build/C/man3/pthread_kill.3:55
6423 "On success, B<pthread_kill>() returns 0; on error, it returns an error "
6424 "number, and no signal is sent."
6428 #: build/C/man3/pthread_kill.3:59
6429 msgid "An invalid signal was specified."
6433 #: build/C/man3/pthread_kill.3:73
6435 "Signal dispositions are process-wide: if a signal handler is installed, the "
6436 "handler will be invoked in the thread I<thread>, but if the disposition of "
6437 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
6438 "affect the whole process."
6442 #: build/C/man3/pthread_kill.3:82
6444 "B<kill>(2) B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
6445 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
6447 "B<kill>(2) B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
6448 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
6451 #: build/C/man3/pthread_kill_other_threads_np.3:24
6453 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
6454 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
6457 #: build/C/man3/pthread_kill_other_threads_np.3:24
6463 #: build/C/man3/pthread_kill_other_threads_np.3:27
6464 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
6468 #: build/C/man3/pthread_kill_other_threads_np.3:32
6470 msgid "B<void pthread_kill_other_threads_np(void);>\n"
6471 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
6474 #. Available since glibc 2.0
6476 #: build/C/man3/pthread_kill_other_threads_np.3:45
6478 "B<pthread_kill_other_threads_np>() only has an effect in the LinuxThreads "
6479 "threading implementation. On that implementation, calling this function "
6480 "causes the immediate termination of all threads in the application, except "
6481 "the calling thread. The cancellation state and cancellation type of the to-"
6482 "be-terminated threads are ignored, and the cleanup handlers are not called "
6487 #: build/C/man3/pthread_kill_other_threads_np.3:57
6489 "B<pthread_kill_other_threads_np>() is intended to be called just before a "
6490 "thread calls B<execve>(2) or a similar function. This function is designed "
6491 "to address a limitation in the obsolete LinuxThreads implementation whereby "
6492 "the other threads of an application are not automatically terminated (as "
6493 "POSIX.1-2001 requires) during B<execve>(2)."
6497 #: build/C/man3/pthread_kill_other_threads_np.3:64
6499 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>() "
6500 "exists, but does nothing. (Nothing needs to be done, because the "
6501 "implementation does the right thing during an B<execve>(2).)"
6505 #: build/C/man3/pthread_kill_other_threads_np.3:70
6507 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
6508 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
6510 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
6511 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
6514 #: build/C/man3/pthread_self.3:24
6516 msgid "PTHREAD_SELF"
6517 msgstr "PTHREAD_SELF"
6520 #: build/C/man3/pthread_self.3:27
6521 msgid "pthread_self - obtain ID of the calling thread"
6525 #: build/C/man3/pthread_self.3:32
6527 msgid "B<pthread_t pthread_self(void);>\n"
6528 msgstr "B<pthread_t pthread_self(void);>\n"
6531 #: build/C/man3/pthread_self.3:44
6533 "The B<pthread_self>() function returns the ID of the calling thread. This "
6534 "is the same value that is returned in I<*thread> in the B<pthread_create>"
6535 "(3) call that created this thread."
6539 #: build/C/man3/pthread_self.3:46
6540 msgid "This function always succeeds, returning the calling thread's ID."
6544 #: build/C/man3/pthread_self.3:61
6546 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
6547 "represent a thread ID; for example, representation using either an "
6548 "arithmetic type or a structure is permitted. Therefore, variables of type "
6549 "I<pthread_t> can't portably be compared using the C equality operator "
6550 "(B<==>); use B<pthread_equal>(3) instead."
6554 #: build/C/man3/pthread_self.3:65
6556 "Thread identifiers should be considered opaque: any attempt to use a thread "
6557 "ID other than in pthreads calls is nonportable and can lead to unspecified "
6562 #: build/C/man3/pthread_self.3:69
6564 "Thread IDs are only guaranteed to be unique within a process. A thread ID "
6565 "may be reused after a terminated thread has been joined, or a detached "
6566 "thread has terminated."
6570 #: build/C/man3/pthread_self.3:74
6572 "The thread ID returned by B<pthread_self>() is not the same thing as the "
6573 "kernel thread ID returned by a call to B<gettid>(2)."
6577 #: build/C/man3/pthread_self.3:78
6578 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6579 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6582 #: build/C/man3/pthread_setaffinity_np.3:24
6584 msgid "PTHREAD_SETAFFINITY_NP"
6585 msgstr "PTHREAD_SETAFFINITY_NP"
6588 #: build/C/man3/pthread_setaffinity_np.3:28
6590 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
6593 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
6594 "CPU affinity の設定/取得を行う"
6597 #: build/C/man3/pthread_setaffinity_np.3:37
6600 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6601 "B< const cpu_set_t *>I<cpuset>B<);>\n"
6602 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6603 "B< cpu_set_t *>I<cpuset>B<);>\n"
6605 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6606 "B< const cpu_set_t *>I<cpuset>B<);>\n"
6607 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6608 "B< cpu_set_t *>I<cpuset>B<);>\n"
6611 #: build/C/man3/pthread_setaffinity_np.3:52
6613 "The B<pthread_setaffinity_np>() function sets the CPU affinity mask of the "
6614 "thread I<thread> to the CPU set pointed to by I<cpuset>. If the call is "
6615 "successful, and the thread is not currently running on one of the CPUs in "
6616 "I<cpuset>, then it is migrated to one of those CPUs."
6618 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
6619 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
6620 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
6621 "場合は、スレッドは指定された CPU のいずれかに移動される。"
6624 #: build/C/man3/pthread_setaffinity_np.3:59
6626 "The B<pthread_getaffinity_np>() function returns the CPU affinity mask of "
6627 "the thread I<thread> in the buffer pointed to by I<cpuset>."
6629 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
6630 "マスクを、I<cpuset> が指すバッファに入れて返す。"
6633 #: build/C/man3/pthread_setaffinity_np.3:75
6635 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
6636 "by I<cpuset>. Typically, this argument would be specified as I<sizeof"
6637 "(cpu_set_t)>. (It may be some other value, if using the macros described in "
6638 "B<CPU_SET>(3) for dynamically allocating a CPU set.)"
6640 "引き数 I<cpusetsize> は I<cpuset> が指すバッファの長さ (バイト単位) で\n"
6641 "ある。通常は、この引き数には I<sizeof(cpu_set_t)> を指定する\n"
6642 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
6643 "割り当てている場合には、別の値になることもある)。"
6646 #: build/C/man3/pthread_setaffinity_np.3:79
6652 #: build/C/man3/pthread_setaffinity_np.3:82
6653 msgid "A supplied memory address was invalid."
6654 msgstr "指定されたメモリアドレスが無効である。"
6657 #: build/C/man3/pthread_setaffinity_np.3:91
6659 "(B<pthread_setaffinity_np>()) The affinity bit mask I<mask> contains no "
6660 "processors that are currently physically on the system and permitted to the "
6661 "thread according to any restrictions that may be imposed by the \"cpuset\" "
6662 "mechanism described in B<cpuset>(7)."
6664 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
6665 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
6666 "されているプロセッサが一つも含まれていない。\n"
6667 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
6668 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
6671 #. Loic Domaigne commented: it seems that in the future the
6672 #. kernel developers want to make cpumask_t dynamic, so
6673 #. CONFIG_NR_CPUS might become obsolete in the future.
6675 #. The raw sched_getaffinity() system call returns the size (in bytes)
6676 #. of the cpumask_t type.
6678 #: build/C/man3/pthread_setaffinity_np.3:107
6680 "(B<pthread_setaffinity_np>()) I<cpuset> specified a CPU that was outside "
6681 "the set supported by the kernel. (The kernel configuration option "
6682 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
6683 "type used to represent CPU sets.)"
6685 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
6686 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
6687 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
6688 "データ型がサポートする CPU 集合の範囲が定義される。)"
6691 #: build/C/man3/pthread_setaffinity_np.3:112
6693 "(B<pthread_getaffinity_np>()) I<cpusetsize> is smaller than the size of the "
6694 "affinity mask used by the kernel."
6696 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
6697 "affinity マスクの大きさよりも小さい。"
6700 #: build/C/man3/pthread_setaffinity_np.3:135
6702 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
6703 "thread will actually run is the intersection of the set specified in the "
6704 "I<cpuset> argument and the set of CPUs actually present on the system. The "
6705 "system may further restrict the set of CPUs on which the thread runs if the "
6706 "\"cpuset\" mechanism described in B<cpuset>(7) is being used. These "
6707 "restrictions on the actual set of CPUs on which the thread will run are "
6708 "silently imposed by the kernel."
6710 "B<pthread_setaffinity_np>() を呼び出した後、\n"
6711 "そのスレッドが実際に実行される CPU 集合は、\n"
6712 "I<cpuset> 引き数で指定された集合と\n"
6713 "システムに実際に存在する CPU 集合の共通部分になる。\n"
6714 "また、 B<cpuset>(7) で説明されている \"cpuset\" 機構が使われている場合\n"
6715 "には、そのスレッドが実行される CPU 集合がシステムによってさらに制限\n"
6716 "される場合がある。そのスレッドが実行される実際の CPU 集合に対する\n"
6717 "これらの制限は、カーネルにより黙って適用される。"
6720 #: build/C/man3/pthread_setaffinity_np.3:141
6722 "These functions are implemented on top of the B<sched_setaffinity>(2) and "
6723 "B<sched_getaffinity>(2) system calls."
6725 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
6726 "B<sched_getaffinity>(2) を使って実装されている。"
6729 #: build/C/man3/pthread_setaffinity_np.3:152
6731 "A new thread created by B<pthread_create>(3) inherits a copy of its "
6732 "creator's CPU affinity mask."
6734 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
6735 "作成者の CPU affinity マスクを継承する。"
6738 #: build/C/man3/pthread_setaffinity_np.3:160
6740 "In the following program, the main thread uses B<pthread_setaffinity_np>() "
6741 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
6742 "available on the system), and then calls B<pthread_getaffinity_np>() to "
6743 "check the resulting CPU affinity mask of the thread."
6745 "以下のプログラムでは、メインスレッドは\n"
6746 "B<pthread_setaffinity_np>() を使って自分の CPU affinity マスクに\n"
6747 "CPU 0 から 7 が含まれるように設定し\n"
6748 "(システム上には 0 から 7 に対応する CPU が全て存在するとは限らない)、\n"
6749 "その後で B<pthread_getaffinity_np>() を使って\n"
6750 "スレッドに実際に設定された CPU affinity マスクを確認している。"
6753 #: build/C/man3/pthread_setaffinity_np.3:167
6756 "#define _GNU_SOURCE\n"
6757 "#include E<lt>pthread.hE<gt>\n"
6758 "#include E<lt>stdio.hE<gt>\n"
6759 "#include E<lt>stdlib.hE<gt>\n"
6760 "#include E<lt>errno.hE<gt>\n"
6762 "#define _GNU_SOURCE\n"
6763 "#include E<lt>pthread.hE<gt>\n"
6764 "#include E<lt>stdio.hE<gt>\n"
6765 "#include E<lt>stdlib.hE<gt>\n"
6766 "#include E<lt>errno.hE<gt>\n"
6769 #: build/C/man3/pthread_setaffinity_np.3:177
6773 "main(int argc, char *argv[])\n"
6776 " cpu_set_t cpuset;\n"
6777 " pthread_t thread;\n"
6780 "main(int argc, char *argv[])\n"
6783 " cpu_set_t cpuset;\n"
6784 " pthread_t thread;\n"
6787 #: build/C/man3/pthread_setaffinity_np.3:179
6789 msgid " thread = pthread_self();\n"
6790 msgstr " thread = pthread_self();\n"
6793 #: build/C/man3/pthread_setaffinity_np.3:181
6795 msgid " /* Set affinity mask to include CPUs 0 to 7 */\n"
6796 msgstr " /* Set affinity mask to include CPUs 0 to 7 */\n"
6799 #: build/C/man3/pthread_setaffinity_np.3:185
6802 " CPU_ZERO(&cpuset);\n"
6803 " for (j = 0; j E<lt> 8; j++)\n"
6804 " CPU_SET(j, &cpuset);\n"
6806 " CPU_ZERO(&cpuset);\n"
6807 " for (j = 0; j E<lt> 8; j++)\n"
6808 " CPU_SET(j, &cpuset);\n"
6811 #: build/C/man3/pthread_setaffinity_np.3:189
6814 " s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6816 " handle_error_en(s, \"pthread_setaffinity_np\");\n"
6818 " s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6820 " handle_error_en(s, \"pthread_setaffinity_np\");\n"
6823 #: build/C/man3/pthread_setaffinity_np.3:191
6825 msgid " /* Check the actual affinity mask assigned to the thread */\n"
6826 msgstr " /* Check the actual affinity mask assigned to the thread */\n"
6829 #: build/C/man3/pthread_setaffinity_np.3:195
6832 " s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6834 " handle_error_en(s, \"pthread_getaffinity_np\");\n"
6836 " s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6838 " handle_error_en(s, \"pthread_getaffinity_np\");\n"
6841 #: build/C/man3/pthread_setaffinity_np.3:200
6844 " printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6845 " for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6846 " if (CPU_ISSET(j, &cpuset))\n"
6847 " printf(\" CPU %d\\en\", j);\n"
6849 " printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6850 " for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6851 " if (CPU_ISSET(j, &cpuset))\n"
6852 " printf(\" CPU %d\\en\", j);\n"
6855 #: build/C/man3/pthread_setaffinity_np.3:203
6856 #: build/C/man3/pthread_setschedparam.3:428
6859 " exit(EXIT_SUCCESS);\n"
6862 " exit(EXIT_SUCCESS);\n"
6866 #: build/C/man3/pthread_setaffinity_np.3:212
6868 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
6869 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
6870 "B<cpuset>(7), B<pthreads>(7)"
6872 "B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
6873 "B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), "
6874 "B<cpuset>(7), B<pthreads>(7)"
6877 #: build/C/man3/pthread_setcancelstate.3:24
6879 msgid "PTHREAD_SETCANCELSTATE"
6880 msgstr "PTHREAD_SETCANCELSTATE"
6883 #: build/C/man3/pthread_setcancelstate.3:28
6885 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
6888 "pthread_setcancelstate, pthread_setcanceltype - cancelability state と\n"
6892 #: build/C/man3/pthread_setcancelstate.3:34
6895 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6896 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6898 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6899 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6902 #: build/C/man3/pthread_setcancelstate.3:49
6904 "The B<pthread_setcancelstate>() sets the cancelability state of the calling "
6905 "thread to the value given in I<state>. The previous cancelability state of "
6906 "the thread is returned in the buffer pointed to by I<oldstate>. The "
6907 "I<state> argument must have one of the following values:"
6909 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
6910 "cancelability state に I<state> で指定された値を設定する。\n"
6911 "変更前のスレッドの cancelability state は\n"
6912 "I<oldstate> が指すバッファで返される。\n"
6913 "I<state> 引き数には以下の値のいずれか一つを指定しなければならない。"
6916 #: build/C/man3/pthread_setcancelstate.3:49
6918 msgid "B<PTHREAD_CANCEL_ENABLE>"
6919 msgstr "B<PTHREAD_CANCEL_ENABLE>"
6922 #: build/C/man3/pthread_setcancelstate.3:56
6924 "The thread is cancelable. This is the default cancelability state in all "
6925 "new threads, including the initial thread. The thread's cancelability type "
6926 "determines when a cancelable thread will respond to a cancellation request."
6928 "スレッドは取り消し可能 (cancelable) である。\n"
6929 "これが全ての新しく作成されるスレッドでのデフォルトの cancelability\n"
6930 "state である。これには最初のスレッドも含まれる。\n"
6931 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
6932 "取り消し要求にいつ反応するかが決まる。"
6935 #: build/C/man3/pthread_setcancelstate.3:56
6937 msgid "B<PTHREAD_CANCEL_DISABLE>"
6938 msgstr "B<PTHREAD_CANCEL_DISABLE>"
6941 #: build/C/man3/pthread_setcancelstate.3:61
6943 "The thread is not cancelable. If a cancellation request is received, it is "
6944 "blocked until cancelability is enabled."
6946 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
6947 "取り消し可能に設定されるまでその要求はブロックされる。"
6950 #: build/C/man3/pthread_setcancelstate.3:73
6952 "The B<pthread_setcanceltype>() sets the cancelability type of the calling "
6953 "thread to the value given in I<type>. The previous cancelability type of "
6954 "the thread is returned in the buffer pointed to by I<oldtype>. The I<type> "
6955 "argument must have one of the following values:"
6957 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
6958 "cancelability type に I<type> で指定された値を設定する。\n"
6959 "変更前のスレッドの cancelability type は\n"
6960 "I<oldtype> が指すバッファで返される。\n"
6961 "I<type> 引き数には以下の値のいずれか一つを指定しなければならない。"
6964 #: build/C/man3/pthread_setcancelstate.3:73
6966 msgid "B<PTHREAD_CANCEL_DEFERRED>"
6967 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
6970 #: build/C/man3/pthread_setcancelstate.3:80
6972 "A cancellation request is deferred until the thread next calls a function "
6973 "that is a cancellation point (see B<pthreads>(7)). This is the default "
6974 "cancelability type in all new threads, including the initial thread."
6976 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
6977 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
6978 "スレッドでのデフォルトの cancellation type である。\n"
6982 #: build/C/man3/pthread_setcancelstate.3:80
6984 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6985 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6988 #: build/C/man3/pthread_setcancelstate.3:86
6990 "The thread can be canceled at any time. (Typically, it will be canceled "
6991 "immediately upon receiving a cancellation request, but the system doesn't "
6994 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
6995 "システムがそのことを保証しているわけではない)。"
6998 #: build/C/man3/pthread_setcancelstate.3:90
7000 "The set-and-get operation performed by each of these functions is atomic "
7001 "with respect to other threads in the process calling the same function."
7005 #: build/C/man3/pthread_setcancelstate.3:97
7006 msgid "The B<pthread_setcancelstate>() can fail with the following error:"
7007 msgstr "B<pthread_setcancelstate>() は以下のエラーで失敗する場合がある。"
7010 #: build/C/man3/pthread_setcancelstate.3:101
7011 msgid "Invalid value for I<state>."
7012 msgstr "I<state> に無効な値が指定された。"
7015 #: build/C/man3/pthread_setcancelstate.3:105
7016 msgid "The B<pthread_setcanceltype>() can fail with the following error:"
7017 msgstr "B<pthread_setcanceltype>() は以下のエラーで失敗する場合がある。"
7020 #. Available since glibc 2.0
7022 #: build/C/man3/pthread_setcancelstate.3:111
7023 msgid "Invalid value for I<type>."
7024 msgstr "I<type> に無効な値が指定された。"
7027 #: build/C/man3/pthread_setcancelstate.3:116
7029 "For details of what happens when a thread is canceled, see B<pthread_cancel>"
7032 "スレッドが取り消された場合に何が起こるかの詳細については\n"
7033 "B<pthread_cancel>(3) を参照。"
7036 #: build/C/man3/pthread_setcancelstate.3:123
7038 "Briefly disabling cancelability is useful if a thread performs some critical "
7039 "action that must not be interrupted by a cancellation request. Beware of "
7040 "disabling cancelability for long periods, or around operations that may "
7041 "block for long periods, since that will render the thread unresponsive to "
7042 "cancellation requests."
7046 #: build/C/man3/pthread_setcancelstate.3:154
7048 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
7049 "useful. Since the thread could be canceled at I<any> time, it cannot safely "
7050 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
7051 "mutexes, semaphores, or locks, and so on. Reserving resources is unsafe "
7052 "because the application has no way of knowing what the state of these "
7053 "resources is when the thread is canceled; that is, did cancellation occur "
7054 "before the resources were reserved, while they were reserved, or after they "
7055 "were released? Furthermore, some internal data structures (e.g., the linked "
7056 "list of free blocks managed by the B<malloc>(3) family of functions) may be "
7057 "left in an inconsistent state if cancellation occurs in the middle of the "
7058 "function call. Consequently, clean-up handlers cease to be useful. "
7059 "Functions that can be safely asynchronously canceled are called I<async-"
7060 "cancel-safe functions>. POSIX.1-2001 only requires that B<pthread_cancel>"
7061 "(3), B<pthread_setcancelstate>(), and B<pthread_setcanceltype>() be async-"
7062 "cancel-safe. In general, other library functions can't be safely called "
7063 "from an asynchronously cancelable thread. One of the few circumstances in "
7064 "which asynchronous cancelability is useful is for cancellation of a thread "
7065 "that is in a pure compute-bound loop."
7068 #. It looks like at least Solaris, FreeBSD and Tru64 support this.
7070 #: build/C/man3/pthread_setcancelstate.3:172
7072 "The Linux threading implementations permit the I<oldstate> argument of "
7073 "B<pthread_setcancelstate>() to be NULL, in which case the information about "
7074 "the previous cancelability state is not returned to the caller. Many other "
7075 "implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 "
7076 "does not specify this point, so portable applications should always specify "
7077 "a non-NULL value in I<oldstate>. A precisely analogous set of statements "
7078 "applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
7082 #: build/C/man3/pthread_setcancelstate.3:175
7083 msgid "See B<pthread_cancel>(3)."
7084 msgstr "B<pthread_cancel>(3) を参照。"
7087 #: build/C/man3/pthread_setcancelstate.3:180
7089 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7092 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
7096 #: build/C/man3/pthread_setconcurrency.3:23
7098 msgid "PTHREAD_SETCONCURRENCY"
7099 msgstr "PTHREAD_SETCONCURRENCY"
7102 #: build/C/man3/pthread_setconcurrency.3:23 build/C/man3/pthread_yield.3:23
7108 #: build/C/man3/pthread_setconcurrency.3:27
7110 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
7115 #: build/C/man3/pthread_setconcurrency.3:33
7118 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7119 "B<int pthread_getconcurrency(void);>\n"
7121 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
7122 "B<int pthread_getconcurrency(void);>\n"
7125 #: build/C/man3/pthread_setconcurrency.3:46
7127 "The B<pthread_setconcurrency>() function informs the implementation of the "
7128 "application's desired concurrency level, specified in I<new_level>. The "
7129 "implementation only takes this as a hint: POSIX.1 does not specify the level "
7130 "of concurrency that should be provided as a result of calling "
7131 "B<pthread_setconcurrency>()."
7135 #: build/C/man3/pthread_setconcurrency.3:51
7137 "Specifying I<new_level> as 0 instructs the implementation to manage the "
7138 "concurrency level as it deems appropriate."
7142 #: build/C/man3/pthread_setconcurrency.3:54
7144 "B<pthread_getconcurrency>() returns the current value of the concurrency "
7145 "level for this process."
7149 #: build/C/man3/pthread_setconcurrency.3:59
7151 "On success, B<pthread_setconcurrency>() returns 0; on error, it returns a "
7152 "nonzero error number."
7156 #: build/C/man3/pthread_setconcurrency.3:66
7158 "B<pthread_getconcurrency>() always succeeds, returning the concurrency "
7159 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
7160 "B<pthread_setconcurrency>() has not previously been called."
7164 #: build/C/man3/pthread_setconcurrency.3:69
7165 msgid "B<pthread_setconcurrency>() can fail with the following error:"
7166 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
7169 #: build/C/man3/pthread_setconcurrency.3:73
7170 msgid "I<new_level> is negative."
7174 #: build/C/man3/pthread_setconcurrency.3:79
7176 "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
7177 "I<new_level> would cause a system resource to be exceeded\")."
7181 #: build/C/man3/pthread_setconcurrency.3:81
7182 msgid "These functions are available in glibc since version 2.1."
7183 msgstr "これらの関数は glibc バージョン 2.1 以降で利用できる。"
7186 #: build/C/man3/pthread_setconcurrency.3:85
7187 msgid "The default concurrency level is 0."
7191 #: build/C/man3/pthread_setconcurrency.3:92
7193 "Concurrency levels are only meaningful for M:N threading implementations, "
7194 "where at any moment a subset of a process's set of user-level threads may be "
7195 "bound to a smaller number of kernel-scheduling entities. Setting the "
7196 "concurrency level allows the application to give the system a hint as to the "
7197 "number of kernel-scheduling entities that should be provided for efficient "
7198 "execution of the application."
7202 #: build/C/man3/pthread_setconcurrency.3:98
7204 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
7205 "concurrency level has no meaning. In other words, on Linux these functions "
7206 "merely exist for compatibility with other systems, and they have no effect "
7207 "on the execution of a program."
7211 #: build/C/man3/pthread_setconcurrency.3:101
7212 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
7213 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
7216 #: build/C/man3/pthread_setschedparam.3:24
7218 msgid "PTHREAD_SETSCHEDPARAM"
7219 msgstr "PTHREAD_SETSCHEDPARAM"
7222 #: build/C/man3/pthread_setschedparam.3:28
7224 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
7225 "parameters of a thread"
7229 #: build/C/man3/pthread_setschedparam.3:36
7232 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
7233 "B< const struct sched_param *>I<param>B<);>\n"
7234 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
7235 "B< struct sched_param *>I<param>B<);>\n"
7237 "B<pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
7238 "B< const struct sched_param *>I<param>B<);>\n"
7239 "B<pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
7240 "B< struct sched_param *>I<param>B<);>\n"
7243 #: build/C/man3/pthread_setschedparam.3:44
7245 "The B<pthread_setschedparam>() function sets the scheduling policy and "
7246 "parameters of the thread I<thread>."
7249 #. FIXME . pthread_setschedparam() places no restriction on the policy,
7250 #. but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
7251 #. http://sourceware.org/bugzilla/show_bug.cgi?id=7013
7253 #: build/C/man3/pthread_setschedparam.3:55
7255 "I<policy> specifies the new scheduling policy for I<thread>. The supported "
7256 "values for I<policy>, and their semantics, are described in "
7257 "B<sched_setscheduler>(2)."
7261 #: build/C/man3/pthread_setschedparam.3:61
7263 "The structure pointed to by I<param> specifies the new scheduling parameters "
7264 "for I<thread>. Scheduling parameters are maintained in the following "
7268 #. FIXME . nptl/pthread_setschedparam.c has the following
7269 #. /* If the thread should have higher priority because of some
7270 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
7271 #. Eventually (perhaps after writing the mutexattr pages), we
7272 #. may want to add something on the topic to this page.
7274 #: build/C/man3/pthread_setschedparam.3:102
7276 "The B<pthread_getschedparam>() function returns the scheduling policy and "
7277 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
7278 "and I<param>, respectively. The returned priority value is that set by the "
7279 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
7280 "B<pthread_create>(3) call that affected I<thread>. The returned priority "
7281 "does not reflect any temporary priority adjustments as a result of calls to "
7282 "any priority inheritance or priority ceiling functions (see, for example, "
7283 "B<pthread_mutexattr_setprioceiling>(3) and B<pthread_mutexattr_setprotocol>"
7288 #: build/C/man3/pthread_setschedparam.3:110
7290 "On success, these functions return 0; on error, they return a nonzero error "
7291 "number. If B<pthread_setschedparam>() fails, the scheduling policy and "
7292 "parameters of I<thread> are not changed."
7296 #: build/C/man3/pthread_setschedparam.3:112
7297 msgid "Both of these functions can fail with the following error:"
7298 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
7301 #: build/C/man3/pthread_setschedparam.3:120
7303 "B<pthread_setschedparam>() may additionally fail with the following errors:"
7304 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
7307 #: build/C/man3/pthread_setschedparam.3:127
7309 "I<policy> is not a recognized policy, or I<param> does not make sense for "
7314 #: build/C/man3/pthread_setschedparam.3:131
7316 "The caller does not have appropriate privileges to set the specified "
7317 "scheduling policy and parameters."
7321 #. Available since glibc 2.0
7323 #: build/C/man3/pthread_setschedparam.3:139
7325 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
7326 "policy or scheduling parameters to an unsupported value\") error for "
7327 "B<pthread_setschedparam>()."
7331 #: build/C/man3/pthread_setschedparam.3:147
7333 "For a description of the permissions required to, and the effect of, "
7334 "changing a thread's scheduling policy and priority, and details of the "
7335 "permitted ranges for priorities in each scheduling policy, see "
7336 "B<sched_setscheduler>(2)."
7340 #: build/C/man3/pthread_setschedparam.3:154
7342 "The program below demonstrates the use of B<pthread_setschedparam>() and "
7343 "B<pthread_getschedparam>(), as well as the use of a number of other "
7344 "scheduling-related pthreads functions."
7348 #: build/C/man3/pthread_setschedparam.3:170
7350 "In the following run, the main thread sets its scheduling policy to "
7351 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
7352 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
7353 "priority attribute of 20. The program then sets (using "
7354 "B<pthread_attr_setinheritsched>(3)) the inherit scheduler attribute of the "
7355 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
7356 "created using this attributes object should take their scheduling attributes "
7357 "from the thread attributes object. The program then creates a thread using "
7358 "the thread attributes object, and that thread displays its scheduling policy "
7363 #: build/C/man3/pthread_setschedparam.3:178
7366 "$ B<su> # Need privilege to set real-time scheduling policies\n"
7368 "# B<./a.out -mf10 -ar20 -i e>\n"
7369 "Scheduler settings of main thread\n"
7370 " policy=SCHED_FIFO, priority=10\n"
7372 "$ B<su> # Need privilege to set real-time scheduling policies\n"
7374 "# B<./a.out -mf10 -ar20 -i e>\n"
7375 "Scheduler settings of main thread\n"
7376 " policy=SCHED_FIFO, priority=10\n"
7379 #: build/C/man3/pthread_setschedparam.3:182
7382 "Scheduler settings in \\(aqattr\\(aq\n"
7383 " policy=SCHED_RR, priority=20\n"
7384 " inheritsched is EXPLICIT\n"
7386 "Scheduler settings in \\(aqattr\\(aq\n"
7387 " policy=SCHED_RR, priority=20\n"
7388 " inheritsched is EXPLICIT\n"
7391 #: build/C/man3/pthread_setschedparam.3:185
7394 "Scheduler attributes of new thread\n"
7395 " policy=SCHED_RR, priority=20\n"
7397 "Scheduler attributes of new thread\n"
7398 " policy=SCHED_RR, priority=20\n"
7401 #: build/C/man3/pthread_setschedparam.3:190
7403 "In the above output, one can see that the scheduling policy and priority "
7404 "were taken from the values specified in the thread attributes object."
7408 #: build/C/man3/pthread_setschedparam.3:197
7410 "The next run is the same as the previous, except that the inherit scheduler "
7411 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
7412 "using the thread attributes object should ignore the scheduling attributes "
7413 "specified in the attributes object and instead take their scheduling "
7414 "attributes from the creating thread."
7418 #: build/C/man3/pthread_setschedparam.3:203
7421 "# B<./a.out -mf10 -ar20 -i i>\n"
7422 "Scheduler settings of main thread\n"
7423 " policy=SCHED_FIFO, priority=10\n"
7425 "# B<./a.out -mf10 -ar20 -i i>\n"
7426 "Scheduler settings of main thread\n"
7427 " policy=SCHED_FIFO, priority=10\n"
7430 #: build/C/man3/pthread_setschedparam.3:207
7433 "Scheduler settings in \\(aqattr\\(aq\n"
7434 " policy=SCHED_RR, priority=20\n"
7435 " inheritsched is INHERIT\n"
7437 "Scheduler settings in \\(aqattr\\(aq\n"
7438 " policy=SCHED_RR, priority=20\n"
7439 " inheritsched is INHERIT\n"
7442 #: build/C/man3/pthread_setschedparam.3:210
7445 "Scheduler attributes of new thread\n"
7446 " policy=SCHED_FIFO, priority=10\n"
7448 "Scheduler attributes of new thread\n"
7449 " policy=SCHED_FIFO, priority=10\n"
7452 #: build/C/man3/pthread_setschedparam.3:216
7454 "In the above output, one can see that the scheduling policy and priority "
7455 "were taken from the creating thread, rather than the thread attributes "
7460 #: build/C/man3/pthread_setschedparam.3:222
7462 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
7463 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
7464 "scheduler attribute."
7468 #: build/C/man3/pthread_setschedparam.3:226
7470 msgid "/* pthreads_sched_test.c */\n"
7471 msgstr "/* pthreads_sched_test.c */\n"
7474 #: build/C/man3/pthread_setschedparam.3:232
7477 "#include E<lt>pthread.hE<gt>\n"
7478 "#include E<lt>stdio.hE<gt>\n"
7479 "#include E<lt>stdlib.hE<gt>\n"
7480 "#include E<lt>unistd.hE<gt>\n"
7481 "#include E<lt>errno.hE<gt>\n"
7483 "#include E<lt>pthread.hE<gt>\n"
7484 "#include E<lt>stdio.hE<gt>\n"
7485 "#include E<lt>stdlib.hE<gt>\n"
7486 "#include E<lt>unistd.hE<gt>\n"
7487 "#include E<lt>errno.hE<gt>\n"
7490 #: build/C/man3/pthread_setschedparam.3:241
7494 "usage(char *prog_name, char *msg)\n"
7496 " if (msg != NULL)\n"
7497 " fputs(msg, stderr);\n"
7500 "usage(char *prog_name, char *msg)\n"
7502 " if (msg != NULL)\n"
7503 " fputs(msg, stderr);\n"
7506 #: build/C/man3/pthread_setschedparam.3:258
7509 " fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
7510 " fprintf(stderr, \"Options are:\\en\");\n"
7511 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg); /* Shorter */\n"
7512 " fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
7513 " fpe(\" thread attributes object\\en\");\n"
7514 " fpe(\" E<lt>policyE<gt> can be\\en\");\n"
7515 " fpe(\" f SCHED_FIFO\\en\");\n"
7516 " fpe(\" r SCHED_RR\\en\");\n"
7517 " fpe(\" o SCHED_OTHER\\en\");\n"
7518 " fpe(\"-A Use default thread attributes object\\en\");\n"
7519 " fpe(\"-i {e|s} Set inherit scheduler attribute to\\en\");\n"
7520 " fpe(\" \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
7521 " fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
7522 " fpe(\" main thread before pthread_create() call\\en\");\n"
7523 " exit(EXIT_FAILURE);\n"
7526 " fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
7527 " fprintf(stderr, \"Options are:\\en\");\n"
7528 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg); /* Shorter */\n"
7529 " fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
7530 " fpe(\" thread attributes object\\en\");\n"
7531 " fpe(\" E<lt>policyE<gt> can be\\en\");\n"
7532 " fpe(\" f SCHED_FIFO\\en\");\n"
7533 " fpe(\" r SCHED_RR\\en\");\n"
7534 " fpe(\" o SCHED_OTHER\\en\");\n"
7535 " fpe(\"-A Use default thread attributes object\\en\");\n"
7536 " fpe(\"-i {e|s} Set inherit scheduler attribute to\\en\");\n"
7537 " fpe(\" \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
7538 " fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
7539 " fpe(\" main thread before pthread_create() call\\en\");\n"
7540 " exit(EXIT_FAILURE);\n"
7544 #: build/C/man3/pthread_setschedparam.3:269
7548 "get_policy(char p, int *policy)\n"
7551 " case \\(aqf\\(aq: *policy = SCHED_FIFO; return 1;\n"
7552 " case \\(aqr\\(aq: *policy = SCHED_RR; return 1;\n"
7553 " case \\(aqo\\(aq: *policy = SCHED_OTHER; return 1;\n"
7554 " default: return 0;\n"
7559 "get_policy(char p, int *policy)\n"
7562 " case \\(aqf\\(aq: *policy = SCHED_FIFO; return 1;\n"
7563 " case \\(aqr\\(aq: *policy = SCHED_RR; return 1;\n"
7564 " case \\(aqo\\(aq: *policy = SCHED_OTHER; return 1;\n"
7565 " default: return 0;\n"
7570 #: build/C/man3/pthread_setschedparam.3:280
7574 "display_sched_attr(int policy, struct sched_param *param)\n"
7576 " printf(\" policy=%s, priority=%d\\en\",\n"
7577 " (policy == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
7578 " (policy == SCHED_RR) ? \"SCHED_RR\" :\n"
7579 " (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
7581 " param-E<gt>sched_priority);\n"
7585 "display_sched_attr(int policy, struct sched_param *param)\n"
7587 " printf(\" policy=%s, priority=%d\\en\",\n"
7588 " (policy == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
7589 " (policy == SCHED_RR) ? \"SCHED_RR\" :\n"
7590 " (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
7592 " param-E<gt>sched_priority);\n"
7596 #: build/C/man3/pthread_setschedparam.3:286
7600 "display_thread_sched_attr(char *msg)\n"
7603 " struct sched_param param;\n"
7606 "display_thread_sched_attr(char *msg)\n"
7609 " struct sched_param param;\n"
7612 #: build/C/man3/pthread_setschedparam.3:290
7615 " s = pthread_getschedparam(pthread_self(), &policy, ¶m);\n"
7617 " handle_error_en(s, \"pthread_getschedparam\");\n"
7619 " s = pthread_getschedparam(pthread_self(), &policy, ¶m);\n"
7621 " handle_error_en(s, \"pthread_getschedparam\");\n"
7624 #: build/C/man3/pthread_setschedparam.3:294
7627 " printf(\"%s\\en\", msg);\n"
7628 " display_sched_attr(policy, ¶m);\n"
7631 " printf(\"%s\\en\", msg);\n"
7632 " display_sched_attr(policy, ¶m);\n"
7636 #: build/C/man3/pthread_setschedparam.3:299
7640 "thread_start(void *arg)\n"
7642 " display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7645 "thread_start(void *arg)\n"
7647 " display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7650 #: build/C/man3/pthread_setschedparam.3:302
7660 #: build/C/man3/pthread_setschedparam.3:312
7664 "main(int argc, char *argv[])\n"
7666 " int s, opt, inheritsched, use_null_attrib, policy;\n"
7667 " pthread_t thread;\n"
7668 " pthread_attr_t attr;\n"
7669 " pthread_attr_t *attrp;\n"
7670 " char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7671 " struct sched_param param;\n"
7674 "main(int argc, char *argv[])\n"
7676 " int s, opt, inheritsched, use_null_attrib, policy;\n"
7677 " pthread_t thread;\n"
7678 " pthread_attr_t attr;\n"
7679 " pthread_attr_t *attrp;\n"
7680 " char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7681 " struct sched_param param;\n"
7684 #: build/C/man3/pthread_setschedparam.3:314
7686 msgid " /* Process command-line options */\n"
7687 msgstr " /* Process command-line options */\n"
7690 #: build/C/man3/pthread_setschedparam.3:319
7693 " use_null_attrib = 0;\n"
7694 " attr_sched_str = NULL;\n"
7695 " main_sched_str = NULL;\n"
7696 " inheritsched_str = NULL;\n"
7698 " use_null_attrib = 0;\n"
7699 " attr_sched_str = NULL;\n"
7700 " main_sched_str = NULL;\n"
7701 " inheritsched_str = NULL;\n"
7704 #: build/C/man3/pthread_setschedparam.3:329
7707 " while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7709 " case \\(aqa\\(aq: attr_sched_str = optarg; break;\n"
7710 " case \\(aqA\\(aq: use_null_attrib = 1; break;\n"
7711 " case \\(aqi\\(aq: inheritsched_str = optarg; break;\n"
7712 " case \\(aqm\\(aq: main_sched_str = optarg; break;\n"
7713 " default: usage(argv[0], \"Unrecognized option\\en\");\n"
7717 " while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7719 " case \\(aqa\\(aq: attr_sched_str = optarg; break;\n"
7720 " case \\(aqA\\(aq: use_null_attrib = 1; break;\n"
7721 " case \\(aqi\\(aq: inheritsched_str = optarg; break;\n"
7722 " case \\(aqm\\(aq: main_sched_str = optarg; break;\n"
7723 " default: usage(argv[0], \"Unrecognized option\\en\");\n"
7728 #: build/C/man3/pthread_setschedparam.3:333
7731 " if (use_null_attrib &&\n"
7732 " (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7733 " usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7735 " if (use_null_attrib &&\n"
7736 " (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7737 " usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7740 #: build/C/man3/pthread_setschedparam.3:336
7743 " /* Optionally set scheduling attributes of main thread,\n"
7744 " and display the attributes */\n"
7746 " /* Optionally set scheduling attributes of main thread,\n"
7747 " and display the attributes */\n"
7750 #: build/C/man3/pthread_setschedparam.3:341
7753 " if (main_sched_str != NULL) {\n"
7754 " if (!get_policy(main_sched_str[0], &policy))\n"
7755 " usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
7756 " param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7758 " if (main_sched_str != NULL) {\n"
7759 " if (!get_policy(main_sched_str[0], &policy))\n"
7760 " usage(argv[0], \"Bad policy for main thread (-s)\\en\");\n"
7761 " param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7764 #: build/C/man3/pthread_setschedparam.3:346
7767 " s = pthread_setschedparam(pthread_self(), policy, ¶m);\n"
7769 " handle_error_en(s, \"pthread_setschedparam\");\n"
7772 " s = pthread_setschedparam(pthread_self(), policy, ¶m);\n"
7774 " handle_error_en(s, \"pthread_setschedparam\");\n"
7778 #: build/C/man3/pthread_setschedparam.3:349
7781 " display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7782 " printf(\"\\en\");\n"
7784 " display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7785 " printf(\"\\en\");\n"
7788 #: build/C/man3/pthread_setschedparam.3:351
7790 msgid " /* Initialize thread attributes object according to options */\n"
7791 msgstr " /* Initialize thread attributes object according to options */\n"
7794 #: build/C/man3/pthread_setschedparam.3:360
7797 " if (!use_null_attrib) {\n"
7798 " s = pthread_attr_init(&attr);\n"
7800 " handle_error_en(s, \"pthread_attr_init\");\n"
7804 " if (!use_null_attrib) {\n"
7805 " s = pthread_attr_init(&attr);\n"
7807 " handle_error_en(s, \"pthread_attr_init\");\n"
7812 #: build/C/man3/pthread_setschedparam.3:368
7815 " if (inheritsched_str != NULL) {\n"
7816 " if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7817 " inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7818 " else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7819 " inheritsched = PTHREAD_INHERIT_SCHED;\n"
7821 " usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7823 " if (inheritsched_str != NULL) {\n"
7824 " if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7825 " inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7826 " else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7827 " inheritsched = PTHREAD_INHERIT_SCHED;\n"
7829 " usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7832 #: build/C/man3/pthread_setschedparam.3:373
7835 " s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7837 " handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7840 " s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7842 " handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7846 #: build/C/man3/pthread_setschedparam.3:379
7849 " if (attr_sched_str != NULL) {\n"
7850 " if (!get_policy(attr_sched_str[0], &policy))\n"
7852 " \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7853 " param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7855 " if (attr_sched_str != NULL) {\n"
7856 " if (!get_policy(attr_sched_str[0], &policy))\n"
7858 " \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7859 " param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7862 #: build/C/man3/pthread_setschedparam.3:387
7865 " s = pthread_attr_setschedpolicy(&attr, policy);\n"
7867 " handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7868 " s = pthread_attr_setschedparam(&attr, ¶m);\n"
7870 " handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7873 " s = pthread_attr_setschedpolicy(&attr, policy);\n"
7875 " handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7876 " s = pthread_attr_setschedparam(&attr, ¶m);\n"
7878 " handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7882 #: build/C/man3/pthread_setschedparam.3:390
7885 " /* If we initialized a thread attributes object, display\n"
7886 " the scheduling attributes that were set in the object */\n"
7888 " /* If we initialized a thread attributes object, display\n"
7889 " the scheduling attributes that were set in the object */\n"
7892 #: build/C/man3/pthread_setschedparam.3:398
7895 " if (attrp != NULL) {\n"
7896 " s = pthread_attr_getschedparam(&attr, ¶m);\n"
7898 " handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7899 " s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7901 " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7903 " if (attrp != NULL) {\n"
7904 " s = pthread_attr_getschedparam(&attr, ¶m);\n"
7906 " handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7907 " s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7909 " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7912 #: build/C/man3/pthread_setschedparam.3:401
7915 " printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7916 " display_sched_attr(policy, ¶m);\n"
7918 " printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7919 " display_sched_attr(policy, ¶m);\n"
7922 #: build/C/man3/pthread_setschedparam.3:409
7925 " s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7926 " printf(\" inheritsched is %s\\en\",\n"
7927 " (inheritsched == PTHREAD_INHERIT_SCHED) ? \"INHERIT\" :\n"
7928 " (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7930 " printf(\"\\en\");\n"
7933 " s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7934 " printf(\" inheritsched is %s\\en\",\n"
7935 " (inheritsched == PTHREAD_INHERIT_SCHED) ? \"INHERIT\" :\n"
7936 " (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7938 " printf(\"\\en\");\n"
7942 #: build/C/man3/pthread_setschedparam.3:411
7944 msgid " /* Create a thread that will display its scheduling attributes */\n"
7945 msgstr " /* Create a thread that will display its scheduling attributes */\n"
7948 #: build/C/man3/pthread_setschedparam.3:415
7951 " s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7953 " handle_error_en(s, \"pthread_create\");\n"
7955 " s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7957 " handle_error_en(s, \"pthread_create\");\n"
7960 #: build/C/man3/pthread_setschedparam.3:417
7962 msgid " /* Destroy unneeded thread attributes object */\n"
7963 msgstr " /* Destroy unneeded thread attributes object */\n"
7966 #: build/C/man3/pthread_setschedparam.3:425
7969 " s = pthread_join(thread, NULL);\n"
7971 " handle_error_en(s, \"pthread_join\");\n"
7973 " s = pthread_join(thread, NULL);\n"
7975 " handle_error_en(s, \"pthread_join\");\n"
7978 #: build/C/man3/pthread_setschedparam.3:441
7980 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7981 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7982 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7983 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
7986 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
7987 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
7988 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
7989 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), "
7993 #: build/C/man3/pthread_setschedprio.3:24
7995 msgid "PTHREAD_SETSCHEDPRIO"
7996 msgstr "PTHREAD_SETSCHEDPRIO"
7999 #: build/C/man3/pthread_setschedprio.3:24
8005 #: build/C/man3/pthread_setschedprio.3:27
8006 msgid "pthread_setschedprio - set scheduling priority of a thread"
8010 #: build/C/man3/pthread_setschedprio.3:32
8012 msgid "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
8013 msgstr "B<pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
8015 #. FIXME . nptl/pthread_setschedprio.c has the following
8016 #. /* If the thread should have higher priority because of some
8017 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
8018 #. Eventually (perhaps after writing the mutexattr pages), we
8019 #. may want to add something on the topic to this page.
8020 #. nptl/pthread_setschedparam.c has a similar case.
8022 #: build/C/man3/pthread_setschedprio.3:51
8024 "The B<pthread_setschedprio>() function sets the scheduling priority of the "
8025 "thread I<thread> to the value specified in I<prio>. (By contrast "
8026 "B<pthread_setschedparam>(3) changes both the scheduling policy and priority "
8031 #: build/C/man3/pthread_setschedprio.3:59
8033 "On success, this function returns 0; on error, it returns a nonzero error "
8034 "number. If B<pthread_setschedprio>() fails, the scheduling priority of "
8035 "I<thread> is not changed."
8039 #: build/C/man3/pthread_setschedprio.3:64
8040 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
8044 #: build/C/man3/pthread_setschedprio.3:68
8046 "The caller does not have appropriate privileges to set the specified "
8051 #: build/C/man3/pthread_setschedprio.3:79
8053 "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the "
8054 "priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
8058 #: build/C/man3/pthread_setschedprio.3:81
8059 msgid "This function is available in glibc since version 2.3.4."
8060 msgstr "この関数は glibc バージョン 2.3.4 以降で利用できる。"
8063 #: build/C/man3/pthread_setschedprio.3:89
8065 "For a description of the permissions required to, and the effect of, "
8066 "changing a thread's scheduling priority, and details of the permitted ranges "
8067 "for priorities in each scheduling policy, see B<sched_setscheduler>(2)."
8071 #: build/C/man3/pthread_setschedprio.3:101
8073 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
8074 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
8075 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
8076 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
8079 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<sched_setscheduler>(2), "
8080 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
8081 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
8082 "B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), "
8086 #: build/C/man3/pthread_sigmask.3:24
8088 msgid "PTHREAD_SIGMASK"
8089 msgstr "PTHREAD_SIGMASK"
8092 #: build/C/man3/pthread_sigmask.3:24
8098 #: build/C/man3/pthread_sigmask.3:27
8099 msgid "pthread_sigmask - examine and change mask of blocked signals"
8103 #: build/C/man3/pthread_sigmask.3:33
8105 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
8106 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
8109 #: build/C/man3/pthread_sigmask.3:44
8111 "The B<pthread_sigmask>() function is just like B<sigprocmask>(2), with the "
8112 "difference that its use in multithreaded programs is explicitly specified by "
8113 "POSIX.1-2001. Other differences are noted in this page."
8117 #: build/C/man3/pthread_sigmask.3:47
8119 "For a description of the arguments and operation of this function, see "
8120 "B<sigprocmask>(2)."
8124 #: build/C/man3/pthread_sigmask.3:52
8126 "On success, B<pthread_sigmask>() returns 0; on error, it returns an error "
8131 #: build/C/man3/pthread_sigmask.3:55
8132 msgid "See B<sigprocmask>(2)."
8136 #: build/C/man3/pthread_sigmask.3:59
8137 msgid "A new thread inherits a copy of its creator's signal mask."
8141 #: build/C/man3/pthread_sigmask.3:64
8143 "The program below blocks some signals in the main thread, and then creates a "
8144 "dedicated thread to fetch those signals via B<sigwait>(3). The following "
8145 "shell session demonstrates its use:"
8149 #: build/C/man3/pthread_sigmask.3:75
8154 "$B< kill -QUIT %1>\n"
8155 "Signal handling thread got signal 3\n"
8156 "$B< kill -USR1 %1>\n"
8157 "Signal handling thread got signal 10\n"
8158 "$B< kill -TERM %1>\n"
8159 "[1]+ Terminated ./a.out\n"
8163 "$B< kill -QUIT %1>\n"
8164 "Signal handling thread got signal 3\n"
8165 "$B< kill -USR1 %1>\n"
8166 "Signal handling thread got signal 10\n"
8167 "$B< kill -TERM %1>\n"
8168 "[1]+ Terminated ./a.out\n"
8171 #: build/C/man3/pthread_sigmask.3:86
8174 "#include E<lt>pthread.hE<gt>\n"
8175 "#include E<lt>stdio.hE<gt>\n"
8176 "#include E<lt>stdlib.hE<gt>\n"
8177 "#include E<lt>unistd.hE<gt>\n"
8178 "#include E<lt>signal.hE<gt>\n"
8179 "#include E<lt>errno.hE<gt>\n"
8181 "#include E<lt>pthread.hE<gt>\n"
8182 "#include E<lt>stdio.hE<gt>\n"
8183 "#include E<lt>stdlib.hE<gt>\n"
8184 "#include E<lt>unistd.hE<gt>\n"
8185 "#include E<lt>signal.hE<gt>\n"
8186 "#include E<lt>errno.hE<gt>\n"
8189 #: build/C/man3/pthread_sigmask.3:88
8191 msgid "/* Simple error handling functions */\n"
8192 msgstr "/* Simple error handling functions */\n"
8195 #: build/C/man3/pthread_sigmask.3:97
8199 "sig_thread(void *arg)\n"
8201 " sigset_t *set = (sigset_t *) arg;\n"
8205 "sig_thread(void *arg)\n"
8207 " sigset_t *set = (sigset_t *) arg;\n"
8211 #: build/C/man3/pthread_sigmask.3:105
8215 " s = sigwait(set, &sig);\n"
8217 " handle_error_en(s, \"sigwait\");\n"
8218 " printf(\"Signal handling thread got signal %d\\en\", sig);\n"
8223 " s = sigwait(set, &sig);\n"
8225 " handle_error_en(s, \"sigwait\");\n"
8226 " printf(\"Signal handling thread got signal %d\\en\", sig);\n"
8231 #: build/C/man3/pthread_sigmask.3:112
8235 "main(int argc, char *argv[])\n"
8237 " pthread_t thread;\n"
8242 "main(int argc, char *argv[])\n"
8244 " pthread_t thread;\n"
8249 #: build/C/man3/pthread_sigmask.3:115
8252 " /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
8253 " will inherit a copy of the signal mask. */\n"
8255 " /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
8256 " will inherit a copy of the signal mask. */\n"
8259 #: build/C/man3/pthread_sigmask.3:122
8262 " sigemptyset(&set);\n"
8263 " sigaddset(&set, SIGQUIT);\n"
8264 " sigaddset(&set, SIGUSR1);\n"
8265 " s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
8267 " handle_error_en(s, \"pthread_sigmask\");\n"
8269 " sigemptyset(&set);\n"
8270 " sigaddset(&set, SIGQUIT);\n"
8271 " sigaddset(&set, SIGUSR1);\n"
8272 " s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
8274 " handle_error_en(s, \"pthread_sigmask\");\n"
8277 #: build/C/man3/pthread_sigmask.3:126
8280 " s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
8282 " handle_error_en(s, \"pthread_create\");\n"
8284 " s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
8286 " handle_error_en(s, \"pthread_create\");\n"
8289 #: build/C/man3/pthread_sigmask.3:129
8292 " /* Main thread carries on to create other threads and/or do\n"
8295 " /* Main thread carries on to create other threads and/or do\n"
8299 #: build/C/man3/pthread_sigmask.3:132
8302 " pause(); /* Dummy pause so we can test program */\n"
8305 " pause(); /* Dummy pause so we can test program */\n"
8309 #: build/C/man3/pthread_sigmask.3:142
8311 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2) B<pthread_create>(3), "
8312 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
8314 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2) B<pthread_create>(3), "
8315 "B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
8318 #: build/C/man3/pthread_sigqueue.3:23
8320 msgid "PTHREAD_SIGQUEUE"
8321 msgstr "PTHREAD_SIGQUEUE"
8324 #: build/C/man3/pthread_sigqueue.3:23
8330 #: build/C/man3/pthread_sigqueue.3:26
8331 msgid "pthread_sigqueue - queue a signal and data to a thread"
8335 #: build/C/man3/pthread_sigqueue.3:32
8338 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
8339 "B< const union sigval >I<value>B<);>\n"
8341 "B<int pthread_sigqueue(pthread_t *>I<thread>B<, int >I<sig>B<,>\n"
8342 "B< const union sigval >I<value>B<);>\n"
8345 #: build/C/man3/pthread_sigqueue.3:43
8346 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
8347 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
8350 #: build/C/man3/pthread_sigqueue.3:51
8352 "The B<pthread_sigqueue>() function performs a similar task to B<sigqueue>"
8353 "(3), but, rather than sending a signal to another process, it sends a signal "
8354 "to another thread in the same process as the calling thread."
8358 #: build/C/man3/pthread_sigqueue.3:63
8360 "The I<thread> argument is the ID of another thread in the same process as "
8361 "the caller. The I<sig> argument specifies the signal to be sent. The "
8362 "I<value> argument specifies data to accompany the signal; see B<sigqueue>"
8367 #: build/C/man3/pthread_sigqueue.3:68
8369 "On success, B<pthread_sigqueue>() returns 0; on error, it returns an error "
8374 #: build/C/man3/pthread_sigqueue.3:75
8376 "The limit of signals which may be queued has been reached. (See B<signal>"
8377 "(7) for further information.)"
8381 #: build/C/man3/pthread_sigqueue.3:79
8382 msgid "I<sig> was invalid."
8386 #: build/C/man3/pthread_sigqueue.3:79
8392 #: build/C/man3/pthread_sigqueue.3:83
8393 msgid "B<pthread_sigqueue>() is not supported on this system."
8397 #: build/C/man3/pthread_sigqueue.3:87
8398 msgid "I<thread> is not valid."
8402 #: build/C/man3/pthread_sigqueue.3:91
8403 msgid "The B<pthread_sigqueue>() function first appeared in glibc 2.11."
8407 #: build/C/man3/pthread_sigqueue.3:93
8408 msgid "This function is a GNU extension."
8409 msgstr "この関数は GNU による拡張である。"
8412 #: build/C/man3/pthread_sigqueue.3:101
8414 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), B<sigqueue>"
8415 "(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
8417 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
8418 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
8421 #: build/C/man3/pthread_testcancel.3:24
8423 msgid "PTHREAD_TESTCANCEL"
8424 msgstr "PTHREAD_TESTCANCEL"
8427 #: build/C/man3/pthread_testcancel.3:24
8433 #: build/C/man3/pthread_testcancel.3:27
8435 "pthread_testcancel - request delivery of any pending cancellation request"
8439 #: build/C/man3/pthread_testcancel.3:32
8441 msgid "B<void pthread_testcancel(void);>\n"
8442 msgstr "B<void pthread_testcancel(void);>\n"
8445 #: build/C/man3/pthread_testcancel.3:41
8447 "Calling B<pthread_testcancel>() creates a cancellation point within the "
8448 "calling thread, so that a thread that is otherwise executing code that "
8449 "contains no cancellation points will respond to a cancellation request."
8453 #: build/C/man3/pthread_testcancel.3:48
8455 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
8456 "cancellation request is pending, then a call to B<pthread_testcancel>(3) "
8461 #: build/C/man3/pthread_testcancel.3:52
8463 "This function does not return a value. If the calling thread is canceled as "
8464 "a consequence of a call to this function, then the function does not return."
8468 #: build/C/man3/pthread_testcancel.3:61
8469 msgid "See B<pthread_cleanup_push>(3)."
8473 #: build/C/man3/pthread_testcancel.3:66
8475 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
8476 "(3), B<pthreads>(7)"
8478 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>"
8479 "(3), B<pthreads>(7)"
8482 #: build/C/man3/pthread_tryjoin_np.3:24
8484 msgid "PTHREAD_TRYJOIN_NP"
8485 msgstr "PTHREAD_TRYJOIN_NP"
8488 #: build/C/man3/pthread_tryjoin_np.3:28
8490 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
8495 #: build/C/man3/pthread_tryjoin_np.3:34
8497 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
8498 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
8501 #: build/C/man3/pthread_tryjoin_np.3:37
8504 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
8505 "B< const struct timespec *>I<abstime>B<);>\n"
8507 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
8508 "B< const struct timespec *>I<abstime>B<);>\n"
8511 #: build/C/man3/pthread_tryjoin_np.3:44
8513 "These functions operate in the same way as B<pthread_join>(3), except for "
8514 "the differences described on this page."
8518 #: build/C/man3/pthread_tryjoin_np.3:56
8520 "The B<pthread_tryjoin_np>() function performs a nonblocking join with the "
8521 "thread I<thread>, returning the exit status of the thread in I<*retval>. If "
8522 "I<thread> has not yet terminated, then instead of blocking, as is done by "
8523 "B<pthread_join>(3), the call returns an error."
8527 #: build/C/man3/pthread_tryjoin_np.3:74
8529 "The B<pthread_timedjoin_np>() function performs a join-with-timeout. If "
8530 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
8531 "specified in I<abstime>. If the timeout expires before I<thread> "
8532 "terminates, the call returns an error. The I<abstime> argument is a "
8533 "structure of the following form, specifying an absolute time measured since "
8534 "the Epoch (see B<time>(2)):"
8538 #: build/C/man3/pthread_tryjoin_np.3:81
8541 "struct timespec {\n"
8542 " time_t tv_sec; /* seconds */\n"
8543 " long tv_nsec; /* nanoseconds */\n"
8546 "struct timespec {\n"
8547 " time_t tv_sec; /* seconds */\n"
8548 " long tv_nsec; /* nanoseconds */\n"
8552 #: build/C/man3/pthread_tryjoin_np.3:87
8554 "On success, these functions return 0; on error, they return an error number."
8558 #: build/C/man3/pthread_tryjoin_np.3:92
8560 "These functions can fail with the same errors as B<pthread_join>(3). "
8561 "B<pthread_tryjoin_np>() can in addition fail with the following error:"
8563 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
8564 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
8567 #: build/C/man3/pthread_tryjoin_np.3:92
8573 #: build/C/man3/pthread_tryjoin_np.3:96
8574 msgid "I<thread> had not yet terminated at the time of the call."
8578 #: build/C/man3/pthread_tryjoin_np.3:99
8580 "B<pthread_timedjoin_np>() can in addition fail with the following error:"
8581 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
8584 #: build/C/man3/pthread_tryjoin_np.3:99
8586 msgid "B<ETIMEDOUT>"
8587 msgstr "B<ETIMEDOUT>"
8590 #: build/C/man3/pthread_tryjoin_np.3:104
8591 msgid "The call timed out before I<thread> terminated."
8595 #: build/C/man3/pthread_tryjoin_np.3:108
8596 msgid "B<pthread_timedjoin_np>() never returns the error B<EINTR>."
8600 #: build/C/man3/pthread_tryjoin_np.3:110
8601 msgid "These functions first appeared in glibc in version 2.3.3."
8605 #: build/C/man3/pthread_tryjoin_np.3:115
8606 msgid "The following code waits to join for up to 5 seconds:"
8610 #: build/C/man3/pthread_tryjoin_np.3:119
8613 " struct timespec ts;\n"
8616 " struct timespec ts;\n"
8620 #: build/C/man3/pthread_tryjoin_np.3:121
8626 #: build/C/man3/pthread_tryjoin_np.3:125
8629 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8630 "\t/* Handle error */\n"
8633 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8634 "\t/* Handle error */\n"
8638 #: build/C/man3/pthread_tryjoin_np.3:127
8640 msgid " ts.tv_sec += 5;\n"
8641 msgstr " ts.tv_sec += 5;\n"
8644 #: build/C/man3/pthread_tryjoin_np.3:132
8647 " s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8649 " /* Handle error */\n"
8652 " s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8654 " /* Handle error */\n"
8658 #: build/C/man3/pthread_tryjoin_np.3:138
8660 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8662 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8665 #: build/C/man3/pthread_yield.3:23
8667 msgid "PTHREAD_YIELD"
8668 msgstr "PTHREAD_YIELD"
8671 #: build/C/man3/pthread_yield.3:26
8672 msgid "pthread_yield - yield the processor"
8676 #: build/C/man3/pthread_yield.3:31
8678 msgid "B<int pthread_yield(void);>\n"
8679 msgstr "B<int pthread_yield(void);>\n"
8682 #: build/C/man3/pthread_yield.3:41
8684 "B<pthread_yield>() causes the calling thread to relinquish the CPU. The "
8685 "thread is placed at the end of the run queue for its static priority and "
8686 "another thread is scheduled to run. For further details, see B<sched_yield>"
8691 #: build/C/man3/pthread_yield.3:46
8693 "On success, B<pthread_yield>() returns 0; on error, it returns an error "
8698 #: build/C/man3/pthread_yield.3:50
8700 "On Linux, this call always succeeds (but portable and future-proof "
8701 "applications should nevertheless handle a possible error return)."
8704 #. e.g., the BSDs, Tru64, AIX, and Irix.
8706 #: build/C/man3/pthread_yield.3:56
8708 "This call is nonstandard, but present on several other systems. Use the "
8709 "standardized B<sched_yield>(2) instead."
8713 #: build/C/man3/pthread_yield.3:59
8714 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
8718 #: build/C/man3/pthread_yield.3:63
8719 msgid "B<sched_setscheduler>(2), B<sched_yield>(2) B<pthreads>(7)"
8720 msgstr "B<sched_setscheduler>(2), B<sched_yield>(2) B<pthreads>(7)"
8723 #: build/C/man7/pthreads.7:24
8729 #: build/C/man7/pthreads.7:24
8735 #: build/C/man7/pthreads.7:27
8736 msgid "pthreads - POSIX threads"
8737 msgstr "pthreads - POSIX スレッド"
8740 #: build/C/man7/pthreads.7:34
8742 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
8743 "programming commonly known as POSIX threads, or Pthreads. A single process "
8744 "can contain multiple threads, all of which are executing the same program. "
8745 "These threads share the same global memory (data and heap segments), but "
8746 "each thread has its own stack (automatic variables)."
8748 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッド・プログ"
8749 "ラミングのインタフェース群 (関数、ヘッダファイル) を規定している。一つのプロ"
8750 "セスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行す"
8751 "る。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各"
8752 "スレッドは自分専用のスタック (自動変数) を持つ。"
8755 #: build/C/man7/pthreads.7:37
8757 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
8758 "these attributes are process-wide rather than per-thread):"
8760 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
8761 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
8764 #: build/C/man7/pthreads.7:37 build/C/man7/pthreads.7:39
8765 #: build/C/man7/pthreads.7:41 build/C/man7/pthreads.7:43
8766 #: build/C/man7/pthreads.7:45 build/C/man7/pthreads.7:47
8767 #: build/C/man7/pthreads.7:49 build/C/man7/pthreads.7:52
8768 #: build/C/man7/pthreads.7:54 build/C/man7/pthreads.7:57
8769 #: build/C/man7/pthreads.7:63 build/C/man7/pthreads.7:68
8770 #: build/C/man7/pthreads.7:71 build/C/man7/pthreads.7:74
8771 #: build/C/man7/pthreads.7:82 build/C/man7/pthreads.7:86
8772 #: build/C/man7/pthreads.7:89 build/C/man7/pthreads.7:93
8773 #: build/C/man7/pthreads.7:96 build/C/man7/pthreads.7:103
8774 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
8775 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
8776 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
8777 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
8778 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
8779 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
8780 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
8781 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
8782 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
8783 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
8784 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
8785 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
8786 #: build/C/man7/pthreads.7:833
8792 #: build/C/man7/pthreads.7:39
8797 #: build/C/man7/pthreads.7:41
8798 msgid "parent process ID"
8802 #: build/C/man7/pthreads.7:43
8803 msgid "process group ID and session ID"
8804 msgstr "プロセスグループ ID とセッション ID"
8807 #: build/C/man7/pthreads.7:45
8808 msgid "controlling terminal"
8812 #: build/C/man7/pthreads.7:47
8813 msgid "user and group IDs"
8814 msgstr "ユーザ ID とグループ ID"
8817 #: build/C/man7/pthreads.7:49
8818 msgid "open file descriptors"
8819 msgstr "オープンするファイルディスクリプタ"
8822 #: build/C/man7/pthreads.7:52
8823 msgid "record locks (see B<fcntl>(2))"
8824 msgstr "レコードのロック (B<fcntl>(3) 参照)"
8827 #: build/C/man7/pthreads.7:54
8828 msgid "signal dispositions"
8832 #: build/C/man7/pthreads.7:57
8833 msgid "file mode creation mask (B<umask>(2))"
8834 msgstr "ファイルモード作成マスク (B<umask>(2))"
8837 #: build/C/man7/pthreads.7:63
8838 msgid "current directory (B<chdir>(2)) and root directory (B<chroot>(2))"
8840 "カレント・ディレクトリ (B<chdir>(2)) とルート・ディレクトリ (B<chroot>(2))"
8843 #: build/C/man7/pthreads.7:68
8845 "interval timers (B<setitimer>(2)) and POSIX timers (B<timer_create>(2))"
8847 "インターバル・タイマ (B<setitimer>(2)) と POSIX タイマ (B<timer_create>(2))"
8850 #: build/C/man7/pthreads.7:71
8851 msgid "nice value (B<setpriority>(2))"
8852 msgstr "nice 値 (B<setpriority>(2))"
8855 #: build/C/man7/pthreads.7:74
8856 msgid "resource limits (B<setrlimit>(2))"
8857 msgstr "リソース制限 (B<setrlimit>(2))"
8860 #: build/C/man7/pthreads.7:79
8862 "measurements of the consumption of CPU time (B<times>(2)) and resources "
8864 msgstr "CPU 時間 (B<times>(2)) とリソース (B<getrusage>(2)) の消費状況の計測"
8867 #: build/C/man7/pthreads.7:82
8869 "As well as the stack, POSIX.1 specifies that various other attributes are "
8870 "distinct for each thread, including:"
8872 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
8876 #: build/C/man7/pthreads.7:86
8877 msgid "thread ID (the I<pthread_t> data type)"
8878 msgstr "スレッド ID (B<pthread_t> データ型)"
8881 #: build/C/man7/pthreads.7:89
8882 msgid "signal mask (B<pthread_sigmask>(3))"
8883 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
8886 #: build/C/man7/pthreads.7:93
8887 msgid "the I<errno> variable"
8888 msgstr "I<errno> 変数"
8891 #: build/C/man7/pthreads.7:96
8892 msgid "alternate signal stack (B<sigaltstack>(2))"
8893 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
8896 #: build/C/man7/pthreads.7:101
8898 "real-time scheduling policy and priority (B<sched_setscheduler>(2) and "
8899 "B<sched_setparam>(2))"
8901 "リアルタイム・スケジューリングのポリシーと優先度 (B<sched_setscheduler>(2) "
8902 "と B<sched_setparam>(2))"
8905 #: build/C/man7/pthreads.7:103
8906 msgid "The following Linux-specific features are also per-thread:"
8907 msgstr "以下の Linux 特有の機能もスレッド単位である:"
8910 #: build/C/man7/pthreads.7:106
8911 msgid "capabilities (see B<capabilities>(7))"
8912 msgstr "ケーパビリティ (B<capabilities>(7) 参照)"
8915 #: build/C/man7/pthreads.7:109
8916 msgid "CPU affinity (B<sched_setaffinity>(2))"
8917 msgstr "CPU affinity (親和度) (B<sched_setaffinity>(2))"
8920 #: build/C/man7/pthreads.7:109
8922 msgid "Pthreads function return values"
8923 msgstr "pthreads 関数の返り値"
8926 #: build/C/man7/pthreads.7:116
8928 "Most pthreads functions return 0 on success, and an error number of "
8929 "failure. Note that the pthreads functions do not set I<errno>. For each of "
8930 "the pthreads functions that can return an error, POSIX.1-2001 specifies that "
8931 "the function can never fail with the error B<EINTR>."
8933 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
8934 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
8935 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
8939 #: build/C/man7/pthreads.7:116
8945 #: build/C/man7/pthreads.7:130
8947 "Each of the threads in a process has a unique thread identifier (stored in "
8948 "the type I<pthread_t>). This identifier is returned to the caller of "
8949 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
8950 "using B<pthread_self>(3). Thread IDs are only guaranteed to be unique "
8951 "within a process. A thread ID may be reused after a terminated thread has "
8952 "been joined, or a detached thread has terminated. In all pthreads functions "
8953 "that accept a thread ID as an argument, that ID by definition refers to a "
8954 "thread in the same process as the caller."
8956 "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持"
8957 "つ。 この識別子は、 B<pthread_create>(3) の呼び出し元に返される。また、ス"
8958 "レッドは自身のスレッド識別子を B<pthread_self>(3) を使って取得できる。 ス"
8959 "レッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了"
8960 "したスレッドが join された後では、スレッド ID は再利用される可能性がある。 ス"
8961 "レッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同"
8962 "じプロセス内の一つのスレッドを参照する。"
8965 #: build/C/man7/pthreads.7:130
8967 msgid "Thread-safe functions"
8971 #: build/C/man7/pthreads.7:134
8973 "A thread-safe function is one that can be safely (i.e., it will deliver the "
8974 "same results regardless of whether it is) called from multiple threads at "
8977 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
8978 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
8981 #: build/C/man7/pthreads.7:138
8983 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
8984 "standard shall be thread-safe, except for the following functions:"
8986 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
8987 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
8990 #: build/C/man7/pthreads.7:232
8997 "ctermid() if passed a non-NULL argument\n"
9011 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9016 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9018 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9020 "getchar_unlocked()\n"
9026 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9027 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9034 "getprotobyname()\n"
9035 "getprotobynumber()\n"
9063 "putchar_unlocked()\n"
9074 "strsignal() [Added in POSIX.1-2008]\n"
9076 "system() [Added in POSIX.1-2008]\n"
9077 "tmpnam() if passed a non-NULL argument\n"
9080 "wcrtomb() if its final argument is NULL\n"
9081 "wcsrtombs() if its final argument is NULL\n"
9089 "ctermid() (NULL でない引き数を渡された場合)\n"
9103 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9108 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9110 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9112 "getchar_unlocked()\n"
9118 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9119 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9126 "getprotobyname()\n"
9127 "getprotobynumber()\n"
9155 "putchar_unlocked()\n"
9166 "strsignal() [POSIX.1-2008 で追加された]\n"
9168 "system() [POSIX.1-2008 で追加された]\n"
9169 "tmpnam() (NULL でない引き数を渡された場合)\n"
9172 "wcrtomb() (最後の引き数が NULL の場合)\n"
9173 "wcsrtombs() (最後の引き数が NULL の場合)\n"
9178 #: build/C/man7/pthreads.7:234
9180 msgid "Async-cancel-safe functions"
9181 msgstr "async-cancel-safe 関数"
9184 #: build/C/man7/pthreads.7:238
9186 "An async-cancel-safe function is one that can be safely called in an "
9187 "application where asynchronous cancelability is enabled (see "
9188 "B<pthread_setcancelstate>(3))."
9190 "async-cancel-safe 関数は、\n"
9191 "非同期キャンセル機能が有効になっているアプリケーションで\n"
9192 "安全に呼び出すことができる関数のことである\n"
9193 "(B<pthread_setcancelstate>(3) を参照)。"
9196 #: build/C/man7/pthreads.7:241
9198 "Only the following functions are required to be async-cancel-safe by "
9199 "POSIX.1-2001 and POSIX.1-2008:"
9201 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
9205 #: build/C/man7/pthreads.7:247
9208 "pthread_cancel()\n"
9209 "pthread_setcancelstate()\n"
9210 "pthread_setcanceltype()\n"
9212 "pthread_cancel()\n"
9213 "pthread_setcancelstate()\n"
9214 "pthread_setcanceltype()\n"
9217 #: build/C/man7/pthreads.7:249
9219 msgid "Cancellation Points"
9220 msgstr "取り消しポイント (cancellation points)"
9223 #: build/C/man7/pthreads.7:256
9225 "POSIX.1 specifies that certain functions must, and certain other functions "
9226 "may, be cancellation points. If a thread is cancelable, its cancelability "
9227 "type is deferred, and a cancellation request is pending for the thread, then "
9228 "the thread is canceled when it calls a function that is a cancellation point."
9230 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
9231 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
9232 "で、その取り消し種別 (cancelability type) が延期 (deferred) で、そのスレッド"
9233 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
9234 "時点で、そのスレッドのキャンセルが 行われる。"
9237 #: build/C/man7/pthreads.7:259
9239 "The following functions are required to be cancellation points by "
9240 "POSIX.1-2001 and/or POSIX.1-2008:"
9242 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
9243 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
9246 #: build/C/man7/pthreads.7:322
9251 "clock_nanosleep()\n"
9255 "fcntl() F_SETLKW\n"
9263 "mq_timedreceive()\n"
9270 "openat() [Added in POSIX.1-2008]\n"
9275 "pthread_cond_timedwait()\n"
9276 "pthread_cond_wait()\n"
9278 "pthread_testcancel()\n"
9293 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
9301 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9310 "clock_nanosleep()\n"
9314 "fcntl() F_SETLKW\n"
9322 "mq_timedreceive()\n"
9329 "openat() [POSIX.1-2008 で追加された]\n"
9334 "pthread_cond_timedwait()\n"
9335 "pthread_cond_wait()\n"
9337 "pthread_testcancel()\n"
9352 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
9360 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9368 #: build/C/man7/pthreads.7:327
9370 "The following functions may be cancellation points according to POSIX.1-2001 "
9371 "and/or POSIX.1-2008:"
9373 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
9374 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
9377 #: build/C/man7/pthreads.7:555
9386 "chmod() [Added in POSIX.1-2008]\n"
9387 "chown() [Added in POSIX.1-2008]\n"
9401 "dprintf() [Added in POSIX.1-2008]\n"
9409 "faccessat() [Added in POSIX.1-2008]\n"
9410 "fchmod() [Added in POSIX.1-2008]\n"
9411 "fchmodat() [Added in POSIX.1-2008]\n"
9412 "fchown() [Added in POSIX.1-2008]\n"
9413 "fchownat() [Added in POSIX.1-2008]\n"
9415 "fcntl() (for any value of cmd argument)\n"
9437 "fstatat() [Added in POSIX.1-2008]\n"
9441 "futimens() [Added in POSIX.1-2008]\n"
9449 "getchar_unlocked()\n"
9452 "getdelim() [Added in POSIX.1-2008]\n"
9458 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
9459 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
9463 "getline() [Added in POSIX.1-2008]\n"
9470 "getopt() (if opterr is nonzero)\n"
9471 "getprotobyname()\n"
9472 "getprotobynumber()\n"
9488 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
9494 "linkat() [Added in POSIX.1-2008]\n"
9495 "lio_listio() [Added in POSIX.1-2008]\n"
9498 "lockf() [Added in POSIX.1-2008]\n"
9501 "mkdir() [Added in POSIX.1-2008]\n"
9502 "mkdirat() [Added in POSIX.1-2008]\n"
9503 "mkdtemp() [Added in POSIX.1-2008]\n"
9504 "mkfifo() [Added in POSIX.1-2008]\n"
9505 "mkfifoat() [Added in POSIX.1-2008]\n"
9506 "mknod() [Added in POSIX.1-2008]\n"
9507 "mknodat() [Added in POSIX.1-2008]\n"
9518 "posix_fallocate()\n"
9523 "posix_trace_clear()\n"
9524 "posix_trace_close()\n"
9525 "posix_trace_create()\n"
9526 "posix_trace_create_withlog()\n"
9527 "posix_trace_eventtypelist_getnext_id()\n"
9528 "posix_trace_eventtypelist_rewind()\n"
9529 "posix_trace_flush()\n"
9530 "posix_trace_get_attr()\n"
9531 "posix_trace_get_filter()\n"
9532 "posix_trace_get_status()\n"
9533 "posix_trace_getnext_event()\n"
9534 "posix_trace_open()\n"
9535 "posix_trace_rewind()\n"
9536 "posix_trace_set_filter()\n"
9537 "posix_trace_shutdown()\n"
9538 "posix_trace_timedgetnext_event()\n"
9539 "posix_typed_mem_open()\n"
9541 "psiginfo() [Added in POSIX.1-2008]\n"
9542 "psignal() [Added in POSIX.1-2008]\n"
9543 "pthread_rwlock_rdlock()\n"
9544 "pthread_rwlock_timedrdlock()\n"
9545 "pthread_rwlock_timedwrlock()\n"
9546 "pthread_rwlock_wrlock()\n"
9550 "putchar_unlocked()\n"
9557 "readlink() [Added in POSIX.1-2008]\n"
9558 "readlinkat() [Added in POSIX.1-2008]\n"
9561 "renameat() [Added in POSIX.1-2008]\n"
9564 "scandir() [Added in POSIX.1-2008]\n"
9575 "sigpause() [Added in POSIX.1-2008]\n"
9581 "symlinkat() [Added in POSIX.1-2008]\n"
9592 "unlinkat() [Added in POSIX.1-2008]\n"
9593 "utime() [Added in POSIX.1-2008]\n"
9594 "utimensat() [Added in POSIX.1-2008]\n"
9595 "utimes() [Added in POSIX.1-2008]\n"
9596 "vdprintf() [Added in POSIX.1-2008]\n"
9612 "chmod() [POSIX.1-2008 で追加された]\n"
9613 "chown() [POSIX.1-2008 で追加された]\n"
9627 "dprintf() [POSIX.1-2008 で追加された]\n"
9635 "faccessat() [POSIX.1-2008 で追加された]\n"
9636 "fchmod() [POSIX.1-2008 で追加された]\n"
9637 "fchmodat() [POSIX.1-2008 で追加された]\n"
9638 "fchown() [POSIX.1-2008 で追加された]\n"
9639 "fchownat() [POSIX.1-2008 で追加された]\n"
9641 "fcntl() (cmd 引き数が何であっても)\n"
9663 "fstatat() [POSIX.1-2008 で追加された]\n"
9667 "futimens() [POSIX.1-2008 で追加された]\n"
9675 "getchar_unlocked()\n"
9678 "getdelim() [POSIX.1-2008 で追加された]\n"
9684 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9685 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9689 "getline() [POSIX.1-2008 で追加された]\n"
9696 "getopt() (opterr が 0 以外の場合)\n"
9697 "getprotobyname()\n"
9698 "getprotobynumber()\n"
9714 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9720 "linkat() [POSIX.1-2008 で追加された]\n"
9721 "lio_listio() [POSIX.1-2008 で追加された]\n"
9724 "lockf() [POSIX.1-2008 で追加された]\n"
9727 "mkdir() [POSIX.1-2008 で追加された]\n"
9728 "mkdirat() [POSIX.1-2008 で追加された]\n"
9729 "mkdtemp() [POSIX.1-2008 で追加された]\n"
9730 "mkfifo() [POSIX.1-2008 で追加された]\n"
9731 "mkfifoat() [POSIX.1-2008 で追加された]\n"
9732 "mknod() [POSIX.1-2008 で追加された]\n"
9733 "mknodat() [POSIX.1-2008 で追加された]\n"
9744 "posix_fallocate()\n"
9749 "posix_trace_clear()\n"
9750 "posix_trace_close()\n"
9751 "posix_trace_create()\n"
9752 "posix_trace_create_withlog()\n"
9753 "posix_trace_eventtypelist_getnext_id()\n"
9754 "posix_trace_eventtypelist_rewind()\n"
9755 "posix_trace_flush()\n"
9756 "posix_trace_get_attr()\n"
9757 "posix_trace_get_filter()\n"
9758 "posix_trace_get_status()\n"
9759 "posix_trace_getnext_event()\n"
9760 "posix_trace_open()\n"
9761 "posix_trace_rewind()\n"
9762 "posix_trace_set_filter()\n"
9763 "posix_trace_shutdown()\n"
9764 "posix_trace_timedgetnext_event()\n"
9765 "posix_typed_mem_open()\n"
9767 "psiginfo() [POSIX.1-2008 で追加された]\n"
9768 "psignal() [POSIX.1-2008 で追加された]\n"
9769 "pthread_rwlock_rdlock()\n"
9770 "pthread_rwlock_timedrdlock()\n"
9771 "pthread_rwlock_timedwrlock()\n"
9772 "pthread_rwlock_wrlock()\n"
9776 "putchar_unlocked()\n"
9783 "readlink() [POSIX.1-2008 で追加された]\n"
9784 "readlinkat() [POSIX.1-2008 で追加された]\n"
9787 "renameat() [POSIX.1-2008 で追加された]\n"
9790 "scandir() [POSIX.1-2008 で追加された]\n"
9801 "sigpause() [POSIX.1-2008 で追加された]\n"
9807 "symlinkat() [POSIX.1-2008 で追加された]\n"
9818 "unlinkat() [POSIX.1-2008 で追加された]\n"
9819 "utime() [POSIX.1-2008 で追加された]\n"
9820 "utimensat() [POSIX.1-2008 で追加された]\n"
9821 "utimes() [POSIX.1-2008 で追加された]\n"
9822 "vdprintf() [POSIX.1-2008 で追加された]\n"
9832 #. So, scanning "cancellation point" comments in the glibc 2.8 header
9833 #. files, it looks as though at least the following nonstandard
9834 #. functions are cancellation points:
9874 #. getprotobynumber_r
9889 #. getwchar_unlocked
9896 #. pthread_timedjoin_np
9902 #. putwchar_unlocked
9923 #: build/C/man7/pthreads.7:653
9925 "An implementation may also mark other functions not specified in the "
9926 "standard as cancellation points. In particular, an implementation is likely "
9927 "to mark any nonstandard function that may block as a cancellation point. "
9928 "(This includes most functions that can touch files.)"
9930 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
9931 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
9932 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
9936 #: build/C/man7/pthreads.7:653
9938 msgid "Compiling on Linux"
9939 msgstr "Linux でのコンパイル"
9942 #: build/C/man7/pthreads.7:656
9944 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
9947 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
9951 #: build/C/man7/pthreads.7:656
9953 msgid "Linux Implementations of POSIX Threads"
9954 msgstr "POSIX スレッドの Linux での実装"
9957 #: build/C/man7/pthreads.7:659
9959 "Over time, two threading implementations have been provided by the GNU C "
9962 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
9966 #: build/C/man7/pthreads.7:659
9968 msgid "B<LinuxThreads>"
9969 msgstr "B<LinuxThreads>"
9972 #: build/C/man7/pthreads.7:663
9974 "This is the original Pthreads implementation. Since glibc 2.4, this "
9975 "implementation is no longer supported."
9977 "最初の Pthreads の実装。\n"
9978 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
9981 #: build/C/man7/pthreads.7:663
9983 msgid "B<NPTL> (Native POSIX Threads Library)"
9984 msgstr "B<NPTL> (Native POSIX Threads Library)"
9987 #: build/C/man7/pthreads.7:671
9989 "This is the modern Pthreads implementation. By comparison with "
9990 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
9991 "POSIX.1 specification and better performance when creating large numbers of "
9992 "threads. NPTL is available since glibc 2.3.2, and requires features that "
9993 "are present in the Linux 2.6 kernel."
9995 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
9996 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
9997 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
10000 #. type: Plain text
10001 #: build/C/man7/pthreads.7:681
10003 "Both of these are so-called 1:1 implementations, meaning that each thread "
10004 "maps to a kernel scheduling entity. Both threading implementations employ "
10005 "the Linux B<clone>(2) system call. In NPTL, thread synchronization "
10006 "primitives (mutexes, thread joining, etc.) are implemented using the Linux "
10007 "B<futex>(2) system call."
10009 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
10010 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
10011 "B<clone>(2) システムコールを利用している。 NPTL では、スレッド同期の基本機"
10012 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2) システムコールを"
10016 #: build/C/man7/pthreads.7:681
10018 msgid "LinuxThreads"
10019 msgstr "LinuxThreads"
10021 #. type: Plain text
10022 #: build/C/man7/pthreads.7:683
10023 msgid "The notable features of this implementation are the following:"
10024 msgstr "この実装の大きな特徴は以下の通りである:"
10026 #. type: Plain text
10027 #: build/C/man7/pthreads.7:690
10029 "In addition to the main (initial) thread, and the threads that the program "
10030 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
10031 "thread. This thread handles thread creation and termination. (Problems can "
10032 "result if this thread is inadvertently killed.)"
10034 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3) を使って"
10035 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
10036 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
10037 "kill されると、問題が起こることがある)。"
10039 #. type: Plain text
10040 #: build/C/man7/pthreads.7:702
10042 "Signals are used internally by the implementation. On Linux 2.2 and later, "
10043 "the first three real-time signals are used (see also B<signal>(7)). On "
10044 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used. Applications must "
10045 "avoid the use of whichever set of signals is employed by the implementation."
10047 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
10048 "グナルのうち最初の 3つが使われる (B<signal>(7) 参照)。 それ以前のカーネルで"
10049 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
10050 "用されているシグナルを どれも使わないようにしなければならない。"
10052 #. type: Plain text
10053 #: build/C/man7/pthreads.7:709
10055 "Threads do not share process IDs. (In effect, LinuxThreads threads are "
10056 "implemented as processes which share more information than usual, but which "
10057 "do not share a common process ID.) LinuxThreads threads (including the "
10058 "manager thread) are visible as separate processes using B<ps>(1)."
10060 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
10061 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
10062 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1) "
10063 "を使うと別のプロセスのように見える。"
10065 #. type: Plain text
10066 #: build/C/man7/pthreads.7:712
10068 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
10069 "number of ways, including the following:"
10071 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
10074 #. type: Plain text
10075 #: build/C/man7/pthreads.7:716
10076 msgid "Calls to B<getpid>(2) return a different value in each thread."
10077 msgstr "B<getpid>(2) を呼び出したときに、スレッド毎に異なる値が返される。"
10079 #. type: Plain text
10080 #: build/C/man7/pthreads.7:725
10082 "Calls to B<getppid>(2) in threads other than the main thread return the "
10083 "process ID of the manager thread; instead B<getppid>(2) in these threads "
10084 "should return the same value as B<getppid>(2) in the main thread."
10086 "メインスレッド以外のスレッドで B<getppid>(2) を呼び出すと、管理スレッドのプ"
10087 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2) を呼んだ場合"
10088 "にはメインスレッドでの B<getppid>(2) と同じ値が返るべきである。"
10090 #. type: Plain text
10091 #: build/C/man7/pthreads.7:735
10093 "When one thread creates a new child process using B<fork>(2), any thread "
10094 "should be able to B<wait>(2) on the child. However, the implementation "
10095 "only allows the thread that created the child to B<wait>(2) on it."
10097 "あるスレッドが B<fork>(2) を使って新しい子プロセスを作成した場合、 どのス"
10098 "レッドでもこの子プロセスを B<wait>(2) できるべきである。しかしながら、この実"
10099 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2) でき"
10102 #. type: Plain text
10103 #: build/C/man7/pthreads.7:742
10105 "When a thread calls B<execve>(2), all other threads are terminated (as "
10106 "required by POSIX.1). However, the resulting process has the same PID as "
10107 "the thread that called B<execve>(2): it should have the same PID as the main "
10110 "あるスレッドが B<execve>(2) を呼び出した場合、他のスレッドは全て終了される "
10111 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2) を呼んだ"
10112 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
10115 #. type: Plain text
10116 #: build/C/man7/pthreads.7:749
10118 "Threads do not share user and group IDs. This can cause complications with "
10119 "set-user-ID programs and can cause failures in Pthreads functions if an "
10120 "application changes its credentials using B<seteuid>(2) or similar."
10122 "スレッド間でユーザ ID とグループ ID が共有されない このことは、set-user-ID プ"
10123 "ログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2) などを使っ"
10124 "て信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
10126 #. type: Plain text
10127 #: build/C/man7/pthreads.7:751
10128 msgid "Threads do not share a common session ID and process group ID."
10129 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
10131 #. type: Plain text
10132 #: build/C/man7/pthreads.7:754
10133 msgid "Threads do not share record locks created using B<fcntl>(2)."
10135 "スレッド間で B<fcntl>(2) を使って作成されるレコード・ロックを共有しない。"
10137 #. type: Plain text
10138 #: build/C/man7/pthreads.7:760
10140 "The information returned by B<times>(2) and B<getrusage>(2) is per-thread "
10141 "rather than process-wide."
10143 "B<times>(2) と B<getrusage>(2) が返す情報がプロセス全体の情報でなくスレッド"
10146 #. type: Plain text
10147 #: build/C/man7/pthreads.7:763
10148 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
10149 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2) 参照) を共有しない。"
10151 #. type: Plain text
10152 #: build/C/man7/pthreads.7:765
10153 msgid "Threads do not share interval timers."
10154 msgstr "スレッド間でインターバル・タイマを共有しない。"
10156 #. FIXME . bug report filed for NPTL nice nonconformance
10157 #. http://bugzilla.kernel.org/show_bug.cgi?id=6258
10158 #. Sep 08: there is a patch by Denys Vlasenko to address this
10159 #. "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
10160 #. Monitor this to see if it makes it into mainline.
10161 #. type: Plain text
10162 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
10163 msgid "Threads do not share a common nice value."
10164 msgstr "スレッドは共通の nice 値を共有しない。"
10166 #. type: Plain text
10167 #: build/C/man7/pthreads.7:777
10169 "POSIX.1 distinguishes the notions of signals that are directed to the "
10170 "process as a whole and signals that are directed to individual threads. "
10171 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
10172 "example) should be handled by a single, arbitrarily selected thread within "
10173 "the process. LinuxThreads does not support the notion of process-directed "
10174 "signals: signals may only be sent to specific threads."
10176 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
10177 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
10178 "ル (例えば B<kill>(2) を使って送る) は、そのプロセスに属すスレッドのうち 勝"
10179 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
10180 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
10181 "ルは特定のスレッドにだけ送ることができる。"
10183 #. type: Plain text
10184 #: build/C/man7/pthreads.7:786
10186 "Threads have distinct alternate signal stack settings. However, a new "
10187 "thread's alternate signal stack settings are copied from the thread that "
10188 "created it, so that the threads initially share an alternate signal stack. "
10189 "(A new thread should start with no alternate signal stack defined. If two "
10190 "threads handle signals on their shared alternate signal stack at the same "
10191 "time, unpredictable program failures are likely to occur.)"
10193 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
10194 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
10195 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
10196 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
10197 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
10198 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
10201 #: build/C/man7/pthreads.7:786
10206 #. type: Plain text
10207 #: build/C/man7/pthreads.7:795
10209 "With NPTL, all of the threads in a process are placed in the same thread "
10210 "group; all members of a thread group share the same PID. NPTL does not "
10211 "employ a manager thread. NPTL makes internal use of the first two real-time "
10212 "signals (see also B<signal>(7)); these signals cannot be used in "
10215 "NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ に属する; "
10216 "スレッド・グループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド "
10217 "(manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初"
10218 "の 2つの番号を使用しており (B<signal>(7) 参照)、これらのシグナルはアプリケー"
10221 #. type: Plain text
10222 #: build/C/man7/pthreads.7:797
10223 msgid "NPTL still has at least one nonconformance with POSIX.1:"
10224 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
10226 #. type: Plain text
10227 #: build/C/man7/pthreads.7:806
10228 msgid "Some NPTL nonconformances only occur with older kernels:"
10229 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
10231 #. type: Plain text
10232 #: build/C/man7/pthreads.7:812
10234 "The information returned by B<times>(2) and B<getrusage>(2) is per-thread "
10235 "rather than process-wide (fixed in kernel 2.6.9)."
10237 "B<times>(2) と B<getrusage>(2) が返す情報がプロセス全体の情報でなくスレッド"
10238 "単位の情報である (カーネル 2.6.9 で修正された)。"
10240 #. type: Plain text
10241 #: build/C/man7/pthreads.7:814
10242 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
10243 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
10245 #. type: Plain text
10246 #: build/C/man7/pthreads.7:816
10247 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
10249 "スレッド間でインターバル・タイマを共有しない (カーネル 2.6.12 で修正された)。"
10251 #. type: Plain text
10252 #: build/C/man7/pthreads.7:820
10254 "Only the main thread is permitted to start a new session using B<setsid>(2) "
10255 "(fixed in kernel 2.6.16)."
10257 "メインスレッドだけが B<setsid>(2) を使って新しいセッションを開始することがで"
10258 "きる (カーネル 2.6.16 で修正された)。"
10260 #. type: Plain text
10261 #: build/C/man7/pthreads.7:825
10263 "Only the main thread is permitted to make the process into a process group "
10264 "leader using B<setpgid>(2) (fixed in kernel 2.6.16)."
10266 "メインスレッドだけが B<setpgid>(2) を使ってそのプロセスをプロセス・グルー"
10267 "プ・リーダーにすることができる (カーネル 2.6.16 で修正された)。"
10269 #. type: Plain text
10270 #: build/C/man7/pthreads.7:831
10272 "Threads have distinct alternate signal stack settings. However, a new "
10273 "thread's alternate signal stack settings are copied from the thread that "
10274 "created it, so that the threads initially share an alternate signal stack "
10275 "(fixed in kernel 2.6.16)."
10277 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
10278 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
10279 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
10280 "ル 2.6.16 で修正された)。"
10282 #. type: Plain text
10283 #: build/C/man7/pthreads.7:833
10284 msgid "Note the following further points about the NPTL implementation:"
10285 msgstr "NPTL の実装では以下の点についても注意すること:"
10287 #. type: Plain text
10288 #: build/C/man7/pthreads.7:847
10290 "If the stack size soft resource limit (see the description of "
10291 "B<RLIMIT_STACK> in B<setrlimit>(2)) is set to a value other than "
10292 "I<unlimited>, then this value defines the default stack size for new "
10293 "threads. To be effective, this limit must be set before the program is "
10294 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
10295 "stacksize> in the C shell)."
10297 "スタックサイズのリソースのソフト・リミット (B<setrlimit>(2) の "
10298 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
10299 "ソフト・リミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設"
10300 "定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけ"
10301 "ればならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
10302 "は I<limit stacksize>) を使って設定する。"
10305 #: build/C/man7/pthreads.7:847
10307 msgid "Determining the Threading Implementation"
10310 #. type: Plain text
10311 #: build/C/man7/pthreads.7:852
10313 "Since glibc 2.3.2, the B<getconf>(1) command can be used to determine the "
10314 "system's threading implementation, for example:"
10316 "glibc 2.3.2 以降では、 B<getconf>(1) コマンドを使って、 システムのスレッド実"
10317 "装を判定することができる。 以下に例を示す:"
10319 #. type: Plain text
10320 #: build/C/man7/pthreads.7:857
10323 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
10326 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
10329 #. type: Plain text
10330 #: build/C/man7/pthreads.7:862
10332 "With older glibc versions, a command such as the following should be "
10333 "sufficient to determine the default threading implementation:"
10335 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
10338 #. type: Plain text
10339 #: build/C/man7/pthreads.7:868
10342 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
10343 " egrep -i \\(aqthreads|nptl\\(aq\n"
10344 " Native POSIX Threads Library by Ulrich Drepper et al\n"
10346 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
10347 " egrep -i \\(aqthreads|ntpl\\(aq\n"
10348 " Native POSIX Threads Library by Ulrich Drepper et al\n"
10351 #: build/C/man7/pthreads.7:870
10353 msgid "Selecting the Threading Implementation: LD_ASSUME_KERNEL"
10354 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
10356 #. type: Plain text
10357 #: build/C/man7/pthreads.7:885
10359 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
10360 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
10361 "override the dynamic linker's default choice of threading implementation. "
10362 "This variable tells the dynamic linker to assume that it is running on top "
10363 "of a particular kernel version. By specifying a kernel version that does "
10364 "not provide the support required by NPTL, we can force the use of "
10365 "LinuxThreads. (The most likely reason for doing this is to run a (broken) "
10366 "application that depends on some nonconformant behavior in LinuxThreads.) "
10369 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
10370 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルト"
10371 "で 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカ"
10372 "が特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL "
10373 "が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、"
10374 "強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな"
10375 "場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーショ"
10376 "ン を動作させる場合だろう)。 以下に例を示す:"
10378 #. type: Plain text
10379 #: build/C/man7/pthreads.7:891
10382 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
10383 " awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
10384 " linuxthreads-0.10 by Xavier Leroy\n"
10386 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
10387 " awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n"
10388 " linuxthreads-0.10 by Xavier Leroy\n"
10390 #. type: Plain text
10391 #: build/C/man7/pthreads.7:903
10393 "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), B<sigevent>"
10394 "(7), B<signal>(7),"
10396 "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), "
10399 #. type: Plain text
10400 #: build/C/man7/pthreads.7:927
10402 "and various Pthreads manual pages, for example: B<pthread_attr_init>(3), "
10403 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
10404 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
10405 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
10406 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
10407 "B<pthread_mutex_unlock>(3), B<pthread_once>(3), B<pthread_setcancelstate>"
10408 "(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), "
10409 "B<pthread_sigmask>(3), B<pthread_sigqueue>(3), and B<pthread_testcancel>(3)"
10411 "および Pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
10412 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
10413 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
10414 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
10415 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
10416 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
10417 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
10418 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
10419 "and B<pthread_testcancel>(3)"