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: 2021-03-12 14:01+0900\n"
10 "PO-Revision-Date: 2021-07-19 09:36+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/man3/getcontext.3:25
25 #: build/C/man3/getcontext.3:25 build/C/man3/makecontext.3:28
26 #: build/C/man3/pthread_tryjoin_np.3:26 build/C/man7/pthreads.7:25
27 #: build/C/man7/attributes.7:24
33 #: build/C/man3/getcontext.3:25 build/C/man3/pthread_attr_init.3:26
34 #: build/C/man3/pthread_attr_setaffinity_np.3:26
35 #: build/C/man3/pthread_attr_setdetachstate.3:26
36 #: build/C/man3/pthread_attr_setguardsize.3:26
37 #: build/C/man3/pthread_attr_setinheritsched.3:26
38 #: build/C/man3/pthread_attr_setschedparam.3:26
39 #: build/C/man3/pthread_attr_setschedpolicy.3:26
40 #: build/C/man3/pthread_attr_setscope.3:26
41 #: build/C/man3/pthread_attr_setstack.3:26
42 #: build/C/man3/pthread_attr_setstackaddr.3:26
43 #: build/C/man3/pthread_attr_setstacksize.3:26 build/C/man3/pthread_cancel.3:26
44 #: build/C/man3/pthread_cleanup_push.3:26
45 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
46 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_detach.3:26
47 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
48 #: build/C/man3/pthread_getattr_np.3:26 build/C/man3/pthread_getcpuclockid.3:26
49 #: build/C/man3/pthread_join.3:26 build/C/man3/pthread_kill.3:26
50 #: build/C/man3/pthread_kill_other_threads_np.3:26
51 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setaffinity_np.3:26
52 #: build/C/man3/pthread_setcancelstate.3:26
53 #: build/C/man3/pthread_setconcurrency.3:25
54 #: build/C/man3/pthread_setname_np.3:26 build/C/man3/pthread_setschedparam.3:26
55 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigmask.3:26
56 #: build/C/man3/pthread_sigqueue.3:25 build/C/man3/pthread_testcancel.3:26
57 #: build/C/man3/pthread_tryjoin_np.3:26 build/C/man3/pthread_yield.3:25
58 #: build/C/man3/pthread_atfork.3:25
59 #: build/C/man3/pthread_attr_setsigmask_np.3:26
60 #: build/C/man3/pthread_getattr_default_np.3:25
61 #: build/C/man3/pthread_mutex_consistent.3:26
62 #: build/C/man3/pthread_mutexattr_getpshared.3:25
63 #: build/C/man3/pthread_mutexattr_init.3:25
64 #: build/C/man3/pthread_mutexattr_setrobust.3:26
65 #: build/C/man3/pthread_spin_init.3:25 build/C/man3/pthread_spin_lock.3:25
66 #: build/C/man7/pthreads.7:25 build/C/man7/attributes.7:24
67 #: build/C/man7/nptl.7:26
73 #: build/C/man3/getcontext.3:25 build/C/man3/makecontext.3:28
74 #: build/C/man3/pthread_attr_init.3:26
75 #: build/C/man3/pthread_attr_setaffinity_np.3:26
76 #: build/C/man3/pthread_attr_setdetachstate.3:26
77 #: build/C/man3/pthread_attr_setguardsize.3:26
78 #: build/C/man3/pthread_attr_setinheritsched.3:26
79 #: build/C/man3/pthread_attr_setschedparam.3:26
80 #: build/C/man3/pthread_attr_setschedpolicy.3:26
81 #: build/C/man3/pthread_attr_setscope.3:26
82 #: build/C/man3/pthread_attr_setstack.3:26
83 #: build/C/man3/pthread_attr_setstackaddr.3:26
84 #: build/C/man3/pthread_attr_setstacksize.3:26 build/C/man3/pthread_cancel.3:26
85 #: build/C/man3/pthread_cleanup_push.3:26
86 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
87 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_detach.3:26
88 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
89 #: build/C/man3/pthread_getattr_np.3:26 build/C/man3/pthread_getcpuclockid.3:26
90 #: build/C/man3/pthread_join.3:26 build/C/man3/pthread_kill.3:26
91 #: build/C/man3/pthread_kill_other_threads_np.3:26
92 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
93 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setaffinity_np.3:26
94 #: build/C/man3/pthread_setcancelstate.3:26
95 #: build/C/man3/pthread_setconcurrency.3:25
96 #: build/C/man3/pthread_setname_np.3:26 build/C/man3/pthread_setschedparam.3:26
97 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigmask.3:26
98 #: build/C/man3/pthread_sigqueue.3:25 build/C/man3/pthread_testcancel.3:26
99 #: build/C/man3/pthread_tryjoin_np.3:26 build/C/man3/pthread_yield.3:25
100 #: build/C/man3/pthread_atfork.3:25
101 #: build/C/man3/pthread_attr_setsigmask_np.3:26
102 #: build/C/man3/pthread_getattr_default_np.3:25
103 #: build/C/man3/pthread_mutex_consistent.3:26
104 #: build/C/man3/pthread_mutexattr_getpshared.3:25
105 #: build/C/man3/pthread_mutexattr_init.3:25
106 #: build/C/man3/pthread_mutexattr_setrobust.3:26
107 #: build/C/man3/pthread_spin_init.3:25 build/C/man3/pthread_spin_lock.3:25
108 #: build/C/man7/pthreads.7:25 build/C/man7/attributes.7:24
109 #: build/C/man7/nptl.7:26
111 msgid "Linux Programmer's Manual"
112 msgstr "Linux Programmer's Manual"
115 #: build/C/man3/getcontext.3:26 build/C/man3/makecontext.3:29
116 #: build/C/man3/pthread_attr_init.3:27
117 #: build/C/man3/pthread_attr_setaffinity_np.3:27
118 #: build/C/man3/pthread_attr_setdetachstate.3:27
119 #: build/C/man3/pthread_attr_setguardsize.3:27
120 #: build/C/man3/pthread_attr_setinheritsched.3:27
121 #: build/C/man3/pthread_attr_setschedparam.3:27
122 #: build/C/man3/pthread_attr_setschedpolicy.3:27
123 #: build/C/man3/pthread_attr_setscope.3:27
124 #: build/C/man3/pthread_attr_setstack.3:27
125 #: build/C/man3/pthread_attr_setstackaddr.3:27
126 #: build/C/man3/pthread_attr_setstacksize.3:27 build/C/man3/pthread_cancel.3:27
127 #: build/C/man3/pthread_cleanup_push.3:27
128 #: build/C/man3/pthread_cleanup_push_defer_np.3:27
129 #: build/C/man3/pthread_create.3:27 build/C/man3/pthread_detach.3:27
130 #: build/C/man3/pthread_equal.3:27 build/C/man3/pthread_exit.3:27
131 #: build/C/man3/pthread_getattr_np.3:27 build/C/man3/pthread_getcpuclockid.3:27
132 #: build/C/man3/pthread_join.3:27 build/C/man3/pthread_kill.3:27
133 #: build/C/man3/pthread_kill_other_threads_np.3:27
134 #: build/C/man3/pthread_rwlockattr_setkind_np.3:26
135 #: build/C/man3/pthread_self.3:27 build/C/man3/pthread_setaffinity_np.3:27
136 #: build/C/man3/pthread_setcancelstate.3:27
137 #: build/C/man3/pthread_setconcurrency.3:26
138 #: build/C/man3/pthread_setname_np.3:27 build/C/man3/pthread_setschedparam.3:27
139 #: build/C/man3/pthread_setschedprio.3:27 build/C/man3/pthread_sigmask.3:27
140 #: build/C/man3/pthread_sigqueue.3:26 build/C/man3/pthread_testcancel.3:27
141 #: build/C/man3/pthread_tryjoin_np.3:27 build/C/man3/pthread_yield.3:26
142 #: build/C/man3/pthread_atfork.3:26
143 #: build/C/man3/pthread_attr_setsigmask_np.3:27
144 #: build/C/man3/pthread_getattr_default_np.3:26
145 #: build/C/man3/pthread_mutex_consistent.3:27
146 #: build/C/man3/pthread_mutexattr_getpshared.3:26
147 #: build/C/man3/pthread_mutexattr_init.3:26
148 #: build/C/man3/pthread_mutexattr_setrobust.3:27
149 #: build/C/man3/pthread_spin_init.3:26 build/C/man3/pthread_spin_lock.3:26
150 #: build/C/man7/pthreads.7:26 build/C/man7/attributes.7:25
151 #: build/C/man7/nptl.7:27
157 #: build/C/man3/getcontext.3:28
158 msgid "getcontext, setcontext - get or set the user context"
159 msgstr "getcontext, setcontext - ユーザーコンテキストを取得/設定する"
162 #: build/C/man3/getcontext.3:28 build/C/man3/makecontext.3:31
163 #: build/C/man3/pthread_attr_init.3:30
164 #: build/C/man3/pthread_attr_setaffinity_np.3:30
165 #: build/C/man3/pthread_attr_setdetachstate.3:30
166 #: build/C/man3/pthread_attr_setguardsize.3:30
167 #: build/C/man3/pthread_attr_setinheritsched.3:30
168 #: build/C/man3/pthread_attr_setschedparam.3:30
169 #: build/C/man3/pthread_attr_setschedpolicy.3:30
170 #: build/C/man3/pthread_attr_setscope.3:30
171 #: build/C/man3/pthread_attr_setstack.3:30
172 #: build/C/man3/pthread_attr_setstackaddr.3:30
173 #: build/C/man3/pthread_attr_setstacksize.3:30 build/C/man3/pthread_cancel.3:29
174 #: build/C/man3/pthread_cleanup_push.3:30
175 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
176 #: build/C/man3/pthread_create.3:29 build/C/man3/pthread_detach.3:29
177 #: build/C/man3/pthread_equal.3:29 build/C/man3/pthread_exit.3:29
178 #: build/C/man3/pthread_getattr_np.3:29 build/C/man3/pthread_getcpuclockid.3:29
179 #: build/C/man3/pthread_join.3:29 build/C/man3/pthread_kill.3:29
180 #: build/C/man3/pthread_kill_other_threads_np.3:29
181 #: build/C/man3/pthread_rwlockattr_setkind_np.3:29
182 #: build/C/man3/pthread_self.3:29 build/C/man3/pthread_setaffinity_np.3:30
183 #: build/C/man3/pthread_setcancelstate.3:30
184 #: build/C/man3/pthread_setconcurrency.3:29
185 #: build/C/man3/pthread_setname_np.3:29 build/C/man3/pthread_setschedparam.3:30
186 #: build/C/man3/pthread_setschedprio.3:29 build/C/man3/pthread_sigmask.3:29
187 #: build/C/man3/pthread_sigqueue.3:28 build/C/man3/pthread_testcancel.3:29
188 #: build/C/man3/pthread_tryjoin_np.3:30 build/C/man3/pthread_yield.3:28
189 #: build/C/man3/pthread_atfork.3:28
190 #: build/C/man3/pthread_attr_setsigmask_np.3:30
191 #: build/C/man3/pthread_getattr_default_np.3:29
192 #: build/C/man3/pthread_mutex_consistent.3:29
193 #: build/C/man3/pthread_mutexattr_getpshared.3:29
194 #: build/C/man3/pthread_mutexattr_init.3:29
195 #: build/C/man3/pthread_mutexattr_setrobust.3:30
196 #: build/C/man3/pthread_spin_init.3:28 build/C/man3/pthread_spin_lock.3:29
202 #: build/C/man3/getcontext.3:30 build/C/man3/makecontext.3:33
203 msgid "B<#include E<lt>ucontext.hE<gt>>"
204 msgstr "B<#include E<lt>ucontext.hE<gt>>"
207 #: build/C/man3/getcontext.3:32
208 msgid "B<int getcontext(ucontext_t *>I<ucp>B<);>"
209 msgstr "B<int getcontext(ucontext_t *>I<ucp>B<);>"
212 #: build/C/man3/getcontext.3:34
213 msgid "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
214 msgstr "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
217 #: build/C/man3/getcontext.3:34 build/C/man3/makecontext.3:38
218 #: build/C/man3/pthread_attr_init.3:39
219 #: build/C/man3/pthread_attr_setaffinity_np.3:42
220 #: build/C/man3/pthread_attr_setdetachstate.3:41
221 #: build/C/man3/pthread_attr_setguardsize.3:41
222 #: build/C/man3/pthread_attr_setinheritsched.3:41
223 #: build/C/man3/pthread_attr_setschedparam.3:41
224 #: build/C/man3/pthread_attr_setschedpolicy.3:41
225 #: build/C/man3/pthread_attr_setscope.3:41
226 #: build/C/man3/pthread_attr_setstack.3:54
227 #: build/C/man3/pthread_attr_setstackaddr.3:41
228 #: build/C/man3/pthread_attr_setstacksize.3:41 build/C/man3/pthread_cancel.3:37
229 #: build/C/man3/pthread_cleanup_push.3:40
230 #: build/C/man3/pthread_cleanup_push_defer_np.3:53
231 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
232 #: build/C/man3/pthread_equal.3:37 build/C/man3/pthread_exit.3:37
233 #: build/C/man3/pthread_getattr_np.3:38 build/C/man3/pthread_getcpuclockid.3:38
234 #: build/C/man3/pthread_join.3:37 build/C/man3/pthread_kill.3:49
235 #: build/C/man3/pthread_kill_other_threads_np.3:35
236 #: build/C/man3/pthread_rwlockattr_setkind_np.3:54
237 #: build/C/man3/pthread_self.3:37 build/C/man3/pthread_setaffinity_np.3:42
238 #: build/C/man3/pthread_setcancelstate.3:39
239 #: build/C/man3/pthread_setconcurrency.3:38
240 #: build/C/man3/pthread_setname_np.3:39 build/C/man3/pthread_setschedparam.3:41
241 #: build/C/man3/pthread_setschedprio.3:37 build/C/man3/pthread_sigmask.3:50
242 #: build/C/man3/pthread_sigqueue.3:46 build/C/man3/pthread_testcancel.3:37
243 #: build/C/man3/pthread_tryjoin_np.3:42 build/C/man3/pthread_yield.3:37
244 #: build/C/man3/pthread_atfork.3:37
245 #: build/C/man3/pthread_attr_setsigmask_np.3:42
246 #: build/C/man3/pthread_getattr_default_np.3:39
247 #: build/C/man3/pthread_mutex_consistent.3:50
248 #: build/C/man3/pthread_mutexattr_getpshared.3:40
249 #: build/C/man3/pthread_mutexattr_init.3:38
250 #: build/C/man3/pthread_mutexattr_setrobust.3:57
251 #: build/C/man3/pthread_spin_init.3:51 build/C/man3/pthread_spin_lock.3:53
252 #: build/C/man7/pthreads.7:28 build/C/man7/attributes.7:27
253 #: build/C/man7/nptl.7:29
259 #: build/C/man3/getcontext.3:49
261 "In a System V-like environment, one has the two types I<mcontext_t> and "
262 "I<ucontext_t> defined in I<E<lt>ucontext.hE<gt>> and the four functions "
263 "B<getcontext>(), B<setcontext>(), B<makecontext>(3), and B<swapcontext>(3) "
264 "that allow user-level context switching between multiple threads of control "
267 "System V 的な環境では、 I<mcontext_t> および I<ucontext_t> という 2 つの型"
268 "と、 B<getcontext>(), B<setcontext>(), B<makecontext>(3), B<swapcontext>(3) "
269 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
270 "部で制御下にある複数のスレッド間で、 ユーザーレベルのコンテキスト切替えができ"
274 #: build/C/man3/getcontext.3:57
276 "The I<mcontext_t> type is machine-dependent and opaque. The I<ucontext_t> "
277 "type is a structure that has at least the following fields:"
279 "I<mcontext_t> 型はマシン依存で、外部からは隠蔽されている。 I<ucontext_t> 型は"
280 "構造体で、少なくとも以下の 4 つのフィールドを持つ。"
283 #: build/C/man3/getcontext.3:67
286 "typedef struct ucontext_t {\n"
287 " struct ucontext_t *uc_link;\n"
288 " sigset_t uc_sigmask;\n"
289 " stack_t uc_stack;\n"
290 " mcontext_t uc_mcontext;\n"
294 "typedef struct ucontext_t {\n"
295 " struct ucontext_t *uc_link;\n"
296 " sigset_t uc_sigmask;\n"
297 " stack_t uc_stack;\n"
298 " mcontext_t uc_mcontext;\n"
303 #: build/C/man3/getcontext.3:94
305 "with I<sigset_t> and I<stack_t> defined in I<E<lt>signal.hE<gt>>. Here "
306 "I<uc_link> points to the context that will be resumed when the current "
307 "context terminates (in case the current context was created using "
308 "B<makecontext>(3)), I<uc_sigmask> is the set of signals blocked in this "
309 "context (see B<sigprocmask>(2)), I<uc_stack> is the stack used by this "
310 "context (see B<sigaltstack>(2)), and I<uc_mcontext> is the machine-specific "
311 "representation of the saved context, that includes the calling thread's "
314 "I<sigset_t> と I<stack_t> は I<E<lt>signal.hE<gt>> で定義されている。 ここで "
315 "I<uc_link> は、 現在のコンテキストが終了したとき、 続いて切り替わるコンテキス"
316 "トへのポインターである (現在のコンテキストが B<makecontext>(3) で生成された"
317 "ものの場合)。 I<uc_sigmask> はこのコンテキストでブロックされている シグナル群"
318 "である (B<sigprocmask>(2) を見よ)。 I<uc_stack> はこのコンテキストが用いてい"
319 "るスタックである (B<signalstack>(2) を見よ)。 I<uc_mcontext> は保存されてい"
320 "るコンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマ"
324 #: build/C/man3/getcontext.3:101
326 "The function B<getcontext>() initializes the structure pointed to by I<ucp> "
327 "to the currently active context."
329 "B<getcontext>() 関数は、 ポインター I<ucp> が指す構造体を、 現在アクティブな"
333 #: build/C/man3/getcontext.3:117
336 #| "The function B<setcontext>() restores the user context pointed at by "
337 #| "I<ucp>. A successful call does not return. The context should have been "
338 #| "obtained by a call of B<getcontext>(), or B<makecontext>(3), or passed as "
339 #| "third argument to a signal handler."
341 "The function B<setcontext>() restores the user context pointed to by "
342 "I<ucp>. A successful call does not return. The context should have been "
343 "obtained by a call of B<getcontext>(), or B<makecontext>(3), or received as "
344 "the third argument to a signal handler (see the discussion of the "
345 "B<SA_SIGINFO> flag in B<sigaction>(2))."
347 "B<setcontext>() 関数は、ポインター I<ucp> が指すユーザーコンテキストをリスト"
348 "アする。 呼び出しに成功すると返らない。 このコンテキストは、以前に "
349 "B<getcontext>() または B<makecontext>(3) で得られたものか、 あるいはシグナ"
350 "ルの第三引数として与えられたものになる。"
353 #: build/C/man3/getcontext.3:121
355 "If the context was obtained by a call of B<getcontext>(), program execution "
356 "continues as if this call just returned."
358 "コンテキストが B<getcontext>() の呼び出しによって得られていたものの場合は、 "
359 "プログラムはこの呼び出しから返った直後からのように実行を継続する。"
362 #: build/C/man3/getcontext.3:138
364 "If the context was obtained by a call of B<makecontext>(3), program "
365 "execution continues by a call to the function I<func> specified as the "
366 "second argument of that call to B<makecontext>(3). When the function "
367 "I<func> returns, we continue with the I<uc_link> member of the structure "
368 "I<ucp> specified as the first argument of that call to B<makecontext>(3). "
369 "When this member is NULL, the thread exits."
371 "コンテキストが B<makecontext>(3) の呼び出しによって得られていたものの場合"
372 "は、 プログラムの実行はその B<makecontext>(3) 呼び出しの第二引数で指定された"
373 "関数 I<func> を呼び出すかたちで継続する。 I<func> から返ると、 "
374 "B<makecontext>(3) 呼び出しの第一引数で指定されていた I<ucp> 構造体の "
375 "I<uc_link> メンバで継続する。 このメンバが NULL だった場合は、そのスレッドは"
379 #: build/C/man3/getcontext.3:145
381 "If the context was obtained by a call to a signal handler, then old standard "
382 "text says that \"program execution continues with the program instruction "
383 "following the instruction interrupted by the signal\". However, this "
384 "sentence was removed in SUSv2, and the present verdict is \"the result is "
387 "コンテキストがシグナルハンドラーの呼び出しによって得られていたものの場合は、 "
388 "古い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命"
389 "令から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結"
393 #: build/C/man3/getcontext.3:145 build/C/man3/makecontext.3:85
394 #: build/C/man3/pthread_attr_init.3:68
395 #: build/C/man3/pthread_attr_setaffinity_np.3:76
396 #: build/C/man3/pthread_attr_setdetachstate.3:77
397 #: build/C/man3/pthread_attr_setguardsize.3:90
398 #: build/C/man3/pthread_attr_setinheritsched.3:93
399 #: build/C/man3/pthread_attr_setschedparam.3:85
400 #: build/C/man3/pthread_attr_setschedpolicy.3:83
401 #: build/C/man3/pthread_attr_setscope.3:103
402 #: build/C/man3/pthread_attr_setstack.3:85
403 #: build/C/man3/pthread_attr_setstackaddr.3:74
404 #: build/C/man3/pthread_attr_setstacksize.3:61
405 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_cleanup_push.3:121
406 #: build/C/man3/pthread_create.3:115 build/C/man3/pthread_detach.3:49
407 #: build/C/man3/pthread_equal.3:41 build/C/man3/pthread_exit.3:71
408 #: build/C/man3/pthread_getattr_np.3:73 build/C/man3/pthread_getcpuclockid.3:49
409 #: build/C/man3/pthread_join.3:70 build/C/man3/pthread_kill.3:63
410 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
411 #: build/C/man3/pthread_self.3:46 build/C/man3/pthread_setaffinity_np.3:77
412 #: build/C/man3/pthread_setcancelstate.3:97
413 #: build/C/man3/pthread_setconcurrency.3:56
414 #: build/C/man3/pthread_setname_np.3:72
415 #: build/C/man3/pthread_setschedparam.3:104
416 #: build/C/man3/pthread_setschedprio.3:53 build/C/man3/pthread_sigmask.3:61
417 #: build/C/man3/pthread_sigqueue.3:66 build/C/man3/pthread_testcancel.3:50
418 #: build/C/man3/pthread_tryjoin_np.3:88 build/C/man3/pthread_yield.3:44
419 #: build/C/man3/pthread_atfork.3:67
420 #: build/C/man3/pthread_attr_setsigmask_np.3:67
421 #: build/C/man3/pthread_mutex_consistent.3:59
422 #: build/C/man3/pthread_mutexattr_getpshared.3:76
423 #: build/C/man3/pthread_mutexattr_init.3:56
424 #: build/C/man3/pthread_mutexattr_setrobust.3:129
425 #: build/C/man3/pthread_spin_init.3:111 build/C/man3/pthread_spin_lock.3:91
431 #: build/C/man3/getcontext.3:154
433 "When successful, B<getcontext>() returns 0 and B<setcontext>() does not "
434 "return. On error, both return -1 and set I<errno> appropriately."
436 "成功すると、 B<getcontext>() は 0 を返し、 B<setcontext>() は返らない。 失"
437 "敗すると、両者とも -1 を返し、I<errno> をエラーに応じて設定する。"
440 #: build/C/man3/getcontext.3:154 build/C/man3/makecontext.3:97
441 #: build/C/man3/pthread_attr_init.3:71
442 #: build/C/man3/pthread_attr_setaffinity_np.3:79
443 #: build/C/man3/pthread_attr_setdetachstate.3:80
444 #: build/C/man3/pthread_attr_setguardsize.3:93
445 #: build/C/man3/pthread_attr_setinheritsched.3:96
446 #: build/C/man3/pthread_attr_setschedparam.3:88
447 #: build/C/man3/pthread_attr_setschedpolicy.3:86
448 #: build/C/man3/pthread_attr_setscope.3:106
449 #: build/C/man3/pthread_attr_setstack.3:88
450 #: build/C/man3/pthread_attr_setstackaddr.3:77
451 #: build/C/man3/pthread_attr_setstacksize.3:64
452 #: build/C/man3/pthread_cancel.3:117 build/C/man3/pthread_cleanup_push.3:123
453 #: build/C/man3/pthread_create.3:122 build/C/man3/pthread_detach.3:54
454 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
455 #: build/C/man3/pthread_getattr_np.3:76 build/C/man3/pthread_getcpuclockid.3:52
456 #: build/C/man3/pthread_join.3:75 build/C/man3/pthread_kill.3:68
457 #: build/C/man3/pthread_rwlockattr_setkind_np.3:129
458 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_setaffinity_np.3:80
459 #: build/C/man3/pthread_setcancelstate.3:100
460 #: build/C/man3/pthread_setconcurrency.3:68
461 #: build/C/man3/pthread_setname_np.3:75
462 #: build/C/man3/pthread_setschedparam.3:112
463 #: build/C/man3/pthread_setschedprio.3:61 build/C/man3/pthread_sigmask.3:66
464 #: build/C/man3/pthread_sigqueue.3:71 build/C/man3/pthread_testcancel.3:54
465 #: build/C/man3/pthread_tryjoin_np.3:92 build/C/man3/pthread_yield.3:49
466 #: build/C/man3/pthread_atfork.3:82
467 #: build/C/man3/pthread_attr_setsigmask_np.3:84
468 #: build/C/man3/pthread_getattr_default_np.3:66
469 #: build/C/man3/pthread_mutex_consistent.3:65
470 #: build/C/man3/pthread_mutexattr_getpshared.3:79
471 #: build/C/man3/pthread_mutexattr_setrobust.3:136
472 #: build/C/man3/pthread_spin_init.3:117 build/C/man3/pthread_spin_lock.3:94
478 #: build/C/man3/getcontext.3:156
479 msgid "None defined."
483 #: build/C/man3/getcontext.3:156 build/C/man3/makecontext.3:106
484 #: build/C/man3/pthread_attr_init.3:79
485 #: build/C/man3/pthread_attr_setaffinity_np.3:108
486 #: build/C/man3/pthread_attr_setdetachstate.3:87
487 #: build/C/man3/pthread_attr_setguardsize.3:106
488 #: build/C/man3/pthread_attr_setinheritsched.3:110
489 #: build/C/man3/pthread_attr_setschedparam.3:107
490 #: build/C/man3/pthread_attr_setschedpolicy.3:100
491 #: build/C/man3/pthread_attr_setscope.3:119
492 #: build/C/man3/pthread_attr_setstack.3:112
493 #: build/C/man3/pthread_attr_setstackaddr.3:83
494 #: build/C/man3/pthread_attr_setstacksize.3:83
495 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_cleanup_push.3:127
496 #: build/C/man3/pthread_create.3:153 build/C/man3/pthread_detach.3:64
497 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
498 #: build/C/man3/pthread_getattr_np.3:98 build/C/man3/pthread_getcpuclockid.3:68
499 #: build/C/man3/pthread_join.3:98 build/C/man3/pthread_kill.3:72
500 #: build/C/man3/pthread_kill_other_threads_np.3:47
501 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_setaffinity_np.3:117
502 #: build/C/man3/pthread_setcancelstate.3:118
503 #: build/C/man3/pthread_setconcurrency.3:83
504 #: build/C/man3/pthread_setname_np.3:102
505 #: build/C/man3/pthread_setschedparam.3:141
506 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:69
507 #: build/C/man3/pthread_sigqueue.3:94 build/C/man3/pthread_testcancel.3:58
508 #: build/C/man3/pthread_tryjoin_np.3:123 build/C/man3/pthread_yield.3:53
509 #: build/C/man3/pthread_attr_setsigmask_np.3:91
510 #: build/C/man3/pthread_getattr_default_np.3:81 build/C/man7/attributes.7:24
516 #: build/C/man3/getcontext.3:159 build/C/man3/makecontext.3:109
517 #: build/C/man3/pthread_attr_init.3:82
518 #: build/C/man3/pthread_attr_setaffinity_np.3:111
519 #: build/C/man3/pthread_attr_setdetachstate.3:90
520 #: build/C/man3/pthread_attr_setguardsize.3:109
521 #: build/C/man3/pthread_attr_setinheritsched.3:113
522 #: build/C/man3/pthread_attr_setschedparam.3:110
523 #: build/C/man3/pthread_attr_setschedpolicy.3:103
524 #: build/C/man3/pthread_attr_setscope.3:122
525 #: build/C/man3/pthread_attr_setstack.3:115
526 #: build/C/man3/pthread_attr_setstackaddr.3:86
527 #: build/C/man3/pthread_attr_setstacksize.3:86
528 #: build/C/man3/pthread_cancel.3:128 build/C/man3/pthread_cleanup_push.3:130
529 #: build/C/man3/pthread_create.3:156 build/C/man3/pthread_detach.3:67
530 #: build/C/man3/pthread_equal.3:50 build/C/man3/pthread_exit.3:78
531 #: build/C/man3/pthread_getattr_np.3:101
532 #: build/C/man3/pthread_getcpuclockid.3:71 build/C/man3/pthread_join.3:101
533 #: build/C/man3/pthread_kill.3:75
534 #: build/C/man3/pthread_kill_other_threads_np.3:50
535 #: build/C/man3/pthread_self.3:53 build/C/man3/pthread_setaffinity_np.3:120
536 #: build/C/man3/pthread_setcancelstate.3:121
537 #: build/C/man3/pthread_setconcurrency.3:86
538 #: build/C/man3/pthread_setname_np.3:105
539 #: build/C/man3/pthread_setschedparam.3:144
540 #: build/C/man3/pthread_setschedprio.3:86 build/C/man3/pthread_sigmask.3:72
541 #: build/C/man3/pthread_sigqueue.3:97 build/C/man3/pthread_testcancel.3:61
542 #: build/C/man3/pthread_tryjoin_np.3:126 build/C/man3/pthread_yield.3:56
543 #: build/C/man3/pthread_attr_setsigmask_np.3:94
544 #: build/C/man3/pthread_getattr_default_np.3:84
546 "For an explanation of the terms used in this section, see B<attributes>(7)."
547 msgstr "この節で使用されている用語の説明については、 B<attributes>(7) を参照。"
550 #: build/C/man3/getcontext.3:163 build/C/man3/makecontext.3:113
551 #: build/C/man3/pthread_attr_init.3:87
552 #: build/C/man3/pthread_attr_setaffinity_np.3:115
553 #: build/C/man3/pthread_attr_setdetachstate.3:94
554 #: build/C/man3/pthread_attr_setguardsize.3:113
555 #: build/C/man3/pthread_attr_setinheritsched.3:117
556 #: build/C/man3/pthread_attr_setschedparam.3:114
557 #: build/C/man3/pthread_attr_setschedpolicy.3:107
558 #: build/C/man3/pthread_attr_setscope.3:126
559 #: build/C/man3/pthread_attr_setstack.3:119
560 #: build/C/man3/pthread_attr_setstackaddr.3:90
561 #: build/C/man3/pthread_attr_setstacksize.3:90
562 #: build/C/man3/pthread_cancel.3:132 build/C/man3/pthread_cleanup_push.3:134
563 #: build/C/man3/pthread_create.3:160 build/C/man3/pthread_detach.3:71
564 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82
565 #: build/C/man3/pthread_getattr_np.3:106
566 #: build/C/man3/pthread_getcpuclockid.3:75 build/C/man3/pthread_join.3:105
567 #: build/C/man3/pthread_kill.3:79
568 #: build/C/man3/pthread_kill_other_threads_np.3:54
569 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setaffinity_np.3:124
570 #: build/C/man3/pthread_setcancelstate.3:126
571 #: build/C/man3/pthread_setconcurrency.3:90
572 #: build/C/man3/pthread_setname_np.3:109
573 #: build/C/man3/pthread_setschedparam.3:148
574 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
575 #: build/C/man3/pthread_sigqueue.3:101 build/C/man3/pthread_testcancel.3:65
576 #: build/C/man3/pthread_tryjoin_np.3:131 build/C/man3/pthread_yield.3:60
577 #: build/C/man3/pthread_attr_setsigmask_np.3:98
578 #: build/C/man3/pthread_getattr_default_np.3:89
584 #: build/C/man3/getcontext.3:163 build/C/man3/makecontext.3:113
585 #: build/C/man3/pthread_attr_init.3:87
586 #: build/C/man3/pthread_attr_setaffinity_np.3:115
587 #: build/C/man3/pthread_attr_setdetachstate.3:94
588 #: build/C/man3/pthread_attr_setguardsize.3:113
589 #: build/C/man3/pthread_attr_setinheritsched.3:117
590 #: build/C/man3/pthread_attr_setschedparam.3:114
591 #: build/C/man3/pthread_attr_setschedpolicy.3:107
592 #: build/C/man3/pthread_attr_setscope.3:126
593 #: build/C/man3/pthread_attr_setstack.3:119
594 #: build/C/man3/pthread_attr_setstackaddr.3:90
595 #: build/C/man3/pthread_attr_setstacksize.3:90
596 #: build/C/man3/pthread_cancel.3:132 build/C/man3/pthread_cleanup_push.3:134
597 #: build/C/man3/pthread_create.3:160 build/C/man3/pthread_detach.3:71
598 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82
599 #: build/C/man3/pthread_getattr_np.3:106
600 #: build/C/man3/pthread_getcpuclockid.3:75 build/C/man3/pthread_join.3:105
601 #: build/C/man3/pthread_kill.3:79
602 #: build/C/man3/pthread_kill_other_threads_np.3:54
603 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setaffinity_np.3:124
604 #: build/C/man3/pthread_setcancelstate.3:126
605 #: build/C/man3/pthread_setconcurrency.3:90
606 #: build/C/man3/pthread_setname_np.3:109
607 #: build/C/man3/pthread_setschedparam.3:148
608 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
609 #: build/C/man3/pthread_sigqueue.3:101 build/C/man3/pthread_testcancel.3:65
610 #: build/C/man3/pthread_tryjoin_np.3:131 build/C/man3/pthread_yield.3:60
611 #: build/C/man3/pthread_attr_setsigmask_np.3:98
612 #: build/C/man3/pthread_getattr_default_np.3:89
618 #: build/C/man3/getcontext.3:163 build/C/man3/makecontext.3:113
619 #: build/C/man3/pthread_attr_init.3:87
620 #: build/C/man3/pthread_attr_setaffinity_np.3:115
621 #: build/C/man3/pthread_attr_setdetachstate.3:94
622 #: build/C/man3/pthread_attr_setguardsize.3:113
623 #: build/C/man3/pthread_attr_setinheritsched.3:117
624 #: build/C/man3/pthread_attr_setschedparam.3:114
625 #: build/C/man3/pthread_attr_setschedpolicy.3:107
626 #: build/C/man3/pthread_attr_setscope.3:126
627 #: build/C/man3/pthread_attr_setstack.3:119
628 #: build/C/man3/pthread_attr_setstackaddr.3:90
629 #: build/C/man3/pthread_attr_setstacksize.3:90
630 #: build/C/man3/pthread_cancel.3:132 build/C/man3/pthread_cleanup_push.3:134
631 #: build/C/man3/pthread_create.3:160 build/C/man3/pthread_detach.3:71
632 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82
633 #: build/C/man3/pthread_getattr_np.3:106
634 #: build/C/man3/pthread_getcpuclockid.3:75 build/C/man3/pthread_join.3:105
635 #: build/C/man3/pthread_kill.3:79
636 #: build/C/man3/pthread_kill_other_threads_np.3:54
637 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setaffinity_np.3:124
638 #: build/C/man3/pthread_setcancelstate.3:126
639 #: build/C/man3/pthread_setconcurrency.3:90
640 #: build/C/man3/pthread_setname_np.3:109
641 #: build/C/man3/pthread_setschedparam.3:148
642 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
643 #: build/C/man3/pthread_sigqueue.3:101 build/C/man3/pthread_testcancel.3:65
644 #: build/C/man3/pthread_tryjoin_np.3:131 build/C/man3/pthread_yield.3:60
645 #: build/C/man3/pthread_attr_setsigmask_np.3:98
646 #: build/C/man3/pthread_getattr_default_np.3:89
652 #: build/C/man3/getcontext.3:167
662 #: build/C/man3/getcontext.3:167 build/C/man3/makecontext.3:116
663 #: build/C/man3/makecontext.3:119 build/C/man3/pthread_attr_init.3:91
664 #: build/C/man3/pthread_attr_setaffinity_np.3:119
665 #: build/C/man3/pthread_attr_setdetachstate.3:98
666 #: build/C/man3/pthread_attr_setguardsize.3:117
667 #: build/C/man3/pthread_attr_setinheritsched.3:121
668 #: build/C/man3/pthread_attr_setschedparam.3:118
669 #: build/C/man3/pthread_attr_setschedpolicy.3:111
670 #: build/C/man3/pthread_attr_setscope.3:130
671 #: build/C/man3/pthread_attr_setstack.3:123
672 #: build/C/man3/pthread_attr_setstackaddr.3:94
673 #: build/C/man3/pthread_attr_setstacksize.3:94
674 #: build/C/man3/pthread_cancel.3:135 build/C/man3/pthread_cleanup_push.3:138
675 #: build/C/man3/pthread_create.3:163 build/C/man3/pthread_detach.3:74
676 #: build/C/man3/pthread_equal.3:57 build/C/man3/pthread_exit.3:85
677 #: build/C/man3/pthread_getattr_np.3:109
678 #: build/C/man3/pthread_getcpuclockid.3:78 build/C/man3/pthread_join.3:108
679 #: build/C/man3/pthread_kill.3:82
680 #: build/C/man3/pthread_kill_other_threads_np.3:57
681 #: build/C/man3/pthread_self.3:60 build/C/man3/pthread_setaffinity_np.3:128
682 #: build/C/man3/pthread_setcancelstate.3:130
683 #: build/C/man3/pthread_setconcurrency.3:94
684 #: build/C/man3/pthread_setname_np.3:113
685 #: build/C/man3/pthread_setschedparam.3:152
686 #: build/C/man3/pthread_setschedprio.3:93 build/C/man3/pthread_sigmask.3:79
687 #: build/C/man3/pthread_sigqueue.3:104 build/C/man3/pthread_testcancel.3:68
688 #: build/C/man3/pthread_tryjoin_np.3:135 build/C/man3/pthread_yield.3:63
689 #: build/C/man3/pthread_attr_setsigmask_np.3:102
690 #: build/C/man3/pthread_getattr_default_np.3:93
692 msgid "Thread safety"
693 msgstr "Thread safety"
696 #: build/C/man3/getcontext.3:167 build/C/man3/makecontext.3:116
698 msgid "MT-Safe race:ucp"
699 msgstr "MT-Safe race:ucp"
702 #: build/C/man3/getcontext.3:169 build/C/man3/makecontext.3:121
703 #: build/C/man3/pthread_attr_init.3:94
704 #: build/C/man3/pthread_attr_setaffinity_np.3:122
705 #: build/C/man3/pthread_attr_setdetachstate.3:100
706 #: build/C/man3/pthread_attr_setguardsize.3:119
707 #: build/C/man3/pthread_attr_setinheritsched.3:123
708 #: build/C/man3/pthread_attr_setschedparam.3:120
709 #: build/C/man3/pthread_attr_setschedpolicy.3:113
710 #: build/C/man3/pthread_attr_setscope.3:132
711 #: build/C/man3/pthread_attr_setstack.3:125
712 #: build/C/man3/pthread_attr_setstackaddr.3:96
713 #: build/C/man3/pthread_attr_setstacksize.3:96
714 #: build/C/man3/pthread_cancel.3:138 build/C/man3/pthread_cleanup_push.3:141
715 #: build/C/man3/pthread_cleanup_push_defer_np.3:114
716 #: build/C/man3/pthread_create.3:166 build/C/man3/pthread_detach.3:77
717 #: build/C/man3/pthread_equal.3:59 build/C/man3/pthread_exit.3:87
718 #: build/C/man3/pthread_getattr_np.3:112
719 #: build/C/man3/pthread_getcpuclockid.3:80 build/C/man3/pthread_join.3:111
720 #: build/C/man3/pthread_kill.3:84
721 #: build/C/man3/pthread_kill_other_threads_np.3:59
722 #: build/C/man3/pthread_rwlockattr_setkind_np.3:140
723 #: build/C/man3/pthread_self.3:62 build/C/man3/pthread_setaffinity_np.3:130
724 #: build/C/man3/pthread_setcancelstate.3:142
725 #: build/C/man3/pthread_setconcurrency.3:96
726 #: build/C/man3/pthread_setname_np.3:116
727 #: build/C/man3/pthread_setschedparam.3:154
728 #: build/C/man3/pthread_setschedprio.3:95 build/C/man3/pthread_sigmask.3:81
729 #: build/C/man3/pthread_sigqueue.3:106 build/C/man3/pthread_testcancel.3:70
730 #: build/C/man3/pthread_tryjoin_np.3:138 build/C/man3/pthread_yield.3:65
731 #: build/C/man3/pthread_atfork.3:86
732 #: build/C/man3/pthread_attr_setsigmask_np.3:105
733 #: build/C/man3/pthread_getattr_default_np.3:96
734 #: build/C/man3/pthread_mutex_consistent.3:72
735 #: build/C/man3/pthread_mutexattr_getpshared.3:92
736 #: build/C/man3/pthread_mutexattr_init.3:59
737 #: build/C/man3/pthread_mutexattr_setrobust.3:150
738 #: build/C/man3/pthread_spin_init.3:130 build/C/man3/pthread_spin_lock.3:109
739 #: build/C/man7/nptl.7:114
741 msgid "CONFORMING TO"
745 #: build/C/man3/getcontext.3:175
747 "SUSv2, POSIX.1-2001. POSIX.1-2008 removes the specification of "
748 "B<getcontext>(), citing portability issues, and recommending that "
749 "applications be rewritten to use POSIX threads instead."
751 "SUSv2, POSIX.1-2001. POSIX.1-2008 では、移植性の問題から B<getcontext>() の"
752 "仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直"
756 #: build/C/man3/getcontext.3:175 build/C/man3/makecontext.3:129
757 #: build/C/man3/pthread_attr_init.3:96
758 #: build/C/man3/pthread_attr_setaffinity_np.3:125
759 #: build/C/man3/pthread_attr_setdetachstate.3:102
760 #: build/C/man3/pthread_attr_setguardsize.3:121
761 #: build/C/man3/pthread_attr_setschedparam.3:122
762 #: build/C/man3/pthread_attr_setscope.3:134
763 #: build/C/man3/pthread_attr_setstack.3:127
764 #: build/C/man3/pthread_attr_setstackaddr.3:99
765 #: build/C/man3/pthread_attr_setstacksize.3:98
766 #: build/C/man3/pthread_cancel.3:140 build/C/man3/pthread_cleanup_push.3:143
767 #: build/C/man3/pthread_create.3:168 build/C/man3/pthread_detach.3:79
768 #: build/C/man3/pthread_equal.3:61 build/C/man3/pthread_exit.3:89
769 #: build/C/man3/pthread_getcpuclockid.3:82 build/C/man3/pthread_join.3:113
770 #: build/C/man3/pthread_kill.3:86
771 #: build/C/man3/pthread_kill_other_threads_np.3:62
772 #: build/C/man3/pthread_self.3:64 build/C/man3/pthread_setaffinity_np.3:133
773 #: build/C/man3/pthread_setcancelstate.3:144
774 #: build/C/man3/pthread_setconcurrency.3:98
775 #: build/C/man3/pthread_setname_np.3:119
776 #: build/C/man3/pthread_setschedparam.3:156
777 #: build/C/man3/pthread_setschedprio.3:97 build/C/man3/pthread_sigmask.3:83
778 #: build/C/man3/pthread_sigqueue.3:108 build/C/man3/pthread_yield.3:71
779 #: build/C/man3/pthread_atfork.3:88
780 #: build/C/man3/pthread_attr_setsigmask_np.3:108
781 #: build/C/man3/pthread_mutex_consistent.3:74
782 #: build/C/man3/pthread_mutexattr_init.3:61
783 #: build/C/man3/pthread_mutexattr_setrobust.3:152
784 #: build/C/man3/pthread_spin_init.3:135 build/C/man3/pthread_spin_lock.3:111
785 #: build/C/man7/nptl.7:117
791 #: build/C/man3/getcontext.3:192
793 "The earliest incarnation of this mechanism was the B<setjmp>(3)/"
794 "B<longjmp>(3) mechanism. Since that does not define the handling of the "
795 "signal context, the next stage was the B<sigsetjmp>(3)/B<siglongjmp>(3) "
796 "pair. The present mechanism gives much more control. On the other hand, "
797 "there is no easy way to detect whether a return from B<getcontext>() is "
798 "from the first call, or via a B<setcontext>() call. The user has to invent "
799 "their own bookkeeping device, and a register variable won't do since "
800 "registers are restored."
802 "このメカニズムの最古の実装は、 B<setjmp>(3)/B<longjmp>(3) 機構であった。 こ"
803 "れらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階で"
804 "は B<sigsetjmp>(3)/B<siglongjmp>(3) のペアが現われた。 現在の機構ではずっと"
805 "細かな制御ができる。 一方 B<getcontext>() から返ったとき、 これが最初の呼び"
806 "出しであったか、 それとも B<setcontext>() 呼び出しからのものであるかを 区別"
807 "する容易な方法がなくなってしまった。 ユーザーは「しおり」機構を自分で作らなけ"
808 "ればならない。 レジスター変数は (レジスターはリストアされてしまうので) これを"
812 #: build/C/man3/getcontext.3:203
814 "When a signal occurs, the current user context is saved and a new context is "
815 "created by the kernel for the signal handler. Do not leave the handler "
816 "using B<longjmp>(3): it is undefined what would happen with contexts. Use "
817 "B<siglongjmp>(3) or B<setcontext>() instead."
819 "シグナルが発生すると、 現在のユーザーコンテキストは保存され、 シグナルハンド"
820 "ラー用のコンテキストがカーネルによって生成される。 今後はハンドラーに "
821 "B<longjmp>(3) を使わせないこと: この関数のコンテキスト下での動作は定義されて"
822 "いない。 代わりに B<siglongjmp>(3) か B<setcontext>() を使うこと。"
825 #: build/C/man3/getcontext.3:203 build/C/man3/makecontext.3:235
826 #: build/C/man3/pthread_attr_init.3:312
827 #: build/C/man3/pthread_attr_setaffinity_np.3:132
828 #: build/C/man3/pthread_attr_setdetachstate.3:124
829 #: build/C/man3/pthread_attr_setguardsize.3:171
830 #: build/C/man3/pthread_attr_setinheritsched.3:144
831 #: build/C/man3/pthread_attr_setschedparam.3:129
832 #: build/C/man3/pthread_attr_setschedpolicy.3:118
833 #: build/C/man3/pthread_attr_setscope.3:145
834 #: build/C/man3/pthread_attr_setstack.3:168
835 #: build/C/man3/pthread_attr_setstackaddr.3:123
836 #: build/C/man3/pthread_attr_setstacksize.3:124
837 #: build/C/man3/pthread_cancel.3:239 build/C/man3/pthread_cleanup_push.3:329
838 #: build/C/man3/pthread_cleanup_push_defer_np.3:117
839 #: build/C/man3/pthread_create.3:405 build/C/man3/pthread_detach.3:110
840 #: build/C/man3/pthread_equal.3:68 build/C/man3/pthread_exit.3:117
841 #: build/C/man3/pthread_getattr_np.3:359
842 #: build/C/man3/pthread_getcpuclockid.3:186 build/C/man3/pthread_join.3:143
843 #: build/C/man3/pthread_kill.3:116
844 #: build/C/man3/pthread_kill_other_threads_np.3:78
845 #: build/C/man3/pthread_rwlockattr_setkind_np.3:143
846 #: build/C/man3/pthread_self.3:88 build/C/man3/pthread_setaffinity_np.3:215
847 #: build/C/man3/pthread_setcancelstate.3:208
848 #: build/C/man3/pthread_setconcurrency.3:113
849 #: build/C/man3/pthread_setname_np.3:214
850 #: build/C/man3/pthread_setschedparam.3:446
851 #: build/C/man3/pthread_setschedprio.3:103 build/C/man3/pthread_sigmask.3:167
852 #: build/C/man3/pthread_sigqueue.3:118 build/C/man3/pthread_testcancel.3:75
853 #: build/C/man3/pthread_tryjoin_np.3:175 build/C/man3/pthread_yield.3:85
854 #: build/C/man3/pthread_atfork.3:122
855 #: build/C/man3/pthread_attr_setsigmask_np.3:142
856 #: build/C/man3/pthread_getattr_default_np.3:196
857 #: build/C/man3/pthread_mutex_consistent.3:99
858 #: build/C/man3/pthread_mutexattr_getpshared.3:94
859 #: build/C/man3/pthread_mutexattr_init.3:64
860 #: build/C/man3/pthread_mutexattr_setrobust.3:276
861 #: build/C/man3/pthread_spin_init.3:162 build/C/man3/pthread_spin_lock.3:117
862 #: build/C/man7/pthreads.7:916 build/C/man7/attributes.7:882
863 #: build/C/man7/nptl.7:128
869 #: build/C/man3/getcontext.3:211
871 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), "
872 "B<makecontext>(3), B<sigsetjmp>(3), B<signal>(7)"
873 msgstr "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), B<makecontext>(3), B<sigsetjmp>(3), B<signal>(7)"
876 #: build/C/man3/getcontext.3:211 build/C/man3/makecontext.3:241
877 #: build/C/man3/pthread_attr_init.3:330
878 #: build/C/man3/pthread_attr_setaffinity_np.3:138
879 #: build/C/man3/pthread_attr_setdetachstate.3:130
880 #: build/C/man3/pthread_attr_setguardsize.3:179
881 #: build/C/man3/pthread_attr_setinheritsched.3:156
882 #: build/C/man3/pthread_attr_setschedparam.3:141
883 #: build/C/man3/pthread_attr_setschedpolicy.3:129
884 #: build/C/man3/pthread_attr_setscope.3:155
885 #: build/C/man3/pthread_attr_setstack.3:180
886 #: build/C/man3/pthread_attr_setstackaddr.3:129
887 #: build/C/man3/pthread_attr_setstacksize.3:131
888 #: build/C/man3/pthread_cancel.3:251 build/C/man3/pthread_cleanup_push.3:335
889 #: build/C/man3/pthread_cleanup_push_defer_np.3:123
890 #: build/C/man3/pthread_create.3:419 build/C/man3/pthread_detach.3:117
891 #: build/C/man3/pthread_equal.3:72 build/C/man3/pthread_exit.3:121
892 #: build/C/man3/pthread_getattr_np.3:375
893 #: build/C/man3/pthread_getcpuclockid.3:194 build/C/man3/pthread_join.3:150
894 #: build/C/man3/pthread_kill.3:125
895 #: build/C/man3/pthread_kill_other_threads_np.3:84
896 #: build/C/man3/pthread_rwlockattr_setkind_np.3:145
897 #: build/C/man3/pthread_self.3:92 build/C/man3/pthread_setaffinity_np.3:224
898 #: build/C/man3/pthread_setcancelstate.3:213
899 #: build/C/man3/pthread_setconcurrency.3:116
900 #: build/C/man3/pthread_setname_np.3:220
901 #: build/C/man3/pthread_setschedparam.3:460
902 #: build/C/man3/pthread_setschedprio.3:117 build/C/man3/pthread_sigmask.3:177
903 #: build/C/man3/pthread_sigqueue.3:126 build/C/man3/pthread_testcancel.3:80
904 #: build/C/man3/pthread_tryjoin_np.3:180 build/C/man3/pthread_yield.3:90
905 #: build/C/man3/pthread_atfork.3:126
906 #: build/C/man3/pthread_attr_setsigmask_np.3:148
907 #: build/C/man3/pthread_getattr_default_np.3:212
908 #: build/C/man3/pthread_mutex_consistent.3:107
909 #: build/C/man3/pthread_mutexattr_getpshared.3:99
910 #: build/C/man3/pthread_mutexattr_init.3:71
911 #: build/C/man3/pthread_mutexattr_setrobust.3:285
912 #: build/C/man3/pthread_spin_init.3:170 build/C/man3/pthread_spin_lock.3:124
913 #: build/C/man7/pthreads.7:958 build/C/man7/attributes.7:885
914 #: build/C/man7/nptl.7:133
920 #: build/C/man3/getcontext.3:219 build/C/man3/makecontext.3:249
921 #: build/C/man3/pthread_attr_init.3:338
922 #: build/C/man3/pthread_attr_setaffinity_np.3:146
923 #: build/C/man3/pthread_attr_setdetachstate.3:138
924 #: build/C/man3/pthread_attr_setguardsize.3:187
925 #: build/C/man3/pthread_attr_setinheritsched.3:164
926 #: build/C/man3/pthread_attr_setschedparam.3:149
927 #: build/C/man3/pthread_attr_setschedpolicy.3:137
928 #: build/C/man3/pthread_attr_setscope.3:163
929 #: build/C/man3/pthread_attr_setstack.3:188
930 #: build/C/man3/pthread_attr_setstackaddr.3:137
931 #: build/C/man3/pthread_attr_setstacksize.3:139
932 #: build/C/man3/pthread_cancel.3:259 build/C/man3/pthread_cleanup_push.3:343
933 #: build/C/man3/pthread_cleanup_push_defer_np.3:131
934 #: build/C/man3/pthread_create.3:427 build/C/man3/pthread_detach.3:125
935 #: build/C/man3/pthread_equal.3:80 build/C/man3/pthread_exit.3:129
936 #: build/C/man3/pthread_getattr_np.3:383
937 #: build/C/man3/pthread_getcpuclockid.3:202 build/C/man3/pthread_join.3:158
938 #: build/C/man3/pthread_kill.3:133
939 #: build/C/man3/pthread_kill_other_threads_np.3:92
940 #: build/C/man3/pthread_rwlockattr_setkind_np.3:153
941 #: build/C/man3/pthread_self.3:100 build/C/man3/pthread_setaffinity_np.3:232
942 #: build/C/man3/pthread_setcancelstate.3:221
943 #: build/C/man3/pthread_setconcurrency.3:124
944 #: build/C/man3/pthread_setname_np.3:228
945 #: build/C/man3/pthread_setschedparam.3:468
946 #: build/C/man3/pthread_setschedprio.3:125 build/C/man3/pthread_sigmask.3:185
947 #: build/C/man3/pthread_sigqueue.3:134 build/C/man3/pthread_testcancel.3:88
948 #: build/C/man3/pthread_tryjoin_np.3:188 build/C/man3/pthread_yield.3:98
949 #: build/C/man3/pthread_atfork.3:134
950 #: build/C/man3/pthread_attr_setsigmask_np.3:156
951 #: build/C/man3/pthread_getattr_default_np.3:220
952 #: build/C/man3/pthread_mutex_consistent.3:115
953 #: build/C/man3/pthread_mutexattr_getpshared.3:107
954 #: build/C/man3/pthread_mutexattr_init.3:79
955 #: build/C/man3/pthread_mutexattr_setrobust.3:293
956 #: build/C/man3/pthread_spin_init.3:178 build/C/man3/pthread_spin_lock.3:132
957 #: build/C/man7/pthreads.7:966 build/C/man7/attributes.7:893
958 #: build/C/man7/nptl.7:141
960 "This page is part of release 5.10 of the Linux I<man-pages> project. A "
961 "description of the project, information about reporting bugs, and the latest "
962 "version of this page, can be found at \\%https://www.kernel.org/doc/man-"
964 msgstr "この man ページは Linux I<man-pages> プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \\%https://www.kernel.org/doc/man-pages/ に書かれている。"
967 #: build/C/man3/makecontext.3:28
973 #: build/C/man3/makecontext.3:28
979 #: build/C/man3/makecontext.3:31
980 msgid "makecontext, swapcontext - manipulate user context"
981 msgstr "makecontext, swapcontext - ユーザーコンテキストを操作する"
984 #: build/C/man3/makecontext.3:36
986 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
989 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
993 #: build/C/man3/makecontext.3:38
995 "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
997 "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
1000 #: build/C/man3/makecontext.3:53
1003 #| "In a System V-like environment, one has the type I<ucontext_t> defined in "
1004 #| "I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(3), "
1005 #| "B<setcontext>(3), B<makecontext>() and B<swapcontext>() that allow user-"
1006 #| "level context switching between multiple threads of control within a "
1009 "In a System V-like environment, one has the type I<ucontext_t> (defined in "
1010 "I<E<lt>ucontext.hE<gt>> and described in B<getcontext>(3)) and the four "
1011 "functions B<getcontext>(3), B<setcontext>(3), B<makecontext>(), and "
1012 "B<swapcontext>() that allow user-level context switching between multiple "
1013 "threads of control within a process."
1015 "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型"
1016 "と、 B<getcontext>(3), B<setcontext>(3), B<makecontext>(), B<swapcontext>() "
1017 "という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内"
1018 "部で制御下にある複数のスレッド間で、 ユーザーレベルのコンテキスト切替えができ"
1022 #: build/C/man3/makecontext.3:65
1024 "The B<makecontext>() function modifies the context pointed to by I<ucp> "
1025 "(which was obtained from a call to B<getcontext>(3)). Before invoking "
1026 "B<makecontext>(), the caller must allocate a new stack for this context and "
1027 "assign its address to I<ucp-E<gt>uc_stack>, and define a successor context "
1028 "and assign its address to I<ucp-E<gt>uc_link>."
1030 "B<makecontext>() 関数は、ポインター I<ucp> が指すコンテキストを変更する "
1031 "(I<ucp> は以前の B<getcontext>(3) 呼び出しで得られたものである)。 "
1032 "B<makecontext>() を起動する前には、呼び出し者は、このコンテキスト用に 新しい"
1033 "スタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継の"
1034 "コンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければな"
1038 #: build/C/man3/makecontext.3:79
1040 "When this context is later activated (using B<setcontext>(3) or "
1041 "B<swapcontext>()) the function I<func> is called, and passed the series of "
1042 "integer (I<int>) arguments that follow I<argc>; the caller must specify the "
1043 "number of these arguments in I<argc>. When this function returns, the "
1044 "successor context is activated. If the successor context pointer is NULL, "
1047 "このコンテキストが将来 (B<setcontext>(3) または B<swapcontext>() によっ"
1048 "て) 有効にされると、関数 I<func> が呼ばれ、 引数として I<argc> 以降の整数 "
1049 "(I<int>) 引数の列が渡される。 呼び出し者は I<argc> にこれらの引数の個数"
1050 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
1051 "る。 後継コンテキストのポインターが NULL の場合、そのスレッドが終了する。"
1054 #: build/C/man3/makecontext.3:85
1056 "The B<swapcontext>() function saves the current context in the structure "
1057 "pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
1059 "B<swapcontext>() 関数は現在のコンテキストを ポインター I<oucp> が指す構造体"
1060 "に保存し、 ポインター I<ucp> が指すコンテキストを有効にする。"
1063 #: build/C/man3/makecontext.3:97
1065 "When successful, B<swapcontext>() does not return. (But we may return "
1066 "later, in case I<oucp> is activated, in which case it looks like "
1067 "B<swapcontext>() returns 0.) On error, B<swapcontext>() returns -1 and "
1068 "sets I<errno> appropriately."
1070 "成功すると、 B<swapcontext>() は返らない (しかし後に I<oucp> が有効になった"
1071 "場合には返ることがある。 このときには B<swapcontext>() は 0 を返すように見え"
1072 "る。) 失敗すると、 B<swapcontext>() は -1 を返し、 I<errno> をエラーに応じ"
1076 #: build/C/man3/makecontext.3:98 build/C/man3/pthread_attr_setaffinity_np.3:102
1077 #: build/C/man3/pthread_getattr_np.3:77 build/C/man3/pthread_atfork.3:83
1078 #: build/C/man3/pthread_attr_setsigmask_np.3:85
1079 #: build/C/man3/pthread_getattr_default_np.3:74
1080 #: build/C/man3/pthread_spin_init.3:125
1086 #: build/C/man3/makecontext.3:101
1087 msgid "Insufficient stack space left."
1088 msgstr "スタックに割り当てる空間が残っていない。"
1091 #: build/C/man3/makecontext.3:101
1092 #: build/C/man3/pthread_attr_setaffinity_np.3:106
1093 #: build/C/man3/pthread_attr_setguardsize.3:104
1094 #: build/C/man3/pthread_attr_setstack.3:110
1095 #: build/C/man3/pthread_attr_setstackaddr.3:81
1096 #: build/C/man3/pthread_attr_setstacksize.3:81
1097 #: build/C/man3/pthread_getattr_np.3:96 build/C/man3/pthread_getcpuclockid.3:66
1098 #: build/C/man3/pthread_rwlockattr_setkind_np.3:134
1099 #: build/C/man3/pthread_setaffinity_np.3:115
1100 #: build/C/man3/pthread_setconcurrency.3:81
1101 #: build/C/man3/pthread_setname_np.3:100 build/C/man3/pthread_setschedprio.3:81
1102 #: build/C/man3/pthread_sigqueue.3:90 build/C/man3/pthread_tryjoin_np.3:121
1103 #: build/C/man3/pthread_attr_setsigmask_np.3:89
1104 #: build/C/man3/pthread_getattr_default_np.3:79
1105 #: build/C/man3/pthread_mutex_consistent.3:69
1106 #: build/C/man3/pthread_mutexattr_setrobust.3:145
1107 #: build/C/man3/pthread_spin_init.3:128 build/C/man3/pthread_spin_lock.3:107
1113 #: build/C/man3/makecontext.3:106
1115 "B<makecontext>() and B<swapcontext>() are provided in glibc since version "
1118 "B<makecontext>() と B<swapcontext>() は、バージョン 2.1 以降の glibc で提供"
1122 #: build/C/man3/makecontext.3:116
1124 msgid "B<makecontext>()"
1125 msgstr "B<makecontext>()"
1128 #: build/C/man3/makecontext.3:119
1130 msgid "B<swapcontext>()"
1131 msgstr "B<swapcontext>()"
1134 #: build/C/man3/makecontext.3:119
1136 msgid "MT-Safe race:oucp race:ucp"
1137 msgstr "MT-Safe race:oucp race:ucp"
1140 #: build/C/man3/makecontext.3:129
1142 "SUSv2, POSIX.1-2001. POSIX.1-2008 removes the specifications of "
1143 "B<makecontext>() and B<swapcontext>(), citing portability issues, and "
1144 "recommending that applications be rewritten to use POSIX threads instead."
1146 "SUSv2, POSIX.1-2001. POSIX.1-2008 では、移植性の問題から B<makecontext>() "
1147 "と B<swapcontext>() の仕様が削除されている。 代わりに、アプリケーションを "
1148 "POSIX スレッドを使って書き直すことが 推奨されている。"
1151 #: build/C/man3/makecontext.3:137
1153 "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), "
1154 "namely, this struct contains the start and length of a memory area to be "
1155 "used as the stack, regardless of the direction of growth of the stack. "
1156 "Thus, it is not necessary for the user program to worry about this direction."
1158 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2) の場合と同じである。 すなわ"
1159 "ちこの構造体には、 スタックとして用いられるメモリー領域の開始アドレスと長さが"
1160 "含まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
1161 "て、ユーザープログラムはこの件については心配しなくてよい。"
1164 #: build/C/man3/makecontext.3:153
1166 "On architectures where I<int> and pointer types are the same size (e.g., "
1167 "x86-32, where both types are 32 bits), you may be able to get away with "
1168 "passing pointers as arguments to B<makecontext>() following I<argc>. "
1169 "However, doing this is not guaranteed to be portable, is undefined according "
1170 "to the standards, and won't work on architectures where pointers are larger "
1171 "than I<int>s. Nevertheless, starting with version 2.8, glibc makes some "
1172 "changes to B<makecontext>(), to permit this on some 64-bit architectures (e."
1175 "I<int> とポインター型が同じ大きさであるアーキテクチャーでは (x86-32 はその例"
1176 "であり、両方の型とも 32 ビットである)、 B<makecontext>() の I<argc> 以降の引"
1177 "数としてポインターを渡してもうまく動くかもしれない。 しかしながら、このよう"
1178 "にすると、移植性は保証されず、 標準に従えば動作は未定義であり、ポインターが "
1179 "I<int> よりも大きいアーキテクチャーでは正しく動作しないことだろう。 それにも"
1180 "関わらず、バージョン 2.8 以降の glibc では、 B<makecontext>() に変更が行わ"
1181 "れ、(x86-64 などの) いくつかの 64 ビットアーキテクチャーで 引数としてポイン"
1182 "ターを渡すことができるようになっている。"
1185 #: build/C/man3/makecontext.3:153 build/C/man3/pthread_attr_init.3:102
1186 #: build/C/man3/pthread_attr_setdetachstate.3:121
1187 #: build/C/man3/pthread_attr_setguardsize.3:168
1188 #: build/C/man3/pthread_attr_setinheritsched.3:141
1189 #: build/C/man3/pthread_attr_setschedparam.3:126
1190 #: build/C/man3/pthread_attr_setschedpolicy.3:115
1191 #: build/C/man3/pthread_attr_setstack.3:165
1192 #: build/C/man3/pthread_attr_setstacksize.3:121
1193 #: build/C/man3/pthread_cancel.3:148 build/C/man3/pthread_cleanup_push.3:169
1194 #: build/C/man3/pthread_create.3:239 build/C/man3/pthread_detach.3:106
1195 #: build/C/man3/pthread_getattr_np.3:115
1196 #: build/C/man3/pthread_getcpuclockid.3:93 build/C/man3/pthread_join.3:140
1197 #: build/C/man3/pthread_setaffinity_np.3:163
1198 #: build/C/man3/pthread_setcancelstate.3:205
1199 #: build/C/man3/pthread_setname_np.3:129
1200 #: build/C/man3/pthread_setschedparam.3:162 build/C/man3/pthread_sigmask.3:93
1201 #: build/C/man3/pthread_testcancel.3:72 build/C/man3/pthread_tryjoin_np.3:141
1202 #: build/C/man3/pthread_getattr_default_np.3:99
1203 #: build/C/man3/pthread_mutex_consistent.3:96
1204 #: build/C/man3/pthread_mutexattr_setrobust.3:188
1210 #: build/C/man3/makecontext.3:160
1212 "The example program below demonstrates the use of B<getcontext>(3), "
1213 "B<makecontext>(), and B<swapcontext>(). Running the program produces the "
1216 "以下のサンプルプログラムは、 B<getcontext>(3), B<makecontext>(), "
1217 "B<swapcontext>() の使用方法の例を示すものである。 このプログラムを実行する"
1221 #: build/C/man3/makecontext.3:172
1225 "main: swapcontext(&uctx_main, &uctx_func2)\n"
1227 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
1229 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
1230 "func2: returning\n"
1231 "func1: returning\n"
1235 "main: swapcontext(&uctx_main, &uctx_func2)\n"
1237 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
1239 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
1240 "func2: returning\n"
1241 "func1: returning\n"
1245 #: build/C/man3/makecontext.3:174 build/C/man3/pthread_attr_init.3:163
1246 #: build/C/man3/pthread_cancel.3:164 build/C/man3/pthread_cleanup_push.3:245
1247 #: build/C/man3/pthread_create.3:278 build/C/man3/pthread_getattr_np.3:193
1248 #: build/C/man3/pthread_getcpuclockid.3:111
1249 #: build/C/man3/pthread_setname_np.3:154
1250 #: build/C/man3/pthread_setschedparam.3:237 build/C/man3/pthread_sigmask.3:111
1251 #: build/C/man3/pthread_getattr_default_np.3:117
1252 #: build/C/man3/pthread_mutexattr_setrobust.3:211
1254 msgid "Program source"
1258 #: build/C/man3/makecontext.3:180
1261 "#include E<lt>ucontext.hE<gt>\n"
1262 "#include E<lt>stdio.hE<gt>\n"
1263 "#include E<lt>stdlib.hE<gt>\n"
1265 "#include E<lt>ucontext.hE<gt>\n"
1266 "#include E<lt>stdio.hE<gt>\n"
1267 "#include E<lt>stdlib.hE<gt>\n"
1270 #: build/C/man3/makecontext.3:182
1272 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
1273 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
1276 #: build/C/man3/makecontext.3:185
1279 "#define handle_error(msg) \\e\n"
1280 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1282 "#define handle_error(msg) \\e\n"
1283 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1286 #: build/C/man3/makecontext.3:195
1292 " printf(\"func1: started\\en\");\n"
1293 " printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
1294 " if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
1295 " handle_error(\"swapcontext\");\n"
1296 " printf(\"func1: returning\\en\");\n"
1302 " printf(\"func1: started\\en\");\n"
1303 " printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
1304 " if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
1305 " handle_error(\"swapcontext\");\n"
1306 " printf(\"func1: returning\\en\");\n"
1310 #: build/C/man3/makecontext.3:205
1316 " printf(\"func2: started\\en\");\n"
1317 " printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1318 " if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1319 " handle_error(\"swapcontext\");\n"
1320 " printf(\"func2: returning\\en\");\n"
1326 " printf(\"func2: started\\en\");\n"
1327 " printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
1328 " if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
1329 " handle_error(\"swapcontext\");\n"
1330 " printf(\"func2: returning\\en\");\n"
1334 #: build/C/man3/makecontext.3:211
1338 "main(int argc, char *argv[])\n"
1340 " char func1_stack[16384];\n"
1341 " char func2_stack[16384];\n"
1344 "main(int argc, char *argv[])\n"
1346 " char func1_stack[16384];\n"
1347 " char func2_stack[16384];\n"
1350 #: build/C/man3/makecontext.3:218
1353 " if (getcontext(&uctx_func1) == -1)\n"
1354 " handle_error(\"getcontext\");\n"
1355 " uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1356 " uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1357 " uctx_func1.uc_link = &uctx_main;\n"
1358 " makecontext(&uctx_func1, func1, 0);\n"
1360 " if (getcontext(&uctx_func1) == -1)\n"
1361 " handle_error(\"getcontext\");\n"
1362 " uctx_func1.uc_stack.ss_sp = func1_stack;\n"
1363 " uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
1364 " uctx_func1.uc_link = &uctx_main;\n"
1365 " makecontext(&uctx_func1, func1, 0);\n"
1368 #: build/C/man3/makecontext.3:226
1371 " if (getcontext(&uctx_func2) == -1)\n"
1372 " handle_error(\"getcontext\");\n"
1373 " uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1374 " uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1375 " /* Successor context is f1(), unless argc E<gt> 1 */\n"
1376 " uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1377 " makecontext(&uctx_func2, func2, 0);\n"
1379 " if (getcontext(&uctx_func2) == -1)\n"
1380 " handle_error(\"getcontext\");\n"
1381 " uctx_func2.uc_stack.ss_sp = func2_stack;\n"
1382 " uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
1383 " /* Successor context is f1(), unless argc E<gt> 1 */\n"
1384 " uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
1385 " makecontext(&uctx_func2, func2, 0);\n"
1388 #: build/C/man3/makecontext.3:230
1391 " printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1392 " if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1393 " handle_error(\"swapcontext\");\n"
1395 " printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1396 " if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1397 " handle_error(\"swapcontext\");\n"
1400 #: build/C/man3/makecontext.3:234
1403 " printf(\"main: exiting\\en\");\n"
1404 " exit(EXIT_SUCCESS);\n"
1407 " printf(\"main: exiting\\en\");\n"
1408 " exit(EXIT_SUCCESS);\n"
1412 #: build/C/man3/makecontext.3:241
1414 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1417 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1421 #: build/C/man3/pthread_attr_init.3:26
1423 msgid "PTHREAD_ATTR_INIT"
1424 msgstr "PTHREAD_ATTR_INIT"
1427 #: build/C/man3/pthread_attr_init.3:26 build/C/man3/pthread_create.3:26
1428 #: build/C/man3/pthread_getattr_np.3:26 build/C/man3/pthread_getcpuclockid.3:26
1429 #: build/C/man3/pthread_setaffinity_np.3:26
1430 #: build/C/man3/pthread_setname_np.3:26 build/C/man3/pthread_sigmask.3:26
1431 #: build/C/man3/pthread_attr_setsigmask_np.3:26
1437 #: build/C/man3/pthread_attr_init.3:30
1439 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1442 "pthread_attr_init, pthread_attr_destroy - \n"
1443 "スレッド属性オブジェクトの初期化と破棄を行う"
1446 #: build/C/man3/pthread_attr_init.3:33
1447 #: build/C/man3/pthread_attr_setdetachstate.3:33
1448 #: build/C/man3/pthread_attr_setguardsize.3:33
1449 #: build/C/man3/pthread_attr_setinheritsched.3:33
1450 #: build/C/man3/pthread_attr_setschedparam.3:33
1451 #: build/C/man3/pthread_attr_setschedpolicy.3:33
1452 #: build/C/man3/pthread_attr_setscope.3:33
1453 #: build/C/man3/pthread_attr_setstack.3:33
1454 #: build/C/man3/pthread_attr_setstackaddr.3:33
1455 #: build/C/man3/pthread_attr_setstacksize.3:33 build/C/man3/pthread_cancel.3:32
1456 #: build/C/man3/pthread_cleanup_push.3:33
1457 #: build/C/man3/pthread_cleanup_push_defer_np.3:33
1458 #: build/C/man3/pthread_create.3:32 build/C/man3/pthread_detach.3:32
1459 #: build/C/man3/pthread_equal.3:32 build/C/man3/pthread_exit.3:32
1460 #: build/C/man3/pthread_join.3:32
1461 #: build/C/man3/pthread_kill_other_threads_np.3:32
1462 #: build/C/man3/pthread_rwlockattr_setkind_np.3:32
1463 #: build/C/man3/pthread_self.3:32 build/C/man3/pthread_setcancelstate.3:33
1464 #: build/C/man3/pthread_setconcurrency.3:32
1465 #: build/C/man3/pthread_setschedparam.3:33
1466 #: build/C/man3/pthread_setschedprio.3:32 build/C/man3/pthread_testcancel.3:32
1467 #: build/C/man3/pthread_atfork.3:31 build/C/man3/pthread_mutex_consistent.3:32
1468 #: build/C/man3/pthread_mutexattr_getpshared.3:32
1469 #: build/C/man3/pthread_mutexattr_init.3:32
1470 #: build/C/man3/pthread_mutexattr_setrobust.3:33
1471 #: build/C/man3/pthread_spin_init.3:31 build/C/man3/pthread_spin_lock.3:32
1473 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1474 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1477 #: build/C/man3/pthread_attr_init.3:36
1480 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1481 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1483 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1484 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1487 #: build/C/man3/pthread_attr_init.3:38
1488 #: build/C/man3/pthread_attr_setaffinity_np.3:41
1489 #: build/C/man3/pthread_attr_setdetachstate.3:40
1490 #: build/C/man3/pthread_attr_setguardsize.3:40
1491 #: build/C/man3/pthread_attr_setinheritsched.3:40
1492 #: build/C/man3/pthread_attr_setschedparam.3:40
1493 #: build/C/man3/pthread_attr_setschedpolicy.3:40
1494 #: build/C/man3/pthread_attr_setscope.3:40
1495 #: build/C/man3/pthread_attr_setstack.3:40
1496 #: build/C/man3/pthread_attr_setstackaddr.3:40
1497 #: build/C/man3/pthread_attr_setstacksize.3:40 build/C/man3/pthread_cancel.3:36
1498 #: build/C/man3/pthread_cleanup_push.3:39 build/C/man3/pthread_equal.3:36
1499 #: build/C/man3/pthread_exit.3:36 build/C/man3/pthread_getattr_np.3:37
1500 #: build/C/man3/pthread_getcpuclockid.3:37
1501 #: build/C/man3/pthread_rwlockattr_setkind_np.3:39
1502 #: build/C/man3/pthread_self.3:36 build/C/man3/pthread_setaffinity_np.3:41
1503 #: build/C/man3/pthread_setcancelstate.3:38
1504 #: build/C/man3/pthread_setconcurrency.3:37
1505 #: build/C/man3/pthread_setschedparam.3:40
1506 #: build/C/man3/pthread_setschedprio.3:36 build/C/man3/pthread_testcancel.3:36
1507 #: build/C/man3/pthread_attr_setsigmask_np.3:41
1508 #: build/C/man3/pthread_getattr_default_np.3:38
1510 msgid "Compile and link with I<-pthread>.\n"
1511 msgstr "I<-pthread> でコンパイルしてリンクする。\n"
1514 #: build/C/man3/pthread_attr_init.3:50
1516 "The B<pthread_attr_init>() function initializes the thread attributes "
1517 "object pointed to by I<attr> with default attribute values. After this "
1518 "call, individual attributes of the object can be set using various related "
1519 "functions (listed under SEE ALSO), and then the object can be used in one or "
1520 "more B<pthread_create>(3) calls that create threads."
1522 "B<pthread_attr_init>() 関数は I<attr> が指すスレッド属性オブジェクト\n"
1523 "(thread attributes object) をデフォルトの属性値で初期化する。\n"
1524 "この呼び出しの後、オブジェクトの各属性は (関連項目に載っている) 種々の\n"
1525 "関数を使って設定することができ、このオブジェクトはスレッドの作成を行う\n"
1526 "B<pthread_create>(3) の呼び出しにおいて使用することができる (一つの\n"
1527 "オブジェクトを複数の B<pthread_create>(3) に渡してもよい)。"
1530 #: build/C/man3/pthread_attr_init.3:55
1532 "Calling B<pthread_attr_init>() on a thread attributes object that has "
1533 "already been initialized results in undefined behavior."
1535 "すでに初期化されているスレッド属性オブジェクトに対して\n"
1536 "B<pthread_attr_init>() を呼び出した場合、\n"
1537 "どのような動作になるかは不定である。"
1540 #: build/C/man3/pthread_attr_init.3:62
1542 "When a thread attributes object is no longer required, it should be "
1543 "destroyed using the B<pthread_attr_destroy>() function. Destroying a "
1544 "thread attributes object has no effect on threads that were created using "
1547 "スレッド属性オブジェクトがもはや必要なくなった際には、\n"
1548 "そのオブジェクトは B<pthread_attr_destroy>() 関数を使って破棄すべきである。\n"
1549 "スレッド属性オブジェクトを破棄しても、\n"
1550 "そのオブジェクトを使って作成されたスレッドには影響はない。"
1553 #: build/C/man3/pthread_attr_init.3:68
1555 "Once a thread attributes object has been destroyed, it can be reinitialized "
1556 "using B<pthread_attr_init>(). Any other use of a destroyed thread "
1557 "attributes object has undefined results."
1559 "いったん破棄したスレッド属性オブジェクトは、\n"
1560 "B<pthread_attr_init>() を使って再初期化することができる。\n"
1561 "破棄したスレッド属性オブジェクトをこれ以外の用途で\n"
1565 #: build/C/man3/pthread_attr_init.3:71
1566 #: build/C/man3/pthread_attr_setaffinity_np.3:79
1567 #: build/C/man3/pthread_attr_setdetachstate.3:80
1568 #: build/C/man3/pthread_attr_setguardsize.3:93
1569 #: build/C/man3/pthread_attr_setinheritsched.3:96
1570 #: build/C/man3/pthread_attr_setschedparam.3:88
1571 #: build/C/man3/pthread_attr_setschedpolicy.3:86
1572 #: build/C/man3/pthread_attr_setscope.3:106
1573 #: build/C/man3/pthread_attr_setstack.3:88
1574 #: build/C/man3/pthread_attr_setstackaddr.3:77
1575 #: build/C/man3/pthread_attr_setstacksize.3:64
1576 #: build/C/man3/pthread_setaffinity_np.3:80
1577 #: build/C/man3/pthread_setcancelstate.3:100
1578 #: build/C/man3/pthread_setname_np.3:75
1580 "On success, these functions return 0; on error, they return a nonzero error "
1583 "成功すると、これらの関数は 0 を返す。\n"
1584 "エラーの場合、0 以外のエラー番号を返す。"
1587 #: build/C/man3/pthread_attr_init.3:79
1589 "POSIX.1 documents an B<ENOMEM> error for B<pthread_attr_init>(); on Linux "
1590 "these functions always succeed (but portable and future-proof applications "
1591 "should nevertheless handle a possible error return)."
1592 msgstr "POSIX.1 では B<pthread_attr_init>() にはエラー B<ENOMEM> が記載されている。 Linux では、これらの関数は常に成功する (ただし、移植性や将来も動作することを保証したいアプリケーションでは正のエラーの返り値を処理するようにすべきである)。"
1595 #: build/C/man3/pthread_attr_init.3:91
1598 "B<pthread_attr_init>(),\n"
1599 "B<pthread_attr_destroy>()"
1601 "B<pthread_attr_init>(),\n"
1602 "B<pthread_attr_destroy>()"
1605 #: build/C/man3/pthread_attr_init.3:91
1606 #: build/C/man3/pthread_attr_setaffinity_np.3:119
1607 #: build/C/man3/pthread_attr_setdetachstate.3:98
1608 #: build/C/man3/pthread_attr_setguardsize.3:117
1609 #: build/C/man3/pthread_attr_setinheritsched.3:121
1610 #: build/C/man3/pthread_attr_setschedparam.3:118
1611 #: build/C/man3/pthread_attr_setschedpolicy.3:111
1612 #: build/C/man3/pthread_attr_setscope.3:130
1613 #: build/C/man3/pthread_attr_setstack.3:123
1614 #: build/C/man3/pthread_attr_setstackaddr.3:94
1615 #: build/C/man3/pthread_attr_setstacksize.3:94
1616 #: build/C/man3/pthread_cancel.3:135 build/C/man3/pthread_cleanup_push.3:138
1617 #: build/C/man3/pthread_create.3:163 build/C/man3/pthread_detach.3:74
1618 #: build/C/man3/pthread_equal.3:57 build/C/man3/pthread_exit.3:85
1619 #: build/C/man3/pthread_getattr_np.3:109
1620 #: build/C/man3/pthread_getcpuclockid.3:78 build/C/man3/pthread_join.3:108
1621 #: build/C/man3/pthread_kill.3:82
1622 #: build/C/man3/pthread_kill_other_threads_np.3:57
1623 #: build/C/man3/pthread_self.3:60 build/C/man3/pthread_setaffinity_np.3:128
1624 #: build/C/man3/pthread_setcancelstate.3:132
1625 #: build/C/man3/pthread_setconcurrency.3:94
1626 #: build/C/man3/pthread_setname_np.3:113
1627 #: build/C/man3/pthread_setschedparam.3:152
1628 #: build/C/man3/pthread_setschedprio.3:93 build/C/man3/pthread_sigmask.3:79
1629 #: build/C/man3/pthread_sigqueue.3:104 build/C/man3/pthread_testcancel.3:68
1630 #: build/C/man3/pthread_tryjoin_np.3:135 build/C/man3/pthread_yield.3:63
1631 #: build/C/man3/pthread_attr_setsigmask_np.3:102
1632 #: build/C/man3/pthread_getattr_default_np.3:93
1638 #: build/C/man3/pthread_attr_init.3:96
1639 #: build/C/man3/pthread_attr_setdetachstate.3:102
1640 #: build/C/man3/pthread_attr_setguardsize.3:121
1641 #: build/C/man3/pthread_attr_setinheritsched.3:125
1642 #: build/C/man3/pthread_attr_setschedparam.3:122
1643 #: build/C/man3/pthread_attr_setschedpolicy.3:115
1644 #: build/C/man3/pthread_attr_setscope.3:134
1645 #: build/C/man3/pthread_attr_setstack.3:127
1646 #: build/C/man3/pthread_attr_setstacksize.3:98
1647 #: build/C/man3/pthread_cancel.3:140 build/C/man3/pthread_cleanup_push.3:143
1648 #: build/C/man3/pthread_create.3:168 build/C/man3/pthread_detach.3:79
1649 #: build/C/man3/pthread_equal.3:61 build/C/man3/pthread_exit.3:89
1650 #: build/C/man3/pthread_getcpuclockid.3:82 build/C/man3/pthread_join.3:113
1651 #: build/C/man3/pthread_kill.3:86 build/C/man3/pthread_self.3:64
1652 #: build/C/man3/pthread_setcancelstate.3:144
1653 #: build/C/man3/pthread_setconcurrency.3:98
1654 #: build/C/man3/pthread_setschedparam.3:156
1655 #: build/C/man3/pthread_setschedprio.3:97 build/C/man3/pthread_sigmask.3:83
1656 #: build/C/man3/pthread_testcancel.3:72 build/C/man3/pthread_atfork.3:88
1657 #: build/C/man3/pthread_mutexattr_getpshared.3:94
1658 #: build/C/man3/pthread_mutexattr_init.3:61
1659 msgid "POSIX.1-2001, POSIX.1-2008."
1660 msgstr "POSIX.1-2001, POSIX.1-2008."
1663 #: build/C/man3/pthread_attr_init.3:102
1665 "The I<pthread_attr_t> type should be treated as opaque: any access to the "
1666 "object other than via pthreads functions is nonportable and produces "
1667 "undefined results."
1669 "I<pthread_attr_t> 型の内部構造は意識すべきではない。\n"
1670 "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n"
1671 "どのような結果が得られるかも分からない。"
1674 #: build/C/man3/pthread_attr_init.3:111
1676 "The program below optionally makes use of B<pthread_attr_init>() and "
1677 "various related functions to initialize a thread attributes object that is "
1678 "used to create a single thread. Once created, the thread uses the "
1679 "B<pthread_getattr_np>(3) function (a nonstandard GNU extension) to retrieve "
1680 "the thread's attributes, and then displays those attributes."
1682 "下記のプログラムは、B<pthread_attr_init>() と種々の関連関数を使って、\n"
1683 "スレッド属性オブジェクトの初期化を行い、\n"
1684 "そのオブジェクトを使ってスレッドを一つ作成する。\n"
1685 "作成されたスレッドは、作成後に B<pthread_getattr_np>(3) 関数 \n"
1686 "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n"
1690 #: build/C/man3/pthread_attr_init.3:120
1692 "If the program is run with no command-line argument, then it passes NULL as "
1693 "the I<attr> argument of B<pthread_create>(3), so that the thread is created "
1694 "with default attributes. Running the program on Linux/x86-32 with the NPTL "
1695 "threading implementation, we see the following:"
1697 "コマンドライン引数なしでプログラムを実行した場合、\n"
1698 "B<pthread_create>(3) の I<attr> 引数には NULL が渡される。\n"
1699 "この場合、スレッドはデフォルトの属性で作成される。\n"
1700 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1701 "動作させると、以下のような出力が得られる。"
1703 #. Results from glibc 2.8, SUSE 11.0; Oct 2008
1705 #: build/C/man3/pthread_attr_init.3:136
1708 "$B< ulimit -s> # No stack limit ==E<gt> default stack size is 2 MB\n"
1711 "Thread attributes:\n"
1712 " Detach state = PTHREAD_CREATE_JOINABLE\n"
1713 " Scope = PTHREAD_SCOPE_SYSTEM\n"
1714 " Inherit scheduler = PTHREAD_INHERIT_SCHED\n"
1715 " Scheduling policy = SCHED_OTHER\n"
1716 " Scheduling priority = 0\n"
1717 " Guard size = 4096 bytes\n"
1718 " Stack address = 0x40196000\n"
1719 " Stack size = 0x201000 bytes\n"
1721 "$B< ulimit -s> # No stack limit ==E<gt> default stack size is 2 MB\n"
1724 "Thread attributes:\n"
1725 " Detach state = PTHREAD_CREATE_JOINABLE\n"
1726 " Scope = PTHREAD_SCOPE_SYSTEM\n"
1727 " Inherit scheduler = PTHREAD_INHERIT_SCHED\n"
1728 " Scheduling policy = SCHED_OTHER\n"
1729 " Scheduling priority = 0\n"
1730 " Guard size = 4096 bytes\n"
1731 " Stack address = 0x40196000\n"
1732 " Stack size = 0x201000 bytes\n"
1735 #: build/C/man3/pthread_attr_init.3:146
1737 "When we supply a stack size as a command-line argument, the program "
1738 "initializes a thread attributes object, sets various attributes in that "
1739 "object, and passes a pointer to the object in the call to "
1740 "B<pthread_create>(3). Running the program on Linux/x86-32 with the NPTL "
1741 "threading implementation, we see the following:"
1743 "コマンドライン引数でスタックサイズが与えられた場合、\n"
1744 "このプログラムは、スレッド属性オブジェクトを初期化し、\n"
1745 "そのオブジェクトの各種属性を設定し、\n"
1746 "B<pthread_create>(3) の呼び出しでこのオブジェクトへのポインターを渡す。\n"
1747 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1748 "動作させると、以下のような出力が得られる。"
1750 #. Results from glibc 2.8, SUSE 11.0; Oct 2008
1752 #: build/C/man3/pthread_attr_init.3:161
1755 "$B< ./a.out 0x3000000>\n"
1756 "posix_memalign() allocated at 0x40197000\n"
1757 "Thread attributes:\n"
1758 " Detach state = PTHREAD_CREATE_DETACHED\n"
1759 " Scope = PTHREAD_SCOPE_SYSTEM\n"
1760 " Inherit scheduler = PTHREAD_EXPLICIT_SCHED\n"
1761 " Scheduling policy = SCHED_OTHER\n"
1762 " Scheduling priority = 0\n"
1763 " Guard size = 0 bytes\n"
1764 " Stack address = 0x40197000\n"
1765 " Stack size = 0x3000000 bytes\n"
1767 "$B< ./a.out 0x3000000>\n"
1768 "posix_memalign() allocated at 0x40197000\n"
1769 "Thread attributes:\n"
1770 " Detach state = PTHREAD_CREATE_DETACHED\n"
1771 " Scope = PTHREAD_SCOPE_SYSTEM\n"
1772 " Inherit scheduler = PTHREAD_EXPLICIT_SCHED\n"
1773 " Scheduling policy = SCHED_OTHER\n"
1774 " Scheduling priority = 0\n"
1775 " Guard size = 0 bytes\n"
1776 " Stack address = 0x40197000\n"
1777 " Stack size = 0x3000000 bytes\n"
1780 #: build/C/man3/pthread_attr_init.3:172 build/C/man3/pthread_getattr_np.3:202
1783 "#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */\n"
1784 "#include E<lt>pthread.hE<gt>\n"
1785 "#include E<lt>stdio.hE<gt>\n"
1786 "#include E<lt>stdlib.hE<gt>\n"
1787 "#include E<lt>unistd.hE<gt>\n"
1788 "#include E<lt>errno.hE<gt>\n"
1790 "#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */\n"
1791 "#include E<lt>pthread.hE<gt>\n"
1792 "#include E<lt>stdio.hE<gt>\n"
1793 "#include E<lt>stdlib.hE<gt>\n"
1794 "#include E<lt>unistd.hE<gt>\n"
1795 "#include E<lt>errno.hE<gt>\n"
1798 #: build/C/man3/pthread_attr_init.3:175 build/C/man3/pthread_cancel.3:175
1799 #: build/C/man3/pthread_cleanup_push.3:257 build/C/man3/pthread_create.3:291
1800 #: build/C/man3/pthread_getattr_np.3:205
1801 #: build/C/man3/pthread_getcpuclockid.3:130
1802 #: build/C/man3/pthread_setaffinity_np.3:181
1803 #: build/C/man3/pthread_setschedparam.3:250 build/C/man3/pthread_sigmask.3:125
1804 #: build/C/man3/pthread_mutexattr_setrobust.3:221
1807 "#define handle_error_en(en, msg) \\e\n"
1808 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1810 "#define handle_error_en(en, msg) \\e\n"
1811 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1814 #: build/C/man3/pthread_attr_init.3:183
1818 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1823 " struct sched_param sp;\n"
1826 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1831 " struct sched_param sp;\n"
1834 #: build/C/man3/pthread_attr_init.3:191
1837 " s = pthread_attr_getdetachstate(attr, &i);\n"
1839 " handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1840 " printf(\"%sDetach state = %s\\en\", prefix,\n"
1841 " (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1842 " (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1845 " s = pthread_attr_getdetachstate(attr, &i);\n"
1847 " handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1848 " printf(\"%sDetach state = %s\\en\", prefix,\n"
1849 " (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1850 " (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1854 #: build/C/man3/pthread_attr_init.3:199
1857 " s = pthread_attr_getscope(attr, &i);\n"
1859 " handle_error_en(s, \"pthread_attr_getscope\");\n"
1860 " printf(\"%sScope = %s\\en\", prefix,\n"
1861 " (i == PTHREAD_SCOPE_SYSTEM) ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1862 " (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1865 " s = pthread_attr_getscope(attr, &i);\n"
1867 " handle_error_en(s, \"pthread_attr_getscope\");\n"
1868 " printf(\"%sScope = %s\\en\", prefix,\n"
1869 " (i == PTHREAD_SCOPE_SYSTEM) ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1870 " (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1874 #: build/C/man3/pthread_attr_init.3:207
1877 " s = pthread_attr_getinheritsched(attr, &i);\n"
1879 " handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1880 " printf(\"%sInherit scheduler = %s\\en\", prefix,\n"
1881 " (i == PTHREAD_INHERIT_SCHED) ? \"PTHREAD_INHERIT_SCHED\" :\n"
1882 " (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1885 " s = pthread_attr_getinheritsched(attr, &i);\n"
1887 " handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1888 " printf(\"%sInherit scheduler = %s\\en\", prefix,\n"
1889 " (i == PTHREAD_INHERIT_SCHED) ? \"PTHREAD_INHERIT_SCHED\" :\n"
1890 " (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1894 #: build/C/man3/pthread_attr_init.3:216
1897 " s = pthread_attr_getschedpolicy(attr, &i);\n"
1899 " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1900 " printf(\"%sScheduling policy = %s\\en\", prefix,\n"
1901 " (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1902 " (i == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
1903 " (i == SCHED_RR) ? \"SCHED_RR\" :\n"
1906 " s = pthread_attr_getschedpolicy(attr, &i);\n"
1908 " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1909 " printf(\"%sScheduling policy = %s\\en\", prefix,\n"
1910 " (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1911 " (i == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
1912 " (i == SCHED_RR) ? \"SCHED_RR\" :\n"
1916 #: build/C/man3/pthread_attr_init.3:221
1919 " s = pthread_attr_getschedparam(attr, &sp);\n"
1921 " handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1922 " printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1924 " s = pthread_attr_getschedparam(attr, &sp);\n"
1926 " handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1927 " printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1930 #: build/C/man3/pthread_attr_init.3:226
1933 " s = pthread_attr_getguardsize(attr, &v);\n"
1935 " handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1936 " printf(\"%sGuard size = %zu bytes\\en\", prefix, v);\n"
1938 " s = pthread_attr_getguardsize(attr, &v);\n"
1940 " handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1941 " printf(\"%sGuard size = %zu bytes\\en\", prefix, v);\n"
1944 #: build/C/man3/pthread_attr_init.3:233
1947 " s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1949 " handle_error_en(s, \"pthread_attr_getstack\");\n"
1950 " printf(\"%sStack address = %p\\en\", prefix, stkaddr);\n"
1951 " printf(\"%sStack size = %#zx bytes\\en\", prefix, v);\n"
1954 " s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1956 " handle_error_en(s, \"pthread_attr_getstack\");\n"
1957 " printf(\"%sStack address = %p\\en\", prefix, stkaddr);\n"
1958 " printf(\"%sStack size = %#zx bytes\\en\", prefix, v);\n"
1962 #: build/C/man3/pthread_attr_init.3:239
1966 "thread_start(void *arg)\n"
1969 " pthread_attr_t gattr;\n"
1972 "thread_start(void *arg)\n"
1975 " pthread_attr_t gattr;\n"
1978 #: build/C/man3/pthread_attr_init.3:243
1981 " /* pthread_getattr_np() is a non-standard GNU extension that\n"
1982 " retrieves the attributes of the thread specified in its\n"
1983 " first argument */\n"
1985 " /* pthread_getattr_np() is a non-standard GNU extension that\n"
1986 " retrieves the attributes of the thread specified in its\n"
1987 " first argument */\n"
1990 #: build/C/man3/pthread_attr_init.3:247
1993 " s = pthread_getattr_np(pthread_self(), &gattr);\n"
1995 " handle_error_en(s, \"pthread_getattr_np\");\n"
1997 " s = pthread_getattr_np(pthread_self(), &gattr);\n"
1999 " handle_error_en(s, \"pthread_getattr_np\");\n"
2002 #: build/C/man3/pthread_attr_init.3:250
2005 " printf(\"Thread attributes:\\en\");\n"
2006 " display_pthread_attr(&gattr, \"\\et\");\n"
2008 " printf(\"Thread attributes:\\en\");\n"
2009 " display_pthread_attr(&gattr, \"\\et\");\n"
2012 #: build/C/man3/pthread_attr_init.3:253 build/C/man3/pthread_getattr_np.3:254
2015 " exit(EXIT_SUCCESS); /* Terminate all threads */\n"
2018 " exit(EXIT_SUCCESS); /* Terminate all threads */\n"
2022 #: build/C/man3/pthread_attr_init.3:261
2026 "main(int argc, char *argv[])\n"
2029 " pthread_attr_t attr;\n"
2030 " pthread_attr_t *attrp; /* NULL or &attr */\n"
2034 "main(int argc, char *argv[])\n"
2037 " pthread_attr_t attr;\n"
2038 " pthread_attr_t *attrp; /* NULL or &attr */\n"
2042 #: build/C/man3/pthread_attr_init.3:263
2043 #: build/C/man3/pthread_setschedparam.3:368
2045 msgid " attrp = NULL;\n"
2046 msgstr " attrp = NULL;\n"
2049 #: build/C/man3/pthread_attr_init.3:267
2052 " /* If a command-line argument was supplied, use it to set the\n"
2053 " stack-size attribute and set a few other thread attributes,\n"
2054 " and set attrp pointing to thread attributes object */\n"
2056 " /* If a command-line argument was supplied, use it to set the\n"
2057 " stack-size attribute and set a few other thread attributes,\n"
2058 " and set attrp pointing to thread attributes object */\n"
2061 #: build/C/man3/pthread_attr_init.3:271
2064 " if (argc E<gt> 1) {\n"
2065 " size_t stack_size;\n"
2068 " if (argc E<gt> 1) {\n"
2069 " size_t stack_size;\n"
2073 #: build/C/man3/pthread_attr_init.3:273
2075 msgid " attrp = &attr;\n"
2076 msgstr " attrp = &attr;\n"
2079 #: build/C/man3/pthread_attr_init.3:277
2082 " s = pthread_attr_init(&attr);\n"
2084 " handle_error_en(s, \"pthread_attr_init\");\n"
2086 " s = pthread_attr_init(&attr);\n"
2088 " handle_error_en(s, \"pthread_attr_init\");\n"
2091 #: build/C/man3/pthread_attr_init.3:281
2094 " s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
2096 " handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
2098 " s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
2100 " handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
2103 #: build/C/man3/pthread_attr_init.3:285
2106 " s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
2108 " handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
2110 " s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
2112 " handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
2115 #: build/C/man3/pthread_attr_init.3:287
2117 msgid " stack_size = strtoul(argv[1], NULL, 0);\n"
2118 msgstr " stack_size = strtoul(argv[1], NULL, 0);\n"
2121 #: build/C/man3/pthread_attr_init.3:291
2124 " s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
2126 " handle_error_en(s, \"posix_memalign\");\n"
2128 " s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
2130 " handle_error_en(s, \"posix_memalign\");\n"
2133 #: build/C/man3/pthread_attr_init.3:293
2135 msgid " printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
2136 msgstr " printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
2139 #: build/C/man3/pthread_attr_init.3:298
2142 " s = pthread_attr_setstack(&attr, sp, stack_size);\n"
2144 " handle_error_en(s, \"pthread_attr_setstack\");\n"
2147 " s = pthread_attr_setstack(&attr, sp, stack_size);\n"
2149 " handle_error_en(s, \"pthread_attr_setstack\");\n"
2153 #: build/C/man3/pthread_attr_init.3:302 build/C/man3/pthread_getattr_np.3:349
2156 " s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
2158 " handle_error_en(s, \"pthread_create\");\n"
2160 " s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
2162 " handle_error_en(s, \"pthread_create\");\n"
2165 #: build/C/man3/pthread_attr_init.3:308 build/C/man3/pthread_getattr_np.3:355
2168 " if (attrp != NULL) {\n"
2169 " s = pthread_attr_destroy(attrp);\n"
2171 " handle_error_en(s, \"pthread_attr_destroy\");\n"
2174 " if (attrp != NULL) {\n"
2175 " s = pthread_attr_destroy(attrp);\n"
2177 " handle_error_en(s, \"pthread_attr_destroy\");\n"
2181 #: build/C/man3/pthread_attr_init.3:311 build/C/man3/pthread_getattr_np.3:358
2184 " pause(); /* Terminates when other thread calls exit() */\n"
2187 " pause(); /* Terminates when other thread calls exit() */\n"
2191 #: build/C/man3/pthread_attr_init.3:330
2193 "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), "
2194 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), "
2195 "B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), "
2196 "B<pthread_attr_setscope>(3), B<pthread_attr_setsigmask_np>(3), "
2197 "B<pthread_attr_setstack>(3), B<pthread_attr_setstackaddr>(3), "
2198 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), "
2199 "B<pthread_getattr_np>(3), B<pthread_setattr_default_np>(3), B<pthreads>(7)"
2200 msgstr "B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setdetachstate>(3), B<pthread_attr_setguardsize>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), B<pthread_attr_setsigmask_np>(3), B<pthread_attr_setstack>(3), B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthread_setattr_default_np>(3), B<pthreads>(7)"
2203 #: build/C/man3/pthread_attr_setaffinity_np.3:26
2205 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
2206 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
2209 #: build/C/man3/pthread_attr_setaffinity_np.3:26
2210 #: build/C/man3/pthread_attr_setscope.3:26
2211 #: build/C/man3/pthread_attr_setstackaddr.3:26
2212 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
2213 #: build/C/man3/pthread_exit.3:26 build/C/man3/pthread_kill.3:26
2214 #: build/C/man3/pthread_kill_other_threads_np.3:26
2215 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setconcurrency.3:25
2216 #: build/C/man3/pthread_sigqueue.3:25
2222 #: build/C/man3/pthread_attr_setaffinity_np.3:30
2224 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
2225 "affinity attribute in thread attributes object"
2227 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
2228 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
2231 #: build/C/man3/pthread_attr_setaffinity_np.3:34
2232 #: build/C/man3/pthread_getattr_np.3:33
2233 #: build/C/man3/pthread_setaffinity_np.3:34
2234 #: build/C/man3/pthread_tryjoin_np.3:34 build/C/man3/pthread_yield.3:32
2235 #: build/C/man3/pthread_attr_setsigmask_np.3:34
2236 #: build/C/man3/pthread_getattr_default_np.3:33
2239 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
2240 "B<#include E<lt>pthread.hE<gt>>\n"
2242 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
2243 "B<#include E<lt>pthread.hE<gt>>\n"
2246 #: build/C/man3/pthread_attr_setaffinity_np.3:39
2249 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
2250 "B< size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
2251 "B<int pthread_attr_getaffinity_np(const pthread_attr_t *>I<attr>B<,>\n"
2252 "B< size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
2254 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
2255 "B< size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
2256 "B<int pthread_attr_getaffinity_np(const pthread_attr_t *>I<attr>B<,>\n"
2257 "B< size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
2260 #: build/C/man3/pthread_attr_setaffinity_np.3:54
2262 "The B<pthread_attr_setaffinity_np>() function sets the CPU affinity mask "
2263 "attribute of the thread attributes object referred to by I<attr> to the "
2264 "value specified in I<cpuset>. This attribute determines the CPU affinity "
2265 "mask of a thread created using the thread attributes object I<attr>."
2267 "B<pthread_attr_setaffinity_np>() 関数は、\n"
2268 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
2269 "I<cpuset> で指定された値に設定する。\n"
2270 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2271 "作成されたスレッドの CPU affinity マスクが決定される。"
2274 #: build/C/man3/pthread_attr_setaffinity_np.3:63
2276 "The B<pthread_attr_getaffinity_np>() function returns the CPU affinity mask "
2277 "attribute of the thread attributes object referred to by I<attr> in the "
2278 "buffer pointed to by I<cpuset>."
2280 "B<pthread_attr_getaffinity_np>() 関数は、 I<attr> が参照する\n"
2281 "スレッド属性オブジェクトの CPU affinity マスク属性を\n"
2282 "I<cpuset> が指すバッファーに入れて返す。"
2285 #: build/C/man3/pthread_attr_setaffinity_np.3:70
2287 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
2288 "by I<cpuset>. Typically, this argument would be specified as "
2289 "I<sizeof(cpu_set_t)>."
2291 "I<cpusetsize> 引数は I<cpuset> が指すバッファーの (バイト単位の)\n"
2292 "大きさである。通常は、この引数には I<sizeof(cpu_set_t)> を\n"
2296 #: build/C/man3/pthread_attr_setaffinity_np.3:76
2297 #: build/C/man3/pthread_setaffinity_np.3:67
2299 "For more details on CPU affinity masks, see B<sched_setaffinity>(2). For a "
2300 "description of a set of macros that can be used to manipulate and inspect "
2301 "CPU sets, see B<CPU_SET>(3)."
2303 "CPU affinity マスクの詳細については、 \n"
2304 "B<sched_setaffinity>(2) を参照してほしい。\n"
2305 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
2306 "B<CPU_SET>(3) を参照してほしい。"
2309 #: build/C/man3/pthread_attr_setaffinity_np.3:80
2310 #: build/C/man3/pthread_attr_setaffinity_np.3:92
2311 #: build/C/man3/pthread_attr_setdetachstate.3:83
2312 #: build/C/man3/pthread_attr_setinheritsched.3:99
2313 #: build/C/man3/pthread_attr_setschedparam.3:91
2314 #: build/C/man3/pthread_attr_setschedpolicy.3:89
2315 #: build/C/man3/pthread_attr_setscope.3:109
2316 #: build/C/man3/pthread_attr_setstack.3:91
2317 #: build/C/man3/pthread_attr_setstacksize.3:67
2318 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:55
2319 #: build/C/man3/pthread_join.3:85 build/C/man3/pthread_join.3:89
2320 #: build/C/man3/pthread_kill.3:69
2321 #: build/C/man3/pthread_rwlockattr_setkind_np.3:130
2322 #: build/C/man3/pthread_setaffinity_np.3:84
2323 #: build/C/man3/pthread_setaffinity_np.3:93
2324 #: build/C/man3/pthread_setaffinity_np.3:105
2325 #: build/C/man3/pthread_setcancelstate.3:104
2326 #: build/C/man3/pthread_setcancelstate.3:112
2327 #: build/C/man3/pthread_setconcurrency.3:71
2328 #: build/C/man3/pthread_setschedparam.3:122
2329 #: build/C/man3/pthread_setschedprio.3:62 build/C/man3/pthread_sigqueue.3:78
2330 #: build/C/man3/pthread_tryjoin_np.3:109
2331 #: build/C/man3/pthread_getattr_default_np.3:67
2332 #: build/C/man3/pthread_mutex_consistent.3:66
2333 #: build/C/man3/pthread_mutexattr_getpshared.3:82
2334 #: build/C/man3/pthread_mutexattr_setrobust.3:137
2340 #. The raw sched_getaffinity() system call returns the size (in bytes)
2341 #. of the cpumask_t type.
2343 #: build/C/man3/pthread_attr_setaffinity_np.3:92
2345 "(B<pthread_attr_setaffinity_np>()) I<cpuset> specified a CPU that was "
2346 "outside the set supported by the kernel. (The kernel configuration option "
2347 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
2348 "type used to represent CPU sets.)"
2350 "(B<pthread_attr_setaffinity_np>())\n"
2351 "I<cpuset> がカーネルがサポートする CPU 集合にない CPU を指定していた。\n"
2352 "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲"
2354 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
2357 #: build/C/man3/pthread_attr_setaffinity_np.3:102
2359 "(B<pthread_attr_getaffinity_np>()) A CPU in the affinity mask of the thread "
2360 "attributes object referred to by I<attr> lies outside the range specified by "
2361 "I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
2363 "(B<pthread_attr_getaffinity_np>())\n"
2364 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
2365 "I<cpusetsize> により指定された範囲の中になかった\n"
2366 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
2369 #: build/C/man3/pthread_attr_setaffinity_np.3:106
2370 msgid "(B<pthread_attr_setaffinity_np>()) Could not allocate memory."
2372 "(B<pthread_attr_setaffinity_np>()) メモリーを割り当てることができなかった。"
2375 #: build/C/man3/pthread_attr_setaffinity_np.3:108
2376 #: build/C/man3/pthread_setaffinity_np.3:117
2377 msgid "These functions are provided by glibc since version 2.3.4."
2378 msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。"
2381 #: build/C/man3/pthread_attr_setaffinity_np.3:119
2384 "B<pthread_attr_setaffinity_np>(),\n"
2385 "B<pthread_attr_getaffinity_np>()"
2387 "B<pthread_attr_setaffinity_np>(),\n"
2388 "B<pthread_attr_getaffinity_np>()"
2391 #: build/C/man3/pthread_attr_setaffinity_np.3:125
2392 #: build/C/man3/pthread_cleanup_push_defer_np.3:117
2393 #: build/C/man3/pthread_setaffinity_np.3:133
2394 #: build/C/man3/pthread_setname_np.3:119 build/C/man3/pthread_tryjoin_np.3:141
2395 #: build/C/man3/pthread_attr_setsigmask_np.3:108
2397 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
2398 "\" (nonportable) in the names."
2400 "これらの関数は非標準の GNU による拡張である。\n"
2401 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
2405 #: build/C/man3/pthread_attr_setaffinity_np.3:132
2406 #: build/C/man3/pthread_setaffinity_np.3:159
2408 "In glibc 2.3.3 only, versions of these functions were provided that did not "
2409 "have a I<cpusetsize> argument. Instead the CPU set size given to the "
2410 "underlying system calls was always I<sizeof(cpu_set_t)>."
2412 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
2413 "これらの関数は I<cpusetsize> 引数を持っていなかった。\n"
2414 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
2415 "常に I<sizeof(cpu_set_t)> であった。"
2418 #: build/C/man3/pthread_attr_setaffinity_np.3:138
2420 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2421 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2423 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2424 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2427 #: build/C/man3/pthread_attr_setdetachstate.3:26
2429 msgid "PTHREAD_ATTR_SETDETACHSTATE"
2430 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
2433 #: build/C/man3/pthread_attr_setdetachstate.3:26
2434 #: build/C/man3/pthread_attr_setguardsize.3:26
2435 #: build/C/man3/pthread_attr_setinheritsched.3:26
2436 #: build/C/man3/pthread_attr_setschedparam.3:26
2437 #: build/C/man3/pthread_attr_setschedpolicy.3:26
2438 #: build/C/man3/pthread_attr_setstack.3:26
2439 #: build/C/man3/pthread_attr_setstacksize.3:26 build/C/man3/pthread_cancel.3:26
2440 #: build/C/man3/pthread_cleanup_push.3:26 build/C/man3/pthread_detach.3:26
2441 #: build/C/man3/pthread_join.3:26 build/C/man3/pthread_setcancelstate.3:26
2442 #: build/C/man3/pthread_setschedparam.3:26 build/C/man3/pthread_testcancel.3:26
2443 #: build/C/man3/pthread_getattr_default_np.3:25
2444 #: build/C/man3/pthread_mutex_consistent.3:26
2445 #: build/C/man3/pthread_mutexattr_setrobust.3:26
2446 #: build/C/man3/pthread_spin_init.3:25
2452 #: build/C/man3/pthread_attr_setdetachstate.3:30
2454 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
2455 "state attribute in thread attributes object"
2457 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
2458 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
2461 #: build/C/man3/pthread_attr_setdetachstate.3:38
2464 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2465 "B<int pthread_attr_getdetachstate(const pthread_attr_t *>I<attr>B<,>\n"
2466 "B< int *>I<detachstate>B<);>\n"
2468 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
2469 "B<int pthread_attr_getdetachstate(const pthread_attr_t *>I<attr>B<,>\n"
2470 "B< int *>I<detachstate>B<);>\n"
2473 #: build/C/man3/pthread_attr_setdetachstate.3:53
2475 "The B<pthread_attr_setdetachstate>() function sets the detach state "
2476 "attribute of the thread attributes object referred to by I<attr> to the "
2477 "value specified in I<detachstate>. The detach state attribute determines "
2478 "whether a thread created using the thread attributes object I<attr> will be "
2479 "created in a joinable or a detached state."
2481 "B<pthread_attr_setdetachstate>() 関数は、\n"
2482 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
2483 "I<detachstate> で指定された値に設定する。\n"
2484 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
2485 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
2486 "detached (切り離された) 状態で作成されるかが決定される。"
2489 #: build/C/man3/pthread_attr_setdetachstate.3:56
2490 msgid "The following values may be specified in I<detachstate>:"
2491 msgstr "I<detachstate> には以下の値を指定できる。"
2494 #: build/C/man3/pthread_attr_setdetachstate.3:56
2496 msgid "B<PTHREAD_CREATE_DETACHED>"
2497 msgstr "B<PTHREAD_CREATE_DETACHED>"
2500 #: build/C/man3/pthread_attr_setdetachstate.3:61
2502 "Threads that are created using I<attr> will be created in a detached state."
2503 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
2506 #: build/C/man3/pthread_attr_setdetachstate.3:61
2508 msgid "B<PTHREAD_CREATE_JOINABLE>"
2509 msgstr "B<PTHREAD_CREATE_JOINABLE>"
2512 #: build/C/man3/pthread_attr_setdetachstate.3:66
2514 "Threads that are created using I<attr> will be created in a joinable state."
2515 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
2518 #: build/C/man3/pthread_attr_setdetachstate.3:70
2520 "The default setting of the detach state attribute in a newly initialized "
2521 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
2523 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
2524 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
2527 #: build/C/man3/pthread_attr_setdetachstate.3:77
2529 "The B<pthread_attr_getdetachstate>() returns the detach state attribute of "
2530 "the thread attributes object I<attr> in the buffer pointed to by "
2533 "B<pthread_attr_getdetachstate>() は、\n"
2534 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
2535 "I<detachstate> が指すバッファーに入れて返す。"
2538 #: build/C/man3/pthread_attr_setdetachstate.3:83
2539 msgid "B<pthread_attr_setdetachstate>() can fail with the following error:"
2540 msgstr "B<pthread_attr_setdetachstate>() は以下のエラーで失敗する場合がある。"
2543 #: build/C/man3/pthread_attr_setdetachstate.3:87
2544 msgid "An invalid value was specified in I<detachstate>."
2545 msgstr "無効な値が I<detachstate> で指定された。"
2548 #: build/C/man3/pthread_attr_setdetachstate.3:98
2551 "B<pthread_attr_setdetachstate>(),\n"
2552 "B<pthread_attr_getdetachstate>()"
2554 "B<pthread_attr_setdetachstate>(),\n"
2555 "B<pthread_attr_getdetachstate>()"
2558 #: build/C/man3/pthread_attr_setdetachstate.3:106
2560 "See B<pthread_create>(3) for more details on detached and joinable threads."
2562 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
2563 "B<pthread_create>(3) を参照。"
2566 #: build/C/man3/pthread_attr_setdetachstate.3:114
2568 "A thread that is created in a joinable state should eventually either be "
2569 "joined using B<pthread_join>(3) or detached using B<pthread_detach>(3); see "
2570 "B<pthread_create>(3)."
2572 "join 可能状態で作成されたスレッドは、最終的に\n"
2573 "B<pthread_join>(3) を使って join するか、\n"
2574 "B<pthread_detach>(3) を使って切り離すか、\n"
2578 #: build/C/man3/pthread_attr_setdetachstate.3:121
2580 "It is an error to specify the thread ID of a thread that was created in a "
2581 "detached state in a later call to B<pthread_detach>(3) or "
2582 "B<pthread_join>(3)."
2584 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
2585 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
2589 #: build/C/man3/pthread_attr_setdetachstate.3:124
2590 #: build/C/man3/pthread_attr_setstack.3:168
2591 msgid "See B<pthread_attr_init>(3)."
2592 msgstr "B<pthread_attr_init>(3) を参照。"
2595 #: build/C/man3/pthread_attr_setdetachstate.3:130
2597 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2598 "B<pthread_join>(3), B<pthreads>(7)"
2600 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2601 "B<pthread_join>(3), B<pthreads>(7)"
2604 #: build/C/man3/pthread_attr_setguardsize.3:26
2606 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2607 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2610 #: build/C/man3/pthread_attr_setguardsize.3:30
2612 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2613 "attribute in thread attributes object"
2615 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
2616 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
2619 #: build/C/man3/pthread_attr_setguardsize.3:38
2622 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2623 "B<int pthread_attr_getguardsize(const pthread_attr_t *>I<attr>B<,>\n"
2624 "B< size_t *>I<guardsize>B<);>\n"
2626 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
2627 "B<int pthread_attr_getguardsize(const pthread_attr_t *>I<attr>B<,>\n"
2628 "B< size_t *>I<guardsize>B<);>\n"
2631 #: build/C/man3/pthread_attr_setguardsize.3:49
2633 "The B<pthread_attr_setguardsize>() function sets the guard size attribute "
2634 "of the thread attributes object referred to by I<attr> to the value "
2635 "specified in I<guardsize>."
2637 "B<pthread_attr_setguardsize>() 関数は、\n"
2638 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
2639 "I<guardsize> で指定された値に設定する。"
2642 #: build/C/man3/pthread_attr_setguardsize.3:59
2644 "If I<guardsize> is greater than 0, then for each new thread created using "
2645 "I<attr> the system allocates an additional region of at least I<guardsize> "
2646 "bytes at the end of the thread's stack to act as the guard area for the "
2647 "stack (but see BUGS)."
2649 "I<guardsize> が 0 より大きい場合、\n"
2650 "I<attr> を使って新しく作成された各スレッドに対して、\n"
2651 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
2652 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
2653 "機能する (ただし「バグ」の節も参照)。"
2656 #: build/C/man3/pthread_attr_setguardsize.3:65
2658 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2661 "I<guardsize> が 0 の場合、\n"
2662 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
2665 #: build/C/man3/pthread_attr_setguardsize.3:67
2666 msgid "The default guard size is the same as the system page size."
2667 msgstr "デフォルトの guard size はシステムのページサイズと同じである。"
2670 #: build/C/man3/pthread_attr_setguardsize.3:82
2672 "If the stack address attribute has been set in I<attr> (using "
2673 "B<pthread_attr_setstack>(3) or B<pthread_attr_setstackaddr>(3)), meaning "
2674 "that the caller is allocating the thread's stack, then the guard size "
2675 "attribute is ignored (i.e., no guard area is created by the system): it is "
2676 "the application's responsibility to handle stack overflow (perhaps by using "
2677 "B<mprotect>(2) to manually define a guard area at the end of the stack that "
2678 "it has allocated)."
2680 "(B<pthread_attr_setstack>(3) や B<pthread_attr_setstackaddr>(3)を使って)\n"
2681 "I<attr> でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n"
2682 "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n"
2683 "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n"
2684 "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n"
2685 "ケーション側の責任となる (おそらく B<mprotect>(2) を使って、割り当て\n"
2686 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
2689 #: build/C/man3/pthread_attr_setguardsize.3:90
2691 "The B<pthread_attr_getguardsize>() function returns the guard size "
2692 "attribute of the thread attributes object referred to by I<attr> in the "
2693 "buffer pointed to by I<guardsize>."
2695 "B<pthread_attr_getguardsize>() は、\n"
2696 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
2697 "I<guardsize> が指すバッファーに入れて返す。"
2700 #: build/C/man3/pthread_attr_setguardsize.3:104
2702 "POSIX.1 documents an B<EINVAL> error if I<attr> or I<guardsize> is invalid. "
2703 "On Linux these functions always succeed (but portable and future-proof "
2704 "applications should nevertheless handle a possible error return)."
2706 "POSIX.1 では、エラー B<EINVAL> が\n"
2707 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2708 "Linux では、これらの関数は常に成功する\n"
2709 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2710 "正のエラーの返り値を処理するようにすべきである)。"
2713 #: build/C/man3/pthread_attr_setguardsize.3:106
2714 #: build/C/man3/pthread_attr_setstackaddr.3:83
2715 #: build/C/man3/pthread_attr_setstacksize.3:83
2716 msgid "These functions are provided by glibc since version 2.1."
2717 msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。"
2720 #: build/C/man3/pthread_attr_setguardsize.3:117
2723 "B<pthread_attr_setguardsize>(),\n"
2724 "B<pthread_attr_getguardsize>()"
2726 "B<pthread_attr_setguardsize>(),\n"
2727 "B<pthread_attr_getguardsize>()"
2730 #: build/C/man3/pthread_attr_setguardsize.3:135
2732 "A guard area consists of virtual memory pages that are protected to prevent "
2733 "read and write access. If a thread overflows its stack into the guard area, "
2734 "then, on most hard architectures, it receives a B<SIGSEGV> signal, thus "
2735 "notifying it of the overflow. Guard areas start on page boundaries, and the "
2736 "guard size is internally rounded up to the system page size when creating a "
2737 "thread. (Nevertheless, B<pthread_attr_getguardsize>() returns the guard "
2738 "size that was set by B<pthread_attr_setguardsize>().)"
2740 "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n"
2741 "られた仮想メモリーページで構成で構成される。スレッドがスタックをガード\n"
2742 "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャー\n"
2743 "では、スレッドに B<SIGSEGV> シグナルが送られ、オーバーフローが発生した\n"
2744 "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n"
2745 "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n"
2746 "(その場合も B<pthread_attr_getguardsize>() では\n"
2747 "B<pthread_attr_setguardsize>() で設定された guard size が返される)。"
2750 #: build/C/man3/pthread_attr_setguardsize.3:139
2752 "Setting a guard size of 0 may be useful to save memory in an application "
2753 "that creates many threads and knows that stack overflow can never occur."
2755 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2756 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2757 "することで、メモリーを節約できることもある。"
2760 #: build/C/man3/pthread_attr_setguardsize.3:143
2762 "Choosing a guard size larger than the default size may be necessary for "
2763 "detecting stack overflows if a thread allocates large data structures on the "
2766 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2767 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2768 "大きな guard size を選ぶ必要があるかもしれない。"
2771 #: build/C/man3/pthread_attr_setguardsize.3:143
2772 #: build/C/man3/pthread_attr_setinheritsched.3:125
2773 #: build/C/man3/pthread_attr_setstacksize.3:109
2774 #: build/C/man3/pthread_create.3:233 build/C/man3/pthread_exit.3:105
2775 #: build/C/man3/pthread_tryjoin_np.3:163
2781 #: build/C/man3/pthread_attr_setguardsize.3:154
2783 "As at glibc 2.8, the NPTL threading implementation includes the guard area "
2784 "within the stack size allocation, rather than allocating extra space at the "
2785 "end of the stack, as POSIX.1 requires. (This can result in an B<EINVAL> "
2786 "error from B<pthread_create>(3) if the guard size value is too large, "
2787 "leaving no space for the actual stack.)"
2789 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2790 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2791 "末尾に追加の領域を割り当てることが求められている。\n"
2792 "(このため、ガード領域が大きすぎて、\n"
2793 "実際のスタック用の場所がなくなってしまう場合、\n"
2794 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2796 #. glibc includes the guardsize within the allocated stack size,
2797 #. which looks pretty clearly to be in violation of POSIX.
2798 #. Filed bug, 22 Oct 2008:
2799 #. http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2801 #. https//bugzilla.redhat.com/show_bug.cgi?id=435337
2802 #. Reportedly, LinuxThreads did the right thing, allocating
2803 #. extra space at the end of the stack:
2804 #. http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2806 #: build/C/man3/pthread_attr_setguardsize.3:168
2808 "The obsolete LinuxThreads implementation did the right thing, allocating "
2809 "extra space at the end of the stack for the guard area."
2811 "廃止予定の LinuxThreads 実装では、\n"
2812 "POSIX.1 で求められている通りの動作で、\n"
2813 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2816 #: build/C/man3/pthread_attr_setguardsize.3:171
2817 msgid "See B<pthread_getattr_np>(3)."
2818 msgstr "B<pthread_getattr_np>(3) を参照。"
2821 #: build/C/man3/pthread_attr_setguardsize.3:179
2823 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), "
2824 "B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), "
2825 "B<pthread_create>(3), B<pthreads>(7)"
2827 "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), "
2828 "B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), "
2829 "B<pthread_create>(3), B<pthreads>(7)"
2832 #: build/C/man3/pthread_attr_setinheritsched.3:26
2834 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2835 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2838 #: build/C/man3/pthread_attr_setinheritsched.3:30
2840 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit-"
2841 "scheduler attribute in thread attributes object"
2843 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - スレッド属性オブ"
2844 "ジェクトの inherit-scheduler 属性の設定/取得を行う"
2847 #: build/C/man3/pthread_attr_setinheritsched.3:38
2850 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2851 "B< int >I<inheritsched>B<);>\n"
2852 "B<int pthread_attr_getinheritsched(const pthread_attr_t *>I<attr>B<,>\n"
2853 "B< int *>I<inheritsched>B<);>\n"
2855 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2856 "B< int >I<inheritsched>B<);>\n"
2857 "B<int pthread_attr_getinheritsched(const pthread_attr_t *>I<attr>B<,>\n"
2858 "B< int *>I<inheritsched>B<);>\n"
2861 #: build/C/man3/pthread_attr_setinheritsched.3:55
2863 "The B<pthread_attr_setinheritsched>() function sets the inherit-scheduler "
2864 "attribute of the thread attributes object referred to by I<attr> to the "
2865 "value specified in I<inheritsched>. The inherit-scheduler attribute "
2866 "determines whether a thread created using the thread attributes object "
2867 "I<attr> will inherit its scheduling attributes from the calling thread or "
2868 "whether it will take them from I<attr>."
2870 "B<pthread_attr_setinheritsched>() 関数は、 I<attr> が参照するスレッド属性オブ"
2871 "ジェクトの inherit-scheduler 属性を I<inheritsched> で指定された値に設定す"
2872 "る。 inherit-scheduler 属性により、スレッド属性オブジェクト I<attr> を使って"
2873 "作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承するか、 "
2874 "I<attr> からスケジューリング属性を取得するかが決定される。"
2877 #: build/C/man3/pthread_attr_setinheritsched.3:64
2879 "The following scheduling attributes are affected by the inherit-scheduler "
2880 "attribute: scheduling policy (B<pthread_attr_setschedpolicy>(3)), scheduling "
2881 "priority (B<pthread_attr_setschedparam>(3)), and contention scope "
2882 "(B<pthread_attr_setscope>(3))."
2884 "次に挙げるスケジューリング属性は inherit-scheduler 属性の影響を受ける: スケ"
2885 "ジューリングポリシー (B<pthread_attr_setschedpolicy>(3))、 スケジューリング優"
2886 "先度 (B<pthread_attr_setschedparam>(3))、 contention scope "
2887 "(B<pthread_attr_setscope>(3))。"
2890 #: build/C/man3/pthread_attr_setinheritsched.3:67
2891 msgid "The following values may be specified in I<inheritsched>:"
2892 msgstr "以下の値を I<inheritsched> に指定できる。"
2895 #: build/C/man3/pthread_attr_setinheritsched.3:67
2897 msgid "B<PTHREAD_INHERIT_SCHED>"
2898 msgstr "B<PTHREAD_INHERIT_SCHED>"
2901 #: build/C/man3/pthread_attr_setinheritsched.3:75
2903 "Threads that are created using I<attr> inherit scheduling attributes from "
2904 "the creating thread; the scheduling attributes in I<attr> are ignored."
2906 "I<attr> を使って作成されたスレッドは、\n"
2907 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2908 "I<attr> 内のスケジューリング属性は無視される。"
2911 #: build/C/man3/pthread_attr_setinheritsched.3:75
2913 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2914 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2916 #. FIXME Document the defaults for scheduler settings
2918 #: build/C/man3/pthread_attr_setinheritsched.3:82
2920 "Threads that are created using I<attr> take their scheduling attributes from "
2921 "the values specified by the attributes object."
2923 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2924 "指定された値からスケジューリング属性を取得する。"
2927 #: build/C/man3/pthread_attr_setinheritsched.3:86
2929 "The default setting of the inherit-scheduler attribute in a newly "
2930 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2932 "新たに初期化されたスレッド属性オブジェクトの inherit-scheduler 属性のデフォル"
2933 "ト設定は B<PTHREAD_INHERIT_SCHED> である。"
2936 #: build/C/man3/pthread_attr_setinheritsched.3:93
2938 "The B<pthread_attr_getinheritsched>() returns the inherit-scheduler "
2939 "attribute of the thread attributes object I<attr> in the buffer pointed to "
2940 "by I<inheritsched>."
2942 "B<pthread_attr_getinheritsched>() は、 スレッド属性オブジェクト I<attr> の "
2943 "inherit-scheduler 属性を I<inheritsched> が指すバッファーに入れて返す。"
2946 #: build/C/man3/pthread_attr_setinheritsched.3:99
2947 msgid "B<pthread_attr_setinheritsched>() can fail with the following error:"
2948 msgstr "B<pthread_attr_setinheritsched>() は以下のエラーで失敗する場合がある。"
2951 #: build/C/man3/pthread_attr_setinheritsched.3:103
2952 msgid "Invalid value in I<inheritsched>."
2953 msgstr "I<inheritsched> に無効な値が指定された。"
2956 #. Available since glibc 2.0.
2958 #: build/C/man3/pthread_attr_setinheritsched.3:110
2960 "POSIX.1 also documents an optional B<ENOTSUP> error (\"attempt was made to "
2961 "set the attribute to an unsupported value\") for "
2962 "B<pthread_attr_setinheritsched>()."
2964 "POSIX.1 では、 B<pthread_attr_setinheritsched>() に関して\n"
2965 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2969 #: build/C/man3/pthread_attr_setinheritsched.3:121
2972 "B<pthread_attr_setinheritsched>(),\n"
2973 "B<pthread_attr_getinheritsched>()"
2975 "B<pthread_attr_setinheritsched>(),\n"
2976 "B<pthread_attr_getinheritsched>()"
2978 #. FIXME . Track status of the following bug:
2979 #. http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2981 #: build/C/man3/pthread_attr_setinheritsched.3:141
2983 "As at glibc 2.8, if a thread attributes object is initialized using "
2984 "B<pthread_attr_init>(3), then the scheduling policy of the attributes object "
2985 "is set to B<SCHED_OTHER> and the scheduling priority is set to 0. However, "
2986 "if the inherit-scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, "
2987 "then a thread created using the attribute object wrongly inherits its "
2988 "scheduling attributes from the creating thread. This bug does not occur if "
2989 "either the scheduling policy or scheduling priority attribute is explicitly "
2990 "set in the thread attributes object before calling B<pthread_create>(3)."
2992 "glibc 2.8 の時点では、スレッド属性オブジェクトが B<pthread_attr_init>(3) を"
2993 "使って初期化された場合、 スレッド属性オブジェクトのスケジューリングポリシー"
2994 "が B<SCHED_OTHER> に、 スケジューリング優先度が 0 に設定される。一方、その後 "
2995 "inherit-scheduler 属性に B<PTHREAD_EXPLICIT_SCHED> が設定されると、このスレッ"
2996 "ド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するスレッド"
2997 "のスケジューリング属性が間違って継承されてしまう。 B<pthread_create>(3) を呼"
2998 "び出す前にスケジューリングポリシー属性かスケジューリング優先度属性のどちらか"
2999 "が明示的に設定された場合には、 このバグは発生しない。"
3002 #: build/C/man3/pthread_attr_setinheritsched.3:144
3003 #: build/C/man3/pthread_attr_setschedparam.3:129
3004 #: build/C/man3/pthread_attr_setschedpolicy.3:118
3005 msgid "See B<pthread_setschedparam>(3)."
3006 msgstr "B<pthread_setschedparam>(3) を参照。"
3009 #: build/C/man3/pthread_attr_setinheritsched.3:156
3011 "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), "
3012 "B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), "
3013 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
3014 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
3016 "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), "
3017 "B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), "
3018 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
3019 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
3022 #: build/C/man3/pthread_attr_setschedparam.3:26
3024 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
3025 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
3028 #: build/C/man3/pthread_attr_setschedparam.3:30
3030 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
3031 "parameter attributes in thread attributes object"
3033 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
3034 "スレッド属性オブジェクトのスケジューリングパラメーター属性の設定/取得を行う"
3037 #: build/C/man3/pthread_attr_setschedparam.3:38
3040 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
3041 "B< const struct sched_param *>I<param>B<);>\n"
3042 "B<int pthread_attr_getschedparam(const pthread_attr_t *>I<attr>B<,>\n"
3043 "B< struct sched_param *>I<param>B<);>\n"
3045 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
3046 "B< const struct sched_param *>I<param>B<);>\n"
3047 "B<int pthread_attr_getschedparam(const pthread_attr_t *>I<attr>B<,>\n"
3048 "B< struct sched_param *>I<param>B<);>\n"
3051 #: build/C/man3/pthread_attr_setschedparam.3:52
3053 "The B<pthread_attr_setschedparam>() function sets the scheduling parameter "
3054 "attributes of the thread attributes object referred to by I<attr> to the "
3055 "values specified in the buffer pointed to by I<param>. These attributes "
3056 "determine the scheduling parameters of a thread created using the thread "
3057 "attributes object I<attr>."
3059 "B<pthread_attr_setschedparam>() 関数は、\n"
3060 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
3061 "パラメーター属性を I<param> が指すバッファーで指定された値に設定する。\n"
3062 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
3063 "作成されるスレッドのスケジューリングパラメーターが決定される。"
3066 #: build/C/man3/pthread_attr_setschedparam.3:59
3068 "The B<pthread_attr_getschedparam>() returns the scheduling parameter "
3069 "attributes of the thread attributes object I<attr> in the buffer pointed to "
3072 "B<pthread_attr_getschedparam>() は、\n"
3073 "スレッド属性オブジェクト I<attr> のスケジューリングパラメーター属性を\n"
3074 "I<param> が指すバッファーに入れて返す。"
3077 #: build/C/man3/pthread_attr_setschedparam.3:61
3078 msgid "Scheduling parameters are maintained in the following structure:"
3079 msgstr "スケジューリングパラメーターは以下の構造体で管理される。"
3082 #: build/C/man3/pthread_attr_setschedparam.3:67
3083 #: build/C/man3/pthread_setschedparam.3:69
3086 "struct sched_param {\n"
3087 " int sched_priority; /* Scheduling priority */\n"
3090 "struct sched_param {\n"
3091 " int sched_priority; /* Scheduling priority */\n"
3095 #: build/C/man3/pthread_attr_setschedparam.3:74
3096 #: build/C/man3/pthread_setschedparam.3:76
3098 "As can be seen, only one scheduling parameter is supported. For details of "
3099 "the permitted ranges for scheduling priorities in each scheduling policy, "
3102 "見て分かる通り、サポートされているスケジューリングパラメーターは一つだけであ"
3103 "る。各スケジューリングポリシーで許可されるスケジューリング優先度の詳細につい"
3104 "ては、B<sched>(7) を参照のこと。"
3107 #: build/C/man3/pthread_attr_setschedparam.3:85
3109 "In order for the parameter setting made by B<pthread_attr_setschedparam>() "
3110 "to have effect when calling B<pthread_create>(3), the caller must use "
3111 "B<pthread_attr_setinheritsched>(3) to set the inherit-scheduler attribute "
3112 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
3114 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedparam>() で行っ"
3115 "たパラメーター設定を有効にするには、 呼び出し側で "
3116 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
3117 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
3121 #: build/C/man3/pthread_attr_setschedparam.3:91
3122 msgid "B<pthread_attr_setschedparam>() can fail with the following error:"
3123 msgstr "B<pthread_attr_setschedparam>() は以下のエラーで失敗する場合がある。"
3126 #: build/C/man3/pthread_attr_setschedparam.3:97
3129 #| "I<policy> is not a recognized policy, or I<param> does not make sense for "
3132 "The priority specified in I<param> does not make sense for the current "
3133 "scheduling policy of I<attr>."
3135 "I<policy> が認識できないポリシーであるか、\n"
3136 "I<param> が I<policy> では意味を持たない値である。"
3139 #. Available since glibc 2.0.
3141 #: build/C/man3/pthread_attr_setschedparam.3:107
3144 #| "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for "
3145 #| "B<pthread_attr_setschedparam>(). On Linux these functions always succeed "
3146 #| "(but portable and future-proof applications should nevertheless handle a "
3147 #| "possible error return)."
3149 "POSIX.1 also documents an B<ENOTSUP> error for "
3150 "B<pthread_attr_setschedparam>(). This value is never returned on Linux (but "
3151 "portable and future-proof applications should nevertheless handle this error "
3155 "B<pthread_attr_setschedparam>() について\n"
3156 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
3157 "Linux では、これらの関数は常に成功する\n"
3158 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
3159 "正のエラーの返り値を処理するようにすべきである)。"
3162 #: build/C/man3/pthread_attr_setschedparam.3:118
3165 "B<pthread_attr_setschedparam>(),\n"
3166 "B<pthread_attr_getschedparam>()"
3168 "B<pthread_attr_setschedparam>(),\n"
3169 "B<pthread_attr_getschedparam>()"
3172 #: build/C/man3/pthread_attr_setschedparam.3:126
3174 "See B<pthread_attr_setschedpolicy>(3) for a list of the thread scheduling "
3175 "policies supported on Linux."
3177 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
3178 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
3181 #: build/C/man3/pthread_attr_setschedparam.3:141
3183 "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
3184 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
3185 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
3186 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
3188 "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
3189 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), "
3190 "B<pthread_create>(3), B<pthread_setschedparam>(3), "
3191 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
3194 #: build/C/man3/pthread_attr_setschedpolicy.3:26
3196 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
3197 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
3200 #: build/C/man3/pthread_attr_setschedpolicy.3:30
3202 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
3203 "scheduling policy attribute in thread attributes object"
3205 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
3206 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
3209 #: build/C/man3/pthread_attr_setschedpolicy.3:38
3212 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
3213 "B<int pthread_attr_getschedpolicy(const pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
3215 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
3216 "B<int pthread_attr_getschedpolicy(const pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
3219 #: build/C/man3/pthread_attr_setschedpolicy.3:52
3221 "The B<pthread_attr_setschedpolicy>() function sets the scheduling policy "
3222 "attribute of the thread attributes object referred to by I<attr> to the "
3223 "value specified in I<policy>. This attribute determines the scheduling "
3224 "policy of a thread created using the thread attributes object I<attr>."
3226 "B<pthread_attr_setschedpolicy>() 関数は、\n"
3227 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
3228 "ポリシー属性を I<policy> で指定された値に設定する。\n"
3229 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3230 "作成されるスレッドのスケジューリングポリシーが決定される。"
3232 #. FIXME . pthread_setschedparam() places no restriction on the policy,
3233 #. but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
3234 #. http://sourceware.org/bugzilla/show_bug.cgi?id=7013
3236 #: build/C/man3/pthread_attr_setschedpolicy.3:65
3238 "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and "
3239 "B<SCHED_OTHER>, with the semantics described in B<sched>(7)."
3241 "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER> であ"
3242 "る。それぞれの意味は B<sched>(7) で説明している通りである。"
3245 #: build/C/man3/pthread_attr_setschedpolicy.3:72
3247 "The B<pthread_attr_getschedpolicy>() returns the scheduling policy "
3248 "attribute of the thread attributes object I<attr> in the buffer pointed to "
3251 "B<pthread_attr_getschedpolicy>() は、\n"
3252 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
3253 "I<policy> が指すバッファーに入れて返す。"
3256 #: build/C/man3/pthread_attr_setschedpolicy.3:83
3258 "In order for the policy setting made by B<pthread_attr_setschedpolicy>() to "
3259 "have effect when calling B<pthread_create>(3), the caller must use "
3260 "B<pthread_attr_setinheritsched>(3) to set the inherit-scheduler attribute "
3261 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
3263 "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedpolicy>() で行っ"
3264 "たポリシー設定を有効にするには、 呼び出し側で "
3265 "B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の "
3266 "inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければなら"
3270 #: build/C/man3/pthread_attr_setschedpolicy.3:89
3271 msgid "B<pthread_attr_setschedpolicy>() can fail with the following error:"
3272 msgstr "B<pthread_attr_setschedpolicy>() は以下のエラーで失敗する場合がある。"
3275 #: build/C/man3/pthread_attr_setschedpolicy.3:93
3276 msgid "Invalid value in I<policy>."
3277 msgstr "I<policy> に無効な値が指定された。"
3280 #. Available since glibc 2.0.
3282 #: build/C/man3/pthread_attr_setschedpolicy.3:100
3284 "POSIX.1 also documents an optional B<ENOTSUP> error (\"attempt was made to "
3285 "set the attribute to an unsupported value\") for "
3286 "B<pthread_attr_setschedpolicy>()."
3287 msgstr "POSIX.1 では、 B<pthread_attr_setschedpolicy>() に関してエラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\") も追加で規定されている。"
3290 #: build/C/man3/pthread_attr_setschedpolicy.3:111
3293 "B<pthread_attr_setschedpolicy>(),\n"
3294 "B<pthread_attr_getschedpolicy>()"
3296 "B<pthread_attr_setschedpolicy>(),\n"
3297 "B<pthread_attr_getschedpolicy>()"
3300 #: build/C/man3/pthread_attr_setschedpolicy.3:129
3302 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
3303 "B<pthread_attr_setschedparam>(3), B<pthread_create>(3), "
3304 "B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), "
3307 "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), "
3308 "B<pthread_attr_setschedparam>(3), B<pthread_create>(3), "
3309 "B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), "
3313 #: build/C/man3/pthread_attr_setscope.3:26
3315 msgid "PTHREAD_ATTR_SETSCOPE"
3316 msgstr "PTHREAD_ATTR_SETSCOPE"
3319 #: build/C/man3/pthread_attr_setscope.3:30
3321 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
3322 "attribute in thread attributes object"
3324 "pthread_attr_setscope, pthread_attr_getscope - \n"
3325 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
3328 #: build/C/man3/pthread_attr_setscope.3:38
3331 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
3332 "B<int pthread_attr_getscope(const pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
3334 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
3335 "B<int pthread_attr_getscope(const pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
3338 #: build/C/man3/pthread_attr_setscope.3:53
3340 "The B<pthread_attr_setscope>() function sets the contention scope attribute "
3341 "of the thread attributes object referred to by I<attr> to the value "
3342 "specified in I<scope>. The contention scope attribute defines the set of "
3343 "threads against which a thread competes for resources such as the CPU. "
3344 "POSIX.1 specifies two possible values for I<scope>:"
3345 msgstr "B<pthread_attr_setscope>() 関数は、 I<attr> が参照するスレッド属性オブジェクトの contention scope 属性を I<scope> で指定された値に設定する。 contention scope 属性により、スレッドが CPU などのリソースを取り合うスレッド集合が規定される。 POSIX.1 では I<scope> に指定する値として 2 つの値が規定されている。"
3348 #: build/C/man3/pthread_attr_setscope.3:53
3350 msgid "B<PTHREAD_SCOPE_SYSTEM>"
3351 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
3354 #: build/C/man3/pthread_attr_setscope.3:61
3356 "The thread competes for resources with all other threads in all processes on "
3357 "the system that are in the same scheduling allocation domain (a group of one "
3358 "or more processors). B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative "
3359 "to one another according to their scheduling policy and priority."
3361 "スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ\n"
3362 "のグループ) にある、システム上の全てのプロセスの自分以外の全ての\n"
3363 "スレッドとリソースを取り合う。 \n"
3364 "B<PTHREAD_SCOPE_SYSTEM> のスレッドは、スケジューリングポリシーと\n"
3365 "優先度に基づき、互いに相対的にスケジューリングされる。"
3368 #: build/C/man3/pthread_attr_setscope.3:61
3370 msgid "B<PTHREAD_SCOPE_PROCESS>"
3371 msgstr "B<PTHREAD_SCOPE_PROCESS>"
3374 #: build/C/man3/pthread_attr_setscope.3:76
3376 "The thread competes for resources with all other threads in the same process "
3377 "that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope. "
3378 "B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in "
3379 "the process according to their scheduling policy and priority. POSIX.1 "
3380 "leaves it unspecified how these threads contend with other threads in other "
3381 "process on the system or with other threads in the same process that were "
3382 "created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
3384 "スレッドは、contention scope が B<PTHREAD_SCOPE_PROCESS> で作成された\n"
3385 "同じプロセスの自分以外の全てのスレッドとリソースを取り合う。\n"
3386 "B<PTHREAD_SCOPE_PROCESS> のスレッドは、スケジューリングポリシーと優先度\n"
3387 "に基づき、同じプロセスの他のスレッドと相対的にスケジューリングされる。\n"
3388 "POSIX.1 では、これらのスレッドがシステム上の他のプロセスのスレッド\n"
3389 "や同じプロセス内の contention scope が B<PTHREAD_SCOPE_SYSTEM> で作成\n"
3390 "された他のスレッドとどのようにリソースを取り合うかは、\n"
3394 #: build/C/man3/pthread_attr_setscope.3:83
3396 "POSIX.1 requires that an implementation support at least one of these "
3397 "contention scopes. Linux supports B<PTHREAD_SCOPE_SYSTEM>, but not "
3398 "B<PTHREAD_SCOPE_PROCESS>."
3399 msgstr "POSIX.1 で求められているのは、スレッド実装がこれらの contention scope のうち少なくとも 1 つをサポートすることだけである。 Linux は B<PTHREAD_SCOPE_SYSTEM> をサポートしているが、 B<PTHREAD_SCOPE_PROCESS> はサポートしていない。"
3402 #: build/C/man3/pthread_attr_setscope.3:95
3404 "On systems that support multiple contention scopes, then, in order for the "
3405 "parameter setting made by B<pthread_attr_setscope>() to have effect when "
3406 "calling B<pthread_create>(3), the caller must use "
3407 "B<pthread_attr_setinheritsched>(3) to set the inherit-scheduler attribute "
3408 "of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
3410 "複数の contention scope をサポートしているシステムで、 B<pthread_create>(3) "
3411 "を呼び出した際に B<pthread_attr_setscope>() で行ったパラメーター設定を有効に"
3412 "するには、 呼び出し側で B<pthread_attr_setinheritsched>(3) を使って 属性オブ"
3413 "ジェクト I<attr> の inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定"
3417 #: build/C/man3/pthread_attr_setscope.3:103
3419 "The B<pthread_attr_getscope>() function returns the contention scope "
3420 "attribute of the thread attributes object referred to by I<attr> in the "
3421 "buffer pointed to by I<scope>."
3423 "B<pthread_attr_getscope>() は、\n"
3424 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
3425 "I<scope> が指すバッファーに入れて返す。"
3428 #: build/C/man3/pthread_attr_setscope.3:109
3429 msgid "B<pthread_attr_setscope>() can fail with the following errors:"
3430 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
3433 #: build/C/man3/pthread_attr_setscope.3:113
3434 msgid "An invalid value was specified in I<scope>."
3435 msgstr "I<scope> に無効な値が指定された。"
3438 #: build/C/man3/pthread_attr_setscope.3:113
3439 #: build/C/man3/pthread_mutexattr_getpshared.3:87
3445 #: build/C/man3/pthread_attr_setscope.3:119
3447 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
3448 "supported on Linux."
3450 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
3451 "この値は Linux でサポートされていない。"
3454 #: build/C/man3/pthread_attr_setscope.3:130
3457 "B<pthread_attr_setscope>(),\n"
3458 "B<pthread_attr_getscope>()"
3460 "B<pthread_attr_setscope>(),\n"
3461 "B<pthread_attr_getscope>()"
3464 #: build/C/man3/pthread_attr_setscope.3:142
3466 "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a user-"
3467 "space thread is bound directly to a single kernel-scheduling entity. This "
3468 "is the case on Linux for the obsolete LinuxThreads implementation and the "
3469 "modern NPTL implementation, which are both 1:1 threading implementations."
3471 "B<PTHREAD_SCOPE_SYSTEM> contention scope では、通常は、一つの\n"
3472 "ユーザー空間スレッドは一つのカーネルスケジューリングエンティティに\n"
3474 "Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに\n"
3475 "該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。"
3478 #: build/C/man3/pthread_attr_setscope.3:145
3480 "POSIX.1 specifies that the default contention scope is implementation-"
3482 msgstr "POSIX.1 では、 contention scope 属性のデフォルト値は実装時で定義されるものと規定されている。"
3485 #: build/C/man3/pthread_attr_setscope.3:155
3487 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3488 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3489 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3491 "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), "
3492 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
3493 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
3496 #: build/C/man3/pthread_attr_setstack.3:26
3498 msgid "PTHREAD_ATTR_SETSTACK"
3499 msgstr "PTHREAD_ATTR_SETSTACK"
3502 #: build/C/man3/pthread_attr_setstack.3:30
3504 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
3505 "thread attributes object"
3507 "pthread_attr_setstack, pthread_attr_getstack - \n"
3508 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
3511 #: build/C/man3/pthread_attr_setstack.3:38
3514 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3515 "B< void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3516 "B<int pthread_attr_getstack(const pthread_attr_t *>I<attr>B<,>\n"
3517 "B< void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3519 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
3520 "B< void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
3521 "B<int pthread_attr_getstack(const pthread_attr_t *>I<attr>B<,>\n"
3522 "B< void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
3525 #: build/C/man3/pthread_attr_setstack.3:45
3526 #: build/C/man3/pthread_cleanup_push_defer_np.3:44
3527 #: build/C/man3/pthread_kill.3:41
3528 #: build/C/man3/pthread_rwlockattr_setkind_np.3:44
3529 #: build/C/man3/pthread_sigmask.3:42 build/C/man3/pthread_sigqueue.3:42
3530 #: build/C/man3/pthread_mutex_consistent.3:41
3531 #: build/C/man3/pthread_mutexattr_setrobust.3:45
3532 #: build/C/man3/pthread_spin_init.3:41 build/C/man3/pthread_spin_lock.3:43
3534 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3535 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7) 参照):"
3538 #: build/C/man3/pthread_attr_setstack.3:50
3539 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3540 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
3543 #: build/C/man3/pthread_attr_setstack.3:52
3544 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
3545 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
3548 #: build/C/man3/pthread_attr_setstack.3:68
3550 "The B<pthread_attr_setstack>() function sets the stack address and stack "
3551 "size attributes of the thread attributes object referred to by I<attr> to "
3552 "the values specified in I<stackaddr> and I<stacksize>, respectively. These "
3553 "attributes specify the location and size of the stack that should be used by "
3554 "a thread that is created using the thread attributes object I<attr>."
3556 "B<pthread_attr_setstack>() 関数は、\n"
3557 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
3558 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
3560 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
3561 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
3564 #: build/C/man3/pthread_attr_setstack.3:74
3566 "I<stackaddr> should point to the lowest addressable byte of a buffer of "
3567 "I<stacksize> bytes that was allocated by the caller. The pages of the "
3568 "allocated buffer should be both readable and writable."
3570 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
3571 "バッファー内の指定できる最小のアドレスバイトを指すべきである。\n"
3572 "割り当てられたバッファーのページは読み書き両方が可能なページとなっている\n"
3576 #: build/C/man3/pthread_attr_setstack.3:85
3578 "The B<pthread_attr_getstack>() function returns the stack address and stack "
3579 "size attributes of the thread attributes object referred to by I<attr> in "
3580 "the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
3582 "B<pthread_attr_getstack>() 関数は、\n"
3583 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
3584 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
3588 #: build/C/man3/pthread_attr_setstack.3:91
3589 msgid "B<pthread_attr_setstack>() can fail with the following error:"
3590 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
3593 #: build/C/man3/pthread_attr_setstack.3:102
3595 "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes. On some "
3596 "systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ "
3597 "stacksize> is not suitably aligned."
3599 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
3600 "システムによっては、 I<stackaddr> か\n"
3601 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
3605 #: build/C/man3/pthread_attr_setstack.3:110
3607 "POSIX.1 also documents an B<EACCES> error if the stack area described by "
3608 "I<stackaddr> and I<stacksize> is not both readable and writable by the "
3610 msgstr "POSIX.1 では エラー B<EACCES> も規定されており、このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に呼び出し側から読み書き両方のアクセスができない状況を表す。"
3613 #: build/C/man3/pthread_attr_setstack.3:112
3614 msgid "These functions are provided by glibc since version 2.2."
3615 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
3618 #: build/C/man3/pthread_attr_setstack.3:123
3621 "B<pthread_attr_setstack>(),\n"
3622 "B<pthread_attr_getstack>()"
3624 "B<pthread_attr_setstack>(),\n"
3625 "B<pthread_attr_getstack>()"
3628 #: build/C/man3/pthread_attr_setstack.3:135
3630 "These functions are provided for applications that must ensure that a "
3631 "thread's stack is placed in a particular location. For most applications, "
3632 "this is not necessary, and the use of these functions should be avoided. "
3633 "(Use B<pthread_attr_setstacksize>(3) if an application simply requires a "
3634 "stack size other than the default.)"
3636 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
3637 "しなければならないアプリケーションのために提供されている。\n"
3638 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
3639 "これらの関数を使うのは避けるべきである。\n"
3640 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
3641 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
3644 #: build/C/man3/pthread_attr_setstack.3:146
3646 "When an application employs B<pthread_attr_setstack>(), it takes over the "
3647 "responsibility of allocating the stack. Any guard size value that was set "
3648 "using B<pthread_attr_setguardsize>(3) is ignored. If deemed necessary, it "
3649 "is the application's responsibility to allocate a guard area (one or more "
3650 "pages protected against reading and writing) to handle the possibility of "
3653 "アプリケーションが B<pthread_attr_setstack>() を利用する際には、\n"
3654 "スタックの割り当てに責任を持つ必要がある。\n"
3655 "B<pthread_attr_setguardsize>(3) を使って設定された\n"
3656 "guard size の値は無視される。\n"
3657 "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n"
3658 "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n"
3659 "スタックオーバーフローの可能性に対処するようにする必要がある。"
3662 #: build/C/man3/pthread_attr_setstack.3:157
3664 "The address specified in I<stackaddr> should be suitably aligned: for full "
3665 "portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>). "
3666 "B<posix_memalign>(3) may be useful for allocation. Probably, I<stacksize> "
3667 "should also be a multiple of the system page size."
3669 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
3670 "完全な移植性を持たせるためには、\n"
3671 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
3672 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
3673 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
3676 #: build/C/man3/pthread_attr_setstack.3:165
3678 "If I<attr> is used to create multiple threads, then the caller must change "
3679 "the stack address attribute between calls to B<pthread_create>(3); "
3680 "otherwise, the threads will attempt to use the same memory area for their "
3681 "stacks, and chaos will ensue."
3683 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
3684 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
3685 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
3686 "さもなければ、複数のスレッドがスタックとして同じメモリー領域を\n"
3687 "使おうとするため、訳の分からない状況が発生してしまう。"
3690 #: build/C/man3/pthread_attr_setstack.3:180
3692 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3693 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3694 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3696 "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), "
3697 "B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), "
3698 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3701 #: build/C/man3/pthread_attr_setstackaddr.3:26
3703 msgid "PTHREAD_ATTR_SETSTACKADDR"
3704 msgstr "PTHREAD_ATTR_SETSTACKADDR"
3707 #: build/C/man3/pthread_attr_setstackaddr.3:30
3709 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
3710 "attribute in thread attributes object"
3712 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
3713 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
3716 #: build/C/man3/pthread_attr_setstackaddr.3:38
3719 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3720 "B<int pthread_attr_getstackaddr(const pthread_attr_t *>I<attr>B<,>\n"
3721 "B< void **>I<stackaddr>B<);>\n"
3723 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
3724 "B<int pthread_attr_getstackaddr(const pthread_attr_t *>I<attr>B<,>\n"
3725 "B< void **>I<stackaddr>B<);>\n"
3728 #: build/C/man3/pthread_attr_setstackaddr.3:49
3730 "These functions are obsolete: B<do not use them.> Use "
3731 "B<pthread_attr_setstack>(3) and B<pthread_attr_getstack>(3) instead."
3733 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
3734 "代わりに B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使うこ"
3738 #: build/C/man3/pthread_attr_setstackaddr.3:60
3740 "The B<pthread_attr_setstackaddr>() function sets the stack address "
3741 "attribute of the thread attributes object referred to by I<attr> to the "
3742 "value specified in I<stackaddr>. This attribute specifies the location of "
3743 "the stack that should be used by a thread that is created using the thread "
3744 "attributes object I<attr>."
3746 "B<pthread_attr_setstackaddr>() 関数は、\n"
3747 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3748 "属性を I<stackaddr> で指定された値に設定する。\n"
3749 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3750 "作成されるスレッドが使用すべきスタックの位置が指定される。"
3753 #: build/C/man3/pthread_attr_setstackaddr.3:66
3755 "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes "
3756 "that was allocated by the caller. The pages of the allocated buffer should "
3757 "be both readable and writable."
3759 "I<stackaddr> は呼び出し側が割り当てたバッファー (大きさは\n"
3760 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
3761 "割り当てられたバッファーのページは読み書き両方が可能なページと\n"
3765 #: build/C/man3/pthread_attr_setstackaddr.3:74
3767 "The B<pthread_attr_getstackaddr>() function returns the stack address "
3768 "attribute of the thread attributes object referred to by I<attr> in the "
3769 "buffer pointed to by I<stackaddr>."
3771 "B<pthread_attr_getstackaddr>() は、\n"
3772 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3773 "I<stackaddr> が指すバッファーに入れて返す。"
3776 #: build/C/man3/pthread_attr_setstackaddr.3:81
3778 "No errors are defined (but applications should nevertheless handle a "
3779 "possible error return)."
3781 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
3782 "返り値を処理するようにすべきである)。"
3785 #: build/C/man3/pthread_attr_setstackaddr.3:94
3788 "B<pthread_attr_setstackaddr>(),\n"
3789 "B<pthread_attr_getstackaddr>()"
3791 "B<pthread_attr_setstackaddr>(),\n"
3792 "B<pthread_attr_getstackaddr>()"
3795 #: build/C/man3/pthread_attr_setstackaddr.3:99
3797 "POSIX.1-2001 specifies these functions but marks them as obsolete. "
3798 "POSIX.1-2008 removes the specification of these functions."
3800 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
3801 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
3804 #: build/C/man3/pthread_attr_setstackaddr.3:123
3806 "I<Do not use these functions!> They cannot be portably used, since they "
3807 "provide no way of specifying the direction of growth or the range of the "
3808 "stack. For example, on architectures with a stack that grows downward, "
3809 "I<stackaddr> specifies the next address past the I<highest> address of the "
3810 "allocated stack area. However, on architectures with a stack that grows "
3811 "upward, I<stackaddr> specifies the I<lowest> address in the allocated stack "
3812 "area. By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3) "
3813 "and B<pthread_attr_getstack>(3), is always a pointer to the lowest address "
3814 "in the allocated stack area (and the I<stacksize> argument specifies the "
3815 "range of the stack)."
3817 "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n"
3818 "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n"
3819 "かを指定する手段が提供されていないからである。\n"
3820 "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャー\n"
3821 "では、I<stackaddr> には割り当てられたスタック領域のI<最も大きな>アドレ\n"
3822 "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n"
3823 "方向) に伸びるアーキテクチャーでは、I<stackaddr> には割り当てられた\n"
3824 "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n"
3825 "B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) が使用する\n"
3826 "I<stackaddr> は、常に割り当てられたスタック領域の最も小さいアドレス\n"
3827 "へのポインターである (I<stacksize> 引数はスタックの範囲を指定する)。"
3830 #: build/C/man3/pthread_attr_setstackaddr.3:129
3832 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3833 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3835 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3836 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3839 #: build/C/man3/pthread_attr_setstacksize.3:26
3841 msgid "PTHREAD_ATTR_SETSTACKSIZE"
3842 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
3845 #: build/C/man3/pthread_attr_setstacksize.3:30
3847 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
3848 "attribute in thread attributes object"
3850 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
3851 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
3854 #: build/C/man3/pthread_attr_setstacksize.3:38
3857 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3858 "B<int pthread_attr_getstacksize(const pthread_attr_t *>I<attr>B<,>\n"
3859 "B< size_t *>I<stacksize>B<);>\n"
3861 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
3862 "B<int pthread_attr_getstacksize(const pthread_attr_t *>I<attr>B<,>\n"
3863 "B< size_t *>I<stacksize>B<);>\n"
3866 #: build/C/man3/pthread_attr_setstacksize.3:49
3868 "The B<pthread_attr_setstacksize>() function sets the stack size attribute "
3869 "of the thread attributes object referred to by I<attr> to the value "
3870 "specified in I<stacksize>."
3872 "B<pthread_attr_setstacksize>() 関数は、\n"
3873 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3874 "属性を I<stacksize> で指定された値に設定する。"
3877 #: build/C/man3/pthread_attr_setstacksize.3:53
3879 "The stack size attribute determines the minimum size (in bytes) that will be "
3880 "allocated for threads created using the thread attributes object I<attr>."
3883 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
3884 "に割り当てられる最小サイズ (バイト単位) が決定される。"
3887 #: build/C/man3/pthread_attr_setstacksize.3:61
3889 "The B<pthread_attr_getstacksize>() function returns the stack size "
3890 "attribute of the thread attributes object referred to by I<attr> in the "
3891 "buffer pointed to by I<stacksize>."
3893 "B<pthread_attr_getstacksize>() は、\n"
3894 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3895 "I<stacksize> が指すバッファーに入れて返す。"
3898 #: build/C/man3/pthread_attr_setstacksize.3:67
3899 msgid "B<pthread_attr_setstacksize>() can fail with the following error:"
3900 msgstr "B<pthread_attr_setstacksize>() は以下のエラーで失敗する場合がある。"
3903 #: build/C/man3/pthread_attr_setstacksize.3:72
3904 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
3905 msgstr "スタックサイズが B<PTHREAD_STACK_MIN> (16384) バイト未満である。"
3909 #: build/C/man3/pthread_attr_setstacksize.3:81
3911 "On some systems, B<pthread_attr_setstacksize>() can fail with the error "
3912 "B<EINVAL> if I<stacksize> is not a multiple of the system page size."
3914 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
3915 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
3916 "エラー B<EINVAL> で失敗する。"
3919 #: build/C/man3/pthread_attr_setstacksize.3:94
3922 "B<pthread_attr_setstacksize>(),\n"
3923 "B<pthread_attr_getstacksize>()"
3925 "B<pthread_attr_setstacksize>(),\n"
3926 "B<pthread_attr_getstacksize>()"
3929 #: build/C/man3/pthread_attr_setstacksize.3:101
3931 "For details on the default stack size of new threads, see "
3932 "B<pthread_create>(3)."
3934 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
3935 "B<pthread_create>(3) を参照。"
3938 #: build/C/man3/pthread_attr_setstacksize.3:104
3940 "A thread's stack size is fixed at the time of thread creation. Only the "
3941 "main thread can dynamically grow its stack."
3943 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
3944 "メインスレッドだけがスタックを動的に伸ばすことができる。"
3947 #: build/C/man3/pthread_attr_setstacksize.3:109
3949 "The B<pthread_attr_setstack>(3) function allows an application to set both "
3950 "the size and location of a caller-allocated stack that is to be used by a "
3953 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
3954 "アプリケーションは、スレッドが使用するスタックとして、\n"
3955 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
3958 #: build/C/man3/pthread_attr_setstacksize.3:121
3960 "As at glibc 2.8, if the specified I<stacksize> is not a multiple of "
3961 "B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded "
3962 "I<downward>, in violation of POSIX.1, which says that the allocated stack "
3963 "will be at least I<stacksize> bytes."
3964 msgstr "glibc 2.8 の時点では、指定された I<stacksize> が B<STACK_ALIGN> (ほとんどのアーキテクチャーでは 16 バイト) の倍数でない場合、 I<stacksize> はI<小さくなる方向に>に丸められる。これは POSIX.1 に違反している。 POSIX.1 では、割り当てらたスタックの大きさは少なくとも I<stacksize> バイトになると書かれている。"
3967 #: build/C/man3/pthread_attr_setstacksize.3:124 build/C/man3/pthread_join.3:143
3968 msgid "See B<pthread_create>(3)."
3969 msgstr "B<pthread_create>(3) を参照。"
3972 #: build/C/man3/pthread_attr_setstacksize.3:131
3974 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3975 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3977 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), "
3978 "B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
3981 #: build/C/man3/pthread_cancel.3:26
3983 msgid "PTHREAD_CANCEL"
3984 msgstr "PTHREAD_CANCEL"
3987 #: build/C/man3/pthread_cancel.3:29
3988 msgid "pthread_cancel - send a cancellation request to a thread"
3989 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
3992 #: build/C/man3/pthread_cancel.3:34
3994 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3995 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3998 #: build/C/man3/pthread_cancel.3:49
4000 "The B<pthread_cancel>() function sends a cancellation request to the thread "
4001 "I<thread>. Whether and when the target thread reacts to the cancellation "
4002 "request depends on two attributes that are under the control of that thread: "
4003 "its cancelability I<state> and I<type>."
4005 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
4006 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
4007 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
4008 "I<state> と I<type>により決まる。"
4011 #: build/C/man3/pthread_cancel.3:61
4013 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
4014 "can be I<enabled> (the default for new threads) or I<disabled>. If a thread "
4015 "has disabled cancellation, then a cancellation request remains queued until "
4016 "the thread enables cancellation. If a thread has enabled cancellation, then "
4017 "its cancelability type determines when cancellation occurs."
4019 "あるスレッドの cancelability state は B<pthread_setcancelstate>(3) で\n"
4020 "設定され、I<enabled> と I<disabled> のいずれとなる (I<enabled> が新しい\n"
4021 "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n"
4022 "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n"
4023 "れたままになる。スレッドがキャンセルを有効にしていた場合、\n"
4024 "cancelability type によって、いつキャンセルが発生するかが決まる。"
4027 #: build/C/man3/pthread_cancel.3:77
4029 "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may "
4030 "be either I<asynchronous> or I<deferred> (the default for new threads). "
4031 "Asynchronous cancelability means that the thread can be canceled at any time "
4032 "(usually immediately, but the system does not guarantee this). Deferred "
4033 "cancelability means that cancellation will be delayed until the thread next "
4034 "calls a function that is a I<cancellation point>. A list of functions that "
4035 "are or may be cancellation points is provided in B<pthreads>(7)."
4037 "スレッドのキャンセル種別 (cancelability type) は\n"
4038 "B<pthread_setcanceltype>(3) で設定され、I<asynchronous> か I<deferred>\n"
4039 "のいずれかとなる(I<deferred> が新しいスレッドのデフォルト値である)。\n"
4040 "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつで\n"
4041 "もキャンセルされることを意味する (通常はすぐにキャンセルされるが、\n"
4042 "システムがそのことを保証しているわけではない)。遅延キャンセル\n"
4043 "(deferred cancelability) では、そのスレッドが I<取り消しポイント\n"
4044 "(cancellation point)> となっている関数を次に呼び出すまでキャンセルが\n"
4045 "遅延される。取り消しポイントに設定されていたり設定\n"
4046 "したりできる関数のリストは B<pthreads>(7) に記載している。"
4049 #: build/C/man3/pthread_cancel.3:81
4051 "When a cancellation requested is acted on, the following steps occur for "
4052 "I<thread> (in this order):"
4055 "I<thread> では以下のステップが (この順序で) 行われる。"
4058 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:69
4064 #: build/C/man3/pthread_cancel.3:86
4066 "Cancellation clean-up handlers are popped (in the reverse of the order in "
4067 "which they were pushed) and called. (See B<pthread_cleanup_push>(3).)"
4069 "キャンセルクリーンアップハンドラーが (push されたのと逆順で)\n"
4070 "取り出され (pop され)、呼び出される。\n"
4071 "(B<pthread_cleanup_push>(3) 参照)"
4074 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:73
4080 #: build/C/man3/pthread_cancel.3:91
4082 "Thread-specific data destructors are called, in an unspecified order. (See "
4083 "B<pthread_key_create>(3).)"
4085 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
4086 "呼び出し順序は規定されていない。\n"
4087 "(B<pthread_key_create>(3) 参照)"
4090 #: build/C/man3/pthread_cancel.3:91 build/C/man3/pthread_cleanup_push.3:83
4096 #: build/C/man3/pthread_cancel.3:95
4097 msgid "The thread is terminated. (See B<pthread_exit>(3).)"
4098 msgstr "スレッドが終了される。 (B<pthread_exit>(3) 参照)"
4101 #: build/C/man3/pthread_cancel.3:103
4103 "The above steps happen asynchronously with respect to the "
4104 "B<pthread_cancel>() call; the return status of B<pthread_cancel>() merely "
4105 "informs the caller whether the cancellation request was successfully queued."
4107 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
4108 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
4109 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
4112 #: build/C/man3/pthread_cancel.3:112
4114 "After a canceled thread has terminated, a join with that thread using "
4115 "B<pthread_join>(3) obtains B<PTHREAD_CANCELED> as the thread's exit "
4116 "status. (Joining with a thread is the only way to know that cancellation "
4119 "キャンセルされたスレッドが終了された後に、\n"
4120 "B<pthread_join>(3) でそのスレッドを join すると、\n"
4121 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
4122 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
4125 #: build/C/man3/pthread_cancel.3:117
4127 "On success, B<pthread_cancel>() returns 0; on error, it returns a nonzero "
4130 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
4131 "エラーの場合、0 以外のエラー番号を返す。"
4134 #: build/C/man3/pthread_cancel.3:118 build/C/man3/pthread_detach.3:59
4135 #: build/C/man3/pthread_getcpuclockid.3:61 build/C/man3/pthread_join.3:93
4136 #: build/C/man3/pthread_setaffinity_np.3:110
4137 #: build/C/man3/pthread_setschedparam.3:114
4138 #: build/C/man3/pthread_setschedprio.3:70 build/C/man3/pthread_sigqueue.3:86
4144 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_detach.3:64
4145 #: build/C/man3/pthread_getcpuclockid.3:66 build/C/man3/pthread_join.3:98
4146 #: build/C/man3/pthread_setaffinity_np.3:115
4147 #: build/C/man3/pthread_setschedparam.3:119
4148 #: build/C/man3/pthread_setschedprio.3:75
4149 msgid "No thread with the ID I<thread> could be found."
4150 msgstr "ID が I<thread> のスレッドが見つからなかった。"
4153 #: build/C/man3/pthread_cancel.3:135
4155 msgid "B<pthread_cancel>()"
4156 msgstr "B<pthread_cancel>()"
4159 #: build/C/man3/pthread_cancel.3:148
4161 "On Linux, cancellation is implemented using signals. Under the NPTL "
4162 "threading implementation, the first real-time signal (i.e., signal 32) is "
4163 "used for this purpose. On LinuxThreads, the second real-time signal is "
4164 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
4166 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装で"
4168 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
4169 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイ"
4171 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
4174 #: build/C/man3/pthread_cancel.3:154
4176 "The program below creates a thread and then cancels it. The main thread "
4177 "joins with the canceled thread to check that its exit status was "
4178 "B<PTHREAD_CANCELED>. The following shell session shows what happens when we "
4181 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルす"
4183 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
4184 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
4185 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
4188 #: build/C/man3/pthread_cancel.3:162
4192 "thread_func(): started; cancellation disabled\n"
4193 "main(): sending cancellation request\n"
4194 "thread_func(): about to enable cancellation\n"
4195 "main(): thread was canceled\n"
4198 "thread_func(): started; cancellation disabled\n"
4199 "main(): sending cancellation request\n"
4200 "thread_func(): about to enable cancellation\n"
4201 "main(): thread was canceled\n"
4204 #: build/C/man3/pthread_cancel.3:172
4207 "#include E<lt>pthread.hE<gt>\n"
4208 "#include E<lt>stdio.hE<gt>\n"
4209 "#include E<lt>errno.hE<gt>\n"
4210 "#include E<lt>stdlib.hE<gt>\n"
4211 "#include E<lt>unistd.hE<gt>\n"
4213 "#include E<lt>pthread.hE<gt>\n"
4214 "#include E<lt>stdio.hE<gt>\n"
4215 "#include E<lt>errno.hE<gt>\n"
4216 "#include E<lt>stdlib.hE<gt>\n"
4217 "#include E<lt>unistd.hE<gt>\n"
4220 #: build/C/man3/pthread_cancel.3:180
4224 "thread_func(void *ignored_argument)\n"
4229 "thread_func(void *ignored_argument)\n"
4234 #: build/C/man3/pthread_cancel.3:183
4237 " /* Disable cancellation for a while, so that we don\\(aqt\n"
4238 " immediately react to a cancellation request */\n"
4240 " /* Disable cancellation for a while, so that we don\\(aqt\n"
4241 " immediately react to a cancellation request */\n"
4244 #: build/C/man3/pthread_cancel.3:187
4247 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
4249 " handle_error_en(s, \"pthread_setcancelstate\");\n"
4251 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
4253 " handle_error_en(s, \"pthread_setcancelstate\");\n"
4256 #: build/C/man3/pthread_cancel.3:191
4259 " printf(\"thread_func(): started; cancellation disabled\\en\");\n"
4261 " printf(\"thread_func(): about to enable cancellation\\en\");\n"
4263 " printf(\"thread_func(): started; cancellation disabled\\en\");\n"
4265 " printf(\"thread_func(): about to enable cancellation\\en\");\n"
4268 #: build/C/man3/pthread_cancel.3:195
4271 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
4273 " handle_error_en(s, \"pthread_setcancelstate\");\n"
4275 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
4277 " handle_error_en(s, \"pthread_setcancelstate\");\n"
4280 #: build/C/man3/pthread_cancel.3:197
4282 msgid " /* sleep() is a cancellation point */\n"
4283 msgstr " /* sleep() is a cancellation point */\n"
4286 #: build/C/man3/pthread_cancel.3:199
4288 msgid " sleep(1000); /* Should get canceled while we sleep */\n"
4289 msgstr " sleep(1000); /* Should get canceled while we sleep */\n"
4292 #: build/C/man3/pthread_cancel.3:201
4294 msgid " /* Should never get here */\n"
4295 msgstr " /* Should never get here */\n"
4298 #: build/C/man3/pthread_cancel.3:205
4301 " printf(\"thread_func(): not canceled!\\en\");\n"
4305 " printf(\"thread_func(): not canceled!\\en\");\n"
4310 #: build/C/man3/pthread_cancel.3:212
4328 #: build/C/man3/pthread_cancel.3:214
4330 msgid " /* Start a thread and then send it a cancellation request */\n"
4331 msgstr " /* Start a thread and then send it a cancellation request */\n"
4334 #: build/C/man3/pthread_cancel.3:218
4337 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
4339 " handle_error_en(s, \"pthread_create\");\n"
4341 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
4343 " handle_error_en(s, \"pthread_create\");\n"
4346 #: build/C/man3/pthread_cancel.3:220
4348 msgid " sleep(2); /* Give thread a chance to get started */\n"
4349 msgstr " sleep(2); /* Give thread a chance to get started */\n"
4352 #: build/C/man3/pthread_cancel.3:225
4355 " printf(\"main(): sending cancellation request\\en\");\n"
4356 " s = pthread_cancel(thr);\n"
4358 " handle_error_en(s, \"pthread_cancel\");\n"
4360 " printf(\"main(): sending cancellation request\\en\");\n"
4361 " s = pthread_cancel(thr);\n"
4363 " handle_error_en(s, \"pthread_cancel\");\n"
4366 #: build/C/man3/pthread_cancel.3:227
4368 msgid " /* Join with thread to see what its exit status was */\n"
4369 msgstr " /* Join with thread to see what its exit status was */\n"
4372 #: build/C/man3/pthread_cancel.3:231 build/C/man3/pthread_cleanup_push.3:321
4375 " s = pthread_join(thr, &res);\n"
4377 " handle_error_en(s, \"pthread_join\");\n"
4379 " s = pthread_join(thr, &res);\n"
4381 " handle_error_en(s, \"pthread_join\");\n"
4384 #: build/C/man3/pthread_cancel.3:238
4387 " if (res == PTHREAD_CANCELED)\n"
4388 " printf(\"main(): thread was canceled\\en\");\n"
4390 " printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
4391 " exit(EXIT_SUCCESS);\n"
4394 " if (res == PTHREAD_CANCELED)\n"
4395 " printf(\"main(): thread was canceled\\en\");\n"
4397 " printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
4398 " exit(EXIT_SUCCESS);\n"
4402 #: build/C/man3/pthread_cancel.3:251
4404 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
4405 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
4406 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4408 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
4409 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
4410 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4413 #: build/C/man3/pthread_cleanup_push.3:26
4415 msgid "PTHREAD_CLEANUP_PUSH"
4416 msgstr "PTHREAD_CLEANUP_PUSH"
4419 #: build/C/man3/pthread_cleanup_push.3:30
4421 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
4424 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
4425 "キャンセルクリーンアップハンドラーの push/pop を行う"
4428 #: build/C/man3/pthread_cleanup_push.3:37
4431 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
4432 "B< void *>I<arg>B<);>\n"
4433 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
4435 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
4436 "B< void *>I<arg>B<);>\n"
4437 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
4440 #: build/C/man3/pthread_cleanup_push.3:48
4442 "These functions manipulate the calling thread's stack of thread-cancellation "
4443 "clean-up handlers. A clean-up handler is a function that is automatically "
4444 "executed when a thread is canceled (or in various other circumstances "
4445 "described below); it might, for example, unlock a mutex so that it becomes "
4446 "available to other threads in the process."
4448 "これらの関数は、呼び出したスレッドのスレッドキャンセル時のクリーンアッ\n"
4449 "プハンドラーのスタックの操作を行う。クリーンアップハンドラーは、スレッドが\n"
4450 "キャンセルされた場合 (や以下で説明する他の種々の状況において) 自動的に\n"
4451 "実行される関数である。例えば、mutex のロック解除を行い、プロセス内の\n"
4452 "他のスレッドが利用できるようにする関数などが考えられる。"
4455 #: build/C/man3/pthread_cleanup_push.3:59
4457 "The B<pthread_cleanup_push>() function pushes I<routine> onto the top of "
4458 "the stack of clean-up handlers. When I<routine> is later invoked, it will "
4459 "be given I<arg> as its argument."
4461 "B<pthread_cleanup_push>() 関数は、 I<routine> をクリーンアップ\n"
4462 "ハンドラーのスタックの一番上にプッシュする。 I<routine> が後で\n"
4463 "起動される際には、 I<arg> が関数の引数と渡される。"
4466 #: build/C/man3/pthread_cleanup_push.3:66
4468 "The B<pthread_cleanup_pop>() function removes the routine at the top of the "
4469 "stack of clean-up handlers, and optionally executes it if I<execute> is "
4472 "B<pthread_cleanup_pop>() 関数は、クリーンアップハンドラーの\n"
4473 "スタックの一番上のルーチンを削除する。\n"
4474 "I<execute> が 0 以外の場合にはそのルーチンを追加で実行する。"
4477 #: build/C/man3/pthread_cleanup_push.3:69
4479 "A cancellation clean-up handler is popped from the stack and executed in the "
4480 "following circumstances:"
4482 "キャンセルクリーンアップハンドラーは、以下に示す場合に\n"
4486 #: build/C/man3/pthread_cleanup_push.3:73
4488 "When a thread is canceled, all of the stacked clean-up handlers are popped "
4489 "and executed in the reverse of the order in which they were pushed onto the "
4492 "スレッドがキャンセルされた際に、スタックに登録された全てのクリーン\n"
4493 "アップハンドラーが取り出されて、実行される。クリーンアップハンドラーの\n"
4494 "実行は、スタックに登録されたのと逆の順序で行われる。"
4497 #: build/C/man3/pthread_cleanup_push.3:83
4499 "When a thread terminates by calling B<pthread_exit>(3), all clean-up "
4500 "handlers are executed as described in the preceding point. (Clean-up "
4501 "handlers are I<not> called if the thread terminates by performing a "
4502 "I<return> from the thread start function.)"
4504 "スレッドが B<pthread_exit>(3) を呼び出して終了する際に、全てのクリーン\n"
4505 "アップハンドラーが上の項目で述べたのと同様に実行される。\n"
4506 "(スレッドがスレッド開始関数からの I<return> の実行により終了する場合に\n"
4507 "は、クリーンアップハンドラーはI<呼び出されない>。)"
4510 #: build/C/man3/pthread_cleanup_push.3:89
4512 "When a thread calls B<pthread_cleanup_pop>() with a nonzero I<execute> "
4513 "argument, the top-most clean-up handler is popped and executed."
4515 "スレッドが 0 以外の I<execute> 引数で B<pthread_cleanup_pop>() を\n"
4516 "呼び出した際に、スタックの一番上のクリーンアップハンドラーが取り出されて\n"
4520 #: build/C/man3/pthread_cleanup_push.3:101
4522 "POSIX.1 permits B<pthread_cleanup_push>() and B<pthread_cleanup_pop>() to "
4523 "be implemented as macros that expand to text containing \\(aqB<{>\\(aq and "
4524 "\\(aqB<}>\\(aq, respectively. For this reason, the caller must ensure that "
4525 "calls to these functions are paired within the same function, and at the "
4526 "same lexical nesting level. (In other words, a clean-up handler is "
4527 "established only during the execution of a specified section of code.)"
4529 "POSIX.1 では、 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>() を\n"
4530 "それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開するマクロと\n"
4531 "して実装することを許容している。\n"
4532 "このため、呼び出し側では、これらの関数の呼び出しが同じ関数の中で対と\n"
4533 "なり、かつ文法的に同じネストレベル (nesting level) になることを保証\n"
4534 "しなければならない。 (言い換えると、クリーンアップハンドラーは、コード\n"
4535 "の特定のセクションの実行の中でのみ設定するものであると言える。)"
4538 #: build/C/man3/pthread_cleanup_push.3:121
4540 "Calling B<longjmp>(3) (B<siglongjmp>(3)) produces undefined results if any "
4541 "call has been made to B<pthread_cleanup_push>() or "
4542 "B<pthread_cleanup_pop>() without the matching call of the pair since the "
4543 "jump buffer was filled by B<setjmp>(3) (B<sigsetjmp>(3)). Likewise, "
4544 "calling B<longjmp>(3) (B<siglongjmp>(3)) from inside a clean-up handler "
4545 "produces undefined results unless the jump buffer was also filled by "
4546 "B<setjmp>(3) (B<sigsetjmp>(3)) inside the handler."
4548 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しは、\n"
4549 "B<pthread_cleanup_push>() や B<pthread_cleanup_pop>() の呼び出しが対と\n"
4550 "なる呼び出しがない状態で行われた場合には、どのような結果になるかは不定\n"
4551 "である。これは jump バッファーは B<setjmp>(3) (B<sigsetjmp>(3)) により設\n"
4552 "定されるからである。同様に、クリーンアップハンドラー内からの\n"
4553 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しも、jump バッファーがハンドラー\n"
4554 "内で B<setjmp>(3) (B<sigsetjmp>(3)) で設定されていない限り、どのような\n"
4558 #: build/C/man3/pthread_cleanup_push.3:123
4559 msgid "These functions do not return a value."
4560 msgstr "これらの関数は値を返さない。"
4563 #. Available since glibc 2.0
4565 #: build/C/man3/pthread_cleanup_push.3:127
4566 msgid "There are no errors."
4570 #: build/C/man3/pthread_cleanup_push.3:138
4573 "B<pthread_cleanup_push>(),\n"
4574 "B<pthread_cleanup_pop>()"
4576 "B<pthread_cleanup_push>(),\n"
4577 "B<pthread_cleanup_pop>()"
4580 #: build/C/man3/pthread_cleanup_push.3:154
4582 "On Linux, the B<pthread_cleanup_push>() and B<pthread_cleanup_pop>() "
4583 "functions I<are> implemented as macros that expand to text containing "
4584 "\\(aqB<{>\\(aq and \\(aqB<}>\\(aq, respectively. This means that variables "
4585 "declared within the scope of paired calls to these functions will be visible "
4586 "within only that scope."
4588 "Linux では、関数 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>()\n"
4589 "は、それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開する\n"
4590 "マクロとして実装されている。このことは、これらの関数を対で呼び出した\n"
4591 "スコープ内で宣言された変数は、そのスコープの中でしか参照できない\n"
4594 #. The text was actually added in the 2004 TC2
4596 #: build/C/man3/pthread_cleanup_push.3:169
4598 "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or "
4599 "I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>() "
4600 "and B<pthread_cleanup_pop>() is undefined. Portable applications should "
4603 "POSIX.1 には、括弧を含む B<pthread_cleanup_push>() と\n"
4604 "B<pthread_cleanup_pop>() のブロックをそのままにしたままで、 \n"
4605 "I<return>, I<break>, I<continue>, I<goto> を使った場合の影響は\n"
4607 "移植性が必要なアプリケーションではこれを行うのは避けるべきである。"
4610 #: build/C/man3/pthread_cleanup_push.3:184
4612 "The program below provides a simple example of the use of the functions "
4613 "described in this page. The program creates a thread that executes a loop "
4614 "bracketed by B<pthread_cleanup_push>() and B<pthread_cleanup_pop>(). This "
4615 "loop increments a global variable, I<cnt>, once each second. Depending on "
4616 "what command-line arguments are supplied, the main thread sends the other "
4617 "thread a cancellation request, or sets a global variable that causes the "
4618 "other thread to exit its loop and terminate normally (by doing a I<return>)."
4620 "以下のプログラムは、このページで説明した関数の簡単な使用例を示すもので\n"
4621 "ある。このプログラムは B<pthread_cleanup_push>() と\n"
4622 "B<pthread_cleanup_pop>() で囲まれたループを実行するスレッドを作成する。\n"
4623 "このループではグローバル変数 I<cnt> を 1 秒に 1 ずつ増やしていく。\n"
4624 "指定されたコマンドライン引数の内容に基づいて、メインスレッドはもう一\n"
4625 "つのスレッドにキャンセル要求を送ったり、もう一つのスレッドがループを\n"
4626 "抜けて (I<return> を呼び出して) 正常終了するようにグローバル変数を\n"
4630 #: build/C/man3/pthread_cleanup_push.3:187
4632 "In the following shell session, the main thread sends a cancellation request "
4633 "to the other thread:"
4635 "以下のシェルセッションでは、メインスレッドはもう一つのスレッドに\n"
4639 #: build/C/man3/pthread_cleanup_push.3:197
4643 "New thread started\n"
4646 "Canceling thread\n"
4647 "Called clean-up handler\n"
4648 "Thread was canceled; cnt = 0\n"
4651 "New thread started\n"
4654 "Canceling thread\n"
4655 "Called clean-up handler\n"
4656 "Thread was canceled; cnt = 0\n"
4659 #: build/C/man3/pthread_cleanup_push.3:205
4661 "From the above, we see that the thread was canceled, and that the "
4662 "cancellation clean-up handler was called and it reset the value of the "
4663 "global variable I<cnt> to 0."
4665 "上記の実行例から、スレッドがキャンセルされ、\n"
4666 "キャンセルクリーンアップハンドラーが呼び出され、\n"
4667 "グローバル変数 I<cnt> の値が 0 にリセットされていることが確認できる。"
4670 #: build/C/man3/pthread_cleanup_push.3:208
4672 "In the next run, the main program sets a global variable that causes other "
4673 "thread to terminate normally:"
4675 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4676 "もう一つのスレッドが正常終了するようにしている。"
4679 #: build/C/man3/pthread_cleanup_push.3:216
4683 "New thread started\n"
4686 "Thread terminated normally; cnt = 2\n"
4689 "New thread started\n"
4692 "Thread terminated normally; cnt = 2\n"
4695 #: build/C/man3/pthread_cleanup_push.3:224
4697 "From the above, we see that the clean-up handler was not executed (because "
4698 "I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
4700 "上記では、 (I<cleanup_pop_arg> が 0 なので) クリーンアップハンドラーは\n"
4701 "実行されておらず、その結果 I<cnt> の値はリセットされていないことが\n"
4705 #: build/C/man3/pthread_cleanup_push.3:229
4707 "In the next run, the main program sets a global variable that causes the "
4708 "other thread to terminate normally, and supplies a nonzero value for "
4709 "I<cleanup_pop_arg>:"
4711 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4712 "もう一つのスレッドが正常終了するようにし、さらに\n"
4713 "I<cleanup_pop_arg> に 0 以外の値を渡している。"
4716 #: build/C/man3/pthread_cleanup_push.3:238
4719 "$ B<./a.out x 1>\n"
4720 "New thread started\n"
4723 "Called clean-up handler\n"
4724 "Thread terminated normally; cnt = 0\n"
4726 "$ B<./a.out x 1>\n"
4727 "New thread started\n"
4730 "Called clean-up handler\n"
4731 "Thread terminated normally; cnt = 0\n"
4734 #: build/C/man3/pthread_cleanup_push.3:245
4736 "In the above, we see that although the thread was not canceled, the clean-up "
4737 "handler was executed, because the argument given to "
4738 "B<pthread_cleanup_pop>() was nonzero."
4739 msgstr "上記では、スレッドはキャンセルされていないが、クリーンアップハンドラーが実行されたことが分かる。これは B<pthread_cleanup_pop>() の引数に 0 以外を渡したからである。"
4742 #: build/C/man3/pthread_cleanup_push.3:254
4745 "#include E<lt>pthread.hE<gt>\n"
4746 "#include E<lt>sys/types.hE<gt>\n"
4747 "#include E<lt>stdio.hE<gt>\n"
4748 "#include E<lt>stdlib.hE<gt>\n"
4749 "#include E<lt>unistd.hE<gt>\n"
4750 "#include E<lt>errno.hE<gt>\n"
4752 "#include E<lt>pthread.hE<gt>\n"
4753 "#include E<lt>sys/types.hE<gt>\n"
4754 "#include E<lt>stdio.hE<gt>\n"
4755 "#include E<lt>stdlib.hE<gt>\n"
4756 "#include E<lt>unistd.hE<gt>\n"
4757 "#include E<lt>errno.hE<gt>\n"
4760 #: build/C/man3/pthread_cleanup_push.3:261
4763 "static int done = 0;\n"
4764 "static int cleanup_pop_arg = 0;\n"
4765 "static int cnt = 0;\n"
4767 "static int done = 0;\n"
4768 "static int cleanup_pop_arg = 0;\n"
4769 "static int cnt = 0;\n"
4772 #: build/C/man3/pthread_cleanup_push.3:268
4776 "cleanup_handler(void *arg)\n"
4778 " printf(\"Called clean-up handler\\en\");\n"
4783 "cleanup_handler(void *arg)\n"
4785 " printf(\"Called clean-up handler\\en\");\n"
4790 #: build/C/man3/pthread_cleanup_push.3:273
4794 "thread_start(void *arg)\n"
4796 " time_t start, curr;\n"
4799 "thread_start(void *arg)\n"
4801 " time_t start, curr;\n"
4804 #: build/C/man3/pthread_cleanup_push.3:275
4806 msgid " printf(\"New thread started\\en\");\n"
4807 msgstr " printf(\"New thread started\\en\");\n"
4810 #: build/C/man3/pthread_cleanup_push.3:277
4812 msgid " pthread_cleanup_push(cleanup_handler, NULL);\n"
4813 msgstr " pthread_cleanup_push(cleanup_handler, NULL);\n"
4816 #: build/C/man3/pthread_cleanup_push.3:279
4818 msgid " curr = start = time(NULL);\n"
4819 msgstr " curr = start = time(NULL);\n"
4822 #: build/C/man3/pthread_cleanup_push.3:288
4825 " while (!done) {\n"
4826 " pthread_testcancel(); /* A cancellation point */\n"
4827 " if (curr E<lt> time(NULL)) {\n"
4828 " curr = time(NULL);\n"
4829 " printf(\"cnt = %d\\en\", cnt); /* A cancellation point */\n"
4834 " while (!done) {\n"
4835 " pthread_testcancel(); /* A cancellation point */\n"
4836 " if (curr E<lt> time(NULL)) {\n"
4837 " curr = time(NULL);\n"
4838 " printf(\"cnt = %d\\en\", cnt); /* A cancellation point */\n"
4844 #: build/C/man3/pthread_cleanup_push.3:292
4847 " pthread_cleanup_pop(cleanup_pop_arg);\n"
4851 " pthread_cleanup_pop(cleanup_pop_arg);\n"
4856 #: build/C/man3/pthread_cleanup_push.3:299
4860 "main(int argc, char *argv[])\n"
4867 "main(int argc, char *argv[])\n"
4874 #: build/C/man3/pthread_cleanup_push.3:303
4877 " s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4879 " handle_error_en(s, \"pthread_create\");\n"
4881 " s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4883 " handle_error_en(s, \"pthread_create\");\n"
4886 #: build/C/man3/pthread_cleanup_push.3:305
4888 msgid " sleep(2); /* Allow new thread to run a while */\n"
4889 msgstr " sleep(2); /* Allow new thread to run a while */\n"
4892 #: build/C/man3/pthread_cleanup_push.3:310
4895 " if (argc E<gt> 1) {\n"
4896 " if (argc E<gt> 2)\n"
4897 " cleanup_pop_arg = atoi(argv[2]);\n"
4900 " if (argc E<gt> 1) {\n"
4901 " if (argc E<gt> 2)\n"
4902 " cleanup_pop_arg = atoi(argv[2]);\n"
4906 #: build/C/man3/pthread_cleanup_push.3:317
4910 " printf(\"Canceling thread\\en\");\n"
4911 " s = pthread_cancel(thr);\n"
4913 " handle_error_en(s, \"pthread_cancel\");\n"
4917 " printf(\"Canceling thread\\en\");\n"
4918 " s = pthread_cancel(thr);\n"
4920 " handle_error_en(s, \"pthread_cancel\");\n"
4924 #: build/C/man3/pthread_cleanup_push.3:328
4927 " if (res == PTHREAD_CANCELED)\n"
4928 " printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4930 " printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4931 " exit(EXIT_SUCCESS);\n"
4934 " if (res == PTHREAD_CANCELED)\n"
4935 " printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4937 " printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4938 " exit(EXIT_SUCCESS);\n"
4942 #: build/C/man3/pthread_cleanup_push.3:335
4944 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4945 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4947 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4948 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4951 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
4953 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4954 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4957 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
4959 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
4960 "thread cancellation clean-up handlers while saving cancelability type"
4962 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - "
4963 "cancelability type を保持したままでスレッドのキャンセルクリーンアップハンド"
4967 #: build/C/man3/pthread_cleanup_push_defer_np.3:37
4970 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4971 "B< void *>I<arg>B<);>\n"
4972 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4974 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
4975 "B< void *>I<arg>B<);>\n"
4976 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
4979 #: build/C/man3/pthread_cleanup_push_defer_np.3:40
4980 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
4981 #: build/C/man3/pthread_join.3:37 build/C/man3/pthread_kill.3:37
4982 #: build/C/man3/pthread_setname_np.3:39 build/C/man3/pthread_sigmask.3:38
4983 #: build/C/man3/pthread_sigqueue.3:38 build/C/man3/pthread_tryjoin_np.3:42
4984 #: build/C/man3/pthread_yield.3:37 build/C/man3/pthread_mutex_consistent.3:37
4985 #: build/C/man3/pthread_mutexattr_getpshared.3:40
4986 #: build/C/man3/pthread_mutexattr_init.3:38
4987 #: build/C/man3/pthread_mutexattr_setrobust.3:41
4988 #: build/C/man3/pthread_spin_init.3:37 build/C/man3/pthread_spin_lock.3:39
4989 msgid "Compile and link with I<-pthread>."
4990 msgstr "I<-pthread> を付けてコンパイルとリンクを行う。"
4993 #: build/C/man3/pthread_cleanup_push_defer_np.3:49
4994 msgid "B<pthread_cleanup_push_defer_np>(), B<pthread_cleanup_pop_defer_np>():"
4995 msgstr "B<pthread_cleanup_push_defer_np>(), B<pthread_cleanup_pop_defer_np>():"
4998 #: build/C/man3/pthread_cleanup_push_defer_np.3:51
5000 msgstr "_GNU_SOURCE"
5003 #: build/C/man3/pthread_cleanup_push_defer_np.3:59
5005 "These functions are the same as B<pthread_cleanup_push>(3) and "
5006 "B<pthread_cleanup_pop>(3), except for the differences noted on this page."
5008 "これらの関数は B<pthread_cleanup_push>(3) と B<pthread_cleanup_pop>(3) と同じ"
5009 "だが、このページで説明する点が異なる。"
5012 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
5014 "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>() pushes "
5015 "I<routine> onto the thread's stack of cancellation clean-up handlers. In "
5016 "addition, it also saves the thread's current cancelability type, and sets "
5017 "the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); "
5018 "this ensures that cancellation clean-up will occur even if the thread's "
5019 "cancelability type was \"asynchronous\" before the call."
5021 "B<pthread_cleanup_push>(3) と同様に、\n"
5022 "B<pthread_cleanup_push_defer_np>() は I<routine> をそのスレッドの\n"
5023 "クリーンアップハンドラーのスタックに追加する。これに加えて、\n"
5024 "B<pthread_cleanup_push_defer_np>() は現在の cancelability type も\n"
5025 "保存し、cancelability type は \"deferred\" に設定する\n"
5026 "(B<pthread_setcanceltype>(3) 参照)。\n"
5027 "これにより、この関数が呼び出される前のスレッドの cancelability type が\n"
5028 "\"asynchronous\" であったとしても、キャンセルクリーンアップが行われること\n"
5032 #: build/C/man3/pthread_cleanup_push_defer_np.3:81
5034 "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>() pops "
5035 "the top-most clean-up handler from the thread's stack of cancellation clean-"
5036 "up handlers. In addition, it restores the thread's cancelability type to "
5037 "its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
5039 "B<pthread_cleanup_pop>(3) と同様に、\n"
5040 "B<pthread_cleanup_pop_restore_np>() はそのスレッドのキャンセル\n"
5041 "クリーンアップハンドラーのスタックから一番上にあるクリーンアップハンドラー\n"
5042 "を取り出す。これに加えて、そのスレッドの cancelability type を、対応\n"
5043 "する B<pthread_cleanup_push_defer_np>() が呼ばれた時点の値に戻す。"
5046 #: build/C/man3/pthread_cleanup_push_defer_np.3:87
5048 "The caller must ensure that calls to these functions are paired within the "
5049 "same function, and at the same lexical nesting level. Other restrictions "
5050 "apply, as described in B<pthread_cleanup_push>(3)."
5052 "呼び出し側では、これらの関数の呼び出しが同じ関数の中で対となり、かつ\n"
5053 "文法的に同じネストレベル (nesting level) になることを保証しなければ\n"
5054 "ならない。 B<pthread_cleanup_push>(3) で説明されている他の制限も\n"
5058 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
5059 msgid "This sequence of calls:"
5063 #: build/C/man3/pthread_cleanup_push_defer_np.3:94
5066 "pthread_cleanup_push_defer_np(routine, arg);\n"
5067 "pthread_cleanup_pop_restore_np(execute);\n"
5069 "pthread_cleanup_push_defer_np(routine, arg);\n"
5070 "pthread_cleanup_pop_restore_np(execute);\n"
5073 #: build/C/man3/pthread_cleanup_push_defer_np.3:98
5074 msgid "is equivalent to (but shorter and more efficient than):"
5075 msgstr "と以下は等価である (但し、上の方がより簡潔で効率的である)。"
5078 #: build/C/man3/pthread_cleanup_push_defer_np.3:104
5080 msgid "int oldtype;\n"
5081 msgstr "int oldtype;\n"
5084 #: build/C/man3/pthread_cleanup_push_defer_np.3:110
5087 "pthread_cleanup_push(routine, arg);\n"
5088 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
5090 "pthread_setcanceltype(oldtype, NULL);\n"
5091 "pthread_cleanup_pop(execute);\n"
5093 "pthread_cleanup_push(routine, arg);\n"
5094 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
5096 "pthread_setcanceltype(oldtype, NULL);\n"
5097 "pthread_cleanup_pop(execute);\n"
5100 #: build/C/man3/pthread_cleanup_push_defer_np.3:123
5102 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
5103 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
5105 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
5106 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
5109 #: build/C/man3/pthread_create.3:26
5111 msgid "PTHREAD_CREATE"
5112 msgstr "PTHREAD_CREATE"
5115 #: build/C/man3/pthread_create.3:29
5116 msgid "pthread_create - create a new thread"
5117 msgstr "pthread_create - 新しいスレッドを作成する"
5120 #: build/C/man3/pthread_create.3:35
5123 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
5124 "B< void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
5126 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
5127 "B< void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
5130 #: build/C/man3/pthread_create.3:47
5132 "The B<pthread_create>() function starts a new thread in the calling "
5133 "process. The new thread starts execution by invoking I<start_routine>(); "
5134 "I<arg> is passed as the sole argument of I<start_routine>()."
5136 "B<pthread_create>() 関数は、呼び出したプロセス内に新しいスレッドを作成す"
5138 "新しいスレッドの実行は、 I<start_routine>() を起動することで開始される。\n"
5139 "I<start_routine>() は引数を一つだけ取り、\n"
5140 "I<arg> が I<start_routine>() の引数として渡される。"
5143 #: build/C/man3/pthread_create.3:49
5144 msgid "The new thread terminates in one of the following ways:"
5145 msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。"
5148 #: build/C/man3/pthread_create.3:49 build/C/man3/pthread_create.3:55
5149 #: build/C/man3/pthread_create.3:63 build/C/man3/pthread_create.3:66
5150 #: build/C/man3/pthread_getattr_np.3:52 build/C/man3/pthread_getattr_np.3:55
5151 #: build/C/man3/pthread_getattr_np.3:58 build/C/man3/pthread_atfork.3:47
5152 #: build/C/man3/pthread_atfork.3:52 build/C/man3/pthread_atfork.3:57
5153 #: build/C/man3/pthread_getattr_default_np.3:50
5154 #: build/C/man3/pthread_getattr_default_np.3:52
5155 #: build/C/man3/pthread_getattr_default_np.3:56 build/C/man7/nptl.7:49
5156 #: build/C/man7/nptl.7:52 build/C/man7/nptl.7:60 build/C/man7/nptl.7:66
5157 #: build/C/man7/nptl.7:75
5163 #: build/C/man3/pthread_create.3:55
5165 "It calls B<pthread_exit>(3), specifying an exit status value that is "
5166 "available to another thread in the same process that calls "
5167 "B<pthread_join>(3)."
5169 "スレッドが B<pthread_exit>(3) を呼び出す。\n"
5170 "B<pthread_exit>(3) を呼び出す際には終了ステータス値を指定する。\n"
5171 "この値は B<pthread_join>(3) を呼び出した同じプロセス内の\n"
5175 #: build/C/man3/pthread_create.3:63
5177 "It returns from I<start_routine>(). This is equivalent to calling "
5178 "B<pthread_exit>(3) with the value supplied in the I<return> statement."
5180 "スレッドが I<start_routine>() から返る。これは、\n"
5181 "I<return> 文に渡した値で B<pthread_exit>(3) を呼び出すのと等価である。"
5184 #: build/C/man3/pthread_create.3:66
5185 msgid "It is canceled (see B<pthread_cancel>(3))."
5186 msgstr "スレッドがキャンセルされる (B<pthread_cancel>(3) 参照)。"
5189 #: build/C/man3/pthread_create.3:72
5191 "Any of the threads in the process calls B<exit>(3), or the main thread "
5192 "performs a return from I<main>(). This causes the termination of all "
5193 "threads in the process."
5195 "プロセス内のいずれかのスレッドで B<exit>(3) が呼ばれるか、\n"
5196 "メインスレッドで I<main>() 内で return が実行される。\n"
5197 "この場合は、プロセス内の全てのスレッドが終了される。"
5200 #: build/C/man3/pthread_create.3:86
5202 "The I<attr> argument points to a I<pthread_attr_t> structure whose contents "
5203 "are used at thread creation time to determine attributes for the new thread; "
5204 "this structure is initialized using B<pthread_attr_init>(3) and related "
5205 "functions. If I<attr> is NULL, then the thread is created with default "
5208 "I<attr> 引数は I<pthread_attr_t> 構造体へのポインターであり、\n"
5209 "I<pthread_attr_t> 構造体の内容を使用して、スレッド作成時に\n"
5210 "新しいスレッドの属性が決定される。\n"
5211 "この構造体は B<pthread_attr_init>(3) や関連の関数を使って初期化される。\n"
5212 "I<attr> が NULL の場合、新しいスレッドはデフォルトの属性で作成される。"
5215 #: build/C/man3/pthread_create.3:93
5217 "Before returning, a successful call to B<pthread_create>() stores the ID of "
5218 "the new thread in the buffer pointed to by I<thread>; this identifier is "
5219 "used to refer to the thread in subsequent calls to other pthreads functions."
5221 "成功した場合は、 B<pthread_create>() は返る前に新しいスレッドの ID を\n"
5222 "I<thread> が指すバッファーに格納する。この ID は、これ以降に他の\n"
5223 "pthreads 関数の呼び出しでスレッドを参照するのに使用される。"
5226 #: build/C/man3/pthread_create.3:101
5228 "The new thread inherits a copy of the creating thread's signal mask "
5229 "(B<pthread_sigmask>(3)). The set of pending signals for the new thread is "
5230 "empty (B<sigpending>(2)). The new thread does not inherit the creating "
5231 "thread's alternate signal stack (B<sigaltstack>(2))."
5233 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスク\n"
5234 "(B<pthread_sigmask>(3) 参照) のコピーを継承する。\n"
5235 "新しいスレッドの処理待ちシグナル (B<sigpending>(2)) の集合は空となる。\n"
5236 "新しいスレッドはスレッドを作成したスレッドの代替シグナルスタック\n"
5237 "(B<sigaltstack>(2)) を継承しない。"
5240 #: build/C/man3/pthread_create.3:104
5242 "The new thread inherits the calling thread's floating-point environment "
5245 "新しいスレッドは呼び出したスレッドの浮動小数点環境 (B<fenv>(3))\n"
5248 #. CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
5250 #: build/C/man3/pthread_create.3:109
5252 "The initial value of the new thread's CPU-time clock is 0 (see "
5253 "B<pthread_getcpuclockid>(3))."
5255 "新しいスレッドの CPU 時間時計の初期値は 0 である\n"
5256 "(B<pthread_getcpuclockid>(3) 参照)。"
5259 #: build/C/man3/pthread_create.3:109
5261 msgid "Linux-specific details"
5262 msgstr "Linux 固有の詳細"
5265 #: build/C/man3/pthread_create.3:115
5267 "The new thread inherits copies of the calling thread's capability sets (see "
5268 "B<capabilities>(7)) and CPU affinity mask (see B<sched_setaffinity>(2))."
5270 "新しいスレッドは、呼び出したスレッドの\n"
5271 "ケーパビリティセット (B<capabilities>(7) 参照) と \n"
5272 "CPU affinity マスク (B<sched_setaffinity>(2) 参照) の\n"
5276 #: build/C/man3/pthread_create.3:122
5278 "On success, B<pthread_create>() returns 0; on error, it returns an error "
5279 "number, and the contents of I<*thread> are undefined."
5281 "成功すると、 B<pthread_create>() は 0 を返す。\n"
5282 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
5285 #: build/C/man3/pthread_create.3:123 build/C/man3/pthread_create.3:126
5286 #: build/C/man3/pthread_sigqueue.3:72 build/C/man3/pthread_spin_init.3:121
5292 #: build/C/man3/pthread_create.3:126
5293 msgid "Insufficient resources to create another thread."
5294 msgstr "別のスレッドを作成するのに十分なリソースがない。"
5296 #. NOTE! The following should match the description in fork(2)
5298 #: build/C/man3/pthread_create.3:144
5300 "A system-imposed limit on the number of threads was encountered. There are "
5301 "a number of limits that may trigger this error: the B<RLIMIT_NPROC> soft "
5302 "resource limit (set via B<setrlimit>(2)), which limits the number of "
5303 "processes and threads for a real user ID, was reached; the kernel's system-"
5304 "wide limit on the number of processes and threads, I</proc/sys/kernel/"
5305 "threads-max>, was reached (see B<proc>(5)); or the maximum number of PIDs, "
5306 "I</proc/sys/kernel/pid_max>, was reached (see B<proc>(5))."
5308 "システムで設定されたスレッド数の上限に達していた。 このエラーの原因となる上限"
5309 "値はいくつかある。 実ユーザー ID 当たりのプロセス数とスレッド数の上限である、"
5310 "ソフトリソース上限 B<RLIMIT_NPROC> に達していた (B<setrlimit>(2) で設定でき"
5311 "る)。 カーネルのシステム全体のプロセスとスレッドの数の上限値である I</proc/"
5312 "sys/kernel/threads-max> が達していた (B<proc>(5) 参照)。 PID の最大値 I</"
5313 "proc/sys/kernel/pid_max> に達していた (B<proc>(5) 参照)。"
5316 #: build/C/man3/pthread_create.3:148
5317 msgid "Invalid settings in I<attr>."
5318 msgstr "I<attr> で指定された設定が不正である。"
5321 #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_setschedparam.3:129
5322 #: build/C/man3/pthread_setschedprio.3:66
5328 #: build/C/man3/pthread_create.3:153
5330 "No permission to set the scheduling policy and parameters specified in "
5333 "I<attr> に指定されたスケジューリングポリシーとパラメーターを\n"
5337 #: build/C/man3/pthread_create.3:163
5339 msgid "B<pthread_create>()"
5340 msgstr "B<pthread_create>()"
5343 #: build/C/man3/pthread_create.3:180
5345 "See B<pthread_self>(3) for further information on the thread ID returned in "
5346 "I<*thread> by B<pthread_create>(). Unless real-time scheduling policies are "
5347 "being employed, after a call to B<pthread_create>(), it is indeterminate "
5348 "which thread\\(emthe caller or the new thread\\(emwill next execute."
5350 "B<pthread_create>() が I<*thread> で返すスレッド ID についての\n"
5351 "詳しい情報は B<pthread_self>(3) を参照のこと。\n"
5352 "リアルタイムスケジューリングポリシーが使用されない限り、\n"
5353 "B<pthread_create>() の呼び出し後に、\n"
5354 "どのスレッドが\\(em呼び出したスレッドか新しいスレッドか\\(em\n"
5358 #: build/C/man3/pthread_create.3:200
5360 "A thread may either be I<joinable> or I<detached>. If a thread is joinable, "
5361 "then another thread can call B<pthread_join>(3) to wait for the thread to "
5362 "terminate and fetch its exit status. Only when a terminated joinable thread "
5363 "has been joined are the last of its resources released back to the system. "
5364 "When a detached thread terminates, its resources are automatically released "
5365 "back to the system: it is not possible to join with the thread in order to "
5366 "obtain its exit status. Making a thread detached is useful for some types "
5367 "of daemon threads whose exit status the application does not need to care "
5368 "about. By default, a new thread is created in a joinable state, unless "
5369 "I<attr> was set to create the thread in a detached state (using "
5370 "B<pthread_attr_setdetachstate>(3))."
5372 "スレッドは I<join 可能>か I<detached (切り離された状態)> のどちらかに\n"
5373 "することができる。スレッドが join 可能な場合、別のスレッドが\n"
5374 "B<pthread_join>(3) を使って終了したスレッドを待ち、終了ステータスを取得\n"
5375 "することができる。終了した join 可能なスレッドは join された場合にのみ、\n"
5376 "そのスレッドの最後に残ったリソースが解放されシステムに戻される。\n"
5377 "detached 状態のスレッドが終了すると、そのスレッドのリソースは自動的に\n"
5378 "システムに戻される。detached 状態のスレッドを join して、その終了\n"
5379 "ステータスを取得することはできない。スレッドを detached 状態にするのは、\n"
5380 "その終了ステータスをアプリケーションが気にする必要がないある種の\n"
5381 "デーモン (daemon) スレッドでは有用である。\n"
5382 "デフォルトでは、新しいスレッドは join 可能な状態で作成される。\n"
5383 "(B<pthread_attr_setdetachstate>(3) を使って) I<attr> でスレッドが\n"
5384 "detached 状態で作成されるように設定されていない限り、join 可能な状態で\n"
5388 #: build/C/man3/pthread_create.3:218
5391 #| "On Linux/x86-32, the default stack size for a new thread is 2 megabytes. "
5392 #| "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
5393 #| "resource limit I<at the time the program started> has any value other "
5394 #| "than \"unlimited\", then it determines the default stack size of new "
5395 #| "threads. Using B<pthread_attr_setstacksize>(3), the stack size attribute "
5396 #| "can be explicitly set in the I<attr> argument used to create a thread, in "
5397 #| "order to obtain a stack size other than the default."
5399 "Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft "
5400 "resource limit I<at the time the program started> has any value other than "
5401 "\"unlimited\", then it determines the default stack size of new threads. "
5402 "Using B<pthread_attr_setstacksize>(3), the stack size attribute can be "
5403 "explicitly set in the I<attr> argument used to create a thread, in order to "
5404 "obtain a stack size other than the default. If the B<RLIMIT_STACK> resource "
5405 "limit is set to \"unlimited\", a per-architecture value is used for the "
5406 "stack size. Here is the value for a few architectures:"
5408 "Linux/x86-32 では、新しいスレッドのデフォルトのスタックサイズは 2MB で\n"
5409 "ある。NPTL スレッド実装の下では、I<プログラム開始時の> B<RLIMIT_STACK>\n"
5410 "ソフトリソース上限が\"unlimited\" 以外の場合、その値が新しいスレッドのデ\n"
5411 "フォルトのスタックサイズとなる。\n"
5412 "B<pthread_attr_setstacksize>(3) を使って、スレッドを作成する際の\n"
5413 "I<attr> 引数に明示的にスタックサイズ属性を設定することで、\n"
5414 "デフォルト値以外のスタックサイズを得ることができる。"
5417 #: build/C/man3/pthread_create.3:223
5419 msgid "Architecture"
5423 #: build/C/man3/pthread_create.3:223
5425 msgid "Default stack size"
5429 #: build/C/man3/pthread_create.3:224
5435 #: build/C/man3/pthread_create.3:224 build/C/man3/pthread_create.3:227
5436 #: build/C/man3/pthread_create.3:228 build/C/man3/pthread_create.3:230
5442 #: build/C/man3/pthread_create.3:225
5448 #: build/C/man3/pthread_create.3:225
5454 #: build/C/man3/pthread_create.3:226
5460 #: build/C/man3/pthread_create.3:226 build/C/man3/pthread_create.3:229
5466 #: build/C/man3/pthread_create.3:227
5472 #: build/C/man3/pthread_create.3:228
5478 #: build/C/man3/pthread_create.3:229
5484 #: build/C/man3/pthread_create.3:230
5490 #: build/C/man3/pthread_create.3:239
5492 "In the obsolete LinuxThreads implementation, each of the threads in a "
5493 "process has a different process ID. This is in violation of the POSIX "
5494 "threads specification, and is the source of many other nonconformances to "
5495 "the standard; see B<pthreads>(7)."
5497 "廃止予定の LinuxThreads 実装では、プロセス内の各スレッドは異なる\n"
5498 "プロセス ID を持つ。これは POSIX スレッドの規格に違反しており、\n"
5499 "他の多くの標準非準拠の点の原因になっている。\n"
5500 "B<pthreads>(7) を参照のこと。"
5503 #: build/C/man3/pthread_create.3:243
5505 "The program below demonstrates the use of B<pthread_create>(), as well as a "
5506 "number of other functions in the pthreads API."
5508 "以下のプログラムは、 B<pthread_create>() や\n"
5509 "pthreads API の他のいろいろな関数の使用例を示している。"
5512 #: build/C/man3/pthread_create.3:248
5514 "In the following run, on a system providing the NPTL threading "
5515 "implementation, the stack size defaults to the value given by the \"stack "
5516 "size\" resource limit:"
5518 "以下の実行例は、 NPTL スレッド実装が提供されているシステムでのもので、\n"
5519 "スタックサイズがデフォルト値の \"stack size\" リソース上限で指定される値\n"
5523 #: build/C/man3/pthread_create.3:260
5527 "8192 # The stack size limit is 8 MB (0x800000 bytes)\n"
5528 "$B< ./a.out hola salut servus>\n"
5529 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
5530 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
5531 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
5532 "Joined with thread 1; returned value was HOLA\n"
5533 "Joined with thread 2; returned value was SALUT\n"
5534 "Joined with thread 3; returned value was SERVUS\n"
5537 "8192 # The stack size limit is 8 MB (0x800000 bytes)\n"
5538 "$B< ./a.out hola salut servus>\n"
5539 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
5540 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
5541 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
5542 "Joined with thread 1; returned value was HOLA\n"
5543 "Joined with thread 2; returned value was SALUT\n"
5544 "Joined with thread 3; returned value was SERVUS\n"
5547 #: build/C/man3/pthread_create.3:266
5549 "In the next run, the program explicitly sets a stack size of 1\\ MB (using "
5550 "B<pthread_attr_setstacksize>(3)) for the created threads:"
5551 msgstr "次の実行例では、プログラム内で、作成されるスレッドに対して (B<pthread_attr_setstacksize>(3) を使って1\\ MB のスタックサイズを明示的に設定している。"
5554 #: build/C/man3/pthread_create.3:276
5557 "$B< ./a.out -s 0x100000 hola salut servus>\n"
5558 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
5559 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
5560 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
5561 "Joined with thread 1; returned value was HOLA\n"
5562 "Joined with thread 2; returned value was SALUT\n"
5563 "Joined with thread 3; returned value was SERVUS\n"
5565 "$B< ./a.out -s 0x100000 hola salut servus>\n"
5566 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
5567 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
5568 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
5569 "Joined with thread 1; returned value was HOLA\n"
5570 "Joined with thread 2; returned value was SALUT\n"
5571 "Joined with thread 3; returned value was SERVUS\n"
5574 #: build/C/man3/pthread_create.3:288
5577 "#include E<lt>pthread.hE<gt>\n"
5578 "#include E<lt>string.hE<gt>\n"
5579 "#include E<lt>stdio.hE<gt>\n"
5580 "#include E<lt>stdlib.hE<gt>\n"
5581 "#include E<lt>unistd.hE<gt>\n"
5582 "#include E<lt>errno.hE<gt>\n"
5583 "#include E<lt>ctype.hE<gt>\n"
5585 "#include E<lt>pthread.hE<gt>\n"
5586 "#include E<lt>string.hE<gt>\n"
5587 "#include E<lt>stdio.hE<gt>\n"
5588 "#include E<lt>stdlib.hE<gt>\n"
5589 "#include E<lt>unistd.hE<gt>\n"
5590 "#include E<lt>errno.hE<gt>\n"
5591 "#include E<lt>ctype.hE<gt>\n"
5594 #: build/C/man3/pthread_create.3:294 build/C/man3/pthread_getcpuclockid.3:127
5597 "#define handle_error(msg) \\e\n"
5598 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5600 "#define handle_error(msg) \\e\n"
5601 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5604 #: build/C/man3/pthread_create.3:300
5607 "struct thread_info { /* Used as argument to thread_start() */\n"
5608 " pthread_t thread_id; /* ID returned by pthread_create() */\n"
5609 " int thread_num; /* Application-defined thread # */\n"
5610 " char *argv_string; /* From command-line argument */\n"
5613 "struct thread_info { /* Used as argument to thread_start() */\n"
5614 " pthread_t thread_id; /* ID returned by pthread_create() */\n"
5615 " int thread_num; /* Application-defined thread # */\n"
5616 " char *argv_string; /* From command-line argument */\n"
5620 #: build/C/man3/pthread_create.3:303
5623 "/* Thread start function: display address near top of our stack,\n"
5624 " and return upper-cased copy of argv_string */\n"
5626 "/* Thread start function: display address near top of our stack,\n"
5627 " and return upper-cased copy of argv_string */\n"
5630 #: build/C/man3/pthread_create.3:309
5634 "thread_start(void *arg)\n"
5636 " struct thread_info *tinfo = arg;\n"
5640 "thread_start(void *arg)\n"
5642 " struct thread_info *tinfo = arg;\n"
5646 #: build/C/man3/pthread_create.3:312
5649 " printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5650 " tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5652 " printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
5653 " tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
5656 #: build/C/man3/pthread_create.3:316
5659 " uargv = strdup(tinfo-E<gt>argv_string);\n"
5660 " if (uargv == NULL)\n"
5661 " handle_error(\"strdup\");\n"
5663 " uargv = strdup(tinfo-E<gt>argv_string);\n"
5664 " if (uargv == NULL)\n"
5665 " handle_error(\"strdup\");\n"
5668 #: build/C/man3/pthread_create.3:319
5671 " for (char *p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5672 " *p = toupper(*p);\n"
5674 " for (char *p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5675 " *p = toupper(*p);\n"
5678 #: build/C/man3/pthread_create.3:322
5688 #: build/C/man3/pthread_create.3:330
5692 "main(int argc, char *argv[])\n"
5694 " int s, opt, num_threads;\n"
5695 " pthread_attr_t attr;\n"
5696 " size_t stack_size;\n"
5700 "main(int argc, char *argv[])\n"
5702 " int s, opt, num_threads;\n"
5703 " pthread_attr_t attr;\n"
5704 " size_t stack_size;\n"
5708 #: build/C/man3/pthread_create.3:332
5710 msgid " /* The \"-s\" option specifies a stack size for our threads */\n"
5711 msgstr " /* The \"-s\" option specifies a stack size for our threads */\n"
5714 #: build/C/man3/pthread_create.3:339
5717 " stack_size = -1;\n"
5718 " while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5720 " case \\(aqs\\(aq:\n"
5721 " stack_size = strtoul(optarg, NULL, 0);\n"
5724 " stack_size = -1;\n"
5725 " while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5727 " case \\(aqs\\(aq:\n"
5728 " stack_size = strtoul(optarg, NULL, 0);\n"
5732 #: build/C/man3/pthread_create.3:346
5736 " fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5738 " exit(EXIT_FAILURE);\n"
5743 " fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5745 " exit(EXIT_FAILURE);\n"
5750 #: build/C/man3/pthread_create.3:348
5752 msgid " num_threads = argc - optind;\n"
5753 msgstr " num_threads = argc - optind;\n"
5756 #: build/C/man3/pthread_create.3:350
5758 msgid " /* Initialize thread creation attributes */\n"
5759 msgstr " /* Initialize thread creation attributes */\n"
5762 #: build/C/man3/pthread_create.3:354
5765 " s = pthread_attr_init(&attr);\n"
5767 " handle_error_en(s, \"pthread_attr_init\");\n"
5769 " s = pthread_attr_init(&attr);\n"
5771 " handle_error_en(s, \"pthread_attr_init\");\n"
5774 #: build/C/man3/pthread_create.3:360
5777 " if (stack_size E<gt> 0) {\n"
5778 " s = pthread_attr_setstacksize(&attr, stack_size);\n"
5780 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5783 " if (stack_size E<gt> 0) {\n"
5784 " s = pthread_attr_setstacksize(&attr, stack_size);\n"
5786 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5790 #: build/C/man3/pthread_create.3:362
5792 msgid " /* Allocate memory for pthread_create() arguments */\n"
5793 msgstr " /* Allocate memory for pthread_create() arguments */\n"
5796 #: build/C/man3/pthread_create.3:366
5799 " struct thread_info *tinfo = calloc(num_threads, sizeof(*tinfo));\n"
5800 " if (tinfo == NULL)\n"
5801 " handle_error(\"calloc\");\n"
5803 " struct thread_info *tinfo = calloc(num_threads, sizeof(*tinfo));\n"
5804 " if (tinfo == NULL)\n"
5805 " handle_error(\"calloc\");\n"
5808 #: build/C/man3/pthread_create.3:368
5810 msgid " /* Create one thread for each command-line argument */\n"
5811 msgstr " /* Create one thread for each command-line argument */\n"
5814 #: build/C/man3/pthread_create.3:372
5817 " for (int tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5818 " tinfo[tnum].thread_num = tnum + 1;\n"
5819 " tinfo[tnum].argv_string = argv[optind + tnum];\n"
5821 " for (int tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5822 " tinfo[tnum].thread_num = tnum + 1;\n"
5823 " tinfo[tnum].argv_string = argv[optind + tnum];\n"
5826 #: build/C/man3/pthread_create.3:375
5829 " /* The pthread_create() call stores the thread ID into\n"
5830 " corresponding element of tinfo[] */\n"
5832 " /* The pthread_create() call stores the thread ID into\n"
5833 " corresponding element of tinfo[] */\n"
5836 #: build/C/man3/pthread_create.3:381
5839 " s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5840 " &thread_start, &tinfo[tnum]);\n"
5842 " handle_error_en(s, \"pthread_create\");\n"
5845 " s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5846 " &thread_start, &tinfo[tnum]);\n"
5848 " handle_error_en(s, \"pthread_create\");\n"
5852 #: build/C/man3/pthread_create.3:384
5855 " /* Destroy the thread attributes object, since it is no\n"
5856 " longer needed */\n"
5858 " /* Destroy the thread attributes object, since it is no\n"
5859 " longer needed */\n"
5862 #: build/C/man3/pthread_create.3:388
5865 " s = pthread_attr_destroy(&attr);\n"
5867 " handle_error_en(s, \"pthread_attr_destroy\");\n"
5869 " s = pthread_attr_destroy(&attr);\n"
5871 " handle_error_en(s, \"pthread_attr_destroy\");\n"
5874 #: build/C/man3/pthread_create.3:390
5876 msgid " /* Now join with each thread, and display its returned value */\n"
5877 msgstr " /* Now join with each thread, and display its returned value */\n"
5880 #: build/C/man3/pthread_create.3:395
5883 " for (int tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5884 " s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5886 " handle_error_en(s, \"pthread_join\");\n"
5888 " for (int tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5889 " s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5891 " handle_error_en(s, \"pthread_join\");\n"
5894 #: build/C/man3/pthread_create.3:400
5897 " printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5898 " tinfo[tnum].thread_num, (char *) res);\n"
5899 " free(res); /* Free memory allocated by thread */\n"
5902 " printf(\"Joined with thread %d; returned value was %s\\en\",\n"
5903 " tinfo[tnum].thread_num, (char *) res);\n"
5904 " free(res); /* Free memory allocated by thread */\n"
5908 #: build/C/man3/pthread_create.3:404
5912 " exit(EXIT_SUCCESS);\n"
5916 " exit(EXIT_SUCCESS);\n"
5920 #: build/C/man3/pthread_create.3:419
5922 "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), "
5923 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
5924 "B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), "
5925 "B<pthread_setattr_default_np>(3), B<pthreads>(7)"
5926 msgstr "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_cancel>(3), B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), B<pthread_getattr_np>(3), B<pthread_join>(3), B<pthread_self>(3), B<pthread_setattr_default_np>(3), B<pthreads>(7)"
5929 #: build/C/man3/pthread_detach.3:26
5931 msgid "PTHREAD_DETACH"
5932 msgstr "PTHREAD_DETACH"
5935 #: build/C/man3/pthread_detach.3:29
5936 msgid "pthread_detach - detach a thread"
5937 msgstr "pthread_detach - スレッドを切り離す (detach する)"
5940 #: build/C/man3/pthread_detach.3:34
5942 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5943 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5946 #: build/C/man3/pthread_detach.3:46
5948 "The B<pthread_detach>() function marks the thread identified by I<thread> "
5949 "as detached. When a detached thread terminates, its resources are "
5950 "automatically released back to the system without the need for another "
5951 "thread to join with the terminated thread."
5953 "B<pthread_detach>() 関数は I<thread> で識別されるスレッドに\n"
5954 "detached (切り離された状態) という印を付ける。\n"
5955 "detached 状態のスレッドが終了すると、\n"
5956 "別のスレッドが終了されたスレッドを join しなくても、\n"
5957 "そのスレッドのリソースは自動的に解放されてシステムに戻される。"
5960 #: build/C/man3/pthread_detach.3:49
5962 "Attempting to detach an already detached thread results in unspecified "
5965 "すでに detach 状態のスレッドを detach しようとした場合に\n"
5966 "どのような結果となるかは規定されていない。"
5969 #: build/C/man3/pthread_detach.3:54
5971 "On success, B<pthread_detach>() returns 0; on error, it returns an error "
5974 "成功すると、B<pthread_detach>() は 0 を返す。\n"
5978 #: build/C/man3/pthread_detach.3:59 build/C/man3/pthread_join.3:89
5979 msgid "I<thread> is not a joinable thread."
5980 msgstr "I<thread> が join 可能なスレッドではない。"
5983 #: build/C/man3/pthread_detach.3:74
5985 msgid "B<pthread_detach>()"
5986 msgstr "B<pthread_detach>()"
5989 #: build/C/man3/pthread_detach.3:83
5991 "Once a thread has been detached, it can't be joined with B<pthread_join>(3) "
5992 "or be made joinable again."
5994 "いったんスレッドを detached 状態にすると、\n"
5995 "そのスレッドを B<pthread_join>(3) で join したり、\n"
5996 "もう一度 join 可能にしたりすることはできない。"
5999 #: build/C/man3/pthread_detach.3:90
6001 "A new thread can be created in a detached state using "
6002 "B<pthread_attr_setdetachstate>(3) to set the detached attribute of the "
6003 "I<attr> argument of B<pthread_create>(3)."
6005 "B<pthread_attr_setdetachstate>(3) を使って\n"
6006 "B<pthread_create>(3) の I<attr> 引数の detached 属性を設定することで、\n"
6007 "新しいスレッドを detached 状態で作成することができる。"
6010 #: build/C/man3/pthread_detach.3:97
6012 "The detached attribute merely determines the behavior of the system when the "
6013 "thread terminates; it does not prevent the thread from being terminated if "
6014 "the process terminates using B<exit>(3) (or equivalently, if the main "
6017 "detached 属性は、スレッドが終了した際のシステムの動作を決めるだけである。\n"
6018 "プロセスが B<exit>(3) を使って終了した場合に、そのスレッドが終了され\n"
6019 "なくなるようなことはない (なお、メインスレッドが return した場合も\n"
6020 "プロセスが B<exit>(3) を使って終了した場合と全く同じである)。 "
6023 #: build/C/man3/pthread_detach.3:106
6026 #| "Either B<pthread_join>(3) or B<pthread_detach>() should be called for "
6027 #| "each thread that an application creates, so that system resources for the "
6028 #| "thread can be released. (But note that the resources of all threads are "
6029 #| "freed when the process terminates.)"
6031 "Either B<pthread_join>(3) or B<pthread_detach>() should be called for each "
6032 "thread that an application creates, so that system resources for the thread "
6033 "can be released. (But note that the resources of any threads for which one "
6034 "of these actions has not been done will be freed when the process "
6037 "アプリケーションが作成した各スレッドについて、そのスレッドが使用して\n"
6038 "いるシステムリソースを解放できるように、B<pthread_join>(3) か\n"
6039 "B<pthread_detach>() のどちらかを呼び出すべきである (ただし、プロセスが\n"
6040 "終了するときには、全てのスレッドのリソースが解放される)。"
6043 #: build/C/man3/pthread_detach.3:108
6044 msgid "The following statement detaches the calling thread:"
6045 msgstr "以下の文は、呼び出したスレッド自身を detach する。"
6048 #: build/C/man3/pthread_detach.3:110
6050 msgid " pthread_detach(pthread_self());\n"
6051 msgstr " pthread_detach(pthread_self());\n"
6054 #: build/C/man3/pthread_detach.3:117
6056 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), "
6057 "B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
6059 "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), "
6060 "B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
6063 #: build/C/man3/pthread_equal.3:26
6065 msgid "PTHREAD_EQUAL"
6066 msgstr "PTHREAD_EQUAL"
6069 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_setschedprio.3:26
6070 #: build/C/man7/nptl.7:26
6076 #: build/C/man3/pthread_equal.3:29
6077 msgid "pthread_equal - compare thread IDs"
6078 msgstr "pthread_equal - スレッド ID を比較する"
6081 #: build/C/man3/pthread_equal.3:34
6083 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
6084 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
6087 #: build/C/man3/pthread_equal.3:41
6088 msgid "The B<pthread_equal>() function compares two thread identifiers."
6089 msgstr "B<pthread_equal>() 関数は 2 つのスレッド識別子の比較を行う。"
6092 #: build/C/man3/pthread_equal.3:45
6094 "If the two thread IDs are equal, B<pthread_equal>() returns a nonzero "
6095 "value; otherwise, it returns 0."
6097 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
6101 #. Available since glibc 2.0
6103 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
6104 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_testcancel.3:58
6105 msgid "This function always succeeds."
6106 msgstr "この関数は常に成功する。"
6109 #: build/C/man3/pthread_equal.3:57
6111 msgid "B<pthread_equal>()"
6112 msgstr "B<pthread_equal>()"
6115 #: build/C/man3/pthread_equal.3:68
6117 "The B<pthread_equal>() function is necessary because thread IDs should be "
6118 "considered opaque: there is no portable way for applications to directly "
6119 "compare two I<pthread_t> values."
6121 "B<pthread_equal>() 関数が必要なのは、\n"
6122 "スレッド ID はその内部構造を意識すべきではないためである。\n"
6123 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
6124 "移植性を確保できる形で比較する方法はない。"
6127 #: build/C/man3/pthread_equal.3:72
6128 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
6129 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
6132 #: build/C/man3/pthread_exit.3:26
6134 msgid "PTHREAD_EXIT"
6135 msgstr "PTHREAD_EXIT"
6138 #: build/C/man3/pthread_exit.3:29
6139 msgid "pthread_exit - terminate calling thread"
6140 msgstr "pthread_exit - 呼び出したスレッドを終了する"
6143 #: build/C/man3/pthread_exit.3:34
6145 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
6146 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
6149 #: build/C/man3/pthread_exit.3:45
6151 "The B<pthread_exit>() function terminates the calling thread and returns a "
6152 "value via I<retval> that (if the thread is joinable) is available to "
6153 "another thread in the same process that calls B<pthread_join>(3)."
6154 msgstr "B<pthread_exit>() 関数は、呼び出したスレッドを終了し、 I<retval> 経由で値を返す。この値は (そのスレッドが join 可能な場合に) B<pthread_join>(3) を呼び出した同じプロセス内の別のスレッドが参照できる値と同じである。"
6157 #: build/C/man3/pthread_exit.3:55
6159 "Any clean-up handlers established by B<pthread_cleanup_push>(3) that have "
6160 "not yet been popped, are popped (in the reverse of the order in which they "
6161 "were pushed) and executed. If the thread has any thread-specific data, "
6162 "then, after the clean-up handlers have been executed, the corresponding "
6163 "destructor functions are called, in an unspecified order."
6164 msgstr "B<pthread_cleanup_push>(3) で設定されたクリーンアップハンドラーのうち、まだ pop (取り出されていない) ハンドラーを (push されたのと逆の順序で) 取り出して実行する。そのスレッドがスレッド固有のデータを持っている場合は、クリーンアップハンドラーが実行された後に、スレッド固有のデータに対応するデストラクタ (destructor) 関数が呼び出される (呼び出し順序は規定されていない)。"
6167 #: build/C/man3/pthread_exit.3:62
6169 "When a thread terminates, process-shared resources (e.g., mutexes, condition "
6170 "variables, semaphores, and file descriptors) are not released, and functions "
6171 "registered using B<atexit>(3) are not called."
6172 msgstr "スレッドが終了する際に、プロセスの共有リソース (例えば、mutex、状態変数 (condition variables)、セマフォ、ファイルディスクリプター) は解放されない。 B<atexit>(3) を使って登録された関数は呼び出されない。"
6175 #: build/C/man3/pthread_exit.3:71
6177 "After the last thread in a process terminates, the process terminates as by "
6178 "calling B<exit>(3) with an exit status of zero; thus, process-shared "
6179 "resources are released and functions registered using B<atexit>(3) are "
6181 msgstr "プロセスの最後のスレッドが終了すると、そのプロセスは、終了ステータス 0 で B<exit>(3) を呼び出した場合と全く同じように終了する。したがって、プロセスの共有リソースは解放され、B<atexit>(3) を使って登録された関数が呼び出される。"
6184 #: build/C/man3/pthread_exit.3:73
6185 msgid "This function does not return to the caller."
6186 msgstr "この関数は呼び出し側には返らない。"
6189 #: build/C/man3/pthread_exit.3:85
6191 msgid "B<pthread_exit>()"
6192 msgstr "B<pthread_exit>()"
6195 #: build/C/man3/pthread_exit.3:94
6197 "Performing a return from the start function of any thread other than the "
6198 "main thread results in an implicit call to B<pthread_exit>(), using the "
6199 "function's return value as the thread's exit status."
6201 "メインスレッド以外のスレッドの開始関数 (start function) がreturn を\n"
6202 "行うと、暗黙のうちに B<pthread_exit>() が呼び出され、\n"
6203 "関数の返り値がスレッドの終了ステータスとして使用される。"
6206 #: build/C/man3/pthread_exit.3:100
6208 "To allow other threads to continue execution, the main thread should "
6209 "terminate by calling B<pthread_exit>() rather than B<exit>(3)."
6211 "他のスレッドが実行を継続できるように、メインスレッドは B<exit>(3) では\n"
6212 "なく B<pthread_exit>() を呼び出して終了すべきである。"
6215 #: build/C/man3/pthread_exit.3:105
6217 "The value pointed to by I<retval> should not be located on the calling "
6218 "thread's stack, since the contents of that stack are undefined after the "
6219 "thread terminates."
6221 "I<retval> が指す値は、呼び出したスレッドのスタックに置くべきではない。\n"
6222 "呼び出したスレッドが終了した後は、そのスタックの内容が不定となるから\n"
6226 #. FIXME . review a later kernel to see if this gets fixed
6227 #. http://thread.gmane.org/gmane.linux.kernel/611611
6228 #. http://marc.info/?l=linux-kernel&m=122525468300823&w=2
6230 #: build/C/man3/pthread_exit.3:117
6232 "Currently, there are limitations in the kernel implementation logic for "
6233 "B<wait>(2)ing on a stopped thread group with a dead thread group leader. "
6234 "This can manifest in problems such as a locked terminal if a stop signal is "
6235 "sent to a foreground process whose thread group leader has already called "
6236 "B<pthread_exit>()."
6238 "現在のところ、停止 (stop) されたスレッドグループを、すでに終了した\n"
6239 "(dead) スレッドグループリーダーで B<wait>(2) する場合の、\n"
6240 "カーネル実装の論理には制限がある。\n"
6241 "この制限は、すでにスレッドグループリーダーが B<pthread_exit>() を\n"
6242 "呼び出しているようなフォアグラウンドプロセスにストップシグナルが送信\n"
6243 "された場合に、端末がロックされてしまう、といった問題として表に見える\n"
6247 #: build/C/man3/pthread_exit.3:121
6248 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
6249 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
6252 #: build/C/man3/pthread_getattr_np.3:26
6254 msgid "PTHREAD_GETATTR_NP"
6255 msgstr "PTHREAD_GETATTR_NP"
6258 #: build/C/man3/pthread_getattr_np.3:29
6259 msgid "pthread_getattr_np - get attributes of created thread"
6260 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
6263 #: build/C/man3/pthread_getattr_np.3:35
6265 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
6266 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
6269 #: build/C/man3/pthread_getattr_np.3:45
6271 "The B<pthread_getattr_np>() function initializes the thread attributes "
6272 "object referred to by I<attr> so that it contains actual attribute values "
6273 "describing the running thread I<thread>."
6275 "B<pthread_getattr_np>() 関数は、\n"
6276 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
6277 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
6281 #: build/C/man3/pthread_getattr_np.3:52
6283 "The returned attribute values may differ from the corresponding attribute "
6284 "values passed in the I<attr> object that was used to create the thread using "
6285 "B<pthread_create>(3). In particular, the following attributes may differ:"
6287 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
6288 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
6289 "特に、以下の属性は異なる場合がある。"
6292 #: build/C/man3/pthread_getattr_np.3:55
6294 "the detach state, since a joinable thread may have detached itself after "
6297 "detach state. join 可能なスレッドは作成後に自分自身を\n"
6298 "切り離す (detach する) ことができるからである。"
6301 #: build/C/man3/pthread_getattr_np.3:58
6303 "the stack size, which the implementation may align to a suitable boundary."
6306 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
6309 #: build/C/man3/pthread_getattr_np.3:63
6311 "and the guard size, which the implementation may round upward to a multiple "
6312 "of the page size, or ignore (i.e., treat as 0), if the application is "
6313 "allocating its own stack."
6316 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
6317 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
6318 "(0 として扱われる) ことがあるからである。"
6321 #: build/C/man3/pthread_getattr_np.3:68
6323 "Furthermore, if the stack address attribute was not set in the thread "
6324 "attributes object used to create the thread, then the returned thread "
6325 "attributes object will report the actual stack address that the "
6326 "implementation selected for the thread."
6328 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
6329 "スタックアドレスが設定されていなかった場合、\n"
6330 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
6331 "割り当てた実際のスタックアドレスが報告される。"
6334 #: build/C/man3/pthread_getattr_np.3:73
6336 "When the thread attributes object returned by B<pthread_getattr_np>() is no "
6337 "longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
6339 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
6340 "必要なくなった際には、 B<pthread_attr_destroy>(3) を使って\n"
6341 "そのオブジェクトを破棄すべきである。"
6344 #: build/C/man3/pthread_getattr_np.3:76 build/C/man3/pthread_getcpuclockid.3:52
6346 "On success, this function returns 0; on error, it returns a nonzero error "
6349 "成功すると、この関数は 0 を返す。\n"
6350 "エラーの場合、 0 以外のエラー番号を返す。"
6352 #. Can happen (but unlikely) while trying to allocate memory for cpuset
6354 #: build/C/man3/pthread_getattr_np.3:81
6355 msgid "Insufficient memory."
6356 msgstr "メモリーが十分になかった。"
6359 #: build/C/man3/pthread_getattr_np.3:96
6361 "In addition, if I<thread> refers to the main thread, then "
6362 "B<pthread_getattr_np>() can fail because of errors from various underlying "
6363 "calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and "
6364 "B<getrlimit>(2), if the B<RLIMIT_STACK> resource limit is not supported."
6366 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
6367 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
6369 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
6370 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
6371 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
6374 #: build/C/man3/pthread_getattr_np.3:98
6375 msgid "This function is available in glibc since version 2.2.3."
6376 msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。"
6379 #: build/C/man3/pthread_getattr_np.3:109
6381 msgid "B<pthread_getattr_np>()"
6382 msgstr "B<pthread_getattr_np>()"
6385 #: build/C/man3/pthread_getattr_np.3:115
6386 #: build/C/man3/pthread_kill_other_threads_np.3:62
6388 "This function is a nonstandard GNU extension; hence the suffix \"_np"
6389 "\" (nonportable) in the name."
6391 "この関数は非標準の GNU による拡張である。\n"
6392 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
6396 #: build/C/man3/pthread_getattr_np.3:125
6398 "The program below demonstrates the use of B<pthread_getattr_np>(). The "
6399 "program creates a thread that then uses B<pthread_getattr_np>() to retrieve "
6400 "and display its guard size, stack address, and stack size attributes. "
6401 "Command-line arguments can be used to set these attributes to values other "
6402 "than the default when creating the thread. The shell sessions below "
6403 "demonstrate the use of the program."
6405 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
6406 "このプログラムは、スレッドを作成し、それから\n"
6407 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
6408 "スタックアドレス、スタックサイズを取得し表示する。\n"
6409 "コマンドライン引数での指定で、スレッドを作成する際に\n"
6410 "上記の属性にデフォルト値以外の値を設定することができる。\n"
6411 "下記のシェルのセッションはこのプログラムの使用例である。"
6414 #: build/C/man3/pthread_getattr_np.3:128
6416 "In the first run, on an x86-32 system, a thread is created using default "
6419 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
6420 "(x86-32 システム上で実行)。"
6423 #: build/C/man3/pthread_getattr_np.3:138
6426 "$B< ulimit -s> # No stack limit ==E<gt> default stack size is 2 MB\n"
6429 "Attributes of created thread:\n"
6430 " Guard size = 4096 bytes\n"
6431 " Stack address = 0x40196000 (EOS = 0x40397000)\n"
6432 " Stack size = 0x201000 (2101248) bytes\n"
6434 "$B< ulimit -s> # No stack limit ==E<gt> default stack size is 2 MB\n"
6437 "Attributes of created thread:\n"
6438 " Guard size = 4096 bytes\n"
6439 " Stack address = 0x40196000 (EOS = 0x40397000)\n"
6440 " Stack size = 0x201000 (2101248) bytes\n"
6443 #: build/C/man3/pthread_getattr_np.3:144
6445 "In the following run, we see that if a guard size is specified, it is "
6446 "rounded up to the next multiple of the system page size (4096 bytes on "
6449 "次の実行例では、guard size が指定された場合、\n"
6450 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
6451 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
6454 #: build/C/man3/pthread_getattr_np.3:152
6457 "$B< ./a.out -g 4097>\n"
6458 "Thread attributes object after initializations:\n"
6459 " Guard size = 4097 bytes\n"
6460 " Stack address = (nil)\n"
6461 " Stack size = 0x0 (0) bytes\n"
6463 "$B< ./a.out -g 4097>\n"
6464 "Thread attributes object after initializations:\n"
6465 " Guard size = 4097 bytes\n"
6466 " Stack address = (nil)\n"
6467 " Stack size = 0x0 (0) bytes\n"
6470 #: build/C/man3/pthread_getattr_np.3:157
6473 "Attributes of created thread:\n"
6474 " Guard size = 8192 bytes\n"
6475 " Stack address = 0x40196000 (EOS = 0x40397000)\n"
6476 " Stack size = 0x201000 (2101248) bytes\n"
6478 "Attributes of created thread:\n"
6479 " Guard size = 8192 bytes\n"
6480 " Stack address = 0x40196000 (EOS = 0x40397000)\n"
6481 " Stack size = 0x201000 (2101248) bytes\n"
6484 #: build/C/man3/pthread_getattr_np.3:176
6486 "In the last run, the program manually allocates a stack for the thread. In "
6487 "this case, the guard size attribute is ignored."
6489 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
6490 "この場合には、guard size 属性は無視される。"
6493 #: build/C/man3/pthread_getattr_np.3:181
6496 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
6497 "Allocated thread stack at 0x804d000\n"
6499 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
6500 "Allocated thread stack at 0x804d000\n"
6503 #: build/C/man3/pthread_getattr_np.3:186
6506 "Thread attributes object after initializations:\n"
6507 " Guard size = 4096 bytes\n"
6508 " Stack address = 0x804d000 (EOS = 0x8055000)\n"
6509 " Stack size = 0x8000 (32768) bytes\n"
6511 "Thread attributes object after initializations:\n"
6512 " Guard size = 4096 bytes\n"
6513 " Stack address = 0x804d000 (EOS = 0x8055000)\n"
6514 " Stack size = 0x8000 (32768) bytes\n"
6517 #: build/C/man3/pthread_getattr_np.3:191
6520 "Attributes of created thread:\n"
6521 " Guard size = 0 bytes\n"
6522 " Stack address = 0x804d000 (EOS = 0x8055000)\n"
6523 " Stack size = 0x8000 (32768) bytes\n"
6525 "Attributes of created thread:\n"
6526 " Guard size = 0 bytes\n"
6527 " Stack address = 0x804d000 (EOS = 0x8055000)\n"
6528 " Stack size = 0x8000 (32768) bytes\n"
6531 #: build/C/man3/pthread_getattr_np.3:212
6535 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6538 " size_t stack_size, guard_size;\n"
6539 " void *stack_addr;\n"
6542 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6545 " size_t stack_size, guard_size;\n"
6546 " void *stack_addr;\n"
6549 #: build/C/man3/pthread_getattr_np.3:217
6552 " s = pthread_attr_getguardsize(attr, &guard_size);\n"
6554 " handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6555 " printf(\"%sGuard size = %zu bytes\\en\", prefix, guard_size);\n"
6557 " s = pthread_attr_getguardsize(attr, &guard_size);\n"
6559 " handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6560 " printf(\"%sGuard size = %zu bytes\\en\", prefix, guard_size);\n"
6563 #: build/C/man3/pthread_getattr_np.3:228
6566 " s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6568 " handle_error_en(s, \"pthread_attr_getstack\");\n"
6569 " printf(\"%sStack address = %p\", prefix, stack_addr);\n"
6570 " if (stack_size E<gt> 0)\n"
6571 " printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6572 " printf(\"\\en\");\n"
6573 " printf(\"%sStack size = %#zx (%zu) bytes\\en\",\n"
6574 " prefix, stack_size, stack_size);\n"
6577 " s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6579 " handle_error_en(s, \"pthread_attr_getstack\");\n"
6580 " printf(\"%sStack address = %p\", prefix, stack_addr);\n"
6581 " if (stack_size E<gt> 0)\n"
6582 " printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
6583 " printf(\"\\en\");\n"
6584 " printf(\"%sStack size = %#zx (%zu) bytes\\en\",\n"
6585 " prefix, stack_size, stack_size);\n"
6589 #: build/C/man3/pthread_getattr_np.3:234
6593 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6596 " pthread_attr_t attr;\n"
6599 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6602 " pthread_attr_t attr;\n"
6605 #: build/C/man3/pthread_getattr_np.3:238
6608 " s = pthread_getattr_np(thread, &attr);\n"
6610 " handle_error_en(s, \"pthread_getattr_np\");\n"
6612 " s = pthread_getattr_np(thread, &attr);\n"
6614 " handle_error_en(s, \"pthread_getattr_np\");\n"
6617 #: build/C/man3/pthread_getattr_np.3:240
6619 msgid " display_stack_related_attributes(&attr, prefix);\n"
6620 msgstr " display_stack_related_attributes(&attr, prefix);\n"
6623 #: build/C/man3/pthread_getattr_np.3:245
6626 " s = pthread_attr_destroy(&attr);\n"
6628 " handle_error_en(s, \"pthread_attr_destroy\");\n"
6631 " s = pthread_attr_destroy(&attr);\n"
6633 " handle_error_en(s, \"pthread_attr_destroy\");\n"
6637 #: build/C/man3/pthread_getattr_np.3:251
6640 "static void * /* Start function for thread we create */\n"
6641 "thread_start(void *arg)\n"
6643 " printf(\"Attributes of created thread:\\en\");\n"
6644 " display_thread_attributes(pthread_self(), \"\\et\");\n"
6646 "static void * /* Start function for thread we create */\n"
6647 "thread_start(void *arg)\n"
6649 " printf(\"Attributes of created thread:\\en\");\n"
6650 " display_thread_attributes(pthread_self(), \"\\et\");\n"
6653 #: build/C/man3/pthread_getattr_np.3:265
6657 "usage(char *pname, char *msg)\n"
6659 " if (msg != NULL)\n"
6660 " fputs(msg, stderr);\n"
6661 " fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6662 " \" [-g guard-size]\\en\", pname);\n"
6663 " fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6664 " exit(EXIT_FAILURE);\n"
6668 "usage(char *pname, char *msg)\n"
6670 " if (msg != NULL)\n"
6671 " fputs(msg, stderr);\n"
6672 " fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
6673 " \" [-g guard-size]\\en\", pname);\n"
6674 " fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
6675 " exit(EXIT_FAILURE);\n"
6679 #: build/C/man3/pthread_getattr_np.3:278
6682 "static pthread_attr_t * /* Get thread attributes from command line */\n"
6683 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6684 " pthread_attr_t *attrp)\n"
6686 " int s, opt, allocate_stack;\n"
6687 " size_t stack_size, guard_size;\n"
6688 " void *stack_addr;\n"
6689 " pthread_attr_t *ret_attrp = NULL; /* Set to attrp if we initialize\n"
6690 " a thread attributes object */\n"
6691 " allocate_stack = 0;\n"
6692 " stack_size = -1;\n"
6693 " guard_size = -1;\n"
6695 "static pthread_attr_t * /* Get thread attributes from command line */\n"
6696 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
6697 " pthread_attr_t *attrp)\n"
6699 " int s, opt, allocate_stack;\n"
6700 " size_t stack_size, guard_size;\n"
6701 " void *stack_addr;\n"
6702 " pthread_attr_t *ret_attrp = NULL; /* Set to attrp if we initialize\n"
6703 " a thread attributes object */\n"
6704 " allocate_stack = 0;\n"
6705 " stack_size = -1;\n"
6706 " guard_size = -1;\n"
6709 #: build/C/man3/pthread_getattr_np.3:287
6712 " while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6714 " case \\(aqa\\(aq: allocate_stack = 1; break;\n"
6715 " case \\(aqg\\(aq: guard_size = strtoul(optarg, NULL, 0); break;\n"
6716 " case \\(aqs\\(aq: stack_size = strtoul(optarg, NULL, 0); break;\n"
6717 " default: usage(argv[0], NULL);\n"
6721 " while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6723 " case \\(aqa\\(aq: allocate_stack = 1; break;\n"
6724 " case \\(aqg\\(aq: guard_size = strtoul(optarg, NULL, 0); break;\n"
6725 " case \\(aqs\\(aq: stack_size = strtoul(optarg, NULL, 0); break;\n"
6726 " default: usage(argv[0], NULL);\n"
6731 #: build/C/man3/pthread_getattr_np.3:290
6734 " if (allocate_stack && stack_size == -1)\n"
6735 " usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6737 " if (allocate_stack && stack_size == -1)\n"
6738 " usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6741 #: build/C/man3/pthread_getattr_np.3:293
6744 " if (argc E<gt> optind)\n"
6745 " usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6747 " if (argc E<gt> optind)\n"
6748 " usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6751 #: build/C/man3/pthread_getattr_np.3:296
6754 " if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6755 " ret_attrp = attrp;\n"
6757 " if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6758 " ret_attrp = attrp;\n"
6761 #: build/C/man3/pthread_getattr_np.3:301
6764 " s = pthread_attr_init(attrp);\n"
6766 " handle_error_en(s, \"pthread_attr_init\");\n"
6769 " s = pthread_attr_init(attrp);\n"
6771 " handle_error_en(s, \"pthread_attr_init\");\n"
6775 #: build/C/man3/pthread_getattr_np.3:313
6778 " if (stack_size E<gt>= 0) {\n"
6779 " if (!allocate_stack) {\n"
6780 " s = pthread_attr_setstacksize(attrp, stack_size);\n"
6782 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6784 " s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6787 " handle_error_en(s, \"posix_memalign\");\n"
6788 " printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6790 " if (stack_size E<gt>= 0) {\n"
6791 " if (!allocate_stack) {\n"
6792 " s = pthread_attr_setstacksize(attrp, stack_size);\n"
6794 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6796 " s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6799 " handle_error_en(s, \"posix_memalign\");\n"
6800 " printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6803 #: build/C/man3/pthread_getattr_np.3:319
6806 " s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6808 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6812 " s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6814 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6819 #: build/C/man3/pthread_getattr_np.3:325
6822 " if (guard_size E<gt>= 0) {\n"
6823 " s = pthread_attr_setguardsize(attrp, guard_size);\n"
6825 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6828 " if (guard_size E<gt>= 0) {\n"
6829 " s = pthread_attr_setguardsize(attrp, guard_size);\n"
6831 " handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6835 #: build/C/man3/pthread_getattr_np.3:328
6838 " return ret_attrp;\n"
6841 " return ret_attrp;\n"
6845 #: build/C/man3/pthread_getattr_np.3:337
6849 "main(int argc, char *argv[])\n"
6853 " pthread_attr_t attr;\n"
6854 " pthread_attr_t *attrp = NULL; /* Set to &attr if we initialize\n"
6855 " a thread attributes object */\n"
6858 "main(int argc, char *argv[])\n"
6862 " pthread_attr_t attr;\n"
6863 " pthread_attr_t *attrp = NULL; /* Set to &attr if we initialize\n"
6864 " a thread attributes object */\n"
6867 #: build/C/man3/pthread_getattr_np.3:339
6869 msgid " attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6870 msgstr " attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6873 #: build/C/man3/pthread_getattr_np.3:345
6876 " if (attrp != NULL) {\n"
6877 " printf(\"Thread attributes object after initializations:\\en\");\n"
6878 " display_stack_related_attributes(attrp, \"\\et\");\n"
6879 " printf(\"\\en\");\n"
6882 " if (attrp != NULL) {\n"
6883 " printf(\"Thread attributes object after initializations:\\en\");\n"
6884 " display_stack_related_attributes(attrp, \"\\et\");\n"
6885 " printf(\"\\en\");\n"
6889 #: build/C/man3/pthread_getattr_np.3:375
6890 #: build/C/man3/pthread_getattr_default_np.3:212
6892 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6893 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6894 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6895 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6896 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6897 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6899 "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), "
6900 "B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), "
6901 "B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), "
6902 "B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), "
6903 "B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), "
6904 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
6907 #: build/C/man3/pthread_getcpuclockid.3:26
6909 msgid "PTHREAD_GETCPUCLOCKID"
6910 msgstr "PTHREAD_GETCPUCLOCKID"
6913 #: build/C/man3/pthread_getcpuclockid.3:29
6914 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
6915 msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する"
6918 #: build/C/man3/pthread_getcpuclockid.3:33
6921 "B<#include E<lt>pthread.hE<gt>>\n"
6922 "B<#include E<lt>time.hE<gt>>\n"
6924 "B<#include E<lt>pthread.hE<gt>>\n"
6925 "B<#include E<lt>time.hE<gt>>\n"
6928 #: build/C/man3/pthread_getcpuclockid.3:35
6930 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clockid>B<);>\n"
6931 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clockid>B<);>\n"
6933 #. The clockid is constructed as follows:
6934 #. *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
6935 #. where CLOCK_IDFIELD_SIZE is 3.
6937 #: build/C/man3/pthread_getcpuclockid.3:49
6940 #| "The B<pthread_getcpuclockid>() function returns the clock ID for the CPU "
6941 #| "time clock of the thread I<thread>."
6943 "The B<pthread_getcpuclockid>() function obtains the ID of the CPU-time "
6944 "clock of the thread whose ID is given in I<thread>, and returns it in the "
6945 "location pointed to by I<clockid>."
6947 "B<pthread_getcpuclockid>() 関数は、\n"
6948 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
6951 #: build/C/man3/pthread_getcpuclockid.3:53
6956 #. CLOCK_THREAD_CPUTIME_ID not defined
6957 #. Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
6958 #. be possible if kernel thread IDs took more than 29 bits (which
6959 #. they currently cannot).
6961 #: build/C/man3/pthread_getcpuclockid.3:61
6962 msgid "Per-thread CPU time clocks are not supported by the system."
6963 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
6966 #: build/C/man3/pthread_getcpuclockid.3:68
6967 msgid "This function is available in glibc since version 2.2."
6968 msgstr "この関数は glibc バージョン 2.2 以降で利用できる。"
6971 #: build/C/man3/pthread_getcpuclockid.3:78
6973 msgid "B<pthread_getcpuclockid>()"
6974 msgstr "B<pthread_getcpuclockid>()"
6977 #: build/C/man3/pthread_getcpuclockid.3:93
6979 "When I<thread> refers to the calling thread, this function returns an "
6980 "identifier that refers to the same clock manipulated by B<clock_gettime>(2) "
6981 "and B<clock_settime>(2) when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
6983 "I<thread> が呼び出したスレッドを参照している場合、\n"
6984 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
6985 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
6989 #: build/C/man3/pthread_getcpuclockid.3:99
6991 "The program below creates a thread and then uses B<clock_gettime>(2) to "
6992 "retrieve the total process CPU time, and the per-thread CPU time consumed by "
6993 "the two threads. The following shell session shows an example run:"
6995 "以下のプログラムは、スレッドを作成し、それから\n"
6996 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
6997 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
6998 "スレッド毎の CPU 時間を取得する。\n"
6999 "下記のシェルのセッションは実行例である。"
7002 #: build/C/man3/pthread_getcpuclockid.3:109
7006 "Main thread sleeping\n"
7007 "Subthread starting infinite loop\n"
7008 "Main thread consuming some CPU time...\n"
7009 "Process total CPU time: 1.368\n"
7010 "Main thread CPU time: 0.376\n"
7011 "Subthread CPU time: 0.992\n"
7014 "Main thread sleeping\n"
7015 "Subthread starting infinite loop\n"
7016 "Main thread consuming some CPU time...\n"
7017 "Process total CPU time: 1.368\n"
7018 "Main thread CPU time: 0.376\n"
7019 "Subthread CPU time: 0.992\n"
7022 #: build/C/man3/pthread_getcpuclockid.3:115
7024 msgid "/* Link with \"-lrt\" */\n"
7025 msgstr "/* \"-lrt\" でリンクする */\n"
7028 #: build/C/man3/pthread_getcpuclockid.3:124
7031 "#include E<lt>time.hE<gt>\n"
7032 "#include E<lt>stdio.hE<gt>\n"
7033 "#include E<lt>stdint.hE<gt>\n"
7034 "#include E<lt>stdlib.hE<gt>\n"
7035 "#include E<lt>unistd.hE<gt>\n"
7036 "#include E<lt>pthread.hE<gt>\n"
7037 "#include E<lt>string.hE<gt>\n"
7038 "#include E<lt>errno.hE<gt>\n"
7040 "#include E<lt>time.hE<gt>\n"
7041 "#include E<lt>stdio.hE<gt>\n"
7042 "#include E<lt>stdint.hE<gt>\n"
7043 "#include E<lt>stdlib.hE<gt>\n"
7044 "#include E<lt>unistd.hE<gt>\n"
7045 "#include E<lt>pthread.hE<gt>\n"
7046 "#include E<lt>string.hE<gt>\n"
7047 "#include E<lt>errno.hE<gt>\n"
7050 #: build/C/man3/pthread_getcpuclockid.3:138
7054 "thread_start(void *arg)\n"
7056 " printf(\"Subthread starting infinite loop\\en\");\n"
7062 "thread_start(void *arg)\n"
7064 " printf(\"Subthread starting infinite loop\\en\");\n"
7070 #: build/C/man3/pthread_getcpuclockid.3:143
7074 "pclock(char *msg, clockid_t cid)\n"
7076 " struct timespec ts;\n"
7079 "pclock(char *msg, clockid_t cid)\n"
7081 " struct timespec ts;\n"
7084 #: build/C/man3/pthread_getcpuclockid.3:149
7087 " printf(\"%s\", msg);\n"
7088 " if (clock_gettime(cid, &ts) == -1)\n"
7089 " handle_error(\"clock_gettime\");\n"
7090 " printf(\"%4jd.%03ld\\en\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n"
7093 " printf(\"%s\", msg);\n"
7094 " if (clock_gettime(cid, &ts) == -1)\n"
7095 " handle_error(\"clock_gettime\");\n"
7096 " printf(\"%4jd.%03ld\\en\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n"
7100 #: build/C/man3/pthread_getcpuclockid.3:156
7104 "main(int argc, char *argv[])\n"
7106 " pthread_t thread;\n"
7111 "main(int argc, char *argv[])\n"
7113 " pthread_t thread;\n"
7118 #: build/C/man3/pthread_getcpuclockid.3:160
7121 " s = pthread_create(&thread, NULL, thread_start, NULL);\n"
7123 " handle_error_en(s, \"pthread_create\");\n"
7125 " s = pthread_create(&thread, NULL, thread_start, NULL);\n"
7127 " handle_error_en(s, \"pthread_create\");\n"
7130 #: build/C/man3/pthread_getcpuclockid.3:163
7133 " printf(\"Main thread sleeping\\en\");\n"
7136 " printf(\"Main thread sleeping\\en\");\n"
7140 #: build/C/man3/pthread_getcpuclockid.3:167
7143 " printf(\"Main thread consuming some CPU time...\\en\");\n"
7144 " for (int j = 0; j E<lt> 2000000; j++)\n"
7147 " printf(\"Main thread consuming some CPU time...\\en\");\n"
7148 " for (int j = 0; j E<lt> 2000000; j++)\n"
7152 #: build/C/man3/pthread_getcpuclockid.3:169
7154 msgid " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
7155 msgstr " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
7158 #: build/C/man3/pthread_getcpuclockid.3:174
7161 " s = pthread_getcpuclockid(pthread_self(), &cid);\n"
7163 " handle_error_en(s, \"pthread_getcpuclockid\");\n"
7164 " pclock(\"Main thread CPU time: \", cid);\n"
7166 " s = pthread_getcpuclockid(pthread_self(), &cid);\n"
7168 " handle_error_en(s, \"pthread_getcpuclockid\");\n"
7169 " pclock(\"Main thread CPU time: \", cid);\n"
7172 #: build/C/man3/pthread_getcpuclockid.3:177
7175 " /* The preceding 4 lines of code could have been replaced by:\n"
7176 " pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n"
7178 " /* The preceding 4 lines of code could have been replaced by:\n"
7179 " pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n"
7182 #: build/C/man3/pthread_getcpuclockid.3:182
7185 " s = pthread_getcpuclockid(thread, &cid);\n"
7187 " handle_error_en(s, \"pthread_getcpuclockid\");\n"
7188 " pclock(\"Subthread CPU time: 1 \", cid);\n"
7190 " s = pthread_getcpuclockid(thread, &cid);\n"
7192 " handle_error_en(s, \"pthread_getcpuclockid\");\n"
7193 " pclock(\"Subthread CPU time: 1 \", cid);\n"
7196 #: build/C/man3/pthread_getcpuclockid.3:185
7199 " exit(EXIT_SUCCESS); /* Terminates both threads */\n"
7202 " exit(EXIT_SUCCESS); /* Terminates both threads */\n"
7206 #: build/C/man3/pthread_getcpuclockid.3:194
7208 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
7209 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
7211 "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), "
7212 "B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
7215 #: build/C/man3/pthread_join.3:26
7217 msgid "PTHREAD_JOIN"
7218 msgstr "PTHREAD_JOIN"
7221 #: build/C/man3/pthread_join.3:29
7222 msgid "pthread_join - join with a terminated thread"
7223 msgstr "pthread_join - 終了したスレッドを join する"
7226 #: build/C/man3/pthread_join.3:34
7228 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
7229 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
7232 #: build/C/man3/pthread_join.3:49
7234 "The B<pthread_join>() function waits for the thread specified by I<thread> "
7235 "to terminate. If that thread has already terminated, then "
7236 "B<pthread_join>() returns immediately. The thread specified by I<thread> "
7239 "B<pthread_join>() 関数は、I<thread> で指定されたスレッドが\n"
7240 "終了するのを待つ。そのスレッドがすでに終了している場合、\n"
7241 "B<pthread_join>() はすぐに返る。\n"
7242 "I<thread> で指定されたスレッドは join 可能でなければならない。"
7245 #: build/C/man3/pthread_join.3:63
7247 "If I<retval> is not NULL, then B<pthread_join>() copies the exit status of "
7248 "the target thread (i.e., the value that the target thread supplied to "
7249 "B<pthread_exit>(3)) into the location pointed to by I<retval>. If the "
7250 "target thread was canceled, then B<PTHREAD_CANCELED> is placed in the "
7251 "location pointed to by I<retval>."
7252 msgstr "I<retval> が NULL でない場合、 B<pthread_join>() は対象スレッドの終了ステータス (すなわち、対象スレッドが B<pthread_exit>(3) に渡した値) を I<retval> が指す場所にコピーする。対象スレッドがキャンセルされた場合、 I<retval> が指す場所には B<PTHREAD_CANCELED> が格納される。"
7255 #: build/C/man3/pthread_join.3:70
7257 "If multiple threads simultaneously try to join with the same thread, the "
7258 "results are undefined. If the thread calling B<pthread_join>() is "
7259 "canceled, then the target thread will remain joinable (i.e., it will not be "
7262 "複数のスレッドが同時に同じスレッドを join しようとした場合、その結果\n"
7263 "は不定である。B<pthread_join>() を呼び出しているスレッドがキャンセル\n"
7264 "された場合、対象スレッドは join 可能のままとなる (detached 状態には\n"
7268 #: build/C/man3/pthread_join.3:75
7270 "On success, B<pthread_join>() returns 0; on error, it returns an error "
7272 msgstr "成功すると、 B<pthread_join>() は 0 を返す。エラーの場合、エラー番号を返す。"
7275 #: build/C/man3/pthread_join.3:76
7280 #. The following verified by testing on glibc 2.8/NPTL:
7281 #. The following verified by testing on glibc 2.8/NPTL:
7283 #: build/C/man3/pthread_join.3:85
7285 "A deadlock was detected (e.g., two threads tried to join with each other); "
7286 "or I<thread> specifies the calling thread."
7288 "デッドロックが検出された (例えば、二つのスレッドが互いに join しようと\n"
7289 "した場合)、または I<thread> に呼び出したスレッドが指定されている。"
7291 #. POSIX.1-2001 does not specify this error case.
7293 #: build/C/man3/pthread_join.3:93
7294 msgid "Another thread is already waiting to join with this thread."
7295 msgstr "別のスレッドがすでにこのスレッドの join 待ちである。"
7298 #: build/C/man3/pthread_join.3:108
7300 msgid "B<pthread_join>()"
7301 msgstr "B<pthread_join>()"
7304 #: build/C/man3/pthread_join.3:120
7306 "After a successful call to B<pthread_join>(), the caller is guaranteed that "
7307 "the target thread has terminated. The caller may then choose to do any "
7308 "clean-up that is required after termination of the thread (e.g., freeing "
7309 "memory or other resources that were allocated to the target thread)."
7313 #: build/C/man3/pthread_join.3:123
7315 "Joining with a thread that has previously been joined results in undefined "
7317 msgstr "すでに join されたスレッドを join した場合の結果は不定である。"
7320 #: build/C/man3/pthread_join.3:131
7322 "Failure to join with a thread that is joinable (i.e., one that is not "
7323 "detached), produces a \"zombie thread\". Avoid doing this, since each "
7324 "zombie thread consumes some system resources, and when enough zombie threads "
7325 "have accumulated, it will no longer be possible to create new threads (or "
7328 "join 可能なスレッド (detached 状態でないスレッド) の join に失敗した場合、\n"
7329 "\"ゾンビスレッド (zombie thread)\" が生成される。\n"
7330 "各ゾンビスレッドはシステムリソースをいくらかは消費し、\n"
7331 "ゾンビスレッドがたくさん生成されてしまうと、\n"
7332 "新しいスレッド (やプロセス) がそれ以上作成できなくなってしまうので、\n"
7333 "このようなことが起きるのは避けること。"
7336 #: build/C/man3/pthread_join.3:137
7338 "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, "
7339 "\"join with any terminated thread\". If you believe you need this "
7340 "functionality, you probably need to rethink your application design."
7342 "pthreads には、 I<waitpid(-1,\\ &status,\\ 0)>、つまり\n"
7343 "\"終了されたスレッドのどれかを join する\" といった機能はない。\n"
7344 "この機能が必要だと思うような場合には、おそらく\n"
7345 "自分のアプリケーションの設計を考え直す必要があるだろう。"
7348 #: build/C/man3/pthread_join.3:140
7350 "All of the threads in a process are peers: any thread can join with any "
7351 "other thread in the process."
7353 "プロセス内の全てのスレッドは対等であり、\n"
7354 "どのスレッドでもプロセス内の他のスレッドを join できる。"
7357 #: build/C/man3/pthread_join.3:150
7359 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
7360 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
7362 "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), "
7363 "B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
7366 #: build/C/man3/pthread_kill.3:26
7368 msgid "PTHREAD_KILL"
7369 msgstr "PTHREAD_KILL"
7372 #: build/C/man3/pthread_kill.3:29
7373 msgid "pthread_kill - send a signal to a thread"
7374 msgstr "pthread_kill - スレッドにシグナルを送信する"
7377 #: build/C/man3/pthread_kill.3:32 build/C/man3/pthread_sigmask.3:32
7379 msgid "B<#include E<lt>signal.hE<gt>>\n"
7380 msgstr "B<#include E<lt>signal.hE<gt>>\n"
7383 #: build/C/man3/pthread_kill.3:34
7385 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
7386 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
7389 #: build/C/man3/pthread_kill.3:45
7390 msgid "B<pthread_kill>():"
7391 msgstr "B<pthread_kill>():"
7394 #: build/C/man3/pthread_kill.3:47 build/C/man3/pthread_sigmask.3:48
7395 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
7396 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
7399 #: build/C/man3/pthread_kill.3:59
7401 "The B<pthread_kill>() function sends the signal I<sig> to I<thread>, a "
7402 "thread in the same process as the caller. The signal is asynchronously "
7403 "directed to I<thread>."
7405 "B<pthread_kill>() 関数は、呼び出したスレッドと同じプロセスの\n"
7406 "スレッド I<thread> にシグナル I<sig> を送信する。\n"
7407 "シグナルは非同期に I<thread> へ直接送られる。"
7410 #: build/C/man3/pthread_kill.3:63
7412 "If I<sig> is 0, then no signal is sent, but error checking is still "
7415 "I<sig> が 0 の場合、シグナルは送信されないが、エラーチェックだけは実行され"
7419 #: build/C/man3/pthread_kill.3:68
7421 "On success, B<pthread_kill>() returns 0; on error, it returns an error "
7422 "number, and no signal is sent."
7424 "成功すると、 B<pthread_kill>() は 0 を返す。\n"
7425 "エラーの場合、エラー番号を返し、シグナルの送信は行わない。"
7428 #: build/C/man3/pthread_kill.3:72
7429 msgid "An invalid signal was specified."
7430 msgstr "無効なシグナルが指定された。"
7433 #: build/C/man3/pthread_kill.3:82
7435 msgid "B<pthread_kill>()"
7436 msgstr "B<pthread_kill>()"
7439 #: build/C/man3/pthread_kill.3:93
7441 "Signal dispositions are process-wide: if a signal handler is installed, the "
7442 "handler will be invoked in the thread I<thread>, but if the disposition of "
7443 "the signal is \"stop\", \"continue\", or \"terminate\", this action will "
7444 "affect the whole process."
7446 "シグナルの配送はプロセス全体で行われる。\n"
7447 "シグナルハンドラーが設定されている場合、\n"
7448 "そのハンドラーがスレッド I<thread> で起動されるが、\n"
7449 "シグナルの配送が \"stop\", \"continue\", \"terminate\" のいずれかの場合、\n"
7450 "シグナルに対するアクションはプロセス全体に影響がある。"
7453 #: build/C/man3/pthread_kill.3:103
7455 "The glibc implementation of B<pthread_kill>() gives an error (B<EINVAL>) "
7456 "on attempts to send either of the real-time signals used internally by the "
7457 "NPTL threading implementation. See B<nptl>(7) for details."
7461 #: build/C/man3/pthread_kill.3:116
7463 "POSIX.1-2008 recommends that if an implementation detects the use of a "
7464 "thread ID after the end of its lifetime, B<pthread_kill>() should return "
7465 "the error B<ESRCH>. The glibc implementation returns this error in the "
7466 "cases where an invalid thread ID can be detected. But note also that POSIX "
7467 "says that an attempt to use a thread ID whose lifetime has ended produces "
7468 "undefined behavior, and an attempt to use an invalid thread ID in a call to "
7469 "B<pthread_kill>() can, for example, cause a segmentation fault."
7471 "POSIX.1-2008 では、 スレッドが終了した後にそのスレッド ID が使用されたことを"
7472 "検出した場合に、 B<pthread_kill>() はエラー B<ESRCH> を返すことを推奨されてい"
7473 "る。 glibc の実装では、無効なスレッド ID を検出できる場合にはこのエラーを返"
7474 "す。 しかし、 POSIX では、 終了したスレッド ID を使おうとした場合の動作は不定"
7475 "であり、 B<pthread_kill>() で無効なスレッド ID を使おうとした場合には、 例え"
7476 "ば、 セグメンテーションフォールトになる可能性もある点に注意すること。"
7479 #: build/C/man3/pthread_kill.3:125
7481 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
7482 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
7484 "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), "
7485 "B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
7488 #: build/C/man3/pthread_kill_other_threads_np.3:26
7490 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
7491 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
7494 #: build/C/man3/pthread_kill_other_threads_np.3:29
7495 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
7496 msgstr "pthread_kill_other_threads_np - プロセス内の他の全スレッドを終了する"
7499 #: build/C/man3/pthread_kill_other_threads_np.3:34
7501 msgid "B<void pthread_kill_other_threads_np(void);>\n"
7502 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
7505 #. Available since glibc 2.0
7507 #: build/C/man3/pthread_kill_other_threads_np.3:47
7509 "B<pthread_kill_other_threads_np>() has an effect only in the LinuxThreads "
7510 "threading implementation. On that implementation, calling this function "
7511 "causes the immediate termination of all threads in the application, except "
7512 "the calling thread. The cancellation state and cancellation type of the to-"
7513 "be-terminated threads are ignored, and the cleanup handlers are not called "
7516 "B<pthread_kill_other_threads_np>() は、\n"
7517 "LinuxThreads スレッド実装においてのみ効果がある。\n"
7518 "LinuxThreads スレッド実装では、この関数を呼び出すと\n"
7519 "アプリケーション内の全てのスレッドがすぐに終了される。\n"
7520 "終了対象のスレッドの cancelability state と cancelability type は\n"
7521 "無視され、それらのスレッドのクリーンアップハンドラーは呼び出されない。"
7524 #: build/C/man3/pthread_kill_other_threads_np.3:57
7526 msgid "B<pthread_kill_other_threads_np>()"
7527 msgstr "B<pthread_kill_other_threads_np>()"
7530 #: build/C/man3/pthread_kill_other_threads_np.3:71
7532 "B<pthread_kill_other_threads_np>() is intended to be called just before a "
7533 "thread calls B<execve>(2) or a similar function. This function is designed "
7534 "to address a limitation in the obsolete LinuxThreads implementation whereby "
7535 "the other threads of an application are not automatically terminated (as "
7536 "POSIX.1-2001 requires) during B<execve>(2)."
7538 "B<pthread_kill_other_threads_np>() は、\n"
7539 "スレッドが B<execve>(2) や同様の関数を呼び出す直前に\n"
7540 "呼ばれることを目的として用意されている。\n"
7541 "この関数は、(廃止予定の) LinuxThreads スレッド実装における、\n"
7542 "B<execve>(2) の際にアプリケーションの他のスレッドが自動的に\n"
7543 "終了されないという制限を解決するために設計された。"
7546 #: build/C/man3/pthread_kill_other_threads_np.3:78
7548 "In the NPTL threading implementation, B<pthread_kill_other_threads_np>() "
7549 "exists, but does nothing. (Nothing needs to be done, because the "
7550 "implementation does the right thing during an B<execve>(2).)"
7552 "NPTL スレッド実装では、 B<pthread_kill_other_threads_np>() は存在するが、\n"
7553 "何もしない(NPTL 実装は B<execve>(2) の際に適切な動作をするので、\n"
7557 #: build/C/man3/pthread_kill_other_threads_np.3:84
7559 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7560 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7562 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7563 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7566 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
7568 msgid "PTHREAD_RWLOCKATTR_SETKIND_NP"
7569 msgstr "PTHREAD_RWLOCKATTR_SETKIND_NP"
7572 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
7573 #: build/C/man3/pthread_atfork.3:25
7579 #: build/C/man3/pthread_rwlockattr_setkind_np.3:29
7581 "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - set/get the "
7582 "read-write lock kind of the thread read-write lock attribute object"
7584 "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - スレッドの読み"
7585 "書きロック属性オブジェクトの読み書きロック種別の設定、取得を行う"
7588 #: build/C/man3/pthread_rwlockattr_setkind_np.3:37
7591 "B<int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *>I<attr>B<,>\n"
7592 "B< int >I<pref>B<);>\n"
7593 "B<int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *>I<attr>B<,>\n"
7594 "B< int *>I<pref>B<);>\n"
7596 "B<int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *>I<attr>B<,>\n"
7597 "B< int >I<pref>B<);>\n"
7598 "B<int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *>I<attr>B<,>\n"
7599 "B< int *>I<pref>B<);>\n"
7602 #: build/C/man3/pthread_rwlockattr_setkind_np.3:48
7603 msgid "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
7605 "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
7608 #: build/C/man3/pthread_rwlockattr_setkind_np.3:52
7609 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _POSIX_C_SOURCE E<gt>= 200809L"
7610 msgstr "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _POSIX_C_SOURCE E<gt>= 200809L"
7613 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
7615 "The B<pthread_rwlockattr_setkind_np>() function sets the \"lock kind\" "
7616 "attribute of the read-write lock attribute object referred to by I<attr> to "
7617 "the value specified in I<pref>. The argument I<pref> may be set to one of "
7620 "B<pthread_rwlockattr_setkind_np>() 関数は、 I<attr> が参照する読み書きロック"
7621 "属性オブジェクトの「ロック種別 (lock kind)」を I<pref> で指定された値に設定す"
7622 "る。 引数 I<pref> には以下のいずれか一つを設定できる。"
7625 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
7627 msgid "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
7628 msgstr "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
7631 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
7633 "This is the default. A thread may hold multiple read locks; that is, read "
7634 "locks are recursive. According to The Single Unix Specification, the "
7635 "behavior is unspecified when a reader tries to place a lock, and there is no "
7636 "write lock but writers are waiting. Giving preference to the reader, as is "
7637 "set by B<PTHREAD_RWLOCK_PREFER_READER_NP>, implies that the reader will "
7638 "receive the requested lock, even if a writer is waiting. As long as there "
7639 "are readers, the writer will be starved."
7641 "これがデフォルトである。 スレッドは複数の読み出しロックを保持できる。 つま"
7642 "り、読み出しロックは再帰的である。 Single Unix Specification では、 読み出し"
7643 "側がロックをかけようとした際に、書き込みロックはないが書き込み側が待っていた"
7644 "場合の、動作は規定されていない。 B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定"
7645 "し、読み出し側に優先度を与えるということは、 たとえ書き込み側が待っていたとし"
7646 "ても、読み出し側が要求したロックを受け取ることを意味する。 読み出し側がいる限"
7650 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
7652 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
7653 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
7659 #. Here is the relevant wording:
7660 #. A thread may hold multiple concurrent read locks on rwlock (that is,
7661 #. successfully call the pthread_rwlock_rdlock() function n times). If
7662 #. so, the thread must perform matching unlocks (that is, it must call
7663 #. the pthread_rwlock_unlock() function n times).
7664 #. By making write-priority work correctly, I broke the above requirement,
7665 #. because I had no clue that recursive read locks are permissible.
7666 #. If a thread which holds a read lock tries to acquire another read lock,
7667 #. and now one or more writers is waiting for a write lock, then the algorithm
7668 #. will lead to an obvious deadlock. The reader will be suspended, waiting for
7669 #. the writers to acquire and release the lock, and the writers will be
7670 #. suspended waiting for every existing read lock to be released.
7672 #. https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
7673 #. https://sourceware.org/legacy-ml/libc-alpha/2000-01/msg00055.html
7674 #. https://sourceware.org/bugzilla/show_bug.cgi?id=7057
7676 #: build/C/man3/pthread_rwlockattr_setkind_np.3:108
7678 "This is intended as the write lock analog of "
7679 "B<PTHREAD_RWLOCK_PREFER_READER_NP>. This is ignored by glibc because the "
7680 "POSIX requirement to support recursive read locks would cause this option to "
7681 "create trivial deadlocks; instead use "
7682 "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> which ensures the "
7683 "application developer will not take recursive read locks thus avoiding "
7688 #: build/C/man3/pthread_rwlockattr_setkind_np.3:108
7690 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
7691 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
7694 #: build/C/man3/pthread_rwlockattr_setkind_np.3:113
7696 "Setting the lock kind to this avoids writer starvation as long as any read "
7697 "locking is not done in a recursive fashion."
7699 "ロック種別をこの値に設定すると、 読み出しロックが再帰的に行われない限りは、 "
7700 "書き込み側の待ちを避けることができる。"
7703 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
7705 "The B<pthread_rwlockattr_getkind_np>() function returns the value of the "
7706 "lock kind attribute of the read-write lock attribute object referred to by "
7707 "I<attr> in the pointer I<pref>."
7709 "B<pthread_rwlockattr_getkind_np>() 関数は、 I<attr> が参照する読み書きロック"
7710 "属性オブジェクトのロック種別属性の値をポインター I<pref> に入れて返す。"
7713 #: build/C/man3/pthread_rwlockattr_setkind_np.3:129
7715 "On success, these functions return 0. Given valid pointer arguments, "
7716 "B<pthread_rwlockattr_getkind_np>() always succeeds. On error, "
7717 "B<pthread_rwlockattr_setkind_np>() returns a nonzero error number."
7719 "成功すると、これらの関数は 0 を返す。 有効なポインター引数が渡された場合、 "
7720 "B<pthread_rwlockattr_getkind_np>() は常に成功する。 エラーの場合、 "
7721 "B<pthread_rwlockattr_setkind_np>() は 0 以外のエラー番号を返す。"
7724 #: build/C/man3/pthread_rwlockattr_setkind_np.3:134
7725 msgid "I<pref> specifies an unsupported value."
7726 msgstr "I<pref> にサポート外の値が指定された。"
7729 #: build/C/man3/pthread_rwlockattr_setkind_np.3:140
7731 "The B<pthread_rwlockattr_getkind_np>() and "
7732 "B<pthread_rwlockattr_setkind_np>() functions first appeared in glibc 2.1."
7734 "関数 B<pthread_rwlockattr_getkind_np>() と "
7735 "B<pthread_rwlockattr_setkind_np>() は glibc 2.1 で初めて登場した。"
7738 #: build/C/man3/pthread_rwlockattr_setkind_np.3:143
7740 "These functions are non-standard GNU extensions; hence the suffix \"_np"
7741 "\" (nonportable) in the names."
7743 "これらの関数は非標準の GNU による拡張である。 そのため、名前に \"_np\" (non-"
7744 "portable; 移植性がない) という接尾辞が付いている。"
7747 #: build/C/man3/pthread_rwlockattr_setkind_np.3:145
7748 msgid "B<pthreads>(7)"
7749 msgstr "B<pthreads>(7)"
7752 #: build/C/man3/pthread_self.3:26
7754 msgid "PTHREAD_SELF"
7755 msgstr "PTHREAD_SELF"
7758 #: build/C/man3/pthread_self.3:29
7759 msgid "pthread_self - obtain ID of the calling thread"
7760 msgstr "pthread_self - 呼び出したスレッドの ID を取得する"
7763 #: build/C/man3/pthread_self.3:34
7765 msgid "B<pthread_t pthread_self(void);>\n"
7766 msgstr "B<pthread_t pthread_self(void);>\n"
7769 #: build/C/man3/pthread_self.3:46
7771 "The B<pthread_self>() function returns the ID of the calling thread. This "
7772 "is the same value that is returned in I<*thread> in the "
7773 "B<pthread_create>(3) call that created this thread."
7775 "B<pthread_self>() 関数は、呼び出したスレッドの ID を返す。\n"
7776 "得られる ID は、このスレッドが作成された B<pthread_create>(3) の\n"
7777 "呼び出しで I<*thread> で返されるのと同じ値である。"
7780 #: build/C/man3/pthread_self.3:48
7781 msgid "This function always succeeds, returning the calling thread's ID."
7782 msgstr "この関数は常に成功し、呼び出したスレッドの ID を返す。"
7785 #: build/C/man3/pthread_self.3:60
7787 msgid "B<pthread_self>()"
7788 msgstr "B<pthread_self>()"
7791 #: build/C/man3/pthread_self.3:75
7793 "POSIX.1 allows an implementation wide freedom in choosing the type used to "
7794 "represent a thread ID; for example, representation using either an "
7795 "arithmetic type or a structure is permitted. Therefore, variables of type "
7796 "I<pthread_t> can't portably be compared using the C equality operator "
7797 "(B<==>); use B<pthread_equal>(3) instead."
7799 "POSIX.1 では、スレッド ID を表現するのに使用する型は、\n"
7800 "スレッド実装が完全に自由に選択してよいことになっている。\n"
7801 "例えば、スレッド ID を表現するのに数値型を使っても構造体を使ってもよい。\n"
7802 "そのため、移植性を確保しつつ、 C 言語の等価演算子 (B<==>) を使って、\n"
7803 "I<pthread_t> 型の変数の比較を行うことはできない。\n"
7804 "代わりに B<pthread_equal>(3) を使うこと。"
7807 #: build/C/man3/pthread_self.3:79
7809 "Thread identifiers should be considered opaque: any attempt to use a thread "
7810 "ID other than in pthreads calls is nonportable and can lead to unspecified "
7813 "スレッド識別子はその内部構造を意識すべきではない。\n"
7814 "pthreads 関数以外でスレッド ID を利用しようとした場合、\n"
7815 "移植性がなくなり、どのような結果が得られるかも分からない。"
7818 #: build/C/man3/pthread_self.3:83
7820 "Thread IDs are guaranteed to be unique only within a process. A thread ID "
7821 "may be reused after a terminated thread has been joined, or a detached "
7822 "thread has terminated."
7824 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
7825 "終了したスレッドが join されたり、\n"
7826 "切り離された (detached) スレッドが終了されたりした後は、\n"
7827 "そのスレッド ID は再利用されることがある。"
7830 #: build/C/man3/pthread_self.3:88
7832 "The thread ID returned by B<pthread_self>() is not the same thing as the "
7833 "kernel thread ID returned by a call to B<gettid>(2)."
7835 "B<pthread_self>() が返すスレッド ID は、\n"
7836 "B<gettid>(2) が返すカーネルスレッド ID とは違うものである。"
7839 #: build/C/man3/pthread_self.3:92
7840 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7841 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
7844 #: build/C/man3/pthread_setaffinity_np.3:26
7846 msgid "PTHREAD_SETAFFINITY_NP"
7847 msgstr "PTHREAD_SETAFFINITY_NP"
7850 #: build/C/man3/pthread_setaffinity_np.3:30
7852 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
7855 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
7856 "CPU affinity の設定/取得を行う"
7859 #: build/C/man3/pthread_setaffinity_np.3:39
7862 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7863 "B< const cpu_set_t *>I<cpuset>B<);>\n"
7864 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7865 "B< cpu_set_t *>I<cpuset>B<);>\n"
7867 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7868 "B< const cpu_set_t *>I<cpuset>B<);>\n"
7869 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
7870 "B< cpu_set_t *>I<cpuset>B<);>\n"
7873 #: build/C/man3/pthread_setaffinity_np.3:54
7875 "The B<pthread_setaffinity_np>() function sets the CPU affinity mask of the "
7876 "thread I<thread> to the CPU set pointed to by I<cpuset>. If the call is "
7877 "successful, and the thread is not currently running on one of the CPUs in "
7878 "I<cpuset>, then it is migrated to one of those CPUs."
7880 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7881 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
7882 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
7883 "場合は、スレッドは指定された CPU のいずれかに移動される。"
7886 #: build/C/man3/pthread_setaffinity_np.3:61
7888 "The B<pthread_getaffinity_np>() function returns the CPU affinity mask of "
7889 "the thread I<thread> in the buffer pointed to by I<cpuset>."
7891 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7892 "マスクを、I<cpuset> が指すバッファーに入れて返す。"
7895 #: build/C/man3/pthread_setaffinity_np.3:77
7897 "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to "
7898 "by I<cpuset>. Typically, this argument would be specified as "
7899 "I<sizeof(cpu_set_t)>. (It may be some other value, if using the macros "
7900 "described in B<CPU_SET>(3) for dynamically allocating a CPU set.)"
7902 "引数 I<cpusetsize> は I<cpuset> が指すバッファーの長さ (バイト単位) で\n"
7903 "ある。通常は、この引数には I<sizeof(cpu_set_t)> を指定する\n"
7904 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
7905 "割り当てている場合には、別の値になることもある)。"
7908 #: build/C/man3/pthread_setaffinity_np.3:81
7914 #: build/C/man3/pthread_setaffinity_np.3:84
7915 msgid "A supplied memory address was invalid."
7916 msgstr "指定されたメモリーアドレスが無効である。"
7919 #: build/C/man3/pthread_setaffinity_np.3:93
7921 "(B<pthread_setaffinity_np>()) The affinity bit mask I<mask> contains no "
7922 "processors that are currently physically on the system and permitted to the "
7923 "thread according to any restrictions that may be imposed by the \"cpuset\" "
7924 "mechanism described in B<cpuset>(7)."
7926 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
7927 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
7928 "されているプロセッサが一つも含まれていない。\n"
7929 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
7930 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
7933 #. The raw sched_getaffinity() system call returns the size (in bytes)
7934 #. of the cpumask_t type.
7936 #: build/C/man3/pthread_setaffinity_np.3:105
7938 "(B<pthread_setaffinity_np>()) I<cpuset> specified a CPU that was outside "
7939 "the set supported by the kernel. (The kernel configuration option "
7940 "B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data "
7941 "type used to represent CPU sets.)"
7943 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
7944 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
7945 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
7946 "データ型がサポートする CPU 集合の範囲が定義される。)"
7949 #: build/C/man3/pthread_setaffinity_np.3:110
7951 "(B<pthread_getaffinity_np>()) I<cpusetsize> is smaller than the size of the "
7952 "affinity mask used by the kernel."
7954 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
7955 "affinity マスクの大きさよりも小さい。"
7958 #: build/C/man3/pthread_setaffinity_np.3:128
7961 "B<pthread_setaffinity_np>(),\n"
7962 "B<pthread_getaffinity_np>()"
7964 "B<pthread_setaffinity_np>(),\n"
7965 "B<pthread_getaffinity_np>()"
7968 #: build/C/man3/pthread_setaffinity_np.3:146
7970 "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the "
7971 "thread will actually run is the intersection of the set specified in the "
7972 "I<cpuset> argument and the set of CPUs actually present on the system. The "
7973 "system may further restrict the set of CPUs on which the thread runs if the "
7974 "\"cpuset\" mechanism described in B<cpuset>(7) is being used. These "
7975 "restrictions on the actual set of CPUs on which the thread will run are "
7976 "silently imposed by the kernel."
7978 "B<pthread_setaffinity_np>() を呼び出した後、\n"
7979 "そのスレッドが実際に実行される CPU 集合は、\n"
7980 "I<cpuset> 引数で指定された集合と\n"
7981 "システムに実際に存在する CPU 集合の共通部分になる。\n"
7982 "また、 B<cpuset>(7) で説明されている \"cpuset\" 機構が使われている場合\n"
7983 "には、そのスレッドが実行される CPU 集合がシステムによってさらに制限\n"
7984 "される場合がある。そのスレッドが実行される実際の CPU 集合に対する\n"
7985 "これらの制限は、カーネルにより黙って適用される。"
7988 #: build/C/man3/pthread_setaffinity_np.3:152
7990 "These functions are implemented on top of the B<sched_setaffinity>(2) and "
7991 "B<sched_getaffinity>(2) system calls."
7993 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
7994 "B<sched_getaffinity>(2) を使って実装されている。"
7997 #: build/C/man3/pthread_setaffinity_np.3:163
7999 "A new thread created by B<pthread_create>(3) inherits a copy of its "
8000 "creator's CPU affinity mask."
8002 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
8003 "作成者の CPU affinity マスクを継承する。"
8006 #: build/C/man3/pthread_setaffinity_np.3:171
8008 "In the following program, the main thread uses B<pthread_setaffinity_np>() "
8009 "to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be "
8010 "available on the system), and then calls B<pthread_getaffinity_np>() to "
8011 "check the resulting CPU affinity mask of the thread."
8013 "以下のプログラムでは、メインスレッドは\n"
8014 "B<pthread_setaffinity_np>() を使って自分の CPU affinity マスクに\n"
8015 "CPU 0 から 7 が含まれるように設定し\n"
8016 "(システム上には 0 から 7 に対応する CPU が全て存在するとは限らない)、\n"
8017 "その後で B<pthread_getaffinity_np>() を使って\n"
8018 "スレッドに実際に設定された CPU affinity マスクを確認している。"
8021 #: build/C/man3/pthread_setaffinity_np.3:178
8022 #: build/C/man3/pthread_getattr_default_np.3:125
8025 "#define _GNU_SOURCE\n"
8026 "#include E<lt>pthread.hE<gt>\n"
8027 "#include E<lt>stdio.hE<gt>\n"
8028 "#include E<lt>stdlib.hE<gt>\n"
8029 "#include E<lt>errno.hE<gt>\n"
8031 "#define _GNU_SOURCE\n"
8032 "#include E<lt>pthread.hE<gt>\n"
8033 "#include E<lt>stdio.hE<gt>\n"
8034 "#include E<lt>stdlib.hE<gt>\n"
8035 "#include E<lt>errno.hE<gt>\n"
8038 #: build/C/man3/pthread_setaffinity_np.3:188
8042 "main(int argc, char *argv[])\n"
8045 " cpu_set_t cpuset;\n"
8046 " pthread_t thread;\n"
8049 "main(int argc, char *argv[])\n"
8052 " cpu_set_t cpuset;\n"
8053 " pthread_t thread;\n"
8056 #: build/C/man3/pthread_setaffinity_np.3:190
8058 msgid " thread = pthread_self();\n"
8059 msgstr " thread = pthread_self();\n"
8062 #: build/C/man3/pthread_setaffinity_np.3:192
8064 msgid " /* Set affinity mask to include CPUs 0 to 7 */\n"
8065 msgstr " /* Set affinity mask to include CPUs 0 to 7 */\n"
8068 #: build/C/man3/pthread_setaffinity_np.3:196
8071 " CPU_ZERO(&cpuset);\n"
8072 " for (int j = 0; j E<lt> 8; j++)\n"
8073 " CPU_SET(j, &cpuset);\n"
8075 " CPU_ZERO(&cpuset);\n"
8076 " for (int j = 0; j E<lt> 8; j++)\n"
8077 " CPU_SET(j, &cpuset);\n"
8080 #: build/C/man3/pthread_setaffinity_np.3:200
8083 " s = pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset);\n"
8085 " handle_error_en(s, \"pthread_setaffinity_np\");\n"
8087 " s = pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset);\n"
8089 " handle_error_en(s, \"pthread_setaffinity_np\");\n"
8092 #: build/C/man3/pthread_setaffinity_np.3:202
8094 msgid " /* Check the actual affinity mask assigned to the thread */\n"
8095 msgstr " /* Check the actual affinity mask assigned to the thread */\n"
8098 #: build/C/man3/pthread_setaffinity_np.3:206
8101 " s = pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset);\n"
8103 " handle_error_en(s, \"pthread_getaffinity_np\");\n"
8105 " s = pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset);\n"
8107 " handle_error_en(s, \"pthread_getaffinity_np\");\n"
8110 #: build/C/man3/pthread_setaffinity_np.3:211
8113 " printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
8114 " for (int j = 0; j E<lt> CPU_SETSIZE; j++)\n"
8115 " if (CPU_ISSET(j, &cpuset))\n"
8116 " printf(\" CPU %d\\en\", j);\n"
8118 " printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
8119 " for (int j = 0; j E<lt> CPU_SETSIZE; j++)\n"
8120 " if (CPU_ISSET(j, &cpuset))\n"
8121 " printf(\" CPU %d\\en\", j);\n"
8124 #: build/C/man3/pthread_setaffinity_np.3:214
8125 #: build/C/man3/pthread_setschedparam.3:445
8126 #: build/C/man3/pthread_getattr_default_np.3:195
8129 " exit(EXIT_SUCCESS);\n"
8132 " exit(EXIT_SUCCESS);\n"
8136 #: build/C/man3/pthread_setaffinity_np.3:224
8138 "B<sched_setaffinity>(2), B<CPU_SET>(3), B<pthread_attr_setaffinity_np>(3), "
8139 "B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), "
8141 msgstr "B<sched_setaffinity>(2), B<CPU_SET>(3), B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), B<sched>(7)"
8144 #: build/C/man3/pthread_setcancelstate.3:26
8146 msgid "PTHREAD_SETCANCELSTATE"
8147 msgstr "PTHREAD_SETCANCELSTATE"
8150 #: build/C/man3/pthread_setcancelstate.3:30
8152 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
8155 "pthread_setcancelstate, pthread_setcanceltype - cancelability state と "
8156 "cancelability type を設定する"
8159 #: build/C/man3/pthread_setcancelstate.3:36
8162 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
8163 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
8165 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
8166 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
8169 #: build/C/man3/pthread_setcancelstate.3:51
8171 "The B<pthread_setcancelstate>() sets the cancelability state of the calling "
8172 "thread to the value given in I<state>. The previous cancelability state of "
8173 "the thread is returned in the buffer pointed to by I<oldstate>. The "
8174 "I<state> argument must have one of the following values:"
8176 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
8177 "cancelability state に I<state> で指定された\n"
8178 "値を設定する。変更前のスレッドの cancelability state は\n"
8179 "I<oldstate> が指すバッファーで返される。\n"
8180 "I<state> 引数には以下の値のいずれか一つを指定しなければならない。"
8183 #: build/C/man3/pthread_setcancelstate.3:51
8185 msgid "B<PTHREAD_CANCEL_ENABLE>"
8186 msgstr "B<PTHREAD_CANCEL_ENABLE>"
8189 #: build/C/man3/pthread_setcancelstate.3:58
8191 "The thread is cancelable. This is the default cancelability state in all "
8192 "new threads, including the initial thread. The thread's cancelability type "
8193 "determines when a cancelable thread will respond to a cancellation request."
8195 "スレッドは取り消し可能 (cancelable) である。\n"
8196 "これが全ての新しく作成されるスレッドでのデフォルトの\n"
8197 "cancelability state である。これには最初のスレッドも含まれる。\n"
8198 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
8199 "取り消し要求にいつ反応するかが決まる。"
8202 #: build/C/man3/pthread_setcancelstate.3:58
8204 msgid "B<PTHREAD_CANCEL_DISABLE>"
8205 msgstr "B<PTHREAD_CANCEL_DISABLE>"
8208 #: build/C/man3/pthread_setcancelstate.3:63
8210 "The thread is not cancelable. If a cancellation request is received, it is "
8211 "blocked until cancelability is enabled."
8213 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
8214 "取り消し可能に設定されるまでその要求はブロックされる。"
8217 #: build/C/man3/pthread_setcancelstate.3:75
8219 "The B<pthread_setcanceltype>() sets the cancelability type of the calling "
8220 "thread to the value given in I<type>. The previous cancelability type of "
8221 "the thread is returned in the buffer pointed to by I<oldtype>. The I<type> "
8222 "argument must have one of the following values:"
8224 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
8225 "cancelability type に I<type> で指定された値を設定する。\n"
8226 "変更前のスレッドの cancelability type は\n"
8227 "I<oldtype> が指すバッファーで返される。\n"
8228 "I<type> 引数には以下の値のいずれか一つを指定しなければならない。"
8231 #: build/C/man3/pthread_setcancelstate.3:75
8233 msgid "B<PTHREAD_CANCEL_DEFERRED>"
8234 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
8237 #: build/C/man3/pthread_setcancelstate.3:82
8239 "A cancellation request is deferred until the thread next calls a function "
8240 "that is a cancellation point (see B<pthreads>(7)). This is the default "
8241 "cancelability type in all new threads, including the initial thread."
8243 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
8244 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
8245 "スレッドでのデフォルトの cancelability type である。\n"
8249 #: build/C/man3/pthread_setcancelstate.3:87
8251 "Even with deferred cancellation, a cancellation point in an asynchronous "
8252 "signal handler may still be acted upon and the effect is as if it was an "
8253 "asynchronous cancellation."
8257 #: build/C/man3/pthread_setcancelstate.3:87
8259 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
8260 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
8263 #: build/C/man3/pthread_setcancelstate.3:93
8265 "The thread can be canceled at any time. (Typically, it will be canceled "
8266 "immediately upon receiving a cancellation request, but the system doesn't "
8269 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
8270 "システムがそのことを保証しているわけではない)。"
8273 #: build/C/man3/pthread_setcancelstate.3:97
8275 "The set-and-get operation performed by each of these functions is atomic "
8276 "with respect to other threads in the process calling the same function."
8278 "これらの関数により実行される「設定と取得」操作 (set-and-get operation) は、\n"
8279 "同じ関数を呼び出したプロセス内の他のスレッドがあっても、\n"
8283 #: build/C/man3/pthread_setcancelstate.3:104
8284 msgid "The B<pthread_setcancelstate>() can fail with the following error:"
8285 msgstr "B<pthread_setcancelstate>() は以下のエラーで失敗する場合がある。"
8288 #: build/C/man3/pthread_setcancelstate.3:108
8289 msgid "Invalid value for I<state>."
8290 msgstr "I<state> に無効な値が指定された。"
8293 #: build/C/man3/pthread_setcancelstate.3:112
8294 msgid "The B<pthread_setcanceltype>() can fail with the following error:"
8295 msgstr "B<pthread_setcanceltype>() は以下のエラーで失敗する場合がある。"
8298 #. Available since glibc 2.0
8300 #: build/C/man3/pthread_setcancelstate.3:118
8301 msgid "Invalid value for I<type>."
8302 msgstr "I<type> に無効な値が指定された。"
8305 #: build/C/man3/pthread_setcancelstate.3:130
8306 #: build/C/man3/pthread_setcancelstate.3:136
8309 "B<pthread_setcancelstate>(),\n"
8310 "B<pthread_setcanceltype>()"
8312 "B<pthread_setcancelstate>(),\n"
8313 "B<pthread_setcanceltype>()"
8316 #: build/C/man3/pthread_setcancelstate.3:136
8318 msgid "Async-cancel-safety"
8319 msgstr "Async-cancel-safety"
8322 #: build/C/man3/pthread_setcancelstate.3:138
8328 #: build/C/man3/pthread_setcancelstate.3:147
8330 "For details of what happens when a thread is canceled, see "
8331 "B<pthread_cancel>(3)."
8333 "スレッドが取り消された場合に何が起こるかの詳細については\n"
8334 "B<pthread_cancel>(3) を参照。"
8337 #: build/C/man3/pthread_setcancelstate.3:154
8339 "Briefly disabling cancelability is useful if a thread performs some critical "
8340 "action that must not be interrupted by a cancellation request. Beware of "
8341 "disabling cancelability for long periods, or around operations that may "
8342 "block for long periods, since that will render the thread unresponsive to "
8343 "cancellation requests."
8345 "取り消し要求により中断されてはならない重要なアクションをスレッドが\n"
8346 "実行する場合、短い時間だけ cancelability を無効にするのは有用である。\n"
8347 "長い時間 cancelability を無効にしたり、長い時間停止 (block) される\n"
8348 "可能性のある操作の前後で cancelability を無効にしたりする際には\n"
8349 "注意すること。なぜなら、無効にしてしまうと、キャンセル要求に対して\n"
8350 "スレッドが応答しない状態になってしまうからである。"
8353 #: build/C/man3/pthread_setcancelstate.3:154
8355 msgid "Asynchronous cancelability"
8359 #: build/C/man3/pthread_setcancelstate.3:173
8361 "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely "
8362 "useful. Since the thread could be canceled at I<any> time, it cannot safely "
8363 "reserve resources (e.g., allocating memory with B<malloc>(3)), acquire "
8364 "mutexes, semaphores, or locks, and so on. Reserving resources is unsafe "
8365 "because the application has no way of knowing what the state of these "
8366 "resources is when the thread is canceled; that is, did cancellation occur "
8367 "before the resources were reserved, while they were reserved, or after they "
8368 "were released? Furthermore, some internal data structures (e.g., the linked "
8369 "list of free blocks managed by the B<malloc>(3) family of functions) may be "
8370 "left in an inconsistent state if cancellation occurs in the middle of the "
8371 "function call. Consequently, clean-up handlers cease to be useful."
8373 "cancelability type を B<PTHREAD_CANCEL_ASYNCHRONOUS> に設定して役に立つことは"
8374 "めったにない。スレッドはI<いつでも>キャンセルすることができることになるので、"
8375 "スレッドが安全にリソースの確保 (例えば B<malloc>(3) でメモリーを割り当てる) "
8376 "や mutex、セマフォ、ロックなどの獲得を行うことができない。アプリケーション"
8377 "は、スレッドがキャンセルされる際に、これらのリソースがどのような状態にあるか"
8378 "を知る術はないので、リソースの確保が安全ではなくなる。つまり、キャンセルが起"
8379 "こったのが、リソースの確保前なのか、確保中なのか、確保後なのかが分からない。"
8380 "さらに、関数呼び出しの最中にキャンセルが発生すると、いくつかの内部データ構造 "
8381 "(例えば、B<malloc>(3) 関連の関数が管理している未使用ブロックのリンクリスト) "
8382 "が一貫性のない状態のままになってしまう可能性がある。その結果、クリーンアップ"
8383 "ハンドラーが役に立たないものになってしまう。"
8386 #: build/C/man3/pthread_setcancelstate.3:184
8388 "Functions that can be safely asynchronously canceled are called I<async-"
8389 "cancel-safe functions>. POSIX.1-2001 and POSIX.1-2008 require only that "
8390 "B<pthread_cancel>(3), B<pthread_setcancelstate>(), and "
8391 "B<pthread_setcanceltype>() be async-cancel-safe. In general, other library "
8392 "functions can't be safely called from an asynchronously cancelable thread."
8393 msgstr "非同期で安全にキャンセルできる関数は I<async-cancel-safe functions> と呼ばれる。 POSIX.1-2001 と POSIX.1-2008 で、非同期で安全にキャンセルできるように求められている関数は B<pthread_cancel>(3), B<pthread_setcancelstate>(), B<pthread_setcanceltype>() だけである。 一般的には、それ以外のライブラリ関数は、非同期にキャンセルできるスレッドから安全に呼び出すことはできない。"
8396 #: build/C/man3/pthread_setcancelstate.3:187
8398 "One of the few circumstances in which asynchronous cancelability is useful "
8399 "is for cancellation of a thread that is in a pure compute-bound loop."
8401 "非同期でのキャンセルが有効な数少ない状況としては、純粋に計算だけを行うループ"
8402 "に入っているスレッドをキャンセルするといった場面がある。"
8405 #: build/C/man3/pthread_setcancelstate.3:187
8407 msgid "Portability notes"
8410 #. It looks like at least Solaris, FreeBSD and Tru64 support this.
8412 #: build/C/man3/pthread_setcancelstate.3:205
8414 "The Linux threading implementations permit the I<oldstate> argument of "
8415 "B<pthread_setcancelstate>() to be NULL, in which case the information about "
8416 "the previous cancelability state is not returned to the caller. Many other "
8417 "implementations also permit a NULL I<oldstat> argument, but POSIX.1 does not "
8418 "specify this point, so portable applications should always specify a non-"
8419 "NULL value in I<oldstate>. A precisely analogous set of statements applies "
8420 "for the I<oldtype> argument of B<pthread_setcanceltype>()."
8421 msgstr "Linux のスレッド実装では、 B<pthread_setcancelstate>() の I<oldstate> 引数に NULL を指定することを認めている。 NULL が指定された場合、変更前の cancelability state の情報が呼び出し側に返されない。他の多くの実装でも I<oldstate> 引数に NULL を指定することを認めているが、 POSIX.1 ではこの点については規定されていない。したがって、移植性が必要なアプリケーションでは常に I<oldstate> に NULL 以外の値を指定するようにすべきである。 B<pthread_setcanceltype>() の I<oldtype> 引数についても、全く同じことが言える。"
8424 #: build/C/man3/pthread_setcancelstate.3:208
8425 msgid "See B<pthread_cancel>(3)."
8426 msgstr "B<pthread_cancel>(3) を参照。"
8429 #: build/C/man3/pthread_setcancelstate.3:213
8431 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
8434 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
8438 #: build/C/man3/pthread_setconcurrency.3:25
8440 msgid "PTHREAD_SETCONCURRENCY"
8441 msgstr "PTHREAD_SETCONCURRENCY"
8444 #: build/C/man3/pthread_setconcurrency.3:29
8446 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
8449 "pthread_setconcurrency, pthread_getconcurrency - 並列処理レベルの設定/取得を"
8453 #: build/C/man3/pthread_setconcurrency.3:35
8456 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
8457 "B<int pthread_getconcurrency(>I<void>B<);>\n"
8459 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
8460 "B<int pthread_getconcurrency(>I<void>B<);>\n"
8463 #: build/C/man3/pthread_setconcurrency.3:48
8465 "The B<pthread_setconcurrency>() function informs the implementation of the "
8466 "application's desired concurrency level, specified in I<new_level>. The "
8467 "implementation takes this only as a hint: POSIX.1 does not specify the level "
8468 "of concurrency that should be provided as a result of calling "
8469 "B<pthread_setconcurrency>()."
8471 "B<pthread_setconcurrency>() 関数は、アプリケーションが希望する\n"
8472 "並列処理レベル (concurrency level) をスレッド実装に通知する。\n"
8473 "希望する並列処理レベルは I<new_level> で指定する。\n"
8474 "スレッド実装はこの情報をヒントとしてのみ利用する。\n"
8475 "POSIX.1 では、 B<pthread_setconcurrency>() の呼び出した結果、\n"
8476 "どのような並列度になるべきかは規定されていない。"
8479 #: build/C/man3/pthread_setconcurrency.3:53
8481 "Specifying I<new_level> as 0 instructs the implementation to manage the "
8482 "concurrency level as it deems appropriate."
8484 "I<new_level> に 0 を指定すると、スレッド実装は並列処理レベルを\n"
8485 "実装側で適切とみなしたレベルに設定するようになる。"
8488 #: build/C/man3/pthread_setconcurrency.3:56
8490 "B<pthread_getconcurrency>() returns the current value of the concurrency "
8491 "level for this process."
8493 "B<pthread_getconcurrency>() は、このプロセスの concurrency level\n"
8497 #: build/C/man3/pthread_setconcurrency.3:61
8499 "On success, B<pthread_setconcurrency>() returns 0; on error, it returns a "
8500 "nonzero error number."
8502 "成功すると、 B<pthread_setconcurrency>() は 0 を返す。\n"
8503 "エラーの場合、 0 以外のエラー番号を返す。"
8506 #: build/C/man3/pthread_setconcurrency.3:68
8508 "B<pthread_getconcurrency>() always succeeds, returning the concurrency "
8509 "level set by a previous call to B<pthread_setconcurrency>(), or 0, if "
8510 "B<pthread_setconcurrency>() has not previously been called."
8512 "B<pthread_getconcurrency>() は常に成功し、最後の\n"
8513 "B<pthread_getconcurrency>() の呼び出しで設定された \n"
8514 "concurrency level を返す。 B<pthread_getconcurrency>() が\n"
8515 "それまでに一度も呼び出されていない場合は 0 が返る。"
8518 #: build/C/man3/pthread_setconcurrency.3:71
8519 msgid "B<pthread_setconcurrency>() can fail with the following error:"
8520 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
8523 #: build/C/man3/pthread_setconcurrency.3:75
8524 msgid "I<new_level> is negative."
8525 msgstr "I<new_level> が負である。"
8528 #: build/C/man3/pthread_setconcurrency.3:81
8531 #| "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by "
8532 #| "I<new_level> would cause a system resource to be exceeded\")."
8534 "POSIX.1 also documents an B<EAGAIN> error (\"the value specified by "
8535 "I<new_level> would cause a system resource to be exceeded\")."
8537 "POSIX.1-2001 には、エラー B<EAGAIN> も記載されている\n"
8538 "(「I<new_level> に指定された値を適用すると、システムリソースが\n"
8542 #: build/C/man3/pthread_setconcurrency.3:83
8543 msgid "These functions are available in glibc since version 2.1."
8544 msgstr "これらの関数は glibc バージョン 2.1 以降で利用できる。"
8547 #: build/C/man3/pthread_setconcurrency.3:94
8550 "B<pthread_setconcurrency>(),\n"
8551 "B<pthread_getconcurrency>()"
8553 "B<pthread_setconcurrency>(),\n"
8554 "B<pthread_getconcurrency>()"
8557 #: build/C/man3/pthread_setconcurrency.3:100
8558 msgid "The default concurrency level is 0."
8559 msgstr "デフォルトの concurrency level は 0 である。"
8562 #: build/C/man3/pthread_setconcurrency.3:107
8564 "Concurrency levels are meaningful only for M:N threading implementations, "
8565 "where at any moment a subset of a process's set of user-level threads may be "
8566 "bound to a smaller number of kernel-scheduling entities. Setting the "
8567 "concurrency level allows the application to give the system a hint as to the "
8568 "number of kernel-scheduling entities that should be provided for efficient "
8569 "execution of the application."
8571 "並列処理レベルが意味を持つのは M:N スレッド実装の場合のみである。\n"
8572 "M:N スレッド実装では、ある瞬間において、あるプロセスのユーザーレベルスレッ\n"
8573 "ドの集合のサブ集合が、そのサブ集合のサイズよりも少ない数のカーネルの\n"
8574 "スケジューリング実体 (kernel-scheduling entity) に結び付けられる。\n"
8575 "並列処理レベルを設定すると、そのアプリケーションの効率的な実行に必要な\n"
8576 "カーネルのスケジューリング実体の数のヒントを、アプリケーションはシステ\n"
8580 #: build/C/man3/pthread_setconcurrency.3:113
8582 "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the "
8583 "concurrency level has no meaning. In other words, on Linux these functions "
8584 "merely exist for compatibility with other systems, and they have no effect "
8585 "on the execution of a program."
8587 "LinuxThreads と NPTL のどちらも 1:1 スレッド実装であり、\n"
8588 "並列処理レベルを設定しても何の意味もない。\n"
8589 "言い換えると、 Linux では、これらの関数は、\n"
8590 "他のシステムとの互換性のためだけに存在し、\n"
8591 "プログラムの実行には何の影響も与えないということである。"
8594 #: build/C/man3/pthread_setconcurrency.3:116
8595 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
8596 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
8599 #: build/C/man3/pthread_setname_np.3:26
8601 msgid "PTHREAD_SETNAME_NP"
8602 msgstr "PTHREAD_SETNAME_NP"
8605 #: build/C/man3/pthread_setname_np.3:29
8606 msgid "pthread_setname_np, pthread_getname_np - set/get the name of a thread"
8607 msgstr "pthread_setname_np, pthread_getname_np - スレッド名の設定/取得を行う"
8610 #: build/C/man3/pthread_setname_np.3:36
8613 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
8614 "B<#include E<lt>pthread.hE<gt>>\n"
8615 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
8616 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
8617 "B< char *>I<name>B<, size_t >I<len>B<);>\n"
8619 "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
8620 "B<#include E<lt>pthread.hE<gt>>\n"
8621 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
8622 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
8623 "B< char *>I<name>B<, size_t >I<len>B<);>\n"
8626 #: build/C/man3/pthread_setname_np.3:55
8628 "By default, all the threads created using B<pthread_create>() inherit the "
8629 "program name. The B<pthread_setname_np>() function can be used to set a "
8630 "unique name for a thread, which can be useful for debugging multithreaded "
8631 "applications. The thread name is a meaningful C language string, whose "
8632 "length is restricted to 16 characters, including the terminating null byte "
8633 "(\\(aq\\e0\\(aq). The I<thread> argument specifies the thread whose name is "
8634 "to be changed; I<name> specifies the new name."
8636 "デフォルトでは、 B<pthread_create>() で作成されたすべてのスレッドはプログラム"
8637 "名を継承する。 B<pthread_setname_np>() 関数を使うとスレッドに固有の名前を設定"
8638 "することができる。 スレッド固有の名前はマルチスレッドアプリケーションのデバッ"
8639 "グに便利である。 スレッド名は意味のある C 言語の文字列である。 その長さは 16 "
8640 "文字に限定されており、 終端のヌルバイト (\\(aq\\e0\\(aq) も 16 文字に含まれ"
8641 "る。 I<thread> 引数で名前を変更するスレッドを指定する。 I<name> には新しい"
8645 #: build/C/man3/pthread_setname_np.3:72
8647 "The B<pthread_getname_np>() function can be used to retrieve the name of "
8648 "the thread. The I<thread> argument specifies the thread whose name is to be "
8649 "retrieved. The buffer I<name> is used to return the thread name; I<len> "
8650 "specifies the number of bytes available in I<name>. The buffer specified by "
8651 "I<name> should be at least 16 characters in length. The returned thread "
8652 "name in the output buffer will be null terminated."
8654 "B<pthread_getname_np>() 関数を使うと、 スレッド名を取得することができる。 "
8655 "I<thread> 引数は名前を取得するスレッドを指定する。 バッファー I<name> はス"
8656 "レッド名を返すのに使用される。 I<len> には I<name> の大きさをバイトで指定す"
8657 "る。 I<name> で指定されたバッファーの大きさは最低でも 16 文字とすべきであ"
8658 "る。 出力バッファーに返されたスレッド名はヌル終端される。"
8661 #: build/C/man3/pthread_setname_np.3:79
8663 "The B<pthread_setname_np>() function can fail with the following error:"
8664 msgstr "B<pthread_setname_np>() は以下のエラーで失敗する場合がある。"
8667 #: build/C/man3/pthread_setname_np.3:79 build/C/man3/pthread_setname_np.3:88
8673 #: build/C/man3/pthread_setname_np.3:84
8675 "The length of the string specified pointed to by I<name> exceeds the allowed "
8677 msgstr "I<name> で指定された文字列の長さが、許可されている上限を超えている。"
8680 #: build/C/man3/pthread_setname_np.3:88
8682 "The B<pthread_getname_np>() function can fail with the following error:"
8683 msgstr "B<pthread_getname_np>() は以下のエラーで失敗する場合がある。"
8686 #: build/C/man3/pthread_setname_np.3:95
8688 "The buffer specified by I<name> and I<len> is too small to hold the thread "
8691 "I<name> と I<len> で指定されたバッファーが、 スレッド名を格納するには短かすぎ"
8695 #: build/C/man3/pthread_setname_np.3:100
8697 "If either of these functions fails to open I</proc/self/task/[tid]/comm>, "
8698 "then the call may fail with one of the errors described in B<open>(2)."
8700 "I</proc/self/task/[tid]/comm> のオープンに失敗した場合、 これらの関数は "
8701 "B<open>(2) で説明されているエラーのいずれかで失敗する。"
8704 #: build/C/man3/pthread_setname_np.3:102
8705 msgid "These functions first appeared in glibc in version 2.12."
8706 msgstr "これらの関数は glibc バージョン 2.12 で初めて登場した。"
8709 #: build/C/man3/pthread_setname_np.3:113
8712 "B<pthread_setname_np>(),\n"
8713 "B<pthread_getname_np>()"
8715 "B<pthread_setname_np>(),\n"
8716 "B<pthread_getname_np>()"
8719 #: build/C/man3/pthread_setname_np.3:129
8721 "B<pthread_setname_np>() internally writes to the thread-specific I<comm> "
8722 "file under the I</proc> filesystem: I</proc/self/task/[tid]/comm>. "
8723 "B<pthread_getname_np>() retrieves it from the same location."
8725 "B<pthread_setname_np>() は内部で I</proc> ファイルシステムのスレッド固有の "
8726 "I<comm> ファイル (I</proc/self/task/[tid]/comm>) に書き込みを行う。 "
8727 "B<pthread_getname_np>() はこのファイルから読み出しを行う。"
8730 #: build/C/man3/pthread_setname_np.3:134
8732 "The program below demonstrates the use of B<pthread_setname_np>() and "
8733 "B<pthread_getname_np>()."
8735 "以下のプログラムは、 B<pthread_setname_np>() と B<pthread_getname_np>()\n"
8739 #: build/C/man3/pthread_setname_np.3:136
8740 msgid "The following shell session shows a sample run of the program:"
8741 msgstr "以下のシェルセッションは、このプログラムの実行例である。"
8744 #: build/C/man3/pthread_setname_np.3:152
8748 "Created a thread. Default name is: a.out\n"
8749 "The thread name after setting it is THREADFOO.\n"
8750 "B<\\(haZ> # Suspend the program\n"
8751 "[1]+ Stopped ./a.out\n"
8752 "$ B<ps H -C a.out -o \\(aqpid tid cmd comm\\(aq>\n"
8753 " PID TID CMD COMMAND\n"
8754 " 5990 5990 ./a.out a.out\n"
8755 " 5990 5991 ./a.out THREADFOO\n"
8756 "$ B<cat /proc/5990/task/5990/comm>\n"
8758 "$ B<cat /proc/5990/task/5991/comm>\n"
8762 "Created a thread. Default name is: a.out\n"
8763 "The thread name after setting it is THREADFOO.\n"
8764 "B<\\(haZ> # Suspend the program\n"
8765 "[1]+ Stopped ./a.out\n"
8766 "$ B<ps H -C a.out -o \\(aqpid tid cmd comm\\(aq>\n"
8767 " PID TID CMD COMMAND\n"
8768 " 5990 5990 ./a.out a.out\n"
8769 " 5990 5991 ./a.out THREADFOO\n"
8770 "$ B<cat /proc/5990/task/5990/comm>\n"
8772 "$ B<cat /proc/5990/task/5991/comm>\n"
8776 #: build/C/man3/pthread_setname_np.3:164
8779 "#define _GNU_SOURCE\n"
8780 "#include E<lt>pthread.hE<gt>\n"
8781 "#include E<lt>stdio.hE<gt>\n"
8782 "#include E<lt>string.hE<gt>\n"
8783 "#include E<lt>unistd.hE<gt>\n"
8784 "#include E<lt>errno.hE<gt>\n"
8785 "#include E<lt>stdlib.hE<gt>\n"
8787 "#define _GNU_SOURCE\n"
8788 "#include E<lt>pthread.hE<gt>\n"
8789 "#include E<lt>stdio.hE<gt>\n"
8790 "#include E<lt>string.hE<gt>\n"
8791 "#include E<lt>unistd.hE<gt>\n"
8792 "#include E<lt>errno.hE<gt>\n"
8793 "#include E<lt>stdlib.hE<gt>\n"
8796 #: build/C/man3/pthread_setname_np.3:166
8798 msgid "#define NAMELEN 16\n"
8799 msgstr "#define NAMELEN 16\n"
8802 #: build/C/man3/pthread_setname_np.3:170
8803 #: build/C/man3/pthread_getattr_default_np.3:129
8806 "#define errExitEN(en, msg) \\e\n"
8807 " do { errno = en; perror(msg); \\e\n"
8808 " exit(EXIT_FAILURE); } while (0)\n"
8810 "#define errExitEN(en, msg) \\e\n"
8811 " do { errno = en; perror(msg); \\e\n"
8812 " exit(EXIT_FAILURE); } while (0)\n"
8815 #: build/C/man3/pthread_setname_np.3:177
8819 "threadfunc(void *parm)\n"
8821 " sleep(5); // allow main program to set the thread name\n"
8826 "threadfunc(void *parm)\n"
8828 " sleep(5); // allow main program to set the thread name\n"
8833 #: build/C/man3/pthread_setname_np.3:184
8837 "main(int argc, char **argv)\n"
8839 " pthread_t thread;\n"
8841 " char thread_name[NAMELEN];\n"
8844 "main(int argc, char **argv)\n"
8846 " pthread_t thread;\n"
8848 " char thread_name[NAMELEN];\n"
8851 #: build/C/man3/pthread_setname_np.3:188
8854 " rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8856 " errExitEN(rc, \"pthread_create\");\n"
8858 " rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8860 " errExitEN(rc, \"pthread_create\");\n"
8863 #: build/C/man3/pthread_setname_np.3:192
8866 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8868 " errExitEN(rc, \"pthread_getname_np\");\n"
8870 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8872 " errExitEN(rc, \"pthread_getname_np\");\n"
8875 #: build/C/man3/pthread_setname_np.3:197
8878 " printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8879 " rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8881 " errExitEN(rc, \"pthread_setname_np\");\n"
8883 " printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
8884 " rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
8886 " errExitEN(rc, \"pthread_setname_np\");\n"
8889 #: build/C/man3/pthread_setname_np.3:199
8890 #: build/C/man3/pthread_mutexattr_setrobust.3:250
8892 msgid " sleep(2);\n"
8893 msgstr " sleep(2);\n"
8896 #: build/C/man3/pthread_setname_np.3:205
8899 " rc = pthread_getname_np(thread, thread_name,\n"
8900 " (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8902 " errExitEN(rc, \"pthread_getname_np\");\n"
8903 " printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8905 " rc = pthread_getname_np(thread, thread_name,\n"
8906 " (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8908 " errExitEN(rc, \"pthread_getname_np\");\n"
8909 " printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8912 #: build/C/man3/pthread_setname_np.3:209
8915 " rc = pthread_join(thread, NULL);\n"
8917 " errExitEN(rc, \"pthread_join\");\n"
8919 " rc = pthread_join(thread, NULL);\n"
8921 " errExitEN(rc, \"pthread_join\");\n"
8924 #: build/C/man3/pthread_setname_np.3:213
8927 " printf(\"Done\\en\");\n"
8928 " exit(EXIT_SUCCESS);\n"
8931 " printf(\"Done\\en\");\n"
8932 " exit(EXIT_SUCCESS);\n"
8936 #: build/C/man3/pthread_setname_np.3:220
8937 msgid "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8938 msgstr "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
8941 #: build/C/man3/pthread_setschedparam.3:26
8943 msgid "PTHREAD_SETSCHEDPARAM"
8944 msgstr "PTHREAD_SETSCHEDPARAM"
8947 #: build/C/man3/pthread_setschedparam.3:30
8949 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
8950 "parameters of a thread"
8952 "pthread_setschedparam, pthread_getschedparam - スレッドの\n"
8953 "スケジューリングポリシーとパラメーターを設定/取得する"
8956 #: build/C/man3/pthread_setschedparam.3:38
8959 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8960 "B< const struct sched_param *>I<param>B<);>\n"
8961 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8962 "B< struct sched_param *>I<param>B<);>\n"
8964 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
8965 "B< const struct sched_param *>I<param>B<);>\n"
8966 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
8967 "B< struct sched_param *>I<param>B<);>\n"
8970 #: build/C/man3/pthread_setschedparam.3:46
8972 "The B<pthread_setschedparam>() function sets the scheduling policy and "
8973 "parameters of the thread I<thread>."
8975 "B<pthread_setschedparam>() 関数は、スレッド I<thread> の\n"
8976 "スケジューリングポリシーとスケジューリングパラメーターを設定する。"
8978 #. FIXME . pthread_setschedparam() places no restriction on the policy,
8979 #. but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
8980 #. http://sourceware.org/bugzilla/show_bug.cgi?id=7013
8982 #: build/C/man3/pthread_setschedparam.3:57
8984 "I<policy> specifies the new scheduling policy for I<thread>. The supported "
8985 "values for I<policy>, and their semantics, are described in B<sched>(7)."
8987 "I<policy> は I<thread> の新しいスケジューリングポリシーを指定する。 "
8988 "I<policy> に指定できる値とその意味は B<sched>(7) で説明されている。"
8991 #: build/C/man3/pthread_setschedparam.3:63
8993 "The structure pointed to by I<param> specifies the new scheduling parameters "
8994 "for I<thread>. Scheduling parameters are maintained in the following "
8997 "I<param> が指す構造体は I<thread> の新しいスケジューリングパラメーターを\n"
8998 "指定する。スケジューリングパラメーターは以下の構造体で管理される。"
9000 #. FIXME . nptl/pthread_setschedparam.c has the following
9001 #. /* If the thread should have higher priority because of some
9002 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
9003 #. Eventually (perhaps after writing the mutexattr pages), we
9004 #. may want to add something on the topic to this page.
9006 #: build/C/man3/pthread_setschedparam.3:104
9008 "The B<pthread_getschedparam>() function returns the scheduling policy and "
9009 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
9010 "and I<param>, respectively. The returned priority value is that set by the "
9011 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
9012 "B<pthread_create>(3) call that affected I<thread>. The returned priority "
9013 "does not reflect any temporary priority adjustments as a result of calls to "
9014 "any priority inheritance or priority ceiling functions (see, for example, "
9015 "B<pthread_mutexattr_setprioceiling>(3) and "
9016 "B<pthread_mutexattr_setprotocol>(3))."
9018 "B<pthread_getschedparam>() 関数は、スレッド I<thread> の\n"
9019 "スケジューリングポリシーとパラメーターを、\n"
9020 "それぞれ I<policy> と I<param> が指すバッファーに入れて返す。\n"
9021 "返された優先度の値は、最も最近実行した I<thread> に影響を与える\n"
9022 "B<pthread_setschedparam>(), B<pthread_setschedprio>,\n"
9023 "B<pthread_create> で設定された値となる。\n"
9024 "返された優先度は、優先度の継承や優先度の上限を設定する関数\n"
9025 "(例えば B<pthread_mutexattr_setprioceiling>(3) や\n"
9026 "B<pthread_mutexattr_setprotocol>(3) を参照) の呼び出しの結果\n"
9027 "行われる一時的な優先度の調整の影響を受けない。"
9030 #: build/C/man3/pthread_setschedparam.3:112
9032 "On success, these functions return 0; on error, they return a nonzero error "
9033 "number. If B<pthread_setschedparam>() fails, the scheduling policy and "
9034 "parameters of I<thread> are not changed."
9036 "成功すると、これらの関数は 0 を返す。\n"
9037 "エラーの場合、0 以外のエラー番号を返す。\n"
9038 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
9039 "スケジューリングポリシーとパラメーターは変更されない。"
9042 #: build/C/man3/pthread_setschedparam.3:114
9043 msgid "Both of these functions can fail with the following error:"
9044 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
9047 #: build/C/man3/pthread_setschedparam.3:122
9049 "B<pthread_setschedparam>() may additionally fail with the following errors:"
9050 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
9053 #: build/C/man3/pthread_setschedparam.3:129
9055 "I<policy> is not a recognized policy, or I<param> does not make sense for "
9058 "I<policy> が認識できないポリシーであるか、\n"
9059 "I<param> が I<policy> では意味を持たない値である。"
9062 #: build/C/man3/pthread_setschedparam.3:133
9064 "The caller does not have appropriate privileges to set the specified "
9065 "scheduling policy and parameters."
9067 "呼び出し側が、指定されたスケジューリングポリシーやパラメーターを設定する\n"
9071 #. Available since glibc 2.0
9073 #: build/C/man3/pthread_setschedparam.3:141
9075 "POSIX.1 also documents an B<ENOTSUP> (\"attempt was made to set the policy "
9076 "or scheduling parameters to an unsupported value\") error for "
9077 "B<pthread_setschedparam>()."
9079 "POSIX.1 では、 B<pthread_setschedparam>() に関して\n"
9080 "エラー B<ENOTSUP> (\"サポートされていない値をスケジューリングポリシーや\n"
9081 "パラメーターに設定しようとした\") も追加で規定されている。"
9084 #: build/C/man3/pthread_setschedparam.3:152
9087 "B<pthread_setschedparam>(),\n"
9088 "B<pthread_getschedparam>()"
9090 "B<pthread_setschedparam>(),\n"
9091 "B<pthread_getschedparam>()"
9094 #: build/C/man3/pthread_setschedparam.3:162
9096 "For a description of the permissions required to, and the effect of, "
9097 "changing a thread's scheduling policy and priority, and details of the "
9098 "permitted ranges for priorities in each scheduling policy, see B<sched>(7)."
9100 "スレッドのスケジューリングポリシーや優先度を変更するために必要な許可や変更し"
9101 "た場合の影響、および各スケジューリングポリシーで認められる優先度の範囲の詳細"
9102 "については、 B<sched>(7) を参照。"
9105 #: build/C/man3/pthread_setschedparam.3:169
9107 "The program below demonstrates the use of B<pthread_setschedparam>() and "
9108 "B<pthread_getschedparam>(), as well as the use of a number of other "
9109 "scheduling-related pthreads functions."
9111 "以下のプログラムは B<pthread_setschedparam>() と\n"
9112 "B<pthread_getschedparam>() やスケジューリングに関連する pthreads の\n"
9113 "他のいろいろな関数の使用例を示すものである。"
9116 #: build/C/man3/pthread_setschedparam.3:185
9118 "In the following run, the main thread sets its scheduling policy to "
9119 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
9120 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
9121 "priority attribute of 20. The program then sets (using "
9122 "B<pthread_attr_setinheritsched>(3)) the inherit scheduler attribute of the "
9123 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
9124 "created using this attributes object should take their scheduling attributes "
9125 "from the thread attributes object. The program then creates a thread using "
9126 "the thread attributes object, and that thread displays its scheduling policy "
9129 "以下の実行例では、メインスレッドは、自分のスケジューリングポリシーを\n"
9130 "優先度 10 の B<SCHED_FIFO> を設定し、スレッド属性オブジェクトを\n"
9131 "スケジューリングポリシー属性 B<SCHED_RR> とスケジューリング優先度\n"
9133 "次に、このプログラムは (B<pthread_attr_setinheritsched>(3) を使って) \n"
9134 "そのスレッド属性オブジェクトの inherit scheduler 属性に\n"
9135 "B<PTHREAD_EXPLICIT_SCHED> を設定する。B<PTHREAD_EXPLICIT_SCHED> は、\n"
9136 "そのスレッド属性オブジェクトを使って作成されたスレッドはスレッド属性\n"
9137 "オブジェクトからスケジューリング属性を取得して使うことを意味する。\n"
9138 "それから、このスレッド属性オブジェクトを使ってスレッドを作成し、\n"
9139 "作成したスレッドのスケジューリングポリシーと優先度を表示する。"
9142 #: build/C/man3/pthread_setschedparam.3:193
9145 "$ B<su> # Need privilege to set real-time scheduling policies\n"
9147 "# B<./a.out -mf10 -ar20 -i e>\n"
9148 "Scheduler settings of main thread\n"
9149 " policy=SCHED_FIFO, priority=10\n"
9151 "$ B<su> # Need privilege to set real-time scheduling policies\n"
9153 "# B<./a.out -mf10 -ar20 -i e>\n"
9154 "Scheduler settings of main thread\n"
9155 " policy=SCHED_FIFO, priority=10\n"
9158 #: build/C/man3/pthread_setschedparam.3:197
9161 "Scheduler settings in \\(aqattr\\(aq\n"
9162 " policy=SCHED_RR, priority=20\n"
9163 " inheritsched is EXPLICIT\n"
9165 "Scheduler settings in \\(aqattr\\(aq\n"
9166 " policy=SCHED_RR, priority=20\n"
9167 " inheritsched is EXPLICIT\n"
9170 #: build/C/man3/pthread_setschedparam.3:200
9173 "Scheduler attributes of new thread\n"
9174 " policy=SCHED_RR, priority=20\n"
9176 "Scheduler attributes of new thread\n"
9177 " policy=SCHED_RR, priority=20\n"
9180 #: build/C/man3/pthread_setschedparam.3:205
9182 "In the above output, one can see that the scheduling policy and priority "
9183 "were taken from the values specified in the thread attributes object."
9185 "上記の出力では、スケジューリングポリシーと優先度がスレッド属性\n"
9186 "オブジェクトで指定された値から取られていることが分かる。"
9189 #: build/C/man3/pthread_setschedparam.3:212
9191 "The next run is the same as the previous, except that the inherit scheduler "
9192 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
9193 "using the thread attributes object should ignore the scheduling attributes "
9194 "specified in the attributes object and instead take their scheduling "
9195 "attributes from the creating thread."
9197 "次の実行例は前のものと同じだが、 inherit scheduler 属性が \n"
9198 "B<PTHREAD_INHERIT_SCHED> に設定される点が異なる。\n"
9199 "B<PTHREAD_INHERIT_SCHED> は、そのスレッド属性オブジェクトを使って作成\n"
9200 "されたスレッドは、スレッド属性オブジェクトからスケジューリング属性を\n"
9201 "無視し、代わりに呼び出したスレッドからスケジューリング属性を取得する\n"
9205 #: build/C/man3/pthread_setschedparam.3:218
9208 "# B<./a.out -mf10 -ar20 -i i>\n"
9209 "Scheduler settings of main thread\n"
9210 " policy=SCHED_FIFO, priority=10\n"
9212 "# B<./a.out -mf10 -ar20 -i i>\n"
9213 "Scheduler settings of main thread\n"
9214 " policy=SCHED_FIFO, priority=10\n"
9217 #: build/C/man3/pthread_setschedparam.3:222
9220 "Scheduler settings in \\(aqattr\\(aq\n"
9221 " policy=SCHED_RR, priority=20\n"
9222 " inheritsched is INHERIT\n"
9224 "Scheduler settings in \\(aqattr\\(aq\n"
9225 " policy=SCHED_RR, priority=20\n"
9226 " inheritsched is INHERIT\n"
9229 #: build/C/man3/pthread_setschedparam.3:225
9232 "Scheduler attributes of new thread\n"
9233 " policy=SCHED_FIFO, priority=10\n"
9235 "Scheduler attributes of new thread\n"
9236 " policy=SCHED_FIFO, priority=10\n"
9239 #: build/C/man3/pthread_setschedparam.3:231
9241 "In the above output, one can see that the scheduling policy and priority "
9242 "were taken from the creating thread, rather than the thread attributes "
9245 "上記の出力では、スケジューリングポリシーと優先度が、\n"
9246 "スレッド属性オブジェクトからではなく、\n"
9247 "スレッドを作成したスレッドから取れれていることが分かる。"
9250 #: build/C/man3/pthread_setschedparam.3:237
9252 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
9253 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
9254 "scheduler attribute."
9256 "なお、 I<-i\\ i> を省略した場合でも、\n"
9257 "B<PTHREAD_INHERIT_SCHED> が inherit scheduler 属性のデフォルト値なので、\n"
9261 #: build/C/man3/pthread_setschedparam.3:241
9263 msgid "/* pthreads_sched_test.c */\n"
9264 msgstr "/* pthreads_sched_test.c */\n"
9267 #: build/C/man3/pthread_setschedparam.3:247
9270 "#include E<lt>pthread.hE<gt>\n"
9271 "#include E<lt>stdio.hE<gt>\n"
9272 "#include E<lt>stdlib.hE<gt>\n"
9273 "#include E<lt>unistd.hE<gt>\n"
9274 "#include E<lt>errno.hE<gt>\n"
9276 "#include E<lt>pthread.hE<gt>\n"
9277 "#include E<lt>stdio.hE<gt>\n"
9278 "#include E<lt>stdlib.hE<gt>\n"
9279 "#include E<lt>unistd.hE<gt>\n"
9280 "#include E<lt>errno.hE<gt>\n"
9283 #: build/C/man3/pthread_setschedparam.3:256
9287 "usage(char *prog_name, char *msg)\n"
9289 " if (msg != NULL)\n"
9290 " fputs(msg, stderr);\n"
9293 "usage(char *prog_name, char *msg)\n"
9295 " if (msg != NULL)\n"
9296 " fputs(msg, stderr);\n"
9299 #: build/C/man3/pthread_setschedparam.3:273
9302 " fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
9303 " fprintf(stderr, \"Options are:\\en\");\n"
9304 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg); /* Shorter */\n"
9305 " fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
9306 " fpe(\" thread attributes object\\en\");\n"
9307 " fpe(\" E<lt>policyE<gt> can be\\en\");\n"
9308 " fpe(\" f SCHED_FIFO\\en\");\n"
9309 " fpe(\" r SCHED_RR\\en\");\n"
9310 " fpe(\" o SCHED_OTHER\\en\");\n"
9311 " fpe(\"-A Use default thread attributes object\\en\");\n"
9312 " fpe(\"-i {e|i} Set inherit scheduler attribute to\\en\");\n"
9313 " fpe(\" \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
9314 " fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
9315 " fpe(\" main thread before pthread_create() call\\en\");\n"
9316 " exit(EXIT_FAILURE);\n"
9319 " fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
9320 " fprintf(stderr, \"Options are:\\en\");\n"
9321 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg); /* Shorter */\n"
9322 " fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
9323 " fpe(\" thread attributes object\\en\");\n"
9324 " fpe(\" E<lt>policyE<gt> can be\\en\");\n"
9325 " fpe(\" f SCHED_FIFO\\en\");\n"
9326 " fpe(\" r SCHED_RR\\en\");\n"
9327 " fpe(\" o SCHED_OTHER\\en\");\n"
9328 " fpe(\"-A Use default thread attributes object\\en\");\n"
9329 " fpe(\"-i {e|i} Set inherit scheduler attribute to\\en\");\n"
9330 " fpe(\" \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
9331 " fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
9332 " fpe(\" main thread before pthread_create() call\\en\");\n"
9333 " exit(EXIT_FAILURE);\n"
9337 #: build/C/man3/pthread_setschedparam.3:284
9341 "get_policy(char p, int *policy)\n"
9344 " case \\(aqf\\(aq: *policy = SCHED_FIFO; return 1;\n"
9345 " case \\(aqr\\(aq: *policy = SCHED_RR; return 1;\n"
9346 " case \\(aqo\\(aq: *policy = SCHED_OTHER; return 1;\n"
9347 " default: return 0;\n"
9352 "get_policy(char p, int *policy)\n"
9355 " case \\(aqf\\(aq: *policy = SCHED_FIFO; return 1;\n"
9356 " case \\(aqr\\(aq: *policy = SCHED_RR; return 1;\n"
9357 " case \\(aqo\\(aq: *policy = SCHED_OTHER; return 1;\n"
9358 " default: return 0;\n"
9363 #: build/C/man3/pthread_setschedparam.3:295
9367 "display_sched_attr(int policy, struct sched_param *param)\n"
9369 " printf(\" policy=%s, priority=%d\\en\",\n"
9370 " (policy == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
9371 " (policy == SCHED_RR) ? \"SCHED_RR\" :\n"
9372 " (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
9374 " param-E<gt>sched_priority);\n"
9378 "display_sched_attr(int policy, struct sched_param *param)\n"
9380 " printf(\" policy=%s, priority=%d\\en\",\n"
9381 " (policy == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
9382 " (policy == SCHED_RR) ? \"SCHED_RR\" :\n"
9383 " (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
9385 " param-E<gt>sched_priority);\n"
9389 #: build/C/man3/pthread_setschedparam.3:301
9393 "display_thread_sched_attr(char *msg)\n"
9396 " struct sched_param param;\n"
9399 "display_thread_sched_attr(char *msg)\n"
9402 " struct sched_param param;\n"
9405 #: build/C/man3/pthread_setschedparam.3:305
9408 " s = pthread_getschedparam(pthread_self(), &policy, ¶m);\n"
9410 " handle_error_en(s, \"pthread_getschedparam\");\n"
9412 " s = pthread_getschedparam(pthread_self(), &policy, ¶m);\n"
9414 " handle_error_en(s, \"pthread_getschedparam\");\n"
9417 #: build/C/man3/pthread_setschedparam.3:309
9420 " printf(\"%s\\en\", msg);\n"
9421 " display_sched_attr(policy, ¶m);\n"
9424 " printf(\"%s\\en\", msg);\n"
9425 " display_sched_attr(policy, ¶m);\n"
9429 #: build/C/man3/pthread_setschedparam.3:314
9433 "thread_start(void *arg)\n"
9435 " display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
9438 "thread_start(void *arg)\n"
9440 " display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
9443 #: build/C/man3/pthread_setschedparam.3:317
9453 #: build/C/man3/pthread_setschedparam.3:327
9457 "main(int argc, char *argv[])\n"
9459 " int s, opt, inheritsched, use_null_attrib, policy;\n"
9460 " pthread_t thread;\n"
9461 " pthread_attr_t attr;\n"
9462 " pthread_attr_t *attrp;\n"
9463 " char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
9464 " struct sched_param param;\n"
9467 "main(int argc, char *argv[])\n"
9469 " int s, opt, inheritsched, use_null_attrib, policy;\n"
9470 " pthread_t thread;\n"
9471 " pthread_attr_t attr;\n"
9472 " pthread_attr_t *attrp;\n"
9473 " char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
9474 " struct sched_param param;\n"
9477 #: build/C/man3/pthread_setschedparam.3:329
9479 msgid " /* Process command-line options */\n"
9480 msgstr " /* Process command-line options */\n"
9483 #: build/C/man3/pthread_setschedparam.3:334
9486 " use_null_attrib = 0;\n"
9487 " attr_sched_str = NULL;\n"
9488 " main_sched_str = NULL;\n"
9489 " inheritsched_str = NULL;\n"
9491 " use_null_attrib = 0;\n"
9492 " attr_sched_str = NULL;\n"
9493 " main_sched_str = NULL;\n"
9494 " inheritsched_str = NULL;\n"
9497 #: build/C/man3/pthread_setschedparam.3:344
9500 " while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
9502 " case \\(aqa\\(aq: attr_sched_str = optarg; break;\n"
9503 " case \\(aqA\\(aq: use_null_attrib = 1; break;\n"
9504 " case \\(aqi\\(aq: inheritsched_str = optarg; break;\n"
9505 " case \\(aqm\\(aq: main_sched_str = optarg; break;\n"
9506 " default: usage(argv[0], \"Unrecognized option\\en\");\n"
9510 " while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
9512 " case \\(aqa\\(aq: attr_sched_str = optarg; break;\n"
9513 " case \\(aqA\\(aq: use_null_attrib = 1; break;\n"
9514 " case \\(aqi\\(aq: inheritsched_str = optarg; break;\n"
9515 " case \\(aqm\\(aq: main_sched_str = optarg; break;\n"
9516 " default: usage(argv[0], \"Unrecognized option\\en\");\n"
9521 #: build/C/man3/pthread_setschedparam.3:348
9524 " if (use_null_attrib &&\n"
9525 " (inheritsched_str != NULL || attr_sched_str != NULL))\n"
9526 " usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
9528 " if (use_null_attrib &&\n"
9529 " (inheritsched_str != NULL || attr_sched_str != NULL))\n"
9530 " usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
9533 #: build/C/man3/pthread_setschedparam.3:351
9536 " /* Optionally set scheduling attributes of main thread,\n"
9537 " and display the attributes */\n"
9539 " /* Optionally set scheduling attributes of main thread,\n"
9540 " and display the attributes */\n"
9543 #: build/C/man3/pthread_setschedparam.3:356
9546 " if (main_sched_str != NULL) {\n"
9547 " if (!get_policy(main_sched_str[0], &policy))\n"
9548 " usage(argv[0], \"Bad policy for main thread (-m)\\en\");\n"
9549 " param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
9551 " if (main_sched_str != NULL) {\n"
9552 " if (!get_policy(main_sched_str[0], &policy))\n"
9553 " usage(argv[0], \"Bad policy for main thread (-m)\\en\");\n"
9554 " param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
9557 #: build/C/man3/pthread_setschedparam.3:361
9560 " s = pthread_setschedparam(pthread_self(), policy, ¶m);\n"
9562 " handle_error_en(s, \"pthread_setschedparam\");\n"
9565 " s = pthread_setschedparam(pthread_self(), policy, ¶m);\n"
9567 " handle_error_en(s, \"pthread_setschedparam\");\n"
9571 #: build/C/man3/pthread_setschedparam.3:364
9574 " display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
9575 " printf(\"\\en\");\n"
9577 " display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
9578 " printf(\"\\en\");\n"
9581 #: build/C/man3/pthread_setschedparam.3:366
9583 msgid " /* Initialize thread attributes object according to options */\n"
9584 msgstr " /* Initialize thread attributes object according to options */\n"
9587 #: build/C/man3/pthread_setschedparam.3:375
9590 " if (!use_null_attrib) {\n"
9591 " s = pthread_attr_init(&attr);\n"
9593 " handle_error_en(s, \"pthread_attr_init\");\n"
9597 " if (!use_null_attrib) {\n"
9598 " s = pthread_attr_init(&attr);\n"
9600 " handle_error_en(s, \"pthread_attr_init\");\n"
9605 #: build/C/man3/pthread_setschedparam.3:383
9608 " if (inheritsched_str != NULL) {\n"
9609 " if (inheritsched_str[0] == \\(aqe\\(aq)\n"
9610 " inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
9611 " else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
9612 " inheritsched = PTHREAD_INHERIT_SCHED;\n"
9614 " usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
9616 " if (inheritsched_str != NULL) {\n"
9617 " if (inheritsched_str[0] == \\(aqe\\(aq)\n"
9618 " inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
9619 " else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
9620 " inheritsched = PTHREAD_INHERIT_SCHED;\n"
9622 " usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
9625 #: build/C/man3/pthread_setschedparam.3:388
9628 " s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
9630 " handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
9633 " s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
9635 " handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
9639 #: build/C/man3/pthread_setschedparam.3:394
9642 " if (attr_sched_str != NULL) {\n"
9643 " if (!get_policy(attr_sched_str[0], &policy))\n"
9645 " \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
9646 " param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
9648 " if (attr_sched_str != NULL) {\n"
9649 " if (!get_policy(attr_sched_str[0], &policy))\n"
9651 " \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
9652 " param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
9655 #: build/C/man3/pthread_setschedparam.3:402
9658 " s = pthread_attr_setschedpolicy(&attr, policy);\n"
9660 " handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
9661 " s = pthread_attr_setschedparam(&attr, ¶m);\n"
9663 " handle_error_en(s, \"pthread_attr_setschedparam\");\n"
9666 " s = pthread_attr_setschedpolicy(&attr, policy);\n"
9668 " handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
9669 " s = pthread_attr_setschedparam(&attr, ¶m);\n"
9671 " handle_error_en(s, \"pthread_attr_setschedparam\");\n"
9675 #: build/C/man3/pthread_setschedparam.3:405
9678 " /* If we initialized a thread attributes object, display\n"
9679 " the scheduling attributes that were set in the object */\n"
9681 " /* If we initialized a thread attributes object, display\n"
9682 " the scheduling attributes that were set in the object */\n"
9685 #: build/C/man3/pthread_setschedparam.3:413
9688 " if (attrp != NULL) {\n"
9689 " s = pthread_attr_getschedparam(&attr, ¶m);\n"
9691 " handle_error_en(s, \"pthread_attr_getschedparam\");\n"
9692 " s = pthread_attr_getschedpolicy(&attr, &policy);\n"
9694 " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
9696 " if (attrp != NULL) {\n"
9697 " s = pthread_attr_getschedparam(&attr, ¶m);\n"
9699 " handle_error_en(s, \"pthread_attr_getschedparam\");\n"
9700 " s = pthread_attr_getschedpolicy(&attr, &policy);\n"
9702 " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
9705 #: build/C/man3/pthread_setschedparam.3:416
9708 " printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
9709 " display_sched_attr(policy, ¶m);\n"
9711 " printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
9712 " display_sched_attr(policy, ¶m);\n"
9715 #: build/C/man3/pthread_setschedparam.3:424
9718 " s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
9719 " printf(\" inheritsched is %s\\en\",\n"
9720 " (inheritsched == PTHREAD_INHERIT_SCHED) ? \"INHERIT\" :\n"
9721 " (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
9723 " printf(\"\\en\");\n"
9726 " s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
9727 " printf(\" inheritsched is %s\\en\",\n"
9728 " (inheritsched == PTHREAD_INHERIT_SCHED) ? \"INHERIT\" :\n"
9729 " (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
9731 " printf(\"\\en\");\n"
9735 #: build/C/man3/pthread_setschedparam.3:426
9737 msgid " /* Create a thread that will display its scheduling attributes */\n"
9738 msgstr " /* Create a thread that will display its scheduling attributes */\n"
9741 #: build/C/man3/pthread_setschedparam.3:430
9744 " s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
9746 " handle_error_en(s, \"pthread_create\");\n"
9748 " s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
9750 " handle_error_en(s, \"pthread_create\");\n"
9753 #: build/C/man3/pthread_setschedparam.3:432
9755 msgid " /* Destroy unneeded thread attributes object */\n"
9756 msgstr " /* Destroy unneeded thread attributes object */\n"
9759 #: build/C/man3/pthread_setschedparam.3:438
9762 " if (!use_null_attrib) {\n"
9763 " s = pthread_attr_destroy(&attr);\n"
9765 " handle_error_en(s, \"pthread_attr_destroy\");\n"
9768 " if (!use_null_attrib) {\n"
9769 " s = pthread_attr_destroy(&attr);\n"
9771 " handle_error_en(s, \"pthread_attr_destroy\");\n"
9775 #: build/C/man3/pthread_setschedparam.3:442
9778 " s = pthread_join(thread, NULL);\n"
9780 " handle_error_en(s, \"pthread_join\");\n"
9782 " s = pthread_join(thread, NULL);\n"
9784 " handle_error_en(s, \"pthread_join\");\n"
9787 #: build/C/man3/pthread_setschedparam.3:460
9789 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9790 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9791 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9792 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
9794 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9795 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9796 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9797 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
9800 #: build/C/man3/pthread_setschedprio.3:26
9802 msgid "PTHREAD_SETSCHEDPRIO"
9803 msgstr "PTHREAD_SETSCHEDPRIO"
9806 #: build/C/man3/pthread_setschedprio.3:29
9807 msgid "pthread_setschedprio - set scheduling priority of a thread"
9808 msgstr "pthread_setschedprio - スレッドのスケジューリング優先度を設定する"
9811 #: build/C/man3/pthread_setschedprio.3:34
9813 msgid "B<int pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
9814 msgstr "B<int pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
9816 #. FIXME . nptl/pthread_setschedprio.c has the following
9817 #. /* If the thread should have higher priority because of some
9818 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
9819 #. Eventually (perhaps after writing the mutexattr pages), we
9820 #. may want to add something on the topic to this page.
9821 #. nptl/pthread_setschedparam.c has a similar case.
9823 #: build/C/man3/pthread_setschedprio.3:53
9825 "The B<pthread_setschedprio>() function sets the scheduling priority of the "
9826 "thread I<thread> to the value specified in I<prio>. (By contrast "
9827 "B<pthread_setschedparam>(3) changes both the scheduling policy and priority "
9830 "B<pthread_setschedprio>() 関数は、スレッド I<thread> のスケジューリング\n"
9831 "優先度に I<prio> で指定された値を設定する\n"
9832 "(一方、B<pthread_setschedparam>(3) はスレッドのスケジューリングポリシー\n"
9836 #: build/C/man3/pthread_setschedprio.3:61
9838 "On success, this function returns 0; on error, it returns a nonzero error "
9839 "number. If B<pthread_setschedprio>() fails, the scheduling priority of "
9840 "I<thread> is not changed."
9842 "成功すると、この関数は 0 を返す。\n"
9843 "エラーの場合、0 以外のエラー番号を返す。\n"
9844 "B<pthread_setschedprio>() が失敗した場合、 I<thread> の\n"
9845 "スケジューリング優先度は変更されない。"
9848 #: build/C/man3/pthread_setschedprio.3:66
9849 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
9851 "指定されたスレッドのスケジューリングポリシーでは、 I<prio> は無効である。"
9854 #: build/C/man3/pthread_setschedprio.3:70
9856 "The caller does not have appropriate privileges to set the specified "
9858 msgstr "呼び出し側が、指定された優先度を設定するのに必要な特権を持っていない。"
9861 #: build/C/man3/pthread_setschedprio.3:81
9863 "POSIX.1 also documents an B<ENOTSUP> (\"attempt was made to set the priority "
9864 "to an unsupported value\") error for B<pthread_setschedparam>(3)."
9866 "POSIX.1 では、 B<pthread_setschedprio>() に関して\n"
9867 "エラー B<ENOTSUP> (\"サポートされていない値を優先度\n"
9868 "に設定しようとした\") も追加で規定されている。"
9871 #: build/C/man3/pthread_setschedprio.3:83
9872 msgid "This function is available in glibc since version 2.3.4."
9873 msgstr "この関数は glibc バージョン 2.3.4 以降で利用できる。"
9876 #: build/C/man3/pthread_setschedprio.3:93
9878 msgid "B<pthread_setschedprio>()"
9879 msgstr "B<pthread_setschedprio>()"
9882 #: build/C/man3/pthread_setschedprio.3:103
9884 "For a description of the permissions required to, and the effect of, "
9885 "changing a thread's scheduling priority, and details of the permitted ranges "
9886 "for priorities in each scheduling policy, see B<sched>(7)."
9888 "スレッドのスケジューリング優先度を変更するために必要な許可や変更した場合の影"
9889 "響、および各スケジューリングポリシーで認められる優先度の範囲の詳細について"
9890 "は、 B<sched>(7) を参照。"
9893 #: build/C/man3/pthread_setschedprio.3:117
9895 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9896 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9897 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9898 "B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
9900 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
9901 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
9902 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
9903 "B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
9906 #: build/C/man3/pthread_sigmask.3:26
9908 msgid "PTHREAD_SIGMASK"
9909 msgstr "PTHREAD_SIGMASK"
9912 #: build/C/man3/pthread_sigmask.3:29
9913 msgid "pthread_sigmask - examine and change mask of blocked signals"
9914 msgstr "pthread_sigmask - 禁止するシグナルマスクの確認と変更を行う"
9917 #: build/C/man3/pthread_sigmask.3:35
9919 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9920 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
9923 #: build/C/man3/pthread_sigmask.3:46
9924 msgid "B<pthread_sigmask>():"
9925 msgstr "B<pthread_sigmask>():"
9928 #: build/C/man3/pthread_sigmask.3:58
9930 "The B<pthread_sigmask>() function is just like B<sigprocmask>(2), with the "
9931 "difference that its use in multithreaded programs is explicitly specified by "
9932 "POSIX.1. Other differences are noted in this page."
9933 msgstr "B<pthread_sigmask>() 関数は B<sigprocmask>(2) と全く同様だが、マルチスレッドプログラムでの利用が POSIX.1 で明示的に規定されている点が異なる。他の違いはこのマニュアルページで説明する。"
9936 #: build/C/man3/pthread_sigmask.3:61
9938 "For a description of the arguments and operation of this function, see "
9939 "B<sigprocmask>(2)."
9940 msgstr "この関数の引数と動作の説明は B<sigprocmask>(2) を参照。"
9943 #: build/C/man3/pthread_sigmask.3:66
9945 "On success, B<pthread_sigmask>() returns 0; on error, it returns an error "
9948 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9952 #: build/C/man3/pthread_sigmask.3:69
9953 msgid "See B<sigprocmask>(2)."
9954 msgstr "B<sigprocmask>(2) を参照。"
9957 #: build/C/man3/pthread_sigmask.3:79
9959 msgid "B<pthread_sigmask>()"
9960 msgstr "B<pthread_sigmask>()"
9963 #: build/C/man3/pthread_sigmask.3:85
9964 msgid "A new thread inherits a copy of its creator's signal mask."
9966 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスクのコピーを\n"
9970 #: build/C/man3/pthread_sigmask.3:93
9972 "The glibc B<pthread_sigmask>() function silently ignores attempts to block "
9973 "the two real-time signals that are used internally by the NPTL threading "
9974 "implementation. See B<nptl>(7) for details."
9978 #: build/C/man3/pthread_sigmask.3:98
9980 "The program below blocks some signals in the main thread, and then creates a "
9981 "dedicated thread to fetch those signals via B<sigwait>(3). The following "
9982 "shell session demonstrates its use:"
9984 "以下のプログラムは、メインスレッドでシグナルのいくつかを禁止 (block)\n"
9985 "するように設定を行い、 B<sigwait>(3) 経由でそれらのシグナルを集める\n"
9987 "下記のシェルのセッションはその利用例を示したものである。"
9990 #: build/C/man3/pthread_sigmask.3:109
9995 "$B< kill -QUIT %1>\n"
9996 "Signal handling thread got signal 3\n"
9997 "$B< kill -USR1 %1>\n"
9998 "Signal handling thread got signal 10\n"
9999 "$B< kill -TERM %1>\n"
10000 "[1]+ Terminated ./a.out\n"
10004 "$B< kill -QUIT %1>\n"
10005 "Signal handling thread got signal 3\n"
10006 "$B< kill -USR1 %1>\n"
10007 "Signal handling thread got signal 10\n"
10008 "$B< kill -TERM %1>\n"
10009 "[1]+ Terminated ./a.out\n"
10011 #. type: Plain text
10012 #: build/C/man3/pthread_sigmask.3:120
10015 "#include E<lt>pthread.hE<gt>\n"
10016 "#include E<lt>stdio.hE<gt>\n"
10017 "#include E<lt>stdlib.hE<gt>\n"
10018 "#include E<lt>unistd.hE<gt>\n"
10019 "#include E<lt>signal.hE<gt>\n"
10020 "#include E<lt>errno.hE<gt>\n"
10022 "#include E<lt>pthread.hE<gt>\n"
10023 "#include E<lt>stdio.hE<gt>\n"
10024 "#include E<lt>stdlib.hE<gt>\n"
10025 "#include E<lt>unistd.hE<gt>\n"
10026 "#include E<lt>signal.hE<gt>\n"
10027 "#include E<lt>errno.hE<gt>\n"
10029 #. type: Plain text
10030 #: build/C/man3/pthread_sigmask.3:122
10032 msgid "/* Simple error handling functions */\n"
10033 msgstr "/* Simple error handling functions */\n"
10035 #. type: Plain text
10036 #: build/C/man3/pthread_sigmask.3:131
10040 "sig_thread(void *arg)\n"
10042 " sigset_t *set = arg;\n"
10046 "sig_thread(void *arg)\n"
10048 " sigset_t *set = arg;\n"
10051 #. type: Plain text
10052 #: build/C/man3/pthread_sigmask.3:139
10056 " s = sigwait(set, &sig);\n"
10058 " handle_error_en(s, \"sigwait\");\n"
10059 " printf(\"Signal handling thread got signal %d\\en\", sig);\n"
10064 " s = sigwait(set, &sig);\n"
10066 " handle_error_en(s, \"sigwait\");\n"
10067 " printf(\"Signal handling thread got signal %d\\en\", sig);\n"
10071 #. type: Plain text
10072 #: build/C/man3/pthread_sigmask.3:146
10076 "main(int argc, char *argv[])\n"
10078 " pthread_t thread;\n"
10083 "main(int argc, char *argv[])\n"
10085 " pthread_t thread;\n"
10089 #. type: Plain text
10090 #: build/C/man3/pthread_sigmask.3:149
10093 " /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
10094 " will inherit a copy of the signal mask. */\n"
10096 " /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
10097 " will inherit a copy of the signal mask. */\n"
10099 #. type: Plain text
10100 #: build/C/man3/pthread_sigmask.3:156
10103 " sigemptyset(&set);\n"
10104 " sigaddset(&set, SIGQUIT);\n"
10105 " sigaddset(&set, SIGUSR1);\n"
10106 " s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
10108 " handle_error_en(s, \"pthread_sigmask\");\n"
10110 " sigemptyset(&set);\n"
10111 " sigaddset(&set, SIGQUIT);\n"
10112 " sigaddset(&set, SIGUSR1);\n"
10113 " s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
10115 " handle_error_en(s, \"pthread_sigmask\");\n"
10117 #. type: Plain text
10118 #: build/C/man3/pthread_sigmask.3:160
10121 " s = pthread_create(&thread, NULL, &sig_thread, &set);\n"
10123 " handle_error_en(s, \"pthread_create\");\n"
10125 " s = pthread_create(&thread, NULL, &sig_thread, &set);\n"
10127 " handle_error_en(s, \"pthread_create\");\n"
10129 #. type: Plain text
10130 #: build/C/man3/pthread_sigmask.3:163
10133 " /* Main thread carries on to create other threads and/or do\n"
10136 " /* Main thread carries on to create other threads and/or do\n"
10139 #. type: Plain text
10140 #: build/C/man3/pthread_sigmask.3:166
10143 " pause(); /* Dummy pause so we can test program */\n"
10146 " pause(); /* Dummy pause so we can test program */\n"
10149 #. type: Plain text
10150 #: build/C/man3/pthread_sigmask.3:177
10152 "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), "
10153 "B<pthread_attr_setsigmask_np>(3), B<pthread_create>(3), B<pthread_kill>(3), "
10154 "B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
10155 msgstr "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_attr_setsigmask_np>(3), B<pthread_create>(3), B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
10158 #: build/C/man3/pthread_sigqueue.3:25
10160 msgid "PTHREAD_SIGQUEUE"
10161 msgstr "PTHREAD_SIGQUEUE"
10163 #. type: Plain text
10164 #: build/C/man3/pthread_sigqueue.3:28
10165 msgid "pthread_sigqueue - queue a signal and data to a thread"
10166 msgstr "pthread_sigqueue - スレッドに対するシグナルとデータをキューに入れる"
10168 #. type: Plain text
10169 #: build/C/man3/pthread_sigqueue.3:32
10172 "B<#include E<lt>signal.hE<gt>>\n"
10173 "B<#include E<lt>pthread.hE<gt>>\n"
10175 "B<#include E<lt>signal.hE<gt>>\n"
10176 "B<#include E<lt>pthread.hE<gt>>\n"
10178 #. type: Plain text
10179 #: build/C/man3/pthread_sigqueue.3:35
10182 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
10183 "B< const union sigval >I<value>B<);>\n"
10185 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
10186 "B< const union sigval >I<value>B<);>\n"
10188 #. type: Plain text
10189 #: build/C/man3/pthread_sigqueue.3:46
10190 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
10191 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
10193 #. type: Plain text
10194 #: build/C/man3/pthread_sigqueue.3:54
10196 "The B<pthread_sigqueue>() function performs a similar task to "
10197 "B<sigqueue>(3), but, rather than sending a signal to a process, it sends a "
10198 "signal to a thread in the same process as the calling thread."
10200 "B<pthread_sigqueue>() 関数は B<sigqueue>(3) と同様の処理を実行するが、\n"
10201 "プロセスにシグナルを送信するのではなく、呼び出したスレッドと\n"
10202 "同じプロセス内のスレッドにシグナルを送信する。"
10204 #. type: Plain text
10205 #: build/C/man3/pthread_sigqueue.3:66
10207 "The I<thread> argument is the ID of a thread in the same process as the "
10208 "caller. The I<sig> argument specifies the signal to be sent. The I<value> "
10209 "argument specifies data to accompany the signal; see B<sigqueue>(3) for "
10212 "I<thread> 引数は、呼び出し側と同じプロセスのスレッドの ID である。\n"
10213 "I<sig> 引数は送信するシグナルを指定する。\n"
10214 "I<value> 引数はシグナルと一緒に渡すデータを指定する。\n"
10215 "詳細は B<sigqueue>(3) を参照。"
10217 #. type: Plain text
10218 #: build/C/man3/pthread_sigqueue.3:71
10220 "On success, B<pthread_sigqueue>() returns 0; on error, it returns an error "
10223 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
10226 #. type: Plain text
10227 #: build/C/man3/pthread_sigqueue.3:78
10229 "The limit of signals which may be queued has been reached. (See "
10230 "B<signal>(7) for further information.)"
10232 "キューに入れられるシグナル数が上限に達していた\n"
10233 "(詳しい情報は (B<signal>(7) を参照)。"
10235 #. type: Plain text
10236 #: build/C/man3/pthread_sigqueue.3:82
10237 msgid "I<sig> was invalid."
10238 msgstr "I<sig> が無効であった。"
10241 #: build/C/man3/pthread_sigqueue.3:82
10246 #. type: Plain text
10247 #: build/C/man3/pthread_sigqueue.3:86
10248 msgid "B<pthread_sigqueue>() is not supported on this system."
10249 msgstr "B<pthread_sigqueue>() がこのシステムではサポートされていない。"
10251 #. type: Plain text
10252 #: build/C/man3/pthread_sigqueue.3:90
10253 msgid "I<thread> is not valid."
10254 msgstr "I<thread> が無効である。"
10256 #. type: Plain text
10257 #: build/C/man3/pthread_sigqueue.3:94
10258 msgid "The B<pthread_sigqueue>() function first appeared in glibc 2.11."
10259 msgstr "B<pthread_sigqueue>() 関数は glibc 2.11 で初めて登場した。"
10262 #: build/C/man3/pthread_sigqueue.3:104
10264 msgid "B<pthread_sigqueue>()"
10265 msgstr "B<pthread_sigqueue>()"
10267 #. type: Plain text
10268 #: build/C/man3/pthread_sigqueue.3:108
10269 msgid "This function is a GNU extension."
10270 msgstr "この関数は GNU による拡張である。"
10272 #. type: Plain text
10273 #: build/C/man3/pthread_sigqueue.3:118
10275 "The glibc implementation of B<pthread_sigqueue>() gives an error "
10276 "(B<EINVAL>) on attempts to send either of the real-time signals used "
10277 "internally by the NPTL threading implementation. See B<nptl>(7) for "
10281 #. type: Plain text
10282 #: build/C/man3/pthread_sigqueue.3:126
10284 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), "
10285 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
10287 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
10288 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
10291 #: build/C/man3/pthread_testcancel.3:26
10293 msgid "PTHREAD_TESTCANCEL"
10294 msgstr "PTHREAD_TESTCANCEL"
10296 #. type: Plain text
10297 #: build/C/man3/pthread_testcancel.3:29
10299 "pthread_testcancel - request delivery of any pending cancellation request"
10300 msgstr "pthread_testcancel - 処理待ちの取り消し要求の配送を要求する"
10302 #. type: Plain text
10303 #: build/C/man3/pthread_testcancel.3:34
10305 msgid "B<void pthread_testcancel(void);>\n"
10306 msgstr "B<void pthread_testcancel(void);>\n"
10308 #. type: Plain text
10309 #: build/C/man3/pthread_testcancel.3:43
10311 "Calling B<pthread_testcancel>() creates a cancellation point within the "
10312 "calling thread, so that a thread that is otherwise executing code that "
10313 "contains no cancellation points will respond to a cancellation request."
10315 "B<pthread_testcancel>() を呼び出すと、呼び出したスレッド内に取り消し\n"
10316 "ポイント (cancellation point) が作成される。\n"
10317 "これにより、これ以外には取り消しポイントを含まないコードを実行して\n"
10318 "いるスレッドが取り消し要求に対応することができるようになる。"
10320 #. type: Plain text
10321 #: build/C/man3/pthread_testcancel.3:50
10323 "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no "
10324 "cancellation request is pending, then a call to B<pthread_testcancel>() has "
10327 "(B<pthread_setcancelstate>(3) を使って) キャンセルが無効になっている\n"
10328 "場合や処理待ちの取り消し要求がない場合は、B<pthread_testcancel>() を\n"
10331 #. type: Plain text
10332 #: build/C/man3/pthread_testcancel.3:54
10334 "This function does not return a value. If the calling thread is canceled as "
10335 "a consequence of a call to this function, then the function does not return."
10337 "この関数は値を返さない。この関数の呼び出しの結果、呼び出したスレッドが\n"
10338 "キャンセルされた場合、この関数が返ることはない。"
10341 #: build/C/man3/pthread_testcancel.3:68
10343 msgid "B<pthread_testcancel>()"
10344 msgstr "B<pthread_testcancel>()"
10346 #. type: Plain text
10347 #: build/C/man3/pthread_testcancel.3:75
10348 msgid "See B<pthread_cleanup_push>(3)."
10349 msgstr "B<pthread_cleanup_push>(3) を参照。"
10351 #. type: Plain text
10352 #: build/C/man3/pthread_testcancel.3:80
10354 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
10355 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
10357 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
10358 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
10361 #: build/C/man3/pthread_tryjoin_np.3:26
10363 msgid "PTHREAD_TRYJOIN_NP"
10364 msgstr "PTHREAD_TRYJOIN_NP"
10366 #. type: Plain text
10367 #: build/C/man3/pthread_tryjoin_np.3:30
10369 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
10372 "pthread_tryjoin_np, pthread_timedjoin_np - 終了したスレッドの join を\n"
10375 #. type: Plain text
10376 #: build/C/man3/pthread_tryjoin_np.3:36
10378 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
10379 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
10381 #. type: Plain text
10382 #: build/C/man3/pthread_tryjoin_np.3:39
10385 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
10386 "B< const struct timespec *>I<abstime>B<);>\n"
10388 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
10389 "B< const struct timespec *>I<abstime>B<);>\n"
10391 #. type: Plain text
10392 #: build/C/man3/pthread_tryjoin_np.3:46
10394 "These functions operate in the same way as B<pthread_join>(3), except for "
10395 "the differences described on this page."
10397 "これらの関数は B<pthread_join>(3) と同じように動作するが、\n"
10400 #. type: Plain text
10401 #: build/C/man3/pthread_tryjoin_np.3:58
10403 "The B<pthread_tryjoin_np>() function performs a nonblocking join with the "
10404 "thread I<thread>, returning the exit status of the thread in I<*retval>. If "
10405 "I<thread> has not yet terminated, then instead of blocking, as is done by "
10406 "B<pthread_join>(3), the call returns an error."
10408 "B<pthread_tryjoin_np>() 関数は、スレッド I<thread> の非停止\n"
10409 "(nonblocking) での join を実行し、スレッドの終了ステータスを\n"
10410 "I<*retval> に入れて返す。I<thread> がまだ終了していない場合は、\n"
10411 "B<pthread_join>(3) のように停止 (block) せずに、エラーを返す。"
10413 #. type: Plain text
10414 #: build/C/man3/pthread_tryjoin_np.3:79
10417 #| "The B<pthread_timedjoin_np>() function performs a join-with-timeout. If "
10418 #| "I<thread> has not yet terminated, then the call blocks until a maximum "
10419 #| "time, specified in I<abstime>. If the timeout expires before I<thread> "
10420 #| "terminates, the call returns an error. The I<abstime> argument is a "
10421 #| "structure of the following form, specifying an absolute time measured "
10422 #| "since the Epoch (see B<time>(2)):"
10424 "The B<pthread_timedjoin_np>() function performs a join-with-timeout. If "
10425 "I<thread> has not yet terminated, then the call blocks until a maximum time, "
10426 "specified in I<abstime>, measured against the B<CLOCK_REALTIME> clock. If "
10427 "the timeout expires before I<thread> terminates, the call returns an error. "
10428 "The I<abstime> argument is a structure of the following form, specifying an "
10429 "absolute time measured since the Epoch (see B<time>(2)):"
10431 "B<pthread_timedjoin_np>() 関数は、タイムアウト付きの join を行う。\n"
10432 "I<thread> がまだ終了していない場合、 I<abstime> で指定された最大時間\n"
10433 "まで停止する。 I<thread> が終了する前にタイムアウト時間が経過した場合は、\n"
10434 "エラーを返す。I<abstime> 引数は以下に示す構造体であり、\n"
10435 "Epoch (時刻紀元; B<time>(2) 参照) から測った絶対時刻を指定する。"
10437 #. type: Plain text
10438 #: build/C/man3/pthread_tryjoin_np.3:86
10441 "struct timespec {\n"
10442 " time_t tv_sec; /* seconds */\n"
10443 " long tv_nsec; /* nanoseconds */\n"
10446 "struct timespec {\n"
10447 " time_t tv_sec; /* seconds */\n"
10448 " long tv_nsec; /* nanoseconds */\n"
10451 #. type: Plain text
10452 #: build/C/man3/pthread_tryjoin_np.3:92
10454 "On success, these functions return 0; on error, they return an error number."
10456 "成功すると、これらの関数は 0 を返す。\n"
10459 #. type: Plain text
10460 #: build/C/man3/pthread_tryjoin_np.3:97
10462 "These functions can fail with the same errors as B<pthread_join>(3). "
10463 "B<pthread_tryjoin_np>() can in addition fail with the following error:"
10465 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
10466 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
10469 #: build/C/man3/pthread_tryjoin_np.3:97 build/C/man3/pthread_spin_lock.3:104
10474 #. type: Plain text
10475 #: build/C/man3/pthread_tryjoin_np.3:101
10476 msgid "I<thread> had not yet terminated at the time of the call."
10477 msgstr "呼び出しを行った時点では I<thread> はまだ終了していない。"
10479 #. type: Plain text
10480 #: build/C/man3/pthread_tryjoin_np.3:104
10482 "B<pthread_timedjoin_np>() can in addition fail with the following errors:"
10483 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
10486 #: build/C/man3/pthread_tryjoin_np.3:104
10488 msgid "B<ETIMEDOUT>"
10489 msgstr "B<ETIMEDOUT>"
10491 #. type: Plain text
10492 #: build/C/man3/pthread_tryjoin_np.3:109
10493 msgid "The call timed out before I<thread> terminated."
10494 msgstr "I<thread> が終了する前に呼び出しがタイムアウトとなった。"
10496 #. type: Plain text
10497 #: build/C/man3/pthread_tryjoin_np.3:117
10499 "I<abstime> value is invalid (I<tv_sec> is less than 0 or I<tv_nsec> is "
10500 "greater than 1e9)."
10502 "I<abstime> の値が無効である (I<tv_sec> が 0 より小さいか、 I<tv_nsec> 1e9 が"
10505 #. type: Plain text
10506 #: build/C/man3/pthread_tryjoin_np.3:121
10507 msgid "B<pthread_timedjoin_np>() never returns the error B<EINTR>."
10508 msgstr "B<pthread_timedjoin_np>() がエラー B<EINTR> を返すことはない。"
10510 #. type: Plain text
10511 #: build/C/man3/pthread_tryjoin_np.3:123
10512 msgid "These functions first appeared in glibc in version 2.3.3."
10513 msgstr "これらの関数は glibc バージョン 2.3.3 で初めて登場した。"
10516 #: build/C/man3/pthread_tryjoin_np.3:135
10519 "B<pthread_tryjoin_np>(),\n"
10520 "B<pthread_timedjoin_np>()"
10522 "B<pthread_tryjoin_np>(),\n"
10523 "B<pthread_timedjoin_np>()"
10525 #. type: Plain text
10526 #: build/C/man3/pthread_tryjoin_np.3:143
10527 msgid "The following code waits to join for up to 5 seconds:"
10528 msgstr "以下のコードは、最大 5 秒まで join を待つ。"
10530 #. type: Plain text
10531 #: build/C/man3/pthread_tryjoin_np.3:148
10534 "struct timespec ts;\n"
10537 "struct timespec ts;\n"
10540 #. type: Plain text
10541 #: build/C/man3/pthread_tryjoin_np.3:150
10546 #. type: Plain text
10547 #: build/C/man3/pthread_tryjoin_np.3:154
10550 "if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
10551 " /* Handle error */\n"
10554 "if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
10555 " /* Handle error */\n"
10558 #. type: Plain text
10559 #: build/C/man3/pthread_tryjoin_np.3:156
10561 msgid "ts.tv_sec += 5;\n"
10562 msgstr "ts.tv_sec += 5;\n"
10564 #. type: Plain text
10565 #: build/C/man3/pthread_tryjoin_np.3:161
10568 "s = pthread_timedjoin_np(thread, NULL, &ts);\n"
10570 " /* Handle error */\n"
10573 "s = pthread_timedjoin_np(thread, NULL, &ts);\n"
10575 " /* Handle error */\n"
10578 #. type: Plain text
10579 #: build/C/man3/pthread_tryjoin_np.3:175
10581 "The B<pthread_timedjoin_np>() function measures time by internally "
10582 "calculating a relative sleep interval that is then measured against the "
10583 "B<CLOCK_MONOTONIC> clock instead of the B<CLOCK_REALTIME> clock. "
10584 "Consequently, the timeout is unaffected by discontinuous changes to the "
10585 "B<CLOCK_REALTIME> clock."
10588 #. type: Plain text
10589 #: build/C/man3/pthread_tryjoin_np.3:180
10591 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
10593 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
10596 #: build/C/man3/pthread_yield.3:25
10598 msgid "PTHREAD_YIELD"
10599 msgstr "PTHREAD_YIELD"
10602 #: build/C/man3/pthread_yield.3:25
10605 msgstr "2017-11-26"
10607 #. type: Plain text
10608 #: build/C/man3/pthread_yield.3:28
10609 msgid "pthread_yield - yield the processor"
10610 msgstr "pthread_yield - プロセッサを明け渡す (yield)"
10612 #. type: Plain text
10613 #: build/C/man3/pthread_yield.3:34
10615 msgid "B<int pthread_yield(void);>\n"
10616 msgstr "B<int pthread_yield(void);>\n"
10618 #. type: Plain text
10619 #: build/C/man3/pthread_yield.3:44
10621 "B<pthread_yield>() causes the calling thread to relinquish the CPU. The "
10622 "thread is placed at the end of the run queue for its static priority and "
10623 "another thread is scheduled to run. For further details, see "
10624 "B<sched_yield>(2)"
10626 "B<pthread_yield>() を呼び出すと、呼び出したスレッドは CPU を手放す。\n"
10627 "スレッドはそのスレッドの静的優先度の実行キューの末尾に回り、\n"
10628 "別のスレッドが実行されるようにスケジューリングされる。\n"
10629 "詳細は B<sched_yield>(2) を参照。"
10631 #. type: Plain text
10632 #: build/C/man3/pthread_yield.3:49
10634 "On success, B<pthread_yield>() returns 0; on error, it returns an error "
10637 "成功すると、 B<pthread_yield>() は 0 を返す。\n"
10640 #. type: Plain text
10641 #: build/C/man3/pthread_yield.3:53
10643 "On Linux, this call always succeeds (but portable and future-proof "
10644 "applications should nevertheless handle a possible error return)."
10646 "Linux では、この関数の呼び出しは常に成功する\n"
10647 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
10648 "正のエラーの返り値を処理するようにすべきである)。"
10651 #: build/C/man3/pthread_yield.3:63
10653 msgid "B<pthread_yield>()"
10654 msgstr "B<pthread_yield>()"
10656 #. e.g., the BSDs, Tru64, AIX, and Irix.
10657 #. type: Plain text
10658 #: build/C/man3/pthread_yield.3:71
10660 "This call is nonstandard, but present on several other systems. Use the "
10661 "standardized B<sched_yield>(2) instead."
10663 "この関数は非標準だが、他のいくつかのシステムにも存在する。\n"
10664 "代わりに、標準化されている B<sched_yield>(2) を使うこと。"
10666 #. type: Plain text
10667 #: build/C/man3/pthread_yield.3:74
10668 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
10670 "Linux では、この関数は B<sched_yield>(2) を呼び出す形で実装されている。"
10672 #. type: Plain text
10673 #: build/C/man3/pthread_yield.3:85
10675 "B<pthread_yield>() is intended for use with real-time scheduling policies "
10676 "(i.e., B<SCHED_FIFO> or B<SCHED_RR>). Use of B<pthread_yield>() with "
10677 "nondeterministic scheduling policies such as B<SCHED_OTHER> is unspecified "
10678 "and very likely means your application design is broken."
10681 #. FIXME . .BR pthread_cond_wait (3),
10682 #. type: Plain text
10683 #: build/C/man3/pthread_yield.3:90
10684 msgid "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
10685 msgstr "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
10688 #: build/C/man3/pthread_atfork.3:25
10690 msgid "PTHREAD_ATFORK"
10691 msgstr "PTHREAD_ATFORK"
10693 #. type: Plain text
10694 #: build/C/man3/pthread_atfork.3:28
10695 msgid "pthread_atfork - register fork handlers"
10698 #. type: Plain text
10699 #: build/C/man3/pthread_atfork.3:34
10702 "B<int pthread_atfork(void (*>I<prepare>B<)(void), void (*>I<parent>B<)(void),>\n"
10703 "B< void (*>I<child>B<)(void));>\n"
10705 "B<int pthread_atfork(void (*>I<prepare>B<)(void), void (*>I<parent>B<)(void),>\n"
10706 "B< void (*>I<child>B<)(void));>\n"
10708 #. type: Plain text
10709 #: build/C/man3/pthread_atfork.3:37
10710 msgid "Link with I<-pthread>."
10711 msgstr "I<-pthread> を付けてリンクする。"
10713 #. type: Plain text
10714 #: build/C/man3/pthread_atfork.3:45
10716 "The B<pthread_atfork>() function registers fork handlers that are to be "
10717 "executed when B<fork>(2) is called by this thread. The handlers are "
10718 "executed in the context of the thread that calls B<fork>(2)."
10721 #. type: Plain text
10722 #: build/C/man3/pthread_atfork.3:47
10723 msgid "Three kinds of handler can be registered:"
10726 #. type: Plain text
10727 #: build/C/man3/pthread_atfork.3:52
10729 "I<prepare> specifies a handler that is executed before B<fork>(2) "
10730 "processing starts."
10733 #. type: Plain text
10734 #: build/C/man3/pthread_atfork.3:57
10736 "I<parent> specifies a handler that is executed in the parent process after "
10737 "B<fork>(2) processing completes."
10740 #. type: Plain text
10741 #: build/C/man3/pthread_atfork.3:62
10743 "I<child> specifies a handler that is executed in the child process after "
10744 "B<fork>(2) processing completes."
10747 #. type: Plain text
10748 #: build/C/man3/pthread_atfork.3:67
10750 "Any of the three arguments may be NULL if no handler is needed in the "
10751 "corresponding phase of B<fork>(2) processing."
10754 #. type: Plain text
10755 #: build/C/man3/pthread_atfork.3:82
10757 "On success, B<pthread_atfork>() returns zero. On error, it returns an "
10758 "error number. B<pthread_atfork>() may be called multiple times by a "
10759 "thread, to register multiple handlers for each phase. The handlers for each "
10760 "phase are called in a specified order: the I<prepare> handlers are called in "
10761 "reverse order of registration; the I<parent> and I<child> handlers are "
10762 "called in the order of registration."
10765 #. type: Plain text
10766 #: build/C/man3/pthread_atfork.3:86
10767 msgid "Could not allocate memory to record the form handler entry."
10770 #. type: Plain text
10771 #: build/C/man3/pthread_atfork.3:108
10773 "When B<fork>(2) is called in a multithreaded process, only the calling "
10774 "thread is duplicated in the child process. The original intention of "
10775 "B<pthread_atfork>() was to allow the calling thread to be returned to a "
10776 "consistent state. For example, at the time of the call to B<fork>(2), other "
10777 "threads may have locked mutexes that are visible in the user-space memory "
10778 "duplicated in the child. Such mutexes would never be unlocked, since the "
10779 "threads that placed the locks are not duplicated in the child. The intent "
10780 "of B<pthread_atfork>() was to provide a mechanism whereby the application "
10781 "(or a library) could ensure that mutexes and other process and thread state "
10782 "would be restored to a consistent state. In practice, this task is "
10783 "generally too difficult to be practicable."
10786 #. type: Plain text
10787 #: build/C/man3/pthread_atfork.3:117
10789 "After a B<fork>(2) in a multithreaded process returns in the child, the "
10790 "child should call only async-signal-safe functions (see B<signal-"
10791 "safety>(7)) until such time as it calls B<execve>(2) to execute a new "
10795 #. type: Plain text
10796 #: build/C/man3/pthread_atfork.3:122
10798 "POSIX.1 specifies that B<pthread_atfork>() shall not fail with the error "
10802 #. type: Plain text
10803 #: build/C/man3/pthread_atfork.3:126
10804 msgid "B<fork>(2), B<atexit>(3), B<pthreads>(7)"
10805 msgstr "B<fork>(2), B<atexit>(3), B<pthreads>(7)"
10808 #: build/C/man3/pthread_attr_setsigmask_np.3:26
10810 msgid "PTHREAD_ATTR_SETSIGMASK_NP"
10811 msgstr "PTHREAD_ATTR_SETSIGMASK_NP"
10813 #. type: Plain text
10814 #: build/C/man3/pthread_attr_setsigmask_np.3:30
10817 #| "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes "
10818 #| "in thread attributes object"
10820 "pthread_attr_setsigmask_np, pthread_attr_getsigmask_np - set/get signal mask "
10821 "attribute in thread attributes object"
10823 "pthread_attr_setstack, pthread_attr_getstack - \n"
10824 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
10826 #. type: Plain text
10827 #: build/C/man3/pthread_attr_setsigmask_np.3:39
10830 "B<int pthread_attr_setsigmask_np(pthread_attr_t *>I<attr>B<,>\n"
10831 "B< const sigset_t *>I<sigmask>B<);>\n"
10832 "B<int pthread_attr_getsigmask_np(const pthread_attr_t *>I<attr>B<,>\n"
10833 "B< sigset_t *>I<sigmask>B<);>\n"
10835 "B<int pthread_attr_setsigmask_np(pthread_attr_t *>I<attr>B<,>\n"
10836 "B< const sigset_t *>I<sigmask>B<);>\n"
10837 "B<int pthread_attr_getsigmask_np(const pthread_attr_t *>I<attr>B<,>\n"
10838 "B< sigset_t *>I<sigmask>B<);>\n"
10840 #. type: Plain text
10841 #: build/C/man3/pthread_attr_setsigmask_np.3:55
10844 #| "The B<pthread_attr_setaffinity_np>() function sets the CPU affinity mask "
10845 #| "attribute of the thread attributes object referred to by I<attr> to the "
10846 #| "value specified in I<cpuset>. This attribute determines the CPU affinity "
10847 #| "mask of a thread created using the thread attributes object I<attr>."
10849 "The B<pthread_attr_setsigmask_np>() function sets the signal mask attribute "
10850 "of the thread attributes object referred to by I<attr> to the value "
10851 "specified in I<*sigmask>. If I<sigmask> is specified as NULL, then any "
10852 "existing signal mask attribute in I<attr> is unset."
10854 "B<pthread_attr_setaffinity_np>() 関数は、\n"
10855 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
10856 "I<cpuset> で指定された値に設定する。\n"
10857 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
10858 "作成されたスレッドの CPU affinity マスクが決定される。"
10860 #. type: Plain text
10861 #: build/C/man3/pthread_attr_setsigmask_np.3:67
10864 #| "The B<pthread_attr_getstack>() function returns the stack address and "
10865 #| "stack size attributes of the thread attributes object referred to by "
10866 #| "I<attr> in the buffers pointed to by I<stackaddr> and I<stacksize>, "
10869 "The B<pthread_attr_getsigmask_np>() function returns the signal mask "
10870 "attribute of the thread attributes object referred to by I<attr> in the "
10871 "buffer pointed to by I<sigmask>. If the signal mask attribute is currently "
10872 "unset, then this function returns the special value "
10873 "B<PTHREAD_ATTR_NO_SIGMASK_NP> as its result."
10875 "B<pthread_attr_getstack>() 関数は、\n"
10876 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
10877 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
10880 #. type: Plain text
10881 #: build/C/man3/pthread_attr_setsigmask_np.3:71
10884 #| "On success, B<pthread_cancel>() returns 0; on error, it returns a "
10885 #| "nonzero error number."
10887 "The B<pthread_attr_setsigmask_np>() function returns 0 on success, or a "
10888 "nonzero error number on failure."
10890 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
10891 "エラーの場合、0 以外のエラー番号を返す。"
10893 #. type: Plain text
10894 #: build/C/man3/pthread_attr_setsigmask_np.3:82
10896 "the B<pthread_attr_getsigmask_np>() function returns either 0 or "
10897 "B<PTHREAD_ATTR_NO_SIGMASK_NP>. When 0 is returned, the signal mask "
10898 "attribute is returned via I<sigmask>. A return value of "
10899 "B<PTHREAD_ATTR_NO_SIGMASK_NP> indicates that the signal mask attribute is "
10900 "not set in I<attr>."
10903 #. type: Plain text
10904 #: build/C/man3/pthread_attr_setsigmask_np.3:84
10907 #| "On success, these functions return 0; on error, they return an error "
10909 msgid "On error, these functions return a positive error number."
10911 "成功すると、これらの関数は 0 を返す。\n"
10914 #. type: Plain text
10915 #: build/C/man3/pthread_attr_setsigmask_np.3:89
10917 #| msgid "(B<pthread_attr_setaffinity_np>()) Could not allocate memory."
10918 msgid "(B<pthread_attr_setsigmask_np>()) Could not allocate memory."
10920 "(B<pthread_attr_setaffinity_np>()) メモリーを割り当てることができなかった。"
10922 #. type: Plain text
10923 #: build/C/man3/pthread_attr_setsigmask_np.3:91
10925 #| msgid "These functions are provided by glibc since version 2.2."
10926 msgid "These functions are provided by glibc since version 2.32."
10927 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
10930 #: build/C/man3/pthread_attr_setsigmask_np.3:102
10933 "B<pthread_attr_setsigmask_np>(),\n"
10934 "B<pthread_attr_getsigmask_np>()"
10936 "B<pthread_attr_setsigmask_np>(),\n"
10937 "B<pthread_attr_getsigmask_np>()"
10939 #. type: Plain text
10940 #: build/C/man3/pthread_attr_setsigmask_np.3:115
10942 "The signal mask attribute determines the signal mask that will be assigned "
10943 "to a thread created using the thread attributes object I<attr>. If this "
10944 "attribute is not set, then a thread created using I<attr> will inherit a "
10945 "copy of the creating thread's signal mask."
10948 #. type: Plain text
10949 #: build/C/man3/pthread_attr_setsigmask_np.3:121
10952 #| "For more details on CPU affinity masks, see B<sched_setaffinity>(2). For "
10953 #| "a description of a set of macros that can be used to manipulate and "
10954 #| "inspect CPU sets, see B<CPU_SET>(3)."
10956 "For more details on signal masks, see B<sigprocmask>(2). For a description "
10957 "of a set of macros that can be used to manipulate and inspect signals sets, "
10958 "see B<sigsetops>(3)."
10960 "CPU affinity マスクの詳細については、 \n"
10961 "B<sched_setaffinity>(2) を参照してほしい。\n"
10962 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
10963 "B<CPU_SET>(3) を参照してほしい。"
10965 #. type: Plain text
10966 #: build/C/man3/pthread_attr_setsigmask_np.3:125
10968 "In the absence of B<pthread_attr_setsigmask_np>() it is possible to create "
10969 "a thread with a desired signal mask as follows:"
10973 #: build/C/man3/pthread_attr_setsigmask_np.3:125
10974 #: build/C/man3/pthread_attr_setsigmask_np.3:129
10975 #: build/C/man3/pthread_attr_setsigmask_np.3:133
10976 #: build/C/man3/pthread_attr_setsigmask_np.3:136
10981 #. type: Plain text
10982 #: build/C/man3/pthread_attr_setsigmask_np.3:129
10984 "The creating thread uses B<pthread_sigmask>(3) to save its current signal "
10985 "mask and set its mask to block all signals."
10988 #. type: Plain text
10989 #: build/C/man3/pthread_attr_setsigmask_np.3:133
10992 #| "A new thread created by B<pthread_create>(3) inherits a copy of its "
10993 #| "creator's CPU affinity mask."
10995 "The new thread is then created using B<pthread_create>(); the new thread "
10996 "will inherit the creating thread's signal mask."
10998 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
10999 "作成者の CPU affinity マスクを継承する。"
11001 #. type: Plain text
11002 #: build/C/man3/pthread_attr_setsigmask_np.3:136
11004 "The new thread sets its signal mask to the desired value using "
11005 "B<pthread_sigmask>(3)."
11008 #. type: Plain text
11009 #: build/C/man3/pthread_attr_setsigmask_np.3:138
11010 msgid "The creating thread restores its signal mask to the original value."
11013 #. type: Plain text
11014 #: build/C/man3/pthread_attr_setsigmask_np.3:142
11016 "Following the above steps, there is no possibility for the new thread to "
11017 "receive a signal before it has adjusted its signal mask to the desired value."
11020 #. type: Plain text
11021 #: build/C/man3/pthread_attr_setsigmask_np.3:148
11023 "B<sigprocmask>(2), B<pthread_attr_init>(3), B<pthread_sigmask>(3), "
11024 "B<pthreads>(7), B<signals>(7)"
11025 msgstr "B<sigprocmask>(2), B<pthread_attr_init>(3), B<pthread_sigmask>(3), B<pthreads>(7), B<signals>(7)"
11028 #: build/C/man3/pthread_getattr_default_np.3:25
11030 msgid "PTHREAD_GETATTR_DEFAULT_NP"
11031 msgstr "PTHREAD_GETATTR_DEFAULT_NP"
11033 #. type: Plain text
11034 #: build/C/man3/pthread_getattr_default_np.3:29
11037 #| "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
11038 #| "affinity attribute in thread attributes object"
11040 "pthread_getattr_default_np, pthread_setattr_default_np, - get or set default "
11041 "thread-creation attributes"
11043 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
11044 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
11046 #. type: Plain text
11047 #: build/C/man3/pthread_getattr_default_np.3:36
11050 "B<int pthread_getattr_default_np(pthread_attr_t *>I<attr>B<);>\n"
11051 "B<int pthread_setattr_default_np(pthread_attr_t *>I<attr>B<);>\n"
11053 "B<int pthread_getattr_default_np(pthread_attr_t *>I<attr>B<);>\n"
11054 "B<int pthread_setattr_default_np(pthread_attr_t *>I<attr>B<);>\n"
11056 #. type: Plain text
11057 #: build/C/man3/pthread_getattr_default_np.3:50
11059 "The B<pthread_setattr_default_np>() function sets the default attributes "
11060 "used for creation of a new thread\\(emthat is, the attributes that are used "
11061 "when B<pthread_create>(3) is called with a second argument that is NULL. "
11062 "The default attributes are set using the attributes supplied in I<*attr>, a "
11063 "previously initialized thread attributes object. Note the following details "
11064 "about the supplied attributes object:"
11067 #. type: Plain text
11068 #: build/C/man3/pthread_getattr_default_np.3:52
11069 msgid "The attribute settings in the object must be valid."
11072 #. type: Plain text
11073 #: build/C/man3/pthread_getattr_default_np.3:56
11074 msgid "The I<stack address> attribute must not be set in the object."
11077 #. type: Plain text
11078 #: build/C/man3/pthread_getattr_default_np.3:60
11080 "Setting the I<stack size> attribute to zero means leave the default stack "
11084 #. type: Plain text
11085 #: build/C/man3/pthread_getattr_default_np.3:66
11088 #| "The B<pthread_getattr_np>() function initializes the thread attributes "
11089 #| "object referred to by I<attr> so that it contains actual attribute values "
11090 #| "describing the running thread I<thread>."
11092 "The B<pthread_getattr_default_np>() function initializes the thread "
11093 "attributes object referred to by I<attr> so that it contains the default "
11094 "attributes used for thread creation."
11096 "B<pthread_getattr_np>() 関数は、\n"
11097 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
11098 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
11101 #. type: Plain text
11102 #: build/C/man3/pthread_getattr_default_np.3:74
11104 "(B<pthread_setattr_default_np>()) One of the attribute settings in I<attr> "
11105 "is invalid, or the stack address attribute is set in I<attr>."
11108 #. Can happen (but unlikely) while trying to allocate memory for cpuset
11109 #. type: Plain text
11110 #: build/C/man3/pthread_getattr_default_np.3:79
11112 #| msgid "(B<pthread_attr_setaffinity_np>()) Could not allocate memory."
11113 msgid "(B<pthread_setattr_default_np>()) Insufficient memory."
11115 "(B<pthread_attr_setaffinity_np>()) メモリーを割り当てることができなかった。"
11117 #. type: Plain text
11118 #: build/C/man3/pthread_getattr_default_np.3:81
11119 msgid "These functions are available in glibc since version 2.18."
11120 msgstr "これらの関数は glibc バージョン 2.18 以降で利用できる。"
11123 #: build/C/man3/pthread_getattr_default_np.3:93
11126 "B<pthread_getattr_default_np>(),\n"
11127 "B<pthread_setattr_default_np>()"
11129 "B<pthread_getattr_default_np>(),\n"
11130 "B<pthread_setattr_default_np>()"
11132 #. type: Plain text
11133 #: build/C/man3/pthread_getattr_default_np.3:99
11135 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
11136 "\" (nonportable) in their names."
11137 msgstr "これらの関数は非標準の GNU による拡張である。そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が付いている。"
11139 #. type: Plain text
11140 #: build/C/man3/pthread_getattr_default_np.3:105
11142 "The program below uses B<pthread_getattr_default_np>() to fetch the default "
11143 "thread-creation attributes and then displays various settings from the "
11144 "returned thread attributes object. When running the program, we see the "
11145 "following output:"
11148 #. type: Plain text
11149 #: build/C/man3/pthread_getattr_default_np.3:115
11153 "Stack size: 8388608\n"
11154 "Guard size: 4096\n"
11155 "Scheduling policy: SCHED_OTHER\n"
11156 "Scheduling priority: 0\n"
11157 "Detach state: JOINABLE\n"
11158 "Inherit scheduler: INHERIT\n"
11161 "Stack size: 8388608\n"
11162 "Guard size: 4096\n"
11163 "Scheduling policy: SCHED_OTHER\n"
11164 "Scheduling priority: 0\n"
11165 "Detach state: JOINABLE\n"
11166 "Inherit scheduler: INHERIT\n"
11168 #. type: Plain text
11169 #: build/C/man3/pthread_getattr_default_np.3:140
11173 "display_pthread_attr(pthread_attr_t *attr)\n"
11176 " size_t stacksize;\n"
11177 " size_t guardsize;\n"
11179 " struct sched_param schedparam;\n"
11180 " int detachstate;\n"
11181 " int inheritsched;\n"
11184 "display_pthread_attr(pthread_attr_t *attr)\n"
11187 " size_t stacksize;\n"
11188 " size_t guardsize;\n"
11190 " struct sched_param schedparam;\n"
11191 " int detachstate;\n"
11192 " int inheritsched;\n"
11194 #. type: Plain text
11195 #: build/C/man3/pthread_getattr_default_np.3:145
11198 " s = pthread_attr_getstacksize(attr, &stacksize);\n"
11200 " errExitEN(s, \"pthread_attr_getstacksize\");\n"
11201 " printf(\"Stack size: %zd\\en\", stacksize);\n"
11203 " s = pthread_attr_getstacksize(attr, &stacksize);\n"
11205 " errExitEN(s, \"pthread_attr_getstacksize\");\n"
11206 " printf(\"Stack size: %zd\\en\", stacksize);\n"
11208 #. type: Plain text
11209 #: build/C/man3/pthread_getattr_default_np.3:150
11212 " s = pthread_attr_getguardsize(attr, &guardsize);\n"
11214 " errExitEN(s, \"pthread_attr_getguardsize\");\n"
11215 " printf(\"Guard size: %zd\\en\", guardsize);\n"
11217 " s = pthread_attr_getguardsize(attr, &guardsize);\n"
11219 " errExitEN(s, \"pthread_attr_getguardsize\");\n"
11220 " printf(\"Guard size: %zd\\en\", guardsize);\n"
11222 #. type: Plain text
11223 #: build/C/man3/pthread_getattr_default_np.3:158
11226 " s = pthread_attr_getschedpolicy(attr, &policy);\n"
11228 " errExitEN(s, \"pthread_attr_getschedpolicy\");\n"
11229 " printf(\"Scheduling policy: %s\\en\",\n"
11230 " (policy == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
11231 " (policy == SCHED_RR) ? \"SCHED_RR\" :\n"
11232 " (policy == SCHED_OTHER) ? \"SCHED_OTHER\" : \"[unknown]\");\n"
11234 " s = pthread_attr_getschedpolicy(attr, &policy);\n"
11236 " errExitEN(s, \"pthread_attr_getschedpolicy\");\n"
11237 " printf(\"Scheduling policy: %s\\en\",\n"
11238 " (policy == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
11239 " (policy == SCHED_RR) ? \"SCHED_RR\" :\n"
11240 " (policy == SCHED_OTHER) ? \"SCHED_OTHER\" : \"[unknown]\");\n"
11242 #. type: Plain text
11243 #: build/C/man3/pthread_getattr_default_np.3:163
11246 " s = pthread_attr_getschedparam(attr, &schedparam);\n"
11248 " errExitEN(s, \"pthread_attr_getschedparam\");\n"
11249 " printf(\"Scheduling priority: %d\\en\", schedparam.sched_priority);\n"
11251 " s = pthread_attr_getschedparam(attr, &schedparam);\n"
11253 " errExitEN(s, \"pthread_attr_getschedparam\");\n"
11254 " printf(\"Scheduling priority: %d\\en\", schedparam.sched_priority);\n"
11256 #. type: Plain text
11257 #: build/C/man3/pthread_getattr_default_np.3:171
11260 " s = pthread_attr_getdetachstate(attr, &detachstate);\n"
11262 " errExitEN(s, \"pthread_attr_getdetachstate\");\n"
11263 " printf(\"Detach state: %s\\en\",\n"
11264 " (detachstate == PTHREAD_CREATE_DETACHED) ? \"DETACHED\" :\n"
11265 " (detachstate == PTHREAD_CREATE_JOINABLE) ? \"JOINABLE\" :\n"
11268 " s = pthread_attr_getdetachstate(attr, &detachstate);\n"
11270 " errExitEN(s, \"pthread_attr_getdetachstate\");\n"
11271 " printf(\"Detach state: %s\\en\",\n"
11272 " (detachstate == PTHREAD_CREATE_DETACHED) ? \"DETACHED\" :\n"
11273 " (detachstate == PTHREAD_CREATE_JOINABLE) ? \"JOINABLE\" :\n"
11276 #. type: Plain text
11277 #: build/C/man3/pthread_getattr_default_np.3:180
11280 " s = pthread_attr_getinheritsched(attr, &inheritsched);\n"
11282 " errExitEN(s, \"pthread_attr_getinheritsched\");\n"
11283 " printf(\"Inherit scheduler: %s\\en\",\n"
11284 " (inheritsched == PTHREAD_INHERIT_SCHED) ? \"INHERIT\" :\n"
11285 " (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
11289 " s = pthread_attr_getinheritsched(attr, &inheritsched);\n"
11291 " errExitEN(s, \"pthread_attr_getinheritsched\");\n"
11292 " printf(\"Inherit scheduler: %s\\en\",\n"
11293 " (inheritsched == PTHREAD_INHERIT_SCHED) ? \"INHERIT\" :\n"
11294 " (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
11298 #. type: Plain text
11299 #: build/C/man3/pthread_getattr_default_np.3:186
11303 "main(int argc, char *argv[])\n"
11306 " pthread_attr_t attr;\n"
11309 "main(int argc, char *argv[])\n"
11312 " pthread_attr_t attr;\n"
11314 #. type: Plain text
11315 #: build/C/man3/pthread_getattr_default_np.3:190
11318 " s = pthread_getattr_default_np(&attr);\n"
11320 " errExitEN(s, \"pthread_getattr_default_np\");\n"
11322 " s = pthread_getattr_default_np(&attr);\n"
11324 " errExitEN(s, \"pthread_getattr_default_np\");\n"
11326 #. type: Plain text
11327 #: build/C/man3/pthread_getattr_default_np.3:192
11329 msgid " display_pthread_attr(&attr);\n"
11330 msgstr " display_pthread_attr(&attr);\n"
11333 #: build/C/man3/pthread_mutex_consistent.3:26
11335 msgid "PTHREAD_MUTEX_CONSISTENT"
11336 msgstr "PTHREAD_MUTEX_CONSISTENT"
11338 #. type: Plain text
11339 #: build/C/man3/pthread_mutex_consistent.3:29
11340 msgid "pthread_mutex_consistent - make a robust mutex consistent"
11343 #. type: Plain text
11344 #: build/C/man3/pthread_mutex_consistent.3:34
11346 msgid "B<int pthread_mutex_consistent(pthread_mutex_t *>I<mutex>B<);>\n"
11347 msgstr "B<int pthread_mutex_consistent(pthread_mutex_t *>I<mutex>B<);>\n"
11349 #. type: Plain text
11350 #: build/C/man3/pthread_mutex_consistent.3:44
11351 msgid "B<pthread_mutex_consistent>():"
11352 msgstr "B<pthread_mutex_consistent>():"
11355 #. But see https://sourceware.org/bugzilla/show_bug.cgi?id=22125
11356 #. type: Plain text
11357 #: build/C/man3/pthread_mutex_consistent.3:48
11358 #: build/C/man3/pthread_mutexattr_setrobust.3:55
11359 msgid "_POSIX_C_SOURCE E<gt>= 200809L"
11360 msgstr "_POSIX_C_SOURCE E<gt>= 200809L"
11362 #. type: Plain text
11363 #: build/C/man3/pthread_mutex_consistent.3:59
11365 "This function makes a robust mutex consistent if it is in an inconsistent "
11366 "state. A mutex can be left in an inconsistent state if its owner terminates "
11367 "while holding the mutex, in which case the next owner who acquires the mutex "
11368 "will succeed and be notified by a return value of B<EOWNERDEAD> from a call "
11369 "to B<pthread_mutex_lock>()."
11372 #. type: Plain text
11373 #: build/C/man3/pthread_mutex_consistent.3:65
11376 #| "On success, B<pthread_create>() returns 0; on error, it returns an error "
11377 #| "number, and the contents of I<*thread> are undefined."
11379 "On success, I<pthread_mutex_consistent>() returns 0. Otherwise, it returns "
11380 "a positive error number to indicate the cause of the error."
11382 "成功すると、 B<pthread_create>() は 0 を返す。\n"
11383 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
11385 #. type: Plain text
11386 #: build/C/man3/pthread_mutex_consistent.3:69
11387 msgid "The mutex is either not robust or is not in an inconsistent state."
11390 #. type: Plain text
11391 #: build/C/man3/pthread_mutex_consistent.3:72
11393 #| msgid "These functions first appeared in glibc in version 2.12."
11394 msgid "B<pthread_mutex_consistent>() was added to glibc in version 2.12."
11395 msgstr "これらの関数は glibc バージョン 2.12 で初めて登場した。"
11397 #. type: Plain text
11398 #: build/C/man3/pthread_mutex_consistent.3:74
11399 #: build/C/man3/pthread_mutexattr_setrobust.3:152
11400 msgid "POSIX.1-2008."
11401 msgstr "POSIX.1-2008."
11403 #. type: Plain text
11404 #: build/C/man3/pthread_mutex_consistent.3:82
11406 "B<pthread_mutex_consistent>() simply informs the implementation that the "
11407 "state (shared data) guarded by the mutex has been restored to a consistent "
11408 "state and that normal operations can now be performed with the mutex. It is "
11409 "the application's responsibility to ensure that the shared data has been "
11410 "restored to a consistent state before calling B<pthread_mutex_consistent>()."
11413 #. type: Plain text
11414 #: build/C/man3/pthread_mutex_consistent.3:89
11416 "Before the addition of B<pthread_mutex_consistent>() to POSIX, glibc "
11417 "defined the following equivalent nonstandard function if B<_GNU_SOURCE> was "
11421 #. type: Plain text
11422 #: build/C/man3/pthread_mutex_consistent.3:92
11424 msgid "B<int pthread_mutex_consistent(const pthread_mutex_t *>I<mutex>B<);>\n"
11425 msgstr "B<int pthread_mutex_consistent(const pthread_mutex_t *>I<mutex>B<);>\n"
11427 #. type: Plain text
11428 #: build/C/man3/pthread_mutex_consistent.3:96
11430 "This GNU-specific API, which first appeared in glibc 2.4, is nowadays "
11431 "obsolete and should not be used in new programs."
11434 #. type: Plain text
11435 #: build/C/man3/pthread_mutex_consistent.3:99
11436 msgid "See B<pthread_mutexattr_setrobust>(3)."
11437 msgstr "B<pthread_mutexattr_setrobust>(3) 参照。"
11439 #. type: Plain text
11440 #: build/C/man3/pthread_mutex_consistent.3:107
11442 "B<pthread_mutex_lock>(3), B<pthread_mutexattr_init>(3), "
11443 "B<pthread_mutexattr_getrobust>(3), B<pthread_mutexattr_setrobust>(3), "
11445 msgstr "B<pthread_mutex_lock>(3), B<pthread_mutexattr_init>(3), B<pthread_mutexattr_getrobust>(3), B<pthread_mutexattr_setrobust>(3), B<pthreads>(7)"
11448 #: build/C/man3/pthread_mutexattr_getpshared.3:25
11450 msgid "PTHREAD_MUTEXATTR_GETPSHARED"
11451 msgstr "PTHREAD_MUTEXATTR_GETPSHARED"
11454 #: build/C/man3/pthread_mutexattr_getpshared.3:25
11457 msgstr "2017-09-13"
11459 #. type: Plain text
11460 #: build/C/man3/pthread_mutexattr_getpshared.3:29
11463 #| "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack "
11464 #| "address attribute in thread attributes object"
11466 "pthread_mutexattr_getpshared, pthread_mutexattr_setpshared - get/set process-"
11467 "shared mutex attribute"
11469 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
11470 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
11472 #. type: Plain text
11473 #: build/C/man3/pthread_mutexattr_getpshared.3:37
11476 "B<int pthread_mutexattr_getpshared(const pthread_mutexattr_t *>I<attr>B<,>\n"
11477 "B< int *>I<pshared>B<);>\n"
11478 "B<int pthread_mutexattr_setpshared(pthread_mutexattr_t *>I<attr>B<,>\n"
11479 "B< int >I<pshared>B<);>\n"
11481 "B<int pthread_mutexattr_getpshared(const pthread_mutexattr_t *>I<attr>B<,>\n"
11482 "B< int *>I<pshared>B<);>\n"
11483 "B<int pthread_mutexattr_setpshared(pthread_mutexattr_t *>I<attr>B<,>\n"
11484 "B< int >I<pshared>B<);>\n"
11486 #. type: Plain text
11487 #: build/C/man3/pthread_mutexattr_getpshared.3:45
11489 "These functions get and set the process-shared attribute in a mutex "
11490 "attributes object. This attribute must be appropriately set to ensure "
11491 "correct, efficient operation of a mutex created using this attributes object."
11494 #. type: Plain text
11495 #: build/C/man3/pthread_mutexattr_getpshared.3:47
11497 #| msgid "The new thread terminates in one of the following ways:"
11498 msgid "The process-shared attribute can have one of the following values:"
11499 msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。"
11502 #: build/C/man3/pthread_mutexattr_getpshared.3:47
11503 #: build/C/man3/pthread_spin_init.3:68
11505 msgid "B<PTHREAD_PROCESS_PRIVATE>"
11506 msgstr "B<PTHREAD_PROCESS_PRIVATE>"
11508 #. type: Plain text
11509 #: build/C/man3/pthread_mutexattr_getpshared.3:52
11511 "Mutexes created with this attributes object are to be shared only among "
11512 "threads in the same process that initialized the mutex. This is the default "
11513 "value for the process-shared mutex attribute."
11517 #: build/C/man3/pthread_mutexattr_getpshared.3:52
11518 #: build/C/man3/pthread_spin_init.3:75
11520 msgid "B<PTHREAD_PROCESS_SHARED>"
11521 msgstr "B<PTHREAD_PROCESS_SHARED>"
11523 #. type: Plain text
11524 #: build/C/man3/pthread_mutexattr_getpshared.3:57
11526 "Mutexes created with this attributes object can be shared between any "
11527 "threads that have access to the memory containing the object, including "
11528 "threads in different processes."
11531 #. type: Plain text
11532 #: build/C/man3/pthread_mutexattr_getpshared.3:64
11535 #| "The B<pthread_attr_getstackaddr>() function returns the stack address "
11536 #| "attribute of the thread attributes object referred to by I<attr> in the "
11537 #| "buffer pointed to by I<stackaddr>."
11539 "B<pthread_mutexattr_getpshared>() places the value of the process-shared "
11540 "attribute of the mutex attributes object referred to by I<attr> in the "
11541 "location pointed to by I<pshared>."
11543 "B<pthread_attr_getstackaddr>() は、\n"
11544 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
11545 "I<stackaddr> が指すバッファーに入れて返す。"
11547 #. type: Plain text
11548 #: build/C/man3/pthread_mutexattr_getpshared.3:71
11551 #| "The B<pthread_attr_setguardsize>() function sets the guard size "
11552 #| "attribute of the thread attributes object referred to by I<attr> to the "
11553 #| "value specified in I<guardsize>."
11555 "B<pthread_mutexattr_setpshared>() sets the value of the process-shared "
11556 "attribute of the mutex attributes object referred to by I<attr> to the value "
11557 "specified in B<pshared>."
11559 "B<pthread_attr_setguardsize>() 関数は、\n"
11560 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
11561 "I<guardsize> で指定された値に設定する。"
11563 #. type: Plain text
11564 #: build/C/man3/pthread_mutexattr_getpshared.3:76
11566 "If I<attr> does not refer to an initialized mutex attributes object, the "
11567 "behavior is undefined."
11570 #. type: Plain text
11571 #: build/C/man3/pthread_mutexattr_getpshared.3:79
11572 #: build/C/man3/pthread_mutexattr_init.3:59
11573 #: build/C/man3/pthread_mutexattr_setrobust.3:132
11576 #| "On success, these functions return 0; on error, they return an error "
11579 "On success, these functions return 0. On error, they return a positive "
11582 "成功すると、これらの関数は 0 を返す。\n"
11585 #. type: Plain text
11586 #: build/C/man3/pthread_mutexattr_getpshared.3:82
11588 #| msgid "B<pthread_attr_setscope>() can fail with the following errors:"
11589 msgid "B<pthread_mutexattr_setpshared>() can fail with the following errors:"
11590 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
11592 #. type: Plain text
11593 #: build/C/man3/pthread_mutexattr_getpshared.3:87
11594 msgid "The value specified in I<pshared> is invalid."
11597 #. type: Plain text
11598 #: build/C/man3/pthread_mutexattr_getpshared.3:92
11600 "I<pshared is> B<PTHREAD_PROCESS_SHARED> but the implementation does not "
11601 "support process-shared mutexes."
11604 #. type: Plain text
11605 #: build/C/man3/pthread_mutexattr_getpshared.3:99
11606 msgid "B<pthread_mutexattr_init>(3), B<pthreads>(7)"
11607 msgstr "B<pthread_mutexattr_init>(3), B<pthreads>(7)"
11610 #: build/C/man3/pthread_mutexattr_init.3:25
11612 msgid "PTHREAD_MUTEXATTR_INIT"
11613 msgstr "PTHREAD_MUTEXATTR_INIT"
11616 #: build/C/man3/pthread_mutexattr_init.3:25
11619 msgstr "2019-10-10"
11621 #. type: Plain text
11622 #: build/C/man3/pthread_mutexattr_init.3:29
11625 #| "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
11626 #| "attributes object"
11628 "pthread_mutexattr_init, pthread_mutexattr_destroy - initialize and destroy a "
11629 "mutex attributes object"
11631 "pthread_attr_init, pthread_attr_destroy - \n"
11632 "スレッド属性オブジェクトの初期化と破棄を行う"
11634 #. type: Plain text
11635 #: build/C/man3/pthread_mutexattr_init.3:35
11638 "B<int pthread_mutexattr_init(pthread_mutexattr_t *>I<attr>B<);>\n"
11639 "B<int pthread_mutexattr_destroy(pthread_mutexattr_t *>I<attr>B<);>\n"
11641 "B<int pthread_mutexattr_init(pthread_mutexattr_t *>I<attr>B<);>\n"
11642 "B<int pthread_mutexattr_destroy(pthread_mutexattr_t *>I<attr>B<);>\n"
11644 #. type: Plain text
11645 #: build/C/man3/pthread_mutexattr_init.3:44
11648 #| "The B<pthread_getattr_np>() function initializes the thread attributes "
11649 #| "object referred to by I<attr> so that it contains actual attribute values "
11650 #| "describing the running thread I<thread>."
11652 "The B<pthread_mutexattr_init>() function initializes the mutex attributes "
11653 "object pointed to by I<attr> with default values for all attributes defined "
11654 "by the implementation."
11656 "B<pthread_getattr_np>() 関数は、\n"
11657 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
11658 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
11661 #. type: Plain text
11662 #: build/C/man3/pthread_mutexattr_init.3:47
11664 "The results of initializing an already initialized mutex attributes object "
11668 #. type: Plain text
11669 #: build/C/man3/pthread_mutexattr_init.3:53
11671 "The B<pthread_mutexattr_destroy>() function destroys a mutex attribute "
11672 "object (making it uninitialized). Once a mutex attributes object has been "
11673 "destroyed, it can be reinitialized with B<pthread_mutexattr_init>()."
11676 #. type: Plain text
11677 #: build/C/man3/pthread_mutexattr_init.3:56
11679 "The results of destroying an uninitialized mutex attributes object are "
11683 #. type: Plain text
11684 #: build/C/man3/pthread_mutexattr_init.3:64
11686 "Subsequent changes to a mutex attributes object do not affect mutex that "
11687 "have already been initialized using that object."
11690 #. type: Plain text
11691 #: build/C/man3/pthread_mutexattr_init.3:71
11693 "B<pthread_mutex_init>(3), B<pthread_mutexattr_getpshared>(3), "
11694 "B<pthread_mutexattr_getrobust>(3), B<pthreads>(7)"
11695 msgstr "B<pthread_mutex_init>(3), B<pthread_mutexattr_getpshared>(3), B<pthread_mutexattr_getrobust>(3), B<pthreads>(7)"
11698 #: build/C/man3/pthread_mutexattr_setrobust.3:26
11700 msgid "PTHREAD_MUTEXATTR_SETROBUST"
11701 msgstr "PTHREAD_MUTEXATTR_SETROBUST"
11703 #. type: Plain text
11704 #: build/C/man3/pthread_mutexattr_setrobust.3:30
11707 #| "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes "
11708 #| "in thread attributes object"
11710 "pthread_mutexattr_getrobust, pthread_mutexattr_setrobust - get and set the "
11711 "robustness attribute of a mutex attributes object"
11713 "pthread_attr_setstack, pthread_attr_getstack - \n"
11714 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
11716 #. type: Plain text
11717 #: build/C/man3/pthread_mutexattr_setrobust.3:38
11720 "B<int pthread_mutexattr_getrobust(const pthread_mutexattr_t *>I<attr>B<,>\n"
11721 "B< int *>I<robustness>B<);>\n"
11722 "B<int pthread_mutexattr_setrobust(const pthread_mutexattr_t *>I<attr>B<,>\n"
11723 "B< int >I<robustness>B<);>\n"
11725 "B<int pthread_mutexattr_getrobust(const pthread_mutexattr_t *>I<attr>B<,>\n"
11726 "B< int *>I<robustness>B<);>\n"
11727 "B<int pthread_mutexattr_setrobust(const pthread_mutexattr_t *>I<attr>B<,>\n"
11728 "B< int >I<robustness>B<);>\n"
11730 #. type: Plain text
11731 #: build/C/man3/pthread_mutexattr_setrobust.3:49
11732 msgid "B<pthread_mutexattr_getrobust>(), B<pthread_mutexattr_setrobust>():"
11733 msgstr "B<pthread_mutexattr_getrobust>(), B<pthread_mutexattr_setrobust>():"
11735 #. type: Plain text
11736 #: build/C/man3/pthread_mutexattr_setrobust.3:72
11739 #| "The B<pthread_attr_setdetachstate>() function sets the detach state "
11740 #| "attribute of the thread attributes object referred to by I<attr> to the "
11741 #| "value specified in I<detachstate>. The detach state attribute determines "
11742 #| "whether a thread created using the thread attributes object I<attr> will "
11743 #| "be created in a joinable or a detached state."
11745 "The B<pthread_mutexattr_getrobust>() function places the value of the "
11746 "robustness attribute of the mutex attributes object referred to by I<attr> "
11747 "in I<*robustness>. The B<pthread_mutexattr_setrobust>() function sets the "
11748 "value of the robustness attribute of the mutex attributes object referred to "
11749 "by I<attr> to the value specified in I<*robustness>."
11751 "B<pthread_attr_setdetachstate>() 関数は、\n"
11752 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
11753 "I<detachstate> で指定された値に設定する。\n"
11754 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
11755 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
11756 "detached (切り離された) 状態で作成されるかが決定される。"
11758 #. type: Plain text
11759 #: build/C/man3/pthread_mutexattr_setrobust.3:77
11761 "The robustness attribute specifies the behavior of the mutex when the owning "
11762 "thread dies without unlocking the mutex. The following values are valid for "
11767 #: build/C/man3/pthread_mutexattr_setrobust.3:77
11769 msgid "B<PTHREAD_MUTEX_STALLED>"
11770 msgstr "B<PTHREAD_MUTEX_STALLED>"
11772 #. type: Plain text
11773 #: build/C/man3/pthread_mutexattr_setrobust.3:86
11775 "This is the default value for a mutex attributes object. If a mutex is "
11776 "initialized with the B<PTHREAD_MUTEX_STALLED> attribute and its owner dies "
11777 "without unlocking it, the mutex remains locked afterwards and any future "
11778 "attempts to call B<pthread_mutex_lock>(3) on the mutex will block "
11783 #: build/C/man3/pthread_mutexattr_setrobust.3:86
11785 msgid "B<PTHREAD_MUTEX_ROBUST>"
11786 msgstr "B<PTHREAD_MUTEX_ROBUST>"
11788 #. type: Plain text
11789 #: build/C/man3/pthread_mutexattr_setrobust.3:102
11791 "If a mutex is initialized with the B<PTHREAD_MUTEX_ROBUST> attribute and its "
11792 "owner dies without unlocking it, any future attempts to call "
11793 "B<pthread_mutex_lock>(3) on this mutex will succeed and return "
11794 "B<EOWNERDEAD> to indicate that the original owner no longer exists and the "
11795 "mutex is in an inconsistent state. Usually after B<EOWNERDEAD> is returned, "
11796 "the next owner should call B<pthread_mutex_consistent>(3) on the acquired "
11797 "mutex to make it consistent again before using it any further."
11800 #. type: Plain text
11801 #: build/C/man3/pthread_mutexattr_setrobust.3:112
11803 "If the next owner unlocks the mutex using B<pthread_mutex_unlock>(3) before "
11804 "making it consistent, the mutex will be permanently unusable and any "
11805 "subsequent attempts to lock it using B<pthread_mutex_lock>(3) will fail "
11806 "with the error B<ENOTRECOVERABLE>. The only permitted operation on such a "
11807 "mutex is B<pthread_mutex_destroy>(3)."
11810 #. type: Plain text
11811 #: build/C/man3/pthread_mutexattr_setrobust.3:119
11813 "If the next owner terminates before calling B<pthread_mutex_consistent>(3), "
11814 "further B<pthread_mutex_lock>(3) operations on this mutex will still return "
11818 #. type: Plain text
11819 #: build/C/man3/pthread_mutexattr_setrobust.3:129
11821 "Note that the I<attr> argument of B<pthread_mutexattr_getrobust>() and "
11822 "B<pthread_mutexattr_setrobust>() should refer to a mutex attributes object "
11823 "that was initialized by B<pthread_mutexattr_init>(3), otherwise the behavior "
11827 #. type: Plain text
11828 #: build/C/man3/pthread_mutexattr_setrobust.3:136
11830 "In the glibc implementation, B<pthread_mutexattr_getrobust>() always return "
11834 #. type: Plain text
11835 #: build/C/man3/pthread_mutexattr_setrobust.3:145
11837 "A value other than B<PTHREAD_MUTEX_STALLED> or B<PTHREAD_MUTEX_ROBUST> was "
11838 "passed to B<pthread_mutexattr_setrobust>()."
11841 #. type: Plain text
11842 #: build/C/man3/pthread_mutexattr_setrobust.3:150
11845 #| "B<makecontext>() and B<swapcontext>() are provided in glibc since "
11848 "B<pthread_mutexattr_getrobust>() and B<pthread_mutexattr_setrobust>() were "
11849 "added to glibc in version 2.12."
11851 "B<makecontext>() と B<swapcontext>() は、バージョン 2.1 以降の glibc で提供"
11854 #. E.g., Solaris, according to its manual page
11855 #. type: Plain text
11856 #: build/C/man3/pthread_mutexattr_setrobust.3:163
11858 "In the Linux implementation, when using process-shared robust mutexes, a "
11859 "waiting thread also receives the B<EOWNERDEAD> notification if the owner of "
11860 "a robust mutex performs an B<execve>(2) without first unlocking the mutex. "
11861 "POSIX.1 does not specify this detail, but the same behavior also occurs in "
11862 "at least some other implementations."
11865 #. type: Plain text
11866 #: build/C/man3/pthread_mutexattr_setrobust.3:172
11868 "Before the addition of B<pthread_mutexattr_getrobust>() and "
11869 "B<pthread_mutexattr_setrobust>() to POSIX, glibc defined the following "
11870 "equivalent nonstandard functions if B<_GNU_SOURCE> was defined:"
11873 #. type: Plain text
11874 #: build/C/man3/pthread_mutexattr_setrobust.3:178
11877 "B<int pthread_mutexattr_getrobust_np(const pthread_mutexattr_t *>I<attr>B<,>\n"
11878 "B< int *>I<robustness>B<);>\n"
11879 "B<int pthread_mutexattr_setrobust_np(const pthread_mutexattr_t *>I<attr>B<,>\n"
11880 "B< int >I<robustness>B<);>\n"
11882 "B<int pthread_mutexattr_getrobust_np(const pthread_mutexattr_t *>I<attr>B<,>\n"
11883 "B< int *>I<robustness>B<);>\n"
11884 "B<int pthread_mutexattr_setrobust_np(const pthread_mutexattr_t *>I<attr>B<,>\n"
11885 "B< int >I<robustness>B<);>\n"
11887 #. type: Plain text
11888 #: build/C/man3/pthread_mutexattr_setrobust.3:185
11890 "Correspondingly, the constants B<PTHREAD_MUTEX_STALLED_NP> and "
11891 "B<PTHREAD_MUTEX_ROBUST_NP> were also defined."
11894 #. type: Plain text
11895 #: build/C/man3/pthread_mutexattr_setrobust.3:188
11897 "These GNU-specific APIs, which first appeared in glibc 2.4, are nowadays "
11898 "obsolete and should not be used in new programs."
11901 #. type: Plain text
11902 #: build/C/man3/pthread_mutexattr_setrobust.3:197
11904 "The program below demonstrates the use of the robustness attribute of a "
11905 "mutex attributes object. In this program, a thread holding the mutex dies "
11906 "prematurely without unlocking the mutex. The main thread subsequently "
11907 "acquires the mutex successfully and gets the error B<EOWNERDEAD>, after "
11908 "which it makes the mutex consistent."
11911 #. type: Plain text
11912 #: build/C/man3/pthread_mutexattr_setrobust.3:199
11914 #| msgid "The following shell session shows a sample run of the program:"
11916 "The following shell session shows what we see when running this program:"
11917 msgstr "以下のシェルセッションは、このプログラムの実行例である。"
11919 #. type: Plain text
11920 #: build/C/man3/pthread_mutexattr_setrobust.3:209
11924 "[original owner] Setting lock...\n"
11925 "[original owner] Locked. Now exiting without unlocking.\n"
11926 "[main] Attempting to lock the robust mutex.\n"
11927 "[main] pthread_mutex_lock() returned EOWNERDEAD\n"
11928 "[main] Now make the mutex consistent\n"
11929 "[main] Mutex is now consistent; unlocking\n"
11932 "[original owner] Setting lock...\n"
11933 "[original owner] Locked. Now exiting without unlocking.\n"
11934 "[main] Attempting to lock the robust mutex.\n"
11935 "[main] pthread_mutex_lock() returned EOWNERDEAD\n"
11936 "[main] Now make the mutex consistent\n"
11937 "[main] Mutex is now consistent; unlocking\n"
11939 #. type: Plain text
11940 #: build/C/man3/pthread_mutexattr_setrobust.3:218
11943 "#include E<lt>stdlib.hE<gt>\n"
11944 "#include E<lt>stdio.hE<gt>\n"
11945 "#include E<lt>unistd.hE<gt>\n"
11946 "#include E<lt>pthread.hE<gt>\n"
11947 "#include E<lt>errno.hE<gt>\n"
11949 "#include E<lt>stdlib.hE<gt>\n"
11950 "#include E<lt>stdio.hE<gt>\n"
11951 "#include E<lt>unistd.hE<gt>\n"
11952 "#include E<lt>pthread.hE<gt>\n"
11953 "#include E<lt>errno.hE<gt>\n"
11955 #. type: Plain text
11956 #: build/C/man3/pthread_mutexattr_setrobust.3:223
11958 msgid "static pthread_mutex_t mtx;\n"
11961 #. type: Plain text
11962 #: build/C/man3/pthread_mutexattr_setrobust.3:232
11966 "original_owner_thread(void *ptr)\n"
11968 " printf(\"[original owner] Setting lock...\\en\");\n"
11969 " pthread_mutex_lock(&mtx);\n"
11970 " printf(\"[original owner] Locked. Now exiting without unlocking.\\en\");\n"
11971 " pthread_exit(NULL);\n"
11975 #. type: Plain text
11976 #: build/C/man3/pthread_mutexattr_setrobust.3:239
11980 "main(int argc, char *argv[])\n"
11982 " pthread_t thr;\n"
11983 " pthread_mutexattr_t attr;\n"
11987 "main(int argc, char *argv[])\n"
11989 " pthread_t thr;\n"
11990 " pthread_mutexattr_t attr;\n"
11993 #. type: Plain text
11994 #: build/C/man3/pthread_mutexattr_setrobust.3:244
11997 " pthread_mutexattr_init(&attr);\n"
11998 " /* initialize the attributes object */\n"
11999 " pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST);\n"
12000 " /* set robustness */\n"
12003 #. type: Plain text
12004 #: build/C/man3/pthread_mutexattr_setrobust.3:246
12006 msgid " pthread_mutex_init(&mtx, &attr); /* initialize the mutex */\n"
12009 #. type: Plain text
12010 #: build/C/man3/pthread_mutexattr_setrobust.3:248
12012 msgid " pthread_create(&thr, NULL, original_owner_thread, NULL);\n"
12015 #. type: Plain text
12016 #: build/C/man3/pthread_mutexattr_setrobust.3:252
12018 msgid " /* \"original_owner_thread\" should have exited by now */\n"
12021 #. type: Plain text
12022 #: build/C/man3/pthread_mutexattr_setrobust.3:265
12025 " printf(\"[main] Attempting to lock the robust mutex.\\en\");\n"
12026 " s = pthread_mutex_lock(&mtx);\n"
12027 " if (s == EOWNERDEAD) {\n"
12028 " printf(\"[main] pthread_mutex_lock() returned EOWNERDEAD\\en\");\n"
12029 " printf(\"[main] Now make the mutex consistent\\en\");\n"
12030 " s = pthread_mutex_consistent(&mtx);\n"
12032 " handle_error_en(s, \"pthread_mutex_consistent\");\n"
12033 " printf(\"[main] Mutex is now consistent; unlocking\\en\");\n"
12034 " s = pthread_mutex_unlock(&mtx);\n"
12036 " handle_error_en(s, \"pthread_mutex_unlock\");\n"
12039 #. type: Plain text
12040 #: build/C/man3/pthread_mutexattr_setrobust.3:275
12043 " exit(EXIT_SUCCESS);\n"
12044 " } else if (s == 0) {\n"
12045 " printf(\"[main] pthread_mutex_lock() unexpectedly succeeded\\en\");\n"
12046 " exit(EXIT_FAILURE);\n"
12048 " printf(\"[main] pthread_mutex_lock() unexpectedly failed\\en\");\n"
12049 " handle_error_en(s, \"pthread_mutex_lock\");\n"
12054 #. type: Plain text
12055 #: build/C/man3/pthread_mutexattr_setrobust.3:285
12057 "B<get_robust_list>(2), B<set_robust_list>(2), "
12058 "B<pthread_mutex_consistent>(3), B<pthread_mutex_init>(3), "
12059 "B<pthread_mutex_lock>(3), B<pthreads>(7)"
12060 msgstr "B<get_robust_list>(2), B<set_robust_list>(2), B<pthread_mutex_consistent>(3), B<pthread_mutex_init>(3), B<pthread_mutex_lock>(3), B<pthreads>(7)"
12063 #: build/C/man3/pthread_spin_init.3:25
12065 msgid "PTHREAD_SPIN_INIT"
12066 msgstr "PTHREAD_SPIN_INIT"
12068 #. type: Plain text
12069 #: build/C/man3/pthread_spin_init.3:28
12072 #| "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
12073 #| "attributes object"
12075 "pthread_spin_init, pthread_spin_destroy - initialize or destroy a spin lock"
12077 "pthread_attr_init, pthread_attr_destroy - \n"
12078 "スレッド属性オブジェクトの初期化と破棄を行う"
12080 #. type: Plain text
12081 #: build/C/man3/pthread_spin_init.3:34
12084 "B<int pthread_spin_init(pthread_spinlock_t *>I<lock>B<, int >I<pshared>B<);>\n"
12085 "B<int pthread_spin_destroy(pthread_spinlock_t *>I<lock>B<);>\n"
12087 "B<int pthread_spin_init(pthread_spinlock_t *>I<lock>B<, int >I<pshared>B<);>\n"
12088 "B<int pthread_spin_destroy(pthread_spinlock_t *>I<lock>B<);>\n"
12090 #. type: Plain text
12091 #: build/C/man3/pthread_spin_init.3:45
12092 msgid "B<pthread_spin_init>(), B<pthread_spin_destroy>():"
12093 msgstr "B<pthread_spin_init>(), B<pthread_spin_destroy>():"
12095 #. type: Plain text
12096 #: build/C/man3/pthread_spin_init.3:49 build/C/man3/pthread_spin_lock.3:51
12097 msgid "_POSIX_C_SOURCE E<gt>= 200112L"
12098 msgstr "_POSIX_C_SOURCE E<gt>= 200112L"
12100 #. type: Plain text
12101 #: build/C/man3/pthread_spin_init.3:58
12103 "I<General note>: Most programs should use mutexes instead of spin locks. "
12104 "Spin locks are primarily useful in conjunction with real-time scheduling "
12105 "policies. See NOTES."
12108 #. type: Plain text
12109 #: build/C/man3/pthread_spin_init.3:68
12111 "The B<pthread_spin_init>() function allocates any resources required for "
12112 "the use of the spin lock referred to by I<lock> and initializes the lock to "
12113 "be in the unlocked state. The I<pshared> argument must have one of the "
12114 "following values:"
12117 #. type: Plain text
12118 #: build/C/man3/pthread_spin_init.3:75
12120 "The spin lock is to be operated on only by threads in the same process as "
12121 "the thread that calls B<pthread_spin_init>(). (Attempting to share the spin "
12122 "lock between processes results in undefined behavior.)"
12125 #. type: Plain text
12126 #: build/C/man3/pthread_spin_init.3:81
12128 "The spin lock may be operated on by any thread in any process that has "
12129 "access to the memory containing the lock (i.e., the lock may be in a shared "
12130 "memory object that is shared among multiple processes)."
12133 #. type: Plain text
12134 #: build/C/man3/pthread_spin_init.3:86
12137 #| "Calling B<pthread_attr_init>() on a thread attributes object that has "
12138 #| "already been initialized results in undefined behavior."
12140 "Calling B<pthread_spin_init>() on a spin lock that has already been "
12141 "initialized results in undefined behavior."
12143 "すでに初期化されているスレッド属性オブジェクトに対して\n"
12144 "B<pthread_attr_init>() を呼び出した場合、\n"
12145 "どのような動作になるかは不定である。"
12147 #. type: Plain text
12148 #: build/C/man3/pthread_spin_init.3:94
12150 "The B<pthread_spin_destroy>() function destroys a previously initialized "
12151 "spin lock, freeing any resources that were allocated for that lock. "
12152 "Destroying a spin lock that has not been previously been initialized or "
12153 "destroying a spin lock while another thread holds the lock results in "
12154 "undefined behavior."
12157 #. type: Plain text
12158 #: build/C/man3/pthread_spin_init.3:100
12160 "Once a spin lock has been destroyed, performing any operation on the lock "
12161 "other than once more initializing it with B<pthread_spin_init>() results in "
12162 "undefined behavior."
12165 #. type: Plain text
12166 #: build/C/man3/pthread_spin_init.3:111
12168 "The result of performing operations such as B<pthread_spin_lock>(3), "
12169 "B<pthread_spin_unlock>(3), and B<pthread_spin_destroy>() on I<copies> of "
12170 "the object referred to by I<lock> is undefined."
12173 #. type: Plain text
12174 #: build/C/man3/pthread_spin_init.3:117
12177 #| "On success, these functions return 0; on error, they return a nonzero "
12178 #| "error number. If B<pthread_setschedparam>() fails, the scheduling "
12179 #| "policy and parameters of I<thread> are not changed."
12181 "On success, there functions return zero. On failure, they return an error "
12182 "number. In the event that B<pthread_spin_init>() fails, the lock is not "
12185 "成功すると、これらの関数は 0 を返す。\n"
12186 "エラーの場合、0 以外のエラー番号を返す。\n"
12187 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
12188 "スケジューリングポリシーとパラメーターは変更されない。"
12190 #. These errors don't occur on the glibc implementation
12191 #. type: Plain text
12192 #: build/C/man3/pthread_spin_init.3:121
12194 #| msgid "B<pthread_attr_setscope>() can fail with the following errors:"
12195 msgid "B<pthread_spin_init>() may fail with the following errors:"
12196 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
12198 #. type: Plain text
12199 #: build/C/man3/pthread_spin_init.3:125
12200 msgid "The system has insufficient resources to initialize a new spin lock."
12203 #. type: Plain text
12204 #: build/C/man3/pthread_spin_init.3:128
12205 msgid "Insufficient memory to initialize the spin lock."
12208 #. type: Plain text
12209 #: build/C/man3/pthread_spin_init.3:130 build/C/man3/pthread_spin_lock.3:109
12211 #| msgid "These functions first appeared in glibc in version 2.12."
12212 msgid "These functions first appeared in glibc in version 2.2."
12213 msgstr "これらの関数は glibc バージョン 2.12 で初めて登場した。"
12215 #. type: Plain text
12216 #: build/C/man3/pthread_spin_init.3:132 build/C/man3/pthread_spin_lock.3:111
12217 msgid "POSIX.1-2001."
12218 msgstr "POSIX.1-2001."
12220 #. type: Plain text
12221 #: build/C/man3/pthread_spin_init.3:135
12223 "Support for process-shared spin locks is a POSIX option. The option is "
12224 "supported in the glibc implementation."
12227 #. type: Plain text
12228 #: build/C/man3/pthread_spin_init.3:148
12230 "Spin locks should be employed in conjunction with real-time scheduling "
12231 "policies (B<SCHED_FIFO>, or possibly B<SCHED_RR>). Use of spin locks with "
12232 "nondeterministic scheduling policies such as B<SCHED_OTHER> probably "
12233 "indicates a design mistake. The problem is that if a thread operating under "
12234 "such a policy is scheduled off the CPU while it holds a spin lock, then "
12235 "other threads will waste time spinning on the lock until the lock holder is "
12236 "once more rescheduled and releases the lock."
12239 #. type: Plain text
12240 #: build/C/man3/pthread_spin_init.3:151
12242 "If threads create a deadlock situation while employing spin locks, those "
12243 "threads will spin forever consuming CPU time."
12246 #. FIXME . When PTHREAD_MUTEX_ADAPTIVE_NP is one day document
12247 #. make reference to it here
12248 #. type: Plain text
12249 #: build/C/man3/pthread_spin_init.3:162
12251 "User-space spin locks are I<not> applicable as a general locking solution. "
12252 "They are, by definition, prone to priority inversion and unbounded spin "
12253 "times. A programmer using spin locks must be exceptionally careful not only "
12254 "in the code, but also in terms of system configuration, thread placement, "
12255 "and priority assignment."
12258 #. type: Plain text
12259 #: build/C/man3/pthread_spin_init.3:170
12261 "B<pthread_mutex_init>(3), B<pthread_mutex_lock>(3), B<pthread_spin_lock>(3), "
12262 "B<pthread_spin_unlock>(3), B<pthreads>(7)"
12263 msgstr "B<pthread_mutex_init>(3), B<pthread_mutex_lock>(3), B<pthread_spin_lock>(3), B<pthread_spin_unlock>(3), B<pthreads>(7)"
12266 #: build/C/man3/pthread_spin_lock.3:25
12268 msgid "PTHREAD_SPIN_LOCK"
12269 msgstr "PTHREAD_SPIN_LOCK"
12272 #: build/C/man3/pthread_spin_lock.3:25
12275 msgstr "2017-09-30"
12277 #. type: Plain text
12278 #: build/C/man3/pthread_spin_lock.3:29
12280 "pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock - lock and "
12281 "unlock a spin lock"
12284 #. type: Plain text
12285 #: build/C/man3/pthread_spin_lock.3:36
12288 "B<int pthread_spin_lock(pthread_spinlock_t *>I<lock>B<);>\n"
12289 "B<int pthread_spin_trylock(pthread_spinlock_t *>I<lock>B<);>\n"
12290 "B<int pthread_spin_unlock(pthread_spinlock_t *>I<lock>B<);>\n"
12293 #. type: Plain text
12294 #: build/C/man3/pthread_spin_lock.3:47
12295 msgid "B<pthread_spin_lock>(), B<pthread_spin_trylock>():"
12296 msgstr "B<pthread_spin_lock>(), B<pthread_spin_trylock>():"
12298 #. type: Plain text
12299 #: build/C/man3/pthread_spin_lock.3:63
12301 "The B<pthread_spin_lock>() function locks the spin lock referred to by "
12302 "I<lock>. If the spin lock is currently unlocked, the calling thread "
12303 "acquires the lock immediately. If the spin lock is currently locked by "
12304 "another thread, the calling thread spins, testing the lock until it becomes "
12305 "available, at which point the calling thread acquires the lock."
12308 #. type: Plain text
12309 #: build/C/man3/pthread_spin_lock.3:70
12312 #| "Calling B<pthread_attr_init>() on a thread attributes object that has "
12313 #| "already been initialized results in undefined behavior."
12315 "Calling B<pthread_spin_lock>() on a lock that is already held by the caller "
12316 "or a lock that has not been initialized with B<pthread_spin_init>(3) "
12317 "results in undefined behavior."
12319 "すでに初期化されているスレッド属性オブジェクトに対して\n"
12320 "B<pthread_attr_init>() を呼び出した場合、\n"
12321 "どのような動作になるかは不定である。"
12323 #. type: Plain text
12324 #: build/C/man3/pthread_spin_lock.3:80
12326 "The B<pthread_spin_trylock>() function is like B<pthread_spin_lock>(), "
12327 "except that if the spin lock referred to by I<lock> is currently locked, "
12328 "then, instead of spinning, the call returns immediately with the error "
12332 #. type: Plain text
12333 #: build/C/man3/pthread_spin_lock.3:87
12335 "The B<pthread_spin_unlock>() function unlocks the spin lock referred to "
12336 "I<lock>. If any threads are spinning on the lock, one of those threads will "
12337 "then acquire the lock."
12340 #. type: Plain text
12341 #: build/C/man3/pthread_spin_lock.3:91
12344 #| "Calling B<pthread_attr_init>() on a thread attributes object that has "
12345 #| "already been initialized results in undefined behavior."
12347 "Calling B<pthread_spin_unlock>() on a lock that is not held by the caller "
12348 "results in undefined behavior."
12350 "すでに初期化されているスレッド属性オブジェクトに対して\n"
12351 "B<pthread_attr_init>() を呼び出した場合、\n"
12352 "どのような動作になるかは不定である。"
12354 #. type: Plain text
12355 #: build/C/man3/pthread_spin_lock.3:94
12358 #| "On success, these functions return 0; on error, they return an error "
12361 "On success, these functions return zero. On failure, they return an error "
12364 "成功すると、これらの関数は 0 を返す。\n"
12367 #. type: Plain text
12368 #: build/C/man3/pthread_spin_lock.3:97
12370 #| msgid "B<pthread_attr_setstack>() can fail with the following error:"
12371 msgid "B<pthread_spin_lock>() may fail with the following errors:"
12372 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
12375 #: build/C/man3/pthread_spin_lock.3:97
12377 msgid "B<EDEADLOCK>"
12378 msgstr "B<EDEADLOCK>"
12380 #. Not detected in glibc
12381 #. type: Plain text
12382 #: build/C/man3/pthread_spin_lock.3:101
12383 msgid "The system detected a deadlock condition."
12386 #. type: Plain text
12387 #: build/C/man3/pthread_spin_lock.3:104
12388 msgid "B<pthread_spin_trylock>() fails with the following errors:"
12389 msgstr "B<pthread_spin_trylock>() は以下のエラーで失敗する。"
12391 #. type: Plain text
12392 #: build/C/man3/pthread_spin_lock.3:107
12393 msgid "The spin lock is currently locked by another thread."
12396 #. type: Plain text
12397 #: build/C/man3/pthread_spin_lock.3:114
12400 #| "Calling B<pthread_attr_init>() on a thread attributes object that has "
12401 #| "already been initialized results in undefined behavior."
12403 "Applying any of the functions described on this page to an uninitialized "
12404 "spin lock results in undefined behavior."
12406 "すでに初期化されているスレッド属性オブジェクトに対して\n"
12407 "B<pthread_attr_init>() を呼び出した場合、\n"
12408 "どのような動作になるかは不定である。"
12410 #. type: Plain text
12411 #: build/C/man3/pthread_spin_lock.3:117
12413 #| msgid "See B<pthread_attr_init>(3)."
12414 msgid "Carefully read NOTES in B<pthread_spin_init>(3)."
12415 msgstr "B<pthread_attr_init>(3) を参照。"
12417 #. FIXME . .BR pthread_mutex_lock (3),
12418 #. type: Plain text
12419 #: build/C/man3/pthread_spin_lock.3:124
12420 msgid "B<pthread_spin_destroy>(3), B<pthread_spin_init>(3), B<pthreads>(7)"
12421 msgstr "B<pthread_spin_destroy>(3), B<pthread_spin_init>(3), B<pthreads>(7)"
12424 #: build/C/man7/pthreads.7:25
12429 #. type: Plain text
12430 #: build/C/man7/pthreads.7:28
12431 msgid "pthreads - POSIX threads"
12432 msgstr "pthreads - POSIX スレッド"
12434 #. type: Plain text
12435 #: build/C/man7/pthreads.7:35
12437 "POSIX.1 specifies a set of interfaces (functions, header files) for threaded "
12438 "programming commonly known as POSIX threads, or Pthreads. A single process "
12439 "can contain multiple threads, all of which are executing the same program. "
12440 "These threads share the same global memory (data and heap segments), but "
12441 "each thread has its own stack (automatic variables)."
12443 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッドプログラ"
12444 "ミングのインターフェース群 (関数、ヘッダーファイル) を規定している。一つのプ"
12445 "ロセスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行"
12446 "する。 これらのスレッドは同じ大域メモリー (データとヒープ領域) を共有する"
12447 "が、 各スレッドは自分専用のスタック (自動変数) を持つ。"
12449 #. type: Plain text
12450 #: build/C/man7/pthreads.7:38
12452 "POSIX.1 also requires that threads share a range of other attributes (i.e., "
12453 "these attributes are process-wide rather than per-thread):"
12455 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
12456 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
12459 #: build/C/man7/pthreads.7:38 build/C/man7/pthreads.7:40
12460 #: build/C/man7/pthreads.7:42 build/C/man7/pthreads.7:44
12461 #: build/C/man7/pthreads.7:46 build/C/man7/pthreads.7:48
12462 #: build/C/man7/pthreads.7:50 build/C/man7/pthreads.7:53
12463 #: build/C/man7/pthreads.7:55 build/C/man7/pthreads.7:58
12464 #: build/C/man7/pthreads.7:64 build/C/man7/pthreads.7:69
12465 #: build/C/man7/pthreads.7:72 build/C/man7/pthreads.7:75
12466 #: build/C/man7/pthreads.7:83 build/C/man7/pthreads.7:87
12467 #: build/C/man7/pthreads.7:90 build/C/man7/pthreads.7:94
12468 #: build/C/man7/pthreads.7:97 build/C/man7/pthreads.7:102
12469 #: build/C/man7/pthreads.7:105 build/C/man7/pthreads.7:704
12470 #: build/C/man7/pthreads.7:711 build/C/man7/pthreads.7:723
12471 #: build/C/man7/pthreads.7:733 build/C/man7/pthreads.7:737
12472 #: build/C/man7/pthreads.7:746 build/C/man7/pthreads.7:756
12473 #: build/C/man7/pthreads.7:763 build/C/man7/pthreads.7:770
12474 #: build/C/man7/pthreads.7:772 build/C/man7/pthreads.7:775
12475 #: build/C/man7/pthreads.7:781 build/C/man7/pthreads.7:784
12476 #: build/C/man7/pthreads.7:786 build/C/man7/pthreads.7:788
12477 #: build/C/man7/pthreads.7:798 build/C/man7/pthreads.7:820
12478 #: build/C/man7/pthreads.7:829 build/C/man7/pthreads.7:835
12479 #: build/C/man7/pthreads.7:837 build/C/man7/pthreads.7:839
12480 #: build/C/man7/pthreads.7:843 build/C/man7/pthreads.7:848
12481 #: build/C/man7/pthreads.7:856
12486 #. type: Plain text
12487 #: build/C/man7/pthreads.7:40
12491 #. type: Plain text
12492 #: build/C/man7/pthreads.7:42
12493 msgid "parent process ID"
12496 #. type: Plain text
12497 #: build/C/man7/pthreads.7:44
12498 msgid "process group ID and session ID"
12499 msgstr "プロセスグループ ID とセッション ID"
12501 #. type: Plain text
12502 #: build/C/man7/pthreads.7:46
12503 msgid "controlling terminal"
12506 #. type: Plain text
12507 #: build/C/man7/pthreads.7:48
12508 msgid "user and group IDs"
12509 msgstr "ユーザー ID とグループ ID"
12511 #. type: Plain text
12512 #: build/C/man7/pthreads.7:50
12513 msgid "open file descriptors"
12514 msgstr "オープンするファイルディスクリプター"
12516 #. type: Plain text
12517 #: build/C/man7/pthreads.7:53
12518 msgid "record locks (see B<fcntl>(2))"
12519 msgstr "レコードのロック (B<fcntl>(3) 参照)"
12521 #. type: Plain text
12522 #: build/C/man7/pthreads.7:55
12523 msgid "signal dispositions"
12526 #. type: Plain text
12527 #: build/C/man7/pthreads.7:58
12528 msgid "file mode creation mask (B<umask>(2))"
12529 msgstr "ファイルモード作成マスク (B<umask>(2))"
12531 #. type: Plain text
12532 #: build/C/man7/pthreads.7:64
12533 msgid "current directory (B<chdir>(2)) and root directory (B<chroot>(2))"
12535 "カレントディレクトリ (B<chdir>(2)) とルートディレクトリ (B<chroot>(2))"
12537 #. type: Plain text
12538 #: build/C/man7/pthreads.7:69
12540 "interval timers (B<setitimer>(2)) and POSIX timers (B<timer_create>(2))"
12542 "インターバルタイマー (B<setitimer>(2)) と POSIX タイマー "
12543 "(B<timer_create>(2))"
12545 #. type: Plain text
12546 #: build/C/man7/pthreads.7:72
12547 msgid "nice value (B<setpriority>(2))"
12548 msgstr "nice 値 (B<setpriority>(2))"
12550 #. type: Plain text
12551 #: build/C/man7/pthreads.7:75
12552 msgid "resource limits (B<setrlimit>(2))"
12553 msgstr "リソース制限 (B<setrlimit>(2))"
12555 #. type: Plain text
12556 #: build/C/man7/pthreads.7:80
12558 "measurements of the consumption of CPU time (B<times>(2)) and resources "
12559 "(B<getrusage>(2))"
12560 msgstr "CPU 時間 (B<times>(2)) とリソース (B<getrusage>(2)) の消費状況の計測"
12562 #. type: Plain text
12563 #: build/C/man7/pthreads.7:83
12565 "As well as the stack, POSIX.1 specifies that various other attributes are "
12566 "distinct for each thread, including:"
12568 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
12571 #. type: Plain text
12572 #: build/C/man7/pthreads.7:87
12573 msgid "thread ID (the I<pthread_t> data type)"
12574 msgstr "スレッド ID (B<pthread_t> データ型)"
12576 #. type: Plain text
12577 #: build/C/man7/pthreads.7:90
12578 msgid "signal mask (B<pthread_sigmask>(3))"
12579 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
12581 #. type: Plain text
12582 #: build/C/man7/pthreads.7:94
12583 msgid "the I<errno> variable"
12584 msgstr "I<errno> 変数"
12586 #. type: Plain text
12587 #: build/C/man7/pthreads.7:97
12588 msgid "alternate signal stack (B<sigaltstack>(2))"
12589 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
12591 #. type: Plain text
12592 #: build/C/man7/pthreads.7:100
12593 msgid "real-time scheduling policy and priority (B<sched>(7))"
12594 msgstr "リアルタイムスケジューリングのポリシーと優先度 (B<sched>(7))"
12596 #. type: Plain text
12597 #: build/C/man7/pthreads.7:102
12598 msgid "The following Linux-specific features are also per-thread:"
12599 msgstr "以下の Linux 特有の機能もスレッド単位である:"
12601 #. type: Plain text
12602 #: build/C/man7/pthreads.7:105
12603 msgid "capabilities (see B<capabilities>(7))"
12604 msgstr "ケーパビリティ (B<capabilities>(7) 参照)"
12606 #. type: Plain text
12607 #: build/C/man7/pthreads.7:108
12608 msgid "CPU affinity (B<sched_setaffinity>(2))"
12609 msgstr "CPU affinity (親和度) (B<sched_setaffinity>(2))"
12612 #: build/C/man7/pthreads.7:108
12614 msgid "Pthreads function return values"
12615 msgstr "pthreads 関数の返り値"
12617 #. type: Plain text
12618 #: build/C/man7/pthreads.7:119
12621 #| "Most pthreads functions return 0 on success, and an error number of "
12622 #| "failure. Note that the pthreads functions do not set I<errno>. For each "
12623 #| "of the pthreads functions that can return an error, POSIX.1-2001 "
12624 #| "specifies that the function can never fail with the error B<EINTR>."
12626 "Most pthreads functions return 0 on success, and an error number on "
12627 "failure. The error numbers that can be returned have the same meaning as "
12628 "the error numbers returned in I<errno> by conventional system calls and C "
12629 "library functions. Note that the pthreads functions do not set I<errno>. "
12630 "For each of the pthreads functions that can return an error, POSIX.1-2001 "
12631 "specifies that the function can never fail with the error B<EINTR>."
12633 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
12634 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
12635 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
12639 #: build/C/man7/pthreads.7:119
12644 #. type: Plain text
12645 #: build/C/man7/pthreads.7:127
12647 "Each of the threads in a process has a unique thread identifier (stored in "
12648 "the type I<pthread_t>). This identifier is returned to the caller of "
12649 "B<pthread_create>(3), and a thread can obtain its own thread identifier "
12650 "using B<pthread_self>(3)."
12651 msgstr "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持つ。 この識別子は、 B<pthread_create>(3) の呼び出し元に返される。また、スレッドは自身のスレッド識別子を B<pthread_self>(3) を使って取得できる。"
12653 #. type: Plain text
12654 #: build/C/man7/pthreads.7:132
12657 #| "Thread IDs are guaranteed to be unique only within a process. A thread "
12658 #| "ID may be reused after a terminated thread has been joined, or a detached "
12659 #| "thread has terminated."
12661 "Thread IDs are guaranteed to be unique only within a process. (In all "
12662 "pthreads functions that accept a thread ID as an argument, that ID by "
12663 "definition refers to a thread in the same process as the caller.)"
12665 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
12666 "終了したスレッドが join されたり、\n"
12667 "切り離された (detached) スレッドが終了されたりした後は、\n"
12668 "そのスレッド ID は再利用されることがある。"
12670 #. type: Plain text
12671 #: build/C/man7/pthreads.7:137
12673 "The system may reuse a thread ID after a terminated thread has been joined, "
12674 "or a detached thread has terminated. POSIX says: \"If an application "
12675 "attempts to use a thread ID whose lifetime has ended, the behavior is "
12680 #: build/C/man7/pthreads.7:137
12682 msgid "Thread-safe functions"
12683 msgstr "スレッドセーフな関数"
12685 #. type: Plain text
12686 #: build/C/man7/pthreads.7:141
12688 "A thread-safe function is one that can be safely (i.e., it will deliver the "
12689 "same results regardless of whether it is) called from multiple threads at "
12692 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
12693 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
12695 #. type: Plain text
12696 #: build/C/man7/pthreads.7:145
12698 "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the "
12699 "standard shall be thread-safe, except for the following functions:"
12701 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
12702 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
12704 #. type: Plain text
12705 #: build/C/man7/pthreads.7:241
12712 "ctermid() if passed a non-NULL argument\n"
12726 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
12731 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
12733 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
12734 "getc_unlocked()\n"
12735 "getchar_unlocked()\n"
12741 "gethostbyaddr() [POSIX.1-2001 only (function removed in\n"
12742 " POSIX.1-2008)]\n"
12743 "gethostbyname() [POSIX.1-2001 only (function removed in\n"
12744 " POSIX.1-2008)]\n"
12751 "getprotobyname()\n"
12752 "getprotobynumber()\n"
12757 "getservbyname()\n"
12758 "getservbyport()\n"
12779 "putc_unlocked()\n"
12780 "putchar_unlocked()\n"
12791 "strsignal() [Added in POSIX.1-2008]\n"
12793 "system() [Added in POSIX.1-2008]\n"
12794 "tmpnam() if passed a non-NULL argument\n"
12797 "wcrtomb() if its final argument is NULL\n"
12798 "wcsrtombs() if its final argument is NULL\n"
12806 "ctermid() (NULL でない引数を渡された場合)\n"
12820 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
12825 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
12827 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
12828 "getc_unlocked()\n"
12829 "getchar_unlocked()\n"
12835 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
12836 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
12843 "getprotobyname()\n"
12844 "getprotobynumber()\n"
12849 "getservbyname()\n"
12850 "getservbyport()\n"
12871 "putc_unlocked()\n"
12872 "putchar_unlocked()\n"
12883 "strsignal() [POSIX.1-2008 で追加された]\n"
12885 "system() [POSIX.1-2008 で追加された]\n"
12886 "tmpnam() (NULL でない引数を渡された場合)\n"
12889 "wcrtomb() (最後の引数が NULL の場合)\n"
12890 "wcsrtombs() (最後の引数が NULL の場合)\n"
12895 #: build/C/man7/pthreads.7:243
12897 msgid "Async-cancel-safe functions"
12898 msgstr "async-cancel-safe 関数"
12900 #. type: Plain text
12901 #: build/C/man7/pthreads.7:247
12903 "An async-cancel-safe function is one that can be safely called in an "
12904 "application where asynchronous cancelability is enabled (see "
12905 "B<pthread_setcancelstate>(3))."
12907 "async-cancel-safe 関数は、\n"
12908 "非同期キャンセル機能が有効になっているアプリケーションで\n"
12909 "安全に呼び出すことができる関数のことである\n"
12910 "(B<pthread_setcancelstate>(3) を参照)。"
12912 #. type: Plain text
12913 #: build/C/man7/pthreads.7:250
12915 "Only the following functions are required to be async-cancel-safe by "
12916 "POSIX.1-2001 and POSIX.1-2008:"
12918 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
12921 #. type: Plain text
12922 #: build/C/man7/pthreads.7:256
12925 "pthread_cancel()\n"
12926 "pthread_setcancelstate()\n"
12927 "pthread_setcanceltype()\n"
12929 "pthread_cancel()\n"
12930 "pthread_setcancelstate()\n"
12931 "pthread_setcanceltype()\n"
12934 #: build/C/man7/pthreads.7:258
12936 msgid "Cancellation points"
12937 msgstr "取り消しポイント (cancellation points)"
12939 #. type: Plain text
12940 #: build/C/man7/pthreads.7:265
12942 "POSIX.1 specifies that certain functions must, and certain other functions "
12943 "may, be cancellation points. If a thread is cancelable, its cancelability "
12944 "type is deferred, and a cancellation request is pending for the thread, then "
12945 "the thread is canceled when it calls a function that is a cancellation point."
12947 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
12948 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
12949 "で、その取り消し種別 (cancelability type) が延期 (deferred) で、そのスレッド"
12950 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
12951 "時点で、そのスレッドのキャンセルが 行われる。"
12953 #. type: Plain text
12954 #: build/C/man7/pthreads.7:268
12956 "The following functions are required to be cancellation points by "
12957 "POSIX.1-2001 and/or POSIX.1-2008:"
12959 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
12960 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
12962 #. type: Plain text
12963 #: build/C/man7/pthreads.7:331
12968 "clock_nanosleep()\n"
12972 "fcntl() F_SETLKW\n"
12980 "mq_timedreceive()\n"
12987 "openat() [Added in POSIX.1-2008]\n"
12992 "pthread_cond_timedwait()\n"
12993 "pthread_cond_wait()\n"
12995 "pthread_testcancel()\n"
13005 "sem_timedwait()\n"
13010 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
13018 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
13027 "clock_nanosleep()\n"
13031 "fcntl() F_SETLKW\n"
13039 "mq_timedreceive()\n"
13046 "openat() [POSIX.1-2008 で追加された]\n"
13051 "pthread_cond_timedwait()\n"
13052 "pthread_cond_wait()\n"
13054 "pthread_testcancel()\n"
13064 "sem_timedwait()\n"
13069 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
13077 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
13084 #. type: Plain text
13085 #: build/C/man7/pthreads.7:336
13087 "The following functions may be cancellation points according to POSIX.1-2001 "
13088 "and/or POSIX.1-2008:"
13090 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
13091 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
13093 #. type: Plain text
13094 #: build/C/man7/pthreads.7:566
13103 "chmod() [Added in POSIX.1-2008]\n"
13104 "chown() [Added in POSIX.1-2008]\n"
13118 "dprintf() [Added in POSIX.1-2008]\n"
13126 "faccessat() [Added in POSIX.1-2008]\n"
13127 "fchmod() [Added in POSIX.1-2008]\n"
13128 "fchmodat() [Added in POSIX.1-2008]\n"
13129 "fchown() [Added in POSIX.1-2008]\n"
13130 "fchownat() [Added in POSIX.1-2008]\n"
13132 "fcntl() (for any value of cmd argument)\n"
13154 "fstatat() [Added in POSIX.1-2008]\n"
13158 "futimens() [Added in POSIX.1-2008]\n"
13164 "getc_unlocked()\n"
13166 "getchar_unlocked()\n"
13169 "getdelim() [Added in POSIX.1-2008]\n"
13175 "gethostbyaddr() [POSIX.1-2001 only (function removed in\n"
13176 " POSIX.1-2008)]\n"
13177 "gethostbyname() [POSIX.1-2001 only (function removed in\n"
13178 " POSIX.1-2008)]\n"
13182 "getline() [Added in POSIX.1-2008]\n"
13189 "getopt() (if opterr is nonzero)\n"
13190 "getprotobyname()\n"
13191 "getprotobynumber()\n"
13199 "getservbyname()\n"
13200 "getservbyport()\n"
13207 "getwd() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
13213 "linkat() [Added in POSIX.1-2008]\n"
13214 "lio_listio() [Added in POSIX.1-2008]\n"
13217 "lockf() [Added in POSIX.1-2008]\n"
13220 "mkdir() [Added in POSIX.1-2008]\n"
13221 "mkdirat() [Added in POSIX.1-2008]\n"
13222 "mkdtemp() [Added in POSIX.1-2008]\n"
13223 "mkfifo() [Added in POSIX.1-2008]\n"
13224 "mkfifoat() [Added in POSIX.1-2008]\n"
13225 "mknod() [Added in POSIX.1-2008]\n"
13226 "mknodat() [Added in POSIX.1-2008]\n"
13236 "posix_fadvise()\n"
13237 "posix_fallocate()\n"
13238 "posix_madvise()\n"
13242 "posix_trace_clear()\n"
13243 "posix_trace_close()\n"
13244 "posix_trace_create()\n"
13245 "posix_trace_create_withlog()\n"
13246 "posix_trace_eventtypelist_getnext_id()\n"
13247 "posix_trace_eventtypelist_rewind()\n"
13248 "posix_trace_flush()\n"
13249 "posix_trace_get_attr()\n"
13250 "posix_trace_get_filter()\n"
13251 "posix_trace_get_status()\n"
13252 "posix_trace_getnext_event()\n"
13253 "posix_trace_open()\n"
13254 "posix_trace_rewind()\n"
13255 "posix_trace_set_filter()\n"
13256 "posix_trace_shutdown()\n"
13257 "posix_trace_timedgetnext_event()\n"
13258 "posix_typed_mem_open()\n"
13260 "psiginfo() [Added in POSIX.1-2008]\n"
13261 "psignal() [Added in POSIX.1-2008]\n"
13262 "pthread_rwlock_rdlock()\n"
13263 "pthread_rwlock_timedrdlock()\n"
13264 "pthread_rwlock_timedwrlock()\n"
13265 "pthread_rwlock_wrlock()\n"
13267 "putc_unlocked()\n"
13269 "putchar_unlocked()\n"
13276 "readlink() [Added in POSIX.1-2008]\n"
13277 "readlinkat() [Added in POSIX.1-2008]\n"
13280 "renameat() [Added in POSIX.1-2008]\n"
13283 "scandir() [Added in POSIX.1-2008]\n"
13294 "sigpause() [Added in POSIX.1-2008]\n"
13300 "symlinkat() [Added in POSIX.1-2008]\n"
13311 "unlinkat() [Added in POSIX.1-2008]\n"
13312 "utime() [Added in POSIX.1-2008]\n"
13313 "utimensat() [Added in POSIX.1-2008]\n"
13314 "utimes() [Added in POSIX.1-2008]\n"
13315 "vdprintf() [Added in POSIX.1-2008]\n"
13331 "chmod() [POSIX.1-2008 で追加された]\n"
13332 "chown() [POSIX.1-2008 で追加された]\n"
13346 "dprintf() [POSIX.1-2008 で追加された]\n"
13354 "faccessat() [POSIX.1-2008 で追加された]\n"
13355 "fchmod() [POSIX.1-2008 で追加された]\n"
13356 "fchmodat() [POSIX.1-2008 で追加された]\n"
13357 "fchown() [POSIX.1-2008 で追加された]\n"
13358 "fchownat() [POSIX.1-2008 で追加された]\n"
13360 "fcntl() (cmd 引数が何であっても)\n"
13382 "fstatat() [POSIX.1-2008 で追加された]\n"
13386 "futimens() [POSIX.1-2008 で追加された]\n"
13392 "getc_unlocked()\n"
13394 "getchar_unlocked()\n"
13397 "getdelim() [POSIX.1-2008 で追加された]\n"
13403 "gethostbyaddr() [POSIX.1-2001 のみ (この関数は\n"
13404 " POSIX.1-2008 で削除されている)]\n"
13405 "gethostbyname() [POSIX.1-2001 のみ (この関数は\n"
13406 " POSIX.1-2008 で削除されている)]\n"
13410 "getline() [POSIX.1-2008 で追加された]\n"
13417 "getopt() (opterr が 0 以外の場合)\n"
13418 "getprotobyname()\n"
13419 "getprotobynumber()\n"
13427 "getservbyname()\n"
13428 "getservbyport()\n"
13435 "getwd() [POSIX.1-2001 のみ (この関数は\n"
13436 " POSIX.1-2008 で削除されている)]\n"
13442 "linkat() [POSIX.1-2008 で追加された]\n"
13443 "lio_listio() [POSIX.1-2008 で追加された]\n"
13446 "lockf() [POSIX.1-2008 で追加された]\n"
13449 "mkdir() [POSIX.1-2008 で追加された]\n"
13450 "mkdirat() [POSIX.1-2008 で追加された]\n"
13451 "mkdtemp() [POSIX.1-2008 で追加された]\n"
13452 "mkfifo() [POSIX.1-2008 で追加された]\n"
13453 "mkfifoat() [POSIX.1-2008 で追加された]\n"
13454 "mknod() [POSIX.1-2008 で追加された]\n"
13455 "mknodat() [POSIX.1-2008 で追加された]\n"
13465 "posix_fadvise()\n"
13466 "posix_fallocate()\n"
13467 "posix_madvise()\n"
13471 "posix_trace_clear()\n"
13472 "posix_trace_close()\n"
13473 "posix_trace_create()\n"
13474 "posix_trace_create_withlog()\n"
13475 "posix_trace_eventtypelist_getnext_id()\n"
13476 "posix_trace_eventtypelist_rewind()\n"
13477 "posix_trace_flush()\n"
13478 "posix_trace_get_attr()\n"
13479 "posix_trace_get_filter()\n"
13480 "posix_trace_get_status()\n"
13481 "posix_trace_getnext_event()\n"
13482 "posix_trace_open()\n"
13483 "posix_trace_rewind()\n"
13484 "posix_trace_set_filter()\n"
13485 "posix_trace_shutdown()\n"
13486 "posix_trace_timedgetnext_event()\n"
13487 "posix_typed_mem_open()\n"
13489 "psiginfo() [POSIX.1-2008 で追加された]\n"
13490 "psignal() [POSIX.1-2008 で追加された]\n"
13491 "pthread_rwlock_rdlock()\n"
13492 "pthread_rwlock_timedrdlock()\n"
13493 "pthread_rwlock_timedwrlock()\n"
13494 "pthread_rwlock_wrlock()\n"
13496 "putc_unlocked()\n"
13498 "putchar_unlocked()\n"
13505 "readlink() [POSIX.1-2008 で追加された]\n"
13506 "readlinkat() [POSIX.1-2008 で追加された]\n"
13509 "renameat() [POSIX.1-2008 で追加された]\n"
13512 "scandir() [POSIX.1-2008 で追加された]\n"
13523 "sigpause() [POSIX.1-2008 で追加された]\n"
13529 "symlinkat() [POSIX.1-2008 で追加された]\n"
13540 "unlinkat() [POSIX.1-2008 で追加された]\n"
13541 "utime() [POSIX.1-2008 で追加された]\n"
13542 "utimensat() [POSIX.1-2008 で追加された]\n"
13543 "utimes() [POSIX.1-2008 で追加された]\n"
13544 "vdprintf() [POSIX.1-2008 で追加された]\n"
13554 #. type: Plain text
13555 #: build/C/man7/pthreads.7:574
13557 "An implementation may also mark other functions not specified in the "
13558 "standard as cancellation points. In particular, an implementation is likely "
13559 "to mark any nonstandard function that may block as a cancellation point. "
13560 "(This includes most functions that can touch files.)"
13562 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
13563 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
13564 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
13567 #. So, scanning "cancellation point" comments in the glibc 2.8 header
13568 #. files, it looks as though at least the following nonstandard
13569 #. functions are cancellation points:
13600 #. gethostbyname2_r
13608 #. getprotobyname_r
13609 #. getprotobynumber_r
13624 #. getwchar_unlocked
13631 #. pthread_timedjoin_np
13637 #. putwchar_unlocked
13657 #. type: Plain text
13658 #: build/C/man7/pthreads.7:674
13660 "It should be noted that even if an application is not using asynchronous "
13661 "cancellation, that calling a function from the above list from an "
13662 "asynchronous signal handler may cause the equivalent of asynchronous "
13663 "cancellation. The underlying user code may not expect asynchronous "
13664 "cancellation and the state of the user data may become inconsistent. "
13665 "Therefore signals should be used with caution when entering a region of "
13666 "deferred cancellation."
13670 #: build/C/man7/pthreads.7:674
13672 msgid "Compiling on Linux"
13673 msgstr "Linux でのコンパイル"
13675 #. type: Plain text
13676 #: build/C/man7/pthreads.7:677
13678 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
13681 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
13685 #: build/C/man7/pthreads.7:677
13687 msgid "Linux implementations of POSIX threads"
13688 msgstr "POSIX スレッドの Linux での実装"
13690 #. type: Plain text
13691 #: build/C/man7/pthreads.7:680
13693 "Over time, two threading implementations have been provided by the GNU C "
13694 "library on Linux:"
13696 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
13700 #: build/C/man7/pthreads.7:680
13702 msgid "B<LinuxThreads>"
13703 msgstr "B<LinuxThreads>"
13705 #. type: Plain text
13706 #: build/C/man7/pthreads.7:684
13708 "This is the original Pthreads implementation. Since glibc 2.4, this "
13709 "implementation is no longer supported."
13711 "最初の Pthreads の実装。\n"
13712 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
13715 #: build/C/man7/pthreads.7:684
13717 msgid "B<NPTL> (Native POSIX Threads Library)"
13718 msgstr "B<NPTL> (Native POSIX Threads Library)"
13720 #. type: Plain text
13721 #: build/C/man7/pthreads.7:692
13723 "This is the modern Pthreads implementation. By comparison with "
13724 "LinuxThreads, NPTL provides closer conformance to the requirements of the "
13725 "POSIX.1 specification and better performance when creating large numbers of "
13726 "threads. NPTL is available since glibc 2.3.2, and requires features that "
13727 "are present in the Linux 2.6 kernel."
13729 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
13730 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
13731 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
13734 #. type: Plain text
13735 #: build/C/man7/pthreads.7:702
13737 "Both of these are so-called 1:1 implementations, meaning that each thread "
13738 "maps to a kernel scheduling entity. Both threading implementations employ "
13739 "the Linux B<clone>(2) system call. In NPTL, thread synchronization "
13740 "primitives (mutexes, thread joining, and so on) are implemented using the "
13741 "Linux B<futex>(2) system call."
13743 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
13744 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
13745 "B<clone>(2) システムコールを利用している。 NPTL では、スレッド同期の基本機"
13746 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2) システムコールを"
13750 #: build/C/man7/pthreads.7:702
13752 msgid "LinuxThreads"
13753 msgstr "LinuxThreads"
13755 #. type: Plain text
13756 #: build/C/man7/pthreads.7:704
13757 msgid "The notable features of this implementation are the following:"
13758 msgstr "この実装の大きな特徴は以下の通りである:"
13760 #. type: Plain text
13761 #: build/C/man7/pthreads.7:711
13763 "In addition to the main (initial) thread, and the threads that the program "
13764 "creates using B<pthread_create>(3), the implementation creates a \"manager\" "
13765 "thread. This thread handles thread creation and termination. (Problems can "
13766 "result if this thread is inadvertently killed.)"
13768 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3) を使って"
13769 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
13770 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
13771 "kill されると、問題が起こることがある)。"
13773 #. type: Plain text
13774 #: build/C/man7/pthreads.7:723
13776 "Signals are used internally by the implementation. On Linux 2.2 and later, "
13777 "the first three real-time signals are used (see also B<signal>(7)). On "
13778 "older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used. Applications must "
13779 "avoid the use of whichever set of signals is employed by the implementation."
13781 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
13782 "グナルのうち最初の 3つが使われる (B<signal>(7) 参照)。 それ以前のカーネルで"
13783 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
13784 "用されているシグナルを どれも使わないようにしなければならない。"
13786 #. type: Plain text
13787 #: build/C/man7/pthreads.7:730
13789 "Threads do not share process IDs. (In effect, LinuxThreads threads are "
13790 "implemented as processes which share more information than usual, but which "
13791 "do not share a common process ID.) LinuxThreads threads (including the "
13792 "manager thread) are visible as separate processes using B<ps>(1)."
13794 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
13795 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
13796 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1) "
13797 "を使うと別のプロセスのように見える。"
13799 #. type: Plain text
13800 #: build/C/man7/pthreads.7:733
13802 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
13803 "number of ways, including the following:"
13805 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
13808 #. type: Plain text
13809 #: build/C/man7/pthreads.7:737
13810 msgid "Calls to B<getpid>(2) return a different value in each thread."
13811 msgstr "B<getpid>(2) を呼び出したときに、スレッド毎に異なる値が返される。"
13813 #. type: Plain text
13814 #: build/C/man7/pthreads.7:746
13816 "Calls to B<getppid>(2) in threads other than the main thread return the "
13817 "process ID of the manager thread; instead B<getppid>(2) in these threads "
13818 "should return the same value as B<getppid>(2) in the main thread."
13820 "メインスレッド以外のスレッドで B<getppid>(2) を呼び出すと、管理スレッドのプ"
13821 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2) を呼んだ場合"
13822 "にはメインスレッドでの B<getppid>(2) と同じ値が返るべきである。"
13824 #. type: Plain text
13825 #: build/C/man7/pthreads.7:756
13827 "When one thread creates a new child process using B<fork>(2), any thread "
13828 "should be able to B<wait>(2) on the child. However, the implementation "
13829 "allows only the thread that created the child to B<wait>(2) on it."
13831 "あるスレッドが B<fork>(2) を使って新しい子プロセスを作成した場合、 どのス"
13832 "レッドでもこの子プロセスを B<wait>(2) できるべきである。しかしながら、この実"
13833 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2) でき"
13836 #. type: Plain text
13837 #: build/C/man7/pthreads.7:763
13839 "When a thread calls B<execve>(2), all other threads are terminated (as "
13840 "required by POSIX.1). However, the resulting process has the same PID as "
13841 "the thread that called B<execve>(2): it should have the same PID as the main "
13844 "あるスレッドが B<execve>(2) を呼び出した場合、他のスレッドは全て終了される "
13845 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2) を呼んだ"
13846 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
13849 #. type: Plain text
13850 #: build/C/man7/pthreads.7:770
13852 "Threads do not share user and group IDs. This can cause complications with "
13853 "set-user-ID programs and can cause failures in Pthreads functions if an "
13854 "application changes its credentials using B<seteuid>(2) or similar."
13856 "スレッド間でユーザー ID とグループ ID が共有されない このことは、set-user-ID "
13857 "プログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2) などを"
13858 "使って信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因とな"
13861 #. type: Plain text
13862 #: build/C/man7/pthreads.7:772
13863 msgid "Threads do not share a common session ID and process group ID."
13864 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
13866 #. type: Plain text
13867 #: build/C/man7/pthreads.7:775
13868 msgid "Threads do not share record locks created using B<fcntl>(2)."
13870 "スレッド間で B<fcntl>(2) を使って作成されるレコードロックを共有しない。"
13872 #. type: Plain text
13873 #: build/C/man7/pthreads.7:781
13875 "The information returned by B<times>(2) and B<getrusage>(2) is per-thread "
13876 "rather than process-wide."
13878 "B<times>(2) と B<getrusage>(2) が返す情報がプロセス全体の情報でなくスレッド"
13881 #. type: Plain text
13882 #: build/C/man7/pthreads.7:784
13883 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
13884 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2) 参照) を共有しない。"
13886 #. type: Plain text
13887 #: build/C/man7/pthreads.7:786
13888 msgid "Threads do not share interval timers."
13889 msgstr "スレッド間でインターバルタイマーを共有しない。"
13891 #. FIXME . bug report filed for NPTL nice nonconformance
13892 #. http://bugzilla.kernel.org/show_bug.cgi?id=6258
13893 #. Sep 08: there is a patch by Denys Vlasenko to address this
13894 #. "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
13895 #. Monitor this to see if it makes it into mainline.
13896 #. type: Plain text
13897 #: build/C/man7/pthreads.7:788 build/C/man7/pthreads.7:827
13898 msgid "Threads do not share a common nice value."
13899 msgstr "スレッドは共通の nice 値を共有しない。"
13901 #. type: Plain text
13902 #: build/C/man7/pthreads.7:798
13904 "POSIX.1 distinguishes the notions of signals that are directed to the "
13905 "process as a whole and signals that are directed to individual threads. "
13906 "According to POSIX.1, a process-directed signal (sent using B<kill>(2), for "
13907 "example) should be handled by a single, arbitrarily selected thread within "
13908 "the process. LinuxThreads does not support the notion of process-directed "
13909 "signals: signals may be sent only to specific threads."
13911 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
13912 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
13913 "ル (例えば B<kill>(2) を使って送る) は、そのプロセスに属すスレッドのうち 勝"
13914 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
13915 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
13916 "ルは特定のスレッドにだけ送ることができる。"
13918 #. type: Plain text
13919 #: build/C/man7/pthreads.7:807
13921 "Threads have distinct alternate signal stack settings. However, a new "
13922 "thread's alternate signal stack settings are copied from the thread that "
13923 "created it, so that the threads initially share an alternate signal stack. "
13924 "(A new thread should start with no alternate signal stack defined. If two "
13925 "threads handle signals on their shared alternate signal stack at the same "
13926 "time, unpredictable program failures are likely to occur.)"
13928 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
13929 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
13930 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
13931 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
13932 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
13933 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
13936 #: build/C/man7/pthreads.7:807 build/C/man7/nptl.7:26
13941 #. type: Plain text
13942 #: build/C/man7/pthreads.7:812
13944 "With NPTL, all of the threads in a process are placed in the same thread "
13945 "group; all members of a thread group share the same PID. NPTL does not "
13946 "employ a manager thread."
13947 msgstr "NPTL では、一つのプロセスの全てのスレッドは同じスレッドグループ に属する; スレッドグループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド (manager thread) を利用しない。"
13949 #. type: Plain text
13950 #: build/C/man7/pthreads.7:818
13952 "NPTL makes internal use of the first two real-time signals; these signals "
13953 "cannot be used in applications. See B<nptl>(7) for further details."
13954 msgstr " NPTL は内部でリアルタイムシグナルのうち最初の 2つの番号を使用しており、これらのシグナルはアプリケーションでは使用できない。詳細は B<nptl>(7) を参照のこと。"
13956 #. type: Plain text
13957 #: build/C/man7/pthreads.7:820
13958 msgid "NPTL still has at least one nonconformance with POSIX.1:"
13959 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
13961 #. type: Plain text
13962 #: build/C/man7/pthreads.7:829
13963 msgid "Some NPTL nonconformances occur only with older kernels:"
13964 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
13966 #. type: Plain text
13967 #: build/C/man7/pthreads.7:835
13969 "The information returned by B<times>(2) and B<getrusage>(2) is per-thread "
13970 "rather than process-wide (fixed in kernel 2.6.9)."
13972 "B<times>(2) と B<getrusage>(2) が返す情報がプロセス全体の情報でなくスレッド"
13973 "単位の情報である (カーネル 2.6.9 で修正された)。"
13975 #. type: Plain text
13976 #: build/C/man7/pthreads.7:837
13977 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
13978 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
13980 #. type: Plain text
13981 #: build/C/man7/pthreads.7:839
13982 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
13984 "スレッド間でインターバルタイマーを共有しない (カーネル 2.6.12 で修正された)。"
13986 #. type: Plain text
13987 #: build/C/man7/pthreads.7:843
13989 "Only the main thread is permitted to start a new session using B<setsid>(2) "
13990 "(fixed in kernel 2.6.16)."
13992 "メインスレッドだけが B<setsid>(2) を使って新しいセッションを開始することがで"
13993 "きる (カーネル 2.6.16 で修正された)。"
13995 #. type: Plain text
13996 #: build/C/man7/pthreads.7:848
13998 "Only the main thread is permitted to make the process into a process group "
13999 "leader using B<setpgid>(2) (fixed in kernel 2.6.16)."
14001 "メインスレッドだけが B<setpgid>(2) を使ってそのプロセスをプロセスグループ"
14002 "リーダーにすることができる (カーネル 2.6.16 で修正された)。"
14004 #. type: Plain text
14005 #: build/C/man7/pthreads.7:854
14007 "Threads have distinct alternate signal stack settings. However, a new "
14008 "thread's alternate signal stack settings are copied from the thread that "
14009 "created it, so that the threads initially share an alternate signal stack "
14010 "(fixed in kernel 2.6.16)."
14012 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
14013 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
14014 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
14015 "ル 2.6.16 で修正された)。"
14017 #. type: Plain text
14018 #: build/C/man7/pthreads.7:856
14019 msgid "Note the following further points about the NPTL implementation:"
14020 msgstr "NPTL の実装では以下の点についても注意すること:"
14022 #. type: Plain text
14023 #: build/C/man7/pthreads.7:870
14025 "If the stack size soft resource limit (see the description of "
14026 "B<RLIMIT_STACK> in B<setrlimit>(2)) is set to a value other than "
14027 "I<unlimited>, then this value defines the default stack size for new "
14028 "threads. To be effective, this limit must be set before the program is "
14029 "executed, perhaps using the I<ulimit -s> shell built-in command (I<limit "
14030 "stacksize> in the C shell)."
14032 "スタックサイズのリソースのソフトリミット (B<setrlimit>(2) の "
14033 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
14034 "ソフトリミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設定"
14035 "を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけれ"
14036 "ばならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
14037 "は I<limit stacksize>) を使って設定する。"
14040 #: build/C/man7/pthreads.7:870
14042 msgid "Determining the threading implementation"
14045 #. type: Plain text
14046 #: build/C/man7/pthreads.7:875
14048 "Since glibc 2.3.2, the B<getconf>(1) command can be used to determine the "
14049 "system's threading implementation, for example:"
14051 "glibc 2.3.2 以降では、 B<getconf>(1) コマンドを使って、 システムのスレッド実"
14052 "装を判定することができる。 以下に例を示す:"
14054 #. type: Plain text
14055 #: build/C/man7/pthreads.7:880
14058 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
14061 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
14064 #. type: Plain text
14065 #: build/C/man7/pthreads.7:885
14067 "With older glibc versions, a command such as the following should be "
14068 "sufficient to determine the default threading implementation:"
14070 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
14073 #. type: Plain text
14074 #: build/C/man7/pthreads.7:891
14077 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
14078 " egrep -i \\(aqthreads|nptl\\(aq\n"
14079 " Native POSIX Threads Library by Ulrich Drepper et al\n"
14081 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
14082 " egrep -i \\(aqthreads|ntpl\\(aq\n"
14083 " Native POSIX Threads Library by Ulrich Drepper et al\n"
14086 #: build/C/man7/pthreads.7:893
14088 msgid "Selecting the threading implementation: LD_ASSUME_KERNEL"
14089 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
14091 #. type: Plain text
14092 #: build/C/man7/pthreads.7:908
14094 "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., "
14095 "glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to "
14096 "override the dynamic linker's default choice of threading implementation. "
14097 "This variable tells the dynamic linker to assume that it is running on top "
14098 "of a particular kernel version. By specifying a kernel version that does "
14099 "not provide the support required by NPTL, we can force the use of "
14100 "LinuxThreads. (The most likely reason for doing this is to run a (broken) "
14101 "application that depends on some nonconformant behavior in LinuxThreads.) "
14104 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
14105 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカーがデフォル"
14106 "トで 選択するスレッド実装を上書きすることができる。 この変数により、動的リン"
14107 "カーが特定のバージョンのカーネル上で 動作していると仮定するように指定する。 "
14108 "NPTL が必要とするサポート機能を提供していないカーネルバージョンを 指定するこ"
14109 "とで、強制的に LinuxThreads を使うことができる (このようなことをする最もあり"
14110 "そうな場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリ"
14111 "ケーション を動作させる場合だろう)。 以下に例を示す:"
14113 #. type: Plain text
14114 #: build/C/man7/pthreads.7:914
14117 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
14118 " awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|nptl\\(aq\n"
14119 " linuxthreads-0.10 by Xavier Leroy\n"
14121 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
14122 " awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|nptl\\(aq\n"
14123 " linuxthreads-0.10 by Xavier Leroy\n"
14125 #. type: Plain text
14126 #: build/C/man7/pthreads.7:929
14128 "B<clone>(2), B<fork>(2), B<futex>(2), B<gettid>(2), B<proc>(5), "
14129 "B<attributes>(7), B<futex>(7), B<nptl>(7), B<sigevent>(7), B<signal>(7)"
14130 msgstr "B<clone>(2), B<fork>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<attributes>(7), B<futex>(7), B<nptl>(7), B<sigevent>(7), B<signal>(7)"
14132 #. type: Plain text
14133 #: build/C/man7/pthreads.7:958
14135 "Various Pthreads manual pages, for example: B<pthread_atfork>(3), "
14136 "B<pthread_attr_init>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
14137 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), "
14138 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), "
14139 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), "
14140 "B<pthread_mutex_unlock>(3), B<pthread_mutexattr_destroy>(3), "
14141 "B<pthread_mutexattr_init>(3), B<pthread_once>(3), B<pthread_spin_init>(3), "
14142 "B<pthread_spin_lock>(3), B<pthread_rwlockattr_setkind_np>(3), "
14143 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), "
14144 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3), "
14145 "and B<pthread_testcancel>(3)"
14146 msgstr "pthreads の各種マニュアルページ、例えば: B<pthread_atfork>(3), B<pthread_attr_init>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3), B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3), B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3), B<pthread_mutex_unlock>(3), B<pthread_mutexattr_destroy>(3), B<pthread_mutexattr_init>(3), B<pthread_once>(3), B<pthread_spin_init>(3), B<pthread_spin_lock>(3), B<pthread_rwlockattr_setkind_np>(3), B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3), and B<pthread_testcancel>(3)"
14148 #. type: Plain text
14149 #: build/C/man7/attributes.7:27
14150 msgid "attributes - POSIX safety concepts"
14153 #. type: Plain text
14154 #: build/C/man7/attributes.7:35
14156 "I<Note>: the text of this man page is based on the material taken from the "
14157 "\"POSIX Safety Concepts\" section of the GNU C Library manual. Further "
14158 "details on the topics described here can be found in that manual."
14161 #. type: Plain text
14162 #: build/C/man7/attributes.7:39
14164 "Various function manual pages include a section ATTRIBUTES that describes "
14165 "the safety of calling the function in various contexts. This section "
14166 "annotates functions with the following safety markings:"
14170 #: build/C/man7/attributes.7:39
14173 msgstr "I<MT-Safe>"
14175 #. type: Plain text
14176 #: build/C/man7/attributes.7:46
14178 "I<MT-Safe> or Thread-Safe functions are safe to call in the presence of "
14179 "other threads. MT, in MT-Safe, stands for Multi Thread."
14182 #. type: Plain text
14183 #: build/C/man7/attributes.7:55
14185 "Being MT-Safe does not imply a function is atomic, nor that it uses any of "
14186 "the memory synchronization mechanisms POSIX exposes to users. It is even "
14187 "possible that calling MT-Safe functions in sequence does not yield an MT-"
14188 "Safe combination. For example, having a thread call two MT-Safe functions "
14189 "one right after the other does not guarantee behavior equivalent to atomic "
14190 "execution of a combination of both functions, since concurrent calls in "
14191 "other threads may interfere in a destructive way."
14200 #. or Async-Signal-Safe functions are safe to call from
14201 #. asynchronous signal handlers.
14202 #. AS, in AS-Safe, stands for Asynchronous Signal.
14203 #. Many functions that are AS-Safe may set
14205 #. or modify the floating-point environment,
14206 #. because their doing so does not make them
14207 #. unsuitable for use in signal handlers.
14208 #. However, programs could misbehave should asynchronous signal handlers
14209 #. modify this thread-local state,
14210 #. and the signal handling machinery cannot be counted on to
14212 #. Therefore, signal handlers that call functions that may set
14214 #. or modify the floating-point environment
14216 #. save their original values, and restore them before returning.
14220 #. or Async-Cancel-Safe functions are safe to call when
14221 #. asynchronous cancellation is enabled.
14222 #. AC in AC-Safe stands for Asynchronous Cancellation.
14223 #. The POSIX standard defines only three functions to be AC-Safe, namely
14224 #. .BR pthread_cancel (3),
14225 #. .BR pthread_setcancelstate (3),
14227 #. .BR pthread_setcanceltype (3).
14228 #. At present the GNU C Library provides no
14229 #. guarantees beyond these three functions,
14230 #. but does document which functions are presently AC-Safe.
14231 #. This documentation is provided for use
14232 #. by the GNU C Library developers.
14233 #. Just like signal handlers, cancellation cleanup routines must configure
14234 #. the floating point environment they require.
14235 #. The routines cannot assume a floating point environment,
14236 #. particularly when asynchronous cancellation is enabled.
14237 #. If the configuration of the floating point
14238 #. environment cannot be performed atomically then it is also possible that
14239 #. the environment encountered is internally inconsistent.
14240 #. type: Plain text
14241 #: build/C/man7/attributes.7:109
14243 "Whole-program optimizations that could inline functions across library "
14244 "interfaces may expose unsafe reordering, and so performing inlining across "
14245 "the GNU C Library interface is not recommended. The documented MT-Safety "
14246 "status is not guaranteed under whole-program optimization. However, "
14247 "functions defined in user-visible headers are designed to be safe for "
14251 #. ", " AS-Unsafe ", " AC-Unsafe
14253 #: build/C/man7/attributes.7:109
14255 msgid "I<MT-Unsafe>"
14256 msgstr "I<MT-Unsafe>"
14264 #. ", " AS-Unsafe ", " AC-Unsafe
14265 #. functions are not
14266 #. safe to call within the safety contexts described above.
14268 #. within such contexts invokes undefined behavior.
14269 #. Functions not explicitly documented as safe in a safety context should
14270 #. be regarded as Unsafe.
14274 #. safety properties are documented, indicating these
14277 #. be counted on in future releases of
14278 #. the GNU C Library.
14279 #. Such preliminary properties are the result of an assessment of the
14280 #. properties of our current implementation,
14281 #. rather than of what is mandated and permitted
14282 #. by current and future standards.
14283 #. Although we strive to abide by the standards, in some cases our
14284 #. implementation is safe even when the standard does not demand safety,
14285 #. and in other cases our implementation does not meet the standard safety
14287 #. The latter are most likely bugs; the former, when marked
14289 #. .IR Preliminary ,
14290 #. should not be counted on: future standards may
14291 #. require changes that are not compatible with the additional safety
14292 #. properties afforded by the current implementation.
14294 #. the POSIX standard does not offer a detailed definition of safety.
14295 #. We assume that, by "safe to call", POSIX means that,
14296 #. as long as the program does not invoke undefined behavior,
14297 #. the "safe to call" function behaves as specified,
14298 #. and does not cause other functions to deviate from their specified behavior.
14299 #. We have chosen to use its loose
14300 #. definitions of safety, not because they are the best definitions to use,
14301 #. but because choosing them harmonizes this manual with POSIX.
14302 #. Please keep in mind that these are preliminary definitions and annotations,
14303 #. and certain aspects of the definitions are still under
14304 #. discussion and might be subject to clarification or change.
14306 #. we envision evolving the preliminary safety notes into stable commitments,
14307 #. as stable as those of our interfaces.
14308 #. As we do, we will remove the
14310 #. keyword from safety notes.
14311 #. As long as the keyword remains, however,
14312 #. they are not to be regarded as a promise of future behavior.
14313 #. type: Plain text
14314 #: build/C/man7/attributes.7:167
14316 "I<MT-Unsafe> functions are not safe to call in a multithreaded programs."
14330 #. .SS Unsafe features
14331 #. Functions that are unsafe to call in certain contexts are annotated with
14332 #. keywords that document their features that make them unsafe to call.
14333 #. AS-Unsafe features in this section indicate the functions are never safe
14334 #. to call when asynchronous signals are enabled.
14335 #. AC-Unsafe features
14336 #. indicate they are never safe to call when asynchronous cancellation is
14338 #. There are no MT-Unsafe marks in this section.
14341 #. Functions marked with
14343 #. as an AS-Unsafe feature may be
14344 #. .\" interrupted by a signal while holding a non-recursive lock.
14345 #. If the signal handler calls another such function that takes the same lock,
14346 #. the result is a deadlock.
14347 #. Functions annotated with
14349 #. as an AC-Unsafe feature may, if canceled asynchronously,
14350 #. fail to release a lock that would have been released if their execution
14351 #. had not been interrupted by asynchronous thread cancellation.
14352 #. Once a lock is left taken,
14353 #. attempts to take that lock will block indefinitely.
14356 #. Functions marked with
14358 #. as an AS-Unsafe feature may corrupt
14359 #. data structures and misbehave when they interrupt,
14360 #. or are interrupted by, another such function.
14361 #. Unlike functions marked with
14363 #. these take recursive locks to avoid MT-Safety problems,
14364 #. but this is not enough to stop a signal handler from observing
14365 #. a partially-updated data structure.
14366 #. Further corruption may arise from the interrupted function's
14367 #. failure to notice updates made by signal handlers.
14368 #. Functions marked with
14370 #. as an AC-Unsafe feature may leave
14371 #. data structures in a corrupt, partially updated state.
14372 #. Subsequent uses of the data structure may misbehave.
14373 #. .\" A special case, probably not worth documenting separately, involves
14374 #. .\" reallocing, or even freeing pointers. Any case involving free could
14375 #. .\" be easily turned into an ac-safe leak by resetting the pointer before
14376 #. .\" releasing it; I don't think we have any case that calls for this sort
14377 #. .\" of fixing. Fixing the realloc cases would require a new interface:
14378 #. .\" instead of @code{ptr=realloc(ptr,size)} we'd have to introduce
14379 #. .\" @code{acsafe_realloc(&ptr,size)} that would modify ptr before
14380 #. .\" releasing the old memory. The ac-unsafe realloc could be implemented
14381 #. .\" in terms of an internal interface with this semantics (say
14382 #. .\" __acsafe_realloc), but since realloc can be overridden, the function
14383 #. .\" we call to implement realloc should not be this internal interface,
14384 #. .\" but another internal interface that calls __acsafe_realloc if realloc
14385 #. .\" was not overridden, and calls the overridden realloc with async
14386 #. .\" cancel disabled. --lxoliva
14389 #. Functions marked with
14391 #. may call heap memory management functions from the
14392 #. .BR malloc (3)/ free (3)
14393 #. family of functions and are only as safe as those functions.
14394 #. This note is thus equivalent to:
14395 #. | AS-Unsafe lock | AC-Unsafe lock fd mem |
14396 #. .\" @sampsafety{@asunsafe{@asulock{}}@acunsafe{@aculock{} @acsfd{} @acsmem{}}}
14398 #. .\" Check for cases that should have used plugin instead of or in
14399 #. .\" addition to this. Then, after rechecking gettext, adjust i18n if
14403 #. Functions marked with
14405 #. use the dynamic loader to load
14406 #. shared libraries into the current execution image.
14407 #. This involves opening files, mapping them into memory,
14408 #. allocating additional memory, resolving symbols,
14409 #. applying relocations and more,
14410 #. all of this while holding internal dynamic loader locks.
14411 #. The locks are enough for these functions to be AS-Unsafe and AC-Unsafe,
14412 #. but other issues may arise.
14413 #. At present this is a placeholder for all
14414 #. potential safety issues raised by
14416 #. .\" dlopen runs init and fini sections of the module; does this mean
14417 #. .\" dlopen always implies plugin?
14420 #. Functions annotated with
14422 #. may run code from plugins that
14423 #. may be external to the GNU C Library.
14424 #. Such plugin functions are assumed to be
14425 #. MT-Safe, AS-Unsafe and AC-Unsafe.
14426 #. Examples of such plugins are stack unwinding libraries,
14427 #. name service switch (NSS) and character set conversion (iconv) back-ends.
14428 #. Although the plugins mentioned as examples are all brought in by means
14431 #. keyword does not imply any direct
14432 #. involvement of the dynamic loader or the
14435 #. those are covered by
14437 #. For example, if one function loads a module and finds the addresses
14438 #. of some of its functions,
14439 #. while another just calls those already-resolved functions,
14440 #. the former will be marked with
14442 #. whereas the latter will get the
14444 #. When a single function takes all of these actions, then it gets both marks.
14447 #. Functions marked with
14449 #. may call internationalization
14450 #. functions of the
14452 #. family and will be only as safe as those
14454 #. This note is thus equivalent to:
14455 #. | MT-Safe env | AS-Unsafe corrupt heap dlopen | AC-Unsafe corrupt |
14456 #. .\" @sampsafety{@mtsafe{@mtsenv{}}@asunsafe{@asucorrupt{} @ascuheap{} @ascudlopen{}}@acunsafe{@acucorrupt{}}}
14459 #. Functions marked with
14464 #. similar to set a time-out for a system call or a long-running operation.
14465 #. In a multi-threaded program, there is a risk that the time-out signal
14466 #. will be delivered to a different thread,
14467 #. thus failing to interrupt the intended thread.
14468 #. Besides being MT-Unsafe, such functions are always
14469 #. AS-Unsafe, because calling them in signal handlers may interfere with
14470 #. timers set in the interrupted code, and AC-Unsafe,
14471 #. because there is no safe way to guarantee an earlier timer
14472 #. will be reset in case of asynchronous cancellation.
14473 #. type: Plain text
14474 #: build/C/man7/attributes.7:325
14476 "Other keywords that appear in safety notes are defined in subsequent "
14481 #: build/C/man7/attributes.7:325
14483 msgid "Conditionally safe features"
14486 #. type: Plain text
14487 #: build/C/man7/attributes.7:337
14489 "For some features that make functions unsafe to call in certain contexts, "
14490 "there are known ways to avoid the safety problem other than refraining from "
14491 "calling the function altogether. The keywords that follow refer to such "
14492 "features, and each of their definitions indicates how the whole program "
14493 "needs to be constrained in order to remove the safety problem indicated by "
14494 "the keyword. Only when all the reasons that make a function unsafe are "
14495 "observed and addressed, by applying the documented constraints, does the "
14496 "function become safe to call in a context."
14500 #: build/C/man7/attributes.7:337
14505 #. type: Plain text
14506 #: build/C/man7/attributes.7:343
14508 "Functions marked with I<init> as an MT-Unsafe feature perform MT-Unsafe "
14509 "initialization when they are first called."
14517 #. Functions marked with
14519 #. as an AS-Unsafe or AC-Unsafe feature use the GNU C Library internal
14521 #. machinery or similar to initialize internal data structures.
14522 #. If a signal handler interrupts such an initializer,
14523 #. and calls any function that also performs
14525 #. initialization, it will deadlock if the thread library has been loaded.
14526 #. Furthermore, if an initializer is partially complete before it is canceled
14527 #. or interrupted by a signal whose handler requires the same initialization,
14528 #. some or all of the initialization may be performed more than once,
14529 #. leaking resources or even resulting in corrupt internal data.
14530 #. Applications that need to call functions marked with
14532 #. as an AS-Safety or AC-Unsafe feature should ensure
14533 #. the initialization is performed
14534 #. before configuring signal handlers or enabling cancellation,
14535 #. so that the AS-Safety and AC-Safety issues related with
14538 #. .\" We may have to extend the annotations to cover conditions in which
14539 #. .\" initialization may or may not occur, since an initial call in a safe
14540 #. .\" context is no use if the initialization doesn't take place at that
14541 #. .\" time: it doesn't remove the risk for later calls.
14542 #. type: Plain text
14543 #: build/C/man7/attributes.7:378
14545 "Calling such a function at least once in single-threaded mode removes this "
14546 "specific cause for the function to be regarded as MT-Unsafe. If no other "
14547 "cause for that remains, the function can then be safely called after other "
14548 "threads are started."
14552 #: build/C/man7/attributes.7:378
14564 #. We consider access to objects passed as (indirect) arguments to
14565 #. functions to be data race free.
14566 #. The assurance of data race free objects
14567 #. is the caller's responsibility.
14568 #. We will not mark a function as MT-Unsafe or AS-Unsafe
14569 #. if it misbehaves when users fail to take the measures required by
14570 #. POSIX to avoid data races when dealing with such objects.
14571 #. As a general rule, if a function is documented as reading from
14572 #. an object passed (by reference) to it, or modifying it,
14573 #. users ought to use memory synchronization primitives
14574 #. to avoid data races just as they would should they perform
14575 #. the accesses themselves rather than by calling the library function.
14577 #. .RI ( "FILE *" )
14578 #. streams are the exception to the general rule,
14579 #. in that POSIX mandates the library to guard against data races
14580 #. in many functions that manipulate objects of this specific opaque type.
14581 #. We regard this as a convenience provided to users,
14582 #. rather than as a general requirement whose expectations
14583 #. should extend to other types.
14584 #. In order to remind users that guarding certain arguments is their
14585 #. responsibility, we will annotate functions that take objects of certain
14586 #. types as arguments.
14587 #. We draw the line for objects passed by users as follows:
14588 #. objects whose types are exposed to users,
14589 #. and that users are expected to access directly,
14590 #. such as memory buffers, strings,
14591 #. and various user-visible structured types, do
14593 #. give reason for functions to be annotated with
14595 #. It would be noisy and redundant with the general requirement,
14596 #. and not many would be surprised by the library's lack of internal
14597 #. guards when accessing objects that can be accessed directly by users.
14598 #. As for objects that are opaque or opaque-like,
14599 #. in that they are to be manipulated only by passing them
14600 #. to library functions (e.g.,
14605 #. there might be additional expectations as to internal coordination
14606 #. of access by the library.
14607 #. We will annotate, with
14609 #. followed by a colon and the argument name,
14610 #. functions that take such objects but that do not take
14611 #. care of synchronizing access to them by default.
14617 #. .RB ( unlocked_stdio (3))
14618 #. will be annotated,
14619 #. but those that perform implicit locking on
14621 #. streams by default will not,
14622 #. even though the implicit locking may be disabled on a per-stream basis.
14623 #. In either case, we will not regard as MT-Unsafe functions that may
14624 #. access user-supplied objects in unsafe ways should users fail to ensure
14625 #. the accesses are well defined.
14626 #. The notion prevails that users are expected to safeguard against
14627 #. data races any user-supplied objects that the library accesses
14628 #. on their behalf.
14629 #. .\" The above describes @mtsrace; @mtasurace is described below.
14630 #. This user responsibility does not apply, however,
14631 #. to objects controlled by the library itself,
14632 #. such as internal objects and static buffers used
14633 #. to return values from certain calls.
14634 #. When the library doesn't guard them against concurrent uses,
14635 #. these cases are regarded as MT-Unsafe and AS-Unsafe (although the
14637 #. mark under AS-Unsafe will be omitted
14638 #. as redundant with the one under MT-Unsafe).
14639 #. As in the case of user-exposed objects,
14640 #. the mark may be followed by a colon and an identifier.
14641 #. The identifier groups all functions that operate on a
14642 #. certain unguarded object; users may avoid the MT-Safety issues related
14643 #. with unguarded concurrent access to such internal objects by creating a
14644 #. non-recursive mutex related with the identifier,
14645 #. and always holding the mutex when calling any function marked
14646 #. as racy on that identifier,
14647 #. as they would have to should the identifier be
14648 #. an object under user control.
14649 #. The non-recursive mutex avoids the MT-Safety issue,
14650 #. but it trades one AS-Safety issue for another,
14651 #. so use in asynchronous signals remains undefined.
14652 #. When the identifier relates to a static buffer used to hold return values,
14653 #. the mutex must be held for as long as the buffer remains in use
14655 #. Many functions that return pointers to static buffers offer reentrant
14656 #. variants that store return values in caller-supplied buffers instead.
14657 #. In some cases, such as
14658 #. .BR tmpname (3),
14659 #. the variant is chosen not by calling an alternate entry point,
14660 #. but by passing a non-NULL pointer to the buffer in which the
14661 #. returned values are to be stored.
14662 #. These variants are generally preferable in multi-threaded programs,
14663 #. although some of them are not MT-Safe because of other internal buffers,
14664 #. also documented with
14667 #. type: Plain text
14668 #: build/C/man7/attributes.7:499
14670 "Functions annotated with I<race> as an MT-Safety issue operate on objects in "
14671 "ways that may cause data races or similar forms of destructive interference "
14672 "out of concurrent execution. In some cases, the objects are passed to the "
14673 "functions by users; in others, they are used by the functions to return "
14674 "values to users; in others, they are not even exposed to users."
14678 #: build/C/man7/attributes.7:499
14687 #. type: Plain text
14688 #: build/C/man7/attributes.7:520
14690 "Functions marked with I<const> as an MT-Safety issue non-atomically modify "
14691 "internal objects that are better regarded as constant, because a substantial "
14692 "portion of the GNU C Library accesses them without synchronization. Unlike "
14693 "I<race>, which causes both readers and writers of internal objects to be "
14694 "regarded as MT-Unsafe, this mark is applied to writers only. Writers remain "
14695 "MT-Unsafe to call, but the then-mandatory constness of objects they modify "
14696 "enables readers to be regarded as MT-Safe (as long as no other reasons for "
14697 "them to be unsafe remain), since the lack of synchronization is not a "
14698 "problem when the objects are effectively constant."
14702 #. The non-recursive locking removes the MT-Safety problem,
14703 #. but it trades one AS-Safety problem for another,
14704 #. so use in asynchronous signals remains undefined.
14705 #. .\" But what if, instead of marking modifiers with const:id and readers
14706 #. .\" with just id, we marked writers with race:id and readers with ro:id?
14707 #. .\" Instead of having to define each instance of 'id', we'd have a
14708 #. .\" general pattern governing all such 'id's, wherein race:id would
14709 #. .\" suggest the need for an exclusive/write lock to make the function
14710 #. .\" safe, whereas ro:id would indicate 'id' is expected to be read-only,
14711 #. .\" but if any modifiers are called (while holding an exclusive lock),
14712 #. .\" then ro:id-marked functions ought to be guarded with a read lock for
14713 #. .\" safe operation. ro:env or ro:locale, for example, seems to convey
14714 #. .\" more clearly the expectations and the meaning, than just env or
14716 #. type: Plain text
14717 #: build/C/man7/attributes.7:550
14719 "The identifier that follows the I<const> mark will appear by itself as a "
14720 "safety note in readers. Programs that wish to work around this safety "
14721 "issue, so as to call writers, may use a non-recursive read-write lock "
14722 "associated with the identifier, and guard I<all> calls to functions marked "
14723 "with I<const> followed by the identifier with a write lock, and I<all> calls "
14724 "to functions marked with the identifier by itself with a read lock."
14728 #: build/C/man7/attributes.7:550
14733 #. (that implies an identical AS-Safety issue, omitted for brevity)
14734 #. type: Plain text
14735 #: build/C/man7/attributes.7:559
14737 "Functions marked with I<sig> as a MT-Safety issue may temporarily install a "
14738 "signal handler for internal purposes, which may interfere with other uses of "
14739 "the signal, identified after a colon."
14745 #. There is no safe way to guarantee the original signal handler is
14746 #. restored in case of asynchronous cancellation,
14747 #. therefore so-marked functions are also AC-Unsafe.
14748 #. .\" fixme: at least deferred cancellation should get it right, and would
14749 #. .\" obviate the restoring bit below, and the qualifier above.
14750 #. Besides the measures recommended to work around the
14751 #. MT-Safety and AS-Safety problem,
14752 #. in order to avert the cancellation problem,
14753 #. disabling asynchronous cancellation
14755 #. installing a cleanup handler to restore the signal to the desired state
14756 #. and to release the mutex are recommended.
14757 #. type: Plain text
14758 #: build/C/man7/attributes.7:581
14760 "This safety problem can be worked around by ensuring that no other uses of "
14761 "the signal will take place for the duration of the call. Holding a non-"
14762 "recursive mutex while calling all functions that use the same temporary "
14763 "signal; blocking that signal before the call and resetting its handler "
14764 "afterwards is recommended."
14768 #: build/C/man7/attributes.7:581
14773 #. The same window enables changes made by asynchronous signals to be lost.
14774 #. These functions are also AS-Unsafe,
14775 #. but the corresponding mark is omitted as redundant.
14776 #. type: Plain text
14777 #: build/C/man7/attributes.7:597
14779 "Functions marked with I<term> as an MT-Safety issue may change the terminal "
14780 "settings in the recommended way, namely: call B<tcgetattr>(3), modify some "
14781 "flags, and then call B<tcsetattr>(3), this creates a window in which changes "
14782 "made by other threads are lost. Thus, functions marked with I<term> are MT-"
14789 #. Functions marked with
14791 #. as an AC-Safety issue are supposed to
14792 #. restore terminal settings to their original state,
14793 #. after temporarily changing them, but they may fail to do so if canceled.
14794 #. .\" fixme: at least deferred cancellation should get it right, and would
14795 #. .\" obviate the restoring bit below, and the qualifier above.
14796 #. Besides the measures recommended to work around the
14797 #. MT-Safety and AS-Safety problem,
14798 #. in order to avert the cancellation problem,
14799 #. disabling asynchronous cancellation
14801 #. installing a cleanup handler to
14802 #. restore the terminal settings to the original state and to release the
14803 #. mutex are recommended.
14804 #. type: Plain text
14805 #: build/C/man7/attributes.7:632
14807 "It is thus advisable for applications using the terminal to avoid concurrent "
14808 "and reentrant interactions with it, by not using it in signal handlers or "
14809 "blocking signals that might use it, and holding a lock while calling these "
14810 "functions and interacting with the terminal. This lock should also be used "
14811 "for mutual exclusion with functions marked with I<race:tcattr(fd)>, where "
14812 "I<fd> is a file descriptor for the controlling terminal. The caller may use "
14813 "a single mutex for simplicity, or use one mutex per terminal, even if "
14814 "referenced by different file descriptors."
14818 #: build/C/man7/attributes.7:632
14820 msgid "Other safety remarks"
14823 #. type: Plain text
14824 #: build/C/man7/attributes.7:636
14826 "Additional keywords may be attached to functions, indicating features that "
14827 "do not make a function unsafe to call, but that may need to be taken into "
14828 "account in certain classes of programs:"
14832 #: build/C/man7/attributes.7:636
14837 #. type: Plain text
14838 #: build/C/man7/attributes.7:648
14840 "Functions annotated with I<locale> as an MT-Safety issue read from the "
14841 "locale object without any form of synchronization. Functions annotated with "
14842 "I<locale> called concurrently with locale changes may behave in ways that do "
14843 "not correspond to any of the locales active during their execution, but an "
14844 "unpredictable mix thereof."
14848 #. Should the locking strategy suggested under @code{const} be used,
14849 #. failure to guard locale uses is not as fatal as data races in
14850 #. general: unguarded uses will @emph{not} follow dangling pointers or
14851 #. access uninitialized, unmapped or recycled memory. Each access will
14852 #. read from a consistent locale object that is or was active at some
14853 #. point during its execution. Without synchronization, however, it
14854 #. cannot even be assumed that, after a change in locale, earlier
14855 #. locales will no longer be used, even after the newly-chosen one is
14856 #. used in the thread. Nevertheless, even though unguarded reads from
14857 #. the locale will not violate type safety, functions that access the
14858 #. locale multiple times may invoke all sorts of undefined behavior
14859 #. because of the unexpected locale changes.
14860 #. type: Plain text
14861 #: build/C/man7/attributes.7:671
14863 "We do not mark these functions as MT-Unsafe, however, because functions that "
14864 "modify the locale object are marked with I<const:locale> and regarded as "
14865 "unsafe. Being unsafe, the latter are not to be called when multiple threads "
14866 "are running or asynchronous signals are enabled, and so the locale can be "
14867 "considered effectively constant in these contexts, which makes the former "
14872 #: build/C/man7/attributes.7:671
14877 #. type: Plain text
14878 #: build/C/man7/attributes.7:680
14880 "Functions marked with I<env> as an MT-Safety issue access the environment "
14881 "with B<getenv>(3) or similar, without any guards to ensure safety in the "
14882 "presence of concurrent modifications."
14886 #. type: Plain text
14887 #: build/C/man7/attributes.7:691
14889 "We do not mark these functions as MT-Unsafe, however, because functions that "
14890 "modify the environment are all marked with I<const:env> and regarded as "
14891 "unsafe. Being unsafe, the latter are not to be called when multiple threads "
14892 "are running or asynchronous signals are enabled, and so the environment can "
14893 "be considered effectively constant in these contexts, which makes the former "
14898 #: build/C/man7/attributes.7:691
14903 #. type: Plain text
14904 #: build/C/man7/attributes.7:710
14906 "The function marked with I<hostid> as an MT-Safety issue reads from the "
14907 "system-wide data structures that hold the \"host ID\" of the machine. These "
14908 "data structures cannot generally be modified atomically. Since it is "
14909 "expected that the \"host ID\" will not normally change, the function that "
14910 "reads from it (B<gethostid>(3)) is regarded as safe, whereas the function "
14911 "that modifies it (B<sethostid>(3)) is marked with I<const:hostid>, "
14912 "indicating it may require special care if it is to be called. In this "
14913 "specific case, the special care amounts to system-wide (not merely intra-"
14914 "process) coordination."
14918 #: build/C/man7/attributes.7:710
14921 msgstr "I<sigintr>"
14923 #. type: Plain text
14924 #: build/C/man7/attributes.7:719
14926 "Functions marked with I<sigintr> as an MT-Safety issue access the GNU C "
14927 "Library I<_sigintr> internal data structure without any guards to ensure "
14928 "safety in the presence of concurrent modifications."
14939 #. Functions annotated with
14941 #. as an AC-Safety issue may leak file
14942 #. descriptors if asynchronous thread cancellation interrupts their
14944 #. Functions that allocate or deallocate file descriptors will generally be
14946 #. Even if they attempted to protect the file descriptor
14947 #. allocation and deallocation with cleanup regions,
14948 #. allocating a new descriptor and storing its number where the cleanup region
14949 #. could release it cannot be performed as a single atomic operation.
14951 #. releasing the descriptor and taking it out of the data structure
14952 #. normally responsible for releasing it cannot be performed atomically.
14953 #. There will always be a window in which the descriptor cannot be released
14954 #. because it was not stored in the cleanup handler argument yet,
14955 #. or it was already taken out before releasing it.
14956 #. .\" It cannot be taken out after release:
14957 #. an open descriptor could mean either that the descriptor still
14958 #. has to be closed,
14959 #. or that it already did so but the descriptor was
14960 #. reallocated by another thread or signal handler.
14961 #. Such leaks could be internally avoided, with some performance penalty,
14962 #. by temporarily disabling asynchronous thread cancellation.
14964 #. since callers of allocation or deallocation functions would have to do
14965 #. this themselves, to avoid the same sort of leak in their own layer,
14966 #. it makes more sense for the library to assume they are taking care of it
14967 #. than to impose a performance penalty that is redundant when the problem
14968 #. is solved in upper layers, and insufficient when it is not.
14969 #. This remark by itself does not cause a function to be regarded as
14971 #. However, cumulative effects of such leaks may pose a
14972 #. problem for some programs.
14973 #. If this is the case,
14974 #. suspending asynchronous cancellation for the duration of calls
14975 #. to such functions is recommended.
14978 #. Functions annotated with
14980 #. as an AC-Safety issue may leak
14981 #. memory if asynchronous thread cancellation interrupts their execution.
14982 #. The problem is similar to that of file descriptors: there is no atomic
14983 #. interface to allocate memory and store its address in the argument to a
14984 #. cleanup handler,
14985 #. or to release it and remove its address from that argument,
14986 #. without at least temporarily disabling asynchronous cancellation,
14987 #. which these functions do not do.
14988 #. This remark does not by itself cause a function to be regarded as
14989 #. generally AC-Unsafe.
14990 #. However, cumulative effects of such leaks may be
14991 #. severe enough for some programs that disabling asynchronous cancellation
14992 #. for the duration of calls to such functions may be required.
14993 #. type: Plain text
14994 #: build/C/man7/attributes.7:792
14996 "We do not mark these functions as MT-Unsafe, however, because functions that "
14997 "modify this data structure are all marked with I<const:sigintr> and regarded "
14998 "as unsafe. Being unsafe, the latter are not to be called when multiple "
14999 "threads are running or asynchronous signals are enabled, and so the data "
15000 "structure can be considered effectively constant in these contexts, which "
15001 "makes the former safe."
15005 #: build/C/man7/attributes.7:792
15010 #. type: Plain text
15011 #: build/C/man7/attributes.7:800
15013 "Functions marked with I<cwd> as an MT-Safety issue may temporarily change "
15014 "the current working directory during their execution, which may cause "
15015 "relative pathnames to be resolved in unexpected ways in other threads or "
15016 "within asynchronous signal or cancellation handlers."
15023 #. This remark, as an MT-Safety, AS-Safety or AC-Safety
15024 #. note to a function,
15025 #. indicates the safety status of the function is known to differ
15026 #. from the specified status in the POSIX standard.
15027 #. For example, POSIX does not require a function to be Safe,
15028 #. but our implementation is, or vice-versa.
15029 #. For the time being, the absence of this remark does not imply the safety
15030 #. properties we documented are identical to those mandated by POSIX for
15031 #. the corresponding functions.
15032 #. type: Plain text
15033 #: build/C/man7/attributes.7:823
15035 "This is not enough of a reason to mark so-marked functions as MT-Unsafe, but "
15036 "when this behavior is optional (e.g., B<nftw>(3) with B<FTW_CHDIR>), "
15037 "avoiding the option may be a good alternative to using full pathnames or "
15038 "file descriptor-relative (e.g., B<openat>(2)) system calls."
15042 #: build/C/man7/attributes.7:823
15044 msgid "I<:identifier>"
15045 msgstr "I<:identifier>"
15047 #. type: Plain text
15048 #: build/C/man7/attributes.7:839
15050 "Annotations may sometimes be followed by identifiers, intended to group "
15051 "several functions that, for example, access the data structures in an unsafe "
15052 "way, as in I<race> and I<const>, or to provide more specific information, "
15053 "such as naming a signal in a function marked with I<sig>. It is envisioned "
15054 "that it may be applied to I<lock> and I<corrupt> as well in the future."
15057 #. type: Plain text
15058 #: build/C/man7/attributes.7:851
15060 "In most cases, the identifier will name a set of functions, but it may name "
15061 "global objects or function arguments, or identifiable properties or logical "
15062 "components associated with them, with a notation such as, for example, I<:"
15063 "buf(arg)> to denote a buffer associated with the argument I<arg>, or I<:"
15064 "tcattr(fd)> to denote the terminal attributes of a file descriptor I<fd>."
15067 #. type: Plain text
15068 #: build/C/man7/attributes.7:856
15070 "The most common use for identifiers is to provide logical groups of "
15071 "functions and arguments that need to be protected by the same "
15072 "synchronization primitive in order to ensure safe operation in a given "
15077 #: build/C/man7/attributes.7:856
15079 msgid "I</condition>"
15080 msgstr "I</condition>"
15082 #. Such conditions as
15086 #. indicate the preceding marker only
15087 #. applies when the underlying kernel is the HURD,
15088 #. or when it is neither Linux nor a BSD kernel, respectively.
15089 #. type: Plain text
15090 #: build/C/man7/attributes.7:877
15092 "Some safety annotations may be conditional, in that they only apply if a "
15093 "boolean expression involving arguments, global variables or even the "
15094 "underlying kernel evaluates to true. For example, I</!ps> and I</"
15095 "one_per_line> indicate the preceding marker only applies when argument I<ps> "
15096 "is NULL, or global variable I<one_per_line> is nonzero."
15099 #. type: Plain text
15100 #: build/C/man7/attributes.7:882
15102 "When all marks that render a function unsafe are adorned with such "
15103 "conditions, and none of the named conditions hold, then the function can be "
15104 "regarded as safe."
15107 #. type: Plain text
15108 #: build/C/man7/attributes.7:885
15109 msgid "B<pthreads>(7), B<signal-safety>(7)"
15110 msgstr "B<pthreads>(7), B<signal-safety>(7)"
15112 #. type: Plain text
15113 #: build/C/man7/nptl.7:29
15115 #| msgid "B<NPTL> (Native POSIX Threads Library)"
15116 msgid "nptl - Native POSIX Threads Library"
15117 msgstr "B<NPTL> (Native POSIX Threads Library)"
15119 #. type: Plain text
15120 #: build/C/man7/nptl.7:34
15122 "NPTL (Native POSIX Threads Library) is the GNU C library POSIX threads "
15123 "implementation that is used on modern Linux systems."
15127 #: build/C/man7/nptl.7:34
15129 msgid "NPTL and signals"
15132 #. type: Plain text
15133 #: build/C/man7/nptl.7:43
15135 "NPTL makes internal use of the first two real-time signals (signal numbers "
15136 "32 and 33). One of these signals is used to support thread cancellation and "
15137 "POSIX timers (see B<timer_create>(2)); the other is used as part of a "
15138 "mechanism that ensures all threads in a process always have the same UIDs "
15139 "and GIDs, as required by POSIX. These signals cannot be used in "
15143 #. type: Plain text
15144 #: build/C/man7/nptl.7:49
15146 "To prevent accidental use of these signals in applications, which might "
15147 "interfere with the operation of the NPTL implementation, various glibc "
15148 "library functions and system call wrapper functions attempt to hide these "
15149 "signals from applications, as follows:"
15152 #. type: Plain text
15153 #: build/C/man7/nptl.7:52
15154 msgid "B<SIGRTMIN> is defined with the value 34 (rather than 32)."
15157 #. type: Plain text
15158 #: build/C/man7/nptl.7:60
15160 "The B<sigwaitinfo>(2), B<sigtimedwait>(2), and B<sigwait>(3) interfaces "
15161 "silently ignore requests to wait for these two signals if they are specified "
15162 "in the signal set argument of these calls."
15165 #. type: Plain text
15166 #: build/C/man7/nptl.7:66
15168 "The B<sigprocmask>(2) and B<pthread_sigmask>(3) interfaces silently ignore "
15169 "attempts to block these two signals."
15172 #. type: Plain text
15173 #: build/C/man7/nptl.7:75
15175 "The B<sigaction>(2), B<pthread_kill>(3), and B<pthread_sigqueue>(3) "
15176 "interfaces fail with the error B<EINVAL> (indicating an invalid signal "
15177 "number) if these signals are specified."
15180 #. type: Plain text
15181 #: build/C/man7/nptl.7:79
15183 "B<sigfillset>(3) does not include these two signals when it creates a full "
15188 #: build/C/man7/nptl.7:79
15190 msgid "NPTL and process credential changes"
15193 #. type: Plain text
15194 #: build/C/man7/nptl.7:89
15196 "At the Linux kernel level, credentials (user and group IDs) are a per-thread "
15197 "attribute. However, POSIX requires that all of the POSIX threads in a "
15198 "process have the same credentials. To accommodate this requirement, the "
15199 "NPTL implementation wraps all of the system calls that change process "
15200 "credentials with functions that, in addition to invoking the underlying "
15201 "system call, arrange for all other threads in the process to also change "
15202 "their credentials."
15205 #. type: Plain text
15206 #: build/C/man7/nptl.7:99
15208 "The implementation of each of these system calls involves the use of a real-"
15209 "time signal that is sent (using B<tgkill>(2)) to each of the other threads "
15210 "that must change its credentials. Before sending these signals, the thread "
15211 "that is changing credentials saves the new credential(s) and records the "
15212 "system call being employed in a global buffer. A signal handler in the "
15213 "receiving thread(s) fetches this information and then uses the same system "
15214 "call to change its credentials."
15218 #. Maybe say something about vfork() not being serialized wrt set*id() APIs?
15219 #. https://sourceware.org/bugzilla/show_bug.cgi?id=14749
15220 #. type: Plain text
15221 #: build/C/man7/nptl.7:114
15223 "Wrapper functions employing this technique are provided for B<setgid>(2), "
15224 "B<setuid>(2), B<setegid>(2), B<seteuid>(2), B<setregid>(2), B<setreuid>(2), "
15225 "B<setresgid>(2), B<setresuid>(2), and B<setgroups>(2)."
15228 #. type: Plain text
15229 #: build/C/man7/nptl.7:117
15232 #| "For details on the default stack size of new threads, see "
15233 #| "B<pthread_create>(3)."
15235 "For details of the conformance of NPTL to the POSIX standard, see "
15238 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
15239 "B<pthread_create>(3) を参照。"
15241 #. See POSIX.1-2008 specification of pthread_mutexattr_init()
15242 #. See sysdeps/x86/bits/pthreadtypes.h
15243 #. type: Plain text
15244 #: build/C/man7/nptl.7:128
15246 "POSIX says that any thread in any process with access to the memory "
15247 "containing a process-shared (B<PTHREAD_PROCESS_SHARED>) mutex can operate "
15248 "on that mutex. However, on 64-bit x86 systems, the mutex definition for "
15249 "x86-64 is incompatible with the mutex definition for i386, meaning that 32-"
15250 "bit and 64-bit binaries can't share mutexes on x86-64 systems."
15253 #. type: Plain text
15254 #: build/C/man7/nptl.7:133
15255 msgid "B<credentials>(7), B<pthreads>(7), B<signal>(7), B<standards>(7)"
15256 msgstr "B<credentials>(7), B<pthreads>(7), B<signal>(7), B<standards>(7)"
15258 #~ msgid "Multithreading (see pthreads(7))"
15259 #~ msgstr "マルチスレッディング (pthreads(7) 参照)"
15261 #~ msgid "For the type and the first two functions, see B<getcontext>(3)."
15263 #~ "これらの型と、最初の 2 つの関数については、 B<getcontext>(3) を参照のこ"
15267 #~ "After a successful call to B<pthread_join>(), the caller is guaranteed "
15268 #~ "that the target thread has terminated."
15270 #~ "B<pthread_join>() の呼び出しが成功した場合は、\n"
15271 #~ "呼び出し側には、対象スレッドが終了していることが保証される。"
15274 #~ "This is intended as the write lock analog of "
15275 #~ "B<PTHREAD_RWLOCK_PREFER_READER_NP>. But see BUGS."
15277 #~ "これは B<PTHREAD_RWLOCK_PREFER_READER_NP> の書き込みロック版である。 ただ"
15281 #~ "Setting the value read-write lock kind to "
15282 #~ "B<PTHREAD_RWLOCK_PREFER_WRITER_NP> results in the same behavior as "
15283 #~ "setting the value to B<PTHREAD_RWLOCK_PREFER_READER_NP>. As long as a "
15284 #~ "reader thread holds the lock, the thread holding a write lock will be "
15285 #~ "starved. Setting the lock kind to "
15286 #~ "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> allows writers to run, "
15287 #~ "but, as the name implies a writer may not lock recursively."
15289 #~ "読み書きロック種別の値を B<PTHREAD_RWLOCK_PREFER_WRITER_NP> に設定すること"
15290 #~ "は、 値を B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定するのと同じ動作とな"
15291 #~ "る。 読み出しスレッドがロックを保持する限り、書き込みロックを保持している"
15292 #~ "スレッドは停止することになる。 ロック種別を "
15293 #~ "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> に設定すると、 書き込み側"
15294 #~ "が動作できるようになるが、変数名から分かるように、 書き込み側はロックを再"