OSDN Git Service

タイマ -> タイマー
[linuxjm/LDP_man-pages.git] / po4a / pthread / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2015-01-23 22:25+0900\n"
10 "PO-Revision-Date: 2015-01-25 07:23+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man3/getcontext.3:25
20 #, no-wrap
21 msgid "GETCONTEXT"
22 msgstr "GETCONTEXT"
23
24 #. type: TH
25 #: build/C/man3/getcontext.3:25
26 #, no-wrap
27 msgid "2014-04-08"
28 msgstr "2014-04-08"
29
30 #. type: TH
31 #: build/C/man3/getcontext.3:25 build/C/man3/pthread_attr_init.3:26
32 #: build/C/man3/pthread_attr_setaffinity_np.3:26
33 #: build/C/man3/pthread_attr_setdetachstate.3:26
34 #: build/C/man3/pthread_attr_setguardsize.3:26
35 #: build/C/man3/pthread_attr_setinheritsched.3:26
36 #: build/C/man3/pthread_attr_setschedparam.3:26
37 #: build/C/man3/pthread_attr_setschedpolicy.3:26
38 #: build/C/man3/pthread_attr_setscope.3:26
39 #: build/C/man3/pthread_attr_setstack.3:26
40 #: build/C/man3/pthread_attr_setstackaddr.3:26
41 #: build/C/man3/pthread_attr_setstacksize.3:26
42 #: build/C/man3/pthread_cancel.3:26 build/C/man3/pthread_cleanup_push.3:26
43 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
44 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_detach.3:26
45 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
46 #: build/C/man3/pthread_getattr_np.3:26
47 #: build/C/man3/pthread_getcpuclockid.3:26 build/C/man3/pthread_join.3:26
48 #: build/C/man3/pthread_kill.3:26
49 #: build/C/man3/pthread_kill_other_threads_np.3:26
50 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setaffinity_np.3:26
51 #: build/C/man3/pthread_setcancelstate.3:26
52 #: build/C/man3/pthread_setconcurrency.3:25
53 #: build/C/man3/pthread_setname_np.3:26
54 #: build/C/man3/pthread_setschedparam.3:26
55 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigmask.3:26
56 #: build/C/man3/pthread_sigqueue.3:25 build/C/man3/pthread_testcancel.3:26
57 #: build/C/man3/pthread_tryjoin_np.3:26 build/C/man3/pthread_yield.3:25
58 #: build/C/man7/pthreads.7:26
59 #, no-wrap
60 msgid "Linux"
61 msgstr "Linux"
62
63 #. type: TH
64 #: build/C/man3/getcontext.3:25 build/C/man3/makecontext.3:28
65 #: build/C/man3/pthread_attr_init.3:26
66 #: build/C/man3/pthread_attr_setaffinity_np.3:26
67 #: build/C/man3/pthread_attr_setdetachstate.3:26
68 #: build/C/man3/pthread_attr_setguardsize.3:26
69 #: build/C/man3/pthread_attr_setinheritsched.3:26
70 #: build/C/man3/pthread_attr_setschedparam.3:26
71 #: build/C/man3/pthread_attr_setschedpolicy.3:26
72 #: build/C/man3/pthread_attr_setscope.3:26
73 #: build/C/man3/pthread_attr_setstack.3:26
74 #: build/C/man3/pthread_attr_setstackaddr.3:26
75 #: build/C/man3/pthread_attr_setstacksize.3:26
76 #: build/C/man3/pthread_cancel.3:26 build/C/man3/pthread_cleanup_push.3:26
77 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
78 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_detach.3:26
79 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
80 #: build/C/man3/pthread_getattr_np.3:26
81 #: build/C/man3/pthread_getcpuclockid.3:26 build/C/man3/pthread_join.3:26
82 #: build/C/man3/pthread_kill.3:26
83 #: build/C/man3/pthread_kill_other_threads_np.3:26
84 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
85 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setaffinity_np.3:26
86 #: build/C/man3/pthread_setcancelstate.3:26
87 #: build/C/man3/pthread_setconcurrency.3:25
88 #: build/C/man3/pthread_setname_np.3:26
89 #: build/C/man3/pthread_setschedparam.3:26
90 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigmask.3:26
91 #: build/C/man3/pthread_sigqueue.3:25 build/C/man3/pthread_testcancel.3:26
92 #: build/C/man3/pthread_tryjoin_np.3:26 build/C/man3/pthread_yield.3:25
93 #: build/C/man7/pthreads.7:26
94 #, no-wrap
95 msgid "Linux Programmer's Manual"
96 msgstr "Linux Programmer's Manual"
97
98 #. type: SH
99 #: build/C/man3/getcontext.3:26 build/C/man3/makecontext.3:29
100 #: build/C/man3/pthread_attr_init.3:27
101 #: build/C/man3/pthread_attr_setaffinity_np.3:27
102 #: build/C/man3/pthread_attr_setdetachstate.3:27
103 #: build/C/man3/pthread_attr_setguardsize.3:27
104 #: build/C/man3/pthread_attr_setinheritsched.3:27
105 #: build/C/man3/pthread_attr_setschedparam.3:27
106 #: build/C/man3/pthread_attr_setschedpolicy.3:27
107 #: build/C/man3/pthread_attr_setscope.3:27
108 #: build/C/man3/pthread_attr_setstack.3:27
109 #: build/C/man3/pthread_attr_setstackaddr.3:27
110 #: build/C/man3/pthread_attr_setstacksize.3:27
111 #: build/C/man3/pthread_cancel.3:27 build/C/man3/pthread_cleanup_push.3:27
112 #: build/C/man3/pthread_cleanup_push_defer_np.3:27
113 #: build/C/man3/pthread_create.3:27 build/C/man3/pthread_detach.3:27
114 #: build/C/man3/pthread_equal.3:27 build/C/man3/pthread_exit.3:27
115 #: build/C/man3/pthread_getattr_np.3:27
116 #: build/C/man3/pthread_getcpuclockid.3:27 build/C/man3/pthread_join.3:27
117 #: build/C/man3/pthread_kill.3:27
118 #: build/C/man3/pthread_kill_other_threads_np.3:27
119 #: build/C/man3/pthread_rwlockattr_setkind_np.3:26
120 #: build/C/man3/pthread_self.3:27 build/C/man3/pthread_setaffinity_np.3:27
121 #: build/C/man3/pthread_setcancelstate.3:27
122 #: build/C/man3/pthread_setconcurrency.3:26
123 #: build/C/man3/pthread_setname_np.3:27
124 #: build/C/man3/pthread_setschedparam.3:27
125 #: build/C/man3/pthread_setschedprio.3:27 build/C/man3/pthread_sigmask.3:27
126 #: build/C/man3/pthread_sigqueue.3:26 build/C/man3/pthread_testcancel.3:27
127 #: build/C/man3/pthread_tryjoin_np.3:27 build/C/man3/pthread_yield.3:26
128 #: build/C/man7/pthreads.7:27
129 #, no-wrap
130 msgid "NAME"
131 msgstr "名前"
132
133 #. type: Plain text
134 #: build/C/man3/getcontext.3:28
135 msgid "getcontext, setcontext - get or set the user context"
136 msgstr "getcontext, setcontext - ユーザーコンテキストを取得/設定する"
137
138 #. type: SH
139 #: build/C/man3/getcontext.3:28 build/C/man3/makecontext.3:31
140 #: build/C/man3/pthread_attr_init.3:30
141 #: build/C/man3/pthread_attr_setaffinity_np.3:30
142 #: build/C/man3/pthread_attr_setdetachstate.3:30
143 #: build/C/man3/pthread_attr_setguardsize.3:30
144 #: build/C/man3/pthread_attr_setinheritsched.3:30
145 #: build/C/man3/pthread_attr_setschedparam.3:30
146 #: build/C/man3/pthread_attr_setschedpolicy.3:30
147 #: build/C/man3/pthread_attr_setscope.3:30
148 #: build/C/man3/pthread_attr_setstack.3:30
149 #: build/C/man3/pthread_attr_setstackaddr.3:30
150 #: build/C/man3/pthread_attr_setstacksize.3:30
151 #: build/C/man3/pthread_cancel.3:29 build/C/man3/pthread_cleanup_push.3:30
152 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
153 #: build/C/man3/pthread_create.3:29 build/C/man3/pthread_detach.3:29
154 #: build/C/man3/pthread_equal.3:29 build/C/man3/pthread_exit.3:29
155 #: build/C/man3/pthread_getattr_np.3:29
156 #: build/C/man3/pthread_getcpuclockid.3:29 build/C/man3/pthread_join.3:29
157 #: build/C/man3/pthread_kill.3:29
158 #: build/C/man3/pthread_kill_other_threads_np.3:29
159 #: build/C/man3/pthread_rwlockattr_setkind_np.3:29
160 #: build/C/man3/pthread_self.3:29 build/C/man3/pthread_setaffinity_np.3:30
161 #: build/C/man3/pthread_setcancelstate.3:30
162 #: build/C/man3/pthread_setconcurrency.3:29
163 #: build/C/man3/pthread_setname_np.3:29
164 #: build/C/man3/pthread_setschedparam.3:30
165 #: build/C/man3/pthread_setschedprio.3:29 build/C/man3/pthread_sigmask.3:29
166 #: build/C/man3/pthread_sigqueue.3:28 build/C/man3/pthread_testcancel.3:29
167 #: build/C/man3/pthread_tryjoin_np.3:30 build/C/man3/pthread_yield.3:28
168 #, no-wrap
169 msgid "SYNOPSIS"
170 msgstr "書式"
171
172 #. type: Plain text
173 #: build/C/man3/getcontext.3:30 build/C/man3/makecontext.3:33
174 msgid "B<#include E<lt>ucontext.hE<gt>>"
175 msgstr "B<#include E<lt>ucontext.hE<gt>>"
176
177 #. type: Plain text
178 #: build/C/man3/getcontext.3:32
179 msgid "B<int getcontext(ucontext_t *>I<ucp>B<);>"
180 msgstr "B<int getcontext(ucontext_t *>I<ucp>B<);>"
181
182 #. type: Plain text
183 #: build/C/man3/getcontext.3:34
184 msgid "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
185 msgstr "B<int setcontext(const ucontext_t *>I<ucp>B<);>"
186
187 #. type: SH
188 #: build/C/man3/getcontext.3:34 build/C/man3/makecontext.3:38
189 #: build/C/man3/pthread_attr_init.3:39
190 #: build/C/man3/pthread_attr_setaffinity_np.3:42
191 #: build/C/man3/pthread_attr_setdetachstate.3:41
192 #: build/C/man3/pthread_attr_setguardsize.3:41
193 #: build/C/man3/pthread_attr_setinheritsched.3:41
194 #: build/C/man3/pthread_attr_setschedparam.3:41
195 #: build/C/man3/pthread_attr_setschedpolicy.3:41
196 #: build/C/man3/pthread_attr_setscope.3:41
197 #: build/C/man3/pthread_attr_setstack.3:54
198 #: build/C/man3/pthread_attr_setstackaddr.3:41
199 #: build/C/man3/pthread_attr_setstacksize.3:41
200 #: build/C/man3/pthread_cancel.3:37 build/C/man3/pthread_cleanup_push.3:40
201 #: build/C/man3/pthread_cleanup_push_defer_np.3:53
202 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
203 #: build/C/man3/pthread_equal.3:37 build/C/man3/pthread_exit.3:37
204 #: build/C/man3/pthread_getattr_np.3:38
205 #: build/C/man3/pthread_getcpuclockid.3:38 build/C/man3/pthread_join.3:37
206 #: build/C/man3/pthread_kill.3:49
207 #: build/C/man3/pthread_kill_other_threads_np.3:35
208 #: build/C/man3/pthread_rwlockattr_setkind_np.3:54
209 #: build/C/man3/pthread_self.3:37 build/C/man3/pthread_setaffinity_np.3:42
210 #: build/C/man3/pthread_setcancelstate.3:39
211 #: build/C/man3/pthread_setconcurrency.3:38
212 #: build/C/man3/pthread_setname_np.3:39
213 #: build/C/man3/pthread_setschedparam.3:41
214 #: build/C/man3/pthread_setschedprio.3:37 build/C/man3/pthread_sigmask.3:50
215 #: build/C/man3/pthread_sigqueue.3:46 build/C/man3/pthread_testcancel.3:37
216 #: build/C/man3/pthread_tryjoin_np.3:42 build/C/man3/pthread_yield.3:37
217 #: build/C/man7/pthreads.7:29
218 #, no-wrap
219 msgid "DESCRIPTION"
220 msgstr "説明"
221
222 #. type: Plain text
223 #: build/C/man3/getcontext.3:49
224 msgid "In a System V-like environment, one has the two types I<mcontext_t> and I<ucontext_t> defined in I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(), B<setcontext>(), B<makecontext>(3), and B<swapcontext>(3)  that allow user-level context switching between multiple threads of control within a process."
225 msgstr "System V 的な環境では、 I<mcontext_t> および I<ucontext_t> という 2 つの型と、 B<getcontext>(), B<setcontext>(), B<makecontext>(3), B<swapcontext>(3)  という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内部で制御下にある複数のスレッド間で、 ユーザーレベルのコンテキスト切替えができるようになっている。"
226
227 #. type: Plain text
228 #: build/C/man3/getcontext.3:57
229 msgid "The I<mcontext_t> type is machine-dependent and opaque.  The I<ucontext_t> type is a structure that has at least the following fields:"
230 msgstr "I<mcontext_t> 型はマシン依存で、外部からは隠蔽されている。 I<ucontext_t> 型は構造体で、少なくとも以下の 4 つのフィールドを持つ。"
231
232 #. type: Plain text
233 #: build/C/man3/getcontext.3:67
234 #, no-wrap
235 msgid ""
236 "typedef struct ucontext {\n"
237 "    struct ucontext *uc_link;\n"
238 "    sigset_t         uc_sigmask;\n"
239 "    stack_t          uc_stack;\n"
240 "    mcontext_t       uc_mcontext;\n"
241 "    ...\n"
242 "} ucontext_t;\n"
243 msgstr ""
244 "typedef struct ucontext {\n"
245 "    struct ucontext *uc_link;\n"
246 "    sigset_t         uc_sigmask;\n"
247 "    stack_t          uc_stack;\n"
248 "    mcontext_t       uc_mcontext;\n"
249 "    ...\n"
250 "} ucontext_t;\n"
251
252 #. type: Plain text
253 #: build/C/man3/getcontext.3:94
254 msgid "with I<sigset_t> and I<stack_t> defined in I<E<lt>signal.hE<gt>>.  Here I<uc_link> points to the context that will be resumed when the current context terminates (in case the current context was created using B<makecontext>(3)), I<uc_sigmask> is the set of signals blocked in this context (see B<sigprocmask>(2)), I<uc_stack> is the stack used by this context (see B<sigaltstack>(2)), and I<uc_mcontext> is the machine-specific representation of the saved context, that includes the calling thread's machine registers."
255 msgstr "I<sigset_t> と I<stack_t> は I<E<lt>signal.hE<gt>> で定義されている。 ここで I<uc_link> は、 現在のコンテキストが終了したとき、 続いて切り替わるコンテキストへのポインターである (現在のコンテキストが B<makecontext>(3)  で生成されたものの場合)。 I<uc_sigmask> はこのコンテキストでブロックされている シグナル群である (B<sigprocmask>(2)  を見よ)。 I<uc_stack> はこのコンテキストが用いているスタックである (B<signalstack>(2)  を見よ)。 I<uc_mcontext> は保存されているコンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマシンレジスタが格納される。"
256
257 #. type: Plain text
258 #: build/C/man3/getcontext.3:101
259 msgid "The function B<getcontext>()  initializes the structure pointed at by I<ucp> to the currently active context."
260 msgstr "B<getcontext>()  関数は、 ポインター I<ucp> が指す構造体を、 現在アクティブなコンテキストに初期化する。"
261
262 #. type: Plain text
263 #: build/C/man3/getcontext.3:114
264 msgid "The function B<setcontext>()  restores the user context pointed at by I<ucp>.  A successful call does not return.  The context should have been obtained by a call of B<getcontext>(), or B<makecontext>(3), or passed as third argument to a signal handler."
265 msgstr "B<setcontext>()  関数は、ポインター I<ucp> が指すユーザーコンテキストをリストアする。 呼び出しに成功すると返らない。 このコンテキストは、以前に B<getcontext>()  または B<makecontext>(3)  で得られたものか、 あるいはシグナルの第三引数として与えられたものになる。"
266
267 #. type: Plain text
268 #: build/C/man3/getcontext.3:118
269 msgid "If the context was obtained by a call of B<getcontext>(), program execution continues as if this call just returned."
270 msgstr "コンテキストが B<getcontext>()  の呼び出しによって得られていたものの場合は、 プログラムはこの呼び出しから返った直後からのように実行を継続する。"
271
272 #. type: Plain text
273 #: build/C/man3/getcontext.3:135
274 msgid "If the context was obtained by a call of B<makecontext>(3), program execution continues by a call to the function I<func> specified as the second argument of that call to B<makecontext>(3).  When the function I<func> returns, we continue with the I<uc_link> member of the structure I<ucp> specified as the first argument of that call to B<makecontext>(3).  When this member is NULL, the thread exits."
275 msgstr "コンテキストが B<makecontext>(3)  の呼び出しによって得られていたものの場合は、 プログラムの実行はその B<makecontext>(3)  呼び出しの第二引数で指定された関数 I<func> を呼び出すかたちで継続する。 I<func> から返ると、 B<makecontext>(3)  呼び出しの第一引数で指定されていた I<ucp> 構造体の I<uc_link> メンバで継続する。 このメンバが NULL だった場合は、そのスレッドは終了する。"
276
277 #. type: Plain text
278 #: build/C/man3/getcontext.3:142
279 msgid "If the context was obtained by a call to a signal handler, then old standard text says that \"program execution continues with the program instruction following the instruction interrupted by the signal\".  However, this sentence was removed in SUSv2, and the present verdict is \"the result is unspecified\"."
280 msgstr "コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 古い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命令から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結果は定義されていない」である。"
281
282 #. type: SH
283 #: build/C/man3/getcontext.3:142 build/C/man3/makecontext.3:84
284 #: build/C/man3/pthread_attr_init.3:68
285 #: build/C/man3/pthread_attr_setaffinity_np.3:76
286 #: build/C/man3/pthread_attr_setdetachstate.3:77
287 #: build/C/man3/pthread_attr_setguardsize.3:90
288 #: build/C/man3/pthread_attr_setinheritsched.3:93
289 #: build/C/man3/pthread_attr_setschedparam.3:85
290 #: build/C/man3/pthread_attr_setschedpolicy.3:83
291 #: build/C/man3/pthread_attr_setscope.3:103
292 #: build/C/man3/pthread_attr_setstack.3:85
293 #: build/C/man3/pthread_attr_setstackaddr.3:74
294 #: build/C/man3/pthread_attr_setstacksize.3:61
295 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_cleanup_push.3:121
296 #: build/C/man3/pthread_create.3:115 build/C/man3/pthread_detach.3:49
297 #: build/C/man3/pthread_equal.3:41 build/C/man3/pthread_exit.3:71
298 #: build/C/man3/pthread_getattr_np.3:73
299 #: build/C/man3/pthread_getcpuclockid.3:46 build/C/man3/pthread_join.3:70
300 #: build/C/man3/pthread_kill.3:63
301 #: build/C/man3/pthread_rwlockattr_setkind_np.3:96
302 #: build/C/man3/pthread_self.3:46 build/C/man3/pthread_setaffinity_np.3:77
303 #: build/C/man3/pthread_setcancelstate.3:92
304 #: build/C/man3/pthread_setconcurrency.3:56
305 #: build/C/man3/pthread_setname_np.3:72
306 #: build/C/man3/pthread_setschedparam.3:104
307 #: build/C/man3/pthread_setschedprio.3:53 build/C/man3/pthread_sigmask.3:61
308 #: build/C/man3/pthread_sigqueue.3:66 build/C/man3/pthread_testcancel.3:50
309 #: build/C/man3/pthread_tryjoin_np.3:85 build/C/man3/pthread_yield.3:44
310 #, no-wrap
311 msgid "RETURN VALUE"
312 msgstr "返り値"
313
314 #. type: Plain text
315 #: build/C/man3/getcontext.3:151
316 msgid "When successful, B<getcontext>()  returns 0 and B<setcontext>()  does not return.  On error, both return -1 and set I<errno> appropriately."
317 msgstr "成功すると、 B<getcontext>()  は 0 を返し、 B<setcontext>()  は返らない。 失敗すると、両者とも -1 を返し、I<errno> をエラーに応じて設定する。"
318
319 #. type: SH
320 #: build/C/man3/getcontext.3:151 build/C/man3/makecontext.3:96
321 #: build/C/man3/pthread_attr_init.3:71
322 #: build/C/man3/pthread_attr_setaffinity_np.3:79
323 #: build/C/man3/pthread_attr_setdetachstate.3:80
324 #: build/C/man3/pthread_attr_setguardsize.3:93
325 #: build/C/man3/pthread_attr_setinheritsched.3:96
326 #: build/C/man3/pthread_attr_setschedparam.3:88
327 #: build/C/man3/pthread_attr_setschedpolicy.3:86
328 #: build/C/man3/pthread_attr_setscope.3:106
329 #: build/C/man3/pthread_attr_setstack.3:88
330 #: build/C/man3/pthread_attr_setstackaddr.3:77
331 #: build/C/man3/pthread_attr_setstacksize.3:64
332 #: build/C/man3/pthread_cancel.3:117 build/C/man3/pthread_cleanup_push.3:123
333 #: build/C/man3/pthread_create.3:122 build/C/man3/pthread_detach.3:54
334 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73
335 #: build/C/man3/pthread_getattr_np.3:76
336 #: build/C/man3/pthread_getcpuclockid.3:49 build/C/man3/pthread_join.3:75
337 #: build/C/man3/pthread_kill.3:68
338 #: build/C/man3/pthread_rwlockattr_setkind_np.3:104
339 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_setaffinity_np.3:80
340 #: build/C/man3/pthread_setcancelstate.3:95
341 #: build/C/man3/pthread_setconcurrency.3:68
342 #: build/C/man3/pthread_setname_np.3:75
343 #: build/C/man3/pthread_setschedparam.3:112
344 #: build/C/man3/pthread_setschedprio.3:61 build/C/man3/pthread_sigmask.3:66
345 #: build/C/man3/pthread_sigqueue.3:71 build/C/man3/pthread_testcancel.3:54
346 #: build/C/man3/pthread_tryjoin_np.3:89 build/C/man3/pthread_yield.3:49
347 #, no-wrap
348 msgid "ERRORS"
349 msgstr "エラー"
350
351 #. type: Plain text
352 #: build/C/man3/getcontext.3:153
353 msgid "None defined."
354 msgstr "定義されていない。"
355
356 #. type: SH
357 #: build/C/man3/getcontext.3:153 build/C/man3/makecontext.3:105
358 #: build/C/man3/pthread_attr_setdetachstate.3:87
359 #: build/C/man3/pthread_attr_setguardsize.3:106
360 #: build/C/man3/pthread_attr_setinheritsched.3:110
361 #: build/C/man3/pthread_attr_setschedparam.3:100
362 #: build/C/man3/pthread_attr_setschedpolicy.3:100
363 #: build/C/man3/pthread_attr_setscope.3:119
364 #: build/C/man3/pthread_attr_setstack.3:112
365 #: build/C/man3/pthread_attr_setstackaddr.3:83
366 #: build/C/man3/pthread_attr_setstacksize.3:83 build/C/man3/pthread_equal.3:47
367 #: build/C/man3/pthread_exit.3:75 build/C/man3/pthread_getcpuclockid.3:65
368 #: build/C/man3/pthread_kill.3:72
369 #: build/C/man3/pthread_kill_other_threads_np.3:47
370 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_setaffinity_np.3:121
371 #: build/C/man3/pthread_setcancelstate.3:113
372 #: build/C/man3/pthread_setconcurrency.3:83
373 #: build/C/man3/pthread_setschedparam.3:141
374 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:69
375 #: build/C/man3/pthread_sigqueue.3:94 build/C/man3/pthread_testcancel.3:58
376 #: build/C/man3/pthread_yield.3:53
377 #, no-wrap
378 msgid "ATTRIBUTES"
379 msgstr "属性"
380
381 #. type: SS
382 #: build/C/man3/getcontext.3:154 build/C/man3/makecontext.3:106
383 #: build/C/man3/pthread_attr_setdetachstate.3:88
384 #: build/C/man3/pthread_attr_setguardsize.3:107
385 #: build/C/man3/pthread_attr_setinheritsched.3:111
386 #: build/C/man3/pthread_attr_setschedparam.3:101
387 #: build/C/man3/pthread_attr_setschedpolicy.3:101
388 #: build/C/man3/pthread_attr_setscope.3:120
389 #: build/C/man3/pthread_attr_setstack.3:113
390 #: build/C/man3/pthread_attr_setstackaddr.3:84
391 #: build/C/man3/pthread_attr_setstacksize.3:84 build/C/man3/pthread_equal.3:48
392 #: build/C/man3/pthread_exit.3:76 build/C/man3/pthread_getcpuclockid.3:66
393 #: build/C/man3/pthread_kill.3:73
394 #: build/C/man3/pthread_kill_other_threads_np.3:48
395 #: build/C/man3/pthread_self.3:51 build/C/man3/pthread_setaffinity_np.3:122
396 #: build/C/man3/pthread_setcancelstate.3:114
397 #: build/C/man3/pthread_setconcurrency.3:84
398 #: build/C/man3/pthread_setschedparam.3:142
399 #: build/C/man3/pthread_setschedprio.3:84 build/C/man3/pthread_sigmask.3:70
400 #: build/C/man3/pthread_sigqueue.3:95 build/C/man3/pthread_testcancel.3:59
401 #: build/C/man3/pthread_yield.3:54
402 #, no-wrap
403 msgid "Multithreading (see pthreads(7))"
404 msgstr "マルチスレッディング (pthreads(7) 参照)"
405
406 #. type: Plain text
407 #: build/C/man3/getcontext.3:160
408 msgid "The B<getcontext>()  and B<setcontext>()  functions are thread-safe."
409 msgstr "関数 B<getcontext>() と B<setcontext>() はスレッドセーフである。"
410
411 #. type: SH
412 #: build/C/man3/getcontext.3:160 build/C/man3/makecontext.3:112
413 #: build/C/man3/pthread_attr_init.3:79
414 #: build/C/man3/pthread_attr_setaffinity_np.3:108
415 #: build/C/man3/pthread_attr_setdetachstate.3:94
416 #: build/C/man3/pthread_attr_setguardsize.3:113
417 #: build/C/man3/pthread_attr_setinheritsched.3:117
418 #: build/C/man3/pthread_attr_setschedparam.3:107
419 #: build/C/man3/pthread_attr_setschedpolicy.3:107
420 #: build/C/man3/pthread_attr_setscope.3:126
421 #: build/C/man3/pthread_attr_setstack.3:119
422 #: build/C/man3/pthread_attr_setstackaddr.3:90
423 #: build/C/man3/pthread_attr_setstacksize.3:90
424 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_cleanup_push.3:127
425 #: build/C/man3/pthread_cleanup_push_defer_np.3:114
426 #: build/C/man3/pthread_create.3:153 build/C/man3/pthread_detach.3:64
427 #: build/C/man3/pthread_equal.3:52 build/C/man3/pthread_exit.3:80
428 #: build/C/man3/pthread_getattr_np.3:98
429 #: build/C/man3/pthread_getcpuclockid.3:70 build/C/man3/pthread_join.3:98
430 #: build/C/man3/pthread_kill.3:77
431 #: build/C/man3/pthread_kill_other_threads_np.3:52
432 #: build/C/man3/pthread_rwlockattr_setkind_np.3:127
433 #: build/C/man3/pthread_self.3:55 build/C/man3/pthread_setaffinity_np.3:128
434 #: build/C/man3/pthread_setcancelstate.3:120
435 #: build/C/man3/pthread_setconcurrency.3:90
436 #: build/C/man3/pthread_setname_np.3:102
437 #: build/C/man3/pthread_setschedparam.3:148
438 #: build/C/man3/pthread_setschedprio.3:88 build/C/man3/pthread_sigmask.3:74
439 #: build/C/man3/pthread_sigqueue.3:99 build/C/man3/pthread_testcancel.3:63
440 #: build/C/man3/pthread_tryjoin_np.3:120 build/C/man3/pthread_yield.3:58
441 #, no-wrap
442 msgid "CONFORMING TO"
443 msgstr "準拠"
444
445 #. type: Plain text
446 #: build/C/man3/getcontext.3:166
447 msgid "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specification of B<getcontext>(), citing portability issues, and recommending that applications be rewritten to use POSIX threads instead."
448 msgstr "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<getcontext>()  の仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直すことが 推奨されている。"
449
450 #. type: SH
451 #: build/C/man3/getcontext.3:166 build/C/man3/makecontext.3:120
452 #: build/C/man3/pthread_attr_init.3:81
453 #: build/C/man3/pthread_attr_setaffinity_np.3:111
454 #: build/C/man3/pthread_attr_setdetachstate.3:96
455 #: build/C/man3/pthread_attr_setguardsize.3:115
456 #: build/C/man3/pthread_attr_setschedparam.3:109
457 #: build/C/man3/pthread_attr_setscope.3:128
458 #: build/C/man3/pthread_attr_setstack.3:121
459 #: build/C/man3/pthread_attr_setstackaddr.3:93
460 #: build/C/man3/pthread_attr_setstacksize.3:92
461 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129
462 #: build/C/man3/pthread_create.3:155 build/C/man3/pthread_detach.3:66
463 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82
464 #: build/C/man3/pthread_getcpuclockid.3:72 build/C/man3/pthread_join.3:100
465 #: build/C/man3/pthread_kill.3:79
466 #: build/C/man3/pthread_kill_other_threads_np.3:55
467 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setaffinity_np.3:131
468 #: build/C/man3/pthread_setcancelstate.3:122
469 #: build/C/man3/pthread_setconcurrency.3:92
470 #: build/C/man3/pthread_setname_np.3:104
471 #: build/C/man3/pthread_setschedparam.3:150
472 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
473 #: build/C/man3/pthread_yield.3:64
474 #, no-wrap
475 msgid "NOTES"
476 msgstr "注意"
477
478 #. type: Plain text
479 #: build/C/man3/getcontext.3:183
480 msgid "The earliest incarnation of this mechanism was the B<setjmp>(3)/B<longjmp>(3)  mechanism.  Since that does not define the handling of the signal context, the next stage was the B<sigsetjmp>(3)/B<siglongjmp>(3)  pair.  The present mechanism gives much more control.  On the other hand, there is no easy way to detect whether a return from B<getcontext>()  is from the first call, or via a B<setcontext>()  call.  The user has to invent her own bookkeeping device, and a register variable won't do since registers are restored."
481 msgstr "このメカニズムの最古の実装は、 B<setjmp>(3)/B<longjmp>(3)  機構であった。 これらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階では B<sigsetjmp>(3)/B<siglongjmp>(3)  のペアが現われた。 現在の機構ではずっと細かな制御ができる。 一方 B<getcontext>()  から返ったとき、 これが最初の呼び出しであったか、 それとも B<setcontext>()  呼び出しからのものであるかを 区別する容易な方法がなくなってしまった。 ユーザーは「しおり」機構を自分で作らなければならない。 レジスタ変数は (レジスタはリストアされてしまうので) これをやってくれない。"
482
483 #. type: Plain text
484 #: build/C/man3/getcontext.3:194
485 msgid "When a signal occurs, the current user context is saved and a new context is created by the kernel for the signal handler.  Do not leave the handler using B<longjmp>(3): it is undefined what would happen with contexts.  Use B<siglongjmp>(3)  or B<setcontext>()  instead."
486 msgstr "シグナルが発生すると、 現在のユーザーコンテキストは保存され、 シグナルハンドラ用のコンテキストがカーネルによって生成される。 今後はハンドラに B<longjmp>(3)  を使わせないこと: この関数のコンテキスト下での動作は定義されていない。 代わりに B<siglongjmp>(3)  か B<setcontext>()  を使うこと。"
487
488 #. type: SH
489 #: build/C/man3/getcontext.3:194 build/C/man3/makecontext.3:227
490 #: build/C/man3/pthread_attr_init.3:297
491 #: build/C/man3/pthread_attr_setaffinity_np.3:118
492 #: build/C/man3/pthread_attr_setdetachstate.3:118
493 #: build/C/man3/pthread_attr_setguardsize.3:165
494 #: build/C/man3/pthread_attr_setinheritsched.3:138
495 #: build/C/man3/pthread_attr_setschedparam.3:116
496 #: build/C/man3/pthread_attr_setschedpolicy.3:112
497 #: build/C/man3/pthread_attr_setscope.3:139
498 #: build/C/man3/pthread_attr_setstack.3:162
499 #: build/C/man3/pthread_attr_setstackaddr.3:117
500 #: build/C/man3/pthread_attr_setstacksize.3:118
501 #: build/C/man3/pthread_cancel.3:226 build/C/man3/pthread_cleanup_push.3:315
502 #: build/C/man3/pthread_cleanup_push_defer_np.3:117
503 #: build/C/man3/pthread_create.3:376 build/C/man3/pthread_detach.3:97
504 #: build/C/man3/pthread_equal.3:61 build/C/man3/pthread_exit.3:110
505 #: build/C/man3/pthread_getattr_np.3:345
506 #: build/C/man3/pthread_getcpuclockid.3:175 build/C/man3/pthread_join.3:127
507 #: build/C/man3/pthread_kill.3:99
508 #: build/C/man3/pthread_kill_other_threads_np.3:71
509 #: build/C/man3/pthread_rwlockattr_setkind_np.3:130
510 #: build/C/man3/pthread_self.3:81 build/C/man3/pthread_setaffinity_np.3:213
511 #: build/C/man3/pthread_setcancelstate.3:186
512 #: build/C/man3/pthread_setconcurrency.3:107
513 #: build/C/man3/pthread_setname_np.3:200
514 #: build/C/man3/pthread_setschedparam.3:440
515 #: build/C/man3/pthread_setschedprio.3:96 build/C/man3/pthread_sigmask.3:152
516 #: build/C/man3/pthread_sigqueue.3:101 build/C/man3/pthread_testcancel.3:68
517 #: build/C/man3/pthread_tryjoin_np.3:143 build/C/man3/pthread_yield.3:67
518 #: build/C/man7/pthreads.7:893
519 #, no-wrap
520 msgid "SEE ALSO"
521 msgstr "関連項目"
522
523 #. type: Plain text
524 #: build/C/man3/getcontext.3:201
525 msgid "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), B<makecontext>(3), B<sigsetjmp>(3)"
526 msgstr "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<longjmp>(3), B<makecontext>(3), B<sigsetjmp>(3)"
527
528 #. type: SH
529 #: build/C/man3/getcontext.3:201 build/C/man3/makecontext.3:233
530 #: build/C/man3/pthread_attr_init.3:313
531 #: build/C/man3/pthread_attr_setaffinity_np.3:124
532 #: build/C/man3/pthread_attr_setdetachstate.3:124
533 #: build/C/man3/pthread_attr_setguardsize.3:173
534 #: build/C/man3/pthread_attr_setinheritsched.3:150
535 #: build/C/man3/pthread_attr_setschedparam.3:128
536 #: build/C/man3/pthread_attr_setschedpolicy.3:123
537 #: build/C/man3/pthread_attr_setscope.3:149
538 #: build/C/man3/pthread_attr_setstack.3:174
539 #: build/C/man3/pthread_attr_setstackaddr.3:123
540 #: build/C/man3/pthread_attr_setstacksize.3:125
541 #: build/C/man3/pthread_cancel.3:238 build/C/man3/pthread_cleanup_push.3:321
542 #: build/C/man3/pthread_cleanup_push_defer_np.3:123
543 #: build/C/man3/pthread_create.3:389 build/C/man3/pthread_detach.3:104
544 #: build/C/man3/pthread_equal.3:65 build/C/man3/pthread_exit.3:114
545 #: build/C/man3/pthread_getattr_np.3:361
546 #: build/C/man3/pthread_getcpuclockid.3:183 build/C/man3/pthread_join.3:134
547 #: build/C/man3/pthread_kill.3:108
548 #: build/C/man3/pthread_kill_other_threads_np.3:77
549 #: build/C/man3/pthread_rwlockattr_setkind_np.3:132
550 #: build/C/man3/pthread_self.3:85 build/C/man3/pthread_setaffinity_np.3:221
551 #: build/C/man3/pthread_setcancelstate.3:191
552 #: build/C/man3/pthread_setconcurrency.3:110
553 #: build/C/man3/pthread_setname_np.3:206
554 #: build/C/man3/pthread_setschedparam.3:454
555 #: build/C/man3/pthread_setschedprio.3:110 build/C/man3/pthread_sigmask.3:161
556 #: build/C/man3/pthread_sigqueue.3:109 build/C/man3/pthread_testcancel.3:73
557 #: build/C/man3/pthread_tryjoin_np.3:148 build/C/man3/pthread_yield.3:71
558 #: build/C/man7/pthreads.7:927
559 #, no-wrap
560 msgid "COLOPHON"
561 msgstr "この文書について"
562
563 #. type: Plain text
564 #: build/C/man3/getcontext.3:209 build/C/man3/makecontext.3:241
565 #: build/C/man3/pthread_attr_init.3:321
566 #: build/C/man3/pthread_attr_setaffinity_np.3:132
567 #: build/C/man3/pthread_attr_setdetachstate.3:132
568 #: build/C/man3/pthread_attr_setguardsize.3:181
569 #: build/C/man3/pthread_attr_setinheritsched.3:158
570 #: build/C/man3/pthread_attr_setschedparam.3:136
571 #: build/C/man3/pthread_attr_setschedpolicy.3:131
572 #: build/C/man3/pthread_attr_setscope.3:157
573 #: build/C/man3/pthread_attr_setstack.3:182
574 #: build/C/man3/pthread_attr_setstackaddr.3:131
575 #: build/C/man3/pthread_attr_setstacksize.3:133
576 #: build/C/man3/pthread_cancel.3:246 build/C/man3/pthread_cleanup_push.3:329
577 #: build/C/man3/pthread_cleanup_push_defer_np.3:131
578 #: build/C/man3/pthread_create.3:397 build/C/man3/pthread_detach.3:112
579 #: build/C/man3/pthread_equal.3:73 build/C/man3/pthread_exit.3:122
580 #: build/C/man3/pthread_getattr_np.3:369
581 #: build/C/man3/pthread_getcpuclockid.3:191 build/C/man3/pthread_join.3:142
582 #: build/C/man3/pthread_kill.3:116
583 #: build/C/man3/pthread_kill_other_threads_np.3:85
584 #: build/C/man3/pthread_rwlockattr_setkind_np.3:140
585 #: build/C/man3/pthread_self.3:93 build/C/man3/pthread_setaffinity_np.3:229
586 #: build/C/man3/pthread_setcancelstate.3:199
587 #: build/C/man3/pthread_setconcurrency.3:118
588 #: build/C/man3/pthread_setname_np.3:214
589 #: build/C/man3/pthread_setschedparam.3:462
590 #: build/C/man3/pthread_setschedprio.3:118 build/C/man3/pthread_sigmask.3:169
591 #: build/C/man3/pthread_sigqueue.3:117 build/C/man3/pthread_testcancel.3:81
592 #: build/C/man3/pthread_tryjoin_np.3:156 build/C/man3/pthread_yield.3:79
593 #: build/C/man7/pthreads.7:935
594 msgid "This page is part of release 3.78 of the Linux I<man-pages> project.  A description of the project, information about reporting bugs, and the latest version of this page, can be found at \\%http://www.kernel.org/doc/man-pages/."
595 msgstr ""
596 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.78 の一部\n"
597 "である。プロジェクトの説明とバグ報告に関する情報は\n"
598 "http://www.kernel.org/doc/man-pages/ に書かれている。"
599
600 #. type: TH
601 #: build/C/man3/makecontext.3:28
602 #, no-wrap
603 msgid "MAKECONTEXT"
604 msgstr "MAKECONTEXT"
605
606 #. type: TH
607 #: build/C/man3/makecontext.3:28 build/C/man3/pthread_attr_setaffinity_np.3:26
608 #: build/C/man3/pthread_attr_setdetachstate.3:26
609 #: build/C/man3/pthread_attr_setguardsize.3:26
610 #: build/C/man3/pthread_attr_setscope.3:26
611 #: build/C/man3/pthread_attr_setstack.3:26
612 #: build/C/man3/pthread_attr_setstackaddr.3:26
613 #: build/C/man3/pthread_attr_setstacksize.3:26
614 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
615 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_setname_np.3:26
616 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigqueue.3:25
617 #, no-wrap
618 msgid "2014-05-28"
619 msgstr "2014-05-28"
620
621 #. type: TH
622 #: build/C/man3/makecontext.3:28
623 #, no-wrap
624 msgid "GNU"
625 msgstr "GNU"
626
627 #. type: Plain text
628 #: build/C/man3/makecontext.3:31
629 msgid "makecontext, swapcontext - manipulate user context"
630 msgstr "makecontext, swapcontext - ユーザーコンテキストを操作する"
631
632 #. type: Plain text
633 #: build/C/man3/makecontext.3:36
634 msgid "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int >I<argc>B<, ...);>"
635 msgstr "B<void makecontext(ucontext_t *>I<ucp>B<, void (*>I<func>B<)(),> B<int >I<argc>B<, ...);>"
636
637 #. type: Plain text
638 #: build/C/man3/makecontext.3:38
639 msgid "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
640 msgstr "B<int swapcontext(ucontext_t *>I<oucp>B<, const ucontext_t *>I<ucp>B<);>"
641
642 #. type: Plain text
643 #: build/C/man3/makecontext.3:49
644 msgid "In a System V-like environment, one has the type I<ucontext_t> defined in I<E<lt>ucontext.hE<gt>> and the four functions B<getcontext>(3), B<setcontext>(3), B<makecontext>()  and B<swapcontext>()  that allow user-level context switching between multiple threads of control within a process."
645 msgstr "System V 的な環境では、 B<mcontext_t> および B<ucontext_t> という 2 つの型と、 B<getcontext>(3), B<setcontext>(3), B<makecontext>(), B<swapcontext>()  という 4 つの関数が I<E<lt>ucontext.hE<gt>> で定義されており、あるプロセス内部で制御下にある複数のスレッド間で、 ユーザーレベルのコンテキスト切替えができるようになっている。"
646
647 #. type: Plain text
648 #: build/C/man3/makecontext.3:52
649 msgid "For the type and the first two functions, see B<getcontext>(3)."
650 msgstr "これらの型と、最初の 2 つの関数については、 B<getcontext>(3) を参照のこと。"
651
652 #. type: Plain text
653 #: build/C/man3/makecontext.3:64
654 msgid "The B<makecontext>()  function modifies the context pointed to by I<ucp> (which was obtained from a call to B<getcontext>(3)).  Before invoking B<makecontext>(), the caller must allocate a new stack for this context and assign its address to I<ucp-E<gt>uc_stack>, and define a successor context and assign its address to I<ucp-E<gt>uc_link>."
655 msgstr "B<makecontext>()  関数は、ポインター I<ucp> が指すコンテキストを変更する (I<ucp> は以前の B<getcontext>(3)  呼び出しで得られたものである)。 B<makecontext>()  を起動する前には、呼び出し者は、このコンテキスト用に 新しいスタックを確保し、そのアドレスを I<ucp-E<gt>uc_stack> に代入し、 さらに後継のコンテキストを定義し、そのアドレスを I<ucp-E<gt>uc_link> に 代入しなければならない。"
656
657 #. type: Plain text
658 #: build/C/man3/makecontext.3:78
659 msgid "When this context is later activated (using B<setcontext>(3)  or B<swapcontext>())  the function I<func> is called, and passed the series of integer (I<int>)  arguments that follow I<argc>; the caller must specify the number of these arguments in I<argc>.  When this function returns, the successor context is activated.  If the successor context pointer is NULL, the thread exits."
660 msgstr "このコンテキストが将来 (B<setcontext>(3)  または B<swapcontext>()  によって)  有効にされると、関数 I<func> が呼ばれ、 引き数として I<argc> 以降の整数 (I<int>)  引き数の列が渡される。 呼び出し者は I<argc> にこれらの引き数の個数を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効になる。 後継コンテキストのポインターが NULL の場合、そのスレッドが終了する。"
661
662 #. type: Plain text
663 #: build/C/man3/makecontext.3:84
664 msgid "The B<swapcontext>()  function saves the current context in the structure pointed to by I<oucp>, and then activates the context pointed to by I<ucp>."
665 msgstr "B<swapcontext>()  関数は現在のコンテキストを ポインター I<oucp> が指す構造体に保存し、 ポインター I<ucp> が指すコンテキストを有効にする。"
666
667 #. type: Plain text
668 #: build/C/man3/makecontext.3:96
669 msgid "When successful, B<swapcontext>()  does not return.  (But we may return later, in case I<oucp> is activated, in which case it looks like B<swapcontext>()  returns 0.)  On error, B<swapcontext>()  returns -1 and sets I<errno> appropriately."
670 msgstr "成功すると、 B<swapcontext>()  は返らない (しかし後に I<oucp> が有効になった場合には返ることがある。 このときには B<swapcontext>()  は 0 を返すように見える。)  失敗すると、 B<swapcontext>()  は -1 を返し、 I<errno> をエラーに応じて設定する。"
671
672 #. type: TP
673 #: build/C/man3/makecontext.3:97
674 #: build/C/man3/pthread_attr_setaffinity_np.3:102
675 #: build/C/man3/pthread_getattr_np.3:77
676 #, no-wrap
677 msgid "B<ENOMEM>"
678 msgstr "B<ENOMEM>"
679
680 #. type: Plain text
681 #: build/C/man3/makecontext.3:100
682 msgid "Insufficient stack space left."
683 msgstr "スタックに割り当てる空間が残っていない。"
684
685 #. type: SH
686 #: build/C/man3/makecontext.3:100
687 #: build/C/man3/pthread_attr_setaffinity_np.3:106
688 #: build/C/man3/pthread_attr_setguardsize.3:104
689 #: build/C/man3/pthread_attr_setstack.3:110
690 #: build/C/man3/pthread_attr_setstackaddr.3:81
691 #: build/C/man3/pthread_attr_setstacksize.3:81
692 #: build/C/man3/pthread_getattr_np.3:96
693 #: build/C/man3/pthread_getcpuclockid.3:63
694 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
695 #: build/C/man3/pthread_setaffinity_np.3:119
696 #: build/C/man3/pthread_setconcurrency.3:81
697 #: build/C/man3/pthread_setname_np.3:100
698 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigqueue.3:90
699 #: build/C/man3/pthread_tryjoin_np.3:118
700 #, no-wrap
701 msgid "VERSIONS"
702 msgstr "バージョン"
703
704 #. type: Plain text
705 #: build/C/man3/makecontext.3:105
706 msgid "B<makecontext>()  and B<swapcontext>()  are provided in glibc since version 2.1."
707 msgstr "B<makecontext>()  と B<swapcontext>()  は、バージョン 2.1 以降の glibc で提供されている。"
708
709 #. type: Plain text
710 #: build/C/man3/makecontext.3:112
711 msgid "The B<makecontext>()  and B<swapcontext>()  functions are thread-safe."
712 msgstr "関数 B<makecontext>() と B<swapcontext>() はスレッドセーフである。"
713
714 #. type: Plain text
715 #: build/C/man3/makecontext.3:120
716 msgid "SUSv2, POSIX.1-2001.  POSIX.1-2008 removes the specifications of B<makecontext>()  and B<swapcontext>(), citing portability issues, and recommending that applications be rewritten to use POSIX threads instead."
717 msgstr "SUSv2, POSIX.1-2001.  POSIX.1-2008 では、移植性の問題から B<makecontext>()  と B<swapcontext>()  の仕様が削除されている。 代わりに、アプリケーションを POSIX スレッドを使って書き直すことが 推奨されている。"
718
719 #. type: Plain text
720 #: build/C/man3/makecontext.3:128
721 msgid "The interpretation of I<ucp-E<gt>uc_stack> is just as in B<sigaltstack>(2), namely, this struct contains the start and length of a memory area to be used as the stack, regardless of the direction of growth of the stack.  Thus, it is not necessary for the user program to worry about this direction."
722 msgstr "I<ucp-E<gt>uc_stack> の解釈は B<sigaltstack>(2)  の場合と同じである。 すなわちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがって、ユーザープログラムはこの件については心配しなくてよい。"
723
724 #. type: Plain text
725 #: build/C/man3/makecontext.3:144
726 msgid "On architectures where I<int> and pointer types are the same size (e.g., x86-32, where both types are 32 bits), you may be able to get away with passing pointers as arguments to B<makecontext>()  following I<argc>.  However, doing this is not guaranteed to be portable, is undefined according to the standards, and won't work on architectures where pointers are larger than I<int>s.  Nevertheless, starting with version 2.8, glibc makes some changes to B<makecontext>(), to permit this on some 64-bit architectures (e.g., x86-64)."
727 msgstr "I<int> とポインター型が同じ大きさであるアーキテクチャーでは (x86-32 はその例であり、両方の型とも 32 ビットである)、 B<makecontext>()  の I<argc> 以降の引き数としてポインターを渡してもうまく動くかもしれない。 しかしながら、このようにすると、移植性は保証されず、 標準に従えば動作は未定義であり、ポインターが I<int> よりも大きいアーキテクチャーでは正しく動作しないことだろう。 それにも関わらず、バージョン 2.8 以降の glibc では、 B<makecontext>()  に変更が行われ、(x86-64 などの) いくつかの 64 ビットアーキテクチャーで 引き数としてポインターを渡すことができるようになっている。"
728
729 #. type: SH
730 #: build/C/man3/makecontext.3:144 build/C/man3/pthread_attr_init.3:87
731 #: build/C/man3/pthread_attr_setdetachstate.3:115
732 #: build/C/man3/pthread_attr_setguardsize.3:162
733 #: build/C/man3/pthread_attr_setinheritsched.3:135
734 #: build/C/man3/pthread_attr_setschedparam.3:113
735 #: build/C/man3/pthread_attr_setschedpolicy.3:109
736 #: build/C/man3/pthread_attr_setstack.3:159
737 #: build/C/man3/pthread_attr_setstacksize.3:115
738 #: build/C/man3/pthread_cancel.3:135 build/C/man3/pthread_cleanup_push.3:155
739 #: build/C/man3/pthread_create.3:209 build/C/man3/pthread_detach.3:93
740 #: build/C/man3/pthread_getattr_np.3:101
741 #: build/C/man3/pthread_getcpuclockid.3:83 build/C/man3/pthread_join.3:124
742 #: build/C/man3/pthread_setaffinity_np.3:161
743 #: build/C/man3/pthread_setcancelstate.3:183
744 #: build/C/man3/pthread_setname_np.3:114
745 #: build/C/man3/pthread_setschedparam.3:156 build/C/man3/pthread_sigmask.3:78
746 #: build/C/man3/pthread_testcancel.3:65 build/C/man3/pthread_tryjoin_np.3:123
747 #, no-wrap
748 msgid "EXAMPLE"
749 msgstr "例"
750
751 #. type: Plain text
752 #: build/C/man3/makecontext.3:152
753 msgid "The example program below demonstrates the use of B<getcontext>(3), B<makecontext>(), and B<swapcontext>().  Running the program produces the following output:"
754 msgstr "以下のサンプルプログラムは、 B<getcontext>(3), B<makecontext>(), B<swapcontext>()  の使用方法の例を示すものである。 このプログラムを実行すると、以下のような出力が得られる:"
755
756 #. type: Plain text
757 #: build/C/man3/makecontext.3:164
758 #, no-wrap
759 msgid ""
760 "$B< ./a.out>\n"
761 "main: swapcontext(&uctx_main, &uctx_func2)\n"
762 "func2: started\n"
763 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
764 "func1: started\n"
765 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
766 "func2: returning\n"
767 "func1: returning\n"
768 "main: exiting\n"
769 msgstr ""
770 "$B< ./a.out>\n"
771 "main: swapcontext(&uctx_main, &uctx_func2)\n"
772 "func2: started\n"
773 "func2: swapcontext(&uctx_func2, &uctx_func1)\n"
774 "func1: started\n"
775 "func1: swapcontext(&uctx_func1, &uctx_func2)\n"
776 "func2: returning\n"
777 "func1: returning\n"
778 "main: exiting\n"
779
780 #. type: SS
781 #: build/C/man3/makecontext.3:166 build/C/man3/pthread_attr_init.3:148
782 #: build/C/man3/pthread_cancel.3:151 build/C/man3/pthread_cleanup_push.3:231
783 #: build/C/man3/pthread_create.3:248 build/C/man3/pthread_getattr_np.3:179
784 #: build/C/man3/pthread_getcpuclockid.3:101
785 #: build/C/man3/pthread_setname_np.3:140
786 #: build/C/man3/pthread_setschedparam.3:231 build/C/man3/pthread_sigmask.3:96
787 #, no-wrap
788 msgid "Program source"
789 msgstr "プログラムのソース"
790
791 #. type: Plain text
792 #: build/C/man3/makecontext.3:172
793 #, no-wrap
794 msgid ""
795 "#include E<lt>ucontext.hE<gt>\n"
796 "#include E<lt>stdio.hE<gt>\n"
797 "#include E<lt>stdlib.hE<gt>\n"
798 msgstr ""
799 "#include E<lt>ucontext.hE<gt>\n"
800 "#include E<lt>stdio.hE<gt>\n"
801 "#include E<lt>stdlib.hE<gt>\n"
802
803 #. type: Plain text
804 #: build/C/man3/makecontext.3:174
805 #, no-wrap
806 msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
807 msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n"
808
809 #. type: Plain text
810 #: build/C/man3/makecontext.3:177
811 #, no-wrap
812 msgid ""
813 "#define handle_error(msg) \\e\n"
814 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
815 msgstr ""
816 "#define handle_error(msg) \\e\n"
817 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
818
819 #. type: Plain text
820 #: build/C/man3/makecontext.3:187
821 #, no-wrap
822 msgid ""
823 "static void\n"
824 "func1(void)\n"
825 "{\n"
826 "    printf(\"func1: started\\en\");\n"
827 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
828 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
829 "        handle_error(\"swapcontext\");\n"
830 "    printf(\"func1: returning\\en\");\n"
831 "}\n"
832 msgstr ""
833 "static void\n"
834 "func1(void)\n"
835 "{\n"
836 "    printf(\"func1: started\\en\");\n"
837 "    printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n"
838 "    if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n"
839 "        handle_error(\"swapcontext\");\n"
840 "    printf(\"func1: returning\\en\");\n"
841 "}\n"
842
843 #. type: Plain text
844 #: build/C/man3/makecontext.3:197
845 #, no-wrap
846 msgid ""
847 "static void\n"
848 "func2(void)\n"
849 "{\n"
850 "    printf(\"func2: started\\en\");\n"
851 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
852 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
853 "        handle_error(\"swapcontext\");\n"
854 "    printf(\"func2: returning\\en\");\n"
855 "}\n"
856 msgstr ""
857 "static void\n"
858 "func2(void)\n"
859 "{\n"
860 "    printf(\"func2: started\\en\");\n"
861 "    printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n"
862 "    if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n"
863 "        handle_error(\"swapcontext\");\n"
864 "    printf(\"func2: returning\\en\");\n"
865 "}\n"
866
867 #. type: Plain text
868 #: build/C/man3/makecontext.3:203
869 #, no-wrap
870 msgid ""
871 "int\n"
872 "main(int argc, char *argv[])\n"
873 "{\n"
874 "    char func1_stack[16384];\n"
875 "    char func2_stack[16384];\n"
876 msgstr ""
877 "int\n"
878 "main(int argc, char *argv[])\n"
879 "{\n"
880 "    char func1_stack[16384];\n"
881 "    char func2_stack[16384];\n"
882
883 #. type: Plain text
884 #: build/C/man3/makecontext.3:210
885 #, no-wrap
886 msgid ""
887 "    if (getcontext(&uctx_func1) == -1)\n"
888 "        handle_error(\"getcontext\");\n"
889 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
890 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
891 "    uctx_func1.uc_link = &uctx_main;\n"
892 "    makecontext(&uctx_func1, func1, 0);\n"
893 msgstr ""
894 "    if (getcontext(&uctx_func1) == -1)\n"
895 "        handle_error(\"getcontext\");\n"
896 "    uctx_func1.uc_stack.ss_sp = func1_stack;\n"
897 "    uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n"
898 "    uctx_func1.uc_link = &uctx_main;\n"
899 "    makecontext(&uctx_func1, func1, 0);\n"
900
901 #. type: Plain text
902 #: build/C/man3/makecontext.3:218
903 #, no-wrap
904 msgid ""
905 "    if (getcontext(&uctx_func2) == -1)\n"
906 "        handle_error(\"getcontext\");\n"
907 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
908 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
909 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
910 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
911 "    makecontext(&uctx_func2, func2, 0);\n"
912 msgstr ""
913 "    if (getcontext(&uctx_func2) == -1)\n"
914 "        handle_error(\"getcontext\");\n"
915 "    uctx_func2.uc_stack.ss_sp = func2_stack;\n"
916 "    uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n"
917 "    /* Successor context is f1(), unless argc E<gt> 1 */\n"
918 "    uctx_func2.uc_link = (argc E<gt> 1) ? NULL : &uctx_func1;\n"
919 "    makecontext(&uctx_func2, func2, 0);\n"
920
921 #. type: Plain text
922 #: build/C/man3/makecontext.3:222
923 #, no-wrap
924 msgid ""
925 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
926 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
927 "        handle_error(\"swapcontext\");\n"
928 msgstr ""
929 "    printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n"
930 "    if (swapcontext(&uctx_main, &uctx_func2) == -1)\n"
931 "        handle_error(\"swapcontext\");\n"
932
933 #. type: Plain text
934 #: build/C/man3/makecontext.3:226
935 #, no-wrap
936 msgid ""
937 "    printf(\"main: exiting\\en\");\n"
938 "    exit(EXIT_SUCCESS);\n"
939 "}\n"
940 msgstr ""
941 "    printf(\"main: exiting\\en\");\n"
942 "    exit(EXIT_SUCCESS);\n"
943 "}\n"
944
945 #. type: Plain text
946 #: build/C/man3/makecontext.3:233
947 msgid "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), B<sigsetjmp>(3)"
948 msgstr "B<sigaction>(2), B<sigaltstack>(2), B<sigprocmask>(2), B<getcontext>(3), B<sigsetjmp>(3)"
949
950 #. type: TH
951 #: build/C/man3/pthread_attr_init.3:26
952 #, no-wrap
953 msgid "PTHREAD_ATTR_INIT"
954 msgstr "PTHREAD_ATTR_INIT"
955
956 #. type: TH
957 #: build/C/man3/pthread_attr_init.3:26
958 #, no-wrap
959 msgid "2008-11-11"
960 msgstr "2008-11-11"
961
962 #. type: Plain text
963 #: build/C/man3/pthread_attr_init.3:30
964 msgid "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread attributes object"
965 msgstr ""
966 "pthread_attr_init, pthread_attr_destroy - \n"
967 "スレッド属性オブジェクトの初期化と破棄を行う"
968
969 #. type: Plain text
970 #: build/C/man3/pthread_attr_init.3:33
971 #: build/C/man3/pthread_attr_setdetachstate.3:33
972 #: build/C/man3/pthread_attr_setguardsize.3:33
973 #: build/C/man3/pthread_attr_setinheritsched.3:33
974 #: build/C/man3/pthread_attr_setschedparam.3:33
975 #: build/C/man3/pthread_attr_setschedpolicy.3:33
976 #: build/C/man3/pthread_attr_setscope.3:33
977 #: build/C/man3/pthread_attr_setstack.3:33
978 #: build/C/man3/pthread_attr_setstackaddr.3:33
979 #: build/C/man3/pthread_attr_setstacksize.3:33
980 #: build/C/man3/pthread_cancel.3:32 build/C/man3/pthread_cleanup_push.3:33
981 #: build/C/man3/pthread_cleanup_push_defer_np.3:33
982 #: build/C/man3/pthread_create.3:32 build/C/man3/pthread_detach.3:32
983 #: build/C/man3/pthread_equal.3:32 build/C/man3/pthread_exit.3:32
984 #: build/C/man3/pthread_join.3:32
985 #: build/C/man3/pthread_kill_other_threads_np.3:32
986 #: build/C/man3/pthread_rwlockattr_setkind_np.3:32
987 #: build/C/man3/pthread_self.3:32 build/C/man3/pthread_setcancelstate.3:33
988 #: build/C/man3/pthread_setconcurrency.3:32
989 #: build/C/man3/pthread_setschedparam.3:33
990 #: build/C/man3/pthread_setschedprio.3:32 build/C/man3/pthread_testcancel.3:32
991 #, no-wrap
992 msgid "B<#include E<lt>pthread.hE<gt>>\n"
993 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
994
995 #. type: Plain text
996 #: build/C/man3/pthread_attr_init.3:36
997 #, no-wrap
998 msgid ""
999 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1000 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1001 msgstr ""
1002 "B<int pthread_attr_init(pthread_attr_t *>I<attr>B<);>\n"
1003 "B<int pthread_attr_destroy(pthread_attr_t *>I<attr>B<);>\n"
1004
1005 #. type: Plain text
1006 #: build/C/man3/pthread_attr_init.3:38
1007 #: build/C/man3/pthread_attr_setaffinity_np.3:41
1008 #: build/C/man3/pthread_attr_setdetachstate.3:40
1009 #: build/C/man3/pthread_attr_setguardsize.3:40
1010 #: build/C/man3/pthread_attr_setinheritsched.3:40
1011 #: build/C/man3/pthread_attr_setschedparam.3:40
1012 #: build/C/man3/pthread_attr_setschedpolicy.3:40
1013 #: build/C/man3/pthread_attr_setscope.3:40
1014 #: build/C/man3/pthread_attr_setstack.3:40
1015 #: build/C/man3/pthread_attr_setstackaddr.3:40
1016 #: build/C/man3/pthread_attr_setstacksize.3:40
1017 #: build/C/man3/pthread_cancel.3:36 build/C/man3/pthread_cleanup_push.3:39
1018 #: build/C/man3/pthread_equal.3:36 build/C/man3/pthread_exit.3:36
1019 #: build/C/man3/pthread_getattr_np.3:37
1020 #: build/C/man3/pthread_getcpuclockid.3:37
1021 #: build/C/man3/pthread_rwlockattr_setkind_np.3:39
1022 #: build/C/man3/pthread_self.3:36 build/C/man3/pthread_setaffinity_np.3:41
1023 #: build/C/man3/pthread_setcancelstate.3:38
1024 #: build/C/man3/pthread_setconcurrency.3:37
1025 #: build/C/man3/pthread_setschedparam.3:40
1026 #: build/C/man3/pthread_setschedprio.3:36 build/C/man3/pthread_testcancel.3:36
1027 #, no-wrap
1028 msgid "Compile and link with I<-pthread>.\n"
1029 msgstr "I<-pthread> でコンパイルしてリンクする。\n"
1030
1031 #. type: Plain text
1032 #: build/C/man3/pthread_attr_init.3:50
1033 msgid "The B<pthread_attr_init>()  function initializes the thread attributes object pointed to by I<attr> with default attribute values.  After this call, individual attributes of the object can be set using various related functions (listed under SEE ALSO), and then the object can be used in one or more B<pthread_create>(3)  calls that create threads."
1034 msgstr ""
1035 "B<pthread_attr_init>() 関数は I<attr> が指すスレッド属性オブジェクト\n"
1036 "(thread attributes object) をデフォルトの属性値で初期化する。\n"
1037 "この呼び出しの後、オブジェクトの各属性は (関連項目に載っている) 種々の\n"
1038 "関数を使って設定することができ、このオブジェクトはスレッドの作成を行う\n"
1039 "B<pthread_create>(3) の呼び出しにおいて使用することができる (一つの\n"
1040 "オブジェクトを複数の B<pthread_create>(3) に渡してもよい)。"
1041
1042 #. type: Plain text
1043 #: build/C/man3/pthread_attr_init.3:55
1044 msgid "Calling B<pthread_attr_init>()  on a thread attributes object that has already been initialized results in undefined behavior."
1045 msgstr ""
1046 "すでに初期化されているスレッド属性オブジェクトに対して\n"
1047 "B<pthread_attr_init>() を呼び出した場合、\n"
1048 "どのような動作になるかは不定である。"
1049
1050 #. type: Plain text
1051 #: build/C/man3/pthread_attr_init.3:62
1052 msgid "When a thread attributes object is no longer required, it should be destroyed using the B<pthread_attr_destroy>()  function.  Destroying a thread attributes object has no effect on threads that were created using that object."
1053 msgstr ""
1054 "スレッド属性オブジェクトがもはや必要なくなった際には、\n"
1055 "そのオブジェクトは B<pthread_attr_destroy>() 関数を使って破棄すべきである。\n"
1056 "スレッド属性オブジェクトを破棄しても、\n"
1057 "そのオブジェクトを使って作成されたスレッドには影響はない。"
1058
1059 #. type: Plain text
1060 #: build/C/man3/pthread_attr_init.3:68
1061 msgid "Once a thread attributes object has been destroyed, it can be reinitialized using B<pthread_attr_init>().  Any other use of a destroyed thread attributes object has undefined results."
1062 msgstr ""
1063 "いったん破棄したスレッド属性オブジェクトは、\n"
1064 "B<pthread_attr_init>() を使って再初期化することができる。\n"
1065 "破棄したスレッド属性オブジェクトをこれ以外の用途で\n"
1066 "使った場合の結果は不定である。"
1067
1068 #. type: Plain text
1069 #: build/C/man3/pthread_attr_init.3:71
1070 #: build/C/man3/pthread_attr_setaffinity_np.3:79
1071 #: build/C/man3/pthread_attr_setdetachstate.3:80
1072 #: build/C/man3/pthread_attr_setguardsize.3:93
1073 #: build/C/man3/pthread_attr_setinheritsched.3:96
1074 #: build/C/man3/pthread_attr_setschedparam.3:88
1075 #: build/C/man3/pthread_attr_setschedpolicy.3:86
1076 #: build/C/man3/pthread_attr_setscope.3:106
1077 #: build/C/man3/pthread_attr_setstack.3:88
1078 #: build/C/man3/pthread_attr_setstackaddr.3:77
1079 #: build/C/man3/pthread_attr_setstacksize.3:64
1080 #: build/C/man3/pthread_setaffinity_np.3:80
1081 #: build/C/man3/pthread_setcancelstate.3:95
1082 #: build/C/man3/pthread_setname_np.3:75
1083 msgid "On success, these functions return 0; on error, they return a nonzero error number."
1084 msgstr ""
1085 "成功すると、これらの関数は 0 を返す。\n"
1086 "エラーの場合、0 以外のエラー番号を返す。"
1087
1088 #. type: Plain text
1089 #: build/C/man3/pthread_attr_init.3:79
1090 msgid "POSIX.1-2001 documents an B<ENOMEM> error for B<pthread_attr_init>(); on Linux these functions always succeed (but portable and future-proof applications should nevertheless handle a possible error return)."
1091 msgstr ""
1092 "POSIX.1-2001 では B<pthread_attr_init>() にはエラー B<ENOMEM> が\n"
1093 "記載されている。\n"
1094 "Linux では、これらの関数は常に成功する\n"
1095 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
1096 "正のエラーの返り値を処理するようにすべきである)。"
1097
1098 #. type: Plain text
1099 #: build/C/man3/pthread_attr_init.3:81
1100 #: build/C/man3/pthread_attr_setdetachstate.3:96
1101 #: build/C/man3/pthread_attr_setguardsize.3:115
1102 #: build/C/man3/pthread_attr_setinheritsched.3:119
1103 #: build/C/man3/pthread_attr_setschedparam.3:109
1104 #: build/C/man3/pthread_attr_setschedpolicy.3:109
1105 #: build/C/man3/pthread_attr_setscope.3:128
1106 #: build/C/man3/pthread_attr_setstack.3:121
1107 #: build/C/man3/pthread_attr_setstacksize.3:92
1108 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129
1109 #: build/C/man3/pthread_create.3:155 build/C/man3/pthread_detach.3:66
1110 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82
1111 #: build/C/man3/pthread_getcpuclockid.3:72 build/C/man3/pthread_join.3:100
1112 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setcancelstate.3:122
1113 #: build/C/man3/pthread_setconcurrency.3:92
1114 #: build/C/man3/pthread_setschedparam.3:150
1115 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76
1116 #: build/C/man3/pthread_testcancel.3:65
1117 msgid "POSIX.1-2001."
1118 msgstr "POSIX.1-2001."
1119
1120 #. type: Plain text
1121 #: build/C/man3/pthread_attr_init.3:87
1122 msgid "The I<pthread_attr_t> type should be treated as opaque: any access to the object other than via pthreads functions is nonportable and produces undefined results."
1123 msgstr ""
1124 "I<pthread_attr_t> 型の内部構造は意識すべきではない。\n"
1125 "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n"
1126 "どのような結果が得られるかも分からない。"
1127
1128 #. type: Plain text
1129 #: build/C/man3/pthread_attr_init.3:96
1130 msgid "The program below optionally makes use of B<pthread_attr_init>()  and various related functions to initialize a thread attributes object that is used to create a single thread.  Once created, the thread uses the B<pthread_getattr_np>(3)  function (a nonstandard GNU extension) to retrieve the thread's attributes, and then displays those attributes."
1131 msgstr ""
1132 "下記のプログラムは、B<pthread_attr_init>() と種々の関連関数を使って、\n"
1133 "スレッド属性オブジェクトの初期化を行い、\n"
1134 "そのオブジェクトを使ってスレッドを一つ作成する。\n"
1135 "作成されたスレッドは、作成後に B<pthread_getattr_np>(3) 関数 \n"
1136 "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n"
1137 "取得した属性を表示する。"
1138
1139 #. type: Plain text
1140 #: build/C/man3/pthread_attr_init.3:105
1141 msgid "If the program is run with no command-line argument, then it passes NULL as the I<attr> argument of B<pthread_create>(3), so that the thread is created with default attributes.  Running the program on Linux/x86-32 with the NPTL threading implementation, we see the following:"
1142 msgstr ""
1143 "コマンドライン引き数なしでプログラムを実行した場合、\n"
1144 "B<pthread_create>(3) の I<attr> 引き数には NULL が渡される。\n"
1145 "この場合、スレッドはデフォルトの属性で作成される。\n"
1146 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1147 "動作させると、以下のような出力が得られる。"
1148
1149 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1150 #. type: Plain text
1151 #: build/C/man3/pthread_attr_init.3:121
1152 #, no-wrap
1153 msgid ""
1154 "$B< ulimit -s>       # No stack limit ==E<gt> default stack size is 2MB\n"
1155 "unlimited\n"
1156 "$B< ./a.out>\n"
1157 "Thread attributes:\n"
1158 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1159 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1160 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1161 "        Scheduling policy   = SCHED_OTHER\n"
1162 "        Scheduling priority = 0\n"
1163 "        Guard size          = 4096 bytes\n"
1164 "        Stack address       = 0x40196000\n"
1165 "        Stack size          = 0x201000 bytes\n"
1166 msgstr ""
1167 "$B< ulimit -s>       # No stack limit ==E<gt> default stack size is 2MB\n"
1168 "unlimited\n"
1169 "$B< ./a.out>\n"
1170 "Thread attributes:\n"
1171 "        Detach state        = PTHREAD_CREATE_JOINABLE\n"
1172 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1173 "        Inherit scheduler   = PTHREAD_INHERIT_SCHED\n"
1174 "        Scheduling policy   = SCHED_OTHER\n"
1175 "        Scheduling priority = 0\n"
1176 "        Guard size          = 4096 bytes\n"
1177 "        Stack address       = 0x40196000\n"
1178 "        Stack size          = 0x201000 bytes\n"
1179
1180 #. type: Plain text
1181 #: build/C/man3/pthread_attr_init.3:131
1182 msgid "When we supply a stack size as a command-line argument, the program initializes a thread attributes object, sets various attributes in that object, and passes a pointer to the object in the call to B<pthread_create>(3).  Running the program on Linux/x86-32 with the NPTL threading implementation, we see the following:"
1183 msgstr ""
1184 "コマンドライン引き数でスタックサイズが与えられた場合、\n"
1185 "このプログラムは、スレッド属性オブジェクトを初期化し、\n"
1186 "そのオブジェクトの各種属性を設定し、\n"
1187 "B<pthread_create>(3) の呼び出しでこのオブジェクトへのポインターを渡す。\n"
1188 "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n"
1189 "動作させると、以下のような出力が得られる。"
1190
1191 #.  Results from glibc 2.8, SUSE 11.0; Oct 2008
1192 #. type: Plain text
1193 #: build/C/man3/pthread_attr_init.3:146
1194 #, no-wrap
1195 msgid ""
1196 "$B< ./a.out 0x3000000>\n"
1197 "posix_memalign() allocated at 0x40197000\n"
1198 "Thread attributes:\n"
1199 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1200 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1201 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1202 "        Scheduling policy   = SCHED_OTHER\n"
1203 "        Scheduling priority = 0\n"
1204 "        Guard size          = 0 bytes\n"
1205 "        Stack address       = 0x40197000\n"
1206 "        Stack size          = 0x3000000 bytes\n"
1207 msgstr ""
1208 "$B< ./a.out 0x3000000>\n"
1209 "posix_memalign() allocated at 0x40197000\n"
1210 "Thread attributes:\n"
1211 "        Detach state        = PTHREAD_CREATE_DETACHED\n"
1212 "        Scope               = PTHREAD_SCOPE_SYSTEM\n"
1213 "        Inherit scheduler   = PTHREAD_EXPLICIT_SCHED\n"
1214 "        Scheduling policy   = SCHED_OTHER\n"
1215 "        Scheduling priority = 0\n"
1216 "        Guard size          = 0 bytes\n"
1217 "        Stack address       = 0x40197000\n"
1218 "        Stack size          = 0x3000000 bytes\n"
1219
1220 #. type: Plain text
1221 #: build/C/man3/pthread_attr_init.3:157 build/C/man3/pthread_getattr_np.3:188
1222 #, no-wrap
1223 msgid ""
1224 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1225 "#include E<lt>pthread.hE<gt>\n"
1226 "#include E<lt>stdio.hE<gt>\n"
1227 "#include E<lt>stdlib.hE<gt>\n"
1228 "#include E<lt>unistd.hE<gt>\n"
1229 "#include E<lt>errno.hE<gt>\n"
1230 msgstr ""
1231 "#define _GNU_SOURCE     /* To get pthread_getattr_np() declaration */\n"
1232 "#include E<lt>pthread.hE<gt>\n"
1233 "#include E<lt>stdio.hE<gt>\n"
1234 "#include E<lt>stdlib.hE<gt>\n"
1235 "#include E<lt>unistd.hE<gt>\n"
1236 "#include E<lt>errno.hE<gt>\n"
1237
1238 #. type: Plain text
1239 #: build/C/man3/pthread_attr_init.3:160 build/C/man3/pthread_cancel.3:162
1240 #: build/C/man3/pthread_cleanup_push.3:243 build/C/man3/pthread_create.3:261
1241 #: build/C/man3/pthread_getattr_np.3:191
1242 #: build/C/man3/pthread_getcpuclockid.3:119
1243 #: build/C/man3/pthread_setaffinity_np.3:179
1244 #: build/C/man3/pthread_setschedparam.3:244 build/C/man3/pthread_sigmask.3:110
1245 #, no-wrap
1246 msgid ""
1247 "#define handle_error_en(en, msg) \\e\n"
1248 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1249 msgstr ""
1250 "#define handle_error_en(en, msg) \\e\n"
1251 "        do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1252
1253 #. type: Plain text
1254 #: build/C/man3/pthread_attr_init.3:168
1255 #, no-wrap
1256 msgid ""
1257 "static void\n"
1258 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1259 "{\n"
1260 "    int s, i;\n"
1261 "    size_t v;\n"
1262 "    void *stkaddr;\n"
1263 "    struct sched_param sp;\n"
1264 msgstr ""
1265 "static void\n"
1266 "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n"
1267 "{\n"
1268 "    int s, i;\n"
1269 "    size_t v;\n"
1270 "    void *stkaddr;\n"
1271 "    struct sched_param sp;\n"
1272
1273 #. type: Plain text
1274 #: build/C/man3/pthread_attr_init.3:176
1275 #, no-wrap
1276 msgid ""
1277 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1278 "    if (s != 0)\n"
1279 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1280 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1281 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1282 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1283 "            \"???\");\n"
1284 msgstr ""
1285 "    s = pthread_attr_getdetachstate(attr, &i);\n"
1286 "    if (s != 0)\n"
1287 "        handle_error_en(s, \"pthread_attr_getdetachstate\");\n"
1288 "    printf(\"%sDetach state        = %s\\en\", prefix,\n"
1289 "            (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n"
1290 "            (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n"
1291 "            \"???\");\n"
1292
1293 #. type: Plain text
1294 #: build/C/man3/pthread_attr_init.3:184
1295 #, no-wrap
1296 msgid ""
1297 "    s = pthread_attr_getscope(attr, &i);\n"
1298 "    if (s != 0)\n"
1299 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1300 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1301 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1302 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1303 "            \"???\");\n"
1304 msgstr ""
1305 "    s = pthread_attr_getscope(attr, &i);\n"
1306 "    if (s != 0)\n"
1307 "        handle_error_en(s, \"pthread_attr_getscope\");\n"
1308 "    printf(\"%sScope               = %s\\en\", prefix,\n"
1309 "            (i == PTHREAD_SCOPE_SYSTEM)  ? \"PTHREAD_SCOPE_SYSTEM\" :\n"
1310 "            (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n"
1311 "            \"???\");\n"
1312
1313 #. type: Plain text
1314 #: build/C/man3/pthread_attr_init.3:192
1315 #, no-wrap
1316 msgid ""
1317 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1318 "    if (s != 0)\n"
1319 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1320 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1321 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1322 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1323 "            \"???\");\n"
1324 msgstr ""
1325 "    s = pthread_attr_getinheritsched(attr, &i);\n"
1326 "    if (s != 0)\n"
1327 "        handle_error_en(s, \"pthread_attr_getinheritsched\");\n"
1328 "    printf(\"%sInherit scheduler   = %s\\en\", prefix,\n"
1329 "            (i == PTHREAD_INHERIT_SCHED)  ? \"PTHREAD_INHERIT_SCHED\" :\n"
1330 "            (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n"
1331 "            \"???\");\n"
1332
1333 #. type: Plain text
1334 #: build/C/man3/pthread_attr_init.3:201
1335 #, no-wrap
1336 msgid ""
1337 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1338 "    if (s != 0)\n"
1339 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1340 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1341 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1342 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1343 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1344 "            \"???\");\n"
1345 msgstr ""
1346 "    s = pthread_attr_getschedpolicy(attr, &i);\n"
1347 "    if (s != 0)\n"
1348 "        handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1349 "    printf(\"%sScheduling policy   = %s\\en\", prefix,\n"
1350 "            (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1351 "            (i == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
1352 "            (i == SCHED_RR)    ? \"SCHED_RR\" :\n"
1353 "            \"???\");\n"
1354
1355 #. type: Plain text
1356 #: build/C/man3/pthread_attr_init.3:206
1357 #, no-wrap
1358 msgid ""
1359 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1360 "    if (s != 0)\n"
1361 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1362 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1363 msgstr ""
1364 "    s = pthread_attr_getschedparam(attr, &sp);\n"
1365 "    if (s != 0)\n"
1366 "        handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1367 "    printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n"
1368
1369 #. type: Plain text
1370 #: build/C/man3/pthread_attr_init.3:211
1371 #, no-wrap
1372 msgid ""
1373 "    s = pthread_attr_getguardsize(attr, &v);\n"
1374 "    if (s != 0)\n"
1375 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1376 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1377 msgstr ""
1378 "    s = pthread_attr_getguardsize(attr, &v);\n"
1379 "    if (s != 0)\n"
1380 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
1381 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, v);\n"
1382
1383 #. type: Plain text
1384 #: build/C/man3/pthread_attr_init.3:218
1385 #, no-wrap
1386 msgid ""
1387 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1388 "    if (s != 0)\n"
1389 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1390 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1391 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1392 "}\n"
1393 msgstr ""
1394 "    s = pthread_attr_getstack(attr, &stkaddr, &v);\n"
1395 "    if (s != 0)\n"
1396 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
1397 "    printf(\"%sStack address       = %p\\en\", prefix, stkaddr);\n"
1398 "    printf(\"%sStack size          = 0x%x bytes\\en\", prefix, v);\n"
1399 "}\n"
1400
1401 #. type: Plain text
1402 #: build/C/man3/pthread_attr_init.3:224
1403 #, no-wrap
1404 msgid ""
1405 "static void *\n"
1406 "thread_start(void *arg)\n"
1407 "{\n"
1408 "    int s;\n"
1409 "    pthread_attr_t gattr;\n"
1410 msgstr ""
1411 "static void *\n"
1412 "thread_start(void *arg)\n"
1413 "{\n"
1414 "    int s;\n"
1415 "    pthread_attr_t gattr;\n"
1416
1417 #. type: Plain text
1418 #: build/C/man3/pthread_attr_init.3:228
1419 #, no-wrap
1420 msgid ""
1421 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1422 "       retrieves the attributes of the thread specified in its\n"
1423 "       first argument */\n"
1424 msgstr ""
1425 "    /* pthread_getattr_np() is a non-standard GNU extension that\n"
1426 "       retrieves the attributes of the thread specified in its\n"
1427 "       first argument */\n"
1428
1429 #. type: Plain text
1430 #: build/C/man3/pthread_attr_init.3:232
1431 #, no-wrap
1432 msgid ""
1433 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1434 "    if (s != 0)\n"
1435 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1436 msgstr ""
1437 "    s = pthread_getattr_np(pthread_self(), &gattr);\n"
1438 "    if (s != 0)\n"
1439 "        handle_error_en(s, \"pthread_getattr_np\");\n"
1440
1441 #. type: Plain text
1442 #: build/C/man3/pthread_attr_init.3:235
1443 #, no-wrap
1444 msgid ""
1445 "    printf(\"Thread attributes:\\en\");\n"
1446 "    display_pthread_attr(&gattr, \"\\et\");\n"
1447 msgstr ""
1448 "    printf(\"Thread attributes:\\en\");\n"
1449 "    display_pthread_attr(&gattr, \"\\et\");\n"
1450
1451 #. type: Plain text
1452 #: build/C/man3/pthread_attr_init.3:238 build/C/man3/pthread_getattr_np.3:240
1453 #, no-wrap
1454 msgid ""
1455 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1456 "}\n"
1457 msgstr ""
1458 "    exit(EXIT_SUCCESS);         /* Terminate all threads */\n"
1459 "}\n"
1460
1461 #. type: Plain text
1462 #: build/C/man3/pthread_attr_init.3:246
1463 #, no-wrap
1464 msgid ""
1465 "int\n"
1466 "main(int argc, char *argv[])\n"
1467 "{\n"
1468 "    pthread_t thr;\n"
1469 "    pthread_attr_t attr;\n"
1470 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1471 "    int s;\n"
1472 msgstr ""
1473 "int\n"
1474 "main(int argc, char *argv[])\n"
1475 "{\n"
1476 "    pthread_t thr;\n"
1477 "    pthread_attr_t attr;\n"
1478 "    pthread_attr_t *attrp;      /* NULL or &attr */\n"
1479 "    int s;\n"
1480
1481 #. type: Plain text
1482 #: build/C/man3/pthread_attr_init.3:248
1483 #: build/C/man3/pthread_setschedparam.3:362
1484 #, no-wrap
1485 msgid "    attrp = NULL;\n"
1486 msgstr "    attrp = NULL;\n"
1487
1488 #. type: Plain text
1489 #: build/C/man3/pthread_attr_init.3:252
1490 #, no-wrap
1491 msgid ""
1492 "    /* If a command-line argument was supplied, use it to set the\n"
1493 "       stack-size attribute and set a few other thread attributes,\n"
1494 "       and set attrp pointing to thread attributes object */\n"
1495 msgstr ""
1496 "    /* If a command-line argument was supplied, use it to set the\n"
1497 "       stack-size attribute and set a few other thread attributes,\n"
1498 "       and set attrp pointing to thread attributes object */\n"
1499
1500 #. type: Plain text
1501 #: build/C/man3/pthread_attr_init.3:256
1502 #, no-wrap
1503 msgid ""
1504 "    if (argc E<gt> 1) {\n"
1505 "        int stack_size;\n"
1506 "        void *sp;\n"
1507 msgstr ""
1508 "    if (argc E<gt> 1) {\n"
1509 "        int stack_size;\n"
1510 "        void *sp;\n"
1511
1512 #. type: Plain text
1513 #: build/C/man3/pthread_attr_init.3:258
1514 #, no-wrap
1515 msgid "        attrp = &attr;\n"
1516 msgstr "        attrp = &attr;\n"
1517
1518 #. type: Plain text
1519 #: build/C/man3/pthread_attr_init.3:262
1520 #, no-wrap
1521 msgid ""
1522 "        s = pthread_attr_init(&attr);\n"
1523 "        if (s != 0)\n"
1524 "            handle_error_en(s, \"pthread_attr_init\");\n"
1525 msgstr ""
1526 "        s = pthread_attr_init(&attr);\n"
1527 "        if (s != 0)\n"
1528 "            handle_error_en(s, \"pthread_attr_init\");\n"
1529
1530 #. type: Plain text
1531 #: build/C/man3/pthread_attr_init.3:266
1532 #, no-wrap
1533 msgid ""
1534 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1535 "        if (s != 0)\n"
1536 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1537 msgstr ""
1538 "        s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n"
1539 "        if (s != 0)\n"
1540 "            handle_error_en(s, \"pthread_attr_setdetachstate\");\n"
1541
1542 #. type: Plain text
1543 #: build/C/man3/pthread_attr_init.3:270
1544 #, no-wrap
1545 msgid ""
1546 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1547 "        if (s != 0)\n"
1548 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1549 msgstr ""
1550 "        s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n"
1551 "        if (s != 0)\n"
1552 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1553
1554 #. type: Plain text
1555 #: build/C/man3/pthread_attr_init.3:272
1556 #, no-wrap
1557 msgid "        stack_size = strtoul(argv[1], NULL, 0);\n"
1558 msgstr "        stack_size = strtoul(argv[1], NULL, 0);\n"
1559
1560 #. type: Plain text
1561 #: build/C/man3/pthread_attr_init.3:276
1562 #, no-wrap
1563 msgid ""
1564 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1565 "        if (s != 0)\n"
1566 "            handle_error_en(s, \"posix_memalign\");\n"
1567 msgstr ""
1568 "        s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n"
1569 "        if (s != 0)\n"
1570 "            handle_error_en(s, \"posix_memalign\");\n"
1571
1572 #. type: Plain text
1573 #: build/C/man3/pthread_attr_init.3:278
1574 #, no-wrap
1575 msgid "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1576 msgstr "        printf(\"posix_memalign() allocated at %p\\en\", sp);\n"
1577
1578 #. type: Plain text
1579 #: build/C/man3/pthread_attr_init.3:283
1580 #, no-wrap
1581 msgid ""
1582 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1583 "        if (s != 0)\n"
1584 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1585 "    }\n"
1586 msgstr ""
1587 "        s = pthread_attr_setstack(&attr, sp, stack_size);\n"
1588 "        if (s != 0)\n"
1589 "            handle_error_en(s, \"pthread_attr_setstack\");\n"
1590 "    }\n"
1591
1592 #. type: Plain text
1593 #: build/C/man3/pthread_attr_init.3:287 build/C/man3/pthread_getattr_np.3:335
1594 #, no-wrap
1595 msgid ""
1596 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1597 "    if (s != 0)\n"
1598 "        handle_error_en(s, \"pthread_create\");\n"
1599 msgstr ""
1600 "    s = pthread_create(&thr, attrp, &thread_start, NULL);\n"
1601 "    if (s != 0)\n"
1602 "        handle_error_en(s, \"pthread_create\");\n"
1603
1604 #. type: Plain text
1605 #: build/C/man3/pthread_attr_init.3:293 build/C/man3/pthread_getattr_np.3:341
1606 #, no-wrap
1607 msgid ""
1608 "    if (attrp != NULL) {\n"
1609 "        s = pthread_attr_destroy(attrp);\n"
1610 "        if (s != 0)\n"
1611 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1612 "    }\n"
1613 msgstr ""
1614 "    if (attrp != NULL) {\n"
1615 "        s = pthread_attr_destroy(attrp);\n"
1616 "        if (s != 0)\n"
1617 "            handle_error_en(s, \"pthread_attr_destroy\");\n"
1618 "    }\n"
1619
1620 #. type: Plain text
1621 #: build/C/man3/pthread_attr_init.3:296 build/C/man3/pthread_getattr_np.3:344
1622 #, no-wrap
1623 msgid ""
1624 "    pause();    /* Terminates when other thread calls exit() */\n"
1625 "}\n"
1626 msgstr ""
1627 "    pause();    /* Terminates when other thread calls exit() */\n"
1628 "}\n"
1629
1630 #. type: Plain text
1631 #: build/C/man3/pthread_attr_init.3:313
1632 msgid "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_setstack>(3), B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1633 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_setstack>(3), B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthread_getattr_np>(3), B<pthreads>(7)"
1634
1635 #. type: TH
1636 #: build/C/man3/pthread_attr_setaffinity_np.3:26
1637 #, no-wrap
1638 msgid "PTHREAD_ATTR_SETAFFINITY_NP"
1639 msgstr "PTHREAD_ATTR_SETAFFINITY_NP"
1640
1641 #. type: Plain text
1642 #: build/C/man3/pthread_attr_setaffinity_np.3:30
1643 msgid "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU affinity attribute in thread attributes object"
1644 msgstr ""
1645 "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n"
1646 "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う"
1647
1648 #. type: Plain text
1649 #: build/C/man3/pthread_attr_setaffinity_np.3:34
1650 #: build/C/man3/pthread_getattr_np.3:33
1651 #: build/C/man3/pthread_setaffinity_np.3:34
1652 #: build/C/man3/pthread_tryjoin_np.3:34 build/C/man3/pthread_yield.3:32
1653 #, no-wrap
1654 msgid ""
1655 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1656 "B<#include E<lt>pthread.hE<gt>>\n"
1657 msgstr ""
1658 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
1659 "B<#include E<lt>pthread.hE<gt>>\n"
1660
1661 #. type: Plain text
1662 #: build/C/man3/pthread_attr_setaffinity_np.3:39
1663 #, no-wrap
1664 msgid ""
1665 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1666 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1667 "B<int pthread_attr_getaffinity_np(const pthread_attr_t *>I<attr>B<,>\n"
1668 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1669 msgstr ""
1670 "B<int pthread_attr_setaffinity_np(pthread_attr_t *>I<attr>B<,>\n"
1671 "B<                   size_t >I<cpusetsize>B<, const cpu_set_t *>I<cpuset>B<);>\n"
1672 "B<int pthread_attr_getaffinity_np(const pthread_attr_t *>I<attr>B<,>\n"
1673 "B<                   size_t >I<cpusetsize>B<, cpu_set_t *>I<cpuset>B<);>\n"
1674
1675 #. type: Plain text
1676 #: build/C/man3/pthread_attr_setaffinity_np.3:54
1677 msgid "The B<pthread_attr_setaffinity_np>()  function sets the CPU affinity mask attribute of the thread attributes object referred to by I<attr> to the value specified in I<cpuset>.  This attribute determines the CPU affinity mask of a thread created using the thread attributes object I<attr>."
1678 msgstr ""
1679 "B<pthread_attr_setaffinity_np>() 関数は、\n"
1680 "I<attr> が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n"
1681 "I<cpuset> で指定された値に設定する。\n"
1682 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
1683 "作成されたスレッドの CPU affinity マスクが決定される。"
1684
1685 #. type: Plain text
1686 #: build/C/man3/pthread_attr_setaffinity_np.3:63
1687 msgid "The B<pthread_attr_getaffinity_np>()  function returns the CPU affinity mask attribute of the thread attributes object referred to by I<attr> in the buffer pointed to by I<cpuset>."
1688 msgstr ""
1689 "B<pthread_attr_getaffinity_np>() 関数は、 I<attr> が参照する\n"
1690 "スレッド属性オブジェクトの CPU affinity マスク属性を\n"
1691 "I<cpuset> が指すバッファーに入れて返す。"
1692
1693 #. type: Plain text
1694 #: build/C/man3/pthread_attr_setaffinity_np.3:70
1695 msgid "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to by I<cpuset>.  Typically, this argument would be specified as I<sizeof(cpu_set_t)>."
1696 msgstr ""
1697 "I<cpusetsize> 引き数は I<cpuset> が指すバッファーの (バイト単位の)\n"
1698 "大きさである。通常は、この引き数には I<sizeof(cpu_set_t)> を\n"
1699 "指定することだろう。"
1700
1701 #. type: Plain text
1702 #: build/C/man3/pthread_attr_setaffinity_np.3:76
1703 #: build/C/man3/pthread_setaffinity_np.3:67
1704 msgid "For more details on CPU affinity masks, see B<sched_setaffinity>(2).  For a description of a set of macros that can be used to manipulate and inspect CPU sets, see B<CPU_SET>(3)."
1705 msgstr ""
1706 "CPU affinity マスクの詳細については、 \n"
1707 "B<sched_setaffinity>(2) を参照してほしい。\n"
1708 "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n"
1709 "B<CPU_SET>(3) を参照してほしい。"
1710
1711 #. type: TP
1712 #: build/C/man3/pthread_attr_setaffinity_np.3:80
1713 #: build/C/man3/pthread_attr_setaffinity_np.3:92
1714 #: build/C/man3/pthread_attr_setdetachstate.3:83
1715 #: build/C/man3/pthread_attr_setinheritsched.3:99
1716 #: build/C/man3/pthread_attr_setschedpolicy.3:89
1717 #: build/C/man3/pthread_attr_setscope.3:109
1718 #: build/C/man3/pthread_attr_setstack.3:91
1719 #: build/C/man3/pthread_attr_setstacksize.3:67
1720 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:55
1721 #: build/C/man3/pthread_join.3:85 build/C/man3/pthread_join.3:89
1722 #: build/C/man3/pthread_kill.3:69
1723 #: build/C/man3/pthread_rwlockattr_setkind_np.3:105
1724 #: build/C/man3/pthread_setaffinity_np.3:84
1725 #: build/C/man3/pthread_setaffinity_np.3:93
1726 #: build/C/man3/pthread_setaffinity_np.3:109
1727 #: build/C/man3/pthread_setcancelstate.3:99
1728 #: build/C/man3/pthread_setcancelstate.3:107
1729 #: build/C/man3/pthread_setconcurrency.3:71
1730 #: build/C/man3/pthread_setschedparam.3:122
1731 #: build/C/man3/pthread_setschedprio.3:62 build/C/man3/pthread_sigqueue.3:78
1732 #: build/C/man3/pthread_tryjoin_np.3:106
1733 #, no-wrap
1734 msgid "B<EINVAL>"
1735 msgstr "B<EINVAL>"
1736
1737 #.  cpumask_t
1738 #.  The raw sched_getaffinity() system call returns the size (in bytes)
1739 #.  of the cpumask_t type.
1740 #. type: Plain text
1741 #: build/C/man3/pthread_attr_setaffinity_np.3:92
1742 msgid "(B<pthread_attr_setaffinity_np>())  I<cpuset> specified a CPU that was outside the set supported by the kernel.  (The kernel configuration option B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data type used to represent CPU sets.)"
1743 msgstr ""
1744 "(B<pthread_attr_setaffinity_np>())\n"
1745 "I<cpuset> がカーネルがサポートする CPU 集合にない CPU を指定していた。\n"
1746 "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲は、\n"
1747 "カーネルの設定オプション B<CONFIG_NR_CPUS> により定義される)。"
1748
1749 #. type: Plain text
1750 #: build/C/man3/pthread_attr_setaffinity_np.3:102
1751 msgid "(B<pthread_attr_getaffinity_np>())  A CPU in the affinity mask of the thread attributes object referred to by I<attr> lies outside the range specified by I<cpusetsize> (i.e., I<cpuset>/I<cpusetsize> is too small)."
1752 msgstr ""
1753 "(B<pthread_attr_getaffinity_np>())\n"
1754 "I<attr> が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n"
1755 "I<cpusetsize> により指定された範囲の中になかった\n"
1756 "(すなわち、I<cpuset>/I<cpusetsize> が小さすぎる)。"
1757
1758 #. type: Plain text
1759 #: build/C/man3/pthread_attr_setaffinity_np.3:106
1760 msgid "(B<pthread_attr_setaffinity_np>())  Could not allocate memory."
1761 msgstr "(B<pthread_attr_setaffinity_np>()) メモリを割り当てることができなかった。"
1762
1763 #. type: Plain text
1764 #: build/C/man3/pthread_attr_setaffinity_np.3:108
1765 #: build/C/man3/pthread_setaffinity_np.3:121
1766 msgid "These functions are provided by glibc since version 2.3.4."
1767 msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。"
1768
1769 #. type: Plain text
1770 #: build/C/man3/pthread_attr_setaffinity_np.3:111
1771 #: build/C/man3/pthread_cleanup_push_defer_np.3:117
1772 #: build/C/man3/pthread_setaffinity_np.3:131
1773 #: build/C/man3/pthread_tryjoin_np.3:123
1774 msgid "These functions are nonstandard GNU extensions; hence the suffix \"_np\" (nonportable) in the names."
1775 msgstr ""
1776 "これらの関数は非標準の GNU による拡張である。\n"
1777 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
1778 "付いている。"
1779
1780 #. type: Plain text
1781 #: build/C/man3/pthread_attr_setaffinity_np.3:118
1782 #: build/C/man3/pthread_setaffinity_np.3:157
1783 msgid "In glibc 2.3.3 only, versions of these functions were provided that did not have a I<cpusetsize> argument.  Instead the CPU set size given to the underlying system calls was always I<sizeof(cpu_set_t)>."
1784 msgstr ""
1785 "(このバージョンだけであるが) glibc 2.3.3 では、\n"
1786 "これらの関数は I<cpusetsize> 引き数を持っていなかった。\n"
1787 "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n"
1788 "常に I<sizeof(cpu_set_t)> であった。"
1789
1790 #. type: Plain text
1791 #: build/C/man3/pthread_attr_setaffinity_np.3:124
1792 msgid "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
1793 msgstr "B<sched_setaffinity>(2), B<pthread_attr_init>(3), B<pthread_setaffinity_np>(3), B<cpuset>(7), B<pthreads>(7)"
1794
1795 #. type: TH
1796 #: build/C/man3/pthread_attr_setdetachstate.3:26
1797 #, no-wrap
1798 msgid "PTHREAD_ATTR_SETDETACHSTATE"
1799 msgstr "PTHREAD_ATTR_SETDETACHSTATE"
1800
1801 #. type: Plain text
1802 #: build/C/man3/pthread_attr_setdetachstate.3:30
1803 msgid "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach state attribute in thread attributes object"
1804 msgstr ""
1805 "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n"
1806 "スレッド属性オブジェクトの detach state 属性の設定/取得を行う"
1807
1808 #. type: Plain text
1809 #: build/C/man3/pthread_attr_setdetachstate.3:38
1810 #, no-wrap
1811 msgid ""
1812 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
1813 "B<int pthread_attr_getdetachstate(const pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
1814 msgstr ""
1815 "B<int pthread_attr_setdetachstate(pthread_attr_t *>I<attr>B<, int >I<detachstate>B<);>\n"
1816 "B<int pthread_attr_getdetachstate(const pthread_attr_t *>I<attr>B<, int *>I<detachstate>B<);>\n"
1817
1818 #. type: Plain text
1819 #: build/C/man3/pthread_attr_setdetachstate.3:53
1820 msgid "The B<pthread_attr_setdetachstate>()  function sets the detach state attribute of the thread attributes object referred to by I<attr> to the value specified in I<detachstate>.  The detach state attribute determines whether a thread created using the thread attributes object I<attr> will be created in a joinable or a detached state."
1821 msgstr ""
1822 "B<pthread_attr_setdetachstate>() 関数は、\n"
1823 "I<attr> が参照するスレッド属性オブジェクトの detach state 属性を\n"
1824 "I<detachstate> で指定された値に設定する。\n"
1825 "detach state 属性により、スレッド属性オブジェクト I<attr> を使って\n"
1826 "作成されるスレッドが、 join 可能な状態で作成されるか、\n"
1827 "detached (切り離された) 状態で作成されるかが決定される。"
1828
1829 #. type: Plain text
1830 #: build/C/man3/pthread_attr_setdetachstate.3:56
1831 msgid "The following values may be specified in I<detachstate>:"
1832 msgstr "I<detachstate> には以下の値を指定できる。"
1833
1834 #. type: TP
1835 #: build/C/man3/pthread_attr_setdetachstate.3:56
1836 #, no-wrap
1837 msgid "B<PTHREAD_CREATE_DETACHED>"
1838 msgstr "B<PTHREAD_CREATE_DETACHED>"
1839
1840 #. type: Plain text
1841 #: build/C/man3/pthread_attr_setdetachstate.3:61
1842 msgid "Threads that are created using I<attr> will be created in a detached state."
1843 msgstr "I<attr> を使って作成されるスレッドは detached 状態で作成される。"
1844
1845 #. type: TP
1846 #: build/C/man3/pthread_attr_setdetachstate.3:61
1847 #, no-wrap
1848 msgid "B<PTHREAD_CREATE_JOINABLE>"
1849 msgstr "B<PTHREAD_CREATE_JOINABLE>"
1850
1851 #. type: Plain text
1852 #: build/C/man3/pthread_attr_setdetachstate.3:66
1853 msgid "Threads that are created using I<attr> will be created in a joinable state."
1854 msgstr "I<attr> を使って作成されるスレッドは join 可能な状態で作成される。"
1855
1856 #. type: Plain text
1857 #: build/C/man3/pthread_attr_setdetachstate.3:70
1858 msgid "The default setting of the detach state attribute in a newly initialized thread attributes object is B<PTHREAD_CREATE_JOINABLE>."
1859 msgstr ""
1860 "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n"
1861 "デフォルト設定は B<PTHREAD_CREATE_JOINABLE> である。"
1862
1863 #. type: Plain text
1864 #: build/C/man3/pthread_attr_setdetachstate.3:77
1865 msgid "The B<pthread_attr_getdetachstate>()  returns the detach state attribute of the thread attributes object I<attr> in the buffer pointed to by I<detachstate>."
1866 msgstr ""
1867 "B<pthread_attr_getdetachstate>() は、\n"
1868 "スレッド属性オブジェクト I<attr> の detach state 属性を\n"
1869 "I<detachstate> が指すバッファーに入れて返す。"
1870
1871 #. type: Plain text
1872 #: build/C/man3/pthread_attr_setdetachstate.3:83
1873 msgid "B<pthread_attr_setdetachstate>()  can fail with the following error:"
1874 msgstr "B<pthread_attr_setdetachstate>() は以下のエラーで失敗する場合がある。"
1875
1876 #. type: Plain text
1877 #: build/C/man3/pthread_attr_setdetachstate.3:87
1878 msgid "An invalid value was specified in I<detachstate>."
1879 msgstr "無効な値が I<detachstate> で指定された。"
1880
1881 #. type: Plain text
1882 #: build/C/man3/pthread_attr_setdetachstate.3:94
1883 msgid "The B<pthread_attr_setdetachstate>()  and B<pthread_attr_getdetachstate>()  functions are thread-safe."
1884 msgstr "関数 B<pthread_attr_setdetachstate>() と B<pthread_attr_getdetachstate>() はスレッドセーフである。"
1885
1886 #. type: Plain text
1887 #: build/C/man3/pthread_attr_setdetachstate.3:100
1888 msgid "See B<pthread_create>(3)  for more details on detached and joinable threads."
1889 msgstr ""
1890 "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n"
1891 "B<pthread_create>(3) を参照。"
1892
1893 #. type: Plain text
1894 #: build/C/man3/pthread_attr_setdetachstate.3:108
1895 msgid "A thread that is created in a joinable state should eventually either be joined using B<pthread_join>(3)  or detached using B<pthread_detach>(3); see B<pthread_create>(3)."
1896 msgstr ""
1897 "join 可能状態で作成されたスレッドは、最終的に\n"
1898 "B<pthread_join>(3) を使って join するか、\n"
1899 "B<pthread_detach>(3) を使って切り離すか、\n"
1900 "のどちらかを行うべきである。"
1901
1902 #. type: Plain text
1903 #: build/C/man3/pthread_attr_setdetachstate.3:115
1904 msgid "It is an error to specify the thread ID of a thread that was created in a detached state in a later call to B<pthread_detach>(3)  or B<pthread_join>(3)."
1905 msgstr ""
1906 "detached 状態で作成されたスレッドのスレッド ID を指定して、\n"
1907 "B<pthread_detach>(3) や B<pthread_join>(3) を後から呼び出すのは\n"
1908 "エラーである。"
1909
1910 #. type: Plain text
1911 #: build/C/man3/pthread_attr_setdetachstate.3:118
1912 #: build/C/man3/pthread_attr_setstack.3:162
1913 msgid "See B<pthread_attr_init>(3)."
1914 msgstr "B<pthread_attr_init>(3) を参照。"
1915
1916 #. type: Plain text
1917 #: build/C/man3/pthread_attr_setdetachstate.3:124
1918 msgid "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), B<pthread_join>(3), B<pthreads>(7)"
1919 msgstr "B<pthread_attr_init>(3), B<pthread_create>(3), B<pthread_detach>(3), B<pthread_join>(3), B<pthreads>(7)"
1920
1921 #. type: TH
1922 #: build/C/man3/pthread_attr_setguardsize.3:26
1923 #, no-wrap
1924 msgid "PTHREAD_ATTR_SETGUARDSIZE"
1925 msgstr "PTHREAD_ATTR_SETGUARDSIZE"
1926
1927 #. type: Plain text
1928 #: build/C/man3/pthread_attr_setguardsize.3:30
1929 msgid "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size attribute in thread attributes object"
1930 msgstr ""
1931 "pthread_attr_setguardsize, pthread_attr_getguardsize - \n"
1932 "スレッド属性オブジェクトの guard size 属性の設定/取得を行う"
1933
1934 #. type: Plain text
1935 #: build/C/man3/pthread_attr_setguardsize.3:38
1936 #, no-wrap
1937 msgid ""
1938 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
1939 "B<int pthread_attr_getguardsize(const pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
1940 msgstr ""
1941 "B<int pthread_attr_setguardsize(pthread_attr_t *>I<attr>B<, size_t >I<guardsize>B<);>\n"
1942 "B<int pthread_attr_getguardsize(const pthread_attr_t *>I<attr>B<, size_t *>I<guardsize>B<);>\n"
1943
1944 #. type: Plain text
1945 #: build/C/man3/pthread_attr_setguardsize.3:49
1946 msgid "The B<pthread_attr_setguardsize>()  function sets the guard size attribute of the thread attributes object referred to by I<attr> to the value specified in I<guardsize>."
1947 msgstr ""
1948 "B<pthread_attr_setguardsize>() 関数は、\n"
1949 "I<attr> が参照するスレッド属性オブジェクトの guard size 属性を\n"
1950 "I<guardsize> で指定された値に設定する。"
1951
1952 #. type: Plain text
1953 #: build/C/man3/pthread_attr_setguardsize.3:59
1954 msgid "If I<guardsize> is greater than 0, then for each new thread created using I<attr> the system allocates an additional region of at least I<guardsize> bytes at the end of the thread's stack to act as the guard area for the stack (but see BUGS)."
1955 msgstr ""
1956 "I<guardsize> が 0 より大きい場合、\n"
1957 "I<attr> を使って新しく作成された各スレッドに対して、\n"
1958 "システムはスレッドのスタックの末尾に少なくとも I<guardsize> バイトの\n"
1959 "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n"
1960 "機能する (ただし「バグ」の節も参照)。"
1961
1962 #. type: Plain text
1963 #: build/C/man3/pthread_attr_setguardsize.3:65
1964 msgid "If I<guardsize> is 0, then new threads created with I<attr> will not have a guard area."
1965 msgstr ""
1966 "I<guardsize> が 0 の場合、\n"
1967 "I<attr> を使って新しく作成されたスレッドはガード領域を持たない。"
1968
1969 #. type: Plain text
1970 #: build/C/man3/pthread_attr_setguardsize.3:67
1971 msgid "The default guard size is the same as the system page size."
1972 msgstr "デフォルトの guard size はシステムのページサイズと同じである。"
1973
1974 #. type: Plain text
1975 #: build/C/man3/pthread_attr_setguardsize.3:82
1976 msgid "If the stack address attribute has been set in I<attr> (using B<pthread_attr_setstack>(3)  or B<pthread_attr_setstackaddr>(3)), meaning that the caller is allocating the thread's stack, then the guard size attribute is ignored (i.e., no guard area is created by the system): it is the application's responsibility to handle stack overflow (perhaps by using B<mprotect>(2)  to manually define a guard area at the end of the stack that it has allocated)."
1977 msgstr ""
1978 "(B<pthread_attr_setstack>(3) や B<pthread_attr_setstackaddr>(3)を使って)\n"
1979 "I<attr> でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n"
1980 "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n"
1981 "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n"
1982 "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n"
1983 "ケーション側の責任となる (おそらく B<mprotect>(2) を使って、割り当て\n"
1984 "られたスタックの最後に手動でガード領域を定義することになるだろう)。"
1985
1986 #. type: Plain text
1987 #: build/C/man3/pthread_attr_setguardsize.3:90
1988 msgid "The B<pthread_attr_getguardsize>()  function returns the guard size attribute of the thread attributes object referred to by I<attr> in the buffer pointed to by I<guardsize>."
1989 msgstr ""
1990 "B<pthread_attr_getguardsize>() は、\n"
1991 "スレッド属性オブジェクト I<attr> の guard size 属性を\n"
1992 "I<guardsize> が指すバッファーに入れて返す。"
1993
1994 #. type: Plain text
1995 #: build/C/man3/pthread_attr_setguardsize.3:104
1996 msgid "POSIX.1-2001 documents an B<EINVAL> error if I<attr> or I<guardsize> is invalid.  On Linux these functions always succeed (but portable and future-proof applications should nevertheless handle a possible error return)."
1997 msgstr ""
1998 "POSIX.1-2001 では、エラー B<EINVAL> が\n"
1999 " I<attr> か I<guardsize> が無効な場合に対して規定されている。\n"
2000 "Linux では、これらの関数は常に成功する\n"
2001 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2002 "正のエラーの返り値を処理するようにすべきである)。"
2003
2004 #. type: Plain text
2005 #: build/C/man3/pthread_attr_setguardsize.3:106
2006 #: build/C/man3/pthread_attr_setstackaddr.3:83
2007 #: build/C/man3/pthread_attr_setstacksize.3:83
2008 msgid "These functions are provided by glibc since version 2.1."
2009 msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。"
2010
2011 #. type: Plain text
2012 #: build/C/man3/pthread_attr_setguardsize.3:113
2013 msgid "The B<pthread_attr_setguardsize>()  and B<pthread_attr_getguardsize>()  functions are thread-safe."
2014 msgstr "関数 B<pthread_attr_setguardsize>() と B<pthread_attr_getguardsize>() はスレッドセーフである。"
2015
2016 #. type: Plain text
2017 #: build/C/man3/pthread_attr_setguardsize.3:129
2018 msgid "A guard area consists of virtual memory pages that are protected to prevent read and write access.  If a thread overflows its stack into the guard area, then, on most hard architectures, it receives a B<SIGSEGV> signal, thus notifying it of the overflow.  Guard areas start on page boundaries, and the guard size is internally rounded up to the system page size when creating a thread.  (Nevertheless, B<pthread_attr_getguardsize>()  returns the guard size that was set by B<pthread_attr_setguardsize>().)"
2019 msgstr ""
2020 "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n"
2021 "られた仮想メモリページで構成で構成される。スレッドがスタックをガード\n"
2022 "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャー\n"
2023 "では、スレッドに B<SIGSEGV> シグナルが送られ、オーバーフローが発生した\n"
2024 "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n"
2025 "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n"
2026 "(その場合も B<pthread_attr_getguardsize>() では\n"
2027 "B<pthread_attr_setguardsize>() で設定された guard size が返される)。"
2028
2029 #. type: Plain text
2030 #: build/C/man3/pthread_attr_setguardsize.3:133
2031 msgid "Setting a guard size of 0 may be useful to save memory in an application that creates many threads and knows that stack overflow can never occur."
2032 msgstr ""
2033 "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n"
2034 "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n"
2035 "することで、メモリを節約できることもある。"
2036
2037 #. type: Plain text
2038 #: build/C/man3/pthread_attr_setguardsize.3:137
2039 msgid "Choosing a guard size larger than the default size may be necessary for detecting stack overflows if a thread allocates large data structures on the stack."
2040 msgstr ""
2041 "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n"
2042 "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n"
2043 "大きな guard size を選ぶ必要があるかもしれない。"
2044
2045 #. type: SH
2046 #: build/C/man3/pthread_attr_setguardsize.3:137
2047 #: build/C/man3/pthread_attr_setinheritsched.3:119
2048 #: build/C/man3/pthread_attr_setstacksize.3:103
2049 #: build/C/man3/pthread_create.3:203 build/C/man3/pthread_exit.3:98
2050 #: build/C/man3/pthread_rwlockattr_setkind_np.3:109
2051 #, no-wrap
2052 msgid "BUGS"
2053 msgstr "バグ"
2054
2055 #. type: Plain text
2056 #: build/C/man3/pthread_attr_setguardsize.3:148
2057 msgid "As at glibc 2.8, the NPTL threading implementation includes the guard area within the stack size allocation, rather than allocating extra space at the end of the stack, as POSIX.1 requires.  (This can result in an B<EINVAL> error from B<pthread_create>(3)  if the guard size value is too large, leaving no space for the actual stack.)"
2058 msgstr ""
2059 "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n"
2060 "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n"
2061 "末尾に追加の領域を割り当てることが求められている。\n"
2062 "(このため、ガード領域が大きすぎて、\n"
2063 "実際のスタック用の場所がなくなってしまう場合、\n"
2064 "B<pthread_create>(3) で B<EINVAL> エラーが発生することになる。)"
2065
2066 #.  glibc includes the guardsize within the allocated stack size,
2067 #.  which looks pretty clearly to be in violation of POSIX.
2068 #.  Filed bug, 22 Oct 2008:
2069 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973
2070 #.  Older reports:
2071 #.  https//bugzilla.redhat.com/show_bug.cgi?id=435337
2072 #.  Reportedly, LinuxThreads did the right thing, allocating
2073 #.  extra space at the end of the stack:
2074 #.  http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html
2075 #. type: Plain text
2076 #: build/C/man3/pthread_attr_setguardsize.3:162
2077 msgid "The obsolete LinuxThreads implementation did the right thing, allocating extra space at the end of the stack for the guard area."
2078 msgstr ""
2079 "廃止予定の LinuxThreads 実装では、\n"
2080 "POSIX.1 で求められている通りの動作で、\n"
2081 "ガード領域がスタックの末尾に追加の領域が割り当てられる。"
2082
2083 #. type: Plain text
2084 #: build/C/man3/pthread_attr_setguardsize.3:165
2085 msgid "See B<pthread_getattr_np>(3)."
2086 msgstr "B<pthread_getattr_np>(3) を参照。"
2087
2088 #. type: Plain text
2089 #: build/C/man3/pthread_attr_setguardsize.3:173
2090 msgid "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2091 msgstr "B<mmap>(2), B<mprotect>(2), B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2092
2093 #. type: TH
2094 #: build/C/man3/pthread_attr_setinheritsched.3:26
2095 #, no-wrap
2096 msgid "PTHREAD_ATTR_SETINHERITSCHED"
2097 msgstr "PTHREAD_ATTR_SETINHERITSCHED"
2098
2099 #. type: TH
2100 #: build/C/man3/pthread_attr_setinheritsched.3:26
2101 #: build/C/man3/pthread_attr_setschedparam.3:26
2102 #: build/C/man3/pthread_attr_setschedpolicy.3:26 build/C/man7/pthreads.7:26
2103 #, no-wrap
2104 msgid "2014-05-21"
2105 msgstr "2014-05-21"
2106
2107 #. type: Plain text
2108 #: build/C/man3/pthread_attr_setinheritsched.3:30
2109 msgid "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit-scheduler attribute in thread attributes object"
2110 msgstr "pthread_attr_setinheritsched, pthread_attr_getinheritsched - スレッド属性オブジェクトの inherit-scheduler 属性の設定/取得を行う"
2111
2112 #. type: Plain text
2113 #: build/C/man3/pthread_attr_setinheritsched.3:38
2114 #, no-wrap
2115 msgid ""
2116 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2117 "B<                                 int >I<inheritsched>B<);>\n"
2118 "B<int pthread_attr_getinheritsched(const pthread_attr_t *>I<attr>B<,>\n"
2119 "B<                                 int *>I<inheritsched>B<);>\n"
2120 msgstr ""
2121 "B<int pthread_attr_setinheritsched(pthread_attr_t *>I<attr>B<,>\n"
2122 "B<                                 int >I<inheritsched>B<);>\n"
2123 "B<int pthread_attr_getinheritsched(const pthread_attr_t *>I<attr>B<,>\n"
2124 "B<                                 int *>I<inheritsched>B<);>\n"
2125
2126 #. type: Plain text
2127 #: build/C/man3/pthread_attr_setinheritsched.3:55
2128 msgid "The B<pthread_attr_setinheritsched>()  function sets the inherit-scheduler attribute of the thread attributes object referred to by I<attr> to the value specified in I<inheritsched>.  The inherit-scheduler attribute determines whether a thread created using the thread attributes object I<attr> will inherit its scheduling attributes from the calling thread or whether it will take them from I<attr>."
2129 msgstr "B<pthread_attr_setinheritsched>() 関数は、 I<attr> が参照するスレッド属性オブジェクトの inherit-scheduler 属性を I<inheritsched> で指定された値に設定する。 inherit-scheduler 属性により、スレッド属性オブジェクト I<attr> を使って作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承するか、 I<attr> からスケジューリング属性を取得するかが決定される。"
2130
2131 #. type: Plain text
2132 #: build/C/man3/pthread_attr_setinheritsched.3:64
2133 msgid "The following scheduling attributes are affected by the inherit-scheduler attribute: scheduling policy (B<pthread_attr_setschedpolicy>(3)), scheduling priority (B<pthread_attr_setschedparam>(3)), and contention scope (B<pthread_attr_setscope>(3))."
2134 msgstr "次に挙げるスケジューリング属性は inherit-scheduler 属性の影響を受ける: スケジューリングポリシー (B<pthread_attr_setschedpolicy>(3))、 スケジューリング優先度 (B<pthread_attr_setschedparam>(3))、 contention scope (B<pthread_attr_setscope>(3))。"
2135
2136 #. type: Plain text
2137 #: build/C/man3/pthread_attr_setinheritsched.3:67
2138 msgid "The following values may be specified in I<inheritsched>:"
2139 msgstr "以下の値を I<inheritsched> に指定できる。"
2140
2141 #. type: TP
2142 #: build/C/man3/pthread_attr_setinheritsched.3:67
2143 #, no-wrap
2144 msgid "B<PTHREAD_INHERIT_SCHED>"
2145 msgstr "B<PTHREAD_INHERIT_SCHED>"
2146
2147 #. type: Plain text
2148 #: build/C/man3/pthread_attr_setinheritsched.3:75
2149 msgid "Threads that are created using I<attr> inherit scheduling attributes from the creating thread; the scheduling attributes in I<attr> are ignored."
2150 msgstr ""
2151 "I<attr> を使って作成されたスレッドは、\n"
2152 "スレッドを作成するスレッドからスケジューリング属性を継承する。\n"
2153 "I<attr> 内のスケジューリング属性は無視される。"
2154
2155 #. type: TP
2156 #: build/C/man3/pthread_attr_setinheritsched.3:75
2157 #, no-wrap
2158 msgid "B<PTHREAD_EXPLICIT_SCHED>"
2159 msgstr "B<PTHREAD_EXPLICIT_SCHED>"
2160
2161 #.  FIXME Document the defaults for scheduler settings
2162 #. type: Plain text
2163 #: build/C/man3/pthread_attr_setinheritsched.3:82
2164 msgid "Threads that are created using I<attr> take their scheduling attributes from the values specified by the attributes object."
2165 msgstr ""
2166 "I<attr> を使って作成されたスレッドは、スレッド属性オブジェクトで\n"
2167 "指定された値からスケジューリング属性を取得する。"
2168
2169 #. type: Plain text
2170 #: build/C/man3/pthread_attr_setinheritsched.3:86
2171 msgid "The default setting of the inherit-scheduler attribute in a newly initialized thread attributes object is B<PTHREAD_INHERIT_SCHED>."
2172 msgstr "新たに初期化されたスレッド属性オブジェクトの inherit-scheduler 属性のデフォルト設定は B<PTHREAD_INHERIT_SCHED> である。"
2173
2174 #. type: Plain text
2175 #: build/C/man3/pthread_attr_setinheritsched.3:93
2176 msgid "The B<pthread_attr_getinheritsched>()  returns the inherit-scheduler attribute of the thread attributes object I<attr> in the buffer pointed to by I<inheritsched>."
2177 msgstr "B<pthread_attr_getinheritsched>() は、 スレッド属性オブジェクト I<attr> の inherit-scheduler 属性を I<inheritsched> が指すバッファーに入れて返す。"
2178
2179 #. type: Plain text
2180 #: build/C/man3/pthread_attr_setinheritsched.3:99
2181 msgid "B<pthread_attr_setinheritsched>()  can fail with the following error:"
2182 msgstr "B<pthread_attr_setinheritsched>() は以下のエラーで失敗する場合がある。"
2183
2184 #. type: Plain text
2185 #: build/C/man3/pthread_attr_setinheritsched.3:103
2186 msgid "Invalid value in I<inheritsched>."
2187 msgstr "I<inheritsched> に無効な値が指定された。"
2188
2189 #.  .SH VERSIONS
2190 #.  Available since glibc 2.0.
2191 #. type: Plain text
2192 #: build/C/man3/pthread_attr_setinheritsched.3:110
2193 msgid "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made to set the attribute to an unsupported value\") for B<pthread_attr_setinheritsched>()."
2194 msgstr ""
2195 "POSIX.1-2001 では、 B<pthread_attr_setinheritsched>() に関して\n"
2196 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2197 "も追加で規定されている。"
2198
2199 #. type: Plain text
2200 #: build/C/man3/pthread_attr_setinheritsched.3:117
2201 msgid "The B<pthread_attr_setinheritsched>()  and B<pthread_attr_getinheritsched>()  functions are thread-safe."
2202 msgstr "関数 B<pthread_attr_setinheritsched>() と B<pthread_attr_getinheritsched>() はスレッドセーフである。"
2203
2204 #.  FIXME . Track status of the following bug:
2205 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7007
2206 #. type: Plain text
2207 #: build/C/man3/pthread_attr_setinheritsched.3:135
2208 msgid "As at glibc 2.8, if a thread attributes object is initialized using B<pthread_attr_init>(3), then the scheduling policy of the attributes object is set to B<SCHED_OTHER> and the scheduling priority is set to 0.  However, if the inherit-scheduler attribute is then set to B<PTHREAD_EXPLICIT_SCHED>, then a thread created using the attribute object wrongly inherits its scheduling attributes from the creating thread.  This bug does not occur if either the scheduling policy or scheduling priority attribute is explicitly set in the thread attributes object before calling B<pthread_create>(3)."
2209 msgstr "glibc 2.8 の時点では、スレッド属性オブジェクトが B<pthread_attr_init>(3) を使って初期化された場合、 スレッド属性オブジェクトのスケジューリングポリシーが B<SCHED_OTHER> に、 スケジューリング優先度が 0 に設定される。一方、その後 inherit-scheduler 属性に B<PTHREAD_EXPLICIT_SCHED> が設定されると、このスレッド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するスレッドのスケジューリング属性が間違って継承されてしまう。 B<pthread_create>(3) を呼び出す前にスケジューリングポリシー属性かスケジューリング優先度属性のどちらかが明示的に設定された場合には、 このバグは発生しない。"
2210
2211 #. type: Plain text
2212 #: build/C/man3/pthread_attr_setinheritsched.3:138
2213 #: build/C/man3/pthread_attr_setschedparam.3:116
2214 #: build/C/man3/pthread_attr_setschedpolicy.3:112
2215 msgid "See B<pthread_setschedparam>(3)."
2216 msgstr "B<pthread_setschedparam>(3) を参照。"
2217
2218 #. type: Plain text
2219 #: build/C/man3/pthread_attr_setinheritsched.3:150
2220 msgid "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2221 msgstr "B<pthread_attr_init>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_attr_setscope>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2222
2223 #. type: TH
2224 #: build/C/man3/pthread_attr_setschedparam.3:26
2225 #, no-wrap
2226 msgid "PTHREAD_ATTR_SETSCHEDPARAM"
2227 msgstr "PTHREAD_ATTR_SETSCHEDPARAM"
2228
2229 #. type: Plain text
2230 #: build/C/man3/pthread_attr_setschedparam.3:30
2231 msgid "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling parameter attributes in thread attributes object"
2232 msgstr ""
2233 "pthread_attr_setschedparam, pthread_attr_getschedparam - \n"
2234 "スレッド属性オブジェクトのスケジューリングパラメーター属性の設定/取得を行う"
2235
2236 #. type: Plain text
2237 #: build/C/man3/pthread_attr_setschedparam.3:38
2238 #, no-wrap
2239 msgid ""
2240 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2241 "B<                               const struct sched_param *>I<param>B<);>\n"
2242 "B<int pthread_attr_getschedparam(const pthread_attr_t *>I<attr>B<,>\n"
2243 "B<                               struct sched_param *>I<param>B<);>\n"
2244 msgstr ""
2245 "B<int pthread_attr_setschedparam(pthread_attr_t *>I<attr>B<,>\n"
2246 "B<                               const struct sched_param *>I<param>B<);>\n"
2247 "B<int pthread_attr_getschedparam(const pthread_attr_t *>I<attr>B<,>\n"
2248 "B<                               struct sched_param *>I<param>B<);>\n"
2249
2250 #. type: Plain text
2251 #: build/C/man3/pthread_attr_setschedparam.3:52
2252 msgid "The B<pthread_attr_setschedparam>()  function sets the scheduling parameter attributes of the thread attributes object referred to by I<attr> to the values specified in the buffer pointed to by I<param>.  These attributes determine the scheduling parameters of a thread created using the thread attributes object I<attr>."
2253 msgstr ""
2254 "B<pthread_attr_setschedparam>() 関数は、\n"
2255 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2256 "パラメーター属性を I<param> が指すバッファーで指定された値に設定する。\n"
2257 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2258 "作成されるスレッドのスケジューリングパラメーターが決定される。"
2259
2260 #. type: Plain text
2261 #: build/C/man3/pthread_attr_setschedparam.3:59
2262 msgid "The B<pthread_attr_getschedparam>()  returns the scheduling parameter attributes of the thread attributes object I<attr> in the buffer pointed to by I<param>."
2263 msgstr ""
2264 "B<pthread_attr_getschedparam>() は、\n"
2265 "スレッド属性オブジェクト I<attr> のスケジューリングパラメーター属性を\n"
2266 "I<param> が指すバッファーに入れて返す。"
2267
2268 #. type: Plain text
2269 #: build/C/man3/pthread_attr_setschedparam.3:61
2270 msgid "Scheduling parameters are maintained in the following structure:"
2271 msgstr "スケジューリングパラメーターは以下の構造体で管理される。"
2272
2273 #. type: Plain text
2274 #: build/C/man3/pthread_attr_setschedparam.3:67
2275 #: build/C/man3/pthread_setschedparam.3:69
2276 #, no-wrap
2277 msgid ""
2278 "struct sched_param {\n"
2279 "    int sched_priority;     /* Scheduling priority */\n"
2280 "};\n"
2281 msgstr ""
2282 "struct sched_param {\n"
2283 "    int sched_priority;     /* Scheduling priority */\n"
2284 "};\n"
2285
2286 #. type: Plain text
2287 #: build/C/man3/pthread_attr_setschedparam.3:74
2288 #: build/C/man3/pthread_setschedparam.3:76
2289 msgid "As can be seen, only one scheduling parameter is supported.  For details of the permitted ranges for scheduling priorities in each scheduling policy, see B<sched>(7)."
2290 msgstr "見て分かる通り、サポートされているスケジューリングパラメーターは一つだけである。各スケジューリングポリシーで許可されるスケジューリング優先度の詳細については、B<sched>(7) を参照のこと。"
2291
2292 #. type: Plain text
2293 #: build/C/man3/pthread_attr_setschedparam.3:85
2294 msgid "In order for the parameter setting made by B<pthread_attr_setschedparam>()  to have effect when calling B<pthread_create>(3), the caller must use B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2295 msgstr "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedparam>() で行ったパラメーター設定を有効にするには、 呼び出し側で B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければならない。"
2296
2297 #.  .SH VERSIONS
2298 #.  Available since glibc 2.0.
2299 #. type: Plain text
2300 #: build/C/man3/pthread_attr_setschedparam.3:100
2301 msgid "POSIX.1 documents B<EINVAL> and B<ENOTSUP> errors for B<pthread_attr_setschedparam>().  On Linux these functions always succeed (but portable and future-proof applications should nevertheless handle a possible error return)."
2302 msgstr ""
2303 "POSIX.1 では、\n"
2304 "B<pthread_attr_setschedparam>() について\n"
2305 "B<EINVAL> と B<ENOTSUP> が規定されている。\n"
2306 "Linux では、これらの関数は常に成功する\n"
2307 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
2308 "正のエラーの返り値を処理するようにすべきである)。"
2309
2310 #. type: Plain text
2311 #: build/C/man3/pthread_attr_setschedparam.3:107
2312 msgid "The B<pthread_attr_setschedparam>()  and B<pthread_attr_getschedparam>()  functions are thread-safe."
2313 msgstr "関数 B<pthread_attr_setschedparam>() と B<pthread_attr_getschedparam>() はスレッドセーフである。"
2314
2315 #. type: Plain text
2316 #: build/C/man3/pthread_attr_setschedparam.3:113
2317 msgid "See B<pthread_attr_setschedpolicy>(3)  for a list of the thread scheduling policies supported on Linux."
2318 msgstr ""
2319 "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n"
2320 "ついては、 B<pthread_attr_setschedpolicy>(3) を参照。"
2321
2322 #. type: Plain text
2323 #: build/C/man3/pthread_attr_setschedparam.3:128
2324 msgid "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2325 msgstr "B<sched_get_priority_min>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2326
2327 #. type: TH
2328 #: build/C/man3/pthread_attr_setschedpolicy.3:26
2329 #, no-wrap
2330 msgid "PTHREAD_ATTR_SETSCHEDPOLICY"
2331 msgstr "PTHREAD_ATTR_SETSCHEDPOLICY"
2332
2333 #. type: Plain text
2334 #: build/C/man3/pthread_attr_setschedpolicy.3:30
2335 msgid "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get scheduling policy attribute in thread attributes object"
2336 msgstr ""
2337 "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n"
2338 "オブジェクトのスケジューリングポリシー属性の設定/取得を行う"
2339
2340 #. type: Plain text
2341 #: build/C/man3/pthread_attr_setschedpolicy.3:38
2342 #, no-wrap
2343 msgid ""
2344 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2345 "B<int pthread_attr_getschedpolicy(const pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2346 msgstr ""
2347 "B<int pthread_attr_setschedpolicy(pthread_attr_t *>I<attr>B<, int >I<policy>B<);>\n"
2348 "B<int pthread_attr_getschedpolicy(const pthread_attr_t *>I<attr>B<, int >I<*policy>B<);>\n"
2349
2350 #. type: Plain text
2351 #: build/C/man3/pthread_attr_setschedpolicy.3:52
2352 msgid "The B<pthread_attr_setschedpolicy>()  function sets the scheduling policy attribute of the thread attributes object referred to by I<attr> to the value specified in I<policy>.  This attribute determines the scheduling policy of a thread created using the thread attributes object I<attr>."
2353 msgstr ""
2354 "B<pthread_attr_setschedpolicy>() 関数は、\n"
2355 "I<attr> が参照するスレッド属性オブジェクトのスケジューリング\n"
2356 "ポリシー属性を I<policy> で指定された値に設定する。\n"
2357 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2358 "作成されるスレッドのスケジューリングポリシーが決定される。"
2359
2360 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
2361 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
2362 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
2363 #. type: Plain text
2364 #: build/C/man3/pthread_attr_setschedpolicy.3:65
2365 msgid "The supported values for I<policy> are B<SCHED_FIFO>, B<SCHED_RR>, and B<SCHED_OTHER>, with the semantics described in B<sched>(7)."
2366 msgstr "I<policy> に指定できる値は B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER> である。それぞれの意味は B<sched>(7) で説明している通りである。"
2367
2368 #. type: Plain text
2369 #: build/C/man3/pthread_attr_setschedpolicy.3:72
2370 msgid "The B<pthread_attr_getschedpolicy>()  returns the scheduling policy attribute of the thread attributes object I<attr> in the buffer pointed to by I<policy>."
2371 msgstr ""
2372 "B<pthread_attr_getschedpolicy>() は、\n"
2373 "スレッド属性オブジェクト I<attr> のスケジューリングポリシー属性を\n"
2374 "I<policy> が指すバッファーに入れて返す。"
2375
2376 #. type: Plain text
2377 #: build/C/man3/pthread_attr_setschedpolicy.3:83
2378 msgid "In order for the policy setting made by B<pthread_attr_setschedpolicy>()  to have effect when calling B<pthread_create>(3), the caller must use B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2379 msgstr "B<pthread_create>(3) を呼び出した際に B<pthread_attr_setschedpolicy>() で行ったポリシー設定を有効にするには、 呼び出し側で B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければならない。"
2380
2381 #. type: Plain text
2382 #: build/C/man3/pthread_attr_setschedpolicy.3:89
2383 msgid "B<pthread_attr_setschedpolicy>()  can fail with the following error:"
2384 msgstr "B<pthread_attr_setschedpolicy>() は以下のエラーで失敗する場合がある。"
2385
2386 #. type: Plain text
2387 #: build/C/man3/pthread_attr_setschedpolicy.3:93
2388 msgid "Invalid value in I<policy>."
2389 msgstr "I<policy> に無効な値が指定された。"
2390
2391 #.  .SH VERSIONS
2392 #.  Available since glibc 2.0.
2393 #. type: Plain text
2394 #: build/C/man3/pthread_attr_setschedpolicy.3:100
2395 msgid "POSIX.1-2001 also documents an optional B<ENOTSUP> error (\"attempt was made to set the attribute to an unsupported value\") for B<pthread_attr_setschedpolicy>()."
2396 msgstr ""
2397 "POSIX.1-2001 では、 B<pthread_attr_setschedpolicy>() に関して\n"
2398 "エラー B<ENOTSUP> (\"サポートされていない値を属性に設定しようとした\")\n"
2399 "も追加で規定されている。"
2400
2401 #. type: Plain text
2402 #: build/C/man3/pthread_attr_setschedpolicy.3:107
2403 msgid "The B<pthread_attr_setschedpolicy>()  and B<pthread_attr_getschedpolicy>()  functions are thread-safe."
2404 msgstr "関数 B<pthread_attr_setschedpolicy>() と B<pthread_attr_getschedpolicy>() はスレッドセーフである。"
2405
2406 #. type: Plain text
2407 #: build/C/man3/pthread_attr_setschedpolicy.3:123
2408 msgid "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2409 msgstr "B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_create>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
2410
2411 #. type: TH
2412 #: build/C/man3/pthread_attr_setscope.3:26
2413 #, no-wrap
2414 msgid "PTHREAD_ATTR_SETSCOPE"
2415 msgstr "PTHREAD_ATTR_SETSCOPE"
2416
2417 #. type: Plain text
2418 #: build/C/man3/pthread_attr_setscope.3:30
2419 msgid "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope attribute in thread attributes object"
2420 msgstr ""
2421 "pthread_attr_setscope, pthread_attr_getscope - \n"
2422 "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う"
2423
2424 #. type: Plain text
2425 #: build/C/man3/pthread_attr_setscope.3:38
2426 #, no-wrap
2427 msgid ""
2428 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2429 "B<int pthread_attr_getscope(const pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2430 msgstr ""
2431 "B<int pthread_attr_setscope(pthread_attr_t *>I<attr>B<, int >I<scope>B<);>\n"
2432 "B<int pthread_attr_getscope(const pthread_attr_t *>I<attr>B<, int *>I<scope>B<);>\n"
2433
2434 #. type: Plain text
2435 #: build/C/man3/pthread_attr_setscope.3:53
2436 msgid "The B<pthread_attr_setscope>()  function sets the contention scope attribute of the thread attributes object referred to by I<attr> to the value specified in I<scope>.  The contention scope attribute defines the set of threads against which a thread competes for resources such as the CPU.  POSIX.1-2001 specifies two possible values for I<scope>:"
2437 msgstr ""
2438 "B<pthread_attr_setscope>() 関数は、\n"
2439 "I<attr> が参照するスレッド属性オブジェクトの contention scope\n"
2440 "属性を I<scope> で指定された値に設定する。\n"
2441 "contention scope 属性により、\n"
2442 "スレッドが CPU などのリソースを取り合うスレッド集合が規定される。\n"
2443 "POSIX.1-2001 では I<scope> に指定する値として 2 つの値が規定されている。"
2444
2445 #. type: TP
2446 #: build/C/man3/pthread_attr_setscope.3:53
2447 #, no-wrap
2448 msgid "B<PTHREAD_SCOPE_SYSTEM>"
2449 msgstr "B<PTHREAD_SCOPE_SYSTEM>"
2450
2451 #. type: Plain text
2452 #: build/C/man3/pthread_attr_setscope.3:61
2453 msgid "The thread competes for resources with all other threads in all processes on the system that are in the same scheduling allocation domain (a group of one or more processors).  B<PTHREAD_SCOPE_SYSTEM> threads are scheduled relative to one another according to their scheduling policy and priority."
2454 msgstr ""
2455 "スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ\n"
2456 "のグループ) にある、システム上の全てのプロセスの自分以外の全ての\n"
2457 "スレッドとリソースを取り合う。 \n"
2458 "B<PTHREAD_SCOPE_SYSTEM> のスレッドは、スケジューリングポリシーと\n"
2459 "優先度に基づき、互いに相対的にスケジューリングされる。"
2460
2461 #. type: TP
2462 #: build/C/man3/pthread_attr_setscope.3:61
2463 #, no-wrap
2464 msgid "B<PTHREAD_SCOPE_PROCESS>"
2465 msgstr "B<PTHREAD_SCOPE_PROCESS>"
2466
2467 #. type: Plain text
2468 #: build/C/man3/pthread_attr_setscope.3:76
2469 msgid "The thread competes for resources with all other threads in the same process that were also created with the B<PTHREAD_SCOPE_PROCESS> contention scope.  B<PTHREAD_SCOPE_PROCESS> threads are scheduled relative to other threads in the process according to their scheduling policy and priority.  POSIX.1-2001 leaves it unspecified how these threads contend with other threads in other process on the system or with other threads in the same process that were created with the B<PTHREAD_SCOPE_SYSTEM> contention scope."
2470 msgstr ""
2471 "スレッドは、contention scope が B<PTHREAD_SCOPE_PROCESS> で作成された\n"
2472 "同じプロセスの自分以外の全てのスレッドとリソースを取り合う。\n"
2473 "B<PTHREAD_SCOPE_PROCESS> のスレッドは、スケジューリングポリシーと優先度\n"
2474 "に基づき、同じプロセスの他のスレッドと相対的にスケジューリングされる。\n"
2475 "POSIX.1-2001 では、これらのスレッドがシステム上の他のプロセスのスレッド\n"
2476 "や同じプロセス内の contention scope が B<PTHREAD_SCOPE_SYSTEM> で作成\n"
2477 "された他のスレッドとどのようにリソースを取り合うかは、\n"
2478 "規定されないままになっている。"
2479
2480 #. type: Plain text
2481 #: build/C/man3/pthread_attr_setscope.3:83
2482 msgid "POSIX.1-2001 requires that an implementation support at least one of these contention scopes.  Linux supports B<PTHREAD_SCOPE_SYSTEM>, but not B<PTHREAD_SCOPE_PROCESS>."
2483 msgstr "POSIX.1-2001 で求められているのは、スレッド実装がこれらの contention scope のうち少なくとも 1 つをサポートすることだけである。 Linux は B<PTHREAD_SCOPE_SYSTEM> をサポートしているが、 B<PTHREAD_SCOPE_PROCESS> はサポートしていない。"
2484
2485 #. type: Plain text
2486 #: build/C/man3/pthread_attr_setscope.3:95
2487 msgid "On systems that support multiple contention scopes, then, in order for the parameter setting made by B<pthread_attr_setscope>()  to have effect when calling B<pthread_create>(3), the caller must use B<pthread_attr_setinheritsched>(3)  to set the inherit-scheduler attribute of the attributes object I<attr> to B<PTHREAD_EXPLICIT_SCHED>."
2488 msgstr "複数の contention scope をサポートしているシステムで、 B<pthread_create>(3) を呼び出した際に B<pthread_attr_setscope>() で行ったパラメーター設定を有効にするには、 呼び出し側で B<pthread_attr_setinheritsched>(3) を使って 属性オブジェクト I<attr> の inherit-scheduler 属性を B<PTHREAD_EXPLICIT_SCHED> に設定しておかなければならない。"
2489
2490 #. type: Plain text
2491 #: build/C/man3/pthread_attr_setscope.3:103
2492 msgid "The B<pthread_attr_getscope>()  function returns the contention scope attribute of the thread attributes object referred to by I<attr> in the buffer pointed to by I<scope>."
2493 msgstr ""
2494 "B<pthread_attr_getscope>() は、\n"
2495 "スレッド属性オブジェクト I<attr> の contention scope 属性を\n"
2496 "I<scope> が指すバッファーに入れて返す。"
2497
2498 #. type: Plain text
2499 #: build/C/man3/pthread_attr_setscope.3:109
2500 msgid "B<pthread_attr_setscope>()  can fail with the following errors:"
2501 msgstr "B<pthread_attr_setscope>() は以下のエラーで失敗する場合がある。"
2502
2503 #. type: Plain text
2504 #: build/C/man3/pthread_attr_setscope.3:113
2505 msgid "An invalid value was specified in I<scope>."
2506 msgstr "I<scope> に無効な値が指定された。"
2507
2508 #. type: TP
2509 #: build/C/man3/pthread_attr_setscope.3:113
2510 #, no-wrap
2511 msgid "B<ENOTSUP>"
2512 msgstr "B<ENOTSUP>"
2513
2514 #. type: Plain text
2515 #: build/C/man3/pthread_attr_setscope.3:119
2516 msgid "I<scope> specified the value B<PTHREAD_SCOPE_PROCESS>, which is not supported on Linux."
2517 msgstr ""
2518 "I<scope> に値 B<PTHREAD_SCOPE_PROCESS> が指定された。\n"
2519 "この値は Linux でサポートされていない。"
2520
2521 #. type: Plain text
2522 #: build/C/man3/pthread_attr_setscope.3:126
2523 msgid "The B<pthread_attr_setscope>()  and B<pthread_attr_getscope>()  functions are thread-safe."
2524 msgstr "関数 B<pthread_attr_setscope>() と B<pthread_attr_getscope>() はスレッドセーフである。"
2525
2526 #. type: Plain text
2527 #: build/C/man3/pthread_attr_setscope.3:136
2528 msgid "The B<PTHREAD_SCOPE_SYSTEM> contention scope typically indicates that a user-space thread is bound directly to a single kernel-scheduling entity.  This is the case on Linux for the obsolete LinuxThreads implementation and the modern NPTL implementation, which are both 1:1 threading implementations."
2529 msgstr ""
2530 "B<PTHREAD_SCOPE_SYSTEM> contention scope では、通常は、一つの\n"
2531 "ユーザー空間スレッドは一つのカーネルスケジューリングエンティティに\n"
2532 "直接結び付けられる。\n"
2533 "Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに\n"
2534 "該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。"
2535
2536 #. type: Plain text
2537 #: build/C/man3/pthread_attr_setscope.3:139
2538 msgid "POSIX.1-2001 specifies that the default contention scope is implementation-defined."
2539 msgstr ""
2540 "POSIX.1-2001 では、 contention scope 属性のデフォルト値は\n"
2541 "実装時で定義されるものと規定されている。"
2542
2543 #. type: Plain text
2544 #: build/C/man3/pthread_attr_setscope.3:149
2545 msgid "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2546 msgstr "B<pthread_attr_init>(3), B<pthread_attr_setaffinity_np>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthreads>(7)"
2547
2548 #. type: TH
2549 #: build/C/man3/pthread_attr_setstack.3:26
2550 #, no-wrap
2551 msgid "PTHREAD_ATTR_SETSTACK"
2552 msgstr "PTHREAD_ATTR_SETSTACK"
2553
2554 #. type: Plain text
2555 #: build/C/man3/pthread_attr_setstack.3:30
2556 msgid "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in thread attributes object"
2557 msgstr ""
2558 "pthread_attr_setstack, pthread_attr_getstack - \n"
2559 "スレッド属性オブジェクトのスタック属性の設定/取得を行う"
2560
2561 #. type: Plain text
2562 #: build/C/man3/pthread_attr_setstack.3:38
2563 #, no-wrap
2564 msgid ""
2565 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2566 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2567 "B<int pthread_attr_getstack(const pthread_attr_t *>I<attr>B<,>\n"
2568 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2569 msgstr ""
2570 "B<int pthread_attr_setstack(pthread_attr_t *>I<attr>B<,>\n"
2571 "B<                          void *>I<stackaddr>B<, size_t >I<stacksize>B<);>\n"
2572 "B<int pthread_attr_getstack(const pthread_attr_t *>I<attr>B<,>\n"
2573 "B<                          void **>I<stackaddr>B<, size_t *>I<stacksize>B<);>\n"
2574
2575 #. type: Plain text
2576 #: build/C/man3/pthread_attr_setstack.3:45
2577 #: build/C/man3/pthread_cleanup_push_defer_np.3:44
2578 #: build/C/man3/pthread_kill.3:41
2579 #: build/C/man3/pthread_rwlockattr_setkind_np.3:44
2580 #: build/C/man3/pthread_sigmask.3:42 build/C/man3/pthread_sigqueue.3:42
2581 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
2582 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
2583
2584 #. type: Plain text
2585 #: build/C/man3/pthread_attr_setstack.3:50
2586 msgid "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2587 msgstr "B<pthread_attr_getstack>(), B<pthread_attr_setstack>():"
2588
2589 #. type: Plain text
2590 #: build/C/man3/pthread_attr_setstack.3:52
2591 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2592 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600"
2593
2594 #. type: Plain text
2595 #: build/C/man3/pthread_attr_setstack.3:68
2596 msgid "The B<pthread_attr_setstack>()  function sets the stack address and stack size attributes of the thread attributes object referred to by I<attr> to the values specified in I<stackaddr> and I<stacksize>, respectively.  These attributes specify the location and size of the stack that should be used by a thread that is created using the thread attributes object I<attr>."
2597 msgstr ""
2598 "B<pthread_attr_setstack>() 関数は、\n"
2599 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス属性と\n"
2600 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> で\n"
2601 "指定された値に設定する。\n"
2602 "これらの属性により、スレッド属性オブジェクト I<attr> を使って\n"
2603 "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。"
2604
2605 #. type: Plain text
2606 #: build/C/man3/pthread_attr_setstack.3:74
2607 msgid "I<stackaddr> should point to the lowest addressable byte of a buffer of I<stacksize> bytes that was allocated by the caller.  The pages of the allocated buffer should be both readable and writable."
2608 msgstr ""
2609 "I<stackaddr> は、呼び出し側で割り当てた、大きさが I<stacksize> バイトの\n"
2610 "バッファー内の指定できる最小のアドレスバイトを指すべきである。\n"
2611 "割り当てられたバッファーのページは読み書き両方が可能なページとなっている\n"
2612 "べきである。"
2613
2614 #. type: Plain text
2615 #: build/C/man3/pthread_attr_setstack.3:85
2616 msgid "The B<pthread_attr_getstack>()  function returns the stack address and stack size attributes of the thread attributes object referred to by I<attr> in the buffers pointed to by I<stackaddr> and I<stacksize>, respectively."
2617 msgstr ""
2618 "B<pthread_attr_getstack>() 関数は、\n"
2619 "スレッド属性オブジェクト I<attr> のスタックアドレス属性と\n"
2620 "スタックサイズ属性をそれぞれ I<stackaddr> と I<stacksize> が\n"
2621 "指すバッファーに入れて返す。"
2622
2623 #. type: Plain text
2624 #: build/C/man3/pthread_attr_setstack.3:91
2625 msgid "B<pthread_attr_setstack>()  can fail with the following error:"
2626 msgstr "B<pthread_attr_setstack>() は以下のエラーで失敗する場合がある。"
2627
2628 #. type: Plain text
2629 #: build/C/man3/pthread_attr_setstack.3:102
2630 msgid "I<stacksize> is less than B<PTHREAD_STACK_MIN> (16384) bytes.  On some systems, this error may also occur if I<stackaddr> or I<stackaddr\\ +\\ stacksize> is not suitably aligned."
2631 msgstr ""
2632 "I<stacksize> が B<PTHREAD_STACK_MIN> (16384) よりも小さい。\n"
2633 "システムによっては、 I<stackaddr> か\n"
2634 "I<stackaddr\\ +\\ stacksize> のアライメントが適切でない場合にも\n"
2635 "このエラーが発生する。"
2636
2637 #. type: Plain text
2638 #: build/C/man3/pthread_attr_setstack.3:110
2639 msgid "POSIX.1-2001 also documents an B<EACCES> error if the stack area described by I<stackaddr> and I<stacksize> is not both readable and writable by the caller."
2640 msgstr ""
2641 "POSIX.1-2001 では エラー B<EACCES> も規定されており、\n"
2642 "このエラーは I<stackaddr> と I<stacksize> で規定されるスタック領域に\n"
2643 "呼び出し側から読み書き両方のアクセスができない状況を表す。"
2644
2645 #. type: Plain text
2646 #: build/C/man3/pthread_attr_setstack.3:112
2647 msgid "These functions are provided by glibc since version 2.2."
2648 msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。"
2649
2650 #. type: Plain text
2651 #: build/C/man3/pthread_attr_setstack.3:119
2652 msgid "The B<pthread_attr_setstack>()  and B<pthread_attr_getstack>()  functions are thread-safe."
2653 msgstr "関数 B<pthread_attr_setstack>() と B<pthread_attr_getstack>() はスレッドセーフである。"
2654
2655 #. type: Plain text
2656 #: build/C/man3/pthread_attr_setstack.3:129
2657 msgid "These functions are provided for applications that must ensure that a thread's stack is placed in a particular location.  For most applications, this is not necessary, and the use of these functions should be avoided.  (Use B<pthread_attr_setstacksize>(3)  if an application simply requires a stack size other than the default.)"
2658 msgstr ""
2659 "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n"
2660 "しなければならないアプリケーションのために提供されている。\n"
2661 "ほとんどのアプリケーションでは、このようなことは必要なく、\n"
2662 "これらの関数を使うのは避けるべきである。\n"
2663 "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n"
2664 "必要がある場合には B<pthread_attr_setstacksize>(3) を使うこと)"
2665
2666 #. type: Plain text
2667 #: build/C/man3/pthread_attr_setstack.3:140
2668 msgid "When an application employs B<pthread_attr_setstack>(), it takes over the responsibility of allocating the stack.  Any guard size value that was set using B<pthread_attr_setguardsize>(3)  is ignored.  If deemed necessary, it is the application's responsibility to allocate a guard area (one or more pages protected against reading and writing)  to handle the possibility of stack overflow."
2669 msgstr ""
2670 "アプリケーションが B<pthread_attr_setstack>() を利用する際には、\n"
2671 "スタックの割り当てに責任を持つ必要がある。\n"
2672 "B<pthread_attr_setguardsize>(3) を使って設定された\n"
2673 "guard size の値は無視される。\n"
2674 "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n"
2675 "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n"
2676 "スタックオーバーフローの可能性に対処するようにする必要がある。"
2677
2678 #. type: Plain text
2679 #: build/C/man3/pthread_attr_setstack.3:151
2680 msgid "The address specified in I<stackaddr> should be suitably aligned: for full portability, align it on a page boundary (I<sysconf(_SC_PAGESIZE)>).  B<posix_memalign>(3)  may be useful for allocation.  Probably, I<stacksize> should also be a multiple of the system page size."
2681 msgstr ""
2682 "I<stackaddr> に指定するアドレスは適切なアライメントとなっているべきである。\n"
2683 "完全な移植性を持たせるためには、\n"
2684 "ページ境界 (I<sysconf(_SC_PAGESIZE)>) に揃えること。\n"
2685 "割り当てには B<posix_memalign>(3) を使うとよい。\n"
2686 "たいていは、 I<stacksize> はシステムのページサイズの倍数とすべきである。"
2687
2688 #. type: Plain text
2689 #: build/C/man3/pthread_attr_setstack.3:159
2690 msgid "If I<attr> is used to create multiple threads, then the caller must change the stack address attribute between calls to B<pthread_create>(3); otherwise, the threads will attempt to use the same memory area for their stacks, and chaos will ensue."
2691 msgstr ""
2692 "一つの I<attr> を使って複数のスレッドを作成する場合、\n"
2693 "B<pthread_create>(3) の次の呼び出しを行う前に、\n"
2694 "呼び出し側でスタックアドレス属性を変更しなければならない。\n"
2695 "さもなければ、複数のスレッドがスタックとして同じメモリ領域を\n"
2696 "使おうとするため、訳の分からない状況が発生してしまう。"
2697
2698 #. type: Plain text
2699 #: build/C/man3/pthread_attr_setstack.3:174
2700 msgid "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2701 msgstr "B<mmap>(2), B<mprotect>(2), B<posix_memalign>(3), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), B<pthread_attr_setstackaddr>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2702
2703 #. type: TH
2704 #: build/C/man3/pthread_attr_setstackaddr.3:26
2705 #, no-wrap
2706 msgid "PTHREAD_ATTR_SETSTACKADDR"
2707 msgstr "PTHREAD_ATTR_SETSTACKADDR"
2708
2709 #. type: Plain text
2710 #: build/C/man3/pthread_attr_setstackaddr.3:30
2711 msgid "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address attribute in thread attributes object"
2712 msgstr ""
2713 "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n"
2714 "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う"
2715
2716 #. type: Plain text
2717 #: build/C/man3/pthread_attr_setstackaddr.3:38
2718 #, no-wrap
2719 msgid ""
2720 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
2721 "B<int pthread_attr_getstackaddr(const pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
2722 msgstr ""
2723 "B<int pthread_attr_setstackaddr(pthread_attr_t *>I<attr>B<, void *>I<stackaddr>B<);>\n"
2724 "B<int pthread_attr_getstackaddr(const pthread_attr_t *>I<attr>B<, void **>I<stackaddr>B<);>\n"
2725
2726 #. type: Plain text
2727 #: build/C/man3/pthread_attr_setstackaddr.3:49
2728 msgid "These functions are obsolete: B<do not use them.> Use B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3)  instead."
2729 msgstr ""
2730 "これらの関数は廃止予定であり、B<使用しないこと>。\n"
2731 "代わりに B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) を使うこと。"
2732
2733 #. type: Plain text
2734 #: build/C/man3/pthread_attr_setstackaddr.3:60
2735 msgid "The B<pthread_attr_setstackaddr>()  function sets the stack address attribute of the thread attributes object referred to by I<attr> to the value specified in I<stackaddr>.  This attribute specifies the location of the stack that should be used by a thread that is created using the thread attributes object I<attr>."
2736 msgstr ""
2737 "B<pthread_attr_setstackaddr>() 関数は、\n"
2738 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
2739 "属性を I<stackaddr> で指定された値に設定する。\n"
2740 "この属性により、スレッド属性オブジェクト I<attr> を使って\n"
2741 "作成されるスレッドが使用すべきスタックの位置が指定される。"
2742
2743 #. type: Plain text
2744 #: build/C/man3/pthread_attr_setstackaddr.3:66
2745 msgid "I<stackaddr> should point to a buffer of at least B<PTHREAD_STACK_MIN> bytes that was allocated by the caller.  The pages of the allocated buffer should be both readable and writable."
2746 msgstr ""
2747 "I<stackaddr> は呼び出し側が割り当てたバッファー (大きさは\n"
2748 "少なくとも B<PTHREAD_STACK_MIN> バイト)を指すべきである。\n"
2749 "割り当てられたバッファーのページは読み書き両方が可能なページと\n"
2750 "なっているべきである。"
2751
2752 #. type: Plain text
2753 #: build/C/man3/pthread_attr_setstackaddr.3:74
2754 msgid "The B<pthread_attr_getstackaddr>()  function returns the stack address attribute of the thread attributes object referred to by I<attr> in the buffer pointed to by I<stackaddr>."
2755 msgstr ""
2756 "B<pthread_attr_getstackaddr>() は、\n"
2757 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
2758 "I<stackaddr> が指すバッファーに入れて返す。"
2759
2760 #. type: Plain text
2761 #: build/C/man3/pthread_attr_setstackaddr.3:81
2762 msgid "No errors are defined (but applications should nevertheless handle a possible error return)."
2763 msgstr ""
2764 "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n"
2765 "返り値を処理するようにすべきである)。"
2766
2767 #. type: Plain text
2768 #: build/C/man3/pthread_attr_setstackaddr.3:90
2769 msgid "The B<pthread_attr_setstackaddr>()  and B<pthread_attr_getstackaddr>()  functions are thread-safe."
2770 msgstr "関数 B<pthread_attr_setstackaddr>() と B<pthread_attr_getstackaddr>() はスレッドセーフである。"
2771
2772 #. type: Plain text
2773 #: build/C/man3/pthread_attr_setstackaddr.3:93
2774 msgid "POSIX.1-2001 specifies these functions but marks them as obsolete.  POSIX.1-2008 removes the specification of these functions."
2775 msgstr ""
2776 "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n"
2777 "POSIX.1-2008 では、これらの関数の規定は削除されている。"
2778
2779 #. type: Plain text
2780 #: build/C/man3/pthread_attr_setstackaddr.3:117
2781 msgid "I<Do not use these functions!> They cannot be portably used, since they provide no way of specifying the direction of growth or the range of the stack.  For example, on architectures with a stack that grows downward, I<stackaddr> specifies the next address past the I<highest> address of the allocated stack area.  However, on architectures with a stack that grows upward, I<stackaddr> specifies the I<lowest> address in the allocated stack area.  By contrast, the I<stackaddr> used by B<pthread_attr_setstack>(3)  and B<pthread_attr_getstack>(3), is always a pointer to the lowest address in the allocated stack area (and the I<stacksize> argument specifies the range of the stack)."
2782 msgstr ""
2783 "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n"
2784 "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n"
2785 "かを指定する手段が提供されていないからである。\n"
2786 "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャー\n"
2787 "では、I<stackaddr> には割り当てられたスタック領域のI<最も大きな>アドレ\n"
2788 "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n"
2789 "方向) に伸びるアーキテクチャーでは、I<stackaddr> には割り当てられた\n"
2790 "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n"
2791 "B<pthread_attr_setstack>(3) と B<pthread_attr_getstack>(3) が使用する\n"
2792 "I<stackaddr> は、常に割り当てられたスタック領域の最も小さいアドレス\n"
2793 "へのポインターである (I<stacksize> 引き数はスタックの範囲を指定する)。"
2794
2795 #. type: Plain text
2796 #: build/C/man3/pthread_attr_setstackaddr.3:123
2797 msgid "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2798 msgstr "B<pthread_attr_init>(3), B<pthread_attr_setstack>(3), B<pthread_attr_setstacksize>(3), B<pthread_create>(3), B<pthreads>(7)"
2799
2800 #. type: TH
2801 #: build/C/man3/pthread_attr_setstacksize.3:26
2802 #, no-wrap
2803 msgid "PTHREAD_ATTR_SETSTACKSIZE"
2804 msgstr "PTHREAD_ATTR_SETSTACKSIZE"
2805
2806 #. type: Plain text
2807 #: build/C/man3/pthread_attr_setstacksize.3:30
2808 msgid "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size attribute in thread attributes object"
2809 msgstr ""
2810 "pthread_attr_setstacksize, pthread_attr_getstacksize - \n"
2811 "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う"
2812
2813 #. type: Plain text
2814 #: build/C/man3/pthread_attr_setstacksize.3:38
2815 #, no-wrap
2816 msgid ""
2817 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
2818 "B<int pthread_attr_getstacksize(const pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
2819 msgstr ""
2820 "B<int pthread_attr_setstacksize(pthread_attr_t *>I<attr>B<, size_t >I<stacksize>B<);>\n"
2821 "B<int pthread_attr_getstacksize(const pthread_attr_t *>I<attr>B<, size_t *>I<stacksize>B<);>\n"
2822
2823 #. type: Plain text
2824 #: build/C/man3/pthread_attr_setstacksize.3:49
2825 msgid "The B<pthread_attr_setstacksize>()  function sets the stack size attribute of the thread attributes object referred to by I<attr> to the value specified in I<stacksize>."
2826 msgstr ""
2827 "B<pthread_attr_setstacksize>() 関数は、\n"
2828 "I<attr> が参照するスレッド属性オブジェクトのスタックアドレス\n"
2829 "属性を I<stacksize> で指定された値に設定する。"
2830
2831 #. type: Plain text
2832 #: build/C/man3/pthread_attr_setstacksize.3:53
2833 msgid "The stack size attribute determines the minimum size (in bytes) that will be allocated for threads created using the thread attributes object I<attr>."
2834 msgstr ""
2835 "スタックサイズ属性により、\n"
2836 "スレッド属性オブジェクト I<attr> を使って作成されたスレッド\n"
2837 "に割り当てられる最小サイズ (バイト単位) が決定される。"
2838
2839 #. type: Plain text
2840 #: build/C/man3/pthread_attr_setstacksize.3:61
2841 msgid "The B<pthread_attr_getstacksize>()  function returns the stack size attribute of the thread attributes object referred to by I<attr> in the buffer pointed to by I<stacksize>."
2842 msgstr ""
2843 "B<pthread_attr_getstacksize>() は、\n"
2844 "スレッド属性オブジェクト I<attr> のスタックアドレス属性を\n"
2845 "I<stacksize> が指すバッファーに入れて返す。"
2846
2847 #. type: Plain text
2848 #: build/C/man3/pthread_attr_setstacksize.3:67
2849 msgid "B<pthread_attr_setstacksize>()  can fail with the following error:"
2850 msgstr "B<pthread_attr_setstacksize>() は以下のエラーで失敗する場合がある。"
2851
2852 #. type: Plain text
2853 #: build/C/man3/pthread_attr_setstacksize.3:72
2854 msgid "The stack size is less than B<PTHREAD_STACK_MIN> (16384) bytes."
2855 msgstr "スタックサイズが B<PTHREAD_STACK_MIN> (16384) バイト未満である。"
2856
2857 #.  e.g., MacOS
2858 #. type: Plain text
2859 #: build/C/man3/pthread_attr_setstacksize.3:81
2860 msgid "On some systems, B<pthread_attr_setstacksize>()  can fail with the error B<EINVAL> if I<stacksize> is not a multiple of the system page size."
2861 msgstr ""
2862 "いくつかのシステムでは、 B<pthread_attr_setstacksize>() は\n"
2863 "I<stacksize> がシステムのページサイズの倍数でない場合にも\n"
2864 "エラー B<EINVAL> で失敗する。"
2865
2866 #. type: Plain text
2867 #: build/C/man3/pthread_attr_setstacksize.3:90
2868 msgid "The B<pthread_attr_setstacksize>()  and B<pthread_attr_getstacksize>()  functions are thread-safe."
2869 msgstr "関数 B<pthread_attr_setstacksize>() と B<pthread_attr_getstacksize>() はスレッドセーフである。"
2870
2871 #. type: Plain text
2872 #: build/C/man3/pthread_attr_setstacksize.3:95
2873 msgid "For details on the default stack size of new threads, see B<pthread_create>(3)."
2874 msgstr ""
2875 "新しいスレッドのデフォルトのスタックサイズの詳細については\n"
2876 "B<pthread_create>(3) を参照。"
2877
2878 #. type: Plain text
2879 #: build/C/man3/pthread_attr_setstacksize.3:98
2880 msgid "A thread's stack size is fixed at the time of thread creation.  Only the main thread can dynamically grow its stack."
2881 msgstr ""
2882 "スレッドのスタックサイズは、スレッド作成時点では固定である。\n"
2883 "メインスレッドだけがスタックを動的に伸ばすことができる。"
2884
2885 #. type: Plain text
2886 #: build/C/man3/pthread_attr_setstacksize.3:103
2887 msgid "The B<pthread_attr_setstack>(3)  function allows an application to set both the size and location of a caller-allocated stack that is to be used by a thread."
2888 msgstr ""
2889 "B<pthread_attr_setstack>(3) 関数を使うと、\n"
2890 "アプリケーションは、スレッドが使用するスタックとして、\n"
2891 "呼び出し側で割り当てたスタックのサイズと場所を指定できる。"
2892
2893 #. type: Plain text
2894 #: build/C/man3/pthread_attr_setstacksize.3:115
2895 msgid "As at glibc 2.8, if the specified I<stacksize> is not a multiple of B<STACK_ALIGN> (16 bytes on most architectures), it may be rounded I<downward>, in violation of POSIX.1-2001, which says that the allocated stack will be at least I<stacksize> bytes."
2896 msgstr ""
2897 "glibc 2.8 の時点では、指定された I<stacksize> が B<STACK_ALIGN> \n"
2898 "(ほとんどのアーキテクチャーでは 16 バイト) の倍数でない場合、\n"
2899 "I<stacksize> はI<小さくなる方向に>に丸められる。\n"
2900 "これは POSIX.1-2001 に違反している。\n"
2901 "POSIX.1-2001 では、割り当てらたスタックの大きさは\n"
2902 "少なくとも I<stacksize> バイトになると書かれている。"
2903
2904 #. type: Plain text
2905 #: build/C/man3/pthread_attr_setstacksize.3:118
2906 #: build/C/man3/pthread_join.3:127
2907 msgid "See B<pthread_create>(3)."
2908 msgstr "B<pthread_create>(3) を参照。"
2909
2910 #. type: Plain text
2911 #: build/C/man3/pthread_attr_setstacksize.3:125
2912 msgid "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
2913 msgstr "B<getrlimit>(2), B<pthread_attr_init>(3), B<pthread_attr_setguardsize>(3), B<pthread_attr_setstack>(3), B<pthread_create>(3), B<pthreads>(7)"
2914
2915 #. type: TH
2916 #: build/C/man3/pthread_cancel.3:26
2917 #, no-wrap
2918 msgid "PTHREAD_CANCEL"
2919 msgstr "PTHREAD_CANCEL"
2920
2921 #. type: TH
2922 #: build/C/man3/pthread_cancel.3:26
2923 #, no-wrap
2924 msgid "2008-11-17"
2925 msgstr "2008-11-17"
2926
2927 #. type: Plain text
2928 #: build/C/man3/pthread_cancel.3:29
2929 msgid "pthread_cancel - send a cancellation request to a thread"
2930 msgstr "pthread_cancel - スレッドにキャンセル要求を送る"
2931
2932 #. type: Plain text
2933 #: build/C/man3/pthread_cancel.3:34
2934 #, no-wrap
2935 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
2936 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
2937
2938 #. type: Plain text
2939 #: build/C/man3/pthread_cancel.3:49
2940 msgid "The B<pthread_cancel>()  function sends a cancellation request to the thread I<thread>.  Whether and when the target thread reacts to the cancellation request depends on two attributes that are under the control of that thread: its cancelability I<state> and I<type>."
2941 msgstr ""
2942 "B<pthread_cancel>() 関数は指定されたスレッド I<thread> にキャンセル要求\n"
2943 "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n"
2944 "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n"
2945 "I<state> と I<type>により決まる。"
2946
2947 #. type: Plain text
2948 #: build/C/man3/pthread_cancel.3:61
2949 msgid "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), can be I<enabled> (the default for new threads) or I<disabled>.  If a thread has disabled cancellation, then a cancellation request remains queued until the thread enables cancellation.  If a thread has enabled cancellation, then its cancelability type determines when cancellation occurs."
2950 msgstr ""
2951 "あるスレッドの cancelability state は B<pthread_setcancelstate>(3) で\n"
2952 "設定され、I<enabled> と I<disabled> のいずれとなる (I<enabled> が新しい\n"
2953 "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n"
2954 "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n"
2955 "れたままになる。スレッドがキャンセルを有効にしていた場合、\n"
2956 "cancelability type によって、いつキャンセルが発生するかが決まる。"
2957
2958 #. type: Plain text
2959 #: build/C/man3/pthread_cancel.3:77
2960 msgid "A thread's cancellation type, determined by B<pthread_setcanceltype>(3), may be either I<asynchronous> or I<deferred> (the default for new threads).  Asynchronous cancelability means that the thread can be canceled at any time (usually immediately, but the system does not guarantee this).  Deferred cancelability means that cancellation will be delayed until the thread next calls a function that is a I<cancellation point>.  A list of functions that are or may be cancellation points is provided in B<pthreads>(7)."
2961 msgstr ""
2962 "スレッドのキャンセル種別 (cancelability type) は\n"
2963 "B<pthread_setcanceltype>(3) で設定され、I<asynchronous> か I<deferred>\n"
2964 "のいずれかとなる(I<deferred> が新しいスレッドのデフォルト値である)。\n"
2965 "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつで\n"
2966 "もキャンセルされることを意味する (通常はすぐにキャンセルされるが、\n"
2967 "システムがそのことを保証しているわけではない)。遅延キャンセル\n"
2968 "(deferred cancelability) では、そのスレッドが I<取り消しポイント\n"
2969 "(cancellation point)> となっている関数を次に呼び出すまでキャンセルが\n"
2970 "遅延される。取り消しポイントに設定されていたり設定\n"
2971 "したりできる関数のリストは B<pthreads>(7) に記載している。"
2972
2973 #. type: Plain text
2974 #: build/C/man3/pthread_cancel.3:81
2975 msgid "When a cancellation requested is acted on, the following steps occur for I<thread> (in this order):"
2976 msgstr ""
2977 "キャンセル要求が実行されると、\n"
2978 "I<thread> では以下のステップが (この順序で) 行われる。"
2979
2980 #. type: IP
2981 #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:69
2982 #, no-wrap
2983 msgid "1."
2984 msgstr "1."
2985
2986 #. type: Plain text
2987 #: build/C/man3/pthread_cancel.3:86
2988 msgid "Cancellation clean-up handlers are popped (in the reverse of the order in which they were pushed) and called.  (See B<pthread_cleanup_push>(3).)"
2989 msgstr ""
2990 "キャンセルクリーンアップハンドラが (push されたのと逆順で)\n"
2991 "取り出され (pop され)、呼び出される。\n"
2992 "(B<pthread_cleanup_push>(3) 参照)"
2993
2994 #. type: IP
2995 #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:73
2996 #, no-wrap
2997 msgid "2."
2998 msgstr "2."
2999
3000 #. type: Plain text
3001 #: build/C/man3/pthread_cancel.3:91
3002 msgid "Thread-specific data destructors are called, in an unspecified order.  (See B<pthread_key_create>(3).)"
3003 msgstr ""
3004 "スレッド固有データのデストラクタ (destructor) が呼び出される。\n"
3005 "呼び出し順序は規定されていない。\n"
3006 "(B<pthread_key_create>(3) 参照)"
3007
3008 #. type: IP
3009 #: build/C/man3/pthread_cancel.3:91 build/C/man3/pthread_cleanup_push.3:83
3010 #, no-wrap
3011 msgid "3."
3012 msgstr "3."
3013
3014 #. type: Plain text
3015 #: build/C/man3/pthread_cancel.3:95
3016 msgid "The thread is terminated.  (See B<pthread_exit>(3).)"
3017 msgstr "スレッドが終了される。 (B<pthread_exit>(3) 参照)"
3018
3019 #. type: Plain text
3020 #: build/C/man3/pthread_cancel.3:103
3021 msgid "The above steps happen asynchronously with respect to the B<pthread_cancel>()  call; the return status of B<pthread_cancel>()  merely informs the caller whether the cancellation request was successfully queued."
3022 msgstr ""
3023 "上記のステップは B<pthread_cancel>() の呼び出しとは非同期に行われる。\n"
3024 "B<pthread_cancel>() の返却ステータスは単にキャンセル要求が正常に\n"
3025 "キューに入れられたかどうかを呼び出し元に示すだけのものである。"
3026
3027 #. type: Plain text
3028 #: build/C/man3/pthread_cancel.3:112
3029 msgid "After a canceled thread has terminated, a join with that thread using B<pthread_join>(3)  obtains B<PTHREAD_CANCELED> as the thread's exit status.  (Joining with a thread is the only way to know that cancellation has completed.)"
3030 msgstr ""
3031 "キャンセルされたスレッドが終了された後に、\n"
3032 "B<pthread_join>(3) でそのスレッドを join すると、\n"
3033 "そのスレッドの終了ステータスとして B<PTHREAD_CANCELED> が得られる。\n"
3034 "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)"
3035
3036 #. type: Plain text
3037 #: build/C/man3/pthread_cancel.3:117
3038 msgid "On success, B<pthread_cancel>()  returns 0; on error, it returns a nonzero error number."
3039 msgstr ""
3040 "成功すると、 B<pthread_cancel>() は 0 を返す。\n"
3041 "エラーの場合、0 以外のエラー番号を返す。"
3042
3043 #. type: TP
3044 #: build/C/man3/pthread_cancel.3:118 build/C/man3/pthread_detach.3:59
3045 #: build/C/man3/pthread_getcpuclockid.3:58 build/C/man3/pthread_join.3:93
3046 #: build/C/man3/pthread_setaffinity_np.3:114
3047 #: build/C/man3/pthread_setschedparam.3:114
3048 #: build/C/man3/pthread_setschedprio.3:70 build/C/man3/pthread_sigqueue.3:86
3049 #, no-wrap
3050 msgid "B<ESRCH>"
3051 msgstr "B<ESRCH>"
3052
3053 #. type: Plain text
3054 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_detach.3:64
3055 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:98
3056 #: build/C/man3/pthread_setaffinity_np.3:119
3057 #: build/C/man3/pthread_setschedparam.3:119
3058 #: build/C/man3/pthread_setschedprio.3:75
3059 msgid "No thread with the ID I<thread> could be found."
3060 msgstr "ID が I<thread> のスレッドが見つからなかった。"
3061
3062 #. type: Plain text
3063 #: build/C/man3/pthread_cancel.3:135
3064 msgid "On Linux, cancellation is implemented using signals.  Under the NPTL threading implementation, the first real-time signal (i.e., signal 32) is used for this purpose.  On LinuxThreads, the second real-time signal is used, if real-time signals are available, otherwise B<SIGUSR2> is used."
3065 msgstr ""
3066 "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装では、\n"
3067 "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n"
3068 "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイム\n"
3069 "シグナルが使用され、そうでない場合は B<SIGUSR2> が使用される。"
3070
3071 #. type: Plain text
3072 #: build/C/man3/pthread_cancel.3:141
3073 msgid "The program below creates a thread and then cancels it.  The main thread joins with the canceled thread to check that its exit status was B<PTHREAD_CANCELED>.  The following shell session shows what happens when we run the program:"
3074 msgstr ""
3075 "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルする。\n"
3076 "メインスレッドはキャンセルされたスレッドをジョインし、\n"
3077 "キャンセルされたスレッドの終了ステータスが B<PTHREAD_CANCELED> かどうかを\n"
3078 "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。"
3079
3080 #. type: Plain text
3081 #: build/C/man3/pthread_cancel.3:149
3082 #, no-wrap
3083 msgid ""
3084 "$ ./a.out\n"
3085 "thread_func(): started; cancellation disabled\n"
3086 "main(): sending cancellation request\n"
3087 "thread_func(): about to enable cancellation\n"
3088 "main(): thread was canceled\n"
3089 msgstr ""
3090 "$ ./a.out\n"
3091 "thread_func(): started; cancellation disabled\n"
3092 "main(): sending cancellation request\n"
3093 "thread_func(): about to enable cancellation\n"
3094 "main(): thread was canceled\n"
3095
3096 #. type: Plain text
3097 #: build/C/man3/pthread_cancel.3:159
3098 #, no-wrap
3099 msgid ""
3100 "#include E<lt>pthread.hE<gt>\n"
3101 "#include E<lt>stdio.hE<gt>\n"
3102 "#include E<lt>errno.hE<gt>\n"
3103 "#include E<lt>stdlib.hE<gt>\n"
3104 "#include E<lt>unistd.hE<gt>\n"
3105 msgstr ""
3106 "#include E<lt>pthread.hE<gt>\n"
3107 "#include E<lt>stdio.hE<gt>\n"
3108 "#include E<lt>errno.hE<gt>\n"
3109 "#include E<lt>stdlib.hE<gt>\n"
3110 "#include E<lt>unistd.hE<gt>\n"
3111
3112 #. type: Plain text
3113 #: build/C/man3/pthread_cancel.3:167
3114 #, no-wrap
3115 msgid ""
3116 "static void *\n"
3117 "thread_func(void *ignored_argument)\n"
3118 "{\n"
3119 "    int s;\n"
3120 msgstr ""
3121 "static void *\n"
3122 "thread_func(void *ignored_argument)\n"
3123 "{\n"
3124 "    int s;\n"
3125
3126 #. type: Plain text
3127 #: build/C/man3/pthread_cancel.3:170
3128 #, no-wrap
3129 msgid ""
3130 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3131 "       immediately react to a cancellation request */\n"
3132 msgstr ""
3133 "    /* Disable cancellation for a while, so that we don\\(aqt\n"
3134 "       immediately react to a cancellation request */\n"
3135
3136 #. type: Plain text
3137 #: build/C/man3/pthread_cancel.3:174
3138 #, no-wrap
3139 msgid ""
3140 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3141 "    if (s != 0)\n"
3142 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3143 msgstr ""
3144 "    s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
3145 "    if (s != 0)\n"
3146 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3147
3148 #. type: Plain text
3149 #: build/C/man3/pthread_cancel.3:178
3150 #, no-wrap
3151 msgid ""
3152 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3153 "    sleep(5);\n"
3154 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3155 msgstr ""
3156 "    printf(\"thread_func(): started; cancellation disabled\\en\");\n"
3157 "    sleep(5);\n"
3158 "    printf(\"thread_func(): about to enable cancellation\\en\");\n"
3159
3160 #. type: Plain text
3161 #: build/C/man3/pthread_cancel.3:182
3162 #, no-wrap
3163 msgid ""
3164 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3165 "    if (s != 0)\n"
3166 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3167 msgstr ""
3168 "    s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
3169 "    if (s != 0)\n"
3170 "        handle_error_en(s, \"pthread_setcancelstate\");\n"
3171
3172 #. type: Plain text
3173 #: build/C/man3/pthread_cancel.3:184
3174 #, no-wrap
3175 msgid "    /* sleep() is a cancellation point */\n"
3176 msgstr "    /* sleep() is a cancellation point */\n"
3177
3178 #. type: Plain text
3179 #: build/C/man3/pthread_cancel.3:186
3180 #, no-wrap
3181 msgid "    sleep(1000);        /* Should get canceled while we sleep */\n"
3182 msgstr "    sleep(1000);        /* Should get canceled while we sleep */\n"
3183
3184 #. type: Plain text
3185 #: build/C/man3/pthread_cancel.3:188
3186 #, no-wrap
3187 msgid "    /* Should never get here */\n"
3188 msgstr "    /* Should never get here */\n"
3189
3190 #. type: Plain text
3191 #: build/C/man3/pthread_cancel.3:192
3192 #, no-wrap
3193 msgid ""
3194 "    printf(\"thread_func(): not canceled!\\en\");\n"
3195 "    return NULL;\n"
3196 "}\n"
3197 msgstr ""
3198 "    printf(\"thread_func(): not canceled!\\en\");\n"
3199 "    return NULL;\n"
3200 "}\n"
3201
3202 #. type: Plain text
3203 #: build/C/man3/pthread_cancel.3:199
3204 #, no-wrap
3205 msgid ""
3206 "int\n"
3207 "main(void)\n"
3208 "{\n"
3209 "    pthread_t thr;\n"
3210 "    void *res;\n"
3211 "    int s;\n"
3212 msgstr ""
3213 "int\n"
3214 "main(void)\n"
3215 "{\n"
3216 "    pthread_t thr;\n"
3217 "    void *res;\n"
3218 "    int s;\n"
3219
3220 #. type: Plain text
3221 #: build/C/man3/pthread_cancel.3:201
3222 #, no-wrap
3223 msgid "    /* Start a thread and then send it a cancellation request */\n"
3224 msgstr "    /* Start a thread and then send it a cancellation request */\n"
3225
3226 #. type: Plain text
3227 #: build/C/man3/pthread_cancel.3:205
3228 #, no-wrap
3229 msgid ""
3230 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3231 "    if (s != 0)\n"
3232 "        handle_error_en(s, \"pthread_create\");\n"
3233 msgstr ""
3234 "    s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
3235 "    if (s != 0)\n"
3236 "        handle_error_en(s, \"pthread_create\");\n"
3237
3238 #. type: Plain text
3239 #: build/C/man3/pthread_cancel.3:207
3240 #, no-wrap
3241 msgid "    sleep(2);           /* Give thread a chance to get started */\n"
3242 msgstr "    sleep(2);           /* Give thread a chance to get started */\n"
3243
3244 #. type: Plain text
3245 #: build/C/man3/pthread_cancel.3:212
3246 #, no-wrap
3247 msgid ""
3248 "    printf(\"main(): sending cancellation request\\en\");\n"
3249 "    s = pthread_cancel(thr);\n"
3250 "    if (s != 0)\n"
3251 "        handle_error_en(s, \"pthread_cancel\");\n"
3252 msgstr ""
3253 "    printf(\"main(): sending cancellation request\\en\");\n"
3254 "    s = pthread_cancel(thr);\n"
3255 "    if (s != 0)\n"
3256 "        handle_error_en(s, \"pthread_cancel\");\n"
3257
3258 #. type: Plain text
3259 #: build/C/man3/pthread_cancel.3:214
3260 #, no-wrap
3261 msgid "    /* Join with thread to see what its exit status was */\n"
3262 msgstr "    /* Join with thread to see what its exit status was */\n"
3263
3264 #. type: Plain text
3265 #: build/C/man3/pthread_cancel.3:218 build/C/man3/pthread_cleanup_push.3:307
3266 #, no-wrap
3267 msgid ""
3268 "    s = pthread_join(thr, &res);\n"
3269 "    if (s != 0)\n"
3270 "        handle_error_en(s, \"pthread_join\");\n"
3271 msgstr ""
3272 "    s = pthread_join(thr, &res);\n"
3273 "    if (s != 0)\n"
3274 "        handle_error_en(s, \"pthread_join\");\n"
3275
3276 #. type: Plain text
3277 #: build/C/man3/pthread_cancel.3:225
3278 #, no-wrap
3279 msgid ""
3280 "    if (res == PTHREAD_CANCELED)\n"
3281 "        printf(\"main(): thread was canceled\\en\");\n"
3282 "    else\n"
3283 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3284 "    exit(EXIT_SUCCESS);\n"
3285 "}\n"
3286 msgstr ""
3287 "    if (res == PTHREAD_CANCELED)\n"
3288 "        printf(\"main(): thread was canceled\\en\");\n"
3289 "    else\n"
3290 "        printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n"
3291 "    exit(EXIT_SUCCESS);\n"
3292 "}\n"
3293
3294 #. type: Plain text
3295 #: build/C/man3/pthread_cancel.3:238
3296 msgid "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3297 msgstr "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3298
3299 #. type: TH
3300 #: build/C/man3/pthread_cleanup_push.3:26
3301 #, no-wrap
3302 msgid "PTHREAD_CLEANUP_PUSH"
3303 msgstr "PTHREAD_CLEANUP_PUSH"
3304
3305 #. type: TH
3306 #: build/C/man3/pthread_cleanup_push.3:26
3307 #, no-wrap
3308 msgid "2008-11-24"
3309 msgstr "2008-11-24"
3310
3311 #. type: Plain text
3312 #: build/C/man3/pthread_cleanup_push.3:30
3313 msgid "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation clean-up handlers"
3314 msgstr ""
3315 "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n"
3316 "キャンセルクリーンアップハンドラの push/pop を行う"
3317
3318 #. type: Plain text
3319 #: build/C/man3/pthread_cleanup_push.3:37
3320 #, no-wrap
3321 msgid ""
3322 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3323 "B<                          void *>I<arg>B<);>\n"
3324 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3325 msgstr ""
3326 "B<void pthread_cleanup_push(void (*>I<routine>B<)(void *),>\n"
3327 "B<                          void *>I<arg>B<);>\n"
3328 "B<void pthread_cleanup_pop(int >I<execute>B<);>\n"
3329
3330 #. type: Plain text
3331 #: build/C/man3/pthread_cleanup_push.3:48
3332 msgid "These functions manipulate the calling thread's stack of thread-cancellation clean-up handlers.  A clean-up handler is a function that is automatically executed when a thread is canceled (or in various other circumstances described below); it might, for example, unlock a mutex so that it becomes available to other threads in the process."
3333 msgstr ""
3334 "これらの関数は、呼び出したスレッドのスレッドキャンセル時のクリーンアッ\n"
3335 "プハンドラのスタックの操作を行う。クリーンアップハンドラは、スレッドが\n"
3336 "キャンセルされた場合 (や以下で説明する他の種々の状況において) 自動的に\n"
3337 "実行される関数である。例えば、mutex のロック解除を行い、プロセス内の\n"
3338 "他のスレッドが利用できるようにする関数などが考えられる。"
3339
3340 #. type: Plain text
3341 #: build/C/man3/pthread_cleanup_push.3:59
3342 msgid "The B<pthread_cleanup_push>()  function pushes I<routine> onto the top of the stack of clean-up handlers.  When I<routine> is later invoked, it will be given I<arg> as its argument."
3343 msgstr ""
3344 "B<pthread_cleanup_push>() 関数は、 I<routine> をクリーンアップ\n"
3345 "ハンドラのスタックの一番上にプッシュする。 I<routine> が後で\n"
3346 "起動される際には、 I<arg> が関数の引き数と渡される。"
3347
3348 #. type: Plain text
3349 #: build/C/man3/pthread_cleanup_push.3:66
3350 msgid "The B<pthread_cleanup_pop>()  function removes the routine at the top of the stack of clean-up handlers, and optionally executes it if I<execute> is nonzero."
3351 msgstr ""
3352 "B<pthread_cleanup_pop>() 関数は、クリーンアップハンドラの\n"
3353 "スタックの一番上のルーチンを削除する。\n"
3354 "I<execute> が 0 以外の場合にはそのルーチンを追加で実行する。"
3355
3356 #. type: Plain text
3357 #: build/C/man3/pthread_cleanup_push.3:69
3358 msgid "A cancellation clean-up handler is popped from the stack and executed in the following circumstances:"
3359 msgstr ""
3360 "キャンセルクリーンアップハンドラは、以下に示す場合に\n"
3361 "スタックから取り出され実行される。"
3362
3363 #. type: Plain text
3364 #: build/C/man3/pthread_cleanup_push.3:73
3365 msgid "When a thread is canceled, all of the stacked clean-up handlers are popped and executed in the reverse of the order in which they were pushed onto the stack."
3366 msgstr ""
3367 "スレッドがキャンセルされた際に、スタックに登録された全てのクリーン\n"
3368 "アップハンドラが取り出されて、実行される。クリーンアップハンドラの\n"
3369 "実行は、スタックに登録されたのと逆の順序で行われる。"
3370
3371 #. type: Plain text
3372 #: build/C/man3/pthread_cleanup_push.3:83
3373 msgid "When a thread terminates by calling B<pthread_exit>(3), all clean-up handlers are executed as described in the preceding point.  (Clean-up handlers are I<not> called if the thread terminates by performing a I<return> from the thread start function.)"
3374 msgstr ""
3375 "スレッドが B<pthread_exit>(3) を呼び出して終了する際に、全てのクリーン\n"
3376 "アップハンドラが上の項目で述べたのと同様に実行される。\n"
3377 "(スレッドがスレッド開始関数からの I<return> の実行により終了する場合に\n"
3378 "は、クリーンアップハンドラはI<呼び出されない>。)"
3379
3380 #. type: Plain text
3381 #: build/C/man3/pthread_cleanup_push.3:89
3382 msgid "When a thread calls B<pthread_cleanup_pop>()  with a nonzero I<execute> argument, the top-most clean-up handler is popped and executed."
3383 msgstr ""
3384 "スレッドが 0 以外の I<execute> 引き数で B<pthread_cleanup_pop>() を\n"
3385 "呼び出した際に、スタックの一番上のクリーンアップハンドラが取り出されて\n"
3386 "実行される。"
3387
3388 #. type: Plain text
3389 #: build/C/man3/pthread_cleanup_push.3:101
3390 msgid "POSIX.1 permits B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  to be implemented as macros that expand to text containing \\(aqB<{>\\(aq and \\(aqB<}>\\(aq, respectively.  For this reason, the caller must ensure that calls to these functions are paired within the same function, and at the same lexical nesting level.  (In other words, a clean-up handler is established only during the execution of a specified section of code.)"
3391 msgstr ""
3392 "POSIX.1 では、 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>() を\n"
3393 "それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開するマクロと\n"
3394 "して実装することを許容している。\n"
3395 "このため、呼び出し側では、これらの関数の呼び出しが同じ関数の中で対と\n"
3396 "なり、かつ文法的に同じネストレベル (nesting level) になることを保証\n"
3397 "しなければならない。 (言い換えると、クリーンアップハンドラは、コード\n"
3398 "の特定のセクションの実行の中でのみ設定するものであると言える。)"
3399
3400 #. type: Plain text
3401 #: build/C/man3/pthread_cleanup_push.3:121
3402 msgid "Calling B<longjmp>(3)  (B<siglongjmp>(3))  produces undefined results if any call has been made to B<pthread_cleanup_push>()  or B<pthread_cleanup_pop>()  without the matching call of the pair since the jump buffer was filled by B<setjmp>(3)  (B<sigsetjmp>(3)).  Likewise, calling B<longjmp>(3)  (B<siglongjmp>(3))  from inside a clean-up handler produces undefined results unless the jump buffer was also filled by B<setjmp>(3)  (B<sigsetjmp>(3))  inside the handler."
3403 msgstr ""
3404 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しは、\n"
3405 "B<pthread_cleanup_push>() や B<pthread_cleanup_pop>() の呼び出しが対と\n"
3406 "なる呼び出しがない状態で行われた場合には、どのような結果になるかは不定\n"
3407 "である。これは jump バッファーは B<setjmp>(3) (B<sigsetjmp>(3)) により設\n"
3408 "定されるからである。同様に、クリーンアップハンドラ内からの\n"
3409 "B<longjmp>(3) (B<siglongjmp>(3)) の呼び出しも、jump バッファーがハンドラ\n"
3410 "内で B<setjmp>(3) (B<sigsetjmp>(3)) で設定されていない限り、どのような\n"
3411 "結果になるかは不定である。"
3412
3413 #. type: Plain text
3414 #: build/C/man3/pthread_cleanup_push.3:123
3415 msgid "These functions do not return a value."
3416 msgstr "これらの関数は値を返さない。"
3417
3418 #.  SH VERSIONS
3419 #.  Available since glibc 2.0
3420 #. type: Plain text
3421 #: build/C/man3/pthread_cleanup_push.3:127
3422 msgid "There are no errors."
3423 msgstr "エラーはない。"
3424
3425 #. type: Plain text
3426 #: build/C/man3/pthread_cleanup_push.3:140
3427 msgid "On Linux, the B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  functions I<are> implemented as macros that expand to text containing \\(aqB<{>\\(aq and \\(aqB<}>\\(aq, respectively.  This means that variables declared within the scope of paired calls to these functions will be visible within only that scope."
3428 msgstr ""
3429 "Linux では、関数 B<pthread_cleanup_push>() と B<pthread_cleanup_pop>()\n"
3430 "は、それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開する\n"
3431 "マクロとして実装されている。このことは、これらの関数を対で呼び出した\n"
3432 "スコープ内で宣言された変数は、そのスコープの中でしか参照できない\n"
3433 "ということを意味している。"
3434
3435 #.  The text was actually added in the 2004 TC2
3436 #. type: Plain text
3437 #: build/C/man3/pthread_cleanup_push.3:155
3438 msgid "POSIX.1 says that the effect of using I<return>, I<break>, I<continue>, or I<goto> to prematurely leave a block bracketed B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>()  is undefined.  Portable applications should avoid doing this."
3439 msgstr ""
3440 "POSIX.1 には、括弧を含む B<pthread_cleanup_push>() と\n"
3441 "B<pthread_cleanup_pop>() のブロックをそのままにしたままで、 \n"
3442 "I<return>, I<break>, I<continue>, I<goto> を使った場合の影響は\n"
3443 "不定であると書かれている。\n"
3444 "移植性が必要なアプリケーションではこれを行うのは避けるべきである。"
3445
3446 #. type: Plain text
3447 #: build/C/man3/pthread_cleanup_push.3:170
3448 msgid "The program below provides a simple example of the use of the functions described in this page.  The program creates a thread that executes a loop bracketed by B<pthread_cleanup_push>()  and B<pthread_cleanup_pop>().  This loop increments a global variable, I<cnt>, once each second.  Depending on what command-line arguments are supplied, the main thread sends the other thread a cancellation request, or sets a global variable that causes the other thread to exit its loop and terminate normally (by doing a I<return>)."
3449 msgstr ""
3450 "以下のプログラムは、このページで説明した関数の簡単な使用例を示すもので\n"
3451 "ある。このプログラムは B<pthread_cleanup_push>() と\n"
3452 "B<pthread_cleanup_pop>() で囲まれたループを実行するスレッドを作成する。\n"
3453 "このループではグローバル変数 I<cnt> を 1 秒に 1 ずつ増やしていく。\n"
3454 "指定されたコマンドライン引き数の内容に基づいて、メインスレッドはもう一\n"
3455 "つのスレッドにキャンセル要求を送ったり、もう一つのスレッドがループを\n"
3456 "抜けて (I<return> を呼び出して) 正常終了するようにグローバル変数を\n"
3457 "設定したりする。"
3458
3459 #. type: Plain text
3460 #: build/C/man3/pthread_cleanup_push.3:173
3461 msgid "In the following shell session, the main thread sends a cancellation request to the other thread:"
3462 msgstr ""
3463 "以下のシェルセッションでは、メインスレッドはもう一つのスレッドに\n"
3464 "キャンセル要求を送信する。"
3465
3466 #. type: Plain text
3467 #: build/C/man3/pthread_cleanup_push.3:183
3468 #, no-wrap
3469 msgid ""
3470 "$ B<./a.out>\n"
3471 "New thread started\n"
3472 "cnt = 0\n"
3473 "cnt = 1\n"
3474 "Canceling thread\n"
3475 "Called clean-up handler\n"
3476 "Thread was canceled; cnt = 0\n"
3477 msgstr ""
3478 "$ B<./a.out>\n"
3479 "New thread started\n"
3480 "cnt = 0\n"
3481 "cnt = 1\n"
3482 "Canceling thread\n"
3483 "Called clean-up handler\n"
3484 "Thread was canceled; cnt = 0\n"
3485
3486 #. type: Plain text
3487 #: build/C/man3/pthread_cleanup_push.3:191
3488 msgid "From the above, we see that the thread was canceled, and that the cancellation clean-up handler was called and it reset the value of the global variable I<cnt> to 0."
3489 msgstr ""
3490 "上記の実行例から、スレッドがキャンセルされ、\n"
3491 "キャンセルクリーンアップハンドラが呼び出され、\n"
3492 "グローバル変数 I<cnt> の値が 0 にリセットされていることが確認できる。"
3493
3494 #. type: Plain text
3495 #: build/C/man3/pthread_cleanup_push.3:194
3496 msgid "In the next run, the main program sets a global variable that causes other thread to terminate normally:"
3497 msgstr ""
3498 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
3499 "もう一つのスレッドが正常終了するようにしている。"
3500
3501 #. type: Plain text
3502 #: build/C/man3/pthread_cleanup_push.3:202
3503 #, no-wrap
3504 msgid ""
3505 "$ B<./a.out x>\n"
3506 "New thread started\n"
3507 "cnt = 0\n"
3508 "cnt = 1\n"
3509 "Thread terminated normally; cnt = 2\n"
3510 msgstr ""
3511 "$ B<./a.out x>\n"
3512 "New thread started\n"
3513 "cnt = 0\n"
3514 "cnt = 1\n"
3515 "Thread terminated normally; cnt = 2\n"
3516
3517 #. type: Plain text
3518 #: build/C/man3/pthread_cleanup_push.3:210
3519 msgid "From the above, we see that the clean-up handler was not executed (because I<cleanup_pop_arg> was 0), and therefore the value of I<cnt> was not reset."
3520 msgstr ""
3521 "上記では、 (I<cleanup_pop_arg> が 0 なので) クリーンアップハンドラは\n"
3522 "実行されておらず、その結果 I<cnt> の値はリセットされていないことが\n"
3523 "分かる。"
3524
3525 #. type: Plain text
3526 #: build/C/man3/pthread_cleanup_push.3:215
3527 msgid "In the next run, the main program sets a global variable that causes the other thread to terminate normally, and supplies a nonzero value for I<cleanup_pop_arg>:"
3528 msgstr ""
3529 "次の実行例では、メインプログラムはグローバル変数を設定して、\n"
3530 "もう一つのスレッドが正常終了するようにし、さらに\n"
3531 "I<cleanup_pop_arg> に 0 以外の値を渡している。"
3532
3533 #. type: Plain text
3534 #: build/C/man3/pthread_cleanup_push.3:224
3535 #, no-wrap
3536 msgid ""
3537 "$ B<./a.out x 1>\n"
3538 "New thread started\n"
3539 "cnt = 0\n"
3540 "cnt = 1\n"
3541 "Called clean-up handler\n"
3542 "Thread terminated normally; cnt = 0\n"
3543 msgstr ""
3544 "$ B<./a.out x 1>\n"
3545 "New thread started\n"
3546 "cnt = 0\n"
3547 "cnt = 1\n"
3548 "Called clean-up handler\n"
3549 "Thread terminated normally; cnt = 0\n"
3550
3551 #. type: Plain text
3552 #: build/C/man3/pthread_cleanup_push.3:231
3553 msgid "In the above, we see that although the thread was not canceled, the clean-up handler was executed, because the argument given to B<pthread_cleanup_pop>()  was nonzero."
3554 msgstr ""
3555 "上記では、スレッドはキャンセルされていないが、クリーンアップハンドラが\n"
3556 "実行されていないことが分かる。これは B<pthread_cleanup_pop>() の引き数\n"
3557 "に 0 以外を渡したからである。"
3558
3559 #. type: Plain text
3560 #: build/C/man3/pthread_cleanup_push.3:240
3561 #, no-wrap
3562 msgid ""
3563 "#include E<lt>pthread.hE<gt>\n"
3564 "#include E<lt>sys/types.hE<gt>\n"
3565 "#include E<lt>stdio.hE<gt>\n"
3566 "#include E<lt>stdlib.hE<gt>\n"
3567 "#include E<lt>unistd.hE<gt>\n"
3568 "#include E<lt>errno.hE<gt>\n"
3569 msgstr ""
3570 "#include E<lt>pthread.hE<gt>\n"
3571 "#include E<lt>sys/types.hE<gt>\n"
3572 "#include E<lt>stdio.hE<gt>\n"
3573 "#include E<lt>stdlib.hE<gt>\n"
3574 "#include E<lt>unistd.hE<gt>\n"
3575 "#include E<lt>errno.hE<gt>\n"
3576
3577 #. type: Plain text
3578 #: build/C/man3/pthread_cleanup_push.3:247
3579 #, no-wrap
3580 msgid ""
3581 "static int done = 0;\n"
3582 "static int cleanup_pop_arg = 0;\n"
3583 "static int cnt = 0;\n"
3584 msgstr ""
3585 "static int done = 0;\n"
3586 "static int cleanup_pop_arg = 0;\n"
3587 "static int cnt = 0;\n"
3588
3589 #. type: Plain text
3590 #: build/C/man3/pthread_cleanup_push.3:254
3591 #, no-wrap
3592 msgid ""
3593 "static void\n"
3594 "cleanup_handler(void *arg)\n"
3595 "{\n"
3596 "    printf(\"Called clean-up handler\\en\");\n"
3597 "    cnt = 0;\n"
3598 "}\n"
3599 msgstr ""
3600 "static void\n"
3601 "cleanup_handler(void *arg)\n"
3602 "{\n"
3603 "    printf(\"Called clean-up handler\\en\");\n"
3604 "    cnt = 0;\n"
3605 "}\n"
3606
3607 #. type: Plain text
3608 #: build/C/man3/pthread_cleanup_push.3:259
3609 #, no-wrap
3610 msgid ""
3611 "static void *\n"
3612 "thread_start(void *arg)\n"
3613 "{\n"
3614 "    time_t start, curr;\n"
3615 msgstr ""
3616 "static void *\n"
3617 "thread_start(void *arg)\n"
3618 "{\n"
3619 "    time_t start, curr;\n"
3620
3621 #. type: Plain text
3622 #: build/C/man3/pthread_cleanup_push.3:261
3623 #, no-wrap
3624 msgid "    printf(\"New thread started\\en\");\n"
3625 msgstr "    printf(\"New thread started\\en\");\n"
3626
3627 #. type: Plain text
3628 #: build/C/man3/pthread_cleanup_push.3:263
3629 #, no-wrap
3630 msgid "    pthread_cleanup_push(cleanup_handler, NULL);\n"
3631 msgstr "    pthread_cleanup_push(cleanup_handler, NULL);\n"
3632
3633 #. type: Plain text
3634 #: build/C/man3/pthread_cleanup_push.3:265
3635 #, no-wrap
3636 msgid "    curr = start = time(NULL);\n"
3637 msgstr "    curr = start = time(NULL);\n"
3638
3639 #. type: Plain text
3640 #: build/C/man3/pthread_cleanup_push.3:274
3641 #, no-wrap
3642 msgid ""
3643 "    while (!done) {\n"
3644 "        pthread_testcancel();           /* A cancellation point */\n"
3645 "        if (curr E<lt> time(NULL)) {\n"
3646 "            curr = time(NULL);\n"
3647 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
3648 "            cnt++;\n"
3649 "        }\n"
3650 "    }\n"
3651 msgstr ""
3652 "    while (!done) {\n"
3653 "        pthread_testcancel();           /* A cancellation point */\n"
3654 "        if (curr E<lt> time(NULL)) {\n"
3655 "            curr = time(NULL);\n"
3656 "            printf(\"cnt = %d\\en\", cnt);  /* A cancellation point */\n"
3657 "            cnt++;\n"
3658 "        }\n"
3659 "    }\n"
3660
3661 #. type: Plain text
3662 #: build/C/man3/pthread_cleanup_push.3:278
3663 #, no-wrap
3664 msgid ""
3665 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
3666 "    return NULL;\n"
3667 "}\n"
3668 msgstr ""
3669 "    pthread_cleanup_pop(cleanup_pop_arg);\n"
3670 "    return NULL;\n"
3671 "}\n"
3672
3673 #. type: Plain text
3674 #: build/C/man3/pthread_cleanup_push.3:285
3675 #, no-wrap
3676 msgid ""
3677 "int\n"
3678 "main(int argc, char *argv[])\n"
3679 "{\n"
3680 "    pthread_t thr;\n"
3681 "    int s;\n"
3682 "    void *res;\n"
3683 msgstr ""
3684 "int\n"
3685 "main(int argc, char *argv[])\n"
3686 "{\n"
3687 "    pthread_t thr;\n"
3688 "    int s;\n"
3689 "    void *res;\n"
3690
3691 #. type: Plain text
3692 #: build/C/man3/pthread_cleanup_push.3:289
3693 #, no-wrap
3694 msgid ""
3695 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
3696 "    if (s != 0)\n"
3697 "        handle_error_en(s, \"pthread_create\");\n"
3698 msgstr ""
3699 "    s = pthread_create(&thr, NULL, thread_start, NULL);\n"
3700 "    if (s != 0)\n"
3701 "        handle_error_en(s, \"pthread_create\");\n"
3702
3703 #. type: Plain text
3704 #: build/C/man3/pthread_cleanup_push.3:291
3705 #, no-wrap
3706 msgid "    sleep(2);           /* Allow new thread to run a while */\n"
3707 msgstr "    sleep(2);           /* Allow new thread to run a while */\n"
3708
3709 #. type: Plain text
3710 #: build/C/man3/pthread_cleanup_push.3:296
3711 #, no-wrap
3712 msgid ""
3713 "    if (argc E<gt> 1) {\n"
3714 "        if (argc E<gt> 2)\n"
3715 "            cleanup_pop_arg = atoi(argv[2]);\n"
3716 "        done = 1;\n"
3717 msgstr ""
3718 "    if (argc E<gt> 1) {\n"
3719 "        if (argc E<gt> 2)\n"
3720 "            cleanup_pop_arg = atoi(argv[2]);\n"
3721 "        done = 1;\n"
3722
3723 #. type: Plain text
3724 #: build/C/man3/pthread_cleanup_push.3:303
3725 #, no-wrap
3726 msgid ""
3727 "    } else {\n"
3728 "        printf(\"Canceling thread\\en\");\n"
3729 "        s = pthread_cancel(thr);\n"
3730 "        if (s != 0)\n"
3731 "            handle_error_en(s, \"pthread_cancel\");\n"
3732 "    }\n"
3733 msgstr ""
3734 "    } else {\n"
3735 "        printf(\"Canceling thread\\en\");\n"
3736 "        s = pthread_cancel(thr);\n"
3737 "        if (s != 0)\n"
3738 "            handle_error_en(s, \"pthread_cancel\");\n"
3739 "    }\n"
3740
3741 #. type: Plain text
3742 #: build/C/man3/pthread_cleanup_push.3:314
3743 #, no-wrap
3744 msgid ""
3745 "    if (res == PTHREAD_CANCELED)\n"
3746 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
3747 "    else\n"
3748 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
3749 "    exit(EXIT_SUCCESS);\n"
3750 "}\n"
3751 msgstr ""
3752 "    if (res == PTHREAD_CANCELED)\n"
3753 "        printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n"
3754 "    else\n"
3755 "        printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n"
3756 "    exit(EXIT_SUCCESS);\n"
3757 "}\n"
3758
3759 #. type: Plain text
3760 #: build/C/man3/pthread_cleanup_push.3:321
3761 msgid "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3762 msgstr "B<pthread_cancel>(3), B<pthread_cleanup_push_defer_np>(3), B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3763
3764 #. type: TH
3765 #: build/C/man3/pthread_cleanup_push_defer_np.3:26
3766 #, no-wrap
3767 msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP"
3768 msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP"
3769
3770 #. type: Plain text
3771 #: build/C/man3/pthread_cleanup_push_defer_np.3:30
3772 msgid "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop thread cancellation clean-up handlers while saving cancelability type"
3773 msgstr "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - cancelability type を保持したままでスレッドのキャンセルクリーンアップハンドラの push/pop を行う"
3774
3775 #. type: Plain text
3776 #: build/C/man3/pthread_cleanup_push_defer_np.3:37
3777 #, no-wrap
3778 msgid ""
3779 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
3780 "B<                                   void *>I<arg>B<);>\n"
3781 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
3782 msgstr ""
3783 "B<void pthread_cleanup_push_defer_np(void (*>I<routine>B<)(void *),>\n"
3784 "B<                                   void *>I<arg>B<);>\n"
3785 "B<void pthread_cleanup_pop_restore_np(int >I<execute>B<);>\n"
3786
3787 #. type: Plain text
3788 #: build/C/man3/pthread_cleanup_push_defer_np.3:40
3789 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37
3790 #: build/C/man3/pthread_join.3:37 build/C/man3/pthread_kill.3:37
3791 #: build/C/man3/pthread_setname_np.3:39 build/C/man3/pthread_sigmask.3:38
3792 #: build/C/man3/pthread_sigqueue.3:38 build/C/man3/pthread_tryjoin_np.3:42
3793 #: build/C/man3/pthread_yield.3:37
3794 msgid "Compile and link with I<-pthread>."
3795 msgstr "I<-pthread> を付けてコンパイルとリンクを行う。"
3796
3797 #. type: Plain text
3798 #: build/C/man3/pthread_cleanup_push_defer_np.3:49
3799 msgid "B<pthread_cleanup_push_defer_np>(), B<pthread_cleanup_pop_defer_np>():"
3800 msgstr "B<pthread_cleanup_push_defer_np>(), B<pthread_cleanup_pop_defer_np>():"
3801
3802 #. type: Plain text
3803 #: build/C/man3/pthread_cleanup_push_defer_np.3:51
3804 msgid "_GNU_SOURCE"
3805 msgstr "_GNU_SOURCE"
3806
3807 #. type: Plain text
3808 #: build/C/man3/pthread_cleanup_push_defer_np.3:59
3809 msgid "These functions are the same as B<pthread_cleanup_push>(3)  and B<pthread_cleanup_pop>(3), except for the differences noted on this page."
3810 msgstr "これらの関数は B<pthread_cleanup_push>(3) と B<pthread_cleanup_pop>(3) と同じだが、このページで説明する点が異なる。"
3811
3812 #. type: Plain text
3813 #: build/C/man3/pthread_cleanup_push_defer_np.3:72
3814 msgid "Like B<pthread_cleanup_push>(3), B<pthread_cleanup_push_defer_np>()  pushes I<routine> onto the thread's stack of cancellation clean-up handlers.  In addition, it also saves the thread's current cancelability type, and sets the cancelability type to \"deferred\" (see B<pthread_setcanceltype>(3)); this ensures that cancellation clean-up will occur even if the thread's cancelability type was \"asynchronous\" before the call."
3815 msgstr ""
3816 "B<pthread_cleanup_push>(3) と同様に、\n"
3817 "B<pthread_cleanup_push_defer_np>() は I<routine> をそのスレッドの\n"
3818 "クリーンアップハンドラのスタックに追加する。これに加えて、\n"
3819 "B<pthread_cleanup_push_defer_np>() は現在の cancelability type も\n"
3820 "保存し、cancelability type は \"deferred\" に設定する\n"
3821 "(B<pthread_setcanceltype>(3) 参照)。\n"
3822 "これにより、この関数が呼び出される前のスレッドの cancelability type が\n"
3823 "\"asynchronous\" であったとしても、キャンセルクリーンアップが行われること\n"
3824 "が保証される。"
3825
3826 #. type: Plain text
3827 #: build/C/man3/pthread_cleanup_push_defer_np.3:81
3828 msgid "Like B<pthread_cleanup_pop>(3), B<pthread_cleanup_pop_restore_np>()  pops the top-most clean-up handler from the thread's stack of cancellation clean-up handlers.  In addition, it restores the thread's cancelability type to its value at the time of the matching B<pthread_cleanup_push_defer_np>()."
3829 msgstr ""
3830 "B<pthread_cleanup_pop>(3) と同様に、\n"
3831 "B<pthread_cleanup_pop_restore_np>() はそのスレッドのキャンセル\n"
3832 "クリーンアップハンドラのスタックから一番上にあるクリーンアップハンドラ\n"
3833 "を取り出す。これに加えて、そのスレッドの cancelability type を、対応\n"
3834 "する B<pthread_cleanup_push_defer_np>() が呼ばれた時点の値に戻す。"
3835
3836 #. type: Plain text
3837 #: build/C/man3/pthread_cleanup_push_defer_np.3:87
3838 msgid "The caller must ensure that calls to these functions are paired within the same function, and at the same lexical nesting level.  Other restrictions apply, as described in B<pthread_cleanup_push>(3)."
3839 msgstr ""
3840 "呼び出し側では、これらの関数の呼び出しが同じ関数の中で対となり、かつ\n"
3841 "文法的に同じネストレベル (nesting level) になることを保証しなければ\n"
3842 "ならない。 B<pthread_cleanup_push>(3) で説明されている他の制限も\n"
3843 "適用される。"
3844
3845 #. type: Plain text
3846 #: build/C/man3/pthread_cleanup_push_defer_np.3:89
3847 msgid "This sequence of calls:"
3848 msgstr "以下の一連の呼び出し"
3849
3850 #. type: Plain text
3851 #: build/C/man3/pthread_cleanup_push_defer_np.3:94
3852 #, no-wrap
3853 msgid ""
3854 "pthread_cleanup_push_defer_np(routine, arg);\n"
3855 "pthread_cleanup_pop_restore_np(execute);\n"
3856 msgstr ""
3857 "pthread_cleanup_push_defer_np(routine, arg);\n"
3858 "pthread_cleanup_pop_restore_np(execute);\n"
3859
3860 #. type: Plain text
3861 #: build/C/man3/pthread_cleanup_push_defer_np.3:98
3862 msgid "is equivalent to (but shorter and more efficient than):"
3863 msgstr "と以下は等価である (但し、上の方がより簡潔で効率的である)。"
3864
3865 #. type: Plain text
3866 #: build/C/man3/pthread_cleanup_push_defer_np.3:104
3867 #, no-wrap
3868 msgid "int oldtype;\n"
3869 msgstr "int oldtype;\n"
3870
3871 #. type: Plain text
3872 #: build/C/man3/pthread_cleanup_push_defer_np.3:110
3873 #, no-wrap
3874 msgid ""
3875 "pthread_cleanup_push(routine, arg);\n"
3876 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
3877 "\\&...\n"
3878 "pthread_setcanceltype(oldtype, NULL);\n"
3879 "pthread_cleanup_pop(execute);\n"
3880 msgstr ""
3881 "pthread_cleanup_push(routine, arg);\n"
3882 "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n"
3883 "\\&...\n"
3884 "pthread_setcanceltype(oldtype, NULL);\n"
3885 "pthread_cleanup_pop(execute);\n"
3886
3887 #. type: Plain text
3888 #: build/C/man3/pthread_cleanup_push_defer_np.3:123
3889 msgid "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3890 msgstr "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
3891
3892 #. type: TH
3893 #: build/C/man3/pthread_create.3:26
3894 #, no-wrap
3895 msgid "PTHREAD_CREATE"
3896 msgstr "PTHREAD_CREATE"
3897
3898 #. type: Plain text
3899 #: build/C/man3/pthread_create.3:29
3900 msgid "pthread_create - create a new thread"
3901 msgstr "pthread_create - 新しいスレッドを作成する"
3902
3903 #. type: Plain text
3904 #: build/C/man3/pthread_create.3:35
3905 #, no-wrap
3906 msgid ""
3907 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
3908 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
3909 msgstr ""
3910 "B<int pthread_create(pthread_t *>I<thread>B<, const pthread_attr_t *>I<attr>B<,>\n"
3911 "B<                   void *(*>I<start_routine>B<) (void *), void *>I<arg>B<);>\n"
3912
3913 #. type: Plain text
3914 #: build/C/man3/pthread_create.3:47
3915 msgid "The B<pthread_create>()  function starts a new thread in the calling process.  The new thread starts execution by invoking I<start_routine>(); I<arg> is passed as the sole argument of I<start_routine>()."
3916 msgstr ""
3917 "B<pthread_create>() 関数は、呼び出したプロセス内に新しいスレッドを作成する。\n"
3918 "新しいスレッドの実行は、 I<start_routine>() を起動することで開始される。\n"
3919 "I<start_routine>() は引き数を一つだけ取り、\n"
3920 "I<arg> が I<start_routine>() の引き数として渡される。"
3921
3922 #. type: Plain text
3923 #: build/C/man3/pthread_create.3:49
3924 msgid "The new thread terminates in one of the following ways:"
3925 msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。"
3926
3927 #. type: IP
3928 #: build/C/man3/pthread_create.3:49 build/C/man3/pthread_create.3:55
3929 #: build/C/man3/pthread_create.3:63 build/C/man3/pthread_create.3:66
3930 #: build/C/man3/pthread_getattr_np.3:52 build/C/man3/pthread_getattr_np.3:55
3931 #: build/C/man3/pthread_getattr_np.3:58
3932 #, no-wrap
3933 msgid "*"
3934 msgstr "*"
3935
3936 #. type: Plain text
3937 #: build/C/man3/pthread_create.3:55
3938 msgid "It calls B<pthread_exit>(3), specifying an exit status value that is available to another thread in the same process that calls B<pthread_join>(3)."
3939 msgstr ""
3940 "スレッドが B<pthread_exit>(3) を呼び出す。\n"
3941 "B<pthread_exit>(3) を呼び出す際には終了ステータス値を指定する。\n"
3942 "この値は B<pthread_join>(3) を呼び出した同じプロセス内の\n"
3943 "別のスレッドで参照できる。"
3944
3945 #. type: Plain text
3946 #: build/C/man3/pthread_create.3:63
3947 msgid "It returns from I<start_routine>().  This is equivalent to calling B<pthread_exit>(3)  with the value supplied in the I<return> statement."
3948 msgstr ""
3949 "スレッドが I<start_routine>() から返る。これは、\n"
3950 "I<return> 文に渡した値で B<pthread_exit>(3) を呼び出すのと等価である。"
3951
3952 #. type: Plain text
3953 #: build/C/man3/pthread_create.3:66
3954 msgid "It is canceled (see B<pthread_cancel>(3))."
3955 msgstr "スレッドがキャンセルされる (B<pthread_cancel>(3) 参照)。"
3956
3957 #. type: Plain text
3958 #: build/C/man3/pthread_create.3:72
3959 msgid "Any of the threads in the process calls B<exit>(3), or the main thread performs a return from I<main>().  This causes the termination of all threads in the process."
3960 msgstr ""
3961 "プロセス内のいずれかのスレッドで B<exit>(3) が呼ばれるか、\n"
3962 "メインスレッドで I<main>() 内で return が実行される。\n"
3963 "この場合は、プロセス内の全てのスレッドが終了される。"
3964
3965 #. type: Plain text
3966 #: build/C/man3/pthread_create.3:86
3967 msgid "The I<attr> argument points to a I<pthread_attr_t> structure whose contents are used at thread creation time to determine attributes for the new thread; this structure is initialized using B<pthread_attr_init>(3)  and related functions.  If I<attr> is NULL, then the thread is created with default attributes."
3968 msgstr ""
3969 "I<attr> 引き数は I<pthread_attr_t> 構造体へのポインターであり、\n"
3970 "I<pthread_attr_t> 構造体の内容を使用して、スレッド作成時に\n"
3971 "新しいスレッドの属性が決定される。\n"
3972 "この構造体は B<pthread_attr_init>(3) や関連の関数を使って初期化される。\n"
3973 "I<attr> が NULL の場合、新しいスレッドはデフォルトの属性で作成される。"
3974
3975 #. type: Plain text
3976 #: build/C/man3/pthread_create.3:93
3977 msgid "Before returning, a successful call to B<pthread_create>()  stores the ID of the new thread in the buffer pointed to by I<thread>; this identifier is used to refer to the thread in subsequent calls to other pthreads functions."
3978 msgstr ""
3979 "成功した場合は、 B<pthread_create>() は返る前に新しいスレッドの ID を\n"
3980 "I<thread> が指すバッファーに格納する。この ID は、これ以降に他の\n"
3981 "pthreads 関数の呼び出しでスレッドを参照するのに使用される。"
3982
3983 #. type: Plain text
3984 #: build/C/man3/pthread_create.3:101
3985 msgid "The new thread inherits a copy of the creating thread's signal mask (B<pthread_sigmask>(3)).  The set of pending signals for the new thread is empty (B<sigpending>(2)).  The new thread does not inherit the creating thread's alternate signal stack (B<sigaltstack>(2))."
3986 msgstr ""
3987 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスク\n"
3988 "(B<pthread_sigmask>(3) 参照) のコピーを継承する。\n"
3989 "新しいスレッドの処理待ちシグナル (B<sigpending>(2)) の集合は空となる。\n"
3990 "新しいスレッドはスレッドを作成したスレッドの代替シグナルスタック\n"
3991 "(B<sigaltstack>(2)) を継承しない。"
3992
3993 #. type: Plain text
3994 #: build/C/man3/pthread_create.3:104
3995 msgid "The new thread inherits the calling thread's floating-point environment (B<fenv>(3))."
3996 msgstr ""
3997 "新しいスレッドは呼び出したスレッドの浮動小数点環境 (B<fenv>(3))\n"
3998 "を継承する。"
3999
4000 #.  CLOCK_THREAD_CPUTIME_ID in clock_gettime(2)
4001 #. type: Plain text
4002 #: build/C/man3/pthread_create.3:109
4003 msgid "The initial value of the new thread's CPU-time clock is 0 (see B<pthread_getcpuclockid>(3))."
4004 msgstr ""
4005 "新しいスレッドの CPU 時間時計の初期値は 0 である\n"
4006 "(B<pthread_getcpuclockid>(3) 参照)。"
4007
4008 #. type: SS
4009 #: build/C/man3/pthread_create.3:109
4010 #, no-wrap
4011 msgid "Linux-specific details"
4012 msgstr "Linux 固有の詳細"
4013
4014 #. type: Plain text
4015 #: build/C/man3/pthread_create.3:115
4016 msgid "The new thread inherits copies of the calling thread's capability sets (see B<capabilities>(7))  and CPU affinity mask (see B<sched_setaffinity>(2))."
4017 msgstr ""
4018 "新しいスレッドは、呼び出したスレッドの\n"
4019 "ケーパビリティセット (B<capabilities>(7) 参照) と \n"
4020 "CPU affinity マスク (B<sched_setaffinity>(2) 参照) の\n"
4021 "コピーをを継承しない。"
4022
4023 #. type: Plain text
4024 #: build/C/man3/pthread_create.3:122
4025 msgid "On success, B<pthread_create>()  returns 0; on error, it returns an error number, and the contents of I<*thread> are undefined."
4026 msgstr ""
4027 "成功すると、 B<pthread_create>() は 0 を返す。\n"
4028 "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。"
4029
4030 #. type: TP
4031 #: build/C/man3/pthread_create.3:123 build/C/man3/pthread_create.3:126
4032 #: build/C/man3/pthread_sigqueue.3:72
4033 #, no-wrap
4034 msgid "B<EAGAIN>"
4035 msgstr "B<EAGAIN>"
4036
4037 #. type: Plain text
4038 #: build/C/man3/pthread_create.3:126
4039 msgid "Insufficient resources to create another thread."
4040 msgstr "別のスレッドを作成するのに十分なリソースがない。"
4041
4042 #.  NOTE! The following should match the description in fork(2)
4043 #. type: Plain text
4044 #: build/C/man3/pthread_create.3:144
4045 msgid "A system-imposed limit on the number of threads was encountered.  There are a number of limits that may trigger this error: the B<RLIMIT_NPROC> soft resource limit (set via B<setrlimit>(2)), which limits the number of processes and threads for a real user ID, was reached; the kernel's system-wide limit on the number of processes and threads, I</proc/sys/kernel/threads-max>, was reached (see B<proc>(5)); or the maximum number of PIDs, I</proc/sys/kernel/pid_max>, was reached (see B<proc>(5))."
4046 msgstr "システムで設定されたスレッド数の上限に達していた。 このエラーの原因となる上限値はいくつかある。 実ユーザー ID 当たりのプロセス数とスレッド数の上限である、ソフトリソース上限 B<RLIMIT_NPROC> に達していた (B<setrlimit>(2) で設定できる)。 カーネルのシステム全体のプロセスとスレッドの数の上限値である I</proc/sys/kernel/threads-max> が達していた (B<proc>(5) 参照)。 PID の最大値 I</proc/sys/kernel/pid_max> に達していた (B<proc>(5) 参照)。"
4047
4048 #. type: Plain text
4049 #: build/C/man3/pthread_create.3:148
4050 msgid "Invalid settings in I<attr>."
4051 msgstr "I<attr> で指定された設定が不正である。"
4052
4053 #. type: TP
4054 #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_setschedparam.3:129
4055 #: build/C/man3/pthread_setschedprio.3:66
4056 #, no-wrap
4057 msgid "B<EPERM>"
4058 msgstr "B<EPERM>"
4059
4060 #. type: Plain text
4061 #: build/C/man3/pthread_create.3:153
4062 msgid "No permission to set the scheduling policy and parameters specified in I<attr>."
4063 msgstr ""
4064 "I<attr> に指定されたスケジューリングポリシーとパラメーターを\n"
4065 "設定する許可がない。"
4066
4067 #. type: Plain text
4068 #: build/C/man3/pthread_create.3:167
4069 msgid "See B<pthread_self>(3)  for further information on the thread ID returned in I<*thread> by B<pthread_create>().  Unless real-time scheduling policies are being employed, after a call to B<pthread_create>(), it is indeterminate which thread\\(emthe caller or the new thread\\(emwill next execute."
4070 msgstr ""
4071 "B<pthread_create>() が I<*thread> で返すスレッド ID についての\n"
4072 "詳しい情報は B<pthread_self>(3) を参照のこと。\n"
4073 "リアルタイムスケジューリングポリシーが使用されない限り、\n"
4074 "B<pthread_create>() の呼び出し後に、\n"
4075 "どのスレッドが\\(em呼び出したスレッドか新しいスレッドか\\(em\n"
4076 "次に実行されるかは決まっていない。"
4077
4078 #. type: Plain text
4079 #: build/C/man3/pthread_create.3:187
4080 msgid "A thread may either be I<joinable> or I<detached>.  If a thread is joinable, then another thread can call B<pthread_join>(3)  to wait for the thread to terminate and fetch its exit status.  Only when a terminated joinable thread has been joined are the last of its resources released back to the system.  When a detached thread terminates, its resources are automatically released back to the system: it is not possible to join with the thread in order to obtain its exit status.  Making a thread detached is useful for some types of daemon threads whose exit status the application does not need to care about.  By default, a new thread is created in a joinable state, unless I<attr> was set to create the thread in a detached state (using B<pthread_attr_setdetachstate>(3))."
4081 msgstr ""
4082 "スレッドは I<join 可能>か I<detached (切り離された状態)> のどちらかに\n"
4083 "することができる。スレッドが join 可能な場合、別のスレッドが\n"
4084 "B<pthread_join>(3) を使って終了したスレッドを待ち、終了ステータスを取得\n"
4085 "することができる。終了した join 可能なスレッドは join された場合にのみ、\n"
4086 "そのスレッドの最後に残ったリソースが解放されシステムに戻される。\n"
4087 "detached 状態のスレッドが終了すると、そのスレッドのリソースは自動的に\n"
4088 "システムに戻される。detached 状態のスレッドを join して、その終了\n"
4089 "ステータスを取得することはできない。スレッドを detached 状態にするのは、\n"
4090 "その終了ステータスをアプリケーションが気にする必要がないある種の\n"
4091 "デーモン (daemon) スレッドでは有用である。\n"
4092 "デフォルトでは、新しいスレッドは join 可能な状態で作成される。\n"
4093 "(B<pthread_attr_setdetachstate>(3) を使って) I<attr> でスレッドが\n"
4094 "detached 状態で作成されるように設定されていない限り、join 可能な状態で\n"
4095 "作成される。"
4096
4097 #.  FIXME . Perhaps some of the following detail should be in
4098 #.  a future pthread_attr_setstacksize(3) page.
4099 #. type: Plain text
4100 #: build/C/man3/pthread_create.3:203
4101 msgid "On Linux/x86-32, the default stack size for a new thread is 2 megabytes.  Under the NPTL threading implementation, if the B<RLIMIT_STACK> soft resource limit I<at the time the program started> has any value other than \"unlimited\", then it determines the default stack size of new threads.  Using B<pthread_attr_setstacksize>(3), the stack size attribute can be explicitly set in the I<attr> argument used to create a thread, in order to obtain a stack size other than the default."
4102 msgstr ""
4103 "Linux/x86-32 では、新しいスレッドのデフォルトのスタックサイズは 2MB で\n"
4104 "ある。NPTL スレッド実装の下では、I<プログラム開始時の> B<RLIMIT_STACK>\n"
4105 "ソフトリソース上限が\"unlimited\" 以外の場合、その値が新しいスレッドのデ\n"
4106 "フォルトのスタックサイズとなる。\n"
4107 "B<pthread_attr_setstacksize>(3) を使って、スレッドを作成する際の\n"
4108 "I<attr> 引き数に明示的にスタックサイズ属性を設定することで、\n"
4109 "デフォルト値以外のスタックサイズを得ることができる。"
4110
4111 #. type: Plain text
4112 #: build/C/man3/pthread_create.3:209
4113 msgid "In the obsolete LinuxThreads implementation, each of the threads in a process has a different process ID.  This is in violation of the POSIX threads specification, and is the source of many other nonconformances to the standard; see B<pthreads>(7)."
4114 msgstr ""
4115 "廃止予定の LinuxThreads 実装では、プロセス内の各スレッドは異なる\n"
4116 "プロセス ID を持つ。これは POSIX スレッドの規格に違反しており、\n"
4117 "他の多くの標準非準拠の点の原因になっている。\n"
4118 "B<pthreads>(7) を参照のこと。"
4119
4120 #. type: Plain text
4121 #: build/C/man3/pthread_create.3:213
4122 msgid "The program below demonstrates the use of B<pthread_create>(), as well as a number of other functions in the pthreads API."
4123 msgstr ""
4124 "以下のプログラムは、 B<pthread_create>() や\n"
4125 "pthreads API の他のいろいろな関数の使用例を示している。"
4126
4127 #. type: Plain text
4128 #: build/C/man3/pthread_create.3:218
4129 msgid "In the following run, on a system providing the NPTL threading implementation, the stack size defaults to the value given by the \"stack size\" resource limit:"
4130 msgstr ""
4131 "以下の実行例は、 NPTL スレッド実装が提供されているシステムでのもので、\n"
4132 "スタックサイズがデフォルト値の \"stack size\" リソース上限で指定される値\n"
4133 "になる。"
4134
4135 #. type: Plain text
4136 #: build/C/man3/pthread_create.3:230
4137 #, no-wrap
4138 msgid ""
4139 "$B< ulimit -s>\n"
4140 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
4141 "$B< ./a.out hola salut servus>\n"
4142 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4143 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4144 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4145 "Joined with thread 1; returned value was HOLA\n"
4146 "Joined with thread 2; returned value was SALUT\n"
4147 "Joined with thread 3; returned value was SERVUS\n"
4148 msgstr ""
4149 "$B< ulimit -s>\n"
4150 "8192            # The stack size limit is 8 MB (0x800000 bytes)\n"
4151 "$B< ./a.out hola salut servus>\n"
4152 "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n"
4153 "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n"
4154 "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n"
4155 "Joined with thread 1; returned value was HOLA\n"
4156 "Joined with thread 2; returned value was SALUT\n"
4157 "Joined with thread 3; returned value was SERVUS\n"
4158
4159 #. type: Plain text
4160 #: build/C/man3/pthread_create.3:236
4161 msgid "In the next run, the program explicitly sets a stack size of 1MB (using B<pthread_attr_setstacksize>(3))  for the created threads:"
4162 msgstr ""
4163 "次の実行例では、プログラム内で、作成されるスレッドに対して\n"
4164 "(B<pthread_attr_setstacksize>(3) を使って1MB のスタックサイズを\n"
4165 "明示的に設定している。"
4166
4167 #. type: Plain text
4168 #: build/C/man3/pthread_create.3:246
4169 #, no-wrap
4170 msgid ""
4171 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4172 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4173 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4174 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4175 "Joined with thread 1; returned value was HOLA\n"
4176 "Joined with thread 2; returned value was SALUT\n"
4177 "Joined with thread 3; returned value was SERVUS\n"
4178 msgstr ""
4179 "$B< ./a.out -s 0x100000 hola salut servus>\n"
4180 "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n"
4181 "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n"
4182 "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n"
4183 "Joined with thread 1; returned value was HOLA\n"
4184 "Joined with thread 2; returned value was SALUT\n"
4185 "Joined with thread 3; returned value was SERVUS\n"
4186
4187 #. type: Plain text
4188 #: build/C/man3/pthread_create.3:258
4189 #, no-wrap
4190 msgid ""
4191 "#include E<lt>pthread.hE<gt>\n"
4192 "#include E<lt>string.hE<gt>\n"
4193 "#include E<lt>stdio.hE<gt>\n"
4194 "#include E<lt>stdlib.hE<gt>\n"
4195 "#include E<lt>unistd.hE<gt>\n"
4196 "#include E<lt>errno.hE<gt>\n"
4197 "#include E<lt>ctype.hE<gt>\n"
4198 msgstr ""
4199 "#include E<lt>pthread.hE<gt>\n"
4200 "#include E<lt>string.hE<gt>\n"
4201 "#include E<lt>stdio.hE<gt>\n"
4202 "#include E<lt>stdlib.hE<gt>\n"
4203 "#include E<lt>unistd.hE<gt>\n"
4204 "#include E<lt>errno.hE<gt>\n"
4205 "#include E<lt>ctype.hE<gt>\n"
4206
4207 #. type: Plain text
4208 #: build/C/man3/pthread_create.3:264 build/C/man3/pthread_getcpuclockid.3:116
4209 #, no-wrap
4210 msgid ""
4211 "#define handle_error(msg) \\e\n"
4212 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4213 msgstr ""
4214 "#define handle_error(msg) \\e\n"
4215 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
4216
4217 #. type: Plain text
4218 #: build/C/man3/pthread_create.3:270
4219 #, no-wrap
4220 msgid ""
4221 "struct thread_info {    /* Used as argument to thread_start() */\n"
4222 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4223 "    int       thread_num;       /* Application-defined thread # */\n"
4224 "    char     *argv_string;      /* From command-line argument */\n"
4225 "};\n"
4226 msgstr ""
4227 "struct thread_info {    /* Used as argument to thread_start() */\n"
4228 "    pthread_t thread_id;        /* ID returned by pthread_create() */\n"
4229 "    int       thread_num;       /* Application-defined thread # */\n"
4230 "    char     *argv_string;      /* From command-line argument */\n"
4231 "};\n"
4232
4233 #. type: Plain text
4234 #: build/C/man3/pthread_create.3:273
4235 #, no-wrap
4236 msgid ""
4237 "/* Thread start function: display address near top of our stack,\n"
4238 "   and return upper-cased copy of argv_string */\n"
4239 msgstr ""
4240 "/* Thread start function: display address near top of our stack,\n"
4241 "   and return upper-cased copy of argv_string */\n"
4242
4243 #. type: Plain text
4244 #: build/C/man3/pthread_create.3:279
4245 #, no-wrap
4246 msgid ""
4247 "static void *\n"
4248 "thread_start(void *arg)\n"
4249 "{\n"
4250 "    struct thread_info *tinfo = arg;\n"
4251 "    char *uargv, *p;\n"
4252 msgstr ""
4253 "static void *\n"
4254 "thread_start(void *arg)\n"
4255 "{\n"
4256 "    struct thread_info *tinfo = arg;\n"
4257 "    char *uargv, *p;\n"
4258
4259 #. type: Plain text
4260 #: build/C/man3/pthread_create.3:282
4261 #, no-wrap
4262 msgid ""
4263 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4264 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4265 msgstr ""
4266 "    printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n"
4267 "            tinfo-E<gt>thread_num, &p, tinfo-E<gt>argv_string);\n"
4268
4269 #. type: Plain text
4270 #: build/C/man3/pthread_create.3:286
4271 #, no-wrap
4272 msgid ""
4273 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4274 "    if (uargv == NULL)\n"
4275 "        handle_error(\"strdup\");\n"
4276 msgstr ""
4277 "    uargv = strdup(tinfo-E<gt>argv_string);\n"
4278 "    if (uargv == NULL)\n"
4279 "        handle_error(\"strdup\");\n"
4280
4281 #. type: Plain text
4282 #: build/C/man3/pthread_create.3:289
4283 #, no-wrap
4284 msgid ""
4285 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4286 "        *p = toupper(*p);\n"
4287 msgstr ""
4288 "    for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n"
4289 "        *p = toupper(*p);\n"
4290
4291 #. type: Plain text
4292 #: build/C/man3/pthread_create.3:292
4293 #, no-wrap
4294 msgid ""
4295 "    return uargv;\n"
4296 "}\n"
4297 msgstr ""
4298 "    return uargv;\n"
4299 "}\n"
4300
4301 #. type: Plain text
4302 #: build/C/man3/pthread_create.3:301
4303 #, no-wrap
4304 msgid ""
4305 "int\n"
4306 "main(int argc, char *argv[])\n"
4307 "{\n"
4308 "    int s, tnum, opt, num_threads;\n"
4309 "    struct thread_info *tinfo;\n"
4310 "    pthread_attr_t attr;\n"
4311 "    int stack_size;\n"
4312 "    void *res;\n"
4313 msgstr ""
4314 "int\n"
4315 "main(int argc, char *argv[])\n"
4316 "{\n"
4317 "    int s, tnum, opt, num_threads;\n"
4318 "    struct thread_info *tinfo;\n"
4319 "    pthread_attr_t attr;\n"
4320 "    int stack_size;\n"
4321 "    void *res;\n"
4322
4323 #. type: Plain text
4324 #: build/C/man3/pthread_create.3:303
4325 #, no-wrap
4326 msgid "    /* The \"-s\" option specifies a stack size for our threads */\n"
4327 msgstr "    /* The \"-s\" option specifies a stack size for our threads */\n"
4328
4329 #. type: Plain text
4330 #: build/C/man3/pthread_create.3:310
4331 #, no-wrap
4332 msgid ""
4333 "    stack_size = -1;\n"
4334 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4335 "        switch (opt) {\n"
4336 "        case \\(aqs\\(aq:\n"
4337 "            stack_size = strtoul(optarg, NULL, 0);\n"
4338 "            break;\n"
4339 msgstr ""
4340 "    stack_size = -1;\n"
4341 "    while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n"
4342 "        switch (opt) {\n"
4343 "        case \\(aqs\\(aq:\n"
4344 "            stack_size = strtoul(optarg, NULL, 0);\n"
4345 "            break;\n"
4346
4347 #. type: Plain text
4348 #: build/C/man3/pthread_create.3:317
4349 #, no-wrap
4350 msgid ""
4351 "        default:\n"
4352 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4353 "                    argv[0]);\n"
4354 "            exit(EXIT_FAILURE);\n"
4355 "        }\n"
4356 "    }\n"
4357 msgstr ""
4358 "        default:\n"
4359 "            fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n"
4360 "                    argv[0]);\n"
4361 "            exit(EXIT_FAILURE);\n"
4362 "        }\n"
4363 "    }\n"
4364
4365 #. type: Plain text
4366 #: build/C/man3/pthread_create.3:319
4367 #, no-wrap
4368 msgid "    num_threads = argc - optind;\n"
4369 msgstr "    num_threads = argc - optind;\n"
4370
4371 #. type: Plain text
4372 #: build/C/man3/pthread_create.3:321
4373 #, no-wrap
4374 msgid "    /* Initialize thread creation attributes */\n"
4375 msgstr "    /* Initialize thread creation attributes */\n"
4376
4377 #. type: Plain text
4378 #: build/C/man3/pthread_create.3:325
4379 #, no-wrap
4380 msgid ""
4381 "    s = pthread_attr_init(&attr);\n"
4382 "    if (s != 0)\n"
4383 "        handle_error_en(s, \"pthread_attr_init\");\n"
4384 msgstr ""
4385 "    s = pthread_attr_init(&attr);\n"
4386 "    if (s != 0)\n"
4387 "        handle_error_en(s, \"pthread_attr_init\");\n"
4388
4389 #. type: Plain text
4390 #: build/C/man3/pthread_create.3:331
4391 #, no-wrap
4392 msgid ""
4393 "    if (stack_size E<gt> 0) {\n"
4394 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4395 "        if (s != 0)\n"
4396 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4397 "    }\n"
4398 msgstr ""
4399 "    if (stack_size E<gt> 0) {\n"
4400 "        s = pthread_attr_setstacksize(&attr, stack_size);\n"
4401 "        if (s != 0)\n"
4402 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
4403 "    }\n"
4404
4405 #. type: Plain text
4406 #: build/C/man3/pthread_create.3:333
4407 #, no-wrap
4408 msgid "    /* Allocate memory for pthread_create() arguments */\n"
4409 msgstr "    /* Allocate memory for pthread_create() arguments */\n"
4410
4411 #. type: Plain text
4412 #: build/C/man3/pthread_create.3:337
4413 #, no-wrap
4414 msgid ""
4415 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4416 "    if (tinfo == NULL)\n"
4417 "        handle_error(\"calloc\");\n"
4418 msgstr ""
4419 "    tinfo = calloc(num_threads, sizeof(struct thread_info));\n"
4420 "    if (tinfo == NULL)\n"
4421 "        handle_error(\"calloc\");\n"
4422
4423 #. type: Plain text
4424 #: build/C/man3/pthread_create.3:339
4425 #, no-wrap
4426 msgid "    /* Create one thread for each command-line argument */\n"
4427 msgstr "    /* Create one thread for each command-line argument */\n"
4428
4429 #. type: Plain text
4430 #: build/C/man3/pthread_create.3:343
4431 #, no-wrap
4432 msgid ""
4433 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4434 "        tinfo[tnum].thread_num = tnum + 1;\n"
4435 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4436 msgstr ""
4437 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4438 "        tinfo[tnum].thread_num = tnum + 1;\n"
4439 "        tinfo[tnum].argv_string = argv[optind + tnum];\n"
4440
4441 #. type: Plain text
4442 #: build/C/man3/pthread_create.3:346
4443 #, no-wrap
4444 msgid ""
4445 "        /* The pthread_create() call stores the thread ID into\n"
4446 "           corresponding element of tinfo[] */\n"
4447 msgstr ""
4448 "        /* The pthread_create() call stores the thread ID into\n"
4449 "           corresponding element of tinfo[] */\n"
4450
4451 #. type: Plain text
4452 #: build/C/man3/pthread_create.3:352
4453 #, no-wrap
4454 msgid ""
4455 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4456 "                           &thread_start, &tinfo[tnum]);\n"
4457 "        if (s != 0)\n"
4458 "            handle_error_en(s, \"pthread_create\");\n"
4459 "    }\n"
4460 msgstr ""
4461 "        s = pthread_create(&tinfo[tnum].thread_id, &attr,\n"
4462 "                           &thread_start, &tinfo[tnum]);\n"
4463 "        if (s != 0)\n"
4464 "            handle_error_en(s, \"pthread_create\");\n"
4465 "    }\n"
4466
4467 #. type: Plain text
4468 #: build/C/man3/pthread_create.3:355
4469 #, no-wrap
4470 msgid ""
4471 "    /* Destroy the thread attributes object, since it is no\n"
4472 "       longer needed */\n"
4473 msgstr ""
4474 "    /* Destroy the thread attributes object, since it is no\n"
4475 "       longer needed */\n"
4476
4477 #. type: Plain text
4478 #: build/C/man3/pthread_create.3:359
4479 #, no-wrap
4480 msgid ""
4481 "    s = pthread_attr_destroy(&attr);\n"
4482 "    if (s != 0)\n"
4483 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4484 msgstr ""
4485 "    s = pthread_attr_destroy(&attr);\n"
4486 "    if (s != 0)\n"
4487 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
4488
4489 #. type: Plain text
4490 #: build/C/man3/pthread_create.3:361
4491 #, no-wrap
4492 msgid "    /* Now join with each thread, and display its returned value */\n"
4493 msgstr "    /* Now join with each thread, and display its returned value */\n"
4494
4495 #. type: Plain text
4496 #: build/C/man3/pthread_create.3:366
4497 #, no-wrap
4498 msgid ""
4499 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4500 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4501 "        if (s != 0)\n"
4502 "            handle_error_en(s, \"pthread_join\");\n"
4503 msgstr ""
4504 "    for (tnum = 0; tnum E<lt> num_threads; tnum++) {\n"
4505 "        s = pthread_join(tinfo[tnum].thread_id, &res);\n"
4506 "        if (s != 0)\n"
4507 "            handle_error_en(s, \"pthread_join\");\n"
4508
4509 #. type: Plain text
4510 #: build/C/man3/pthread_create.3:371
4511 #, no-wrap
4512 msgid ""
4513 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4514 "                tinfo[tnum].thread_num, (char *) res);\n"
4515 "        free(res);      /* Free memory allocated by thread */\n"
4516 "    }\n"
4517 msgstr ""
4518 "        printf(\"Joined with thread %d; returned value was %s\\en\",\n"
4519 "                tinfo[tnum].thread_num, (char *) res);\n"
4520 "        free(res);      /* Free memory allocated by thread */\n"
4521 "    }\n"
4522
4523 #. type: Plain text
4524 #: build/C/man3/pthread_create.3:375
4525 #, no-wrap
4526 msgid ""
4527 "    free(tinfo);\n"
4528 "    exit(EXIT_SUCCESS);\n"
4529 "}\n"
4530 msgstr ""
4531 "    free(tinfo);\n"
4532 "    exit(EXIT_SUCCESS);\n"
4533 "}\n"
4534
4535 #. type: Plain text
4536 #: build/C/man3/pthread_create.3:389
4537 msgid "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<pthreads>(7)"
4538 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<pthreads>(7)"
4539
4540 #. type: TH
4541 #: build/C/man3/pthread_detach.3:26
4542 #, no-wrap
4543 msgid "PTHREAD_DETACH"
4544 msgstr "PTHREAD_DETACH"
4545
4546 #. type: TH
4547 #: build/C/man3/pthread_detach.3:26 build/C/man3/pthread_join.3:26
4548 #, no-wrap
4549 msgid "2008-11-27"
4550 msgstr "2008-11-27"
4551
4552 #. type: Plain text
4553 #: build/C/man3/pthread_detach.3:29
4554 msgid "pthread_detach - detach a thread"
4555 msgstr "pthread_detach - スレッドを切り離す (detach する)"
4556
4557 #. type: Plain text
4558 #: build/C/man3/pthread_detach.3:34
4559 #, no-wrap
4560 msgid "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
4561 msgstr "B<int pthread_detach(pthread_t >I<thread>B<);>\n"
4562
4563 #. type: Plain text
4564 #: build/C/man3/pthread_detach.3:46
4565 msgid "The B<pthread_detach>()  function marks the thread identified by I<thread> as detached.  When a detached thread terminates, its resources are automatically released back to the system without the need for another thread to join with the terminated thread."
4566 msgstr ""
4567 "B<pthread_detach>() 関数は I<thread> で識別されるスレッドに\n"
4568 "detached (切り離された状態) という印を付ける。\n"
4569 "detached 状態のスレッドが終了すると、\n"
4570 "別のスレッドが終了されたスレッドを join しなくても、\n"
4571 "そのスレッドのリソースは自動的に解放されてシステムに戻される。"
4572
4573 #. type: Plain text
4574 #: build/C/man3/pthread_detach.3:49
4575 msgid "Attempting to detach an already detached thread results in unspecified behavior."
4576 msgstr ""
4577 "すでに detach 状態のスレッドを detach しようとした場合に\n"
4578 "どのような結果となるかは規定されていない。"
4579
4580 #. type: Plain text
4581 #: build/C/man3/pthread_detach.3:54
4582 msgid "On success, B<pthread_detach>()  returns 0; on error, it returns an error number."
4583 msgstr ""
4584 "成功すると、B<pthread_detach>() は 0 を返す。\n"
4585 "エラーの場合、エラー番号を返す。"
4586
4587 #. type: Plain text
4588 #: build/C/man3/pthread_detach.3:59 build/C/man3/pthread_join.3:89
4589 msgid "I<thread> is not a joinable thread."
4590 msgstr "I<thread> が join 可能なスレッドではない。"
4591
4592 #. type: Plain text
4593 #: build/C/man3/pthread_detach.3:70
4594 msgid "Once a thread has been detached, it can't be joined with B<pthread_join>(3)  or be made joinable again."
4595 msgstr ""
4596 "いったんスレッドを detached 状態にすると、\n"
4597 "そのスレッドを B<pthread_join>(3) で join したり、\n"
4598 "もう一度 join 可能にしたりすることはできない。"
4599
4600 #. type: Plain text
4601 #: build/C/man3/pthread_detach.3:77
4602 msgid "A new thread can be created in a detached state using B<pthread_attr_setdetachstate>(3)  to set the detached attribute of the I<attr> argument of B<pthread_create>(3)."
4603 msgstr ""
4604 "B<pthread_attr_setdetachstate>(3) を使って\n"
4605 "B<pthread_create>(3) の I<attr> 引き数の detached 属性を設定することで、\n"
4606 "新しいスレッドを detached 状態で作成することができる。"
4607
4608 #. type: Plain text
4609 #: build/C/man3/pthread_detach.3:84
4610 msgid "The detached attribute merely determines the behavior of the system when the thread terminates; it does not prevent the thread from being terminated if the process terminates using B<exit>(3)  (or equivalently, if the main thread returns)."
4611 msgstr ""
4612 "detached 属性は、スレッドが終了した際のシステムの動作を決めるだけである。\n"
4613 "プロセスが B<exit>(3) を使って終了した場合に、そのスレッドが終了され\n"
4614 "なくなるようなことはない (なお、メインスレッドが return した場合も\n"
4615 "プロセスが B<exit>(3) を使って終了した場合と全く同じである)。 "
4616
4617 #. type: Plain text
4618 #: build/C/man3/pthread_detach.3:93
4619 msgid "Either B<pthread_join>(3)  or B<pthread_detach>()  should be called for each thread that an application creates, so that system resources for the thread can be released.  (But note that the resources of all threads are freed when the process terminates.)"
4620 msgstr ""
4621 "アプリケーションが作成した各スレッドについて、そのスレッドが使用して\n"
4622 "いるシステムリソースを解放できるように、B<pthread_join>(3) か\n"
4623 "B<pthread_detach>() のどちらかを呼び出すべきである (ただし、プロセスが\n"
4624 "終了するときには、全てのスレッドのリソースが解放される)。"
4625
4626 #. type: Plain text
4627 #: build/C/man3/pthread_detach.3:95
4628 msgid "The following statement detaches the calling thread:"
4629 msgstr "以下の文は、呼び出したスレッド自身を detach する。"
4630
4631 #. type: Plain text
4632 #: build/C/man3/pthread_detach.3:97
4633 #, no-wrap
4634 msgid "    pthread_detach(pthread_self());\n"
4635 msgstr "    pthread_detach(pthread_self());\n"
4636
4637 #. type: Plain text
4638 #: build/C/man3/pthread_detach.3:104
4639 msgid "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
4640 msgstr "B<pthread_attr_setdetachstate>(3), B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
4641
4642 #. type: TH
4643 #: build/C/man3/pthread_equal.3:26
4644 #, no-wrap
4645 msgid "PTHREAD_EQUAL"
4646 msgstr "PTHREAD_EQUAL"
4647
4648 #. type: TH
4649 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26
4650 #: build/C/man3/pthread_getcpuclockid.3:26
4651 #: build/C/man3/pthread_setaffinity_np.3:26
4652 #: build/C/man3/pthread_setconcurrency.3:25
4653 #, no-wrap
4654 msgid "2014-05-23"
4655 msgstr "2014-05-23"
4656
4657 #. type: Plain text
4658 #: build/C/man3/pthread_equal.3:29
4659 msgid "pthread_equal - compare thread IDs"
4660 msgstr "pthread_equal - スレッド ID を比較する"
4661
4662 #. type: Plain text
4663 #: build/C/man3/pthread_equal.3:34
4664 #, no-wrap
4665 msgid "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
4666 msgstr "B<int pthread_equal(pthread_t >I<t1>B<, pthread_t >I<t2>B<);>\n"
4667
4668 #. type: Plain text
4669 #: build/C/man3/pthread_equal.3:41
4670 msgid "The B<pthread_equal>()  function compares two thread identifiers."
4671 msgstr "B<pthread_equal>() 関数は 2 つのスレッド識別子の比較を行う。"
4672
4673 #. type: Plain text
4674 #: build/C/man3/pthread_equal.3:45
4675 msgid "If the two thread IDs are equal, B<pthread_equal>()  returns a nonzero value; otherwise, it returns 0."
4676 msgstr ""
4677 "B<pthread_equal>() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n"
4678 "そうでなければ 0 を返す。"
4679
4680 #.  SH VERSIONS
4681 #.  Available since glibc 2.0
4682 #. type: Plain text
4683 #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75
4684 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_testcancel.3:58
4685 msgid "This function always succeeds."
4686 msgstr "この関数は常に成功する。"
4687
4688 #. type: Plain text
4689 #: build/C/man3/pthread_equal.3:52
4690 msgid "The B<pthread_equal>()  function is thread-safe."
4691 msgstr "B<pthread_equal>() 関数はスレッドセーフである。"
4692
4693 #. type: Plain text
4694 #: build/C/man3/pthread_equal.3:61
4695 msgid "The B<pthread_equal>()  function is necessary because thread IDs should be considered opaque: there is no portable way for applications to directly compare two I<pthread_t> values."
4696 msgstr ""
4697 "B<pthread_equal>() 関数が必要なのは、\n"
4698 "スレッド ID はその内部構造を意識すべきではないためである。\n"
4699 "アプリケーションが 2 つの I<pthread_t> の値を直接比較する場合、\n"
4700 "移植性を確保できる形で比較する方法はない。"
4701
4702 #. type: Plain text
4703 #: build/C/man3/pthread_equal.3:65
4704 msgid "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
4705 msgstr "B<pthread_create>(3), B<pthread_self>(3), B<pthreads>(7)"
4706
4707 #. type: TH
4708 #: build/C/man3/pthread_exit.3:26
4709 #, no-wrap
4710 msgid "PTHREAD_EXIT"
4711 msgstr "PTHREAD_EXIT"
4712
4713 #. type: Plain text
4714 #: build/C/man3/pthread_exit.3:29
4715 msgid "pthread_exit - terminate calling thread"
4716 msgstr "pthread_exit - 呼び出したスレッドを終了する"
4717
4718 #. type: Plain text
4719 #: build/C/man3/pthread_exit.3:34
4720 #, no-wrap
4721 msgid "B<void pthread_exit(void *>I<retval>B<);>\n"
4722 msgstr "B<void pthread_exit(void *>I<retval>B<);>\n"
4723
4724 #. type: Plain text
4725 #: build/C/man3/pthread_exit.3:45
4726 msgid "The B<pthread_exit>()  function terminates the calling thread and returns a value via I<retval> that (if the thread is joinable)  is available to another thread in the same process that calls B<pthread_join>(3)."
4727 msgstr ""
4728 "B<pthread_exit>() 関数は、呼び出したスレッドを終了し、\n"
4729 "I<retval> 経由で値を返す。\n"
4730 "この値は (そのスレッドが join 可能な場合に) B<pthread_join>(3) を\n"
4731 "呼び出した同じプロセス内の別のスレッドが参照できる値と同じである。"
4732
4733 #. type: Plain text
4734 #: build/C/man3/pthread_exit.3:55
4735 msgid "Any clean-up handlers established by B<pthread_cleanup_push>(3)  that have not yet been popped, are popped (in the reverse of the order in which they were pushed)  and executed.  If the thread has any thread-specific data, then, after the clean-up handlers have been executed, the corresponding destructor functions are called, in an unspecified order."
4736 msgstr ""
4737 "B<pthread_cleanup_push>(3) で設定されたクリーンアップハンドラのうち、\n"
4738 "まだ pop (取り出されていない) ハンドラを (push されたのと逆の順序で)\n"
4739 "取り出して実行する。そのスレッドがスレッド固有のデータを持っている\n"
4740 "場合は、クリーンアップハンドラが実行された後に、スレッド固有のデータ\n"
4741 "に対応するデストラクタ (destructor) 関数が呼び出される (呼び出し順序\n"
4742 "は規定されていない)。"
4743
4744 #. type: Plain text
4745 #: build/C/man3/pthread_exit.3:62
4746 msgid "When a thread terminates, process-shared resources (e.g., mutexes, condition variables, semaphores, and file descriptors) are not released, and functions registered using B<atexit>(3)  are not called."
4747 msgstr ""
4748 "スレッドが終了する際に、プロセスの共有リソース (例えば、mutex、状態変数\n"
4749 "(condition variables)、セマフォ、ファイルディスクリプター)が解放される。\n"
4750 "B<atexit>(3) を使って登録された関数は呼び出されない。"
4751
4752 #. type: Plain text
4753 #: build/C/man3/pthread_exit.3:71
4754 msgid "After the last thread in a process terminates, the process terminates as by calling B<exit>(3)  with an exit status of zero; thus, process-shared resources are released and functions registered using B<atexit>(3)  are called."
4755 msgstr ""
4756 "プロセスの最後のスレッドが終了すると、そのプロセスは、終了ステータス 0\n"
4757 "で B<exit>(3) を呼び出した場合と全く同じように終了する。したがって、\n"
4758 "プロセスの共有リソースは解放され、B<atexit>(3) を使って登録された関数\n"
4759 "が呼び出される。"
4760
4761 #. type: Plain text
4762 #: build/C/man3/pthread_exit.3:73
4763 msgid "This function does not return to the caller."
4764 msgstr "この関数は呼び出し側には返らない。"
4765
4766 #. type: Plain text
4767 #: build/C/man3/pthread_exit.3:80
4768 msgid "The B<pthread_exit>()  function is thread-safe."
4769 msgstr "B<pthread_exit>() 関数はスレッドセーフである。"
4770
4771 #. type: Plain text
4772 #: build/C/man3/pthread_exit.3:87
4773 msgid "Performing a return from the start function of any thread other than the main thread results in an implicit call to B<pthread_exit>(), using the function's return value as the thread's exit status."
4774 msgstr ""
4775 "メインスレッド以外のスレッドの開始関数 (start function) がreturn を\n"
4776 "行うと、暗黙のうちに B<pthread_exit>() が呼び出され、\n"
4777 "関数の返り値がスレッドの終了ステータスとして使用される。"
4778
4779 #. type: Plain text
4780 #: build/C/man3/pthread_exit.3:93
4781 msgid "To allow other threads to continue execution, the main thread should terminate by calling B<pthread_exit>()  rather than B<exit>(3)."
4782 msgstr ""
4783 "他のスレッドが実行を継続できるように、メインスレッドは B<exit>(3) では\n"
4784 "なく B<pthread_exit>() を呼び出して終了すべきである。"
4785
4786 #. type: Plain text
4787 #: build/C/man3/pthread_exit.3:98
4788 msgid "The value pointed to by I<retval> should not be located on the calling thread's stack, since the contents of that stack are undefined after the thread terminates."
4789 msgstr ""
4790 "I<retval> が指す値は、呼び出したスレッドのスタックに置くべきではない。\n"
4791 "呼び出したスレッドが終了した後は、そのスタックの内容が不定となるから\n"
4792 "である。"
4793
4794 #.  Linux 2.6.27
4795 #.  FIXME . review a later kernel to see if this gets fixed
4796 #.  http://thread.gmane.org/gmane.linux.kernel/611611
4797 #.  http://marc.info/?l=linux-kernel&m=122525468300823&w=2
4798 #. type: Plain text
4799 #: build/C/man3/pthread_exit.3:110
4800 msgid "Currently, there are limitations in the kernel implementation logic for B<wait>(2)ing on a stopped thread group with a dead thread group leader.  This can manifest in problems such as a locked terminal if a stop signal is sent to a foreground process whose thread group leader has already called B<pthread_exit>()."
4801 msgstr ""
4802 "現在のところ、停止 (stop) されたスレッドグループを、すでに終了した\n"
4803 "(dead) スレッドグループリーダーで B<wait>(2) する場合の、\n"
4804 "カーネル実装の論理には制限がある。\n"
4805 "この制限は、すでにスレッドグループリーダーが B<pthread_exit>() を\n"
4806 "呼び出しているようなフォアグラウンドプロセスにストップシグナルが送信\n"
4807 "された場合に、端末がロックされてしまう、といった問題として表に見える\n"
4808 "場合がある。"
4809
4810 #. type: Plain text
4811 #: build/C/man3/pthread_exit.3:114
4812 msgid "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
4813 msgstr "B<pthread_create>(3), B<pthread_join>(3), B<pthreads>(7)"
4814
4815 #. type: TH
4816 #: build/C/man3/pthread_getattr_np.3:26
4817 #, no-wrap
4818 msgid "PTHREAD_GETATTR_NP"
4819 msgstr "PTHREAD_GETATTR_NP"
4820
4821 #. type: TH
4822 #: build/C/man3/pthread_getattr_np.3:26
4823 #, no-wrap
4824 msgid "2010-09-10"
4825 msgstr "2010-09-10"
4826
4827 #. type: Plain text
4828 #: build/C/man3/pthread_getattr_np.3:29
4829 msgid "pthread_getattr_np - get attributes of created thread"
4830 msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する"
4831
4832 #. type: Plain text
4833 #: build/C/man3/pthread_getattr_np.3:35
4834 #, no-wrap
4835 msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
4836 msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n"
4837
4838 #. type: Plain text
4839 #: build/C/man3/pthread_getattr_np.3:45
4840 msgid "The B<pthread_getattr_np>()  function initializes the thread attributes object referred to by I<attr> so that it contains actual attribute values describing the running thread I<thread>."
4841 msgstr ""
4842 "B<pthread_getattr_np>() 関数は、\n"
4843 "I<attr> が参照するスレッド属性オブジェクトを初期化し、\n"
4844 "そのオブジェクトに実行中のスレッド I<thread> の実際の属性値を\n"
4845 "格納して返す。"
4846
4847 #. type: Plain text
4848 #: build/C/man3/pthread_getattr_np.3:52
4849 msgid "The returned attribute values may differ from the corresponding attribute values passed in the I<attr> object that was used to create the thread using B<pthread_create>(3).  In particular, the following attributes may differ:"
4850 msgstr ""
4851 "返される属性値は、B<pthread_create>(3) でスレッドを作成する際に\n"
4852 "使われたI<attr> オブジェクトで渡された属性値と異なる場合がある。\n"
4853 "特に、以下の属性は異なる場合がある。"
4854
4855 #. type: Plain text
4856 #: build/C/man3/pthread_getattr_np.3:55
4857 msgid "the detach state, since a joinable thread may have detached itself after creation;"
4858 msgstr ""
4859 "detach state. join 可能なスレッドは作成後に自分自身を\n"
4860 "切り離す (detach する) ことができるからである。"
4861
4862 #. type: Plain text
4863 #: build/C/man3/pthread_getattr_np.3:58
4864 msgid "the stack size, which the implementation may align to a suitable boundary."
4865 msgstr ""
4866 "スタックサイズ。\n"
4867 "スレッドの実装によって適切な境界に揃えられる可能があるためである。"
4868
4869 #. type: Plain text
4870 #: build/C/man3/pthread_getattr_np.3:63
4871 msgid "and the guard size, which the implementation may round upward to a multiple of the page size, or ignore (i.e., treat as 0), if the application is allocating its own stack."
4872 msgstr ""
4873 "guard size.\n"
4874 "スレッドの実装によりページサイズの倍数に切り上げられたり、\n"
4875 "アプリケーションが自分でスタックを割り当てる場合には無視される\n"
4876 "(0 として扱われる) ことがあるからである。"
4877
4878 #. type: Plain text
4879 #: build/C/man3/pthread_getattr_np.3:68
4880 msgid "Furthermore, if the stack address attribute was not set in the thread attributes object used to create the thread, then the returned thread attributes object will report the actual stack address that the implementation selected for the thread."
4881 msgstr ""
4882 "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n"
4883 "スタックアドレスが設定されていなかった場合、\n"
4884 "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n"
4885 "割り当てた実際のスタックアドレスが報告される。"
4886
4887 #. type: Plain text
4888 #: build/C/man3/pthread_getattr_np.3:73
4889 msgid "When the thread attributes object returned by B<pthread_getattr_np>()  is no longer required, it should be destroyed using B<pthread_attr_destroy>(3)."
4890 msgstr ""
4891 "B<pthread_getattr_np>() が返したスレッド属性オブジェクトが\n"
4892 "必要なくなった際には、  B<pthread_attr_destroy>(3) を使って\n"
4893 "そのオブジェクトを破棄すべきである。"
4894
4895 #. type: Plain text
4896 #: build/C/man3/pthread_getattr_np.3:76
4897 #: build/C/man3/pthread_getcpuclockid.3:49
4898 msgid "On success, this function returns 0; on error, it returns a nonzero error number."
4899 msgstr ""
4900 "成功すると、この関数は 0 を返す。\n"
4901 "エラーの場合、 0 以外のエラー番号を返す。"
4902
4903 #.  Can happen (but unlikely) while trying to allocate memory for cpuset
4904 #. type: Plain text
4905 #: build/C/man3/pthread_getattr_np.3:81
4906 msgid "Insufficient memory."
4907 msgstr "メモリが十分になかった。"
4908
4909 #. type: Plain text
4910 #: build/C/man3/pthread_getattr_np.3:96
4911 msgid "In addition, if I<thread> refers to the main thread, then B<pthread_getattr_np>()  can fail because of errors from various underlying calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and B<getrlimit>(2), if the B<RLIMIT_STACK> resource limit is not supported."
4912 msgstr ""
4913 "さらに、 I<thread> がメインスレッドを参照している場合には、\n"
4914 "B<pthread_getattr_np>() は内部で行われる様々な呼び出しでの\n"
4915 "エラーで失敗する可能性がある。\n"
4916 "I</proc/self/maps> がオープンできない場合には B<fopen>(3)\n"
4917 "でエラーが発生し、リソース上限 B<RLIMIT_STACK> が\n"
4918 "サポートされていない場合には B<getrlimit>(2) でエラーが発生する。"
4919
4920 #. type: Plain text
4921 #: build/C/man3/pthread_getattr_np.3:98
4922 msgid "This function is available in glibc since version 2.2.3."
4923 msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。"
4924
4925 #. type: Plain text
4926 #: build/C/man3/pthread_getattr_np.3:101
4927 #: build/C/man3/pthread_kill_other_threads_np.3:55
4928 msgid "This function is a nonstandard GNU extension; hence the suffix \"_np\" (nonportable) in the name."
4929 msgstr ""
4930 "この関数は非標準の GNU による拡張である。\n"
4931 "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n"
4932 "付いている。"
4933
4934 #. type: Plain text
4935 #: build/C/man3/pthread_getattr_np.3:111
4936 msgid "The program below demonstrates the use of B<pthread_getattr_np>().  The program creates a thread that then uses B<pthread_getattr_np>()  to retrieve and display its guard size, stack address, and stack size attributes.  Command-line arguments can be used to set these attributes to values other than the default when creating the thread.  The shell sessions below demonstrate the use of the program."
4937 msgstr ""
4938 "以下のプログラムは B<pthread_getattr_np>() の使用例を示したものである。\n"
4939 "このプログラムは、スレッドを作成し、それから\n"
4940 "B<pthread_getattr_np>() を使ってそのスレッドの属性 guard size、\n"
4941 "スタックアドレス、スタックサイズを取得し表示する。\n"
4942 "コマンドライン引き数での指定で、スレッドを作成する際に\n"
4943 "上記の属性にデフォルト値以外の値を設定することができる。\n"
4944 "下記のシェルのセッションはこのプログラムの使用例である。"
4945
4946 #. type: Plain text
4947 #: build/C/man3/pthread_getattr_np.3:114
4948 msgid "In the first run, on an x86-32 system, a thread is created using default attributes:"
4949 msgstr ""
4950 "最初の実行例は、デフォルトの属性でスレッドが作成されている\n"
4951 "(x86-32 システム上で実行)。"
4952
4953 #. type: Plain text
4954 #: build/C/man3/pthread_getattr_np.3:124
4955 #, no-wrap
4956 msgid ""
4957 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
4958 "unlimited\n"
4959 "$B< ./a.out>\n"
4960 "Attributes of created thread:\n"
4961 "        Guard size          = 4096 bytes\n"
4962 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
4963 "        Stack size          = 0x201000 (2101248) bytes\n"
4964 msgstr ""
4965 "$B< ulimit -s>      # No stack limit ==E<gt> default stack size is 2MB\n"
4966 "unlimited\n"
4967 "$B< ./a.out>\n"
4968 "Attributes of created thread:\n"
4969 "        Guard size          = 4096 bytes\n"
4970 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
4971 "        Stack size          = 0x201000 (2101248) bytes\n"
4972
4973 #. type: Plain text
4974 #: build/C/man3/pthread_getattr_np.3:130
4975 msgid "In the following run, we see that if a guard size is specified, it is rounded up to the next multiple of the system page size (4096 bytes on x86-32):"
4976 msgstr ""
4977 "次の実行例では、guard size が指定された場合、\n"
4978 "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n"
4979 "(x86-32 ではシステムのページサイズは 4096 バイトである)。"
4980
4981 #. type: Plain text
4982 #: build/C/man3/pthread_getattr_np.3:138
4983 #, no-wrap
4984 msgid ""
4985 "$B< ./a.out -g 4097>\n"
4986 "Thread attributes object after initializations:\n"
4987 "        Guard size          = 4097 bytes\n"
4988 "        Stack address       = (nil)\n"
4989 "        Stack size          = 0x0 (0) bytes\n"
4990 msgstr ""
4991 "$B< ./a.out -g 4097>\n"
4992 "Thread attributes object after initializations:\n"
4993 "        Guard size          = 4097 bytes\n"
4994 "        Stack address       = (nil)\n"
4995 "        Stack size          = 0x0 (0) bytes\n"
4996
4997 #. type: Plain text
4998 #: build/C/man3/pthread_getattr_np.3:143
4999 #, no-wrap
5000 msgid ""
5001 "Attributes of created thread:\n"
5002 "        Guard size          = 8192 bytes\n"
5003 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5004 "        Stack size          = 0x201000 (2101248) bytes\n"
5005 msgstr ""
5006 "Attributes of created thread:\n"
5007 "        Guard size          = 8192 bytes\n"
5008 "        Stack address       = 0x40196000 (EOS = 0x40397000)\n"
5009 "        Stack size          = 0x201000 (2101248) bytes\n"
5010
5011 #. .in +4n
5012 #. .nf
5013 #. $ ./a.out \-s 0x8000
5014 #. Thread attributes object after initializations:
5015 #.         Guard size          = 4096 bytes
5016 #.         Stack address       = 0xffff8000 (EOS = (nil))
5017 #.         Stack size          = 0x8000 (32768) bytes
5018 #. Attributes of created thread:
5019 #.         Guard size          = 4096 bytes
5020 #.         Stack address       = 0x4001e000 (EOS = 0x40026000)
5021 #.         Stack size          = 0x8000 (32768) bytes
5022 #. .fi
5023 #. .in
5024 #. type: Plain text
5025 #: build/C/man3/pthread_getattr_np.3:162
5026 msgid "In the last run, the program manually allocates a stack for the thread.  In this case, the guard size attribute is ignored."
5027 msgstr ""
5028 "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n"
5029 "この場合には、guard size 属性は無視される。"
5030
5031 #. type: Plain text
5032 #: build/C/man3/pthread_getattr_np.3:167
5033 #, no-wrap
5034 msgid ""
5035 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5036 "Allocated thread stack at 0x804d000\n"
5037 msgstr ""
5038 "$B< ./a.out -g 4096 -s 0x8000 -a>\n"
5039 "Allocated thread stack at 0x804d000\n"
5040
5041 #. type: Plain text
5042 #: build/C/man3/pthread_getattr_np.3:172
5043 #, no-wrap
5044 msgid ""
5045 "Thread attributes object after initializations:\n"
5046 "        Guard size          = 4096 bytes\n"
5047 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5048 "        Stack size          = 0x8000 (32768) bytes\n"
5049 msgstr ""
5050 "Thread attributes object after initializations:\n"
5051 "        Guard size          = 4096 bytes\n"
5052 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5053 "        Stack size          = 0x8000 (32768) bytes\n"
5054
5055 #. type: Plain text
5056 #: build/C/man3/pthread_getattr_np.3:177
5057 #, no-wrap
5058 msgid ""
5059 "Attributes of created thread:\n"
5060 "        Guard size          = 0 bytes\n"
5061 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5062 "        Stack size          = 0x8000 (32768) bytes\n"
5063 msgstr ""
5064 "Attributes of created thread:\n"
5065 "        Guard size          = 0 bytes\n"
5066 "        Stack address       = 0x804d000 (EOS = 0x8055000)\n"
5067 "        Stack size          = 0x8000 (32768) bytes\n"
5068
5069 #. type: Plain text
5070 #: build/C/man3/pthread_getattr_np.3:198
5071 #, no-wrap
5072 msgid ""
5073 "static void\n"
5074 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5075 "{\n"
5076 "    int s;\n"
5077 "    size_t stack_size, guard_size;\n"
5078 "    void *stack_addr;\n"
5079 msgstr ""
5080 "static void\n"
5081 "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n"
5082 "{\n"
5083 "    int s;\n"
5084 "    size_t stack_size, guard_size;\n"
5085 "    void *stack_addr;\n"
5086
5087 #. type: Plain text
5088 #: build/C/man3/pthread_getattr_np.3:203
5089 #, no-wrap
5090 msgid ""
5091 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5092 "    if (s != 0)\n"
5093 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5094 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5095 msgstr ""
5096 "    s = pthread_attr_getguardsize(attr, &guard_size);\n"
5097 "    if (s != 0)\n"
5098 "        handle_error_en(s, \"pthread_attr_getguardsize\");\n"
5099 "    printf(\"%sGuard size          = %d bytes\\en\", prefix, guard_size);\n"
5100
5101 #. type: Plain text
5102 #: build/C/man3/pthread_getattr_np.3:214
5103 #, no-wrap
5104 msgid ""
5105 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5106 "    if (s != 0)\n"
5107 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5108 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5109 "    if (stack_size E<gt> 0)\n"
5110 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5111 "    printf(\"\\en\");\n"
5112 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5113 "            prefix, stack_size, stack_size);\n"
5114 "}\n"
5115 msgstr ""
5116 "    s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n"
5117 "    if (s != 0)\n"
5118 "        handle_error_en(s, \"pthread_attr_getstack\");\n"
5119 "    printf(\"%sStack address       = %p\", prefix, stack_addr);\n"
5120 "    if (stack_size E<gt> 0)\n"
5121 "        printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n"
5122 "    printf(\"\\en\");\n"
5123 "    printf(\"%sStack size          = 0x%x (%d) bytes\\en\",\n"
5124 "            prefix, stack_size, stack_size);\n"
5125 "}\n"
5126
5127 #. type: Plain text
5128 #: build/C/man3/pthread_getattr_np.3:220
5129 #, no-wrap
5130 msgid ""
5131 "static void\n"
5132 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5133 "{\n"
5134 "    int s;\n"
5135 "    pthread_attr_t attr;\n"
5136 msgstr ""
5137 "static void\n"
5138 "display_thread_attributes(pthread_t thread, char *prefix)\n"
5139 "{\n"
5140 "    int s;\n"
5141 "    pthread_attr_t attr;\n"
5142
5143 #. type: Plain text
5144 #: build/C/man3/pthread_getattr_np.3:224
5145 #, no-wrap
5146 msgid ""
5147 "    s = pthread_getattr_np(thread, &attr);\n"
5148 "    if (s != 0)\n"
5149 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5150 msgstr ""
5151 "    s = pthread_getattr_np(thread, &attr);\n"
5152 "    if (s != 0)\n"
5153 "        handle_error_en(s, \"pthread_getattr_np\");\n"
5154
5155 #. type: Plain text
5156 #: build/C/man3/pthread_getattr_np.3:226
5157 #, no-wrap
5158 msgid "    display_stack_related_attributes(&attr, prefix);\n"
5159 msgstr "    display_stack_related_attributes(&attr, prefix);\n"
5160
5161 #. type: Plain text
5162 #: build/C/man3/pthread_getattr_np.3:231
5163 #, no-wrap
5164 msgid ""
5165 "    s = pthread_attr_destroy(&attr);\n"
5166 "    if (s != 0)\n"
5167 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5168 "}\n"
5169 msgstr ""
5170 "    s = pthread_attr_destroy(&attr);\n"
5171 "    if (s != 0)\n"
5172 "        handle_error_en(s, \"pthread_attr_destroy\");\n"
5173 "}\n"
5174
5175 #. type: Plain text
5176 #: build/C/man3/pthread_getattr_np.3:237
5177 #, no-wrap
5178 msgid ""
5179 "static void *           /* Start function for thread we create */\n"
5180 "thread_start(void *arg)\n"
5181 "{\n"
5182 "    printf(\"Attributes of created thread:\\en\");\n"
5183 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5184 msgstr ""
5185 "static void *           /* Start function for thread we create */\n"
5186 "thread_start(void *arg)\n"
5187 "{\n"
5188 "    printf(\"Attributes of created thread:\\en\");\n"
5189 "    display_thread_attributes(pthread_self(), \"\\et\");\n"
5190
5191 #. type: Plain text
5192 #: build/C/man3/pthread_getattr_np.3:251
5193 #, no-wrap
5194 msgid ""
5195 "static void\n"
5196 "usage(char *pname, char *msg)\n"
5197 "{\n"
5198 "    if (msg != NULL)\n"
5199 "        fputs(msg, stderr);\n"
5200 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5201 "            \" [-g guard-size]\\en\", pname);\n"
5202 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5203 "    exit(EXIT_FAILURE);\n"
5204 "}\n"
5205 msgstr ""
5206 "static void\n"
5207 "usage(char *pname, char *msg)\n"
5208 "{\n"
5209 "    if (msg != NULL)\n"
5210 "        fputs(msg, stderr);\n"
5211 "    fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n"
5212 "            \" [-g guard-size]\\en\", pname);\n"
5213 "    fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n"
5214 "    exit(EXIT_FAILURE);\n"
5215 "}\n"
5216
5217 #. type: Plain text
5218 #: build/C/man3/pthread_getattr_np.3:264
5219 #, no-wrap
5220 msgid ""
5221 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5222 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5223 "                              pthread_attr_t *attrp)\n"
5224 "{\n"
5225 "    int s, opt, allocate_stack;\n"
5226 "    long stack_size, guard_size;\n"
5227 "            void *stack_addr;\n"
5228 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
5229 "                                           a thread attributes object */\n"
5230 "    allocate_stack = 0;\n"
5231 "    stack_size = -1;\n"
5232 "    guard_size = -1;\n"
5233 msgstr ""
5234 "static pthread_attr_t *   /* Get thread attributes from command line */\n"
5235 "get_thread_attributes_from_cl(int argc, char *argv[],\n"
5236 "                              pthread_attr_t *attrp)\n"
5237 "{\n"
5238 "    int s, opt, allocate_stack;\n"
5239 "    long stack_size, guard_size;\n"
5240 "            void *stack_addr;\n"
5241 "    pthread_attr_t *ret_attrp = NULL;   /* Set to attrp if we initialize\n"
5242 "                                           a thread attributes object */\n"
5243 "    allocate_stack = 0;\n"
5244 "    stack_size = -1;\n"
5245 "    guard_size = -1;\n"
5246
5247 #. type: Plain text
5248 #: build/C/man3/pthread_getattr_np.3:273
5249 #, no-wrap
5250 msgid ""
5251 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5252 "        switch (opt) {\n"
5253 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
5254 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
5255 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
5256 "        default:    usage(argv[0], NULL);\n"
5257 "        }\n"
5258 "    }\n"
5259 msgstr ""
5260 "    while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n"
5261 "        switch (opt) {\n"
5262 "        case \\(aqa\\(aq:   allocate_stack = 1;                     break;\n"
5263 "        case \\(aqg\\(aq:   guard_size = strtoul(optarg, NULL, 0);  break;\n"
5264 "        case \\(aqs\\(aq:   stack_size = strtoul(optarg, NULL, 0);  break;\n"
5265 "        default:    usage(argv[0], NULL);\n"
5266 "        }\n"
5267 "    }\n"
5268
5269 #. type: Plain text
5270 #: build/C/man3/pthread_getattr_np.3:276
5271 #, no-wrap
5272 msgid ""
5273 "    if (allocate_stack && stack_size == -1)\n"
5274 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5275 msgstr ""
5276 "    if (allocate_stack && stack_size == -1)\n"
5277 "        usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n"
5278
5279 #. type: Plain text
5280 #: build/C/man3/pthread_getattr_np.3:279
5281 #, no-wrap
5282 msgid ""
5283 "    if (argc E<gt> optind)\n"
5284 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5285 msgstr ""
5286 "    if (argc E<gt> optind)\n"
5287 "        usage(argv[0], \"Extraneous command-line arguments\\en\");\n"
5288
5289 #. type: Plain text
5290 #: build/C/man3/pthread_getattr_np.3:282
5291 #, no-wrap
5292 msgid ""
5293 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5294 "        ret_attrp = attrp;\n"
5295 msgstr ""
5296 "    if (stack_size E<gt>= 0 || guard_size E<gt> 0) {\n"
5297 "        ret_attrp = attrp;\n"
5298
5299 #. type: Plain text
5300 #: build/C/man3/pthread_getattr_np.3:287
5301 #, no-wrap
5302 msgid ""
5303 "        s = pthread_attr_init(attrp);\n"
5304 "        if (s != 0)\n"
5305 "            handle_error_en(s, \"pthread_attr_init\");\n"
5306 "    }\n"
5307 msgstr ""
5308 "        s = pthread_attr_init(attrp);\n"
5309 "        if (s != 0)\n"
5310 "            handle_error_en(s, \"pthread_attr_init\");\n"
5311 "    }\n"
5312
5313 #. type: Plain text
5314 #: build/C/man3/pthread_getattr_np.3:299
5315 #, no-wrap
5316 msgid ""
5317 "    if (stack_size E<gt>= 0) {\n"
5318 "        if (!allocate_stack) {\n"
5319 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
5320 "            if (s != 0)\n"
5321 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5322 "        } else {\n"
5323 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5324 "                               stack_size);\n"
5325 "            if (s != 0)\n"
5326 "                handle_error_en(s, \"posix_memalign\");\n"
5327 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5328 msgstr ""
5329 "    if (stack_size E<gt>= 0) {\n"
5330 "        if (!allocate_stack) {\n"
5331 "            s = pthread_attr_setstacksize(attrp, stack_size);\n"
5332 "            if (s != 0)\n"
5333 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5334 "        } else {\n"
5335 "            s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n"
5336 "                               stack_size);\n"
5337 "            if (s != 0)\n"
5338 "                handle_error_en(s, \"posix_memalign\");\n"
5339 "            printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n"
5340
5341 #. type: Plain text
5342 #: build/C/man3/pthread_getattr_np.3:305
5343 #, no-wrap
5344 msgid ""
5345 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5346 "            if (s != 0)\n"
5347 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5348 "        }\n"
5349 "    }\n"
5350 msgstr ""
5351 "            s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n"
5352 "            if (s != 0)\n"
5353 "                handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5354 "        }\n"
5355 "    }\n"
5356
5357 #. type: Plain text
5358 #: build/C/man3/pthread_getattr_np.3:311
5359 #, no-wrap
5360 msgid ""
5361 "    if (guard_size E<gt>= 0) {\n"
5362 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
5363 "        if (s != 0)\n"
5364 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5365 "    }\n"
5366 msgstr ""
5367 "    if (guard_size E<gt>= 0) {\n"
5368 "        s = pthread_attr_setguardsize(attrp, guard_size);\n"
5369 "        if (s != 0)\n"
5370 "            handle_error_en(s, \"pthread_attr_setstacksize\");\n"
5371 "    }\n"
5372
5373 #. type: Plain text
5374 #: build/C/man3/pthread_getattr_np.3:314
5375 #, no-wrap
5376 msgid ""
5377 "    return ret_attrp;\n"
5378 "}\n"
5379 msgstr ""
5380 "    return ret_attrp;\n"
5381 "}\n"
5382
5383 #. type: Plain text
5384 #: build/C/man3/pthread_getattr_np.3:323
5385 #, no-wrap
5386 msgid ""
5387 "int\n"
5388 "main(int argc, char *argv[])\n"
5389 "{\n"
5390 "    int s;\n"
5391 "    pthread_t thr;\n"
5392 "    pthread_attr_t attr;\n"
5393 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
5394 "                                        a thread attributes object */\n"
5395 msgstr ""
5396 "int\n"
5397 "main(int argc, char *argv[])\n"
5398 "{\n"
5399 "    int s;\n"
5400 "    pthread_t thr;\n"
5401 "    pthread_attr_t attr;\n"
5402 "    pthread_attr_t *attrp = NULL;    /* Set to &attr if we initialize\n"
5403 "                                        a thread attributes object */\n"
5404
5405 #. type: Plain text
5406 #: build/C/man3/pthread_getattr_np.3:325
5407 #, no-wrap
5408 msgid "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5409 msgstr "    attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n"
5410
5411 #. type: Plain text
5412 #: build/C/man3/pthread_getattr_np.3:331
5413 #, no-wrap
5414 msgid ""
5415 "    if (attrp != NULL) {\n"
5416 "        printf(\"Thread attributes object after initializations:\\en\");\n"
5417 "        display_stack_related_attributes(attrp, \"\\et\");\n"
5418 "        printf(\"\\en\");\n"
5419 "    }\n"
5420 msgstr ""
5421 "    if (attrp != NULL) {\n"
5422 "        printf(\"Thread attributes object after initializations:\\en\");\n"
5423 "        display_stack_related_attributes(attrp, \"\\et\");\n"
5424 "        printf(\"\\en\");\n"
5425 "    }\n"
5426
5427 #. type: Plain text
5428 #: build/C/man3/pthread_getattr_np.3:361
5429 msgid "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5430 msgstr "B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)"
5431
5432 #. type: TH
5433 #: build/C/man3/pthread_getcpuclockid.3:26
5434 #, no-wrap
5435 msgid "PTHREAD_GETCPUCLOCKID"
5436 msgstr "PTHREAD_GETCPUCLOCKID"
5437
5438 #. type: Plain text
5439 #: build/C/man3/pthread_getcpuclockid.3:29
5440 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock"
5441 msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する"
5442
5443 #. type: Plain text
5444 #: build/C/man3/pthread_getcpuclockid.3:33
5445 #, no-wrap
5446 msgid ""
5447 "B<#include E<lt>pthread.hE<gt>>\n"
5448 "B<#include E<lt>time.hE<gt>>\n"
5449 msgstr ""
5450 "B<#include E<lt>pthread.hE<gt>>\n"
5451 "B<#include E<lt>time.hE<gt>>\n"
5452
5453 #. type: Plain text
5454 #: build/C/man3/pthread_getcpuclockid.3:35
5455 #, no-wrap
5456 msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id>B<);>\n"
5457 msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clock_id>B<);>\n"
5458
5459 #.  The clockid is constructed as follows:
5460 #.  *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE)
5461 #.  where CLOCK_IDFIELD_SIZE is 3.
5462 #. type: Plain text
5463 #: build/C/man3/pthread_getcpuclockid.3:46
5464 msgid "The B<pthread_getcpuclockid>()  function returns the clock ID for the CPU time clock of the thread I<thread>."
5465 msgstr ""
5466 "B<pthread_getcpuclockid>() 関数は、\n"
5467 "スレッド I<thread> の CPU 時間時計のクロック ID を返す。"
5468
5469 #. type: TP
5470 #: build/C/man3/pthread_getcpuclockid.3:50
5471 #, no-wrap
5472 msgid "B<ENOENT>"
5473 msgstr "B<ENOENT>"
5474
5475 #.  CLOCK_THREAD_CPUTIME_ID not defined
5476 #.  Looking at nptl/pthread_getcpuclockid.c an ERANGE error would
5477 #.  be possible if kernel thread IDs took more than 29 bits (which
5478 #.  they currently cannot).
5479 #. type: Plain text
5480 #: build/C/man3/pthread_getcpuclockid.3:58
5481 msgid "Per-thread CPU time clocks are not supported by the system."
5482 msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。"
5483
5484 #. type: Plain text
5485 #: build/C/man3/pthread_getcpuclockid.3:65
5486 msgid "This function is available in glibc since version 2.2."
5487 msgstr "この関数は glibc バージョン 2.2 以降で利用できる。"
5488
5489 #. type: Plain text
5490 #: build/C/man3/pthread_getcpuclockid.3:70
5491 msgid "The B<pthread_getcpuclockid>()  function is thread-safe."
5492 msgstr "B<pthread_getcpuclockid>() 関数はスレッドセーフである。"
5493
5494 #. type: Plain text
5495 #: build/C/man3/pthread_getcpuclockid.3:83
5496 msgid "When I<thread> refers to the calling thread, this function returns an identifier that refers to the same clock manipulated by B<clock_gettime>(2)  and B<clock_settime>(2)  when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>."
5497 msgstr ""
5498 "I<thread> が呼び出したスレッドを参照している場合、\n"
5499 "クロック ID B<CLOCK_THREAD_CPUTIME_ID> が指定されていれば、\n"
5500 "B<clock_gettime>(2) と B<clock_settime>(2) が操作するのと同じ時計\n"
5501 "を参照する ID が返される。"
5502
5503 #. type: Plain text
5504 #: build/C/man3/pthread_getcpuclockid.3:89
5505 msgid "The program below creates a thread and then uses B<clock_gettime>(2)  to retrieve the total process CPU time, and the per-thread CPU time consumed by the two threads.  The following shell session shows an example run:"
5506 msgstr ""
5507 "以下のプログラムは、スレッドを作成し、それから\n"
5508 "B<clock_gettime>(2) を使ってプロセス全体の CPU 時間を取得し、\n"
5509 "B<pthread_getcpuclockid>(3) を使って 2 つのスレッドが消費した\n"
5510 "スレッド毎の CPU 時間を取得する。\n"
5511 "下記のシェルのセッションは実行例である。"
5512
5513 #. type: Plain text
5514 #: build/C/man3/pthread_getcpuclockid.3:99
5515 #, no-wrap
5516 msgid ""
5517 "$ B<./a.out>\n"
5518 "Main thread sleeping\n"
5519 "Subthread starting infinite loop\n"
5520 "Main thread consuming some CPU time...\n"
5521 "Process total CPU time:    1.368\n"
5522 "Main thread CPU time:      0.376\n"
5523 "Subthread CPU time:        0.992\n"
5524 msgstr ""
5525 "$ B<./a.out>\n"
5526 "Main thread sleeping\n"
5527 "Subthread starting infinite loop\n"
5528 "Main thread consuming some CPU time...\n"
5529 "Process total CPU time:    1.368\n"
5530 "Main thread CPU time:      0.376\n"
5531 "Subthread CPU time:        0.992\n"
5532
5533 #. type: Plain text
5534 #: build/C/man3/pthread_getcpuclockid.3:105
5535 #, no-wrap
5536 msgid "/* Link with \"-lrt\" */\n"
5537 msgstr "/* \"-lrt\" でリンクする */\n"
5538
5539 #. type: Plain text
5540 #: build/C/man3/pthread_getcpuclockid.3:113
5541 #, no-wrap
5542 msgid ""
5543 "#include E<lt>time.hE<gt>\n"
5544 "#include E<lt>stdio.hE<gt>\n"
5545 "#include E<lt>stdlib.hE<gt>\n"
5546 "#include E<lt>unistd.hE<gt>\n"
5547 "#include E<lt>pthread.hE<gt>\n"
5548 "#include E<lt>string.hE<gt>\n"
5549 "#include E<lt>errno.hE<gt>\n"
5550 msgstr ""
5551 "#include E<lt>time.hE<gt>\n"
5552 "#include E<lt>stdio.hE<gt>\n"
5553 "#include E<lt>stdlib.hE<gt>\n"
5554 "#include E<lt>unistd.hE<gt>\n"
5555 "#include E<lt>pthread.hE<gt>\n"
5556 "#include E<lt>string.hE<gt>\n"
5557 "#include E<lt>errno.hE<gt>\n"
5558
5559 #. type: Plain text
5560 #: build/C/man3/pthread_getcpuclockid.3:127
5561 #, no-wrap
5562 msgid ""
5563 "static void *\n"
5564 "thread_start(void *arg)\n"
5565 "{\n"
5566 "    printf(\"Subthread starting infinite loop\\en\");\n"
5567 "    for (;;)\n"
5568 "        continue;\n"
5569 "}\n"
5570 msgstr ""
5571 "static void *\n"
5572 "thread_start(void *arg)\n"
5573 "{\n"
5574 "    printf(\"Subthread starting infinite loop\\en\");\n"
5575 "    for (;;)\n"
5576 "        continue;\n"
5577 "}\n"
5578
5579 #. type: Plain text
5580 #: build/C/man3/pthread_getcpuclockid.3:132
5581 #, no-wrap
5582 msgid ""
5583 "static void\n"
5584 "pclock(char *msg, clockid_t cid)\n"
5585 "{\n"
5586 "    struct timespec ts;\n"
5587 msgstr ""
5588 "static void\n"
5589 "pclock(char *msg, clockid_t cid)\n"
5590 "{\n"
5591 "    struct timespec ts;\n"
5592
5593 #. type: Plain text
5594 #: build/C/man3/pthread_getcpuclockid.3:138
5595 #, no-wrap
5596 msgid ""
5597 "    printf(\"%s\", msg);\n"
5598 "    if (clock_gettime(cid, &ts) == -1)\n"
5599 "        handle_error(\"clock_gettime\");\n"
5600 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
5601 "}\n"
5602 msgstr ""
5603 "    printf(\"%s\", msg);\n"
5604 "    if (clock_gettime(cid, &ts) == -1)\n"
5605 "        handle_error(\"clock_gettime\");\n"
5606 "    printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n"
5607 "}\n"
5608
5609 #. type: Plain text
5610 #: build/C/man3/pthread_getcpuclockid.3:145
5611 #, no-wrap
5612 msgid ""
5613 "int\n"
5614 "main(int argc, char *argv[])\n"
5615 "{\n"
5616 "    pthread_t thread;\n"
5617 "    clockid_t cid;\n"
5618 "    int j, s;\n"
5619 msgstr ""
5620 "int\n"
5621 "main(int argc, char *argv[])\n"
5622 "{\n"
5623 "    pthread_t thread;\n"
5624 "    clockid_t cid;\n"
5625 "    int j, s;\n"
5626
5627 #. type: Plain text
5628 #: build/C/man3/pthread_getcpuclockid.3:149
5629 #, no-wrap
5630 msgid ""
5631 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
5632 "    if (s != 0)\n"
5633 "        handle_error_en(s, \"pthread_create\");\n"
5634 msgstr ""
5635 "    s = pthread_create(&thread, NULL, thread_start, NULL);\n"
5636 "    if (s != 0)\n"
5637 "        handle_error_en(s, \"pthread_create\");\n"
5638
5639 #. type: Plain text
5640 #: build/C/man3/pthread_getcpuclockid.3:152
5641 #, no-wrap
5642 msgid ""
5643 "    printf(\"Main thread sleeping\\en\");\n"
5644 "    sleep(1);\n"
5645 msgstr ""
5646 "    printf(\"Main thread sleeping\\en\");\n"
5647 "    sleep(1);\n"
5648
5649 #. type: Plain text
5650 #: build/C/man3/pthread_getcpuclockid.3:156
5651 #, no-wrap
5652 msgid ""
5653 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
5654 "    for (j = 0; j E<lt> 2000000; j++)\n"
5655 "        getppid();\n"
5656 msgstr ""
5657 "    printf(\"Main thread consuming some CPU time...\\en\");\n"
5658 "    for (j = 0; j E<lt> 2000000; j++)\n"
5659 "        getppid();\n"
5660
5661 #. type: Plain text
5662 #: build/C/man3/pthread_getcpuclockid.3:158
5663 #, no-wrap
5664 msgid "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
5665 msgstr "    pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n"
5666
5667 #. type: Plain text
5668 #: build/C/man3/pthread_getcpuclockid.3:163
5669 #, no-wrap
5670 msgid ""
5671 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
5672 "    if (s != 0)\n"
5673 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5674 "    pclock(\"Main thread CPU time:   \", cid);\n"
5675 msgstr ""
5676 "    s = pthread_getcpuclockid(pthread_self(), &cid);\n"
5677 "    if (s != 0)\n"
5678 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5679 "    pclock(\"Main thread CPU time:   \", cid);\n"
5680
5681 #. type: Plain text
5682 #: build/C/man3/pthread_getcpuclockid.3:166
5683 #, no-wrap
5684 msgid ""
5685 "    /* The preceding 4 lines of code could have been replaced by:\n"
5686 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
5687 msgstr ""
5688 "    /* The preceding 4 lines of code could have been replaced by:\n"
5689 "       pclock(\"Main thread CPU time:   \", CLOCK_THREAD_CPUTIME_ID); */\n"
5690
5691 #. type: Plain text
5692 #: build/C/man3/pthread_getcpuclockid.3:171
5693 #, no-wrap
5694 msgid ""
5695 "    s = pthread_getcpuclockid(thread, &cid);\n"
5696 "    if (s != 0)\n"
5697 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5698 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
5699 msgstr ""
5700 "    s = pthread_getcpuclockid(thread, &cid);\n"
5701 "    if (s != 0)\n"
5702 "        handle_error_en(s, \"pthread_getcpuclockid\");\n"
5703 "    pclock(\"Subthread CPU time: 1    \", cid);\n"
5704
5705 #. type: Plain text
5706 #: build/C/man3/pthread_getcpuclockid.3:174
5707 #, no-wrap
5708 msgid ""
5709 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
5710 "}\n"
5711 msgstr ""
5712 "    exit(EXIT_SUCCESS);         /* Terminates both threads */\n"
5713 "}\n"
5714
5715 #. type: Plain text
5716 #: build/C/man3/pthread_getcpuclockid.3:183
5717 msgid "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
5718 msgstr "B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)"
5719
5720 #. type: TH
5721 #: build/C/man3/pthread_join.3:26
5722 #, no-wrap
5723 msgid "PTHREAD_JOIN"
5724 msgstr "PTHREAD_JOIN"
5725
5726 #. type: Plain text
5727 #: build/C/man3/pthread_join.3:29
5728 msgid "pthread_join - join with a terminated thread"
5729 msgstr "pthread_join - 終了したスレッドを join する"
5730
5731 #. type: Plain text
5732 #: build/C/man3/pthread_join.3:34
5733 #, no-wrap
5734 msgid "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
5735 msgstr "B<int pthread_join(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
5736
5737 #. type: Plain text
5738 #: build/C/man3/pthread_join.3:49
5739 msgid "The B<pthread_join>()  function waits for the thread specified by I<thread> to terminate.  If that thread has already terminated, then B<pthread_join>()  returns immediately.  The thread specified by I<thread> must be joinable."
5740 msgstr ""
5741 "B<pthread_join>() 関数は、I<thread> で指定されたスレッドが\n"
5742 "終了するのを待つ。そのスレッドがすでに終了している場合、\n"
5743 "B<pthread_join>() はすぐに返る。\n"
5744 "I<thread> で指定されたスレッドは join 可能でなければならない。"
5745
5746 #. type: Plain text
5747 #: build/C/man3/pthread_join.3:63
5748 msgid "If I<retval> is not NULL, then B<pthread_join>()  copies the exit status of the target thread (i.e., the value that the target thread supplied to B<pthread_exit>(3))  into the location pointed to by I<*retval>.  If the target thread was canceled, then B<PTHREAD_CANCELED> is placed in I<*retval>."
5749 msgstr ""
5750 "I<retval> が NULL でない場合、 B<pthread_join>() は対象スレッドの終了\n"
5751 "ステータス (すなわち、対象スレッドが B<pthread_exit>(3) に渡した値) を\n"
5752 "I<*retval> が指す場所にコピーする。対象スレッドがキャンセルされた場合、\n"
5753 "I<*retval> には B<PTHREAD_CANCELED> が格納される。"
5754
5755 #. type: Plain text
5756 #: build/C/man3/pthread_join.3:70
5757 msgid "If multiple threads simultaneously try to join with the same thread, the results are undefined.  If the thread calling B<pthread_join>()  is canceled, then the target thread will remain joinable (i.e., it will not be detached)."
5758 msgstr ""
5759 "複数のスレッドが同時に同じスレッドを join しようとした場合、その結果\n"
5760 "は不定である。B<pthread_join>() を呼び出しているスレッドがキャンセル\n"
5761 "された場合、対象スレッドは join 可能のままとなる (detached 状態には\n"
5762 "ならない)。"
5763
5764 #. type: Plain text
5765 #: build/C/man3/pthread_join.3:75
5766 msgid "On success, B<pthread_join>()  returns 0; on error, it returns an error number."
5767 msgstr ""
5768 "成功すると、 B<pthread_join>() は 0 を返す。\n"
5769 "エラーの場合、エラー番号を返す。"
5770
5771 #. type: TP
5772 #: build/C/man3/pthread_join.3:76
5773 #, no-wrap
5774 msgid "B<EDEADLK>"
5775 msgstr "B<EDEADLK>"
5776
5777 #.  The following verified by testing on glibc 2.8/NPTL:
5778 #.  The following verified by testing on glibc 2.8/NPTL:
5779 #. type: Plain text
5780 #: build/C/man3/pthread_join.3:85
5781 msgid "A deadlock was detected (e.g., two threads tried to join with each other); or I<thread> specifies the calling thread."
5782 msgstr ""
5783 "デッドロックが検出された (例えば、二つのスレッドが互いに join しようと\n"
5784 "した場合)、または I<thread> に呼び出したスレッドが指定されている。"
5785
5786 #.  POSIX.1-2001 does not specify this error case.
5787 #. type: Plain text
5788 #: build/C/man3/pthread_join.3:93
5789 msgid "Another thread is already waiting to join with this thread."
5790 msgstr "別のスレッドがすでにこのスレッドの join 待ちである。"
5791
5792 #. type: Plain text
5793 #: build/C/man3/pthread_join.3:104
5794 msgid "After a successful call to B<pthread_join>(), the caller is guaranteed that the target thread has terminated."
5795 msgstr ""
5796 "B<pthread_join>() の呼び出しが成功した場合は、\n"
5797 "呼び出し側には、対象スレッドが終了していることが保証される。"
5798
5799 #. type: Plain text
5800 #: build/C/man3/pthread_join.3:107
5801 msgid "Joining with a thread that has previously been joined results in undefined behavior."
5802 msgstr "すでに join されたスレッドを join した場合の結果は不定である。"
5803
5804 #. type: Plain text
5805 #: build/C/man3/pthread_join.3:115
5806 msgid "Failure to join with a thread that is joinable (i.e., one that is not detached), produces a \"zombie thread\".  Avoid doing this, since each zombie thread consumes some system resources, and when enough zombie threads have accumulated, it will no longer be possible to create new threads (or processes)."
5807 msgstr ""
5808 "join 可能なスレッド (detached 状態でないスレッド) の join に失敗した場合、\n"
5809 "\"ゾンビスレッド (zombie thread)\" が生成される。\n"
5810 "各ゾンビスレッドはシステムリソースをいくらかは消費し、\n"
5811 "ゾンビスレッドがたくさん生成されてしまうと、\n"
5812 "新しいスレッド (やプロセス) がそれ以上作成できなくなってしまうので、\n"
5813 "このようなことが起きるのは避けること。"
5814
5815 #. type: Plain text
5816 #: build/C/man3/pthread_join.3:121
5817 msgid "There is no pthreads analog of I<waitpid(-1,\\ &status,\\ 0)>, that is, \"join with any terminated thread\".  If you believe you need this functionality, you probably need to rethink your application design."
5818 msgstr ""
5819 "pthreads には、 I<waitpid(-1,\\ &status,\\ 0)>、つまり\n"
5820 "\"終了されたスレッドのどれかを join する\" といった機能はない。\n"
5821 "この機能が必要だと思うような場合には、おそらく\n"
5822 "自分のアプリケーションの設計を考え直す必要があるだろう。"
5823
5824 #. type: Plain text
5825 #: build/C/man3/pthread_join.3:124
5826 msgid "All of the threads in a process are peers: any thread can join with any other thread in the process."
5827 msgstr ""
5828 "プロセス内の全てのスレッドは対等であり、\n"
5829 "どのスレッドでもプロセス内の他のスレッドを join できる。"
5830
5831 #. type: Plain text
5832 #: build/C/man3/pthread_join.3:134
5833 msgid "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
5834 msgstr "B<pthread_cancel>(3), B<pthread_create>(3), B<pthread_detach>(3), B<pthread_exit>(3), B<pthread_tryjoin_np>(3), B<pthreads>(7)"
5835
5836 #. type: TH
5837 #: build/C/man3/pthread_kill.3:26
5838 #, no-wrap
5839 msgid "PTHREAD_KILL"
5840 msgstr "PTHREAD_KILL"
5841
5842 #. type: TH
5843 #: build/C/man3/pthread_kill.3:26
5844 #: build/C/man3/pthread_kill_other_threads_np.3:26
5845 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setcancelstate.3:26
5846 #: build/C/man3/pthread_yield.3:25
5847 #, no-wrap
5848 msgid "2014-05-13"
5849 msgstr "2014-05-13"
5850
5851 #. type: Plain text
5852 #: build/C/man3/pthread_kill.3:29
5853 msgid "pthread_kill - send a signal to a thread"
5854 msgstr "pthread_kill - スレッドにシグナルを送信する"
5855
5856 #. type: Plain text
5857 #: build/C/man3/pthread_kill.3:32 build/C/man3/pthread_sigmask.3:32
5858 #, no-wrap
5859 msgid "B<#include E<lt>signal.hE<gt>>\n"
5860 msgstr "B<#include E<lt>signal.hE<gt>>\n"
5861
5862 #. type: Plain text
5863 #: build/C/man3/pthread_kill.3:34
5864 #, no-wrap
5865 msgid "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
5866 msgstr "B<int pthread_kill(pthread_t >I<thread>B<, int >I<sig>B<);>\n"
5867
5868 #. type: Plain text
5869 #: build/C/man3/pthread_kill.3:45
5870 msgid "B<pthread_kill>():"
5871 msgstr "B<pthread_kill>():"
5872
5873 #. type: Plain text
5874 #: build/C/man3/pthread_kill.3:47 build/C/man3/pthread_sigmask.3:48
5875 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
5876 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 199506L || _XOPEN_SOURCE\\ E<gt>=\\ 500"
5877
5878 #. type: Plain text
5879 #: build/C/man3/pthread_kill.3:59
5880 msgid "The B<pthread_kill>()  function sends the signal I<sig> to I<thread>, a thread in the same process as the caller.  The signal is asynchronously directed to I<thread>."
5881 msgstr ""
5882 "B<pthread_kill>() 関数は、呼び出したスレッドと同じプロセスの\n"
5883 "スレッド I<thread> にシグナル I<sig> を送信する。\n"
5884 "シグナルは非同期に I<thread> へ直接送られる。"
5885
5886 #. type: Plain text
5887 #: build/C/man3/pthread_kill.3:63
5888 msgid "If I<sig> is 0, then no signal is sent, but error checking is still performed."
5889 msgstr "I<sig> が 0 の場合、シグナルは送信されないが、エラーチェックだけは実行される。"
5890
5891 #. type: Plain text
5892 #: build/C/man3/pthread_kill.3:68
5893 msgid "On success, B<pthread_kill>()  returns 0; on error, it returns an error number, and no signal is sent."
5894 msgstr ""
5895 "成功すると、 B<pthread_kill>() は 0 を返す。\n"
5896 "エラーの場合、エラー番号を返し、シグナルの送信は行わない。"
5897
5898 #. type: Plain text
5899 #: build/C/man3/pthread_kill.3:72
5900 msgid "An invalid signal was specified."
5901 msgstr "無効なシグナルが指定された。"
5902
5903 #. type: Plain text
5904 #: build/C/man3/pthread_kill.3:77
5905 msgid "The B<pthread_kill>()  function is thread-safe."
5906 msgstr "B<pthread_kill>() 関数はスレッドセーフである。"
5907
5908 #. type: Plain text
5909 #: build/C/man3/pthread_kill.3:79
5910 msgid "POSIX.1-2008."
5911 msgstr "POSIX.1-2008."
5912
5913 #. type: Plain text
5914 #: build/C/man3/pthread_kill.3:86
5915 msgid "Signal dispositions are process-wide: if a signal handler is installed, the handler will be invoked in the thread I<thread>, but if the disposition of the signal is \"stop\", \"continue\", or \"terminate\", this action will affect the whole process."
5916 msgstr ""
5917 "シグナルの配送はプロセス全体で行われる。\n"
5918 "シグナルハンドラが設定されている場合、\n"
5919 "そのハンドラがスレッド I<thread> で起動されるが、\n"
5920 "シグナルの配送が \"stop\", \"continue\", \"terminate\" のいずれかの場合、\n"
5921 "シグナルに対するアクションはプロセス全体に影響がある。"
5922
5923 #. type: Plain text
5924 #: build/C/man3/pthread_kill.3:99
5925 msgid "POSIX.1-2008 recommends that if an implementation detects the use of a thread ID after the end of its lifetime, B<pthread_kill>()  should return the error B<ESRCH>.  The glibc implementation returns this error in the cases where an invalid thread ID can be detected.  But note also that POSIX says that an attempt to use a thread ID whose lifetime has ended produces undefined behavior, and an attempt to use an invalid thread ID in a call to B<pthread_kill>()  can, for example, cause a segmentation fault."
5926 msgstr "POSIX.1-2008 では、 スレッドが終了した後にそのスレッド ID が使用されたことを検出した場合に、 B<pthread_kill>() はエラー B<ESRCH> を返すことを推奨されている。 glibc の実装では、無効なスレッド ID を検出できる場合にはこのエラーを返す。 しかし、 POSIX では、 終了したスレッド ID を使おうとした場合の動作は不定であり、 B<pthread_kill>() で無効なスレッド ID を使おうとした場合には、 例えば、 セグメンテーションフォールトになる可能性もある点に注意すること。"
5927
5928 #. type: Plain text
5929 #: build/C/man3/pthread_kill.3:108
5930 msgid "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
5931 msgstr "B<kill>(2), B<sigaction>(2), B<sigpending>(2), B<pthread_self>(3), B<pthread_sigmask>(3), B<raise>(3), B<pthreads>(7), B<signal>(7)"
5932
5933 #. type: TH
5934 #: build/C/man3/pthread_kill_other_threads_np.3:26
5935 #, no-wrap
5936 msgid "PTHREAD_KILL_OTHER_THREADS_NP"
5937 msgstr "PTHREAD_KILL_OTHER_THREADS_NP"
5938
5939 #. type: Plain text
5940 #: build/C/man3/pthread_kill_other_threads_np.3:29
5941 msgid "pthread_kill_other_threads_np - terminate all other threads in process"
5942 msgstr "pthread_kill_other_threads_np - プロセス内の他の全スレッドを終了する"
5943
5944 #. type: Plain text
5945 #: build/C/man3/pthread_kill_other_threads_np.3:34
5946 #, no-wrap
5947 msgid "B<void pthread_kill_other_threads_np(void);>\n"
5948 msgstr "B<void pthread_kill_other_threads_np(void);>\n"
5949
5950 #.  .SH VERSIONS
5951 #.  Available since glibc 2.0
5952 #. type: Plain text
5953 #: build/C/man3/pthread_kill_other_threads_np.3:47
5954 msgid "B<pthread_kill_other_threads_np>()  has an effect only in the LinuxThreads threading implementation.  On that implementation, calling this function causes the immediate termination of all threads in the application, except the calling thread.  The cancellation state and cancellation type of the to-be-terminated threads are ignored, and the cleanup handlers are not called in those threads."
5955 msgstr ""
5956 "B<pthread_kill_other_threads_np>() は、\n"
5957 "LinuxThreads スレッド実装においてのみ効果がある。\n"
5958 "LinuxThreads スレッド実装では、この関数を呼び出すと\n"
5959 "アプリケーション内の全てのスレッドがすぐに終了される。\n"
5960 "終了対象のスレッドの cancelability state と cancelability type は\n"
5961 "無視され、それらのスレッドのクリーンアップハンドラは呼び出されない。"
5962
5963 #. type: Plain text
5964 #: build/C/man3/pthread_kill_other_threads_np.3:52
5965 msgid "The B<pthread_kill_other_threads_np>()  function is thread-safe."
5966 msgstr "B<pthread_kill_other_threads_np>() 関数はスレッドセーフである。"
5967
5968 #. type: Plain text
5969 #: build/C/man3/pthread_kill_other_threads_np.3:64
5970 msgid "B<pthread_kill_other_threads_np>()  is intended to be called just before a thread calls B<execve>(2)  or a similar function.  This function is designed to address a limitation in the obsolete LinuxThreads implementation whereby the other threads of an application are not automatically terminated (as POSIX.1-2001 requires) during B<execve>(2)."
5971 msgstr ""
5972 "B<pthread_kill_other_threads_np>() は、\n"
5973 "スレッドが B<execve>(2) や同様の関数を呼び出す直前に\n"
5974 "呼ばれることを目的として用意されている。\n"
5975 "この関数は、(廃止予定の) LinuxThreads スレッド実装における、\n"
5976 "B<execve>(2) の際にアプリケーションの他のスレッドが自動的に\n"
5977 "終了されないという制限を解決するために設計された。"
5978
5979 #. type: Plain text
5980 #: build/C/man3/pthread_kill_other_threads_np.3:71
5981 msgid "In the NPTL threading implementation, B<pthread_kill_other_threads_np>()  exists, but does nothing.  (Nothing needs to be done, because the implementation does the right thing during an B<execve>(2).)"
5982 msgstr ""
5983 "NPTL スレッド実装では、 B<pthread_kill_other_threads_np>() は存在するが、\n"
5984 "何もしない(NPTL 実装は B<execve>(2) の際に適切な動作をするので、\n"
5985 "何もする必要がないということだ)。"
5986
5987 #. type: Plain text
5988 #: build/C/man3/pthread_kill_other_threads_np.3:77
5989 msgid "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), B<pthreads>(7)"
5990 msgstr "B<execve>(2), B<pthread_cancel>(3), B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3), B<pthreads>(7)"
5991
5992 #. type: TH
5993 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
5994 #, no-wrap
5995 msgid "PTHREAD_RWLOCKATTR_SETKIND_NP"
5996 msgstr "PTHREAD_RWLOCKATTR_SETKIND_NP"
5997
5998 #. type: TH
5999 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25
6000 #, no-wrap
6001 msgid "2014-10-15"
6002 msgstr "2014-10-15"
6003
6004 #. type: Plain text
6005 #: build/C/man3/pthread_rwlockattr_setkind_np.3:29
6006 msgid "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - set/get the read-write lock kind of the thread read-write lock attribute object"
6007 msgstr "pthread_rwlockattr_setkind_np, pthread_rwlockattr_getkind_np - スレッドの読み書きロック属性オブジェクトの読み書きロック種別の設定、取得を行う"
6008
6009 #. type: Plain text
6010 #: build/C/man3/pthread_rwlockattr_setkind_np.3:37
6011 #, no-wrap
6012 msgid ""
6013 "B<int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *>I<attr>B<,>\n"
6014 "B<                                   int >I<pref>B<);>\n"
6015 "B<int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *>I<attr>B<,>\n"
6016 "B<                                   int *>I<pref>B<);>\n"
6017 msgstr ""
6018 "B<int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *>I<attr>B<,>\n"
6019 "B<                                   int >I<pref>B<);>\n"
6020 "B<int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *>I<attr>B<,>\n"
6021 "B<                                   int *>I<pref>B<);>\n"
6022
6023 #. type: Plain text
6024 #: build/C/man3/pthread_rwlockattr_setkind_np.3:48
6025 msgid "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
6026 msgstr "B<pthread_rwlockattr_setkind_np>(), B<pthread_rwlockattr_getkind_np>():"
6027
6028 #. type: Plain text
6029 #: build/C/man3/pthread_rwlockattr_setkind_np.3:52
6030 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _POSIX_C_SOURCE E<gt>= 200809L"
6031 msgstr "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _POSIX_C_SOURCE E<gt>= 200809L"
6032
6033 #. type: Plain text
6034 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
6035 msgid "The B<pthread_rwlockattr_setkind_np>()  function sets the \"lock kind\" attribute of the read-write lock attribute object referred to by I<attr> to the value specified in I<pref>.  The argument I<pref> may be set to one of the following:"
6036 msgstr "B<pthread_rwlockattr_setkind_np>() 関数は、 I<attr> が参照する読み書きロック属性オブジェクトの「ロック種別 (lock kind)」を I<pref> で指定された値に設定する。 引き数 I<pref> には以下のいずれか一つを設定できる。"
6037
6038 #. type: TP
6039 #: build/C/man3/pthread_rwlockattr_setkind_np.3:65
6040 #, no-wrap
6041 msgid "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
6042 msgstr "B<PTHREAD_RWLOCK_PREFER_READER_NP>"
6043
6044 #. type: Plain text
6045 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
6046 msgid "This is the default.  A thread may hold multiple read locks; that is, read locks are recursive.  According to The Single Unix Specification, the behavior is unspecified when a reader tries to place a lock, and there is no write lock but writers are waiting.  Giving preference to the reader, as is set by B<PTHREAD_RWLOCK_PREFER_READER_NP>, implies that the reader will receive the requested lock, even if a writer is waiting.  As long as there are readers, the writer will be starved."
6047 msgstr "これがデフォルトである。 スレッドは複数の読み出しロックを保持できる。 つまり、読み出しロックは再帰的である。 Single Unix Specification では、 読み出し側がロックをかけようとした際に、書き込みロックはないが書き込み側が待っていた場合の、動作は規定されていない。 B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定し、読み出し側に優先度を与えるということは、 たとえ書き込み側が待っていたとしても、読み出し側が要求したロックを受け取ることを意味する。 読み出し側がいる限り、書き込み側は待つことになる。"
6048
6049 #. type: TP
6050 #: build/C/man3/pthread_rwlockattr_setkind_np.3:78
6051 #, no-wrap
6052 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
6053 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NP>"
6054
6055 #. type: Plain text
6056 #: build/C/man3/pthread_rwlockattr_setkind_np.3:83
6057 msgid "This is intended as the write lock analog of B<PTHREAD_RWLOCK_PREFER_READER_NP>.  But see BUGS."
6058 msgstr "これは B<PTHREAD_RWLOCK_PREFER_READER_NP> の書き込みロック版である。 ただし「バグ」を参照のこと。"
6059
6060 #. type: TP
6061 #: build/C/man3/pthread_rwlockattr_setkind_np.3:83
6062 #, no-wrap
6063 msgid "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
6064 msgstr "B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP>"
6065
6066 #. type: Plain text
6067 #: build/C/man3/pthread_rwlockattr_setkind_np.3:88
6068 msgid "Setting the lock kind to this avoids writer starvation as long as any read locking is not done in a recursive fashion."
6069 msgstr "ロック種別をこの値に設定すると、 読み出しロックが再帰的に行われない限りは、 書き込み側の待ちを避けることができる。"
6070
6071 #. type: Plain text
6072 #: build/C/man3/pthread_rwlockattr_setkind_np.3:96
6073 msgid "The B<pthread_rwlockattr_getkind_np>()  function returns the value of the lock kind attribute of the read-write lock attribute object referred to by I<attr> in the pointer I<pref>."
6074 msgstr "B<pthread_rwlockattr_getkind_np>() 関数は、 I<attr> が参照する読み書きロック属性オブジェクトのロック種別属性の値をポインター I<pref> に入れて返す。"
6075
6076 #. type: Plain text
6077 #: build/C/man3/pthread_rwlockattr_setkind_np.3:104
6078 msgid "On success, these functions return 0.  Given valid pointer arguments, B<pthread_rwlockattr_getkind_np>()  always succeeds.  On error, B<pthread_rwlockattr_setkind_np>()  returns a non-zero error number."
6079 msgstr "成功すると、これらの関数は 0 を返す。 有効なポインター引き数が渡された場合、 B<pthread_rwlockattr_getkind_np>() は常に成功する。 エラーの場合、 B<pthread_rwlockattr_setkind_np>() は 0 以外のエラー番号を返す。"
6080
6081 #. type: Plain text
6082 #: build/C/man3/pthread_rwlockattr_setkind_np.3:109
6083 msgid "I<pref> specifies an unsupported value."
6084 msgstr "I<pref> にサポート外の値が指定された。"
6085
6086 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7057
6087 #. type: Plain text
6088 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121
6089 msgid "Setting the value read-write lock kind to B<PTHREAD_RWLOCK_PREFER_WRITER_NP> results in the same behavior as setting the value to B<PTHREAD_RWLOCK_PREFER_READER_NP>.  As long as a reader thread holds the lock, the thread holding a write lock will be starved.  Setting the lock kind to B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> allows writers to run, but, as the name implies a writer may not lock recursively."
6090 msgstr "読み書きロック種別の値を B<PTHREAD_RWLOCK_PREFER_WRITER_NP> に設定することは、 値を B<PTHREAD_RWLOCK_PREFER_READER_NP> に設定するのと同じ動作となる。 読み出しスレッドがロックを保持する限り、書き込みロックを保持しているスレッドは停止することになる。 ロック種別を B<PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP> に設定すると、 書き込み側が動作できるようになるが、変数名から分かるように、 書き込み側はロックを再帰的に行うことはできない。"
6091
6092 #. type: Plain text
6093 #: build/C/man3/pthread_rwlockattr_setkind_np.3:127
6094 msgid "The B<pthread_rwlockattr_getkind_np>()  and B<pthread_rwlockattr_setkind_np>()  functions first appeared in glibc 2.1."
6095 msgstr "関数 B<pthread_rwlockattr_getkind_np>() と B<pthread_rwlockattr_setkind_np>() は glibc 2.1 で初めて登場した。"
6096
6097 #. type: Plain text
6098 #: build/C/man3/pthread_rwlockattr_setkind_np.3:130
6099 msgid "These functions are non-standard GNU extensions; hence the suffix \"_np\" (non-portable) in the names."
6100 msgstr "これらの関数は非標準の GNU による拡張である。 そのため、名前に \"_np\" (non-portable; 移植性がない) という接尾辞が付いている。"
6101
6102 #. type: Plain text
6103 #: build/C/man3/pthread_rwlockattr_setkind_np.3:132
6104 msgid "B<pthreads>(7)"
6105 msgstr "B<pthreads>(7)"
6106
6107 #. type: TH
6108 #: build/C/man3/pthread_self.3:26
6109 #, no-wrap
6110 msgid "PTHREAD_SELF"
6111 msgstr "PTHREAD_SELF"
6112
6113 #. type: Plain text
6114 #: build/C/man3/pthread_self.3:29
6115 msgid "pthread_self - obtain ID of the calling thread"
6116 msgstr "pthread_self - 呼び出したスレッドの ID を取得する"
6117
6118 #. type: Plain text
6119 #: build/C/man3/pthread_self.3:34
6120 #, no-wrap
6121 msgid "B<pthread_t pthread_self(void);>\n"
6122 msgstr "B<pthread_t pthread_self(void);>\n"
6123
6124 #. type: Plain text
6125 #: build/C/man3/pthread_self.3:46
6126 msgid "The B<pthread_self>()  function returns the ID of the calling thread.  This is the same value that is returned in I<*thread> in the B<pthread_create>(3)  call that created this thread."
6127 msgstr ""
6128 "B<pthread_self>() 関数は、呼び出したスレッドの ID を返す。\n"
6129 "得られる ID は、このスレッドが作成された B<pthread_create>(3) の\n"
6130 "呼び出しで I<*thread> で返されるのと同じ値である。"
6131
6132 #. type: Plain text
6133 #: build/C/man3/pthread_self.3:48
6134 msgid "This function always succeeds, returning the calling thread's ID."
6135 msgstr "この関数は常に成功し、呼び出したスレッドの ID を返す。"
6136
6137 #. type: Plain text
6138 #: build/C/man3/pthread_self.3:55
6139 msgid "The B<pthread_self>()  function is thread-safe."
6140 msgstr "B<pthread_self>() 関数はスレッドセーフである。"
6141
6142 #. type: Plain text
6143 #: build/C/man3/pthread_self.3:68
6144 msgid "POSIX.1 allows an implementation wide freedom in choosing the type used to represent a thread ID; for example, representation using either an arithmetic type or a structure is permitted.  Therefore, variables of type I<pthread_t> can't portably be compared using the C equality operator (B<==>); use B<pthread_equal>(3)  instead."
6145 msgstr ""
6146 "POSIX.1 では、スレッド ID を表現するのに使用する型は、\n"
6147 "スレッド実装が完全に自由に選択してよいことになっている。\n"
6148 "例えば、スレッド ID を表現するのに数値型を使っても構造体を使ってもよい。\n"
6149 "そのため、移植性を確保しつつ、 C 言語の等価演算子 (B<==>) を使って、\n"
6150 "I<pthread_t> 型の変数の比較を行うことはできない。\n"
6151 "代わりに B<pthread_equal>(3) を使うこと。"
6152
6153 #. type: Plain text
6154 #: build/C/man3/pthread_self.3:72
6155 msgid "Thread identifiers should be considered opaque: any attempt to use a thread ID other than in pthreads calls is nonportable and can lead to unspecified results."
6156 msgstr ""
6157 "スレッド識別子はその内部構造を意識すべきではない。\n"
6158 "pthreads 関数以外でスレッド ID を利用しようとした場合、\n"
6159 "移植性がなくなり、どのような結果が得られるかも分からない。"
6160
6161 #. type: Plain text
6162 #: build/C/man3/pthread_self.3:76
6163 msgid "Thread IDs are guaranteed to be unique only within a process.  A thread ID may be reused after a terminated thread has been joined, or a detached thread has terminated."
6164 msgstr ""
6165 "スレッド ID の一意性が保証されるのは、あるプロセス内においてのみである。\n"
6166 "終了したスレッドが join されたり、\n"
6167 "切り離された (detached) スレッドが終了されたりした後は、\n"
6168 "そのスレッド ID は再利用されることがある。"
6169
6170 #. type: Plain text
6171 #: build/C/man3/pthread_self.3:81
6172 msgid "The thread ID returned by B<pthread_self>()  is not the same thing as the kernel thread ID returned by a call to B<gettid>(2)."
6173 msgstr ""
6174 "B<pthread_self>() が返すスレッド ID は、\n"
6175 "B<gettid>(2) が返すカーネルスレッド ID とは違うものである。"
6176
6177 #. type: Plain text
6178 #: build/C/man3/pthread_self.3:85
6179 msgid "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6180 msgstr "B<pthread_create>(3), B<pthread_equal>(3), B<pthreads>(7)"
6181
6182 #. type: TH
6183 #: build/C/man3/pthread_setaffinity_np.3:26
6184 #, no-wrap
6185 msgid "PTHREAD_SETAFFINITY_NP"
6186 msgstr "PTHREAD_SETAFFINITY_NP"
6187
6188 #. type: Plain text
6189 #: build/C/man3/pthread_setaffinity_np.3:30
6190 msgid "pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a thread"
6191 msgstr ""
6192 "pthread_setaffinity_np, pthread_getaffinity_np - スレッドの\n"
6193 "CPU affinity の設定/取得を行う"
6194
6195 #. type: Plain text
6196 #: build/C/man3/pthread_setaffinity_np.3:39
6197 #, no-wrap
6198 msgid ""
6199 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6200 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6201 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6202 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6203 msgstr ""
6204 "B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6205 "B<                           const cpu_set_t *>I<cpuset>B<);>\n"
6206 "B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n"
6207 "B<                           cpu_set_t *>I<cpuset>B<);>\n"
6208
6209 #. type: Plain text
6210 #: build/C/man3/pthread_setaffinity_np.3:54
6211 msgid "The B<pthread_setaffinity_np>()  function sets the CPU affinity mask of the thread I<thread> to the CPU set pointed to by I<cpuset>.  If the call is successful, and the thread is not currently running on one of the CPUs in I<cpuset>, then it is migrated to one of those CPUs."
6212 msgstr ""
6213 "B<pthread_setaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
6214 "マスクに I<cpuset> が指す CPU 集合を設定する。呼び出しが成功し、\n"
6215 "そのスレッドが現在 I<cpuset> で指定された CPU 上でが実行されていない\n"
6216 "場合は、スレッドは指定された CPU のいずれかに移動される。"
6217
6218 #. type: Plain text
6219 #: build/C/man3/pthread_setaffinity_np.3:61
6220 msgid "The B<pthread_getaffinity_np>()  function returns the CPU affinity mask of the thread I<thread> in the buffer pointed to by I<cpuset>."
6221 msgstr ""
6222 "B<pthread_getaffinity_np>() 関数は、スレッド I<thread> の CPU affinity\n"
6223 "マスクを、I<cpuset> が指すバッファーに入れて返す。"
6224
6225 #. type: Plain text
6226 #: build/C/man3/pthread_setaffinity_np.3:77
6227 msgid "The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to by I<cpuset>.  Typically, this argument would be specified as I<sizeof(cpu_set_t)>.  (It may be some other value, if using the macros described in B<CPU_SET>(3)  for dynamically allocating a CPU set.)"
6228 msgstr ""
6229 "引き数 I<cpusetsize> は I<cpuset> が指すバッファーの長さ (バイト単位) で\n"
6230 "ある。通常は、この引き数には I<sizeof(cpu_set_t)> を指定する\n"
6231 "(B<CPU_SET>(3) に書かれているマクロを使って CPU 集合を動的に\n"
6232 "割り当てている場合には、別の値になることもある)。"
6233
6234 #. type: TP
6235 #: build/C/man3/pthread_setaffinity_np.3:81
6236 #, no-wrap
6237 msgid "B<EFAULT>"
6238 msgstr "B<EFAULT>"
6239
6240 #. type: Plain text
6241 #: build/C/man3/pthread_setaffinity_np.3:84
6242 msgid "A supplied memory address was invalid."
6243 msgstr "指定されたメモリアドレスが無効である。"
6244
6245 #. type: Plain text
6246 #: build/C/man3/pthread_setaffinity_np.3:93
6247 msgid "(B<pthread_setaffinity_np>())  The affinity bit mask I<mask> contains no processors that are currently physically on the system and permitted to the thread according to any restrictions that may be imposed by the \"cpuset\" mechanism described in B<cpuset>(7)."
6248 msgstr ""
6249 "(B<pthread_setaffinity_np>()) affinity ビットマスク I<mask> に、\n"
6250 "その時点でシステム上に物理的に存在して、かつそのスレッドに対して許可\n"
6251 "されているプロセッサが一つも含まれていない。\n"
6252 "スレッドに対してどのプロセッサの利用が許可されるかは、B<cpuset>(7) で\n"
6253 "説明されている \"cpuset\" 機構に適用される制限に基づいて決まる。"
6254
6255 #.  FIXME . ?
6256 #.  Loic Domaigne commented: it seems that in the future the
6257 #.  kernel developers want to make cpumask_t dynamic, so
6258 #.  CONFIG_NR_CPUS might become obsolete in the future.
6259 #.  cpumask_t
6260 #.  The raw sched_getaffinity() system call returns the size (in bytes)
6261 #.  of the cpumask_t type.
6262 #. type: Plain text
6263 #: build/C/man3/pthread_setaffinity_np.3:109
6264 msgid "(B<pthread_setaffinity_np>())  I<cpuset> specified a CPU that was outside the set supported by the kernel.  (The kernel configuration option B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data type used to represent CPU sets.)"
6265 msgstr ""
6266 "(B<pthread_setaffinity_np>()) I<cpuset> が、カーネルがサポートする CPU\n"
6267 "集合に含まれない CPU を指定していた。(カーネルの設定オプション\n"
6268 "B<CONFIG_NR_CPUS> により、CPU 集合を表現するのに使われるカーネルの\n"
6269 "データ型がサポートする CPU 集合の範囲が定義される。)"
6270
6271 #. type: Plain text
6272 #: build/C/man3/pthread_setaffinity_np.3:114
6273 msgid "(B<pthread_getaffinity_np>())  I<cpusetsize> is smaller than the size of the affinity mask used by the kernel."
6274 msgstr ""
6275 "(B<pthread_getaffinity_np>()) I<cpusetsize> がカーネルが使用する\n"
6276 "affinity マスクの大きさよりも小さい。"
6277
6278 #. type: Plain text
6279 #: build/C/man3/pthread_setaffinity_np.3:128
6280 msgid "The B<pthread_setaffinity_np>()  and B<pthread_getaffinity_np>()  functions are thread-safe."
6281 msgstr "関数 B<pthread_setaffinity_np>() と B<pthread_getaffinity_np>() はスレッドセーフである。"
6282
6283 #. type: Plain text
6284 #: build/C/man3/pthread_setaffinity_np.3:144
6285 msgid "After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the thread will actually run is the intersection of the set specified in the I<cpuset> argument and the set of CPUs actually present on the system.  The system may further restrict the set of CPUs on which the thread runs if the \"cpuset\" mechanism described in B<cpuset>(7)  is being used.  These restrictions on the actual set of CPUs on which the thread will run are silently imposed by the kernel."
6286 msgstr ""
6287 "B<pthread_setaffinity_np>() を呼び出した後、\n"
6288 "そのスレッドが実際に実行される CPU 集合は、\n"
6289 "I<cpuset> 引き数で指定された集合と\n"
6290 "システムに実際に存在する CPU 集合の共通部分になる。\n"
6291 "また、 B<cpuset>(7) で説明されている \"cpuset\" 機構が使われている場合\n"
6292 "には、そのスレッドが実行される CPU 集合がシステムによってさらに制限\n"
6293 "される場合がある。そのスレッドが実行される実際の CPU 集合に対する\n"
6294 "これらの制限は、カーネルにより黙って適用される。"
6295
6296 #. type: Plain text
6297 #: build/C/man3/pthread_setaffinity_np.3:150
6298 msgid "These functions are implemented on top of the B<sched_setaffinity>(2)  and B<sched_getaffinity>(2)  system calls."
6299 msgstr ""
6300 "これらの関数は、システムコール B<sched_setaffinity>(2) と\n"
6301 "B<sched_getaffinity>(2) を使って実装されている。"
6302
6303 #. type: Plain text
6304 #: build/C/man3/pthread_setaffinity_np.3:161
6305 msgid "A new thread created by B<pthread_create>(3)  inherits a copy of its creator's CPU affinity mask."
6306 msgstr ""
6307 "B<pthread_create>(3) で作成される新しいスレッドは、\n"
6308 "作成者の CPU affinity マスクを継承する。"
6309
6310 #. type: Plain text
6311 #: build/C/man3/pthread_setaffinity_np.3:169
6312 msgid "In the following program, the main thread uses B<pthread_setaffinity_np>()  to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be available on the system), and then calls B<pthread_getaffinity_np>()  to check the resulting CPU affinity mask of the thread."
6313 msgstr ""
6314 "以下のプログラムでは、メインスレッドは\n"
6315 "B<pthread_setaffinity_np>() を使って自分の CPU affinity マスクに\n"
6316 "CPU 0 から 7 が含まれるように設定し\n"
6317 "(システム上には 0 から 7 に対応する CPU が全て存在するとは限らない)、\n"
6318 "その後で B<pthread_getaffinity_np>() を使って\n"
6319 "スレッドに実際に設定された CPU affinity マスクを確認している。"
6320
6321 #. type: Plain text
6322 #: build/C/man3/pthread_setaffinity_np.3:176
6323 #, no-wrap
6324 msgid ""
6325 "#define _GNU_SOURCE\n"
6326 "#include E<lt>pthread.hE<gt>\n"
6327 "#include E<lt>stdio.hE<gt>\n"
6328 "#include E<lt>stdlib.hE<gt>\n"
6329 "#include E<lt>errno.hE<gt>\n"
6330 msgstr ""
6331 "#define _GNU_SOURCE\n"
6332 "#include E<lt>pthread.hE<gt>\n"
6333 "#include E<lt>stdio.hE<gt>\n"
6334 "#include E<lt>stdlib.hE<gt>\n"
6335 "#include E<lt>errno.hE<gt>\n"
6336
6337 #. type: Plain text
6338 #: build/C/man3/pthread_setaffinity_np.3:186
6339 #, no-wrap
6340 msgid ""
6341 "int\n"
6342 "main(int argc, char *argv[])\n"
6343 "{\n"
6344 "    int s, j;\n"
6345 "    cpu_set_t cpuset;\n"
6346 "    pthread_t thread;\n"
6347 msgstr ""
6348 "int\n"
6349 "main(int argc, char *argv[])\n"
6350 "{\n"
6351 "    int s, j;\n"
6352 "    cpu_set_t cpuset;\n"
6353 "    pthread_t thread;\n"
6354
6355 #. type: Plain text
6356 #: build/C/man3/pthread_setaffinity_np.3:188
6357 #, no-wrap
6358 msgid "    thread = pthread_self();\n"
6359 msgstr "    thread = pthread_self();\n"
6360
6361 #. type: Plain text
6362 #: build/C/man3/pthread_setaffinity_np.3:190
6363 #, no-wrap
6364 msgid "    /* Set affinity mask to include CPUs 0 to 7 */\n"
6365 msgstr "    /* Set affinity mask to include CPUs 0 to 7 */\n"
6366
6367 #. type: Plain text
6368 #: build/C/man3/pthread_setaffinity_np.3:194
6369 #, no-wrap
6370 msgid ""
6371 "    CPU_ZERO(&cpuset);\n"
6372 "    for (j = 0; j E<lt> 8; j++)\n"
6373 "        CPU_SET(j, &cpuset);\n"
6374 msgstr ""
6375 "    CPU_ZERO(&cpuset);\n"
6376 "    for (j = 0; j E<lt> 8; j++)\n"
6377 "        CPU_SET(j, &cpuset);\n"
6378
6379 #. type: Plain text
6380 #: build/C/man3/pthread_setaffinity_np.3:198
6381 #, no-wrap
6382 msgid ""
6383 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6384 "    if (s != 0)\n"
6385 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
6386 msgstr ""
6387 "    s = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6388 "    if (s != 0)\n"
6389 "        handle_error_en(s, \"pthread_setaffinity_np\");\n"
6390
6391 #. type: Plain text
6392 #: build/C/man3/pthread_setaffinity_np.3:200
6393 #, no-wrap
6394 msgid "    /* Check the actual affinity mask assigned to the thread */\n"
6395 msgstr "    /* Check the actual affinity mask assigned to the thread */\n"
6396
6397 #. type: Plain text
6398 #: build/C/man3/pthread_setaffinity_np.3:204
6399 #, no-wrap
6400 msgid ""
6401 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6402 "    if (s != 0)\n"
6403 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
6404 msgstr ""
6405 "    s = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n"
6406 "    if (s != 0)\n"
6407 "        handle_error_en(s, \"pthread_getaffinity_np\");\n"
6408
6409 #. type: Plain text
6410 #: build/C/man3/pthread_setaffinity_np.3:209
6411 #, no-wrap
6412 msgid ""
6413 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6414 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6415 "        if (CPU_ISSET(j, &cpuset))\n"
6416 "            printf(\"    CPU %d\\en\", j);\n"
6417 msgstr ""
6418 "    printf(\"Set returned by pthread_getaffinity_np() contained:\\en\");\n"
6419 "    for (j = 0; j E<lt> CPU_SETSIZE; j++)\n"
6420 "        if (CPU_ISSET(j, &cpuset))\n"
6421 "            printf(\"    CPU %d\\en\", j);\n"
6422
6423 #. type: Plain text
6424 #: build/C/man3/pthread_setaffinity_np.3:212
6425 #: build/C/man3/pthread_setschedparam.3:439
6426 #, no-wrap
6427 msgid ""
6428 "    exit(EXIT_SUCCESS);\n"
6429 "}\n"
6430 msgstr ""
6431 "    exit(EXIT_SUCCESS);\n"
6432 "}\n"
6433
6434 #. type: Plain text
6435 #: build/C/man3/pthread_setaffinity_np.3:221
6436 msgid "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), B<sched>(7)"
6437 msgstr "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), B<sched>(7)"
6438
6439 #. type: TH
6440 #: build/C/man3/pthread_setcancelstate.3:26
6441 #, no-wrap
6442 msgid "PTHREAD_SETCANCELSTATE"
6443 msgstr "PTHREAD_SETCANCELSTATE"
6444
6445 #. type: Plain text
6446 #: build/C/man3/pthread_setcancelstate.3:30
6447 msgid "pthread_setcancelstate, pthread_setcanceltype - set cancelability state and type"
6448 msgstr "pthread_setcancelstate, pthread_setcanceltype - cancelability state と cancelability type を設定する"
6449
6450 #. type: Plain text
6451 #: build/C/man3/pthread_setcancelstate.3:36
6452 #, no-wrap
6453 msgid ""
6454 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6455 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6456 msgstr ""
6457 "B<int pthread_setcancelstate(int >I<state>B<, int *>I<oldstate>B<);>\n"
6458 "B<int pthread_setcanceltype(int >I<type>B<, int *>I<oldtype>B<);>\n"
6459
6460 #. type: Plain text
6461 #: build/C/man3/pthread_setcancelstate.3:51
6462 msgid "The B<pthread_setcancelstate>()  sets the cancelability state of the calling thread to the value given in I<state>.  The previous cancelability state of the thread is returned in the buffer pointed to by I<oldstate>.  The I<state> argument must have one of the following values:"
6463 msgstr ""
6464 "B<pthread_setcancelstate>() は、呼び出したスレッドの\n"
6465 "cancelability state に I<state> で指定された\n"
6466 "値を設定する。変更前のスレッドの cancelability state は\n"
6467 "I<oldstate> が指すバッファーで返される。\n"
6468 "I<state> 引き数には以下の値のいずれか一つを指定しなければならない。"
6469
6470 #. type: TP
6471 #: build/C/man3/pthread_setcancelstate.3:51
6472 #, no-wrap
6473 msgid "B<PTHREAD_CANCEL_ENABLE>"
6474 msgstr "B<PTHREAD_CANCEL_ENABLE>"
6475
6476 #. type: Plain text
6477 #: build/C/man3/pthread_setcancelstate.3:58
6478 msgid "The thread is cancelable.  This is the default cancelability state in all new threads, including the initial thread.  The thread's cancelability type determines when a cancelable thread will respond to a cancellation request."
6479 msgstr ""
6480 "スレッドは取り消し可能 (cancelable) である。\n"
6481 "これが全ての新しく作成されるスレッドでのデフォルトの\n"
6482 "cancelability state である。これには最初のスレッドも含まれる。\n"
6483 "スレッドの cancelability type により、取り消し可能なスレッドが\n"
6484 "取り消し要求にいつ反応するかが決まる。"
6485
6486 #. type: TP
6487 #: build/C/man3/pthread_setcancelstate.3:58
6488 #, no-wrap
6489 msgid "B<PTHREAD_CANCEL_DISABLE>"
6490 msgstr "B<PTHREAD_CANCEL_DISABLE>"
6491
6492 #. type: Plain text
6493 #: build/C/man3/pthread_setcancelstate.3:63
6494 msgid "The thread is not cancelable.  If a cancellation request is received, it is blocked until cancelability is enabled."
6495 msgstr ""
6496 "スレッドは取り消しできない。取り消し要求を受信した際は、\n"
6497 "取り消し可能に設定されるまでその要求はブロックされる。"
6498
6499 #. type: Plain text
6500 #: build/C/man3/pthread_setcancelstate.3:75
6501 msgid "The B<pthread_setcanceltype>()  sets the cancelability type of the calling thread to the value given in I<type>.  The previous cancelability type of the thread is returned in the buffer pointed to by I<oldtype>.  The I<type> argument must have one of the following values:"
6502 msgstr ""
6503 "B<pthread_setcanceltype>() は、呼び出したスレッドの\n"
6504 "cancelability type に I<type> で指定された値を設定する。\n"
6505 "変更前のスレッドの cancelability type は\n"
6506 "I<oldtype> が指すバッファーで返される。\n"
6507 "I<type> 引き数には以下の値のいずれか一つを指定しなければならない。"
6508
6509 #. type: TP
6510 #: build/C/man3/pthread_setcancelstate.3:75
6511 #, no-wrap
6512 msgid "B<PTHREAD_CANCEL_DEFERRED>"
6513 msgstr "B<PTHREAD_CANCEL_DEFERRED>"
6514
6515 #. type: Plain text
6516 #: build/C/man3/pthread_setcancelstate.3:82
6517 msgid "A cancellation request is deferred until the thread next calls a function that is a cancellation point (see B<pthreads>(7)).  This is the default cancelability type in all new threads, including the initial thread."
6518 msgstr ""
6519 "そのスレッドが次に取り消しポイント (cancellation point) の関数を\n"
6520 "呼び出すまで取り消し要求が遅延される。これが全ての新しく作成される\n"
6521 "スレッドでのデフォルトの cancelability type である。\n"
6522 "これには最初のスレッドも含まれる。"
6523
6524 #. type: TP
6525 #: build/C/man3/pthread_setcancelstate.3:82
6526 #, no-wrap
6527 msgid "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6528 msgstr "B<PTHREAD_CANCEL_ASYNCHRONOUS>"
6529
6530 #. type: Plain text
6531 #: build/C/man3/pthread_setcancelstate.3:88
6532 msgid "The thread can be canceled at any time.  (Typically, it will be canceled immediately upon receiving a cancellation request, but the system doesn't guarantee this.)"
6533 msgstr ""
6534 "スレッドはいつでも取り消すことができる (通常はすぐにキャンセルされるが、\n"
6535 "システムがそのことを保証しているわけではない)。"
6536
6537 #. type: Plain text
6538 #: build/C/man3/pthread_setcancelstate.3:92
6539 msgid "The set-and-get operation performed by each of these functions is atomic with respect to other threads in the process calling the same function."
6540 msgstr ""
6541 "これらの関数により実行される「設定と取得」操作 (set-and-get operation) は、\n"
6542 "同じ関数を呼び出したプロセス内の他のスレッドがあっても、\n"
6543 "アトミックに行われる。"
6544
6545 #. type: Plain text
6546 #: build/C/man3/pthread_setcancelstate.3:99
6547 msgid "The B<pthread_setcancelstate>()  can fail with the following error:"
6548 msgstr "B<pthread_setcancelstate>() は以下のエラーで失敗する場合がある。"
6549
6550 #. type: Plain text
6551 #: build/C/man3/pthread_setcancelstate.3:103
6552 msgid "Invalid value for I<state>."
6553 msgstr "I<state> に無効な値が指定された。"
6554
6555 #. type: Plain text
6556 #: build/C/man3/pthread_setcancelstate.3:107
6557 msgid "The B<pthread_setcanceltype>()  can fail with the following error:"
6558 msgstr "B<pthread_setcanceltype>() は以下のエラーで失敗する場合がある。"
6559
6560 #.  .SH VERSIONS
6561 #.  Available since glibc 2.0
6562 #. type: Plain text
6563 #: build/C/man3/pthread_setcancelstate.3:113
6564 msgid "Invalid value for I<type>."
6565 msgstr "I<type> に無効な値が指定された。"
6566
6567 #. type: Plain text
6568 #: build/C/man3/pthread_setcancelstate.3:120
6569 msgid "The B<pthread_setcancelstate>()  and B<pthread_setcanceltype>()  functions are thread-safe."
6570 msgstr "関数 B<pthread_setcancelstate>() と B<pthread_setcanceltype>() はスレッドセーフである。"
6571
6572 #. type: Plain text
6573 #: build/C/man3/pthread_setcancelstate.3:125
6574 msgid "For details of what happens when a thread is canceled, see B<pthread_cancel>(3)."
6575 msgstr ""
6576 "スレッドが取り消された場合に何が起こるかの詳細については\n"
6577 "B<pthread_cancel>(3) を参照。"
6578
6579 #. type: Plain text
6580 #: build/C/man3/pthread_setcancelstate.3:132
6581 msgid "Briefly disabling cancelability is useful if a thread performs some critical action that must not be interrupted by a cancellation request.  Beware of disabling cancelability for long periods, or around operations that may block for long periods, since that will render the thread unresponsive to cancellation requests."
6582 msgstr ""
6583 "取り消し要求により中断されてはならない重要なアクションをスレッドが\n"
6584 "実行する場合、短い時間だけ cancelability を無効にするのは有用である。\n"
6585 "長い時間 cancelability を無効にしたり、長い時間停止 (block) される\n"
6586 "可能性のある操作の前後で cancelability を無効にしたりする際には\n"
6587 "注意すること。なぜなら、無効にしてしまうと、キャンセル要求に対して\n"
6588 "スレッドが応答しない状態になってしまうからである。"
6589
6590 #. type: SS
6591 #: build/C/man3/pthread_setcancelstate.3:132
6592 #, no-wrap
6593 msgid "Asynchronous cancelability"
6594 msgstr "非同期キャンセル"
6595
6596 #. type: Plain text
6597 #: build/C/man3/pthread_setcancelstate.3:151
6598 msgid "Setting the cancelability type to B<PTHREAD_CANCEL_ASYNCHRONOUS> is rarely useful.  Since the thread could be canceled at I<any> time, it cannot safely reserve resources (e.g., allocating memory with B<malloc>(3)), acquire mutexes, semaphores, or locks, and so on.  Reserving resources is unsafe because the application has no way of knowing what the state of these resources is when the thread is canceled; that is, did cancellation occur before the resources were reserved, while they were reserved, or after they were released? Furthermore, some internal data structures (e.g., the linked list of free blocks managed by the B<malloc>(3)  family of functions) may be left in an inconsistent state if cancellation occurs in the middle of the function call.  Consequently, clean-up handlers cease to be useful."
6599 msgstr "cancelability type を B<PTHREAD_CANCEL_ASYNCHRONOUS> に設定して役に立つことはめったにない。スレッドはI<いつでも>キャンセルすることができることになるので、スレッドが安全にリソースの確保 (例えば B<malloc>(3) でメモリを割り当てる) や mutex、セマフォ、ロックなどの獲得を行うことができない。アプリケーションは、スレッドがキャンセルされる際に、これらのリソースがどのような状態にあるかを知る術はないので、リソースの確保が安全ではなくなる。つまり、キャンセルが起こったのが、リソースの確保前なのか、確保中なのか、確保後なのかが分からない。さらに、関数呼び出しの最中にキャンセルが発生すると、いくつかの内部データ構造 (例えば、B<malloc>(3) 関連の関数が管理している未使用ブロックのリンクリスト) が一貫性のない状態のままになってしまう可能性がある。その結果、クリーンアップハンドラが役に立たないものになってしまう。"
6600
6601 #. type: Plain text
6602 #: build/C/man3/pthread_setcancelstate.3:162
6603 msgid "Functions that can be safely asynchronously canceled are called I<async-cancel-safe functions>.  POSIX.1-2001 requires only that B<pthread_cancel>(3), B<pthread_setcancelstate>(), and B<pthread_setcanceltype>()  be async-cancel-safe.  In general, other library functions can't be safely called from an asynchronously cancelable thread."
6604 msgstr "非同期で安全にキャンセルできる関数は I<async-cancel-safe functions> と呼ばれる。 POSIX.1-2001 で、非同期で安全にキャンセルできるように求められている関数は B<pthread_cancel>(3), B<pthread_setcancelstate>(), B<pthread_setcanceltype>() だけである。 一般的には、それ以外のライブラリ関数は、非同期にキャンセルできるスレッドから安全に呼び出すことはできない。"
6605
6606 #. type: Plain text
6607 #: build/C/man3/pthread_setcancelstate.3:165
6608 msgid "One of the few circumstances in which asynchronous cancelability is useful is for cancellation of a thread that is in a pure compute-bound loop."
6609 msgstr "非同期でのキャンセルが有効な数少ない状況としては、純粋に計算だけを行うループに入っているスレッドをキャンセルするといった場面がある。"
6610
6611 #. type: SS
6612 #: build/C/man3/pthread_setcancelstate.3:165
6613 #, no-wrap
6614 msgid "Portability notes"
6615 msgstr "移植性に関する注意"
6616
6617 #.  It looks like at least Solaris, FreeBSD and Tru64 support this.
6618 #. type: Plain text
6619 #: build/C/man3/pthread_setcancelstate.3:183
6620 msgid "The Linux threading implementations permit the I<oldstate> argument of B<pthread_setcancelstate>()  to be NULL, in which case the information about the previous cancelability state is not returned to the caller.  Many other implementations also permit a NULL I<oldstat> argument, but POSIX.1-2001 does not specify this point, so portable applications should always specify a non-NULL value in I<oldstate>.  A precisely analogous set of statements applies for the I<oldtype> argument of B<pthread_setcanceltype>()."
6621 msgstr ""
6622 "Linux のスレッド実装では、 B<pthread_setcancelstate>() の I<oldstate>\n"
6623 "引き数に NULL を指定することを認めている。 NULL が指定された場合、\n"
6624 "変更前の cancelability state の情報が呼び出し側に返されない。\n"
6625 "他の多くの実装でも I<oldstate> 引き数に NULL を指定することを認めて\n"
6626 "いるが、 POSIX.1-2001 ではこの点については規定されていない。\n"
6627 "したがって、移植性が必要なアプリケーションでは常に I<oldstate> に\n"
6628 "NULL 以外の値を指定するようにすべきである。\n"
6629 "B<pthread_setcanceltype>() の I<oldtype> 引き数についても、\n"
6630 "全く同じことが言える。"
6631
6632 #. type: Plain text
6633 #: build/C/man3/pthread_setcancelstate.3:186
6634 msgid "See B<pthread_cancel>(3)."
6635 msgstr "B<pthread_cancel>(3) を参照。"
6636
6637 #. type: Plain text
6638 #: build/C/man3/pthread_setcancelstate.3:191
6639 msgid "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
6640 msgstr "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
6641
6642 #. type: TH
6643 #: build/C/man3/pthread_setconcurrency.3:25
6644 #, no-wrap
6645 msgid "PTHREAD_SETCONCURRENCY"
6646 msgstr "PTHREAD_SETCONCURRENCY"
6647
6648 #. type: Plain text
6649 #: build/C/man3/pthread_setconcurrency.3:29
6650 msgid "pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency level"
6651 msgstr "pthread_setconcurrency, pthread_getconcurrency - 並列処理レベルの設定/取得を行う"
6652
6653 #. type: Plain text
6654 #: build/C/man3/pthread_setconcurrency.3:35
6655 #, no-wrap
6656 msgid ""
6657 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
6658 "B<int pthread_getconcurrency(void);>\n"
6659 msgstr ""
6660 "B<int pthread_setconcurrency(int >I<new_level>B<);>\n"
6661 "B<int pthread_getconcurrency(void);>\n"
6662
6663 #. type: Plain text
6664 #: build/C/man3/pthread_setconcurrency.3:48
6665 msgid "The B<pthread_setconcurrency>()  function informs the implementation of the application's desired concurrency level, specified in I<new_level>.  The implementation takes this only as a hint: POSIX.1 does not specify the level of concurrency that should be provided as a result of calling B<pthread_setconcurrency>()."
6666 msgstr ""
6667 "B<pthread_setconcurrency>() 関数は、アプリケーションが希望する\n"
6668 "並列処理レベル (concurrency level) をスレッド実装に通知する。\n"
6669 "希望する並列処理レベルは I<new_level> で指定する。\n"
6670 "スレッド実装はこの情報をヒントとしてのみ利用する。\n"
6671 "POSIX.1 では、 B<pthread_setconcurrency>() の呼び出した結果、\n"
6672 "どのような並列度になるべきかは規定されていない。"
6673
6674 #. type: Plain text
6675 #: build/C/man3/pthread_setconcurrency.3:53
6676 msgid "Specifying I<new_level> as 0 instructs the implementation to manage the concurrency level as it deems appropriate."
6677 msgstr ""
6678 "I<new_level> に 0 を指定すると、スレッド実装は並列処理レベルを\n"
6679 "実装側で適切とみなしたレベルに設定するようになる。"
6680
6681 #. type: Plain text
6682 #: build/C/man3/pthread_setconcurrency.3:56
6683 msgid "B<pthread_getconcurrency>()  returns the current value of the concurrency level for this process."
6684 msgstr ""
6685 "B<pthread_getconcurrency>() は、このプロセスの concurrency level\n"
6686 "の現在値を返す。"
6687
6688 #. type: Plain text
6689 #: build/C/man3/pthread_setconcurrency.3:61
6690 msgid "On success, B<pthread_setconcurrency>()  returns 0; on error, it returns a nonzero error number."
6691 msgstr ""
6692 "成功すると、 B<pthread_setconcurrency>() は 0 を返す。\n"
6693 "エラーの場合、 0 以外のエラー番号を返す。"
6694
6695 #. type: Plain text
6696 #: build/C/man3/pthread_setconcurrency.3:68
6697 msgid "B<pthread_getconcurrency>()  always succeeds, returning the concurrency level set by a previous call to B<pthread_setconcurrency>(), or 0, if B<pthread_setconcurrency>()  has not previously been called."
6698 msgstr ""
6699 "B<pthread_getconcurrency>() は常に成功し、最後の\n"
6700 "B<pthread_getconcurrency>() の呼び出しで設定された \n"
6701 "concurrency level を返す。 B<pthread_getconcurrency>() が\n"
6702 "それまでに一度も呼び出されていない場合は 0 が返る。"
6703
6704 #. type: Plain text
6705 #: build/C/man3/pthread_setconcurrency.3:71
6706 msgid "B<pthread_setconcurrency>()  can fail with the following error:"
6707 msgstr "B<pthread_setconcurrency>() は以下のエラーで失敗する場合がある。"
6708
6709 #. type: Plain text
6710 #: build/C/man3/pthread_setconcurrency.3:75
6711 msgid "I<new_level> is negative."
6712 msgstr "I<new_level> が負である。"
6713
6714 #. type: Plain text
6715 #: build/C/man3/pthread_setconcurrency.3:81
6716 msgid "POSIX.1-2001 also documents an B<EAGAIN> error (\"the value specified by I<new_level> would cause a system resource to be exceeded\")."
6717 msgstr ""
6718 "POSIX.1-2001 には、エラー B<EAGAIN> も記載されている\n"
6719 "(「I<new_level> に指定された値を適用すると、システムリソースが\n"
6720 "超過してしまう」)。"
6721
6722 #. type: Plain text
6723 #: build/C/man3/pthread_setconcurrency.3:83
6724 msgid "These functions are available in glibc since version 2.1."
6725 msgstr "これらの関数は glibc バージョン 2.1 以降で利用できる。"
6726
6727 #. type: Plain text
6728 #: build/C/man3/pthread_setconcurrency.3:90
6729 msgid "The B<pthread_setconcurrency>()  and B<pthread_getconcurrency>()  functions are thread-safe."
6730 msgstr "関数 B<pthread_setconcurrency>() と B<pthread_getconcurrency>() はスレッドセーフである。"
6731
6732 #. type: Plain text
6733 #: build/C/man3/pthread_setconcurrency.3:94
6734 msgid "The default concurrency level is 0."
6735 msgstr "デフォルトの concurrency level は 0 である。"
6736
6737 #. type: Plain text
6738 #: build/C/man3/pthread_setconcurrency.3:101
6739 msgid "Concurrency levels are meaningful only for M:N threading implementations, where at any moment a subset of a process's set of user-level threads may be bound to a smaller number of kernel-scheduling entities.  Setting the concurrency level allows the application to give the system a hint as to the number of kernel-scheduling entities that should be provided for efficient execution of the application."
6740 msgstr ""
6741 "並列処理レベルが意味を持つのは M:N スレッド実装の場合のみである。\n"
6742 "M:N スレッド実装では、ある瞬間において、あるプロセスのユーザーレベルスレッ\n"
6743 "ドの集合のサブ集合が、そのサブ集合のサイズよりも少ない数のカーネルの\n"
6744 "スケジューリング実体 (kernel-scheduling entity) に結び付けられる。\n"
6745 "並列処理レベルを設定すると、そのアプリケーションの効率的な実行に必要な\n"
6746 "カーネルのスケジューリング実体の数のヒントを、アプリケーションはシステ\n"
6747 "ムに伝えることができる。"
6748
6749 #. type: Plain text
6750 #: build/C/man3/pthread_setconcurrency.3:107
6751 msgid "Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the concurrency level has no meaning.  In other words, on Linux these functions merely exist for compatibility with other systems, and they have no effect on the execution of a program."
6752 msgstr ""
6753 "LinuxThreads と NPTL のどちらも 1:1 スレッド実装であり、\n"
6754 "並列処理レベルを設定しても何の意味もない。\n"
6755 "言い換えると、 Linux では、これらの関数は、\n"
6756 "他のシステムとの互換性のためだけに存在し、\n"
6757 "プログラムの実行には何の影響も与えないということである。"
6758
6759 #. type: Plain text
6760 #: build/C/man3/pthread_setconcurrency.3:110
6761 msgid "B<pthread_attr_setscope>(3), B<pthreads>(7)"
6762 msgstr "B<pthread_attr_setscope>(3), B<pthreads>(7)"
6763
6764 #. type: TH
6765 #: build/C/man3/pthread_setname_np.3:26
6766 #, no-wrap
6767 msgid "PTHREAD_SETNAME_NP"
6768 msgstr "PTHREAD_SETNAME_NP"
6769
6770 #. type: Plain text
6771 #: build/C/man3/pthread_setname_np.3:29
6772 msgid "pthread_setname_np, pthread_getname_np - set/get the name of a thread"
6773 msgstr "pthread_setname_np, pthread_getname_np - スレッド名の設定/取得を行う"
6774
6775 #. type: Plain text
6776 #: build/C/man3/pthread_setname_np.3:36
6777 #, no-wrap
6778 msgid ""
6779 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
6780 "B<#include E<lt>pthread.hE<gt>>\n"
6781 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
6782 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
6783 "B<                       char *>I<name>B<, size_t >I<len>B<);>\n"
6784 msgstr ""
6785 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
6786 "B<#include E<lt>pthread.hE<gt>>\n"
6787 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
6788 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
6789 "B<                       char *>I<name>B<, size_t >I<len>B<);>\n"
6790
6791 #. type: Plain text
6792 #: build/C/man3/pthread_setname_np.3:55
6793 msgid "By default, all the threads created using B<pthread_create>()  inherit the program name.  The B<pthread_setname_np>()  function can be used to set a unique name for a thread, which can be useful for debugging multithreaded applications.  The thread name is a meaningful C language string, whose length is restricted to 16 characters, including the terminating null byte (\\(aq\\e0\\(aq).  The I<thread> argument specifies the thread whose name is to be changed; I<name> specifies the new name."
6794 msgstr "デフォルトでは、 B<pthread_create>() で作成されたすべてのスレッドはプログラム名を継承する。 B<pthread_setname_np>() 関数を使うとスレッドに固有の名前を設定することができる。 スレッド固有の名前はマルチスレッドアプリケーションのデバッグに便利である。 スレッド名は意味のある C 言語の文字列である。 その長さは 16 文字に限定されており、 終端のヌルバイト (\\(aq\\e0\\(aq) も 16 文字に含まれる。 I<thread> 引き数で名前を変更するスレッドを指定する。 I<name> には新しい名前を指定する。"
6795
6796 #. type: Plain text
6797 #: build/C/man3/pthread_setname_np.3:72
6798 msgid "The B<pthread_getname_np>()  function can be used to retrieve the name of the thread.  The I<thread> argument specifies the thread whose name is to be retrieved.  The buffer I<name> is used to return the thread name; I<len> specifies the number of bytes available in I<name>.  The buffer specified by I<name> should be at least 16 characters in length.  The returned thread name in the output buffer will be null terminated."
6799 msgstr "B<pthread_getname_np>() 関数を使うと、 スレッド名を取得することができる。 I<thread> 引き数は名前を取得するスレッドを指定する。 バッファー I<name> はスレッド名を返すのに使用される。 I<len> には I<name> の大きさをバイトで指定する。 I<name> で指定されたバッファーの大きさは最低でも 16 文字とすべきである。 出力バッファーに返されたスレッド名はヌル終端される。"
6800
6801 #. type: Plain text
6802 #: build/C/man3/pthread_setname_np.3:79
6803 msgid "The B<pthread_setname_np>()  function can fail with the following error:"
6804 msgstr "B<pthread_setname_np>() は以下のエラーで失敗する場合がある。"
6805
6806 #. type: TP
6807 #: build/C/man3/pthread_setname_np.3:79 build/C/man3/pthread_setname_np.3:88
6808 #, no-wrap
6809 msgid "B<ERANGE>"
6810 msgstr "B<ERANGE>"
6811
6812 #. type: Plain text
6813 #: build/C/man3/pthread_setname_np.3:84
6814 msgid "The length of the string specified pointed to by I<name> exceeds the allowed limit."
6815 msgstr "I<name> で指定された文字列の長さが、許可されている上限を超えている。"
6816
6817 #. type: Plain text
6818 #: build/C/man3/pthread_setname_np.3:88
6819 msgid "The B<pthread_getname_np>()  function can fail with the following error:"
6820 msgstr "B<pthread_getname_np>() は以下のエラーで失敗する場合がある。"
6821
6822 #. type: Plain text
6823 #: build/C/man3/pthread_setname_np.3:95
6824 msgid "The buffer specified by I<name> and I<len> is too small to hold the thread name."
6825 msgstr "I<name> と I<len> で指定されたバッファーが、 スレッド名を格納するには短かすぎる。"
6826
6827 #. type: Plain text
6828 #: build/C/man3/pthread_setname_np.3:100
6829 msgid "If either of these functions fails to open I</proc/self/task/[tid]/comm>, then the call may fail with one of the errors described in B<open>(2)."
6830 msgstr "I</proc/self/task/[tid]/comm> のオープンに失敗した場合、 これらの関数は B<open>(2) で説明されているエラーのいずれかで失敗する。"
6831
6832 #. type: Plain text
6833 #: build/C/man3/pthread_setname_np.3:102
6834 msgid "These functions first appeared in glibc in version 2.12."
6835 msgstr "これらの関数は glibc バージョン 2.12 で初めて登場した。"
6836
6837 #. type: Plain text
6838 #: build/C/man3/pthread_setname_np.3:104
6839 msgid "These functions are nonstandard GNU extensions."
6840 msgstr "これらの関数は非標準の GNU による拡張である。"
6841
6842 #. type: Plain text
6843 #: build/C/man3/pthread_setname_np.3:114
6844 msgid "B<pthread_setname_np>()  internally writes to the thread-specific I<comm> file under the I</proc> filesystem: I</proc/self/task/[tid]/comm>.  B<pthread_getname_np>()  retrieves it from the same location."
6845 msgstr "B<pthread_setname_np>() は内部で I</proc> ファイルシステムのスレッド固有の I<comm> ファイル (I</proc/self/task/[tid]/comm>) に書き込みを行う。 B<pthread_getname_np>() はこのファイルから読み出しを行う。"
6846
6847 #. type: Plain text
6848 #: build/C/man3/pthread_setname_np.3:120
6849 msgid "The program below demonstrates the use of B<pthread_setname_np>()  and B<pthread_getname_np>()."
6850 msgstr ""
6851 "以下のプログラムは、 B<pthread_setname_np>() と B<pthread_getname_np>()\n"
6852 "の使用例を示している。"
6853
6854 #. type: Plain text
6855 #: build/C/man3/pthread_setname_np.3:122
6856 msgid "The following shell session shows a sample run of the program:"
6857 msgstr "以下のシェルセッションは、このプログラムの実行例である。"
6858
6859 #. type: Plain text
6860 #: build/C/man3/pthread_setname_np.3:138
6861 #, no-wrap
6862 msgid ""
6863 "$B< ./a.out>\n"
6864 "Created a thread. Default name is: a.out\n"
6865 "The thread name after setting it is THREADFOO.\n"
6866 "B<^Z>                           # Suspend the program\n"
6867 "[1]+  Stopped           ./a.out\n"
6868 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
6869 "  PID   TID CMD                         COMMAND\n"
6870 " 5990  5990 ./a.out                     a.out\n"
6871 " 5990  5991 ./a.out                     THREADFOO\n"
6872 "$ B<cat /proc/5990/task/5990/comm>\n"
6873 "a.out\n"
6874 "$ B<cat /proc/5990/task/5991/comm>\n"
6875 "THREADFOO\n"
6876 msgstr ""
6877 "$B< ./a.out>\n"
6878 "Created a thread. Default name is: a.out\n"
6879 "The thread name after setting it is THREADFOO.\n"
6880 "B<^Z>                           # Suspend the program\n"
6881 "[1]+  Stopped           ./a.out\n"
6882 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
6883 "  PID   TID CMD                         COMMAND\n"
6884 " 5990  5990 ./a.out                     a.out\n"
6885 " 5990  5991 ./a.out                     THREADFOO\n"
6886 "$ B<cat /proc/5990/task/5990/comm>\n"
6887 "a.out\n"
6888 "$ B<cat /proc/5990/task/5991/comm>\n"
6889 "THREADFOO\n"
6890
6891 #. type: Plain text
6892 #: build/C/man3/pthread_setname_np.3:150
6893 #, no-wrap
6894 msgid ""
6895 "#define _GNU_SOURCE\n"
6896 "#include E<lt>pthread.hE<gt>\n"
6897 "#include E<lt>stdio.hE<gt>\n"
6898 "#include E<lt>string.hE<gt>\n"
6899 "#include E<lt>unistd.hE<gt>\n"
6900 "#include E<lt>errno.hE<gt>\n"
6901 "#include E<lt>stdlib.hE<gt>\n"
6902 msgstr ""
6903 "#define _GNU_SOURCE\n"
6904 "#include E<lt>pthread.hE<gt>\n"
6905 "#include E<lt>stdio.hE<gt>\n"
6906 "#include E<lt>string.hE<gt>\n"
6907 "#include E<lt>unistd.hE<gt>\n"
6908 "#include E<lt>errno.hE<gt>\n"
6909 "#include E<lt>stdlib.hE<gt>\n"
6910
6911 #. type: Plain text
6912 #: build/C/man3/pthread_setname_np.3:152
6913 #, no-wrap
6914 msgid "#define NAMELEN 16\n"
6915 msgstr "#define NAMELEN 16\n"
6916
6917 #. type: Plain text
6918 #: build/C/man3/pthread_setname_np.3:156
6919 #, no-wrap
6920 msgid ""
6921 "#define errExitEN(en, msg) \\e\n"
6922 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
6923 "        } while (0)\n"
6924 msgstr ""
6925 "#define errExitEN(en, msg) \\e\n"
6926 "            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\e\n"
6927 "        } while (0)\n"
6928
6929 #. type: Plain text
6930 #: build/C/man3/pthread_setname_np.3:163
6931 #, no-wrap
6932 msgid ""
6933 "static void *\n"
6934 "threadfunc(void *parm)\n"
6935 "{\n"
6936 "    sleep(5);          // allow main program to set the thread name\n"
6937 "    return NULL;\n"
6938 "}\n"
6939 msgstr ""
6940 "static void *\n"
6941 "threadfunc(void *parm)\n"
6942 "{\n"
6943 "    sleep(5);          // allow main program to set the thread name\n"
6944 "    return NULL;\n"
6945 "}\n"
6946
6947 #. type: Plain text
6948 #: build/C/man3/pthread_setname_np.3:170
6949 #, no-wrap
6950 msgid ""
6951 "int\n"
6952 "main(int argc, char **argv)\n"
6953 "{\n"
6954 "    pthread_t thread;\n"
6955 "    int rc;\n"
6956 "    char thread_name[NAMELEN];\n"
6957 msgstr ""
6958 "int\n"
6959 "main(int argc, char **argv)\n"
6960 "{\n"
6961 "    pthread_t thread;\n"
6962 "    int rc;\n"
6963 "    char thread_name[NAMELEN];\n"
6964
6965 #. type: Plain text
6966 #: build/C/man3/pthread_setname_np.3:174
6967 #, no-wrap
6968 msgid ""
6969 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
6970 "    if (rc != 0)\n"
6971 "        errExitEN(rc, \"pthread_create\");\n"
6972 msgstr ""
6973 "    rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
6974 "    if (rc != 0)\n"
6975 "        errExitEN(rc, \"pthread_create\");\n"
6976
6977 #. type: Plain text
6978 #: build/C/man3/pthread_setname_np.3:178
6979 #, no-wrap
6980 msgid ""
6981 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
6982 "    if (rc != 0)\n"
6983 "        errExitEN(rc, \"pthread_getname_np\");\n"
6984 msgstr ""
6985 "    rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
6986 "    if (rc != 0)\n"
6987 "        errExitEN(rc, \"pthread_getname_np\");\n"
6988
6989 #. type: Plain text
6990 #: build/C/man3/pthread_setname_np.3:183
6991 #, no-wrap
6992 msgid ""
6993 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
6994 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
6995 "    if (rc != 0)\n"
6996 "        errExitEN(rc, \"pthread_setname_np\");\n"
6997 msgstr ""
6998 "    printf(\"Created a thread. Default name is: %s\\en\", thread_name);\n"
6999 "    rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
7000 "    if (rc != 0)\n"
7001 "        errExitEN(rc, \"pthread_setname_np\");\n"
7002
7003 #. type: Plain text
7004 #: build/C/man3/pthread_setname_np.3:185
7005 #, no-wrap
7006 msgid "    sleep(2);\n"
7007 msgstr "    sleep(2);\n"
7008
7009 #. type: Plain text
7010 #: build/C/man3/pthread_setname_np.3:191
7011 #, no-wrap
7012 msgid ""
7013 "    rc = pthread_getname_np(thread, thread_name,\n"
7014 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
7015 "    if (rc != 0)\n"
7016 "        errExitEN(rc, \"pthread_getname_np\");\n"
7017 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
7018 msgstr ""
7019 "    rc = pthread_getname_np(thread, thread_name,\n"
7020 "                            (argc E<gt> 2) ? atoi(argv[1]) : NAMELEN);\n"
7021 "    if (rc != 0)\n"
7022 "        errExitEN(rc, \"pthread_getname_np\");\n"
7023 "    printf(\"The thread name after setting it is %s.\\en\", thread_name);\n"
7024
7025 #. type: Plain text
7026 #: build/C/man3/pthread_setname_np.3:195
7027 #, no-wrap
7028 msgid ""
7029 "    rc = pthread_join(thread, NULL);\n"
7030 "    if (rc != 0)\n"
7031 "        errExitEN(rc, \"pthread_join\");\n"
7032 msgstr ""
7033 "    rc = pthread_join(thread, NULL);\n"
7034 "    if (rc != 0)\n"
7035 "        errExitEN(rc, \"pthread_join\");\n"
7036
7037 #. type: Plain text
7038 #: build/C/man3/pthread_setname_np.3:199
7039 #, no-wrap
7040 msgid ""
7041 "    printf(\"Done\\en\");\n"
7042 "    exit(EXIT_SUCCESS);\n"
7043 "}\n"
7044 msgstr ""
7045 "    printf(\"Done\\en\");\n"
7046 "    exit(EXIT_SUCCESS);\n"
7047 "}\n"
7048
7049 #. type: Plain text
7050 #: build/C/man3/pthread_setname_np.3:206
7051 msgid "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
7052 msgstr "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
7053
7054 #. type: TH
7055 #: build/C/man3/pthread_setschedparam.3:26
7056 #, no-wrap
7057 msgid "PTHREAD_SETSCHEDPARAM"
7058 msgstr "PTHREAD_SETSCHEDPARAM"
7059
7060 #. type: TH
7061 #: build/C/man3/pthread_setschedparam.3:26
7062 #, no-wrap
7063 msgid "2014-12-31"
7064 msgstr "2014-12-31"
7065
7066 #. type: Plain text
7067 #: build/C/man3/pthread_setschedparam.3:30
7068 msgid "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and parameters of a thread"
7069 msgstr ""
7070 "pthread_setschedparam, pthread_getschedparam - スレッドの\n"
7071 "スケジューリングポリシーとパラメーターを設定/取得する"
7072
7073 #. type: Plain text
7074 #: build/C/man3/pthread_setschedparam.3:38
7075 #, no-wrap
7076 msgid ""
7077 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
7078 "B<                          const struct sched_param *>I<param>B<);>\n"
7079 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
7080 "B<                          struct sched_param *>I<param>B<);>\n"
7081 msgstr ""
7082 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
7083 "B<                          const struct sched_param *>I<param>B<);>\n"
7084 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *>I<policy>B<,>\n"
7085 "B<                          struct sched_param *>I<param>B<);>\n"
7086
7087 #. type: Plain text
7088 #: build/C/man3/pthread_setschedparam.3:46
7089 msgid "The B<pthread_setschedparam>()  function sets the scheduling policy and parameters of the thread I<thread>."
7090 msgstr ""
7091 "B<pthread_setschedparam>() 関数は、スレッド I<thread> の\n"
7092 "スケジューリングポリシーとスケジューリングパラメーターを設定する。"
7093
7094 #.  FIXME . pthread_setschedparam() places no restriction on the policy,
7095 #.  but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
7096 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7013
7097 #. type: Plain text
7098 #: build/C/man3/pthread_setschedparam.3:57
7099 msgid "I<policy> specifies the new scheduling policy for I<thread>.  The supported values for I<policy>, and their semantics, are described in B<sched>(7)."
7100 msgstr "I<policy> は I<thread> の新しいスケジューリングポリシーを指定する。 I<policy> に指定できる値とその意味は B<sched>(7) で説明されている。"
7101
7102 #. type: Plain text
7103 #: build/C/man3/pthread_setschedparam.3:63
7104 msgid "The structure pointed to by I<param> specifies the new scheduling parameters for I<thread>.  Scheduling parameters are maintained in the following structure:"
7105 msgstr ""
7106 "I<param> が指す構造体は I<thread> の新しいスケジューリングパラメーターを\n"
7107 "指定する。スケジューリングパラメーターは以下の構造体で管理される。"
7108
7109 #.  FIXME . nptl/pthread_setschedparam.c has the following
7110 #.    /* If the thread should have higher priority because of some
7111 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
7112 #.  Eventually (perhaps after writing the mutexattr pages), we
7113 #.  may want to add something on the topic to this page.
7114 #. type: Plain text
7115 #: build/C/man3/pthread_setschedparam.3:104
7116 msgid "The B<pthread_getschedparam>()  function returns the scheduling policy and parameters of the thread I<thread>, in the buffers pointed to by I<policy> and I<param>, respectively.  The returned priority value is that set by the most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or B<pthread_create>(3)  call that affected I<thread>.  The returned priority does not reflect any temporary priority adjustments as a result of calls to any priority inheritance or priority ceiling functions (see, for example, B<pthread_mutexattr_setprioceiling>(3)  and B<pthread_mutexattr_setprotocol>(3))."
7117 msgstr ""
7118 "B<pthread_getschedparam>() 関数は、スレッド I<thread> の\n"
7119 "スケジューリングポリシーとパラメーターを、\n"
7120 "それぞれ I<policy> と I<param> が指すバッファーに入れて返す。\n"
7121 "返された優先度の値は、最も最近実行した I<thread> に影響を与える\n"
7122 "B<pthread_setschedparam>(), B<pthread_setschedprio>,\n"
7123 "B<pthread_create> で設定された値となる。\n"
7124 "返された優先度は、優先度の継承や優先度の上限を設定する関数\n"
7125 "(例えば B<pthread_mutexattr_setprioceiling>(3) や\n"
7126 "B<pthread_mutexattr_setprotocol>(3) を参照) の呼び出しの結果\n"
7127 "行われる一時的な優先度の調整の影響を受けない。"
7128
7129 #. type: Plain text
7130 #: build/C/man3/pthread_setschedparam.3:112
7131 msgid "On success, these functions return 0; on error, they return a nonzero error number.  If B<pthread_setschedparam>()  fails, the scheduling policy and parameters of I<thread> are not changed."
7132 msgstr ""
7133 "成功すると、これらの関数は 0 を返す。\n"
7134 "エラーの場合、0 以外のエラー番号を返す。\n"
7135 "B<pthread_setschedparam>() が失敗した場合、 I<thread> の\n"
7136 "スケジューリングポリシーとパラメーターは変更されない。"
7137
7138 #. type: Plain text
7139 #: build/C/man3/pthread_setschedparam.3:114
7140 msgid "Both of these functions can fail with the following error:"
7141 msgstr "これらの関数はどちらも以下のエラーで失敗する場合がある。"
7142
7143 #. type: Plain text
7144 #: build/C/man3/pthread_setschedparam.3:122
7145 msgid "B<pthread_setschedparam>()  may additionally fail with the following errors:"
7146 msgstr "B<pthread_setschedparam>() はさらに以下のエラーで失敗する場合がある。"
7147
7148 #. type: Plain text
7149 #: build/C/man3/pthread_setschedparam.3:129
7150 msgid "I<policy> is not a recognized policy, or I<param> does not make sense for the I<policy>."
7151 msgstr ""
7152 "I<policy> が認識できないポリシーであるか、\n"
7153 "I<param> が I<policy> では意味を持たない値である。"
7154
7155 #. type: Plain text
7156 #: build/C/man3/pthread_setschedparam.3:133
7157 msgid "The caller does not have appropriate privileges to set the specified scheduling policy and parameters."
7158 msgstr ""
7159 "呼び出し側が、指定されたスケジューリングポリシーやパラメーターを設定する\n"
7160 "のに必要な特権を持たない。"
7161
7162 #.  .SH VERSIONS
7163 #.  Available since glibc 2.0
7164 #. type: Plain text
7165 #: build/C/man3/pthread_setschedparam.3:141
7166 msgid "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the policy or scheduling parameters to an unsupported value\") error for B<pthread_setschedparam>()."
7167 msgstr ""
7168 "POSIX.1-2001 では、 B<pthread_setschedparam>() に関して\n"
7169 "エラー B<ENOTSUP> (\"サポートされていない値をスケジューリングポリシーや\n"
7170 "パラメーターに設定しようとした\") も追加で規定されている。"
7171
7172 #. type: Plain text
7173 #: build/C/man3/pthread_setschedparam.3:148
7174 msgid "The B<pthread_setschedparam>()  and B<pthread_getschedparam>()  functions are thread-safe."
7175 msgstr "関数 B<pthread_setschedparam>() と B<pthread_getschedparam>() はスレッドセーフである。"
7176
7177 #. type: Plain text
7178 #: build/C/man3/pthread_setschedparam.3:156
7179 msgid "For a description of the permissions required to, and the effect of, changing a thread's scheduling policy and priority, and details of the permitted ranges for priorities in each scheduling policy, see B<sched>(7)."
7180 msgstr "スレッドのスケジューリングポリシーや優先度を変更するために必要な許可や変更した場合の影響、および各スケジューリングポリシーで認められる優先度の範囲の詳細については、 B<sched>(7) を参照。"
7181
7182 #. type: Plain text
7183 #: build/C/man3/pthread_setschedparam.3:163
7184 msgid "The program below demonstrates the use of B<pthread_setschedparam>()  and B<pthread_getschedparam>(), as well as the use of a number of other scheduling-related pthreads functions."
7185 msgstr ""
7186 "以下のプログラムは B<pthread_setschedparam>() と\n"
7187 "B<pthread_getschedparam>() やスケジューリングに関連する pthreads の\n"
7188 "他のいろいろな関数の使用例を示すものである。"
7189
7190 #. type: Plain text
7191 #: build/C/man3/pthread_setschedparam.3:179
7192 msgid "In the following run, the main thread sets its scheduling policy to B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes object with a scheduling policy attribute of B<SCHED_RR> and a scheduling priority attribute of 20.  The program then sets (using B<pthread_attr_setinheritsched>(3))  the inherit scheduler attribute of the thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads created using this attributes object should take their scheduling attributes from the thread attributes object.  The program then creates a thread using the thread attributes object, and that thread displays its scheduling policy and priority."
7193 msgstr ""
7194 "以下の実行例では、メインスレッドは、自分のスケジューリングポリシーを\n"
7195 "優先度 10 の B<SCHED_FIFO> を設定し、スレッド属性オブジェクトを\n"
7196 "スケジューリングポリシー属性 B<SCHED_RR> とスケジューリング優先度\n"
7197 "属性 20 で初期化する。\n"
7198 "次に、このプログラムは (B<pthread_attr_setinheritsched>(3) を使って) \n"
7199 "そのスレッド属性オブジェクトの inherit scheduler 属性に\n"
7200 "B<PTHREAD_EXPLICIT_SCHED> を設定する。B<PTHREAD_EXPLICIT_SCHED> は、\n"
7201 "そのスレッド属性オブジェクトを使って作成されたスレッドはスレッド属性\n"
7202 "オブジェクトからスケジューリング属性を取得して使うことを意味する。\n"
7203 "それから、このスレッド属性オブジェクトを使ってスレッドを作成し、\n"
7204 "作成したスレッドのスケジューリングポリシーと優先度を表示する。"
7205
7206 #. type: Plain text
7207 #: build/C/man3/pthread_setschedparam.3:187
7208 #, no-wrap
7209 msgid ""
7210 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
7211 "Password:\n"
7212 "# B<./a.out -mf10 -ar20 -i e>\n"
7213 "Scheduler settings of main thread\n"
7214 "    policy=SCHED_FIFO, priority=10\n"
7215 msgstr ""
7216 "$ B<su>      # Need privilege to set real-time scheduling policies\n"
7217 "Password:\n"
7218 "# B<./a.out -mf10 -ar20 -i e>\n"
7219 "Scheduler settings of main thread\n"
7220 "    policy=SCHED_FIFO, priority=10\n"
7221
7222 #. type: Plain text
7223 #: build/C/man3/pthread_setschedparam.3:191
7224 #, no-wrap
7225 msgid ""
7226 "Scheduler settings in \\(aqattr\\(aq\n"
7227 "    policy=SCHED_RR, priority=20\n"
7228 "    inheritsched is EXPLICIT\n"
7229 msgstr ""
7230 "Scheduler settings in \\(aqattr\\(aq\n"
7231 "    policy=SCHED_RR, priority=20\n"
7232 "    inheritsched is EXPLICIT\n"
7233
7234 #. type: Plain text
7235 #: build/C/man3/pthread_setschedparam.3:194
7236 #, no-wrap
7237 msgid ""
7238 "Scheduler attributes of new thread\n"
7239 "    policy=SCHED_RR, priority=20\n"
7240 msgstr ""
7241 "Scheduler attributes of new thread\n"
7242 "    policy=SCHED_RR, priority=20\n"
7243
7244 #. type: Plain text
7245 #: build/C/man3/pthread_setschedparam.3:199
7246 msgid "In the above output, one can see that the scheduling policy and priority were taken from the values specified in the thread attributes object."
7247 msgstr ""
7248 "上記の出力では、スケジューリングポリシーと優先度がスレッド属性\n"
7249 "オブジェクトで指定された値から取られていることが分かる。"
7250
7251 #. type: Plain text
7252 #: build/C/man3/pthread_setschedparam.3:206
7253 msgid "The next run is the same as the previous, except that the inherit scheduler attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created using the thread attributes object should ignore the scheduling attributes specified in the attributes object and instead take their scheduling attributes from the creating thread."
7254 msgstr ""
7255 "次の実行例は前のものと同じだが、 inherit scheduler 属性が \n"
7256 "B<PTHREAD_INHERIT_SCHED> に設定される点が異なる。\n"
7257 "B<PTHREAD_INHERIT_SCHED> は、そのスレッド属性オブジェクトを使って作成\n"
7258 "されたスレッドは、スレッド属性オブジェクトからスケジューリング属性を\n"
7259 "無視し、代わりに呼び出したスレッドからスケジューリング属性を取得する\n"
7260 "ことを意味する。"
7261
7262 #. type: Plain text
7263 #: build/C/man3/pthread_setschedparam.3:212
7264 #, no-wrap
7265 msgid ""
7266 "# B<./a.out -mf10 -ar20 -i i>\n"
7267 "Scheduler settings of main thread\n"
7268 "    policy=SCHED_FIFO, priority=10\n"
7269 msgstr ""
7270 "# B<./a.out -mf10 -ar20 -i i>\n"
7271 "Scheduler settings of main thread\n"
7272 "    policy=SCHED_FIFO, priority=10\n"
7273
7274 #. type: Plain text
7275 #: build/C/man3/pthread_setschedparam.3:216
7276 #, no-wrap
7277 msgid ""
7278 "Scheduler settings in \\(aqattr\\(aq\n"
7279 "    policy=SCHED_RR, priority=20\n"
7280 "    inheritsched is INHERIT\n"
7281 msgstr ""
7282 "Scheduler settings in \\(aqattr\\(aq\n"
7283 "    policy=SCHED_RR, priority=20\n"
7284 "    inheritsched is INHERIT\n"
7285
7286 #. type: Plain text
7287 #: build/C/man3/pthread_setschedparam.3:219
7288 #, no-wrap
7289 msgid ""
7290 "Scheduler attributes of new thread\n"
7291 "    policy=SCHED_FIFO, priority=10\n"
7292 msgstr ""
7293 "Scheduler attributes of new thread\n"
7294 "    policy=SCHED_FIFO, priority=10\n"
7295
7296 #. type: Plain text
7297 #: build/C/man3/pthread_setschedparam.3:225
7298 msgid "In the above output, one can see that the scheduling policy and priority were taken from the creating thread, rather than the thread attributes object."
7299 msgstr ""
7300 "上記の出力では、スケジューリングポリシーと優先度が、\n"
7301 "スレッド属性オブジェクトからではなく、\n"
7302 "スレッドを作成したスレッドから取れれていることが分かる。"
7303
7304 #. type: Plain text
7305 #: build/C/man3/pthread_setschedparam.3:231
7306 msgid "Note that if we had omitted the I<-i\\ i> option, the output would have been the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit scheduler attribute."
7307 msgstr ""
7308 "なお、 I<-i\\ i> を省略した場合でも、\n"
7309 "B<PTHREAD_INHERIT_SCHED> が inherit scheduler 属性のデフォルト値なので、\n"
7310 "出力は同じになる。"
7311
7312 #. type: Plain text
7313 #: build/C/man3/pthread_setschedparam.3:235
7314 #, no-wrap
7315 msgid "/* pthreads_sched_test.c */\n"
7316 msgstr "/* pthreads_sched_test.c */\n"
7317
7318 #. type: Plain text
7319 #: build/C/man3/pthread_setschedparam.3:241
7320 #, no-wrap
7321 msgid ""
7322 "#include E<lt>pthread.hE<gt>\n"
7323 "#include E<lt>stdio.hE<gt>\n"
7324 "#include E<lt>stdlib.hE<gt>\n"
7325 "#include E<lt>unistd.hE<gt>\n"
7326 "#include E<lt>errno.hE<gt>\n"
7327 msgstr ""
7328 "#include E<lt>pthread.hE<gt>\n"
7329 "#include E<lt>stdio.hE<gt>\n"
7330 "#include E<lt>stdlib.hE<gt>\n"
7331 "#include E<lt>unistd.hE<gt>\n"
7332 "#include E<lt>errno.hE<gt>\n"
7333
7334 #. type: Plain text
7335 #: build/C/man3/pthread_setschedparam.3:250
7336 #, no-wrap
7337 msgid ""
7338 "static void\n"
7339 "usage(char *prog_name, char *msg)\n"
7340 "{\n"
7341 "    if (msg != NULL)\n"
7342 "        fputs(msg, stderr);\n"
7343 msgstr ""
7344 "static void\n"
7345 "usage(char *prog_name, char *msg)\n"
7346 "{\n"
7347 "    if (msg != NULL)\n"
7348 "        fputs(msg, stderr);\n"
7349
7350 #. type: Plain text
7351 #: build/C/man3/pthread_setschedparam.3:267
7352 #, no-wrap
7353 msgid ""
7354 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
7355 "    fprintf(stderr, \"Options are:\\en\");\n"
7356 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
7357 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
7358 "    fpe(\"                 thread attributes object\\en\");\n"
7359 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
7360 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
7361 "    fpe(\"                     r  SCHED_RR\\en\");\n"
7362 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
7363 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
7364 "    fpe(\"-i {e|i}         Set inherit scheduler attribute to\\en\");\n"
7365 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
7366 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
7367 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
7368 "    exit(EXIT_FAILURE);\n"
7369 "}\n"
7370 msgstr ""
7371 "    fprintf(stderr, \"Usage: %s [options]\\en\", prog_name);\n"
7372 "    fprintf(stderr, \"Options are:\\en\");\n"
7373 "#define fpe(msg) fprintf(stderr, \"\\et%s\", msg);          /* Shorter */\n"
7374 "    fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\en\");\n"
7375 "    fpe(\"                 thread attributes object\\en\");\n"
7376 "    fpe(\"                 E<lt>policyE<gt> can be\\en\");\n"
7377 "    fpe(\"                     f  SCHED_FIFO\\en\");\n"
7378 "    fpe(\"                     r  SCHED_RR\\en\");\n"
7379 "    fpe(\"                     o  SCHED_OTHER\\en\");\n"
7380 "    fpe(\"-A               Use default thread attributes object\\en\");\n"
7381 "    fpe(\"-i {e|i}         Set inherit scheduler attribute to\\en\");\n"
7382 "    fpe(\"                 \\(aqexplicit\\(aq or \\(aqinherit\\(aq\\en\");\n"
7383 "    fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\en\");\n"
7384 "    fpe(\"                 main thread before pthread_create() call\\en\");\n"
7385 "    exit(EXIT_FAILURE);\n"
7386 "}\n"
7387
7388 #. type: Plain text
7389 #: build/C/man3/pthread_setschedparam.3:278
7390 #, no-wrap
7391 msgid ""
7392 "static int\n"
7393 "get_policy(char p, int *policy)\n"
7394 "{\n"
7395 "    switch (p) {\n"
7396 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
7397 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
7398 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
7399 "    default:  return 0;\n"
7400 "    }\n"
7401 "}\n"
7402 msgstr ""
7403 "static int\n"
7404 "get_policy(char p, int *policy)\n"
7405 "{\n"
7406 "    switch (p) {\n"
7407 "    case \\(aqf\\(aq: *policy = SCHED_FIFO;     return 1;\n"
7408 "    case \\(aqr\\(aq: *policy = SCHED_RR;       return 1;\n"
7409 "    case \\(aqo\\(aq: *policy = SCHED_OTHER;    return 1;\n"
7410 "    default:  return 0;\n"
7411 "    }\n"
7412 "}\n"
7413
7414 #. type: Plain text
7415 #: build/C/man3/pthread_setschedparam.3:289
7416 #, no-wrap
7417 msgid ""
7418 "static void\n"
7419 "display_sched_attr(int policy, struct sched_param *param)\n"
7420 "{\n"
7421 "    printf(\"    policy=%s, priority=%d\\en\",\n"
7422 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
7423 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
7424 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
7425 "            \"???\",\n"
7426 "            param-E<gt>sched_priority);\n"
7427 "}\n"
7428 msgstr ""
7429 "static void\n"
7430 "display_sched_attr(int policy, struct sched_param *param)\n"
7431 "{\n"
7432 "    printf(\"    policy=%s, priority=%d\\en\",\n"
7433 "            (policy == SCHED_FIFO)  ? \"SCHED_FIFO\" :\n"
7434 "            (policy == SCHED_RR)    ? \"SCHED_RR\" :\n"
7435 "            (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
7436 "            \"???\",\n"
7437 "            param-E<gt>sched_priority);\n"
7438 "}\n"
7439
7440 #. type: Plain text
7441 #: build/C/man3/pthread_setschedparam.3:295
7442 #, no-wrap
7443 msgid ""
7444 "static void\n"
7445 "display_thread_sched_attr(char *msg)\n"
7446 "{\n"
7447 "    int policy, s;\n"
7448 "    struct sched_param param;\n"
7449 msgstr ""
7450 "static void\n"
7451 "display_thread_sched_attr(char *msg)\n"
7452 "{\n"
7453 "    int policy, s;\n"
7454 "    struct sched_param param;\n"
7455
7456 #. type: Plain text
7457 #: build/C/man3/pthread_setschedparam.3:299
7458 #, no-wrap
7459 msgid ""
7460 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
7461 "    if (s != 0)\n"
7462 "        handle_error_en(s, \"pthread_getschedparam\");\n"
7463 msgstr ""
7464 "    s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
7465 "    if (s != 0)\n"
7466 "        handle_error_en(s, \"pthread_getschedparam\");\n"
7467
7468 #. type: Plain text
7469 #: build/C/man3/pthread_setschedparam.3:303
7470 #, no-wrap
7471 msgid ""
7472 "    printf(\"%s\\en\", msg);\n"
7473 "    display_sched_attr(policy, &param);\n"
7474 "}\n"
7475 msgstr ""
7476 "    printf(\"%s\\en\", msg);\n"
7477 "    display_sched_attr(policy, &param);\n"
7478 "}\n"
7479
7480 #. type: Plain text
7481 #: build/C/man3/pthread_setschedparam.3:308
7482 #, no-wrap
7483 msgid ""
7484 "static void *\n"
7485 "thread_start(void *arg)\n"
7486 "{\n"
7487 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7488 msgstr ""
7489 "static void *\n"
7490 "thread_start(void *arg)\n"
7491 "{\n"
7492 "    display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
7493
7494 #. type: Plain text
7495 #: build/C/man3/pthread_setschedparam.3:311
7496 #, no-wrap
7497 msgid ""
7498 "    return NULL;\n"
7499 "}\n"
7500 msgstr ""
7501 "    return NULL;\n"
7502 "}\n"
7503
7504 #. type: Plain text
7505 #: build/C/man3/pthread_setschedparam.3:321
7506 #, no-wrap
7507 msgid ""
7508 "int\n"
7509 "main(int argc, char *argv[])\n"
7510 "{\n"
7511 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
7512 "    pthread_t thread;\n"
7513 "    pthread_attr_t attr;\n"
7514 "    pthread_attr_t *attrp;\n"
7515 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7516 "    struct sched_param param;\n"
7517 msgstr ""
7518 "int\n"
7519 "main(int argc, char *argv[])\n"
7520 "{\n"
7521 "    int s, opt, inheritsched, use_null_attrib, policy;\n"
7522 "    pthread_t thread;\n"
7523 "    pthread_attr_t attr;\n"
7524 "    pthread_attr_t *attrp;\n"
7525 "    char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
7526 "    struct sched_param param;\n"
7527
7528 #. type: Plain text
7529 #: build/C/man3/pthread_setschedparam.3:323
7530 #, no-wrap
7531 msgid "    /* Process command-line options */\n"
7532 msgstr "    /* Process command-line options */\n"
7533
7534 #. type: Plain text
7535 #: build/C/man3/pthread_setschedparam.3:328
7536 #, no-wrap
7537 msgid ""
7538 "    use_null_attrib = 0;\n"
7539 "    attr_sched_str = NULL;\n"
7540 "    main_sched_str = NULL;\n"
7541 "    inheritsched_str = NULL;\n"
7542 msgstr ""
7543 "    use_null_attrib = 0;\n"
7544 "    attr_sched_str = NULL;\n"
7545 "    main_sched_str = NULL;\n"
7546 "    inheritsched_str = NULL;\n"
7547
7548 #. type: Plain text
7549 #: build/C/man3/pthread_setschedparam.3:338
7550 #, no-wrap
7551 msgid ""
7552 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7553 "        switch (opt) {\n"
7554 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
7555 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
7556 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
7557 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
7558 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
7559 "        }\n"
7560 "    }\n"
7561 msgstr ""
7562 "    while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
7563 "        switch (opt) {\n"
7564 "        case \\(aqa\\(aq: attr_sched_str = optarg;      break;\n"
7565 "        case \\(aqA\\(aq: use_null_attrib = 1;          break;\n"
7566 "        case \\(aqi\\(aq: inheritsched_str = optarg;    break;\n"
7567 "        case \\(aqm\\(aq: main_sched_str = optarg;      break;\n"
7568 "        default:  usage(argv[0], \"Unrecognized option\\en\");\n"
7569 "        }\n"
7570 "    }\n"
7571
7572 #. type: Plain text
7573 #: build/C/man3/pthread_setschedparam.3:342
7574 #, no-wrap
7575 msgid ""
7576 "    if (use_null_attrib &&\n"
7577 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7578 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7579 msgstr ""
7580 "    if (use_null_attrib &&\n"
7581 "            (inheritsched_str != NULL || attr_sched_str != NULL))\n"
7582 "        usage(argv[0], \"Can\\(aqt specify -A with -i or -a\\en\");\n"
7583
7584 #. type: Plain text
7585 #: build/C/man3/pthread_setschedparam.3:345
7586 #, no-wrap
7587 msgid ""
7588 "    /* Optionally set scheduling attributes of main thread,\n"
7589 "       and display the attributes */\n"
7590 msgstr ""
7591 "    /* Optionally set scheduling attributes of main thread,\n"
7592 "       and display the attributes */\n"
7593
7594 #. type: Plain text
7595 #: build/C/man3/pthread_setschedparam.3:350
7596 #, no-wrap
7597 msgid ""
7598 "    if (main_sched_str != NULL) {\n"
7599 "        if (!get_policy(main_sched_str[0], &policy))\n"
7600 "            usage(argv[0], \"Bad policy for main thread (-m)\\en\");\n"
7601 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7602 msgstr ""
7603 "    if (main_sched_str != NULL) {\n"
7604 "        if (!get_policy(main_sched_str[0], &policy))\n"
7605 "            usage(argv[0], \"Bad policy for main thread (-m)\\en\");\n"
7606 "        param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
7607
7608 #. type: Plain text
7609 #: build/C/man3/pthread_setschedparam.3:355
7610 #, no-wrap
7611 msgid ""
7612 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
7613 "        if (s != 0)\n"
7614 "            handle_error_en(s, \"pthread_setschedparam\");\n"
7615 "    }\n"
7616 msgstr ""
7617 "        s = pthread_setschedparam(pthread_self(), policy, &param);\n"
7618 "        if (s != 0)\n"
7619 "            handle_error_en(s, \"pthread_setschedparam\");\n"
7620 "    }\n"
7621
7622 #. type: Plain text
7623 #: build/C/man3/pthread_setschedparam.3:358
7624 #, no-wrap
7625 msgid ""
7626 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7627 "    printf(\"\\en\");\n"
7628 msgstr ""
7629 "    display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
7630 "    printf(\"\\en\");\n"
7631
7632 #. type: Plain text
7633 #: build/C/man3/pthread_setschedparam.3:360
7634 #, no-wrap
7635 msgid "    /* Initialize thread attributes object according to options */\n"
7636 msgstr "    /* Initialize thread attributes object according to options */\n"
7637
7638 #. type: Plain text
7639 #: build/C/man3/pthread_setschedparam.3:369
7640 #, no-wrap
7641 msgid ""
7642 "    if (!use_null_attrib) {\n"
7643 "        s = pthread_attr_init(&attr);\n"
7644 "        if (s != 0)\n"
7645 "            handle_error_en(s, \"pthread_attr_init\");\n"
7646 "        attrp = &attr;\n"
7647 "    }\n"
7648 msgstr ""
7649 "    if (!use_null_attrib) {\n"
7650 "        s = pthread_attr_init(&attr);\n"
7651 "        if (s != 0)\n"
7652 "            handle_error_en(s, \"pthread_attr_init\");\n"
7653 "        attrp = &attr;\n"
7654 "    }\n"
7655
7656 #. type: Plain text
7657 #: build/C/man3/pthread_setschedparam.3:377
7658 #, no-wrap
7659 msgid ""
7660 "    if (inheritsched_str != NULL) {\n"
7661 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7662 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7663 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7664 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
7665 "        else\n"
7666 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7667 msgstr ""
7668 "    if (inheritsched_str != NULL) {\n"
7669 "        if (inheritsched_str[0] == \\(aqe\\(aq)\n"
7670 "            inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
7671 "        else if (inheritsched_str[0] == \\(aqi\\(aq)\n"
7672 "            inheritsched = PTHREAD_INHERIT_SCHED;\n"
7673 "        else\n"
7674 "            usage(argv[0], \"Value for -i must be \\(aqe\\(aq or \\(aqi\\(aq\\en\");\n"
7675
7676 #. type: Plain text
7677 #: build/C/man3/pthread_setschedparam.3:382
7678 #, no-wrap
7679 msgid ""
7680 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7681 "        if (s != 0)\n"
7682 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7683 "    }\n"
7684 msgstr ""
7685 "        s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
7686 "        if (s != 0)\n"
7687 "            handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
7688 "    }\n"
7689
7690 #. type: Plain text
7691 #: build/C/man3/pthread_setschedparam.3:388
7692 #, no-wrap
7693 msgid ""
7694 "    if (attr_sched_str != NULL) {\n"
7695 "        if (!get_policy(attr_sched_str[0], &policy))\n"
7696 "            usage(argv[0],\n"
7697 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7698 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7699 msgstr ""
7700 "    if (attr_sched_str != NULL) {\n"
7701 "        if (!get_policy(attr_sched_str[0], &policy))\n"
7702 "            usage(argv[0],\n"
7703 "                    \"Bad policy for \\(aqattr\\(aq (-a)\\en\");\n"
7704 "        param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
7705
7706 #. type: Plain text
7707 #: build/C/man3/pthread_setschedparam.3:396
7708 #, no-wrap
7709 msgid ""
7710 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
7711 "        if (s != 0)\n"
7712 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7713 "        s = pthread_attr_setschedparam(&attr, &param);\n"
7714 "        if (s != 0)\n"
7715 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7716 "    }\n"
7717 msgstr ""
7718 "        s = pthread_attr_setschedpolicy(&attr, policy);\n"
7719 "        if (s != 0)\n"
7720 "            handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
7721 "        s = pthread_attr_setschedparam(&attr, &param);\n"
7722 "        if (s != 0)\n"
7723 "            handle_error_en(s, \"pthread_attr_setschedparam\");\n"
7724 "    }\n"
7725
7726 #. type: Plain text
7727 #: build/C/man3/pthread_setschedparam.3:399
7728 #, no-wrap
7729 msgid ""
7730 "    /* If we initialized a thread attributes object, display\n"
7731 "       the scheduling attributes that were set in the object */\n"
7732 msgstr ""
7733 "    /* If we initialized a thread attributes object, display\n"
7734 "       the scheduling attributes that were set in the object */\n"
7735
7736 #. type: Plain text
7737 #: build/C/man3/pthread_setschedparam.3:407
7738 #, no-wrap
7739 msgid ""
7740 "    if (attrp != NULL) {\n"
7741 "        s = pthread_attr_getschedparam(&attr, &param);\n"
7742 "        if (s != 0)\n"
7743 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7744 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7745 "        if (s != 0)\n"
7746 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7747 msgstr ""
7748 "    if (attrp != NULL) {\n"
7749 "        s = pthread_attr_getschedparam(&attr, &param);\n"
7750 "        if (s != 0)\n"
7751 "            handle_error_en(s, \"pthread_attr_getschedparam\");\n"
7752 "        s = pthread_attr_getschedpolicy(&attr, &policy);\n"
7753 "        if (s != 0)\n"
7754 "            handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
7755
7756 #. type: Plain text
7757 #: build/C/man3/pthread_setschedparam.3:410
7758 #, no-wrap
7759 msgid ""
7760 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7761 "        display_sched_attr(policy, &param);\n"
7762 msgstr ""
7763 "        printf(\"Scheduler settings in \\(aqattr\\(aq\\en\");\n"
7764 "        display_sched_attr(policy, &param);\n"
7765
7766 #. type: Plain text
7767 #: build/C/man3/pthread_setschedparam.3:418
7768 #, no-wrap
7769 msgid ""
7770 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7771 "        printf(\"    inheritsched is %s\\en\",\n"
7772 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
7773 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7774 "                \"???\");\n"
7775 "        printf(\"\\en\");\n"
7776 "    }\n"
7777 msgstr ""
7778 "        s = pthread_attr_getinheritsched(&attr, &inheritsched);\n"
7779 "        printf(\"    inheritsched is %s\\en\",\n"
7780 "                (inheritsched == PTHREAD_INHERIT_SCHED)  ? \"INHERIT\" :\n"
7781 "                (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
7782 "                \"???\");\n"
7783 "        printf(\"\\en\");\n"
7784 "    }\n"
7785
7786 #. type: Plain text
7787 #: build/C/man3/pthread_setschedparam.3:420
7788 #, no-wrap
7789 msgid "    /* Create a thread that will display its scheduling attributes */\n"
7790 msgstr "    /* Create a thread that will display its scheduling attributes */\n"
7791
7792 #. type: Plain text
7793 #: build/C/man3/pthread_setschedparam.3:424
7794 #, no-wrap
7795 msgid ""
7796 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7797 "    if (s != 0)\n"
7798 "        handle_error_en(s, \"pthread_create\");\n"
7799 msgstr ""
7800 "    s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
7801 "    if (s != 0)\n"
7802 "        handle_error_en(s, \"pthread_create\");\n"
7803
7804 #. type: Plain text
7805 #: build/C/man3/pthread_setschedparam.3:426
7806 #, no-wrap
7807 msgid "    /* Destroy unneeded thread attributes object */\n"
7808 msgstr "    /* Destroy unneeded thread attributes object */\n"
7809
7810 #. type: Plain text
7811 #: build/C/man3/pthread_setschedparam.3:432
7812 #, no-wrap
7813 msgid ""
7814 "    if (!use_null_attrib) {\n"
7815 "      s = pthread_attr_destroy(&attr);\n"
7816 "      if (s != 0)\n"
7817 "          handle_error_en(s, \"pthread_attr_destroy\");\n"
7818 "    }\n"
7819 msgstr ""
7820 "    if (!use_null_attrib) {\n"
7821 "      s = pthread_attr_destroy(&attr);\n"
7822 "      if (s != 0)\n"
7823 "          handle_error_en(s, \"pthread_attr_destroy\");\n"
7824 "    }\n"
7825
7826 #. type: Plain text
7827 #: build/C/man3/pthread_setschedparam.3:436
7828 #, no-wrap
7829 msgid ""
7830 "    s = pthread_join(thread, NULL);\n"
7831 "    if (s != 0)\n"
7832 "        handle_error_en(s, \"pthread_join\");\n"
7833 msgstr ""
7834 "    s = pthread_join(thread, NULL);\n"
7835 "    if (s != 0)\n"
7836 "        handle_error_en(s, \"pthread_join\");\n"
7837
7838 #. type: Plain text
7839 #: build/C/man3/pthread_setschedparam.3:454
7840 msgid "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
7841 msgstr "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
7842
7843 #. type: TH
7844 #: build/C/man3/pthread_setschedprio.3:26
7845 #, no-wrap
7846 msgid "PTHREAD_SETSCHEDPRIO"
7847 msgstr "PTHREAD_SETSCHEDPRIO"
7848
7849 #. type: Plain text
7850 #: build/C/man3/pthread_setschedprio.3:29
7851 msgid "pthread_setschedprio - set scheduling priority of a thread"
7852 msgstr "pthread_setschedprio - スレッドのスケジューリング優先度を設定する"
7853
7854 #. type: Plain text
7855 #: build/C/man3/pthread_setschedprio.3:34
7856 #, no-wrap
7857 msgid "B<int pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
7858 msgstr "B<int pthread_setschedprio(pthread_t >I<thread>B<, int >I<prio>B<);>\n"
7859
7860 #.  FIXME . nptl/pthread_setschedprio.c has the following
7861 #.    /* If the thread should have higher priority because of some
7862 #.       PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
7863 #.  Eventually (perhaps after writing the mutexattr pages), we
7864 #.  may want to add something on the topic to this page.
7865 #.  nptl/pthread_setschedparam.c has a similar case.
7866 #. type: Plain text
7867 #: build/C/man3/pthread_setschedprio.3:53
7868 msgid "The B<pthread_setschedprio>()  function sets the scheduling priority of the thread I<thread> to the value specified in I<prio>.  (By contrast B<pthread_setschedparam>(3)  changes both the scheduling policy and priority of a thread.)"
7869 msgstr ""
7870 "B<pthread_setschedprio>() 関数は、スレッド I<thread> のスケジューリング\n"
7871 "優先度に I<prio> で指定された値を設定する\n"
7872 "(一方、B<pthread_setschedparam>(3) はスレッドのスケジューリングポリシー\n"
7873 "と優先度の両方を変更する)。"
7874
7875 #. type: Plain text
7876 #: build/C/man3/pthread_setschedprio.3:61
7877 msgid "On success, this function returns 0; on error, it returns a nonzero error number.  If B<pthread_setschedprio>()  fails, the scheduling priority of I<thread> is not changed."
7878 msgstr ""
7879 "成功すると、この関数は 0 を返す。\n"
7880 "エラーの場合、0 以外のエラー番号を返す。\n"
7881 "B<pthread_setschedprio>() が失敗した場合、 I<thread> の\n"
7882 "スケジューリング優先度は変更されない。"
7883
7884 #. type: Plain text
7885 #: build/C/man3/pthread_setschedprio.3:66
7886 msgid "I<prio> is not valid for the scheduling policy of the specified thread."
7887 msgstr "指定されたスレッドのスケジューリングポリシーでは、 I<prio> は無効である。"
7888
7889 #. type: Plain text
7890 #: build/C/man3/pthread_setschedprio.3:70
7891 msgid "The caller does not have appropriate privileges to set the specified priority."
7892 msgstr "呼び出し側が、指定された優先度を設定するのに必要な特権を持っていない。"
7893
7894 #. type: Plain text
7895 #: build/C/man3/pthread_setschedprio.3:81
7896 msgid "POSIX.1-2001 also documents an B<ENOTSUP> (\"attempt was made to set the priority to an unsupported value\") error for B<pthread_setschedparam>(3)."
7897 msgstr ""
7898 "POSIX.1-2001 では、 B<pthread_setschedprio>() に関して\n"
7899 "エラー B<ENOTSUP> (\"サポートされていない値を優先度\n"
7900 "に設定しようとした\") も追加で規定されている。"
7901
7902 #. type: Plain text
7903 #: build/C/man3/pthread_setschedprio.3:83
7904 msgid "This function is available in glibc since version 2.3.4."
7905 msgstr "この関数は glibc バージョン 2.3.4 以降で利用できる。"
7906
7907 #. type: Plain text
7908 #: build/C/man3/pthread_setschedprio.3:88
7909 msgid "The B<pthread_setschedprio>()  function is thread-safe."
7910 msgstr "B<pthread_setschedprio>() 関数はスレッドセーフである。"
7911
7912 #. type: Plain text
7913 #: build/C/man3/pthread_setschedprio.3:96
7914 msgid "For a description of the permissions required to, and the effect of, changing a thread's scheduling priority, and details of the permitted ranges for priorities in each scheduling policy, see B<sched>(7)."
7915 msgstr "スレッドのスケジューリング優先度を変更するために必要な許可や変更した場合の影響、および各スケジューリングポリシーで認められる優先度の範囲の詳細については、 B<sched>(7) を参照。"
7916
7917 #. type: Plain text
7918 #: build/C/man3/pthread_setschedprio.3:110
7919 msgid "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
7920 msgstr "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), B<pthread_setschedparam>(3), B<pthreads>(7), B<sched>(7)"
7921
7922 #. type: TH
7923 #: build/C/man3/pthread_sigmask.3:26
7924 #, no-wrap
7925 msgid "PTHREAD_SIGMASK"
7926 msgstr "PTHREAD_SIGMASK"
7927
7928 #. type: TH
7929 #: build/C/man3/pthread_sigmask.3:26 build/C/man3/pthread_testcancel.3:26
7930 #, no-wrap
7931 msgid "2014-05-19"
7932 msgstr "2014-05-19"
7933
7934 #. type: Plain text
7935 #: build/C/man3/pthread_sigmask.3:29
7936 msgid "pthread_sigmask - examine and change mask of blocked signals"
7937 msgstr "pthread_sigmask - 禁止するシグナルマスクの確認と変更を行う"
7938
7939 #. type: Plain text
7940 #: build/C/man3/pthread_sigmask.3:35
7941 #, no-wrap
7942 msgid "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
7943 msgstr "B<int pthread_sigmask(int >I<how>B<, const sigset_t *>I<set>B<, sigset_t *>I<oldset>B<);>\n"
7944
7945 #. type: Plain text
7946 #: build/C/man3/pthread_sigmask.3:46
7947 msgid "B<pthread_sigmask>():"
7948 msgstr "B<pthread_sigmask>():"
7949
7950 #. type: Plain text
7951 #: build/C/man3/pthread_sigmask.3:58
7952 msgid "The B<pthread_sigmask>()  function is just like B<sigprocmask>(2), with the difference that its use in multithreaded programs is explicitly specified by POSIX.1-2001.  Other differences are noted in this page."
7953 msgstr ""
7954 "B<pthread_sigmask>() 関数は B<sigprocmask>(2) と全く同様だが、\n"
7955 "マルチスレッドプログラムでの利用が POSIX.1-2001 で明示的に規定されて\n"
7956 "いる点が異なる。他の違いはこのマニュアルページで説明する。"
7957
7958 #. type: Plain text
7959 #: build/C/man3/pthread_sigmask.3:61
7960 msgid "For a description of the arguments and operation of this function, see B<sigprocmask>(2)."
7961 msgstr "この関数の引き数と動作の説明は B<sigprocmask>(2) を参照。"
7962
7963 #. type: Plain text
7964 #: build/C/man3/pthread_sigmask.3:66
7965 msgid "On success, B<pthread_sigmask>()  returns 0; on error, it returns an error number."
7966 msgstr ""
7967 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
7968 "エラーの場合、エラー番号を返す。"
7969
7970 #. type: Plain text
7971 #: build/C/man3/pthread_sigmask.3:69
7972 msgid "See B<sigprocmask>(2)."
7973 msgstr "B<sigprocmask>(2) を参照。"
7974
7975 #. type: Plain text
7976 #: build/C/man3/pthread_sigmask.3:74
7977 msgid "The B<pthread_sigmask>()  function is thread-safe."
7978 msgstr "B<pthread_sigmask>() 関数はスレッドセーフである。"
7979
7980 #. type: Plain text
7981 #: build/C/man3/pthread_sigmask.3:78
7982 msgid "A new thread inherits a copy of its creator's signal mask."
7983 msgstr ""
7984 "新しいスレッドは、スレッドを作成したスレッドのシグナルマスクのコピーを\n"
7985 "継承する。"
7986
7987 #. type: Plain text
7988 #: build/C/man3/pthread_sigmask.3:83
7989 msgid "The program below blocks some signals in the main thread, and then creates a dedicated thread to fetch those signals via B<sigwait>(3).  The following shell session demonstrates its use:"
7990 msgstr ""
7991 "以下のプログラムは、メインスレッドでシグナルのいくつかを禁止 (block)\n"
7992 "するように設定を行い、 B<sigwait>(3) 経由でそれらのシグナルを集める\n"
7993 "専用のスレッドを作成する。\n"
7994 "下記のシェルのセッションはその利用例を示したものである。"
7995
7996 #. type: Plain text
7997 #: build/C/man3/pthread_sigmask.3:94
7998 #, no-wrap
7999 msgid ""
8000 "$B< ./a.out &>\n"
8001 "[1] 5423\n"
8002 "$B< kill -QUIT %1>\n"
8003 "Signal handling thread got signal 3\n"
8004 "$B< kill -USR1 %1>\n"
8005 "Signal handling thread got signal 10\n"
8006 "$B< kill -TERM %1>\n"
8007 "[1]+  Terminated              ./a.out\n"
8008 msgstr ""
8009 "$B< ./a.out &>\n"
8010 "[1] 5423\n"
8011 "$B< kill -QUIT %1>\n"
8012 "Signal handling thread got signal 3\n"
8013 "$B< kill -USR1 %1>\n"
8014 "Signal handling thread got signal 10\n"
8015 "$B< kill -TERM %1>\n"
8016 "[1]+  Terminated              ./a.out\n"
8017
8018 #. type: Plain text
8019 #: build/C/man3/pthread_sigmask.3:105
8020 #, no-wrap
8021 msgid ""
8022 "#include E<lt>pthread.hE<gt>\n"
8023 "#include E<lt>stdio.hE<gt>\n"
8024 "#include E<lt>stdlib.hE<gt>\n"
8025 "#include E<lt>unistd.hE<gt>\n"
8026 "#include E<lt>signal.hE<gt>\n"
8027 "#include E<lt>errno.hE<gt>\n"
8028 msgstr ""
8029 "#include E<lt>pthread.hE<gt>\n"
8030 "#include E<lt>stdio.hE<gt>\n"
8031 "#include E<lt>stdlib.hE<gt>\n"
8032 "#include E<lt>unistd.hE<gt>\n"
8033 "#include E<lt>signal.hE<gt>\n"
8034 "#include E<lt>errno.hE<gt>\n"
8035
8036 #. type: Plain text
8037 #: build/C/man3/pthread_sigmask.3:107
8038 #, no-wrap
8039 msgid "/* Simple error handling functions */\n"
8040 msgstr "/* Simple error handling functions */\n"
8041
8042 #. type: Plain text
8043 #: build/C/man3/pthread_sigmask.3:116
8044 #, no-wrap
8045 msgid ""
8046 "static void *\n"
8047 "sig_thread(void *arg)\n"
8048 "{\n"
8049 "    sigset_t *set = arg;\n"
8050 "    int s, sig;\n"
8051 msgstr ""
8052 "static void *\n"
8053 "sig_thread(void *arg)\n"
8054 "{\n"
8055 "    sigset_t *set = arg;\n"
8056 "    int s, sig;\n"
8057
8058 #. type: Plain text
8059 #: build/C/man3/pthread_sigmask.3:124
8060 #, no-wrap
8061 msgid ""
8062 "    for (;;) {\n"
8063 "        s = sigwait(set, &sig);\n"
8064 "        if (s != 0)\n"
8065 "            handle_error_en(s, \"sigwait\");\n"
8066 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
8067 "    }\n"
8068 "}\n"
8069 msgstr ""
8070 "    for (;;) {\n"
8071 "        s = sigwait(set, &sig);\n"
8072 "        if (s != 0)\n"
8073 "            handle_error_en(s, \"sigwait\");\n"
8074 "        printf(\"Signal handling thread got signal %d\\en\", sig);\n"
8075 "    }\n"
8076 "}\n"
8077
8078 #. type: Plain text
8079 #: build/C/man3/pthread_sigmask.3:131
8080 #, no-wrap
8081 msgid ""
8082 "int\n"
8083 "main(int argc, char *argv[])\n"
8084 "{\n"
8085 "    pthread_t thread;\n"
8086 "    sigset_t set;\n"
8087 "    int s;\n"
8088 msgstr ""
8089 "int\n"
8090 "main(int argc, char *argv[])\n"
8091 "{\n"
8092 "    pthread_t thread;\n"
8093 "    sigset_t set;\n"
8094 "    int s;\n"
8095
8096 #. type: Plain text
8097 #: build/C/man3/pthread_sigmask.3:134
8098 #, no-wrap
8099 msgid ""
8100 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
8101 "       will inherit a copy of the signal mask. */\n"
8102 msgstr ""
8103 "    /* Block SIGQUIT and SIGUSR1; other threads created by main()\n"
8104 "       will inherit a copy of the signal mask. */\n"
8105
8106 #. type: Plain text
8107 #: build/C/man3/pthread_sigmask.3:141
8108 #, no-wrap
8109 msgid ""
8110 "    sigemptyset(&set);\n"
8111 "    sigaddset(&set, SIGQUIT);\n"
8112 "    sigaddset(&set, SIGUSR1);\n"
8113 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
8114 "    if (s != 0)\n"
8115 "        handle_error_en(s, \"pthread_sigmask\");\n"
8116 msgstr ""
8117 "    sigemptyset(&set);\n"
8118 "    sigaddset(&set, SIGQUIT);\n"
8119 "    sigaddset(&set, SIGUSR1);\n"
8120 "    s = pthread_sigmask(SIG_BLOCK, &set, NULL);\n"
8121 "    if (s != 0)\n"
8122 "        handle_error_en(s, \"pthread_sigmask\");\n"
8123
8124 #. type: Plain text
8125 #: build/C/man3/pthread_sigmask.3:145
8126 #, no-wrap
8127 msgid ""
8128 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
8129 "    if (s != 0)\n"
8130 "        handle_error_en(s, \"pthread_create\");\n"
8131 msgstr ""
8132 "    s = pthread_create(&thread, NULL, &sig_thread, (void *) &set);\n"
8133 "    if (s != 0)\n"
8134 "        handle_error_en(s, \"pthread_create\");\n"
8135
8136 #. type: Plain text
8137 #: build/C/man3/pthread_sigmask.3:148
8138 #, no-wrap
8139 msgid ""
8140 "    /* Main thread carries on to create other threads and/or do\n"
8141 "       other work */\n"
8142 msgstr ""
8143 "    /* Main thread carries on to create other threads and/or do\n"
8144 "       other work */\n"
8145
8146 #. type: Plain text
8147 #: build/C/man3/pthread_sigmask.3:151
8148 #, no-wrap
8149 msgid ""
8150 "    pause();            /* Dummy pause so we can test program */\n"
8151 "}\n"
8152 msgstr ""
8153 "    pause();            /* Dummy pause so we can test program */\n"
8154 "}\n"
8155
8156 #. type: Plain text
8157 #: build/C/man3/pthread_sigmask.3:161
8158 msgid "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
8159 msgstr "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<pthread_create>(3), B<pthread_kill>(3), B<sigsetops>(3), B<pthreads>(7), B<signal>(7)"
8160
8161 #. type: TH
8162 #: build/C/man3/pthread_sigqueue.3:25
8163 #, no-wrap
8164 msgid "PTHREAD_SIGQUEUE"
8165 msgstr "PTHREAD_SIGQUEUE"
8166
8167 #. type: Plain text
8168 #: build/C/man3/pthread_sigqueue.3:28
8169 msgid "pthread_sigqueue - queue a signal and data to a thread"
8170 msgstr "pthread_sigqueue - スレッドに対するシグナルとデータをキューに入れる"
8171
8172 #. type: Plain text
8173 #: build/C/man3/pthread_sigqueue.3:32
8174 #, no-wrap
8175 msgid ""
8176 "B<#include E<lt>signal.hE<gt>>\n"
8177 "B<#include E<lt>pthread.hE<gt>>\n"
8178 msgstr ""
8179 "B<#include E<lt>signal.hE<gt>>\n"
8180 "B<#include E<lt>pthread.hE<gt>>\n"
8181
8182 #. type: Plain text
8183 #: build/C/man3/pthread_sigqueue.3:35
8184 #, no-wrap
8185 msgid ""
8186 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
8187 "B<                     const union sigval >I<value>B<);>\n"
8188 msgstr ""
8189 "B<int pthread_sigqueue(pthread_t >I<thread>B<, int >I<sig>B<,>\n"
8190 "B<                     const union sigval >I<value>B<);>\n"
8191
8192 #. type: Plain text
8193 #: build/C/man3/pthread_sigqueue.3:46
8194 msgid "B<pthread_sigqueue>(): _GNU_SOURCE"
8195 msgstr "B<pthread_sigqueue>(): _GNU_SOURCE"
8196
8197 #. type: Plain text
8198 #: build/C/man3/pthread_sigqueue.3:54
8199 msgid "The B<pthread_sigqueue>()  function performs a similar task to B<sigqueue>(3), but, rather than sending a signal to a process, it sends a signal to a thread in the same process as the calling thread."
8200 msgstr ""
8201 "B<pthread_sigqueue>() 関数は B<sigqueue>(3) と同様の処理を実行するが、\n"
8202 "プロセスにシグナルを送信するのではなく、呼び出したスレッドと\n"
8203 "同じプロセス内のスレッドにシグナルを送信する。"
8204
8205 #. type: Plain text
8206 #: build/C/man3/pthread_sigqueue.3:66
8207 msgid "The I<thread> argument is the ID of a thread in the same process as the caller.  The I<sig> argument specifies the signal to be sent.  The I<value> argument specifies data to accompany the signal; see B<sigqueue>(3)  for details."
8208 msgstr ""
8209 "I<thread> 引き数は、呼び出し側と同じプロセスのスレッドの ID である。\n"
8210 "I<sig> 引き数は送信するシグナルを指定する。\n"
8211 "I<value> 引き数はシグナルと一緒に渡すデータを指定する。\n"
8212 "詳細は B<sigqueue>(3) を参照。"
8213
8214 #. type: Plain text
8215 #: build/C/man3/pthread_sigqueue.3:71
8216 msgid "On success, B<pthread_sigqueue>()  returns 0; on error, it returns an error number."
8217 msgstr ""
8218 "成功すると、 B<pthread_sigmask>() は 0 を返す。\n"
8219 "エラーの場合、エラー番号を返す。"
8220
8221 #. type: Plain text
8222 #: build/C/man3/pthread_sigqueue.3:78
8223 msgid "The limit of signals which may be queued has been reached.  (See B<signal>(7)  for further information.)"
8224 msgstr ""
8225 "キューに入れられるシグナル数が上限に達していた\n"
8226 "(詳しい情報は (B<signal>(7) を参照)。"
8227
8228 #. type: Plain text
8229 #: build/C/man3/pthread_sigqueue.3:82
8230 msgid "I<sig> was invalid."
8231 msgstr "I<sig> が無効であった。"
8232
8233 #. type: TP
8234 #: build/C/man3/pthread_sigqueue.3:82
8235 #, no-wrap
8236 msgid "B<ENOSYS>"
8237 msgstr "B<ENOSYS>"
8238
8239 #. type: Plain text
8240 #: build/C/man3/pthread_sigqueue.3:86
8241 msgid "B<pthread_sigqueue>()  is not supported on this system."
8242 msgstr "B<pthread_sigqueue>() がこのシステムではサポートされていない。"
8243
8244 #. type: Plain text
8245 #: build/C/man3/pthread_sigqueue.3:90
8246 msgid "I<thread> is not valid."
8247 msgstr "I<thread> が無効である。"
8248
8249 #. type: Plain text
8250 #: build/C/man3/pthread_sigqueue.3:94
8251 msgid "The B<pthread_sigqueue>()  function first appeared in glibc 2.11."
8252 msgstr "B<pthread_sigqueue>() 関数は glibc 2.11 で初めて登場した。"
8253
8254 #. type: Plain text
8255 #: build/C/man3/pthread_sigqueue.3:99
8256 msgid "The B<pthread_sigqueue>()  function is thread-safe."
8257 msgstr "B<pthread_sigqueue>() 関数はスレッドセーフである。"
8258
8259 #. type: Plain text
8260 #: build/C/man3/pthread_sigqueue.3:101
8261 msgid "This function is a GNU extension."
8262 msgstr "この関数は GNU による拡張である。"
8263
8264 #. type: Plain text
8265 #: build/C/man3/pthread_sigqueue.3:109
8266 msgid "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
8267 msgstr ""
8268 "B<rt_tgsigqueueinfo>(2), B<sigaction>(2), B<pthread_sigmask>(3), \n"
8269 "B<sigqueue>(3), B<sigwait>(3), B<pthreads>(7), B<signal>(7)"
8270
8271 #. type: TH
8272 #: build/C/man3/pthread_testcancel.3:26
8273 #, no-wrap
8274 msgid "PTHREAD_TESTCANCEL"
8275 msgstr "PTHREAD_TESTCANCEL"
8276
8277 #. type: Plain text
8278 #: build/C/man3/pthread_testcancel.3:29
8279 msgid "pthread_testcancel - request delivery of any pending cancellation request"
8280 msgstr "pthread_testcancel - 処理待ちの取り消し要求の配送を要求する"
8281
8282 #. type: Plain text
8283 #: build/C/man3/pthread_testcancel.3:34
8284 #, no-wrap
8285 msgid "B<void pthread_testcancel(void);>\n"
8286 msgstr "B<void pthread_testcancel(void);>\n"
8287
8288 #. type: Plain text
8289 #: build/C/man3/pthread_testcancel.3:43
8290 msgid "Calling B<pthread_testcancel>()  creates a cancellation point within the calling thread, so that a thread that is otherwise executing code that contains no cancellation points will respond to a cancellation request."
8291 msgstr ""
8292 "B<pthread_testcancel>() を呼び出すと、呼び出したスレッド内に取り消し\n"
8293 "ポイント (cancellation point) が作成される。\n"
8294 "これにより、これ以外には取り消しポイントを含まないコードを実行して\n"
8295 "いるスレッドが取り消し要求に対応することができるようになる。"
8296
8297 #. type: Plain text
8298 #: build/C/man3/pthread_testcancel.3:50
8299 msgid "If cancelability is disabled (using B<pthread_setcancelstate>(3)), or no cancellation request is pending, then a call to B<pthread_testcancel>()  has no effect."
8300 msgstr ""
8301 "(B<pthread_setcancelstate>(3) を使って) キャンセルが無効になっている\n"
8302 "場合や処理待ちの取り消し要求がない場合は、B<pthread_testcancel>() を\n"
8303 "呼び出しても何の影響もない。"
8304
8305 #. type: Plain text
8306 #: build/C/man3/pthread_testcancel.3:54
8307 msgid "This function does not return a value.  If the calling thread is canceled as a consequence of a call to this function, then the function does not return."
8308 msgstr ""
8309 "この関数は値を返さない。この関数の呼び出しの結果、呼び出したスレッドが\n"
8310 "キャンセルされた場合、この関数が返ることはない。"
8311
8312 #. type: Plain text
8313 #: build/C/man3/pthread_testcancel.3:63
8314 msgid "The B<pthread_testcancel>()  function is thread-safe."
8315 msgstr "B<pthread_testcancel>() 関数はスレッドセーフである。"
8316
8317 #. type: Plain text
8318 #: build/C/man3/pthread_testcancel.3:68
8319 msgid "See B<pthread_cleanup_push>(3)."
8320 msgstr "B<pthread_cleanup_push>(3) を参照。"
8321
8322 #. type: Plain text
8323 #: build/C/man3/pthread_testcancel.3:73
8324 msgid "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>(3), B<pthreads>(7)"
8325 msgstr "B<pthread_cancel>(3), B<pthread_cleanup_push>(3), B<pthread_setcancelstate>(3), B<pthreads>(7)"
8326
8327 #. type: TH
8328 #: build/C/man3/pthread_tryjoin_np.3:26
8329 #, no-wrap
8330 msgid "PTHREAD_TRYJOIN_NP"
8331 msgstr "PTHREAD_TRYJOIN_NP"
8332
8333 #. type: TH
8334 #: build/C/man3/pthread_tryjoin_np.3:26
8335 #, no-wrap
8336 msgid "2015-01-10"
8337 msgstr "2015-01-10"
8338
8339 #. type: Plain text
8340 #: build/C/man3/pthread_tryjoin_np.3:30
8341 msgid "pthread_tryjoin_np, pthread_timedjoin_np - try to join with a terminated thread"
8342 msgstr ""
8343 "pthread_tryjoin_np, pthread_timedjoin_np - 終了したスレッドの join を\n"
8344 "試みる"
8345
8346 #. type: Plain text
8347 #: build/C/man3/pthread_tryjoin_np.3:36
8348 #, no-wrap
8349 msgid "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
8350 msgstr "B<int pthread_tryjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<);>\n"
8351
8352 #. type: Plain text
8353 #: build/C/man3/pthread_tryjoin_np.3:39
8354 #, no-wrap
8355 msgid ""
8356 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
8357 "B<                         const struct timespec *>I<abstime>B<);>\n"
8358 msgstr ""
8359 "B<int pthread_timedjoin_np(pthread_t >I<thread>B<, void **>I<retval>B<,>\n"
8360 "B<                         const struct timespec *>I<abstime>B<);>\n"
8361
8362 #. type: Plain text
8363 #: build/C/man3/pthread_tryjoin_np.3:46
8364 msgid "These functions operate in the same way as B<pthread_join>(3), except for the differences described on this page."
8365 msgstr ""
8366 "これらの関数は B<pthread_join>(3) と同じように動作するが、\n"
8367 "このページで説明する違いがある。"
8368
8369 #. type: Plain text
8370 #: build/C/man3/pthread_tryjoin_np.3:58
8371 msgid "The B<pthread_tryjoin_np>()  function performs a nonblocking join with the thread I<thread>, returning the exit status of the thread in I<*retval>.  If I<thread> has not yet terminated, then instead of blocking, as is done by B<pthread_join>(3), the call returns an error."
8372 msgstr ""
8373 "B<pthread_tryjoin_np>() 関数は、スレッド I<thread> の非停止\n"
8374 "(nonblocking) での join を実行し、スレッドの終了ステータスを\n"
8375 "I<*retval> に入れて返す。I<thread> がまだ終了していない場合は、\n"
8376 "B<pthread_join>(3) のように停止 (block) せずに、エラーを返す。"
8377
8378 #. type: Plain text
8379 #: build/C/man3/pthread_tryjoin_np.3:76
8380 msgid "The B<pthread_timedjoin_np>()  function performs a join-with-timeout.  If I<thread> has not yet terminated, then the call blocks until a maximum time, specified in I<abstime>.  If the timeout expires before I<thread> terminates, the call returns an error.  The I<abstime> argument is a structure of the following form, specifying an absolute time measured since the Epoch (see B<time>(2)):"
8381 msgstr ""
8382 "B<pthread_timedjoin_np>() 関数は、タイムアウト付きの join を行う。\n"
8383 "I<thread> がまだ終了していない場合、 I<abstime> で指定された最大時間\n"
8384 "まで停止する。 I<thread> が終了する前にタイムアウト時間が経過した場合は、\n"
8385 "エラーを返す。I<abstime> 引き数は以下に示す構造体であり、\n"
8386 "Epoch (時刻紀元; B<time>(2) 参照) から測った絶対時刻を指定する。"
8387
8388 #. type: Plain text
8389 #: build/C/man3/pthread_tryjoin_np.3:83
8390 #, no-wrap
8391 msgid ""
8392 "struct timespec {\n"
8393 "    time_t tv_sec;     /* seconds */\n"
8394 "    long   tv_nsec;    /* nanoseconds */\n"
8395 "};\n"
8396 msgstr ""
8397 "struct timespec {\n"
8398 "    time_t tv_sec;     /* seconds */\n"
8399 "    long   tv_nsec;    /* nanoseconds */\n"
8400 "};\n"
8401
8402 #. type: Plain text
8403 #: build/C/man3/pthread_tryjoin_np.3:89
8404 msgid "On success, these functions return 0; on error, they return an error number."
8405 msgstr ""
8406 "成功すると、これらの関数は 0 を返す。\n"
8407 "エラーの場合、エラー番号を返す。"
8408
8409 #. type: Plain text
8410 #: build/C/man3/pthread_tryjoin_np.3:94
8411 msgid "These functions can fail with the same errors as B<pthread_join>(3).  B<pthread_tryjoin_np>()  can in addition fail with the following error:"
8412 msgstr ""
8413 "これらの関数は B<pthread_join>(3) と同じエラーで失敗する。\n"
8414 "B<pthread_tryjoin_np>() はさらに以下のエラーで失敗する場合がある。"
8415
8416 #. type: TP
8417 #: build/C/man3/pthread_tryjoin_np.3:94
8418 #, no-wrap
8419 msgid "B<EBUSY>"
8420 msgstr "B<EBUSY>"
8421
8422 #. type: Plain text
8423 #: build/C/man3/pthread_tryjoin_np.3:98
8424 msgid "I<thread> had not yet terminated at the time of the call."
8425 msgstr "呼び出しを行った時点では I<thread> はまだ終了していない。"
8426
8427 #. type: Plain text
8428 #: build/C/man3/pthread_tryjoin_np.3:101
8429 msgid "B<pthread_timedjoin_np>()  can in addition fail with the following errors:"
8430 msgstr "B<pthread_timedjoin_np>() はさらに以下のエラーで失敗する場合がある。"
8431
8432 #. type: TP
8433 #: build/C/man3/pthread_tryjoin_np.3:101
8434 #, no-wrap
8435 msgid "B<ETIMEDOUT>"
8436 msgstr "B<ETIMEDOUT>"
8437
8438 #. type: Plain text
8439 #: build/C/man3/pthread_tryjoin_np.3:106
8440 msgid "The call timed out before I<thread> terminated."
8441 msgstr "I<thread> が終了する前に呼び出しがタイムアウトとなった。"
8442
8443 #. type: Plain text
8444 #: build/C/man3/pthread_tryjoin_np.3:114
8445 msgid "I<abstime> value is invalid (I<tv_sec> is less than 0 or I<tv_nsec> is greater than 1e9)."
8446 msgstr "I<abstime> の値が無効である (I<tv_sec> が 0 より小さいか、 I<tv_nsec> 1e9 がより大きい)。"
8447
8448 #. type: Plain text
8449 #: build/C/man3/pthread_tryjoin_np.3:118
8450 msgid "B<pthread_timedjoin_np>()  never returns the error B<EINTR>."
8451 msgstr "B<pthread_timedjoin_np>() がエラー B<EINTR> を返すことはない。"
8452
8453 #. type: Plain text
8454 #: build/C/man3/pthread_tryjoin_np.3:120
8455 msgid "These functions first appeared in glibc in version 2.3.3."
8456 msgstr "これらの関数は glibc バージョン 2.3.3 で初めて登場した。"
8457
8458 #. type: Plain text
8459 #: build/C/man3/pthread_tryjoin_np.3:125
8460 msgid "The following code waits to join for up to 5 seconds:"
8461 msgstr "以下のコードは、最大 5 秒まで join を待つ。"
8462
8463 #. type: Plain text
8464 #: build/C/man3/pthread_tryjoin_np.3:129
8465 #, no-wrap
8466 msgid ""
8467 "    struct timespec ts;\n"
8468 "    int s;\n"
8469 msgstr ""
8470 "    struct timespec ts;\n"
8471 "    int s;\n"
8472
8473 #. type: Plain text
8474 #: build/C/man3/pthread_tryjoin_np.3:131
8475 #, no-wrap
8476 msgid "    ...\n"
8477 msgstr "    ...\n"
8478
8479 #. type: Plain text
8480 #: build/C/man3/pthread_tryjoin_np.3:135
8481 #, no-wrap
8482 msgid ""
8483 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8484 "\t/* Handle error */\n"
8485 "    }\n"
8486 msgstr ""
8487 "    if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {\n"
8488 "\t/* Handle error */\n"
8489 "    }\n"
8490
8491 #. type: Plain text
8492 #: build/C/man3/pthread_tryjoin_np.3:137
8493 #, no-wrap
8494 msgid "    ts.tv_sec += 5;\n"
8495 msgstr "    ts.tv_sec += 5;\n"
8496
8497 #. type: Plain text
8498 #: build/C/man3/pthread_tryjoin_np.3:142
8499 #, no-wrap
8500 msgid ""
8501 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8502 "    if (s != 0) {\n"
8503 "        /* Handle error */\n"
8504 "    }\n"
8505 msgstr ""
8506 "    s = pthread_timedjoin_np(thread, NULL, &ts);\n"
8507 "    if (s != 0) {\n"
8508 "        /* Handle error */\n"
8509 "    }\n"
8510
8511 #. type: Plain text
8512 #: build/C/man3/pthread_tryjoin_np.3:148
8513 msgid "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8514 msgstr "B<clock_gettime>(2), B<pthread_exit>(3), B<pthread_join>(3), B<pthreads>(7)"
8515
8516 #. type: TH
8517 #: build/C/man3/pthread_yield.3:25
8518 #, no-wrap
8519 msgid "PTHREAD_YIELD"
8520 msgstr "PTHREAD_YIELD"
8521
8522 #. type: Plain text
8523 #: build/C/man3/pthread_yield.3:28
8524 msgid "pthread_yield - yield the processor"
8525 msgstr "pthread_yield - プロセッサを明け渡す (yield)"
8526
8527 #. type: Plain text
8528 #: build/C/man3/pthread_yield.3:34
8529 #, no-wrap
8530 msgid "B<int pthread_yield(void);>\n"
8531 msgstr "B<int pthread_yield(void);>\n"
8532
8533 #. type: Plain text
8534 #: build/C/man3/pthread_yield.3:44
8535 msgid "B<pthread_yield>()  causes the calling thread to relinquish the CPU.  The thread is placed at the end of the run queue for its static priority and another thread is scheduled to run.  For further details, see B<sched_yield>(2)"
8536 msgstr ""
8537 "B<pthread_yield>() を呼び出すと、呼び出したスレッドは CPU を手放す。\n"
8538 "スレッドはそのスレッドの静的優先度の実行キューの末尾に回り、\n"
8539 "別のスレッドが実行されるようにスケジューリングされる。\n"
8540 "詳細は B<sched_yield>(2) を参照。"
8541
8542 #. type: Plain text
8543 #: build/C/man3/pthread_yield.3:49
8544 msgid "On success, B<pthread_yield>()  returns 0; on error, it returns an error number."
8545 msgstr ""
8546 "成功すると、 B<pthread_yield>() は 0 を返す。\n"
8547 "エラーの場合、エラー番号を返す。"
8548
8549 #. type: Plain text
8550 #: build/C/man3/pthread_yield.3:53
8551 msgid "On Linux, this call always succeeds (but portable and future-proof applications should nevertheless handle a possible error return)."
8552 msgstr ""
8553 "Linux では、この関数の呼び出しは常に成功する\n"
8554 "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n"
8555 "正のエラーの返り値を処理するようにすべきである)。"
8556
8557 #. type: Plain text
8558 #: build/C/man3/pthread_yield.3:58
8559 msgid "The B<pthread_yield>()  function is thread-safe."
8560 msgstr "B<pthread_yield>() 関数はスレッドセーフである。"
8561
8562 #.  e.g., the BSDs, Tru64, AIX, and Irix.
8563 #. type: Plain text
8564 #: build/C/man3/pthread_yield.3:64
8565 msgid "This call is nonstandard, but present on several other systems.  Use the standardized B<sched_yield>(2)  instead."
8566 msgstr ""
8567 "この関数は非標準だが、他のいくつかのシステムにも存在する。\n"
8568 "代わりに、標準化されている B<sched_yield>(2) を使うこと。"
8569
8570 #. type: Plain text
8571 #: build/C/man3/pthread_yield.3:67
8572 msgid "On Linux, this function is implemented as a call to B<sched_yield>(2)."
8573 msgstr "Linux では、この関数は B<sched_yield>(2) を呼び出す形で実装されている。"
8574
8575 #. type: Plain text
8576 #: build/C/man3/pthread_yield.3:71
8577 msgid "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
8578 msgstr "B<sched_yield>(2), B<pthreads>(7), B<sched>(7)"
8579
8580 #. type: TH
8581 #: build/C/man7/pthreads.7:26
8582 #, no-wrap
8583 msgid "PTHREADS"
8584 msgstr "PTHREADS"
8585
8586 #. type: Plain text
8587 #: build/C/man7/pthreads.7:29
8588 msgid "pthreads - POSIX threads"
8589 msgstr "pthreads - POSIX スレッド"
8590
8591 #. type: Plain text
8592 #: build/C/man7/pthreads.7:36
8593 msgid "POSIX.1 specifies a set of interfaces (functions, header files) for threaded programming commonly known as POSIX threads, or Pthreads.  A single process can contain multiple threads, all of which are executing the same program.  These threads share the same global memory (data and heap segments), but each thread has its own stack (automatic variables)."
8594 msgstr "POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる スレッドプログラミングのインタフェース群 (関数、ヘッダファイル)  を規定している。一つのプロセスは複数のスレッドを持つことができ、 全てのスレッドは同じプログラムを実行する。 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、 各スレッドは自分専用のスタック (自動変数) を持つ。"
8595
8596 #. type: Plain text
8597 #: build/C/man7/pthreads.7:39
8598 msgid "POSIX.1 also requires that threads share a range of other attributes (i.e., these attributes are process-wide rather than per-thread):"
8599 msgstr "POSIX.1 はスレッド間でどのような属性を共有するかについても定めている (つまり、これらの属性はスレッド単位ではなくプロセス全体で共通である):"
8600
8601 #. type: IP
8602 #: build/C/man7/pthreads.7:39 build/C/man7/pthreads.7:41
8603 #: build/C/man7/pthreads.7:43 build/C/man7/pthreads.7:45
8604 #: build/C/man7/pthreads.7:47 build/C/man7/pthreads.7:49
8605 #: build/C/man7/pthreads.7:51 build/C/man7/pthreads.7:54
8606 #: build/C/man7/pthreads.7:56 build/C/man7/pthreads.7:59
8607 #: build/C/man7/pthreads.7:65 build/C/man7/pthreads.7:70
8608 #: build/C/man7/pthreads.7:73 build/C/man7/pthreads.7:76
8609 #: build/C/man7/pthreads.7:84 build/C/man7/pthreads.7:88
8610 #: build/C/man7/pthreads.7:91 build/C/man7/pthreads.7:95
8611 #: build/C/man7/pthreads.7:98 build/C/man7/pthreads.7:103
8612 #: build/C/man7/pthreads.7:106 build/C/man7/pthreads.7:683
8613 #: build/C/man7/pthreads.7:690 build/C/man7/pthreads.7:702
8614 #: build/C/man7/pthreads.7:712 build/C/man7/pthreads.7:716
8615 #: build/C/man7/pthreads.7:725 build/C/man7/pthreads.7:735
8616 #: build/C/man7/pthreads.7:742 build/C/man7/pthreads.7:749
8617 #: build/C/man7/pthreads.7:751 build/C/man7/pthreads.7:754
8618 #: build/C/man7/pthreads.7:760 build/C/man7/pthreads.7:763
8619 #: build/C/man7/pthreads.7:765 build/C/man7/pthreads.7:767
8620 #: build/C/man7/pthreads.7:777 build/C/man7/pthreads.7:797
8621 #: build/C/man7/pthreads.7:806 build/C/man7/pthreads.7:812
8622 #: build/C/man7/pthreads.7:814 build/C/man7/pthreads.7:816
8623 #: build/C/man7/pthreads.7:820 build/C/man7/pthreads.7:825
8624 #: build/C/man7/pthreads.7:833
8625 #, no-wrap
8626 msgid "-"
8627 msgstr "-"
8628
8629 #. type: Plain text
8630 #: build/C/man7/pthreads.7:41
8631 msgid "process ID"
8632 msgstr "プロセス ID"
8633
8634 #. type: Plain text
8635 #: build/C/man7/pthreads.7:43
8636 msgid "parent process ID"
8637 msgstr "親プロセス ID"
8638
8639 #. type: Plain text
8640 #: build/C/man7/pthreads.7:45
8641 msgid "process group ID and session ID"
8642 msgstr "プロセスグループ ID とセッション ID"
8643
8644 #. type: Plain text
8645 #: build/C/man7/pthreads.7:47
8646 msgid "controlling terminal"
8647 msgstr "制御端末"
8648
8649 #. type: Plain text
8650 #: build/C/man7/pthreads.7:49
8651 msgid "user and group IDs"
8652 msgstr "ユーザー ID とグループ ID"
8653
8654 #. type: Plain text
8655 #: build/C/man7/pthreads.7:51
8656 msgid "open file descriptors"
8657 msgstr "オープンするファイルディスクリプター"
8658
8659 #. type: Plain text
8660 #: build/C/man7/pthreads.7:54
8661 msgid "record locks (see B<fcntl>(2))"
8662 msgstr "レコードのロック (B<fcntl>(3)  参照)"
8663
8664 #. type: Plain text
8665 #: build/C/man7/pthreads.7:56
8666 msgid "signal dispositions"
8667 msgstr "シグナルの配置"
8668
8669 #. type: Plain text
8670 #: build/C/man7/pthreads.7:59
8671 msgid "file mode creation mask (B<umask>(2))"
8672 msgstr "ファイルモード作成マスク (B<umask>(2))"
8673
8674 #. type: Plain text
8675 #: build/C/man7/pthreads.7:65
8676 msgid "current directory (B<chdir>(2))  and root directory (B<chroot>(2))"
8677 msgstr "カレントディレクトリ (B<chdir>(2))  とルートディレクトリ (B<chroot>(2))"
8678
8679 #. type: Plain text
8680 #: build/C/man7/pthreads.7:70
8681 msgid "interval timers (B<setitimer>(2))  and POSIX timers (B<timer_create>(2))"
8682 msgstr "インターバルタイマー (B<setitimer>(2))  と POSIX タイマー (B<timer_create>(2))"
8683
8684 #. type: Plain text
8685 #: build/C/man7/pthreads.7:73
8686 msgid "nice value (B<setpriority>(2))"
8687 msgstr "nice 値 (B<setpriority>(2))"
8688
8689 #. type: Plain text
8690 #: build/C/man7/pthreads.7:76
8691 msgid "resource limits (B<setrlimit>(2))"
8692 msgstr "リソース制限 (B<setrlimit>(2))"
8693
8694 #. type: Plain text
8695 #: build/C/man7/pthreads.7:81
8696 msgid "measurements of the consumption of CPU time (B<times>(2))  and resources (B<getrusage>(2))"
8697 msgstr "CPU 時間 (B<times>(2))  とリソース (B<getrusage>(2))  の消費状況の計測"
8698
8699 #. type: Plain text
8700 #: build/C/man7/pthreads.7:84
8701 msgid "As well as the stack, POSIX.1 specifies that various other attributes are distinct for each thread, including:"
8702 msgstr "スタックについても、POSIX.1 はどのような属性が 個々のスレッドで独立に管理されるかを規定している:"
8703
8704 #. type: Plain text
8705 #: build/C/man7/pthreads.7:88
8706 msgid "thread ID (the I<pthread_t> data type)"
8707 msgstr "スレッド ID (B<pthread_t> データ型)"
8708
8709 #. type: Plain text
8710 #: build/C/man7/pthreads.7:91
8711 msgid "signal mask (B<pthread_sigmask>(3))"
8712 msgstr "シグナルマスク (B<pthread_sigmask>(3))"
8713
8714 #. type: Plain text
8715 #: build/C/man7/pthreads.7:95
8716 msgid "the I<errno> variable"
8717 msgstr "I<errno> 変数"
8718
8719 #. type: Plain text
8720 #: build/C/man7/pthreads.7:98
8721 msgid "alternate signal stack (B<sigaltstack>(2))"
8722 msgstr "代替シグナルスタック (B<sigaltstack>(2))"
8723
8724 #. type: Plain text
8725 #: build/C/man7/pthreads.7:101
8726 msgid "real-time scheduling policy and priority (B<sched>(7))"
8727 msgstr "リアルタイムスケジューリングのポリシーと優先度 (B<sched>(7))"
8728
8729 #. type: Plain text
8730 #: build/C/man7/pthreads.7:103
8731 msgid "The following Linux-specific features are also per-thread:"
8732 msgstr "以下の Linux 特有の機能もスレッド単位である:"
8733
8734 #. type: Plain text
8735 #: build/C/man7/pthreads.7:106
8736 msgid "capabilities (see B<capabilities>(7))"
8737 msgstr "ケーパビリティ (B<capabilities>(7)  参照)"
8738
8739 #. type: Plain text
8740 #: build/C/man7/pthreads.7:109
8741 msgid "CPU affinity (B<sched_setaffinity>(2))"
8742 msgstr "CPU affinity (親和度)  (B<sched_setaffinity>(2))"
8743
8744 #. type: SS
8745 #: build/C/man7/pthreads.7:109
8746 #, no-wrap
8747 msgid "Pthreads function return values"
8748 msgstr "pthreads 関数の返り値"
8749
8750 #. type: Plain text
8751 #: build/C/man7/pthreads.7:116
8752 msgid "Most pthreads functions return 0 on success, and an error number of failure.  Note that the pthreads functions do not set I<errno>.  For each of the pthreads functions that can return an error, POSIX.1-2001 specifies that the function can never fail with the error B<EINTR>."
8753 msgstr "ほとんどの pthreads 関数は成功すると 0 を返し、 失敗した場合エラー番号を返す。 pthreads 関数は I<errno> をセットしない点に注意すること。 POSIX.1-2001 では、 エラーを返す可能性のある pthreads 関数がエラー B<EINTR> で失敗することは決してないと規定している。"
8754
8755 #. type: SS
8756 #: build/C/man7/pthreads.7:116
8757 #, no-wrap
8758 msgid "Thread IDs"
8759 msgstr "スレッド ID"
8760
8761 #. type: Plain text
8762 #: build/C/man7/pthreads.7:130
8763 msgid "Each of the threads in a process has a unique thread identifier (stored in the type I<pthread_t>).  This identifier is returned to the caller of B<pthread_create>(3), and a thread can obtain its own thread identifier using B<pthread_self>(3).  Thread IDs are guaranteed to be unique only within a process.  A thread ID may be reused after a terminated thread has been joined, or a detached thread has terminated.  In all pthreads functions that accept a thread ID as an argument, that ID by definition refers to a thread in the same process as the caller."
8764 msgstr "あるプロセス内の各スレッドは (I<pthread_t> 型の) 一意なスレッド識別子を持つ。 この識別子は、 B<pthread_create>(3)  の呼び出し元に返される。また、スレッドは自身のスレッド識別子を B<pthread_self>(3)  を使って取得できる。 スレッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。 終了したスレッドが join された後では、スレッド ID は再利用される可能性がある。 スレッド ID を引き数に取る全てのスレッド関数において、 その ID は呼び出し元と同じプロセス内の一つのスレッドを参照する。"
8765
8766 #. type: SS
8767 #: build/C/man7/pthreads.7:130
8768 #, no-wrap
8769 msgid "Thread-safe functions"
8770 msgstr "スレッドセーフな関数"
8771
8772 #. type: Plain text
8773 #: build/C/man7/pthreads.7:134
8774 msgid "A thread-safe function is one that can be safely (i.e., it will deliver the same results regardless of whether it is)  called from multiple threads at the same time."
8775 msgstr "スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な (すなわち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。"
8776
8777 #. type: Plain text
8778 #: build/C/man7/pthreads.7:138
8779 msgid "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the standard shall be thread-safe, except for the following functions:"
8780 msgstr "POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、 標準で規定されている全ての関数がスレッドセーフであることを要求している。 以下の関数が例外である。"
8781
8782 #. type: Plain text
8783 #: build/C/man7/pthreads.7:232
8784 #, no-wrap
8785 msgid ""
8786 "asctime()\n"
8787 "basename()\n"
8788 "catgets()\n"
8789 "crypt()\n"
8790 "ctermid() if passed a non-NULL argument\n"
8791 "ctime()\n"
8792 "dbm_clearerr()\n"
8793 "dbm_close()\n"
8794 "dbm_delete()\n"
8795 "dbm_error()\n"
8796 "dbm_fetch()\n"
8797 "dbm_firstkey()\n"
8798 "dbm_nextkey()\n"
8799 "dbm_open()\n"
8800 "dbm_store()\n"
8801 "dirname()\n"
8802 "dlerror()\n"
8803 "drand48()\n"
8804 "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8805 "encrypt()\n"
8806 "endgrent()\n"
8807 "endpwent()\n"
8808 "endutxent()\n"
8809 "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8810 "ftw()\n"
8811 "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8812 "getc_unlocked()\n"
8813 "getchar_unlocked()\n"
8814 "getdate()\n"
8815 "getenv()\n"
8816 "getgrent()\n"
8817 "getgrgid()\n"
8818 "getgrnam()\n"
8819 "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8820 "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
8821 "gethostent()\n"
8822 "getlogin()\n"
8823 "getnetbyaddr()\n"
8824 "getnetbyname()\n"
8825 "getnetent()\n"
8826 "getopt()\n"
8827 "getprotobyname()\n"
8828 "getprotobynumber()\n"
8829 "getprotoent()\n"
8830 "getpwent()\n"
8831 "getpwnam()\n"
8832 "getpwuid()\n"
8833 "getservbyname()\n"
8834 "getservbyport()\n"
8835 "getservent()\n"
8836 "getutxent()\n"
8837 "getutxid()\n"
8838 "getutxline()\n"
8839 "gmtime()\n"
8840 "hcreate()\n"
8841 "hdestroy()\n"
8842 "hsearch()\n"
8843 "inet_ntoa()\n"
8844 "l64a()\n"
8845 "lgamma()\n"
8846 "lgammaf()\n"
8847 "lgammal()\n"
8848 "localeconv()\n"
8849 "localtime()\n"
8850 "lrand48()\n"
8851 "mrand48()\n"
8852 "nftw()\n"
8853 "nl_langinfo()\n"
8854 "ptsname()\n"
8855 "putc_unlocked()\n"
8856 "putchar_unlocked()\n"
8857 "putenv()\n"
8858 "pututxline()\n"
8859 "rand()\n"
8860 "readdir()\n"
8861 "setenv()\n"
8862 "setgrent()\n"
8863 "setkey()\n"
8864 "setpwent()\n"
8865 "setutxent()\n"
8866 "strerror()\n"
8867 "strsignal() [Added in POSIX.1-2008]\n"
8868 "strtok()\n"
8869 "system() [Added in POSIX.1-2008]\n"
8870 "tmpnam() if passed a non-NULL argument\n"
8871 "ttyname()\n"
8872 "unsetenv()\n"
8873 "wcrtomb() if its final argument is NULL\n"
8874 "wcsrtombs() if its final argument is NULL\n"
8875 "wcstombs()\n"
8876 "wctomb()\n"
8877 msgstr ""
8878 "asctime()\n"
8879 "basename()\n"
8880 "catgets()\n"
8881 "crypt()\n"
8882 "ctermid() (NULL でない引き数を渡された場合)\n"
8883 "ctime()\n"
8884 "dbm_clearerr()\n"
8885 "dbm_close()\n"
8886 "dbm_delete()\n"
8887 "dbm_error()\n"
8888 "dbm_fetch()\n"
8889 "dbm_firstkey()\n"
8890 "dbm_nextkey()\n"
8891 "dbm_open()\n"
8892 "dbm_store()\n"
8893 "dirname()\n"
8894 "dlerror()\n"
8895 "drand48()\n"
8896 "ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8897 "encrypt()\n"
8898 "endgrent()\n"
8899 "endpwent()\n"
8900 "endutxent()\n"
8901 "fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8902 "ftw()\n"
8903 "gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8904 "getc_unlocked()\n"
8905 "getchar_unlocked()\n"
8906 "getdate()\n"
8907 "getenv()\n"
8908 "getgrent()\n"
8909 "getgrgid()\n"
8910 "getgrnam()\n"
8911 "gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8912 "gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
8913 "gethostent()\n"
8914 "getlogin()\n"
8915 "getnetbyaddr()\n"
8916 "getnetbyname()\n"
8917 "getnetent()\n"
8918 "getopt()\n"
8919 "getprotobyname()\n"
8920 "getprotobynumber()\n"
8921 "getprotoent()\n"
8922 "getpwent()\n"
8923 "getpwnam()\n"
8924 "getpwuid()\n"
8925 "getservbyname()\n"
8926 "getservbyport()\n"
8927 "getservent()\n"
8928 "getutxent()\n"
8929 "getutxid()\n"
8930 "getutxline()\n"
8931 "gmtime()\n"
8932 "hcreate()\n"
8933 "hdestroy()\n"
8934 "hsearch()\n"
8935 "inet_ntoa()\n"
8936 "l64a()\n"
8937 "lgamma()\n"
8938 "lgammaf()\n"
8939 "lgammal()\n"
8940 "localeconv()\n"
8941 "localtime()\n"
8942 "lrand48()\n"
8943 "mrand48()\n"
8944 "nftw()\n"
8945 "nl_langinfo()\n"
8946 "ptsname()\n"
8947 "putc_unlocked()\n"
8948 "putchar_unlocked()\n"
8949 "putenv()\n"
8950 "pututxline()\n"
8951 "rand()\n"
8952 "readdir()\n"
8953 "setenv()\n"
8954 "setgrent()\n"
8955 "setkey()\n"
8956 "setpwent()\n"
8957 "setutxent()\n"
8958 "strerror()\n"
8959 "strsignal() [POSIX.1-2008 で追加された]\n"
8960 "strtok()\n"
8961 "system() [POSIX.1-2008 で追加された]\n"
8962 "tmpnam() (NULL でない引き数を渡された場合)\n"
8963 "ttyname()\n"
8964 "unsetenv()\n"
8965 "wcrtomb() (最後の引き数が NULL の場合)\n"
8966 "wcsrtombs() (最後の引き数が NULL の場合)\n"
8967 "wcstombs()\n"
8968 "wctomb()\n"
8969
8970 #. type: SS
8971 #: build/C/man7/pthreads.7:234
8972 #, no-wrap
8973 msgid "Async-cancel-safe functions"
8974 msgstr "async-cancel-safe 関数"
8975
8976 #. type: Plain text
8977 #: build/C/man7/pthreads.7:238
8978 msgid "An async-cancel-safe function is one that can be safely called in an application where asynchronous cancelability is enabled (see B<pthread_setcancelstate>(3))."
8979 msgstr ""
8980 "async-cancel-safe 関数は、\n"
8981 "非同期キャンセル機能が有効になっているアプリケーションで\n"
8982 "安全に呼び出すことができる関数のことである\n"
8983 "(B<pthread_setcancelstate>(3) を参照)。"
8984
8985 #. type: Plain text
8986 #: build/C/man7/pthreads.7:241
8987 msgid "Only the following functions are required to be async-cancel-safe by POSIX.1-2001 and POSIX.1-2008:"
8988 msgstr ""
8989 "以下の関数だけが、POSIX.1-2001 と POSIX.1-2008 で async-cancel-safe で\n"
8990 "なければならないとされている。"
8991
8992 #. type: Plain text
8993 #: build/C/man7/pthreads.7:247
8994 #, no-wrap
8995 msgid ""
8996 "pthread_cancel()\n"
8997 "pthread_setcancelstate()\n"
8998 "pthread_setcanceltype()\n"
8999 msgstr ""
9000 "pthread_cancel()\n"
9001 "pthread_setcancelstate()\n"
9002 "pthread_setcanceltype()\n"
9003
9004 #. type: SS
9005 #: build/C/man7/pthreads.7:249
9006 #, no-wrap
9007 msgid "Cancellation points"
9008 msgstr "取り消しポイント (cancellation points)"
9009
9010 #. type: Plain text
9011 #: build/C/man7/pthreads.7:256
9012 msgid "POSIX.1 specifies that certain functions must, and certain other functions may, be cancellation points.  If a thread is cancelable, its cancelability type is deferred, and a cancellation request is pending for the thread, then the thread is canceled when it calls a function that is a cancellation point."
9013 msgstr "POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、 他の特定の関数は取り消しポイントであってもよいとされている。 あるスレッドが取り消し可能で、その取り消し種別 (cancelability type)  が延期 (deferred) で、そのスレッドに対する取り消し要求が処理待ちの場合、 取り消しポイントである関数を呼び出した時点で、そのスレッドのキャンセルが 行われる。"
9014
9015 #. type: Plain text
9016 #: build/C/man7/pthreads.7:259
9017 msgid "The following functions are required to be cancellation points by POSIX.1-2001 and/or POSIX.1-2008:"
9018 msgstr "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数は、取り消しポイント (cancellation points) で あることが必須となっている。"
9019
9020 #. type: Plain text
9021 #: build/C/man7/pthreads.7:322
9022 #, no-wrap
9023 msgid ""
9024 "accept()\n"
9025 "aio_suspend()\n"
9026 "clock_nanosleep()\n"
9027 "close()\n"
9028 "connect()\n"
9029 "creat()\n"
9030 "fcntl() F_SETLKW\n"
9031 "fdatasync()\n"
9032 "fsync()\n"
9033 "getmsg()\n"
9034 "getpmsg()\n"
9035 "lockf() F_LOCK\n"
9036 "mq_receive()\n"
9037 "mq_send()\n"
9038 "mq_timedreceive()\n"
9039 "mq_timedsend()\n"
9040 "msgrcv()\n"
9041 "msgsnd()\n"
9042 "msync()\n"
9043 "nanosleep()\n"
9044 "open()\n"
9045 "openat() [Added in POSIX.1-2008]\n"
9046 "pause()\n"
9047 "poll()\n"
9048 "pread()\n"
9049 "pselect()\n"
9050 "pthread_cond_timedwait()\n"
9051 "pthread_cond_wait()\n"
9052 "pthread_join()\n"
9053 "pthread_testcancel()\n"
9054 "putmsg()\n"
9055 "putpmsg()\n"
9056 "pwrite()\n"
9057 "read()\n"
9058 "readv()\n"
9059 "recv()\n"
9060 "recvfrom()\n"
9061 "recvmsg()\n"
9062 "select()\n"
9063 "sem_timedwait()\n"
9064 "sem_wait()\n"
9065 "send()\n"
9066 "sendmsg()\n"
9067 "sendto()\n"
9068 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
9069 "sigsuspend()\n"
9070 "sigtimedwait()\n"
9071 "sigwait()\n"
9072 "sigwaitinfo()\n"
9073 "sleep()\n"
9074 "system()\n"
9075 "tcdrain()\n"
9076 "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n"
9077 "wait()\n"
9078 "waitid()\n"
9079 "waitpid()\n"
9080 "write()\n"
9081 "writev()\n"
9082 msgstr ""
9083 "accept()\n"
9084 "aio_suspend()\n"
9085 "clock_nanosleep()\n"
9086 "close()\n"
9087 "connect()\n"
9088 "creat()\n"
9089 "fcntl() F_SETLKW\n"
9090 "fdatasync()\n"
9091 "fsync()\n"
9092 "getmsg()\n"
9093 "getpmsg()\n"
9094 "lockf() F_LOCK\n"
9095 "mq_receive()\n"
9096 "mq_send()\n"
9097 "mq_timedreceive()\n"
9098 "mq_timedsend()\n"
9099 "msgrcv()\n"
9100 "msgsnd()\n"
9101 "msync()\n"
9102 "nanosleep()\n"
9103 "open()\n"
9104 "openat() [POSIX.1-2008 で追加された]\n"
9105 "pause()\n"
9106 "poll()\n"
9107 "pread()\n"
9108 "pselect()\n"
9109 "pthread_cond_timedwait()\n"
9110 "pthread_cond_wait()\n"
9111 "pthread_join()\n"
9112 "pthread_testcancel()\n"
9113 "putmsg()\n"
9114 "putpmsg()\n"
9115 "pwrite()\n"
9116 "read()\n"
9117 "readv()\n"
9118 "recv()\n"
9119 "recvfrom()\n"
9120 "recvmsg()\n"
9121 "select()\n"
9122 "sem_timedwait()\n"
9123 "sem_wait()\n"
9124 "send()\n"
9125 "sendmsg()\n"
9126 "sendto()\n"
9127 "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n"
9128 "sigsuspend()\n"
9129 "sigtimedwait()\n"
9130 "sigwait()\n"
9131 "sigwaitinfo()\n"
9132 "sleep()\n"
9133 "system()\n"
9134 "tcdrain()\n"
9135 "usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]\n"
9136 "wait()\n"
9137 "waitid()\n"
9138 "waitpid()\n"
9139 "write()\n"
9140 "writev()\n"
9141
9142 #. type: Plain text
9143 #: build/C/man7/pthreads.7:327
9144 msgid "The following functions may be cancellation points according to POSIX.1-2001 and/or POSIX.1-2008:"
9145 msgstr "POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、 以下の関数は、取り消しポイント (cancellation points) で あってもよいことになっている。"
9146
9147 #. type: Plain text
9148 #: build/C/man7/pthreads.7:555
9149 #, no-wrap
9150 msgid ""
9151 "access()\n"
9152 "asctime()\n"
9153 "asctime_r()\n"
9154 "catclose()\n"
9155 "catgets()\n"
9156 "catopen()\n"
9157 "chmod() [Added in POSIX.1-2008]\n"
9158 "chown() [Added in POSIX.1-2008]\n"
9159 "closedir()\n"
9160 "closelog()\n"
9161 "ctermid()\n"
9162 "ctime()\n"
9163 "ctime_r()\n"
9164 "dbm_close()\n"
9165 "dbm_delete()\n"
9166 "dbm_fetch()\n"
9167 "dbm_nextkey()\n"
9168 "dbm_open()\n"
9169 "dbm_store()\n"
9170 "dlclose()\n"
9171 "dlopen()\n"
9172 "dprintf() [Added in POSIX.1-2008]\n"
9173 "endgrent()\n"
9174 "endhostent()\n"
9175 "endnetent()\n"
9176 "endprotoent()\n"
9177 "endpwent()\n"
9178 "endservent()\n"
9179 "endutxent()\n"
9180 "faccessat() [Added in POSIX.1-2008]\n"
9181 "fchmod() [Added in POSIX.1-2008]\n"
9182 "fchmodat() [Added in POSIX.1-2008]\n"
9183 "fchown() [Added in POSIX.1-2008]\n"
9184 "fchownat() [Added in POSIX.1-2008]\n"
9185 "fclose()\n"
9186 "fcntl() (for any value of cmd argument)\n"
9187 "fflush()\n"
9188 "fgetc()\n"
9189 "fgetpos()\n"
9190 "fgets()\n"
9191 "fgetwc()\n"
9192 "fgetws()\n"
9193 "fmtmsg()\n"
9194 "fopen()\n"
9195 "fpathconf()\n"
9196 "fprintf()\n"
9197 "fputc()\n"
9198 "fputs()\n"
9199 "fputwc()\n"
9200 "fputws()\n"
9201 "fread()\n"
9202 "freopen()\n"
9203 "fscanf()\n"
9204 "fseek()\n"
9205 "fseeko()\n"
9206 "fsetpos()\n"
9207 "fstat()\n"
9208 "fstatat() [Added in POSIX.1-2008]\n"
9209 "ftell()\n"
9210 "ftello()\n"
9211 "ftw()\n"
9212 "futimens() [Added in POSIX.1-2008]\n"
9213 "fwprintf()\n"
9214 "fwrite()\n"
9215 "fwscanf()\n"
9216 "getaddrinfo()\n"
9217 "getc()\n"
9218 "getc_unlocked()\n"
9219 "getchar()\n"
9220 "getchar_unlocked()\n"
9221 "getcwd()\n"
9222 "getdate()\n"
9223 "getdelim() [Added in POSIX.1-2008]\n"
9224 "getgrent()\n"
9225 "getgrgid()\n"
9226 "getgrgid_r()\n"
9227 "getgrnam()\n"
9228 "getgrnam_r()\n"
9229 "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n"
9230 "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n"
9231 "gethostent()\n"
9232 "gethostid()\n"
9233 "gethostname()\n"
9234 "getline() [Added in POSIX.1-2008]\n"
9235 "getlogin()\n"
9236 "getlogin_r()\n"
9237 "getnameinfo()\n"
9238 "getnetbyaddr()\n"
9239 "getnetbyname()\n"
9240 "getnetent()\n"
9241 "getopt() (if opterr is nonzero)\n"
9242 "getprotobyname()\n"
9243 "getprotobynumber()\n"
9244 "getprotoent()\n"
9245 "getpwent()\n"
9246 "getpwnam()\n"
9247 "getpwnam_r()\n"
9248 "getpwuid()\n"
9249 "getpwuid_r()\n"
9250 "gets()\n"
9251 "getservbyname()\n"
9252 "getservbyport()\n"
9253 "getservent()\n"
9254 "getutxent()\n"
9255 "getutxid()\n"
9256 "getutxline()\n"
9257 "getwc()\n"
9258 "getwchar()\n"
9259 "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n"
9260 "glob()\n"
9261 "iconv_close()\n"
9262 "iconv_open()\n"
9263 "ioctl()\n"
9264 "link()\n"
9265 "linkat() [Added in POSIX.1-2008]\n"
9266 "lio_listio() [Added in POSIX.1-2008]\n"
9267 "localtime()\n"
9268 "localtime_r()\n"
9269 "lockf() [Added in POSIX.1-2008]\n"
9270 "lseek()\n"
9271 "lstat()\n"
9272 "mkdir() [Added in POSIX.1-2008]\n"
9273 "mkdirat() [Added in POSIX.1-2008]\n"
9274 "mkdtemp() [Added in POSIX.1-2008]\n"
9275 "mkfifo() [Added in POSIX.1-2008]\n"
9276 "mkfifoat() [Added in POSIX.1-2008]\n"
9277 "mknod() [Added in POSIX.1-2008]\n"
9278 "mknodat() [Added in POSIX.1-2008]\n"
9279 "mkstemp()\n"
9280 "mktime()\n"
9281 "nftw()\n"
9282 "opendir()\n"
9283 "openlog()\n"
9284 "pathconf()\n"
9285 "pclose()\n"
9286 "perror()\n"
9287 "popen()\n"
9288 "posix_fadvise()\n"
9289 "posix_fallocate()\n"
9290 "posix_madvise()\n"
9291 "posix_openpt()\n"
9292 "posix_spawn()\n"
9293 "posix_spawnp()\n"
9294 "posix_trace_clear()\n"
9295 "posix_trace_close()\n"
9296 "posix_trace_create()\n"
9297 "posix_trace_create_withlog()\n"
9298 "posix_trace_eventtypelist_getnext_id()\n"
9299 "posix_trace_eventtypelist_rewind()\n"
9300 "posix_trace_flush()\n"
9301 "posix_trace_get_attr()\n"
9302 "posix_trace_get_filter()\n"
9303 "posix_trace_get_status()\n"
9304 "posix_trace_getnext_event()\n"
9305 "posix_trace_open()\n"
9306 "posix_trace_rewind()\n"
9307 "posix_trace_set_filter()\n"
9308 "posix_trace_shutdown()\n"
9309 "posix_trace_timedgetnext_event()\n"
9310 "posix_typed_mem_open()\n"
9311 "printf()\n"
9312 "psiginfo() [Added in POSIX.1-2008]\n"
9313 "psignal() [Added in POSIX.1-2008]\n"
9314 "pthread_rwlock_rdlock()\n"
9315 "pthread_rwlock_timedrdlock()\n"
9316 "pthread_rwlock_timedwrlock()\n"
9317 "pthread_rwlock_wrlock()\n"
9318 "putc()\n"
9319 "putc_unlocked()\n"
9320 "putchar()\n"
9321 "putchar_unlocked()\n"
9322 "puts()\n"
9323 "pututxline()\n"
9324 "putwc()\n"
9325 "putwchar()\n"
9326 "readdir()\n"
9327 "readdir_r()\n"
9328 "readlink() [Added in POSIX.1-2008]\n"
9329 "readlinkat() [Added in POSIX.1-2008]\n"
9330 "remove()\n"
9331 "rename()\n"
9332 "renameat() [Added in POSIX.1-2008]\n"
9333 "rewind()\n"
9334 "rewinddir()\n"
9335 "scandir() [Added in POSIX.1-2008]\n"
9336 "scanf()\n"
9337 "seekdir()\n"
9338 "semop()\n"
9339 "setgrent()\n"
9340 "sethostent()\n"
9341 "setnetent()\n"
9342 "setprotoent()\n"
9343 "setpwent()\n"
9344 "setservent()\n"
9345 "setutxent()\n"
9346 "sigpause() [Added in POSIX.1-2008]\n"
9347 "stat()\n"
9348 "strerror()\n"
9349 "strerror_r()\n"
9350 "strftime()\n"
9351 "symlink()\n"
9352 "symlinkat() [Added in POSIX.1-2008]\n"
9353 "sync()\n"
9354 "syslog()\n"
9355 "tmpfile()\n"
9356 "tmpnam()\n"
9357 "ttyname()\n"
9358 "ttyname_r()\n"
9359 "tzset()\n"
9360 "ungetc()\n"
9361 "ungetwc()\n"
9362 "unlink()\n"
9363 "unlinkat() [Added in POSIX.1-2008]\n"
9364 "utime() [Added in POSIX.1-2008]\n"
9365 "utimensat() [Added in POSIX.1-2008]\n"
9366 "utimes() [Added in POSIX.1-2008]\n"
9367 "vdprintf() [Added in POSIX.1-2008]\n"
9368 "vfprintf()\n"
9369 "vfwprintf()\n"
9370 "vprintf()\n"
9371 "vwprintf()\n"
9372 "wcsftime()\n"
9373 "wordexp()\n"
9374 "wprintf()\n"
9375 "wscanf()\n"
9376 msgstr ""
9377 "access()\n"
9378 "asctime()\n"
9379 "asctime_r()\n"
9380 "catclose()\n"
9381 "catgets()\n"
9382 "catopen()\n"
9383 "chmod() [POSIX.1-2008 で追加された]\n"
9384 "chown() [POSIX.1-2008 で追加された]\n"
9385 "closedir()\n"
9386 "closelog()\n"
9387 "ctermid()\n"
9388 "ctime()\n"
9389 "ctime_r()\n"
9390 "dbm_close()\n"
9391 "dbm_delete()\n"
9392 "dbm_fetch()\n"
9393 "dbm_nextkey()\n"
9394 "dbm_open()\n"
9395 "dbm_store()\n"
9396 "dlclose()\n"
9397 "dlopen()\n"
9398 "dprintf() [POSIX.1-2008 で追加された]\n"
9399 "endgrent()\n"
9400 "endhostent()\n"
9401 "endnetent()\n"
9402 "endprotoent()\n"
9403 "endpwent()\n"
9404 "endservent()\n"
9405 "endutxent()\n"
9406 "faccessat() [POSIX.1-2008 で追加された]\n"
9407 "fchmod() [POSIX.1-2008 で追加された]\n"
9408 "fchmodat() [POSIX.1-2008 で追加された]\n"
9409 "fchown() [POSIX.1-2008 で追加された]\n"
9410 "fchownat() [POSIX.1-2008 で追加された]\n"
9411 "fclose()\n"
9412 "fcntl() (cmd 引き数が何であっても)\n"
9413 "fflush()\n"
9414 "fgetc()\n"
9415 "fgetpos()\n"
9416 "fgets()\n"
9417 "fgetwc()\n"
9418 "fgetws()\n"
9419 "fmtmsg()\n"
9420 "fopen()\n"
9421 "fpathconf()\n"
9422 "fprintf()\n"
9423 "fputc()\n"
9424 "fputs()\n"
9425 "fputwc()\n"
9426 "fputws()\n"
9427 "fread()\n"
9428 "freopen()\n"
9429 "fscanf()\n"
9430 "fseek()\n"
9431 "fseeko()\n"
9432 "fsetpos()\n"
9433 "fstat()\n"
9434 "fstatat() [POSIX.1-2008 で追加された]\n"
9435 "ftell()\n"
9436 "ftello()\n"
9437 "ftw()\n"
9438 "futimens() [POSIX.1-2008 で追加された]\n"
9439 "fwprintf()\n"
9440 "fwrite()\n"
9441 "fwscanf()\n"
9442 "getaddrinfo()\n"
9443 "getc()\n"
9444 "getc_unlocked()\n"
9445 "getchar()\n"
9446 "getchar_unlocked()\n"
9447 "getcwd()\n"
9448 "getdate()\n"
9449 "getdelim() [POSIX.1-2008 で追加された]\n"
9450 "getgrent()\n"
9451 "getgrgid()\n"
9452 "getgrgid_r()\n"
9453 "getgrnam()\n"
9454 "getgrnam_r()\n"
9455 "gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9456 "gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9457 "gethostent()\n"
9458 "gethostid()\n"
9459 "gethostname()\n"
9460 "getline() [POSIX.1-2008 で追加された]\n"
9461 "getlogin()\n"
9462 "getlogin_r()\n"
9463 "getnameinfo()\n"
9464 "getnetbyaddr()\n"
9465 "getnetbyname()\n"
9466 "getnetent()\n"
9467 "getopt() (opterr が 0 以外の場合)\n"
9468 "getprotobyname()\n"
9469 "getprotobynumber()\n"
9470 "getprotoent()\n"
9471 "getpwent()\n"
9472 "getpwnam()\n"
9473 "getpwnam_r()\n"
9474 "getpwuid()\n"
9475 "getpwuid_r()\n"
9476 "gets()\n"
9477 "getservbyname()\n"
9478 "getservbyport()\n"
9479 "getservent()\n"
9480 "getutxent()\n"
9481 "getutxid()\n"
9482 "getutxline()\n"
9483 "getwc()\n"
9484 "getwchar()\n"
9485 "getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]\n"
9486 "glob()\n"
9487 "iconv_close()\n"
9488 "iconv_open()\n"
9489 "ioctl()\n"
9490 "link()\n"
9491 "linkat() [POSIX.1-2008 で追加された]\n"
9492 "lio_listio() [POSIX.1-2008 で追加された]\n"
9493 "localtime()\n"
9494 "localtime_r()\n"
9495 "lockf() [POSIX.1-2008 で追加された]\n"
9496 "lseek()\n"
9497 "lstat()\n"
9498 "mkdir() [POSIX.1-2008 で追加された]\n"
9499 "mkdirat() [POSIX.1-2008 で追加された]\n"
9500 "mkdtemp() [POSIX.1-2008 で追加された]\n"
9501 "mkfifo() [POSIX.1-2008 で追加された]\n"
9502 "mkfifoat() [POSIX.1-2008 で追加された]\n"
9503 "mknod() [POSIX.1-2008 で追加された]\n"
9504 "mknodat() [POSIX.1-2008 で追加された]\n"
9505 "mkstemp()\n"
9506 "mktime()\n"
9507 "nftw()\n"
9508 "opendir()\n"
9509 "openlog()\n"
9510 "pathconf()\n"
9511 "pclose()\n"
9512 "perror()\n"
9513 "popen()\n"
9514 "posix_fadvise()\n"
9515 "posix_fallocate()\n"
9516 "posix_madvise()\n"
9517 "posix_openpt()\n"
9518 "posix_spawn()\n"
9519 "posix_spawnp()\n"
9520 "posix_trace_clear()\n"
9521 "posix_trace_close()\n"
9522 "posix_trace_create()\n"
9523 "posix_trace_create_withlog()\n"
9524 "posix_trace_eventtypelist_getnext_id()\n"
9525 "posix_trace_eventtypelist_rewind()\n"
9526 "posix_trace_flush()\n"
9527 "posix_trace_get_attr()\n"
9528 "posix_trace_get_filter()\n"
9529 "posix_trace_get_status()\n"
9530 "posix_trace_getnext_event()\n"
9531 "posix_trace_open()\n"
9532 "posix_trace_rewind()\n"
9533 "posix_trace_set_filter()\n"
9534 "posix_trace_shutdown()\n"
9535 "posix_trace_timedgetnext_event()\n"
9536 "posix_typed_mem_open()\n"
9537 "printf()\n"
9538 "psiginfo() [POSIX.1-2008 で追加された]\n"
9539 "psignal() [POSIX.1-2008 で追加された]\n"
9540 "pthread_rwlock_rdlock()\n"
9541 "pthread_rwlock_timedrdlock()\n"
9542 "pthread_rwlock_timedwrlock()\n"
9543 "pthread_rwlock_wrlock()\n"
9544 "putc()\n"
9545 "putc_unlocked()\n"
9546 "putchar()\n"
9547 "putchar_unlocked()\n"
9548 "puts()\n"
9549 "pututxline()\n"
9550 "putwc()\n"
9551 "putwchar()\n"
9552 "readdir()\n"
9553 "readdir_r()\n"
9554 "readlink() [POSIX.1-2008 で追加された]\n"
9555 "readlinkat() [POSIX.1-2008 で追加された]\n"
9556 "remove()\n"
9557 "rename()\n"
9558 "renameat() [POSIX.1-2008 で追加された]\n"
9559 "rewind()\n"
9560 "rewinddir()\n"
9561 "scandir() [POSIX.1-2008 で追加された]\n"
9562 "scanf()\n"
9563 "seekdir()\n"
9564 "semop()\n"
9565 "setgrent()\n"
9566 "sethostent()\n"
9567 "setnetent()\n"
9568 "setprotoent()\n"
9569 "setpwent()\n"
9570 "setservent()\n"
9571 "setutxent()\n"
9572 "sigpause() [POSIX.1-2008 で追加された]\n"
9573 "stat()\n"
9574 "strerror()\n"
9575 "strerror_r()\n"
9576 "strftime()\n"
9577 "symlink()\n"
9578 "symlinkat() [POSIX.1-2008 で追加された]\n"
9579 "sync()\n"
9580 "syslog()\n"
9581 "tmpfile()\n"
9582 "tmpnam()\n"
9583 "ttyname()\n"
9584 "ttyname_r()\n"
9585 "tzset()\n"
9586 "ungetc()\n"
9587 "ungetwc()\n"
9588 "unlink()\n"
9589 "unlinkat() [POSIX.1-2008 で追加された]\n"
9590 "utime() [POSIX.1-2008 で追加された]\n"
9591 "utimensat() [POSIX.1-2008 で追加された]\n"
9592 "utimes() [POSIX.1-2008 で追加された]\n"
9593 "vdprintf() [POSIX.1-2008 で追加された]\n"
9594 "vfprintf()\n"
9595 "vfwprintf()\n"
9596 "vprintf()\n"
9597 "vwprintf()\n"
9598 "wcsftime()\n"
9599 "wordexp()\n"
9600 "wprintf()\n"
9601 "wscanf()\n"
9602
9603 #.  So, scanning "cancellation point" comments in the glibc 2.8 header
9604 #.  files, it looks as though at least the following nonstandard
9605 #.  functions are cancellation points:
9606 #.  endnetgrent
9607 #.  endspent
9608 #.  epoll_pwait
9609 #.  epoll_wait
9610 #.  fcloseall
9611 #.  fdopendir
9612 #.  fflush_unlocked
9613 #.  fgetc_unlocked
9614 #.  fgetgrent
9615 #.  fgetgrent_r
9616 #.  fgetpwent
9617 #.  fgetpwent_r
9618 #.  fgets_unlocked
9619 #.  fgetspent
9620 #.  fgetspent_r
9621 #.  fgetwc_unlocked
9622 #.  fgetws_unlocked
9623 #.  fputc_unlocked
9624 #.  fputs_unlocked
9625 #.  fputwc_unlocked
9626 #.  fputws_unlocked
9627 #.  fread_unlocked
9628 #.  fwrite_unlocked
9629 #.  gai_suspend
9630 #.  getaddrinfo_a
9631 #.  getdate_r
9632 #.  getgrent_r
9633 #.  getgrouplist
9634 #.  gethostbyaddr_r
9635 #.  gethostbyname2
9636 #.  gethostbyname2_r
9637 #.  gethostbyname_r
9638 #.  gethostent_r
9639 #.  getnetbyaddr_r
9640 #.  getnetbyname_r
9641 #.  getnetent_r
9642 #.  getnetgrent
9643 #.  getnetgrent_r
9644 #.  getprotobyname_r
9645 #.  getprotobynumber_r
9646 #.  getprotoent_r
9647 #.  getpw
9648 #.  getpwent_r
9649 #.  getservbyname_r
9650 #.  getservbyport_r
9651 #.  getservent_r
9652 #.  getspent
9653 #.  getspent_r
9654 #.  getspnam
9655 #.  getspnam_r
9656 #.  getutmp
9657 #.  getutmpx
9658 #.  getw
9659 #.  getwc_unlocked
9660 #.  getwchar_unlocked
9661 #.  initgroups
9662 #.  innetgr
9663 #.  mkostemp
9664 #.  mkostemp64
9665 #.  mkstemp64
9666 #.  ppoll
9667 #.  pthread_timedjoin_np
9668 #.  putgrent
9669 #.  putpwent
9670 #.  putspent
9671 #.  putw
9672 #.  putwc_unlocked
9673 #.  putwchar_unlocked
9674 #.  rcmd
9675 #.  rcmd_af
9676 #.  rexec
9677 #.  rexec_af
9678 #.  rresvport
9679 #.  rresvport_af
9680 #.  ruserok
9681 #.  ruserok_af
9682 #.  setnetgrent
9683 #.  setspent
9684 #.  sgetspent
9685 #.  sgetspent_r
9686 #.  updwtmpx
9687 #.  utmpxname
9688 #.  vfscanf
9689 #.  vfwscanf
9690 #.  vscanf
9691 #.  vsyslog
9692 #.  vwscanf
9693 #. type: Plain text
9694 #: build/C/man7/pthreads.7:653
9695 msgid "An implementation may also mark other functions not specified in the standard as cancellation points.  In particular, an implementation is likely to mark any nonstandard function that may block as a cancellation point.  (This includes most functions that can touch files.)"
9696 msgstr "実装時に、標準規格で規定されていないその他の関数を取り消しポイント とすることも認められている。 特に、停止 (block) する可能性がある非標準の関数を取り消しポイントと する実装はあり得ることだろう (ファイルを扱う可能性のあるほとんどの関数がこれに含まれる)。"
9697
9698 #. type: SS
9699 #: build/C/man7/pthreads.7:653
9700 #, no-wrap
9701 msgid "Compiling on Linux"
9702 msgstr "Linux でのコンパイル"
9703
9704 #. type: Plain text
9705 #: build/C/man7/pthreads.7:656
9706 msgid "On Linux, programs that use the Pthreads API should be compiled using I<cc -pthread>."
9707 msgstr "Linux では、Pthreads API を用いたプログラムは I<cc -pthread> でコンパイルすべきである。"
9708
9709 #. type: SS
9710 #: build/C/man7/pthreads.7:656
9711 #, no-wrap
9712 msgid "Linux implementations of POSIX threads"
9713 msgstr "POSIX スレッドの Linux での実装"
9714
9715 #. type: Plain text
9716 #: build/C/man7/pthreads.7:659
9717 msgid "Over time, two threading implementations have been provided by the GNU C library on Linux:"
9718 msgstr "これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより 提供されてきた。"
9719
9720 #. type: TP
9721 #: build/C/man7/pthreads.7:659
9722 #, no-wrap
9723 msgid "B<LinuxThreads>"
9724 msgstr "B<LinuxThreads>"
9725
9726 #. type: Plain text
9727 #: build/C/man7/pthreads.7:663
9728 msgid "This is the original Pthreads implementation.  Since glibc 2.4, this implementation is no longer supported."
9729 msgstr ""
9730 "最初の Pthreads の実装。\n"
9731 "glibc 2.4 以降は、この実装はもはやサポートされていない。"
9732
9733 #. type: TP
9734 #: build/C/man7/pthreads.7:663
9735 #, no-wrap
9736 msgid "B<NPTL> (Native POSIX Threads Library)"
9737 msgstr "B<NPTL> (Native POSIX Threads Library)"
9738
9739 #. type: Plain text
9740 #: build/C/man7/pthreads.7:671
9741 msgid "This is the modern Pthreads implementation.  By comparison with LinuxThreads, NPTL provides closer conformance to the requirements of the POSIX.1 specification and better performance when creating large numbers of threads.  NPTL is available since glibc 2.3.2, and requires features that are present in the Linux 2.6 kernel."
9742 msgstr "新しい Pthreads の実装。LinuxThreads と比べると、 NPTL は POSIX.1 の要求仕様への準拠の度合いが高く、 多数のスレッドを作成した際の性能も高い。 NPTL は glibc 2.3.2 以降で利用可能である。 NPTL を利用するには Linux 2.6 カーネルに実装されている機能が必要である。"
9743
9744 #. type: Plain text
9745 #: build/C/man7/pthreads.7:681
9746 msgid "Both of these are so-called 1:1 implementations, meaning that each thread maps to a kernel scheduling entity.  Both threading implementations employ the Linux B<clone>(2)  system call.  In NPTL, thread synchronization primitives (mutexes, thread joining, and so on) are implemented using the Linux B<futex>(2)  system call."
9747 msgstr "どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが カーネルのスケジューリング実体にマッピングされる。 どちらのスレッドの実装も Linux の B<clone>(2)  システムコールを利用している。 NPTL では、スレッド同期の基本機構 (mutex や スレッドの join 等) は Linux の B<futex>(2)  システムコールを使って実装されている。"
9748
9749 #. type: SS
9750 #: build/C/man7/pthreads.7:681
9751 #, no-wrap
9752 msgid "LinuxThreads"
9753 msgstr "LinuxThreads"
9754
9755 #. type: Plain text
9756 #: build/C/man7/pthreads.7:683
9757 msgid "The notable features of this implementation are the following:"
9758 msgstr "この実装の大きな特徴は以下の通りである:"
9759
9760 #. type: Plain text
9761 #: build/C/man7/pthreads.7:690
9762 msgid "In addition to the main (initial) thread, and the threads that the program creates using B<pthread_create>(3), the implementation creates a \"manager\" thread.  This thread handles thread creation and termination.  (Problems can result if this thread is inadvertently killed.)"
9763 msgstr "メインスレッド (最初のスレッド) とプログラムが B<pthread_create>(3)  を使って作成したスレッドに加え、 この実装では「管理 (manager)」スレッドが作成される。 管理スレッドはスレッドの作成と終了を取り扱う (このスレッドがうっかり kill されると、問題が起こることがある)。"
9764
9765 #. type: Plain text
9766 #: build/C/man7/pthreads.7:702
9767 msgid "Signals are used internally by the implementation.  On Linux 2.2 and later, the first three real-time signals are used (see also B<signal>(7)).  On older Linux kernels, B<SIGUSR1> and B<SIGUSR2> are used.  Applications must avoid the use of whichever set of signals is employed by the implementation."
9768 msgstr "この実装では内部でシグナルを使用している。 Linux 2.2 以降では、リアルタイムシグナルのうち最初の 3つが使われる (B<signal>(7)  参照)。 それ以前のカーネルでは B<SIGUSR1> と B<SIGUSR2> が使われる。 アプリケーションは、スレッド実装で利用されているシグナルを どれも使わないようにしなければならない。"
9769
9770 #. type: Plain text
9771 #: build/C/man7/pthreads.7:709
9772 msgid "Threads do not share process IDs.  (In effect, LinuxThreads threads are implemented as processes which share more information than usual, but which do not share a common process ID.)  LinuxThreads threads (including the manager thread)  are visible as separate processes using B<ps>(1)."
9773 msgstr "スレッド間でプロセス ID を共有しない (実際には LinuxThreads のスレッドは通常よりは情報を共有するプロセスとして 実装されているが、一つの共通のプロセス ID を共有してはいない)。 (管理スレッドを含む) LinuxThreads スレッドは B<ps>(1)  を使うと別のプロセスのように見える。"
9774
9775 #. type: Plain text
9776 #: build/C/man7/pthreads.7:712
9777 msgid "The LinuxThreads implementation deviates from the POSIX.1 specification in a number of ways, including the following:"
9778 msgstr "LinuxThreads の実装では POSIX.1 仕様から逸脱している点が いくつかある。以下に示すような点がある:"
9779
9780 #. type: Plain text
9781 #: build/C/man7/pthreads.7:716
9782 msgid "Calls to B<getpid>(2)  return a different value in each thread."
9783 msgstr "B<getpid>(2)  を呼び出したときに、スレッド毎に異なる値が返される。"
9784
9785 #. type: Plain text
9786 #: build/C/man7/pthreads.7:725
9787 msgid "Calls to B<getppid>(2)  in threads other than the main thread return the process ID of the manager thread; instead B<getppid>(2)  in these threads should return the same value as B<getppid>(2)  in the main thread."
9788 msgstr "メインスレッド以外のスレッドで B<getppid>(2)  を呼び出すと、管理スレッドのプロセス ID が返される。 本当は、これらのスレッドで B<getppid>(2)  を呼んだ場合にはメインスレッドでの B<getppid>(2)  と同じ値が返るべきである。"
9789
9790 #. type: Plain text
9791 #: build/C/man7/pthreads.7:735
9792 msgid "When one thread creates a new child process using B<fork>(2), any thread should be able to B<wait>(2)  on the child.  However, the implementation only allows the thread that created the child to B<wait>(2)  on it."
9793 msgstr "あるスレッドが B<fork>(2)  を使って新しい子プロセスを作成した場合、 どのスレッドでもこの子プロセスを B<wait>(2)  できるべきである。しかしながら、この実装では子プロセスを作成した スレッドだけがこの子プロセスを B<wait>(2)  できる。"
9794
9795 #. type: Plain text
9796 #: build/C/man7/pthreads.7:742
9797 msgid "When a thread calls B<execve>(2), all other threads are terminated (as required by POSIX.1).  However, the resulting process has the same PID as the thread that called B<execve>(2): it should have the same PID as the main thread."
9798 msgstr "あるスレッドが B<execve>(2)  を呼び出した場合、他のスレッドは全て終了される (POSIX.1 の仕様通り)。 しかしながら、新しいプロセスは B<execve>(2)  を呼んだスレッドと同じ PID を持つ。正しくは メインスレッドと同じ PID を持つべきである。"
9799
9800 #. type: Plain text
9801 #: build/C/man7/pthreads.7:749
9802 msgid "Threads do not share user and group IDs.  This can cause complications with set-user-ID programs and can cause failures in Pthreads functions if an application changes its credentials using B<seteuid>(2)  or similar."
9803 msgstr "スレッド間でユーザー ID とグループ ID が共有されない このことは、set-user-ID プログラムで面倒な事態を招いたり、 アプリケーションが B<seteuid>(2)  などを使って信用情報 (credentials) を変更した場合に Pthreads 関数が失敗する原因となる。"
9804
9805 #. type: Plain text
9806 #: build/C/man7/pthreads.7:751
9807 msgid "Threads do not share a common session ID and process group ID."
9808 msgstr "スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。"
9809
9810 #. type: Plain text
9811 #: build/C/man7/pthreads.7:754
9812 msgid "Threads do not share record locks created using B<fcntl>(2)."
9813 msgstr "スレッド間で B<fcntl>(2)  を使って作成されるレコードロックを共有しない。"
9814
9815 #. type: Plain text
9816 #: build/C/man7/pthreads.7:760
9817 msgid "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread rather than process-wide."
9818 msgstr "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド単位の情報である。"
9819
9820 #. type: Plain text
9821 #: build/C/man7/pthreads.7:763
9822 msgid "Threads do not share semaphore undo values (see B<semop>(2))."
9823 msgstr "スレッド間でセマフォのアンドゥ値 (B<semop>(2)  参照) を共有しない。"
9824
9825 #. type: Plain text
9826 #: build/C/man7/pthreads.7:765
9827 msgid "Threads do not share interval timers."
9828 msgstr "スレッド間でインターバルタイマーを共有しない。"
9829
9830 #.  FIXME . bug report filed for NPTL nice nonconformance
9831 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6258
9832 #.  Sep 08: there is a patch by Denys Vlasenko to address this
9833 #.  "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
9834 #.  Monitor this to see if it makes it into mainline.
9835 #. type: Plain text
9836 #: build/C/man7/pthreads.7:767 build/C/man7/pthreads.7:804
9837 msgid "Threads do not share a common nice value."
9838 msgstr "スレッドは共通の nice 値を共有しない。"
9839
9840 #. type: Plain text
9841 #: build/C/man7/pthreads.7:777
9842 msgid "POSIX.1 distinguishes the notions of signals that are directed to the process as a whole and signals that are directed to individual threads.  According to POSIX.1, a process-directed signal (sent using B<kill>(2), for example) should be handled by a single, arbitrarily selected thread within the process.  LinuxThreads does not support the notion of process-directed signals: signals may be sent only to specific threads."
9843 msgstr "POSXI.1 では、全体としてのプロセスに送られるシグナルと、 個別のスレッドに送られるシグナルを区別して考えている。 POSIX.1 によると、プロセスに送られたシグナル (例えば B<kill>(2)  を使って送る) は、そのプロセスに属すスレッドのうち 勝手に (arbitrarily) に選択された一つのスレッドにより処理される ことになっている。LinuxThreads はプロセスに送られるシグナルの 概念に対応しておらず、シグナルは特定のスレッドにだけ送ることができる。"
9844
9845 #. type: Plain text
9846 #: build/C/man7/pthreads.7:786
9847 msgid "Threads have distinct alternate signal stack settings.  However, a new thread's alternate signal stack settings are copied from the thread that created it, so that the threads initially share an alternate signal stack.  (A new thread should start with no alternate signal stack defined.  If two threads handle signals on their shared alternate signal stack at the same time, unpredictable program failures are likely to occur.)"
9848 msgstr "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいスレッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピーされ、そのため スレッドは最初は一つの代替シグナルスタックを共有する。 (仕様では、新しいスレッドは代替シグナルスタックが定義されていない状態 で開始されるべきとされている。 2つのスレッドが共有されている代替シグナルスタック上で同時に シグナルの処理を行った場合、予測不可能なプログラムのエラーが 起こり得る。)"
9849
9850 #. type: SS
9851 #: build/C/man7/pthreads.7:786
9852 #, no-wrap
9853 msgid "NPTL"
9854 msgstr "NPTL"
9855
9856 #. type: Plain text
9857 #: build/C/man7/pthreads.7:795
9858 msgid "With NPTL, all of the threads in a process are placed in the same thread group; all members of a thread group share the same PID.  NPTL does not employ a manager thread.  NPTL makes internal use of the first two real-time signals (see also B<signal>(7)); these signals cannot be used in applications."
9859 msgstr "NPTL では、一つのプロセスの全てのスレッドは同じスレッドグループ に属する; スレッドグループの全メンバーは同じ PID を共有する。 NPTL は管理スレッド (manager thread) を利用しない。 NPTL は内部でリアルタイムシグナルのうち最初の 2つの番号を使用しており (B<signal>(7)  参照)、これらのシグナルはアプリケーションでは使用できない。"
9860
9861 #. type: Plain text
9862 #: build/C/man7/pthreads.7:797
9863 msgid "NPTL still has at least one nonconformance with POSIX.1:"
9864 msgstr "NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:"
9865
9866 #. type: Plain text
9867 #: build/C/man7/pthreads.7:806
9868 msgid "Some NPTL nonconformances occur only with older kernels:"
9869 msgstr "NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:"
9870
9871 #. type: Plain text
9872 #: build/C/man7/pthreads.7:812
9873 msgid "The information returned by B<times>(2)  and B<getrusage>(2)  is per-thread rather than process-wide (fixed in kernel 2.6.9)."
9874 msgstr "B<times>(2)  と B<getrusage>(2)  が返す情報がプロセス全体の情報でなくスレッド単位の情報である (カーネル 2.6.9 で修正された)。"
9875
9876 #. type: Plain text
9877 #: build/C/man7/pthreads.7:814
9878 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)."
9879 msgstr "スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。"
9880
9881 #. type: Plain text
9882 #: build/C/man7/pthreads.7:816
9883 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)."
9884 msgstr "スレッド間でインターバルタイマーを共有しない (カーネル 2.6.12 で修正された)。"
9885
9886 #. type: Plain text
9887 #: build/C/man7/pthreads.7:820
9888 msgid "Only the main thread is permitted to start a new session using B<setsid>(2)  (fixed in kernel 2.6.16)."
9889 msgstr "メインスレッドだけが B<setsid>(2)  を使って新しいセッションを開始することができる (カーネル 2.6.16 で修正された)。"
9890
9891 #. type: Plain text
9892 #: build/C/man7/pthreads.7:825
9893 msgid "Only the main thread is permitted to make the process into a process group leader using B<setpgid>(2)  (fixed in kernel 2.6.16)."
9894 msgstr "メインスレッドだけが B<setpgid>(2)  を使ってそのプロセスをプロセスグループリーダーにすることができる (カーネル 2.6.16 で修正された)。"
9895
9896 #. type: Plain text
9897 #: build/C/man7/pthreads.7:831
9898 msgid "Threads have distinct alternate signal stack settings.  However, a new thread's alternate signal stack settings are copied from the thread that created it, so that the threads initially share an alternate signal stack (fixed in kernel 2.6.16)."
9899 msgstr "スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。 しかし、新しいスレッドの代替シグナルスタックの設定は そのスレッドを作成したスレッドからコピーされ、そのため スレッドは最初は一つの代替シグナルスタックを共有する (カーネル 2.6.16 で修正された)。"
9900
9901 #. type: Plain text
9902 #: build/C/man7/pthreads.7:833
9903 msgid "Note the following further points about the NPTL implementation:"
9904 msgstr "NPTL の実装では以下の点についても注意すること:"
9905
9906 #. type: Plain text
9907 #: build/C/man7/pthreads.7:847
9908 msgid "If the stack size soft resource limit (see the description of B<RLIMIT_STACK> in B<setrlimit>(2))  is set to a value other than I<unlimited>, then this value defines the default stack size for new threads.  To be effective, this limit must be set before the program is executed, perhaps using the I<ulimit -s> shell built-in command (I<limit stacksize> in the C shell)."
9909 msgstr "スタックサイズのリソースのソフトリミット (B<setrlimit>(2)  の B<RLIMIT_STACK> の説明を参照) が I<unlimited> 以外の値に設定されている場合、ソフトリミットの値が 新しいスレッドのデフォルトのスタックサイズとなる。 設定を有効にするためには、プログラムを実行する前にリミット値を 設定しておかなければならない。たいていは、シェルの組み込みコマンドの I<ulimit -s> (C シェルでは I<limit stacksize>)  を使って設定する。"
9910
9911 #. type: SS
9912 #: build/C/man7/pthreads.7:847
9913 #, no-wrap
9914 msgid "Determining the threading implementation"
9915 msgstr "スレッド実装の判定"
9916
9917 #. type: Plain text
9918 #: build/C/man7/pthreads.7:852
9919 msgid "Since glibc 2.3.2, the B<getconf>(1)  command can be used to determine the system's threading implementation, for example:"
9920 msgstr "glibc 2.3.2 以降では、 B<getconf>(1)  コマンドを使って、 システムのスレッド実装を判定することができる。 以下に例を示す:"
9921
9922 #. type: Plain text
9923 #: build/C/man7/pthreads.7:857
9924 #, no-wrap
9925 msgid ""
9926 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
9927 "NPTL 2.3.4\n"
9928 msgstr ""
9929 "bash$ getconf GNU_LIBPTHREAD_VERSION\n"
9930 "NPTL 2.3.4\n"
9931
9932 #. type: Plain text
9933 #: build/C/man7/pthreads.7:862
9934 msgid "With older glibc versions, a command such as the following should be sufficient to determine the default threading implementation:"
9935 msgstr "ぞれ以前の glibc のバージョンでは、以下のようなコマンドで デフォルトのスレッド実装を判定することができる。"
9936
9937 #. type: Plain text
9938 #: build/C/man7/pthreads.7:868
9939 #, no-wrap
9940 msgid ""
9941 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
9942 "                egrep -i \\(aqthreads|nptl\\(aq\n"
9943 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
9944 msgstr ""
9945 "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n"
9946 "                egrep -i \\(aqthreads|ntpl\\(aq\n"
9947 "        Native POSIX Threads Library by Ulrich Drepper et al\n"
9948
9949 #. type: SS
9950 #: build/C/man7/pthreads.7:870
9951 #, no-wrap
9952 msgid "Selecting the threading implementation: LD_ASSUME_KERNEL"
9953 msgstr "スレッドの実装の選択: LD_ASSUME_KERNEL"
9954
9955 #. type: Plain text
9956 #: build/C/man7/pthreads.7:885
9957 msgid "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., glibc 2.3.I<x>), the B<LD_ASSUME_KERNEL> environment variable can be used to override the dynamic linker's default choice of threading implementation.  This variable tells the dynamic linker to assume that it is running on top of a particular kernel version.  By specifying a kernel version that does not provide the support required by NPTL, we can force the use of LinuxThreads.  (The most likely reason for doing this is to run a (broken) application that depends on some nonconformant behavior in LinuxThreads.)  For example:"
9958 msgstr "LinuxThreads と NPTL の両方をサポートしている glibc (glibc 2.3.I<x>) があるシステムでは、 B<LD_ASSUME_KERNEL> 環境変数を使うことで、動的リンカがデフォルトで 選択するスレッド実装を上書きすることができる。 この変数により、動的リンカが特定のバージョンのカーネル上で 動作していると仮定するように指定する。 NPTL が必要とするサポート機能を提供していないカーネルバージョンを 指定することで、強制的に LinuxThreads を使うことができる (このようなことをする最もありそうな場面は、 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーション を動作させる場合だろう)。 以下に例を示す:"
9959
9960 #. type: Plain text
9961 #: build/C/man7/pthreads.7:891
9962 #, no-wrap
9963 msgid ""
9964 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
9965 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|nptl\\(aq\n"
9966 "        linuxthreads-0.10 by Xavier Leroy\n"
9967 msgstr ""
9968 "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n"
9969 "                awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|nptl\\(aq\n"
9970 "        linuxthreads-0.10 by Xavier Leroy\n"
9971
9972 #. type: Plain text
9973 #: build/C/man7/pthreads.7:903
9974 msgid "B<clone>(2), B<futex>(2), B<gettid>(2), B<proc>(5), B<futex>(7), B<sigevent>(7), B<signal>(7),"
9975 msgstr "B<clone>(2), B<futex>(2), B<gettid>(2), B<futex>(7), B<sigevent>(7), B<signal>(7),"
9976
9977 #. type: Plain text
9978 #: build/C/man7/pthreads.7:927
9979 msgid "Various Pthreads manual pages, for example: B<pthread_attr_init>(3), B<pthread_atfork>(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_once>(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)"
9980 msgstr ""
9981 "pthreads の各種マニュアルページ、例えば: B<pthread_attr_init>(3),\n"
9982 "B<pthread_atfork>(3), B<pthread_cancel>(3), B<pthread_cleanup_push>(3),\n"
9983 "B<pthread_cond_signal>(3), B<pthread_cond_wait>(3), B<pthread_create>(3),\n"
9984 "B<pthread_detach>(3), B<pthread_equal>(3), B<pthread_exit>(3),\n"
9985 "B<pthread_key_create>(3), B<pthread_kill>(3), B<pthread_mutex_lock>(3),\n"
9986 "B<pthread_mutex_unlock>(3), B<pthread_once>(3),\n"
9987 "B<pthread_setcancelstate>(3), B<pthread_setcanceltype>(3),\n"
9988 "B<pthread_setspecific>(3), B<pthread_sigmask>(3), B<pthread_sigqueue>(3),\n"
9989 "and B<pthread_testcancel>(3)"