OSDN Git Service

info/GNU_which: Add some explanations.
[linuxjm/jm.git] / manual / LDP_man-pages / po4a / pthread / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 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"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man3/getcontext.3:25
20 #, no-wrap
21 msgid "GETCONTEXT"
22 msgstr "GETCONTEXT"
23
24 #. type: TH
25 #: build/C/man3/getcontext.3:25 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
28 #, no-wrap
29 msgid "2020-12-21"
30 msgstr "2020-12-21"
31
32 #. type: TH
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
68 #, no-wrap
69 msgid "Linux"
70 msgstr "Linux"
71
72 #. type: TH
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
110 #, no-wrap
111 msgid "Linux Programmer's Manual"
112 msgstr "Linux Programmer's Manual"
113
114 #. type: SH
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
152 #, no-wrap
153 msgid "NAME"
154 msgstr "名前"
155
156 #. type: Plain text
157 #: build/C/man3/getcontext.3:28
158 msgid "getcontext, setcontext - get or set the user context"
159 msgstr "getcontext, setcontext - ユーザーコンテキストを取得/設定する"
160
161 #. type: SH
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
197 #, no-wrap
198 msgid "SYNOPSIS"
199 msgstr "書式"
200
201 #. type: Plain text
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>>"
205
206 #. type: Plain text
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<);>"
210
211 #. type: Plain text
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<);>"
215
216 #. type: SH
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
254 #, no-wrap
255 msgid "DESCRIPTION"
256 msgstr "説明"
257
258 #. type: Plain text
259 #: build/C/man3/getcontext.3:49
260 msgid ""
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 "
265 "within a process."
266 msgstr ""
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 "部で制御下にある複数のスレッド間で、 ユーザーレベルのコンテキスト切替えができ"
271 "るようになっている。"
272
273 #. type: Plain text
274 #: build/C/man3/getcontext.3:57
275 msgid ""
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:"
278 msgstr ""
279 "I<mcontext_t> 型はマシン依存で、外部からは隠蔽されている。 I<ucontext_t> 型は"
280 "構造体で、少なくとも以下の 4 つのフィールドを持つ。"
281
282 #. type: Plain text
283 #: build/C/man3/getcontext.3:67
284 #, no-wrap
285 msgid ""
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"
291 "    ...\n"
292 "} ucontext_t;\n"
293 msgstr ""
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"
299 "    ...\n"
300 "} ucontext_t;\n"
301
302 #. type: Plain text
303 #: build/C/man3/getcontext.3:94
304 msgid ""
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 "
312 "machine registers."
313 msgstr ""
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 "るコンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマ"
321 "シンレジスターが格納される。"
322
323 #. type: Plain text
324 #: build/C/man3/getcontext.3:101
325 msgid ""
326 "The function B<getcontext>()  initializes the structure pointed to by I<ucp> "
327 "to the currently active context."
328 msgstr ""
329 "B<getcontext>()  関数は、 ポインター I<ucp> が指す構造体を、 現在アクティブな"
330 "コンテキストに初期化する。"
331
332 #. type: Plain text
333 #: build/C/man3/getcontext.3:117
334 #, fuzzy
335 #| msgid ""
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."
340 msgid ""
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))."
346 msgstr ""
347 "B<setcontext>()  関数は、ポインター I<ucp> が指すユーザーコンテキストをリスト"
348 "アする。 呼び出しに成功すると返らない。 このコンテキストは、以前に "
349 "B<getcontext>()  または B<makecontext>(3)  で得られたものか、 あるいはシグナ"
350 "ルの第三引数として与えられたものになる。"
351
352 #. type: Plain text
353 #: build/C/man3/getcontext.3:121
354 msgid ""
355 "If the context was obtained by a call of B<getcontext>(), program execution "
356 "continues as if this call just returned."
357 msgstr ""
358 "コンテキストが B<getcontext>()  の呼び出しによって得られていたものの場合は、 "
359 "プログラムはこの呼び出しから返った直後からのように実行を継続する。"
360
361 #. type: Plain text
362 #: build/C/man3/getcontext.3:138
363 msgid ""
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."
370 msgstr ""
371 "コンテキストが B<makecontext>(3)  の呼び出しによって得られていたものの場合"
372 "は、 プログラムの実行はその B<makecontext>(3)  呼び出しの第二引数で指定された"
373 "関数 I<func> を呼び出すかたちで継続する。 I<func> から返ると、 "
374 "B<makecontext>(3)  呼び出しの第一引数で指定されていた I<ucp> 構造体の "
375 "I<uc_link> メンバで継続する。 このメンバが NULL だった場合は、そのスレッドは"
376 "終了する。"
377
378 #. type: Plain text
379 #: build/C/man3/getcontext.3:145
380 msgid ""
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 "
385 "unspecified\"."
386 msgstr ""
387 "コンテキストがシグナルハンドラーの呼び出しによって得られていたものの場合は、 "
388 "古い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命"
389 "令から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結"
390 "果は定義されていない」である。"
391
392 #. type: SH
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
426 #, no-wrap
427 msgid "RETURN VALUE"
428 msgstr "返り値"
429
430 #. type: Plain text
431 #: build/C/man3/getcontext.3:154
432 msgid ""
433 "When successful, B<getcontext>()  returns 0 and B<setcontext>()  does not "
434 "return.  On error, both return -1 and set I<errno> appropriately."
435 msgstr ""
436 "成功すると、 B<getcontext>()  は 0 を返し、 B<setcontext>()  は返らない。 失"
437 "敗すると、両者とも -1 を返し、I<errno> をエラーに応じて設定する。"
438
439 #. type: SH
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
473 #, no-wrap
474 msgid "ERRORS"
475 msgstr "エラー"
476
477 #. type: Plain text
478 #: build/C/man3/getcontext.3:156
479 msgid "None defined."
480 msgstr "定義されていない。"
481
482 #. type: TH
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
511 #, no-wrap
512 msgid "ATTRIBUTES"
513 msgstr "属性"
514
515 #. type: Plain text
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
545 msgid ""
546 "For an explanation of the terms used in this section, see B<attributes>(7)."
547 msgstr "この節で使用されている用語の説明については、 B<attributes>(7) を参照。"
548
549 #. type: tbl table
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
579 #, no-wrap
580 msgid "Interface"
581 msgstr "インターフェース"
582
583 #. type: tbl table
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
613 #, no-wrap
614 msgid "Attribute"
615 msgstr "属性"
616
617 #. type: tbl table
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
647 #, no-wrap
648 msgid "Value"
649 msgstr "値"
650
651 #. type: tbl table
652 #: build/C/man3/getcontext.3:167
653 #, no-wrap
654 msgid ""
655 "B<getcontext>(),\n"
656 "B<setcontext>()"
657 msgstr ""
658 "B<getcontext>(),\n"
659 "B<setcontext>()"
660
661 #. type: tbl table
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
691 #, no-wrap
692 msgid "Thread safety"
693 msgstr "Thread safety"
694
695 #. type: tbl table
696 #: build/C/man3/getcontext.3:167 build/C/man3/makecontext.3:116
697 #, no-wrap
698 msgid "MT-Safe race:ucp"
699 msgstr "MT-Safe race:ucp"
700
701 #. type: SH
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
740 #, no-wrap
741 msgid "CONFORMING TO"
742 msgstr "準拠"
743
744 #. type: Plain text
745 #: build/C/man3/getcontext.3:175
746 msgid ""
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."
750 msgstr ""
751 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<getcontext>()  の"
752 "仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直"
753 "すことが 推奨されている。"
754
755 #. type: SH
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
786 #, no-wrap
787 msgid "NOTES"
788 msgstr "注意"
789
790 #. type: Plain text
791 #: build/C/man3/getcontext.3:192
792 msgid ""
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."
801 msgstr ""
802 "このメカニズムの最古の実装は、 B<setjmp>(3)/B<longjmp>(3)  機構であった。 こ"
803 "れらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階で"
804 "は B<sigsetjmp>(3)/B<siglongjmp>(3)  のペアが現われた。 現在の機構ではずっと"
805 "細かな制御ができる。 一方 B<getcontext>()  から返ったとき、 これが最初の呼び"
806 "出しであったか、 それとも B<setcontext>()  呼び出しからのものであるかを 区別"
807 "する容易な方法がなくなってしまった。 ユーザーは「しおり」機構を自分で作らなけ"
808 "ればならない。 レジスター変数は (レジスターはリストアされてしまうので) これを"
809 "やってくれない。"
810
811 #. type: Plain text
812 #: build/C/man3/getcontext.3:203
813 msgid ""
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."
818 msgstr ""
819 "シグナルが発生すると、 現在のユーザーコンテキストは保存され、 シグナルハンド"
820 "ラー用のコンテキストがカーネルによって生成される。 今後はハンドラーに "
821 "B<longjmp>(3)  を使わせないこと: この関数のコンテキスト下での動作は定義されて"
822 "いない。 代わりに B<siglongjmp>(3)  か B<setcontext>()  を使うこと。"
823
824 #. type: SH
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
864 #, no-wrap
865 msgid "SEE ALSO"
866 msgstr "関連項目"
867
868 #. type: Plain text
869 #: build/C/man3/getcontext.3:211
870 msgid ""
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)"
874
875 #. type: SH
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
915 #, no-wrap
916 msgid "COLOPHON"
917 msgstr "この文書について"
918
919 #. type: Plain text
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
959 msgid ""
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-"
963 "pages/."
964 msgstr "この man ページは Linux I<man-pages> プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \\%https://www.kernel.org/doc/man-pages/ に書かれている。"
965
966 #. type: TH
967 #: build/C/man3/makecontext.3:28
968 #, no-wrap
969 msgid "MAKECONTEXT"
970 msgstr "MAKECONTEXT"
971
972 #. type: TH
973 #: build/C/man3/makecontext.3:28
974 #, no-wrap
975 msgid "GNU"
976 msgstr "GNU"
977
978 #. type: Plain text
979 #: build/C/man3/makecontext.3:31
980 msgid "makecontext, swapcontext - manipulate user context"
981 msgstr "makecontext, swapcontext - ユーザーコンテキストを操作する"
982
983 #. type: Plain text
984 #: build/C/man3/makecontext.3:36
985 msgid ""
986 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
987 ">I<argc>B<, ...);>"
988 msgstr ""
989 "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int "
990 ">I<argc>B<, ...);>"
991
992 #. type: Plain text
993 #: build/C/man3/makecontext.3:38
994 msgid ""
995 "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
996 msgstr ""
997 "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
998
999 #. type: Plain text
1000 #: build/C/man3/makecontext.3:53
1001 #, fuzzy
1002 #| msgid ""
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 "
1007 #| "process."
1008 msgid ""
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."
1014 msgstr ""
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 "部で制御下にある複数のスレッド間で、 ユーザーレベルのコンテキスト切替えができ"
1019 "るようになっている。"
1020
1021 #. type: Plain text
1022 #: build/C/man3/makecontext.3:65
1023 msgid ""
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>."
1029 msgstr ""
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> に 代入しなければな"
1035 "らない。"
1036
1037 #. type: Plain text
1038 #: build/C/man3/makecontext.3:79
1039 msgid ""
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, "
1045 "the thread exits."
1046 msgstr ""
1047 "このコンテキストが将来 (B<setcontext>(3)  または B<swapcontext>()  によっ"
1048 "て)  有効にされると、関数 I<func> が呼ばれ、 引数として I<argc> 以降の整数 "
1049 "(I<int>)  引数の列が渡される。 呼び出し者は I<argc> にこれらの引数の個数"
1050 "を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効にな"
1051 "る。 後継コンテキストのポインターが NULL の場合、そのスレッドが終了する。"
1052
1053 #. type: Plain text
1054 #: build/C/man3/makecontext.3:85
1055 msgid ""
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>."
1058 msgstr ""
1059 "B<swapcontext>()  関数は現在のコンテキストを ポインター I<oucp> が指す構造体"
1060 "に保存し、 ポインター I<ucp> が指すコンテキストを有効にする。"
1061
1062 #. type: Plain text
1063 #: build/C/man3/makecontext.3:97
1064 msgid ""
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."
1069 msgstr ""
1070 "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった"
1071 "場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見え"
1072 "る。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じ"
1073 "て設定する。"
1074
1075 #. type: TP
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
1081 #, no-wrap
1082 msgid "B<ENOMEM>"
1083 msgstr "B<ENOMEM>"
1084
1085 #. type: Plain text
1086 #: build/C/man3/makecontext.3:101
1087 msgid "Insufficient stack space left."
1088 msgstr "スタックに割り当てる空間が残っていない。"
1089
1090 #. type: SH
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
1108 #, no-wrap
1109 msgid "VERSIONS"
1110 msgstr "バージョン"
1111
1112 #. type: Plain text
1113 #: build/C/man3/makecontext.3:106
1114 msgid ""
1115 "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version "
1116 "2.1."
1117 msgstr ""
1118 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
1119 "されている。"
1120
1121 #. type: tbl table
1122 #: build/C/man3/makecontext.3:116
1123 #, no-wrap
1124 msgid "B<makecontext>()"
1125 msgstr "B<makecontext>()"
1126
1127 #. type: tbl table
1128 #: build/C/man3/makecontext.3:119
1129 #, no-wrap
1130 msgid "B<swapcontext>()"
1131 msgstr "B<swapcontext>()"
1132
1133 #. type: tbl table
1134 #: build/C/man3/makecontext.3:119
1135 #, no-wrap
1136 msgid "MT-Safe race:oucp race:ucp"
1137 msgstr "MT-Safe race:oucp race:ucp"
1138
1139 #. type: Plain text
1140 #: build/C/man3/makecontext.3:129
1141 msgid ""
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."
1145 msgstr ""
1146 "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  "
1147 "と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを "
1148 "POSIX スレッドを使って書き直すことが 推奨されている。"
1149
1150 #. type: Plain text
1151 #: build/C/man3/makecontext.3:137
1152 msgid ""
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."
1157 msgstr ""
1158 "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわ"
1159 "ちこの構造体には、 スタックとして用いられるメモリー領域の開始アドレスと長さが"
1160 "含まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがっ"
1161 "て、ユーザープログラムはこの件については心配しなくてよい。"
1162
1163 #. type: Plain text
1164 #: build/C/man3/makecontext.3:153
1165 msgid ""
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."
1173 "g., x86-64)."
1174 msgstr ""
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 "ターを渡すことができるようになっている。"
1183
1184 #. type: SH
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
1205 #, no-wrap
1206 msgid "EXAMPLES"
1207 msgstr "例"
1208
1209 #. type: Plain text
1210 #: build/C/man3/makecontext.3:160
1211 msgid ""
1212 "The example program below demonstrates the use of B<getcontext>(3), "
1213 "B<makecontext>(), and B<swapcontext>().  Running the program produces the "
1214 "following output:"
1215 msgstr ""
1216 "以下のサンプルプログラムは、 B<getcontext>(3), B<makecontext>(), "
1217 "B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行する"
1218 "と、以下のような出力が得られる:"
1219
1220 #. type: Plain text
1221 #: build/C/man3/makecontext.3:172
1222 #, no-wrap
1223 msgid ""
1224 "$B< ./a.out>\n"
1225 "main: swapcontext(&uctx_main, &uctx_func2)\n"
1226 "func2: started\n"
1227 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
1228 "func1: started\n"
1229 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
1230 "func2: returning\n"
1231 "func1: returning\n"
1232 "main: exiting\n"
1233 msgstr ""
1234 "$B< ./a.out>\n"
1235 "main: swapcontext(&uctx_main, &uctx_func2)\n"
1236 "func2: started\n"
1237 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
1238 "func1: started\n"
1239 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
1240 "func2: returning\n"
1241 "func1: returning\n"
1242 "main: exiting\n"
1243
1244 #. type: SS
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
1253 #, no-wrap
1254 msgid "Program source"
1255 msgstr "プログラムのソース"
1256
1257 #. type: Plain text
1258 #: build/C/man3/makecontext.3:180
1259 #, no-wrap
1260 msgid ""
1261 "#include E<lt>ucontext.hE<gt>\n"
1262 "#include E<lt>stdio.hE<gt>\n"
1263 "#include E<lt>stdlib.hE<gt>\n"
1264 msgstr ""
1265 "#include E<lt>ucontext.hE<gt>\n"
1266 "#include E<lt>stdio.hE<gt>\n"
1267 "#include E<lt>stdlib.hE<gt>\n"
1268
1269 #. type: Plain text
1270 #: build/C/man3/makecontext.3:182
1271 #, no-wrap
1272 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
1273 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
1274
1275 #. type: Plain text
1276 #: build/C/man3/makecontext.3:185
1277 #, no-wrap
1278 msgid ""
1279 "#define handle_error(msg) \\e\n"
1280 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1281 msgstr ""
1282 "#define handle_error(msg) \\e\n"
1283 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1284
1285 #. type: Plain text
1286 #: build/C/man3/makecontext.3:195
1287 #, no-wrap
1288 msgid ""
1289 "static void\n"
1290 "func1(void)\n"
1291 "{\n"
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"
1297 "}\n"
1298 msgstr ""
1299 "static void\n"
1300 "func1(void)\n"
1301 "{\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"
1307 "}\n"
1308
1309 #. type: Plain text
1310 #: build/C/man3/makecontext.3:205
1311 #, no-wrap
1312 msgid ""
1313 "static void\n"
1314 "func2(void)\n"
1315 "{\n"
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"
1321 "}\n"
1322 msgstr ""
1323 "static void\n"
1324 "func2(void)\n"
1325 "{\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"
1331 "}\n"
1332
1333 #. type: Plain text
1334 #: build/C/man3/makecontext.3:211
1335 #, no-wrap
1336 msgid ""
1337 "int\n"
1338 "main(int argc, char *argv[])\n"
1339 "{\n"
1340 "    char func1_stack[16384];\n"
1341 "    char func2_stack[16384];\n"
1342 msgstr ""
1343 "int\n"
1344 "main(int argc, char *argv[])\n"
1345 "{\n"
1346 "    char func1_stack[16384];\n"
1347 "    char func2_stack[16384];\n"
1348
1349 #. type: Plain text
1350 #: build/C/man3/makecontext.3:218
1351 #, no-wrap
1352 msgid ""
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"
1359 msgstr ""
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"
1366
1367 #. type: Plain text
1368 #: build/C/man3/makecontext.3:226
1369 #, no-wrap
1370 msgid ""
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"
1378 msgstr ""
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"
1386
1387 #. type: Plain text
1388 #: build/C/man3/makecontext.3:230
1389 #, no-wrap
1390 msgid ""
1391 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1392 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1393 "        handle_error(\"swapcontext\");\n"
1394 msgstr ""
1395 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
1396 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
1397 "        handle_error(\"swapcontext\");\n"
1398
1399 #. type: Plain text
1400 #: build/C/man3/makecontext.3:234
1401 #, no-wrap
1402 msgid ""
1403 "    printf(\"main: exiting\\en\");\n"
1404 "    exit(EXIT_SUCCESS);\n"
1405 "}\n"
1406 msgstr ""
1407 "    printf(\"main: exiting\\en\");\n"
1408 "    exit(EXIT_SUCCESS);\n"
1409 "}\n"
1410
1411 #. type: Plain text
1412 #: build/C/man3/makecontext.3:241
1413 msgid ""
1414 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1415 "B<sigsetjmp>(3)"
1416 msgstr ""
1417 "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), "
1418 "B<sigsetjmp>(3)"
1419
1420 #. type: TH
1421 #: build/C/man3/pthread_attr_init.3:26
1422 #, no-wrap
1423 msgid "PTHREAD_ATTR_INIT"
1424 msgstr "PTHREAD_ATTR_INIT"
1425
1426 #. type: TH
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
1432 #, no-wrap
1433 msgid "2020-11-01"
1434 msgstr "2020-11-01"
1435
1436 #. type: Plain text
1437 #: build/C/man3/pthread_attr_init.3:30
1438 msgid ""
1439 "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
1440 "attributes object"
1441 msgstr ""
1442 "pthread_attr_init, pthread_attr_destroy - \n"
1443 "スレッド属性オブジェクトの初期化と破棄を行う"
1444
1445 #. type: Plain text
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
1472 #, no-wrap
1473 msgid "B<#include E<lt>pthread.hE<gt>>\n"
1474 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
1475
1476 #. type: Plain text
1477 #: build/C/man3/pthread_attr_init.3:36
1478 #, no-wrap
1479 msgid ""
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"
1482 msgstr ""
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"
1485
1486 #. type: Plain text
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
1509 #, no-wrap
1510 msgid "Compile and link with I<-pthread>.\n"
1511 msgstr "I<-pthread> でコンパイルしてリンクする。\n"
1512
1513 #. type: Plain text
1514 #: build/C/man3/pthread_attr_init.3:50
1515 msgid ""
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."
1521 msgstr ""
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) に渡してもよい)。"
1528
1529 #. type: Plain text
1530 #: build/C/man3/pthread_attr_init.3:55
1531 msgid ""
1532 "Calling B<pthread_attr_init>()  on a thread attributes object that has "
1533 "already been initialized results in undefined behavior."
1534 msgstr ""
1535 "すでに初期化されているスレッド属性オブジェクトに対して\n"
1536 "B<pthread_attr_init>() を呼び出した場合、\n"
1537 "どのような動作になるかは不定である。"
1538
1539 #. type: Plain text
1540 #: build/C/man3/pthread_attr_init.3:62
1541 msgid ""
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 "
1545 "that object."
1546 msgstr ""
1547 "スレッド属性オブジェクトがもはや必要なくなった際には、\n"
1548 "そのオブジェクトは B<pthread_attr_destroy>() 関数を使って破棄すべきである。\n"
1549 "スレッド属性オブジェクトを破棄しても、\n"
1550 "そのオブジェクトを使って作成されたスレッドには影響はない。"
1551
1552 #. type: Plain text
1553 #: build/C/man3/pthread_attr_init.3:68
1554 msgid ""
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."
1558 msgstr ""
1559 "いったん破棄したスレッド属性オブジェクトは、\n"
1560 "B<pthread_attr_init>() を使って再初期化することができる。\n"
1561 "破棄したスレッド属性オブジェクトをこれ以外の用途で\n"
1562 "使った場合の結果は不定である。"
1563
1564 #. type: Plain text
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
1579 msgid ""
1580 "On success, these functions return 0; on error, they return a nonzero error "
1581 "number."
1582 msgstr ""
1583 "成功すると、これらの関数は 0 を返す。\n"
1584 "エラーの場合、0 以外のエラー番号を返す。"
1585
1586 #. type: Plain text
1587 #: build/C/man3/pthread_attr_init.3:79
1588 msgid ""
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 では、これらの関数は常に成功する (ただし、移植性や将来も動作することを保証したいアプリケーションでは正のエラーの返り値を処理するようにすべきである)。"
1593
1594 #. type: tbl table
1595 #: build/C/man3/pthread_attr_init.3:91
1596 #, no-wrap
1597 msgid ""
1598 "B<pthread_attr_init>(),\n"
1599 "B<pthread_attr_destroy>()"
1600 msgstr ""
1601 "B<pthread_attr_init>(),\n"
1602 "B<pthread_attr_destroy>()"
1603
1604 #. type: tbl table
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
1633 #, no-wrap
1634 msgid "MT-Safe"
1635 msgstr "MT-Safe"
1636
1637 #. type: Plain text
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."
1661
1662 #. type: Plain text
1663 #: build/C/man3/pthread_attr_init.3:102
1664 msgid ""
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."
1668 msgstr ""
1669 "I<pthread_attr_t> 型の内部構造は意識すべきではない。\n"
1670 "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n"
1671 "どのような結果が得られるかも分からない。"
1672
1673 #. type: Plain text
1674 #: build/C/man3/pthread_attr_init.3:111
1675 msgid ""
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."
1681 msgstr ""
1682 "下記のプログラムは、B<pthread_attr_init>() と種々の関連関数を使って、\n"
1683 "スレッド属性オブジェクトの初期化を行い、\n"
1684 "そのオブジェクトを使ってスレッドを一つ作成する。\n"
1685 "作成されたスレッドは、作成後に B<pthread_getattr_np>(3) 関数 \n"
1686 "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n"
1687 "取得した属性を表示する。"
1688
1689 #. type: Plain text
1690 #: build/C/man3/pthread_attr_init.3:120
1691 msgid ""
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:"
1696 msgstr ""
1697 "コマンドライン引数なしでプログラムを実行した場合、\n"
1698 "B<pthread_create>(3) の I<attr> 引数には NULL が渡される。\n"
1699 "この場合、スレッドはデフォルトの属性で作成される。\n"
1700 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1701 "動作させると、以下のような出力が得られる。"
1702
1703 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1704 #. type: Plain text
1705 #: build/C/man3/pthread_attr_init.3:136
1706 #, no-wrap
1707 msgid ""
1708 "$B< ulimit -s>       # No stack limit ==E<gt> default stack size is 2 MB\n"
1709 "unlimited\n"
1710 "$B< ./a.out>\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"
1720 msgstr ""
1721 "$B< ulimit -s>       # No stack limit ==E<gt> default stack size is 2 MB\n"
1722 "unlimited\n"
1723 "$B< ./a.out>\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"
1733
1734 #. type: Plain text
1735 #: build/C/man3/pthread_attr_init.3:146
1736 msgid ""
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:"
1742 msgstr ""
1743 "コマンドライン引数でスタックサイズが与えられた場合、\n"
1744 "このプログラムは、スレッド属性オブジェクトを初期化し、\n"
1745 "そのオブジェクトの各種属性を設定し、\n"
1746 "B<pthread_create>(3) の呼び出しでこのオブジェクトへのポインターを渡す。\n"
1747 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1748 "動作させると、以下のような出力が得られる。"
1749
1750 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1751 #. type: Plain text
1752 #: build/C/man3/pthread_attr_init.3:161
1753 #, no-wrap
1754 msgid ""
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"
1766 msgstr ""
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"
1778
1779 #. type: Plain text
1780 #: build/C/man3/pthread_attr_init.3:172 build/C/man3/pthread_getattr_np.3:202
1781 #, no-wrap
1782 msgid ""
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"
1789 msgstr ""
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"
1796
1797 #. type: Plain text
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
1805 #, no-wrap
1806 msgid ""
1807 "#define handle_error_en(en, msg) \\e\n"
1808 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1809 msgstr ""
1810 "#define handle_error_en(en, msg) \\e\n"
1811 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1812
1813 #. type: Plain text
1814 #: build/C/man3/pthread_attr_init.3:183
1815 #, no-wrap
1816 msgid ""
1817 "static void\n"
1818 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1819 "{\n"
1820 "    int s, i;\n"
1821 "    size_t v;\n"
1822 "    void *stkaddr;\n"
1823 "    struct sched_param sp;\n"
1824 msgstr ""
1825 "static void\n"
1826 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1827 "{\n"
1828 "    int s, i;\n"
1829 "    size_t v;\n"
1830 "    void *stkaddr;\n"
1831 "    struct sched_param sp;\n"
1832
1833 #. type: Plain text
1834 #: build/C/man3/pthread_attr_init.3:191
1835 #, no-wrap
1836 msgid ""
1837 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1838 "    if (s != 0)\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"
1843 "            \"???\");\n"
1844 msgstr ""
1845 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1846 "    if (s != 0)\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"
1851 "            \"???\");\n"
1852
1853 #. type: Plain text
1854 #: build/C/man3/pthread_attr_init.3:199
1855 #, no-wrap
1856 msgid ""
1857 "    s = pthread_attr_getscope(attr, &i);\n"
1858 "    if (s != 0)\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"
1863 "            \"???\");\n"
1864 msgstr ""
1865 "    s = pthread_attr_getscope(attr, &i);\n"
1866 "    if (s != 0)\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"
1871 "            \"???\");\n"
1872
1873 #. type: Plain text
1874 #: build/C/man3/pthread_attr_init.3:207
1875 #, no-wrap
1876 msgid ""
1877 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1878 "    if (s != 0)\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"
1883 "            \"???\");\n"
1884 msgstr ""
1885 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1886 "    if (s != 0)\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"
1891 "            \"???\");\n"
1892
1893 #. type: Plain text
1894 #: build/C/man3/pthread_attr_init.3:216
1895 #, no-wrap
1896 msgid ""
1897 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1898 "    if (s != 0)\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"
1904 "            \"???\");\n"
1905 msgstr ""
1906 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1907 "    if (s != 0)\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"
1913 "            \"???\");\n"
1914
1915 #. type: Plain text
1916 #: build/C/man3/pthread_attr_init.3:221
1917 #, no-wrap
1918 msgid ""
1919 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1920 "    if (s != 0)\n"
1921 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1922 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1923 msgstr ""
1924 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1925 "    if (s != 0)\n"
1926 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1927 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1928
1929 #. type: Plain text
1930 #: build/C/man3/pthread_attr_init.3:226
1931 #, no-wrap
1932 msgid ""
1933 "    s = pthread_attr_getguardsize(attr, &v);\n"
1934 "    if (s != 0)\n"
1935 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1936 "    printf(\"%sGuard size          = %zu bytes\\en\", prefix, v);\n"
1937 msgstr ""
1938 "    s = pthread_attr_getguardsize(attr, &v);\n"
1939 "    if (s != 0)\n"
1940 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1941 "    printf(\"%sGuard size          = %zu bytes\\en\", prefix, v);\n"
1942
1943 #. type: Plain text
1944 #: build/C/man3/pthread_attr_init.3:233
1945 #, no-wrap
1946 msgid ""
1947 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1948 "    if (s != 0)\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"
1952 "}\n"
1953 msgstr ""
1954 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1955 "    if (s != 0)\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"
1959 "}\n"
1960
1961 #. type: Plain text
1962 #: build/C/man3/pthread_attr_init.3:239
1963 #, no-wrap
1964 msgid ""
1965 "static void *\n"
1966 "thread_start(void *arg)\n"
1967 "{\n"
1968 "    int s;\n"
1969 "    pthread_attr_t gattr;\n"
1970 msgstr ""
1971 "static void *\n"
1972 "thread_start(void *arg)\n"
1973 "{\n"
1974 "    int s;\n"
1975 "    pthread_attr_t gattr;\n"
1976
1977 #. type: Plain text
1978 #: build/C/man3/pthread_attr_init.3:243
1979 #, no-wrap
1980 msgid ""
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"
1984 msgstr ""
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"
1988
1989 #. type: Plain text
1990 #: build/C/man3/pthread_attr_init.3:247
1991 #, no-wrap
1992 msgid ""
1993 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1994 "    if (s != 0)\n"
1995 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1996 msgstr ""
1997 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1998 "    if (s != 0)\n"
1999 "        handle_error_en(s, \"pthread_getattr_np\");\n"
2000
2001 #. type: Plain text
2002 #: build/C/man3/pthread_attr_init.3:250
2003 #, no-wrap
2004 msgid ""
2005 "    printf(\"Thread attributes:\\en\");\n"
2006 "    display_pthread_attr(&gattr, \"\\et\");\n"
2007 msgstr ""
2008 "    printf(\"Thread attributes:\\en\");\n"
2009 "    display_pthread_attr(&gattr, \"\\et\");\n"
2010
2011 #. type: Plain text
2012 #: build/C/man3/pthread_attr_init.3:253 build/C/man3/pthread_getattr_np.3:254
2013 #, no-wrap
2014 msgid ""
2015 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
2016 "}\n"
2017 msgstr ""
2018 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
2019 "}\n"
2020
2021 #. type: Plain text
2022 #: build/C/man3/pthread_attr_init.3:261
2023 #, no-wrap
2024 msgid ""
2025 "int\n"
2026 "main(int argc, char *argv[])\n"
2027 "{\n"
2028 "    pthread_t thr;\n"
2029 "    pthread_attr_t attr;\n"
2030 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
2031 "    int s;\n"
2032 msgstr ""
2033 "int\n"
2034 "main(int argc, char *argv[])\n"
2035 "{\n"
2036 "    pthread_t thr;\n"
2037 "    pthread_attr_t attr;\n"
2038 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
2039 "    int s;\n"
2040
2041 #. type: Plain text
2042 #: build/C/man3/pthread_attr_init.3:263
2043 #: build/C/man3/pthread_setschedparam.3:368
2044 #, no-wrap
2045 msgid "    attrp = NULL;\n"
2046 msgstr "    attrp = NULL;\n"
2047
2048 #. type: Plain text
2049 #: build/C/man3/pthread_attr_init.3:267
2050 #, no-wrap
2051 msgid ""
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"
2055 msgstr ""
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"
2059
2060 #. type: Plain text
2061 #: build/C/man3/pthread_attr_init.3:271
2062 #, no-wrap
2063 msgid ""
2064 "    if (argc E<gt> 1) {\n"
2065 "        size_t stack_size;\n"
2066 "        void *sp;\n"
2067 msgstr ""
2068 "    if (argc E<gt> 1) {\n"
2069 "        size_t stack_size;\n"
2070 "        void *sp;\n"
2071
2072 #. type: Plain text
2073 #: build/C/man3/pthread_attr_init.3:273
2074 #, no-wrap
2075 msgid "        attrp = &attr;\n"
2076 msgstr "        attrp = &attr;\n"
2077
2078 #. type: Plain text
2079 #: build/C/man3/pthread_attr_init.3:277
2080 #, no-wrap
2081 msgid ""
2082 "        s = pthread_attr_init(&attr);\n"
2083 "        if (s != 0)\n"
2084 "            handle_error_en(s, \"pthread_attr_init\");\n"
2085 msgstr ""
2086 "        s = pthread_attr_init(&attr);\n"
2087 "        if (s != 0)\n"
2088 "            handle_error_en(s, \"pthread_attr_init\");\n"
2089
2090 #. type: Plain text
2091 #: build/C/man3/pthread_attr_init.3:281
2092 #, no-wrap
2093 msgid ""
2094 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
2095 "        if (s != 0)\n"
2096 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
2097 msgstr ""
2098 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
2099 "        if (s != 0)\n"
2100 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
2101
2102 #. type: Plain text
2103 #: build/C/man3/pthread_attr_init.3:285
2104 #, no-wrap
2105 msgid ""
2106 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
2107 "        if (s != 0)\n"
2108 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
2109 msgstr ""
2110 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
2111 "        if (s != 0)\n"
2112 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
2113
2114 #. type: Plain text
2115 #: build/C/man3/pthread_attr_init.3:287
2116 #, no-wrap
2117 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
2118 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
2119
2120 #. type: Plain text
2121 #: build/C/man3/pthread_attr_init.3:291
2122 #, no-wrap
2123 msgid ""
2124 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
2125 "        if (s != 0)\n"
2126 "            handle_error_en(s, \"posix_memalign\");\n"
2127 msgstr ""
2128 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
2129 "        if (s != 0)\n"
2130 "            handle_error_en(s, \"posix_memalign\");\n"
2131
2132 #. type: Plain text
2133 #: build/C/man3/pthread_attr_init.3:293
2134 #, no-wrap
2135 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
2136 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
2137
2138 #. type: Plain text
2139 #: build/C/man3/pthread_attr_init.3:298
2140 #, no-wrap
2141 msgid ""
2142 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
2143 "        if (s != 0)\n"
2144 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
2145 "    }\n"
2146 msgstr ""
2147 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
2148 "        if (s != 0)\n"
2149 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
2150 "    }\n"
2151
2152 #. type: Plain text
2153 #: build/C/man3/pthread_attr_init.3:302 build/C/man3/pthread_getattr_np.3:349
2154 #, no-wrap
2155 msgid ""
2156 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
2157 "    if (s != 0)\n"
2158 "        handle_error_en(s, \"pthread_create\");\n"
2159 msgstr ""
2160 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
2161 "    if (s != 0)\n"
2162 "        handle_error_en(s, \"pthread_create\");\n"
2163
2164 #. type: Plain text
2165 #: build/C/man3/pthread_attr_init.3:308 build/C/man3/pthread_getattr_np.3:355
2166 #, no-wrap
2167 msgid ""
2168 "    if (attrp != NULL) {\n"
2169 "        s = pthread_attr_destroy(attrp);\n"
2170 "        if (s != 0)\n"
2171 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
2172 "    }\n"
2173 msgstr ""
2174 "    if (attrp != NULL) {\n"
2175 "        s = pthread_attr_destroy(attrp);\n"
2176 "        if (s != 0)\n"
2177 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
2178 "    }\n"
2179
2180 #. type: Plain text
2181 #: build/C/man3/pthread_attr_init.3:311 build/C/man3/pthread_getattr_np.3:358
2182 #, no-wrap
2183 msgid ""
2184 "    pause();    /* Terminates when other thread calls exit() */\n"
2185 "}\n"
2186 msgstr ""
2187 "    pause();    /* Terminates when other thread calls exit() */\n"
2188 "}\n"
2189
2190 #. type: Plain text
2191 #: build/C/man3/pthread_attr_init.3:330
2192 msgid ""
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)"
2201
2202 #. type: TH
2203 #: build/C/man3/pthread_attr_setaffinity_np.3:26
2204 #, no-wrap
2205 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
2206 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
2207
2208 #. type: TH
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
2217 #, no-wrap
2218 msgid "2017-09-15"
2219 msgstr "2017-09-15"
2220
2221 #. type: Plain text
2222 #: build/C/man3/pthread_attr_setaffinity_np.3:30
2223 msgid ""
2224 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
2225 "affinity attribute in thread attributes object"
2226 msgstr ""
2227 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
2228 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
2229
2230 #. type: Plain text
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
2237 #, no-wrap
2238 msgid ""
2239 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
2240 "B<#include E<lt>pthread.hE<gt>>\n"
2241 msgstr ""
2242 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
2243 "B<#include E<lt>pthread.hE<gt>>\n"
2244
2245 #. type: Plain text
2246 #: build/C/man3/pthread_attr_setaffinity_np.3:39
2247 #, no-wrap
2248 msgid ""
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"
2253 msgstr ""
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"
2258
2259 #. type: Plain text
2260 #: build/C/man3/pthread_attr_setaffinity_np.3:54
2261 msgid ""
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>."
2266 msgstr ""
2267 "B<pthread_attr_setaffinity_np>() 関数は、\n"
2268 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
2269 "I<cpuset> で指定された値に設定する。\n"
2270 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2271 "作成されたスレッドの CPU affinity マスクが決定される。"
2272
2273 #. type: Plain text
2274 #: build/C/man3/pthread_attr_setaffinity_np.3:63
2275 msgid ""
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>."
2279 msgstr ""
2280 "B<pthread_attr_getaffinity_np>() 関数は、 I<attr> が参照する\n"
2281 "スレッド属性オブジェクトの CPU affinity マスク属性を\n"
2282 "I<cpuset> が指すバッファーに入れて返す。"
2283
2284 #. type: Plain text
2285 #: build/C/man3/pthread_attr_setaffinity_np.3:70
2286 msgid ""
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)>."
2290 msgstr ""
2291 "I<cpusetsize> 引数は I<cpuset> が指すバッファーの (バイト単位の)\n"
2292 "大きさである。通常は、この引数には I<sizeof(cpu_set_t)> を\n"
2293 "指定することだろう。"
2294
2295 #. type: Plain text
2296 #: build/C/man3/pthread_attr_setaffinity_np.3:76
2297 #: build/C/man3/pthread_setaffinity_np.3:67
2298 msgid ""
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)."
2302 msgstr ""
2303 "CPU affinity マスクの詳細については、 \n"
2304 "B<sched_setaffinity>(2) を参照してほしい。\n"
2305 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
2306 "B<CPU_SET>(3) を参照してほしい。"
2307
2308 #. type: TP
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
2335 #, no-wrap
2336 msgid "B<EINVAL>"
2337 msgstr "B<EINVAL>"
2338
2339 #.  cpumask_t
2340 #.  The raw sched_getaffinity() system call returns the size (in bytes)
2341 #.  of the cpumask_t type.
2342 #. type: Plain text
2343 #: build/C/man3/pthread_attr_setaffinity_np.3:92
2344 msgid ""
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.)"
2349 msgstr ""
2350 "(B<pthread_attr_setaffinity_np>())\n"
2351 "I<cpuset> がカーネルがサポートする CPU 集合にない CPU を指定していた。\n"
2352 "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲"
2353 "は、\n"
2354 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
2355
2356 #. type: Plain text
2357 #: build/C/man3/pthread_attr_setaffinity_np.3:102
2358 msgid ""
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)."
2362 msgstr ""
2363 "(B<pthread_attr_getaffinity_np>())\n"
2364 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
2365 "I<cpusetsize> により指定された範囲の中になかった\n"
2366 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
2367
2368 #. type: Plain text
2369 #: build/C/man3/pthread_attr_setaffinity_np.3:106
2370 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
2371 msgstr ""
2372 "(B<pthread_attr_setaffinity_np>()) メモリーを割り当てることができなかった。"
2373
2374 #. type: Plain text
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 以降で提供されている。"
2379
2380 #. type: tbl table
2381 #: build/C/man3/pthread_attr_setaffinity_np.3:119
2382 #, no-wrap
2383 msgid ""
2384 "B<pthread_attr_setaffinity_np>(),\n"
2385 "B<pthread_attr_getaffinity_np>()"
2386 msgstr ""
2387 "B<pthread_attr_setaffinity_np>(),\n"
2388 "B<pthread_attr_getaffinity_np>()"
2389
2390 #. type: Plain text
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
2396 msgid ""
2397 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
2398 "\" (nonportable) in the names."
2399 msgstr ""
2400 "これらの関数は非標準の GNU による拡張である。\n"
2401 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
2402 "付いている。"
2403
2404 #. type: Plain text
2405 #: build/C/man3/pthread_attr_setaffinity_np.3:132
2406 #: build/C/man3/pthread_setaffinity_np.3:159
2407 msgid ""
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)>."
2411 msgstr ""
2412 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
2413 "これらの関数は I<cpusetsize> 引数を持っていなかった。\n"
2414 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
2415 "常に I<sizeof(cpu_set_t)> であった。"
2416
2417 #. type: Plain text
2418 #: build/C/man3/pthread_attr_setaffinity_np.3:138
2419 msgid ""
2420 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2421 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2422 msgstr ""
2423 "B<sched_setaffinity>(2), B<pthread_attr_init>(3), "
2424 "B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
2425
2426 #. type: TH
2427 #: build/C/man3/pthread_attr_setdetachstate.3:26
2428 #, no-wrap
2429 msgid "PTHREAD_ATTR_SETDETACHSTATE"
2430 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
2431
2432 #. type: TH
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
2447 #, no-wrap
2448 msgid "2020-06-09"
2449 msgstr "2020-06-09"
2450
2451 #. type: Plain text
2452 #: build/C/man3/pthread_attr_setdetachstate.3:30
2453 msgid ""
2454 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach "
2455 "state attribute in thread attributes object"
2456 msgstr ""
2457 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
2458 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
2459
2460 #. type: Plain text
2461 #: build/C/man3/pthread_attr_setdetachstate.3:38
2462 #, no-wrap
2463 msgid ""
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"
2467 msgstr ""
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"
2471
2472 #. type: Plain text
2473 #: build/C/man3/pthread_attr_setdetachstate.3:53
2474 msgid ""
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."
2480 msgstr ""
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 (切り離された) 状態で作成されるかが決定される。"
2487
2488 #. type: Plain text
2489 #: build/C/man3/pthread_attr_setdetachstate.3:56
2490 msgid "The following values may be specified in I<detachstate>:"
2491 msgstr "I<detachstate> には以下の値を指定できる。"
2492
2493 #. type: TP
2494 #: build/C/man3/pthread_attr_setdetachstate.3:56
2495 #, no-wrap
2496 msgid "B<PTHREAD_CREATE_DETACHED>"
2497 msgstr "B<PTHREAD_CREATE_DETACHED>"
2498
2499 #. type: Plain text
2500 #: build/C/man3/pthread_attr_setdetachstate.3:61
2501 msgid ""
2502 "Threads that are created using I<attr> will be created in a detached state."
2503 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
2504
2505 #. type: TP
2506 #: build/C/man3/pthread_attr_setdetachstate.3:61
2507 #, no-wrap
2508 msgid "B<PTHREAD_CREATE_JOINABLE>"
2509 msgstr "B<PTHREAD_CREATE_JOINABLE>"
2510
2511 #. type: Plain text
2512 #: build/C/man3/pthread_attr_setdetachstate.3:66
2513 msgid ""
2514 "Threads that are created using I<attr> will be created in a joinable state."
2515 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
2516
2517 #. type: Plain text
2518 #: build/C/man3/pthread_attr_setdetachstate.3:70
2519 msgid ""
2520 "The default setting of the detach state attribute in a newly initialized "
2521 "thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
2522 msgstr ""
2523 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
2524 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
2525
2526 #. type: Plain text
2527 #: build/C/man3/pthread_attr_setdetachstate.3:77
2528 msgid ""
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 "
2531 "I<detachstate>."
2532 msgstr ""
2533 "B<pthread_attr_getdetachstate>() は、\n"
2534 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
2535 "I<detachstate> が指すバッファーに入れて返す。"
2536
2537 #. type: Plain text
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>() は以下のエラーで失敗する場合がある。"
2541
2542 #. type: Plain text
2543 #: build/C/man3/pthread_attr_setdetachstate.3:87
2544 msgid "An invalid value was specified in I<detachstate>."
2545 msgstr "無効な値が I<detachstate> で指定された。"
2546
2547 #. type: tbl table
2548 #: build/C/man3/pthread_attr_setdetachstate.3:98
2549 #, no-wrap
2550 msgid ""
2551 "B<pthread_attr_setdetachstate>(),\n"
2552 "B<pthread_attr_getdetachstate>()"
2553 msgstr ""
2554 "B<pthread_attr_setdetachstate>(),\n"
2555 "B<pthread_attr_getdetachstate>()"
2556
2557 #. type: Plain text
2558 #: build/C/man3/pthread_attr_setdetachstate.3:106
2559 msgid ""
2560 "See B<pthread_create>(3)  for more details on detached and joinable threads."
2561 msgstr ""
2562 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
2563 "B<pthread_create>(3) を参照。"
2564
2565 #. type: Plain text
2566 #: build/C/man3/pthread_attr_setdetachstate.3:114
2567 msgid ""
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)."
2571 msgstr ""
2572 "join 可能状態で作成されたスレッドは、最終的に\n"
2573 "B<pthread_join>(3) を使って join するか、\n"
2574 "B<pthread_detach>(3) を使って切り離すか、\n"
2575 "のどちらかを行うべきである。"
2576
2577 #. type: Plain text
2578 #: build/C/man3/pthread_attr_setdetachstate.3:121
2579 msgid ""
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)."
2583 msgstr ""
2584 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
2585 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
2586 "エラーである。"
2587
2588 #. type: Plain text
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) を参照。"
2593
2594 #. type: Plain text
2595 #: build/C/man3/pthread_attr_setdetachstate.3:130
2596 msgid ""
2597 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2598 "B<pthread_join>(3), B<pthreads>(7)"
2599 msgstr ""
2600 "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), "
2601 "B<pthread_join>(3), B<pthreads>(7)"
2602
2603 #. type: TH
2604 #: build/C/man3/pthread_attr_setguardsize.3:26
2605 #, no-wrap
2606 msgid "PTHREAD_ATTR_SETGUARDSIZE"
2607 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
2608
2609 #. type: Plain text
2610 #: build/C/man3/pthread_attr_setguardsize.3:30
2611 msgid ""
2612 "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size "
2613 "attribute in thread attributes object"
2614 msgstr ""
2615 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
2616 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
2617
2618 #. type: Plain text
2619 #: build/C/man3/pthread_attr_setguardsize.3:38
2620 #, no-wrap
2621 msgid ""
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"
2625 msgstr ""
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"
2629
2630 #. type: Plain text
2631 #: build/C/man3/pthread_attr_setguardsize.3:49
2632 msgid ""
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>."
2636 msgstr ""
2637 "B<pthread_attr_setguardsize>() 関数は、\n"
2638 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
2639 "I<guardsize> で指定された値に設定する。"
2640
2641 #. type: Plain text
2642 #: build/C/man3/pthread_attr_setguardsize.3:59
2643 msgid ""
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)."
2648 msgstr ""
2649 "I<guardsize> が 0 より大きい場合、\n"
2650 "I<attr> を使って新しく作成された各スレッドに対して、\n"
2651 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
2652 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
2653 "機能する (ただし「バグ」の節も参照)。"
2654
2655 #. type: Plain text
2656 #: build/C/man3/pthread_attr_setguardsize.3:65
2657 msgid ""
2658 "If I<guardsize> is 0, then new threads created with I<attr> will not have a "
2659 "guard area."
2660 msgstr ""
2661 "I<guardsize> が 0 の場合、\n"
2662 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
2663
2664 #. type: Plain text
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 はシステムのページサイズと同じである。"
2668
2669 #. type: Plain text
2670 #: build/C/man3/pthread_attr_setguardsize.3:82
2671 msgid ""
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)."
2679 msgstr ""
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 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
2687
2688 #. type: Plain text
2689 #: build/C/man3/pthread_attr_setguardsize.3:90
2690 msgid ""
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>."
2694 msgstr ""
2695 "B<pthread_attr_getguardsize>() は、\n"
2696 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
2697 "I<guardsize> が指すバッファーに入れて返す。"
2698
2699 #. type: Plain text
2700 #: build/C/man3/pthread_attr_setguardsize.3:104
2701 msgid ""
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)."
2705 msgstr ""
2706 "POSIX.1 では、エラー B<EINVAL> が\n"
2707 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2708 "Linux では、これらの関数は常に成功する\n"
2709 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2710 "正のエラーの返り値を処理するようにすべきである)。"
2711
2712 #. type: Plain text
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 以降で提供されている。"
2718
2719 #. type: tbl table
2720 #: build/C/man3/pthread_attr_setguardsize.3:117
2721 #, no-wrap
2722 msgid ""
2723 "B<pthread_attr_setguardsize>(),\n"
2724 "B<pthread_attr_getguardsize>()"
2725 msgstr ""
2726 "B<pthread_attr_setguardsize>(),\n"
2727 "B<pthread_attr_getguardsize>()"
2728
2729 #. type: Plain text
2730 #: build/C/man3/pthread_attr_setguardsize.3:135
2731 msgid ""
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>().)"
2739 msgstr ""
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 が返される)。"
2748
2749 #. type: Plain text
2750 #: build/C/man3/pthread_attr_setguardsize.3:139
2751 msgid ""
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."
2754 msgstr ""
2755 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2756 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2757 "することで、メモリーを節約できることもある。"
2758
2759 #. type: Plain text
2760 #: build/C/man3/pthread_attr_setguardsize.3:143
2761 msgid ""
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 "
2764 "stack."
2765 msgstr ""
2766 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2767 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2768 "大きな guard size を選ぶ必要があるかもしれない。"
2769
2770 #. type: SH
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
2776 #, no-wrap
2777 msgid "BUGS"
2778 msgstr "バグ"
2779
2780 #. type: Plain text
2781 #: build/C/man3/pthread_attr_setguardsize.3:154
2782 msgid ""
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.)"
2788 msgstr ""
2789 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2790 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2791 "末尾に追加の領域を割り当てることが求められている。\n"
2792 "(このため、ガード領域が大きすぎて、\n"
2793 "実際のスタック用の場所がなくなってしまう場合、\n"
2794 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2795
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
2800 #.  Older reports:
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
2805 #. type: Plain text
2806 #: build/C/man3/pthread_attr_setguardsize.3:168
2807 msgid ""
2808 "The obsolete LinuxThreads implementation did the right thing, allocating "
2809 "extra space at the end of the stack for the guard area."
2810 msgstr ""
2811 "廃止予定の LinuxThreads 実装では、\n"
2812 "POSIX.1 で求められている通りの動作で、\n"
2813 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2814
2815 #. type: Plain text
2816 #: build/C/man3/pthread_attr_setguardsize.3:171
2817 msgid "See B<pthread_getattr_np>(3)."
2818 msgstr "B<pthread_getattr_np>(3) を参照。"
2819
2820 #. type: Plain text
2821 #: build/C/man3/pthread_attr_setguardsize.3:179
2822 msgid ""
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)"
2826 msgstr ""
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)"
2830
2831 #. type: TH
2832 #: build/C/man3/pthread_attr_setinheritsched.3:26
2833 #, no-wrap
2834 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2835 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2836
2837 #. type: Plain text
2838 #: build/C/man3/pthread_attr_setinheritsched.3:30
2839 msgid ""
2840 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit-"
2841 "scheduler attribute in thread attributes object"
2842 msgstr ""
2843 "pthread_attr_setinheritsched, pthread_attr_getinheritsched - スレッド属性オブ"
2844 "ジェクトの inherit-scheduler 属性の設定/取得を行う"
2845
2846 #. type: Plain text
2847 #: build/C/man3/pthread_attr_setinheritsched.3:38
2848 #, no-wrap
2849 msgid ""
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"
2854 msgstr ""
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"
2859
2860 #. type: Plain text
2861 #: build/C/man3/pthread_attr_setinheritsched.3:55
2862 msgid ""
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>."
2869 msgstr ""
2870 "B<pthread_attr_setinheritsched>() 関数は、 I<attr> が参照するスレッド属性オブ"
2871 "ジェクトの inherit-scheduler 属性を I<inheritsched> で指定された値に設定す"
2872 "る。 inherit-scheduler 属性により、スレッド属性オブジェクト I<attr> を使って"
2873 "作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承するか、 "
2874 "I<attr> からスケジューリング属性を取得するかが決定される。"
2875
2876 #. type: Plain text
2877 #: build/C/man3/pthread_attr_setinheritsched.3:64
2878 msgid ""
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))."
2883 msgstr ""
2884 "次に挙げるスケジューリング属性は inherit-scheduler 属性の影響を受ける: スケ"
2885 "ジューリングポリシー (B<pthread_attr_setschedpolicy>(3))、 スケジューリング優"
2886 "先度 (B<pthread_attr_setschedparam>(3))、 contention scope "
2887 "(B<pthread_attr_setscope>(3))。"
2888
2889 #. type: Plain text
2890 #: build/C/man3/pthread_attr_setinheritsched.3:67
2891 msgid "The following values may be specified in I<inheritsched>:"
2892 msgstr "以下の値を I<inheritsched> に指定できる。"
2893
2894 #. type: TP
2895 #: build/C/man3/pthread_attr_setinheritsched.3:67
2896 #, no-wrap
2897 msgid "B<PTHREAD_INHERIT_SCHED>"
2898 msgstr "B<PTHREAD_INHERIT_SCHED>"
2899
2900 #. type: Plain text
2901 #: build/C/man3/pthread_attr_setinheritsched.3:75
2902 msgid ""
2903 "Threads that are created using I<attr> inherit scheduling attributes from "
2904 "the creating thread; the scheduling attributes in I<attr> are ignored."
2905 msgstr ""
2906 "I<attr> を使って作成されたスレッドは、\n"
2907 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2908 "I<attr> 内のスケジューリング属性は無視される。"
2909
2910 #. type: TP
2911 #: build/C/man3/pthread_attr_setinheritsched.3:75
2912 #, no-wrap
2913 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2914 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2915
2916 #.  FIXME Document the defaults for scheduler settings
2917 #. type: Plain text
2918 #: build/C/man3/pthread_attr_setinheritsched.3:82
2919 msgid ""
2920 "Threads that are created using I<attr> take their scheduling attributes from "
2921 "the values specified by the attributes object."
2922 msgstr ""
2923 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2924 "指定された値からスケジューリング属性を取得する。"
2925
2926 #. type: Plain text
2927 #: build/C/man3/pthread_attr_setinheritsched.3:86
2928 msgid ""
2929 "The default setting of the inherit-scheduler attribute in a newly "
2930 "initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2931 msgstr ""
2932 "新たに初期化されたスレッド属性オブジェクトの inherit-scheduler 属性のデフォル"
2933 "ト設定は B<PTHREAD_INHERIT_SCHED> である。"
2934
2935 #. type: Plain text
2936 #: build/C/man3/pthread_attr_setinheritsched.3:93
2937 msgid ""
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>."
2941 msgstr ""
2942 "B<pthread_attr_getinheritsched>() は、 スレッド属性オブジェクト I<attr> の "
2943 "inherit-scheduler 属性を I<inheritsched> が指すバッファーに入れて返す。"
2944
2945 #. type: Plain text
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>() は以下のエラーで失敗する場合がある。"
2949
2950 #. type: Plain text
2951 #: build/C/man3/pthread_attr_setinheritsched.3:103
2952 msgid "Invalid value in I<inheritsched>."
2953 msgstr "I<inheritsched> に無効な値が指定された。"
2954
2955 #.  .SH VERSIONS
2956 #.  Available since glibc 2.0.
2957 #. type: Plain text
2958 #: build/C/man3/pthread_attr_setinheritsched.3:110
2959 msgid ""
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>()."
2963 msgstr ""
2964 "POSIX.1 では、 B<pthread_attr_setinheritsched>() に関して\n"
2965 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2966 "も追加で規定されている。"
2967
2968 #. type: tbl table
2969 #: build/C/man3/pthread_attr_setinheritsched.3:121
2970 #, no-wrap
2971 msgid ""
2972 "B<pthread_attr_setinheritsched>(),\n"
2973 "B<pthread_attr_getinheritsched>()"
2974 msgstr ""
2975 "B<pthread_attr_setinheritsched>(),\n"
2976 "B<pthread_attr_getinheritsched>()"
2977
2978 #.  FIXME . Track status of the following bug:
2979 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2980 #. type: Plain text
2981 #: build/C/man3/pthread_attr_setinheritsched.3:141
2982 msgid ""
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)."
2991 msgstr ""
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 "が明示的に設定された場合には、 このバグは発生しない。"
3000
3001 #. type: Plain text
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) を参照。"
3007
3008 #. type: Plain text
3009 #: build/C/man3/pthread_attr_setinheritsched.3:156
3010 msgid ""
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)"
3015 msgstr ""
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)"
3020
3021 #. type: TH
3022 #: build/C/man3/pthread_attr_setschedparam.3:26
3023 #, no-wrap
3024 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
3025 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
3026
3027 #. type: Plain text
3028 #: build/C/man3/pthread_attr_setschedparam.3:30
3029 msgid ""
3030 "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling "
3031 "parameter attributes in thread attributes object"
3032 msgstr ""
3033 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
3034 "スレッド属性オブジェクトのスケジューリングパラメーター属性の設定/取得を行う"
3035
3036 #. type: Plain text
3037 #: build/C/man3/pthread_attr_setschedparam.3:38
3038 #, no-wrap
3039 msgid ""
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"
3044 msgstr ""
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"
3049
3050 #. type: Plain text
3051 #: build/C/man3/pthread_attr_setschedparam.3:52
3052 msgid ""
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>."
3058 msgstr ""
3059 "B<pthread_attr_setschedparam>() 関数は、\n"
3060 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
3061 "パラメーター属性を I<param> が指すバッファーで指定された値に設定する。\n"
3062 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
3063 "作成されるスレッドのスケジューリングパラメーターが決定される。"
3064
3065 #. type: Plain text
3066 #: build/C/man3/pthread_attr_setschedparam.3:59
3067 msgid ""
3068 "The B<pthread_attr_getschedparam>()  returns the scheduling parameter "
3069 "attributes of the thread attributes object I<attr> in the buffer pointed to "
3070 "by I<param>."
3071 msgstr ""
3072 "B<pthread_attr_getschedparam>() は、\n"
3073 "スレッド属性オブジェクト I<attr> のスケジューリングパラメーター属性を\n"
3074 "I<param> が指すバッファーに入れて返す。"
3075
3076 #. type: Plain text
3077 #: build/C/man3/pthread_attr_setschedparam.3:61
3078 msgid "Scheduling parameters are maintained in the following structure:"
3079 msgstr "スケジューリングパラメーターは以下の構造体で管理される。"
3080
3081 #. type: Plain text
3082 #: build/C/man3/pthread_attr_setschedparam.3:67
3083 #: build/C/man3/pthread_setschedparam.3:69
3084 #, no-wrap
3085 msgid ""
3086 "struct sched_param {\n"
3087 "    int sched_priority;     /* Scheduling priority */\n"
3088 "};\n"
3089 msgstr ""
3090 "struct sched_param {\n"
3091 "    int sched_priority;     /* Scheduling priority */\n"
3092 "};\n"
3093
3094 #. type: Plain text
3095 #: build/C/man3/pthread_attr_setschedparam.3:74
3096 #: build/C/man3/pthread_setschedparam.3:76
3097 msgid ""
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, "
3100 "see B<sched>(7)."
3101 msgstr ""
3102 "見て分かる通り、サポートされているスケジューリングパラメーターは一つだけであ"
3103 "る。各スケジューリングポリシーで許可されるスケジューリング優先度の詳細につい"
3104 "ては、B<sched>(7) を参照のこと。"
3105
3106 #. type: Plain text
3107 #: build/C/man3/pthread_attr_setschedparam.3:85
3108 msgid ""
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>."
3113 msgstr ""
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> に設定しておかなければなら"
3118 "ない。"
3119
3120 #. type: Plain text
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>() は以下のエラーで失敗する場合がある。"
3124
3125 #. type: Plain text
3126 #: build/C/man3/pthread_attr_setschedparam.3:97
3127 #, fuzzy
3128 #| msgid ""
3129 #| "I<policy> is not a recognized policy, or I<param> does not make sense for "
3130 #| "the I<policy>."
3131 msgid ""
3132 "The priority specified in I<param> does not make sense for the current "
3133 "scheduling policy of I<attr>."
3134 msgstr ""
3135 "I<policy> が認識できないポリシーであるか、\n"
3136 "I<param> が I<policy> では意味を持たない値である。"
3137
3138 #.  .SH VERSIONS
3139 #.  Available since glibc 2.0.
3140 #. type: Plain text
3141 #: build/C/man3/pthread_attr_setschedparam.3:107
3142 #, fuzzy
3143 #| msgid ""
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)."
3148 msgid ""
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 "
3152 "return value)."
3153 msgstr ""
3154 "POSIX.1 では、\n"
3155 "B<pthread_attr_setschedparam>() について\n"
3156 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
3157 "Linux では、これらの関数は常に成功する\n"
3158 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
3159 "正のエラーの返り値を処理するようにすべきである)。"
3160
3161 #. type: tbl table
3162 #: build/C/man3/pthread_attr_setschedparam.3:118
3163 #, no-wrap
3164 msgid ""
3165 "B<pthread_attr_setschedparam>(),\n"
3166 "B<pthread_attr_getschedparam>()"
3167 msgstr ""
3168 "B<pthread_attr_setschedparam>(),\n"
3169 "B<pthread_attr_getschedparam>()"
3170
3171 #. type: Plain text
3172 #: build/C/man3/pthread_attr_setschedparam.3:126
3173 msgid ""
3174 "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling "
3175 "policies supported on Linux."
3176 msgstr ""
3177 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
3178 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
3179
3180 #. type: Plain text
3181 #: build/C/man3/pthread_attr_setschedparam.3:141
3182 msgid ""
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)"
3187 msgstr ""
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)"
3192
3193 #. type: TH
3194 #: build/C/man3/pthread_attr_setschedpolicy.3:26
3195 #, no-wrap
3196 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
3197 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
3198
3199 #. type: Plain text
3200 #: build/C/man3/pthread_attr_setschedpolicy.3:30
3201 msgid ""
3202 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get "
3203 "scheduling policy attribute in thread attributes object"
3204 msgstr ""
3205 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
3206 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
3207
3208 #. type: Plain text
3209 #: build/C/man3/pthread_attr_setschedpolicy.3:38
3210 #, no-wrap
3211 msgid ""
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"
3214 msgstr ""
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"
3217
3218 #. type: Plain text
3219 #: build/C/man3/pthread_attr_setschedpolicy.3:52
3220 msgid ""
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>."
3225 msgstr ""
3226 "B<pthread_attr_setschedpolicy>() 関数は、\n"
3227 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
3228 "ポリシー属性を I<policy> で指定された値に設定する。\n"
3229 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3230 "作成されるスレッドのスケジューリングポリシーが決定される。"
3231
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
3235 #. type: Plain text
3236 #: build/C/man3/pthread_attr_setschedpolicy.3:65
3237 msgid ""
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)."
3240 msgstr ""
3241 "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER> であ"
3242 "る。それぞれの意味は B<sched>(7) で説明している通りである。"
3243
3244 #. type: Plain text
3245 #: build/C/man3/pthread_attr_setschedpolicy.3:72
3246 msgid ""
3247 "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy "
3248 "attribute of the thread attributes object I<attr> in the buffer pointed to "
3249 "by I<policy>."
3250 msgstr ""
3251 "B<pthread_attr_getschedpolicy>() は、\n"
3252 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
3253 "I<policy> が指すバッファーに入れて返す。"
3254
3255 #. type: Plain text
3256 #: build/C/man3/pthread_attr_setschedpolicy.3:83
3257 msgid ""
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>."
3262 msgstr ""
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> に設定しておかなければなら"
3267 "ない。"
3268
3269 #. type: Plain text
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>() は以下のエラーで失敗する場合がある。"
3273
3274 #. type: Plain text
3275 #: build/C/man3/pthread_attr_setschedpolicy.3:93
3276 msgid "Invalid value in I<policy>."
3277 msgstr "I<policy> に無効な値が指定された。"
3278
3279 #.  .SH VERSIONS
3280 #.  Available since glibc 2.0.
3281 #. type: Plain text
3282 #: build/C/man3/pthread_attr_setschedpolicy.3:100
3283 msgid ""
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> (\"サポートされていない値を属性に設定しようとした\") も追加で規定されている。"
3288
3289 #. type: tbl table
3290 #: build/C/man3/pthread_attr_setschedpolicy.3:111
3291 #, no-wrap
3292 msgid ""
3293 "B<pthread_attr_setschedpolicy>(),\n"
3294 "B<pthread_attr_getschedpolicy>()"
3295 msgstr ""
3296 "B<pthread_attr_setschedpolicy>(),\n"
3297 "B<pthread_attr_getschedpolicy>()"
3298
3299 #. type: Plain text
3300 #: build/C/man3/pthread_attr_setschedpolicy.3:129
3301 msgid ""
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), "
3305 "B<sched>(7)"
3306 msgstr ""
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), "
3310 "B<sched>(7)"
3311
3312 #. type: TH
3313 #: build/C/man3/pthread_attr_setscope.3:26
3314 #, no-wrap
3315 msgid "PTHREAD_ATTR_SETSCOPE"
3316 msgstr "PTHREAD_ATTR_SETSCOPE"
3317
3318 #. type: Plain text
3319 #: build/C/man3/pthread_attr_setscope.3:30
3320 msgid ""
3321 "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope "
3322 "attribute in thread attributes object"
3323 msgstr ""
3324 "pthread_attr_setscope, pthread_attr_getscope - \n"
3325 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
3326
3327 #. type: Plain text
3328 #: build/C/man3/pthread_attr_setscope.3:38
3329 #, no-wrap
3330 msgid ""
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"
3333 msgstr ""
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"
3336
3337 #. type: Plain text
3338 #: build/C/man3/pthread_attr_setscope.3:53
3339 msgid ""
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 つの値が規定されている。"
3346
3347 #. type: TP
3348 #: build/C/man3/pthread_attr_setscope.3:53
3349 #, no-wrap
3350 msgid "B<PTHREAD_SCOPE_SYSTEM>"
3351 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
3352
3353 #. type: Plain text
3354 #: build/C/man3/pthread_attr_setscope.3:61
3355 msgid ""
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."
3360 msgstr ""
3361 "スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ\n"
3362 "のグループ) にある、システム上の全てのプロセスの自分以外の全ての\n"
3363 "スレッドとリソースを取り合う。 \n"
3364 "B<PTHREAD_SCOPE_SYSTEM> のスレッドは、スケジューリングポリシーと\n"
3365 "優先度に基づき、互いに相対的にスケジューリングされる。"
3366
3367 #. type: TP
3368 #: build/C/man3/pthread_attr_setscope.3:61
3369 #, no-wrap
3370 msgid "B<PTHREAD_SCOPE_PROCESS>"
3371 msgstr "B<PTHREAD_SCOPE_PROCESS>"
3372
3373 #. type: Plain text
3374 #: build/C/man3/pthread_attr_setscope.3:76
3375 msgid ""
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."
3383 msgstr ""
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"
3391 "規定されないままになっている。"
3392
3393 #. type: Plain text
3394 #: build/C/man3/pthread_attr_setscope.3:83
3395 msgid ""
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> はサポートしていない。"
3400
3401 #. type: Plain text
3402 #: build/C/man3/pthread_attr_setscope.3:95
3403 msgid ""
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>."
3409 msgstr ""
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> に設定"
3414 "しておかなければならない。"
3415
3416 #. type: Plain text
3417 #: build/C/man3/pthread_attr_setscope.3:103
3418 msgid ""
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>."
3422 msgstr ""
3423 "B<pthread_attr_getscope>() は、\n"
3424 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
3425 "I<scope> が指すバッファーに入れて返す。"
3426
3427 #. type: Plain text
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>() は以下のエラーで失敗する場合がある。"
3431
3432 #. type: Plain text
3433 #: build/C/man3/pthread_attr_setscope.3:113
3434 msgid "An invalid value was specified in I<scope>."
3435 msgstr "I<scope> に無効な値が指定された。"
3436
3437 #. type: TP
3438 #: build/C/man3/pthread_attr_setscope.3:113
3439 #: build/C/man3/pthread_mutexattr_getpshared.3:87
3440 #, no-wrap
3441 msgid "B<ENOTSUP>"
3442 msgstr "B<ENOTSUP>"
3443
3444 #. type: Plain text
3445 #: build/C/man3/pthread_attr_setscope.3:119
3446 msgid ""
3447 "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not "
3448 "supported on Linux."
3449 msgstr ""
3450 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
3451 "この値は Linux でサポートされていない。"
3452
3453 #. type: tbl table
3454 #: build/C/man3/pthread_attr_setscope.3:130
3455 #, no-wrap
3456 msgid ""
3457 "B<pthread_attr_setscope>(),\n"
3458 "B<pthread_attr_getscope>()"
3459 msgstr ""
3460 "B<pthread_attr_setscope>(),\n"
3461 "B<pthread_attr_getscope>()"
3462
3463 #. type: Plain text
3464 #: build/C/man3/pthread_attr_setscope.3:142
3465 msgid ""
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."
3470 msgstr ""
3471 "B<PTHREAD_SCOPE_SYSTEM> contention scope では、通常は、一つの\n"
3472 "ユーザー空間スレッドは一つのカーネルスケジューリングエンティティに\n"
3473 "直接結び付けられる。\n"
3474 "Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに\n"
3475 "該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。"
3476
3477 #. type: Plain text
3478 #: build/C/man3/pthread_attr_setscope.3:145
3479 msgid ""
3480 "POSIX.1 specifies that the default contention scope is implementation-"
3481 "defined."
3482 msgstr "POSIX.1 では、 contention scope 属性のデフォルト値は実装時で定義されるものと規定されている。"
3483
3484 #. type: Plain text
3485 #: build/C/man3/pthread_attr_setscope.3:155
3486 msgid ""
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)"
3490 msgstr ""
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)"
3494
3495 #. type: TH
3496 #: build/C/man3/pthread_attr_setstack.3:26
3497 #, no-wrap
3498 msgid "PTHREAD_ATTR_SETSTACK"
3499 msgstr "PTHREAD_ATTR_SETSTACK"
3500
3501 #. type: Plain text
3502 #: build/C/man3/pthread_attr_setstack.3:30
3503 msgid ""
3504 "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in "
3505 "thread attributes object"
3506 msgstr ""
3507 "pthread_attr_setstack, pthread_attr_getstack - \n"
3508 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
3509
3510 #. type: Plain text
3511 #: build/C/man3/pthread_attr_setstack.3:38
3512 #, no-wrap
3513 msgid ""
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"
3518 msgstr ""
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"
3523
3524 #. type: Plain text
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
3533 msgid ""
3534 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3535 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
3536
3537 #. type: Plain text
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>():"
3541
3542 #. type: Plain text
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"
3546
3547 #. type: Plain text
3548 #: build/C/man3/pthread_attr_setstack.3:68
3549 msgid ""
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>."
3555 msgstr ""
3556 "B<pthread_attr_setstack>() 関数は、\n"
3557 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
3558 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
3559 "指定された値に設定する。\n"
3560 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
3561 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
3562
3563 #. type: Plain text
3564 #: build/C/man3/pthread_attr_setstack.3:74
3565 msgid ""
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."
3569 msgstr ""
3570 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
3571 "バッファー内の指定できる最小のアドレスバイトを指すべきである。\n"
3572 "割り当てられたバッファーのページは読み書き両方が可能なページとなっている\n"
3573 "べきである。"
3574
3575 #. type: Plain text
3576 #: build/C/man3/pthread_attr_setstack.3:85
3577 msgid ""
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."
3581 msgstr ""
3582 "B<pthread_attr_getstack>() 関数は、\n"
3583 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
3584 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
3585 "指すバッファーに入れて返す。"
3586
3587 #. type: Plain text
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>() は以下のエラーで失敗する場合がある。"
3591
3592 #. type: Plain text
3593 #: build/C/man3/pthread_attr_setstack.3:102
3594 msgid ""
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."
3598 msgstr ""
3599 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
3600 "システムによっては、 I<stackaddr> か\n"
3601 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
3602 "このエラーが発生する。"
3603
3604 #. type: Plain text
3605 #: build/C/man3/pthread_attr_setstack.3:110
3606 msgid ""
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 "
3609 "caller."
3610 msgstr "POSIX.1 では エラー B<EACCES> も規定されており、このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に呼び出し側から読み書き両方のアクセスができない状況を表す。"
3611
3612 #. type: Plain text
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 以降で提供されている。"
3616
3617 #. type: tbl table
3618 #: build/C/man3/pthread_attr_setstack.3:123
3619 #, no-wrap
3620 msgid ""
3621 "B<pthread_attr_setstack>(),\n"
3622 "B<pthread_attr_getstack>()"
3623 msgstr ""
3624 "B<pthread_attr_setstack>(),\n"
3625 "B<pthread_attr_getstack>()"
3626
3627 #. type: Plain text
3628 #: build/C/man3/pthread_attr_setstack.3:135
3629 msgid ""
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.)"
3635 msgstr ""
3636 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
3637 "しなければならないアプリケーションのために提供されている。\n"
3638 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
3639 "これらの関数を使うのは避けるべきである。\n"
3640 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
3641 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
3642
3643 #. type: Plain text
3644 #: build/C/man3/pthread_attr_setstack.3:146
3645 msgid ""
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 "
3651 "stack overflow."
3652 msgstr ""
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 "スタックオーバーフローの可能性に対処するようにする必要がある。"
3660
3661 #. type: Plain text
3662 #: build/C/man3/pthread_attr_setstack.3:157
3663 msgid ""
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."
3668 msgstr ""
3669 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
3670 "完全な移植性を持たせるためには、\n"
3671 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
3672 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
3673 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
3674
3675 #. type: Plain text
3676 #: build/C/man3/pthread_attr_setstack.3:165
3677 msgid ""
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."
3682 msgstr ""
3683 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
3684 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
3685 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
3686 "さもなければ、複数のスレッドがスタックとして同じメモリー領域を\n"
3687 "使おうとするため、訳の分からない状況が発生してしまう。"
3688
3689 #. type: Plain text
3690 #: build/C/man3/pthread_attr_setstack.3:180
3691 msgid ""
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)"
3695 msgstr ""
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)"
3699
3700 #. type: TH
3701 #: build/C/man3/pthread_attr_setstackaddr.3:26
3702 #, no-wrap
3703 msgid "PTHREAD_ATTR_SETSTACKADDR"
3704 msgstr "PTHREAD_ATTR_SETSTACKADDR"
3705
3706 #. type: Plain text
3707 #: build/C/man3/pthread_attr_setstackaddr.3:30
3708 msgid ""
3709 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address "
3710 "attribute in thread attributes object"
3711 msgstr ""
3712 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
3713 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
3714
3715 #. type: Plain text
3716 #: build/C/man3/pthread_attr_setstackaddr.3:38
3717 #, no-wrap
3718 msgid ""
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"
3722 msgstr ""
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"
3726
3727 #. type: Plain text
3728 #: build/C/man3/pthread_attr_setstackaddr.3:49
3729 msgid ""
3730 "These functions are obsolete: B<do not use them.> Use "
3731 "B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
3732 msgstr ""
3733 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
3734 "代わりに B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使うこ"
3735 "と。"
3736
3737 #. type: Plain text
3738 #: build/C/man3/pthread_attr_setstackaddr.3:60
3739 msgid ""
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>."
3745 msgstr ""
3746 "B<pthread_attr_setstackaddr>() 関数は、\n"
3747 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3748 "属性を I<stackaddr> で指定された値に設定する。\n"
3749 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
3750 "作成されるスレッドが使用すべきスタックの位置が指定される。"
3751
3752 #. type: Plain text
3753 #: build/C/man3/pthread_attr_setstackaddr.3:66
3754 msgid ""
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."
3758 msgstr ""
3759 "I<stackaddr> は呼び出し側が割り当てたバッファー (大きさは\n"
3760 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
3761 "割り当てられたバッファーのページは読み書き両方が可能なページと\n"
3762 "なっているべきである。"
3763
3764 #. type: Plain text
3765 #: build/C/man3/pthread_attr_setstackaddr.3:74
3766 msgid ""
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>."
3770 msgstr ""
3771 "B<pthread_attr_getstackaddr>() は、\n"
3772 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3773 "I<stackaddr> が指すバッファーに入れて返す。"
3774
3775 #. type: Plain text
3776 #: build/C/man3/pthread_attr_setstackaddr.3:81
3777 msgid ""
3778 "No errors are defined (but applications should nevertheless handle a "
3779 "possible error return)."
3780 msgstr ""
3781 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
3782 "返り値を処理するようにすべきである)。"
3783
3784 #. type: tbl table
3785 #: build/C/man3/pthread_attr_setstackaddr.3:94
3786 #, no-wrap
3787 msgid ""
3788 "B<pthread_attr_setstackaddr>(),\n"
3789 "B<pthread_attr_getstackaddr>()"
3790 msgstr ""
3791 "B<pthread_attr_setstackaddr>(),\n"
3792 "B<pthread_attr_getstackaddr>()"
3793
3794 #. type: Plain text
3795 #: build/C/man3/pthread_attr_setstackaddr.3:99
3796 msgid ""
3797 "POSIX.1-2001 specifies these functions but marks them as obsolete.  "
3798 "POSIX.1-2008 removes the specification of these functions."
3799 msgstr ""
3800 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
3801 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
3802
3803 #. type: Plain text
3804 #: build/C/man3/pthread_attr_setstackaddr.3:123
3805 msgid ""
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)."
3816 msgstr ""
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> 引数はスタックの範囲を指定する)。"
3828
3829 #. type: Plain text
3830 #: build/C/man3/pthread_attr_setstackaddr.3:129
3831 msgid ""
3832 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3833 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3834 msgstr ""
3835 "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), "
3836 "B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
3837
3838 #. type: TH
3839 #: build/C/man3/pthread_attr_setstacksize.3:26
3840 #, no-wrap
3841 msgid "PTHREAD_ATTR_SETSTACKSIZE"
3842 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
3843
3844 #. type: Plain text
3845 #: build/C/man3/pthread_attr_setstacksize.3:30
3846 msgid ""
3847 "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size "
3848 "attribute in thread attributes object"
3849 msgstr ""
3850 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
3851 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
3852
3853 #. type: Plain text
3854 #: build/C/man3/pthread_attr_setstacksize.3:38
3855 #, no-wrap
3856 msgid ""
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"
3860 msgstr ""
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"
3864
3865 #. type: Plain text
3866 #: build/C/man3/pthread_attr_setstacksize.3:49
3867 msgid ""
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>."
3871 msgstr ""
3872 "B<pthread_attr_setstacksize>() 関数は、\n"
3873 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
3874 "属性を I<stacksize> で指定された値に設定する。"
3875
3876 #. type: Plain text
3877 #: build/C/man3/pthread_attr_setstacksize.3:53
3878 msgid ""
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>."
3881 msgstr ""
3882 "スタックサイズ属性により、\n"
3883 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
3884 "に割り当てられる最小サイズ (バイト単位) が決定される。"
3885
3886 #. type: Plain text
3887 #: build/C/man3/pthread_attr_setstacksize.3:61
3888 msgid ""
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>."
3892 msgstr ""
3893 "B<pthread_attr_getstacksize>() は、\n"
3894 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
3895 "I<stacksize> が指すバッファーに入れて返す。"
3896
3897 #. type: Plain text
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>() は以下のエラーで失敗する場合がある。"
3901
3902 #. type: Plain text
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) バイト未満である。"
3906
3907 #.  e.g., MacOS
3908 #. type: Plain text
3909 #: build/C/man3/pthread_attr_setstacksize.3:81
3910 msgid ""
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."
3913 msgstr ""
3914 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
3915 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
3916 "エラー B<EINVAL> で失敗する。"
3917
3918 #. type: tbl table
3919 #: build/C/man3/pthread_attr_setstacksize.3:94
3920 #, no-wrap
3921 msgid ""
3922 "B<pthread_attr_setstacksize>(),\n"
3923 "B<pthread_attr_getstacksize>()"
3924 msgstr ""
3925 "B<pthread_attr_setstacksize>(),\n"
3926 "B<pthread_attr_getstacksize>()"
3927
3928 #. type: Plain text
3929 #: build/C/man3/pthread_attr_setstacksize.3:101
3930 msgid ""
3931 "For details on the default stack size of new threads, see "
3932 "B<pthread_create>(3)."
3933 msgstr ""
3934 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
3935 "B<pthread_create>(3) を参照。"
3936
3937 #. type: Plain text
3938 #: build/C/man3/pthread_attr_setstacksize.3:104
3939 msgid ""
3940 "A thread's stack size is fixed at the time of thread creation.  Only the "
3941 "main thread can dynamically grow its stack."
3942 msgstr ""
3943 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
3944 "メインスレッドだけがスタックを動的に伸ばすことができる。"
3945
3946 #. type: Plain text
3947 #: build/C/man3/pthread_attr_setstacksize.3:109
3948 msgid ""
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 "
3951 "thread."
3952 msgstr ""
3953 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
3954 "アプリケーションは、スレッドが使用するスタックとして、\n"
3955 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
3956
3957 #. type: Plain text
3958 #: build/C/man3/pthread_attr_setstacksize.3:121
3959 msgid ""
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> バイトになると書かれている。"
3965
3966 #. type: Plain text
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) を参照。"
3970
3971 #. type: Plain text
3972 #: build/C/man3/pthread_attr_setstacksize.3:131
3973 msgid ""
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)"
3976 msgstr ""
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)"
3979
3980 #. type: TH
3981 #: build/C/man3/pthread_cancel.3:26
3982 #, no-wrap
3983 msgid "PTHREAD_CANCEL"
3984 msgstr "PTHREAD_CANCEL"
3985
3986 #. type: Plain text
3987 #: build/C/man3/pthread_cancel.3:29
3988 msgid "pthread_cancel - send a cancellation request to a thread"
3989 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
3990
3991 #. type: Plain text
3992 #: build/C/man3/pthread_cancel.3:34
3993 #, no-wrap
3994 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3995 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
3996
3997 #. type: Plain text
3998 #: build/C/man3/pthread_cancel.3:49
3999 msgid ""
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>."
4004 msgstr ""
4005 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
4006 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
4007 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
4008 "I<state> と I<type>により決まる。"
4009
4010 #. type: Plain text
4011 #: build/C/man3/pthread_cancel.3:61
4012 msgid ""
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."
4018 msgstr ""
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 によって、いつキャンセルが発生するかが決まる。"
4025
4026 #. type: Plain text
4027 #: build/C/man3/pthread_cancel.3:77
4028 msgid ""
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)."
4036 msgstr ""
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) に記載している。"
4047
4048 #. type: Plain text
4049 #: build/C/man3/pthread_cancel.3:81
4050 msgid ""
4051 "When a cancellation requested is acted on, the following steps occur for "
4052 "I<thread> (in this order):"
4053 msgstr ""
4054 "キャンセル要求が実行されると、\n"
4055 "I<thread> では以下のステップが (この順序で) 行われる。"
4056
4057 #. type: IP
4058 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:69
4059 #, no-wrap
4060 msgid "1."
4061 msgstr "1."
4062
4063 #. type: Plain text
4064 #: build/C/man3/pthread_cancel.3:86
4065 msgid ""
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).)"
4068 msgstr ""
4069 "キャンセルクリーンアップハンドラーが (push されたのと逆順で)\n"
4070 "取り出され (pop され)、呼び出される。\n"
4071 "(B<pthread_cleanup_push>(3) 参照)"
4072
4073 #. type: IP
4074 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:73
4075 #, no-wrap
4076 msgid "2."
4077 msgstr "2."
4078
4079 #. type: Plain text
4080 #: build/C/man3/pthread_cancel.3:91
4081 msgid ""
4082 "Thread-specific data destructors are called, in an unspecified order.  (See "
4083 "B<pthread_key_create>(3).)"
4084 msgstr ""
4085 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
4086 "呼び出し順序は規定されていない。\n"
4087 "(B<pthread_key_create>(3) 参照)"
4088
4089 #. type: IP
4090 #: build/C/man3/pthread_cancel.3:91 build/C/man3/pthread_cleanup_push.3:83
4091 #, no-wrap
4092 msgid "3."
4093 msgstr "3."
4094
4095 #. type: Plain text
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) 参照)"
4099
4100 #. type: Plain text
4101 #: build/C/man3/pthread_cancel.3:103
4102 msgid ""
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."
4106 msgstr ""
4107 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
4108 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
4109 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
4110
4111 #. type: Plain text
4112 #: build/C/man3/pthread_cancel.3:112
4113 msgid ""
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 "
4117 "has completed.)"
4118 msgstr ""
4119 "キャンセルされたスレッドが終了された後に、\n"
4120 "B<pthread_join>(3) でそのスレッドを join すると、\n"
4121 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
4122 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
4123
4124 #. type: Plain text
4125 #: build/C/man3/pthread_cancel.3:117
4126 msgid ""
4127 "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero "
4128 "error number."
4129 msgstr ""
4130 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
4131 "エラーの場合、0 以外のエラー番号を返す。"
4132
4133 #. type: TP
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
4139 #, no-wrap
4140 msgid "B<ESRCH>"
4141 msgstr "B<ESRCH>"
4142
4143 #. type: Plain text
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> のスレッドが見つからなかった。"
4151
4152 #. type: tbl table
4153 #: build/C/man3/pthread_cancel.3:135
4154 #, no-wrap
4155 msgid "B<pthread_cancel>()"
4156 msgstr "B<pthread_cancel>()"
4157
4158 #. type: Plain text
4159 #: build/C/man3/pthread_cancel.3:148
4160 msgid ""
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."
4165 msgstr ""
4166 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装で"
4167 "は、\n"
4168 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
4169 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイ"
4170 "ム\n"
4171 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
4172
4173 #. type: Plain text
4174 #: build/C/man3/pthread_cancel.3:154
4175 msgid ""
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 "
4179 "run the program:"
4180 msgstr ""
4181 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルす"
4182 "る。\n"
4183 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
4184 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
4185 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
4186
4187 #. type: Plain text
4188 #: build/C/man3/pthread_cancel.3:162
4189 #, no-wrap
4190 msgid ""
4191 "$ ./a.out\n"
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"
4196 msgstr ""
4197 "$ ./a.out\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"
4202
4203 #. type: Plain text
4204 #: build/C/man3/pthread_cancel.3:172
4205 #, no-wrap
4206 msgid ""
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"
4212 msgstr ""
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"
4218
4219 #. type: Plain text
4220 #: build/C/man3/pthread_cancel.3:180
4221 #, no-wrap
4222 msgid ""
4223 "static void *\n"
4224 "thread_func(void *ignored_argument)\n"
4225 "{\n"
4226 "    int s;\n"
4227 msgstr ""
4228 "static void *\n"
4229 "thread_func(void *ignored_argument)\n"
4230 "{\n"
4231 "    int s;\n"
4232
4233 #. type: Plain text
4234 #: build/C/man3/pthread_cancel.3:183
4235 #, no-wrap
4236 msgid ""
4237 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
4238 "       immediately react to a cancellation request */\n"
4239 msgstr ""
4240 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
4241 "       immediately react to a cancellation request */\n"
4242
4243 #. type: Plain text
4244 #: build/C/man3/pthread_cancel.3:187
4245 #, no-wrap
4246 msgid ""
4247 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
4248 "    if (s != 0)\n"
4249 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
4250 msgstr ""
4251 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
4252 "    if (s != 0)\n"
4253 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
4254
4255 #. type: Plain text
4256 #: build/C/man3/pthread_cancel.3:191
4257 #, no-wrap
4258 msgid ""
4259 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
4260 "    sleep(5);\n"
4261 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
4262 msgstr ""
4263 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
4264 "    sleep(5);\n"
4265 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
4266
4267 #. type: Plain text
4268 #: build/C/man3/pthread_cancel.3:195
4269 #, no-wrap
4270 msgid ""
4271 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
4272 "    if (s != 0)\n"
4273 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
4274 msgstr ""
4275 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
4276 "    if (s != 0)\n"
4277 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
4278
4279 #. type: Plain text
4280 #: build/C/man3/pthread_cancel.3:197
4281 #, no-wrap
4282 msgid "    /* sleep() is a cancellation point */\n"
4283 msgstr "    /* sleep() is a cancellation point */\n"
4284
4285 #. type: Plain text
4286 #: build/C/man3/pthread_cancel.3:199
4287 #, no-wrap
4288 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
4289 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
4290
4291 #. type: Plain text
4292 #: build/C/man3/pthread_cancel.3:201
4293 #, no-wrap
4294 msgid "    /* Should never get here */\n"
4295 msgstr "    /* Should never get here */\n"
4296
4297 #. type: Plain text
4298 #: build/C/man3/pthread_cancel.3:205
4299 #, no-wrap
4300 msgid ""
4301 "    printf(\"thread_func(): not canceled!\\en\");\n"
4302 "    return NULL;\n"
4303 "}\n"
4304 msgstr ""
4305 "    printf(\"thread_func(): not canceled!\\en\");\n"
4306 "    return NULL;\n"
4307 "}\n"
4308
4309 #. type: Plain text
4310 #: build/C/man3/pthread_cancel.3:212
4311 #, no-wrap
4312 msgid ""
4313 "int\n"
4314 "main(void)\n"
4315 "{\n"
4316 "    pthread_t thr;\n"
4317 "    void *res;\n"
4318 "    int s;\n"
4319 msgstr ""
4320 "int\n"
4321 "main(void)\n"
4322 "{\n"
4323 "    pthread_t thr;\n"
4324 "    void *res;\n"
4325 "    int s;\n"
4326
4327 #. type: Plain text
4328 #: build/C/man3/pthread_cancel.3:214
4329 #, no-wrap
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"
4332
4333 #. type: Plain text
4334 #: build/C/man3/pthread_cancel.3:218
4335 #, no-wrap
4336 msgid ""
4337 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
4338 "    if (s != 0)\n"
4339 "        handle_error_en(s, \"pthread_create\");\n"
4340 msgstr ""
4341 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
4342 "    if (s != 0)\n"
4343 "        handle_error_en(s, \"pthread_create\");\n"
4344
4345 #. type: Plain text
4346 #: build/C/man3/pthread_cancel.3:220
4347 #, no-wrap
4348 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
4349 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
4350
4351 #. type: Plain text
4352 #: build/C/man3/pthread_cancel.3:225
4353 #, no-wrap
4354 msgid ""
4355 "    printf(\"main(): sending cancellation request\\en\");\n"
4356 "    s = pthread_cancel(thr);\n"
4357 "    if (s != 0)\n"
4358 "        handle_error_en(s, \"pthread_cancel\");\n"
4359 msgstr ""
4360 "    printf(\"main(): sending cancellation request\\en\");\n"
4361 "    s = pthread_cancel(thr);\n"
4362 "    if (s != 0)\n"
4363 "        handle_error_en(s, \"pthread_cancel\");\n"
4364
4365 #. type: Plain text
4366 #: build/C/man3/pthread_cancel.3:227
4367 #, no-wrap
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"
4370
4371 #. type: Plain text
4372 #: build/C/man3/pthread_cancel.3:231 build/C/man3/pthread_cleanup_push.3:321
4373 #, no-wrap
4374 msgid ""
4375 "    s = pthread_join(thr, &res);\n"
4376 "    if (s != 0)\n"
4377 "        handle_error_en(s, \"pthread_join\");\n"
4378 msgstr ""
4379 "    s = pthread_join(thr, &res);\n"
4380 "    if (s != 0)\n"
4381 "        handle_error_en(s, \"pthread_join\");\n"
4382
4383 #. type: Plain text
4384 #: build/C/man3/pthread_cancel.3:238
4385 #, no-wrap
4386 msgid ""
4387 "    if (res == PTHREAD_CANCELED)\n"
4388 "        printf(\"main(): thread was canceled\\en\");\n"
4389 "    else\n"
4390 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
4391 "    exit(EXIT_SUCCESS);\n"
4392 "}\n"
4393 msgstr ""
4394 "    if (res == PTHREAD_CANCELED)\n"
4395 "        printf(\"main(): thread was canceled\\en\");\n"
4396 "    else\n"
4397 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
4398 "    exit(EXIT_SUCCESS);\n"
4399 "}\n"
4400
4401 #. type: Plain text
4402 #: build/C/man3/pthread_cancel.3:251
4403 msgid ""
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)"
4407 msgstr ""
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)"
4411
4412 #. type: TH
4413 #: build/C/man3/pthread_cleanup_push.3:26
4414 #, no-wrap
4415 msgid "PTHREAD_CLEANUP_PUSH"
4416 msgstr "PTHREAD_CLEANUP_PUSH"
4417
4418 #. type: Plain text
4419 #: build/C/man3/pthread_cleanup_push.3:30
4420 msgid ""
4421 "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation "
4422 "clean-up handlers"
4423 msgstr ""
4424 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
4425 "キャンセルクリーンアップハンドラーの push/pop を行う"
4426
4427 #. type: Plain text
4428 #: build/C/man3/pthread_cleanup_push.3:37
4429 #, no-wrap
4430 msgid ""
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"
4434 msgstr ""
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"
4438
4439 #. type: Plain text
4440 #: build/C/man3/pthread_cleanup_push.3:48
4441 msgid ""
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."
4447 msgstr ""
4448 "これらの関数は、呼び出したスレッドのスレッドキャンセル時のクリーンアッ\n"
4449 "プハンドラーのスタックの操作を行う。クリーンアップハンドラーは、スレッドが\n"
4450 "キャンセルされた場合 (や以下で説明する他の種々の状況において) 自動的に\n"
4451 "実行される関数である。例えば、mutex のロック解除を行い、プロセス内の\n"
4452 "他のスレッドが利用できるようにする関数などが考えられる。"
4453
4454 #. type: Plain text
4455 #: build/C/man3/pthread_cleanup_push.3:59
4456 msgid ""
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."
4460 msgstr ""
4461 "B<pthread_cleanup_push>() 関数は、 I<routine> をクリーンアップ\n"
4462 "ハンドラーのスタックの一番上にプッシュする。 I<routine> が後で\n"
4463 "起動される際には、 I<arg> が関数の引数と渡される。"
4464
4465 #. type: Plain text
4466 #: build/C/man3/pthread_cleanup_push.3:66
4467 msgid ""
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 "
4470 "nonzero."
4471 msgstr ""
4472 "B<pthread_cleanup_pop>() 関数は、クリーンアップハンドラーの\n"
4473 "スタックの一番上のルーチンを削除する。\n"
4474 "I<execute> が 0 以外の場合にはそのルーチンを追加で実行する。"
4475
4476 #. type: Plain text
4477 #: build/C/man3/pthread_cleanup_push.3:69
4478 msgid ""
4479 "A cancellation clean-up handler is popped from the stack and executed in the "
4480 "following circumstances:"
4481 msgstr ""
4482 "キャンセルクリーンアップハンドラーは、以下に示す場合に\n"
4483 "スタックから取り出され実行される。"
4484
4485 #. type: Plain text
4486 #: build/C/man3/pthread_cleanup_push.3:73
4487 msgid ""
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 "
4490 "stack."
4491 msgstr ""
4492 "スレッドがキャンセルされた際に、スタックに登録された全てのクリーン\n"
4493 "アップハンドラーが取り出されて、実行される。クリーンアップハンドラーの\n"
4494 "実行は、スタックに登録されたのと逆の順序で行われる。"
4495
4496 #. type: Plain text
4497 #: build/C/man3/pthread_cleanup_push.3:83
4498 msgid ""
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.)"
4503 msgstr ""
4504 "スレッドが B<pthread_exit>(3) を呼び出して終了する際に、全てのクリーン\n"
4505 "アップハンドラーが上の項目で述べたのと同様に実行される。\n"
4506 "(スレッドがスレッド開始関数からの I<return> の実行により終了する場合に\n"
4507 "は、クリーンアップハンドラーはI<呼び出されない>。)"
4508
4509 #. type: Plain text
4510 #: build/C/man3/pthread_cleanup_push.3:89
4511 msgid ""
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."
4514 msgstr ""
4515 "スレッドが 0 以外の I<execute> 引数で B<pthread_cleanup_pop>() を\n"
4516 "呼び出した際に、スタックの一番上のクリーンアップハンドラーが取り出されて\n"
4517 "実行される。"
4518
4519 #. type: Plain text
4520 #: build/C/man3/pthread_cleanup_push.3:101
4521 msgid ""
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.)"
4528 msgstr ""
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 "の特定のセクションの実行の中でのみ設定するものであると言える。)"
4536
4537 #. type: Plain text
4538 #: build/C/man3/pthread_cleanup_push.3:121
4539 msgid ""
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."
4547 msgstr ""
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"
4555 "結果になるかは不定である。"
4556
4557 #. type: Plain text
4558 #: build/C/man3/pthread_cleanup_push.3:123
4559 msgid "These functions do not return a value."
4560 msgstr "これらの関数は値を返さない。"
4561
4562 #.  SH VERSIONS
4563 #.  Available since glibc 2.0
4564 #. type: Plain text
4565 #: build/C/man3/pthread_cleanup_push.3:127
4566 msgid "There are no errors."
4567 msgstr "エラーはない。"
4568
4569 #. type: tbl table
4570 #: build/C/man3/pthread_cleanup_push.3:138
4571 #, no-wrap
4572 msgid ""
4573 "B<pthread_cleanup_push>(),\n"
4574 "B<pthread_cleanup_pop>()"
4575 msgstr ""
4576 "B<pthread_cleanup_push>(),\n"
4577 "B<pthread_cleanup_pop>()"
4578
4579 #. type: Plain text
4580 #: build/C/man3/pthread_cleanup_push.3:154
4581 msgid ""
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."
4587 msgstr ""
4588 "Linux では、関数 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>()\n"
4589 "は、それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開する\n"
4590 "マクロとして実装されている。このことは、これらの関数を対で呼び出した\n"
4591 "スコープ内で宣言された変数は、そのスコープの中でしか参照できない\n"
4592 "ということを意味している。"
4593
4594 #.  The text was actually added in the 2004 TC2
4595 #. type: Plain text
4596 #: build/C/man3/pthread_cleanup_push.3:169
4597 msgid ""
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 "
4601 "avoid doing this."
4602 msgstr ""
4603 "POSIX.1 には、括弧を含む B<pthread_cleanup_push>() と\n"
4604 "B<pthread_cleanup_pop>() のブロックをそのままにしたままで、 \n"
4605 "I<return>, I<break>, I<continue>, I<goto> を使った場合の影響は\n"
4606 "不定であると書かれている。\n"
4607 "移植性が必要なアプリケーションではこれを行うのは避けるべきである。"
4608
4609 #. type: Plain text
4610 #: build/C/man3/pthread_cleanup_push.3:184
4611 msgid ""
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>)."
4619 msgstr ""
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"
4627 "設定したりする。"
4628
4629 #. type: Plain text
4630 #: build/C/man3/pthread_cleanup_push.3:187
4631 msgid ""
4632 "In the following shell session, the main thread sends a cancellation request "
4633 "to the other thread:"
4634 msgstr ""
4635 "以下のシェルセッションでは、メインスレッドはもう一つのスレッドに\n"
4636 "キャンセル要求を送信する。"
4637
4638 #. type: Plain text
4639 #: build/C/man3/pthread_cleanup_push.3:197
4640 #, no-wrap
4641 msgid ""
4642 "$ B<./a.out>\n"
4643 "New thread started\n"
4644 "cnt = 0\n"
4645 "cnt = 1\n"
4646 "Canceling thread\n"
4647 "Called clean-up handler\n"
4648 "Thread was canceled; cnt = 0\n"
4649 msgstr ""
4650 "$ B<./a.out>\n"
4651 "New thread started\n"
4652 "cnt = 0\n"
4653 "cnt = 1\n"
4654 "Canceling thread\n"
4655 "Called clean-up handler\n"
4656 "Thread was canceled; cnt = 0\n"
4657
4658 #. type: Plain text
4659 #: build/C/man3/pthread_cleanup_push.3:205
4660 msgid ""
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."
4664 msgstr ""
4665 "上記の実行例から、スレッドがキャンセルされ、\n"
4666 "キャンセルクリーンアップハンドラーが呼び出され、\n"
4667 "グローバル変数 I<cnt> の値が 0 にリセットされていることが確認できる。"
4668
4669 #. type: Plain text
4670 #: build/C/man3/pthread_cleanup_push.3:208
4671 msgid ""
4672 "In the next run, the main program sets a global variable that causes other "
4673 "thread to terminate normally:"
4674 msgstr ""
4675 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4676 "もう一つのスレッドが正常終了するようにしている。"
4677
4678 #. type: Plain text
4679 #: build/C/man3/pthread_cleanup_push.3:216
4680 #, no-wrap
4681 msgid ""
4682 "$ B<./a.out x>\n"
4683 "New thread started\n"
4684 "cnt = 0\n"
4685 "cnt = 1\n"
4686 "Thread terminated normally; cnt = 2\n"
4687 msgstr ""
4688 "$ B<./a.out x>\n"
4689 "New thread started\n"
4690 "cnt = 0\n"
4691 "cnt = 1\n"
4692 "Thread terminated normally; cnt = 2\n"
4693
4694 #. type: Plain text
4695 #: build/C/man3/pthread_cleanup_push.3:224
4696 msgid ""
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."
4699 msgstr ""
4700 "上記では、 (I<cleanup_pop_arg> が 0 なので) クリーンアップハンドラーは\n"
4701 "実行されておらず、その結果 I<cnt> の値はリセットされていないことが\n"
4702 "分かる。"
4703
4704 #. type: Plain text
4705 #: build/C/man3/pthread_cleanup_push.3:229
4706 msgid ""
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>:"
4710 msgstr ""
4711 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
4712 "もう一つのスレッドが正常終了するようにし、さらに\n"
4713 "I<cleanup_pop_arg> に 0 以外の値を渡している。"
4714
4715 #. type: Plain text
4716 #: build/C/man3/pthread_cleanup_push.3:238
4717 #, no-wrap
4718 msgid ""
4719 "$ B<./a.out x 1>\n"
4720 "New thread started\n"
4721 "cnt = 0\n"
4722 "cnt = 1\n"
4723 "Called clean-up handler\n"
4724 "Thread terminated normally; cnt = 0\n"
4725 msgstr ""
4726 "$ B<./a.out x 1>\n"
4727 "New thread started\n"
4728 "cnt = 0\n"
4729 "cnt = 1\n"
4730 "Called clean-up handler\n"
4731 "Thread terminated normally; cnt = 0\n"
4732
4733 #. type: Plain text
4734 #: build/C/man3/pthread_cleanup_push.3:245
4735 msgid ""
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 以外を渡したからである。"
4740
4741 #. type: Plain text
4742 #: build/C/man3/pthread_cleanup_push.3:254
4743 #, no-wrap
4744 msgid ""
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"
4751 msgstr ""
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"
4758
4759 #. type: Plain text
4760 #: build/C/man3/pthread_cleanup_push.3:261
4761 #, no-wrap
4762 msgid ""
4763 "static int done = 0;\n"
4764 "static int cleanup_pop_arg = 0;\n"
4765 "static int cnt = 0;\n"
4766 msgstr ""
4767 "static int done = 0;\n"
4768 "static int cleanup_pop_arg = 0;\n"
4769 "static int cnt = 0;\n"
4770
4771 #. type: Plain text
4772 #: build/C/man3/pthread_cleanup_push.3:268
4773 #, no-wrap
4774 msgid ""
4775 "static void\n"
4776 "cleanup_handler(void *arg)\n"
4777 "{\n"
4778 "    printf(\"Called clean-up handler\\en\");\n"
4779 "    cnt = 0;\n"
4780 "}\n"
4781 msgstr ""
4782 "static void\n"
4783 "cleanup_handler(void *arg)\n"
4784 "{\n"
4785 "    printf(\"Called clean-up handler\\en\");\n"
4786 "    cnt = 0;\n"
4787 "}\n"
4788
4789 #. type: Plain text
4790 #: build/C/man3/pthread_cleanup_push.3:273
4791 #, no-wrap
4792 msgid ""
4793 "static void *\n"
4794 "thread_start(void *arg)\n"
4795 "{\n"
4796 "    time_t start, curr;\n"
4797 msgstr ""
4798 "static void *\n"
4799 "thread_start(void *arg)\n"
4800 "{\n"
4801 "    time_t start, curr;\n"
4802
4803 #. type: Plain text
4804 #: build/C/man3/pthread_cleanup_push.3:275
4805 #, no-wrap
4806 msgid "    printf(\"New thread started\\en\");\n"
4807 msgstr "    printf(\"New thread started\\en\");\n"
4808
4809 #. type: Plain text
4810 #: build/C/man3/pthread_cleanup_push.3:277
4811 #, no-wrap
4812 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4813 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
4814
4815 #. type: Plain text
4816 #: build/C/man3/pthread_cleanup_push.3:279
4817 #, no-wrap
4818 msgid "    curr = start = time(NULL);\n"
4819 msgstr "    curr = start = time(NULL);\n"
4820
4821 #. type: Plain text
4822 #: build/C/man3/pthread_cleanup_push.3:288
4823 #, no-wrap
4824 msgid ""
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"
4830 "            cnt++;\n"
4831 "        }\n"
4832 "    }\n"
4833 msgstr ""
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"
4839 "            cnt++;\n"
4840 "        }\n"
4841 "    }\n"
4842
4843 #. type: Plain text
4844 #: build/C/man3/pthread_cleanup_push.3:292
4845 #, no-wrap
4846 msgid ""
4847 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4848 "    return NULL;\n"
4849 "}\n"
4850 msgstr ""
4851 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
4852 "    return NULL;\n"
4853 "}\n"
4854
4855 #. type: Plain text
4856 #: build/C/man3/pthread_cleanup_push.3:299
4857 #, no-wrap
4858 msgid ""
4859 "int\n"
4860 "main(int argc, char *argv[])\n"
4861 "{\n"
4862 "    pthread_t thr;\n"
4863 "    int s;\n"
4864 "    void *res;\n"
4865 msgstr ""
4866 "int\n"
4867 "main(int argc, char *argv[])\n"
4868 "{\n"
4869 "    pthread_t thr;\n"
4870 "    int s;\n"
4871 "    void *res;\n"
4872
4873 #. type: Plain text
4874 #: build/C/man3/pthread_cleanup_push.3:303
4875 #, no-wrap
4876 msgid ""
4877 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4878 "    if (s != 0)\n"
4879 "        handle_error_en(s, \"pthread_create\");\n"
4880 msgstr ""
4881 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
4882 "    if (s != 0)\n"
4883 "        handle_error_en(s, \"pthread_create\");\n"
4884
4885 #. type: Plain text
4886 #: build/C/man3/pthread_cleanup_push.3:305
4887 #, no-wrap
4888 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
4889 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
4890
4891 #. type: Plain text
4892 #: build/C/man3/pthread_cleanup_push.3:310
4893 #, no-wrap
4894 msgid ""
4895 "    if (argc E<gt> 1) {\n"
4896 "        if (argc E<gt> 2)\n"
4897 "            cleanup_pop_arg = atoi(argv[2]);\n"
4898 "        done = 1;\n"
4899 msgstr ""
4900 "    if (argc E<gt> 1) {\n"
4901 "        if (argc E<gt> 2)\n"
4902 "            cleanup_pop_arg = atoi(argv[2]);\n"
4903 "        done = 1;\n"
4904
4905 #. type: Plain text
4906 #: build/C/man3/pthread_cleanup_push.3:317
4907 #, no-wrap
4908 msgid ""
4909 "    } else {\n"
4910 "        printf(\"Canceling thread\\en\");\n"
4911 "        s = pthread_cancel(thr);\n"
4912 "        if (s != 0)\n"
4913 "            handle_error_en(s, \"pthread_cancel\");\n"
4914 "    }\n"
4915 msgstr ""
4916 "    } else {\n"
4917 "        printf(\"Canceling thread\\en\");\n"
4918 "        s = pthread_cancel(thr);\n"
4919 "        if (s != 0)\n"
4920 "            handle_error_en(s, \"pthread_cancel\");\n"
4921 "    }\n"
4922
4923 #. type: Plain text
4924 #: build/C/man3/pthread_cleanup_push.3:328
4925 #, no-wrap
4926 msgid ""
4927 "    if (res == PTHREAD_CANCELED)\n"
4928 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4929 "    else\n"
4930 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4931 "    exit(EXIT_SUCCESS);\n"
4932 "}\n"
4933 msgstr ""
4934 "    if (res == PTHREAD_CANCELED)\n"
4935 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
4936 "    else\n"
4937 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
4938 "    exit(EXIT_SUCCESS);\n"
4939 "}\n"
4940
4941 #. type: Plain text
4942 #: build/C/man3/pthread_cleanup_push.3:335
4943 msgid ""
4944 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4945 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4946 msgstr ""
4947 "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), "
4948 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
4949
4950 #. type: TH
4951 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
4952 #, no-wrap
4953 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4954 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
4955
4956 #. type: Plain text
4957 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
4958 msgid ""
4959 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop "
4960 "thread cancellation clean-up handlers while saving cancelability type"
4961 msgstr ""
4962 "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - "
4963 "cancelability type を保持したままでスレッドのキャンセルクリーンアップハンド"
4964 "ラーの push/pop を行う"
4965
4966 #. type: Plain text
4967 #: build/C/man3/pthread_cleanup_push_defer_np.3:37
4968 #, no-wrap
4969 msgid ""
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"
4973 msgstr ""
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"
4977
4978 #. type: Plain text
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> を付けてコンパイルとリンクを行う。"
4991
4992 #. type: Plain text
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>():"
4996
4997 #. type: Plain text
4998 #: build/C/man3/pthread_cleanup_push_defer_np.3:51
4999 msgid "_GNU_SOURCE"
5000 msgstr "_GNU_SOURCE"
5001
5002 #. type: Plain text
5003 #: build/C/man3/pthread_cleanup_push_defer_np.3:59
5004 msgid ""
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."
5007 msgstr ""
5008 "これらの関数は B<pthread_cleanup_push>(3) と B<pthread_cleanup_pop>(3) と同じ"
5009 "だが、このページで説明する点が異なる。"
5010
5011 #. type: Plain text
5012 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
5013 msgid ""
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."
5020 msgstr ""
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"
5029 "が保証される。"
5030
5031 #. type: Plain text
5032 #: build/C/man3/pthread_cleanup_push_defer_np.3:81
5033 msgid ""
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>()."
5038 msgstr ""
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>() が呼ばれた時点の値に戻す。"
5044
5045 #. type: Plain text
5046 #: build/C/man3/pthread_cleanup_push_defer_np.3:87
5047 msgid ""
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)."
5051 msgstr ""
5052 "呼び出し側では、これらの関数の呼び出しが同じ関数の中で対となり、かつ\n"
5053 "文法的に同じネストレベル (nesting level) になることを保証しなければ\n"
5054 "ならない。 B<pthread_cleanup_push>(3) で説明されている他の制限も\n"
5055 "適用される。"
5056
5057 #. type: Plain text
5058 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
5059 msgid "This sequence of calls:"
5060 msgstr "以下の一連の呼び出し"
5061
5062 #. type: Plain text
5063 #: build/C/man3/pthread_cleanup_push_defer_np.3:94
5064 #, no-wrap
5065 msgid ""
5066 "pthread_cleanup_push_defer_np(routine, arg);\n"
5067 "pthread_cleanup_pop_restore_np(execute);\n"
5068 msgstr ""
5069 "pthread_cleanup_push_defer_np(routine, arg);\n"
5070 "pthread_cleanup_pop_restore_np(execute);\n"
5071
5072 #. type: Plain text
5073 #: build/C/man3/pthread_cleanup_push_defer_np.3:98
5074 msgid "is equivalent to (but shorter and more efficient than):"
5075 msgstr "と以下は等価である (但し、上の方がより簡潔で効率的である)。"
5076
5077 #. type: Plain text
5078 #: build/C/man3/pthread_cleanup_push_defer_np.3:104
5079 #, no-wrap
5080 msgid "int oldtype;\n"
5081 msgstr "int oldtype;\n"
5082
5083 #. type: Plain text
5084 #: build/C/man3/pthread_cleanup_push_defer_np.3:110
5085 #, no-wrap
5086 msgid ""
5087 "pthread_cleanup_push(routine, arg);\n"
5088 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
5089 "\\&...\n"
5090 "pthread_setcanceltype(oldtype, NULL);\n"
5091 "pthread_cleanup_pop(execute);\n"
5092 msgstr ""
5093 "pthread_cleanup_push(routine, arg);\n"
5094 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
5095 "\\&...\n"
5096 "pthread_setcanceltype(oldtype, NULL);\n"
5097 "pthread_cleanup_pop(execute);\n"
5098
5099 #. type: Plain text
5100 #: build/C/man3/pthread_cleanup_push_defer_np.3:123
5101 msgid ""
5102 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
5103 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
5104 msgstr ""
5105 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
5106 "B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
5107
5108 #. type: TH
5109 #: build/C/man3/pthread_create.3:26
5110 #, no-wrap
5111 msgid "PTHREAD_CREATE"
5112 msgstr "PTHREAD_CREATE"
5113
5114 #. type: Plain text
5115 #: build/C/man3/pthread_create.3:29
5116 msgid "pthread_create - create a new thread"
5117 msgstr "pthread_create - 新しいスレッドを作成する"
5118
5119 #. type: Plain text
5120 #: build/C/man3/pthread_create.3:35
5121 #, no-wrap
5122 msgid ""
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"
5125 msgstr ""
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"
5128
5129 #. type: Plain text
5130 #: build/C/man3/pthread_create.3:47
5131 msgid ""
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>()."
5135 msgstr ""
5136 "B<pthread_create>() 関数は、呼び出したプロセス内に新しいスレッドを作成す"
5137 "る。\n"
5138 "新しいスレッドの実行は、 I<start_routine>() を起動することで開始される。\n"
5139 "I<start_routine>() は引数を一つだけ取り、\n"
5140 "I<arg> が I<start_routine>() の引数として渡される。"
5141
5142 #. type: Plain text
5143 #: build/C/man3/pthread_create.3:49
5144 msgid "The new thread terminates in one of the following ways:"
5145 msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。"
5146
5147 #. type: IP
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
5158 #, no-wrap
5159 msgid "*"
5160 msgstr "*"
5161
5162 #. type: Plain text
5163 #: build/C/man3/pthread_create.3:55
5164 msgid ""
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)."
5168 msgstr ""
5169 "スレッドが B<pthread_exit>(3) を呼び出す。\n"
5170 "B<pthread_exit>(3) を呼び出す際には終了ステータス値を指定する。\n"
5171 "この値は B<pthread_join>(3) を呼び出した同じプロセス内の\n"
5172 "別のスレッドで参照できる。"
5173
5174 #. type: Plain text
5175 #: build/C/man3/pthread_create.3:63
5176 msgid ""
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."
5179 msgstr ""
5180 "スレッドが I<start_routine>() から返る。これは、\n"
5181 "I<return> 文に渡した値で B<pthread_exit>(3) を呼び出すのと等価である。"
5182
5183 #. type: Plain text
5184 #: build/C/man3/pthread_create.3:66
5185 msgid "It is canceled (see B<pthread_cancel>(3))."
5186 msgstr "スレッドがキャンセルされる (B<pthread_cancel>(3) 参照)。"
5187
5188 #. type: Plain text
5189 #: build/C/man3/pthread_create.3:72
5190 msgid ""
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."
5194 msgstr ""
5195 "プロセス内のいずれかのスレッドで B<exit>(3) が呼ばれるか、\n"
5196 "メインスレッドで I<main>() 内で return が実行される。\n"
5197 "この場合は、プロセス内の全てのスレッドが終了される。"
5198
5199 #. type: Plain text
5200 #: build/C/man3/pthread_create.3:86
5201 msgid ""
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 "
5206 "attributes."
5207 msgstr ""
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 の場合、新しいスレッドはデフォルトの属性で作成される。"
5213
5214 #. type: Plain text
5215 #: build/C/man3/pthread_create.3:93
5216 msgid ""
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."
5220 msgstr ""
5221 "成功した場合は、 B<pthread_create>() は返る前に新しいスレッドの ID を\n"
5222 "I<thread> が指すバッファーに格納する。この ID は、これ以降に他の\n"
5223 "pthreads 関数の呼び出しでスレッドを参照するのに使用される。"
5224
5225 #. type: Plain text
5226 #: build/C/man3/pthread_create.3:101
5227 msgid ""
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))."
5232 msgstr ""
5233 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスク\n"
5234 "(B<pthread_sigmask>(3) 参照) のコピーを継承する。\n"
5235 "新しいスレッドの処理待ちシグナル (B<sigpending>(2)) の集合は空となる。\n"
5236 "新しいスレッドはスレッドを作成したスレッドの代替シグナルスタック\n"
5237 "(B<sigaltstack>(2)) を継承しない。"
5238
5239 #. type: Plain text
5240 #: build/C/man3/pthread_create.3:104
5241 msgid ""
5242 "The new thread inherits the calling thread's floating-point environment "
5243 "(B<fenv>(3))."
5244 msgstr ""
5245 "新しいスレッドは呼び出したスレッドの浮動小数点環境 (B<fenv>(3))\n"
5246 "を継承する。"
5247
5248 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
5249 #. type: Plain text
5250 #: build/C/man3/pthread_create.3:109
5251 msgid ""
5252 "The initial value of the new thread's CPU-time clock is 0 (see "
5253 "B<pthread_getcpuclockid>(3))."
5254 msgstr ""
5255 "新しいスレッドの CPU 時間時計の初期値は 0 である\n"
5256 "(B<pthread_getcpuclockid>(3) 参照)。"
5257
5258 #. type: SS
5259 #: build/C/man3/pthread_create.3:109
5260 #, no-wrap
5261 msgid "Linux-specific details"
5262 msgstr "Linux 固有の詳細"
5263
5264 #. type: Plain text
5265 #: build/C/man3/pthread_create.3:115
5266 msgid ""
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))."
5269 msgstr ""
5270 "新しいスレッドは、呼び出したスレッドの\n"
5271 "ケーパビリティセット (B<capabilities>(7) 参照) と \n"
5272 "CPU affinity マスク (B<sched_setaffinity>(2) 参照) の\n"
5273 "コピーをを継承しない。"
5274
5275 #. type: Plain text
5276 #: build/C/man3/pthread_create.3:122
5277 msgid ""
5278 "On success, B<pthread_create>()  returns 0; on error, it returns an error "
5279 "number, and the contents of I<*thread> are undefined."
5280 msgstr ""
5281 "成功すると、 B<pthread_create>() は 0 を返す。\n"
5282 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
5283
5284 #. type: TP
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
5287 #, no-wrap
5288 msgid "B<EAGAIN>"
5289 msgstr "B<EAGAIN>"
5290
5291 #. type: Plain text
5292 #: build/C/man3/pthread_create.3:126
5293 msgid "Insufficient resources to create another thread."
5294 msgstr "別のスレッドを作成するのに十分なリソースがない。"
5295
5296 #.  NOTE! The following should match the description in fork(2)
5297 #. type: Plain text
5298 #: build/C/man3/pthread_create.3:144
5299 msgid ""
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))."
5307 msgstr ""
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) 参照)。"
5314
5315 #. type: Plain text
5316 #: build/C/man3/pthread_create.3:148
5317 msgid "Invalid settings in I<attr>."
5318 msgstr "I<attr> で指定された設定が不正である。"
5319
5320 #. type: TP
5321 #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_setschedparam.3:129
5322 #: build/C/man3/pthread_setschedprio.3:66
5323 #, no-wrap
5324 msgid "B<EPERM>"
5325 msgstr "B<EPERM>"
5326
5327 #. type: Plain text
5328 #: build/C/man3/pthread_create.3:153
5329 msgid ""
5330 "No permission to set the scheduling policy and parameters specified in "
5331 "I<attr>."
5332 msgstr ""
5333 "I<attr> に指定されたスケジューリングポリシーとパラメーターを\n"
5334 "設定する許可がない。"
5335
5336 #. type: tbl table
5337 #: build/C/man3/pthread_create.3:163
5338 #, no-wrap
5339 msgid "B<pthread_create>()"
5340 msgstr "B<pthread_create>()"
5341
5342 #. type: Plain text
5343 #: build/C/man3/pthread_create.3:180
5344 msgid ""
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."
5349 msgstr ""
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"
5355 "次に実行されるかは決まっていない。"
5356
5357 #. type: Plain text
5358 #: build/C/man3/pthread_create.3:200
5359 msgid ""
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))."
5371 msgstr ""
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"
5385 "作成される。"
5386
5387 #. type: Plain text
5388 #: build/C/man3/pthread_create.3:218
5389 #, fuzzy
5390 #| msgid ""
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."
5398 msgid ""
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:"
5407 msgstr ""
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 "デフォルト値以外のスタックサイズを得ることができる。"
5415
5416 #. type: tbl table
5417 #: build/C/man3/pthread_create.3:223
5418 #, no-wrap
5419 msgid "Architecture"
5420 msgstr ""
5421
5422 #. type: tbl table
5423 #: build/C/man3/pthread_create.3:223
5424 #, no-wrap
5425 msgid "Default stack size"
5426 msgstr ""
5427
5428 #. type: tbl table
5429 #: build/C/man3/pthread_create.3:224
5430 #, no-wrap
5431 msgid "i386"
5432 msgstr "i386"
5433
5434 #. type: tbl table
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
5437 #, no-wrap
5438 msgid "2 MB"
5439 msgstr "2 MB"
5440
5441 #. type: tbl table
5442 #: build/C/man3/pthread_create.3:225
5443 #, no-wrap
5444 msgid "IA-64"
5445 msgstr "IA-64"
5446
5447 #. type: tbl table
5448 #: build/C/man3/pthread_create.3:225
5449 #, no-wrap
5450 msgid "32 MB"
5451 msgstr "32 MB"
5452
5453 #. type: tbl table
5454 #: build/C/man3/pthread_create.3:226
5455 #, no-wrap
5456 msgid "PowerPC"
5457 msgstr "PowerPC"
5458
5459 #. type: tbl table
5460 #: build/C/man3/pthread_create.3:226 build/C/man3/pthread_create.3:229
5461 #, no-wrap
5462 msgid "4 MB"
5463 msgstr "4 MB"
5464
5465 #. type: tbl table
5466 #: build/C/man3/pthread_create.3:227
5467 #, no-wrap
5468 msgid "S/390"
5469 msgstr "S/390"
5470
5471 #. type: tbl table
5472 #: build/C/man3/pthread_create.3:228
5473 #, no-wrap
5474 msgid "Sparc-32"
5475 msgstr "Sparc-32"
5476
5477 #. type: tbl table
5478 #: build/C/man3/pthread_create.3:229
5479 #, no-wrap
5480 msgid "Sparc-64"
5481 msgstr "Sparc-64"
5482
5483 #. type: tbl table
5484 #: build/C/man3/pthread_create.3:230
5485 #, no-wrap
5486 msgid "x86_64"
5487 msgstr "x86_64"
5488
5489 #. type: Plain text
5490 #: build/C/man3/pthread_create.3:239
5491 msgid ""
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)."
5496 msgstr ""
5497 "廃止予定の LinuxThreads 実装では、プロセス内の各スレッドは異なる\n"
5498 "プロセス ID を持つ。これは POSIX スレッドの規格に違反しており、\n"
5499 "他の多くの標準非準拠の点の原因になっている。\n"
5500 "B<pthreads>(7) を参照のこと。"
5501
5502 #. type: Plain text
5503 #: build/C/man3/pthread_create.3:243
5504 msgid ""
5505 "The program below demonstrates the use of B<pthread_create>(), as well as a "
5506 "number of other functions in the pthreads API."
5507 msgstr ""
5508 "以下のプログラムは、 B<pthread_create>() や\n"
5509 "pthreads API の他のいろいろな関数の使用例を示している。"
5510
5511 #. type: Plain text
5512 #: build/C/man3/pthread_create.3:248
5513 msgid ""
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:"
5517 msgstr ""
5518 "以下の実行例は、 NPTL スレッド実装が提供されているシステムでのもので、\n"
5519 "スタックサイズがデフォルト値の \"stack size\" リソース上限で指定される値\n"
5520 "になる。"
5521
5522 #. type: Plain text
5523 #: build/C/man3/pthread_create.3:260
5524 #, no-wrap
5525 msgid ""
5526 "$B< ulimit -s>\n"
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"
5535 msgstr ""
5536 "$B< ulimit -s>\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"
5545
5546 #. type: Plain text
5547 #: build/C/man3/pthread_create.3:266
5548 msgid ""
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 のスタックサイズを明示的に設定している。"
5552
5553 #. type: Plain text
5554 #: build/C/man3/pthread_create.3:276
5555 #, no-wrap
5556 msgid ""
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"
5564 msgstr ""
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"
5572
5573 #. type: Plain text
5574 #: build/C/man3/pthread_create.3:288
5575 #, no-wrap
5576 msgid ""
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"
5584 msgstr ""
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"
5592
5593 #. type: Plain text
5594 #: build/C/man3/pthread_create.3:294 build/C/man3/pthread_getcpuclockid.3:127
5595 #, no-wrap
5596 msgid ""
5597 "#define handle_error(msg) \\e\n"
5598 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5599 msgstr ""
5600 "#define handle_error(msg) \\e\n"
5601 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
5602
5603 #. type: Plain text
5604 #: build/C/man3/pthread_create.3:300
5605 #, no-wrap
5606 msgid ""
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"
5611 "};\n"
5612 msgstr ""
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"
5617 "};\n"
5618
5619 #. type: Plain text
5620 #: build/C/man3/pthread_create.3:303
5621 #, no-wrap
5622 msgid ""
5623 "/* Thread start function: display address near top of our stack,\n"
5624 "   and return upper-cased copy of argv_string */\n"
5625 msgstr ""
5626 "/* Thread start function: display address near top of our stack,\n"
5627 "   and return upper-cased copy of argv_string */\n"
5628
5629 #. type: Plain text
5630 #: build/C/man3/pthread_create.3:309
5631 #, no-wrap
5632 msgid ""
5633 "static void *\n"
5634 "thread_start(void *arg)\n"
5635 "{\n"
5636 "    struct thread_info *tinfo = arg;\n"
5637 "    char *uargv;\n"
5638 msgstr ""
5639 "static void *\n"
5640 "thread_start(void *arg)\n"
5641 "{\n"
5642 "    struct thread_info *tinfo = arg;\n"
5643 "    char *uargv;\n"
5644
5645 #. type: Plain text
5646 #: build/C/man3/pthread_create.3:312
5647 #, no-wrap
5648 msgid ""
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"
5651 msgstr ""
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"
5654
5655 #. type: Plain text
5656 #: build/C/man3/pthread_create.3:316
5657 #, no-wrap
5658 msgid ""
5659 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5660 "    if (uargv == NULL)\n"
5661 "        handle_error(\"strdup\");\n"
5662 msgstr ""
5663 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
5664 "    if (uargv == NULL)\n"
5665 "        handle_error(\"strdup\");\n"
5666
5667 #. type: Plain text
5668 #: build/C/man3/pthread_create.3:319
5669 #, no-wrap
5670 msgid ""
5671 "    for (char *p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5672 "        *p = toupper(*p);\n"
5673 msgstr ""
5674 "    for (char *p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
5675 "        *p = toupper(*p);\n"
5676
5677 #. type: Plain text
5678 #: build/C/man3/pthread_create.3:322
5679 #, no-wrap
5680 msgid ""
5681 "    return uargv;\n"
5682 "}\n"
5683 msgstr ""
5684 "    return uargv;\n"
5685 "}\n"
5686
5687 #. type: Plain text
5688 #: build/C/man3/pthread_create.3:330
5689 #, no-wrap
5690 msgid ""
5691 "int\n"
5692 "main(int argc, char *argv[])\n"
5693 "{\n"
5694 "    int s, opt, num_threads;\n"
5695 "    pthread_attr_t attr;\n"
5696 "    size_t stack_size;\n"
5697 "    void *res;\n"
5698 msgstr ""
5699 "int\n"
5700 "main(int argc, char *argv[])\n"
5701 "{\n"
5702 "    int s, opt, num_threads;\n"
5703 "    pthread_attr_t attr;\n"
5704 "    size_t stack_size;\n"
5705 "    void *res;\n"
5706
5707 #. type: Plain text
5708 #: build/C/man3/pthread_create.3:332
5709 #, no-wrap
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"
5712
5713 #. type: Plain text
5714 #: build/C/man3/pthread_create.3:339
5715 #, no-wrap
5716 msgid ""
5717 "    stack_size = -1;\n"
5718 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5719 "        switch (opt) {\n"
5720 "        case \\(aqs\\(aq:\n"
5721 "            stack_size = strtoul(optarg, NULL, 0);\n"
5722 "            break;\n"
5723 msgstr ""
5724 "    stack_size = -1;\n"
5725 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
5726 "        switch (opt) {\n"
5727 "        case \\(aqs\\(aq:\n"
5728 "            stack_size = strtoul(optarg, NULL, 0);\n"
5729 "            break;\n"
5730
5731 #. type: Plain text
5732 #: build/C/man3/pthread_create.3:346
5733 #, no-wrap
5734 msgid ""
5735 "        default:\n"
5736 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5737 "                    argv[0]);\n"
5738 "            exit(EXIT_FAILURE);\n"
5739 "        }\n"
5740 "    }\n"
5741 msgstr ""
5742 "        default:\n"
5743 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
5744 "                    argv[0]);\n"
5745 "            exit(EXIT_FAILURE);\n"
5746 "        }\n"
5747 "    }\n"
5748
5749 #. type: Plain text
5750 #: build/C/man3/pthread_create.3:348
5751 #, no-wrap
5752 msgid "    num_threads = argc - optind;\n"
5753 msgstr "    num_threads = argc - optind;\n"
5754
5755 #. type: Plain text
5756 #: build/C/man3/pthread_create.3:350
5757 #, no-wrap
5758 msgid "    /* Initialize thread creation attributes */\n"
5759 msgstr "    /* Initialize thread creation attributes */\n"
5760
5761 #. type: Plain text
5762 #: build/C/man3/pthread_create.3:354
5763 #, no-wrap
5764 msgid ""
5765 "    s = pthread_attr_init(&attr);\n"
5766 "    if (s != 0)\n"
5767 "        handle_error_en(s, \"pthread_attr_init\");\n"
5768 msgstr ""
5769 "    s = pthread_attr_init(&attr);\n"
5770 "    if (s != 0)\n"
5771 "        handle_error_en(s, \"pthread_attr_init\");\n"
5772
5773 #. type: Plain text
5774 #: build/C/man3/pthread_create.3:360
5775 #, no-wrap
5776 msgid ""
5777 "    if (stack_size E<gt> 0) {\n"
5778 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5779 "        if (s != 0)\n"
5780 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5781 "    }\n"
5782 msgstr ""
5783 "    if (stack_size E<gt> 0) {\n"
5784 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
5785 "        if (s != 0)\n"
5786 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5787 "    }\n"
5788
5789 #. type: Plain text
5790 #: build/C/man3/pthread_create.3:362
5791 #, no-wrap
5792 msgid "    /* Allocate memory for pthread_create() arguments */\n"
5793 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
5794
5795 #. type: Plain text
5796 #: build/C/man3/pthread_create.3:366
5797 #, no-wrap
5798 msgid ""
5799 "    struct thread_info *tinfo = calloc(num_threads, sizeof(*tinfo));\n"
5800 "    if (tinfo == NULL)\n"
5801 "        handle_error(\"calloc\");\n"
5802 msgstr ""
5803 "    struct thread_info *tinfo = calloc(num_threads, sizeof(*tinfo));\n"
5804 "    if (tinfo == NULL)\n"
5805 "        handle_error(\"calloc\");\n"
5806
5807 #. type: Plain text
5808 #: build/C/man3/pthread_create.3:368
5809 #, no-wrap
5810 msgid "    /* Create one thread for each command-line argument */\n"
5811 msgstr "    /* Create one thread for each command-line argument */\n"
5812
5813 #. type: Plain text
5814 #: build/C/man3/pthread_create.3:372
5815 #, no-wrap
5816 msgid ""
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"
5820 msgstr ""
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"
5824
5825 #. type: Plain text
5826 #: build/C/man3/pthread_create.3:375
5827 #, no-wrap
5828 msgid ""
5829 "        /* The pthread_create() call stores the thread ID into\n"
5830 "           corresponding element of tinfo[] */\n"
5831 msgstr ""
5832 "        /* The pthread_create() call stores the thread ID into\n"
5833 "           corresponding element of tinfo[] */\n"
5834
5835 #. type: Plain text
5836 #: build/C/man3/pthread_create.3:381
5837 #, no-wrap
5838 msgid ""
5839 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5840 "                           &thread_start, &tinfo[tnum]);\n"
5841 "        if (s != 0)\n"
5842 "            handle_error_en(s, \"pthread_create\");\n"
5843 "    }\n"
5844 msgstr ""
5845 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
5846 "                           &thread_start, &tinfo[tnum]);\n"
5847 "        if (s != 0)\n"
5848 "            handle_error_en(s, \"pthread_create\");\n"
5849 "    }\n"
5850
5851 #. type: Plain text
5852 #: build/C/man3/pthread_create.3:384
5853 #, no-wrap
5854 msgid ""
5855 "    /* Destroy the thread attributes object, since it is no\n"
5856 "       longer needed */\n"
5857 msgstr ""
5858 "    /* Destroy the thread attributes object, since it is no\n"
5859 "       longer needed */\n"
5860
5861 #. type: Plain text
5862 #: build/C/man3/pthread_create.3:388
5863 #, no-wrap
5864 msgid ""
5865 "    s = pthread_attr_destroy(&attr);\n"
5866 "    if (s != 0)\n"
5867 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5868 msgstr ""
5869 "    s = pthread_attr_destroy(&attr);\n"
5870 "    if (s != 0)\n"
5871 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5872
5873 #. type: Plain text
5874 #: build/C/man3/pthread_create.3:390
5875 #, no-wrap
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"
5878
5879 #. type: Plain text
5880 #: build/C/man3/pthread_create.3:395
5881 #, no-wrap
5882 msgid ""
5883 "    for (int tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5884 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5885 "        if (s != 0)\n"
5886 "            handle_error_en(s, \"pthread_join\");\n"
5887 msgstr ""
5888 "    for (int tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
5889 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
5890 "        if (s != 0)\n"
5891 "            handle_error_en(s, \"pthread_join\");\n"
5892
5893 #. type: Plain text
5894 #: build/C/man3/pthread_create.3:400
5895 #, no-wrap
5896 msgid ""
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"
5900 "    }\n"
5901 msgstr ""
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"
5905 "    }\n"
5906
5907 #. type: Plain text
5908 #: build/C/man3/pthread_create.3:404
5909 #, no-wrap
5910 msgid ""
5911 "    free(tinfo);\n"
5912 "    exit(EXIT_SUCCESS);\n"
5913 "}\n"
5914 msgstr ""
5915 "    free(tinfo);\n"
5916 "    exit(EXIT_SUCCESS);\n"
5917 "}\n"
5918
5919 #. type: Plain text
5920 #: build/C/man3/pthread_create.3:419
5921 msgid ""
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)"
5927
5928 #. type: TH
5929 #: build/C/man3/pthread_detach.3:26
5930 #, no-wrap
5931 msgid "PTHREAD_DETACH"
5932 msgstr "PTHREAD_DETACH"
5933
5934 #. type: Plain text
5935 #: build/C/man3/pthread_detach.3:29
5936 msgid "pthread_detach - detach a thread"
5937 msgstr "pthread_detach - スレッドを切り離す (detach する)"
5938
5939 #. type: Plain text
5940 #: build/C/man3/pthread_detach.3:34
5941 #, no-wrap
5942 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5943 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
5944
5945 #. type: Plain text
5946 #: build/C/man3/pthread_detach.3:46
5947 msgid ""
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."
5952 msgstr ""
5953 "B<pthread_detach>() 関数は I<thread> で識別されるスレッドに\n"
5954 "detached (切り離された状態) という印を付ける。\n"
5955 "detached 状態のスレッドが終了すると、\n"
5956 "別のスレッドが終了されたスレッドを join しなくても、\n"
5957 "そのスレッドのリソースは自動的に解放されてシステムに戻される。"
5958
5959 #. type: Plain text
5960 #: build/C/man3/pthread_detach.3:49
5961 msgid ""
5962 "Attempting to detach an already detached thread results in unspecified "
5963 "behavior."
5964 msgstr ""
5965 "すでに detach 状態のスレッドを detach しようとした場合に\n"
5966 "どのような結果となるかは規定されていない。"
5967
5968 #. type: Plain text
5969 #: build/C/man3/pthread_detach.3:54
5970 msgid ""
5971 "On success, B<pthread_detach>()  returns 0; on error, it returns an error "
5972 "number."
5973 msgstr ""
5974 "成功すると、B<pthread_detach>() は 0 を返す。\n"
5975 "エラーの場合、エラー番号を返す。"
5976
5977 #. type: Plain text
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 可能なスレッドではない。"
5981
5982 #. type: tbl table
5983 #: build/C/man3/pthread_detach.3:74
5984 #, no-wrap
5985 msgid "B<pthread_detach>()"
5986 msgstr "B<pthread_detach>()"
5987
5988 #. type: Plain text
5989 #: build/C/man3/pthread_detach.3:83
5990 msgid ""
5991 "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  "
5992 "or be made joinable again."
5993 msgstr ""
5994 "いったんスレッドを detached 状態にすると、\n"
5995 "そのスレッドを B<pthread_join>(3) で join したり、\n"
5996 "もう一度 join 可能にしたりすることはできない。"
5997
5998 #. type: Plain text
5999 #: build/C/man3/pthread_detach.3:90
6000 msgid ""
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)."
6004 msgstr ""
6005 "B<pthread_attr_setdetachstate>(3) を使って\n"
6006 "B<pthread_create>(3) の I<attr> 引数の detached 属性を設定することで、\n"
6007 "新しいスレッドを detached 状態で作成することができる。"
6008
6009 #. type: Plain text
6010 #: build/C/man3/pthread_detach.3:97
6011 msgid ""
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 "
6015 "thread returns)."
6016 msgstr ""
6017 "detached 属性は、スレッドが終了した際のシステムの動作を決めるだけである。\n"
6018 "プロセスが B<exit>(3) を使って終了した場合に、そのスレッドが終了され\n"
6019 "なくなるようなことはない (なお、メインスレッドが return した場合も\n"
6020 "プロセスが B<exit>(3) を使って終了した場合と全く同じである)。 "
6021
6022 #. type: Plain text
6023 #: build/C/man3/pthread_detach.3:106
6024 #, fuzzy
6025 #| msgid ""
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.)"
6030 msgid ""
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 "
6035 "terminates.)"
6036 msgstr ""
6037 "アプリケーションが作成した各スレッドについて、そのスレッドが使用して\n"
6038 "いるシステムリソースを解放できるように、B<pthread_join>(3) か\n"
6039 "B<pthread_detach>() のどちらかを呼び出すべきである (ただし、プロセスが\n"
6040 "終了するときには、全てのスレッドのリソースが解放される)。"
6041
6042 #. type: Plain text
6043 #: build/C/man3/pthread_detach.3:108
6044 msgid "The following statement detaches the calling thread:"
6045 msgstr "以下の文は、呼び出したスレッド自身を detach する。"
6046
6047 #. type: Plain text
6048 #: build/C/man3/pthread_detach.3:110
6049 #, no-wrap
6050 msgid "    pthread_detach(pthread_self());\n"
6051 msgstr "    pthread_detach(pthread_self());\n"
6052
6053 #. type: Plain text
6054 #: build/C/man3/pthread_detach.3:117
6055 msgid ""
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)"
6058 msgstr ""
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)"
6061
6062 #. type: TH
6063 #: build/C/man3/pthread_equal.3:26
6064 #, no-wrap
6065 msgid "PTHREAD_EQUAL"
6066 msgstr "PTHREAD_EQUAL"
6067
6068 #. type: TH
6069 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_setschedprio.3:26
6070 #: build/C/man7/nptl.7:26
6071 #, no-wrap
6072 msgid "2015-08-08"
6073 msgstr "2015-08-08"
6074
6075 #. type: Plain text
6076 #: build/C/man3/pthread_equal.3:29
6077 msgid "pthread_equal - compare thread IDs"
6078 msgstr "pthread_equal - スレッド ID を比較する"
6079
6080 #. type: Plain text
6081 #: build/C/man3/pthread_equal.3:34
6082 #, no-wrap
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"
6085
6086 #. type: Plain text
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 つのスレッド識別子の比較を行う。"
6090
6091 #. type: Plain text
6092 #: build/C/man3/pthread_equal.3:45
6093 msgid ""
6094 "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero "
6095 "value; otherwise, it returns 0."
6096 msgstr ""
6097 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
6098 "そうでなければ 0 を返す。"
6099
6100 #.  SH VERSIONS
6101 #.  Available since glibc 2.0
6102 #. type: Plain text
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 "この関数は常に成功する。"
6107
6108 #. type: tbl table
6109 #: build/C/man3/pthread_equal.3:57
6110 #, no-wrap
6111 msgid "B<pthread_equal>()"
6112 msgstr "B<pthread_equal>()"
6113
6114 #. type: Plain text
6115 #: build/C/man3/pthread_equal.3:68
6116 msgid ""
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."
6120 msgstr ""
6121 "B<pthread_equal>() 関数が必要なのは、\n"
6122 "スレッド ID はその内部構造を意識すべきではないためである。\n"
6123 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
6124 "移植性を確保できる形で比較する方法はない。"
6125
6126 #. type: Plain text
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)"
6130
6131 #. type: TH
6132 #: build/C/man3/pthread_exit.3:26
6133 #, no-wrap
6134 msgid "PTHREAD_EXIT"
6135 msgstr "PTHREAD_EXIT"
6136
6137 #. type: Plain text
6138 #: build/C/man3/pthread_exit.3:29
6139 msgid "pthread_exit - terminate calling thread"
6140 msgstr "pthread_exit - 呼び出したスレッドを終了する"
6141
6142 #. type: Plain text
6143 #: build/C/man3/pthread_exit.3:34
6144 #, no-wrap
6145 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
6146 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
6147
6148 #. type: Plain text
6149 #: build/C/man3/pthread_exit.3:45
6150 msgid ""
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) を呼び出した同じプロセス内の別のスレッドが参照できる値と同じである。"
6155
6156 #. type: Plain text
6157 #: build/C/man3/pthread_exit.3:55
6158 msgid ""
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) 関数が呼び出される (呼び出し順序は規定されていない)。"
6165
6166 #. type: Plain text
6167 #: build/C/man3/pthread_exit.3:62
6168 msgid ""
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) を使って登録された関数は呼び出されない。"
6173
6174 #. type: Plain text
6175 #: build/C/man3/pthread_exit.3:71
6176 msgid ""
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 "
6180 "called."
6181 msgstr "プロセスの最後のスレッドが終了すると、そのプロセスは、終了ステータス 0 で B<exit>(3) を呼び出した場合と全く同じように終了する。したがって、プロセスの共有リソースは解放され、B<atexit>(3) を使って登録された関数が呼び出される。"
6182
6183 #. type: Plain text
6184 #: build/C/man3/pthread_exit.3:73
6185 msgid "This function does not return to the caller."
6186 msgstr "この関数は呼び出し側には返らない。"
6187
6188 #. type: tbl table
6189 #: build/C/man3/pthread_exit.3:85
6190 #, no-wrap
6191 msgid "B<pthread_exit>()"
6192 msgstr "B<pthread_exit>()"
6193
6194 #. type: Plain text
6195 #: build/C/man3/pthread_exit.3:94
6196 msgid ""
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."
6200 msgstr ""
6201 "メインスレッド以外のスレッドの開始関数 (start function) がreturn を\n"
6202 "行うと、暗黙のうちに B<pthread_exit>() が呼び出され、\n"
6203 "関数の返り値がスレッドの終了ステータスとして使用される。"
6204
6205 #. type: Plain text
6206 #: build/C/man3/pthread_exit.3:100
6207 msgid ""
6208 "To allow other threads to continue execution, the main thread should "
6209 "terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
6210 msgstr ""
6211 "他のスレッドが実行を継続できるように、メインスレッドは B<exit>(3) では\n"
6212 "なく B<pthread_exit>() を呼び出して終了すべきである。"
6213
6214 #. type: Plain text
6215 #: build/C/man3/pthread_exit.3:105
6216 msgid ""
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."
6220 msgstr ""
6221 "I<retval> が指す値は、呼び出したスレッドのスタックに置くべきではない。\n"
6222 "呼び出したスレッドが終了した後は、そのスタックの内容が不定となるから\n"
6223 "である。"
6224
6225 #.  Linux 2.6.27
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
6229 #. type: Plain text
6230 #: build/C/man3/pthread_exit.3:117
6231 msgid ""
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>()."
6237 msgstr ""
6238 "現在のところ、停止 (stop) されたスレッドグループを、すでに終了した\n"
6239 "(dead) スレッドグループリーダーで B<wait>(2) する場合の、\n"
6240 "カーネル実装の論理には制限がある。\n"
6241 "この制限は、すでにスレッドグループリーダーが B<pthread_exit>() を\n"
6242 "呼び出しているようなフォアグラウンドプロセスにストップシグナルが送信\n"
6243 "された場合に、端末がロックされてしまう、といった問題として表に見える\n"
6244 "場合がある。"
6245
6246 #. type: Plain text
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)"
6250
6251 #. type: TH
6252 #: build/C/man3/pthread_getattr_np.3:26
6253 #, no-wrap
6254 msgid "PTHREAD_GETATTR_NP"
6255 msgstr "PTHREAD_GETATTR_NP"
6256
6257 #. type: Plain text
6258 #: build/C/man3/pthread_getattr_np.3:29
6259 msgid "pthread_getattr_np - get attributes of created thread"
6260 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
6261
6262 #. type: Plain text
6263 #: build/C/man3/pthread_getattr_np.3:35
6264 #, no-wrap
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"
6267
6268 #. type: Plain text
6269 #: build/C/man3/pthread_getattr_np.3:45
6270 msgid ""
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>."
6274 msgstr ""
6275 "B<pthread_getattr_np>() 関数は、\n"
6276 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
6277 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
6278 "格納して返す。"
6279
6280 #. type: Plain text
6281 #: build/C/man3/pthread_getattr_np.3:52
6282 msgid ""
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:"
6286 msgstr ""
6287 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
6288 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
6289 "特に、以下の属性は異なる場合がある。"
6290
6291 #. type: Plain text
6292 #: build/C/man3/pthread_getattr_np.3:55
6293 msgid ""
6294 "the detach state, since a joinable thread may have detached itself after "
6295 "creation;"
6296 msgstr ""
6297 "detach state. join 可能なスレッドは作成後に自分自身を\n"
6298 "切り離す (detach する) ことができるからである。"
6299
6300 #. type: Plain text
6301 #: build/C/man3/pthread_getattr_np.3:58
6302 msgid ""
6303 "the stack size, which the implementation may align to a suitable boundary."
6304 msgstr ""
6305 "スタックサイズ。\n"
6306 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
6307
6308 #. type: Plain text
6309 #: build/C/man3/pthread_getattr_np.3:63
6310 msgid ""
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."
6314 msgstr ""
6315 "guard size.\n"
6316 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
6317 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
6318 "(0 として扱われる) ことがあるからである。"
6319
6320 #. type: Plain text
6321 #: build/C/man3/pthread_getattr_np.3:68
6322 msgid ""
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."
6327 msgstr ""
6328 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
6329 "スタックアドレスが設定されていなかった場合、\n"
6330 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
6331 "割り当てた実際のスタックアドレスが報告される。"
6332
6333 #. type: Plain text
6334 #: build/C/man3/pthread_getattr_np.3:73
6335 msgid ""
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)."
6338 msgstr ""
6339 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
6340 "必要なくなった際には、  B<pthread_attr_destroy>(3) を使って\n"
6341 "そのオブジェクトを破棄すべきである。"
6342
6343 #. type: Plain text
6344 #: build/C/man3/pthread_getattr_np.3:76 build/C/man3/pthread_getcpuclockid.3:52
6345 msgid ""
6346 "On success, this function returns 0; on error, it returns a nonzero error "
6347 "number."
6348 msgstr ""
6349 "成功すると、この関数は 0 を返す。\n"
6350 "エラーの場合、 0 以外のエラー番号を返す。"
6351
6352 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
6353 #. type: Plain text
6354 #: build/C/man3/pthread_getattr_np.3:81
6355 msgid "Insufficient memory."
6356 msgstr "メモリーが十分になかった。"
6357
6358 #. type: Plain text
6359 #: build/C/man3/pthread_getattr_np.3:96
6360 msgid ""
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."
6365 msgstr ""
6366 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
6367 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
6368 "エラーで失敗する可能性がある。\n"
6369 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
6370 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
6371 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
6372
6373 #. type: Plain text
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 以降で利用できる。"
6377
6378 #. type: tbl table
6379 #: build/C/man3/pthread_getattr_np.3:109
6380 #, no-wrap
6381 msgid "B<pthread_getattr_np>()"
6382 msgstr "B<pthread_getattr_np>()"
6383
6384 #. type: Plain text
6385 #: build/C/man3/pthread_getattr_np.3:115
6386 #: build/C/man3/pthread_kill_other_threads_np.3:62
6387 msgid ""
6388 "This function is a nonstandard GNU extension; hence the suffix \"_np"
6389 "\" (nonportable) in the name."
6390 msgstr ""
6391 "この関数は非標準の GNU による拡張である。\n"
6392 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
6393 "付いている。"
6394
6395 #. type: Plain text
6396 #: build/C/man3/pthread_getattr_np.3:125
6397 msgid ""
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."
6404 msgstr ""
6405 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
6406 "このプログラムは、スレッドを作成し、それから\n"
6407 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
6408 "スタックアドレス、スタックサイズを取得し表示する。\n"
6409 "コマンドライン引数での指定で、スレッドを作成する際に\n"
6410 "上記の属性にデフォルト値以外の値を設定することができる。\n"
6411 "下記のシェルのセッションはこのプログラムの使用例である。"
6412
6413 #. type: Plain text
6414 #: build/C/man3/pthread_getattr_np.3:128
6415 msgid ""
6416 "In the first run, on an x86-32 system, a thread is created using default "
6417 "attributes:"
6418 msgstr ""
6419 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
6420 "(x86-32 システム上で実行)。"
6421
6422 #. type: Plain text
6423 #: build/C/man3/pthread_getattr_np.3:138
6424 #, no-wrap
6425 msgid ""
6426 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2 MB\n"
6427 "unlimited\n"
6428 "$B< ./a.out>\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"
6433 msgstr ""
6434 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2 MB\n"
6435 "unlimited\n"
6436 "$B< ./a.out>\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"
6441
6442 #. type: Plain text
6443 #: build/C/man3/pthread_getattr_np.3:144
6444 msgid ""
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 "
6447 "x86-32):"
6448 msgstr ""
6449 "次の実行例では、guard size が指定された場合、\n"
6450 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
6451 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
6452
6453 #. type: Plain text
6454 #: build/C/man3/pthread_getattr_np.3:152
6455 #, no-wrap
6456 msgid ""
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"
6462 msgstr ""
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"
6468
6469 #. type: Plain text
6470 #: build/C/man3/pthread_getattr_np.3:157
6471 #, no-wrap
6472 msgid ""
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"
6477 msgstr ""
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"
6482
6483 #. type: Plain text
6484 #: build/C/man3/pthread_getattr_np.3:176
6485 msgid ""
6486 "In the last run, the program manually allocates a stack for the thread.  In "
6487 "this case, the guard size attribute is ignored."
6488 msgstr ""
6489 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
6490 "この場合には、guard size 属性は無視される。"
6491
6492 #. type: Plain text
6493 #: build/C/man3/pthread_getattr_np.3:181
6494 #, no-wrap
6495 msgid ""
6496 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
6497 "Allocated thread stack at 0x804d000\n"
6498 msgstr ""
6499 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
6500 "Allocated thread stack at 0x804d000\n"
6501
6502 #. type: Plain text
6503 #: build/C/man3/pthread_getattr_np.3:186
6504 #, no-wrap
6505 msgid ""
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"
6510 msgstr ""
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"
6515
6516 #. type: Plain text
6517 #: build/C/man3/pthread_getattr_np.3:191
6518 #, no-wrap
6519 msgid ""
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"
6524 msgstr ""
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"
6529
6530 #. type: Plain text
6531 #: build/C/man3/pthread_getattr_np.3:212
6532 #, no-wrap
6533 msgid ""
6534 "static void\n"
6535 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6536 "{\n"
6537 "    int s;\n"
6538 "    size_t stack_size, guard_size;\n"
6539 "    void *stack_addr;\n"
6540 msgstr ""
6541 "static void\n"
6542 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
6543 "{\n"
6544 "    int s;\n"
6545 "    size_t stack_size, guard_size;\n"
6546 "    void *stack_addr;\n"
6547
6548 #. type: Plain text
6549 #: build/C/man3/pthread_getattr_np.3:217
6550 #, no-wrap
6551 msgid ""
6552 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
6553 "    if (s != 0)\n"
6554 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6555 "    printf(\"%sGuard size          = %zu bytes\\en\", prefix, guard_size);\n"
6556 msgstr ""
6557 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
6558 "    if (s != 0)\n"
6559 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
6560 "    printf(\"%sGuard size          = %zu bytes\\en\", prefix, guard_size);\n"
6561
6562 #. type: Plain text
6563 #: build/C/man3/pthread_getattr_np.3:228
6564 #, no-wrap
6565 msgid ""
6566 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6567 "    if (s != 0)\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"
6575 "}\n"
6576 msgstr ""
6577 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
6578 "    if (s != 0)\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"
6586 "}\n"
6587
6588 #. type: Plain text
6589 #: build/C/man3/pthread_getattr_np.3:234
6590 #, no-wrap
6591 msgid ""
6592 "static void\n"
6593 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6594 "{\n"
6595 "    int s;\n"
6596 "    pthread_attr_t attr;\n"
6597 msgstr ""
6598 "static void\n"
6599 "display_thread_attributes(pthread_t thread, char *prefix)\n"
6600 "{\n"
6601 "    int s;\n"
6602 "    pthread_attr_t attr;\n"
6603
6604 #. type: Plain text
6605 #: build/C/man3/pthread_getattr_np.3:238
6606 #, no-wrap
6607 msgid ""
6608 "    s = pthread_getattr_np(thread, &attr);\n"
6609 "    if (s != 0)\n"
6610 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6611 msgstr ""
6612 "    s = pthread_getattr_np(thread, &attr);\n"
6613 "    if (s != 0)\n"
6614 "        handle_error_en(s, \"pthread_getattr_np\");\n"
6615
6616 #. type: Plain text
6617 #: build/C/man3/pthread_getattr_np.3:240
6618 #, no-wrap
6619 msgid "    display_stack_related_attributes(&attr, prefix);\n"
6620 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
6621
6622 #. type: Plain text
6623 #: build/C/man3/pthread_getattr_np.3:245
6624 #, no-wrap
6625 msgid ""
6626 "    s = pthread_attr_destroy(&attr);\n"
6627 "    if (s != 0)\n"
6628 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6629 "}\n"
6630 msgstr ""
6631 "    s = pthread_attr_destroy(&attr);\n"
6632 "    if (s != 0)\n"
6633 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
6634 "}\n"
6635
6636 #. type: Plain text
6637 #: build/C/man3/pthread_getattr_np.3:251
6638 #, no-wrap
6639 msgid ""
6640 "static void *           /* Start function for thread we create */\n"
6641 "thread_start(void *arg)\n"
6642 "{\n"
6643 "    printf(\"Attributes of created thread:\\en\");\n"
6644 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6645 msgstr ""
6646 "static void *           /* Start function for thread we create */\n"
6647 "thread_start(void *arg)\n"
6648 "{\n"
6649 "    printf(\"Attributes of created thread:\\en\");\n"
6650 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
6651
6652 #. type: Plain text
6653 #: build/C/man3/pthread_getattr_np.3:265
6654 #, no-wrap
6655 msgid ""
6656 "static void\n"
6657 "usage(char *pname, char *msg)\n"
6658 "{\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"
6665 "}\n"
6666 msgstr ""
6667 "static void\n"
6668 "usage(char *pname, char *msg)\n"
6669 "{\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"
6676 "}\n"
6677
6678 #. type: Plain text
6679 #: build/C/man3/pthread_getattr_np.3:278
6680 #, no-wrap
6681 msgid ""
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"
6685 "{\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"
6694 msgstr ""
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"
6698 "{\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"
6707
6708 #. type: Plain text
6709 #: build/C/man3/pthread_getattr_np.3:287
6710 #, no-wrap
6711 msgid ""
6712 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6713 "        switch (opt) {\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"
6718 "        }\n"
6719 "    }\n"
6720 msgstr ""
6721 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
6722 "        switch (opt) {\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"
6727 "        }\n"
6728 "    }\n"
6729
6730 #. type: Plain text
6731 #: build/C/man3/pthread_getattr_np.3:290
6732 #, no-wrap
6733 msgid ""
6734 "    if (allocate_stack && stack_size == -1)\n"
6735 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6736 msgstr ""
6737 "    if (allocate_stack && stack_size == -1)\n"
6738 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
6739
6740 #. type: Plain text
6741 #: build/C/man3/pthread_getattr_np.3:293
6742 #, no-wrap
6743 msgid ""
6744 "    if (argc E<gt> optind)\n"
6745 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6746 msgstr ""
6747 "    if (argc E<gt> optind)\n"
6748 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
6749
6750 #. type: Plain text
6751 #: build/C/man3/pthread_getattr_np.3:296
6752 #, no-wrap
6753 msgid ""
6754 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6755 "        ret_attrp = attrp;\n"
6756 msgstr ""
6757 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
6758 "        ret_attrp = attrp;\n"
6759
6760 #. type: Plain text
6761 #: build/C/man3/pthread_getattr_np.3:301
6762 #, no-wrap
6763 msgid ""
6764 "        s = pthread_attr_init(attrp);\n"
6765 "        if (s != 0)\n"
6766 "            handle_error_en(s, \"pthread_attr_init\");\n"
6767 "    }\n"
6768 msgstr ""
6769 "        s = pthread_attr_init(attrp);\n"
6770 "        if (s != 0)\n"
6771 "            handle_error_en(s, \"pthread_attr_init\");\n"
6772 "    }\n"
6773
6774 #. type: Plain text
6775 #: build/C/man3/pthread_getattr_np.3:313
6776 #, no-wrap
6777 msgid ""
6778 "    if (stack_size E<gt>= 0) {\n"
6779 "        if (!allocate_stack) {\n"
6780 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6781 "            if (s != 0)\n"
6782 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6783 "        } else {\n"
6784 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6785 "                               stack_size);\n"
6786 "            if (s != 0)\n"
6787 "                handle_error_en(s, \"posix_memalign\");\n"
6788 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6789 msgstr ""
6790 "    if (stack_size E<gt>= 0) {\n"
6791 "        if (!allocate_stack) {\n"
6792 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
6793 "            if (s != 0)\n"
6794 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6795 "        } else {\n"
6796 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
6797 "                               stack_size);\n"
6798 "            if (s != 0)\n"
6799 "                handle_error_en(s, \"posix_memalign\");\n"
6800 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
6801
6802 #. type: Plain text
6803 #: build/C/man3/pthread_getattr_np.3:319
6804 #, no-wrap
6805 msgid ""
6806 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6807 "            if (s != 0)\n"
6808 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6809 "        }\n"
6810 "    }\n"
6811 msgstr ""
6812 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
6813 "            if (s != 0)\n"
6814 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6815 "        }\n"
6816 "    }\n"
6817
6818 #. type: Plain text
6819 #: build/C/man3/pthread_getattr_np.3:325
6820 #, no-wrap
6821 msgid ""
6822 "    if (guard_size E<gt>= 0) {\n"
6823 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6824 "        if (s != 0)\n"
6825 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6826 "    }\n"
6827 msgstr ""
6828 "    if (guard_size E<gt>= 0) {\n"
6829 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
6830 "        if (s != 0)\n"
6831 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
6832 "    }\n"
6833
6834 #. type: Plain text
6835 #: build/C/man3/pthread_getattr_np.3:328
6836 #, no-wrap
6837 msgid ""
6838 "    return ret_attrp;\n"
6839 "}\n"
6840 msgstr ""
6841 "    return ret_attrp;\n"
6842 "}\n"
6843
6844 #. type: Plain text
6845 #: build/C/man3/pthread_getattr_np.3:337
6846 #, no-wrap
6847 msgid ""
6848 "int\n"
6849 "main(int argc, char *argv[])\n"
6850 "{\n"
6851 "    int s;\n"
6852 "    pthread_t thr;\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"
6856 msgstr ""
6857 "int\n"
6858 "main(int argc, char *argv[])\n"
6859 "{\n"
6860 "    int s;\n"
6861 "    pthread_t thr;\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"
6865
6866 #. type: Plain text
6867 #: build/C/man3/pthread_getattr_np.3:339
6868 #, no-wrap
6869 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6870 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
6871
6872 #. type: Plain text
6873 #: build/C/man3/pthread_getattr_np.3:345
6874 #, no-wrap
6875 msgid ""
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"
6880 "    }\n"
6881 msgstr ""
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"
6886 "    }\n"
6887
6888 #. type: Plain text
6889 #: build/C/man3/pthread_getattr_np.3:375
6890 #: build/C/man3/pthread_getattr_default_np.3:212
6891 msgid ""
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)"
6898 msgstr ""
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)"
6905
6906 #. type: TH
6907 #: build/C/man3/pthread_getcpuclockid.3:26
6908 #, no-wrap
6909 msgid "PTHREAD_GETCPUCLOCKID"
6910 msgstr "PTHREAD_GETCPUCLOCKID"
6911
6912 #. type: Plain text
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 を取得する"
6916
6917 #. type: Plain text
6918 #: build/C/man3/pthread_getcpuclockid.3:33
6919 #, no-wrap
6920 msgid ""
6921 "B<#include E<lt>pthread.hE<gt>>\n"
6922 "B<#include E<lt>time.hE<gt>>\n"
6923 msgstr ""
6924 "B<#include E<lt>pthread.hE<gt>>\n"
6925 "B<#include E<lt>time.hE<gt>>\n"
6926
6927 #. type: Plain text
6928 #: build/C/man3/pthread_getcpuclockid.3:35
6929 #, no-wrap
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"
6932
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.
6936 #. type: Plain text
6937 #: build/C/man3/pthread_getcpuclockid.3:49
6938 #, fuzzy
6939 #| msgid ""
6940 #| "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU "
6941 #| "time clock of the thread I<thread>."
6942 msgid ""
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>."
6946 msgstr ""
6947 "B<pthread_getcpuclockid>() 関数は、\n"
6948 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
6949
6950 #. type: TP
6951 #: build/C/man3/pthread_getcpuclockid.3:53
6952 #, no-wrap
6953 msgid "B<ENOENT>"
6954 msgstr "B<ENOENT>"
6955
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).
6960 #. type: Plain text
6961 #: build/C/man3/pthread_getcpuclockid.3:61
6962 msgid "Per-thread CPU time clocks are not supported by the system."
6963 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
6964
6965 #. type: Plain text
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 以降で利用できる。"
6969
6970 #. type: tbl table
6971 #: build/C/man3/pthread_getcpuclockid.3:78
6972 #, no-wrap
6973 msgid "B<pthread_getcpuclockid>()"
6974 msgstr "B<pthread_getcpuclockid>()"
6975
6976 #. type: Plain text
6977 #: build/C/man3/pthread_getcpuclockid.3:93
6978 msgid ""
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>."
6982 msgstr ""
6983 "I<thread> が呼び出したスレッドを参照している場合、\n"
6984 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
6985 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
6986 "を参照する ID が返される。"
6987
6988 #. type: Plain text
6989 #: build/C/man3/pthread_getcpuclockid.3:99
6990 msgid ""
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:"
6994 msgstr ""
6995 "以下のプログラムは、スレッドを作成し、それから\n"
6996 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
6997 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
6998 "スレッド毎の CPU 時間を取得する。\n"
6999 "下記のシェルのセッションは実行例である。"
7000
7001 #. type: Plain text
7002 #: build/C/man3/pthread_getcpuclockid.3:109
7003 #, no-wrap
7004 msgid ""
7005 "$ B<./a.out>\n"
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"
7012 msgstr ""
7013 "$ B<./a.out>\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"
7020
7021 #. type: Plain text
7022 #: build/C/man3/pthread_getcpuclockid.3:115
7023 #, no-wrap
7024 msgid "/* Link with \"-lrt\" */\n"
7025 msgstr "/* \"-lrt\" でリンクする */\n"
7026
7027 #. type: Plain text
7028 #: build/C/man3/pthread_getcpuclockid.3:124
7029 #, no-wrap
7030 msgid ""
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"
7039 msgstr ""
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"
7048
7049 #. type: Plain text
7050 #: build/C/man3/pthread_getcpuclockid.3:138
7051 #, no-wrap
7052 msgid ""
7053 "static void *\n"
7054 "thread_start(void *arg)\n"
7055 "{\n"
7056 "    printf(\"Subthread starting infinite loop\\en\");\n"
7057 "    for (;;)\n"
7058 "        continue;\n"
7059 "}\n"
7060 msgstr ""
7061 "static void *\n"
7062 "thread_start(void *arg)\n"
7063 "{\n"
7064 "    printf(\"Subthread starting infinite loop\\en\");\n"
7065 "    for (;;)\n"
7066 "        continue;\n"
7067 "}\n"
7068
7069 #. type: Plain text
7070 #: build/C/man3/pthread_getcpuclockid.3:143
7071 #, no-wrap
7072 msgid ""
7073 "static void\n"
7074 "pclock(char *msg, clockid_t cid)\n"
7075 "{\n"
7076 "    struct timespec ts;\n"
7077 msgstr ""
7078 "static void\n"
7079 "pclock(char *msg, clockid_t cid)\n"
7080 "{\n"
7081 "    struct timespec ts;\n"
7082
7083 #. type: Plain text
7084 #: build/C/man3/pthread_getcpuclockid.3:149
7085 #, no-wrap
7086 msgid ""
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"
7091 "}\n"
7092 msgstr ""
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"
7097 "}\n"
7098
7099 #. type: Plain text
7100 #: build/C/man3/pthread_getcpuclockid.3:156
7101 #, no-wrap
7102 msgid ""
7103 "int\n"
7104 "main(int argc, char *argv[])\n"
7105 "{\n"
7106 "    pthread_t thread;\n"
7107 "    clockid_t cid;\n"
7108 "    int s;\n"
7109 msgstr ""
7110 "int\n"
7111 "main(int argc, char *argv[])\n"
7112 "{\n"
7113 "    pthread_t thread;\n"
7114 "    clockid_t cid;\n"
7115 "    int s;\n"
7116
7117 #. type: Plain text
7118 #: build/C/man3/pthread_getcpuclockid.3:160
7119 #, no-wrap
7120 msgid ""
7121 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
7122 "    if (s != 0)\n"
7123 "        handle_error_en(s, \"pthread_create\");\n"
7124 msgstr ""
7125 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
7126 "    if (s != 0)\n"
7127 "        handle_error_en(s, \"pthread_create\");\n"
7128
7129 #. type: Plain text
7130 #: build/C/man3/pthread_getcpuclockid.3:163
7131 #, no-wrap
7132 msgid ""
7133 "    printf(\"Main thread sleeping\\en\");\n"
7134 "    sleep(1);\n"
7135 msgstr ""
7136 "    printf(\"Main thread sleeping\\en\");\n"
7137 "    sleep(1);\n"
7138
7139 #. type: Plain text
7140 #: build/C/man3/pthread_getcpuclockid.3:167
7141 #, no-wrap
7142 msgid ""
7143 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
7144 "    for (int j = 0; j E<lt> 2000000; j++)\n"
7145 "        getppid();\n"
7146 msgstr ""
7147 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
7148 "    for (int j = 0; j E<lt> 2000000; j++)\n"
7149 "        getppid();\n"
7150
7151 #. type: Plain text
7152 #: build/C/man3/pthread_getcpuclockid.3:169
7153 #, no-wrap
7154 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
7155 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
7156
7157 #. type: Plain text
7158 #: build/C/man3/pthread_getcpuclockid.3:174
7159 #, no-wrap
7160 msgid ""
7161 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
7162 "    if (s != 0)\n"
7163 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
7164 "    pclock(\"Main thread CPU time:   \", cid);\n"
7165 msgstr ""
7166 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
7167 "    if (s != 0)\n"
7168 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
7169 "    pclock(\"Main thread CPU time:   \", cid);\n"
7170
7171 #. type: Plain text
7172 #: build/C/man3/pthread_getcpuclockid.3:177
7173 #, no-wrap
7174 msgid ""
7175 "    /* The preceding 4 lines of code could have been replaced by:\n"
7176 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
7177 msgstr ""
7178 "    /* The preceding 4 lines of code could have been replaced by:\n"
7179 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
7180
7181 #. type: Plain text
7182 #: build/C/man3/pthread_getcpuclockid.3:182
7183 #, no-wrap
7184 msgid ""
7185 "    s = pthread_getcpuclockid(thread, &cid);\n"
7186 "    if (s != 0)\n"
7187 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
7188 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
7189 msgstr ""
7190 "    s = pthread_getcpuclockid(thread, &cid);\n"
7191 "    if (s != 0)\n"
7192 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
7193 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
7194
7195 #. type: Plain text
7196 #: build/C/man3/pthread_getcpuclockid.3:185
7197 #, no-wrap
7198 msgid ""
7199 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
7200 "}\n"
7201 msgstr ""
7202 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
7203 "}\n"
7204
7205 #. type: Plain text
7206 #: build/C/man3/pthread_getcpuclockid.3:194
7207 msgid ""
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)"
7210 msgstr ""
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)"
7213
7214 #. type: TH
7215 #: build/C/man3/pthread_join.3:26
7216 #, no-wrap
7217 msgid "PTHREAD_JOIN"
7218 msgstr "PTHREAD_JOIN"
7219
7220 #. type: Plain text
7221 #: build/C/man3/pthread_join.3:29
7222 msgid "pthread_join - join with a terminated thread"
7223 msgstr "pthread_join - 終了したスレッドを join する"
7224
7225 #. type: Plain text
7226 #: build/C/man3/pthread_join.3:34
7227 #, no-wrap
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"
7230
7231 #. type: Plain text
7232 #: build/C/man3/pthread_join.3:49
7233 msgid ""
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> "
7237 "must be joinable."
7238 msgstr ""
7239 "B<pthread_join>() 関数は、I<thread> で指定されたスレッドが\n"
7240 "終了するのを待つ。そのスレッドがすでに終了している場合、\n"
7241 "B<pthread_join>() はすぐに返る。\n"
7242 "I<thread> で指定されたスレッドは join 可能でなければならない。"
7243
7244 #. type: Plain text
7245 #: build/C/man3/pthread_join.3:63
7246 msgid ""
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> が格納される。"
7253
7254 #. type: Plain text
7255 #: build/C/man3/pthread_join.3:70
7256 msgid ""
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 "
7260 "detached)."
7261 msgstr ""
7262 "複数のスレッドが同時に同じスレッドを join しようとした場合、その結果\n"
7263 "は不定である。B<pthread_join>() を呼び出しているスレッドがキャンセル\n"
7264 "された場合、対象スレッドは join 可能のままとなる (detached 状態には\n"
7265 "ならない)。"
7266
7267 #. type: Plain text
7268 #: build/C/man3/pthread_join.3:75
7269 msgid ""
7270 "On success, B<pthread_join>()  returns 0; on error, it returns an error "
7271 "number."
7272 msgstr "成功すると、 B<pthread_join>() は 0 を返す。エラーの場合、エラー番号を返す。"
7273
7274 #. type: TP
7275 #: build/C/man3/pthread_join.3:76
7276 #, no-wrap
7277 msgid "B<EDEADLK>"
7278 msgstr "B<EDEADLK>"
7279
7280 #.  The following verified by testing on glibc 2.8/NPTL:
7281 #.  The following verified by testing on glibc 2.8/NPTL:
7282 #. type: Plain text
7283 #: build/C/man3/pthread_join.3:85
7284 msgid ""
7285 "A deadlock was detected (e.g., two threads tried to join with each other); "
7286 "or I<thread> specifies the calling thread."
7287 msgstr ""
7288 "デッドロックが検出された (例えば、二つのスレッドが互いに join しようと\n"
7289 "した場合)、または I<thread> に呼び出したスレッドが指定されている。"
7290
7291 #.  POSIX.1-2001 does not specify this error case.
7292 #. type: Plain text
7293 #: build/C/man3/pthread_join.3:93
7294 msgid "Another thread is already waiting to join with this thread."
7295 msgstr "別のスレッドがすでにこのスレッドの join 待ちである。"
7296
7297 #. type: tbl table
7298 #: build/C/man3/pthread_join.3:108
7299 #, no-wrap
7300 msgid "B<pthread_join>()"
7301 msgstr "B<pthread_join>()"
7302
7303 #. type: Plain text
7304 #: build/C/man3/pthread_join.3:120
7305 msgid ""
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)."
7310 msgstr ""
7311
7312 #. type: Plain text
7313 #: build/C/man3/pthread_join.3:123
7314 msgid ""
7315 "Joining with a thread that has previously been joined results in undefined "
7316 "behavior."
7317 msgstr "すでに join されたスレッドを join した場合の結果は不定である。"
7318
7319 #. type: Plain text
7320 #: build/C/man3/pthread_join.3:131
7321 msgid ""
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 "
7326 "processes)."
7327 msgstr ""
7328 "join 可能なスレッド (detached 状態でないスレッド) の join に失敗した場合、\n"
7329 "\"ゾンビスレッド (zombie thread)\" が生成される。\n"
7330 "各ゾンビスレッドはシステムリソースをいくらかは消費し、\n"
7331 "ゾンビスレッドがたくさん生成されてしまうと、\n"
7332 "新しいスレッド (やプロセス) がそれ以上作成できなくなってしまうので、\n"
7333 "このようなことが起きるのは避けること。"
7334
7335 #. type: Plain text
7336 #: build/C/man3/pthread_join.3:137
7337 msgid ""
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."
7341 msgstr ""
7342 "pthreads には、 I<waitpid(-1,\\ &status,\\ 0)>、つまり\n"
7343 "\"終了されたスレッドのどれかを join する\" といった機能はない。\n"
7344 "この機能が必要だと思うような場合には、おそらく\n"
7345 "自分のアプリケーションの設計を考え直す必要があるだろう。"
7346
7347 #. type: Plain text
7348 #: build/C/man3/pthread_join.3:140
7349 msgid ""
7350 "All of the threads in a process are peers: any thread can join with any "
7351 "other thread in the process."
7352 msgstr ""
7353 "プロセス内の全てのスレッドは対等であり、\n"
7354 "どのスレッドでもプロセス内の他のスレッドを join できる。"
7355
7356 #. type: Plain text
7357 #: build/C/man3/pthread_join.3:150
7358 msgid ""
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)"
7361 msgstr ""
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)"
7364
7365 #. type: TH
7366 #: build/C/man3/pthread_kill.3:26
7367 #, no-wrap
7368 msgid "PTHREAD_KILL"
7369 msgstr "PTHREAD_KILL"
7370
7371 #. type: Plain text
7372 #: build/C/man3/pthread_kill.3:29
7373 msgid "pthread_kill - send a signal to a thread"
7374 msgstr "pthread_kill - スレッドにシグナルを送信する"
7375
7376 #. type: Plain text
7377 #: build/C/man3/pthread_kill.3:32 build/C/man3/pthread_sigmask.3:32
7378 #, no-wrap
7379 msgid "B<#include E<lt>signal.hE<gt>>\n"
7380 msgstr "B<#include E<lt>signal.hE<gt>>\n"
7381
7382 #. type: Plain text
7383 #: build/C/man3/pthread_kill.3:34
7384 #, no-wrap
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"
7387
7388 #. type: Plain text
7389 #: build/C/man3/pthread_kill.3:45
7390 msgid "B<pthread_kill>():"
7391 msgstr "B<pthread_kill>():"
7392
7393 #. type: Plain text
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"
7397
7398 #. type: Plain text
7399 #: build/C/man3/pthread_kill.3:59
7400 msgid ""
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>."
7404 msgstr ""
7405 "B<pthread_kill>() 関数は、呼び出したスレッドと同じプロセスの\n"
7406 "スレッド I<thread> にシグナル I<sig> を送信する。\n"
7407 "シグナルは非同期に I<thread> へ直接送られる。"
7408
7409 #. type: Plain text
7410 #: build/C/man3/pthread_kill.3:63
7411 msgid ""
7412 "If I<sig> is 0, then no signal is sent, but error checking is still "
7413 "performed."
7414 msgstr ""
7415 "I<sig> が 0 の場合、シグナルは送信されないが、エラーチェックだけは実行され"
7416 "る。"
7417
7418 #. type: Plain text
7419 #: build/C/man3/pthread_kill.3:68
7420 msgid ""
7421 "On success, B<pthread_kill>()  returns 0; on error, it returns an error "
7422 "number, and no signal is sent."
7423 msgstr ""
7424 "成功すると、 B<pthread_kill>() は 0 を返す。\n"
7425 "エラーの場合、エラー番号を返し、シグナルの送信は行わない。"
7426
7427 #. type: Plain text
7428 #: build/C/man3/pthread_kill.3:72
7429 msgid "An invalid signal was specified."
7430 msgstr "無効なシグナルが指定された。"
7431
7432 #. type: tbl table
7433 #: build/C/man3/pthread_kill.3:82
7434 #, no-wrap
7435 msgid "B<pthread_kill>()"
7436 msgstr "B<pthread_kill>()"
7437
7438 #. type: Plain text
7439 #: build/C/man3/pthread_kill.3:93
7440 msgid ""
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."
7445 msgstr ""
7446 "シグナルの配送はプロセス全体で行われる。\n"
7447 "シグナルハンドラーが設定されている場合、\n"
7448 "そのハンドラーがスレッド I<thread> で起動されるが、\n"
7449 "シグナルの配送が \"stop\", \"continue\", \"terminate\" のいずれかの場合、\n"
7450 "シグナルに対するアクションはプロセス全体に影響がある。"
7451
7452 #. type: Plain text
7453 #: build/C/man3/pthread_kill.3:103
7454 msgid ""
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."
7458 msgstr ""
7459
7460 #. type: Plain text
7461 #: build/C/man3/pthread_kill.3:116
7462 msgid ""
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."
7470 msgstr ""
7471 "POSIX.1-2008 では、 スレッドが終了した後にそのスレッド ID が使用されたことを"
7472 "検出した場合に、 B<pthread_kill>() はエラー B<ESRCH> を返すことを推奨されてい"
7473 "る。 glibc の実装では、無効なスレッド ID を検出できる場合にはこのエラーを返"
7474 "す。 しかし、 POSIX では、 終了したスレッド ID を使おうとした場合の動作は不定"
7475 "であり、 B<pthread_kill>() で無効なスレッド ID を使おうとした場合には、 例え"
7476 "ば、 セグメンテーションフォールトになる可能性もある点に注意すること。"
7477
7478 #. type: Plain text
7479 #: build/C/man3/pthread_kill.3:125
7480 msgid ""
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)"
7483 msgstr ""
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)"
7486
7487 #. type: TH
7488 #: build/C/man3/pthread_kill_other_threads_np.3:26
7489 #, no-wrap
7490 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
7491 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
7492
7493 #. type: Plain text
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 - プロセス内の他の全スレッドを終了する"
7497
7498 #. type: Plain text
7499 #: build/C/man3/pthread_kill_other_threads_np.3:34
7500 #, no-wrap
7501 msgid "B<void pthread_kill_other_threads_np(void);>\n"
7502 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
7503
7504 #.  .SH VERSIONS
7505 #.  Available since glibc 2.0
7506 #. type: Plain text
7507 #: build/C/man3/pthread_kill_other_threads_np.3:47
7508 msgid ""
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 "
7514 "in those threads."
7515 msgstr ""
7516 "B<pthread_kill_other_threads_np>() は、\n"
7517 "LinuxThreads スレッド実装においてのみ効果がある。\n"
7518 "LinuxThreads スレッド実装では、この関数を呼び出すと\n"
7519 "アプリケーション内の全てのスレッドがすぐに終了される。\n"
7520 "終了対象のスレッドの cancelability state と cancelability type は\n"
7521 "無視され、それらのスレッドのクリーンアップハンドラーは呼び出されない。"
7522
7523 #. type: tbl table
7524 #: build/C/man3/pthread_kill_other_threads_np.3:57
7525 #, no-wrap
7526 msgid "B<pthread_kill_other_threads_np>()"
7527 msgstr "B<pthread_kill_other_threads_np>()"
7528
7529 #. type: Plain text
7530 #: build/C/man3/pthread_kill_other_threads_np.3:71
7531 msgid ""
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)."
7537 msgstr ""
7538 "B<pthread_kill_other_threads_np>() は、\n"
7539 "スレッドが B<execve>(2) や同様の関数を呼び出す直前に\n"
7540 "呼ばれることを目的として用意されている。\n"
7541 "この関数は、(廃止予定の) LinuxThreads スレッド実装における、\n"
7542 "B<execve>(2) の際にアプリケーションの他のスレッドが自動的に\n"
7543 "終了されないという制限を解決するために設計された。"
7544
7545 #. type: Plain text
7546 #: build/C/man3/pthread_kill_other_threads_np.3:78
7547 msgid ""
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).)"
7551 msgstr ""
7552 "NPTL スレッド実装では、 B<pthread_kill_other_threads_np>() は存在するが、\n"
7553 "何もしない(NPTL 実装は B<execve>(2) の際に適切な動作をするので、\n"
7554 "何もする必要がないということだ)。"
7555
7556 #. type: Plain text
7557 #: build/C/man3/pthread_kill_other_threads_np.3:84
7558 msgid ""
7559 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7560 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7561 msgstr ""
7562 "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), "
7563 "B<pthread_setcanceltype>(3), B<pthreads>(7)"
7564
7565 #. type: TH
7566 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
7567 #, no-wrap
7568 msgid "PTHREAD_RWLOCKATTR_SETKIND_NP"
7569 msgstr "PTHREAD_RWLOCKATTR_SETKIND_NP"
7570
7571 #. type: TH
7572 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
7573 #: build/C/man3/pthread_atfork.3:25
7574 #, no-wrap
7575 msgid "2020-08-13"
7576 msgstr "2020-08-13"
7577
7578 #. type: Plain text
7579 #: build/C/man3/pthread_rwlockattr_setkind_np.3:29
7580 msgid ""
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"
7583 msgstr ""
7584 "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - スレッドの読み"
7585 "書きロック属性オブジェクトの読み書きロック種別の設定、取得を行う"
7586
7587 #. type: Plain text
7588 #: build/C/man3/pthread_rwlockattr_setkind_np.3:37
7589 #, no-wrap
7590 msgid ""
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"
7595 msgstr ""
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"
7600
7601 #. type: Plain text
7602 #: build/C/man3/pthread_rwlockattr_setkind_np.3:48
7603 msgid "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
7604 msgstr ""
7605 "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
7606
7607 #. type: Plain text
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"
7611
7612 #. type: Plain text
7613 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
7614 msgid ""
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 "
7618 "the following:"
7619 msgstr ""
7620 "B<pthread_rwlockattr_setkind_np>() 関数は、 I<attr> が参照する読み書きロック"
7621 "属性オブジェクトの「ロック種別 (lock kind)」を I<pref> で指定された値に設定す"
7622 "る。 引数 I<pref> には以下のいずれか一つを設定できる。"
7623
7624 #. type: TP
7625 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
7626 #, no-wrap
7627 msgid "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
7628 msgstr "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
7629
7630 #. type: Plain text
7631 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
7632 msgid ""
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."
7640 msgstr ""
7641 "これがデフォルトである。 スレッドは複数の読み出しロックを保持できる。 つま"
7642 "り、読み出しロックは再帰的である。 Single Unix Specification では、 読み出し"
7643 "側がロックをかけようとした際に、書き込みロックはないが書き込み側が待っていた"
7644 "場合の、動作は規定されていない。 B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定"
7645 "し、読み出し側に優先度を与えるということは、 たとえ書き込み側が待っていたとし"
7646 "ても、読み出し側が要求したロックを受け取ることを意味する。 読み出し側がいる限"
7647 "り、書き込み側は待つことになる。"
7648
7649 #. type: TP
7650 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
7651 #, no-wrap
7652 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
7653 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
7654
7655 #
7656 #
7657 #
7658 #.  ---
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.
7671 #.  ---
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
7675 #. type: Plain text
7676 #: build/C/man3/pthread_rwlockattr_setkind_np.3:108
7677 msgid ""
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 "
7684 "deadlocks."
7685 msgstr ""
7686
7687 #. type: TP
7688 #: build/C/man3/pthread_rwlockattr_setkind_np.3:108
7689 #, no-wrap
7690 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
7691 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
7692
7693 #. type: Plain text
7694 #: build/C/man3/pthread_rwlockattr_setkind_np.3:113
7695 msgid ""
7696 "Setting the lock kind to this avoids writer starvation as long as any read "
7697 "locking is not done in a recursive fashion."
7698 msgstr ""
7699 "ロック種別をこの値に設定すると、 読み出しロックが再帰的に行われない限りは、 "
7700 "書き込み側の待ちを避けることができる。"
7701
7702 #. type: Plain text
7703 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
7704 msgid ""
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>."
7708 msgstr ""
7709 "B<pthread_rwlockattr_getkind_np>() 関数は、 I<attr> が参照する読み書きロック"
7710 "属性オブジェクトのロック種別属性の値をポインター I<pref> に入れて返す。"
7711
7712 #. type: Plain text
7713 #: build/C/man3/pthread_rwlockattr_setkind_np.3:129
7714 msgid ""
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."
7718 msgstr ""
7719 "成功すると、これらの関数は 0 を返す。 有効なポインター引数が渡された場合、 "
7720 "B<pthread_rwlockattr_getkind_np>() は常に成功する。 エラーの場合、 "
7721 "B<pthread_rwlockattr_setkind_np>() は 0 以外のエラー番号を返す。"
7722
7723 #. type: Plain text
7724 #: build/C/man3/pthread_rwlockattr_setkind_np.3:134
7725 msgid "I<pref> specifies an unsupported value."
7726 msgstr "I<pref> にサポート外の値が指定された。"
7727
7728 #. type: Plain text
7729 #: build/C/man3/pthread_rwlockattr_setkind_np.3:140
7730 msgid ""
7731 "The B<pthread_rwlockattr_getkind_np>()  and "
7732 "B<pthread_rwlockattr_setkind_np>()  functions first appeared in glibc 2.1."
7733 msgstr ""
7734 "関数 B<pthread_rwlockattr_getkind_np>() と "
7735 "B<pthread_rwlockattr_setkind_np>() は glibc 2.1 で初めて登場した。"
7736
7737 #. type: Plain text
7738 #: build/C/man3/pthread_rwlockattr_setkind_np.3:143
7739 msgid ""
7740 "These functions are non-standard GNU extensions; hence the suffix \"_np"
7741 "\" (nonportable) in the names."
7742 msgstr ""
7743 "これらの関数は非標準の GNU による拡張である。 そのため、名前に \"_np\" (non-"
7744 "portable; 移植性がない) という接尾辞が付いている。"
7745
7746 #. type: Plain text
7747 #: build/C/man3/pthread_rwlockattr_setkind_np.3:145
7748 msgid "B<pthreads>(7)"
7749 msgstr "B<pthreads>(7)"
7750
7751 #. type: TH
7752 #: build/C/man3/pthread_self.3:26
7753 #, no-wrap
7754 msgid "PTHREAD_SELF"
7755 msgstr "PTHREAD_SELF"
7756
7757 #. type: Plain text
7758 #: build/C/man3/pthread_self.3:29
7759 msgid "pthread_self - obtain ID of the calling thread"
7760 msgstr "pthread_self - 呼び出したスレッドの ID を取得する"
7761
7762 #. type: Plain text
7763 #: build/C/man3/pthread_self.3:34
7764 #, no-wrap
7765 msgid "B<pthread_t pthread_self(void);>\n"
7766 msgstr "B<pthread_t pthread_self(void);>\n"
7767
7768 #. type: Plain text
7769 #: build/C/man3/pthread_self.3:46
7770 msgid ""
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."
7774 msgstr ""
7775 "B<pthread_self>() 関数は、呼び出したスレッドの ID を返す。\n"
7776 "得られる ID は、このスレッドが作成された B<pthread_create>(3) の\n"
7777 "呼び出しで I<*thread> で返されるのと同じ値である。"
7778
7779 #. type: Plain text
7780 #: build/C/man3/pthread_self.3:48
7781 msgid "This function always succeeds, returning the calling thread's ID."
7782 msgstr "この関数は常に成功し、呼び出したスレッドの ID を返す。"
7783
7784 #. type: tbl table
7785 #: build/C/man3/pthread_self.3:60
7786 #, no-wrap
7787 msgid "B<pthread_self>()"
7788 msgstr "B<pthread_self>()"
7789
7790 #. type: Plain text
7791 #: build/C/man3/pthread_self.3:75
7792 msgid ""
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."
7798 msgstr ""
7799 "POSIX.1 では、スレッド ID を表現するのに使用する型は、\n"
7800 "スレッド実装が完全に自由に選択してよいことになっている。\n"
7801 "例えば、スレッド ID を表現するのに数値型を使っても構造体を使ってもよい。\n"
7802 "そのため、移植性を確保しつつ、 C 言語の等価演算子 (B<==>) を使って、\n"
7803 "I<pthread_t> 型の変数の比較を行うことはできない。\n"
7804 "代わりに B<pthread_equal>(3) を使うこと。"
7805
7806 #. type: Plain text
7807 #: build/C/man3/pthread_self.3:79
7808 msgid ""
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 "
7811 "results."
7812 msgstr ""
7813 "スレッド識別子はその内部構造を意識すべきではない。\n"
7814 "pthreads 関数以外でスレッド ID を利用しようとした場合、\n"
7815 "移植性がなくなり、どのような結果が得られるかも分からない。"
7816
7817 #. type: Plain text
7818 #: build/C/man3/pthread_self.3:83
7819 msgid ""
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."
7823 msgstr ""
7824 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
7825 "終了したスレッドが join されたり、\n"
7826 "切り離された (detached) スレッドが終了されたりした後は、\n"
7827 "そのスレッド ID は再利用されることがある。"
7828
7829 #. type: Plain text
7830 #: build/C/man3/pthread_self.3:88
7831 msgid ""
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)."
7834 msgstr ""
7835 "B<pthread_self>() が返すスレッド ID は、\n"
7836 "B<gettid>(2) が返すカーネルスレッド ID とは違うものである。"
7837
7838 #. type: Plain text
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)"
7842
7843 #. type: TH
7844 #: build/C/man3/pthread_setaffinity_np.3:26
7845 #, no-wrap
7846 msgid "PTHREAD_SETAFFINITY_NP"
7847 msgstr "PTHREAD_SETAFFINITY_NP"
7848
7849 #. type: Plain text
7850 #: build/C/man3/pthread_setaffinity_np.3:30
7851 msgid ""
7852 "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a "
7853 "thread"
7854 msgstr ""
7855 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
7856 "CPU affinity の設定/取得を行う"
7857
7858 #. type: Plain text
7859 #: build/C/man3/pthread_setaffinity_np.3:39
7860 #, no-wrap
7861 msgid ""
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"
7866 msgstr ""
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"
7871
7872 #. type: Plain text
7873 #: build/C/man3/pthread_setaffinity_np.3:54
7874 msgid ""
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."
7879 msgstr ""
7880 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7881 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
7882 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
7883 "場合は、スレッドは指定された CPU のいずれかに移動される。"
7884
7885 #. type: Plain text
7886 #: build/C/man3/pthread_setaffinity_np.3:61
7887 msgid ""
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>."
7890 msgstr ""
7891 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
7892 "マスクを、I<cpuset> が指すバッファーに入れて返す。"
7893
7894 #. type: Plain text
7895 #: build/C/man3/pthread_setaffinity_np.3:77
7896 msgid ""
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.)"
7901 msgstr ""
7902 "引数 I<cpusetsize> は I<cpuset> が指すバッファーの長さ (バイト単位) で\n"
7903 "ある。通常は、この引数には I<sizeof(cpu_set_t)> を指定する\n"
7904 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
7905 "割り当てている場合には、別の値になることもある)。"
7906
7907 #. type: TP
7908 #: build/C/man3/pthread_setaffinity_np.3:81
7909 #, no-wrap
7910 msgid "B<EFAULT>"
7911 msgstr "B<EFAULT>"
7912
7913 #. type: Plain text
7914 #: build/C/man3/pthread_setaffinity_np.3:84
7915 msgid "A supplied memory address was invalid."
7916 msgstr "指定されたメモリーアドレスが無効である。"
7917
7918 #. type: Plain text
7919 #: build/C/man3/pthread_setaffinity_np.3:93
7920 msgid ""
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)."
7925 msgstr ""
7926 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
7927 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
7928 "されているプロセッサが一つも含まれていない。\n"
7929 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
7930 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
7931
7932 #.  cpumask_t
7933 #.  The raw sched_getaffinity() system call returns the size (in bytes)
7934 #.  of the cpumask_t type.
7935 #. type: Plain text
7936 #: build/C/man3/pthread_setaffinity_np.3:105
7937 msgid ""
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.)"
7942 msgstr ""
7943 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
7944 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
7945 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
7946 "データ型がサポートする CPU 集合の範囲が定義される。)"
7947
7948 #. type: Plain text
7949 #: build/C/man3/pthread_setaffinity_np.3:110
7950 msgid ""
7951 "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the "
7952 "affinity mask used by the kernel."
7953 msgstr ""
7954 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
7955 "affinity マスクの大きさよりも小さい。"
7956
7957 #. type: tbl table
7958 #: build/C/man3/pthread_setaffinity_np.3:128
7959 #, no-wrap
7960 msgid ""
7961 "B<pthread_setaffinity_np>(),\n"
7962 "B<pthread_getaffinity_np>()"
7963 msgstr ""
7964 "B<pthread_setaffinity_np>(),\n"
7965 "B<pthread_getaffinity_np>()"
7966
7967 #. type: Plain text
7968 #: build/C/man3/pthread_setaffinity_np.3:146
7969 msgid ""
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."
7977 msgstr ""
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 "これらの制限は、カーネルにより黙って適用される。"
7986
7987 #. type: Plain text
7988 #: build/C/man3/pthread_setaffinity_np.3:152
7989 msgid ""
7990 "These functions are implemented on top of the B<sched_setaffinity>(2)  and "
7991 "B<sched_getaffinity>(2)  system calls."
7992 msgstr ""
7993 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
7994 "B<sched_getaffinity>(2) を使って実装されている。"
7995
7996 #. type: Plain text
7997 #: build/C/man3/pthread_setaffinity_np.3:163
7998 msgid ""
7999 "A new thread created by B<pthread_create>(3)  inherits a copy of its "
8000 "creator's CPU affinity mask."
8001 msgstr ""
8002 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
8003 "作成者の CPU affinity マスクを継承する。"
8004
8005 #. type: Plain text
8006 #: build/C/man3/pthread_setaffinity_np.3:171
8007 msgid ""
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."
8012 msgstr ""
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 マスクを確認している。"
8019
8020 #. type: Plain text
8021 #: build/C/man3/pthread_setaffinity_np.3:178
8022 #: build/C/man3/pthread_getattr_default_np.3:125
8023 #, no-wrap
8024 msgid ""
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"
8030 msgstr ""
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"
8036
8037 #. type: Plain text
8038 #: build/C/man3/pthread_setaffinity_np.3:188
8039 #, no-wrap
8040 msgid ""
8041 "int\n"
8042 "main(int argc, char *argv[])\n"
8043 "{\n"
8044 "    int s;\n"
8045 "    cpu_set_t cpuset;\n"
8046 "    pthread_t thread;\n"
8047 msgstr ""
8048 "int\n"
8049 "main(int argc, char *argv[])\n"
8050 "{\n"
8051 "    int s;\n"
8052 "    cpu_set_t cpuset;\n"
8053 "    pthread_t thread;\n"
8054
8055 #. type: Plain text
8056 #: build/C/man3/pthread_setaffinity_np.3:190
8057 #, no-wrap
8058 msgid "    thread = pthread_self();\n"
8059 msgstr "    thread = pthread_self();\n"
8060
8061 #. type: Plain text
8062 #: build/C/man3/pthread_setaffinity_np.3:192
8063 #, no-wrap
8064 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
8065 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
8066
8067 #. type: Plain text
8068 #: build/C/man3/pthread_setaffinity_np.3:196
8069 #, no-wrap
8070 msgid ""
8071 "    CPU_ZERO(&cpuset);\n"
8072 "    for (int j = 0; j E<lt> 8; j++)\n"
8073 "        CPU_SET(j, &cpuset);\n"
8074 msgstr ""
8075 "    CPU_ZERO(&cpuset);\n"
8076 "    for (int j = 0; j E<lt> 8; j++)\n"
8077 "        CPU_SET(j, &cpuset);\n"
8078
8079 #. type: Plain text
8080 #: build/C/man3/pthread_setaffinity_np.3:200
8081 #, no-wrap
8082 msgid ""
8083 "    s = pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset);\n"
8084 "    if (s != 0)\n"
8085 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
8086 msgstr ""
8087 "    s = pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset);\n"
8088 "    if (s != 0)\n"
8089 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
8090
8091 #. type: Plain text
8092 #: build/C/man3/pthread_setaffinity_np.3:202
8093 #, no-wrap
8094 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
8095 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
8096
8097 #. type: Plain text
8098 #: build/C/man3/pthread_setaffinity_np.3:206
8099 #, no-wrap
8100 msgid ""
8101 "    s = pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset);\n"
8102 "    if (s != 0)\n"
8103 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
8104 msgstr ""
8105 "    s = pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset);\n"
8106 "    if (s != 0)\n"
8107 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
8108
8109 #. type: Plain text
8110 #: build/C/man3/pthread_setaffinity_np.3:211
8111 #, no-wrap
8112 msgid ""
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"
8117 msgstr ""
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"
8122
8123 #. type: Plain text
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
8127 #, no-wrap
8128 msgid ""
8129 "    exit(EXIT_SUCCESS);\n"
8130 "}\n"
8131 msgstr ""
8132 "    exit(EXIT_SUCCESS);\n"
8133 "}\n"
8134
8135 #. type: Plain text
8136 #: build/C/man3/pthread_setaffinity_np.3:224
8137 msgid ""
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), "
8140 "B<sched>(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)"
8142
8143 #. type: TH
8144 #: build/C/man3/pthread_setcancelstate.3:26
8145 #, no-wrap
8146 msgid "PTHREAD_SETCANCELSTATE"
8147 msgstr "PTHREAD_SETCANCELSTATE"
8148
8149 #. type: Plain text
8150 #: build/C/man3/pthread_setcancelstate.3:30
8151 msgid ""
8152 "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and "
8153 "type"
8154 msgstr ""
8155 "pthread_setcancelstate, pthread_setcanceltype - cancelability state と "
8156 "cancelability type を設定する"
8157
8158 #. type: Plain text
8159 #: build/C/man3/pthread_setcancelstate.3:36
8160 #, no-wrap
8161 msgid ""
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"
8164 msgstr ""
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"
8167
8168 #. type: Plain text
8169 #: build/C/man3/pthread_setcancelstate.3:51
8170 msgid ""
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:"
8175 msgstr ""
8176 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
8177 "cancelability state に I<state> で指定された\n"
8178 "値を設定する。変更前のスレッドの cancelability state は\n"
8179 "I<oldstate> が指すバッファーで返される。\n"
8180 "I<state> 引数には以下の値のいずれか一つを指定しなければならない。"
8181
8182 #. type: TP
8183 #: build/C/man3/pthread_setcancelstate.3:51
8184 #, no-wrap
8185 msgid "B<PTHREAD_CANCEL_ENABLE>"
8186 msgstr "B<PTHREAD_CANCEL_ENABLE>"
8187
8188 #. type: Plain text
8189 #: build/C/man3/pthread_setcancelstate.3:58
8190 msgid ""
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."
8194 msgstr ""
8195 "スレッドは取り消し可能 (cancelable) である。\n"
8196 "これが全ての新しく作成されるスレッドでのデフォルトの\n"
8197 "cancelability state である。これには最初のスレッドも含まれる。\n"
8198 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
8199 "取り消し要求にいつ反応するかが決まる。"
8200
8201 #. type: TP
8202 #: build/C/man3/pthread_setcancelstate.3:58
8203 #, no-wrap
8204 msgid "B<PTHREAD_CANCEL_DISABLE>"
8205 msgstr "B<PTHREAD_CANCEL_DISABLE>"
8206
8207 #. type: Plain text
8208 #: build/C/man3/pthread_setcancelstate.3:63
8209 msgid ""
8210 "The thread is not cancelable.  If a cancellation request is received, it is "
8211 "blocked until cancelability is enabled."
8212 msgstr ""
8213 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
8214 "取り消し可能に設定されるまでその要求はブロックされる。"
8215
8216 #. type: Plain text
8217 #: build/C/man3/pthread_setcancelstate.3:75
8218 msgid ""
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:"
8223 msgstr ""
8224 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
8225 "cancelability type に I<type> で指定された値を設定する。\n"
8226 "変更前のスレッドの cancelability type は\n"
8227 "I<oldtype> が指すバッファーで返される。\n"
8228 "I<type> 引数には以下の値のいずれか一つを指定しなければならない。"
8229
8230 #. type: TP
8231 #: build/C/man3/pthread_setcancelstate.3:75
8232 #, no-wrap
8233 msgid "B<PTHREAD_CANCEL_DEFERRED>"
8234 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
8235
8236 #. type: Plain text
8237 #: build/C/man3/pthread_setcancelstate.3:82
8238 msgid ""
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."
8242 msgstr ""
8243 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
8244 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
8245 "スレッドでのデフォルトの cancelability type である。\n"
8246 "これには最初のスレッドも含まれる。"
8247
8248 #. type: Plain text
8249 #: build/C/man3/pthread_setcancelstate.3:87
8250 msgid ""
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."
8254 msgstr ""
8255
8256 #. type: TP
8257 #: build/C/man3/pthread_setcancelstate.3:87
8258 #, no-wrap
8259 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
8260 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
8261
8262 #. type: Plain text
8263 #: build/C/man3/pthread_setcancelstate.3:93
8264 msgid ""
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 "
8267 "guarantee this.)"
8268 msgstr ""
8269 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
8270 "システムがそのことを保証しているわけではない)。"
8271
8272 #. type: Plain text
8273 #: build/C/man3/pthread_setcancelstate.3:97
8274 msgid ""
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."
8277 msgstr ""
8278 "これらの関数により実行される「設定と取得」操作 (set-and-get operation) は、\n"
8279 "同じ関数を呼び出したプロセス内の他のスレッドがあっても、\n"
8280 "アトミックに行われる。"
8281
8282 #. type: Plain text
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>() は以下のエラーで失敗する場合がある。"
8286
8287 #. type: Plain text
8288 #: build/C/man3/pthread_setcancelstate.3:108
8289 msgid "Invalid value for I<state>."
8290 msgstr "I<state> に無効な値が指定された。"
8291
8292 #. type: Plain text
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>() は以下のエラーで失敗する場合がある。"
8296
8297 #.  .SH VERSIONS
8298 #.  Available since glibc 2.0
8299 #. type: Plain text
8300 #: build/C/man3/pthread_setcancelstate.3:118
8301 msgid "Invalid value for I<type>."
8302 msgstr "I<type> に無効な値が指定された。"
8303
8304 #. type: tbl table
8305 #: build/C/man3/pthread_setcancelstate.3:130
8306 #: build/C/man3/pthread_setcancelstate.3:136
8307 #, no-wrap
8308 msgid ""
8309 "B<pthread_setcancelstate>(),\n"
8310 "B<pthread_setcanceltype>()"
8311 msgstr ""
8312 "B<pthread_setcancelstate>(),\n"
8313 "B<pthread_setcanceltype>()"
8314
8315 #. type: tbl table
8316 #: build/C/man3/pthread_setcancelstate.3:136
8317 #, no-wrap
8318 msgid "Async-cancel-safety"
8319 msgstr "Async-cancel-safety"
8320
8321 #. type: tbl table
8322 #: build/C/man3/pthread_setcancelstate.3:138
8323 #, no-wrap
8324 msgid "AC-Safe"
8325 msgstr "AC-Safe"
8326
8327 #. type: Plain text
8328 #: build/C/man3/pthread_setcancelstate.3:147
8329 msgid ""
8330 "For details of what happens when a thread is canceled, see "
8331 "B<pthread_cancel>(3)."
8332 msgstr ""
8333 "スレッドが取り消された場合に何が起こるかの詳細については\n"
8334 "B<pthread_cancel>(3) を参照。"
8335
8336 #. type: Plain text
8337 #: build/C/man3/pthread_setcancelstate.3:154
8338 msgid ""
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."
8344 msgstr ""
8345 "取り消し要求により中断されてはならない重要なアクションをスレッドが\n"
8346 "実行する場合、短い時間だけ cancelability を無効にするのは有用である。\n"
8347 "長い時間 cancelability を無効にしたり、長い時間停止 (block) される\n"
8348 "可能性のある操作の前後で cancelability を無効にしたりする際には\n"
8349 "注意すること。なぜなら、無効にしてしまうと、キャンセル要求に対して\n"
8350 "スレッドが応答しない状態になってしまうからである。"
8351
8352 #. type: SS
8353 #: build/C/man3/pthread_setcancelstate.3:154
8354 #, no-wrap
8355 msgid "Asynchronous cancelability"
8356 msgstr "非同期キャンセル"
8357
8358 #. type: Plain text
8359 #: build/C/man3/pthread_setcancelstate.3:173
8360 msgid ""
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."
8372 msgstr ""
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 "ハンドラーが役に立たないものになってしまう。"
8384
8385 #. type: Plain text
8386 #: build/C/man3/pthread_setcancelstate.3:184
8387 msgid ""
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>() だけである。 一般的には、それ以外のライブラリ関数は、非同期にキャンセルできるスレッドから安全に呼び出すことはできない。"
8394
8395 #. type: Plain text
8396 #: build/C/man3/pthread_setcancelstate.3:187
8397 msgid ""
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."
8400 msgstr ""
8401 "非同期でのキャンセルが有効な数少ない状況としては、純粋に計算だけを行うループ"
8402 "に入っているスレッドをキャンセルするといった場面がある。"
8403
8404 #. type: SS
8405 #: build/C/man3/pthread_setcancelstate.3:187
8406 #, no-wrap
8407 msgid "Portability notes"
8408 msgstr "移植性に関する注意"
8409
8410 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
8411 #. type: Plain text
8412 #: build/C/man3/pthread_setcancelstate.3:205
8413 msgid ""
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> 引数についても、全く同じことが言える。"
8422
8423 #. type: Plain text
8424 #: build/C/man3/pthread_setcancelstate.3:208
8425 msgid "See B<pthread_cancel>(3)."
8426 msgstr "B<pthread_cancel>(3) を参照。"
8427
8428 #. type: Plain text
8429 #: build/C/man3/pthread_setcancelstate.3:213
8430 msgid ""
8431 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
8432 "B<pthreads>(7)"
8433 msgstr ""
8434 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), "
8435 "B<pthreads>(7)"
8436
8437 #. type: TH
8438 #: build/C/man3/pthread_setconcurrency.3:25
8439 #, no-wrap
8440 msgid "PTHREAD_SETCONCURRENCY"
8441 msgstr "PTHREAD_SETCONCURRENCY"
8442
8443 #. type: Plain text
8444 #: build/C/man3/pthread_setconcurrency.3:29
8445 msgid ""
8446 "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency "
8447 "level"
8448 msgstr ""
8449 "pthread_setconcurrency, pthread_getconcurrency - 並列処理レベルの設定/取得を"
8450 "行う"
8451
8452 #. type: Plain text
8453 #: build/C/man3/pthread_setconcurrency.3:35
8454 #, no-wrap
8455 msgid ""
8456 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
8457 "B<int pthread_getconcurrency(>I<void>B<);>\n"
8458 msgstr ""
8459 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
8460 "B<int pthread_getconcurrency(>I<void>B<);>\n"
8461
8462 #. type: Plain text
8463 #: build/C/man3/pthread_setconcurrency.3:48
8464 msgid ""
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>()."
8470 msgstr ""
8471 "B<pthread_setconcurrency>() 関数は、アプリケーションが希望する\n"
8472 "並列処理レベル (concurrency level) をスレッド実装に通知する。\n"
8473 "希望する並列処理レベルは I<new_level> で指定する。\n"
8474 "スレッド実装はこの情報をヒントとしてのみ利用する。\n"
8475 "POSIX.1 では、 B<pthread_setconcurrency>() の呼び出した結果、\n"
8476 "どのような並列度になるべきかは規定されていない。"
8477
8478 #. type: Plain text
8479 #: build/C/man3/pthread_setconcurrency.3:53
8480 msgid ""
8481 "Specifying I<new_level> as 0 instructs the implementation to manage the "
8482 "concurrency level as it deems appropriate."
8483 msgstr ""
8484 "I<new_level> に 0 を指定すると、スレッド実装は並列処理レベルを\n"
8485 "実装側で適切とみなしたレベルに設定するようになる。"
8486
8487 #. type: Plain text
8488 #: build/C/man3/pthread_setconcurrency.3:56
8489 msgid ""
8490 "B<pthread_getconcurrency>()  returns the current value of the concurrency "
8491 "level for this process."
8492 msgstr ""
8493 "B<pthread_getconcurrency>() は、このプロセスの concurrency level\n"
8494 "の現在値を返す。"
8495
8496 #. type: Plain text
8497 #: build/C/man3/pthread_setconcurrency.3:61
8498 msgid ""
8499 "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a "
8500 "nonzero error number."
8501 msgstr ""
8502 "成功すると、 B<pthread_setconcurrency>() は 0 を返す。\n"
8503 "エラーの場合、 0 以外のエラー番号を返す。"
8504
8505 #. type: Plain text
8506 #: build/C/man3/pthread_setconcurrency.3:68
8507 msgid ""
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."
8511 msgstr ""
8512 "B<pthread_getconcurrency>() は常に成功し、最後の\n"
8513 "B<pthread_getconcurrency>() の呼び出しで設定された \n"
8514 "concurrency level を返す。 B<pthread_getconcurrency>() が\n"
8515 "それまでに一度も呼び出されていない場合は 0 が返る。"
8516
8517 #. type: Plain text
8518 #: build/C/man3/pthread_setconcurrency.3:71
8519 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
8520 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
8521
8522 #. type: Plain text
8523 #: build/C/man3/pthread_setconcurrency.3:75
8524 msgid "I<new_level> is negative."
8525 msgstr "I<new_level> が負である。"
8526
8527 #. type: Plain text
8528 #: build/C/man3/pthread_setconcurrency.3:81
8529 #, fuzzy
8530 #| msgid ""
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\")."
8533 msgid ""
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\")."
8536 msgstr ""
8537 "POSIX.1-2001 には、エラー B<EAGAIN> も記載されている\n"
8538 "(「I<new_level> に指定された値を適用すると、システムリソースが\n"
8539 "超過してしまう」)。"
8540
8541 #. type: Plain text
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 以降で利用できる。"
8545
8546 #. type: tbl table
8547 #: build/C/man3/pthread_setconcurrency.3:94
8548 #, no-wrap
8549 msgid ""
8550 "B<pthread_setconcurrency>(),\n"
8551 "B<pthread_getconcurrency>()"
8552 msgstr ""
8553 "B<pthread_setconcurrency>(),\n"
8554 "B<pthread_getconcurrency>()"
8555
8556 #. type: Plain text
8557 #: build/C/man3/pthread_setconcurrency.3:100
8558 msgid "The default concurrency level is 0."
8559 msgstr "デフォルトの concurrency level は 0 である。"
8560
8561 #. type: Plain text
8562 #: build/C/man3/pthread_setconcurrency.3:107
8563 msgid ""
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."
8570 msgstr ""
8571 "並列処理レベルが意味を持つのは M:N スレッド実装の場合のみである。\n"
8572 "M:N スレッド実装では、ある瞬間において、あるプロセスのユーザーレベルスレッ\n"
8573 "ドの集合のサブ集合が、そのサブ集合のサイズよりも少ない数のカーネルの\n"
8574 "スケジューリング実体 (kernel-scheduling entity) に結び付けられる。\n"
8575 "並列処理レベルを設定すると、そのアプリケーションの効率的な実行に必要な\n"
8576 "カーネルのスケジューリング実体の数のヒントを、アプリケーションはシステ\n"
8577 "ムに伝えることができる。"
8578
8579 #. type: Plain text
8580 #: build/C/man3/pthread_setconcurrency.3:113
8581 msgid ""
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."
8586 msgstr ""
8587 "LinuxThreads と NPTL のどちらも 1:1 スレッド実装であり、\n"
8588 "並列処理レベルを設定しても何の意味もない。\n"
8589 "言い換えると、 Linux では、これらの関数は、\n"
8590 "他のシステムとの互換性のためだけに存在し、\n"
8591 "プログラムの実行には何の影響も与えないということである。"
8592
8593 #. type: Plain text
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)"
8597
8598 #. type: TH
8599 #: build/C/man3/pthread_setname_np.3:26
8600 #, no-wrap
8601 msgid "PTHREAD_SETNAME_NP"
8602 msgstr "PTHREAD_SETNAME_NP"
8603
8604 #. type: Plain text
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 - スレッド名の設定/取得を行う"
8608
8609 #. type: Plain text
8610 #: build/C/man3/pthread_setname_np.3:36
8611 #, no-wrap
8612 msgid ""
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"
8618 msgstr ""
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"
8624
8625 #. type: Plain text
8626 #: build/C/man3/pthread_setname_np.3:55
8627 msgid ""
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."
8635 msgstr ""
8636 "デフォルトでは、 B<pthread_create>() で作成されたすべてのスレッドはプログラム"
8637 "名を継承する。 B<pthread_setname_np>() 関数を使うとスレッドに固有の名前を設定"
8638 "することができる。 スレッド固有の名前はマルチスレッドアプリケーションのデバッ"
8639 "グに便利である。 スレッド名は意味のある C 言語の文字列である。 その長さは 16 "
8640 "文字に限定されており、 終端のヌルバイト (\\(aq\\e0\\(aq) も 16 文字に含まれ"
8641 "る。 I<thread> 引数で名前を変更するスレッドを指定する。 I<name> には新しい"
8642 "名前を指定する。"
8643
8644 #. type: Plain text
8645 #: build/C/man3/pthread_setname_np.3:72
8646 msgid ""
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."
8653 msgstr ""
8654 "B<pthread_getname_np>() 関数を使うと、 スレッド名を取得することができる。 "
8655 "I<thread> 引数は名前を取得するスレッドを指定する。 バッファー I<name> はス"
8656 "レッド名を返すのに使用される。 I<len> には I<name> の大きさをバイトで指定す"
8657 "る。 I<name> で指定されたバッファーの大きさは最低でも 16 文字とすべきであ"
8658 "る。 出力バッファーに返されたスレッド名はヌル終端される。"
8659
8660 #. type: Plain text
8661 #: build/C/man3/pthread_setname_np.3:79
8662 msgid ""
8663 "The B<pthread_setname_np>()  function can fail with the following error:"
8664 msgstr "B<pthread_setname_np>() は以下のエラーで失敗する場合がある。"
8665
8666 #. type: TP
8667 #: build/C/man3/pthread_setname_np.3:79 build/C/man3/pthread_setname_np.3:88
8668 #, no-wrap
8669 msgid "B<ERANGE>"
8670 msgstr "B<ERANGE>"
8671
8672 #. type: Plain text
8673 #: build/C/man3/pthread_setname_np.3:84
8674 msgid ""
8675 "The length of the string specified pointed to by I<name> exceeds the allowed "
8676 "limit."
8677 msgstr "I<name> で指定された文字列の長さが、許可されている上限を超えている。"
8678
8679 #. type: Plain text
8680 #: build/C/man3/pthread_setname_np.3:88
8681 msgid ""
8682 "The B<pthread_getname_np>()  function can fail with the following error:"
8683 msgstr "B<pthread_getname_np>() は以下のエラーで失敗する場合がある。"
8684
8685 #. type: Plain text
8686 #: build/C/man3/pthread_setname_np.3:95
8687 msgid ""
8688 "The buffer specified by I<name> and I<len> is too small to hold the thread "
8689 "name."
8690 msgstr ""
8691 "I<name> と I<len> で指定されたバッファーが、 スレッド名を格納するには短かすぎ"
8692 "る。"
8693
8694 #. type: Plain text
8695 #: build/C/man3/pthread_setname_np.3:100
8696 msgid ""
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)."
8699 msgstr ""
8700 "I</proc/self/task/[tid]/comm> のオープンに失敗した場合、 これらの関数は "
8701 "B<open>(2) で説明されているエラーのいずれかで失敗する。"
8702
8703 #. type: Plain text
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 で初めて登場した。"
8707
8708 #. type: tbl table
8709 #: build/C/man3/pthread_setname_np.3:113
8710 #, no-wrap
8711 msgid ""
8712 "B<pthread_setname_np>(),\n"
8713 "B<pthread_getname_np>()"
8714 msgstr ""
8715 "B<pthread_setname_np>(),\n"
8716 "B<pthread_getname_np>()"
8717
8718 #. type: Plain text
8719 #: build/C/man3/pthread_setname_np.3:129
8720 msgid ""
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."
8724 msgstr ""
8725 "B<pthread_setname_np>() は内部で I</proc> ファイルシステムのスレッド固有の "
8726 "I<comm> ファイル (I</proc/self/task/[tid]/comm>) に書き込みを行う。 "
8727 "B<pthread_getname_np>() はこのファイルから読み出しを行う。"
8728
8729 #. type: Plain text
8730 #: build/C/man3/pthread_setname_np.3:134
8731 msgid ""
8732 "The program below demonstrates the use of B<pthread_setname_np>()  and "
8733 "B<pthread_getname_np>()."
8734 msgstr ""
8735 "以下のプログラムは、 B<pthread_setname_np>() と B<pthread_getname_np>()\n"
8736 "の使用例を示している。"
8737
8738 #. type: Plain text
8739 #: build/C/man3/pthread_setname_np.3:136
8740 msgid "The following shell session shows a sample run of the program:"
8741 msgstr "以下のシェルセッションは、このプログラムの実行例である。"
8742
8743 #. type: Plain text
8744 #: build/C/man3/pthread_setname_np.3:152
8745 #, no-wrap
8746 msgid ""
8747 "$B< ./a.out>\n"
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"
8757 "a.out\n"
8758 "$ B<cat /proc/5990/task/5991/comm>\n"
8759 "THREADFOO\n"
8760 msgstr ""
8761 "$B< ./a.out>\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"
8771 "a.out\n"
8772 "$ B<cat /proc/5990/task/5991/comm>\n"
8773 "THREADFOO\n"
8774
8775 #. type: Plain text
8776 #: build/C/man3/pthread_setname_np.3:164
8777 #, no-wrap
8778 msgid ""
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"
8786 msgstr ""
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"
8794
8795 #. type: Plain text
8796 #: build/C/man3/pthread_setname_np.3:166
8797 #, no-wrap
8798 msgid "#define NAMELEN 16\n"
8799 msgstr "#define NAMELEN 16\n"
8800
8801 #. type: Plain text
8802 #: build/C/man3/pthread_setname_np.3:170
8803 #: build/C/man3/pthread_getattr_default_np.3:129
8804 #, no-wrap
8805 msgid ""
8806 "#define errExitEN(en, msg) \\e\n"
8807 "                        do { errno = en; perror(msg); \\e\n"
8808 "                             exit(EXIT_FAILURE); } while (0)\n"
8809 msgstr ""
8810 "#define errExitEN(en, msg) \\e\n"
8811 "                        do { errno = en; perror(msg); \\e\n"
8812 "                             exit(EXIT_FAILURE); } while (0)\n"
8813
8814 #. type: Plain text
8815 #: build/C/man3/pthread_setname_np.3:177
8816 #, no-wrap
8817 msgid ""
8818 "static void *\n"
8819 "threadfunc(void *parm)\n"
8820 "{\n"
8821 "    sleep(5);          // allow main program to set the thread name\n"
8822 "    return NULL;\n"
8823 "}\n"
8824 msgstr ""
8825 "static void *\n"
8826 "threadfunc(void *parm)\n"
8827 "{\n"
8828 "    sleep(5);          // allow main program to set the thread name\n"
8829 "    return NULL;\n"
8830 "}\n"
8831
8832 #. type: Plain text
8833 #: build/C/man3/pthread_setname_np.3:184
8834 #, no-wrap
8835 msgid ""
8836 "int\n"
8837 "main(int argc, char **argv)\n"
8838 "{\n"
8839 "    pthread_t thread;\n"
8840 "    int rc;\n"
8841 "    char thread_name[NAMELEN];\n"
8842 msgstr ""
8843 "int\n"
8844 "main(int argc, char **argv)\n"
8845 "{\n"
8846 "    pthread_t thread;\n"
8847 "    int rc;\n"
8848 "    char thread_name[NAMELEN];\n"
8849
8850 #. type: Plain text
8851 #: build/C/man3/pthread_setname_np.3:188
8852 #, no-wrap
8853 msgid ""
8854 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8855 "    if (rc != 0)\n"
8856 "        errExitEN(rc, \"pthread_create\");\n"
8857 msgstr ""
8858 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
8859 "    if (rc != 0)\n"
8860 "        errExitEN(rc, \"pthread_create\");\n"
8861
8862 #. type: Plain text
8863 #: build/C/man3/pthread_setname_np.3:192
8864 #, no-wrap
8865 msgid ""
8866 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8867 "    if (rc != 0)\n"
8868 "        errExitEN(rc, \"pthread_getname_np\");\n"
8869 msgstr ""
8870 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
8871 "    if (rc != 0)\n"
8872 "        errExitEN(rc, \"pthread_getname_np\");\n"
8873
8874 #. type: Plain text
8875 #: build/C/man3/pthread_setname_np.3:197
8876 #, no-wrap
8877 msgid ""
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"
8880 "    if (rc != 0)\n"
8881 "        errExitEN(rc, \"pthread_setname_np\");\n"
8882 msgstr ""
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"
8885 "    if (rc != 0)\n"
8886 "        errExitEN(rc, \"pthread_setname_np\");\n"
8887
8888 #. type: Plain text
8889 #: build/C/man3/pthread_setname_np.3:199
8890 #: build/C/man3/pthread_mutexattr_setrobust.3:250
8891 #, no-wrap
8892 msgid "    sleep(2);\n"
8893 msgstr "    sleep(2);\n"
8894
8895 #. type: Plain text
8896 #: build/C/man3/pthread_setname_np.3:205
8897 #, no-wrap
8898 msgid ""
8899 "    rc = pthread_getname_np(thread, thread_name,\n"
8900 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8901 "    if (rc != 0)\n"
8902 "        errExitEN(rc, \"pthread_getname_np\");\n"
8903 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8904 msgstr ""
8905 "    rc = pthread_getname_np(thread, thread_name,\n"
8906 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
8907 "    if (rc != 0)\n"
8908 "        errExitEN(rc, \"pthread_getname_np\");\n"
8909 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
8910
8911 #. type: Plain text
8912 #: build/C/man3/pthread_setname_np.3:209
8913 #, no-wrap
8914 msgid ""
8915 "    rc = pthread_join(thread, NULL);\n"
8916 "    if (rc != 0)\n"
8917 "        errExitEN(rc, \"pthread_join\");\n"
8918 msgstr ""
8919 "    rc = pthread_join(thread, NULL);\n"
8920 "    if (rc != 0)\n"
8921 "        errExitEN(rc, \"pthread_join\");\n"
8922
8923 #. type: Plain text
8924 #: build/C/man3/pthread_setname_np.3:213
8925 #, no-wrap
8926 msgid ""
8927 "    printf(\"Done\\en\");\n"
8928 "    exit(EXIT_SUCCESS);\n"
8929 "}\n"
8930 msgstr ""
8931 "    printf(\"Done\\en\");\n"
8932 "    exit(EXIT_SUCCESS);\n"
8933 "}\n"
8934
8935 #. type: Plain text
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)"
8939
8940 #. type: TH
8941 #: build/C/man3/pthread_setschedparam.3:26
8942 #, no-wrap
8943 msgid "PTHREAD_SETSCHEDPARAM"
8944 msgstr "PTHREAD_SETSCHEDPARAM"
8945
8946 #. type: Plain text
8947 #: build/C/man3/pthread_setschedparam.3:30
8948 msgid ""
8949 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
8950 "parameters of a thread"
8951 msgstr ""
8952 "pthread_setschedparam, pthread_getschedparam - スレッドの\n"
8953 "スケジューリングポリシーとパラメーターを設定/取得する"
8954
8955 #. type: Plain text
8956 #: build/C/man3/pthread_setschedparam.3:38
8957 #, no-wrap
8958 msgid ""
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"
8963 msgstr ""
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"
8968
8969 #. type: Plain text
8970 #: build/C/man3/pthread_setschedparam.3:46
8971 msgid ""
8972 "The B<pthread_setschedparam>()  function sets the scheduling policy and "
8973 "parameters of the thread I<thread>."
8974 msgstr ""
8975 "B<pthread_setschedparam>() 関数は、スレッド I<thread> の\n"
8976 "スケジューリングポリシーとスケジューリングパラメーターを設定する。"
8977
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
8981 #. type: Plain text
8982 #: build/C/man3/pthread_setschedparam.3:57
8983 msgid ""
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)."
8986 msgstr ""
8987 "I<policy> は I<thread> の新しいスケジューリングポリシーを指定する。 "
8988 "I<policy> に指定できる値とその意味は B<sched>(7) で説明されている。"
8989
8990 #. type: Plain text
8991 #: build/C/man3/pthread_setschedparam.3:63
8992 msgid ""
8993 "The structure pointed to by I<param> specifies the new scheduling parameters "
8994 "for I<thread>.  Scheduling parameters are maintained in the following "
8995 "structure:"
8996 msgstr ""
8997 "I<param> が指す構造体は I<thread> の新しいスケジューリングパラメーターを\n"
8998 "指定する。スケジューリングパラメーターは以下の構造体で管理される。"
8999
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.
9005 #. type: Plain text
9006 #: build/C/man3/pthread_setschedparam.3:104
9007 msgid ""
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))."
9017 msgstr ""
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 "行われる一時的な優先度の調整の影響を受けない。"
9028
9029 #. type: Plain text
9030 #: build/C/man3/pthread_setschedparam.3:112
9031 msgid ""
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."
9035 msgstr ""
9036 "成功すると、これらの関数は 0 を返す。\n"
9037 "エラーの場合、0 以外のエラー番号を返す。\n"
9038 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
9039 "スケジューリングポリシーとパラメーターは変更されない。"
9040
9041 #. type: Plain text
9042 #: build/C/man3/pthread_setschedparam.3:114
9043 msgid "Both of these functions can fail with the following error:"
9044 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
9045
9046 #. type: Plain text
9047 #: build/C/man3/pthread_setschedparam.3:122
9048 msgid ""
9049 "B<pthread_setschedparam>()  may additionally fail with the following errors:"
9050 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
9051
9052 #. type: Plain text
9053 #: build/C/man3/pthread_setschedparam.3:129
9054 msgid ""
9055 "I<policy> is not a recognized policy, or I<param> does not make sense for "
9056 "the I<policy>."
9057 msgstr ""
9058 "I<policy> が認識できないポリシーであるか、\n"
9059 "I<param> が I<policy> では意味を持たない値である。"
9060
9061 #. type: Plain text
9062 #: build/C/man3/pthread_setschedparam.3:133
9063 msgid ""
9064 "The caller does not have appropriate privileges to set the specified "
9065 "scheduling policy and parameters."
9066 msgstr ""
9067 "呼び出し側が、指定されたスケジューリングポリシーやパラメーターを設定する\n"
9068 "のに必要な特権を持たない。"
9069
9070 #.  .SH VERSIONS
9071 #.  Available since glibc 2.0
9072 #. type: Plain text
9073 #: build/C/man3/pthread_setschedparam.3:141
9074 msgid ""
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>()."
9078 msgstr ""
9079 "POSIX.1 では、 B<pthread_setschedparam>() に関して\n"
9080 "エラー B<ENOTSUP> (\"サポートされていない値をスケジューリングポリシーや\n"
9081 "パラメーターに設定しようとした\") も追加で規定されている。"
9082
9083 #. type: tbl table
9084 #: build/C/man3/pthread_setschedparam.3:152
9085 #, no-wrap
9086 msgid ""
9087 "B<pthread_setschedparam>(),\n"
9088 "B<pthread_getschedparam>()"
9089 msgstr ""
9090 "B<pthread_setschedparam>(),\n"
9091 "B<pthread_getschedparam>()"
9092
9093 #. type: Plain text
9094 #: build/C/man3/pthread_setschedparam.3:162
9095 msgid ""
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)."
9099 msgstr ""
9100 "スレッドのスケジューリングポリシーや優先度を変更するために必要な許可や変更し"
9101 "た場合の影響、および各スケジューリングポリシーで認められる優先度の範囲の詳細"
9102 "については、 B<sched>(7) を参照。"
9103
9104 #. type: Plain text
9105 #: build/C/man3/pthread_setschedparam.3:169
9106 msgid ""
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."
9110 msgstr ""
9111 "以下のプログラムは B<pthread_setschedparam>() と\n"
9112 "B<pthread_getschedparam>() やスケジューリングに関連する pthreads の\n"
9113 "他のいろいろな関数の使用例を示すものである。"
9114
9115 #. type: Plain text
9116 #: build/C/man3/pthread_setschedparam.3:185
9117 msgid ""
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 "
9127 "and priority."
9128 msgstr ""
9129 "以下の実行例では、メインスレッドは、自分のスケジューリングポリシーを\n"
9130 "優先度 10 の B<SCHED_FIFO> を設定し、スレッド属性オブジェクトを\n"
9131 "スケジューリングポリシー属性 B<SCHED_RR> とスケジューリング優先度\n"
9132 "属性 20 で初期化する。\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 "作成したスレッドのスケジューリングポリシーと優先度を表示する。"
9140
9141 #. type: Plain text
9142 #: build/C/man3/pthread_setschedparam.3:193
9143 #, no-wrap
9144 msgid ""
9145 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
9146 "Password:\n"
9147 "# B<./a.out -mf10 -ar20 -i e>\n"
9148 "Scheduler settings of main thread\n"
9149 "    policy=SCHED_FIFO, priority=10\n"
9150 msgstr ""
9151 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
9152 "Password:\n"
9153 "# B<./a.out -mf10 -ar20 -i e>\n"
9154 "Scheduler settings of main thread\n"
9155 "    policy=SCHED_FIFO, priority=10\n"
9156
9157 #. type: Plain text
9158 #: build/C/man3/pthread_setschedparam.3:197
9159 #, no-wrap
9160 msgid ""
9161 "Scheduler settings in \\(aqattr\\(aq\n"
9162 "    policy=SCHED_RR, priority=20\n"
9163 "    inheritsched is EXPLICIT\n"
9164 msgstr ""
9165 "Scheduler settings in \\(aqattr\\(aq\n"
9166 "    policy=SCHED_RR, priority=20\n"
9167 "    inheritsched is EXPLICIT\n"
9168
9169 #. type: Plain text
9170 #: build/C/man3/pthread_setschedparam.3:200
9171 #, no-wrap
9172 msgid ""
9173 "Scheduler attributes of new thread\n"
9174 "    policy=SCHED_RR, priority=20\n"
9175 msgstr ""
9176 "Scheduler attributes of new thread\n"
9177 "    policy=SCHED_RR, priority=20\n"
9178
9179 #. type: Plain text
9180 #: build/C/man3/pthread_setschedparam.3:205
9181 msgid ""
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."
9184 msgstr ""
9185 "上記の出力では、スケジューリングポリシーと優先度がスレッド属性\n"
9186 "オブジェクトで指定された値から取られていることが分かる。"
9187
9188 #. type: Plain text
9189 #: build/C/man3/pthread_setschedparam.3:212
9190 msgid ""
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."
9196 msgstr ""
9197 "次の実行例は前のものと同じだが、 inherit scheduler 属性が \n"
9198 "B<PTHREAD_INHERIT_SCHED> に設定される点が異なる。\n"
9199 "B<PTHREAD_INHERIT_SCHED> は、そのスレッド属性オブジェクトを使って作成\n"
9200 "されたスレッドは、スレッド属性オブジェクトからスケジューリング属性を\n"
9201 "無視し、代わりに呼び出したスレッドからスケジューリング属性を取得する\n"
9202 "ことを意味する。"
9203
9204 #. type: Plain text
9205 #: build/C/man3/pthread_setschedparam.3:218
9206 #, no-wrap
9207 msgid ""
9208 "# B<./a.out -mf10 -ar20 -i i>\n"
9209 "Scheduler settings of main thread\n"
9210 "    policy=SCHED_FIFO, priority=10\n"
9211 msgstr ""
9212 "# B<./a.out -mf10 -ar20 -i i>\n"
9213 "Scheduler settings of main thread\n"
9214 "    policy=SCHED_FIFO, priority=10\n"
9215
9216 #. type: Plain text
9217 #: build/C/man3/pthread_setschedparam.3:222
9218 #, no-wrap
9219 msgid ""
9220 "Scheduler settings in \\(aqattr\\(aq\n"
9221 "    policy=SCHED_RR, priority=20\n"
9222 "    inheritsched is INHERIT\n"
9223 msgstr ""
9224 "Scheduler settings in \\(aqattr\\(aq\n"
9225 "    policy=SCHED_RR, priority=20\n"
9226 "    inheritsched is INHERIT\n"
9227
9228 #. type: Plain text
9229 #: build/C/man3/pthread_setschedparam.3:225
9230 #, no-wrap
9231 msgid ""
9232 "Scheduler attributes of new thread\n"
9233 "    policy=SCHED_FIFO, priority=10\n"
9234 msgstr ""
9235 "Scheduler attributes of new thread\n"
9236 "    policy=SCHED_FIFO, priority=10\n"
9237
9238 #. type: Plain text
9239 #: build/C/man3/pthread_setschedparam.3:231
9240 msgid ""
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 "
9243 "object."
9244 msgstr ""
9245 "上記の出力では、スケジューリングポリシーと優先度が、\n"
9246 "スレッド属性オブジェクトからではなく、\n"
9247 "スレッドを作成したスレッドから取れれていることが分かる。"
9248
9249 #. type: Plain text
9250 #: build/C/man3/pthread_setschedparam.3:237
9251 msgid ""
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."
9255 msgstr ""
9256 "なお、 I<-i\\ i> を省略した場合でも、\n"
9257 "B<PTHREAD_INHERIT_SCHED> が inherit scheduler 属性のデフォルト値なので、\n"
9258 "出力は同じになる。"
9259
9260 #. type: Plain text
9261 #: build/C/man3/pthread_setschedparam.3:241
9262 #, no-wrap
9263 msgid "/* pthreads_sched_test.c */\n"
9264 msgstr "/* pthreads_sched_test.c */\n"
9265
9266 #. type: Plain text
9267 #: build/C/man3/pthread_setschedparam.3:247
9268 #, no-wrap
9269 msgid ""
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"
9275 msgstr ""
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"
9281
9282 #. type: Plain text
9283 #: build/C/man3/pthread_setschedparam.3:256
9284 #, no-wrap
9285 msgid ""
9286 "static void\n"
9287 "usage(char *prog_name, char *msg)\n"
9288 "{\n"
9289 "    if (msg != NULL)\n"
9290 "        fputs(msg, stderr);\n"
9291 msgstr ""
9292 "static void\n"
9293 "usage(char *prog_name, char *msg)\n"
9294 "{\n"
9295 "    if (msg != NULL)\n"
9296 "        fputs(msg, stderr);\n"
9297
9298 #. type: Plain text
9299 #: build/C/man3/pthread_setschedparam.3:273
9300 #, no-wrap
9301 msgid ""
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"
9317 "}\n"
9318 msgstr ""
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"
9334 "}\n"
9335
9336 #. type: Plain text
9337 #: build/C/man3/pthread_setschedparam.3:284
9338 #, no-wrap
9339 msgid ""
9340 "static int\n"
9341 "get_policy(char p, int *policy)\n"
9342 "{\n"
9343 "    switch (p) {\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"
9348 "    }\n"
9349 "}\n"
9350 msgstr ""
9351 "static int\n"
9352 "get_policy(char p, int *policy)\n"
9353 "{\n"
9354 "    switch (p) {\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"
9359 "    }\n"
9360 "}\n"
9361
9362 #. type: Plain text
9363 #: build/C/man3/pthread_setschedparam.3:295
9364 #, no-wrap
9365 msgid ""
9366 "static void\n"
9367 "display_sched_attr(int policy, struct sched_param *param)\n"
9368 "{\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"
9373 "            \"???\",\n"
9374 "            param-E<gt>sched_priority);\n"
9375 "}\n"
9376 msgstr ""
9377 "static void\n"
9378 "display_sched_attr(int policy, struct sched_param *param)\n"
9379 "{\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"
9384 "            \"???\",\n"
9385 "            param-E<gt>sched_priority);\n"
9386 "}\n"
9387
9388 #. type: Plain text
9389 #: build/C/man3/pthread_setschedparam.3:301
9390 #, no-wrap
9391 msgid ""
9392 "static void\n"
9393 "display_thread_sched_attr(char *msg)\n"
9394 "{\n"
9395 "    int policy, s;\n"
9396 "    struct sched_param param;\n"
9397 msgstr ""
9398 "static void\n"
9399 "display_thread_sched_attr(char *msg)\n"
9400 "{\n"
9401 "    int policy, s;\n"
9402 "    struct sched_param param;\n"
9403
9404 #. type: Plain text
9405 #: build/C/man3/pthread_setschedparam.3:305
9406 #, no-wrap
9407 msgid ""
9408 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
9409 "    if (s != 0)\n"
9410 "        handle_error_en(s, \"pthread_getschedparam\");\n"
9411 msgstr ""
9412 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
9413 "    if (s != 0)\n"
9414 "        handle_error_en(s, \"pthread_getschedparam\");\n"
9415
9416 #. type: Plain text
9417 #: build/C/man3/pthread_setschedparam.3:309
9418 #, no-wrap
9419 msgid ""
9420 "    printf(\"%s\\en\", msg);\n"
9421 "    display_sched_attr(policy, &param);\n"
9422 "}\n"
9423 msgstr ""
9424 "    printf(\"%s\\en\", msg);\n"
9425 "    display_sched_attr(policy, &param);\n"
9426 "}\n"
9427
9428 #. type: Plain text
9429 #: build/C/man3/pthread_setschedparam.3:314
9430 #, no-wrap
9431 msgid ""
9432 "static void *\n"
9433 "thread_start(void *arg)\n"
9434 "{\n"
9435 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
9436 msgstr ""
9437 "static void *\n"
9438 "thread_start(void *arg)\n"
9439 "{\n"
9440 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
9441
9442 #. type: Plain text
9443 #: build/C/man3/pthread_setschedparam.3:317
9444 #, no-wrap
9445 msgid ""
9446 "    return NULL;\n"
9447 "}\n"
9448 msgstr ""
9449 "    return NULL;\n"
9450 "}\n"
9451
9452 #. type: Plain text
9453 #: build/C/man3/pthread_setschedparam.3:327
9454 #, no-wrap
9455 msgid ""
9456 "int\n"
9457 "main(int argc, char *argv[])\n"
9458 "{\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"
9465 msgstr ""
9466 "int\n"
9467 "main(int argc, char *argv[])\n"
9468 "{\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"
9475
9476 #. type: Plain text
9477 #: build/C/man3/pthread_setschedparam.3:329
9478 #, no-wrap
9479 msgid "    /* Process command-line options */\n"
9480 msgstr "    /* Process command-line options */\n"
9481
9482 #. type: Plain text
9483 #: build/C/man3/pthread_setschedparam.3:334
9484 #, no-wrap
9485 msgid ""
9486 "    use_null_attrib = 0;\n"
9487 "    attr_sched_str = NULL;\n"
9488 "    main_sched_str = NULL;\n"
9489 "    inheritsched_str = NULL;\n"
9490 msgstr ""
9491 "    use_null_attrib = 0;\n"
9492 "    attr_sched_str = NULL;\n"
9493 "    main_sched_str = NULL;\n"
9494 "    inheritsched_str = NULL;\n"
9495
9496 #. type: Plain text
9497 #: build/C/man3/pthread_setschedparam.3:344
9498 #, no-wrap
9499 msgid ""
9500 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
9501 "        switch (opt) {\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"
9507 "        }\n"
9508 "    }\n"
9509 msgstr ""
9510 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
9511 "        switch (opt) {\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"
9517 "        }\n"
9518 "    }\n"
9519
9520 #. type: Plain text
9521 #: build/C/man3/pthread_setschedparam.3:348
9522 #, no-wrap
9523 msgid ""
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"
9527 msgstr ""
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"
9531
9532 #. type: Plain text
9533 #: build/C/man3/pthread_setschedparam.3:351
9534 #, no-wrap
9535 msgid ""
9536 "    /* Optionally set scheduling attributes of main thread,\n"
9537 "       and display the attributes */\n"
9538 msgstr ""
9539 "    /* Optionally set scheduling attributes of main thread,\n"
9540 "       and display the attributes */\n"
9541
9542 #. type: Plain text
9543 #: build/C/man3/pthread_setschedparam.3:356
9544 #, no-wrap
9545 msgid ""
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"
9550 msgstr ""
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"
9555
9556 #. type: Plain text
9557 #: build/C/man3/pthread_setschedparam.3:361
9558 #, no-wrap
9559 msgid ""
9560 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
9561 "        if (s != 0)\n"
9562 "            handle_error_en(s, \"pthread_setschedparam\");\n"
9563 "    }\n"
9564 msgstr ""
9565 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
9566 "        if (s != 0)\n"
9567 "            handle_error_en(s, \"pthread_setschedparam\");\n"
9568 "    }\n"
9569
9570 #. type: Plain text
9571 #: build/C/man3/pthread_setschedparam.3:364
9572 #, no-wrap
9573 msgid ""
9574 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
9575 "    printf(\"\\en\");\n"
9576 msgstr ""
9577 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
9578 "    printf(\"\\en\");\n"
9579
9580 #. type: Plain text
9581 #: build/C/man3/pthread_setschedparam.3:366
9582 #, no-wrap
9583 msgid "    /* Initialize thread attributes object according to options */\n"
9584 msgstr "    /* Initialize thread attributes object according to options */\n"
9585
9586 #. type: Plain text
9587 #: build/C/man3/pthread_setschedparam.3:375
9588 #, no-wrap
9589 msgid ""
9590 "    if (!use_null_attrib) {\n"
9591 "        s = pthread_attr_init(&attr);\n"
9592 "        if (s != 0)\n"
9593 "            handle_error_en(s, \"pthread_attr_init\");\n"
9594 "        attrp = &attr;\n"
9595 "    }\n"
9596 msgstr ""
9597 "    if (!use_null_attrib) {\n"
9598 "        s = pthread_attr_init(&attr);\n"
9599 "        if (s != 0)\n"
9600 "            handle_error_en(s, \"pthread_attr_init\");\n"
9601 "        attrp = &attr;\n"
9602 "    }\n"
9603
9604 #. type: Plain text
9605 #: build/C/man3/pthread_setschedparam.3:383
9606 #, no-wrap
9607 msgid ""
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"
9613 "        else\n"
9614 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
9615 msgstr ""
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"
9621 "        else\n"
9622 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
9623
9624 #. type: Plain text
9625 #: build/C/man3/pthread_setschedparam.3:388
9626 #, no-wrap
9627 msgid ""
9628 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
9629 "        if (s != 0)\n"
9630 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
9631 "    }\n"
9632 msgstr ""
9633 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
9634 "        if (s != 0)\n"
9635 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
9636 "    }\n"
9637
9638 #. type: Plain text
9639 #: build/C/man3/pthread_setschedparam.3:394
9640 #, no-wrap
9641 msgid ""
9642 "    if (attr_sched_str != NULL) {\n"
9643 "        if (!get_policy(attr_sched_str[0], &policy))\n"
9644 "            usage(argv[0],\n"
9645 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
9646 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
9647 msgstr ""
9648 "    if (attr_sched_str != NULL) {\n"
9649 "        if (!get_policy(attr_sched_str[0], &policy))\n"
9650 "            usage(argv[0],\n"
9651 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
9652 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
9653
9654 #. type: Plain text
9655 #: build/C/man3/pthread_setschedparam.3:402
9656 #, no-wrap
9657 msgid ""
9658 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
9659 "        if (s != 0)\n"
9660 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
9661 "        s = pthread_attr_setschedparam(&attr, &param);\n"
9662 "        if (s != 0)\n"
9663 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
9664 "    }\n"
9665 msgstr ""
9666 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
9667 "        if (s != 0)\n"
9668 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
9669 "        s = pthread_attr_setschedparam(&attr, &param);\n"
9670 "        if (s != 0)\n"
9671 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
9672 "    }\n"
9673
9674 #. type: Plain text
9675 #: build/C/man3/pthread_setschedparam.3:405
9676 #, no-wrap
9677 msgid ""
9678 "    /* If we initialized a thread attributes object, display\n"
9679 "       the scheduling attributes that were set in the object */\n"
9680 msgstr ""
9681 "    /* If we initialized a thread attributes object, display\n"
9682 "       the scheduling attributes that were set in the object */\n"
9683
9684 #. type: Plain text
9685 #: build/C/man3/pthread_setschedparam.3:413
9686 #, no-wrap
9687 msgid ""
9688 "    if (attrp != NULL) {\n"
9689 "        s = pthread_attr_getschedparam(&attr, &param);\n"
9690 "        if (s != 0)\n"
9691 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
9692 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
9693 "        if (s != 0)\n"
9694 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
9695 msgstr ""
9696 "    if (attrp != NULL) {\n"
9697 "        s = pthread_attr_getschedparam(&attr, &param);\n"
9698 "        if (s != 0)\n"
9699 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
9700 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
9701 "        if (s != 0)\n"
9702 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
9703
9704 #. type: Plain text
9705 #: build/C/man3/pthread_setschedparam.3:416
9706 #, no-wrap
9707 msgid ""
9708 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
9709 "        display_sched_attr(policy, &param);\n"
9710 msgstr ""
9711 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
9712 "        display_sched_attr(policy, &param);\n"
9713
9714 #. type: Plain text
9715 #: build/C/man3/pthread_setschedparam.3:424
9716 #, no-wrap
9717 msgid ""
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"
9722 "                \"???\");\n"
9723 "        printf(\"\\en\");\n"
9724 "    }\n"
9725 msgstr ""
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"
9730 "                \"???\");\n"
9731 "        printf(\"\\en\");\n"
9732 "    }\n"
9733
9734 #. type: Plain text
9735 #: build/C/man3/pthread_setschedparam.3:426
9736 #, no-wrap
9737 msgid "    /* Create a thread that will display its scheduling attributes */\n"
9738 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
9739
9740 #. type: Plain text
9741 #: build/C/man3/pthread_setschedparam.3:430
9742 #, no-wrap
9743 msgid ""
9744 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
9745 "    if (s != 0)\n"
9746 "        handle_error_en(s, \"pthread_create\");\n"
9747 msgstr ""
9748 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
9749 "    if (s != 0)\n"
9750 "        handle_error_en(s, \"pthread_create\");\n"
9751
9752 #. type: Plain text
9753 #: build/C/man3/pthread_setschedparam.3:432
9754 #, no-wrap
9755 msgid "    /* Destroy unneeded thread attributes object */\n"
9756 msgstr "    /* Destroy unneeded thread attributes object */\n"
9757
9758 #. type: Plain text
9759 #: build/C/man3/pthread_setschedparam.3:438
9760 #, no-wrap
9761 msgid ""
9762 "    if (!use_null_attrib) {\n"
9763 "      s = pthread_attr_destroy(&attr);\n"
9764 "      if (s != 0)\n"
9765 "          handle_error_en(s, \"pthread_attr_destroy\");\n"
9766 "    }\n"
9767 msgstr ""
9768 "    if (!use_null_attrib) {\n"
9769 "      s = pthread_attr_destroy(&attr);\n"
9770 "      if (s != 0)\n"
9771 "          handle_error_en(s, \"pthread_attr_destroy\");\n"
9772 "    }\n"
9773
9774 #. type: Plain text
9775 #: build/C/man3/pthread_setschedparam.3:442
9776 #, no-wrap
9777 msgid ""
9778 "    s = pthread_join(thread, NULL);\n"
9779 "    if (s != 0)\n"
9780 "        handle_error_en(s, \"pthread_join\");\n"
9781 msgstr ""
9782 "    s = pthread_join(thread, NULL);\n"
9783 "    if (s != 0)\n"
9784 "        handle_error_en(s, \"pthread_join\");\n"
9785
9786 #. type: Plain text
9787 #: build/C/man3/pthread_setschedparam.3:460
9788 msgid ""
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)"
9793 msgstr ""
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)"
9798
9799 #. type: TH
9800 #: build/C/man3/pthread_setschedprio.3:26
9801 #, no-wrap
9802 msgid "PTHREAD_SETSCHEDPRIO"
9803 msgstr "PTHREAD_SETSCHEDPRIO"
9804
9805 #. type: Plain text
9806 #: build/C/man3/pthread_setschedprio.3:29
9807 msgid "pthread_setschedprio - set scheduling priority of a thread"
9808 msgstr "pthread_setschedprio - スレッドのスケジューリング優先度を設定する"
9809
9810 #. type: Plain text
9811 #: build/C/man3/pthread_setschedprio.3:34
9812 #, no-wrap
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"
9815
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.
9822 #. type: Plain text
9823 #: build/C/man3/pthread_setschedprio.3:53
9824 msgid ""
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 "
9828 "of a thread.)"
9829 msgstr ""
9830 "B<pthread_setschedprio>() 関数は、スレッド I<thread> のスケジューリング\n"
9831 "優先度に I<prio> で指定された値を設定する\n"
9832 "(一方、B<pthread_setschedparam>(3) はスレッドのスケジューリングポリシー\n"
9833 "と優先度の両方を変更する)。"
9834
9835 #. type: Plain text
9836 #: build/C/man3/pthread_setschedprio.3:61
9837 msgid ""
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."
9841 msgstr ""
9842 "成功すると、この関数は 0 を返す。\n"
9843 "エラーの場合、0 以外のエラー番号を返す。\n"
9844 "B<pthread_setschedprio>() が失敗した場合、 I<thread> の\n"
9845 "スケジューリング優先度は変更されない。"
9846
9847 #. type: Plain text
9848 #: build/C/man3/pthread_setschedprio.3:66
9849 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
9850 msgstr ""
9851 "指定されたスレッドのスケジューリングポリシーでは、 I<prio> は無効である。"
9852
9853 #. type: Plain text
9854 #: build/C/man3/pthread_setschedprio.3:70
9855 msgid ""
9856 "The caller does not have appropriate privileges to set the specified "
9857 "priority."
9858 msgstr "呼び出し側が、指定された優先度を設定するのに必要な特権を持っていない。"
9859
9860 #. type: Plain text
9861 #: build/C/man3/pthread_setschedprio.3:81
9862 msgid ""
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)."
9865 msgstr ""
9866 "POSIX.1 では、 B<pthread_setschedprio>() に関して\n"
9867 "エラー B<ENOTSUP> (\"サポートされていない値を優先度\n"
9868 "に設定しようとした\") も追加で規定されている。"
9869
9870 #. type: Plain text
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 以降で利用できる。"
9874
9875 #. type: tbl table
9876 #: build/C/man3/pthread_setschedprio.3:93
9877 #, no-wrap
9878 msgid "B<pthread_setschedprio>()"
9879 msgstr "B<pthread_setschedprio>()"
9880
9881 #. type: Plain text
9882 #: build/C/man3/pthread_setschedprio.3:103
9883 msgid ""
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)."
9887 msgstr ""
9888 "スレッドのスケジューリング優先度を変更するために必要な許可や変更した場合の影"
9889 "響、および各スケジューリングポリシーで認められる優先度の範囲の詳細について"
9890 "は、 B<sched>(7) を参照。"
9891
9892 #. type: Plain text
9893 #: build/C/man3/pthread_setschedprio.3:117
9894 msgid ""
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)"
9899 msgstr ""
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)"
9904
9905 #. type: TH
9906 #: build/C/man3/pthread_sigmask.3:26
9907 #, no-wrap
9908 msgid "PTHREAD_SIGMASK"
9909 msgstr "PTHREAD_SIGMASK"
9910
9911 #. type: Plain text
9912 #: build/C/man3/pthread_sigmask.3:29
9913 msgid "pthread_sigmask - examine and change mask of blocked signals"
9914 msgstr "pthread_sigmask - 禁止するシグナルマスクの確認と変更を行う"
9915
9916 #. type: Plain text
9917 #: build/C/man3/pthread_sigmask.3:35
9918 #, no-wrap
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"
9921
9922 #. type: Plain text
9923 #: build/C/man3/pthread_sigmask.3:46
9924 msgid "B<pthread_sigmask>():"
9925 msgstr "B<pthread_sigmask>():"
9926
9927 #. type: Plain text
9928 #: build/C/man3/pthread_sigmask.3:58
9929 msgid ""
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 で明示的に規定されている点が異なる。他の違いはこのマニュアルページで説明する。"
9934
9935 #. type: Plain text
9936 #: build/C/man3/pthread_sigmask.3:61
9937 msgid ""
9938 "For a description of the arguments and operation of this function, see "
9939 "B<sigprocmask>(2)."
9940 msgstr "この関数の引数と動作の説明は B<sigprocmask>(2) を参照。"
9941
9942 #. type: Plain text
9943 #: build/C/man3/pthread_sigmask.3:66
9944 msgid ""
9945 "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error "
9946 "number."
9947 msgstr ""
9948 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
9949 "エラーの場合、エラー番号を返す。"
9950
9951 #. type: Plain text
9952 #: build/C/man3/pthread_sigmask.3:69
9953 msgid "See B<sigprocmask>(2)."
9954 msgstr "B<sigprocmask>(2) を参照。"
9955
9956 #. type: tbl table
9957 #: build/C/man3/pthread_sigmask.3:79
9958 #, no-wrap
9959 msgid "B<pthread_sigmask>()"
9960 msgstr "B<pthread_sigmask>()"
9961
9962 #. type: Plain text
9963 #: build/C/man3/pthread_sigmask.3:85
9964 msgid "A new thread inherits a copy of its creator's signal mask."
9965 msgstr ""
9966 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスクのコピーを\n"
9967 "継承する。"
9968
9969 #. type: Plain text
9970 #: build/C/man3/pthread_sigmask.3:93
9971 msgid ""
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."
9975 msgstr ""
9976
9977 #. type: Plain text
9978 #: build/C/man3/pthread_sigmask.3:98
9979 msgid ""
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:"
9983 msgstr ""
9984 "以下のプログラムは、メインスレッドでシグナルのいくつかを禁止 (block)\n"
9985 "するように設定を行い、 B<sigwait>(3) 経由でそれらのシグナルを集める\n"
9986 "専用のスレッドを作成する。\n"
9987 "下記のシェルのセッションはその利用例を示したものである。"
9988
9989 #. type: Plain text
9990 #: build/C/man3/pthread_sigmask.3:109
9991 #, no-wrap
9992 msgid ""
9993 "$B< ./a.out &>\n"
9994 "[1] 5423\n"
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"
10001 msgstr ""
10002 "$B< ./a.out &>\n"
10003 "[1] 5423\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"
10010
10011 #. type: Plain text
10012 #: build/C/man3/pthread_sigmask.3:120
10013 #, no-wrap
10014 msgid ""
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"
10021 msgstr ""
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"
10028
10029 #. type: Plain text
10030 #: build/C/man3/pthread_sigmask.3:122
10031 #, no-wrap
10032 msgid "/* Simple error handling functions */\n"
10033 msgstr "/* Simple error handling functions */\n"
10034
10035 #. type: Plain text
10036 #: build/C/man3/pthread_sigmask.3:131
10037 #, no-wrap
10038 msgid ""
10039 "static void *\n"
10040 "sig_thread(void *arg)\n"
10041 "{\n"
10042 "    sigset_t *set = arg;\n"
10043 "    int s, sig;\n"
10044 msgstr ""
10045 "static void *\n"
10046 "sig_thread(void *arg)\n"
10047 "{\n"
10048 "    sigset_t *set = arg;\n"
10049 "    int s, sig;\n"
10050
10051 #. type: Plain text
10052 #: build/C/man3/pthread_sigmask.3:139
10053 #, no-wrap
10054 msgid ""
10055 "    for (;;) {\n"
10056 "        s = sigwait(set, &sig);\n"
10057 "        if (s != 0)\n"
10058 "            handle_error_en(s, \"sigwait\");\n"
10059 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
10060 "    }\n"
10061 "}\n"
10062 msgstr ""
10063 "    for (;;) {\n"
10064 "        s = sigwait(set, &sig);\n"
10065 "        if (s != 0)\n"
10066 "            handle_error_en(s, \"sigwait\");\n"
10067 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
10068 "    }\n"
10069 "}\n"
10070
10071 #. type: Plain text
10072 #: build/C/man3/pthread_sigmask.3:146
10073 #, no-wrap
10074 msgid ""
10075 "int\n"
10076 "main(int argc, char *argv[])\n"
10077 "{\n"
10078 "    pthread_t thread;\n"
10079 "    sigset_t set;\n"
10080 "    int s;\n"
10081 msgstr ""
10082 "int\n"
10083 "main(int argc, char *argv[])\n"
10084 "{\n"
10085 "    pthread_t thread;\n"
10086 "    sigset_t set;\n"
10087 "    int s;\n"
10088
10089 #. type: Plain text
10090 #: build/C/man3/pthread_sigmask.3:149
10091 #, no-wrap
10092 msgid ""
10093 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
10094 "       will inherit a copy of the signal mask. */\n"
10095 msgstr ""
10096 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
10097 "       will inherit a copy of the signal mask. */\n"
10098
10099 #. type: Plain text
10100 #: build/C/man3/pthread_sigmask.3:156
10101 #, no-wrap
10102 msgid ""
10103 "    sigemptyset(&set);\n"
10104 "    sigaddset(&set, SIGQUIT);\n"
10105 "    sigaddset(&set, SIGUSR1);\n"
10106 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
10107 "    if (s != 0)\n"
10108 "        handle_error_en(s, \"pthread_sigmask\");\n"
10109 msgstr ""
10110 "    sigemptyset(&set);\n"
10111 "    sigaddset(&set, SIGQUIT);\n"
10112 "    sigaddset(&set, SIGUSR1);\n"
10113 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
10114 "    if (s != 0)\n"
10115 "        handle_error_en(s, \"pthread_sigmask\");\n"
10116
10117 #. type: Plain text
10118 #: build/C/man3/pthread_sigmask.3:160
10119 #, no-wrap
10120 msgid ""
10121 "    s = pthread_create(&thread, NULL, &sig_thread, &set);\n"
10122 "    if (s != 0)\n"
10123 "        handle_error_en(s, \"pthread_create\");\n"
10124 msgstr ""
10125 "    s = pthread_create(&thread, NULL, &sig_thread, &set);\n"
10126 "    if (s != 0)\n"
10127 "        handle_error_en(s, \"pthread_create\");\n"
10128
10129 #. type: Plain text
10130 #: build/C/man3/pthread_sigmask.3:163
10131 #, no-wrap
10132 msgid ""
10133 "    /* Main thread carries on to create other threads and/or do\n"
10134 "       other work */\n"
10135 msgstr ""
10136 "    /* Main thread carries on to create other threads and/or do\n"
10137 "       other work */\n"
10138
10139 #. type: Plain text
10140 #: build/C/man3/pthread_sigmask.3:166
10141 #, no-wrap
10142 msgid ""
10143 "    pause();            /* Dummy pause so we can test program */\n"
10144 "}\n"
10145 msgstr ""
10146 "    pause();            /* Dummy pause so we can test program */\n"
10147 "}\n"
10148
10149 #. type: Plain text
10150 #: build/C/man3/pthread_sigmask.3:177
10151 msgid ""
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)"
10156
10157 #. type: TH
10158 #: build/C/man3/pthread_sigqueue.3:25
10159 #, no-wrap
10160 msgid "PTHREAD_SIGQUEUE"
10161 msgstr "PTHREAD_SIGQUEUE"
10162
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 - スレッドに対するシグナルとデータをキューに入れる"
10167
10168 #. type: Plain text
10169 #: build/C/man3/pthread_sigqueue.3:32
10170 #, no-wrap
10171 msgid ""
10172 "B<#include E<lt>signal.hE<gt>>\n"
10173 "B<#include E<lt>pthread.hE<gt>>\n"
10174 msgstr ""
10175 "B<#include E<lt>signal.hE<gt>>\n"
10176 "B<#include E<lt>pthread.hE<gt>>\n"
10177
10178 #. type: Plain text
10179 #: build/C/man3/pthread_sigqueue.3:35
10180 #, no-wrap
10181 msgid ""
10182 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
10183 "B<                     const union sigval >I<value>B<);>\n"
10184 msgstr ""
10185 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
10186 "B<                     const union sigval >I<value>B<);>\n"
10187
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"
10192
10193 #. type: Plain text
10194 #: build/C/man3/pthread_sigqueue.3:54
10195 msgid ""
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."
10199 msgstr ""
10200 "B<pthread_sigqueue>() 関数は B<sigqueue>(3) と同様の処理を実行するが、\n"
10201 "プロセスにシグナルを送信するのではなく、呼び出したスレッドと\n"
10202 "同じプロセス内のスレッドにシグナルを送信する。"
10203
10204 #. type: Plain text
10205 #: build/C/man3/pthread_sigqueue.3:66
10206 msgid ""
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 "
10210 "details."
10211 msgstr ""
10212 "I<thread> 引数は、呼び出し側と同じプロセスのスレッドの ID である。\n"
10213 "I<sig> 引数は送信するシグナルを指定する。\n"
10214 "I<value> 引数はシグナルと一緒に渡すデータを指定する。\n"
10215 "詳細は B<sigqueue>(3) を参照。"
10216
10217 #. type: Plain text
10218 #: build/C/man3/pthread_sigqueue.3:71
10219 msgid ""
10220 "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error "
10221 "number."
10222 msgstr ""
10223 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
10224 "エラーの場合、エラー番号を返す。"
10225
10226 #. type: Plain text
10227 #: build/C/man3/pthread_sigqueue.3:78
10228 msgid ""
10229 "The limit of signals which may be queued has been reached.  (See "
10230 "B<signal>(7)  for further information.)"
10231 msgstr ""
10232 "キューに入れられるシグナル数が上限に達していた\n"
10233 "(詳しい情報は (B<signal>(7) を参照)。"
10234
10235 #. type: Plain text
10236 #: build/C/man3/pthread_sigqueue.3:82
10237 msgid "I<sig> was invalid."
10238 msgstr "I<sig> が無効であった。"
10239
10240 #. type: TP
10241 #: build/C/man3/pthread_sigqueue.3:82
10242 #, no-wrap
10243 msgid "B<ENOSYS>"
10244 msgstr "B<ENOSYS>"
10245
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>() がこのシステムではサポートされていない。"
10250
10251 #. type: Plain text
10252 #: build/C/man3/pthread_sigqueue.3:90
10253 msgid "I<thread> is not valid."
10254 msgstr "I<thread> が無効である。"
10255
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 で初めて登場した。"
10260
10261 #. type: tbl table
10262 #: build/C/man3/pthread_sigqueue.3:104
10263 #, no-wrap
10264 msgid "B<pthread_sigqueue>()"
10265 msgstr "B<pthread_sigqueue>()"
10266
10267 #. type: Plain text
10268 #: build/C/man3/pthread_sigqueue.3:108
10269 msgid "This function is a GNU extension."
10270 msgstr "この関数は GNU による拡張である。"
10271
10272 #. type: Plain text
10273 #: build/C/man3/pthread_sigqueue.3:118
10274 msgid ""
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 "
10278 "details."
10279 msgstr ""
10280
10281 #. type: Plain text
10282 #: build/C/man3/pthread_sigqueue.3:126
10283 msgid ""
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)"
10286 msgstr ""
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)"
10289
10290 #. type: TH
10291 #: build/C/man3/pthread_testcancel.3:26
10292 #, no-wrap
10293 msgid "PTHREAD_TESTCANCEL"
10294 msgstr "PTHREAD_TESTCANCEL"
10295
10296 #. type: Plain text
10297 #: build/C/man3/pthread_testcancel.3:29
10298 msgid ""
10299 "pthread_testcancel - request delivery of any pending cancellation request"
10300 msgstr "pthread_testcancel - 処理待ちの取り消し要求の配送を要求する"
10301
10302 #. type: Plain text
10303 #: build/C/man3/pthread_testcancel.3:34
10304 #, no-wrap
10305 msgid "B<void pthread_testcancel(void);>\n"
10306 msgstr "B<void pthread_testcancel(void);>\n"
10307
10308 #. type: Plain text
10309 #: build/C/man3/pthread_testcancel.3:43
10310 msgid ""
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."
10314 msgstr ""
10315 "B<pthread_testcancel>() を呼び出すと、呼び出したスレッド内に取り消し\n"
10316 "ポイント (cancellation point) が作成される。\n"
10317 "これにより、これ以外には取り消しポイントを含まないコードを実行して\n"
10318 "いるスレッドが取り消し要求に対応することができるようになる。"
10319
10320 #. type: Plain text
10321 #: build/C/man3/pthread_testcancel.3:50
10322 msgid ""
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 "
10325 "no effect."
10326 msgstr ""
10327 "(B<pthread_setcancelstate>(3) を使って) キャンセルが無効になっている\n"
10328 "場合や処理待ちの取り消し要求がない場合は、B<pthread_testcancel>() を\n"
10329 "呼び出しても何の影響もない。"
10330
10331 #. type: Plain text
10332 #: build/C/man3/pthread_testcancel.3:54
10333 msgid ""
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."
10336 msgstr ""
10337 "この関数は値を返さない。この関数の呼び出しの結果、呼び出したスレッドが\n"
10338 "キャンセルされた場合、この関数が返ることはない。"
10339
10340 #. type: tbl table
10341 #: build/C/man3/pthread_testcancel.3:68
10342 #, no-wrap
10343 msgid "B<pthread_testcancel>()"
10344 msgstr "B<pthread_testcancel>()"
10345
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) を参照。"
10350
10351 #. type: Plain text
10352 #: build/C/man3/pthread_testcancel.3:80
10353 msgid ""
10354 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
10355 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
10356 msgstr ""
10357 "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), "
10358 "B<pthread_setcancelstate>(3), B<pthreads>(7)"
10359
10360 #. type: TH
10361 #: build/C/man3/pthread_tryjoin_np.3:26
10362 #, no-wrap
10363 msgid "PTHREAD_TRYJOIN_NP"
10364 msgstr "PTHREAD_TRYJOIN_NP"
10365
10366 #. type: Plain text
10367 #: build/C/man3/pthread_tryjoin_np.3:30
10368 msgid ""
10369 "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated "
10370 "thread"
10371 msgstr ""
10372 "pthread_tryjoin_np, pthread_timedjoin_np - 終了したスレッドの join を\n"
10373 "試みる"
10374
10375 #. type: Plain text
10376 #: build/C/man3/pthread_tryjoin_np.3:36
10377 #, no-wrap
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"
10380
10381 #. type: Plain text
10382 #: build/C/man3/pthread_tryjoin_np.3:39
10383 #, no-wrap
10384 msgid ""
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"
10387 msgstr ""
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"
10390
10391 #. type: Plain text
10392 #: build/C/man3/pthread_tryjoin_np.3:46
10393 msgid ""
10394 "These functions operate in the same way as B<pthread_join>(3), except for "
10395 "the differences described on this page."
10396 msgstr ""
10397 "これらの関数は B<pthread_join>(3) と同じように動作するが、\n"
10398 "このページで説明する違いがある。"
10399
10400 #. type: Plain text
10401 #: build/C/man3/pthread_tryjoin_np.3:58
10402 msgid ""
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."
10407 msgstr ""
10408 "B<pthread_tryjoin_np>() 関数は、スレッド I<thread> の非停止\n"
10409 "(nonblocking) での join を実行し、スレッドの終了ステータスを\n"
10410 "I<*retval> に入れて返す。I<thread> がまだ終了していない場合は、\n"
10411 "B<pthread_join>(3) のように停止 (block) せずに、エラーを返す。"
10412
10413 #. type: Plain text
10414 #: build/C/man3/pthread_tryjoin_np.3:79
10415 #, fuzzy
10416 #| msgid ""
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)):"
10423 msgid ""
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)):"
10430 msgstr ""
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) 参照) から測った絶対時刻を指定する。"
10436
10437 #. type: Plain text
10438 #: build/C/man3/pthread_tryjoin_np.3:86
10439 #, no-wrap
10440 msgid ""
10441 "struct timespec {\n"
10442 "    time_t tv_sec;     /* seconds */\n"
10443 "    long   tv_nsec;    /* nanoseconds */\n"
10444 "};\n"
10445 msgstr ""
10446 "struct timespec {\n"
10447 "    time_t tv_sec;     /* seconds */\n"
10448 "    long   tv_nsec;    /* nanoseconds */\n"
10449 "};\n"
10450
10451 #. type: Plain text
10452 #: build/C/man3/pthread_tryjoin_np.3:92
10453 msgid ""
10454 "On success, these functions return 0; on error, they return an error number."
10455 msgstr ""
10456 "成功すると、これらの関数は 0 を返す。\n"
10457 "エラーの場合、エラー番号を返す。"
10458
10459 #. type: Plain text
10460 #: build/C/man3/pthread_tryjoin_np.3:97
10461 msgid ""
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:"
10464 msgstr ""
10465 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
10466 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
10467
10468 #. type: TP
10469 #: build/C/man3/pthread_tryjoin_np.3:97 build/C/man3/pthread_spin_lock.3:104
10470 #, no-wrap
10471 msgid "B<EBUSY>"
10472 msgstr "B<EBUSY>"
10473
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> はまだ終了していない。"
10478
10479 #. type: Plain text
10480 #: build/C/man3/pthread_tryjoin_np.3:104
10481 msgid ""
10482 "B<pthread_timedjoin_np>()  can in addition fail with the following errors:"
10483 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
10484
10485 #. type: TP
10486 #: build/C/man3/pthread_tryjoin_np.3:104
10487 #, no-wrap
10488 msgid "B<ETIMEDOUT>"
10489 msgstr "B<ETIMEDOUT>"
10490
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> が終了する前に呼び出しがタイムアウトとなった。"
10495
10496 #. type: Plain text
10497 #: build/C/man3/pthread_tryjoin_np.3:117
10498 msgid ""
10499 "I<abstime> value is invalid (I<tv_sec> is less than 0 or I<tv_nsec> is "
10500 "greater than 1e9)."
10501 msgstr ""
10502 "I<abstime> の値が無効である (I<tv_sec> が 0 より小さいか、 I<tv_nsec> 1e9 が"
10503 "より大きい)。"
10504
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> を返すことはない。"
10509
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 で初めて登場した。"
10514
10515 #. type: tbl table
10516 #: build/C/man3/pthread_tryjoin_np.3:135
10517 #, no-wrap
10518 msgid ""
10519 "B<pthread_tryjoin_np>(),\n"
10520 "B<pthread_timedjoin_np>()"
10521 msgstr ""
10522 "B<pthread_tryjoin_np>(),\n"
10523 "B<pthread_timedjoin_np>()"
10524
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 を待つ。"
10529
10530 #. type: Plain text
10531 #: build/C/man3/pthread_tryjoin_np.3:148
10532 #, no-wrap
10533 msgid ""
10534 "struct timespec ts;\n"
10535 "int s;\n"
10536 msgstr ""
10537 "struct timespec ts;\n"
10538 "int s;\n"
10539
10540 #. type: Plain text
10541 #: build/C/man3/pthread_tryjoin_np.3:150
10542 #, no-wrap
10543 msgid "\\&...\n"
10544 msgstr "\\&...\n"
10545
10546 #. type: Plain text
10547 #: build/C/man3/pthread_tryjoin_np.3:154
10548 #, no-wrap
10549 msgid ""
10550 "if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
10551 "    /* Handle error */\n"
10552 "}\n"
10553 msgstr ""
10554 "if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
10555 "    /* Handle error */\n"
10556 "}\n"
10557
10558 #. type: Plain text
10559 #: build/C/man3/pthread_tryjoin_np.3:156
10560 #, no-wrap
10561 msgid "ts.tv_sec += 5;\n"
10562 msgstr "ts.tv_sec += 5;\n"
10563
10564 #. type: Plain text
10565 #: build/C/man3/pthread_tryjoin_np.3:161
10566 #, no-wrap
10567 msgid ""
10568 "s = pthread_timedjoin_np(thread, NULL, &ts);\n"
10569 "if (s != 0) {\n"
10570 "    /* Handle error */\n"
10571 "}\n"
10572 msgstr ""
10573 "s = pthread_timedjoin_np(thread, NULL, &ts);\n"
10574 "if (s != 0) {\n"
10575 "    /* Handle error */\n"
10576 "}\n"
10577
10578 #. type: Plain text
10579 #: build/C/man3/pthread_tryjoin_np.3:175
10580 msgid ""
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."
10586 msgstr ""
10587
10588 #. type: Plain text
10589 #: build/C/man3/pthread_tryjoin_np.3:180
10590 msgid ""
10591 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
10592 msgstr ""
10593 "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
10594
10595 #. type: TH
10596 #: build/C/man3/pthread_yield.3:25
10597 #, no-wrap
10598 msgid "PTHREAD_YIELD"
10599 msgstr "PTHREAD_YIELD"
10600
10601 #. type: TH
10602 #: build/C/man3/pthread_yield.3:25
10603 #, no-wrap
10604 msgid "2017-11-26"
10605 msgstr "2017-11-26"
10606
10607 #. type: Plain text
10608 #: build/C/man3/pthread_yield.3:28
10609 msgid "pthread_yield - yield the processor"
10610 msgstr "pthread_yield - プロセッサを明け渡す (yield)"
10611
10612 #. type: Plain text
10613 #: build/C/man3/pthread_yield.3:34
10614 #, no-wrap
10615 msgid "B<int pthread_yield(void);>\n"
10616 msgstr "B<int pthread_yield(void);>\n"
10617
10618 #. type: Plain text
10619 #: build/C/man3/pthread_yield.3:44
10620 msgid ""
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)"
10625 msgstr ""
10626 "B<pthread_yield>() を呼び出すと、呼び出したスレッドは CPU を手放す。\n"
10627 "スレッドはそのスレッドの静的優先度の実行キューの末尾に回り、\n"
10628 "別のスレッドが実行されるようにスケジューリングされる。\n"
10629 "詳細は B<sched_yield>(2) を参照。"
10630
10631 #. type: Plain text
10632 #: build/C/man3/pthread_yield.3:49
10633 msgid ""
10634 "On success, B<pthread_yield>()  returns 0; on error, it returns an error "
10635 "number."
10636 msgstr ""
10637 "成功すると、 B<pthread_yield>() は 0 を返す。\n"
10638 "エラーの場合、エラー番号を返す。"
10639
10640 #. type: Plain text
10641 #: build/C/man3/pthread_yield.3:53
10642 msgid ""
10643 "On Linux, this call always succeeds (but portable and future-proof "
10644 "applications should nevertheless handle a possible error return)."
10645 msgstr ""
10646 "Linux では、この関数の呼び出しは常に成功する\n"
10647 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
10648 "正のエラーの返り値を処理するようにすべきである)。"
10649
10650 #. type: tbl table
10651 #: build/C/man3/pthread_yield.3:63
10652 #, no-wrap
10653 msgid "B<pthread_yield>()"
10654 msgstr "B<pthread_yield>()"
10655
10656 #.  e.g., the BSDs, Tru64, AIX, and Irix.
10657 #. type: Plain text
10658 #: build/C/man3/pthread_yield.3:71
10659 msgid ""
10660 "This call is nonstandard, but present on several other systems.  Use the "
10661 "standardized B<sched_yield>(2)  instead."
10662 msgstr ""
10663 "この関数は非標準だが、他のいくつかのシステムにも存在する。\n"
10664 "代わりに、標準化されている B<sched_yield>(2) を使うこと。"
10665
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)."
10669 msgstr ""
10670 "Linux では、この関数は B<sched_yield>(2) を呼び出す形で実装されている。"
10671
10672 #. type: Plain text
10673 #: build/C/man3/pthread_yield.3:85
10674 msgid ""
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."
10679 msgstr ""
10680
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)"
10686
10687 #. type: TH
10688 #: build/C/man3/pthread_atfork.3:25
10689 #, no-wrap
10690 msgid "PTHREAD_ATFORK"
10691 msgstr "PTHREAD_ATFORK"
10692
10693 #. type: Plain text
10694 #: build/C/man3/pthread_atfork.3:28
10695 msgid "pthread_atfork - register fork handlers"
10696 msgstr ""
10697
10698 #. type: Plain text
10699 #: build/C/man3/pthread_atfork.3:34
10700 #, no-wrap
10701 msgid ""
10702 "B<int pthread_atfork(void (*>I<prepare>B<)(void), void (*>I<parent>B<)(void),>\n"
10703 "B<                   void (*>I<child>B<)(void));>\n"
10704 msgstr ""
10705 "B<int pthread_atfork(void (*>I<prepare>B<)(void), void (*>I<parent>B<)(void),>\n"
10706 "B<                   void (*>I<child>B<)(void));>\n"
10707
10708 #. type: Plain text
10709 #: build/C/man3/pthread_atfork.3:37
10710 msgid "Link with I<-pthread>."
10711 msgstr "I<-pthread> を付けてリンクする。"
10712
10713 #. type: Plain text
10714 #: build/C/man3/pthread_atfork.3:45
10715 msgid ""
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)."
10719 msgstr ""
10720
10721 #. type: Plain text
10722 #: build/C/man3/pthread_atfork.3:47
10723 msgid "Three kinds of handler can be registered:"
10724 msgstr ""
10725
10726 #. type: Plain text
10727 #: build/C/man3/pthread_atfork.3:52
10728 msgid ""
10729 "I<prepare> specifies a handler that is executed before B<fork>(2)  "
10730 "processing starts."
10731 msgstr ""
10732
10733 #. type: Plain text
10734 #: build/C/man3/pthread_atfork.3:57
10735 msgid ""
10736 "I<parent> specifies a handler that is executed in the parent process after "
10737 "B<fork>(2)  processing completes."
10738 msgstr ""
10739
10740 #. type: Plain text
10741 #: build/C/man3/pthread_atfork.3:62
10742 msgid ""
10743 "I<child> specifies a handler that is executed in the child process after "
10744 "B<fork>(2)  processing completes."
10745 msgstr ""
10746
10747 #. type: Plain text
10748 #: build/C/man3/pthread_atfork.3:67
10749 msgid ""
10750 "Any of the three arguments may be NULL if no handler is needed in the "
10751 "corresponding phase of B<fork>(2)  processing."
10752 msgstr ""
10753
10754 #. type: Plain text
10755 #: build/C/man3/pthread_atfork.3:82
10756 msgid ""
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."
10763 msgstr ""
10764
10765 #. type: Plain text
10766 #: build/C/man3/pthread_atfork.3:86
10767 msgid "Could not allocate memory to record the form handler entry."
10768 msgstr ""
10769
10770 #. type: Plain text
10771 #: build/C/man3/pthread_atfork.3:108
10772 msgid ""
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."
10784 msgstr ""
10785
10786 #. type: Plain text
10787 #: build/C/man3/pthread_atfork.3:117
10788 msgid ""
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 "
10792 "program."
10793 msgstr ""
10794
10795 #. type: Plain text
10796 #: build/C/man3/pthread_atfork.3:122
10797 msgid ""
10798 "POSIX.1 specifies that B<pthread_atfork>()  shall not fail with the error "
10799 "B<EINTR>."
10800 msgstr ""
10801
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)"
10806
10807 #. type: TH
10808 #: build/C/man3/pthread_attr_setsigmask_np.3:26
10809 #, no-wrap
10810 msgid "PTHREAD_ATTR_SETSIGMASK_NP"
10811 msgstr "PTHREAD_ATTR_SETSIGMASK_NP"
10812
10813 #. type: Plain text
10814 #: build/C/man3/pthread_attr_setsigmask_np.3:30
10815 #, fuzzy
10816 #| msgid ""
10817 #| "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes "
10818 #| "in thread attributes object"
10819 msgid ""
10820 "pthread_attr_setsigmask_np, pthread_attr_getsigmask_np - set/get signal mask "
10821 "attribute in thread attributes object"
10822 msgstr ""
10823 "pthread_attr_setstack, pthread_attr_getstack - \n"
10824 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
10825
10826 #. type: Plain text
10827 #: build/C/man3/pthread_attr_setsigmask_np.3:39
10828 #, no-wrap
10829 msgid ""
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"
10834 msgstr ""
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"
10839
10840 #. type: Plain text
10841 #: build/C/man3/pthread_attr_setsigmask_np.3:55
10842 #, fuzzy
10843 #| msgid ""
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>."
10848 msgid ""
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."
10853 msgstr ""
10854 "B<pthread_attr_setaffinity_np>() 関数は、\n"
10855 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
10856 "I<cpuset> で指定された値に設定する。\n"
10857 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
10858 "作成されたスレッドの CPU affinity マスクが決定される。"
10859
10860 #. type: Plain text
10861 #: build/C/man3/pthread_attr_setsigmask_np.3:67
10862 #, fuzzy
10863 #| msgid ""
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>, "
10867 #| "respectively."
10868 msgid ""
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."
10874 msgstr ""
10875 "B<pthread_attr_getstack>() 関数は、\n"
10876 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
10877 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
10878 "指すバッファーに入れて返す。"
10879
10880 #. type: Plain text
10881 #: build/C/man3/pthread_attr_setsigmask_np.3:71
10882 #, fuzzy
10883 #| msgid ""
10884 #| "On success, B<pthread_cancel>()  returns 0; on error, it returns a "
10885 #| "nonzero error number."
10886 msgid ""
10887 "The B<pthread_attr_setsigmask_np>()  function returns 0 on success, or a "
10888 "nonzero error number on failure."
10889 msgstr ""
10890 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
10891 "エラーの場合、0 以外のエラー番号を返す。"
10892
10893 #. type: Plain text
10894 #: build/C/man3/pthread_attr_setsigmask_np.3:82
10895 msgid ""
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>."
10901 msgstr ""
10902
10903 #. type: Plain text
10904 #: build/C/man3/pthread_attr_setsigmask_np.3:84
10905 #, fuzzy
10906 #| msgid ""
10907 #| "On success, these functions return 0; on error, they return an error "
10908 #| "number."
10909 msgid "On error, these functions return a positive error number."
10910 msgstr ""
10911 "成功すると、これらの関数は 0 を返す。\n"
10912 "エラーの場合、エラー番号を返す。"
10913
10914 #. type: Plain text
10915 #: build/C/man3/pthread_attr_setsigmask_np.3:89
10916 #, fuzzy
10917 #| msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
10918 msgid "(B<pthread_attr_setsigmask_np>())  Could not allocate memory."
10919 msgstr ""
10920 "(B<pthread_attr_setaffinity_np>()) メモリーを割り当てることができなかった。"
10921
10922 #. type: Plain text
10923 #: build/C/man3/pthread_attr_setsigmask_np.3:91
10924 #, fuzzy
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 以降で提供されている。"
10928
10929 #. type: tbl table
10930 #: build/C/man3/pthread_attr_setsigmask_np.3:102
10931 #, no-wrap
10932 msgid ""
10933 "B<pthread_attr_setsigmask_np>(),\n"
10934 "B<pthread_attr_getsigmask_np>()"
10935 msgstr ""
10936 "B<pthread_attr_setsigmask_np>(),\n"
10937 "B<pthread_attr_getsigmask_np>()"
10938
10939 #. type: Plain text
10940 #: build/C/man3/pthread_attr_setsigmask_np.3:115
10941 msgid ""
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."
10946 msgstr ""
10947
10948 #. type: Plain text
10949 #: build/C/man3/pthread_attr_setsigmask_np.3:121
10950 #, fuzzy
10951 #| msgid ""
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)."
10955 msgid ""
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)."
10959 msgstr ""
10960 "CPU affinity マスクの詳細については、 \n"
10961 "B<sched_setaffinity>(2) を参照してほしい。\n"
10962 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
10963 "B<CPU_SET>(3) を参照してほしい。"
10964
10965 #. type: Plain text
10966 #: build/C/man3/pthread_attr_setsigmask_np.3:125
10967 msgid ""
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:"
10970 msgstr ""
10971
10972 #. type: IP
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
10977 #, no-wrap
10978 msgid "\\(bu"
10979 msgstr "\\(bu"
10980
10981 #. type: Plain text
10982 #: build/C/man3/pthread_attr_setsigmask_np.3:129
10983 msgid ""
10984 "The creating thread uses B<pthread_sigmask>(3)  to save its current signal "
10985 "mask and set its mask to block all signals."
10986 msgstr ""
10987
10988 #. type: Plain text
10989 #: build/C/man3/pthread_attr_setsigmask_np.3:133
10990 #, fuzzy
10991 #| msgid ""
10992 #| "A new thread created by B<pthread_create>(3)  inherits a copy of its "
10993 #| "creator's CPU affinity mask."
10994 msgid ""
10995 "The new thread is then created using B<pthread_create>(); the new thread "
10996 "will inherit the creating thread's signal mask."
10997 msgstr ""
10998 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
10999 "作成者の CPU affinity マスクを継承する。"
11000
11001 #. type: Plain text
11002 #: build/C/man3/pthread_attr_setsigmask_np.3:136
11003 msgid ""
11004 "The new thread sets its signal mask to the desired value using "
11005 "B<pthread_sigmask>(3)."
11006 msgstr ""
11007
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."
11011 msgstr ""
11012
11013 #. type: Plain text
11014 #: build/C/man3/pthread_attr_setsigmask_np.3:142
11015 msgid ""
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."
11018 msgstr ""
11019
11020 #. type: Plain text
11021 #: build/C/man3/pthread_attr_setsigmask_np.3:148
11022 msgid ""
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)"
11026
11027 #. type: TH
11028 #: build/C/man3/pthread_getattr_default_np.3:25
11029 #, no-wrap
11030 msgid "PTHREAD_GETATTR_DEFAULT_NP"
11031 msgstr "PTHREAD_GETATTR_DEFAULT_NP"
11032
11033 #. type: Plain text
11034 #: build/C/man3/pthread_getattr_default_np.3:29
11035 #, fuzzy
11036 #| msgid ""
11037 #| "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU "
11038 #| "affinity attribute in thread attributes object"
11039 msgid ""
11040 "pthread_getattr_default_np, pthread_setattr_default_np, - get or set default "
11041 "thread-creation attributes"
11042 msgstr ""
11043 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
11044 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
11045
11046 #. type: Plain text
11047 #: build/C/man3/pthread_getattr_default_np.3:36
11048 #, no-wrap
11049 msgid ""
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"
11052 msgstr ""
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"
11055
11056 #. type: Plain text
11057 #: build/C/man3/pthread_getattr_default_np.3:50
11058 msgid ""
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:"
11065 msgstr ""
11066
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."
11070 msgstr ""
11071
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."
11075 msgstr ""
11076
11077 #. type: Plain text
11078 #: build/C/man3/pthread_getattr_default_np.3:60
11079 msgid ""
11080 "Setting the I<stack size> attribute to zero means leave the default stack "
11081 "size unchanged."
11082 msgstr ""
11083
11084 #. type: Plain text
11085 #: build/C/man3/pthread_getattr_default_np.3:66
11086 #, fuzzy
11087 #| msgid ""
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>."
11091 msgid ""
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."
11095 msgstr ""
11096 "B<pthread_getattr_np>() 関数は、\n"
11097 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
11098 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
11099 "格納して返す。"
11100
11101 #. type: Plain text
11102 #: build/C/man3/pthread_getattr_default_np.3:74
11103 msgid ""
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>."
11106 msgstr ""
11107
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
11111 #, fuzzy
11112 #| msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
11113 msgid "(B<pthread_setattr_default_np>())  Insufficient memory."
11114 msgstr ""
11115 "(B<pthread_attr_setaffinity_np>()) メモリーを割り当てることができなかった。"
11116
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 以降で利用できる。"
11121
11122 #. type: tbl table
11123 #: build/C/man3/pthread_getattr_default_np.3:93
11124 #, no-wrap
11125 msgid ""
11126 "B<pthread_getattr_default_np>(),\n"
11127 "B<pthread_setattr_default_np>()"
11128 msgstr ""
11129 "B<pthread_getattr_default_np>(),\n"
11130 "B<pthread_setattr_default_np>()"
11131
11132 #. type: Plain text
11133 #: build/C/man3/pthread_getattr_default_np.3:99
11134 msgid ""
11135 "These functions are nonstandard GNU extensions; hence the suffix \"_np"
11136 "\" (nonportable) in their names."
11137 msgstr "これらの関数は非標準の GNU による拡張である。そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が付いている。"
11138
11139 #. type: Plain text
11140 #: build/C/man3/pthread_getattr_default_np.3:105
11141 msgid ""
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:"
11146 msgstr ""
11147
11148 #. type: Plain text
11149 #: build/C/man3/pthread_getattr_default_np.3:115
11150 #, no-wrap
11151 msgid ""
11152 "$ B<./a.out>\n"
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"
11159 msgstr ""
11160 "$ B<./a.out>\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"
11167
11168 #. type: Plain text
11169 #: build/C/man3/pthread_getattr_default_np.3:140
11170 #, no-wrap
11171 msgid ""
11172 "static void\n"
11173 "display_pthread_attr(pthread_attr_t *attr)\n"
11174 "{\n"
11175 "    int s;\n"
11176 "    size_t stacksize;\n"
11177 "    size_t guardsize;\n"
11178 "    int policy;\n"
11179 "    struct sched_param schedparam;\n"
11180 "    int detachstate;\n"
11181 "    int inheritsched;\n"
11182 msgstr ""
11183 "static void\n"
11184 "display_pthread_attr(pthread_attr_t *attr)\n"
11185 "{\n"
11186 "    int s;\n"
11187 "    size_t stacksize;\n"
11188 "    size_t guardsize;\n"
11189 "    int policy;\n"
11190 "    struct sched_param schedparam;\n"
11191 "    int detachstate;\n"
11192 "    int inheritsched;\n"
11193
11194 #. type: Plain text
11195 #: build/C/man3/pthread_getattr_default_np.3:145
11196 #, no-wrap
11197 msgid ""
11198 "    s = pthread_attr_getstacksize(attr, &stacksize);\n"
11199 "    if (s != 0)\n"
11200 "        errExitEN(s, \"pthread_attr_getstacksize\");\n"
11201 "    printf(\"Stack size:          %zd\\en\", stacksize);\n"
11202 msgstr ""
11203 "    s = pthread_attr_getstacksize(attr, &stacksize);\n"
11204 "    if (s != 0)\n"
11205 "        errExitEN(s, \"pthread_attr_getstacksize\");\n"
11206 "    printf(\"Stack size:          %zd\\en\", stacksize);\n"
11207
11208 #. type: Plain text
11209 #: build/C/man3/pthread_getattr_default_np.3:150
11210 #, no-wrap
11211 msgid ""
11212 "    s = pthread_attr_getguardsize(attr, &guardsize);\n"
11213 "    if (s != 0)\n"
11214 "        errExitEN(s, \"pthread_attr_getguardsize\");\n"
11215 "    printf(\"Guard size:          %zd\\en\", guardsize);\n"
11216 msgstr ""
11217 "    s = pthread_attr_getguardsize(attr, &guardsize);\n"
11218 "    if (s != 0)\n"
11219 "        errExitEN(s, \"pthread_attr_getguardsize\");\n"
11220 "    printf(\"Guard size:          %zd\\en\", guardsize);\n"
11221
11222 #. type: Plain text
11223 #: build/C/man3/pthread_getattr_default_np.3:158
11224 #, no-wrap
11225 msgid ""
11226 "    s = pthread_attr_getschedpolicy(attr, &policy);\n"
11227 "    if (s != 0)\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"
11233 msgstr ""
11234 "    s = pthread_attr_getschedpolicy(attr, &policy);\n"
11235 "    if (s != 0)\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"
11241
11242 #. type: Plain text
11243 #: build/C/man3/pthread_getattr_default_np.3:163
11244 #, no-wrap
11245 msgid ""
11246 "    s = pthread_attr_getschedparam(attr, &schedparam);\n"
11247 "    if (s != 0)\n"
11248 "        errExitEN(s, \"pthread_attr_getschedparam\");\n"
11249 "    printf(\"Scheduling priority: %d\\en\", schedparam.sched_priority);\n"
11250 msgstr ""
11251 "    s = pthread_attr_getschedparam(attr, &schedparam);\n"
11252 "    if (s != 0)\n"
11253 "        errExitEN(s, \"pthread_attr_getschedparam\");\n"
11254 "    printf(\"Scheduling priority: %d\\en\", schedparam.sched_priority);\n"
11255
11256 #. type: Plain text
11257 #: build/C/man3/pthread_getattr_default_np.3:171
11258 #, no-wrap
11259 msgid ""
11260 "    s = pthread_attr_getdetachstate(attr, &detachstate);\n"
11261 "    if (s != 0)\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"
11266 "            \"???\");\n"
11267 msgstr ""
11268 "    s = pthread_attr_getdetachstate(attr, &detachstate);\n"
11269 "    if (s != 0)\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"
11274 "            \"???\");\n"
11275
11276 #. type: Plain text
11277 #: build/C/man3/pthread_getattr_default_np.3:180
11278 #, no-wrap
11279 msgid ""
11280 "    s = pthread_attr_getinheritsched(attr, &inheritsched);\n"
11281 "    if (s != 0)\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"
11286 "            \"???\");\n"
11287 "}\n"
11288 msgstr ""
11289 "    s = pthread_attr_getinheritsched(attr, &inheritsched);\n"
11290 "    if (s != 0)\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"
11295 "            \"???\");\n"
11296 "}\n"
11297
11298 #. type: Plain text
11299 #: build/C/man3/pthread_getattr_default_np.3:186
11300 #, no-wrap
11301 msgid ""
11302 "int\n"
11303 "main(int argc, char *argv[])\n"
11304 "{\n"
11305 "    int s;\n"
11306 "    pthread_attr_t attr;\n"
11307 msgstr ""
11308 "int\n"
11309 "main(int argc, char *argv[])\n"
11310 "{\n"
11311 "    int s;\n"
11312 "    pthread_attr_t attr;\n"
11313
11314 #. type: Plain text
11315 #: build/C/man3/pthread_getattr_default_np.3:190
11316 #, no-wrap
11317 msgid ""
11318 "    s = pthread_getattr_default_np(&attr);\n"
11319 "    if (s != 0)\n"
11320 "        errExitEN(s, \"pthread_getattr_default_np\");\n"
11321 msgstr ""
11322 "    s = pthread_getattr_default_np(&attr);\n"
11323 "    if (s != 0)\n"
11324 "        errExitEN(s, \"pthread_getattr_default_np\");\n"
11325
11326 #. type: Plain text
11327 #: build/C/man3/pthread_getattr_default_np.3:192
11328 #, no-wrap
11329 msgid "    display_pthread_attr(&attr);\n"
11330 msgstr "    display_pthread_attr(&attr);\n"
11331
11332 #. type: TH
11333 #: build/C/man3/pthread_mutex_consistent.3:26
11334 #, no-wrap
11335 msgid "PTHREAD_MUTEX_CONSISTENT"
11336 msgstr "PTHREAD_MUTEX_CONSISTENT"
11337
11338 #. type: Plain text
11339 #: build/C/man3/pthread_mutex_consistent.3:29
11340 msgid "pthread_mutex_consistent - make a robust mutex consistent"
11341 msgstr ""
11342
11343 #. type: Plain text
11344 #: build/C/man3/pthread_mutex_consistent.3:34
11345 #, no-wrap
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"
11348
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>():"
11353
11354 #.  FIXME .
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"
11361
11362 #. type: Plain text
11363 #: build/C/man3/pthread_mutex_consistent.3:59
11364 msgid ""
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>()."
11370 msgstr ""
11371
11372 #. type: Plain text
11373 #: build/C/man3/pthread_mutex_consistent.3:65
11374 #, fuzzy
11375 #| msgid ""
11376 #| "On success, B<pthread_create>()  returns 0; on error, it returns an error "
11377 #| "number, and the contents of I<*thread> are undefined."
11378 msgid ""
11379 "On success, I<pthread_mutex_consistent>()  returns 0.  Otherwise, it returns "
11380 "a positive error number to indicate the cause of the error."
11381 msgstr ""
11382 "成功すると、 B<pthread_create>() は 0 を返す。\n"
11383 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
11384
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."
11388 msgstr ""
11389
11390 #. type: Plain text
11391 #: build/C/man3/pthread_mutex_consistent.3:72
11392 #, fuzzy
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 で初めて登場した。"
11396
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."
11402
11403 #. type: Plain text
11404 #: build/C/man3/pthread_mutex_consistent.3:82
11405 msgid ""
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>()."
11411 msgstr ""
11412
11413 #. type: Plain text
11414 #: build/C/man3/pthread_mutex_consistent.3:89
11415 msgid ""
11416 "Before the addition of B<pthread_mutex_consistent>()  to POSIX, glibc "
11417 "defined the following equivalent nonstandard function if B<_GNU_SOURCE> was "
11418 "defined:"
11419 msgstr ""
11420
11421 #. type: Plain text
11422 #: build/C/man3/pthread_mutex_consistent.3:92
11423 #, no-wrap
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"
11426
11427 #. type: Plain text
11428 #: build/C/man3/pthread_mutex_consistent.3:96
11429 msgid ""
11430 "This GNU-specific API, which first appeared in glibc 2.4, is nowadays "
11431 "obsolete and should not be used in new programs."
11432 msgstr ""
11433
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) 参照。"
11438
11439 #. type: Plain text
11440 #: build/C/man3/pthread_mutex_consistent.3:107
11441 msgid ""
11442 "B<pthread_mutex_lock>(3), B<pthread_mutexattr_init>(3), "
11443 "B<pthread_mutexattr_getrobust>(3), B<pthread_mutexattr_setrobust>(3), "
11444 "B<pthreads>(7)"
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)"
11446
11447 #. type: TH
11448 #: build/C/man3/pthread_mutexattr_getpshared.3:25
11449 #, no-wrap
11450 msgid "PTHREAD_MUTEXATTR_GETPSHARED"
11451 msgstr "PTHREAD_MUTEXATTR_GETPSHARED"
11452
11453 #. type: TH
11454 #: build/C/man3/pthread_mutexattr_getpshared.3:25
11455 #, no-wrap
11456 msgid "2017-09-13"
11457 msgstr "2017-09-13"
11458
11459 #. type: Plain text
11460 #: build/C/man3/pthread_mutexattr_getpshared.3:29
11461 #, fuzzy
11462 #| msgid ""
11463 #| "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack "
11464 #| "address attribute in thread attributes object"
11465 msgid ""
11466 "pthread_mutexattr_getpshared, pthread_mutexattr_setpshared - get/set process-"
11467 "shared mutex attribute"
11468 msgstr ""
11469 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
11470 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
11471
11472 #. type: Plain text
11473 #: build/C/man3/pthread_mutexattr_getpshared.3:37
11474 #, no-wrap
11475 msgid ""
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"
11480 msgstr ""
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"
11485
11486 #. type: Plain text
11487 #: build/C/man3/pthread_mutexattr_getpshared.3:45
11488 msgid ""
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."
11492 msgstr ""
11493
11494 #. type: Plain text
11495 #: build/C/man3/pthread_mutexattr_getpshared.3:47
11496 #, fuzzy
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 "新しく作成されたスレッドは、以下のいずれかで終了する。"
11500
11501 #. type: TP
11502 #: build/C/man3/pthread_mutexattr_getpshared.3:47
11503 #: build/C/man3/pthread_spin_init.3:68
11504 #, no-wrap
11505 msgid "B<PTHREAD_PROCESS_PRIVATE>"
11506 msgstr "B<PTHREAD_PROCESS_PRIVATE>"
11507
11508 #. type: Plain text
11509 #: build/C/man3/pthread_mutexattr_getpshared.3:52
11510 msgid ""
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."
11514 msgstr ""
11515
11516 #. type: TP
11517 #: build/C/man3/pthread_mutexattr_getpshared.3:52
11518 #: build/C/man3/pthread_spin_init.3:75
11519 #, no-wrap
11520 msgid "B<PTHREAD_PROCESS_SHARED>"
11521 msgstr "B<PTHREAD_PROCESS_SHARED>"
11522
11523 #. type: Plain text
11524 #: build/C/man3/pthread_mutexattr_getpshared.3:57
11525 msgid ""
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."
11529 msgstr ""
11530
11531 #. type: Plain text
11532 #: build/C/man3/pthread_mutexattr_getpshared.3:64
11533 #, fuzzy
11534 #| msgid ""
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>."
11538 msgid ""
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>."
11542 msgstr ""
11543 "B<pthread_attr_getstackaddr>() は、\n"
11544 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
11545 "I<stackaddr> が指すバッファーに入れて返す。"
11546
11547 #. type: Plain text
11548 #: build/C/man3/pthread_mutexattr_getpshared.3:71
11549 #, fuzzy
11550 #| msgid ""
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>."
11554 msgid ""
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>."
11558 msgstr ""
11559 "B<pthread_attr_setguardsize>() 関数は、\n"
11560 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
11561 "I<guardsize> で指定された値に設定する。"
11562
11563 #. type: Plain text
11564 #: build/C/man3/pthread_mutexattr_getpshared.3:76
11565 msgid ""
11566 "If I<attr> does not refer to an initialized mutex attributes object, the "
11567 "behavior is undefined."
11568 msgstr ""
11569
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
11574 #, fuzzy
11575 #| msgid ""
11576 #| "On success, these functions return 0; on error, they return an error "
11577 #| "number."
11578 msgid ""
11579 "On success, these functions return 0.  On error, they return a positive "
11580 "error number."
11581 msgstr ""
11582 "成功すると、これらの関数は 0 を返す。\n"
11583 "エラーの場合、エラー番号を返す。"
11584
11585 #. type: Plain text
11586 #: build/C/man3/pthread_mutexattr_getpshared.3:82
11587 #, fuzzy
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>() は以下のエラーで失敗する場合がある。"
11591
11592 #. type: Plain text
11593 #: build/C/man3/pthread_mutexattr_getpshared.3:87
11594 msgid "The value specified in I<pshared> is invalid."
11595 msgstr ""
11596
11597 #. type: Plain text
11598 #: build/C/man3/pthread_mutexattr_getpshared.3:92
11599 msgid ""
11600 "I<pshared is> B<PTHREAD_PROCESS_SHARED> but the implementation does not "
11601 "support process-shared mutexes."
11602 msgstr ""
11603
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)"
11608
11609 #. type: TH
11610 #: build/C/man3/pthread_mutexattr_init.3:25
11611 #, no-wrap
11612 msgid "PTHREAD_MUTEXATTR_INIT"
11613 msgstr "PTHREAD_MUTEXATTR_INIT"
11614
11615 #. type: TH
11616 #: build/C/man3/pthread_mutexattr_init.3:25
11617 #, no-wrap
11618 msgid "2019-10-10"
11619 msgstr "2019-10-10"
11620
11621 #. type: Plain text
11622 #: build/C/man3/pthread_mutexattr_init.3:29
11623 #, fuzzy
11624 #| msgid ""
11625 #| "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
11626 #| "attributes object"
11627 msgid ""
11628 "pthread_mutexattr_init, pthread_mutexattr_destroy - initialize and destroy a "
11629 "mutex attributes object"
11630 msgstr ""
11631 "pthread_attr_init, pthread_attr_destroy - \n"
11632 "スレッド属性オブジェクトの初期化と破棄を行う"
11633
11634 #. type: Plain text
11635 #: build/C/man3/pthread_mutexattr_init.3:35
11636 #, no-wrap
11637 msgid ""
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"
11640 msgstr ""
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"
11643
11644 #. type: Plain text
11645 #: build/C/man3/pthread_mutexattr_init.3:44
11646 #, fuzzy
11647 #| msgid ""
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>."
11651 msgid ""
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."
11655 msgstr ""
11656 "B<pthread_getattr_np>() 関数は、\n"
11657 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
11658 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
11659 "格納して返す。"
11660
11661 #. type: Plain text
11662 #: build/C/man3/pthread_mutexattr_init.3:47
11663 msgid ""
11664 "The results of initializing an already initialized mutex attributes object "
11665 "are undefined."
11666 msgstr ""
11667
11668 #. type: Plain text
11669 #: build/C/man3/pthread_mutexattr_init.3:53
11670 msgid ""
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>()."
11674 msgstr ""
11675
11676 #. type: Plain text
11677 #: build/C/man3/pthread_mutexattr_init.3:56
11678 msgid ""
11679 "The results of destroying an uninitialized mutex attributes object are "
11680 "undefined."
11681 msgstr ""
11682
11683 #. type: Plain text
11684 #: build/C/man3/pthread_mutexattr_init.3:64
11685 msgid ""
11686 "Subsequent changes to a mutex attributes object do not affect mutex that "
11687 "have already been initialized using that object."
11688 msgstr ""
11689
11690 #. type: Plain text
11691 #: build/C/man3/pthread_mutexattr_init.3:71
11692 msgid ""
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)"
11696
11697 #. type: TH
11698 #: build/C/man3/pthread_mutexattr_setrobust.3:26
11699 #, no-wrap
11700 msgid "PTHREAD_MUTEXATTR_SETROBUST"
11701 msgstr "PTHREAD_MUTEXATTR_SETROBUST"
11702
11703 #. type: Plain text
11704 #: build/C/man3/pthread_mutexattr_setrobust.3:30
11705 #, fuzzy
11706 #| msgid ""
11707 #| "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes "
11708 #| "in thread attributes object"
11709 msgid ""
11710 "pthread_mutexattr_getrobust, pthread_mutexattr_setrobust - get and set the "
11711 "robustness attribute of a mutex attributes object"
11712 msgstr ""
11713 "pthread_attr_setstack, pthread_attr_getstack - \n"
11714 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
11715
11716 #. type: Plain text
11717 #: build/C/man3/pthread_mutexattr_setrobust.3:38
11718 #, no-wrap
11719 msgid ""
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"
11724 msgstr ""
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"
11729
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>():"
11734
11735 #. type: Plain text
11736 #: build/C/man3/pthread_mutexattr_setrobust.3:72
11737 #, fuzzy
11738 #| msgid ""
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."
11744 msgid ""
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>."
11750 msgstr ""
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 (切り離された) 状態で作成されるかが決定される。"
11757
11758 #. type: Plain text
11759 #: build/C/man3/pthread_mutexattr_setrobust.3:77
11760 msgid ""
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 "
11763 "I<robustness>:"
11764 msgstr ""
11765
11766 #. type: TP
11767 #: build/C/man3/pthread_mutexattr_setrobust.3:77
11768 #, no-wrap
11769 msgid "B<PTHREAD_MUTEX_STALLED>"
11770 msgstr "B<PTHREAD_MUTEX_STALLED>"
11771
11772 #. type: Plain text
11773 #: build/C/man3/pthread_mutexattr_setrobust.3:86
11774 msgid ""
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 "
11779 "indefinitely."
11780 msgstr ""
11781
11782 #. type: TP
11783 #: build/C/man3/pthread_mutexattr_setrobust.3:86
11784 #, no-wrap
11785 msgid "B<PTHREAD_MUTEX_ROBUST>"
11786 msgstr "B<PTHREAD_MUTEX_ROBUST>"
11787
11788 #. type: Plain text
11789 #: build/C/man3/pthread_mutexattr_setrobust.3:102
11790 msgid ""
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."
11798 msgstr ""
11799
11800 #. type: Plain text
11801 #: build/C/man3/pthread_mutexattr_setrobust.3:112
11802 msgid ""
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)."
11808 msgstr ""
11809
11810 #. type: Plain text
11811 #: build/C/man3/pthread_mutexattr_setrobust.3:119
11812 msgid ""
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 "
11815 "B<EOWNERDEAD>."
11816 msgstr ""
11817
11818 #. type: Plain text
11819 #: build/C/man3/pthread_mutexattr_setrobust.3:129
11820 msgid ""
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 "
11824 "is undefined."
11825 msgstr ""
11826
11827 #. type: Plain text
11828 #: build/C/man3/pthread_mutexattr_setrobust.3:136
11829 msgid ""
11830 "In the glibc implementation, B<pthread_mutexattr_getrobust>()  always return "
11831 "zero."
11832 msgstr ""
11833
11834 #. type: Plain text
11835 #: build/C/man3/pthread_mutexattr_setrobust.3:145
11836 msgid ""
11837 "A value other than B<PTHREAD_MUTEX_STALLED> or B<PTHREAD_MUTEX_ROBUST> was "
11838 "passed to B<pthread_mutexattr_setrobust>()."
11839 msgstr ""
11840
11841 #. type: Plain text
11842 #: build/C/man3/pthread_mutexattr_setrobust.3:150
11843 #, fuzzy
11844 #| msgid ""
11845 #| "B<makecontext>()  and B<swapcontext>()  are provided in glibc since "
11846 #| "version 2.1."
11847 msgid ""
11848 "B<pthread_mutexattr_getrobust>()  and B<pthread_mutexattr_setrobust>()  were "
11849 "added to glibc in version 2.12."
11850 msgstr ""
11851 "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供"
11852 "されている。"
11853
11854 #.  E.g., Solaris, according to its manual page
11855 #. type: Plain text
11856 #: build/C/man3/pthread_mutexattr_setrobust.3:163
11857 msgid ""
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."
11863 msgstr ""
11864
11865 #. type: Plain text
11866 #: build/C/man3/pthread_mutexattr_setrobust.3:172
11867 msgid ""
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:"
11871 msgstr ""
11872
11873 #. type: Plain text
11874 #: build/C/man3/pthread_mutexattr_setrobust.3:178
11875 #, no-wrap
11876 msgid ""
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"
11881 msgstr ""
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"
11886
11887 #. type: Plain text
11888 #: build/C/man3/pthread_mutexattr_setrobust.3:185
11889 msgid ""
11890 "Correspondingly, the constants B<PTHREAD_MUTEX_STALLED_NP> and "
11891 "B<PTHREAD_MUTEX_ROBUST_NP> were also defined."
11892 msgstr ""
11893
11894 #. type: Plain text
11895 #: build/C/man3/pthread_mutexattr_setrobust.3:188
11896 msgid ""
11897 "These GNU-specific APIs, which first appeared in glibc 2.4, are nowadays "
11898 "obsolete and should not be used in new programs."
11899 msgstr ""
11900
11901 #. type: Plain text
11902 #: build/C/man3/pthread_mutexattr_setrobust.3:197
11903 msgid ""
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."
11909 msgstr ""
11910
11911 #. type: Plain text
11912 #: build/C/man3/pthread_mutexattr_setrobust.3:199
11913 #, fuzzy
11914 #| msgid "The following shell session shows a sample run of the program:"
11915 msgid ""
11916 "The following shell session shows what we see when running this program:"
11917 msgstr "以下のシェルセッションは、このプログラムの実行例である。"
11918
11919 #. type: Plain text
11920 #: build/C/man3/pthread_mutexattr_setrobust.3:209
11921 #, no-wrap
11922 msgid ""
11923 "$ B<./a.out>\n"
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"
11930 msgstr ""
11931 "$ B<./a.out>\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"
11938
11939 #. type: Plain text
11940 #: build/C/man3/pthread_mutexattr_setrobust.3:218
11941 #, no-wrap
11942 msgid ""
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"
11948 msgstr ""
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"
11954
11955 #. type: Plain text
11956 #: build/C/man3/pthread_mutexattr_setrobust.3:223
11957 #, no-wrap
11958 msgid "static pthread_mutex_t mtx;\n"
11959 msgstr ""
11960
11961 #. type: Plain text
11962 #: build/C/man3/pthread_mutexattr_setrobust.3:232
11963 #, no-wrap
11964 msgid ""
11965 "static void *\n"
11966 "original_owner_thread(void *ptr)\n"
11967 "{\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"
11972 "}\n"
11973 msgstr ""
11974
11975 #. type: Plain text
11976 #: build/C/man3/pthread_mutexattr_setrobust.3:239
11977 #, no-wrap
11978 msgid ""
11979 "int\n"
11980 "main(int argc, char *argv[])\n"
11981 "{\n"
11982 "    pthread_t thr;\n"
11983 "    pthread_mutexattr_t attr;\n"
11984 "    int s;\n"
11985 msgstr ""
11986 "int\n"
11987 "main(int argc, char *argv[])\n"
11988 "{\n"
11989 "    pthread_t thr;\n"
11990 "    pthread_mutexattr_t attr;\n"
11991 "    int s;\n"
11992
11993 #. type: Plain text
11994 #: build/C/man3/pthread_mutexattr_setrobust.3:244
11995 #, no-wrap
11996 msgid ""
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"
12001 msgstr ""
12002
12003 #. type: Plain text
12004 #: build/C/man3/pthread_mutexattr_setrobust.3:246
12005 #, no-wrap
12006 msgid "    pthread_mutex_init(&mtx, &attr);   /* initialize the mutex */\n"
12007 msgstr ""
12008
12009 #. type: Plain text
12010 #: build/C/man3/pthread_mutexattr_setrobust.3:248
12011 #, no-wrap
12012 msgid "    pthread_create(&thr, NULL, original_owner_thread, NULL);\n"
12013 msgstr ""
12014
12015 #. type: Plain text
12016 #: build/C/man3/pthread_mutexattr_setrobust.3:252
12017 #, no-wrap
12018 msgid "    /* \"original_owner_thread\" should have exited by now */\n"
12019 msgstr ""
12020
12021 #. type: Plain text
12022 #: build/C/man3/pthread_mutexattr_setrobust.3:265
12023 #, no-wrap
12024 msgid ""
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"
12031 "        if (s != 0)\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"
12035 "        if (s != 0)\n"
12036 "            handle_error_en(s, \"pthread_mutex_unlock\");\n"
12037 msgstr ""
12038
12039 #. type: Plain text
12040 #: build/C/man3/pthread_mutexattr_setrobust.3:275
12041 #, no-wrap
12042 msgid ""
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"
12047 "    } else {\n"
12048 "        printf(\"[main] pthread_mutex_lock() unexpectedly failed\\en\");\n"
12049 "        handle_error_en(s, \"pthread_mutex_lock\");\n"
12050 "    }\n"
12051 "}\n"
12052 msgstr ""
12053
12054 #. type: Plain text
12055 #: build/C/man3/pthread_mutexattr_setrobust.3:285
12056 msgid ""
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)"
12061
12062 #. type: TH
12063 #: build/C/man3/pthread_spin_init.3:25
12064 #, no-wrap
12065 msgid "PTHREAD_SPIN_INIT"
12066 msgstr "PTHREAD_SPIN_INIT"
12067
12068 #. type: Plain text
12069 #: build/C/man3/pthread_spin_init.3:28
12070 #, fuzzy
12071 #| msgid ""
12072 #| "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread "
12073 #| "attributes object"
12074 msgid ""
12075 "pthread_spin_init, pthread_spin_destroy - initialize or destroy a spin lock"
12076 msgstr ""
12077 "pthread_attr_init, pthread_attr_destroy - \n"
12078 "スレッド属性オブジェクトの初期化と破棄を行う"
12079
12080 #. type: Plain text
12081 #: build/C/man3/pthread_spin_init.3:34
12082 #, no-wrap
12083 msgid ""
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"
12086 msgstr ""
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"
12089
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>():"
12094
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"
12099
12100 #. type: Plain text
12101 #: build/C/man3/pthread_spin_init.3:58
12102 msgid ""
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."
12106 msgstr ""
12107
12108 #. type: Plain text
12109 #: build/C/man3/pthread_spin_init.3:68
12110 msgid ""
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:"
12115 msgstr ""
12116
12117 #. type: Plain text
12118 #: build/C/man3/pthread_spin_init.3:75
12119 msgid ""
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.)"
12123 msgstr ""
12124
12125 #. type: Plain text
12126 #: build/C/man3/pthread_spin_init.3:81
12127 msgid ""
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)."
12131 msgstr ""
12132
12133 #. type: Plain text
12134 #: build/C/man3/pthread_spin_init.3:86
12135 #, fuzzy
12136 #| msgid ""
12137 #| "Calling B<pthread_attr_init>()  on a thread attributes object that has "
12138 #| "already been initialized results in undefined behavior."
12139 msgid ""
12140 "Calling B<pthread_spin_init>()  on a spin lock that has already been "
12141 "initialized results in undefined behavior."
12142 msgstr ""
12143 "すでに初期化されているスレッド属性オブジェクトに対して\n"
12144 "B<pthread_attr_init>() を呼び出した場合、\n"
12145 "どのような動作になるかは不定である。"
12146
12147 #. type: Plain text
12148 #: build/C/man3/pthread_spin_init.3:94
12149 msgid ""
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."
12155 msgstr ""
12156
12157 #. type: Plain text
12158 #: build/C/man3/pthread_spin_init.3:100
12159 msgid ""
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."
12163 msgstr ""
12164
12165 #. type: Plain text
12166 #: build/C/man3/pthread_spin_init.3:111
12167 msgid ""
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."
12171 msgstr ""
12172
12173 #. type: Plain text
12174 #: build/C/man3/pthread_spin_init.3:117
12175 #, fuzzy
12176 #| msgid ""
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."
12180 msgid ""
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 "
12183 "initialized."
12184 msgstr ""
12185 "成功すると、これらの関数は 0 を返す。\n"
12186 "エラーの場合、0 以外のエラー番号を返す。\n"
12187 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
12188 "スケジューリングポリシーとパラメーターは変更されない。"
12189
12190 #.  These errors don't occur on the glibc implementation
12191 #. type: Plain text
12192 #: build/C/man3/pthread_spin_init.3:121
12193 #, fuzzy
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>() は以下のエラーで失敗する場合がある。"
12197
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."
12201 msgstr ""
12202
12203 #. type: Plain text
12204 #: build/C/man3/pthread_spin_init.3:128
12205 msgid "Insufficient memory to initialize the spin lock."
12206 msgstr ""
12207
12208 #. type: Plain text
12209 #: build/C/man3/pthread_spin_init.3:130 build/C/man3/pthread_spin_lock.3:109
12210 #, fuzzy
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 で初めて登場した。"
12214
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."
12219
12220 #. type: Plain text
12221 #: build/C/man3/pthread_spin_init.3:135
12222 msgid ""
12223 "Support for process-shared spin locks is a POSIX option.  The option is "
12224 "supported in the glibc implementation."
12225 msgstr ""
12226
12227 #. type: Plain text
12228 #: build/C/man3/pthread_spin_init.3:148
12229 msgid ""
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."
12237 msgstr ""
12238
12239 #. type: Plain text
12240 #: build/C/man3/pthread_spin_init.3:151
12241 msgid ""
12242 "If threads create a deadlock situation while employing spin locks, those "
12243 "threads will spin forever consuming CPU time."
12244 msgstr ""
12245
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
12250 msgid ""
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."
12256 msgstr ""
12257
12258 #. type: Plain text
12259 #: build/C/man3/pthread_spin_init.3:170
12260 msgid ""
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)"
12264
12265 #. type: TH
12266 #: build/C/man3/pthread_spin_lock.3:25
12267 #, no-wrap
12268 msgid "PTHREAD_SPIN_LOCK"
12269 msgstr "PTHREAD_SPIN_LOCK"
12270
12271 #. type: TH
12272 #: build/C/man3/pthread_spin_lock.3:25
12273 #, no-wrap
12274 msgid "2017-09-30"
12275 msgstr "2017-09-30"
12276
12277 #. type: Plain text
12278 #: build/C/man3/pthread_spin_lock.3:29
12279 msgid ""
12280 "pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock - lock and "
12281 "unlock a spin lock"
12282 msgstr ""
12283
12284 #. type: Plain text
12285 #: build/C/man3/pthread_spin_lock.3:36
12286 #, no-wrap
12287 msgid ""
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"
12291 msgstr ""
12292
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>():"
12297
12298 #. type: Plain text
12299 #: build/C/man3/pthread_spin_lock.3:63
12300 msgid ""
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."
12306 msgstr ""
12307
12308 #. type: Plain text
12309 #: build/C/man3/pthread_spin_lock.3:70
12310 #, fuzzy
12311 #| msgid ""
12312 #| "Calling B<pthread_attr_init>()  on a thread attributes object that has "
12313 #| "already been initialized results in undefined behavior."
12314 msgid ""
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."
12318 msgstr ""
12319 "すでに初期化されているスレッド属性オブジェクトに対して\n"
12320 "B<pthread_attr_init>() を呼び出した場合、\n"
12321 "どのような動作になるかは不定である。"
12322
12323 #. type: Plain text
12324 #: build/C/man3/pthread_spin_lock.3:80
12325 msgid ""
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 "
12329 "B<EBUSY>."
12330 msgstr ""
12331
12332 #. type: Plain text
12333 #: build/C/man3/pthread_spin_lock.3:87
12334 msgid ""
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."
12338 msgstr ""
12339
12340 #. type: Plain text
12341 #: build/C/man3/pthread_spin_lock.3:91
12342 #, fuzzy
12343 #| msgid ""
12344 #| "Calling B<pthread_attr_init>()  on a thread attributes object that has "
12345 #| "already been initialized results in undefined behavior."
12346 msgid ""
12347 "Calling B<pthread_spin_unlock>()  on a lock that is not held by the caller "
12348 "results in undefined behavior."
12349 msgstr ""
12350 "すでに初期化されているスレッド属性オブジェクトに対して\n"
12351 "B<pthread_attr_init>() を呼び出した場合、\n"
12352 "どのような動作になるかは不定である。"
12353
12354 #. type: Plain text
12355 #: build/C/man3/pthread_spin_lock.3:94
12356 #, fuzzy
12357 #| msgid ""
12358 #| "On success, these functions return 0; on error, they return an error "
12359 #| "number."
12360 msgid ""
12361 "On success, these functions return zero.  On failure, they return an error "
12362 "number."
12363 msgstr ""
12364 "成功すると、これらの関数は 0 を返す。\n"
12365 "エラーの場合、エラー番号を返す。"
12366
12367 #. type: Plain text
12368 #: build/C/man3/pthread_spin_lock.3:97
12369 #, fuzzy
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>() は以下のエラーで失敗する場合がある。"
12373
12374 #. type: TP
12375 #: build/C/man3/pthread_spin_lock.3:97
12376 #, no-wrap
12377 msgid "B<EDEADLOCK>"
12378 msgstr "B<EDEADLOCK>"
12379
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."
12384 msgstr ""
12385
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>() は以下のエラーで失敗する。"
12390
12391 #. type: Plain text
12392 #: build/C/man3/pthread_spin_lock.3:107
12393 msgid "The spin lock is currently locked by another thread."
12394 msgstr ""
12395
12396 #. type: Plain text
12397 #: build/C/man3/pthread_spin_lock.3:114
12398 #, fuzzy
12399 #| msgid ""
12400 #| "Calling B<pthread_attr_init>()  on a thread attributes object that has "
12401 #| "already been initialized results in undefined behavior."
12402 msgid ""
12403 "Applying any of the functions described on this page to an uninitialized "
12404 "spin lock results in undefined behavior."
12405 msgstr ""
12406 "すでに初期化されているスレッド属性オブジェクトに対して\n"
12407 "B<pthread_attr_init>() を呼び出した場合、\n"
12408 "どのような動作になるかは不定である。"
12409
12410 #. type: Plain text
12411 #: build/C/man3/pthread_spin_lock.3:117
12412 #, fuzzy
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) を参照。"
12416
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)"
12422
12423 #. type: TH
12424 #: build/C/man7/pthreads.7:25
12425 #, no-wrap
12426 msgid "PTHREADS"
12427 msgstr "PTHREADS"
12428
12429 #. type: Plain text
12430 #: build/C/man7/pthreads.7:28
12431 msgid "pthreads - POSIX threads"
12432 msgstr "pthreads - POSIX スレッド"
12433
12434 #. type: Plain text
12435 #: build/C/man7/pthreads.7:35
12436 msgid ""
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)."
12442 msgstr ""
12443 "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッドプログラ"
12444 "ミングのインターフェース群 (関数、ヘッダーファイル)  を規定している。一つのプ"
12445 "ロセスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行"
12446 "する。 これらのスレッドは同じ大域メモリー (データとヒープ領域) を共有する"
12447 "が、 各スレッドは自分専用のスタック (自動変数) を持つ。"
12448
12449 #. type: Plain text
12450 #: build/C/man7/pthreads.7:38
12451 msgid ""
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):"
12454 msgstr ""
12455 "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つま"
12456 "り、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
12457
12458 #. type: IP
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
12482 #, no-wrap
12483 msgid "-"
12484 msgstr "-"
12485
12486 #. type: Plain text
12487 #: build/C/man7/pthreads.7:40
12488 msgid "process ID"
12489 msgstr "プロセス ID"
12490
12491 #. type: Plain text
12492 #: build/C/man7/pthreads.7:42
12493 msgid "parent process ID"
12494 msgstr "親プロセス ID"
12495
12496 #. type: Plain text
12497 #: build/C/man7/pthreads.7:44
12498 msgid "process group ID and session ID"
12499 msgstr "プロセスグループ ID とセッション ID"
12500
12501 #. type: Plain text
12502 #: build/C/man7/pthreads.7:46
12503 msgid "controlling terminal"
12504 msgstr "制御端末"
12505
12506 #. type: Plain text
12507 #: build/C/man7/pthreads.7:48
12508 msgid "user and group IDs"
12509 msgstr "ユーザー ID とグループ ID"
12510
12511 #. type: Plain text
12512 #: build/C/man7/pthreads.7:50
12513 msgid "open file descriptors"
12514 msgstr "オープンするファイルディスクリプター"
12515
12516 #. type: Plain text
12517 #: build/C/man7/pthreads.7:53
12518 msgid "record locks (see B<fcntl>(2))"
12519 msgstr "レコードのロック (B<fcntl>(3)  参照)"
12520
12521 #. type: Plain text
12522 #: build/C/man7/pthreads.7:55
12523 msgid "signal dispositions"
12524 msgstr "シグナルの配置"
12525
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))"
12530
12531 #. type: Plain text
12532 #: build/C/man7/pthreads.7:64
12533 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
12534 msgstr ""
12535 "カレントディレクトリ (B<chdir>(2))  とルートディレクトリ (B<chroot>(2))"
12536
12537 #. type: Plain text
12538 #: build/C/man7/pthreads.7:69
12539 msgid ""
12540 "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
12541 msgstr ""
12542 "インターバルタイマー (B<setitimer>(2))  と POSIX タイマー "
12543 "(B<timer_create>(2))"
12544
12545 #. type: Plain text
12546 #: build/C/man7/pthreads.7:72
12547 msgid "nice value (B<setpriority>(2))"
12548 msgstr "nice 値 (B<setpriority>(2))"
12549
12550 #. type: Plain text
12551 #: build/C/man7/pthreads.7:75
12552 msgid "resource limits (B<setrlimit>(2))"
12553 msgstr "リソース制限 (B<setrlimit>(2))"
12554
12555 #. type: Plain text
12556 #: build/C/man7/pthreads.7:80
12557 msgid ""
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))  の消費状況の計測"
12561
12562 #. type: Plain text
12563 #: build/C/man7/pthreads.7:83
12564 msgid ""
12565 "As well as the stack, POSIX.1 specifies that various other attributes are "
12566 "distinct for each thread, including:"
12567 msgstr ""
12568 "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理され"
12569 "るかを規定している:"
12570
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> データ型)"
12575
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))"
12580
12581 #. type: Plain text
12582 #: build/C/man7/pthreads.7:94
12583 msgid "the I<errno> variable"
12584 msgstr "I<errno> 変数"
12585
12586 #. type: Plain text
12587 #: build/C/man7/pthreads.7:97
12588 msgid "alternate signal stack (B<sigaltstack>(2))"
12589 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
12590
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))"
12595
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 特有の機能もスレッド単位である:"
12600
12601 #. type: Plain text
12602 #: build/C/man7/pthreads.7:105
12603 msgid "capabilities (see B<capabilities>(7))"
12604 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
12605
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))"
12610
12611 #. type: SS
12612 #: build/C/man7/pthreads.7:108
12613 #, no-wrap
12614 msgid "Pthreads function return values"
12615 msgstr "pthreads 関数の返り値"
12616
12617 #. type: Plain text
12618 #: build/C/man7/pthreads.7:119
12619 #, fuzzy
12620 #| msgid ""
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>."
12625 msgid ""
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>."
12632 msgstr ""
12633 "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返"
12634 "す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 "
12635 "では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗すること"
12636 "は決してないと規定している。"
12637
12638 #. type: SS
12639 #: build/C/man7/pthreads.7:119
12640 #, no-wrap
12641 msgid "Thread IDs"
12642 msgstr "スレッド ID"
12643
12644 #. type: Plain text
12645 #: build/C/man7/pthreads.7:127
12646 msgid ""
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) を使って取得できる。"
12652
12653 #. type: Plain text
12654 #: build/C/man7/pthreads.7:132
12655 #, fuzzy
12656 #| msgid ""
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."
12660 msgid ""
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.)"
12664 msgstr ""
12665 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
12666 "終了したスレッドが join されたり、\n"
12667 "切り離された (detached) スレッドが終了されたりした後は、\n"
12668 "そのスレッド ID は再利用されることがある。"
12669
12670 #. type: Plain text
12671 #: build/C/man7/pthreads.7:137
12672 msgid ""
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 "
12676 "undefined.\""
12677 msgstr ""
12678
12679 #. type: SS
12680 #: build/C/man7/pthreads.7:137
12681 #, no-wrap
12682 msgid "Thread-safe functions"
12683 msgstr "スレッドセーフな関数"
12684
12685 #. type: Plain text
12686 #: build/C/man7/pthreads.7:141
12687 msgid ""
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 "
12690 "the same time."
12691 msgstr ""
12692 "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわ"
12693 "ち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
12694
12695 #. type: Plain text
12696 #: build/C/man7/pthreads.7:145
12697 msgid ""
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:"
12700 msgstr ""
12701 "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全て"
12702 "の関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
12703
12704 #. type: Plain text
12705 #: build/C/man7/pthreads.7:241
12706 #, no-wrap
12707 msgid ""
12708 "asctime()\n"
12709 "basename()\n"
12710 "catgets()\n"
12711 "crypt()\n"
12712 "ctermid() if passed a non-NULL argument\n"
12713 "ctime()\n"
12714 "dbm_clearerr()\n"
12715 "dbm_close()\n"
12716 "dbm_delete()\n"
12717 "dbm_error()\n"
12718 "dbm_fetch()\n"
12719 "dbm_firstkey()\n"
12720 "dbm_nextkey()\n"
12721 "dbm_open()\n"
12722 "dbm_store()\n"
12723 "dirname()\n"
12724 "dlerror()\n"
12725 "drand48()\n"
12726 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
12727 "encrypt()\n"
12728 "endgrent()\n"
12729 "endpwent()\n"
12730 "endutxent()\n"
12731 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
12732 "ftw()\n"
12733 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
12734 "getc_unlocked()\n"
12735 "getchar_unlocked()\n"
12736 "getdate()\n"
12737 "getenv()\n"
12738 "getgrent()\n"
12739 "getgrgid()\n"
12740 "getgrnam()\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"
12745 "gethostent()\n"
12746 "getlogin()\n"
12747 "getnetbyaddr()\n"
12748 "getnetbyname()\n"
12749 "getnetent()\n"
12750 "getopt()\n"
12751 "getprotobyname()\n"
12752 "getprotobynumber()\n"
12753 "getprotoent()\n"
12754 "getpwent()\n"
12755 "getpwnam()\n"
12756 "getpwuid()\n"
12757 "getservbyname()\n"
12758 "getservbyport()\n"
12759 "getservent()\n"
12760 "getutxent()\n"
12761 "getutxid()\n"
12762 "getutxline()\n"
12763 "gmtime()\n"
12764 "hcreate()\n"
12765 "hdestroy()\n"
12766 "hsearch()\n"
12767 "inet_ntoa()\n"
12768 "l64a()\n"
12769 "lgamma()\n"
12770 "lgammaf()\n"
12771 "lgammal()\n"
12772 "localeconv()\n"
12773 "localtime()\n"
12774 "lrand48()\n"
12775 "mrand48()\n"
12776 "nftw()\n"
12777 "nl_langinfo()\n"
12778 "ptsname()\n"
12779 "putc_unlocked()\n"
12780 "putchar_unlocked()\n"
12781 "putenv()\n"
12782 "pututxline()\n"
12783 "rand()\n"
12784 "readdir()\n"
12785 "setenv()\n"
12786 "setgrent()\n"
12787 "setkey()\n"
12788 "setpwent()\n"
12789 "setutxent()\n"
12790 "strerror()\n"
12791 "strsignal() [Added in POSIX.1-2008]\n"
12792 "strtok()\n"
12793 "system() [Added in POSIX.1-2008]\n"
12794 "tmpnam() if passed a non-NULL argument\n"
12795 "ttyname()\n"
12796 "unsetenv()\n"
12797 "wcrtomb() if its final argument is NULL\n"
12798 "wcsrtombs() if its final argument is NULL\n"
12799 "wcstombs()\n"
12800 "wctomb()\n"
12801 msgstr ""
12802 "asctime()\n"
12803 "basename()\n"
12804 "catgets()\n"
12805 "crypt()\n"
12806 "ctermid() (NULL でない引数を渡された場合)\n"
12807 "ctime()\n"
12808 "dbm_clearerr()\n"
12809 "dbm_close()\n"
12810 "dbm_delete()\n"
12811 "dbm_error()\n"
12812 "dbm_fetch()\n"
12813 "dbm_firstkey()\n"
12814 "dbm_nextkey()\n"
12815 "dbm_open()\n"
12816 "dbm_store()\n"
12817 "dirname()\n"
12818 "dlerror()\n"
12819 "drand48()\n"
12820 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
12821 "encrypt()\n"
12822 "endgrent()\n"
12823 "endpwent()\n"
12824 "endutxent()\n"
12825 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
12826 "ftw()\n"
12827 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
12828 "getc_unlocked()\n"
12829 "getchar_unlocked()\n"
12830 "getdate()\n"
12831 "getenv()\n"
12832 "getgrent()\n"
12833 "getgrgid()\n"
12834 "getgrnam()\n"
12835 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
12836 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
12837 "gethostent()\n"
12838 "getlogin()\n"
12839 "getnetbyaddr()\n"
12840 "getnetbyname()\n"
12841 "getnetent()\n"
12842 "getopt()\n"
12843 "getprotobyname()\n"
12844 "getprotobynumber()\n"
12845 "getprotoent()\n"
12846 "getpwent()\n"
12847 "getpwnam()\n"
12848 "getpwuid()\n"
12849 "getservbyname()\n"
12850 "getservbyport()\n"
12851 "getservent()\n"
12852 "getutxent()\n"
12853 "getutxid()\n"
12854 "getutxline()\n"
12855 "gmtime()\n"
12856 "hcreate()\n"
12857 "hdestroy()\n"
12858 "hsearch()\n"
12859 "inet_ntoa()\n"
12860 "l64a()\n"
12861 "lgamma()\n"
12862 "lgammaf()\n"
12863 "lgammal()\n"
12864 "localeconv()\n"
12865 "localtime()\n"
12866 "lrand48()\n"
12867 "mrand48()\n"
12868 "nftw()\n"
12869 "nl_langinfo()\n"
12870 "ptsname()\n"
12871 "putc_unlocked()\n"
12872 "putchar_unlocked()\n"
12873 "putenv()\n"
12874 "pututxline()\n"
12875 "rand()\n"
12876 "readdir()\n"
12877 "setenv()\n"
12878 "setgrent()\n"
12879 "setkey()\n"
12880 "setpwent()\n"
12881 "setutxent()\n"
12882 "strerror()\n"
12883 "strsignal() [POSIX.1-2008 で追加された]\n"
12884 "strtok()\n"
12885 "system() [POSIX.1-2008 で追加された]\n"
12886 "tmpnam() (NULL でない引数を渡された場合)\n"
12887 "ttyname()\n"
12888 "unsetenv()\n"
12889 "wcrtomb() (最後の引数が NULL の場合)\n"
12890 "wcsrtombs() (最後の引数が NULL の場合)\n"
12891 "wcstombs()\n"
12892 "wctomb()\n"
12893
12894 #. type: SS
12895 #: build/C/man7/pthreads.7:243
12896 #, no-wrap
12897 msgid "Async-cancel-safe functions"
12898 msgstr "async-cancel-safe 関数"
12899
12900 #. type: Plain text
12901 #: build/C/man7/pthreads.7:247
12902 msgid ""
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))."
12906 msgstr ""
12907 "async-cancel-safe 関数は、\n"
12908 "非同期キャンセル機能が有効になっているアプリケーションで\n"
12909 "安全に呼び出すことができる関数のことである\n"
12910 "(B<pthread_setcancelstate>(3) を参照)。"
12911
12912 #. type: Plain text
12913 #: build/C/man7/pthreads.7:250
12914 msgid ""
12915 "Only the following functions are required to be async-cancel-safe by "
12916 "POSIX.1-2001 and POSIX.1-2008:"
12917 msgstr ""
12918 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
12919 "なければならないとされている。"
12920
12921 #. type: Plain text
12922 #: build/C/man7/pthreads.7:256
12923 #, no-wrap
12924 msgid ""
12925 "pthread_cancel()\n"
12926 "pthread_setcancelstate()\n"
12927 "pthread_setcanceltype()\n"
12928 msgstr ""
12929 "pthread_cancel()\n"
12930 "pthread_setcancelstate()\n"
12931 "pthread_setcanceltype()\n"
12932
12933 #. type: SS
12934 #: build/C/man7/pthreads.7:258
12935 #, no-wrap
12936 msgid "Cancellation points"
12937 msgstr "取り消しポイント (cancellation points)"
12938
12939 #. type: Plain text
12940 #: build/C/man7/pthreads.7:265
12941 msgid ""
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."
12946 msgstr ""
12947 "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の"
12948 "関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能"
12949 "で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッド"
12950 "に対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した"
12951 "時点で、そのスレッドのキャンセルが 行われる。"
12952
12953 #. type: Plain text
12954 #: build/C/man7/pthreads.7:268
12955 msgid ""
12956 "The following functions are required to be cancellation points by "
12957 "POSIX.1-2001 and/or POSIX.1-2008:"
12958 msgstr ""
12959 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
12960 "は、取り消しポイント (cancellation points) で あることが必須となっている。"
12961
12962 #. type: Plain text
12963 #: build/C/man7/pthreads.7:331
12964 #, no-wrap
12965 msgid ""
12966 "accept()\n"
12967 "aio_suspend()\n"
12968 "clock_nanosleep()\n"
12969 "close()\n"
12970 "connect()\n"
12971 "creat()\n"
12972 "fcntl() F_SETLKW\n"
12973 "fdatasync()\n"
12974 "fsync()\n"
12975 "getmsg()\n"
12976 "getpmsg()\n"
12977 "lockf() F_LOCK\n"
12978 "mq_receive()\n"
12979 "mq_send()\n"
12980 "mq_timedreceive()\n"
12981 "mq_timedsend()\n"
12982 "msgrcv()\n"
12983 "msgsnd()\n"
12984 "msync()\n"
12985 "nanosleep()\n"
12986 "open()\n"
12987 "openat() [Added in POSIX.1-2008]\n"
12988 "pause()\n"
12989 "poll()\n"
12990 "pread()\n"
12991 "pselect()\n"
12992 "pthread_cond_timedwait()\n"
12993 "pthread_cond_wait()\n"
12994 "pthread_join()\n"
12995 "pthread_testcancel()\n"
12996 "putmsg()\n"
12997 "putpmsg()\n"
12998 "pwrite()\n"
12999 "read()\n"
13000 "readv()\n"
13001 "recv()\n"
13002 "recvfrom()\n"
13003 "recvmsg()\n"
13004 "select()\n"
13005 "sem_timedwait()\n"
13006 "sem_wait()\n"
13007 "send()\n"
13008 "sendmsg()\n"
13009 "sendto()\n"
13010 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
13011 "sigsuspend()\n"
13012 "sigtimedwait()\n"
13013 "sigwait()\n"
13014 "sigwaitinfo()\n"
13015 "sleep()\n"
13016 "system()\n"
13017 "tcdrain()\n"
13018 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
13019 "wait()\n"
13020 "waitid()\n"
13021 "waitpid()\n"
13022 "write()\n"
13023 "writev()\n"
13024 msgstr ""
13025 "accept()\n"
13026 "aio_suspend()\n"
13027 "clock_nanosleep()\n"
13028 "close()\n"
13029 "connect()\n"
13030 "creat()\n"
13031 "fcntl() F_SETLKW\n"
13032 "fdatasync()\n"
13033 "fsync()\n"
13034 "getmsg()\n"
13035 "getpmsg()\n"
13036 "lockf() F_LOCK\n"
13037 "mq_receive()\n"
13038 "mq_send()\n"
13039 "mq_timedreceive()\n"
13040 "mq_timedsend()\n"
13041 "msgrcv()\n"
13042 "msgsnd()\n"
13043 "msync()\n"
13044 "nanosleep()\n"
13045 "open()\n"
13046 "openat() [POSIX.1-2008 で追加された]\n"
13047 "pause()\n"
13048 "poll()\n"
13049 "pread()\n"
13050 "pselect()\n"
13051 "pthread_cond_timedwait()\n"
13052 "pthread_cond_wait()\n"
13053 "pthread_join()\n"
13054 "pthread_testcancel()\n"
13055 "putmsg()\n"
13056 "putpmsg()\n"
13057 "pwrite()\n"
13058 "read()\n"
13059 "readv()\n"
13060 "recv()\n"
13061 "recvfrom()\n"
13062 "recvmsg()\n"
13063 "select()\n"
13064 "sem_timedwait()\n"
13065 "sem_wait()\n"
13066 "send()\n"
13067 "sendmsg()\n"
13068 "sendto()\n"
13069 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
13070 "sigsuspend()\n"
13071 "sigtimedwait()\n"
13072 "sigwait()\n"
13073 "sigwaitinfo()\n"
13074 "sleep()\n"
13075 "system()\n"
13076 "tcdrain()\n"
13077 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
13078 "wait()\n"
13079 "waitid()\n"
13080 "waitpid()\n"
13081 "write()\n"
13082 "writev()\n"
13083
13084 #. type: Plain text
13085 #: build/C/man7/pthreads.7:336
13086 msgid ""
13087 "The following functions may be cancellation points according to POSIX.1-2001 "
13088 "and/or POSIX.1-2008:"
13089 msgstr ""
13090 "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数"
13091 "は、取り消しポイント (cancellation points) で あってもよいことになっている。"
13092
13093 #. type: Plain text
13094 #: build/C/man7/pthreads.7:566
13095 #, no-wrap
13096 msgid ""
13097 "access()\n"
13098 "asctime()\n"
13099 "asctime_r()\n"
13100 "catclose()\n"
13101 "catgets()\n"
13102 "catopen()\n"
13103 "chmod() [Added in POSIX.1-2008]\n"
13104 "chown() [Added in POSIX.1-2008]\n"
13105 "closedir()\n"
13106 "closelog()\n"
13107 "ctermid()\n"
13108 "ctime()\n"
13109 "ctime_r()\n"
13110 "dbm_close()\n"
13111 "dbm_delete()\n"
13112 "dbm_fetch()\n"
13113 "dbm_nextkey()\n"
13114 "dbm_open()\n"
13115 "dbm_store()\n"
13116 "dlclose()\n"
13117 "dlopen()\n"
13118 "dprintf() [Added in POSIX.1-2008]\n"
13119 "endgrent()\n"
13120 "endhostent()\n"
13121 "endnetent()\n"
13122 "endprotoent()\n"
13123 "endpwent()\n"
13124 "endservent()\n"
13125 "endutxent()\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"
13131 "fclose()\n"
13132 "fcntl() (for any value of cmd argument)\n"
13133 "fflush()\n"
13134 "fgetc()\n"
13135 "fgetpos()\n"
13136 "fgets()\n"
13137 "fgetwc()\n"
13138 "fgetws()\n"
13139 "fmtmsg()\n"
13140 "fopen()\n"
13141 "fpathconf()\n"
13142 "fprintf()\n"
13143 "fputc()\n"
13144 "fputs()\n"
13145 "fputwc()\n"
13146 "fputws()\n"
13147 "fread()\n"
13148 "freopen()\n"
13149 "fscanf()\n"
13150 "fseek()\n"
13151 "fseeko()\n"
13152 "fsetpos()\n"
13153 "fstat()\n"
13154 "fstatat() [Added in POSIX.1-2008]\n"
13155 "ftell()\n"
13156 "ftello()\n"
13157 "ftw()\n"
13158 "futimens() [Added in POSIX.1-2008]\n"
13159 "fwprintf()\n"
13160 "fwrite()\n"
13161 "fwscanf()\n"
13162 "getaddrinfo()\n"
13163 "getc()\n"
13164 "getc_unlocked()\n"
13165 "getchar()\n"
13166 "getchar_unlocked()\n"
13167 "getcwd()\n"
13168 "getdate()\n"
13169 "getdelim() [Added in POSIX.1-2008]\n"
13170 "getgrent()\n"
13171 "getgrgid()\n"
13172 "getgrgid_r()\n"
13173 "getgrnam()\n"
13174 "getgrnam_r()\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"
13179 "gethostent()\n"
13180 "gethostid()\n"
13181 "gethostname()\n"
13182 "getline() [Added in POSIX.1-2008]\n"
13183 "getlogin()\n"
13184 "getlogin_r()\n"
13185 "getnameinfo()\n"
13186 "getnetbyaddr()\n"
13187 "getnetbyname()\n"
13188 "getnetent()\n"
13189 "getopt() (if opterr is nonzero)\n"
13190 "getprotobyname()\n"
13191 "getprotobynumber()\n"
13192 "getprotoent()\n"
13193 "getpwent()\n"
13194 "getpwnam()\n"
13195 "getpwnam_r()\n"
13196 "getpwuid()\n"
13197 "getpwuid_r()\n"
13198 "gets()\n"
13199 "getservbyname()\n"
13200 "getservbyport()\n"
13201 "getservent()\n"
13202 "getutxent()\n"
13203 "getutxid()\n"
13204 "getutxline()\n"
13205 "getwc()\n"
13206 "getwchar()\n"
13207 "getwd() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
13208 "glob()\n"
13209 "iconv_close()\n"
13210 "iconv_open()\n"
13211 "ioctl()\n"
13212 "link()\n"
13213 "linkat() [Added in POSIX.1-2008]\n"
13214 "lio_listio() [Added in POSIX.1-2008]\n"
13215 "localtime()\n"
13216 "localtime_r()\n"
13217 "lockf() [Added in POSIX.1-2008]\n"
13218 "lseek()\n"
13219 "lstat()\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"
13227 "mkstemp()\n"
13228 "mktime()\n"
13229 "nftw()\n"
13230 "opendir()\n"
13231 "openlog()\n"
13232 "pathconf()\n"
13233 "pclose()\n"
13234 "perror()\n"
13235 "popen()\n"
13236 "posix_fadvise()\n"
13237 "posix_fallocate()\n"
13238 "posix_madvise()\n"
13239 "posix_openpt()\n"
13240 "posix_spawn()\n"
13241 "posix_spawnp()\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"
13259 "printf()\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"
13266 "putc()\n"
13267 "putc_unlocked()\n"
13268 "putchar()\n"
13269 "putchar_unlocked()\n"
13270 "puts()\n"
13271 "pututxline()\n"
13272 "putwc()\n"
13273 "putwchar()\n"
13274 "readdir()\n"
13275 "readdir_r()\n"
13276 "readlink() [Added in POSIX.1-2008]\n"
13277 "readlinkat() [Added in POSIX.1-2008]\n"
13278 "remove()\n"
13279 "rename()\n"
13280 "renameat() [Added in POSIX.1-2008]\n"
13281 "rewind()\n"
13282 "rewinddir()\n"
13283 "scandir() [Added in POSIX.1-2008]\n"
13284 "scanf()\n"
13285 "seekdir()\n"
13286 "semop()\n"
13287 "setgrent()\n"
13288 "sethostent()\n"
13289 "setnetent()\n"
13290 "setprotoent()\n"
13291 "setpwent()\n"
13292 "setservent()\n"
13293 "setutxent()\n"
13294 "sigpause() [Added in POSIX.1-2008]\n"
13295 "stat()\n"
13296 "strerror()\n"
13297 "strerror_r()\n"
13298 "strftime()\n"
13299 "symlink()\n"
13300 "symlinkat() [Added in POSIX.1-2008]\n"
13301 "sync()\n"
13302 "syslog()\n"
13303 "tmpfile()\n"
13304 "tmpnam()\n"
13305 "ttyname()\n"
13306 "ttyname_r()\n"
13307 "tzset()\n"
13308 "ungetc()\n"
13309 "ungetwc()\n"
13310 "unlink()\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"
13316 "vfprintf()\n"
13317 "vfwprintf()\n"
13318 "vprintf()\n"
13319 "vwprintf()\n"
13320 "wcsftime()\n"
13321 "wordexp()\n"
13322 "wprintf()\n"
13323 "wscanf()\n"
13324 msgstr ""
13325 "access()\n"
13326 "asctime()\n"
13327 "asctime_r()\n"
13328 "catclose()\n"
13329 "catgets()\n"
13330 "catopen()\n"
13331 "chmod() [POSIX.1-2008 で追加された]\n"
13332 "chown() [POSIX.1-2008 で追加された]\n"
13333 "closedir()\n"
13334 "closelog()\n"
13335 "ctermid()\n"
13336 "ctime()\n"
13337 "ctime_r()\n"
13338 "dbm_close()\n"
13339 "dbm_delete()\n"
13340 "dbm_fetch()\n"
13341 "dbm_nextkey()\n"
13342 "dbm_open()\n"
13343 "dbm_store()\n"
13344 "dlclose()\n"
13345 "dlopen()\n"
13346 "dprintf() [POSIX.1-2008 で追加された]\n"
13347 "endgrent()\n"
13348 "endhostent()\n"
13349 "endnetent()\n"
13350 "endprotoent()\n"
13351 "endpwent()\n"
13352 "endservent()\n"
13353 "endutxent()\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"
13359 "fclose()\n"
13360 "fcntl() (cmd 引数が何であっても)\n"
13361 "fflush()\n"
13362 "fgetc()\n"
13363 "fgetpos()\n"
13364 "fgets()\n"
13365 "fgetwc()\n"
13366 "fgetws()\n"
13367 "fmtmsg()\n"
13368 "fopen()\n"
13369 "fpathconf()\n"
13370 "fprintf()\n"
13371 "fputc()\n"
13372 "fputs()\n"
13373 "fputwc()\n"
13374 "fputws()\n"
13375 "fread()\n"
13376 "freopen()\n"
13377 "fscanf()\n"
13378 "fseek()\n"
13379 "fseeko()\n"
13380 "fsetpos()\n"
13381 "fstat()\n"
13382 "fstatat() [POSIX.1-2008 で追加された]\n"
13383 "ftell()\n"
13384 "ftello()\n"
13385 "ftw()\n"
13386 "futimens() [POSIX.1-2008 で追加された]\n"
13387 "fwprintf()\n"
13388 "fwrite()\n"
13389 "fwscanf()\n"
13390 "getaddrinfo()\n"
13391 "getc()\n"
13392 "getc_unlocked()\n"
13393 "getchar()\n"
13394 "getchar_unlocked()\n"
13395 "getcwd()\n"
13396 "getdate()\n"
13397 "getdelim() [POSIX.1-2008 で追加された]\n"
13398 "getgrent()\n"
13399 "getgrgid()\n"
13400 "getgrgid_r()\n"
13401 "getgrnam()\n"
13402 "getgrnam_r()\n"
13403 "gethostbyaddr() [POSIX.1-2001 のみ (この関数は\n"
13404 "                 POSIX.1-2008 で削除されている)]\n"
13405 "gethostbyname() [POSIX.1-2001 のみ (この関数は\n"
13406 "                 POSIX.1-2008 で削除されている)]\n"
13407 "gethostent()\n"
13408 "gethostid()\n"
13409 "gethostname()\n"
13410 "getline() [POSIX.1-2008 で追加された]\n"
13411 "getlogin()\n"
13412 "getlogin_r()\n"
13413 "getnameinfo()\n"
13414 "getnetbyaddr()\n"
13415 "getnetbyname()\n"
13416 "getnetent()\n"
13417 "getopt() (opterr が 0 以外の場合)\n"
13418 "getprotobyname()\n"
13419 "getprotobynumber()\n"
13420 "getprotoent()\n"
13421 "getpwent()\n"
13422 "getpwnam()\n"
13423 "getpwnam_r()\n"
13424 "getpwuid()\n"
13425 "getpwuid_r()\n"
13426 "gets()\n"
13427 "getservbyname()\n"
13428 "getservbyport()\n"
13429 "getservent()\n"
13430 "getutxent()\n"
13431 "getutxid()\n"
13432 "getutxline()\n"
13433 "getwc()\n"
13434 "getwchar()\n"
13435 "getwd() [POSIX.1-2001 のみ (この関数は\n"
13436 "         POSIX.1-2008 で削除されている)]\n"
13437 "glob()\n"
13438 "iconv_close()\n"
13439 "iconv_open()\n"
13440 "ioctl()\n"
13441 "link()\n"
13442 "linkat() [POSIX.1-2008 で追加された]\n"
13443 "lio_listio() [POSIX.1-2008 で追加された]\n"
13444 "localtime()\n"
13445 "localtime_r()\n"
13446 "lockf() [POSIX.1-2008 で追加された]\n"
13447 "lseek()\n"
13448 "lstat()\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"
13456 "mkstemp()\n"
13457 "mktime()\n"
13458 "nftw()\n"
13459 "opendir()\n"
13460 "openlog()\n"
13461 "pathconf()\n"
13462 "pclose()\n"
13463 "perror()\n"
13464 "popen()\n"
13465 "posix_fadvise()\n"
13466 "posix_fallocate()\n"
13467 "posix_madvise()\n"
13468 "posix_openpt()\n"
13469 "posix_spawn()\n"
13470 "posix_spawnp()\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"
13488 "printf()\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"
13495 "putc()\n"
13496 "putc_unlocked()\n"
13497 "putchar()\n"
13498 "putchar_unlocked()\n"
13499 "puts()\n"
13500 "pututxline()\n"
13501 "putwc()\n"
13502 "putwchar()\n"
13503 "readdir()\n"
13504 "readdir_r()\n"
13505 "readlink() [POSIX.1-2008 で追加された]\n"
13506 "readlinkat() [POSIX.1-2008 で追加された]\n"
13507 "remove()\n"
13508 "rename()\n"
13509 "renameat() [POSIX.1-2008 で追加された]\n"
13510 "rewind()\n"
13511 "rewinddir()\n"
13512 "scandir() [POSIX.1-2008 で追加された]\n"
13513 "scanf()\n"
13514 "seekdir()\n"
13515 "semop()\n"
13516 "setgrent()\n"
13517 "sethostent()\n"
13518 "setnetent()\n"
13519 "setprotoent()\n"
13520 "setpwent()\n"
13521 "setservent()\n"
13522 "setutxent()\n"
13523 "sigpause() [POSIX.1-2008 で追加された]\n"
13524 "stat()\n"
13525 "strerror()\n"
13526 "strerror_r()\n"
13527 "strftime()\n"
13528 "symlink()\n"
13529 "symlinkat() [POSIX.1-2008 で追加された]\n"
13530 "sync()\n"
13531 "syslog()\n"
13532 "tmpfile()\n"
13533 "tmpnam()\n"
13534 "ttyname()\n"
13535 "ttyname_r()\n"
13536 "tzset()\n"
13537 "ungetc()\n"
13538 "ungetwc()\n"
13539 "unlink()\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"
13545 "vfprintf()\n"
13546 "vfwprintf()\n"
13547 "vprintf()\n"
13548 "vwprintf()\n"
13549 "wcsftime()\n"
13550 "wordexp()\n"
13551 "wprintf()\n"
13552 "wscanf()\n"
13553
13554 #. type: Plain text
13555 #: build/C/man7/pthreads.7:574
13556 msgid ""
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.)"
13561 msgstr ""
13562 "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすること"
13563 "も認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消し"
13564 "ポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの"
13565 "関数がこれに含まれる)。"
13566
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:
13570 #.  endnetgrent
13571 #.  endspent
13572 #.  epoll_pwait
13573 #.  epoll_wait
13574 #.  fcloseall
13575 #.  fdopendir
13576 #.  fflush_unlocked
13577 #.  fgetc_unlocked
13578 #.  fgetgrent
13579 #.  fgetgrent_r
13580 #.  fgetpwent
13581 #.  fgetpwent_r
13582 #.  fgets_unlocked
13583 #.  fgetspent
13584 #.  fgetspent_r
13585 #.  fgetwc_unlocked
13586 #.  fgetws_unlocked
13587 #.  fputc_unlocked
13588 #.  fputs_unlocked
13589 #.  fputwc_unlocked
13590 #.  fputws_unlocked
13591 #.  fread_unlocked
13592 #.  fwrite_unlocked
13593 #.  gai_suspend
13594 #.  getaddrinfo_a
13595 #.  getdate_r
13596 #.  getgrent_r
13597 #.  getgrouplist
13598 #.  gethostbyaddr_r
13599 #.  gethostbyname2
13600 #.  gethostbyname2_r
13601 #.  gethostbyname_r
13602 #.  gethostent_r
13603 #.  getnetbyaddr_r
13604 #.  getnetbyname_r
13605 #.  getnetent_r
13606 #.  getnetgrent
13607 #.  getnetgrent_r
13608 #.  getprotobyname_r
13609 #.  getprotobynumber_r
13610 #.  getprotoent_r
13611 #.  getpw
13612 #.  getpwent_r
13613 #.  getservbyname_r
13614 #.  getservbyport_r
13615 #.  getservent_r
13616 #.  getspent
13617 #.  getspent_r
13618 #.  getspnam
13619 #.  getspnam_r
13620 #.  getutmp
13621 #.  getutmpx
13622 #.  getw
13623 #.  getwc_unlocked
13624 #.  getwchar_unlocked
13625 #.  initgroups
13626 #.  innetgr
13627 #.  mkostemp
13628 #.  mkostemp64
13629 #.  mkstemp64
13630 #.  ppoll
13631 #.  pthread_timedjoin_np
13632 #.  putgrent
13633 #.  putpwent
13634 #.  putspent
13635 #.  putw
13636 #.  putwc_unlocked
13637 #.  putwchar_unlocked
13638 #.  rcmd
13639 #.  rcmd_af
13640 #.  rexec
13641 #.  rexec_af
13642 #.  rresvport
13643 #.  rresvport_af
13644 #.  ruserok
13645 #.  ruserok_af
13646 #.  setnetgrent
13647 #.  setspent
13648 #.  sgetspent
13649 #.  sgetspent_r
13650 #.  updwtmpx
13651 #.  utmpxname
13652 #.  vfscanf
13653 #.  vfwscanf
13654 #.  vscanf
13655 #.  vsyslog
13656 #.  vwscanf
13657 #. type: Plain text
13658 #: build/C/man7/pthreads.7:674
13659 msgid ""
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."
13667 msgstr ""
13668
13669 #. type: SS
13670 #: build/C/man7/pthreads.7:674
13671 #, no-wrap
13672 msgid "Compiling on Linux"
13673 msgstr "Linux でのコンパイル"
13674
13675 #. type: Plain text
13676 #: build/C/man7/pthreads.7:677
13677 msgid ""
13678 "On Linux, programs that use the Pthreads API should be compiled using I<cc -"
13679 "pthread>."
13680 msgstr ""
13681 "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべ"
13682 "きである。"
13683
13684 #. type: SS
13685 #: build/C/man7/pthreads.7:677
13686 #, no-wrap
13687 msgid "Linux implementations of POSIX threads"
13688 msgstr "POSIX スレッドの Linux での実装"
13689
13690 #. type: Plain text
13691 #: build/C/man7/pthreads.7:680
13692 msgid ""
13693 "Over time, two threading implementations have been provided by the GNU C "
13694 "library on Linux:"
13695 msgstr ""
13696 "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてき"
13697 "た。"
13698
13699 #. type: TP
13700 #: build/C/man7/pthreads.7:680
13701 #, no-wrap
13702 msgid "B<LinuxThreads>"
13703 msgstr "B<LinuxThreads>"
13704
13705 #. type: Plain text
13706 #: build/C/man7/pthreads.7:684
13707 msgid ""
13708 "This is the original Pthreads implementation.  Since glibc 2.4, this "
13709 "implementation is no longer supported."
13710 msgstr ""
13711 "最初の Pthreads の実装。\n"
13712 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
13713
13714 #. type: TP
13715 #: build/C/man7/pthreads.7:684
13716 #, no-wrap
13717 msgid "B<NPTL> (Native POSIX Threads Library)"
13718 msgstr "B<NPTL> (Native POSIX Threads Library)"
13719
13720 #. type: Plain text
13721 #: build/C/man7/pthreads.7:692
13722 msgid ""
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."
13728 msgstr ""
13729 "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様"
13730 "への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は "
13731 "glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実"
13732 "装されている機能が必要である。"
13733
13734 #. type: Plain text
13735 #: build/C/man7/pthreads.7:702
13736 msgid ""
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."
13742 msgstr ""
13743 "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケ"
13744 "ジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の "
13745 "B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機"
13746 "構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを"
13747 "使って実装されている。"
13748
13749 #. type: SS
13750 #: build/C/man7/pthreads.7:702
13751 #, no-wrap
13752 msgid "LinuxThreads"
13753 msgstr "LinuxThreads"
13754
13755 #. type: Plain text
13756 #: build/C/man7/pthreads.7:704
13757 msgid "The notable features of this implementation are the following:"
13758 msgstr "この実装の大きな特徴は以下の通りである:"
13759
13760 #. type: Plain text
13761 #: build/C/man7/pthreads.7:711
13762 msgid ""
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.)"
13767 msgstr ""
13768 "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って"
13769 "作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成され"
13770 "る。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり "
13771 "kill されると、問題が起こることがある)。"
13772
13773 #. type: Plain text
13774 #: build/C/man7/pthreads.7:723
13775 msgid ""
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."
13780 msgstr ""
13781 "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシ"
13782 "グナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルで"
13783 "は B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利"
13784 "用されているシグナルを どれも使わないようにしなければならない。"
13785
13786 #. type: Plain text
13787 #: build/C/man7/pthreads.7:730
13788 msgid ""
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)."
13793 msgstr ""
13794 "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常"
13795 "よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID "
13796 "を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  "
13797 "を使うと別のプロセスのように見える。"
13798
13799 #. type: Plain text
13800 #: build/C/man7/pthreads.7:733
13801 msgid ""
13802 "The LinuxThreads implementation deviates from the POSIX.1 specification in a "
13803 "number of ways, including the following:"
13804 msgstr ""
13805 "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に"
13806 "示すような点がある:"
13807
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)  を呼び出したときに、スレッド毎に異なる値が返される。"
13812
13813 #. type: Plain text
13814 #: build/C/man7/pthreads.7:746
13815 msgid ""
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."
13819 msgstr ""
13820 "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプ"
13821 "ロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合"
13822 "にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
13823
13824 #. type: Plain text
13825 #: build/C/man7/pthreads.7:756
13826 msgid ""
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."
13830 msgstr ""
13831 "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのス"
13832 "レッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実"
13833 "装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  でき"
13834 "る。"
13835
13836 #. type: Plain text
13837 #: build/C/man7/pthreads.7:763
13838 msgid ""
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 "
13842 "thread."
13843 msgstr ""
13844 "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される "
13845 "(POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだ"
13846 "スレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきであ"
13847 "る。"
13848
13849 #. type: Plain text
13850 #: build/C/man7/pthreads.7:770
13851 msgid ""
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."
13855 msgstr ""
13856 "スレッド間でユーザー ID とグループ ID が共有されない このことは、set-user-ID "
13857 "プログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを"
13858 "使って信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因とな"
13859 "る。"
13860
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 を共有しない。"
13865
13866 #. type: Plain text
13867 #: build/C/man7/pthreads.7:775
13868 msgid "Threads do not share record locks created using B<fcntl>(2)."
13869 msgstr ""
13870 "スレッド間で B<fcntl>(2)  を使って作成されるレコードロックを共有しない。"
13871
13872 #. type: Plain text
13873 #: build/C/man7/pthreads.7:781
13874 msgid ""
13875 "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread "
13876 "rather than process-wide."
13877 msgstr ""
13878 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
13879 "単位の情報である。"
13880
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)  参照) を共有しない。"
13885
13886 #. type: Plain text
13887 #: build/C/man7/pthreads.7:786
13888 msgid "Threads do not share interval timers."
13889 msgstr "スレッド間でインターバルタイマーを共有しない。"
13890
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 値を共有しない。"
13900
13901 #. type: Plain text
13902 #: build/C/man7/pthreads.7:798
13903 msgid ""
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."
13910 msgstr ""
13911 "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送ら"
13912 "れるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナ"
13913 "ル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝"
13914 "手に (arbitrarily) に選択された一つのスレッドにより処理される ことになってい"
13915 "る。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナ"
13916 "ルは特定のスレッドにだけ送ることができる。"
13917
13918 #. type: Plain text
13919 #: build/C/man7/pthreads.7:807
13920 msgid ""
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.)"
13927 msgstr ""
13928 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
13929 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
13930 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様で"
13931 "は、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべ"
13932 "きとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に "
13933 "シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
13934
13935 #. type: TH
13936 #: build/C/man7/pthreads.7:807 build/C/man7/nptl.7:26
13937 #, no-wrap
13938 msgid "NPTL"
13939 msgstr "NPTL"
13940
13941 #. type: Plain text
13942 #: build/C/man7/pthreads.7:812
13943 msgid ""
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) を利用しない。"
13948
13949 #. type: Plain text
13950 #: build/C/man7/pthreads.7:818
13951 msgid ""
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) を参照のこと。"
13955
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 に準拠していない点が少なくとも一つある:"
13960
13961 #. type: Plain text
13962 #: build/C/man7/pthreads.7:829
13963 msgid "Some NPTL nonconformances occur only with older kernels:"
13964 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
13965
13966 #. type: Plain text
13967 #: build/C/man7/pthreads.7:835
13968 msgid ""
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)."
13971 msgstr ""
13972 "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド"
13973 "単位の情報である (カーネル 2.6.9 で修正された)。"
13974
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 で修正された)。"
13979
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)."
13983 msgstr ""
13984 "スレッド間でインターバルタイマーを共有しない (カーネル 2.6.12 で修正された)。"
13985
13986 #. type: Plain text
13987 #: build/C/man7/pthreads.7:843
13988 msgid ""
13989 "Only the main thread is permitted to start a new session using B<setsid>(2)  "
13990 "(fixed in kernel 2.6.16)."
13991 msgstr ""
13992 "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することがで"
13993 "きる (カーネル 2.6.16 で修正された)。"
13994
13995 #. type: Plain text
13996 #: build/C/man7/pthreads.7:848
13997 msgid ""
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)."
14000 msgstr ""
14001 "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセスグループ"
14002 "リーダーにすることができる (カーネル 2.6.16 で修正された)。"
14003
14004 #. type: Plain text
14005 #: build/C/man7/pthreads.7:854
14006 msgid ""
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)."
14011 msgstr ""
14012 "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいス"
14013 "レッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピー"
14014 "され、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネ"
14015 "ル 2.6.16 で修正された)。"
14016
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 の実装では以下の点についても注意すること:"
14021
14022 #. type: Plain text
14023 #: build/C/man7/pthreads.7:870
14024 msgid ""
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)."
14031 msgstr ""
14032 "スタックサイズのリソースのソフトリミット (B<setrlimit>(2)  の "
14033 "B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、"
14034 "ソフトリミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設定"
14035 "を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなけれ"
14036 "ばならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルで"
14037 "は I<limit stacksize>)  を使って設定する。"
14038
14039 #. type: SS
14040 #: build/C/man7/pthreads.7:870
14041 #, no-wrap
14042 msgid "Determining the threading implementation"
14043 msgstr "スレッド実装の判定"
14044
14045 #. type: Plain text
14046 #: build/C/man7/pthreads.7:875
14047 msgid ""
14048 "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the "
14049 "system's threading implementation, for example:"
14050 msgstr ""
14051 "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実"
14052 "装を判定することができる。 以下に例を示す:"
14053
14054 #. type: Plain text
14055 #: build/C/man7/pthreads.7:880
14056 #, no-wrap
14057 msgid ""
14058 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
14059 "NPTL 2.3.4\n"
14060 msgstr ""
14061 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
14062 "NPTL 2.3.4\n"
14063
14064 #. type: Plain text
14065 #: build/C/man7/pthreads.7:885
14066 msgid ""
14067 "With older glibc versions, a command such as the following should be "
14068 "sufficient to determine the default threading implementation:"
14069 msgstr ""
14070 "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッ"
14071 "ド実装を判定することができる。"
14072
14073 #. type: Plain text
14074 #: build/C/man7/pthreads.7:891
14075 #, no-wrap
14076 msgid ""
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"
14080 msgstr ""
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"
14084
14085 #. type: SS
14086 #: build/C/man7/pthreads.7:893
14087 #, no-wrap
14088 msgid "Selecting the threading implementation: LD_ASSUME_KERNEL"
14089 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
14090
14091 #. type: Plain text
14092 #: build/C/man7/pthreads.7:908
14093 msgid ""
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.)  "
14102 "For example:"
14103 msgstr ""
14104 "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシ"
14105 "ステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカーがデフォル"
14106 "トで 選択するスレッド実装を上書きすることができる。 この変数により、動的リン"
14107 "カーが特定のバージョンのカーネル上で 動作していると仮定するように指定する。 "
14108 "NPTL が必要とするサポート機能を提供していないカーネルバージョンを 指定するこ"
14109 "とで、強制的に LinuxThreads を使うことができる (このようなことをする最もあり"
14110 "そうな場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリ"
14111 "ケーション を動作させる場合だろう)。 以下に例を示す:"
14112
14113 #. type: Plain text
14114 #: build/C/man7/pthreads.7:914
14115 #, no-wrap
14116 msgid ""
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"
14120 msgstr ""
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"
14124
14125 #. type: Plain text
14126 #: build/C/man7/pthreads.7:929
14127 msgid ""
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)"
14131
14132 #. type: Plain text
14133 #: build/C/man7/pthreads.7:958
14134 msgid ""
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)"
14147
14148 #. type: Plain text
14149 #: build/C/man7/attributes.7:27
14150 msgid "attributes - POSIX safety concepts"
14151 msgstr ""
14152
14153 #. type: Plain text
14154 #: build/C/man7/attributes.7:35
14155 msgid ""
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."
14159 msgstr ""
14160
14161 #. type: Plain text
14162 #: build/C/man7/attributes.7:39
14163 msgid ""
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:"
14167 msgstr ""
14168
14169 #. type: TP
14170 #: build/C/man7/attributes.7:39
14171 #, no-wrap
14172 msgid "I<MT-Safe>"
14173 msgstr "I<MT-Safe>"
14174
14175 #. type: Plain text
14176 #: build/C/man7/attributes.7:46
14177 msgid ""
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."
14180 msgstr ""
14181
14182 #. type: Plain text
14183 #: build/C/man7/attributes.7:55
14184 msgid ""
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."
14192 msgstr ""
14193
14194 #
14195 #
14196 #
14197 #.  .TP
14198 #.  .I AS-Safe
14199 #.  .I AS-Safe
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
14204 #.  .IR errno ,
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
14211 #.  preserve it.
14212 #.  Therefore, signal handlers that call functions that may set
14213 #.  .I errno
14214 #.  or modify the floating-point environment
14215 #.  .I must
14216 #.  save their original values, and restore them before returning.
14217 #.  .TP
14218 #.  .I AC-Safe
14219 #.  .I AC-Safe
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),
14226 #.  and
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
14242 msgid ""
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 "
14248 "inlining."
14249 msgstr ""
14250
14251 #.  ", " AS-Unsafe ", " AC-Unsafe
14252 #. type: TP
14253 #: build/C/man7/attributes.7:109
14254 #, no-wrap
14255 msgid "I<MT-Unsafe>"
14256 msgstr "I<MT-Unsafe>"
14257
14258 #
14259 #
14260 #
14261 #
14262 #
14263 #
14264 #.  ", " AS-Unsafe ", " AC-Unsafe
14265 #.  functions are not
14266 #.  safe to call within the safety contexts described above.
14267 #.  Calling them
14268 #.  within such contexts invokes undefined behavior.
14269 #.  Functions not explicitly documented as safe in a safety context should
14270 #.  be regarded as Unsafe.
14271 #.  .TP
14272 #.  .I Preliminary
14273 #.  .I Preliminary
14274 #.  safety properties are documented, indicating these
14275 #.  properties may
14276 #.  .I not
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
14286 #.  requirements.
14287 #.  The latter are most likely bugs; the former, when marked
14288 #.  as
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.
14293 #.  Furthermore,
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.
14305 #.  Over time,
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
14309 #.  .I Preliminary
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
14315 msgid ""
14316 "I<MT-Unsafe> functions are not safe to call in a multithreaded programs."
14317 msgstr ""
14318
14319 #
14320 #
14321 #
14322 #
14323 #
14324 #
14325 #
14326 #
14327 #
14328 #
14329 #
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
14337 #.  .\" enabled.
14338 #.  There are no MT-Unsafe marks in this section.
14339 #.  .TP
14340 #.  .\" .I code
14341 #.  Functions marked with
14342 #.  .I lock
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
14348 #.  .I lock
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.
14354 #.  .TP
14355 #.  .I corrupt
14356 #.  Functions marked with
14357 #.  .\" .I corrupt
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
14362 #.  .IR lock ,
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
14369 #.  .I corrupt
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
14387 #.  .TP
14388 #.  .I heap
14389 #.  Functions marked with
14390 #.  .I heap
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{}}}
14397 #.  .\"
14398 #.  .\" Check for cases that should have used plugin instead of or in
14399 #.  .\" addition to this.  Then, after rechecking gettext, adjust i18n if
14400 #.  .\" needed.
14401 #.  .TP
14402 #.  .I dlopen
14403 #.  Functions marked with
14404 #.  .I dlopen
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
14415 #.  .BR dlopen (3).
14416 #.  .\" dlopen runs init and fini sections of the module; does this mean
14417 #.  .\" dlopen always implies plugin?
14418 #.  .TP
14419 #.  .I plugin
14420 #.  Functions annotated with
14421 #.  .I plugin
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
14429 #.  of dlopen, the
14430 #.  .I plugin
14431 #.  keyword does not imply any direct
14432 #.  involvement of the dynamic loader or the
14433 #.  .I libdl
14434 #.  interfaces,
14435 #.  those are covered by
14436 #.  .IR dlopen .
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
14441 #.  .IR dlopen ,
14442 #.  whereas the latter will get the
14443 #.  .IR plugin .
14444 #.  When a single function takes all of these actions, then it gets both marks.
14445 #.  .TP
14446 #.  .I i18n
14447 #.  Functions marked with
14448 #.  .I i18n
14449 #.  may call internationalization
14450 #.  functions of the
14451 #.  .BR gettext (3)
14452 #.  family and will be only as safe as those
14453 #.  functions.
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{}}}
14457 #.  .TP
14458 #.  .I timer
14459 #.  Functions marked with
14460 #.  .I timer
14461 #.  use the
14462 #.  .BR alarm (3)
14463 #.  function or
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
14475 msgid ""
14476 "Other keywords that appear in safety notes are defined in subsequent "
14477 "sections."
14478 msgstr ""
14479
14480 #. type: SS
14481 #: build/C/man7/attributes.7:325
14482 #, no-wrap
14483 msgid "Conditionally safe features"
14484 msgstr ""
14485
14486 #. type: Plain text
14487 #: build/C/man7/attributes.7:337
14488 msgid ""
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."
14497 msgstr ""
14498
14499 #. type: TP
14500 #: build/C/man7/attributes.7:337
14501 #, no-wrap
14502 msgid "I<init>"
14503 msgstr "I<init>"
14504
14505 #. type: Plain text
14506 #: build/C/man7/attributes.7:343
14507 msgid ""
14508 "Functions marked with I<init> as an MT-Unsafe feature perform MT-Unsafe "
14509 "initialization when they are first called."
14510 msgstr ""
14511
14512 #
14513 #
14514 #
14515 #
14516 #
14517 #.  Functions marked with
14518 #.  .I init
14519 #.  as an AS-Unsafe or AC-Unsafe feature use the GNU C Library internal
14520 #.  .I libc_once
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
14524 #.  .I libc_once
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
14531 #.  .I init
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
14536 #.  .I libc_once
14537 #.  do not arise.
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
14544 msgid ""
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."
14549 msgstr ""
14550
14551 #. type: TP
14552 #: build/C/man7/attributes.7:378
14553 #, no-wrap
14554 msgid "I<race>"
14555 msgstr "I<race>"
14556
14557 #
14558 #
14559 #
14560 #
14561 #
14562 #
14563 #
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.
14576 #.  Standard I/O
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
14592 #.  .I not
14593 #.  give reason for functions to be annotated with
14594 #.  .IR race .
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.,
14601 #.  .IR FILE ,
14602 #.  .IR DIR ,
14603 #.  .IR obstack ,
14604 #.  .IR iconv_t ),
14605 #.  there might be additional expectations as to internal coordination
14606 #.  of access by the library.
14607 #.  We will annotate, with
14608 #.  .I race
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.
14612 #.  For example,
14613 #.  .I FILE
14614 #.  stream
14615 #.  .I unlocked
14616 #.  functions
14617 #.  .RB ( unlocked_stdio (3))
14618 #.  will be annotated,
14619 #.  but those that perform implicit locking on
14620 #.  .I FILE
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
14636 #.  .I race
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
14654 #.  by the caller.
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
14665 #.  .I race
14666 #.  notes.
14667 #. type: Plain text
14668 #: build/C/man7/attributes.7:499
14669 msgid ""
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."
14675 msgstr ""
14676
14677 #. type: TP
14678 #: build/C/man7/attributes.7:499
14679 #, no-wrap
14680 msgid "I<const>"
14681 msgstr "I<const>"
14682
14683 #.  and AS-Unsafe,
14684 #.  equally
14685 #.  and AS-Unsafe
14686 #.  and AS-Safe
14687 #. type: Plain text
14688 #: build/C/man7/attributes.7:520
14689 msgid ""
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."
14699 msgstr ""
14700
14701 #
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
14715 #.  .\" locale.
14716 #. type: Plain text
14717 #: build/C/man7/attributes.7:550
14718 msgid ""
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."
14725 msgstr ""
14726
14727 #. type: TP
14728 #: build/C/man7/attributes.7:550
14729 #, no-wrap
14730 msgid "I<sig>"
14731 msgstr "I<sig>"
14732
14733 #.  (that implies an identical AS-Safety issue, omitted for brevity)
14734 #. type: Plain text
14735 #: build/C/man7/attributes.7:559
14736 msgid ""
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."
14740 msgstr ""
14741
14742 #
14743 #
14744 #
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
14754 #.  .I and
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
14759 msgid ""
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."
14765 msgstr ""
14766
14767 #. type: TP
14768 #: build/C/man7/attributes.7:581
14769 #, no-wrap
14770 msgid "I<term>"
14771 msgstr "I<term>"
14772
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
14778 msgid ""
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-"
14783 "Unsafe."
14784 msgstr ""
14785
14786 #
14787 #
14788 #
14789 #.  Functions marked with
14790 #.  .I term
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
14800 #.  .I and
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
14806 msgid ""
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."
14815 msgstr ""
14816
14817 #. type: SS
14818 #: build/C/man7/attributes.7:632
14819 #, no-wrap
14820 msgid "Other safety remarks"
14821 msgstr ""
14822
14823 #. type: Plain text
14824 #: build/C/man7/attributes.7:636
14825 msgid ""
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:"
14829 msgstr ""
14830
14831 #. type: TP
14832 #: build/C/man7/attributes.7:636
14833 #, no-wrap
14834 msgid "I<locale>"
14835 msgstr "I<locale>"
14836
14837 #. type: Plain text
14838 #: build/C/man7/attributes.7:648
14839 msgid ""
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."
14845 msgstr ""
14846
14847 #.  or AS-Unsafe,
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
14862 msgid ""
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 "
14868 "safe."
14869 msgstr ""
14870
14871 #. type: TP
14872 #: build/C/man7/attributes.7:671
14873 #, no-wrap
14874 msgid "I<env>"
14875 msgstr "I<env>"
14876
14877 #. type: Plain text
14878 #: build/C/man7/attributes.7:680
14879 msgid ""
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."
14883 msgstr ""
14884
14885 #.  or AS-Unsafe,
14886 #. type: Plain text
14887 #: build/C/man7/attributes.7:691
14888 msgid ""
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 "
14894 "safe."
14895 msgstr ""
14896
14897 #. type: TP
14898 #: build/C/man7/attributes.7:691
14899 #, no-wrap
14900 msgid "I<hostid>"
14901 msgstr "I<hostid>"
14902
14903 #. type: Plain text
14904 #: build/C/man7/attributes.7:710
14905 msgid ""
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."
14915 msgstr ""
14916
14917 #. type: TP
14918 #: build/C/man7/attributes.7:710
14919 #, no-wrap
14920 msgid "I<sigintr>"
14921 msgstr "I<sigintr>"
14922
14923 #. type: Plain text
14924 #: build/C/man7/attributes.7:719
14925 msgid ""
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."
14929 msgstr ""
14930
14931 #
14932 #
14933 #
14934 #
14935 #
14936 #.  or AS-Unsafe,
14937 #.  .TP
14938 #.  .I fd
14939 #.  Functions annotated with
14940 #.  .I fd
14941 #.  as an AC-Safety issue may leak file
14942 #.  descriptors if asynchronous thread cancellation interrupts their
14943 #.  execution.
14944 #.  Functions that allocate or deallocate file descriptors will generally be
14945 #.  marked as such.
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.
14950 #.  Similarly,
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.
14963 #.  However,
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
14970 #.  AC-Unsafe.
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.
14976 #.  .TP
14977 #.  .I mem
14978 #.  Functions annotated with
14979 #.  .I mem
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
14995 msgid ""
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."
15002 msgstr ""
15003
15004 #. type: TP
15005 #: build/C/man7/attributes.7:792
15006 #, no-wrap
15007 msgid "I<cwd>"
15008 msgstr "I<cwd>"
15009
15010 #. type: Plain text
15011 #: build/C/man7/attributes.7:800
15012 msgid ""
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."
15017 msgstr ""
15018
15019 #
15020 #.  or AS-Unsafe,
15021 #.  .TP
15022 #.  .I !posix
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
15034 msgid ""
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."
15039 msgstr ""
15040
15041 #. type: TP
15042 #: build/C/man7/attributes.7:823
15043 #, no-wrap
15044 msgid "I<:identifier>"
15045 msgstr "I<:identifier>"
15046
15047 #. type: Plain text
15048 #: build/C/man7/attributes.7:839
15049 msgid ""
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."
15055 msgstr ""
15056
15057 #. type: Plain text
15058 #: build/C/man7/attributes.7:851
15059 msgid ""
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>."
15065 msgstr ""
15066
15067 #. type: Plain text
15068 #: build/C/man7/attributes.7:856
15069 msgid ""
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 "
15073 "context."
15074 msgstr ""
15075
15076 #. type: TP
15077 #: build/C/man7/attributes.7:856
15078 #, no-wrap
15079 msgid "I</condition>"
15080 msgstr "I</condition>"
15081
15082 #.  Such conditions as
15083 #.  .I /hurd
15084 #.  or
15085 #.  .I /!linux!bsd
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
15091 msgid ""
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."
15097 msgstr ""
15098
15099 #. type: Plain text
15100 #: build/C/man7/attributes.7:882
15101 msgid ""
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."
15105 msgstr ""
15106
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)"
15111
15112 #. type: Plain text
15113 #: build/C/man7/nptl.7:29
15114 #, fuzzy
15115 #| msgid "B<NPTL> (Native POSIX Threads Library)"
15116 msgid "nptl - Native POSIX Threads Library"
15117 msgstr "B<NPTL> (Native POSIX Threads Library)"
15118
15119 #. type: Plain text
15120 #: build/C/man7/nptl.7:34
15121 msgid ""
15122 "NPTL (Native POSIX Threads Library)  is the GNU C library POSIX threads "
15123 "implementation that is used on modern Linux systems."
15124 msgstr ""
15125
15126 #. type: SS
15127 #: build/C/man7/nptl.7:34
15128 #, no-wrap
15129 msgid "NPTL and signals"
15130 msgstr ""
15131
15132 #. type: Plain text
15133 #: build/C/man7/nptl.7:43
15134 msgid ""
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 "
15140 "applications."
15141 msgstr ""
15142
15143 #. type: Plain text
15144 #: build/C/man7/nptl.7:49
15145 msgid ""
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:"
15150 msgstr ""
15151
15152 #. type: Plain text
15153 #: build/C/man7/nptl.7:52
15154 msgid "B<SIGRTMIN> is defined with the value 34 (rather than 32)."
15155 msgstr ""
15156
15157 #. type: Plain text
15158 #: build/C/man7/nptl.7:60
15159 msgid ""
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."
15163 msgstr ""
15164
15165 #. type: Plain text
15166 #: build/C/man7/nptl.7:66
15167 msgid ""
15168 "The B<sigprocmask>(2)  and B<pthread_sigmask>(3)  interfaces silently ignore "
15169 "attempts to block these two signals."
15170 msgstr ""
15171
15172 #. type: Plain text
15173 #: build/C/man7/nptl.7:75
15174 msgid ""
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."
15178 msgstr ""
15179
15180 #. type: Plain text
15181 #: build/C/man7/nptl.7:79
15182 msgid ""
15183 "B<sigfillset>(3)  does not include these two signals when it creates a full "
15184 "signal set."
15185 msgstr ""
15186
15187 #. type: SS
15188 #: build/C/man7/nptl.7:79
15189 #, no-wrap
15190 msgid "NPTL and process credential changes"
15191 msgstr ""
15192
15193 #. type: Plain text
15194 #: build/C/man7/nptl.7:89
15195 msgid ""
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."
15203 msgstr ""
15204
15205 #. type: Plain text
15206 #: build/C/man7/nptl.7:99
15207 msgid ""
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."
15215 msgstr ""
15216
15217 #.  FIXME .
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
15222 msgid ""
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)."
15226 msgstr ""
15227
15228 #. type: Plain text
15229 #: build/C/man7/nptl.7:117
15230 #, fuzzy
15231 #| msgid ""
15232 #| "For details on the default stack size of new threads, see "
15233 #| "B<pthread_create>(3)."
15234 msgid ""
15235 "For details of the conformance of NPTL to the POSIX standard, see "
15236 "B<pthreads>(7)."
15237 msgstr ""
15238 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
15239 "B<pthread_create>(3) を参照。"
15240
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
15245 msgid ""
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."
15251 msgstr ""
15252
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)"
15257
15258 #~ msgid "Multithreading (see pthreads(7))"
15259 #~ msgstr "マルチスレッディング (pthreads(7) 参照)"
15260
15261 #~ msgid "For the type and the first two functions, see B<getcontext>(3)."
15262 #~ msgstr ""
15263 #~ "これらの型と、最初の 2 つの関数については、 B<getcontext>(3) を参照のこ"
15264 #~ "と。"
15265
15266 #~ msgid ""
15267 #~ "After a successful call to B<pthread_join>(), the caller is guaranteed "
15268 #~ "that the target thread has terminated."
15269 #~ msgstr ""
15270 #~ "B<pthread_join>() の呼び出しが成功した場合は、\n"
15271 #~ "呼び出し側には、対象スレッドが終了していることが保証される。"
15272
15273 #~ msgid ""
15274 #~ "This is intended as the write lock analog of "
15275 #~ "B<PTHREAD_RWLOCK_PREFER_READER_NP>.  But see BUGS."
15276 #~ msgstr ""
15277 #~ "これは B<PTHREAD_RWLOCK_PREFER_READER_NP> の書き込みロック版である。 ただ"
15278 #~ "し「バグ」を参照のこと。"
15279
15280 #~ msgid ""
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."
15288 #~ msgstr ""
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 #~ "が動作できるようになるが、変数名から分かるように、 書き込み側はロックを再"
15295 #~ "帰的に行うことはできない。"