OSDN Git Service

アーキテクチャ -> アーキテクチャー
[linuxjm/LDP_man-pages.git] / po4a / sched / 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/CPU_SET.3:27
20 #, no-wrap
21 msgid "CPU_SET"
22 msgstr "CPU_SET"
23
24 #. type: TH
25 #: build/C/man3/CPU_SET.3:27
26 #, no-wrap
27 msgid "2012-03-15"
28 msgstr "2012-03-15"
29
30 #. type: TH
31 #: build/C/man3/CPU_SET.3:27 build/C/man2/clone.2:42 build/C/man2/kcmp.2:28
32 #: build/C/man2/sched_get_priority_max.2:29 build/C/man3/sched_getcpu.3:26
33 #: build/C/man2/sched_rr_get_interval.2:29 build/C/man2/sched_setaffinity.2:34
34 #: build/C/man2/sched_setattr.2:26 build/C/man2/sched_setparam.2:30
35 #: build/C/man2/sched_setscheduler.2:26 build/C/man2/sched_yield.2:29
36 #: build/C/man7/sched.7:32 build/C/man2/setns.2:8 build/C/man2/unshare.2:20
37 #, no-wrap
38 msgid "Linux"
39 msgstr "Linux"
40
41 #. type: TH
42 #: build/C/man3/CPU_SET.3:27 build/C/man2/clone.2:42 build/C/man2/kcmp.2:28
43 #: build/C/man2/sched_get_priority_max.2:29 build/C/man3/sched_getcpu.3:26
44 #: build/C/man2/sched_rr_get_interval.2:29 build/C/man2/sched_setaffinity.2:34
45 #: build/C/man2/sched_setattr.2:26 build/C/man2/sched_setparam.2:30
46 #: build/C/man2/sched_setscheduler.2:26 build/C/man2/sched_yield.2:29
47 #: build/C/man7/sched.7:32 build/C/man2/setns.2:8 build/C/man2/unshare.2:20
48 #, no-wrap
49 msgid "Linux Programmer's Manual"
50 msgstr "Linux Programmer's Manual"
51
52 #. type: SH
53 #: build/C/man3/CPU_SET.3:28 build/C/man2/clone.2:43 build/C/man2/kcmp.2:29
54 #: build/C/man2/sched_get_priority_max.2:30 build/C/man3/sched_getcpu.3:27
55 #: build/C/man2/sched_rr_get_interval.2:30 build/C/man2/sched_setaffinity.2:35
56 #: build/C/man2/sched_setattr.2:27 build/C/man2/sched_setparam.2:31
57 #: build/C/man2/sched_setscheduler.2:27 build/C/man2/sched_yield.2:30
58 #: build/C/man7/sched.7:33 build/C/man2/setns.2:9 build/C/man2/unshare.2:21
59 #, no-wrap
60 msgid "NAME"
61 msgstr "名前"
62
63 #. type: Plain text
64 #: build/C/man3/CPU_SET.3:35
65 msgid "CPU_SET, CPU_CLR, CPU_ISSET, CPU_ZERO, CPU_COUNT, CPU_AND, CPU_OR, CPU_XOR, CPU_EQUAL, CPU_ALLOC, CPU_ALLOC_SIZE, CPU_FREE, CPU_SET_S, CPU_CLR_S, CPU_ISSET_S, CPU_ZERO_S, CPU_COUNT_S, CPU_AND_S, CPU_OR_S, CPU_XOR_S, CPU_EQUAL_S - macros for manipulating CPU sets"
66 msgstr "CPU_SET, CPU_CLR, CPU_ISSET, CPU_ZERO, CPU_COUNT, CPU_AND, CPU_OR, CPU_XOR, CPU_EQUAL, CPU_ALLOC, CPU_ALLOC_SIZE, CPU_FREE, CPU_SET_S, CPU_CLR_S, CPU_ISSET_S, CPU_ZERO_S, CPU_COUNT_S, CPU_AND_S, CPU_OR_S, CPU_XOR_S, CPU_EQUAL_S - CPU 集合を操作するためのマクロ"
67
68 #. type: SH
69 #: build/C/man3/CPU_SET.3:35 build/C/man2/clone.2:45 build/C/man2/kcmp.2:31
70 #: build/C/man2/sched_get_priority_max.2:32 build/C/man3/sched_getcpu.3:29
71 #: build/C/man2/sched_rr_get_interval.2:32 build/C/man2/sched_setaffinity.2:38
72 #: build/C/man2/sched_setattr.2:30 build/C/man2/sched_setparam.2:33
73 #: build/C/man2/sched_setscheduler.2:30 build/C/man2/sched_yield.2:32
74 #: build/C/man2/setns.2:11 build/C/man2/unshare.2:23
75 #, no-wrap
76 msgid "SYNOPSIS"
77 msgstr "書式"
78
79 #. type: Plain text
80 #: build/C/man3/CPU_SET.3:39 build/C/man2/sched_setaffinity.2:42
81 #: build/C/man2/setns.2:15
82 #, no-wrap
83 msgid ""
84 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
85 "B<#include E<lt>sched.hE<gt>>\n"
86 msgstr ""
87 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
88 "B<#include E<lt>sched.hE<gt>>\n"
89
90 #. type: Plain text
91 #: build/C/man3/CPU_SET.3:41
92 #, no-wrap
93 msgid "B<void CPU_ZERO(cpu_set_t *>I<set>B<);>\n"
94 msgstr "B<void CPU_ZERO(cpu_set_t *>I<set>B<);>\n"
95
96 #. type: Plain text
97 #: build/C/man3/CPU_SET.3:45
98 #, no-wrap
99 msgid ""
100 "B<void CPU_SET(int >I<cpu>B<, cpu_set_t *>I<set>B<);>\n"
101 "B<void CPU_CLR(int >I<cpu>B<, cpu_set_t *>I<set>B<);>\n"
102 "B<int  CPU_ISSET(int >I<cpu>B<, cpu_set_t *>I<set>B<);>\n"
103 msgstr ""
104 "B<void CPU_SET(int >I<cpu>B<, cpu_set_t *>I<set>B<);>\n"
105 "B<void CPU_CLR(int >I<cpu>B<, cpu_set_t *>I<set>B<);>\n"
106 "B<int  CPU_ISSET(int >I<cpu>B<, cpu_set_t *>I<set>B<);>\n"
107
108 #. type: Plain text
109 #: build/C/man3/CPU_SET.3:47
110 #, no-wrap
111 msgid "B<int  CPU_COUNT(cpu_set_t *>I<set>B<);>\n"
112 msgstr "B<int  CPU_COUNT(cpu_set_t *>I<set>B<);>\n"
113
114 #. type: Plain text
115 #: build/C/man3/CPU_SET.3:54
116 #, no-wrap
117 msgid ""
118 "B<void CPU_AND(cpu_set_t *>I<destset>B<,>\n"
119 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
120 "B<void CPU_OR(cpu_set_t *>I<destset>B<,>\n"
121 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
122 "B<void CPU_XOR(cpu_set_t *>I<destset>B<,>\n"
123 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
124 msgstr ""
125 "B<void CPU_AND(cpu_set_t *>I<destset>B<,>\n"
126 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
127 "B<void CPU_OR(cpu_set_t *>I<destset>B<,>\n"
128 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
129 "B<void CPU_XOR(cpu_set_t *>I<destset>B<,>\n"
130 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
131
132 #. type: Plain text
133 #: build/C/man3/CPU_SET.3:56
134 #, no-wrap
135 msgid "B<int  CPU_EQUAL(cpu_set_t *>I<set1>B<, cpu_set_t *>I<set2>B<);>\n"
136 msgstr "B<int  CPU_EQUAL(cpu_set_t *>I<set1>B<, cpu_set_t *>I<set2>B<);>\n"
137
138 #. type: Plain text
139 #: build/C/man3/CPU_SET.3:60
140 #, no-wrap
141 msgid ""
142 "B<cpu_set_t *CPU_ALLOC(int >I<num_cpus>B<);>\n"
143 "B<void CPU_FREE(cpu_set_t *>I<set>B<);>\n"
144 "B<size_t CPU_ALLOC_SIZE(int >I<num_cpus>B<);>\n"
145 msgstr ""
146 "B<cpu_set_t *CPU_ALLOC(int >I<num_cpus>B<);>\n"
147 "B<void CPU_FREE(cpu_set_t *>I<set>B<);>\n"
148 "B<size_t CPU_ALLOC_SIZE(int >I<num_cpus>B<);>\n"
149
150 #. type: Plain text
151 #: build/C/man3/CPU_SET.3:62
152 #, no-wrap
153 msgid "B<void CPU_ZERO_S(size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
154 msgstr "B<void CPU_ZERO_S(size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
155
156 #. type: Plain text
157 #: build/C/man3/CPU_SET.3:66
158 #, no-wrap
159 msgid ""
160 "B<void CPU_SET_S(int >I<cpu>B<, size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
161 "B<void CPU_CLR_S(int >I<cpu>B<, size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
162 "B<int  CPU_ISSET_S(int >I<cpu>B<, size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
163 msgstr ""
164 "B<void CPU_SET_S(int >I<cpu>B<, size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
165 "B<void CPU_CLR_S(int >I<cpu>B<, size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
166 "B<int  CPU_ISSET_S(int >I<cpu>B<, size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
167
168 #. type: Plain text
169 #: build/C/man3/CPU_SET.3:68
170 #, no-wrap
171 msgid "B<int  CPU_COUNT_S(size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
172 msgstr "B<int  CPU_COUNT_S(size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
173
174 #. type: Plain text
175 #: build/C/man3/CPU_SET.3:75
176 #, no-wrap
177 msgid ""
178 "B<void CPU_AND_S(size_t >I<setsize>B<, cpu_set_t *>I<destset>B<,>\n"
179 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
180 "B<void CPU_OR_S(size_t >I<setsize>B<, cpu_set_t *>I<destset>B<,>\n"
181 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
182 "B<void CPU_XOR_S(size_t >I<setsize>B<, cpu_set_t *>I<destset>B<,>\n"
183 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
184 msgstr ""
185 "B<void CPU_AND_S(size_t >I<setsize>B<, cpu_set_t *>I<destset>B<,>\n"
186 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
187 "B<void CPU_OR_S(size_t >I<setsize>B<, cpu_set_t *>I<destset>B<,>\n"
188 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
189 "B<void CPU_XOR_S(size_t >I<setsize>B<, cpu_set_t *>I<destset>B<,>\n"
190 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
191
192 #. type: Plain text
193 #: build/C/man3/CPU_SET.3:78
194 #, no-wrap
195 msgid "B<int  CPU_EQUAL_S(size_t >I<setsize>B<, cpu_set_t *>I<set1>B<, cpu_set_t *>I<set2>B<);>\n"
196 msgstr "B<int  CPU_EQUAL_S(size_t >I<setsize>B<, cpu_set_t *>I<set1>B<, cpu_set_t *>I<set2>B<);>\n"
197
198 #. type: SH
199 #: build/C/man3/CPU_SET.3:79 build/C/man2/clone.2:83 build/C/man2/kcmp.2:41
200 #: build/C/man2/sched_get_priority_max.2:38 build/C/man3/sched_getcpu.3:55
201 #: build/C/man2/sched_rr_get_interval.2:36 build/C/man2/sched_setaffinity.2:49
202 #: build/C/man2/sched_setattr.2:41 build/C/man2/sched_setparam.2:47
203 #: build/C/man2/sched_setscheduler.2:41 build/C/man2/sched_yield.2:36
204 #: build/C/man7/sched.7:35 build/C/man2/setns.2:18 build/C/man2/unshare.2:50
205 #, no-wrap
206 msgid "DESCRIPTION"
207 msgstr "説明"
208
209 #. type: Plain text
210 #: build/C/man3/CPU_SET.3:86
211 msgid "The I<cpu_set_t> data structure represents a set of CPUs.  CPU sets are used by B<sched_setaffinity>(2)  and similar interfaces."
212 msgstr "I<cpu_set_t> データ構造体は CPU 集合を表現している。 CPU 集合は B<sched_setaffinity>(2) や同様のインタフェースで使用されている。"
213
214 #. type: Plain text
215 #: build/C/man3/CPU_SET.3:93
216 msgid "The I<cpu_set_t> data type is implemented as a bit set.  However, the data structure treated as considered opaque: all manipulation of CPU sets should be done via the macros described in this page."
217 msgstr "I<cpu_set_t> データ型はビット集合として実装されている。 しかし、 データ構造体はその実装を意識せずに扱うものとされており、 CPU 集合のすべての操作は、 このページで説明されているマクロを通して行うべきである。"
218
219 #. type: Plain text
220 #: build/C/man3/CPU_SET.3:96
221 msgid "The following macros are provided to operate on the CPU set I<set>:"
222 msgstr "以下のマクロが CPU 集合 I<set> を操作するために提供されている。"
223
224 #. type: TP
225 #: build/C/man3/CPU_SET.3:96
226 #, no-wrap
227 msgid "B<CPU_ZERO>()"
228 msgstr "B<CPU_ZERO>()"
229
230 #. type: Plain text
231 #: build/C/man3/CPU_SET.3:101
232 msgid "Clears I<set>, so that it contains no CPUs."
233 msgstr "I<set> をクリアする。 集合には何も CPU が含まれない状態となる。"
234
235 #. type: TP
236 #: build/C/man3/CPU_SET.3:101
237 #, no-wrap
238 msgid "B<CPU_SET>()"
239 msgstr "B<CPU_SET>()"
240
241 #. type: Plain text
242 #: build/C/man3/CPU_SET.3:107
243 msgid "Add CPU I<cpu> to I<set>."
244 msgstr "I<set> に I<cpu> を追加する。"
245
246 #. type: TP
247 #: build/C/man3/CPU_SET.3:107
248 #, no-wrap
249 msgid "B<CPU_CLR>()"
250 msgstr "B<CPU_CLR>()"
251
252 #. type: Plain text
253 #: build/C/man3/CPU_SET.3:113
254 msgid "Remove CPU I<cpu> from I<set>."
255 msgstr "I<set> から I<cpu> を削除する。"
256
257 #. type: TP
258 #: build/C/man3/CPU_SET.3:113
259 #, no-wrap
260 msgid "B<CPU_ISSET>()"
261 msgstr "B<CPU_ISSET>()"
262
263 #. type: Plain text
264 #: build/C/man3/CPU_SET.3:119
265 msgid "Test to see if CPU I<cpu> is a member of I<set>."
266 msgstr "CPU I<cpu> が I<set> のメンバーであるかを検査する。"
267
268 #. type: TP
269 #: build/C/man3/CPU_SET.3:119
270 #, no-wrap
271 msgid "B<CPU_COUNT>()"
272 msgstr "B<CPU_COUNT>()"
273
274 #. type: Plain text
275 #: build/C/man3/CPU_SET.3:123
276 msgid "Return the number of CPUs in I<set>."
277 msgstr "I<set> に含まれる CPU 数を返す。"
278
279 #. type: Plain text
280 #: build/C/man3/CPU_SET.3:128
281 msgid "Where a I<cpu> argument is specified, it should not produce side effects, since the above macros may evaluate the argument more than once."
282 msgstr "I<cpu> 引き数が指定する場合、 その引き数は副作用を伴うべきではない。 上記のマクロは引き数を複数回評価する可能性があるからである。"
283
284 #. type: Plain text
285 #: build/C/man3/CPU_SET.3:139
286 msgid "The first available CPU on the system corresponds to a I<cpu> value of 0, the next CPU corresponds to a I<cpu> value of 1, and so on.  The constant B<CPU_SETSIZE> (currently 1024) specifies a value one greater than the maximum CPU number that can be stored in I<cpu_set_t>."
287 msgstr "そのシステムで利用可能な最初の CPU が I<cpu> 値 0 に対応し、 次の CPU が I<cpu> 値 1 に対応し、 以降も同様である。 定数 B<CPU_SETSIZE> (現在のところ 1024) は I<cpu_set_t> に格納できる最大 CPU 数よりも大きな値である。"
288
289 #. type: Plain text
290 #: build/C/man3/CPU_SET.3:141
291 msgid "The following macros perform logical operations on CPU sets:"
292 msgstr "以下のマクロは CPU 集合どうしの論理操作を行う。"
293
294 #. type: TP
295 #: build/C/man3/CPU_SET.3:141
296 #, no-wrap
297 msgid "B<CPU_AND>()"
298 msgstr "B<CPU_AND>()"
299
300 #. type: Plain text
301 #: build/C/man3/CPU_SET.3:150
302 msgid "Store the intersection of the sets I<srcset1> and I<srcset2> in I<destset> (which may be one of the source sets)."
303 msgstr "集合 I<srcset1> と I<srcset2> の積集合を I<destset> に格納する (元の集合のいずれかが I<destset> として使用される場合もある)。"
304
305 #. type: TP
306 #: build/C/man3/CPU_SET.3:150
307 #, no-wrap
308 msgid "B<CPU_OR>()"
309 msgstr "B<CPU_OR>()"
310
311 #. type: Plain text
312 #: build/C/man3/CPU_SET.3:159
313 msgid "Store the union of the sets I<srcset1> and I<srcset2> in I<destset> (which may be one of the source sets)."
314 msgstr "集合 I<srcset1> と I<srcset2> の和集合を I<destset> に格納する (元の集合のいずれかが I<destset> として使用される場合もある)。"
315
316 #. type: TP
317 #: build/C/man3/CPU_SET.3:159
318 #, no-wrap
319 msgid "B<CPU_XOR>()"
320 msgstr "B<CPU_XOR>()"
321
322 #. type: Plain text
323 #: build/C/man3/CPU_SET.3:173
324 msgid "Store the XOR of the sets I<srcset1> and I<srcset2> in I<destset> (which may be one of the source sets).  The XOR means the set of CPUs that are in either I<srcset1> or I<srcset2>, but not both."
325 msgstr "集合 I<srcset1> と I<srcset2> の XOR を I<destset> に格納する (元の集合のいずれかが I<destset> として使用される場合もある)。 XOR とは、 I<srcset1> か I<srcset2> のいずれかに含まれるが、両方には含まれない集合のことである。"
326
327 #. type: TP
328 #: build/C/man3/CPU_SET.3:173
329 #, no-wrap
330 msgid "B<CPU_EQUAL>()"
331 msgstr "B<CPU_EQUAL>()"
332
333 #. type: Plain text
334 #: build/C/man3/CPU_SET.3:176
335 msgid "Test whether two CPU set contain exactly the same CPUs."
336 msgstr "二つの CPU 集合が全く同じ CPU を含んでいるかを検査する。"
337
338 #. type: SS
339 #: build/C/man3/CPU_SET.3:176
340 #, no-wrap
341 msgid "Dynamically sized CPU sets"
342 msgstr "動的に大きさが決まる CPU 集合"
343
344 #. type: Plain text
345 #: build/C/man3/CPU_SET.3:182
346 msgid "Because some applications may require the ability to dynamically size CPU sets (e.g., to allocate sets larger than that defined by the standard I<cpu_set_t> data type), glibc nowadays provides a set of macros to support this."
347 msgstr "いくつかのアプリケーションでは CPU 集合の大きさを動的に決める能力 (例えば、 標準の I<cpu_set_t> データ型で定義されたよりも大きい集合を割り当てるなど) が必要となることがあるため、 現在 glibc はこれに対応するためにいくつかのマクロを提供している。"
348
349 #. type: Plain text
350 #: build/C/man3/CPU_SET.3:184
351 msgid "The following macros are used to allocate and deallocate CPU sets:"
352 msgstr "以下のマクロを使うと CPU 集合の割り当てと解放ができる。"
353
354 #. type: TP
355 #: build/C/man3/CPU_SET.3:184
356 #, no-wrap
357 msgid "B<CPU_ALLOC>()"
358 msgstr "B<CPU_ALLOC>()"
359
360 #. type: Plain text
361 #: build/C/man3/CPU_SET.3:189
362 msgid "Allocate a CPU set large enough to hold CPUs in the range 0 to I<num_cpus-1>."
363 msgstr "0 から I<num_cpus-1> までの範囲の CPU を保持するのに十分な大きさの CPU 集合を割り当てる。"
364
365 #. type: TP
366 #: build/C/man3/CPU_SET.3:189
367 #, no-wrap
368 msgid "B<CPU_ALLOC_SIZE>()"
369 msgstr "B<CPU_ALLOC_SIZE>()"
370
371 #. type: Plain text
372 #: build/C/man3/CPU_SET.3:199
373 msgid "Return the size in bytes of the CPU set that would be needed to hold CPUs in the range 0 to I<num_cpus-1>.  This macro provides the value that can be used for the I<setsize> argument in the B<CPU_*_S>()  macros described below."
374 msgstr "0 から I<num_cpus-1> までの範囲の CPU を保持するのに必要な CPU 集合の大きさをバイト数で返す。 このマクロが返す値は、 後述の B<CPU_*_S>() マクロの I<setsize> 引き数として使用できる。"
375
376 #. type: TP
377 #: build/C/man3/CPU_SET.3:199
378 #, no-wrap
379 msgid "B<CPU_FREE>()"
380 msgstr "B<CPU_FREE>()"
381
382 #. type: Plain text
383 #: build/C/man3/CPU_SET.3:203
384 msgid "Free a CPU set previously allocated by B<CPU_ALLOC>()."
385 msgstr "以前に B<CPU_ALLOC>() で割り当てられた CPU 集合を解放する。"
386
387 #. type: Plain text
388 #: build/C/man3/CPU_SET.3:210
389 msgid "The macros whose names end with \"_S\" are the analogs of the similarly named macros without the suffix.  These macros perform the same tasks as their analogs, but operate on the dynamically allocated CPU set(s) whose size is I<setsize> bytes."
390 msgstr "名前が \"_S\" で終わるマクロは \"_S\" なしの同じ名前のマクロと同等である。 これらのマクロは \"_S\" なしのものと同じ動作をするが、 動的に割り当てられた、 大きさが I<setsize> バイトの CPU 集合に対して操作を行う点が異なる。"
391
392 #. type: SH
393 #: build/C/man3/CPU_SET.3:210 build/C/man2/clone.2:873 build/C/man2/kcmp.2:127
394 #: build/C/man2/sched_get_priority_max.2:97 build/C/man3/sched_getcpu.3:58
395 #: build/C/man2/sched_rr_get_interval.2:73
396 #: build/C/man2/sched_setaffinity.2:107 build/C/man2/sched_setattr.2:262
397 #: build/C/man2/sched_setparam.2:87 build/C/man2/sched_setscheduler.2:135
398 #: build/C/man2/sched_yield.2:41 build/C/man2/setns.2:138
399 #: build/C/man2/unshare.2:277
400 #, no-wrap
401 msgid "RETURN VALUE"
402 msgstr "返り値"
403
404 #. type: Plain text
405 #: build/C/man3/CPU_SET.3:219
406 msgid "B<CPU_ISSET>()  and B<CPU_ISSET_S>()  return nonzero if I<cpu> is in I<set>; otherwise, it returns 0."
407 msgstr "B<CPU_ISSET>() と B<CPU_ISSET_S>() は、 I<cpu> が I<set> に含まれていれば 0 以外を返し、含まれない場合 0 を返す。"
408
409 #. type: Plain text
410 #: build/C/man3/CPU_SET.3:225
411 msgid "B<CPU_COUNT>()  and B<CPU_COUNT_S>()  return the number of CPUs in I<set>."
412 msgstr "B<CPU_COUNT>() と B<CPU_COUNT_S>() は I<set> に含まれる CPU 数を返す。"
413
414 #. type: Plain text
415 #: build/C/man3/CPU_SET.3:230
416 msgid "B<CPU_EQUAL>()  and B<CPU_EQUAL_S>()  return nonzero if the two CPU sets are equal; otherwise it returns 0."
417 msgstr "B<CPU_EQUAL>() と B<CPU_EQUAL_S>() は、 二つの CPU 集合が等しければ 0 以外を返し、 等しくない場合 0 を返す。"
418
419 #. type: Plain text
420 #: build/C/man3/CPU_SET.3:235
421 msgid "B<CPU_ALLOC>()  returns a pointer on success, or NULL on failure.  (Errors are as for B<malloc>(3).)"
422 msgstr "B<CPU_ALLOC>() は成功するとポインターを返し、 失敗すると NULL を返す (エラーは B<malloc>(3) と同じである)。"
423
424 #. type: Plain text
425 #: build/C/man3/CPU_SET.3:239
426 msgid "B<CPU_ALLOC_SIZE>()  returns the number of bytes required to store a CPU set of the specified cardinality."
427 msgstr "B<CPU_ALLOC_SIZE>() は指定された大きさの CPU 集合を格納するのに必要なバイト数を返す。"
428
429 #. type: Plain text
430 #: build/C/man3/CPU_SET.3:241
431 msgid "The other functions do not return a value."
432 msgstr "他の関数は値を返さない。"
433
434 #. type: SH
435 #: build/C/man3/CPU_SET.3:241 build/C/man2/clone.2:1031
436 #: build/C/man2/kcmp.2:198 build/C/man3/sched_getcpu.3:70
437 #: build/C/man2/sched_setaffinity.2:148 build/C/man2/sched_setattr.2:348
438 #: build/C/man2/setns.2:186 build/C/man2/unshare.2:330
439 #, no-wrap
440 msgid "VERSIONS"
441 msgstr "バージョン"
442
443 #. type: Plain text
444 #: build/C/man3/CPU_SET.3:249
445 msgid "The B<CPU_ZERO>(), B<CPU_SET>(), B<CPU_CLR>(), and B<CPU_ISSET>()  macros were added in glibc 2.3.3."
446 msgstr "マクロ B<CPU_ZERO>(), B<CPU_SET>(), B<CPU_CLR>(), B<CPU_ISSET>() は glibc 2.3.3 で追加された。"
447
448 #. type: Plain text
449 #: build/C/man3/CPU_SET.3:252
450 msgid "B<CPU_COUNT>()  first appeared in glibc 2.6."
451 msgstr "B<CPU_COUNT>() は glibc 2.6 で初めて登場した。"
452
453 #. type: Plain text
454 #: build/C/man3/CPU_SET.3:270
455 msgid "B<CPU_AND>(), B<CPU_OR>(), B<CPU_XOR>(), B<CPU_EQUAL>(), B<CPU_ALLOC>(), B<CPU_ALLOC_SIZE>(), B<CPU_FREE>(), B<CPU_ZERO_S>(), B<CPU_SET_S>(), B<CPU_CLR_S>(), B<CPU_ISSET_S>(), B<CPU_AND_S>(), B<CPU_OR_S>(), B<CPU_XOR_S>(), and B<CPU_EQUAL_S>()  first appeared in glibc 2.7."
456 msgstr "B<CPU_AND>(), B<CPU_OR>(), B<CPU_XOR>(), B<CPU_EQUAL>(), B<CPU_ALLOC>(), B<CPU_ALLOC_SIZE>(), B<CPU_FREE>(), B<CPU_ZERO_S>(), B<CPU_SET_S>(), B<CPU_CLR_S>(), B<CPU_ISSET_S>(), B<CPU_AND_S>(), B<CPU_OR_S>(), B<CPU_XOR_S>(), B<CPU_EQUAL_S>() は glibc 2.7 で初めて登場した。"
457
458 #. type: SH
459 #: build/C/man3/CPU_SET.3:270 build/C/man2/clone.2:1038
460 #: build/C/man2/kcmp.2:202 build/C/man2/sched_get_priority_max.2:113
461 #: build/C/man3/sched_getcpu.3:77 build/C/man2/sched_rr_get_interval.2:94
462 #: build/C/man2/sched_setaffinity.2:159 build/C/man2/sched_setattr.2:351
463 #: build/C/man2/sched_setparam.2:119 build/C/man2/sched_setscheduler.2:170
464 #: build/C/man2/sched_yield.2:52 build/C/man2/setns.2:191
465 #: build/C/man2/unshare.2:334
466 #, no-wrap
467 msgid "CONFORMING TO"
468 msgstr "準拠"
469
470 #. type: Plain text
471 #: build/C/man3/CPU_SET.3:272
472 msgid "These interfaces are Linux-specific."
473 msgstr "これらのインタフェースは Linux 固有である。"
474
475 #. type: SH
476 #: build/C/man3/CPU_SET.3:272 build/C/man2/clone.2:1042
477 #: build/C/man2/kcmp.2:205 build/C/man3/sched_getcpu.3:80
478 #: build/C/man2/sched_rr_get_interval.2:96
479 #: build/C/man2/sched_setaffinity.2:161 build/C/man2/sched_setattr.2:353
480 #: build/C/man2/sched_setparam.2:121 build/C/man2/sched_setscheduler.2:173
481 #: build/C/man2/sched_yield.2:54 build/C/man7/sched.7:611
482 #: build/C/man2/setns.2:195 build/C/man2/unshare.2:338
483 #, no-wrap
484 msgid "NOTES"
485 msgstr "注意"
486
487 #. type: Plain text
488 #: build/C/man3/CPU_SET.3:275
489 msgid "To duplicate a CPU set, use B<memcpy>(3)."
490 msgstr "CPU 集合を複製するには、 B<memcpy>(3) を使用する。"
491
492 #. type: Plain text
493 #: build/C/man3/CPU_SET.3:282
494 msgid "Since CPU sets are bit sets allocated in units of long words, the actual number of CPUs in a dynamically allocated CPU set will be rounded up to the next multiple of I<sizeof(unsigned long)>.  An application should consider the contents of these extra bits to be undefined."
495 msgstr "CPU 集合はロングワード単位に割り当てられるビット集合なので、 動的に割り当てられた CPU 集合の実際の CPU 数は I<sizeof(unsigned long)> の次の倍数に切り上げられることになる。 アプリケーションは、 これらの余分なビットの内容は不定と考えるべきである。"
496
497 #. type: Plain text
498 #: build/C/man3/CPU_SET.3:294
499 msgid "Notwithstanding the similarity in the names, note that the constant B<CPU_SETSIZE> indicates the number of CPUs in the I<cpu_set_t> data type (thus, it is effectively a count of bits in the bit set), while the I<setsize> argument of the B<CPU_*_S>()  macros is a size in bytes."
500 msgstr "名前は似ているが、 定数 B<CPU_SETSIZE> は I<cpu_set_t> データ型に含まれる CPU 数 (つまり、事実上ビット集合内のビットカウント) を示すのに対して、 マクロ B<CPU_*_S>() の I<setsize> 引き数はバイト単位のサイズである点に注意すること。"
501
502 #. type: Plain text
503 #: build/C/man3/CPU_SET.3:300
504 msgid "The data types for arguments and return values shown in the SYNOPSIS are hints what about is expected in each case.  However, since these interfaces are implemented as macros, the compiler won't necessarily catch all type errors if you violate the suggestions."
505 msgstr "「書式」に書かれている引き数と返り値のデータ型は、それぞれの場合でどんな型が期待されるかのヒントである。 しかしながら、 これらのインタフェースはマクロとして実装されているため、 このヒントを守らなかった場合に、 コンパイラが必ずしも全ての型エラーを捕捉できるとは限らない。"
506
507 #. type: SH
508 #: build/C/man3/CPU_SET.3:300 build/C/man2/clone.2:1067
509 #: build/C/man2/sched_setattr.2:369 build/C/man2/sched_setscheduler.2:214
510 #, no-wrap
511 msgid "BUGS"
512 msgstr "バグ"
513
514 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7029
515 #. type: Plain text
516 #: build/C/man3/CPU_SET.3:312
517 msgid "On 32-bit platforms with glibc 2.8 and earlier, B<CPU_ALLOC>()  allocates twice as much space as is required, and B<CPU_ALLOC_SIZE>()  returns a value twice as large as it should.  This bug should not affect the semantics of a program, but does result in wasted memory and less efficient operation of the macros that operate on dynamically allocated CPU sets.  These bugs are fixed in glibc 2.9."
518 msgstr "glibc 2.8 以前の 32 ビットプラットフォームでは、 B<CPU_ALLOC>() は必要な空間の割り当てを二度行い、 B<CPU_ALLOC_SIZE>() は本来あるべき値の二倍の値を返す。 このバグはプログラムの動作には影響を与えないはずだが、 無駄にメモリを消費し、 動的に割り当てられた CPU 集合に対して操作を行うマクロの動作の効率が下がる結果となる。 これらのバグは glibc 2.9 で修正された。"
519
520 #. type: SH
521 #: build/C/man3/CPU_SET.3:312 build/C/man2/clone.2:1109
522 #: build/C/man2/setns.2:201 build/C/man2/unshare.2:372
523 #, no-wrap
524 msgid "EXAMPLE"
525 msgstr "例"
526
527 #. type: Plain text
528 #: build/C/man3/CPU_SET.3:315
529 msgid "The following program demonstrates the use of some of the macros used for dynamically allocated CPU sets."
530 msgstr "以下のプログラムは、動的に割り当てた CPU 集合に対していくつかのマクロを使用する例を示している。"
531
532 #. type: Plain text
533 #: build/C/man3/CPU_SET.3:323
534 #, no-wrap
535 msgid ""
536 "#define _GNU_SOURCE\n"
537 "#include E<lt>sched.hE<gt>\n"
538 "#include E<lt>stdlib.hE<gt>\n"
539 "#include E<lt>unistd.hE<gt>\n"
540 "#include E<lt>stdio.hE<gt>\n"
541 "#include E<lt>assert.hE<gt>\n"
542 msgstr ""
543 "#define _GNU_SOURCE\n"
544 "#include E<lt>sched.hE<gt>\n"
545 "#include E<lt>stdlib.hE<gt>\n"
546 "#include E<lt>unistd.hE<gt>\n"
547 "#include E<lt>stdio.hE<gt>\n"
548 "#include E<lt>assert.hE<gt>\n"
549
550 #. type: Plain text
551 #: build/C/man3/CPU_SET.3:330
552 #, no-wrap
553 msgid ""
554 "int\n"
555 "main(int argc, char *argv[])\n"
556 "{\n"
557 "    cpu_set_t *cpusetp;\n"
558 "    size_t size;\n"
559 "    int num_cpus, cpu;\n"
560 msgstr ""
561 "int\n"
562 "main(int argc, char *argv[])\n"
563 "{\n"
564 "    cpu_set_t *cpusetp;\n"
565 "    size_t size;\n"
566 "    int num_cpus, cpu;\n"
567
568 #. type: Plain text
569 #: build/C/man3/CPU_SET.3:335
570 #, no-wrap
571 msgid ""
572 "    if (argc E<lt> 2) {\n"
573 "        fprintf(stderr, \"Usage: %s E<lt>num-cpusE<gt>\\en\", argv[0]);\n"
574 "        exit(EXIT_FAILURE);\n"
575 "    }\n"
576 msgstr ""
577 "    if (argc E<lt> 2) {\n"
578 "        fprintf(stderr, \"Usage: %s E<lt>num-cpusE<gt>\\en\", argv[0]);\n"
579 "        exit(EXIT_FAILURE);\n"
580 "    }\n"
581
582 #. type: Plain text
583 #: build/C/man3/CPU_SET.3:337
584 #, no-wrap
585 msgid "    num_cpus = atoi(argv[1]);\n"
586 msgstr "    num_cpus = atoi(argv[1]);\n"
587
588 #. type: Plain text
589 #: build/C/man3/CPU_SET.3:343
590 #, no-wrap
591 msgid ""
592 "    cpusetp = CPU_ALLOC(num_cpus);\n"
593 "    if (cpusetp == NULL) {\n"
594 "        perror(\"CPU_ALLOC\");\n"
595 "        exit(EXIT_FAILURE);\n"
596 "    }\n"
597 msgstr ""
598 "    cpusetp = CPU_ALLOC(num_cpus);\n"
599 "    if (cpusetp == NULL) {\n"
600 "        perror(\"CPU_ALLOC\");\n"
601 "        exit(EXIT_FAILURE);\n"
602 "    }\n"
603
604 #. type: Plain text
605 #: build/C/man3/CPU_SET.3:345
606 #, no-wrap
607 msgid "    size = CPU_ALLOC_SIZE(num_cpus);\n"
608 msgstr "    size = CPU_ALLOC_SIZE(num_cpus);\n"
609
610 #. type: Plain text
611 #: build/C/man3/CPU_SET.3:349
612 #, no-wrap
613 msgid ""
614 "    CPU_ZERO_S(size, cpusetp);\n"
615 "    for (cpu = 0; cpu E<lt> num_cpus; cpu += 2)\n"
616 "        CPU_SET_S(cpu, size, cpusetp);\n"
617 msgstr ""
618 "    CPU_ZERO_S(size, cpusetp);\n"
619 "    for (cpu = 0; cpu E<lt> num_cpus; cpu += 2)\n"
620 "        CPU_SET_S(cpu, size, cpusetp);\n"
621
622 #. type: Plain text
623 #: build/C/man3/CPU_SET.3:351
624 #, no-wrap
625 msgid "    printf(\"CPU_COUNT() of set:    %d\\en\", CPU_COUNT_S(size, cpusetp));\n"
626 msgstr "    printf(\"CPU_COUNT() of set:    %d\\en\", CPU_COUNT_S(size, cpusetp));\n"
627
628 #. type: Plain text
629 #: build/C/man3/CPU_SET.3:355
630 #, no-wrap
631 msgid ""
632 "    CPU_FREE(cpusetp);\n"
633 "    exit(EXIT_SUCCESS);\n"
634 "}\n"
635 msgstr ""
636 "    CPU_FREE(cpusetp);\n"
637 "    exit(EXIT_SUCCESS);\n"
638 "}\n"
639
640 #. type: SH
641 #: build/C/man3/CPU_SET.3:356 build/C/man2/clone.2:1206
642 #: build/C/man2/kcmp.2:222 build/C/man2/sched_get_priority_max.2:115
643 #: build/C/man3/sched_getcpu.3:100 build/C/man2/sched_rr_get_interval.2:132
644 #: build/C/man2/sched_setaffinity.2:226 build/C/man2/sched_setattr.2:385
645 #: build/C/man2/sched_setparam.2:127 build/C/man2/sched_setscheduler.2:222
646 #: build/C/man2/sched_yield.2:79 build/C/man7/sched.7:664
647 #: build/C/man2/setns.2:288 build/C/man2/unshare.2:459
648 #, no-wrap
649 msgid "SEE ALSO"
650 msgstr "関連項目"
651
652 #. type: Plain text
653 #: build/C/man3/CPU_SET.3:361
654 msgid "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), B<pthread_setaffinity_np>(3), B<cpuset>(7)"
655 msgstr "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), B<pthread_setaffinity_np>(3), B<cpuset>(7)"
656
657 #. type: SH
658 #: build/C/man3/CPU_SET.3:361 build/C/man2/clone.2:1221
659 #: build/C/man2/kcmp.2:225 build/C/man2/sched_get_priority_max.2:125
660 #: build/C/man3/sched_getcpu.3:103 build/C/man2/sched_rr_get_interval.2:134
661 #: build/C/man2/sched_setaffinity.2:248 build/C/man2/sched_setattr.2:408
662 #: build/C/man2/sched_setparam.2:142 build/C/man2/sched_setscheduler.2:242
663 #: build/C/man2/sched_yield.2:81 build/C/man7/sched.7:702
664 #: build/C/man2/setns.2:295 build/C/man2/unshare.2:470
665 #, no-wrap
666 msgid "COLOPHON"
667 msgstr "この文書について"
668
669 #. type: Plain text
670 #: build/C/man3/CPU_SET.3:369 build/C/man2/clone.2:1229
671 #: build/C/man2/kcmp.2:233 build/C/man2/sched_get_priority_max.2:133
672 #: build/C/man3/sched_getcpu.3:111 build/C/man2/sched_rr_get_interval.2:142
673 #: build/C/man2/sched_setaffinity.2:256 build/C/man2/sched_setattr.2:416
674 #: build/C/man2/sched_setparam.2:150 build/C/man2/sched_setscheduler.2:250
675 #: build/C/man2/sched_yield.2:89 build/C/man7/sched.7:710
676 #: build/C/man2/setns.2:303 build/C/man2/unshare.2:478
677 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/."
678 msgstr ""
679 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.78 の一部\n"
680 "である。プロジェクトの説明とバグ報告に関する情報は\n"
681 "http://www.kernel.org/doc/man-pages/ に書かれている。"
682
683 #. type: TH
684 #: build/C/man2/clone.2:42
685 #, no-wrap
686 msgid "CLONE"
687 msgstr "CLONE"
688
689 #. type: TH
690 #: build/C/man2/clone.2:42 build/C/man2/unshare.2:20
691 #, no-wrap
692 msgid "2014-09-21"
693 msgstr "2014-09-21"
694
695 #. type: Plain text
696 #: build/C/man2/clone.2:45
697 msgid "clone, __clone2 - create a child process"
698 msgstr "clone, __clone2 - 子プロセスを作成する"
699
700 #. type: Plain text
701 #: build/C/man2/clone.2:48
702 #, no-wrap
703 msgid "/* Prototype for the glibc wrapper function */\n"
704 msgstr "/* glibc ラッパー関数のプロトタイプ */\n"
705
706 #. type: Plain text
707 #: build/C/man2/clone.2:50 build/C/man3/sched_getcpu.3:32
708 #: build/C/man2/sched_setattr.2:33 build/C/man2/sched_setparam.2:36
709 #: build/C/man2/sched_setscheduler.2:33 build/C/man2/unshare.2:26
710 #, no-wrap
711 msgid "B<#include E<lt>sched.hE<gt>>\n"
712 msgstr "B<#include E<lt>sched.hE<gt>>\n"
713
714 #. type: Plain text
715 #: build/C/man2/clone.2:55
716 #, no-wrap
717 msgid ""
718 "B<int clone(int (*>I<fn>B<)(void *), void *>I<child_stack>B<,>\n"
719 "B<          int >I<flags>B<, void *>I<arg>B<, ... >\n"
720 "B<          /* pid_t *>I<ptid>B<, struct user_desc *>I<tls>B<, pid_t *>I<ctid>B< */ );>\n"
721 msgstr ""
722 "B<int clone(int (*>I<fn>B<)(void *), void *>I<child_stack>B<,>\n"
723 "B<          int >I<flags>B<, void *>I<arg>B<, ... >\n"
724 "B<          /* pid_t *>I<ptid>B<, struct user_desc *>I<tls>B<, pid_t *>I<ctid>B< */ );>\n"
725
726 #. type: Plain text
727 #: build/C/man2/clone.2:57
728 #, no-wrap
729 msgid "/* Prototype for the raw system call */\n"
730 msgstr "/* 素のシステムコールのプロトタイプ */\n"
731
732 #. type: Plain text
733 #: build/C/man2/clone.2:61
734 #, no-wrap
735 msgid ""
736 "B<long clone(unsigned long >I<flags>B<, void *>I<child_stack>B<,>\n"
737 "B<          void *>I<ptid>B<, void *>I<ctid>B<,>\n"
738 "B<          struct pt_regs *>I<regs>B<);>\n"
739 msgstr ""
740 "B<long clone(unsigned long >I<flags>B<, void *>I<child_stack>B<,>\n"
741 "B<          void *>I<ptid>B<, void *>I<ctid>B<,>\n"
742 "B<          struct pt_regs *>I<regs>B<);>\n"
743
744 #. type: Plain text
745 #: build/C/man2/clone.2:66
746 msgid "Feature Test Macro Requirements for glibc wrapper function (see B<feature_test_macros>(7)):"
747 msgstr "glibc ラッパー関数の機能検査マクロの要件 (B<feature_test_macros>(7) 参照):"
748
749 #. type: Plain text
750 #: build/C/man2/clone.2:69
751 msgid "B<clone>():"
752 msgstr "B<clone>():"
753
754 #. type: TP
755 #: build/C/man2/clone.2:72 build/C/man3/sched_getcpu.3:45
756 #: build/C/man2/unshare.2:39
757 #, no-wrap
758 msgid "Since glibc 2.14:"
759 msgstr "glibc 2.14 以降:"
760
761 #. type: Plain text
762 #: build/C/man2/clone.2:75 build/C/man3/sched_getcpu.3:48
763 #: build/C/man2/unshare.2:42
764 msgid "_GNU_SOURCE"
765 msgstr "_GNU_SOURCE"
766
767 #.  See http://sources.redhat.com/bugzilla/show_bug.cgi?id=4749
768 #. type: TP
769 #: build/C/man2/clone.2:75 build/C/man3/sched_getcpu.3:48
770 #: build/C/man2/unshare.2:42
771 #, no-wrap
772 msgid "Before glibc 2.14:"
773 msgstr "glibc 2.14 より前:"
774
775 #. type: Plain text
776 #: build/C/man2/clone.2:80 build/C/man3/sched_getcpu.3:52
777 #: build/C/man2/unshare.2:47
778 #, no-wrap
779 msgid ""
780 "_BSD_SOURCE || _SVID_SOURCE\n"
781 "    /* _GNU_SOURCE also suffices */\n"
782 msgstr ""
783 "_BSD_SOURCE || _SVID_SOURCE\n"
784 "    /* _GNU_SOURCE も定義される */\n"
785
786 #. type: Plain text
787 #: build/C/man2/clone.2:87
788 msgid "B<clone>()  creates a new process, in a manner similar to B<fork>(2)."
789 msgstr "B<clone>() は、 B<fork>(2) と似た方法で新しいプロセスを作成する。"
790
791 #. type: Plain text
792 #: build/C/man2/clone.2:94
793 msgid "This page describes both the glibc B<clone>()  wrapper function and the underlying system call on which it is based.  The main text describes the wrapper function; the differences for the raw system call are described toward the end of this page."
794 msgstr "このページでは、 glibc の B<clone>() ラッパー関数とその裏で呼ばれるシステムコールの両方について説明している。 メインの説明はラッパー関数に関するものである。 素のシステムコールにおける差分はこのページの最後の方で説明する。"
795
796 #. type: Plain text
797 #: build/C/man2/clone.2:106
798 msgid "Unlike B<fork>(2), B<clone>()  allows the child process to share parts of its execution context with the calling process, such as the memory space, the table of file descriptors, and the table of signal handlers.  (Note that on this manual page, \"calling process\" normally corresponds to \"parent process\".  But see the description of B<CLONE_PARENT> below.)"
799 msgstr "B<fork>(2) とは異なり、B<clone>() では、子プロセス (child process)  と呼び出し元のプロセスとが、メモリ空間、ファイルディスクリプターのテーブル、シグナルハンドラのテーブルなどの 実行コンテキストの一部を共有できる。 (このマニュアルにおける「呼び出し元のプロセス」は、通常は 「親プロセス」と一致する。但し、後述の B<CLONE_PARENT> の項も参照のこと)"
800
801 #. type: Plain text
802 #: build/C/man2/clone.2:111
803 msgid "The main use of B<clone>()  is to implement threads: multiple threads of control in a program that run concurrently in a shared memory space."
804 msgstr "B<clone>()  の主要な使用法はスレッド (threads) を実装することである: 一つのプログラムの中の複数のスレッドは共有されたメモリ空間で 同時に実行される。"
805
806 #. type: Plain text
807 #: build/C/man2/clone.2:131
808 msgid "When the child process is created with B<clone>(), it executes the function I<fn>(I<arg>).  (This differs from B<fork>(2), where execution continues in the child from the point of the B<fork>(2)  call.)  The I<fn> argument is a pointer to a function that is called by the child process at the beginning of its execution.  The I<arg> argument is passed to the I<fn> function."
809 msgstr "B<clone>()  で子プロセスが作成された時に、作成された子プロセスは関数 I<fn>(I<arg>)  を実行する。 (この点が B<fork>(2)  とは異なる。 B<fork>(2)  の場合、子プロセスは B<fork>(2)  が呼び出された場所から実行を続ける。)  I<fn> 引き数は、子プロセスが実行を始める時に子プロセスが呼び出す 関数へのポインターである。 I<arg> 引き数はそのまま I<fn> 関数へと渡される。"
810
811 #. type: Plain text
812 #: build/C/man2/clone.2:141
813 msgid "When the I<fn>(I<arg>)  function application returns, the child process terminates.  The integer returned by I<fn> is the exit code for the child process.  The child process may also terminate explicitly by calling B<exit>(2)  or after receiving a fatal signal."
814 msgstr "I<fn>(I<arg>)  関数が終了すると、子プロセスは終了する。 I<fn> によって返された整数が子プロセスの終了コードとなる。 子プロセスは、 B<exit>(2)  を呼んで明示的に終了することもあるし、致命的なシグナルを受信した 場合に終了することもある。"
815
816 #. type: Plain text
817 #: build/C/man2/clone.2:157
818 msgid "The I<child_stack> argument specifies the location of the stack used by the child process.  Since the child and calling process may share memory, it is not possible for the child process to execute in the same stack as the calling process.  The calling process must therefore set up memory space for the child stack and pass a pointer to this space to B<clone>().  Stacks grow downward on all processors that run Linux (except the HP PA processors), so I<child_stack> usually points to the topmost address of the memory space set up for the child stack."
819 msgstr "I<child_stack> 引き数は、子プロセスによって使用されるスタックの位置を指定する。 子プロセスと呼び出し元のプロセスはメモリを共有することがあるため、 子プロセスは呼び出し元のプロセスと同じスタックで実行することができない。 このため、呼び出し元のプロセスは子プロセスのスタックのためのメモリ空間を 用意して、この空間へのポインターを B<clone>()  へ渡さなければならない。 (HP PA プロセッサ以外の) Linux が動作する全てのプロセッサでは、 スタックは下方 (アドレスが小さい方向) へと伸びる。このため、普通は I<child_stack> は子プロセスのスタックのために用意したメモリ空間の一番大きい アドレスを指すようにする。"
820
821 #. type: Plain text
822 #: build/C/man2/clone.2:173
823 msgid "The low byte of I<flags> contains the number of the I<termination signal> sent to the parent when the child dies.  If this signal is specified as anything other than B<SIGCHLD>, then the parent process must specify the B<__WALL> or B<__WCLONE> options when waiting for the child with B<wait>(2).  If no signal is specified, then the parent process is not signaled when the child terminates."
824 msgstr "I<flags> の下位 1 バイトは子プロセスが死んだ場合に親プロセスへと送られる I<終了シグナル (termination signal)> の番号を指定する。このシグナルとして B<SIGCHLD> 以外が指定された場合、親プロセスは、 B<wait>(2)  で子プロセスを待つ際に、オプションとして B<__WALL> または B<__WCLONE> を指定しなければならない。 どのシグナルも指定されなかった場合、子プロセスが終了した時に親プロセス にシグナルは送られない。"
825
826 #. type: Plain text
827 #: build/C/man2/clone.2:178
828 msgid "I<flags> may also be bitwise-or'ed with zero or more of the following constants, in order to specify what is shared between the calling process and the child process:"
829 msgstr "I<flags> には、以下の定数のうち 0個以上をビット毎の論理和 (bitwise-or)  をとったものを指定できる。これらの定数は呼び出し元のプロセスと 子プロセスの間で何を共有するかを指定する:"
830
831 #. type: TP
832 #: build/C/man2/clone.2:178
833 #, no-wrap
834 msgid "B<CLONE_CHILD_CLEARTID> (since Linux 2.5.49)"
835 msgstr "B<CLONE_CHILD_CLEARTID> (Linux 2.5.49 以降)"
836
837 #. type: Plain text
838 #: build/C/man2/clone.2:188
839 msgid "Erase child thread ID at location I<ctid> in child memory when the child exits, and do a wakeup on the futex at that address.  The address involved may be changed by the B<set_tid_address>(2)  system call.  This is used by threading libraries."
840 msgstr "子プロセスが終了したときに子プロセスのメモリ内の I<ctid> が指す場所にある子プロセスのスレッド ID を消去し、 そのアドレスで futex を wake (起床) させる。 このアドレスは B<set_tid_address>(2)  システムコールで変更することができる。 この機能はスレッドライブラリで使用される。"
841
842 #. type: TP
843 #: build/C/man2/clone.2:188
844 #, no-wrap
845 msgid "B<CLONE_CHILD_SETTID> (since Linux 2.5.49)"
846 msgstr "B<CLONE_CHILD_SETTID> (Linux 2.5.49 以降)"
847
848 #. type: Plain text
849 #: build/C/man2/clone.2:193
850 msgid "Store child thread ID at location I<ctid> in child memory."
851 msgstr "子プロセスのメモリ内の I<ctid> が指す場所に子プロセスのスレッド ID を格納する。"
852
853 #. type: TP
854 #: build/C/man2/clone.2:193
855 #, no-wrap
856 msgid "B<CLONE_FILES> (since Linux 2.0)"
857 msgstr "B<CLONE_FILES> (Linux 2.0 以降)"
858
859 #. type: Plain text
860 #: build/C/man2/clone.2:206
861 msgid "If B<CLONE_FILES> is set, the calling process and the child process share the same file descriptor table.  Any file descriptor created by the calling process or by the child process is also valid in the other process.  Similarly, if one of the processes closes a file descriptor, or changes its associated flags (using the B<fcntl>(2)  B<F_SETFD> operation), the other process is also affected."
862 msgstr "B<CLONE_FILES> が設定された場合、呼び出し元のプロセスと子プロセスはファイルディスクリプターの テーブルを共有する。 呼び出し元プロセスとその子プロセスの一方が作成した ファイルディスクリプターは、もう一方においても有効である。 同じように、一方のプロセスがファイルディスクリプターを閉じたり、 (B<fcntl>(2)  B<F_SETFD> 操作を使って) ディスクリプターに関連するフラグを変更したりすると、 もう一方のプロセスにも影響する。"
863
864 #. type: Plain text
865 #: build/C/man2/clone.2:220
866 msgid "If B<CLONE_FILES> is not set, the child process inherits a copy of all file descriptors opened in the calling process at the time of B<clone>().  (The duplicated file descriptors in the child refer to the same open file descriptions (see B<open>(2))  as the corresponding file descriptors in the calling process.)  Subsequent operations that open or close file descriptors, or change file descriptor flags, performed by either the calling process or the child process do not affect the other process."
867 msgstr "B<CLONE_FILES> が設定されていない場合、子プロセスは、 B<clone>()  が実行された時点で、呼び出し元のプロセスがオープンしている全ての ファイルディスクリプターのコピーを継承する (子プロセスの複製されたファイルディスクリプターは、 対応する呼び出し元のプロセスのファイルディスクリプターと 同じファイル記述 (B<open>(2)  参照) を参照する)。 これ以降に、呼び出し元のプロセスと子プロセスの一方が ファイルディスクリプターの操作 (ファイルディスクリプターの オープン・クローズや、ファイルディスクリプターフラグの変更)  を行っても、もう一方のプロセスには影響を与えない。"
868
869 #. type: TP
870 #: build/C/man2/clone.2:220
871 #, no-wrap
872 msgid "B<CLONE_FS> (since Linux 2.0)"
873 msgstr "B<CLONE_FS> (Linux 2.0 以降)"
874
875 #. type: Plain text
876 #: build/C/man2/clone.2:235
877 msgid "If B<CLONE_FS> is set, the caller and the child process share the same filesystem information.  This includes the root of the filesystem, the current working directory, and the umask.  Any call to B<chroot>(2), B<chdir>(2), or B<umask>(2)  performed by the calling process or the child process also affects the other process."
878 msgstr "B<CLONE_FS> が設定された場合、呼び出し元のプロセスと子プロセスが同じファイルシステム 情報を共有する。ファイルシステム情報は、ファイルシステムのルート (root)、 カレントワーキングディレクトリ (current working directory)  や umask などである。 呼び出し元のプロセスや子プロセスのどちらか一方によって B<chroot>(2), B<chdir>(2), B<umask>(2)  が呼び出されると、もう一方のプロセスにも影響が及ぶ。"
879
880 #. type: Plain text
881 #: build/C/man2/clone.2:247
882 msgid "If B<CLONE_FS> is not set, the child process works on a copy of the filesystem information of the calling process at the time of the B<clone>()  call.  Calls to B<chroot>(2), B<chdir>(2), B<umask>(2)  performed later by one of the processes do not affect the other process."
883 msgstr "B<CLONE_FS> が設定されていない場合、子プロセスは、 B<clone>()  が実行された時点での、呼び出し元のプロセスのファイルシステム情報のコピーを 使用する。 これ以降は、呼び出し元のプロセスと子プロセスの一方が B<chroot>(2), B<chdir>(2), B<umask>(2)  を呼び出しても、もう一方のプロセスには影響を与えない。"
884
885 #. type: TP
886 #: build/C/man2/clone.2:247
887 #, no-wrap
888 msgid "B<CLONE_IO> (since Linux 2.6.25)"
889 msgstr "B<CLONE_IO> (Linux 2.6.25 以降)"
890
891 #. type: Plain text
892 #: build/C/man2/clone.2:256
893 msgid "If B<CLONE_IO> is set, then the new process shares an I/O context with the calling process.  If this flag is not set, then (as with B<fork>(2))  the new process has its own I/O context."
894 msgstr "B<CLONE_IO> が設定された場合、新しいプロセスは呼び出し元のプロセスと I/O コンテキストを共有する。 このフラグが設定されていない場合には、 (B<fork>(2)  の場合と同様) 新しいプロセスは自分専用の I/O コンテキストを持つ。"
895
896 #.  The following based on text from Jens Axboe
897 #.  the anticipatory and CFQ scheduler
898 #.  with CFQ and AS.
899 #. type: Plain text
900 #: build/C/man2/clone.2:273
901 msgid "The I/O context is the I/O scope of the disk scheduler (i.e, what the I/O scheduler uses to model scheduling of a process's I/O).  If processes share the same I/O context, they are treated as one by the I/O scheduler.  As a consequence, they get to share disk time.  For some I/O schedulers, if two processes share an I/O context, they will be allowed to interleave their disk access.  If several threads are doing I/O on behalf of the same process (B<aio_read>(3), for instance), they should employ B<CLONE_IO> to get better I/O performance."
902 msgstr "I/O コンテキストは、ディスクスケジュールの I/O スコープである (言い換えると、I/O コンテキストは I/O スケジューラがプロセス I/O の スケジューリングをモデル化するのに使用される)。 複数のプロセスが同じ I/O コンテキストを共有する場合、 これらのプロセスは I/O スケジューラからは一つとして扱われる。 結果として、これらのプロセスはディスクアクセスの時間を共有するようになる。 いくつかの I/O スケジューラでは、 二つのプロセスが I/O コンテキストを共有している場合、 これらのプロセスはディスクアクセスを交互に行うことができる。 同じプロセスの複数のスレッドが I/O を実行している場合 (例えば B<aio_read>(3))、 B<CLONE_IO> を利用することで I/O 性能を良くすることができる。"
903
904 #. type: Plain text
905 #: build/C/man2/clone.2:277
906 msgid "If the kernel is not configured with the B<CONFIG_BLOCK> option, this flag is a no-op."
907 msgstr "カーネルの設定が B<CONFIG_BLOCK> オプション付きでない場合、 このフラグは何の意味も持たない。"
908
909 #. type: TP
910 #: build/C/man2/clone.2:277 build/C/man2/unshare.2:96
911 #, no-wrap
912 msgid "B<CLONE_NEWIPC> (since Linux 2.6.19)"
913 msgstr "B<CLONE_NEWIPC> (Linux 2.6.19 以降)"
914
915 #. type: Plain text
916 #: build/C/man2/clone.2:287
917 msgid "If B<CLONE_NEWIPC> is set, then create the process in a new IPC namespace.  If this flag is not set, then (as with B<fork>(2)), the process is created in the same IPC namespace as the calling process.  This flag is intended for the implementation of containers."
918 msgstr "B<CLONE_NEWIPC> が設定された場合、新しい IPC 名前空間 (namespace) でプロセスを作成する。 このフラグが設定されていない場合、 (B<fork>(2)  の場合と同様) 呼び出し元のプロセスと同じ IPC 名前空間でプロセスが 作成される。 このフラグは、コンテナの実装での使用を意図して用意されたものである。"
919
920 #.  commit 7eafd7c74c3f2e67c27621b987b28397110d643f
921 #.  https://lwn.net/Articles/312232/
922 #. type: Plain text
923 #: build/C/man2/clone.2:299
924 msgid "An IPC namespace provides an isolated view of System\\ V IPC objects (see B<svipc>(7))  and (since Linux 2.6.30)  POSIX message queues (see B<mq_overview>(7)).  The common characteristic of these IPC mechanisms is that IPC objects are identified by mechanisms other than filesystem pathnames."
925 msgstr "IPC 名前空間は、独立の System\\ V IPC オブジェクト空間 (B<svipc>(7) 参照) を提供する 。 (Linux 2.6.30 以降では) 独立した POSIX メッセージキュー空間 (B<mq_overview>(7) 参照) も提供される。 これらの IPC 機構に共通の特徴として、 IPC オブジェクトはファイルシステムのパス名とは違った仕組みで識別されるという点がある。"
926
927 #. type: Plain text
928 #: build/C/man2/clone.2:303
929 msgid "Objects created in an IPC namespace are visible to all other processes that are members of that namespace, but are not visible to processes in other IPC namespaces."
930 msgstr "ある IPC 名前空間に作成されたオブジェクトは、 その名前空間のメンバーである他のすべてのプロセスからも見えるが、 違う IPC 名前空間のプロセスからは見えない。"
931
932 #. type: Plain text
933 #: build/C/man2/clone.2:307
934 msgid "When an IPC namespace is destroyed (i.e., when the last process that is a member of the namespace terminates), all IPC objects in the namespace are automatically destroyed."
935 msgstr "IPC 名前空間が破棄される時 (すなわち、その名前空間のメンバーの最後のプロセスが終了する時)、 その名前空間の全ての IPC オブジェクトは自動的に破棄される。"
936
937 #. type: Plain text
938 #: build/C/man2/clone.2:314
939 msgid "Only a privileged process (B<CAP_SYS_ADMIN>)  can employ B<CLONE_NEWIPC>.  This flag can't be specified in conjunction with B<CLONE_SYSVSEM>."
940 msgstr "特権プロセス (B<CAP_SYS_ADMIN>) だけが B<CLONE_NEWIPC> を使用できる。 このフラグは B<CLONE_SYSVSEM> と組み合わせて指定することはできない。"
941
942 #. type: Plain text
943 #: build/C/man2/clone.2:317
944 msgid "For further information on IPC namespaces, see B<namespaces>(7)."
945 msgstr "IPC 名前空間の詳細は B<namespaces>(7) を参照。"
946
947 #. type: TP
948 #: build/C/man2/clone.2:317 build/C/man2/unshare.2:113
949 #, no-wrap
950 msgid "B<CLONE_NEWNET> (since Linux 2.6.24)"
951 msgstr "B<CLONE_NEWNET> (Linux 2.6.24 以降)"
952
953 #. type: Plain text
954 #: build/C/man2/clone.2:321
955 msgid "(The implementation of this flag was completed only by about kernel version 2.6.29.)"
956 msgstr "(このフラグの実装は、Linux 2.6.29 あたりまでには完成した。)"
957
958 #. type: Plain text
959 #: build/C/man2/clone.2:330
960 msgid "If B<CLONE_NEWNET> is set, then create the process in a new network namespace.  If this flag is not set, then (as with B<fork>(2))  the process is created in the same network namespace as the calling process.  This flag is intended for the implementation of containers."
961 msgstr "B<CLONE_NEWNET> が設定された場合、新しいネットワーク名前空間 (network namaspace)  でプロセスを作成する。 このフラグが設定されていない場合、 (B<fork>(2)  の場合と同様) 呼び出し元のプロセスと同じネットワーク名前空間でプロセスが 作成される。 このフラグは、コンテナの実装での使用を意図して用意されたものである。"
962
963 #.  FIXME . Add pointer to veth(4) page when it is eventually completed
964 #. type: Plain text
965 #: build/C/man2/clone.2:345
966 msgid "A network namespace provides an isolated view of the networking stack (network device interfaces, IPv4 and IPv6 protocol stacks, IP routing tables, firewall rules, the I</proc/net> and I</sys/class/net> directory trees, sockets, etc.).  A physical network device can live in exactly one network namespace.  A virtual network device (\"veth\") pair provides a pipe-like abstraction that can be used to create tunnels between network namespaces, and can be used to create a bridge to a physical network device in another namespace."
967 msgstr "ネットワーク名前空間は、分離されたネットワークスタックを提供するものである (ネットワークスタックとは、 ネットワークデバイスインタフェース、IPv4 や IPv6 プロトコルスタック、 I</proc/net>、 I</sys/class/net> ディレクトリツリー、ソケットなどである)。 物理ネットワークデバイスが所属できるネットワーク名前空間は一つだけである。 仮想ネットワークデバイス (\"veth\") のペアにより パイプ風の抽象化 (abstraction) が実現されており、 これを使うことで、ネットワーク名前空間間のトンネルを作成したり、 別の名前空間の物理ネットワークデバイスへのブリッジを作成したり することができる。"
968
969 #. type: Plain text
970 #: build/C/man2/clone.2:352
971 msgid "When a network namespace is freed (i.e., when the last process in the namespace terminates), its physical network devices are moved back to the initial network namespace (not to the parent of the process).  For further information on network namespaces, see B<namespaces>(7)."
972 msgstr "ネットワーク名前空間が解放される時 (すなわち、その名前空間の最後のプロセスが終了する時)、 物理ネットワークデバイスは初期ネットワーク名前空間 (initial network namespace) に戻される (親プロセスのネットワーク名前空間に戻される訳ではない)。 ネットワーク名前空間のさらなる情報は B<namespaces>(7) を参照。"
973
974 #. type: Plain text
975 #: build/C/man2/clone.2:357
976 msgid "Only a privileged process (B<CAP_SYS_ADMIN>)  can employ B<CLONE_NEWNET>."
977 msgstr "特権プロセス (B<CAP_SYS_ADMIN>) だけが B<CLONE_NEWNET> を使用できる。"
978
979 #. type: TP
980 #: build/C/man2/clone.2:357
981 #, no-wrap
982 msgid "B<CLONE_NEWNS> (since Linux 2.4.19)"
983 msgstr "B<CLONE_NEWNS> (Linux 2.4.19 以降)"
984
985 #. type: Plain text
986 #: build/C/man2/clone.2:367
987 msgid "If B<CLONE_NEWNS> is set, the cloned child is started in a new mount namespace, initialized with a copy of the namespace of the parent.  If B<CLONE_NEWNS> is not set, the child lives in the same mount namespace as the parent."
988 msgstr "B<CLONE_NEWNS> がセットされている場合、 clone で作成された子プロセスは新しいマウント名前空間で開始され、 新しい名前空間は親プロセスの名前空間のコピーで初期化される。 B<CLONE_NEWNS> がセットされていない場合、 子プロセスは親プロセスと同じマウント名前空間となる。"
989
990 #. type: Plain text
991 #: build/C/man2/clone.2:370
992 msgid "For further information on mount namespaces, see B<namespaces>(7)."
993 msgstr "マウント名前空間の詳細は B<namespaces>(7) を参照。"
994
995 #.  See https://lwn.net/Articles/543273/
996 #. type: Plain text
997 #: build/C/man2/clone.2:383
998 msgid "Only a privileged process (B<CAP_SYS_ADMIN>)  can employ B<CLONE_NEWNS>.  It is not permitted to specify both B<CLONE_NEWNS> and B<CLONE_FS> in the same B<clone>()  call."
999 msgstr "特権プロセス (B<CAP_SYS_ADMIN>) のみが B<CLONE_NEWNS> を指定することができる。 一つの B<clone>()  呼び出しで、 B<CLONE_NEWNS> と B<CLONE_FS> の両方を指定することはできない。"
1000
1001 #. type: TP
1002 #: build/C/man2/clone.2:383
1003 #, no-wrap
1004 msgid "B<CLONE_NEWPID> (since Linux 2.6.24)"
1005 msgstr "B<CLONE_NEWPID> (Linux 2.6.24 以降)"
1006
1007 #.  This explanation draws a lot of details from
1008 #.  http://lwn.net/Articles/259217/
1009 #.  Authors: Pavel Emelyanov <xemul@openvz.org>
1010 #.  and Kir Kolyshkin <kir@openvz.org>
1011 #.  The primary kernel commit is 30e49c263e36341b60b735cbef5ca37912549264
1012 #.  Author: Pavel Emelyanov <xemul@openvz.org>
1013 #. type: Plain text
1014 #: build/C/man2/clone.2:400
1015 msgid "If B<CLONE_NEWPID> is set, then create the process in a new PID namespace.  If this flag is not set, then (as with B<fork>(2))  the process is created in the same PID namespace as the calling process.  This flag is intended for the implementation of containers."
1016 msgstr "B<CLONE_NEWPID> が設定された場合、新しい PID 名前空間でプロセスを作成する。 このフラグが設定されていない場合、 (B<fork>(2)  の場合と同様) 呼び出し元のプロセスと同じ PID 名前空間で プロセスが作成される。 このフラグは、コンテナの実装での使用を意図して用意されたものである。"
1017
1018 #. type: Plain text
1019 #: build/C/man2/clone.2:405
1020 msgid "For further information on PID namespaces, see B<namespaces>(7)  and B<pid_namespaces>(7)"
1021 msgstr "PID 名前空間の詳細は B<namespaces>(7) と B<pid_namespaces>(7) を参照。"
1022
1023 #. type: Plain text
1024 #: build/C/man2/clone.2:414
1025 msgid "Only a privileged process (B<CAP_SYS_ADMIN>)  can employ B<CLONE_NEWPID>.  This flag can't be specified in conjunction with B<CLONE_THREAD> or B<CLONE_PARENT>."
1026 msgstr "特権プロセス (B<CAP_SYS_ADMIN>) だけが B<CLONE_NEWPID> を使用できる。 このフラグは B<CLONE_THREAD> や B<CLONE_PARENT> と組み合わせて指定することはできない。"
1027
1028 #. type: TP
1029 #: build/C/man2/clone.2:414
1030 #, no-wrap
1031 msgid "B<CLONE_NEWUSER>"
1032 msgstr "B<CLONE_NEWUSER>"
1033
1034 #. type: Plain text
1035 #: build/C/man2/clone.2:424
1036 msgid "(This flag first became meaningful for B<clone>()  in Linux 2.6.23, the current B<clone>()  semantics were merged in Linux 3.5, and the final pieces to make the user namespaces completely usable were merged in Linux 3.8.)"
1037 msgstr "(このフラグが B<clone>() で意味を持つようになったのは Linux 2.6.23 である。 現在の B<clone>() の動作が取り込まれたのは Linux 3.5 であり、 ユーザー名前空間が完全に機能するようにする最後の機能が取り込まれたのは Linux 3.8 である。)"
1038
1039 #. type: Plain text
1040 #: build/C/man2/clone.2:431
1041 msgid "If B<CLONE_NEWUSER> is set, then create the process in a new user namespace.  If this flag is not set, then (as with B<fork>(2))  the process is created in the same user namespace as the calling process."
1042 msgstr "B<CLONE_NEWUSER> がセットされている場合、新しいユーザー名前空間でプロセスを作成する。 このフラグがセットされていない場合、 (B<fork>(2)  の場合と同様に) 呼び出し元のプロセスと同じユーザー名前空間でプロセスが作成される。"
1043
1044 #. type: Plain text
1045 #: build/C/man2/clone.2:436
1046 msgid "For further information on user namespaces, see B<namespaces>(7)  and B<user_namespaces>(7)"
1047 msgstr "ユーザー名前空間の詳細は B<namespaces>(7) と B<user_namespaces>(7) を参照。"
1048
1049 #.  Before Linux 2.6.29, it appears that only CAP_SYS_ADMIN was needed
1050 #. type: Plain text
1051 #: build/C/man2/clone.2:447
1052 msgid "Before Linux 3.8, use of B<CLONE_NEWUSER> required that the caller have three capabilities: B<CAP_SYS_ADMIN>, B<CAP_SETUID>, and B<CAP_SETGID>.  Starting with Linux 3.8, no privileges are needed to create a user namespace."
1053 msgstr "Linux 3.8 より前では、 B<CLONE_NEWUSER> を使用するには、 呼び出し元は B<CAP_SYS_ADMIN>, B<CAP_SETUID>, B<CAP_SETGID> の 3 つのケーパリビティを持っている必要があった。 Linux 3.8 以降では、 ユーザー名前空間を作成するのに特権は必要なくなった。"
1054
1055 #.  commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
1056 #.  https://lwn.net/Articles/543273/
1057 #.  The fix actually went into 3.9 and into 3.8.3. However, user namespaces
1058 #.  were, for practical purposes, unusable in earlier 3.8.x because of the
1059 #.  various filesystems that didn't support userns.
1060 #. type: Plain text
1061 #: build/C/man2/clone.2:461
1062 msgid "This flag can't be specified in conjunction with B<CLONE_THREAD> or B<CLONE_PARENT>.  For security reasons, B<CLONE_NEWUSER> cannot be specified in conjunction with B<CLONE_FS>."
1063 msgstr "このフラグは B<CLONE_THREAD> や B<CLONE_PARENT> と組み合わせて指定することはできない。 セキュリティ上の理由から、 B<CLONE_NEWUSER> は B<CLONE_FS> と組み合わせて指定することはできない。"
1064
1065 #. type: Plain text
1066 #: build/C/man2/clone.2:464 build/C/man2/unshare.2:209
1067 msgid "For further information on user namespaces, see B<user_namespaces>(7)."
1068 msgstr "ユーザー名前空間の詳細は B<user_namespaces>(7) を参照。"
1069
1070 #. type: TP
1071 #: build/C/man2/clone.2:464 build/C/man2/unshare.2:209
1072 #, no-wrap
1073 msgid "B<CLONE_NEWUTS> (since Linux 2.6.19)"
1074 msgstr "B<CLONE_NEWUTS> (Linux 2.6.19 以降)"
1075
1076 #. type: Plain text
1077 #: build/C/man2/clone.2:476
1078 msgid "If B<CLONE_NEWUTS> is set, then create the process in a new UTS namespace, whose identifiers are initialized by duplicating the identifiers from the UTS namespace of the calling process.  If this flag is not set, then (as with B<fork>(2))  the process is created in the same UTS namespace as the calling process.  This flag is intended for the implementation of containers."
1079 msgstr "B<CLONE_NEWUTS> が設定された場合、新しい UTS 名前空間でプロセスを作成する。 新しい UTS 名前空間の識別子の初期値は、呼び出し元のプロセスの UTS 名前空間の識別子を複製したものとなる。 このフラグが設定されていない場合、 (B<fork>(2)  の場合と同様) 呼び出し元のプロセスと同じ UTS 名前空間で プロセスが作成される。 このフラグは、コンテナの実装での使用を意図して用意されたものである。"
1080
1081 #. type: Plain text
1082 #: build/C/man2/clone.2:487
1083 msgid "A UTS namespace is the set of identifiers returned by B<uname>(2); among these, the domain name and the hostname can be modified by B<setdomainname>(2)  and B<sethostname>(2), respectively.  Changes made to the identifiers in a UTS namespace are visible to all other processes in the same namespace, but are not visible to processes in other UTS namespaces."
1084 msgstr "UTS 名前空間は、 B<uname>(2)  が返す識別子の集合である。 識別子としてはドメイン名とホスト名があり、 それぞれ B<setdomainname>(2), B<sethostname>(2)  で修正することができる。 ある UTS 名前空間における識別子の変更は同じ名前空間の他のすべての プロセスに見えるが、別の UTS 名前空間のプロセスには見えない。"
1085
1086 #. type: Plain text
1087 #: build/C/man2/clone.2:492
1088 msgid "Only a privileged process (B<CAP_SYS_ADMIN>)  can employ B<CLONE_NEWUTS>."
1089 msgstr "特権プロセス (B<CAP_SYS_ADMIN>) だけが B<CLONE_NEWUTS> を使用できる。"
1090
1091 #. type: Plain text
1092 #: build/C/man2/clone.2:495
1093 msgid "For further information on UTS namespaces, see B<namespaces>(7)."
1094 msgstr "UTS 名前空間の詳細は B<namespaces>(7) を参照。"
1095
1096 #. type: TP
1097 #: build/C/man2/clone.2:495
1098 #, no-wrap
1099 msgid "B<CLONE_PARENT> (since Linux 2.3.12)"
1100 msgstr "B<CLONE_PARENT> (Linux 2.3.12 以降)"
1101
1102 #. type: Plain text
1103 #: build/C/man2/clone.2:502
1104 msgid "If B<CLONE_PARENT> is set, then the parent of the new child (as returned by B<getppid>(2))  will be the same as that of the calling process."
1105 msgstr "B<CLONE_PARENT> が設定された場合、新しい子供の (B<getppid>(2)  で返される) 親プロセスは呼び出し元のプロセスの親プロセスと同じになる。"
1106
1107 #. type: Plain text
1108 #: build/C/man2/clone.2:508
1109 msgid "If B<CLONE_PARENT> is not set, then (as with B<fork>(2))  the child's parent is the calling process."
1110 msgstr "B<CLONE_PARENT> が設定されていない場合、 (B<fork>(2)  と同様に) 呼び出し元のプロセスがその子供の親になる。"
1111
1112 #. type: Plain text
1113 #: build/C/man2/clone.2:516
1114 msgid "Note that it is the parent process, as returned by B<getppid>(2), which is signaled when the child terminates, so that if B<CLONE_PARENT> is set, then the parent of the calling process, rather than the calling process itself, will be signaled."
1115 msgstr "子供が終了した時にシグナルが送られるのは B<getppid>(2)  が返す親プロセスである点に注意すること。このため B<CLONE_PARENT> が設定された場合、呼び出し元のプロセスではなく呼び出し元のプロセスの 親プロセスにシグナルが送られる。"
1116
1117 #. type: TP
1118 #: build/C/man2/clone.2:516
1119 #, no-wrap
1120 msgid "B<CLONE_PARENT_SETTID> (since Linux 2.5.49)"
1121 msgstr "B<CLONE_PARENT_SETTID> (Linux 2.5.49 以降)"
1122
1123 #. type: Plain text
1124 #: build/C/man2/clone.2:524
1125 msgid "Store child thread ID at location I<ptid> in parent and child memory.  (In Linux 2.5.32-2.5.48 there was a flag B<CLONE_SETTID> that did this.)"
1126 msgstr "親プロセスと子プロセスのメモリ内の I<ptid> が指す領域に子プロセスのスレッド ID を格納する。 (Linux 2.5.32-2.5.48 では、 同じことをする B<CLONE_SETTID> というフラグが存在した。)"
1127
1128 #. type: TP
1129 #: build/C/man2/clone.2:524
1130 #, no-wrap
1131 msgid "B<CLONE_PID> (obsolete)"
1132 msgstr "B<CLONE_PID> (廃止予定)"
1133
1134 #. type: Plain text
1135 #: build/C/man2/clone.2:535
1136 msgid "If B<CLONE_PID> is set, the child process is created with the same process ID as the calling process.  This is good for hacking the system, but otherwise of not much use.  Since 2.3.21 this flag can be specified only by the system boot process (PID 0).  It disappeared in Linux 2.5.16."
1137 msgstr "B<CLONE_PID> が設定された場合、子プロセスは呼び出し元のプロセスと同じプロセス ID で作成される。これはシステムをハッキングするのには便利だが、 それ以外にはあまり使われない。 Linux 2.3.21 以降では、 システムのブートプロセス (PID 0) だけがこのフラグを指定できる。 Linux 2.5.16 で削除された。"
1138
1139 #. type: TP
1140 #: build/C/man2/clone.2:535
1141 #, no-wrap
1142 msgid "B<CLONE_PTRACE> (since Linux 2.2)"
1143 msgstr "B<CLONE_PTRACE> (Linux 2.2 以降)"
1144
1145 #. type: Plain text
1146 #: build/C/man2/clone.2:542
1147 msgid "If B<CLONE_PTRACE> is specified, and the calling process is being traced, then trace the child also (see B<ptrace>(2))."
1148 msgstr "B<CLONE_PTRACE> が指定され、かつ呼び出し元のプロセスが追跡 (trace) されていた場合、子プロセスも 同様に追跡される。 (B<ptrace>(2)  を参照のこと)"
1149
1150 #. type: TP
1151 #: build/C/man2/clone.2:542
1152 #, no-wrap
1153 msgid "B<CLONE_SETTLS> (since Linux 2.5.32)"
1154 msgstr "B<CLONE_SETTLS> (Linux 2.5.32 以降)"
1155
1156 #. type: Plain text
1157 #: build/C/man2/clone.2:549
1158 msgid "The I<newtls> argument is the new TLS (Thread Local Storage) descriptor.  (See B<set_thread_area>(2).)"
1159 msgstr "I<newtls> 引き数は、新しい TLS (Thread Local Storage) ディスクリプターである。 (B<set_thread_area>(2)  を参照のこと)"
1160
1161 #. type: TP
1162 #: build/C/man2/clone.2:549
1163 #, no-wrap
1164 msgid "B<CLONE_SIGHAND> (since Linux 2.0)"
1165 msgstr "B<CLONE_SIGHAND> (Linux 2.0 以降)"
1166
1167 #. type: Plain text
1168 #: build/C/man2/clone.2:565
1169 msgid "If B<CLONE_SIGHAND> is set, the calling process and the child process share the same table of signal handlers.  If the calling process or child process calls B<sigaction>(2)  to change the behavior associated with a signal, the behavior is changed in the other process as well.  However, the calling process and child processes still have distinct signal masks and sets of pending signals.  So, one of them may block or unblock some signals using B<sigprocmask>(2)  without affecting the other process."
1170 msgstr "B<CLONE_SIGHAND> が設定された場合、呼び出し元のプロセスと子プロセスは同じシグナルハン ドラのテーブルを共有する。呼び出し元のプロセスまたは子プロセスのどちらかが B<sigaction>(2)  を呼び出してシグナルに対応する動作を変更した場合、 もう一方のプロセスのシグナル動作も変更される。 但し、呼び出し元のプロセスと子プロセスは、 プロセス毎に、シグナルマスク (signal mask) と処理待ちシグナルの集合 を持っている。このため、あるプロセスは、 B<sigprocmask>(2)  を使用して、もう一方のプロセスに影響を与えずに シグナルを禁止 (block) したり許可 (unblock) したりできる。"
1171
1172 #. type: Plain text
1173 #: build/C/man2/clone.2:576
1174 msgid "If B<CLONE_SIGHAND> is not set, the child process inherits a copy of the signal handlers of the calling process at the time B<clone>()  is called.  Calls to B<sigaction>(2)  performed later by one of the processes have no effect on the other process."
1175 msgstr "B<CLONE_SIGHAND> が設定されていない場合、子プロセスは B<clone>()  が実行された時点での、呼び出し元のプロセスのシグナルハンドラの コピーを継承する。これ以降は、一方のプロセスが B<sigaction>(2)  を呼び出しても、もう一方のプロセスには影響を与えない。"
1176
1177 #. type: Plain text
1178 #: build/C/man2/clone.2:584
1179 msgid "Since Linux 2.6.0-test6, I<flags> must also include B<CLONE_VM> if B<CLONE_SIGHAND> is specified"
1180 msgstr "Linux 2.6.0-test6 以降では、 B<CLONE_SIGHAND> を指定する場合、 B<CLONE_VM> も I<flags> に含めなければならない。"
1181
1182 #. type: TP
1183 #: build/C/man2/clone.2:584
1184 #, no-wrap
1185 msgid "B<CLONE_STOPPED> (since Linux 2.6.0-test2)"
1186 msgstr "B<CLONE_STOPPED> (Linux 2.6.0-test2 以降)"
1187
1188 #. type: Plain text
1189 #: build/C/man2/clone.2:593
1190 msgid "If B<CLONE_STOPPED> is set, then the child is initially stopped (as though it was sent a B<SIGSTOP> signal), and must be resumed by sending it a B<SIGCONT> signal."
1191 msgstr "B<CLONE_STOPPED> が設定されると、子プロセスは最初 (B<SIGSTOP> シグナルを送られたかのように) 停止した状態となる。 子プロセスを再開させるには B<SIGCONT> シグナルを送信しなければならない。"
1192
1193 #.  glibc 2.8 removed this defn from bits/sched.h
1194 #. type: Plain text
1195 #: build/C/man2/clone.2:601
1196 msgid "This flag was I<deprecated> from Linux 2.6.25 onward, and was I<removed> altogether in Linux 2.6.38."
1197 msgstr ""
1198 "このフラグは Linux 2.6.25 以降ではI<非推奨>であり、\n"
1199 "Linux 2.6.38 で完全にI<削除>された。"
1200
1201 #. type: TP
1202 #: build/C/man2/clone.2:601
1203 #, no-wrap
1204 msgid "B<CLONE_SYSVSEM> (since Linux 2.5.10)"
1205 msgstr "B<CLONE_SYSVSEM> (Linux 2.5.10 以降)"
1206
1207 #. type: Plain text
1208 #: build/C/man2/clone.2:619
1209 msgid "If B<CLONE_SYSVSEM> is set, then the child and the calling process share a single list of System V semaphore adjustment (I<semadj>)  values (see B<semop>(2)).  In this case, the shared list accumulates I<semadj> values across all processes sharing the list, and semaphore adjustments are performed only when the last process that is sharing the list terminates (or ceases sharing the list using B<unshare>(2)).  If this flag is not set, then the child has a separate I<semadj> list that is initially empty."
1210 msgstr "B<CLONE_SYSVSEM> がセットされると、子プロセスと呼び出し元プロセスは一つの System\\ V セマフォの調整値 (I<semadj>) (B<semop>(2)  参照) を共有する。 この場合、共有されたリストはこのリストを共有する全プロセスの I<semadj> 値を積算し、 セマフォ調整はこのリストを共有している最後のプロセスが終了した際 (または B<unshare>(2) を使ってリストの共有が中止された際) に実行される。 このフラグがセットされていなければ、 子プロセスは独自のセマフォ I<semadj> リストを持つ (リストの初期値は空である)。"
1211
1212 #. type: TP
1213 #: build/C/man2/clone.2:619
1214 #, no-wrap
1215 msgid "B<CLONE_THREAD> (since Linux 2.4.0-test8)"
1216 msgstr "B<CLONE_THREAD> (Linux 2.4.0-test8以降)"
1217
1218 #. type: Plain text
1219 #: build/C/man2/clone.2:628
1220 msgid "If B<CLONE_THREAD> is set, the child is placed in the same thread group as the calling process.  To make the remainder of the discussion of B<CLONE_THREAD> more readable, the term \"thread\" is used to refer to the processes within a thread group."
1221 msgstr "B<CLONE_THREAD> が設定された場合、子プロセスは呼び出し元のプロセスと同じスレッドグループに 置かれる。 B<CLONE_THREAD> についての以降の議論を読みやすくするため、 「スレッド」という用語はスレッドグループの中のプロセスを 参照するのに使うこととする。"
1222
1223 #. type: Plain text
1224 #: build/C/man2/clone.2:636
1225 msgid "Thread groups were a feature added in Linux 2.4 to support the POSIX threads notion of a set of threads that share a single PID.  Internally, this shared PID is the so-called thread group identifier (TGID) for the thread group.  Since Linux 2.4, calls to B<getpid>(2)  return the TGID of the caller."
1226 msgstr "スレッドグループは、 スレッド集合で一つの PID を共有するという POSIX スレッドの概念をサポートするために Linux 2.4 に加えられた機能であった。 内部的には、この共有 PID はいわゆるそのスレッドグループの スレッドグループ識別子 (TGID) である。 Linux 2.4 以降では、 B<getpid>(2)  の呼び出しではそのプロセスのスレッドグループ ID を返す。"
1227
1228 #. type: Plain text
1229 #: build/C/man2/clone.2:645
1230 msgid "The threads within a group can be distinguished by their (system-wide)  unique thread IDs (TID).  A new thread's TID is available as the function result returned to the caller of B<clone>(), and a thread can obtain its own TID using B<gettid>(2)."
1231 msgstr "あるグループに属するスレッドは (システム全体で) 一意なスレッド ID (TID)  で区別できる。新しいスレッドの TID は B<clone>()  の呼び出し元へ関数の結果として返され、 スレッドは自分自身の TID を B<gettid>(2)  で取得できる。"
1232
1233 #. type: Plain text
1234 #: build/C/man2/clone.2:655
1235 msgid "When a call is made to B<clone>()  without specifying B<CLONE_THREAD>, then the resulting thread is placed in a new thread group whose TGID is the same as the thread's TID.  This thread is the I<leader> of the new thread group."
1236 msgstr "B<CLONE_THREAD> を指定せずに B<clone>()  の呼び出しが行われると、 生成されたスレッドはそのスレッドの TID と同じ値の TGID を持つ 新しいスレッドグループに置かれる。このスレッドは 新しいスレッドグループの「リーダー」である。"
1237
1238 #. type: Plain text
1239 #: build/C/man2/clone.2:677
1240 msgid "A new thread created with B<CLONE_THREAD> has the same parent process as the caller of B<clone>()  (i.e., like B<CLONE_PARENT>), so that calls to B<getppid>(2)  return the same value for all of the threads in a thread group.  When a B<CLONE_THREAD> thread terminates, the thread that created it using B<clone>()  is not sent a B<SIGCHLD> (or other termination) signal; nor can the status of such a thread be obtained using B<wait>(2).  (The thread is said to be I<detached>.)"
1241 msgstr "B<CLONE_THREAD> を指定して作成された新しいスレッドは、 (B<CLONE_PARENT> の場合と同様に)  B<clone>()  を呼び出し元と同じ親プロセスを持つ。 そのため、 B<getppid>(2)  を呼ぶと、一つのスレッドグループに属すスレッドは全て同じ値を返す。 B<CLONE_THREAD> で作られたスレッドが終了した際に、 そのスレッドを B<clone>()  を使って生成したスレッドには B<SIGCHLD> (もしくは他の終了シグナル) は送信されない。 また、 B<wait>(2)  を使って終了したスレッドの状態を取得することもできない (そのようなスレッドは I<detached> (分離された) といわれる)。"
1242
1243 #. type: Plain text
1244 #: build/C/man2/clone.2:682
1245 msgid "After all of the threads in a thread group terminate the parent process of the thread group is sent a B<SIGCHLD> (or other termination) signal."
1246 msgstr "スレッドグループに属す全てのスレッドが終了した後、 そのスレッドグループの親プロセスに B<SIGCHLD> (もしくは他の終了シグナル) が送られる。"
1247
1248 #. type: Plain text
1249 #: build/C/man2/clone.2:687
1250 msgid "If any of the threads in a thread group performs an B<execve>(2), then all threads other than the thread group leader are terminated, and the new program is executed in the thread group leader."
1251 msgstr "スレッドグループに属すいずれかのスレッドが B<execve>(2)  を実行すると、スレッドグループリーダー以外の全てのスレッドは 終了され、新しいプロセスがそのスレッドグループリーダーの下で 実行される。"
1252
1253 #. type: Plain text
1254 #: build/C/man2/clone.2:693
1255 msgid "If one of the threads in a thread group creates a child using B<fork>(2), then any thread in the group can B<wait>(2)  for that child."
1256 msgstr "スレッドグループに属すスレッドの一つが B<fork>(2)  を使って子プロセスを作成した場合、 スレッドグループのどのスレッドであっても その子供を B<wait>(2)  できる。"
1257
1258 #. type: Plain text
1259 #: build/C/man2/clone.2:706
1260 msgid "Since Linux 2.5.35, I<flags> must also include B<CLONE_SIGHAND> if B<CLONE_THREAD> is specified (and note that, since Linux 2.6.0-test6, B<CLONE_SIGHAND> also requires B<CLONE_VM> to be included)."
1261 msgstr "Linux 2.5.35 以降では、 B<CLONE_THREAD> を指定する場合、 I<flags> に B<CLONE_SIGHAND> も含まれていなければならない (Linux 2.6.0-test6 以降では、 B<CLONE_SIGHAND> を指定する場合 B<CLONE_VM> も指定する必要がある点に注意すること)。"
1262
1263 #. type: Plain text
1264 #: build/C/man2/clone.2:711
1265 msgid "Signals may be sent to a thread group as a whole (i.e., a TGID) using B<kill>(2), or to a specific thread (i.e., TID) using B<tgkill>(2)."
1266 msgstr "B<kill>(2)  を使ってスレッドグループ全体 (つまり TGID) にシグナルを送ることもできれば、 B<tgkill>(2)  を使って特定のスレッド (つまり TID) にシグナルを送ることもできる。"
1267
1268 #. type: Plain text
1269 #: build/C/man2/clone.2:716
1270 msgid "Signal dispositions and actions are process-wide: if an unhandled signal is delivered to a thread, then it will affect (terminate, stop, continue, be ignored in)  all members of the thread group."
1271 msgstr "シグナルの配送と処理はプロセス全体に影響する: ハンドラを設定していないシグナルがあるスレッドに配送されると、 そのシグナルはスレッドグループの全メンバーに影響を及ぼす (終了したり、停止したり、動作を継続したり、無視されたりする)。"
1272
1273 #. type: Plain text
1274 #: build/C/man2/clone.2:729
1275 msgid "Each thread has its own signal mask, as set by B<sigprocmask>(2), but signals can be pending either: for the whole process (i.e., deliverable to any member of the thread group), when sent with B<kill>(2); or for an individual thread, when sent with B<tgkill>(2).  A call to B<sigpending>(2)  returns a signal set that is the union of the signals pending for the whole process and the signals that are pending for the calling thread."
1276 msgstr "各々のスレッドは独自のシグナルマスクを持っており、 B<sigprocmask>(2)  で設定できる。 だが、処理待ちのシグナルには、 B<kill>(2)  で送信されるプロセス全体に対するもの (つまり、スレッドグループの どのメンバーにも配送できるもの) と、 B<tgkill>(2)  で送信される個々のスレッドに対するものがありえる。 B<sigpending>(2)  を呼び出すと、プロセス全体に対する処理待ちシグナルと呼び出し元の スレッドに対する処理待ちシグナルを結合したシグナル集合が返される。"
1277
1278 #. type: Plain text
1279 #: build/C/man2/clone.2:741
1280 msgid "If B<kill>(2)  is used to send a signal to a thread group, and the thread group has installed a handler for the signal, then the handler will be invoked in exactly one, arbitrarily selected member of the thread group that has not blocked the signal.  If multiple threads in a group are waiting to accept the same signal using B<sigwaitinfo>(2), the kernel will arbitrarily select one of these threads to receive a signal sent using B<kill>(2)."
1281 msgstr "B<kill>(2)  を使ってスレッドグループにシグナルが送られた場合で、 そのスレッドグループがそのシグナルに対するシグナルハンドラが 登録されていたときには、シグナルハンドラはスレッドグループの メンバーのうち、ただ一つのスレッドでだけ起動される。ハンドラが 起動されるスレッドは、そのシグナルを禁止 (block) していない メンバーの中から一つだけが勝手に (arbitrarily) 選ばれる。 スレッドグループに属す複数のスレッドが B<sigwaitinfo>(2)  を使って同じシグナルを待っている場合、 これらのスレッドの中から一つをカーネルが勝手に選択し、 そのスレッドが B<kill (2)> を使って送信されたシグナルを受信する。"
1282
1283 #. type: TP
1284 #: build/C/man2/clone.2:741
1285 #, no-wrap
1286 msgid "B<CLONE_UNTRACED> (since Linux 2.5.46)"
1287 msgstr "B<CLONE_UNTRACED> (Linux 2.5.46 以降)"
1288
1289 #. type: Plain text
1290 #: build/C/man2/clone.2:748
1291 msgid "If B<CLONE_UNTRACED> is specified, then a tracing process cannot force B<CLONE_PTRACE> on this child process."
1292 msgstr "B<CLONE_UNTRACED> が指定されると、 trace を行っているプロセスは この子プロセスに B<CLONE_PTRACE> を適用することができない。"
1293
1294 #. type: TP
1295 #: build/C/man2/clone.2:748
1296 #, no-wrap
1297 msgid "B<CLONE_VFORK> (since Linux 2.2)"
1298 msgstr "B<CLONE_VFORK> (Linux 2.2 以降)"
1299
1300 #. type: Plain text
1301 #: build/C/man2/clone.2:760
1302 msgid "If B<CLONE_VFORK> is set, the execution of the calling process is suspended until the child releases its virtual memory resources via a call to B<execve>(2)  or B<_exit>(2)  (as with B<vfork>(2))."
1303 msgstr "B<CLONE_VFORK> が設定された場合、 (B<vfork>(2)  と同様に) 子プロセスが B<execve>(2)  または B<_exit>(2)  によって仮想メモリを解放するまで、呼び出し元のプロセスの実行は停止される。"
1304
1305 #. type: Plain text
1306 #: build/C/man2/clone.2:766
1307 msgid "If B<CLONE_VFORK> is not set, then both the calling process and the child are schedulable after the call, and an application should not rely on execution occurring in any particular order."
1308 msgstr "B<CLONE_VFORK> が設定されていない場合、 B<clone>()  呼び出し後は、呼び出し元のプロセスと子プロセスの 両方がスケジュール対象となり、アプリケーションはこれらのプロセスの 実行順序に依存しないようにすべきである。"
1309
1310 #. type: TP
1311 #: build/C/man2/clone.2:766
1312 #, no-wrap
1313 msgid "B<CLONE_VM> (since Linux 2.0)"
1314 msgstr "B<CLONE_VM> (Linux 2.0 以降)"
1315
1316 #. type: Plain text
1317 #: build/C/man2/clone.2:779
1318 msgid "If B<CLONE_VM> is set, the calling process and the child process run in the same memory space.  In particular, memory writes performed by the calling process or by the child process are also visible in the other process.  Moreover, any memory mapping or unmapping performed with B<mmap>(2)  or B<munmap>(2)  by the child or calling process also affects the other process."
1319 msgstr "B<CLONE_VM> が設定された場合、呼び出し元のプロセスと子プロセスは同じメモリ空間で 実行される。特に、呼び出し元のプロセスや子プロセスの一方がメモリに 書き込んだ内容はもう一方のプロセスからも見ることができる。さらに、 子プロセスや呼び出し元のプロセスの一方が B<mmap>(2)  や B<munmap>(2)  を使ってメモリをマップしたりアンマップした場合、 もう一方のプロセスにも影響が及ぶ。"
1320
1321 #. type: Plain text
1322 #: build/C/man2/clone.2:788
1323 msgid "If B<CLONE_VM> is not set, the child process runs in a separate copy of the memory space of the calling process at the time of B<clone>().  Memory writes or file mappings/unmappings performed by one of the processes do not affect the other, as with B<fork>(2)."
1324 msgstr "B<CLONE_VM> が設定されていない場合、子プロセスは B<clone>()  が実行された時点での、親プロセスのメモリ空間をコピーした 別のメモリ空間で実行される。 一方のプロセスが行ったメモリへの書き込みや ファイルのマップ/アンマップは、 B<fork>(2)  の場合と同様、もう一方のプロセスには影響しない。"
1325
1326 #. type: SS
1327 #: build/C/man2/clone.2:788 build/C/man2/sched_setaffinity.2:212
1328 #, no-wrap
1329 msgid "C library/kernel ABI differences"
1330 msgstr "C ライブラリとカーネル ABI の違い"
1331
1332 #. type: Plain text
1333 #: build/C/man2/clone.2:804
1334 msgid "The raw B<clone>()  system call corresponds more closely to B<fork>(2)  in that execution in the child continues from the point of the call.  As such, the I<fn> and I<arg> arguments of the B<clone>()  wrapper function are omitted.  Furthermore, the argument order changes.  The raw system call interface on x86 and many other architectures is roughly:"
1335 msgstr "素の B<clone> システムコールは、より B<fork>(2) に近いかたちになっており、 子プロセスの実行が呼び出しが行われた場所から続けられる。 そのため、 B<clone>() ラッパー関数の引き数 I<fn> と I<arg> は省略される。 また、 引き数の順序も違っている。 x86 と他の多くのアーキテクチャーにおける、 素のシステムコールのインターフェースは、 おおまかには次のようになっている。"
1336
1337 #. type: Plain text
1338 #: build/C/man2/clone.2:810
1339 #, no-wrap
1340 msgid ""
1341 "B<long clone(unsigned long >I<flags>B<, void *>I<child_stack>B<,>\n"
1342 "B<           void *>I<ptid>B<, void *>I<ctid>B<,>\n"
1343 "B<           struct pt_regs *>I<regs>B<);>\n"
1344 msgstr ""
1345 "B<long clone(unsigned long >I<flags>B<, void *>I<child_stack>B<,>\n"
1346 "B<           void *>I<ptid>B<, void *>I<ctid>B<,>\n"
1347 "B<           struct pt_regs *>I<regs>B<);>\n"
1348
1349 #. type: Plain text
1350 #: build/C/man2/clone.2:821
1351 msgid "Another difference for the raw system call is that the I<child_stack> argument may be zero, in which case copy-on-write semantics ensure that the child gets separate copies of stack pages when either process modifies the stack.  In this case, for correct operation, the B<CLONE_VM> option should not be specified."
1352 msgstr "生のシステムコールのもう一つの違いは、 I<child_stack> 引き数がゼロでも良いことである。この場合には、どちらかのプロセスが スタックを変更した時に、書き込み時コピー (copy-on-write) 方式により 子プロセスがスタックページの独立したコピーを得られることが保証される。 この場合、正常に動作させるためには、 B<CLONE_VM> オプションを指定してはならない。"
1353
1354 #. type: Plain text
1355 #: build/C/man2/clone.2:829
1356 msgid "For some architectures, the order of the arguments for the system call differs from that shown above.  On the score, microblaze, ARM, ARM 64, PA-RISC, arc, Power PC, xtensa, and MIPS architectures, the order of the fourth and fifth arguments is reversed.  On the cris and s390 architectures, the order of the first and second arguments is reversed."
1357 msgstr "いくつかのアーキテクチャーでは、システムコールの引き数の順序は上記とは異なっている。 microblaze, ARM, ARM 64, PA-RISC, arc, Power PC, xtensa, MIPS アーキテクチャーでは、 4 番目と 5 番目の引き数の順番が逆である。 cris と s390 アーキテクチャーでは、最初と 2 番目の引き数の順番が逆である。"
1358
1359 #. type: SS
1360 #: build/C/man2/clone.2:829
1361 #, no-wrap
1362 msgid "blackfin, m68k, and sparc"
1363 msgstr "blackfin, m68k, sparc"
1364
1365 #. type: Plain text
1366 #: build/C/man2/clone.2:833
1367 msgid "The argument-passing conventions on blackfin, m68k, and sparc are different from the descriptions above.  For details, see the kernel (and glibc) source."
1368 msgstr "blackfin, m68k, sparc では引き数渡しの規約が上記の説明とは異なる。 詳細は、カーネル (と glibc) のソースを参照のこと。"
1369
1370 #. type: SS
1371 #: build/C/man2/clone.2:833
1372 #, no-wrap
1373 msgid "ia64"
1374 msgstr "ia64"
1375
1376 #. type: Plain text
1377 #: build/C/man2/clone.2:835
1378 msgid "On ia64, a different interface is used:"
1379 msgstr "ia64 では、別のインターフェースが使用される:"
1380
1381 #. type: Plain text
1382 #: build/C/man2/clone.2:842
1383 #, no-wrap
1384 msgid ""
1385 "B<int __clone2(int (*>I<fn>B<)(void *), >\n"
1386 "B<             void *>I<child_stack_base>B<, size_t >I<stack_size>B<,>\n"
1387 "B<             int >I<flags>B<, void *>I<arg>B<, ... >\n"
1388 "B<          /* pid_t *>I<ptid>B<, struct user_desc *>I<tls>B<, pid_t *>I<ctid>B< */ );>\n"
1389 msgstr ""
1390 "B<int __clone2(int (*>I<fn>B<)(void *), >\n"
1391 "B<             void *>I<child_stack_base>B<, size_t >I<stack_size>B<,>\n"
1392 "B<             int >I<flags>B<, void *>I<arg>B<, ... >\n"
1393 "B<          /* pid_t *>I<ptid>B<, struct user_desc *>I<tls>B<, pid_t *>I<ctid>B< */ );>\n"
1394
1395 #. type: Plain text
1396 #: build/C/man2/clone.2:854
1397 msgid "The prototype shown above is for the glibc wrapper function; the raw system call interface has no I<fn> or I<arg> argument, and changes the order of the arguments so that I<flags> is the first argument, and I<tls> is the last argument."
1398 msgstr "上記のプロトタイプは glibc ラッパー関数用のものである。 素のシステムコールのインターフェースには引き数 I<fn> と I<arg> がない。 また、引き数の順序が変わり、 I<flags> が最初の引き数で、 I<tls> が最後の引き数である。"
1399
1400 #. type: Plain text
1401 #: build/C/man2/clone.2:865
1402 msgid "B<__clone2>()  operates in the same way as B<clone>(), except that I<child_stack_base> points to the lowest address of the child's stack area, and I<stack_size> specifies the size of the stack pointed to by I<child_stack_base>."
1403 msgstr "B<__clone2>() は B<clone>() と同じように動作するが、以下の点が異なる: I<child_stack_base> は子プロセスのスタックエリアの最小のアドレスを指し、 I<stack_size> は I<child_stack_base> が指し示すスタックエリアの大きさを示す。"
1404
1405 #. type: SS
1406 #: build/C/man2/clone.2:865
1407 #, no-wrap
1408 msgid "Linux 2.4 and earlier"
1409 msgstr "Linux 2.4 以前"
1410
1411 #. type: Plain text
1412 #: build/C/man2/clone.2:873
1413 msgid "In Linux 2.4 and earlier, B<clone>()  does not take arguments I<ptid>, I<tls>, and I<ctid>."
1414 msgstr "Linux 2.4 以前では、 B<clone>()  は引き数 I<ptid>, I<tls>, I<ctid> を取らない。"
1415
1416 #.  gettid(2) returns current->pid;
1417 #.  getpid(2) returns current->tgid;
1418 #. type: Plain text
1419 #: build/C/man2/clone.2:882
1420 msgid "On success, the thread ID of the child process is returned in the caller's thread of execution.  On failure, -1 is returned in the caller's context, no child process will be created, and I<errno> will be set appropriately."
1421 msgstr "成功した場合、呼び出し元の実行スレッドには子プロセスのスレッドID が返される。 失敗した場合、 呼び出し元のコンテキストには -1 が返され、子プロセスは 作成されず、 I<errno> が適切に設定される。"
1422
1423 #. type: SH
1424 #: build/C/man2/clone.2:882 build/C/man2/kcmp.2:170
1425 #: build/C/man2/sched_get_priority_max.2:107 build/C/man3/sched_getcpu.3:65
1426 #: build/C/man2/sched_rr_get_interval.2:80
1427 #: build/C/man2/sched_setaffinity.2:116 build/C/man2/sched_setattr.2:271
1428 #: build/C/man2/sched_setparam.2:96 build/C/man2/sched_setscheduler.2:145
1429 #: build/C/man2/sched_yield.2:48 build/C/man2/setns.2:145
1430 #: build/C/man2/unshare.2:282
1431 #, no-wrap
1432 msgid "ERRORS"
1433 msgstr "エラー"
1434
1435 #. type: TP
1436 #: build/C/man2/clone.2:883
1437 #, no-wrap
1438 msgid "B<EAGAIN>"
1439 msgstr "B<EAGAIN>"
1440
1441 #. type: Plain text
1442 #: build/C/man2/clone.2:887
1443 msgid "Too many processes are already running; see B<fork>(2)."
1444 msgstr "すでに実行中のプロセスが多すぎる。 B<fork>(2) 参照。"
1445
1446 #. type: TP
1447 #: build/C/man2/clone.2:887 build/C/man2/clone.2:894 build/C/man2/clone.2:909
1448 #: build/C/man2/clone.2:926 build/C/man2/clone.2:934 build/C/man2/clone.2:946
1449 #: build/C/man2/clone.2:952 build/C/man2/clone.2:962 build/C/man2/clone.2:970
1450 #: build/C/man2/clone.2:978 build/C/man2/kcmp.2:181
1451 #: build/C/man2/sched_get_priority_max.2:108
1452 #: build/C/man2/sched_rr_get_interval.2:84
1453 #: build/C/man2/sched_setaffinity.2:120 build/C/man2/sched_setaffinity.2:128
1454 #: build/C/man2/sched_setattr.2:276 build/C/man2/sched_setattr.2:300
1455 #: build/C/man2/sched_setattr.2:323 build/C/man2/sched_setparam.2:97
1456 #: build/C/man2/sched_setparam.2:104 build/C/man2/sched_setscheduler.2:146
1457 #: build/C/man2/sched_setscheduler.2:153 build/C/man2/sched_setscheduler.2:158
1458 #: build/C/man2/setns.2:150 build/C/man2/setns.2:155 build/C/man2/setns.2:159
1459 #: build/C/man2/setns.2:164 build/C/man2/setns.2:168 build/C/man2/setns.2:175
1460 #: build/C/man2/unshare.2:283 build/C/man2/unshare.2:287
1461 #, no-wrap
1462 msgid "B<EINVAL>"
1463 msgstr "B<EINVAL>"
1464
1465 #. type: Plain text
1466 #: build/C/man2/clone.2:894
1467 msgid "B<CLONE_SIGHAND> was specified, but B<CLONE_VM> was not.  (Since Linux 2.6.0-test6.)"
1468 msgstr "B<CLONE_SIGHAND> が指定されていたが、 B<CLONE_VM> が指定されていなかった。 (Linux 2.6.0-test6 以降)"
1469
1470 #.  .TP
1471 #.  .B EINVAL
1472 #.  Precisely one of
1473 #.  .B CLONE_DETACHED
1474 #.  and
1475 #.  .B CLONE_THREAD
1476 #.  was specified.
1477 #.  (Since Linux 2.6.0-test6.)
1478 #. type: Plain text
1479 #: build/C/man2/clone.2:909
1480 msgid "B<CLONE_THREAD> was specified, but B<CLONE_SIGHAND> was not.  (Since Linux 2.5.35.)"
1481 msgstr "B<CLONE_THREAD> が指定されていたが、 B<CLONE_SIGHAND> が指定されていなかった。 (Linux 2.5.35 以降)"
1482
1483 #.  commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
1484 #. type: Plain text
1485 #: build/C/man2/clone.2:918
1486 msgid "Both B<CLONE_FS> and B<CLONE_NEWNS> were specified in I<flags>."
1487 msgstr "B<CLONE_FS> と B<CLONE_NEWNS> の両方が I<flags> に指定された。"
1488
1489 #. type: TP
1490 #: build/C/man2/clone.2:918
1491 #, no-wrap
1492 msgid "B<EINVAL> (since Linux 3.9)"
1493 msgstr "B<EINVAL> (Linux 3.9 以降)"
1494
1495 #. type: Plain text
1496 #: build/C/man2/clone.2:926
1497 msgid "Both B<CLONE_NEWUSER> and B<CLONE_FS> were specified in I<flags>."
1498 msgstr "B<CLONE_NEWUSER> と B<CLONE_FS> の両方が I<flags> に指定された。"
1499
1500 #. type: Plain text
1501 #: build/C/man2/clone.2:934
1502 msgid "Both B<CLONE_NEWIPC> and B<CLONE_SYSVSEM> were specified in I<flags>."
1503 msgstr "B<CLONE_NEWIPC> と B<CLONE_SYSVSEM> の両方が I<flags> に指定された。"
1504
1505 #. type: Plain text
1506 #: build/C/man2/clone.2:946
1507 msgid "One (or both) of B<CLONE_NEWPID> or B<CLONE_NEWUSER> and one (or both) of B<CLONE_THREAD> or B<CLONE_PARENT> were specified in I<flags>."
1508 msgstr "B<CLONE_NEWPID> と B<CLONE_NEWUSER> の一方 (もしくは両方) と、 B<CLONE_THREAD> と B<CLONE_PARENT>  の一方 (もしくは両方) が、 I<flags> に指定された。"
1509
1510 #. type: Plain text
1511 #: build/C/man2/clone.2:952
1512 msgid "Returned by B<clone>()  when a zero value is specified for I<child_stack>."
1513 msgstr "I<child_stack> にゼロを指定した場合に B<clone>()  が返す。"
1514
1515 #. type: Plain text
1516 #: build/C/man2/clone.2:962
1517 msgid "B<CLONE_NEWIPC> was specified in I<flags>, but the kernel was not configured with the B<CONFIG_SYSVIPC> and B<CONFIG_IPC_NS> options."
1518 msgstr "I<flags> に B<CLONE_NEWIPC> が指定されたが、カーネルでオプション B<CONFIG_SYSVIPC> と B<CONFIG_IPC_NS> が有効になっていなかった。"
1519
1520 #. type: Plain text
1521 #: build/C/man2/clone.2:970
1522 msgid "B<CLONE_NEWNET> was specified in I<flags>, but the kernel was not configured with the B<CONFIG_NET_NS> option."
1523 msgstr "I<flags> に B<CLONE_NEWNET> が指定されたが、カーネルでオプション B<CONFIG_NET_NS> が有効になっていなかった。"
1524
1525 #. type: Plain text
1526 #: build/C/man2/clone.2:978
1527 msgid "B<CLONE_NEWPID> was specified in I<flags>, but the kernel was not configured with the B<CONFIG_PID_NS> option."
1528 msgstr "I<flags> に B<CLONE_NEWPID> が指定されたが、カーネルでオプション B<CONFIG_PID_NS> が有効になっていなかった。"
1529
1530 #. type: Plain text
1531 #: build/C/man2/clone.2:986
1532 msgid "B<CLONE_NEWUTS> was specified in I<flags>, but the kernel was not configured with the B<CONFIG_UTS> option."
1533 msgstr "I<flags> に B<CLONE_NEWUTS> が指定されたが、カーネルでオプション B<CONFIG_UTS> が有効になっていなかった。"
1534
1535 #. type: TP
1536 #: build/C/man2/clone.2:986 build/C/man2/setns.2:179
1537 #: build/C/man2/unshare.2:296
1538 #, no-wrap
1539 msgid "B<ENOMEM>"
1540 msgstr "B<ENOMEM>"
1541
1542 #. type: Plain text
1543 #: build/C/man2/clone.2:991
1544 msgid "Cannot allocate sufficient memory to allocate a task structure for the child, or to copy those parts of the caller's context that need to be copied."
1545 msgstr "子プロセスのために確保すべきタスク構造体や、呼び出し元のコンテキストの 一部をコピーするのに必要なメモリを十分に割り当てることができない。"
1546
1547 #. type: TP
1548 #: build/C/man2/clone.2:991 build/C/man2/clone.2:1000
1549 #: build/C/man2/clone.2:1004 build/C/man2/kcmp.2:185
1550 #: build/C/man2/sched_setaffinity.2:135 build/C/man2/sched_setattr.2:339
1551 #: build/C/man2/sched_setattr.2:342 build/C/man2/sched_setparam.2:109
1552 #: build/C/man2/sched_setscheduler.2:164 build/C/man2/setns.2:182
1553 #: build/C/man2/unshare.2:300 build/C/man2/unshare.2:303
1554 #, no-wrap
1555 msgid "B<EPERM>"
1556 msgstr "B<EPERM>"
1557
1558 #. type: Plain text
1559 #: build/C/man2/clone.2:1000
1560 msgid "B<CLONE_NEWIPC>, B<CLONE_NEWNET>, B<CLONE_NEWNS>, B<CLONE_NEWPID>, or B<CLONE_NEWUTS> was specified by an unprivileged process (process without B<CAP_SYS_ADMIN>)."
1561 msgstr "非特権プロセス (B<CAP_SYS_ADMIN> を持たないプロセス) が B<CLONE_NEWIPC>, B<CLONE_NEWNET>, B<CLONE_NEWNS>, B<CLONE_NEWPID>, B<CLONE_NEWUTS> を指定した。"
1562
1563 #. type: Plain text
1564 #: build/C/man2/clone.2:1004
1565 msgid "B<CLONE_PID> was specified by a process other than process 0."
1566 msgstr "PID が 0 以外のプロセスによって B<CLONE_PID> が指定された。"
1567
1568 #. type: Plain text
1569 #: build/C/man2/clone.2:1012 build/C/man2/unshare.2:311
1570 msgid "B<CLONE_NEWUSER> was specified in I<flags>, but either the effective user ID or the effective group ID of the caller does not have a mapping in the parent namespace (see B<user_namespaces>(7))."
1571 msgstr "B<CLONE_NEWUSER> が I<flags> に指定されたが、 呼び出し元の実効ユーザー ID もしくは実効グループ ID が親名前空間にマッピングがない (B<user_namespaces>(7) 参照)。"
1572
1573 #. type: TP
1574 #: build/C/man2/clone.2:1012 build/C/man2/unshare.2:311
1575 #, no-wrap
1576 msgid "B<EPERM> (since Linux 3.9)"
1577 msgstr "B<EPERM> (Linux 3.9 以降)"
1578
1579 #.  commit 3151527ee007b73a0ebd296010f1c0454a919c7d
1580 #.  FIXME What is the rationale for this restriction?
1581 #. type: Plain text
1582 #: build/C/man2/clone.2:1022 build/C/man2/unshare.2:321
1583 msgid "B<CLONE_NEWUSER> was specified in I<flags> and the caller is in a chroot environment (i.e., the caller's root directory does not match the root directory of the mount namespace in which it resides)."
1584 msgstr "B<CLONE_NEWUSER> が I<flags> に指定され、 呼び出し元が chroot された環境にいる (すなわち、呼び出し元の root ディレクトリが呼び出し元が属するマウント名前空間の root ディレクトリに一致しない)。"
1585
1586 #. type: TP
1587 #: build/C/man2/clone.2:1022 build/C/man2/unshare.2:321
1588 #, no-wrap
1589 msgid "B<EUSERS> (since Linux 3.11)"
1590 msgstr "B<EUSERS> (Linux 3.11 以降)"
1591
1592 #. type: Plain text
1593 #: build/C/man2/clone.2:1031 build/C/man2/unshare.2:330
1594 msgid "B<CLONE_NEWUSER> was specified in I<flags>, and the call would cause the limit on the number of nested user namespaces to be exceeded.  See B<user_namespaces>(7)."
1595 msgstr "B<CLONE_NEWUSER> が I<flags> に指定されており、 この呼び出しによりネストされたユーザー名前空間数の上限を超えてしまう。 B<user_namespaces>(7) を参照。"
1596
1597 #. type: Plain text
1598 #: build/C/man2/clone.2:1038
1599 msgid "There is no entry for B<clone>()  in libc5.  glibc2 provides B<clone>()  as described in this manual page."
1600 msgstr "libc5 には B<clone>()  はない。glibc2 では B<clone>()  が提供されており、このマニュアルページに記載の通りである。"
1601
1602 #. type: Plain text
1603 #: build/C/man2/clone.2:1042
1604 msgid "B<clone>()  is Linux-specific and should not be used in programs intended to be portable."
1605 msgstr "B<clone>() は Linux 特有であり、移植を考慮したプログラムでは使用すべき ではない。"
1606
1607 #. type: Plain text
1608 #: build/C/man2/clone.2:1052
1609 msgid "In the kernel 2.4.x series, B<CLONE_THREAD> generally does not make the parent of the new thread the same as the parent of the calling process.  However, for kernel versions 2.4.7 to 2.4.18 the B<CLONE_THREAD> flag implied the B<CLONE_PARENT> flag (as in kernel 2.6)."
1610 msgstr "カーネル 2.4.x 系列では、一般的には B<CLONE_THREAD> フラグを指定しても新しいスレッドの親を 呼び出し元プロセスの親と同じにはしない。 しかし、バージョン 2.4.7〜2.4.18 のカーネルでは、 (カーネル 2.6 と同じように) CLONE_THREAD フラグを指定すると、 暗黙のうちに CLONE_PARENT フラグを指定したことになる。"
1611
1612 #. type: Plain text
1613 #: build/C/man2/clone.2:1062
1614 msgid "For a while there was B<CLONE_DETACHED> (introduced in 2.5.32): parent wants no child-exit signal.  In 2.6.2 the need to give this together with B<CLONE_THREAD> disappeared.  This flag is still defined, but has no effect."
1615 msgstr "B<CLONE_DETACHED> というフラグが、2.5.32 で導入されて以来しばらくの間存在した。 このフラグは親プロセスが子プロセス終了のシグナルを必要としないことを 表すものである。 2.6.2 で、 CLONE_DETATCHED を CLONE_THREAD と一緒に指定する必要はなくなった。 このフラグはまだ定義されているが、何の効果もない。"
1616
1617 #. type: Plain text
1618 #: build/C/man2/clone.2:1067
1619 msgid "On i386, B<clone>()  should not be called through vsyscall, but directly through I<int $0x80>."
1620 msgstr "i386 上では、 B<clone>()  は vsyscall 経由ではなく、直接 I<int $0x80> 経由で呼び出すべきである。"
1621
1622 #. type: Plain text
1623 #: build/C/man2/clone.2:1098
1624 msgid "Versions of the GNU C library that include the NPTL threading library contain a wrapper function for B<getpid>(2)  that performs caching of PIDs.  This caching relies on support in the glibc wrapper for B<clone>(), but as currently implemented, the cache may not be up to date in some circumstances.  In particular, if a signal is delivered to the child immediately after the B<clone>()  call, then a call to B<getpid>(2)  in a handler for the signal may return the PID of the calling process (\"the parent\"), if the clone wrapper has not yet had a chance to update the PID cache in the child.  (This discussion ignores the case where the child was created using B<CLONE_THREAD>, when B<getpid>(2)  I<should> return the same value in the child and in the process that called B<clone>(), since the caller and the child are in the same thread group.  The stale-cache problem also does not occur if the I<flags> argument includes B<CLONE_VM>.)  To get the truth, it may be necessary to use code such as the following:"
1625 msgstr "NPTL スレッドライブラリを含んでいる GNU C ライブラリのいくつかのバージョン には、 B<getpid>(2)  のラッパー関数が含まれており、このラッパー関数は PID をキャッシュする。 このキャッシュ処理が正しく動作するためには glibc の B<clone>()  のラッパー関数での助けが必要だが、現状の実装では、 ある状況下においてキャッシュが最新とならない可能性がある。 特に、 B<clone>()  の呼び出し直後にシグナルが子プロセスに配送された場合に、 そのシグナルに対するハンドラ内で B<getpid>(2)  を呼び出すと、それまでに clone のラッパー関数が子プロセスの PID キャッシュを 更新する機会が得られていなければ、呼び出し元プロセス (\"親プロセス\") の PID が 返される可能性がある。 (この議論では、子プロセスが B<CLONE_THREAD> を使って作成された場合のことは無視している。 子プロセスが B<CLONE_THREAD> を作って作成された場合には、 呼び出し元と子プロセスは同じスレッドグループに属すので、 B<getpid>(2)  は子プロセスと B<clone>()  を呼び出したプロセスで同じ値を返すのが「正しい」。 キャッシュが最新とならない問題 (stale-cache problem) は、 I<flags> に B<CLONE_VM> が含まれている場合にも発生しない。)  本当の値を得るためには、次のようなコードを使う必要があるかもしれない。"
1626
1627 #. type: Plain text
1628 #: build/C/man2/clone.2:1101
1629 #, no-wrap
1630 msgid "    #include E<lt>syscall.hE<gt>\n"
1631 msgstr "    #include E<lt>syscall.hE<gt>\n"
1632
1633 #. type: Plain text
1634 #: build/C/man2/clone.2:1103
1635 #, no-wrap
1636 msgid "    pid_t mypid;\n"
1637 msgstr "    pid_t mypid;\n"
1638
1639 #. type: Plain text
1640 #: build/C/man2/clone.2:1105
1641 #, no-wrap
1642 msgid "    mypid = syscall(SYS_getpid);\n"
1643 msgstr "    mypid = syscall(SYS_getpid);\n"
1644
1645 #. type: Plain text
1646 #: build/C/man2/clone.2:1119
1647 msgid "The following program demonstrates the use of B<clone>()  to create a child process that executes in a separate UTS namespace.  The child changes the hostname in its UTS namespace.  Both parent and child then display the system hostname, making it possible to see that the hostname differs in the UTS namespaces of the parent and child.  For an example of the use of this program, see B<setns>(2)."
1648 msgstr "以下のプログラムは、 別の UTS 名前空間で動作する子プロセスを B<clone>() を使って作成する例である。 子プロセスは、自分の UTS 名前空間においてホスト名を変更する。 それから、親プロセスと子プロセスの両方でシステムのホスト名を表示し、 親プロセスと子プロセスの UTS 名前空間でホスト名が異なることを確認する。 このプログラムの使用方法については B<setns>(2) を参照。"
1649
1650 #. type: SS
1651 #: build/C/man2/clone.2:1119 build/C/man2/setns.2:255
1652 #: build/C/man2/unshare.2:396
1653 #, no-wrap
1654 msgid "Program source"
1655 msgstr "プログラムのソース"
1656
1657 #. type: Plain text
1658 #: build/C/man2/clone.2:1129
1659 #, no-wrap
1660 msgid ""
1661 "#define _GNU_SOURCE\n"
1662 "#include E<lt>sys/wait.hE<gt>\n"
1663 "#include E<lt>sys/utsname.hE<gt>\n"
1664 "#include E<lt>sched.hE<gt>\n"
1665 "#include E<lt>string.hE<gt>\n"
1666 "#include E<lt>stdio.hE<gt>\n"
1667 "#include E<lt>stdlib.hE<gt>\n"
1668 "#include E<lt>unistd.hE<gt>\n"
1669 msgstr ""
1670 "#define _GNU_SOURCE\n"
1671 "#include E<lt>sys/wait.hE<gt>\n"
1672 "#include E<lt>sys/utsname.hE<gt>\n"
1673 "#include E<lt>sched.hE<gt>\n"
1674 "#include E<lt>string.hE<gt>\n"
1675 "#include E<lt>stdio.hE<gt>\n"
1676 "#include E<lt>stdlib.hE<gt>\n"
1677 "#include E<lt>unistd.hE<gt>\n"
1678
1679 #. type: Plain text
1680 #: build/C/man2/clone.2:1132 build/C/man2/setns.2:266
1681 #: build/C/man2/unshare.2:415
1682 #, no-wrap
1683 msgid ""
1684 "#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \\e\n"
1685 "                        } while (0)\n"
1686 msgstr ""
1687 "#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \\e\n"
1688 "                        } while (0)\n"
1689
1690 #. type: Plain text
1691 #: build/C/man2/clone.2:1137
1692 #, no-wrap
1693 msgid ""
1694 "static int              /* Start function for cloned child */\n"
1695 "childFunc(void *arg)\n"
1696 "{\n"
1697 "    struct utsname uts;\n"
1698 msgstr ""
1699 "static int              /* clone された子プロセスの開始関数 */\n"
1700 "childFunc(void *arg)\n"
1701 "{\n"
1702 "    struct utsname uts;\n"
1703
1704 #. type: Plain text
1705 #: build/C/man2/clone.2:1139
1706 #, no-wrap
1707 msgid "    /* Change hostname in UTS namespace of child */\n"
1708 msgstr "    /* 子プロセスの UTS 名前空間でホスト名を変更する */\n"
1709
1710 #. type: Plain text
1711 #: build/C/man2/clone.2:1142
1712 #, no-wrap
1713 msgid ""
1714 "    if (sethostname(arg, strlen(arg)) == -1)\n"
1715 "        errExit(\"sethostname\");\n"
1716 msgstr ""
1717 "    if (sethostname(arg, strlen(arg)) == -1)\n"
1718 "        errExit(\"sethostname\");\n"
1719
1720 #. type: Plain text
1721 #: build/C/man2/clone.2:1144
1722 #, no-wrap
1723 msgid "    /* Retrieve and display hostname */\n"
1724 msgstr "    /* ホスト名を取得し表示する */\n"
1725
1726 #. type: Plain text
1727 #: build/C/man2/clone.2:1148
1728 #, no-wrap
1729 msgid ""
1730 "    if (uname(&uts) == -1)\n"
1731 "        errExit(\"uname\");\n"
1732 "    printf(\"uts.nodename in child:  %s\\en\", uts.nodename);\n"
1733 msgstr ""
1734 "    if (uname(&uts) == -1)\n"
1735 "        errExit(\"uname\");\n"
1736 "    printf(\"uts.nodename in child:  %s\\en\", uts.nodename);\n"
1737
1738 #. type: Plain text
1739 #: build/C/man2/clone.2:1152
1740 #, no-wrap
1741 msgid ""
1742 "    /* Keep the namespace open for a while, by sleeping.\n"
1743 "       This allows some experimentation--for example, another\n"
1744 "       process might join the namespace. */\n"
1745 msgstr ""
1746 "    /* sleep を使ってしばらく名前空間をオープンされたままにする。\n"
1747 "       これにより実験を行うことができる -- 例えば、\n"
1748 "       別のプロセスがこの名前空間に参加するなど。 */\n"
1749
1750 #. type: Plain text
1751 #: build/C/man2/clone.2:1154
1752 #, no-wrap
1753 msgid "    sleep(200);\n"
1754 msgstr "    sleep(200);\n"
1755
1756 #. type: Plain text
1757 #: build/C/man2/clone.2:1157
1758 #, no-wrap
1759 msgid ""
1760 "    return 0;           /* Child terminates now */\n"
1761 "}\n"
1762 msgstr ""
1763 "    return 0;           /* 子プロセスを終了する */\n"
1764 "}\n"
1765
1766 #. type: Plain text
1767 #: build/C/man2/clone.2:1159
1768 #, no-wrap
1769 msgid "#define STACK_SIZE (1024 * 1024)    /* Stack size for cloned child */\n"
1770 msgstr "#define STACK_SIZE (1024 * 1024)    /* clone される子プロセスのスタックサイズ */\n"
1771
1772 #. type: Plain text
1773 #: build/C/man2/clone.2:1167
1774 #, no-wrap
1775 msgid ""
1776 "int\n"
1777 "main(int argc, char *argv[])\n"
1778 "{\n"
1779 "    char *stack;                    /* Start of stack buffer */\n"
1780 "    char *stackTop;                 /* End of stack buffer */\n"
1781 "    pid_t pid;\n"
1782 "    struct utsname uts;\n"
1783 msgstr ""
1784 "int\n"
1785 "main(int argc, char *argv[])\n"
1786 "{\n"
1787 "    char *stack;                    /* スタックバッファーの先頭 */\n"
1788 "    char *stackTop;                 /* スタックバッファーの末尾 */\n"
1789 "    pid_t pid;\n"
1790 "    struct utsname uts;\n"
1791
1792 #. type: Plain text
1793 #: build/C/man2/clone.2:1172
1794 #, no-wrap
1795 msgid ""
1796 "    if (argc E<lt> 2) {\n"
1797 "        fprintf(stderr, \"Usage: %s E<lt>child-hostnameE<gt>\\en\", argv[0]);\n"
1798 "        exit(EXIT_SUCCESS);\n"
1799 "    }\n"
1800 msgstr ""
1801 "    if (argc E<lt> 2) {\n"
1802 "        fprintf(stderr, \"Usage: %s E<lt>child-hostnameE<gt>\\en\", argv[0]);\n"
1803 "        exit(EXIT_SUCCESS);\n"
1804 "    }\n"
1805
1806 #. type: Plain text
1807 #: build/C/man2/clone.2:1174
1808 #, no-wrap
1809 msgid "    /* Allocate stack for child */\n"
1810 msgstr "    /* 子プロセス用のスタックを割り当てる */\n"
1811
1812 #. type: Plain text
1813 #: build/C/man2/clone.2:1179
1814 #, no-wrap
1815 msgid ""
1816 "    stack = malloc(STACK_SIZE);\n"
1817 "    if (stack == NULL)\n"
1818 "        errExit(\"malloc\");\n"
1819 "    stackTop = stack + STACK_SIZE;  /* Assume stack grows downward */\n"
1820 msgstr ""
1821 "    stack = malloc(STACK_SIZE);\n"
1822 "    if (stack == NULL)\n"
1823 "        errExit(\"malloc\");\n"
1824 "    stackTop = stack + STACK_SIZE;  /* スタックは下方向に伸びるものとする */\n"
1825
1826 #. type: Plain text
1827 #: build/C/man2/clone.2:1182
1828 #, no-wrap
1829 msgid ""
1830 "    /* Create child that has its own UTS namespace;\n"
1831 "       child commences execution in childFunc() */\n"
1832 msgstr ""
1833 "    /* 自分専用の UTS 名前空間を持つ子プロセスを作成する;\n"
1834 "       子プロセスは childFunc() の実行を開始する */\n"
1835
1836 #. type: Plain text
1837 #: build/C/man2/clone.2:1187
1838 #, no-wrap
1839 msgid ""
1840 "    pid = clone(childFunc, stackTop, CLONE_NEWUTS | SIGCHLD, argv[1]);\n"
1841 "    if (pid == -1)\n"
1842 "        errExit(\"clone\");\n"
1843 "    printf(\"clone() returned %ld\\en\", (long) pid);\n"
1844 msgstr ""
1845 "    pid = clone(childFunc, stackTop, CLONE_NEWUTS | SIGCHLD, argv[1]);\n"
1846 "    if (pid == -1)\n"
1847 "        errExit(\"clone\");\n"
1848 "    printf(\"clone() returned %ld\\en\", (long) pid);\n"
1849
1850 #. type: Plain text
1851 #: build/C/man2/clone.2:1189
1852 #, no-wrap
1853 msgid "    /* Parent falls through to here */\n"
1854 msgstr "    /* 親プロセスの実行はここに来る */\n"
1855
1856 #. type: Plain text
1857 #: build/C/man2/clone.2:1191
1858 #, no-wrap
1859 msgid "    sleep(1);           /* Give child time to change its hostname */\n"
1860 msgstr "    sleep(1);           /* 子プロセスがホスト名を変更する時間を与える */\n"
1861
1862 #. type: Plain text
1863 #: build/C/man2/clone.2:1194
1864 #, no-wrap
1865 msgid ""
1866 "    /* Display hostname in parent\\(aqs UTS namespace. This will be\n"
1867 "       different from hostname in child\\(aqs UTS namespace. */\n"
1868 msgstr ""
1869 "    /* 親プロセスの UTS 名前空間でのホスト名を表示する;\n"
1870 "       これは子プロセスの UTS 名前空間でのホスト名とは異なる */\n"
1871
1872 #. type: Plain text
1873 #: build/C/man2/clone.2:1198
1874 #, no-wrap
1875 msgid ""
1876 "    if (uname(&uts) == -1)\n"
1877 "        errExit(\"uname\");\n"
1878 "    printf(\"uts.nodename in parent: %s\\en\", uts.nodename);\n"
1879 msgstr ""
1880 "    if (uname(&uts) == -1)\n"
1881 "        errExit(\"uname\");\n"
1882 "    printf(\"uts.nodename in parent: %s\\en\", uts.nodename);\n"
1883
1884 #. type: Plain text
1885 #: build/C/man2/clone.2:1202
1886 #, no-wrap
1887 msgid ""
1888 "    if (waitpid(pid, NULL, 0) == -1)    /* Wait for child */\n"
1889 "        errExit(\"waitpid\");\n"
1890 "    printf(\"child has terminated\\en\");\n"
1891 msgstr ""
1892 "    if (waitpid(pid, NULL, 0) == -1)    /* 子プロセスを待つ */\n"
1893 "        errExit(\"waitpid\");\n"
1894 "    printf(\"child has terminated\\en\");\n"
1895
1896 #. type: Plain text
1897 #: build/C/man2/clone.2:1205
1898 #, no-wrap
1899 msgid ""
1900 "    exit(EXIT_SUCCESS);\n"
1901 "}\n"
1902 msgstr ""
1903 "    exit(EXIT_SUCCESS);\n"
1904 "}\n"
1905
1906 #. type: Plain text
1907 #: build/C/man2/clone.2:1221
1908 msgid "B<fork>(2), B<futex>(2), B<getpid>(2), B<gettid>(2), B<kcmp>(2), B<set_thread_area>(2), B<set_tid_address>(2), B<setns>(2), B<tkill>(2), B<unshare>(2), B<wait>(2), B<capabilities>(7), B<namespaces>(7), B<pthreads>(7)"
1909 msgstr "B<fork>(2), B<futex>(2), B<getpid>(2), B<gettid>(2), B<kcmp>(2), B<set_thread_area>(2), B<set_tid_address>(2), B<setns>(2), B<tkill>(2), B<unshare>(2), B<wait>(2), B<capabilities>(7), B<namespaces>(7), B<pthreads>(7)"
1910
1911 #. type: TH
1912 #: build/C/man2/kcmp.2:28
1913 #, no-wrap
1914 msgid "KCMP"
1915 msgstr "KCMP"
1916
1917 #. type: TH
1918 #: build/C/man2/kcmp.2:28
1919 #, no-wrap
1920 msgid "2013-12-08"
1921 msgstr "2013-12-08"
1922
1923 #. type: Plain text
1924 #: build/C/man2/kcmp.2:31
1925 msgid "kcmp - compare two processes to determine if they share a kernel resource"
1926 msgstr "kcmp - 二つのプロセスが同じカーネルリソースを共有しているかを比較する"
1927
1928 #. type: Plain text
1929 #: build/C/man2/kcmp.2:34
1930 #, no-wrap
1931 msgid "B<#include E<lt>linux/kcmp.hE<gt>>\n"
1932 msgstr "B<#include E<lt>linux/kcmp.hE<gt>>\n"
1933
1934 #. type: Plain text
1935 #: build/C/man2/kcmp.2:37
1936 #, no-wrap
1937 msgid ""
1938 "B<int kcmp(pid_t >I<pid1>B<, pid_t >I<pid2>B<, int >I<type>B<,>\n"
1939 "B<         unsigned long >I<idx1>B<, unsigned long >I<idx2>B<);>\n"
1940 msgstr ""
1941 "B<int kcmp(pid_t >I<pid1>B<, pid_t >I<pid2>B<, int >I<type>B<,>\n"
1942 "B<         unsigned long >I<idx1>B<, unsigned long >I<idx2>B<);>\n"
1943
1944 #. type: Plain text
1945 #: build/C/man2/kcmp.2:41
1946 msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
1947 msgstr "I<注>: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。"
1948
1949 #. type: Plain text
1950 #: build/C/man2/kcmp.2:50
1951 msgid "The B<kcmp>()  system call can be used to check whether the two processes identified by I<pid1> and I<pid2> share a kernel resource such as virtual memory, file descriptors, and so on."
1952 msgstr "システムコール B<kcmp>() を使うと、 ID が I<pid1> と I<pid2> の二つのプロセスが、 仮想メモリやファイルディスクリプターなどの、 同じカーネルリソースを共有しているかどうかを検査できる。"
1953
1954 #. type: Plain text
1955 #: build/C/man2/kcmp.2:55
1956 msgid "The I<type> argument specifies which resource is to be compared in the two processes.  It has one of the following values:"
1957 msgstr "I<type> 引き数は 2 つのプロセス間でどのリソースを比較するかを指定する。 以下のいずれかの値を指定する。"
1958
1959 #. type: TP
1960 #: build/C/man2/kcmp.2:55
1961 #, no-wrap
1962 msgid "B<KCMP_FILE>"
1963 msgstr "B<KCMP_FILE>"
1964
1965 #. type: Plain text
1966 #: build/C/man2/kcmp.2:67
1967 msgid "Check whether a file descriptor I<idx1> in the process I<pid1> refers to the same open file description (see B<open>(2))  as file descriptor I<idx2> in the process I<pid2>."
1968 msgstr "プロセス I<pid1> のファイルディスクリプター I<idx1> が、 プロセス I<pid2> のファイルディスクリプター I<idx2> と同じオープンファイル記述 (open file description) を参照しているかを検査する。"
1969
1970 #. type: TP
1971 #: build/C/man2/kcmp.2:67
1972 #, no-wrap
1973 msgid "B<KCMP_FILES>"
1974 msgstr "B<KCMP_FILES>"
1975
1976 #. type: Plain text
1977 #: build/C/man2/kcmp.2:75
1978 msgid "Check whether the process share the same set of open file descriptors.  The arguments I<idx1> and I<idx2> are ignored."
1979 msgstr "二つのプロセスが同じオープンファイル記述の集合を共有しているかを検査する。 引き数 I<idx1> と I<idx2> は無視される。"
1980
1981 #. type: TP
1982 #: build/C/man2/kcmp.2:75
1983 #, no-wrap
1984 msgid "B<KCMP_FS>"
1985 msgstr "B<KCMP_FS>"
1986
1987 #. type: Plain text
1988 #: build/C/man2/kcmp.2:84
1989 msgid "Check whether the processes share the same filesystem information (i.e., file mode creation mask, working directory, and filesystem root).  The arguments I<idx1> and I<idx2> are ignored."
1990 msgstr "二つのプロセスが同じファイルシステム情報 (すなわち、ファイルのモード作成マスク、作業ディレクトリ、ファイルシステムのルート) を共有しているかを検査する。 引き数 I<idx1> と I<idx2> は無視される。"
1991
1992 #. type: TP
1993 #: build/C/man2/kcmp.2:84
1994 #, no-wrap
1995 msgid "B<KCMP_IO>"
1996 msgstr "B<KCMP_IO>"
1997
1998 #. type: Plain text
1999 #: build/C/man2/kcmp.2:92
2000 msgid "Check whether the processes share I/O context.  The arguments I<idx1> and I<idx2> are ignored."
2001 msgstr "二つのプロセスが I/O コンテキストを共有しているかを検査する。 引き数 I<idx1> と I<idx2> は無視される。"
2002
2003 #. type: TP
2004 #: build/C/man2/kcmp.2:92
2005 #, no-wrap
2006 msgid "B<KCMP_SIGHAND>"
2007 msgstr "B<KCMP_SIGHAND>"
2008
2009 #. type: Plain text
2010 #: build/C/man2/kcmp.2:100
2011 msgid "Check whether the processes share the same table of signal dispositions.  The arguments I<idx1> and I<idx2> are ignored."
2012 msgstr "二つのプロセスがシグナル配送 (disposition) テーブルを共有しているかを検査する。 引き数 I<idx1> と I<idx2> は無視される。"
2013
2014 #. type: TP
2015 #: build/C/man2/kcmp.2:100
2016 #, no-wrap
2017 msgid "B<KCMP_SYSVSEM>"
2018 msgstr "B<KCMP_SYSVSEM>"
2019
2020 #. type: Plain text
2021 #: build/C/man2/kcmp.2:109
2022 msgid "Check whether the processes share the same list of System\\ V semaphore undo operations.  The arguments I<idx1> and I<idx2> are ignored."
2023 msgstr "二つのプロセスが同じ System\\ V セマフォ undo 操作のリストを共有しているかを検査する。 引き数 I<idx1> と I<idx2> は無視される。"
2024
2025 #. type: TP
2026 #: build/C/man2/kcmp.2:109
2027 #, no-wrap
2028 msgid "B<KCMP_VM>"
2029 msgstr "B<KCMP_VM>"
2030
2031 #. type: Plain text
2032 #: build/C/man2/kcmp.2:117
2033 msgid "Check whether the processes share the same address space.  The arguments I<idx1> and I<idx2> are ignored."
2034 msgstr "二つのプロセスが同じアドレス空間を共有しているかを検査する。 引き数 I<idx1> と I<idx2> は無視される。"
2035
2036 #. type: Plain text
2037 #: build/C/man2/kcmp.2:127
2038 msgid "Note the B<kcmp>()  is not protected against false positives which may occur if tasks are running.  One should stop tasks by sending B<SIGSTOP> (see B<signal>(7))  prior to inspection with this system call to obtain meaningful results."
2039 msgstr "B<kcmp>() には、タスクが実行されている場合に起こり得る誤判定 (false positive) に関する保護はない。 ということは、 意味のある結果を得るためには、 このシステムコールで検査を行う前に、 B<SIGSTOP> を送信してタスクを停止すべきだということだ (B<signal>(7) 参照)。"
2040
2041 #. type: Plain text
2042 #: build/C/man2/kcmp.2:133
2043 msgid "The return value of a successful call to B<kcmp>()  is simply the result of arithmetic comparison of kernel pointers (when the kernel compares resources, it uses their memory addresses)."
2044 msgstr "B<kcmp>() の呼び出しが成功した場合の返り値は、単にカーネルポインターを数値で比較した結果となる (カーネルはリソースを比較する際、リソースのメモリアドレスを使用する)。"
2045
2046 #. type: Plain text
2047 #: build/C/man2/kcmp.2:141
2048 msgid "The easiest way to explain is to consider an example.  Suppose that I<v1> and I<v2> are the addresses of appropriate resources, then the return value is one of the following:"
2049 msgstr "これを説明するには、例を見るのが一番簡単である。 I<v1> と I<v2> を適切なリソースのアドレスとすると、 返り値は以下のいずれか一つとなる。"
2050
2051 #. type: IP
2052 #: build/C/man2/kcmp.2:142
2053 #, no-wrap
2054 msgid "0"
2055 msgstr "0"
2056
2057 #. type: Plain text
2058 #: build/C/man2/kcmp.2:147
2059 msgid "I<v1> is equal to I<v2>; in other words, the two processes share the resource."
2060 msgstr "I<v1> は I<v2> と等しい。言い換えれば、二つのプロセスはそのリソースを共有している。"
2061
2062 #. type: IP
2063 #: build/C/man2/kcmp.2:147
2064 #, no-wrap
2065 msgid "1"
2066 msgstr "1"
2067
2068 #. type: Plain text
2069 #: build/C/man2/kcmp.2:151
2070 msgid "I<v1> is less than I<v2>."
2071 msgstr "I<v1> は I<v2> より小さい。"
2072
2073 #. type: IP
2074 #: build/C/man2/kcmp.2:151
2075 #, no-wrap
2076 msgid "2"
2077 msgstr "2"
2078
2079 #. type: Plain text
2080 #: build/C/man2/kcmp.2:155
2081 msgid "I<v1> is greater than I<v2>."
2082 msgstr "I<v1> は I<v2> より大きい。"
2083
2084 #. type: IP
2085 #: build/C/man2/kcmp.2:155
2086 #, no-wrap
2087 msgid "3"
2088 msgstr "3"
2089
2090 #. type: Plain text
2091 #: build/C/man2/kcmp.2:160
2092 msgid "I<v1> is not equal to I<v2>, but ordering information is unavailable."
2093 msgstr "I<v1> は I<v2> と等しくないが、順序情報がない。"
2094
2095 #. type: Plain text
2096 #: build/C/man2/kcmp.2:165
2097 msgid "On error, -1 is returned, and I<errno> is set appropriately."
2098 msgstr "エラーの場合は -1 が返され、 I<errno> が適切に設定される。"
2099
2100 #. type: Plain text
2101 #: build/C/man2/kcmp.2:170
2102 msgid "B<kcmp>()  was designed to return values suitable for sorting.  This is particularly handy if one needs to compare a large number of file descriptors."
2103 msgstr "B<kcmp>() は、ソートに適した値を返すように設計された。 大量のファイルディスクリプターを比較する必要がある場合に、特に役に立つ。"
2104
2105 #. type: TP
2106 #: build/C/man2/kcmp.2:171 build/C/man2/setns.2:146
2107 #, no-wrap
2108 msgid "B<EBADF>"
2109 msgstr "B<EBADF>"
2110
2111 #. type: Plain text
2112 #: build/C/man2/kcmp.2:181
2113 msgid "I<type> is B<KCMP_FILE> and I<fd1> or I<fd2> is not an open file descriptor."
2114 msgstr "I<type> が B<KCMP_FILE> で、かつ I<fd1> か I<fd2> がオープンファイル記述でない。"
2115
2116 #. type: Plain text
2117 #: build/C/man2/kcmp.2:185
2118 msgid "I<type> is invalid."
2119 msgstr "I<type> が無効である。"
2120
2121 #. type: Plain text
2122 #: build/C/man2/kcmp.2:191
2123 msgid "Insufficient permission to inspect process resources.  The B<CAP_SYS_PTRACE> capability is required to inspect processes that you do not own."
2124 msgstr "プロセスのリソースを検査するのに十分な許可がない。 自分が所有していないプロセスを検査するためには B<CAP_SYS_PTRACE> ケーパビリティが必要である。"
2125
2126 #. type: TP
2127 #: build/C/man2/kcmp.2:191 build/C/man2/sched_rr_get_interval.2:90
2128 #: build/C/man2/sched_setaffinity.2:145 build/C/man2/sched_setattr.2:284
2129 #: build/C/man2/sched_setparam.2:116 build/C/man2/sched_setscheduler.2:167
2130 #, no-wrap
2131 msgid "B<ESRCH>"
2132 msgstr "B<ESRCH>"
2133
2134 #. type: Plain text
2135 #: build/C/man2/kcmp.2:198
2136 msgid "Process I<pid1> or I<pid2> does not exist."
2137 msgstr "プロセス I<pid1> か I<pid2> が存在しない。"
2138
2139 #. type: Plain text
2140 #: build/C/man2/kcmp.2:202
2141 msgid "The B<kcmp>()  system call first appeared in Linux 3.5."
2142 msgstr "B<kcmp>() システムコールは Linux 3.5 で初めて登場した。"
2143
2144 #. type: Plain text
2145 #: build/C/man2/kcmp.2:205
2146 msgid "B<kcmp>()  is Linux-specific and should not be used in programs intended to be portable."
2147 msgstr "B<kcmp>() は Linux 特有であり、 移植を考慮したプログラムでは使用すべきではない。"
2148
2149 #. type: Plain text
2150 #: build/C/man2/kcmp.2:208
2151 msgid "Glibc does not provide a wrapper for this system call; call it using B<syscall>(2)."
2152 msgstr "glibc はこのシステムコールに対するラッパー関数を提供していない。 B<syscall>(2) を使って呼び出すこと。"
2153
2154 #. type: Plain text
2155 #: build/C/man2/kcmp.2:217
2156 msgid "This system call is available only if the kernel was configured with B<CONFIG_CHECKPOINT_RESTORE>.  The main use of the system call is for the checkpoint/restore in user space (CRIU) feature.  The alternative to this system call would have been to expose suitable process information via the B<proc>(5)  filesystem; this was deemed to be unsuitable for security reasons."
2157 msgstr "このシステムコールが利用できるのは、 カーネルの B<CONFIG_CHECKPOINT_RESTORE> オプションが有効になっている場合だけである。 このシステムコールの主な用途は、 ユーザー空間でのチェックポイント/リストア (checkpoint/restore in user space; CRIU) 機能である。 このシステムコールを使わないとすると、 B<proc>(5) ファイルシステム経由で必要なプロセス情報を公開することになるが、 これはセキュリティ上の理由から不適切とみなされた。"
2158
2159 #. type: Plain text
2160 #: build/C/man2/kcmp.2:222
2161 msgid "See B<clone>(2)  for some background information on the shared resources referred to on this page."
2162 msgstr "このページで参照されている共有リソースに関する背景についての情報は B<clone>(2) を参照のこと。"
2163
2164 #. type: Plain text
2165 #: build/C/man2/kcmp.2:225
2166 msgid "B<clone>(2), B<unshare>(2)"
2167 msgstr "B<clone>(2), B<unshare>(2)"
2168
2169 #. type: TH
2170 #: build/C/man2/sched_get_priority_max.2:29
2171 #, no-wrap
2172 msgid "SCHED_GET_PRIORITY_MAX"
2173 msgstr "SCHED_GET_PRIORITY_MAX"
2174
2175 #. type: TH
2176 #: build/C/man2/sched_get_priority_max.2:29
2177 #, no-wrap
2178 msgid "2014-05-12"
2179 msgstr "2014-05-12"
2180
2181 #. type: Plain text
2182 #: build/C/man2/sched_get_priority_max.2:32
2183 msgid "sched_get_priority_max, sched_get_priority_min - get static priority range"
2184 msgstr "sched_get_priority_max, sched_get_priority_min - 静的プライオリティの範囲を取得する"
2185
2186 #. type: Plain text
2187 #: build/C/man2/sched_get_priority_max.2:34
2188 #: build/C/man2/sched_rr_get_interval.2:34 build/C/man2/sched_yield.2:34
2189 msgid "B<#include E<lt>sched.hE<gt>>"
2190 msgstr "B<#include E<lt>sched.hE<gt>>"
2191
2192 #. type: Plain text
2193 #: build/C/man2/sched_get_priority_max.2:36
2194 msgid "B<int sched_get_priority_max(int >I<policy>B<);>"
2195 msgstr "B<int sched_get_priority_max(int >I<policy>B<);>"
2196
2197 #. type: Plain text
2198 #: build/C/man2/sched_get_priority_max.2:38
2199 msgid "B<int sched_get_priority_min(int >I<policy>B<);>"
2200 msgstr "B<int sched_get_priority_min(int >I<policy>B<);>"
2201
2202 #. type: Plain text
2203 #: build/C/man2/sched_get_priority_max.2:59
2204 msgid "B<sched_get_priority_max>()  returns the maximum priority value that can be used with the scheduling algorithm identified by I<policy>.  B<sched_get_priority_min>()  returns the minimum priority value that can be used with the scheduling algorithm identified by I<policy>.  Supported I<policy> values are B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER>, B<SCHED_BATCH>, B<SCHED_IDLE>, and B<SCHED_DEADLINE>.  Further details about these policies can be found in B<sched>(7)."
2205 msgstr "B<sched_get_priority_max>()  はI<policy> によって指定されたスケジューリングのアルゴリズムで 使用されるプライオリティの最大値を返す。 B<sched_get_priority_min>()  はI<policy> によって指定されたスケジューリングのアルゴリズムで 使用されるプライオリティの最小値を返す。 サポートされる I<policy> の値は B<SCHED_FIFO>、 B<SCHED_RR>、 B<SCHED_OTHER>、 B<SCHED_BATCH>, B<SCHED_IDLE>, B<SCHED_DEADLINE> である。これらのスケジューリング方針に関する詳細は B<sched>(7)  に書かれている。"
2206
2207 #. type: Plain text
2208 #: build/C/man2/sched_get_priority_max.2:68
2209 msgid "Processes with numerically higher priority values are scheduled before processes with numerically lower priority values.  Thus, the value returned by B<sched_get_priority_max>()  will be greater than the value returned by B<sched_get_priority_min>()."
2210 msgstr "数値的に大きなプライオリティ値を持つプロセスは小さな プライオリティ値を持つプロセスより前にスケジュールされる。 このため B<sched_get_priority_max>()  が返す値は B<sched_get_priority_min>()  が返す値よりも大きい。"
2211
2212 #. type: Plain text
2213 #: build/C/man2/sched_get_priority_max.2:76
2214 msgid "Linux allows the static priority range 1 to 99 for the B<SCHED_FIFO> and B<SCHED_RR> policies, and the priority 0 for the remaining policies.  Scheduling priority ranges for the various policies are not alterable."
2215 msgstr "Linux では、 ポリシー B<SCHED_FIFO> と B<SCHED_RR> では 1 から 99 の範囲の静的プライオリティーを持ち、それ以外のポリシーでは プライオリティとして 0 を持つ。 それぞれの方針のスケジューリングプライオリティの範囲は 変更することができない。"
2216
2217 #. type: Plain text
2218 #: build/C/man2/sched_get_priority_max.2:88
2219 msgid "The range of scheduling priorities may vary on other POSIX systems, thus it is a good idea for portable applications to use a virtual priority range and map it to the interval given by B<sched_get_priority_max>()  and B<sched_get_priority_min>().  POSIX.1-2001 requires a spread of at least 32 between the maximum and the minimum values for B<SCHED_FIFO> and B<SCHED_RR>."
2220 msgstr "スケジューリングプライオリティの範囲は他の POSIX システムと 異なっているかもしれない。それで、移植性(portable)のある アプリケーションでは仮想的な範囲を用い B<sched_get_priority_max>()  と B<sched_get_priority_min>()  で与えられた間隔にマップして使用することはいい考えである。 POSIX.1-2001 では B<SCHED_FIFO> と B<SCHED_RR> における 最大値と最小値の間隔を少なくとも 32 にすることを要求している。"
2221
2222 #. type: Plain text
2223 #: build/C/man2/sched_get_priority_max.2:97
2224 msgid "POSIX systems on which B<sched_get_priority_max>()  and B<sched_get_priority_min>()  are available define B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
2225 msgstr "POSIX システムでは B<sched_get_priority_max>()  と B<sched_get_priority_min>()  は I<E<lt>unistd.hE<gt>> に B<_POSIX_PRIORITY_SCHEDULING> が定義されている場合にのみ使用可能である。"
2226
2227 #. type: Plain text
2228 #: build/C/man2/sched_get_priority_max.2:107
2229 msgid "On success, B<sched_get_priority_max>()  and B<sched_get_priority_min>()  return the maximum/minimum priority value for the named scheduling policy.  On error, -1 is returned, and I<errno> is set appropriately."
2230 msgstr "成功した場合は B<sched_get_priority_max>()  と B<sched_get_priority_min>()  は指定されたスケジューリング方針のプライオリティの最大値/最小値を返す。 エラーの場合は -1 が返され、 I<errno> が適切に設定される。"
2231
2232 #. type: Plain text
2233 #: build/C/man2/sched_get_priority_max.2:113
2234 msgid "The argument I<policy> does not identify a defined scheduling policy."
2235 msgstr "引き数 I<policy> が定義されているスケジューリング方針と一致しない。"
2236
2237 #. type: Plain text
2238 #: build/C/man2/sched_get_priority_max.2:115
2239 #: build/C/man2/sched_rr_get_interval.2:96 build/C/man2/sched_setparam.2:121
2240 #: build/C/man2/sched_yield.2:54
2241 msgid "POSIX.1-2001."
2242 msgstr "POSIX.1-2001."
2243
2244 #. type: Plain text
2245 #: build/C/man2/sched_get_priority_max.2:125
2246 msgid "B<sched_getaffinity>(2), B<sched_getparam>(2), B<sched_getscheduler>(2), B<sched_setaffinity>(2), B<sched_setparam>(2), B<sched_setscheduler>(2), B<sched>(7)"
2247 msgstr "B<sched_getaffinity>(2), B<sched_getparam>(2), B<sched_getscheduler>(2), B<sched_setaffinity>(2), B<sched_setparam>(2), B<sched_setscheduler>(2), B<sched>(7)"
2248
2249 #. type: TH
2250 #: build/C/man3/sched_getcpu.3:26
2251 #, no-wrap
2252 msgid "SCHED_GETCPU"
2253 msgstr "SCHED_GETCPU"
2254
2255 #. type: TH
2256 #: build/C/man3/sched_getcpu.3:26
2257 #, no-wrap
2258 msgid "2014-05-10"
2259 msgstr "2014-05-10"
2260
2261 #. type: Plain text
2262 #: build/C/man3/sched_getcpu.3:29
2263 msgid "sched_getcpu - determine CPU on which the calling thread is running"
2264 msgstr "sched_getcpu - 呼び出したスレッドが実行されている CPU を知る"
2265
2266 #. type: Plain text
2267 #: build/C/man3/sched_getcpu.3:34
2268 #, no-wrap
2269 msgid "B<int sched_getcpu(void);>\n"
2270 msgstr "B<int sched_getcpu(void);>\n"
2271
2272 #. type: Plain text
2273 #: build/C/man3/sched_getcpu.3:39 build/C/man2/unshare.2:33
2274 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
2275 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
2276
2277 #. type: Plain text
2278 #: build/C/man3/sched_getcpu.3:42
2279 msgid "B<sched_getcpu>():"
2280 msgstr "B<sched_getcpu>():"
2281
2282 #. type: Plain text
2283 #: build/C/man3/sched_getcpu.3:58
2284 msgid "B<sched_getcpu>()  returns the number of the CPU on which the calling thread is currently executing."
2285 msgstr "B<sched_getcpu>()  は、呼び出したスレッドが現在実行されている CPU の番号を返す。"
2286
2287 #. type: Plain text
2288 #: build/C/man3/sched_getcpu.3:65
2289 msgid "On success, B<sched_getcpu>()  returns a nonnegative CPU number.  On error, -1 is returned and I<errno> is set to indicate the error."
2290 msgstr "成功すると、 B<sched_getcpu>()  は非負の CPU 番号を返す。 エラーの場合、-1 を返し、 I<errno> にエラーを示す値を設定する。"
2291
2292 #. type: TP
2293 #: build/C/man3/sched_getcpu.3:66 build/C/man2/sched_rr_get_interval.2:87
2294 #, no-wrap
2295 msgid "B<ENOSYS>"
2296 msgstr "B<ENOSYS>"
2297
2298 #. type: Plain text
2299 #: build/C/man3/sched_getcpu.3:70
2300 msgid "This kernel does not implement B<getcpu>(2)."
2301 msgstr "このカーネルでは B<getcpu>(2)  が実装されていない。"
2302
2303 #. type: Plain text
2304 #: build/C/man3/sched_getcpu.3:72
2305 msgid "This function is available since glibc 2.6."
2306 msgstr "この関数は glibc 2.6 以降で利用可能である。"
2307
2308 #. type: SH
2309 #: build/C/man3/sched_getcpu.3:72
2310 #, no-wrap
2311 msgid "ATTRIBUTES"
2312 msgstr "属性"
2313
2314 #. type: SS
2315 #: build/C/man3/sched_getcpu.3:73
2316 #, no-wrap
2317 msgid "Multithreading (see pthreads(7))"
2318 msgstr "マルチスレッディング (pthreads(7) 参照)"
2319
2320 #. type: Plain text
2321 #: build/C/man3/sched_getcpu.3:77
2322 msgid "The B<sched_getcpu>()  function is thread-safe."
2323 msgstr "B<sched_getcpu>() 関数はスレッドセーフである。"
2324
2325 #. type: Plain text
2326 #: build/C/man3/sched_getcpu.3:80
2327 msgid "B<sched_getcpu>()  is glibc-specific."
2328 msgstr "B<sched_getcpu>()  は glibc 固有である。"
2329
2330 #. type: Plain text
2331 #: build/C/man3/sched_getcpu.3:82
2332 msgid "The call"
2333 msgstr "呼び出し"
2334
2335 #. type: Plain text
2336 #: build/C/man3/sched_getcpu.3:86
2337 #, no-wrap
2338 msgid "cpu = sched_getcpu();\n"
2339 msgstr "cpu = sched_getcpu();\n"
2340
2341 #. type: Plain text
2342 #: build/C/man3/sched_getcpu.3:92
2343 msgid "is equivalent to the following B<getcpu>(2)  call:"
2344 msgstr "は、以下の B<getcpu>(2)  呼び出しと等価である。"
2345
2346 #. type: Plain text
2347 #: build/C/man3/sched_getcpu.3:98
2348 #, no-wrap
2349 msgid ""
2350 "int c, s;\n"
2351 "s = getcpu(&c, NULL, NULL);\n"
2352 "cpu = (s == -1) ? s : c;\n"
2353 msgstr ""
2354 "int c, s;\n"
2355 "s = getcpu(&c, NULL, NULL);\n"
2356 "cpu = (s == -1) ? s : c;\n"
2357
2358 #. type: Plain text
2359 #: build/C/man3/sched_getcpu.3:103
2360 msgid "B<getcpu>(2), B<sched>(7)"
2361 msgstr "B<getcpu>(2), B<sched>(7)"
2362
2363 #. type: TH
2364 #: build/C/man2/sched_rr_get_interval.2:29
2365 #, no-wrap
2366 msgid "SCHED_RR_GET_INTERVAL"
2367 msgstr "SCHED_RR_GET_INTERVAL"
2368
2369 #. type: TH
2370 #: build/C/man2/sched_rr_get_interval.2:29 build/C/man2/sched_yield.2:29
2371 #, no-wrap
2372 msgid "2014-04-28"
2373 msgstr "2014-04-28"
2374
2375 #. type: Plain text
2376 #: build/C/man2/sched_rr_get_interval.2:32
2377 msgid "sched_rr_get_interval - get the SCHED_RR interval for the named process"
2378 msgstr "sched_rr_get_interval - 指定されたプロセスの SCHED_RR 間隔を取得する"
2379
2380 #. type: Plain text
2381 #: build/C/man2/sched_rr_get_interval.2:36
2382 msgid "B<int sched_rr_get_interval(pid_t >I<pid>B<, struct timespec * >I<tp>B<);>"
2383 msgstr "B<int sched_rr_get_interval(pid_t >I<pid>B<, struct timespec *>I<tp>B<);>"
2384
2385 #. type: Plain text
2386 #: build/C/man2/sched_rr_get_interval.2:47
2387 msgid "B<sched_rr_get_interval>()  writes into the I<timespec> structure pointed to by I<tp> the round-robin time quantum for the process identified by I<pid>.  The specified process should be running under the B<SCHED_RR> scheduling policy."
2388 msgstr ""
2389 "B<sched_rr_get_interval>() は I<tp> で指定された I<timespec> 構造体に\n"
2390 "I<pid> で指定されたプロセスのラウンドロビン時間量 (round robin time\n"
2391 "quantum) を書き込む。指定されたプロセスは B<SCHED_RR> スケジューリング\n"
2392 "ポリシーで動作しているはずである。"
2393
2394 #. type: Plain text
2395 #: build/C/man2/sched_rr_get_interval.2:51
2396 msgid "The I<timespec> structure has the following form:"
2397 msgstr "I<timespec> 構造体は以下の通りである:"
2398
2399 #. type: Plain text
2400 #: build/C/man2/sched_rr_get_interval.2:58
2401 #, no-wrap
2402 msgid ""
2403 "struct timespec {\n"
2404 "    time_t tv_sec;    /* seconds */\n"
2405 "    long   tv_nsec;   /* nanoseconds */\n"
2406 "};\n"
2407 msgstr ""
2408 "struct timespec {\n"
2409 "    time_t tv_sec;    /* seconds */\n"
2410 "    long   tv_nsec;   /* nanoseconds */\n"
2411 "};\n"
2412
2413 #
2414 #.  FIXME . On Linux, sched_rr_get_interval()
2415 #.  returns the timeslice for SCHED_OTHER processes -- this timeslice
2416 #.  is influenced by the nice value.
2417 #.  For SCHED_FIFO processes, this always returns 0.
2418 #.  The round-robin time quantum value is not alterable under Linux
2419 #.  1.3.81.
2420 #. type: Plain text
2421 #: build/C/man2/sched_rr_get_interval.2:73
2422 msgid "If I<pid> is zero, the time quantum for the calling process is written into I<*tp>."
2423 msgstr ""
2424 "I<pid> が 0 の場合、呼び出したプロセスの時間量 (time quantum) が\n"
2425 "I<*tp> に書き込まれる。"
2426
2427 #. type: Plain text
2428 #: build/C/man2/sched_rr_get_interval.2:80
2429 msgid "On success, B<sched_rr_get_interval>()  returns 0.  On error, -1 is returned, and I<errno> is set appropriately."
2430 msgstr "成功した場合は B<sched_rr_get_interval>()  は 0 を返す。 エラーの場合は -1 が返され、 I<errno> が適切に設定される。"
2431
2432 #. type: TP
2433 #: build/C/man2/sched_rr_get_interval.2:81
2434 #: build/C/man2/sched_setaffinity.2:117
2435 #, no-wrap
2436 msgid "B<EFAULT>"
2437 msgstr "B<EFAULT>"
2438
2439 #. type: Plain text
2440 #: build/C/man2/sched_rr_get_interval.2:84
2441 msgid "Problem with copying information to user space."
2442 msgstr "情報をユーザー空間にコピーする時に問題が起きた。"
2443
2444 #. type: Plain text
2445 #: build/C/man2/sched_rr_get_interval.2:87
2446 msgid "Invalid pid."
2447 msgstr "PID が不正である。"
2448
2449 #. type: Plain text
2450 #: build/C/man2/sched_rr_get_interval.2:90
2451 msgid "The system call is not yet implemented (only on rather old kernels)."
2452 msgstr "システムコールがまだ実装されていない (かなり古いカーネルにおいてのみ)。"
2453
2454 #. type: Plain text
2455 #: build/C/man2/sched_rr_get_interval.2:94
2456 msgid "Could not find a process with the ID I<pid>."
2457 msgstr "プロセス ID が I<pid> のプロセスが見つからなかった。"
2458
2459 #. type: Plain text
2460 #: build/C/man2/sched_rr_get_interval.2:103
2461 msgid "POSIX systems on which B<sched_rr_get_interval>()  is available define B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
2462 msgstr ""
2463 "POSIX システムで B<sched_rr_get_interval>() は I<E<lt>unistd.hE<gt>> に\n"
2464 "B<_POSIX_PRIORITY_SCHEDULING> が定義されている場合にのみ使用可能である。"
2465
2466 #. type: SS
2467 #: build/C/man2/sched_rr_get_interval.2:103
2468 #, no-wrap
2469 msgid "Linux notes"
2470 msgstr "Linux での注意"
2471
2472 #.  commit a4ec24b48ddef1e93f7578be53270f0b95ad666c
2473 #. type: Plain text
2474 #: build/C/man2/sched_rr_get_interval.2:117
2475 msgid "POSIX does not specify any mechanism for controlling the size of the round-robin time quantum.  Older Linux kernels provide a (nonportable) method of doing this.  The quantum can be controlled by adjusting the process's nice value (see B<setpriority>(2)).  Assigning a negative (i.e., high) nice value results in a longer quantum; assigning a positive (i.e., low) nice value results in a shorter quantum.  The default quantum is 0.1 seconds; the degree to which changing the nice value affects the quantum has varied somewhat across kernel versions.  This method of adjusting the quantum was removed starting with Linux 2.6.24."
2476 msgstr "POSIX ではラウンドロビン時間量の大きさを制御する仕組みが規定されていない。 古い Linux カーネルではこれを変更する方法が提供されている (この方法に移植性はない)。 プロセスの nice 値を調整することで時間量を制御できる (B<setpriority>(2) 参照)。 負の nice 値 (すなわち、高い nice 値) を割り当てると時間量は長くなり、 正の nice 値 (すなわち、低い nice 値) を割り当てると時間量は短くなる。 デフォルトの時間量は 0.1 秒である。 nice 値の変更が時間量にどの程度影響を与えるかは カーネルのバージョンにより多少異なる。時間量を調整するこのメソッドは Linux 2.6.24 以降で削除された。"
2477
2478 #.  commit ce0dbbbb30aee6a835511d5be446462388ba9eee
2479 #.  .SH BUGS
2480 #.  As of Linux 1.3.81
2481 #.  .BR sched_rr_get_interval ()
2482 #.  returns with error
2483 #.  ENOSYS, because SCHED_RR has not yet been fully implemented and tested
2484 #.  properly.
2485 #. type: Plain text
2486 #: build/C/man2/sched_rr_get_interval.2:132
2487 msgid "Linux 3.9 added a new mechanism for adjusting (and viewing) the B<SCHED_RR> quantum: the I</proc/sys/kernel/sched_rr_timeslice_ms> file exposes the quantum as a millisecond value, whose default is 100.  Writing 0 to this file resets the quantum to the default value."
2488 msgstr "Linux 3.9 で、 B<SCHED_RR> の時間量の調整 (と参照) を行う新しい機構が追加された。 I</proc/sys/kernel/sched_rr_timeslice_ms> ファイルでミリ秒単位の時間量の値が参照でき、 デフォルト値は 100 である。 このファイルに 0 を書き込むと、 時間量をデフォルト値に戻すことができる。"
2489
2490 #. type: Plain text
2491 #: build/C/man2/sched_rr_get_interval.2:134 build/C/man2/sched_yield.2:81
2492 msgid "B<sched>(7)"
2493 msgstr "B<sched>(7)"
2494
2495 #. type: TH
2496 #: build/C/man2/sched_setaffinity.2:34
2497 #, no-wrap
2498 msgid "SCHED_SETAFFINITY"
2499 msgstr "SCHED_SETAFFINITY"
2500
2501 #. type: TH
2502 #: build/C/man2/sched_setaffinity.2:34
2503 #, no-wrap
2504 msgid "2014-12-31"
2505 msgstr "2014-12-31"
2506
2507 #. type: Plain text
2508 #: build/C/man2/sched_setaffinity.2:38
2509 msgid "sched_setaffinity, sched_getaffinity - set and get a thread's CPU affinity mask"
2510 msgstr "sched_setaffinity, sched_getaffinity - スレッドの CPU affinity マスクを設定・取得する"
2511
2512 #. type: Plain text
2513 #: build/C/man2/sched_setaffinity.2:45
2514 #, no-wrap
2515 msgid ""
2516 "B<int sched_setaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
2517 "B<                      const cpu_set_t *>I<mask>B<);>\n"
2518 msgstr ""
2519 "B<int sched_setaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
2520 "B<                      const cpu_set_t *>I<mask>B<);>\n"
2521
2522 #. type: Plain text
2523 #: build/C/man2/sched_setaffinity.2:48
2524 #, no-wrap
2525 msgid ""
2526 "B<int sched_getaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
2527 "B<                      cpu_set_t *>I<mask>B<);>\n"
2528 msgstr ""
2529 "B<int sched_getaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
2530 "B<                      cpu_set_t *>I<mask>B<);>\n"
2531
2532 #. type: Plain text
2533 #: build/C/man2/sched_setaffinity.2:63
2534 msgid "A thread's CPU affinity mask determines the set of CPUs on which it is eligible to run.  On a multiprocessor system, setting the CPU affinity mask can be used to obtain performance benefits.  For example, by dedicating one CPU to a particular thread (i.e., setting the affinity mask of that thread to specify a single CPU, and setting the affinity mask of all other threads to exclude that CPU), it is possible to ensure maximum execution speed for that thread.  Restricting a thread to run on a single CPU also avoids the performance cost caused by the cache invalidation that occurs when a thread ceases to execute on one CPU and then recommences execution on a different CPU."
2535 msgstr "スレッドの CPU affinity (親和度) マスクは、そのスレッドが 実行を許可されている CPU の集合を決定する。 マルチプロセッサシステムでは、CPU affinity マスクを設定することで 性能上のメリットを得られる可能性がある。 例えば、特定のスレッドを一つの CPU に括り付け (すなわち、そのスレッドの affinity マスクを一つの CPU に設定し)、 他の全てのスレッドの affinity マスクからその CPU を除外することで、 確実にそのスレッドの実行速度を最大にすることができる。 また、あるスレッドの実行を一つの CPU に限定することで、 一つの CPU での実行を停止してから別の CPU で実行を再開するときに発生する キャッシュ無効化 (cache invalidation) による性能面の劣化を避けることもできる。"
2536
2537 #. type: Plain text
2538 #: build/C/man2/sched_setaffinity.2:70
2539 msgid "A CPU affinity mask is represented by the I<cpu_set_t> structure, a \"CPU set\", pointed to by I<mask>.  A set of macros for manipulating CPU sets is described in B<CPU_SET>(3)."
2540 msgstr "CPU affinity マスクは「CPU の集合」を表す I<cpu_set_t> 構造体で表現され、 I<cpu_set_t> へのポインター I<mask> で指定される。 CPU 集合を操作するためのマクロ群については B<CPU_SET>(3)  で記載されている。"
2541
2542 #. type: Plain text
2543 #: build/C/man2/sched_setaffinity.2:85
2544 msgid "B<sched_setaffinity>()  sets the CPU affinity mask of the thread whose ID is I<pid> to the value specified by I<mask>.  If I<pid> is zero, then the calling thread is used.  The argument I<cpusetsize> is the length (in bytes) of the data pointed to by I<mask>.  Normally this argument would be specified as I<sizeof(cpu_set_t)>."
2545 msgstr "B<sched_setaffinity>()  は、スレッド ID が I<pid> のスレッドの CPU affinity マスクを I<mask> で指定された値に設定する。 I<pid> が 0 の場合、呼び出し元スレッドが使われる。 I<cpusetsize> 引き数には I<mask> が指すデータの長さ (バイト単位) である。 通常は、この引き数には I<sizeof(cpu_set_t)> を指定すればよい。"
2546
2547 #. type: Plain text
2548 #: build/C/man2/sched_setaffinity.2:92
2549 msgid "If the thread specified by I<pid> is not currently running on one of the CPUs specified in I<mask>, then that thread is migrated to one of the CPUs specified in I<mask>."
2550 msgstr "I<pid> で指定されたスレッドが I<mask> で指定された CPU のいずれかで現在実行されていない場合、 そのスレッドは I<mask> で指定された CPU のいずれかに移動される。"
2551
2552 #. type: Plain text
2553 #: build/C/man2/sched_setaffinity.2:107
2554 msgid "B<sched_getaffinity>()  writes the affinity mask of the thread whose ID is I<pid> into the I<cpu_set_t> structure pointed to by I<mask>.  The I<cpusetsize> argument specifies the size (in bytes) of I<mask>.  If I<pid> is zero, then the mask of the calling thread is returned."
2555 msgstr "B<sched_getaffinity>()  は、 スレッド ID が I<pid> のスレッドの affinity マスクを I<mask> が指す I<cpu_set_t> 構造体に書き込む。 I<cpusetsize> 引き数には I<mask> の (バイト単位の) 大きさを指定する。"
2556
2557 #. type: Plain text
2558 #: build/C/man2/sched_setaffinity.2:116
2559 msgid "On success, B<sched_setaffinity>()  and B<sched_getaffinity>()  return 0.  On error, -1 is returned, and I<errno> is set appropriately."
2560 msgstr "成功した場合、 B<sched_setaffinity>()  と B<sched_getaffinity>()  は 0 を返す。 エラーの場合は -1 を返し、 I<errno> を適切に設定する。"
2561
2562 #. type: Plain text
2563 #: build/C/man2/sched_setaffinity.2:120
2564 msgid "A supplied memory address was invalid."
2565 msgstr "指定されたメモリ番地が不正である。"
2566
2567 #. type: Plain text
2568 #: build/C/man2/sched_setaffinity.2:128
2569 msgid "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)."
2570 msgstr "システム上に現在実際に存在し、かつ \"cpuset\" 機構が課す制限においてそのスレッドに対して許可されている プロセッサが、 affinity ビットマスク I<mask> に含まれていない。 \"cpuset\" 機構については B<cpuset>(7)  を参照。"
2571
2572 #. type: Plain text
2573 #: build/C/man2/sched_setaffinity.2:135
2574 msgid "(B<sched_getaffinity>()  and, in kernels before 2.6.9, B<sched_setaffinity>())  I<cpusetsize> is smaller than the size of the affinity mask used by the kernel."
2575 msgstr "(B<sched_getaffinity>()  と、カーネル 2.6.9 以前の B<sched_setaffinity>())  I<cpusetsize> がカーネルで使われている affinity マスクのサイズより小さい。"
2576
2577 #. type: Plain text
2578 #: build/C/man2/sched_setaffinity.2:145
2579 msgid "(B<sched_setaffinity>())  The calling thread does not have appropriate privileges.  The caller needs an effective user ID equal to the real user ID or effective user ID of the thread identified by I<pid>, or it must possess the B<CAP_SYS_NICE> capability."
2580 msgstr "(B<sched_setaffinity>())  呼び出し元のスレッドに適切な特権がなかった。 呼び出し元は、実効ユーザー ID が I<pid> で識別されるスレッドの実ユーザー ID または実効ユーザー ID と同じであるか、 B<CAP_SYS_NICE> ケーパビリティ (capability) を持たなければならない。"
2581
2582 #. type: Plain text
2583 #: build/C/man2/sched_setaffinity.2:148 build/C/man2/sched_setattr.2:289
2584 #: build/C/man2/sched_setscheduler.2:170
2585 msgid "The thread whose ID is I<pid> could not be found."
2586 msgstr "ID が I<pid> のスレッドが見つからなかった。"
2587
2588 #. type: Plain text
2589 #: build/C/man2/sched_setaffinity.2:159
2590 msgid "The CPU affinity system calls were introduced in Linux kernel 2.5.8.  The system call wrappers were introduced in glibc 2.3.  Initially, the glibc interfaces included a I<cpusetsize> argument, typed as I<unsigned int>.  In glibc 2.3.3, the I<cpusetsize> argument was removed, but was then restored in glibc 2.3.4, with type I<size_t>."
2591 msgstr "CPU affinity システムコールは Linux kernel 2.5.8 で導入された。 これらのシステムコールのラッパー関数は glibc 2.3 で導入された。 最初は、glibc のインタフェースには I<unsigned int> 型の I<cpusetsize> 引き数が入っていた。 glibc 2.3.3 では I<cpusetsize> 引き数が削除されたが、glibc 2.3.4 で I<size_t> 型で復活した。"
2592
2593 #. type: Plain text
2594 #: build/C/man2/sched_setaffinity.2:161
2595 msgid "These system calls are Linux-specific."
2596 msgstr "これらのシステムコールは Linux 固有である。"
2597
2598 #. type: Plain text
2599 #: build/C/man2/sched_setaffinity.2:174
2600 msgid "After a call to B<sched_setaffinity>(), the set of CPUs on which the thread will actually run is the intersection of the set specified in the I<mask> 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."
2601 msgstr "B<sched_setaffinity>()  を呼び出した後は、スレッドが実際に実行される CPU の集合は、 I<mask> 引き数で指定された集合と、システム上に実際に存在する CPU の集合の 共通集合 (AND) となる。 \"cpuset\" 機構が使用されている場合には、スレッドが動作する CPU 集合 に対してシステムはさらに制限を加えるかもしれない (\"cpuset\" 機構については B<cpuset>(7)  を参照)。 スレッドが動作する実際の CPU 集合に対する制限はカーネルにより 暗黙のうちに適用される。"
2602
2603 #. type: Plain text
2604 #: build/C/man2/sched_setaffinity.2:186
2605 msgid "There are various ways of determining the number of CPUs available on the system, including: inspecting the contents of I</proc/cpuinfo>; using B<syconf>(3)  to obtain the values of the B<_SC_NPROCESSORS_CONF> and B<_SC_NPROCESSORS_ONLN> parameters; and inspecting the list CPU directories under I</sys/devices/system/cpu/>."
2606 msgstr "システムで利用可能な CPU 数を判定する方法はいくつかある。 I</proc/cpuinfo> の内容を調べる、 B<sysconf>(3) を使って B<_SC_NPROCESSORS_CONF> と B<_SC_NPROCESSORS_ONLN> の値を取得する、 I</sys/devices/system/cpu/> の CPU ディレクトリの一覧を調べる、などがある。"
2607
2608 #. type: Plain text
2609 #: build/C/man2/sched_setaffinity.2:189
2610 msgid "B<sched>(7)  has a description of the Linux scheduling scheme."
2611 msgstr "B<sched>(7) に Linux のスケジューリング方式についての説明がある。"
2612
2613 #. type: Plain text
2614 #: build/C/man2/sched_setaffinity.2:206
2615 msgid "The affinity mask is a per-thread attribute that can be adjusted independently for each of the threads in a thread group.  The value returned from a call to B<gettid>(2)  can be passed in the argument I<pid>.  Specifying I<pid> as 0 will set the attribute for the calling thread, and passing the value returned from a call to B<getpid>(2)  will set the attribute for the main thread of the thread group.  (If you are using the POSIX threads API, then use B<pthread_setaffinity_np>(3)  instead of B<sched_setaffinity>().)"
2616 msgstr "affinity マスクはスレッド単位の属性で、スレッドグループの 各スレッド単位に独立して調整することができる。 B<gettid>(2)  コールからの返り値をこのコールの I<pid> 引き数として渡すことができる。 I<pid> に 0 を指定すると呼び出し元のスレッドの属性が設定され、 B<getpid>(2)  コールからの返り値を I<pid> に指定するとスレッドグループのメインスレッドの属性が設定される (POSIX スレッド API を使用している場合、 B<sched_setaffinity>()  の代わりに B<pthread_setaffinity_np>(3)  を使用すること)。"
2617
2618 #. type: Plain text
2619 #: build/C/man2/sched_setaffinity.2:212
2620 msgid "A child created via B<fork>(2)  inherits its parent's CPU affinity mask.  The affinity mask is preserved across an B<execve>(2)."
2621 msgstr "B<fork>(2)  経由で生成された子プロセスは親プロセスの CPU affinity マスクを継承する。 affinity マスクは B<execve>(2)  の前後で保存される。"
2622
2623 #. type: Plain text
2624 #: build/C/man2/sched_setaffinity.2:226
2625 msgid "This manual page describes the glibc interface for the CPU affinity calls.  The actual system call interface is slightly different, with the I<mask> being typed as I<unsigned long\\ *>, reflecting the fact that the underlying implementation of CPU sets is a simple bit mask.  On success, the raw B<sched_getaffinity>()  system call returns the size (in bytes) of the I<cpumask_t> data type that is used internally by the kernel to represent the CPU set bit mask."
2626 msgstr "このマニュアルページでは CPU affinity コールの glibc インタフェースを 説明している。実際のシステムコールインタフェースは少し違っており、 実際の実装では CPU 集合は簡単なビットマスクであるという実状を反映し、 I<mask> の型が I<unsigned long\\ *> となっている。 成功時には、生の B<sched_getaffinity>()  システムコール自身は I<cpumask_t> データ型の (バイト単位の) 大きさを返す。 I<cpumask_t> はカーネル内部で CPU 集合のビットマスクを表現するのに 使われているデータ型である。"
2627
2628 #. type: Plain text
2629 #: build/C/man2/sched_setaffinity.2:248
2630 msgid "B<lscpu>(1), B<nproc>(1), B<taskset>(1), B<clone>(2), B<getcpu>(2), B<getpriority>(2), B<gettid>(2), B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), B<sched_getscheduler>(2), B<sched_setscheduler>(2), B<setpriority>(2), B<CPU_SET>(3), B<pthread_setaffinity_np>(3), B<sched_getcpu>(3), B<capabilities>(7), B<cpuset>(7), B<sched>(7)"
2631 msgstr "B<lscpu>(1), B<nproc>(1), B<taskset>(1), B<clone>(2), B<getcpu>(2), B<getpriority>(2), B<gettid>(2), B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), B<sched_getscheduler>(2), B<sched_setscheduler>(2), B<setpriority>(2), B<CPU_SET>(3), B<pthread_setaffinity_np>(3), B<sched_getcpu>(3), B<capabilities>(7), B<cpuset>(7), B<sched>(7)"
2632
2633 #. type: TH
2634 #: build/C/man2/sched_setattr.2:26
2635 #, no-wrap
2636 msgid "SCHED_SETATTR"
2637 msgstr "SCHED_SETATTR"
2638
2639 #. type: TH
2640 #: build/C/man2/sched_setattr.2:26 build/C/man2/sched_setscheduler.2:26
2641 #: build/C/man7/sched.7:32
2642 #, no-wrap
2643 msgid "2014-10-02"
2644 msgstr "2014-10-02"
2645
2646 #. type: Plain text
2647 #: build/C/man2/sched_setattr.2:30
2648 msgid "sched_setattr, sched_getattr - set and get scheduling policy and attributes"
2649 msgstr "sched_setattr, sched_getattr - スケジューリングポリシーと属性の設定と取得を行なう"
2650
2651 #. type: Plain text
2652 #: build/C/man2/sched_setattr.2:36
2653 #, no-wrap
2654 msgid ""
2655 "B<int sched_setattr(pid_t >I<pid>B<, const struct sched_attr *>I<attr>B<,>\n"
2656 "B<                  unsigned int >I<flags>B<);>\n"
2657 msgstr ""
2658 "B<int sched_setattr(pid_t >I<pid>B<, const struct sched_attr *>I<attr>B<,>\n"
2659 "B<                  unsigned int >I<flags>B<);>\n"
2660
2661 #. type: Plain text
2662 #: build/C/man2/sched_setattr.2:39
2663 #, no-wrap
2664 msgid ""
2665 "B<int sched_getattr(pid_t >I<pid>B<, const struct sched_attr *>I<attr>B<,>\n"
2666 "B<                  unsigned int >I<size>B<, unsigned int >I<flags>B<);>\n"
2667 msgstr ""
2668 "B<int sched_getattr(pid_t >I<pid>B<, const struct sched_attr *>I<attr>B<,>\n"
2669 "B<                  unsigned int >I<size>B<, unsigned int >I<flags>B<);>\n"
2670
2671 #. type: SS
2672 #: build/C/man2/sched_setattr.2:42
2673 #, no-wrap
2674 msgid "sched_setattr()"
2675 msgstr "sched_setattr()"
2676
2677 #. type: Plain text
2678 #: build/C/man2/sched_setattr.2:52
2679 msgid "The B<sched_setattr>()  system call sets the scheduling policy and associated attributes for the thread whose ID is specified in I<pid>.  If I<pid> equals zero, the scheduling policy and attributes of the calling thread will be set."
2680 msgstr "B<sched_setattr>() システムコールは、 I<pid> で指定された ID を持つスレッドのスケジューリングポリシーと関連する属性を設定する。 I<pid> が 0 の場合、呼び出したスレッド自身のスケジューリングポリシーと属性が設定される。"
2681
2682 #. type: Plain text
2683 #: build/C/man2/sched_setattr.2:56 build/C/man2/sched_setscheduler.2:73
2684 msgid "Currently, Linux supports the following \"normal\" (i.e., non-real-time) scheduling policies as values that may be specified in I<policy>:"
2685 msgstr "現在のところ、 Linux では、 以下の「通常」の (つまり、リアルタイムではない) スケジューリングポリシーが、 I<policy> に指定できる値としてサポートされている。"
2686
2687 #. type: TP
2688 #: build/C/man2/sched_setattr.2:56 build/C/man2/sched_setscheduler.2:73
2689 #, no-wrap
2690 msgid "B<SCHED_OTHER>"
2691 msgstr "B<SCHED_OTHER>"
2692
2693 #.  In the 2.6 kernel sources, SCHED_OTHER is actually called
2694 #.  SCHED_NORMAL.
2695 #. type: Plain text
2696 #: build/C/man2/sched_setattr.2:61 build/C/man2/sched_setscheduler.2:78
2697 msgid "the standard round-robin time-sharing policy;"
2698 msgstr "標準の、ラウンドロビンによる時分割型のスケジューリングポリシー。"
2699
2700 #. type: TP
2701 #: build/C/man2/sched_setattr.2:61 build/C/man2/sched_setscheduler.2:78
2702 #, no-wrap
2703 msgid "B<SCHED_BATCH>"
2704 msgstr "B<SCHED_BATCH>"
2705
2706 #. type: Plain text
2707 #: build/C/man2/sched_setattr.2:64 build/C/man2/sched_setscheduler.2:81
2708 msgid "for \"batch\" style execution of processes; and"
2709 msgstr "「バッチ」形式でのプロセスの実行用。"
2710
2711 #. type: TP
2712 #: build/C/man2/sched_setattr.2:64 build/C/man2/sched_setscheduler.2:81
2713 #, no-wrap
2714 msgid "B<SCHED_IDLE>"
2715 msgstr "B<SCHED_IDLE>"
2716
2717 #. type: Plain text
2718 #: build/C/man2/sched_setattr.2:69 build/C/man2/sched_setscheduler.2:86
2719 msgid "for running I<very> low priority background jobs."
2720 msgstr "「非常に」低い優先度で動作するバックグラウンドジョブ用。"
2721
2722 #. type: Plain text
2723 #: build/C/man2/sched_setattr.2:78 build/C/man2/sched_setscheduler.2:99
2724 msgid "Various \"real-time\" policies are also supported, for special time-critical applications that need precise control over the way in which runnable threads are selected for execution.  For the rules governing when a process may use these policies, see B<sched>(7).  The real-time policies that may be specified in I<policy> are:"
2725 msgstr "どの実行可能スレッドを選択するかについて、より正確な制御を必要とする 時間の制約が厳しい特別なアプリケーション用として、 いろいろな「リアルタイム」ポリシーもサポートされている。 プロセスがこれらのポリシーをいつ使用できるかを決めるルールについては、B<sched>(7) を参照。 I<policy> には以下のリアルタイムポリシーを指定できる。"
2726
2727 #. type: TP
2728 #: build/C/man2/sched_setattr.2:78 build/C/man2/sched_setscheduler.2:99
2729 #, no-wrap
2730 msgid "B<SCHED_FIFO>"
2731 msgstr "B<SCHED_FIFO>"
2732
2733 #. type: Plain text
2734 #: build/C/man2/sched_setattr.2:81 build/C/man2/sched_setscheduler.2:102
2735 msgid "a first-in, first-out policy; and"
2736 msgstr "ファーストイン、ファーストアウト型のポリシー。"
2737
2738 #. type: TP
2739 #: build/C/man2/sched_setattr.2:81 build/C/man2/sched_setscheduler.2:102
2740 #, no-wrap
2741 msgid "B<SCHED_RR>"
2742 msgstr "B<SCHED_RR>"
2743
2744 #. type: Plain text
2745 #: build/C/man2/sched_setattr.2:84 build/C/man2/sched_setscheduler.2:105
2746 msgid "a round-robin policy."
2747 msgstr "ラウンドロビン型のポリシー。"
2748
2749 #. type: Plain text
2750 #: build/C/man2/sched_setattr.2:86
2751 msgid "Linux also provides the following policy:"
2752 msgstr "Linux では以下のポリシーも提供されている。"
2753
2754 #. type: TP
2755 #: build/C/man2/sched_setattr.2:86
2756 #, no-wrap
2757 msgid "B<SCHED_DEADLINE>"
2758 msgstr "B<SCHED_DEADLINE>"
2759
2760 #. type: Plain text
2761 #: build/C/man2/sched_setattr.2:91
2762 msgid "a deadline scheduling policy; see B<sched>(7)  for details."
2763 msgstr "デッドライン (応答期限) ベースのスケジューリングポリシー。詳細は B<sched>(7) を参照。"
2764
2765 #. type: Plain text
2766 #: build/C/man2/sched_setattr.2:97
2767 msgid "The I<attr> argument is a pointer to a structure that defines the new scheduling policy and attributes for the specified thread.  This structure has the following form:"
2768 msgstr "I<attr> 引き数は、 指定したスレッドの新しいスケジューリングポリシーと属性を定義した構造体へのポインターである。 この構造体は以下の形式である。"
2769
2770 #. type: Plain text
2771 #: build/C/man2/sched_setattr.2:113
2772 #, no-wrap
2773 msgid ""
2774 "struct sched_attr {\n"
2775 "    u32 size;              /* Size of this structure */\n"
2776 "    u32 sched_policy;      /* Policy (SCHED_*) */\n"
2777 "    u64 sched_flags;       /* Flags */\n"
2778 "    s32 sched_nice;        /* Nice value (SCHED_OTHER,\n"
2779 "                              SCHED_BATCH) */\n"
2780 "    u32 sched_priority;    /* Static priority (SCHED_FIFO,\n"
2781 "                              SCHED_RR) */\n"
2782 "    /* Remaining fields are for SCHED_DEADLINE */\n"
2783 "    u64 sched_runtime;\n"
2784 "    u64 sched_deadline;\n"
2785 "    u64 sched_period;\n"
2786 "};\n"
2787 msgstr ""
2788 "struct sched_attr {\n"
2789 "    u32 size;              /* この構造体のサイズ */\n"
2790 "    u32 sched_policy;      /* ポリシー (SCHED_*) */\n"
2791 "    u64 sched_flags;       /* フラグ */\n"
2792 "    s32 sched_nice;        /* nice 値 (SCHED_OTHER,\n"
2793 "                              SCHED_BATCH) */\n"
2794 "    u32 sched_priority;    /* 静的優先度 (SCHED_FIFO,\n"
2795 "                              SCHED_RR) */\n"
2796 "    /* 残りのフィールドは SCHED_DEADLINE 用である */\n"
2797 "    u64 sched_runtime;\n"
2798 "    u64 sched_deadline;\n"
2799 "    u64 sched_period;\n"
2800 "};\n"
2801
2802 #. type: Plain text
2803 #: build/C/man2/sched_setattr.2:117
2804 msgid "The fields of this structure are as follows:"
2805 msgstr "この構造体のフィールドは以下の通りである。"
2806
2807 #. type: TP
2808 #: build/C/man2/sched_setattr.2:117
2809 #, no-wrap
2810 msgid "B<size>"
2811 msgstr "B<size>"
2812
2813 #. type: Plain text
2814 #: build/C/man2/sched_setattr.2:132
2815 msgid "This field should be set to the size of the structure in bytes, as in I<sizeof(struct sched_attr)>.  If the provided structure is smaller than the kernel structure, any additional fields are assumed to be '0'.  If the provided structure is larger than the kernel structure, the kernel verifies that all additional fields are 0; if they are not, B<sched_setattr>()  fails with the error B<E2BIG> and updates I<size> to contain the size of the kernel structure."
2816 msgstr "このフィールドには、 構造体のバイト単位のサイズを設定する。 I<sizeof(struct sched_attr)> を指定すればよい。 指定された構造体がカーネル構造体よりも小さい場合、 追加となるフィールドは 0 とみなされる。 指定された構造体がカーネル構造体よりも大きい場合、 カーネルは追加のフィールドが 0 であるかを検査する。 0 でない場合は B<sched_setattr>() はエラー B<E2BIG> で失敗するので、 I<size> をカーネル構造体のサイズに更新する必要がある。"
2817
2818 #. type: Plain text
2819 #: build/C/man2/sched_setattr.2:146
2820 msgid "The above behavior when the size of the user-space I<sched_attr> structure does not match the size of the kernel structure allows for future extensibility of the interface.  Malformed applications that pass oversize structures won't break in the future if the size of the kernel I<sched_attr> structure is increased.  In the future, it could also allow applications that know about a larger user-space I<sched_attr> structure to determine whether they are running on an older kernel that does not support the larger structure."
2821 msgstr "ユーザー空間の I<sched_attr> 構造体のサイズがカーネル構造体のサイズと一致しなかった場合の上記の動作は、 このインタフェースを将来拡張できるようにするためである。 サイズが大きい構造体を渡す行儀の良くないアプリケーションも、 将来カーネルの I<sched_attr> 構造体のサイズが大きくなったとしてもおかしくならない。 この仕組みにより、 将来的には、 大きなユーザー空間 I<sched_attr> 構造体があることを知っているアプリケーションで、 大きいサイズの構造体に対応していない古いカーネル上で動作しているかを判定することができる。"
2822
2823 #. type: TP
2824 #: build/C/man2/sched_setattr.2:146
2825 #, no-wrap
2826 msgid "I<sched_policy>"
2827 msgstr "I<sched_policy>"
2828
2829 #. type: Plain text
2830 #: build/C/man2/sched_setattr.2:151
2831 msgid "This field specifies the scheduling policy, as one of the B<SCHED_*> values listed above."
2832 msgstr "このフィールドはスケジューリングポリシーを指定する。 上記のリストにある B<SCHED_*> 値のいずれかを指定する。"
2833
2834 #. type: TP
2835 #: build/C/man2/sched_setattr.2:151
2836 #, no-wrap
2837 msgid "I<sched_flags>"
2838 msgstr "I<sched_flags>"
2839
2840 #. type: Plain text
2841 #: build/C/man2/sched_setattr.2:162
2842 msgid "This field contains flags controlling scheduling behavior.  Only one such flag is currently defined: B<SCHED_FLAG_RESET_ON_FORK>.  As a result of including this flag, children created by B<fork>(2)  do not inherit privileged scheduling policies.  See B<sched>(7)  for details."
2843 msgstr "このフィールドはスケジューリング動作の制御を行う。 現在のところ、サポートされているフラグは B<SCHED_FLAG_RESET_ON_FORK> の一つだけである。 このフラグが指定されると、 B<fork>(2) で作成された子プロセスは特権が必要なスケジューリングポリシーを継承しない。 詳細は B<sched>(7) を参照。"
2844
2845 #. type: TP
2846 #: build/C/man2/sched_setattr.2:162
2847 #, no-wrap
2848 msgid "I<sched_nice>"
2849 msgstr "I<sched_nice>"
2850
2851 #. type: Plain text
2852 #: build/C/man2/sched_setattr.2:173
2853 msgid "This field specifies the nice value to be set when specifying I<sched_policy> as B<SCHED_OTHER> or B<SCHED_BATCH>.  The nice value is a number in the range -20 (high priority)  to +19 (low priority); see B<setpriority>(2)."
2854 msgstr "このフィールドは、 I<sched_policy> に B<SCHED_OTHER> か B<SCHED_BATCH> が指定された場合に設定される nice 値を指定する。 nice 値は -20 (高優先度) から +19 (低優先度) の範囲の数値である。 B<setpriority>(2) を参照。"
2855
2856 #. type: TP
2857 #: build/C/man2/sched_setattr.2:173
2858 #, no-wrap
2859 msgid "I<sched_priority>"
2860 msgstr "I<sched_priority>"
2861
2862 #. type: Plain text
2863 #: build/C/man2/sched_setattr.2:186
2864 msgid "This field specifies the static priority to be set when specifying I<sched_policy> as B<SCHED_FIFO> or B<SCHED_RR>.  The allowed range of priorities for these policies can be determined using B<sched_get_priority_min>(2)  and B<sched_get_priority_max>(2).  For other policies, this field must be specified as 0."
2865 msgstr "このフィールドは、 I<sched_policy> に B<SCHED_FIFO> か B<SCHED_RR> が指定された場合に設定される静的優先度を指定する。 これらのポリシーで指定できる優先度の範囲は、 B<sched_get_priority_min>(2) と B<sched_get_priority_max>(2) を使って判定できる。 他のポリシーでは、 このフィールドには 0 を指定しなければならない。"
2866
2867 #. type: TP
2868 #: build/C/man2/sched_setattr.2:186
2869 #, no-wrap
2870 msgid "I<sched_runtime>"
2871 msgstr "I<sched_runtime>"
2872
2873 #. type: Plain text
2874 #: build/C/man2/sched_setattr.2:195
2875 msgid "This field specifies the \"Runtime\" parameter for deadline scheduling.  The value is expressed in nanoseconds.  This field, and the next two fields, are used only for B<SCHED_DEADLINE> scheduling; for further details, see B<sched>(7)."
2876 msgstr "このフィールドは、 デッドラインスケジューリングの \"Runtime\" パラメーターを指定する。 この値はナノ秒単位で表現される。 このフィールドと次の 2 つのフィールドは B<SCHED_DEADLINE> スケジューリングにおいてのみ使用される。 詳細は B<sched>(7) を参照。"
2877
2878 #. type: TP
2879 #: build/C/man2/sched_setattr.2:195
2880 #, no-wrap
2881 msgid "I<sched_deadline>"
2882 msgstr "I<sched_deadline>"
2883
2884 #. type: Plain text
2885 #: build/C/man2/sched_setattr.2:199
2886 msgid "This field specifies the \"Deadline\" parameter for deadline scheduling.  The value is expressed in nanoseconds."
2887 msgstr "このフィールドは、 デッドラインスケジューリングの \"Deadline\" パラメーターを指定する。 この値はナノ秒単位で表現される。"
2888
2889 #. type: TP
2890 #: build/C/man2/sched_setattr.2:199
2891 #, no-wrap
2892 msgid "I<sched_period>"
2893 msgstr "I<sched_period>"
2894
2895 #. type: Plain text
2896 #: build/C/man2/sched_setattr.2:203
2897 msgid "This field specifies the \"Period\" parameter for deadline scheduling.  The value is expressed in nanoseconds."
2898 msgstr "このフィールドは、 デッドラインスケジューリングの \"Period\" パラメーターを指定する。 この値はナノ秒単位で表現される。"
2899
2900 #. type: Plain text
2901 #: build/C/man2/sched_setattr.2:210 build/C/man2/sched_setattr.2:262
2902 msgid "The I<flags> argument is provided to allow for future extensions to the interface; in the current implementation it must be specified as 0."
2903 msgstr "I<flags> 引き数は、このインタフェースの将来の拡張のために用意されている。 現在の実装では 0 を指定しなければならない。"
2904
2905 #. type: SS
2906 #: build/C/man2/sched_setattr.2:210
2907 #, no-wrap
2908 msgid "sched_getattr()"
2909 msgstr "sched_getattr()"
2910
2911 #. type: Plain text
2912 #: build/C/man2/sched_setattr.2:221
2913 msgid "The B<sched_getattr>()  system call fetches the scheduling policy and the associated attributes for the thread whose ID is specified in I<pid>.  If I<pid> equals zero, the scheduling policy and attributes of the calling thread will be retrieved."
2914 msgstr "B<sched_getattr>() システムコールは、 I<pid> で指定された ID を持つスレッドのスケジューリングポリシーと関連する属性を取得する。 I<pid> が 0 の場合、呼び出したスレッド自身のスケジューリングポリシーと関連する属性を取得する。"
2915
2916 #. type: Plain text
2917 #: build/C/man2/sched_setattr.2:231
2918 msgid "The I<size> argument should be set to the size of the I<sched_attr> structure as known to user space.  The value must be at least as large as the size of the initially published I<sched_attr> structure, or the call fails with the error B<EINVAL>."
2919 msgstr "I<size> 引き数には、 ユーザー空間での I<sched_attr> 構造体の大きさを設定する。 この値は、 少なくとも初期バージョンの I<sched_attr> 構造体のサイズでなければならない。 そうでなかった場合、 エラー B<EINVAL> で呼び出しが失敗する。"
2920
2921 #. type: Plain text
2922 #: build/C/man2/sched_setattr.2:241
2923 msgid "The retrieved scheduling attributes are placed in the fields of the I<sched_attr> structure pointed to by I<attr>.  The kernel sets I<attr.size> to the size of its I<sched_attr> structure."
2924 msgstr "取得したスケジューリング属性は、 I<attr> が指す I<sched_attr> 構造体の各フィールドに格納される。 カーネルは I<attr.size> に I<sched_attr> 構造体のサイズを設定する。"
2925
2926 #. type: Plain text
2927 #: build/C/man2/sched_setattr.2:257
2928 msgid "If the caller-provided I<attr> buffer is larger than the kernel's I<sched_attr> structure, the additional bytes in the user-space structure are not touched.  If the caller-provided structure is smaller than the kernel I<sched_attr> structure and the kernel needs to return values outside the provided space, B<sched_getattr>()  fails with the error B<E2BIG>.  As with B<sched_setattr>(), these semantics allow for future extensibility of the interface."
2929 msgstr "呼び出し側が提供した I<attr> バッファーがカーネルの I<sched_attr> 構造体よりも大きい場合、 ユーザー空間構造体の残りのバイトは変更されない。 呼び出し側が提供した構造体がカーネルの I<sched_attr> 構造体よりも小さく、 カーネルが値を返すのにもっと大きな空間が必要な場合、 B<sched_getattr>() はエラー B<E2BIG> で失敗する。 B<sched_setattr>() と同様、 この動作はこのインタフェースの将来の拡張性を考慮してのものである。"
2930
2931 #. type: Plain text
2932 #: build/C/man2/sched_setattr.2:271
2933 msgid "On success, B<sched_setattr>()  and B<sched_getattr>()  return 0.  On error, -1 is returned, and I<errno> is set to indicate the cause of the error."
2934 msgstr "成功した場合は B<sched_setattr>()  と B<sched_getattr>()  は 0 を返す。 エラーの場合は -1 が返され、 エラーの原因を示す値が I<errno> に設定される。"
2935
2936 #. type: Plain text
2937 #: build/C/man2/sched_setattr.2:276
2938 msgid "B<sched_getattr>()  and B<sched_setattr>()  can both fail for the following reasons:"
2939 msgstr "B<sched_getattr>() と B<sched_setattr>() の両方が以下の理由で失敗する。"
2940
2941 #. type: Plain text
2942 #: build/C/man2/sched_setattr.2:284
2943 msgid "I<attr> is NULL; or I<pid> is negative; or I<flags> is not zero."
2944 msgstr "I<attr> が NULL である。 I<pid> が負である。 I<flags> が 0 以外である。"
2945
2946 #. type: Plain text
2947 #: build/C/man2/sched_setattr.2:293
2948 msgid "In addition, B<sched_getattr>()  can fail for the following reasons:"
2949 msgstr "さらに、 B<sched_getattr>() は以下の理由でも失敗する。"
2950
2951 #. type: TP
2952 #: build/C/man2/sched_setattr.2:293 build/C/man2/sched_setattr.2:310
2953 #, no-wrap
2954 msgid "B<E2BIG>"
2955 msgstr "B<E2BIG>"
2956
2957 #. type: Plain text
2958 #: build/C/man2/sched_setattr.2:300
2959 msgid "The buffer specified by I<size> and I<attr> is too small."
2960 msgstr "I<size> と I<attr> で指定されたバッファーが小さすぎる。"
2961
2962 #. type: Plain text
2963 #: build/C/man2/sched_setattr.2:306
2964 msgid "I<size> is invalid; that is, it is smaller than the initial version of the I<sched_attr> structure (48 bytes) or larger than the system page size."
2965 msgstr "I<size> が無効である。つまり、 最初のバージョンの I<sched_attr> 構造体 (48 バイト) よりも小さいか、 システムのページサイズよりも大きい。"
2966
2967 #. type: Plain text
2968 #: build/C/man2/sched_setattr.2:310
2969 msgid "In addition, B<sched_setattr>()  can fail for the following reasons:"
2970 msgstr "さらに、 B<sched_setattr>() は以下の理由でも失敗する。"
2971
2972 #. type: Plain text
2973 #: build/C/man2/sched_setattr.2:318
2974 msgid "The buffer specified by I<size> and I<attr> is larger than the kernel structure, and one or more of the excess bytes is nonzero."
2975 msgstr "I<size> と I<attr> で指定されたバッファーがカーネル構造体よりも大きく、 一つ以上の超過バイトが 0 でなかった。"
2976
2977 #. type: TP
2978 #: build/C/man2/sched_setattr.2:318
2979 #, no-wrap
2980 msgid "B<EBUSY>"
2981 msgstr "B<EBUSY>"
2982
2983 #. type: Plain text
2984 #: build/C/man2/sched_setattr.2:323
2985 msgid "B<SCHED_DEADLINE> admission control failure, see B<sched>(7)."
2986 msgstr "B<SCHED_DEADLINE> の流入制御の失敗については B<sched>(7) を参照。"
2987
2988 #. type: Plain text
2989 #: build/C/man2/sched_setattr.2:339
2990 msgid "I<attr.sched_policy> is not one of the recognized policies; I<attr.sched_flags> contains a flag other than B<SCHED_FLAG_RESET_ON_FORK>; or I<attr.sched_priority> is invalid; or I<attr.sched_policy> is B<SCHED_DEADLINE> and the deadline scheduling parameters in I<attr> are invalid."
2991 msgstr "I<attr.sched_policy> が認識できるポリシーではない。 I<attr.sched_flags> に B<SCHED_FLAG_RESET_ON_FORK> 以外のフラグが含まれている。 I<attr.sched_priority> が無効である。 I<attr.sched_policy> が B<SCHED_DEADLINE> で、 I<attr> に指定されたデッドラインスケジューリングパラメーターが無効である。"
2992
2993 #. type: Plain text
2994 #: build/C/man2/sched_setattr.2:342
2995 msgid "The caller does not have appropriate privileges."
2996 msgstr "呼び出した元が適切な特権を持っていない。"
2997
2998 #. type: Plain text
2999 #: build/C/man2/sched_setattr.2:348
3000 msgid "The caller's CPU affinity mask does not include all CPUs in the system (see B<sched_setaffinity>(2))."
3001 msgstr "呼び出し元の CPU affinity マスクにシステムの全ての CPU のうち含まれていないものがある (B<sched_setaffinity>(2) を参照)。"
3002
3003 #.  FIXME . Add glibc version
3004 #. type: Plain text
3005 #: build/C/man2/sched_setattr.2:351
3006 msgid "These system calls first appeared in Linux 3.14."
3007 msgstr "これらのシステムコールは Linux 3.14 で初めて登場した。"
3008
3009 #. type: Plain text
3010 #: build/C/man2/sched_setattr.2:353
3011 msgid "These system calls are nonstandard Linux extensions."
3012 msgstr "これらのシステムコールは非標準の Linux による拡張である。"
3013
3014 #. type: Plain text
3015 #: build/C/man2/sched_setattr.2:369
3016 msgid "B<sched_setattr>()  provides a superset of the functionality of B<sched_setscheduler>(2), B<sched_setparam>(2), B<nice>(2), and (other than the ability to set the priority of all processes belonging to a specified user or all processes in a specified group)  B<setpriority>(2).  Analogously, B<sched_getattr>()  provides a superset of the functionality of B<sched_getscheduler>(2), B<sched_getparam>(2), and (partially)  B<getpriority>(2)."
3017 msgstr "B<sched_setattr>() は、B<sched_setscheduler>(2), B<sched_setparam>(2), B<nice>(2) の機能および B<setpriority> の一部機能を持つ (ただし、B<setpriority>(2) の、指定されたユーザーに所属するすべてのプロセスまたは指定されたグループのすべてのプロセスの優先度を設定する機能は除く)。 同様に、 B<sched_getattr>() は B<sched_getscheduler>(2), B<sched_getparam>(2) の機能および B<getpriority>(2) の一部機能を持つ。"
3018
3019 #.  FIXME . patch sent to Peter Zijlstra
3020 #.  In Linux versions up to up 3.15,
3021 #.  FIXME . patch from Peter Zijlstra pending
3022 #.  .BR sched_setattr ()
3023 #.  allowed a negative
3024 #.  .I attr.sched_policy
3025 #.  value.
3026 #. type: Plain text
3027 #: build/C/man2/sched_setattr.2:385
3028 msgid "In Linux versions up to 3.15, B<sched_settattr>()  failed with the error B<EFAULT> instead of B<E2BIG> for the case described in ERRORS."
3029 msgstr "バージョン 3.15 までの Linux では、 B<sched_settattr>() は、 エラーの節に書かれている B<E2BIG> の場合にエラーB<EFAULT> で失敗していた。"
3030
3031 #. type: Plain text
3032 #: build/C/man2/sched_setattr.2:407
3033 msgid "B<chrt>(1), B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), B<sched_getaffinity>(2), B<sched_getscheduler>(2), B<sched_getparam>(2), B<sched_rr_get_interval>(2), B<sched_setaffinity>(2), B<sched_setscheduler>(2), B<sched_setparam>(2), B<sched_yield>(2), B<setpriority>(2), B<pthread_getschedparam>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<capabilities>(7), B<cpuset>(7), B<sched>(7)"
3034 msgstr "B<chrt>(1), B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), B<sched_getaffinity>(2), B<sched_getscheduler>(2), B<sched_getparam>(2), B<sched_rr_get_interval>(2), B<sched_setaffinity>(2), B<sched_setscheduler>(2), B<sched_setparam>(2), B<sched_yield>(2), B<setpriority>(2), B<pthread_getschedparam>(3), B<pthread_setschedparam>(3), B<pthread_setschedprio>(3), B<capabilities>(7), B<cpuset>(7), B<sched>(7)"
3035
3036 #. type: TH
3037 #: build/C/man2/sched_setparam.2:30
3038 #, no-wrap
3039 msgid "SCHED_SETPARAM"
3040 msgstr "SCHED_SETPARAM"
3041
3042 #. type: TH
3043 #: build/C/man2/sched_setparam.2:30
3044 #, no-wrap
3045 msgid "2014-05-11"
3046 msgstr "2014-05-11"
3047
3048 #. type: Plain text
3049 #: build/C/man2/sched_setparam.2:33
3050 msgid "sched_setparam, sched_getparam - set and get scheduling parameters"
3051 msgstr "sched_setparam, sched_getparam - スケジューリングパラメーターの設定と取得を行なう"
3052
3053 #. type: Plain text
3054 #: build/C/man2/sched_setparam.2:38
3055 #, no-wrap
3056 msgid "B<int sched_setparam(pid_t >I<pid>B<, const struct sched_param *>I<param>B<);>\n"
3057 msgstr "B<int sched_setparam(pid_t >I<pid>B<, const struct sched_param *>I<param>B<);>\n"
3058
3059 #. type: Plain text
3060 #: build/C/man2/sched_setparam.2:40
3061 #, no-wrap
3062 msgid "B<int sched_getparam(pid_t >I<pid>B<, struct sched_param *>I<param>B<);>\n"
3063 msgstr "B<int sched_getparam(pid_t >I<pid>B<, struct sched_param *>I<param>B<);>\n"
3064
3065 #. type: Plain text
3066 #: build/C/man2/sched_setparam.2:46
3067 #, no-wrap
3068 msgid ""
3069 "B<struct sched_param {\n"
3070 "    ...\n"
3071 "    int >I<sched_priority>B<;\n"
3072 "    ...\n"
3073 "};>\n"
3074 msgstr ""
3075 "B<struct sched_param {\n"
3076 "    ...\n"
3077 "    int >I<sched_priority>B<;\n"
3078 "    ...\n"
3079 "};>\n"
3080
3081 #. type: Plain text
3082 #: build/C/man2/sched_setparam.2:60
3083 msgid "B<sched_setparam>()  sets the scheduling parameters associated with the scheduling policy for the process identified by I<pid>.  If I<pid> is zero, then the parameters of the calling process are set.  The interpretation of the argument I<param> depends on the scheduling policy of the process identified by I<pid>.  See B<sched>(7)  for a description of the scheduling policies supported under Linux."
3084 msgstr "B<sched_setparam>()  は I<pid> で指定されたプロセスのスケジューリング方針 (scheduling policy) に 関連するスケジューリングパラメーターを設定する。 I<pid> が 0 ならば、呼び出し元のプロセスのパラメーターが設定される。 引き数 I<param> の解釈は、 I<pid> で指定されたプロセスのスケジューリング方針によって異なる。 Linux でサポートされているスケジューリング方針の説明は B<sched>(7)  を参照のこと。"
3085
3086 #. type: Plain text
3087 #: build/C/man2/sched_setparam.2:66
3088 msgid "B<sched_getparam>()  retrieves the scheduling parameters for the process identified by I<pid>.  If I<pid> is zero, then the parameters of the calling process are retrieved."
3089 msgstr "B<sched_getparam>()  は I<pid> で指定されたプロセスのスケジューリングパラメーターを取得する。 I<pid> が 0 ならば、呼び出し元のプロセスのパラメーターを取得する。"
3090
3091 #. type: Plain text
3092 #: build/C/man2/sched_setparam.2:75
3093 msgid "B<sched_setparam>()  checks the validity of I<param> for the scheduling policy of the thread.  The value I<param-E<gt>sched_priority> must lie within the range given by B<sched_get_priority_min>(2)  and B<sched_get_priority_max>(2)."
3094 msgstr "B<sched_setparam>()  はスレッドのスケジューリング方針における I<param> の妥当性をチェックする。 I<param-E<gt>sched_priority> の値は B<sched_get_priority_min>(2)  と B<sched_get_priority_max>(2)  の範囲に入っていなければならない。"
3095
3096 #. type: Plain text
3097 #: build/C/man2/sched_setparam.2:79
3098 msgid "For a discussion of the privileges and resource limits related to scheduling priority and policy, see B<sched>(7)."
3099 msgstr "スケジューリングの優先度と方針に関連する特権とリソース制限の 議論に関しては B<sched>(7)  を参照のこと。"
3100
3101 #. type: Plain text
3102 #: build/C/man2/sched_setparam.2:87
3103 msgid "POSIX systems on which B<sched_setparam>()  and B<sched_getparam>()  are available define B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
3104 msgstr "B<sched_setparam>()  と B<sched_getparam>()  が使用できる POSIX システムでは、 I<E<lt>unistd.hE<gt>> に B<_POSIX_PRIORITY_SCHEDULING> が定義されている。"
3105
3106 #. type: Plain text
3107 #: build/C/man2/sched_setparam.2:96
3108 msgid "On success, B<sched_setparam>()  and B<sched_getparam>()  return 0.  On error, -1 is returned, and I<errno> is set appropriately."
3109 msgstr "成功した場合は B<sched_setparam>()  と B<sched_getparam>()  は 0 を返す。 エラーの場合は -1 が返され、 I<errno> が適切に設定される。"
3110
3111 #. type: Plain text
3112 #: build/C/man2/sched_setparam.2:104
3113 msgid "Invalid arguments: I<param> is NULL or I<pid> is negative"
3114 msgstr "無効な引き数: I<param> が NULL である、または I<pid> が負である。"
3115
3116 #. type: Plain text
3117 #: build/C/man2/sched_setparam.2:109
3118 msgid "(B<sched_setparam>())  The argument I<param> does not make sense for the current scheduling policy."
3119 msgstr "(B<sched_setparam>()) 引き数 I<param> が現在のスケジューリング方針においては 無意味である。"
3120
3121 #. type: Plain text
3122 #: build/C/man2/sched_setparam.2:116
3123 msgid "(B<sched_setparam>())  The calling process does not have appropriate privileges (Linux: does not have the B<CAP_SYS_NICE> capability)."
3124 msgstr "(B<sched_setparam>()) 呼び出し元のプロセスが適切な特権を持っていない (Linux では、 B<CAP_SYS_NICE> ケーパビリティを持っていない)。"
3125
3126 #. type: Plain text
3127 #: build/C/man2/sched_setparam.2:119
3128 msgid "The process whose ID is I<pid> could not be found."
3129 msgstr "プロセス ID I<pid> のプロセスが見つからなかった。"
3130
3131 #. type: Plain text
3132 #: build/C/man2/sched_setparam.2:127
3133 msgid "Scheduling parameters are in fact per-thread attributes on Linux; see B<sched>(7)."
3134 msgstr "Linux では、スケジューリングパラメーターは実際にはスレッド単位の属性である。 B<sched>(7) 参照。"
3135
3136 #. type: Plain text
3137 #: build/C/man2/sched_setparam.2:142
3138 msgid "B<getpriority>(2), B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), B<sched_getaffinity>(2), B<sched_getscheduler>(2), B<sched_setaffinity>(2), B<sched_setscheduler>(2), B<sched_setattr>(2), B<setpriority>(2), B<capabilities>(7), B<sched>(7)"
3139 msgstr "B<getpriority>(2), B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), B<sched_getaffinity>(2), B<sched_getscheduler>(2), B<sched_setaffinity>(2), B<sched_setscheduler>(2), B<sched_setattr>(2), B<setpriority>(2), B<capabilities>(7), B<sched>(7)"
3140
3141 #. type: TH
3142 #: build/C/man2/sched_setscheduler.2:26
3143 #, no-wrap
3144 msgid "SCHED_SETSCHEDULER"
3145 msgstr "SCHED_SETSCHEDULER"
3146
3147 #. type: Plain text
3148 #: build/C/man2/sched_setscheduler.2:30
3149 msgid "sched_setscheduler, sched_getscheduler - set and get scheduling policy/parameters"
3150 msgstr "sched_setscheduler, sched_getscheduler - スケジューリングポリシーとパラメーターを設定/取得する"
3151
3152 #. type: Plain text
3153 #: build/C/man2/sched_setscheduler.2:35
3154 #, no-wrap
3155 msgid "B<int sched_setscheduler(pid_t >I<pid>B<, int >I<policy>B<,>\n"
3156 msgstr "B<int sched_setscheduler(pid_t >I<pid>B<, int >I<policy>B<,>\n"
3157
3158 #. type: Plain text
3159 #: build/C/man2/sched_setscheduler.2:37
3160 #, no-wrap
3161 msgid "B<                       const struct sched_param *>I<param>B<);>\n"
3162 msgstr "B<                       const struct sched_param *>I<param>B<);>\n"
3163
3164 #. type: Plain text
3165 #: build/C/man2/sched_setscheduler.2:39
3166 #, no-wrap
3167 msgid "B<int sched_getscheduler(pid_t >I<pid>B<);>\n"
3168 msgstr "B<int sched_getscheduler(pid_t >I<pid>B<);>\n"
3169
3170 #. type: Plain text
3171 #: build/C/man2/sched_setscheduler.2:49
3172 msgid "The B<sched_setscheduler>()  system call sets both the scheduling policy and parameters for the thread whose ID is specified in I<pid>.  If I<pid> equals zero, the scheduling policy and parameters of the calling thread will be set."
3173 msgstr "B<sched_setscheduler>() システムコールは、 I<pid> で指定された ID を持つスレッドのスケジューリングポリシーとスケジューリングパラメーターの両方を設定する。 I<pid> が 0 の場合、呼び出したスレッド自身のスケジューリングポリシーとスケジューリングパラメーターが設定される。"
3174
3175 #. type: Plain text
3176 #: build/C/man2/sched_setscheduler.2:53
3177 msgid "The scheduling parameters are specified in the I<param> argument, which is a pointer to a structure of the following form:"
3178 msgstr "スケジューリングパラメーターは I<param> 引き数で、以下の形式の構造体へのポインターを指定する。"
3179
3180 #. type: Plain text
3181 #: build/C/man2/sched_setscheduler.2:61
3182 #, no-wrap
3183 msgid ""
3184 "struct sched_param {\n"
3185 "    ...\n"
3186 "    int sched_priority;\n"
3187 "    ...\n"
3188 "};\n"
3189 msgstr ""
3190 "struct sched_param {\n"
3191 "    ...\n"
3192 "    int sched_priority;\n"
3193 "    ...\n"
3194 "};\n"
3195
3196 #. type: Plain text
3197 #: build/C/man2/sched_setscheduler.2:69
3198 msgid "In the current implementation, the structure contains only one field, I<sched_priority>.  The interpretation of I<param> depends on the selected policy."
3199 msgstr "現在の実装では、この構造体のフィールドは I<sched_priority> だけである。 I<param> がどのように解釈されるかは選択されたポリシーによって変わる。"
3200
3201 #. type: Plain text
3202 #: build/C/man2/sched_setscheduler.2:90
3203 msgid "For each of the above policies, I<param-E<gt>sched_priority> must be 0."
3204 msgstr "上記のどのポリシーの場合でも、 I<param-E<gt>sched_priority> は 0 でなければならない。"
3205
3206 #. type: Plain text
3207 #: build/C/man2/sched_setscheduler.2:116
3208 msgid "For each of the above policies, I<param-E<gt>sched_priority> specifies a scheduling priority for the thread.  This is a number in the range returned by calling B<sched_get_priority_min>(2)  and B<sched_get_priority_max>(2)  with the specified I<policy>.  On Linux, these system calls return, respectively, 1 and 99."
3209 msgstr "上記のどのポリシーの場合でも、 I<param-E<gt>sched_priority> はそのスレッドのスケジューリングポリシーを指定する。 指定された I<policy> で I<sched_get_priority_min>(2) と I<sched_get_priority_max>(2) を呼び出した返り値の範囲の数字を指定する。 Linux では、これらのシステムコールはそれぞれ 1 と 99 を返す。"
3210
3211 #. type: Plain text
3212 #: build/C/man2/sched_setscheduler.2:129
3213 msgid "Since Linux 2.6.32, the B<SCHED_RESET_ON_FORK> flag can be ORed in I<policy> when calling B<sched_setscheduler>().  As a result of including this flag, children created by B<fork>(2)  do not inherit privileged scheduling policies.  See B<sched>(7)  for details."
3214 msgstr "Linux 2.6.32 以降では、 B<sched_setscheduler>() を呼び出す際に I<policy> に B<SCHED_RESET_ON_FORK> フラグを OR で指定できる。このフラグが指定されると、 B<fork>(2) で作成された子プロセスは特権が必要なスケジューリングポリシーを継承しない。 詳細は B<sched>(7) を参照。"
3215
3216 #. type: Plain text
3217 #: build/C/man2/sched_setscheduler.2:135
3218 msgid "B<sched_getscheduler>()  returns the current scheduling policy of the thread identified by I<pid>.  If I<pid> equals zero, the policy of the calling thread will be retrieved."
3219 msgstr "B<sched_getscheduler>()  は I<pid> で識別されるスレッドの現在のスケジューリングポリシーを返す。I<pid> が 0 ならば、呼び出した スレッド自身のスケジューリングポリシーが返される。"
3220
3221 #. type: Plain text
3222 #: build/C/man2/sched_setscheduler.2:145
3223 msgid "On success, B<sched_setscheduler>()  returns zero.  On success, B<sched_getscheduler>()  returns the policy for the thread (a nonnegative integer).  On error, both calls return -1, and I<errno> is set appropriately."
3224 msgstr "成功した場合、 B<sched_setscheduler>()  は 0 を返す。 成功した場合、 B<sched_getscheduler>()  は現在のそのスレッドのポリシー (非負の整数) を返す。 エラーの場合、 どちらのコールも -1 を返し、 I<errno> が適切に設定される。"
3225
3226 #. type: Plain text
3227 #: build/C/man2/sched_setscheduler.2:153
3228 msgid "Invalid arguments: I<pid> is negative or I<param> is NULL."
3229 msgstr "無効な引き数: I<pid> が負である、または I<param> が NULL である。"
3230
3231 #. type: Plain text
3232 #: build/C/man2/sched_setscheduler.2:158
3233 msgid "(B<sched_setscheduler>())  I<policy> is not one of the recognized policies."
3234 msgstr "(B<sched_setscheduler>()) I<policy> が認識できるポリシーではない。"
3235
3236 #. type: Plain text
3237 #: build/C/man2/sched_setscheduler.2:164
3238 msgid "(B<sched_setscheduler>())  I<param> does not make sense for the specified I<policy>."
3239 msgstr "(B<sched_setscheduler>()) 引き数 I<param> が指定された I<policy> では意味を持たない。"
3240
3241 #. type: Plain text
3242 #: build/C/man2/sched_setscheduler.2:167
3243 msgid "The calling thread does not have appropriate privileges."
3244 msgstr "呼び出したスレッドが適切な特権を持っていない。"
3245
3246 #. type: Plain text
3247 #: build/C/man2/sched_setscheduler.2:173
3248 msgid "POSIX.1-2001 (but see BUGS below).  The B<SCHED_BATCH> and B<SCHED_IDLE> policies are Linux-specific."
3249 msgstr "POSIX.1-2001 (但し、下記のバグの節も参照)。 B<SCHED_BATCH> と B<SCHED_IDLE> ポリシーは Linux 固有である。"
3250
3251 #. type: Plain text
3252 #: build/C/man2/sched_setscheduler.2:177
3253 msgid "Further details of the semantics of all of the above \"normal\" and \"real-time\" scheduling policies can be found in B<sched>(7)."
3254 msgstr "上記の「通常」および「リアルタイム」スケジューリングポリシーの動作の詳細な説明は B<sched>(7) にある。"
3255
3256 #. type: Plain text
3257 #: build/C/man2/sched_setscheduler.2:185
3258 msgid "POSIX systems on which B<sched_setscheduler>()  and B<sched_getscheduler>()  are available define B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
3259 msgstr "POSIX システムでは I<E<lt>unistd.hE<gt>> に B<_POSIX_PRIORITY_SCHEDULING> が定義されている場合にのみ B<sched_setscheduler>()  と B<sched_getscheduler>()  が使用できる。"
3260
3261 #. type: Plain text
3262 #: build/C/man2/sched_setscheduler.2:193
3263 msgid "POSIX.1 does not detail the permissions that an unprivileged thread requires in order to call B<sched_setscheduler>(), and details vary across systems.  For example, the Solaris 7 manual page says that the real or effective user ID of the caller must match the real user ID or the save set-user-ID of the target."
3264 msgstr "POSIX.1 は、非特権スレッドが B<sched_setscheduler>()  を呼び出すために必要な権限の詳細を規定しておらず、 詳細はシステムにより異なる。 例えば、Solaris 7 のマニュアルページでは、 呼び出し元の実ユーザー ID または実効ユーザー ID が 設定対象の実ユーザー ID か保存 (save) set-user-ID と 一致していなければならない、となっている。"
3265
3266 #. type: Plain text
3267 #: build/C/man2/sched_setscheduler.2:214
3268 msgid "The scheduling policy and parameters are in fact per-thread attributes on Linux.  The value returned from a call to B<gettid>(2)  can be passed in the argument I<pid>.  Specifying I<pid> as 0 will operate on the attributes of the calling thread, and passing the value returned from a call to B<getpid>(2)  will operate on the attributes of the main thread of the thread group.  (If you are using the POSIX threads API, then use B<pthread_setschedparam>(3), B<pthread_getschedparam>(3), and B<pthread_setschedprio>(3), instead of the B<sched_*>(2)  system calls.)"
3269 msgstr "Linux では、 スケジューリングポリシーとスケジューリングパラメーターは、 実際にはスレッド単位の属性である。 B<gettid>(2) の呼び出しの返り値をこのシステムコールの I<pid> 引き数として渡すことができる。 I<pid> に 0 を指定すると、 呼び出し元のスレッドの属性が設定される。 B<getpid>(2) コールからの返り値を I<pid> に指定すると、 スレッドグループのメインスレッドの属性が設定される (POSIX スレッド API を使用している場合は、 B<sched_*>(2) システムコールの代わりに B<pthread_setschedparam>(3), B<pthread_getschedparam>(3), and B<pthread_setschedprio>(3) を使用すること)。"
3270
3271 #. type: Plain text
3272 #: build/C/man2/sched_setscheduler.2:222
3273 msgid "POSIX says that on success, B<sched_setscheduler>()  should return the previous scheduling policy.  Linux B<sched_setscheduler>()  does not conform to this requirement, since it always returns 0 on success."
3274 msgstr "POSIX では、成功時に B<sched_setscheduler>()  は直前のスケジューリングポリシーを返すべきとされている。 Linux の B<sched_setscheduler>()  はこの要求仕様に準拠しておらず、 成功時には常に 0 を返す。"
3275
3276 #. type: Plain text
3277 #: build/C/man2/sched_setscheduler.2:241
3278 msgid "B<chrt>(1), B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), B<sched_getaffinity>(2), B<sched_getattr>(2), B<sched_getparam>(2), B<sched_rr_get_interval>(2), B<sched_setaffinity>(2), B<sched_setattr>(2), B<sched_setparam>(2), B<sched_yield>(2), B<setpriority>(2), B<capabilities>(7), B<cpuset>(7), B<sched>(7)"
3279 msgstr "B<chrt>(1), B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), B<sched_getaffinity>(2), B<sched_getattr>(2), B<sched_getparam>(2), B<sched_rr_get_interval>(2), B<sched_setaffinity>(2), B<sched_setattr>(2), B<sched_setparam>(2), B<sched_yield>(2), B<setpriority>(2), B<capabilities>(7), B<cpuset>(7), B<sched>(7)"
3280
3281 #. type: TH
3282 #: build/C/man2/sched_yield.2:29
3283 #, no-wrap
3284 msgid "SCHED_YIELD"
3285 msgstr "SCHED_YIELD"
3286
3287 #. type: Plain text
3288 #: build/C/man2/sched_yield.2:32
3289 msgid "sched_yield - yield the processor"
3290 msgstr "sched_yield - プロセッサーを空け渡す(yield)"
3291
3292 #. type: Plain text
3293 #: build/C/man2/sched_yield.2:36
3294 msgid "B<int sched_yield(void);>"
3295 msgstr "B<int sched_yield(void);>"
3296
3297 #. type: Plain text
3298 #: build/C/man2/sched_yield.2:41
3299 msgid "B<sched_yield>()  causes the calling thread to relinquish the CPU.  The thread is moved to the end of the queue for its static priority and a new thread gets to run."
3300 msgstr "B<sched_yield>()  を呼び出すことで、呼び出したスレッドが CPU の使用権を手放すことができる。 そのスレッドは、そのスレッドの静的プライオリティのキューの末尾に 移動し、新しいスレッドが走り始める。"
3301
3302 #. type: Plain text
3303 #: build/C/man2/sched_yield.2:48
3304 msgid "On success, B<sched_yield>()  returns 0.  On error, -1 is returned, and I<errno> is set appropriately."
3305 msgstr "成功した場合は B<sched_yield>()  は 0 を返す。 エラーの場合は -1 が返され、 I<errno> が適切に設定される。"
3306
3307 #. type: Plain text
3308 #: build/C/man2/sched_yield.2:52
3309 msgid "In the Linux implementation, B<sched_yield>()  always succeeds."
3310 msgstr "Linux の実装では、 B<sched_yield>()  は常に成功する。"
3311
3312 #. type: Plain text
3313 #: build/C/man2/sched_yield.2:59
3314 msgid "If the calling thread is the only thread in the highest priority list at that time, it will continue to run after a call to B<sched_yield>()."
3315 msgstr "B<sched_yield>()  を呼び出した時点で最大優先度のリストの中に呼び出し元のスレッドしか 存在しなければ、そのスレッドは呼び出し後も走り続けることになる。"
3316
3317 #. type: Plain text
3318 #: build/C/man2/sched_yield.2:66
3319 msgid "POSIX systems on which B<sched_yield>()  is available define B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
3320 msgstr "POSIX システムで B<sched_yield>()  は I<E<lt>unistd.hE<gt>> に B<_POSIX_PRIORITY_SCHEDULING> が定義されている場合にのみ使用可能である。"
3321
3322 #. type: Plain text
3323 #: build/C/man2/sched_yield.2:79
3324 msgid "Strategic calls to B<sched_yield>()  can improve performance by giving other threads or processes a chance to run when (heavily) contended resources (e.g., mutexes)  have been released by the caller.  Avoid calling B<sched_yield>()  unnecessarily or inappropriately (e.g., when resources needed by other schedulable threads are still held by the caller), since doing so will result in unnecessary context switches, which will degrade system performance."
3325 msgstr "B<sched_yield>()  を戦略的に呼び出すことで、(極度に) 競合するリソース (mutex など)  を呼び出し元が解放した際に他のスレッドやプロセスに実行機会を与えることで、 性能を上げることができる。 B<sched_yield>()  を必要もないのに呼び出したり、不適切な場面 (例えば、他のスケジューリング 対象となるスレッドが必要とするリソースを呼び出し元が保持したままの状態)  で呼び出したりするのは避けること。なぜなら、 B<sched_yield>()  の呼び出しより不必要なコンテキストスイッチが起こり、システム性能が 劣化する結果になるからである。"
3326
3327 #. type: TH
3328 #: build/C/man7/sched.7:32
3329 #, no-wrap
3330 msgid "SCHED"
3331 msgstr "SCHED"
3332
3333 #. type: Plain text
3334 #: build/C/man7/sched.7:35
3335 msgid "sched - overview of scheduling APIs"
3336 msgstr "sched - スケジューリング API の概要"
3337
3338 #. type: SS
3339 #: build/C/man7/sched.7:36
3340 #, no-wrap
3341 msgid "API summary"
3342 msgstr "API の概要"
3343
3344 #. type: Plain text
3345 #: build/C/man7/sched.7:38
3346 msgid "The Linux scheduling APIs are as follows:"
3347 msgstr "Linux のスケジューリング API は以下のとおりである。"
3348
3349 #. type: TP
3350 #: build/C/man7/sched.7:38
3351 #, no-wrap
3352 msgid "B<sched_setscheduler>(2)"
3353 msgstr "B<sched_setscheduler>(2)"
3354
3355 #. type: Plain text
3356 #: build/C/man7/sched.7:41
3357 msgid "Set the scheduling policy and parameters of a specified thread."
3358 msgstr "指定されたスレッドのスケジューリングポリシーとパラメーターを設定する。"
3359
3360 #. type: TP
3361 #: build/C/man7/sched.7:41
3362 #, no-wrap
3363 msgid "B<sched_getscheduler>(2)"
3364 msgstr "B<sched_getscheduler>(2)"
3365
3366 #. type: Plain text
3367 #: build/C/man7/sched.7:44
3368 msgid "Return the scheduling policy of a specified thread."
3369 msgstr "指定されたスレッドのスケジューリングポリシーを返す。"
3370
3371 #. type: TP
3372 #: build/C/man7/sched.7:44
3373 #, no-wrap
3374 msgid "B<sched_setparam>(2)"
3375 msgstr "B<sched_setparam>(2)"
3376
3377 #. type: Plain text
3378 #: build/C/man7/sched.7:47
3379 msgid "Set the scheduling parameters of a specified thread."
3380 msgstr "指定されたスレッドのスケジューリングパラメーターを設定する。"
3381
3382 #. type: TP
3383 #: build/C/man7/sched.7:47
3384 #, no-wrap
3385 msgid "B<sched_getparam>(2)"
3386 msgstr "B<sched_getparam>(2)"
3387
3388 #. type: Plain text
3389 #: build/C/man7/sched.7:50
3390 msgid "Fetch the scheduling parameters of a specified thread."
3391 msgstr "指定されたスレッドのスケジューリングパラメーターを取得する。"
3392
3393 #. type: TP
3394 #: build/C/man7/sched.7:50
3395 #, no-wrap
3396 msgid "B<sched_get_priority_max>(2)"
3397 msgstr "B<sched_get_priority_max>(2)"
3398
3399 #. type: Plain text
3400 #: build/C/man7/sched.7:53
3401 msgid "Return the minimum priority available in a specified scheduling policy."
3402 msgstr "指定されたスケジューリングポリシーで利用可能な最小の優先度を返す。"
3403
3404 #. type: TP
3405 #: build/C/man7/sched.7:53
3406 #, no-wrap
3407 msgid "B<sched_get_priority_min>(2)"
3408 msgstr "B<sched_get_priority_min>(2)"
3409
3410 #. type: Plain text
3411 #: build/C/man7/sched.7:56
3412 msgid "Return the maximum priority available in a specified scheduling policy."
3413 msgstr "指定されたスケジューリングポリシーで利用可能な最大の優先度を返す。"
3414
3415 #. type: TP
3416 #: build/C/man7/sched.7:56
3417 #, no-wrap
3418 msgid "B<sched_rr_get_interval>(2)"
3419 msgstr "B<sched_rr_get_interval>(2)"
3420
3421 #. type: Plain text
3422 #: build/C/man7/sched.7:60
3423 msgid "Fetch the quantum used for threads that are scheduled under the \"round-robin\" scheduling policy."
3424 msgstr "「ラウンドロビン」スケジューリングポリシーでスケジューリグされるスレッドで使用される単位時間 (quantum) を取得する。"
3425
3426 #. type: TP
3427 #: build/C/man7/sched.7:60
3428 #, no-wrap
3429 msgid "B<sched_yield>(2)"
3430 msgstr "B<sched_yield>(2)"
3431
3432 #. type: Plain text
3433 #: build/C/man7/sched.7:64
3434 msgid "Cause the caller to relinquish the CPU, so that some other thread be executed."
3435 msgstr "呼び出し元が CPU の使用権を明け渡して、 他のスレッドが実行できるようにする。"
3436
3437 #. type: TP
3438 #: build/C/man7/sched.7:64
3439 #, no-wrap
3440 msgid "B<sched_setaffinity>(2)"
3441 msgstr "B<sched_setaffinity>(2)"
3442
3443 #. type: Plain text
3444 #: build/C/man7/sched.7:68
3445 msgid "(Linux-specific)  Set the CPU affinity of a specified thread."
3446 msgstr "(Linux 固有) 指定されたスレッドの CPU affinity を設定する。"
3447
3448 #. type: TP
3449 #: build/C/man7/sched.7:68
3450 #, no-wrap
3451 msgid "B<sched_getaffinity>(2)"
3452 msgstr "B<sched_getaffinity>(2)"
3453
3454 #. type: Plain text
3455 #: build/C/man7/sched.7:72
3456 msgid "(Linux-specific)  Get the CPU affinity of a specified thread."
3457 msgstr "(Linux 固有) 指定されたスレッドの CPU affinity を取得する。"
3458
3459 #. type: TP
3460 #: build/C/man7/sched.7:72
3461 #, no-wrap
3462 msgid "B<sched_setattr>(2)"
3463 msgstr "B<sched_setattr>(2)"
3464
3465 #. type: Plain text
3466 #: build/C/man7/sched.7:79
3467 msgid "Set the scheduling policy and parameters of a specified thread.  This (Linux-specific) system call provides a superset of the functionality of B<sched_setscheduler>(2)  and B<sched_setparam>(2)."
3468 msgstr "指定されたスレッドのスケジューリングポリシーとパラメーターを設定する。 この (Linux 固有の) システムコールは B<sched_setscheduler>(2) と B<sched_setparam>(2) の両方の機能を持つ。"
3469
3470 #. type: TP
3471 #: build/C/man7/sched.7:79
3472 #, no-wrap
3473 msgid "B<sched_getattr>(2)"
3474 msgstr "B<sched_getattr>(2)"
3475
3476 #. type: Plain text
3477 #: build/C/man7/sched.7:87
3478 msgid "Fetch the scheduling policy and parameters of a specified thread.  This (Linux-specific) system call provides a superset of the functionality of B<sched_getscheduler>(2)  and B<sched_getparam>(2)."
3479 msgstr "指定されたスレッドのスケジューリングポリシーとパラメーターを取得する。 この (Linux 固有の) システムコールは B<sched_getscheduler>(2) と B<sched_getparam>(2) の両方の機能を持つ。"
3480
3481 #. type: SS
3482 #: build/C/man7/sched.7:87
3483 #, no-wrap
3484 msgid "Scheduling policies"
3485 msgstr "スケジューリングポリシー (scheduling policy)"
3486
3487 #. type: Plain text
3488 #: build/C/man7/sched.7:95
3489 msgid "The scheduler is the kernel component that decides which runnable thread will be executed by the CPU next.  Each thread has an associated scheduling policy and a I<static> scheduling priority, I<sched_priority>.  The scheduler makes its decisions based on knowledge of the scheduling policy and static priority of all threads on the system."
3490 msgstr "スケジューラ (scheduler) とはカーネルの構成要素で、 次に CPU で実行される実行可能なスレッドを決定するものである。 各々のスレッドには、スケジューリングポリシーと 「静的」なスケジューリング優先度 I<sched_priority> が対応付けられる。 スケジューラは、システム上の全スレッドのスケジューリングポリシーと 静的優先度に関する知識に基づいて決定を行う。"
3491
3492 #. type: Plain text
3493 #: build/C/man7/sched.7:100
3494 msgid "For threads scheduled under one of the normal scheduling policies (B<SCHED_OTHER>, B<SCHED_IDLE>, B<SCHED_BATCH>), I<sched_priority> is not used in scheduling decisions (it must be specified as 0)."
3495 msgstr "通常のスケジューリングポリシー (B<SCHED_OTHER>, B<SCHED_IDLE>, B<SCHED_BATCH>)  の下でスケジューリングされるスレッドでは、 I<sched_priority> はスケジューリングの決定に使用されない (I<sched_priority> には 0 を指定しなければならない)。"
3496
3497 #. type: Plain text
3498 #: build/C/man7/sched.7:114
3499 msgid "Processes scheduled under one of the real-time policies (B<SCHED_FIFO>, B<SCHED_RR>) have a I<sched_priority> value in the range 1 (low) to 99 (high).  (As the numbers imply, real-time threads always have higher priority than normal threads.)  Note well: POSIX.1-2001 requires an implementation to support only a minimum 32 distinct priority levels for the real-time policies, and some systems supply just this minimum.  Portable programs should use B<sched_get_priority_min>(2)  and B<sched_get_priority_max>(2)  to find the range of priorities supported for a particular policy."
3500 msgstr "リアルタイムスケジューリングポリシー (B<SCHED_FIFO>, B<SCHED_RR>)  の下でスケジューリングされるスレッドは、 I<sched_priority> の値は 1 (最低) から 99 (最高) の範囲となる (数字から分かるように、リアルタイムスレッドは常に通常のスレッドよりも 高い優先度を持つ)。 ここで注意すべきなのは、POSIX.1-2001 が要求しているのは、 リアルタイムポリシーの実装において最低 32 種類の異なる優先度レベルが サポートされることだけであり、いくつかのシステムではこの最低限の数の 優先度しか提供されていない、ということである。 移植性が必要なプログラムでは、 B<sched_get_priority_min>(2)  と B<sched_get_priority_max>(2)  を使って、あるポリシーがサポートする優先度の範囲を調べるべきである。"
3501
3502 #. type: Plain text
3503 #: build/C/man7/sched.7:120
3504 msgid "Conceptually, the scheduler maintains a list of runnable threads for each possible I<sched_priority> value.  In order to determine which thread runs next, the scheduler looks for the nonempty list with the highest static priority and selects the thread at the head of this list."
3505 msgstr "概念としては、 スケジューラはその I<sched_priority> の値それぞれに対して 実行可能なスレッドのリストを管理している。 どのスレッドを次に実行するかを決定するために、 スケジューラは静的優先度の最も高い空でないリストを探して、 そのリストの先頭のスレッドを選択する。"
3506
3507 #. type: Plain text
3508 #: build/C/man7/sched.7:124
3509 msgid "A thread's scheduling policy determines where it will be inserted into the list of threads with equal static priority and how it will move inside this list."
3510 msgstr "各スレッドのスケジューリングポリシーは、 そのスレッドが同じ静的優先度を持つスレッドのリストの中のどこに挿入され、 このリストの中をどのように移動するかを決定する。"
3511
3512 #. type: Plain text
3513 #: build/C/man7/sched.7:132
3514 msgid "All scheduling is preemptive: if a thread with a higher static priority becomes ready to run, the currently running thread will be preempted and returned to the wait list for its static priority level.  The scheduling policy determines the ordering only within the list of runnable threads with equal static priority."
3515 msgstr "全てのスケジューリングはプリエンプティブ (preemptive) である: より高い優先度のスレッドが実行可能になると、現在実行中のスレッドは実行権を 取り上げられ (preempted)、そのスレッドの静的優先度レベルの待ちリストに 戻される。スケジューリングポリシーは同じ静的優先度を持つ実行可能な スレッドのリストの中で順番のみを決定する。"
3516
3517 #. type: SS
3518 #: build/C/man7/sched.7:132
3519 #, no-wrap
3520 msgid "SCHED_FIFO: First in-first out scheduling"
3521 msgstr "SCHED_FIFO: ファーストインファーストアウトスケジューリング"
3522
3523 #. type: Plain text
3524 #: build/C/man7/sched.7:141
3525 msgid "B<SCHED_FIFO> can be used only with static priorities higher than 0, which means that when a B<SCHED_FIFO> threads becomes runnable, it will always immediately preempt any currently running B<SCHED_OTHER>, B<SCHED_BATCH>, or B<SCHED_IDLE> thread.  B<SCHED_FIFO> is a simple scheduling algorithm without time slicing.  For threads scheduled under the B<SCHED_FIFO> policy, the following rules apply:"
3526 msgstr "B<SCHED_FIFO> は 0 より大きな静的優先度でのみ使用できる。このポリシーでは、 B<SCHED_FIFO> スレッドが実行可能になった場合、 そのポリシーが B<SCHED_OTHER>、 B<SCHED_BATCH>、 B<SCHED_IDLE> の 現在実行中のスレッドは直ちに実行権を取り上げられる。 B<SCHED_FIFO> は時分割のない単純なスケジューリングアルゴリズムである。 B<SCHED_FIFO> ポリシーでスケジューリングされているスレッドには以下の ルールが適用される:"
3527
3528 #. type: IP
3529 #: build/C/man7/sched.7:141 build/C/man7/sched.7:146 build/C/man7/sched.7:149
3530 #: build/C/man7/sched.7:164 build/C/man7/sched.7:412 build/C/man7/sched.7:421
3531 #: build/C/man7/sched.7:444 build/C/man7/sched.7:452 build/C/man7/sched.7:491
3532 #: build/C/man7/sched.7:499 build/C/man7/sched.7:504 build/C/man7/sched.7:509
3533 #, no-wrap
3534 msgid "*"
3535 msgstr "*"
3536
3537 #. type: Plain text
3538 #: build/C/man7/sched.7:146
3539 msgid "A B<SCHED_FIFO> thread that has been preempted by another thread of higher priority will stay at the head of the list for its priority and will resume execution as soon as all threads of higher priority are blocked again."
3540 msgstr "より高い優先度の他のスレッドによって取って代わられた B<SCHED_FIFO> スレッドはその優先度のリストの先頭に留まり続け、 より高い優先度のスレッド全てが停止 (block) した場合に実行を再開する。"
3541
3542 #. type: Plain text
3543 #: build/C/man7/sched.7:149
3544 msgid "When a B<SCHED_FIFO> thread becomes runnable, it will be inserted at the end of the list for its priority."
3545 msgstr "B<SCHED_FIFO> スレッドが実行可能になった時、その優先度のリストの最後 に挿入される。"
3546
3547 #.  In 2.2.x and 2.4.x, the thread is placed at the front of the queue
3548 #.  In 2.0.x, the Right Thing happened: the thread went to the back -- MTK
3549 #. type: Plain text
3550 #: build/C/man7/sched.7:164
3551 msgid "A call to B<sched_setscheduler>(2), B<sched_setparam>(2), or B<sched_setattr>(2)  will put the B<SCHED_FIFO> (or B<SCHED_RR>) thread identified by I<pid> at the start of the list if it was runnable.  As a consequence, it may preempt the currently running thread if it has the same priority.  (POSIX.1-2001 specifies that the thread should go to the end of the list.)"
3552 msgstr "B<sched_setscheduler>(2), B<sched_setparam>(2), B<sched_setattr>(2) は I<pid> で指定された B<SCHED_FIFO> (または B<SCHED_RR>) スレッドが 実行可能な場合、リストの最初に置く。 結果として、もし優先度が同じだった場合、 現在実行中のスレッドに先んじるかもしれない。 (POSIX.1-2001 ではスレッドはリストの最後に行くべきと規定されている。)"
3553
3554 #. type: Plain text
3555 #: build/C/man7/sched.7:168
3556 msgid "A thread calling B<sched_yield>(2)  will be put at the end of the list."
3557 msgstr "B<sched_yield>(2)  を呼び出したスレッドはリストの最後に置かれる。"
3558
3559 #. type: Plain text
3560 #: build/C/man7/sched.7:172
3561 msgid "No other events will move a thread scheduled under the B<SCHED_FIFO> policy in the wait list of runnable threads with equal static priority."
3562 msgstr "その他のイベントによって B<SCHED_FIFO> ポリシーでスケジューリングされるスレッドが同じ優先度の実行可能なスレッドの待ちリストの中を移動することはない。"
3563
3564 #. type: Plain text
3565 #: build/C/man7/sched.7:177
3566 msgid "A B<SCHED_FIFO> thread runs until either it is blocked by an I/O request, it is preempted by a higher priority thread, or it calls B<sched_yield>(2)."
3567 msgstr "B<SCHED_FIFO> スレッドは I/O 要求によって停止するか、 より高い優先度のスレッドによって置きかえられるか、 B<sched_yield>(2)  を呼び出すまで実行を続ける。"
3568
3569 #. type: SS
3570 #: build/C/man7/sched.7:177
3571 #, no-wrap
3572 msgid "SCHED_RR: Round-robin scheduling"
3573 msgstr "SCHED_RR: ラウンドロビン (round-robin) スケジューリング"
3574
3575 #.  On Linux 2.4, the length of the RR interval is influenced
3576 #.  by the process nice value -- MTK
3577 #. type: Plain text
3578 #: build/C/man7/sched.7:196
3579 msgid "B<SCHED_RR> is a simple enhancement of B<SCHED_FIFO>.  Everything described above for B<SCHED_FIFO> also applies to B<SCHED_RR>, except that each thread is allowed to run only for a maximum time quantum.  If a B<SCHED_RR> thread has been running for a time period equal to or longer than the time quantum, it will be put at the end of the list for its priority.  A B<SCHED_RR> thread that has been preempted by a higher priority thread and subsequently resumes execution as a running thread will complete the unexpired portion of its round-robin time quantum.  The length of the time quantum can be retrieved using B<sched_rr_get_interval>(2)."
3580 msgstr ""
3581 "B<SCHED_RR> は B<SCHED_FIFO> の単純な拡張である。 上述された\n"
3582 "B<SCHED_FIFO> に関する記述は全て B<SCHED_RR> に 適用できる。異なるのは\n"
3583 "それぞれのスレッドは最大時間単位までしか実行できない ということである。\n"
3584 "B<SCHED_RR> スレッドが時間単位と同じかそれより 長い時間実行されると、\n"
3585 "その優先度のリストの最後に置かれる。 より高い優先度のスレッドによって\n"
3586 "置きかえられ、その後実行を再開した B<SCHED_RR> スレッドは、そのラウンド\n"
3587 "ロビン時間単位を完全に使い切る まで実行される。その時間単位の長さは\n"
3588 "B<sched_rr_get_interval>(2) を使って取得できる。"
3589
3590 #. type: SS
3591 #: build/C/man7/sched.7:196
3592 #, no-wrap
3593 msgid "SCHED_DEADLINE: Sporadic task model deadline scheduling"
3594 msgstr "SCHED_DEADLINE: 散発タスクモデルのデッドラインスケジューリング"
3595
3596 #. type: Plain text
3597 #: build/C/man7/sched.7:208
3598 msgid "Since version 3.14, Linux provides a deadline scheduling policy (B<SCHED_DEADLINE>).  This policy is currently implemented using GEDF (Global Earliest Deadline First)  in conjunction with CBS (Constant Bandwidth Server).  To set and fetch this policy and associated attributes, one must use the Linux-specific B<sched_setattr>(2)  and B<sched_getattr>(2)  system calls."
3599 msgstr "バージョン 3.14 以降では、 Linux はデッドラインスケジューリングポリシー (B<SCHED_DEADLINE>) が提供される。 現在のところ、 このポリシーは GEDF (Global Earliest Deadline First) を使って CBS (Constant Bandwidth Server) との組み合わせで実装されている。 このポリシーと関連する属性の設定、取得を行うには、 Linux 固有のシステムコール B<sched_setattr>(2) と B<sched_getattr>(2) を使用する必要がある。"
3600
3601 #. type: Plain text
3602 #: build/C/man7/sched.7:226
3603 msgid "A sporadic task is one that has a sequence of jobs, where each job is activated at most once per period.  Each job also has a I<relative deadline>, before which it should finish execution, and a I<computation time>, which is the CPU time necessary for executing the job.  The moment when a task wakes up because a new job has to be executed is called the I<arrival time> (also referred to as the request time or release time).  The I<start time> is the time at which a task starts its execution.  The I<absolute deadline> is thus obtained by adding the relative deadline to the arrival time."
3604 msgstr "散発タスク (sporadic task) はジョブ列を持つタスクで、 各ジョブは期間 (period) あたり多くとも 1 回だけ有効化される。 各ジョブには I<relative deadline> (相対デッドライン) と I<computation time> (計算時間) がある。 相対デッドラインは、そのジョブがそのデッドラインより前に実行が終了すべきであることを示す。 計算時間は、このジョブを実行するのに必要な CPU 時間である。 新しいジョブを実行する必要が出てタスクが起こされる時点は I<arrival time> (到着時刻) と呼ばれる (要求時刻 (request time) や解放時刻 (release time) と呼ばれることもある)。 I<start time> はタスクが実行を開始する時刻である。 したがって、 I<absolute deadline> (絶対デッドライン) は到着時刻に相対デッドラインを加算することで求められる。"
3605
3606 #. type: Plain text
3607 #: build/C/man7/sched.7:228
3608 msgid "The following diagram clarifies these terms:"
3609 msgstr "以下の図はこれらの用語をまとめたものである。"
3610
3611 #. type: Plain text
3612 #: build/C/man7/sched.7:239
3613 #, no-wrap
3614 msgid ""
3615 "arrival/wakeup                    absolute deadline\n"
3616 "     |    start time                    |\n"
3617 "     |        |                         |\n"
3618 "     v        v                         v\n"
3619 "-----x--------xooooooooooooooooo--------x--------x---\n"
3620 "              |E<lt>- comp. time -E<gt>|\n"
3621 "     |E<lt>------- relative deadline ------E<gt>|\n"
3622 "     |E<lt>-------------- period -------------------E<gt>|\n"
3623 msgstr ""
3624 "arrival/wakeup                    absolute deadline\n"
3625 "     |    start time                    |\n"
3626 "     |        |                         |\n"
3627 "     v        v                         v\n"
3628 "-----x--------xooooooooooooooooo--------x--------x---\n"
3629 "              |E<lt>- comp. time -E<gt>|\n"
3630 "     |E<lt>------- relative deadline ------E<gt>|\n"
3631 "     |E<lt>-------------- period -------------------E<gt>|\n"
3632
3633 #. type: Plain text
3634 #: build/C/man7/sched.7:258
3635 msgid "When setting a B<SCHED_DEADLINE> policy for a thread using B<sched_setattr>(2), one can specify three parameters: I<Runtime>, I<Deadline>, and I<Period>.  These parameters do not necessarily correspond to the aforementioned terms: usual practice is to set Runtime to something bigger than the average computation time (or worst-case execution time for hard real-time tasks), Deadline to the relative deadline, and Period to the period of the task.  Thus, for B<SCHED_DEADLINE> scheduling, we have:"
3636 msgstr "B<sched_setattr>(2) を使ってスレッドに B<SCHED_DEADLINE> ポリシーを設定する際、 I<Runtime>, I<Deadline>, I<Period> の 3 つのパラメーターを指定することができる。 これらのパラメーターは必ずしも上で述べた用語に対応しているわけではない。 よくある方法としては、 Runtime に平均計算時間 (もしくはハードリアルタイムタスクの場合は最悪ケースの実行時間) よりも大きな値を、 Deadline に相対デッドラインを、 Period にタスクの期間 (period) を設定する。 したがって、 B<SCHED_DEADLINE> スケジューリングでは、 以下のようになる。"
3637
3638 #. type: Plain text
3639 #: build/C/man7/sched.7:269
3640 #, no-wrap
3641 msgid ""
3642 "arrival/wakeup                    absolute deadline\n"
3643 "     |    start time                    |\n"
3644 "     |        |                         |\n"
3645 "     v        v                         v\n"
3646 "-----x--------xooooooooooooooooo--------x--------x---\n"
3647 "              |E<lt>-- Runtime -------E<gt>|\n"
3648 "     |E<lt>----------- Deadline -----------E<gt>|\n"
3649 "     |E<lt>-------------- Period -------------------E<gt>|\n"
3650 msgstr ""
3651 "arrival/wakeup                    absolute deadline\n"
3652 "     |    start time                    |\n"
3653 "     |        |                         |\n"
3654 "     v        v                         v\n"
3655 "-----x--------xooooooooooooooooo--------x--------x---\n"
3656 "              |E<lt>-- Runtime -------E<gt>|\n"
3657 "     |E<lt>----------- Deadline -----------E<gt>|\n"
3658 "     |E<lt>-------------- Period -------------------E<gt>|\n"
3659
3660 #.  FIXME It looks as though specifying sched_period as 0 means
3661 #.        "make sched_period the same as sched_deadline".
3662 #.        This needs to be documented.
3663 #. type: Plain text
3664 #: build/C/man7/sched.7:289
3665 msgid "The three deadline-scheduling parameters correspond to the I<sched_runtime>, I<sched_deadline>, and I<sched_period> fields of the I<sched_attr> structure; see B<sched_setattr>(2).  These fields express value in nanoseconds.  If I<sched_period> is specified as 0, then it is made the same as I<sched_deadline>."
3666 msgstr "3 つのデッドラインスケジューリングパラメーターは I<sched_attr> 構造体の I<sched_runtime>, I<sched_deadline>, I<sched_period> フィールドに対応する。 これらのフィールドはナノ秒単位の値である。 I<sched_period> に 0 が指定された場合 I<sched_deadline> と同じ値になる。"
3667
3668 #. type: Plain text
3669 #: build/C/man7/sched.7:291
3670 msgid "The kernel requires that:"
3671 msgstr "カーネルでは以下の関係が成り立つことが求められる。"
3672
3673 #. type: Plain text
3674 #: build/C/man7/sched.7:293
3675 #, no-wrap
3676 msgid "    sched_runtime E<lt>= sched_deadline E<lt>= sched_period\n"
3677 msgstr "    sched_runtime E<lt>= sched_deadline E<lt>= sched_period\n"
3678
3679 #.  See __checkparam_dl in kernel/sched/core.c
3680 #. type: Plain text
3681 #: build/C/man7/sched.7:303
3682 msgid "In addition, under the current implementation, all of the parameter values must be at least 1024 (i.e., just over one microsecond, which is the resolution of the implementation), and less than 2^63.  If any of these checks fails, B<sched_setattr>(2)  fails with the error B<EINVAL>."
3683 msgstr "これに加えて、 現在の実装では、 すべてのパラメーター値は少なくとも 1024 (実装の粒度である 1 マイクロ秒よりも少しだけ大きな値) で 2^63 よりも小さくなければならない。 これらのチェックのいずれかが失敗すると、 B<sched_setattr>(2) はエラー B<EINVAL> で失敗する。"
3684
3685 #. type: Plain text
3686 #: build/C/man7/sched.7:306
3687 msgid "The CBS guarantees non-interference between tasks, by throttling threads that attempt to over-run their specified Runtime."
3688 msgstr "CBS によりタスク間の干渉がないことが保証される。 指定された Runtime を超えて実行しようとしたスレッドは絞り込まれることになる。"
3689
3690 #. type: Plain text
3691 #: build/C/man7/sched.7:319
3692 msgid "To ensure deadline scheduling guarantees, the kernel must prevent situations where the set of B<SCHED_DEADLINE> threads is not feasible (schedulable) within the given constraints.  The kernel thus performs an admittance test when setting or changing B<SCHED_DEADLINE> policy and attributes.  This admission test calculates whether the change is feasible; if it is not B<sched_setattr>(2)  fails with the error B<EBUSY>."
3693 msgstr "デッドラインスケジューリングの保証がきちんと機能するためには、 カーネルは B<SCHEDULING> スレッドの集合が指定された制約条件におさまらない (スケジューリングできない) 状況を防止しなければならない。 そのため、カーネルは B<SCHED_DEADLINE> ポリシーと属性を設定、変更する際に、受け入れチェック (admittance test) を実行する。 この受け入れチェックは、変更が実行可能かを計算し、もし実行できないようであれば B<sched_setattr>(2) はエラー B<EBUSY> で失敗する。"
3694
3695 #. type: Plain text
3696 #: build/C/man7/sched.7:325
3697 msgid "For example, it is required (but not necessarily sufficient) for the total utilization to be less than or equal to the total number of CPUs available, where, since each thread can maximally run for Runtime per Period, that thread's utilization is its Runtime divided by its Period."
3698 msgstr "例えば、 使用率の合計が利用可能な合計 CPU 数以下である必要がある (ただし、必ずしも十分というわけではない)。 なお、 各スレッドは最大で Period あたり Runtime だけ実行されることがあるので、 そのスレッドの使用率は Runtime を Period で割ったものとなる。"
3699
3700 #. type: Plain text
3701 #: build/C/man7/sched.7:336
3702 msgid "In order to fulfil the guarantees that are made when a thread is admitted to the B<SCHED_DEADLINE> policy, B<SCHED_DEADLINE> threads are the highest priority (user controllable) threads in the system; if any B<SCHED_DEADLINE> thread is runnable, it will preempt any thread scheduled under one of the other policies."
3703 msgstr "スレッドが B<SCHED_DEADLINE> ポリシーに受け入れられた場合に保証を実現するため、 B<SCHED_DEADLINE> スレッドはシステムで (ユーザーが制御可能な) 最高優先度のスレッドとなる。 いずれかの B<SCHED_DEADLINE> スレッドが実行可能であれば、 他のポリシーでスケジューリングされているスレッドはすべて横取りされる。"
3704
3705 #. type: Plain text
3706 #: build/C/man7/sched.7:344
3707 msgid "A call to B<fork>(2)  by a thread scheduled under the B<SCHED_DEADLINE> policy will fail with the error B<EAGAIN>, unless the thread has its reset-on-fork flag set (see below)."
3708 msgstr "B<SCHED_DEADLINE> ポリシーでスケジューリングされているスレッドが B<fork>(2) を呼び出すと、 そのスレッドで reset-on-fork フラグがセットされている場合 (下記参照) を除き、 エラー B<EAGAIN> で失敗する。"
3709
3710 #
3711 #.  FIXME Calling sched_getparam() on a SCHED_DEADLINE thread
3712 #.        fails with EINVAL, but sched_getscheduler() succeeds.
3713 #.        Is that intended? (Why?)
3714 #. type: Plain text
3715 #: build/C/man7/sched.7:355
3716 msgid "A B<SCHED_DEADLINE> thread that calls B<sched_yield>(2)  will yield the current job and wait for a new period to begin."
3717 msgstr "B<SCHED_DEADLINE> スレッドが B<sched_yield>(2) を呼び出すと、 現在のジョブが CPU を明け渡し、新しい期間が開始するのを待つ。"
3718
3719 #. type: SS
3720 #: build/C/man7/sched.7:355
3721 #, no-wrap
3722 msgid "SCHED_OTHER: Default Linux time-sharing scheduling"
3723 msgstr "SCHED_OTHER: Linux のデフォルトの時分割スケジューリング"
3724
3725 #. type: Plain text
3726 #: build/C/man7/sched.7:372
3727 msgid "B<SCHED_OTHER> can be used at only static priority 0.  B<SCHED_OTHER> is the standard Linux time-sharing scheduler that is intended for all threads that do not require the special real-time mechanisms.  The thread to run is chosen from the static priority 0 list based on a I<dynamic> priority that is determined only inside this list.  The dynamic priority is based on the nice value (set by B<nice>(2), B<setpriority>(2), or B<sched_setattr>(2))  and increased for each time quantum the thread is ready to run, but denied to run by the scheduler.  This ensures fair progress among all B<SCHED_OTHER> threads."
3728 msgstr "B<SCHED_OTHER> は静的優先度 0 でのみ使用できる。 B<SCHED_OTHER> は Linux 標準の時分割スケジューラで、 特別なリアルタイム機構を必要としていない全てのスレッドで使用される。 実行するスレッドは、静的優先度 0 のリストから、このリストの中だけで 決定される「動的な」優先度 (dynamic priority) に基いて決定される。 動的な優先度は (B<nice>(2), B<setpriority>(2), B<sched_setattr>(2) により設定される) nice 値に基づいて決定されるもので、 単位時間毎に、スレッドが実行可能だが、スケジューラにより実行が拒否された 場合にインクリメントされる。 これにより、全ての B<SCHED_OTHER> スレッドでの公平性が保証される。"
3729
3730 #. type: SS
3731 #: build/C/man7/sched.7:372
3732 #, no-wrap
3733 msgid "SCHED_BATCH: Scheduling batch processes"
3734 msgstr "SCHED_BATCH: バッチプロセスのスケジューリング"
3735
3736 #. type: Plain text
3737 #: build/C/man7/sched.7:384
3738 msgid "(Since Linux 2.6.16.)  B<SCHED_BATCH> can be used only at static priority 0.  This policy is similar to B<SCHED_OTHER> in that it schedules the thread according to its dynamic priority (based on the nice value).  The difference is that this policy will cause the scheduler to always assume that the thread is CPU-intensive.  Consequently, the scheduler will apply a small scheduling penalty with respect to wakeup behavior, so that this thread is mildly disfavored in scheduling decisions."
3739 msgstr "(Linux 2.6.16 以降)  B<SCHED_BATCH> は静的優先度 0 でのみ使用できる。 このポリシーは (nice 値に基づく) 動的な優先度にしたがってスレッドの スケジューリングが行われるという点で、B<SCHED_OTHER> に似ている。 異なるのは、このポリシーでは、スレッドが常に CPU に負荷のかかる (CPU-intensive)  処理を行うと、スケジューラが仮定する点である。 スケジューラはスレッドを呼び起こす毎にそのスレッドにスケジューリング上の ペナルティを少し課し、その結果、このスレッドはスケジューリングの決定で 若干冷遇されるようになる。"
3740
3741 #.  The following paragraph is drawn largely from the text that
3742 #.  accompanied Ingo Molnar's patch for the implementation of
3743 #.  SCHED_BATCH.
3744 #.  commit b0a9499c3dd50d333e2aedb7e894873c58da3785
3745 #. type: Plain text
3746 #: build/C/man7/sched.7:394
3747 msgid "This policy is useful for workloads that are noninteractive, but do not want to lower their nice value, and for workloads that want a deterministic scheduling policy without interactivity causing extra preemptions (between the workload's tasks)."
3748 msgstr "このポリシーは、非対話的な処理だがその nice 値を下げたくない処理や、 (処理のタスク間で) 余計なタスクの置き換えの原因とある対話的な処理なしで 確定的な (deterministic) スケジューリングポリシーを適用したい処理に 対して有効である。"
3749
3750 #. type: SS
3751 #: build/C/man7/sched.7:394
3752 #, no-wrap
3753 msgid "SCHED_IDLE: Scheduling very low priority jobs"
3754 msgstr "SCHED_IDLE: 非常に優先度の低いジョブのスケジューリング"
3755
3756 #. type: Plain text
3757 #: build/C/man7/sched.7:398
3758 msgid "(Since Linux 2.6.23.)  B<SCHED_IDLE> can be used only at static priority 0; the process nice value has no influence for this policy."
3759 msgstr "(Linux 2.6.23 以降)  B<SCHED_IDLE> は静的優先度 0 でのみ使用できる。 このポリシーではプロセスの nice 値はスケジューリングに影響を与えない。"
3760
3761 #. type: Plain text
3762 #: build/C/man7/sched.7:406
3763 msgid "This policy is intended for running jobs at extremely low priority (lower even than a +19 nice value with the B<SCHED_OTHER> or B<SCHED_BATCH> policies)."
3764 msgstr "非常に低い優先度でのジョブの実行を目的としたものである (非常に低い優先度とは、ポリシー B<SCHED_OTHER> か B<SCHED_BATCH> での nice 値 +19 よりさらに低い優先度である)。"
3765
3766 #. type: SS
3767 #: build/C/man7/sched.7:406
3768 #, no-wrap
3769 msgid "Resetting scheduling policy for child processes"
3770 msgstr "子プロセスでのスケジューリングポリシーのリセット"
3771
3772 #. type: Plain text
3773 #: build/C/man7/sched.7:412
3774 msgid "Each thread has a reset-on-fork scheduling flag.  When this flag is set, children created by B<fork>(2)  do not inherit privileged scheduling policies.  The reset-on-fork flag can be set by either:"
3775 msgstr "各スレッドには reset-on-fork スケジューリングフラグがある。 このフラグがセットされると、 B<fork>(2) で作成される子プロセスは特権スケジューリングポリシーを継承しない。 reset-on-fork フラグは以下のいずれかの方法でセットできる。"
3776
3777 #. type: Plain text
3778 #: build/C/man7/sched.7:421
3779 msgid "ORing the B<SCHED_RESET_ON_FORK> flag into the I<policy> argument when calling B<sched_setscheduler>(2)  (since Linux 2.6.32); or"
3780 msgstr "B<sched_setscheduler>(2) を呼び出す際に B<SCHED_RESET_ON_FORK> フラグを I<policy> 引き数に論理和で指定する (Linux 2.6.32 以降)。"
3781
3782 #. type: Plain text
3783 #: build/C/man7/sched.7:428
3784 msgid "specifying the B<SCHED_FLAG_RESET_ON_FORK> flag in I<attr.sched_flags> when calling B<sched_setattr>(2)."
3785 msgstr "B<sched_setattr>(2) を呼び出し際に I<attr.sched_flags> に B<SCHED_FLAG_RESET_ON_FORK> フラグを指定する。"
3786
3787 #. type: Plain text
3788 #: build/C/man7/sched.7:434
3789 msgid "Note that the constants used with these two APIs have different names.  The state of the reset-on-fork flag can analogously be retrieved using B<sched_getscheduler>(2)  and B<sched_getattr>(2)."
3790 msgstr "これらの 2 つの API で使用される定数は名前が違っている点に注意すること。 同様に reset-on-fork フラグの状態は B<sched_getscheduler>(2) と B<sched_getattr>(2) を使って取得できる。"
3791
3792 #. type: Plain text
3793 #: build/C/man7/sched.7:441
3794 msgid "The reset-on-fork feature is intended for media-playback applications, and can be used to prevent applications evading the B<RLIMIT_RTTIME> resource limit (see B<getrlimit>(2))  by creating multiple child processes."
3795 msgstr "reset-on-fork 機能はメディア再生アプリケーションでの利用を意図したものである。 複数の子プロセスを作成することで、 アプリケーションは B<RLIMIT_RTTIME> リソース上限 (B<getrlimit>(2) を参照) を避けることができる。"
3796
3797 #. type: Plain text
3798 #: build/C/man7/sched.7:444
3799 msgid "More precisely, if the reset-on-fork flag is set, the following rules apply for subsequently created children:"
3800 msgstr "より正確には、 reset-on-fork フラグがセットされた場合、それ以降に作成される子プロセスに以下のルールが適用される。"
3801
3802 #. type: Plain text
3803 #: build/C/man7/sched.7:452
3804 msgid "If the calling thread has a scheduling policy of B<SCHED_FIFO> or B<SCHED_RR>, the policy is reset to B<SCHED_OTHER> in child processes."
3805 msgstr "呼び出したスレッドのスケジューリングポリシーが B<SCHED_FIFO> か B<SCHED_RR> の場合、子プロセスのポリシーは B<SCHED_OTHER> にリセットされる。"
3806
3807 #. type: Plain text
3808 #: build/C/man7/sched.7:455
3809 msgid "If the calling process has a negative nice value, the nice value is reset to zero in child processes."
3810 msgstr "子プロセスが負の nice 値を持っている場合、子プロセスの nice 値は 0 にリセットされる。"
3811
3812 #. type: Plain text
3813 #: build/C/man7/sched.7:463
3814 msgid "After the reset-on-fork flag has been enabled, it can be reset only if the thread has the B<CAP_SYS_NICE> capability.  This flag is disabled in child processes created by B<fork>(2)."
3815 msgstr "一度 reset-on-fork フラグが有効にされた後は、このフラグをリセットできるのは、スレッドが B<CAP_SYS_NICE> ケーパビリティを持つ場合だけである。このフラグは B<fork>(2) で作成された子プロセスでは無効になる。"
3816
3817 #. type: SS
3818 #: build/C/man7/sched.7:463
3819 #, no-wrap
3820 msgid "Privileges and resource limits"
3821 msgstr "特権とリソース制限"
3822
3823 #. type: Plain text
3824 #: build/C/man7/sched.7:475
3825 msgid "In Linux kernels before 2.6.12, only privileged (B<CAP_SYS_NICE>)  threads can set a nonzero static priority (i.e., set a real-time scheduling policy).  The only change that an unprivileged thread can make is to set the B<SCHED_OTHER> policy, and this can be done only if the effective user ID of the caller matches the real or effective user ID of the target thread (i.e., the thread specified by I<pid>)  whose policy is being changed."
3826 msgstr "2.6.12 より前のバージョンの Linux カーネルでは、 特権スレッド (B<CAP_SYS_NICE> ケーパビリティを持つスレッド) だけが 0 以外の静的優先度を設定する (すなわち、リアルタイムスケジューリングポリシーを設定する) ことができる。 非特権スレッドができる変更は B<SCHED_OTHER> ポリシーを設定することだけであり、さらに、 この変更を行えるのは、 呼び出し元の実効ユーザー ID がポリシーの変更対象スレッド (I<pid> で指定されたスレッド) の実ユーザー ID か実効ユーザー ID と 一致する場合だけである。"
3827
3828 #. type: Plain text
3829 #: build/C/man7/sched.7:481
3830 msgid "A thread must be privileged (B<CAP_SYS_NICE>)  in order to set or modify a B<SCHED_DEADLINE> policy."
3831 msgstr "B<SCHED_DEADLINE> ポリシーを設定、変更するには、スレッドが特権 (B<CAP_SYS_NICE>) を持っていなければならない。"
3832
3833 #. type: Plain text
3834 #: build/C/man7/sched.7:491
3835 msgid "Since Linux 2.6.12, the B<RLIMIT_RTPRIO> resource limit defines a ceiling on an unprivileged thread's static priority for the B<SCHED_RR> and B<SCHED_FIFO> policies.  The rules for changing scheduling policy and priority are as follows:"
3836 msgstr "Linux 2.6.12 以降では、リソース制限 B<RLIMIT_RTPRIO> が定義されており、 スケジューリングポリシーが B<SCHED_RR> と B<SCHED_FIFO> の場合の、非特権スレッドの静的優先度の上限を定めている。 スケジューリングポリシーと優先度を変更する際のルールは以下の通りである。"
3837
3838 #. type: Plain text
3839 #: build/C/man7/sched.7:499
3840 msgid "If an unprivileged thread has a nonzero B<RLIMIT_RTPRIO> soft limit, then it can change its scheduling policy and priority, subject to the restriction that the priority cannot be set to a value higher than the maximum of its current priority and its B<RLIMIT_RTPRIO> soft limit."
3841 msgstr "非特権スレッドに 0 以外の B<RLIMIT_RTPRIO> ソフトリミットが設定されている場合、 非特権スレッドはそのスレッドのスケジューリングポリシーと優先度を 変更できるが、優先度を現在の自身の優先度と B<RLIMIT_RTPRIO> ソフトリミットの大きい方よりも高い値に設定できないという制限が課される。"
3842
3843 #. type: Plain text
3844 #: build/C/man7/sched.7:504
3845 msgid "If the B<RLIMIT_RTPRIO> soft limit is 0, then the only permitted changes are to lower the priority, or to switch to a non-real-time policy."
3846 msgstr "B<RLIMIT_RTPRIO> ソフトリミットが 0 の場合、優先度を下げるか、 リアルタイムでないポリシーへ切り替えるかの変更だけが許可される。"
3847
3848 #. type: Plain text
3849 #: build/C/man7/sched.7:509
3850 msgid "Subject to the same rules, another unprivileged thread can also make these changes, as long as the effective user ID of the thread making the change matches the real or effective user ID of the target thread."
3851 msgstr "ある非特権スレッドが別のスレッドに対してこれらの変更を行う際にも、 同じルールが適用される。変更を行えるのは、変更を行おうとするスレッド の実効ユーザー ID が変更対象のスレッドの実ユーザー ID か実効ユーザー ID と 一致している場合に限られる。"
3852
3853 #.  commit c02aa73b1d18e43cfd79c2f193b225e84ca497c8
3854 #. type: Plain text
3855 #: build/C/man7/sched.7:528
3856 msgid "Special rules apply for the B<SCHED_IDLE> policy.  In Linux kernels before 2.6.39, an unprivileged thread operating under this policy cannot change its policy, regardless of the value of its B<RLIMIT_RTPRIO> resource limit.  In Linux kernels since 2.6.39, an unprivileged thread can switch to either the B<SCHED_BATCH> or the B<SCHED_NORMAL> policy so long as its nice value falls within the range permitted by its B<RLIMIT_NICE> resource limit (see B<getrlimit>(2))."
3857 msgstr "B<SCHED_IDLE> ポリシーの場合には特別なルールが適用される。 2.6.39 より前の Linux カーネルでは、このポリシーで動作する非特権スレッドは、 B<RLIMIT_RTPRIO> リソース上限の値に関わらず、自分のポリシーを変更することができない。 2.6.39 以降の Linux カーネルでは、非特権スレッドは、自分の nice 値が B<RLIMIT_NICE> リソース上限 (B<getrlimit>(2) 参照) で許可された範囲である限りは、自分のスケジューリングポリシーを B<SCHED_BATCH> か B<SCHED_NORMAL> ポリシーに切り替えることができる。"
3858
3859 #. type: Plain text
3860 #: build/C/man7/sched.7:539
3861 msgid "Privileged (B<CAP_SYS_NICE>)  threads ignore the B<RLIMIT_RTPRIO> limit; as with older kernels, they can make arbitrary changes to scheduling policy and priority.  See B<getrlimit>(2)  for further information on B<RLIMIT_RTPRIO>."
3862 msgstr "特権スレッド (B<CAP_SYS_NICE> ケーパビリティを持つスレッド) の場合、 B<RLIMIT_RTPRIO> の制限は無視される; 古いカーネルと同じように、スケジューリングポリシーと優先度に対し 任意の変更を行うことができる。 B<RLIMIT_RTPRIO> に関するもっと詳しい情報は B<getrlimit>(2)  を参照のこと。"
3863
3864 #. type: SS
3865 #: build/C/man7/sched.7:539
3866 #, no-wrap
3867 msgid "Limiting the CPU usage of real-time and deadline processes"
3868 msgstr "リアルタイムプロセスとデッドラインプロセスの CPU 使用量を制限する"
3869
3870 #. type: Plain text
3871 #: build/C/man7/sched.7:552
3872 msgid "A nonblocking infinite loop in a thread scheduled under the B<SCHED_FIFO>, B<SCHED_RR>, or B<SCHED_DEADLINE> policy will block all threads with lower priority forever.  Prior to Linux 2.6.25, the only way of preventing a runaway real-time process from freezing the system was to run (at the console)  a shell scheduled under a higher static priority than the tested application.  This allows an emergency kill of tested real-time applications that do not block or terminate as expected."
3873 msgstr "B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_DEADLINE> でスケジューリングされる スレッドが停止せずに無限ループに陥ると、 他の全てのより低い優先度のスレッドを永久に停止 (block) させてしまう。 Linux 2.6.25 より前では、 リアルタイムプロセスが暴走してしまい、システムが止まってしまうのを防止する唯一の方法は、 (コンソールで) シェルをテスト対象のアプリケーションよりも高い静的優先度で実行することだけであった。 これによって期待通りに停止したり終了したりしないリアルタイム アプリケーションを緊急終了させることが可能になる。"
3874
3875 #. type: Plain text
3876 #: build/C/man7/sched.7:562
3877 msgid "Since Linux 2.6.25, there are other techniques for dealing with runaway real-time and deadline processes.  One of these is to use the B<RLIMIT_RTTIME> resource limit to set a ceiling on the CPU time that a real-time process may consume.  See B<getrlimit>(2)  for details."
3878 msgstr "Linux 2.6.25 以降では、 暴走したリアルタイムプロセスやデッドラインプロセスを扱う別の方法が提供されている。 一つは B<RLIMIT_RTTIME> リソース上限を使ってリアルタイムプロセスが消費できる CPU 時間の上限を設定する方法である。 詳細は B<getrlimit>(2) を参照。"
3879
3880 #. type: Plain text
3881 #: build/C/man7/sched.7:570
3882 msgid "Since version 2.6.25, Linux also provides two I</proc> files that can be used to reserve a certain amount of CPU time to be used by non-real-time processes.  Reserving some CPU time in this fashion allows some CPU time to be allocated to (say) a root shell that can be used to kill a runaway process.  Both of these files specify time values in microseconds:"
3883 msgstr "Linux 2.6.25 以降では、 2 つの I</proc> ファイルを使って、リアルタイムでないプロセスが使用できる CPU 時間を一定量予約することができる。 この方法で CPU 時間をいくらか予約しておくことで、 CPU 時間が (例えば) root シェルに割り当てられ、このシェルから暴走したプロセスを殺すことができる。 これらのファイルでは両方ともマイクロ秒で時間を指定する。"
3884
3885 #. type: TP
3886 #: build/C/man7/sched.7:570
3887 #, no-wrap
3888 msgid "I</proc/sys/kernel/sched_rt_period_us>"
3889 msgstr "I</proc/sys/kernel/sched_rt_period_us>"
3890
3891 #. type: Plain text
3892 #: build/C/man7/sched.7:578
3893 msgid "This file specifies a scheduling period that is equivalent to 100% CPU bandwidth.  The value in this file can range from 1 to B<INT_MAX>, giving an operating range of 1 microsecond to around 35 minutes.  The default value in this file is 1,000,000 (1 second)."
3894 msgstr "このファイルは、 CPU 時間 100% にあたるスケジューリング間隔を指定する。 このファイルの値として 1 から B<INT_MAX> を指定できる。 この値は実際の時間としては 1 マイクロ秒から約 35 分に相当する。 このファイルのデフォルト値は 1,000,000 (1 秒) である。"
3895
3896 #. type: TP
3897 #: build/C/man7/sched.7:578
3898 #, no-wrap
3899 msgid "I</proc/sys/kernel/sched_rt_runtime_us>"
3900 msgstr "I</proc/sys/kernel/sched_rt_runtime_us>"
3901
3902 #. type: Plain text
3903 #: build/C/man7/sched.7:591
3904 msgid "The value in this file specifies how much of the \"period\" time can be used by all real-time and deadline scheduled processes on the system.  The value in this file can range from -1 to B<INT_MAX>-1.  Specifying -1 makes the runtime the same as the period; that is, no CPU time is set aside for non-real-time processes (which was the Linux behavior before kernel 2.6.25).  The default value in this file is 950,000 (0.95 seconds), meaning that 5% of the CPU time is reserved for processes that don't run under a real-time or deadline scheduling policy."
3905 msgstr "このファイルの値は、 システム上のリアルタイムスケジューリングやデッドラインスケジューリングの全プロセスが使用できる「期間」を指定する。 このファイルの値として -1 から B<INT_MAX>-1 を指定できる。 -1 を指定すると、実行時間 (runtime) はスケジューリング間隔 (period) と同じになる。 つまり、 CPU 時間はリアルタイムでないプロセスには確保されない (カーネル 2.6.25 より前の Linux の動作である)。 このファイルのデフォルト値は 950,000 (0.95 秒) である。 これは CPU 時間の 5% がリアルタイムやデッドラインスケジューリングポリシー以外で動作するプロセスに確保されるという意味する。"
3906
3907 #. type: SS
3908 #: build/C/man7/sched.7:592
3909 #, no-wrap
3910 msgid "Response time"
3911 msgstr "応答時間 (response time)"
3912
3913 #.  as described in
3914 #.  .BR request_irq (9).
3915 #. type: Plain text
3916 #: build/C/man7/sched.7:600
3917 msgid "A blocked high priority thread waiting for I/O has a certain response time before it is scheduled again.  The device driver writer can greatly reduce this response time by using a \"slow interrupt\" interrupt handler."
3918 msgstr "I/O 待ちで停止したより高い優先度のスレッドは再びスケジューリングされる 前にいくらかの応答時間がかかる。デバイスドライバーを書く場合には \"slow interrupt\" 割り込みハンドラーを使用することで この応答時間を劇的に減少させることができる。"
3919
3920 #. type: SS
3921 #: build/C/man7/sched.7:600
3922 #, no-wrap
3923 msgid "Miscellaneous"
3924 msgstr "その他"
3925
3926 #. type: Plain text
3927 #: build/C/man7/sched.7:605
3928 msgid "Child processes inherit the scheduling policy and parameters across a B<fork>(2).  The scheduling policy and parameters are preserved across B<execve>(2)."
3929 msgstr "子プロセスは B<fork>(2)  の際に親プロセスのスケジューリングポリシーとパラメーターを継承する。 B<execve>(2)  の前後で、スケジューリングポリシーとパラメーターは保持される。"
3930
3931 #. type: Plain text
3932 #: build/C/man7/sched.7:611
3933 msgid "Memory locking is usually needed for real-time processes to avoid paging delays; this can be done with B<mlock>(2)  or B<mlockall>(2)."
3934 msgstr "リアルタイムプロセスは大抵、ページングの待ち時間を避けるために B<mlock>(2)  や B<mlockall>(2)  を使ってメモリロックをしなければならない。"
3935
3936 #. type: Plain text
3937 #: build/C/man7/sched.7:622
3938 msgid "Originally, Standard Linux was intended as a general-purpose operating system being able to handle background processes, interactive applications, and less demanding real-time applications (applications that need to usually meet timing deadlines).  Although the Linux kernel 2.6 allowed for kernel preemption and the newly introduced O(1) scheduler ensures that the time needed to schedule is fixed and deterministic irrespective of the number of active tasks, true real-time computing was not possible up to kernel version 2.6.17."
3939 msgstr "もともとは、標準の Linux は一般目的のオペレーティングシステムとして 設計されており、バックグラウンドプロセスや対話的アプリケーション、 リアルタイム性の要求が厳しくないリアルタイムアプリケーション (普通はタイミングの応答期限 (deadline) を満たす必要があるアプリケーション)  を扱うことができた。 Linux カーネル 2.6 では、 カーネルのプリエンプション (タスクの置き換え) が可能であり、 新たに導入された O(1) スケジューラにより、 アクティブなタスクの数に関わらずスケジューリングに必要な時間は 固定で確定的 (deterministic) であることが保証されている。 それにも関わらず、カーネル 2.6.17 までは 真のリアルタイムコンピューティングは実現できなかった。"
3940
3941 #. type: SS
3942 #: build/C/man7/sched.7:622
3943 #, no-wrap
3944 msgid "Real-time features in the mainline Linux kernel"
3945 msgstr "本流の Linux カーネルでのリアルタイム機能"
3946
3947 #.  FIXME . Probably this text will need some minor tweaking
3948 #.  by about the time of 2.6.30; ask Carsten Emde about this then.
3949 #. type: Plain text
3950 #: build/C/man7/sched.7:636
3951 msgid "From kernel version 2.6.18 onward, however, Linux is gradually becoming equipped with real-time capabilities, most of which are derived from the former I<realtime-preempt> patches developed by Ingo Molnar, Thomas Gleixner, Steven Rostedt, and others.  Until the patches have been completely merged into the mainline kernel (this is expected to be around kernel version 2.6.30), they must be installed to achieve the best real-time performance.  These patches are named:"
3952 msgstr ""
3953 "カーネル 2.6.18 から現在まで、 Linux は徐々にリアルタイム機能を備えつつ\n"
3954 "あるが、 これらの機能のほとんどは、 Ingo Molnar, Thomas Gleixner,\n"
3955 "Steven Rostedt らによって開発された、 以前の I<realtime-preempt> パッチ\n"
3956 "からのものである。 これらのパッチが本流のカーネルに完全にマージされるま\n"
3957 "では (マージの完了はカーネル 2.6.30 あたりの予定)、 最高のリアルタイム\n"
3958 "性能を達成するには realtime-preempt パッチを 組み込まなければならない。\n"
3959 "これらのパッチは"
3960
3961 #. type: Plain text
3962 #: build/C/man7/sched.7:640
3963 #, no-wrap
3964 msgid "patch-I<kernelversion>-rtI<patchversion>\n"
3965 msgstr "patch-I<kernelversion>-rtI<patchversion>\n"
3966
3967 #. type: Plain text
3968 #: build/C/man7/sched.7:646
3969 msgid "and can be downloaded from E<.UR http://www.kernel.org\\:/pub\\:/linux\\:/kernel\\:/projects\\:/rt/> E<.UE .>"
3970 msgstr "という名前で、 E<.UR http://www.kernel.org\\:/pub\\:/linux\\:/kernel\\:/projects\\:/rt/> E<.UE> からダウンロードできる。"
3971
3972 #. type: Plain text
3973 #: build/C/man7/sched.7:655
3974 msgid "Without the patches and prior to their full inclusion into the mainline kernel, the kernel configuration offers only the three preemption classes B<CONFIG_PREEMPT_NONE>, B<CONFIG_PREEMPT_VOLUNTARY>, and B<CONFIG_PREEMPT_DESKTOP> which respectively provide no, some, and considerable reduction of the worst-case scheduling latency."
3975 msgstr "このパッチが適用されず、かつパッチの内容の本流のカーネルへのマージが 完了するまでは、カーネルの設定では B<CONFIG_PREEMPT_NONE>, B<CONFIG_PREEMPT_VOLUNTARY>, B<CONFIG_PREEMPT_DESKTOP> の 3つのプリエンプションクラス (preemption class) だけが提供される。 これらのクラスでは、最悪の場合のスケジューリング遅延がそれぞれ 全く減らない、いくらか減る、かなり減る。"
3976
3977 #. type: Plain text
3978 #: build/C/man7/sched.7:664
3979 msgid "With the patches applied or after their full inclusion into the mainline kernel, the additional configuration item B<CONFIG_PREEMPT_RT> becomes available.  If this is selected, Linux is transformed into a regular real-time operating system.  The FIFO and RR scheduling policies are then used to run a thread with true real-time priority and a minimum worst-case scheduling latency."
3980 msgstr "パッチが適用された場合、またはパッチの内容の本流のカーネルへのマージが 完了した後では、上記に加えて設定項目として B<CONFIG_PREEMPT_RT> が利用可能になる。この項目を選択すると、 Linux は通常のリアルタイムオペレーティングシステムに変身する。 この場合には、 FIFO と RR のスケジューリングポリシーは、 真のリアルタイム優先度を持つスレッドを最悪の場合のスケジューリング遅延が 最小となる環境で動作させるために使われることになる。"
3981
3982 #. type: Plain text
3983 #: build/C/man7/sched.7:691
3984 msgid "B<chrt>(1), B<taskset>(1), B<getpriority>(2), B<mlock>(2), B<mlockall>(2), B<munlock>(2), B<munlockall>(2), B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), B<sched_getscheduler>(2), B<sched_getaffinity>(2), B<sched_getparam>(2), B<sched_rr_get_interval>(2), B<sched_setaffinity>(2), B<sched_setscheduler>(2), B<sched_setparam>(2), B<sched_yield>(2), B<setpriority>(2), B<pthread_getaffinity_np>(3), B<pthread_setaffinity_np>(3), B<sched_getcpu>(3), B<capabilities>(7), B<cpuset>(7)"
3985 msgstr "B<chrt>(1), B<taskset>(1), B<getpriority>(2), B<mlock>(2), B<mlockall>(2), B<munlock>(2), B<munlockall>(2), B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), B<sched_getscheduler>(2), B<sched_getaffinity>(2), B<sched_getparam>(2), B<sched_rr_get_interval>(2), B<sched_setaffinity>(2), B<sched_setscheduler>(2), B<sched_setparam>(2), B<sched_yield>(2), B<setpriority>(2), B<pthread_getaffinity_np>(3), B<pthread_setaffinity_np>(3), B<sched_getcpu>(3), B<capabilities>(7), B<cpuset>(7)"
3986
3987 #. type: Plain text
3988 #: build/C/man7/sched.7:695
3989 msgid "I<Programming for the real world - POSIX.4> by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0."
3990 msgstr "I<Programming for the real world - POSIX.4> by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0."
3991
3992 #. type: Plain text
3993 #: build/C/man7/sched.7:702
3994 msgid "The Linux kernel source files I<Documentation/scheduler/sched-deadline.txt>, I<Documentation/scheduler/sched-rt-group.txt>, I<Documentation/scheduler/sched-design-CFS.txt>, and I<Documentation/scheduler/sched-nice-design.txt>"
3995 msgstr "Linux カーネルソースのファイル I<Documentation/scheduler/sched-deadline.txt>, I<Documentation/scheduler/sched-rt-group.txt>, I<Documentation/scheduler/sched-design-CFS.txt>, I<Documentation/scheduler/sched-nice-design.txt>"
3996
3997 #. type: TH
3998 #: build/C/man2/setns.2:8
3999 #, no-wrap
4000 msgid "SETNS"
4001 msgstr "SETNS"
4002
4003 #. type: TH
4004 #: build/C/man2/setns.2:8
4005 #, no-wrap
4006 msgid "2015-01-10"
4007 msgstr "2015-01-10"
4008
4009 #. type: Plain text
4010 #: build/C/man2/setns.2:11
4011 msgid "setns - reassociate thread with a namespace"
4012 msgstr "setns - スレッドに名前空間を関連付けしなおす"
4013
4014 #. type: Plain text
4015 #: build/C/man2/setns.2:17
4016 #, no-wrap
4017 msgid "B<int setns(int >I<fd>B<, int >I<nstype>B<);>\n"
4018 msgstr "B<int setns(int >I<fd>B<, int >I<nstype>B<);>\n"
4019
4020 #. type: Plain text
4021 #: build/C/man2/setns.2:21
4022 msgid "Given a file descriptor referring to a namespace, reassociate the calling thread with that namespace."
4023 msgstr ""
4024 "名前空間を参照するファイルディスクリプターを指定すると、\n"
4025 "呼び出したスレッドにその名前空間を関連付けしなおす。"
4026
4027 #. type: Plain text
4028 #: build/C/man2/setns.2:34
4029 msgid "The I<fd> argument is a file descriptor referring to one of the namespace entries in a I</proc/[pid]/ns/> directory; see B<namespaces>(7)  for further information on I</proc/[pid]/ns/>.  The calling thread will be reassociated with the corresponding namespace, subject to any constraints imposed by the I<nstype> argument."
4030 msgstr ""
4031 "I<fd> 引き数は、 I</proc/[pid]/ns/> ディレクトリ内の名前空間エントリ\n"
4032 "のいずれかを参照するファイルディスクリプターである。\n"
4033 "I</proc/[pid]/ns/> の詳細は B<namespaces>(7) を参照。\n"
4034 "I<nstype> 引き数で指定された制限の範囲内で、\n"
4035 "呼び出したスレッドに I<fd> に対応する名前空間を関連付けしなおす。"
4036
4037 #. type: Plain text
4038 #: build/C/man2/setns.2:40
4039 msgid "The I<nstype> argument specifies which type of namespace the calling thread may be reassociated with.  This argument can have one of the following values:"
4040 msgstr ""
4041 "I<nstype> 引き数は、呼び出したスレッドがどのタイプの名前空間を\n"
4042 "関連付けしなおすことができるかを指定する。\n"
4043 "この引き数には以下のいずれかの値を指定できる。"
4044
4045 #. type: TP
4046 #: build/C/man2/setns.2:40
4047 #, no-wrap
4048 msgid "B<0>"
4049 msgstr "B<0>"
4050
4051 #. type: Plain text
4052 #: build/C/man2/setns.2:43
4053 msgid "Allow any type of namespace to be joined."
4054 msgstr "どのタイプの名前空間も関連付けることができる。"
4055
4056 #. type: TP
4057 #: build/C/man2/setns.2:43
4058 #, no-wrap
4059 msgid "B<CLONE_NEWIPC> (since Linux 3.0)"
4060 msgstr "B<CLONE_NEWIPC> (Linux 3.0 以降)"
4061
4062 #. type: Plain text
4063 #: build/C/man2/setns.2:47
4064 msgid "I<fd> must refer to an IPC namespace."
4065 msgstr "I<fd> は IPC 名前空間を参照していなければならない。"
4066
4067 #. type: TP
4068 #: build/C/man2/setns.2:47
4069 #, no-wrap
4070 msgid "B<CLONE_NEWNET> (since Linux 3.0)"
4071 msgstr "B<CLONE_NEWNET> (Linux 3.0 以降)"
4072
4073 #. type: Plain text
4074 #: build/C/man2/setns.2:51
4075 msgid "I<fd> must refer to a network namespace."
4076 msgstr "I<fd> はネットワーク名前空間を参照していなければならない。"
4077
4078 #. type: TP
4079 #: build/C/man2/setns.2:51
4080 #, no-wrap
4081 msgid "B<CLONE_NEWNS> (since Linux 3.8)"
4082 msgstr "B<CLONE_NEWNS> (Linux 3.8 以降)"
4083
4084 #. type: Plain text
4085 #: build/C/man2/setns.2:55
4086 msgid "I<fd> must refer to a mount namespace."
4087 msgstr "I<fd> はマウント名前空間を参照していなければならない。"
4088
4089 #. type: TP
4090 #: build/C/man2/setns.2:55 build/C/man2/unshare.2:149
4091 #, no-wrap
4092 msgid "B<CLONE_NEWPID> (since Linux 3.8)"
4093 msgstr "B<CLONE_NEWPID> (Linux 3.8 以降)"
4094
4095 #. type: Plain text
4096 #: build/C/man2/setns.2:59
4097 msgid "I<fd> must refer to a descendant PID namespace."
4098 msgstr "I<fd> は子孫の PID 名前空間を参照していなければならない。"
4099
4100 #. type: TP
4101 #: build/C/man2/setns.2:59 build/C/man2/unshare.2:176
4102 #, no-wrap
4103 msgid "B<CLONE_NEWUSER> (since Linux 3.8)"
4104 msgstr "B<CLONE_NEWUSER> (Linux 3.8 以降)"
4105
4106 #. type: Plain text
4107 #: build/C/man2/setns.2:63
4108 msgid "I<fd> must refer to a user namespace."
4109 msgstr "I<fd> はユーザー名前空間を参照していなければならない。"
4110
4111 #. type: TP
4112 #: build/C/man2/setns.2:63
4113 #, no-wrap
4114 msgid "B<CLONE_NEWUTS> (since Linux 3.0)"
4115 msgstr "B<CLONE_NEWUTS> (Linux 3.0 以降)"
4116
4117 #. type: Plain text
4118 #: build/C/man2/setns.2:67
4119 msgid "I<fd> must refer to a UTS namespace."
4120 msgstr "I<fd> は UTS 名前空間を参照していなければならない。"
4121
4122 #. type: Plain text
4123 #: build/C/man2/setns.2:82
4124 msgid "Specifying I<nstype> as 0 suffices if the caller knows (or does not care)  what type of namespace is referred to by I<fd>.  Specifying a nonzero value for I<nstype> is useful if the caller does not know what type of namespace is referred to by I<fd> and wants to ensure that the namespace is of a particular type.  (The caller might not know the type of the namespace referred to by I<fd> if the file descriptor was opened by another process and, for example, passed to the caller via a UNIX domain socket.)"
4125 msgstr ""
4126 "呼び出し側が I<fd> がどのタイプの名前空間を参照しているかを知っている\n"
4127 "(もしくは気にする必要がない) 場合には、 I<nstype> に 0 を指定すれば十分\n"
4128 "である。呼び出し側が I<fd> がどのタイプの名前空間を参照しているかを\n"
4129 "知っておらず、かつ、特定のタイプの名前空間であることを保証したい場合、\n"
4130 "I<nstype> に 0 以外の値を指定するとよい。 (ファイルディスクリプターが別の\n"
4131 "プロセスによりオープンされ、例えば、UNIX ドメインソケット経由で呼び出し\n"
4132 "側に渡された場合などでは、呼び出し側が I<fd> がどのタイプの名前空間を\n"
4133 "参照しているかを知らない可能性がある。)"
4134
4135 #. type: Plain text
4136 #: build/C/man2/setns.2:97
4137 msgid "B<CLONE_NEWPID> behaves somewhat differently from the other I<nstype> values: reassociating the calling thread with a PID namespace only changes the PID namespace that child processes of the caller will be created in; it does not change the PID namespace of the caller itself.  Reassociating with a PID namespace is only allowed if the PID namespace specified by I<fd> is a descendant (child, grandchild, etc.)  of the PID namespace of the caller.  For further details on PID namespaces, see B<pid_namespaces>(7)."
4138 msgstr "B<CLONE_NEWPID> は他の I<nstype> 値の場合と少し違った動作をする。 呼び出し元スレッドを PID 名前空間に関連付けし直すと、 呼び出し元の子プロセスが作成される PID 名前空間が変更されるだけである。 呼び出し元自身の PID 名前空間は変更されない。 PID 名前空間を関連付けし直すことができるのは、 I<fd> で指定された PID 名前空間が呼び出し元の PID 名前空間の子孫 (子プロセス、孫プロセスなど) の場合だけである。 PID 名前空間の詳細は B<pid_namespaces>(7) を参照。"
4139
4140 #.  See kernel/user_namespace.c:userns_install() [3.8 source]
4141 #.  commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
4142 #.  https://lwn.net/Articles/543273/
4143 #. type: Plain text
4144 #: build/C/man2/setns.2:124
4145 msgid "A process reassociating itself with a user namespace must have the B<CAP_SYS_ADMIN> capability in the target user namespace.  Upon successfully joining a user namespace, a process is granted all capabilities in that namespace, regardless of its user and group IDs.  A multithreaded process may not change user namespace with B<setns>().  It is not permitted to use B<setns>()  to reenter the caller's current user namespace.  This prevents a caller that has dropped capabilities from regaining those capabilities via a call to B<setns>().  For security reasons, a process can't join a new user namespace if it is sharing filesystem-related attributes (the attributes whose sharing is controlled by the B<clone>(2)  B<CLONE_FS> flag) with another process.  For further details on user namespaces, see B<user_namespaces>(7)."
4146 msgstr "プロセスが自分自身をユーザー名前空間に再関連付けするには、 そのプロセスは変更後のユーザー名前空間において B<CAP_SYS_ADMIN> ケーパビリティを持っていなければならない。 ユーザー名前空間への参加に成功すると、 そのユーザー ID やグループ ID に関わらず、 プロセスにはその名前空間におけるすべてのケーパビリティが認められる。 マルチスレッドのプロセスは B<setns>() でユーザー名前空間を変更できない。 B<setns>() を使って、呼び出し元が現在のユーザー名前空間に再度入ることは認められていない。 これにより、 いくつかのケーパビリティを外した呼び出し元が B<setns>() を呼び出すことでそれらのケーパビリティを再度得ることを防ぐことができる。 セキュリティ上の理由から、 ファイルシステム関連の属性 (共有が B<clone>(2) B<CLONE_FS> フラグで制御される属性) を別のプロセスと共有している場合、 プロセスは新しいユーザー名前空間に参加できない。 ユーザー名前空間の詳細は B<user_namespaces>(7) を参照。"
4147
4148 #.  Above check is in fs/namespace.c:mntns_install() [3.8 source]
4149 #. type: Plain text
4150 #: build/C/man2/setns.2:138
4151 msgid "A process may not be reassociated with a new mount namespace if it is multithreaded.  Changing the mount namespace requires that the caller possess both B<CAP_SYS_CHROOT> and B<CAP_SYS_ADMIN> capabilities in its own user namespace and B<CAP_SYS_ADMIN> in the target mount namespace.  See B<user_namespaces>(7)  for details on the interaction of user namespaces and mount namespaces."
4152 msgstr "プロセスがマルチスレッドの場合、そのプロセスを新しいマウント名前空間に関連付けし直すことは許可されていない。 マウント名前空間を変更するには、呼び出し元のプロセスが、 自分自身のユーザー名前空間において B<CAP_SYS_CHROOT> と B<CAP_SYS_ADMIN> の両方のケーパビリティを持っており、 変更後のマウント名前空間で B<CAP_SYS_ADMIN> ケーパビリティを持っていなければならない。 ユーザー名前空間とマウント名前空間の関係の詳細は B<user_namespaces>(7) を参照。"
4153
4154 #. type: Plain text
4155 #: build/C/man2/setns.2:145
4156 msgid "On success, B<setns>()  returns 0.  On failure, -1 is returned and I<errno> is set to indicate the error."
4157 msgstr "成功すると B<setns>() は 0 を返す。 失敗すると、 -1 が返され、 I<errno> にエラーを示す値が設定される。"
4158
4159 #. type: Plain text
4160 #: build/C/man2/setns.2:150
4161 msgid "I<fd> is not a valid file descriptor."
4162 msgstr "I<fd> が有効なファイルディスクリプターではない。"
4163
4164 #. type: Plain text
4165 #: build/C/man2/setns.2:155
4166 msgid "I<fd> refers to a namespace whose type does not match that specified in I<nstype>."
4167 msgstr "I<fd> が I<nstype> で指定されたタイプと一致しない名前空間を参照している。"
4168
4169 #. type: Plain text
4170 #: build/C/man2/setns.2:159
4171 msgid "There is problem with reassociating the thread with the specified namespace."
4172 msgstr "スレッドを指定された名前空間に関連付けし直す際に問題が発生した。"
4173
4174 #. type: Plain text
4175 #: build/C/man2/setns.2:164
4176 msgid "The caller tried to join an ancestor (parent, grandparent, etc...)  pid namespace."
4177 msgstr "呼び出し元が先祖 (親や親の親など) の PID 名前空間に参加しようとした。"
4178
4179 #. type: Plain text
4180 #: build/C/man2/setns.2:168
4181 msgid "The caller attempted to join the user namespace in which it is already a member."
4182 msgstr "自分がすでにメンバーとなっているユーザー名前空間に参加しようとした。"
4183
4184 #.  commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
4185 #. type: Plain text
4186 #: build/C/man2/setns.2:175
4187 msgid "The caller shares filesystem (B<CLONE_FS>)  state (in particular, the root directory)  with other processes and tried to join a new user namespace."
4188 msgstr "呼び出し元が他のプロセスとファイルシステム状態 (特に root ディレクトリ) を共有していて (B<CLONE_FS>)、 新しいユーザー名前空間に参加しようとした。"
4189
4190 #.  See kernel/user_namespace.c::userns_install() [kernel 3.15 sources]
4191 #. type: Plain text
4192 #: build/C/man2/setns.2:179
4193 msgid "The caller is multithreaded and tried to join a new user namespace."
4194 msgstr "呼び出し元プロセスがマルチスレッドで、新しいユーザー名前空間に参加しようとした。"
4195
4196 #. type: Plain text
4197 #: build/C/man2/setns.2:182
4198 msgid "Cannot allocate sufficient memory to change the specified namespace."
4199 msgstr "指定された名前空間に変更するのに必要なメモリが割り当てられない。"
4200
4201 #. type: Plain text
4202 #: build/C/man2/setns.2:186
4203 msgid "The calling thread did not have the required capability for this operation."
4204 msgstr "呼び出し元スレッドはこの操作を行うのに必要なケーパビリティを持っていなかった。"
4205
4206 #. type: Plain text
4207 #: build/C/man2/setns.2:191
4208 msgid "The B<setns>()  system call first appeared in Linux in kernel 3.0; library support was added to glibc in version 2.14."
4209 msgstr ""
4210 "B<setns>() システムコールはカーネル 3.0 で Linux に初めて登場した。\n"
4211 "ライブラリによるサポートは glibc バージョン 2.14 を追加された。"
4212
4213 #. type: Plain text
4214 #: build/C/man2/setns.2:195
4215 msgid "The B<setns>()  system call is Linux-specific."
4216 msgstr "B<setns>() システムコールは Linux 固有である。"
4217
4218 #. type: Plain text
4219 #: build/C/man2/setns.2:201
4220 msgid "Not all of the attributes that can be shared when a new thread is created using B<clone>(2)  can be changed using B<setns>()."
4221 msgstr ""
4222 "新しいスレッドが B<clone>(2) を使って作成された際に共有できる全ての属性を、\n"
4223 "B<setns>() を使って変更できるわけではない。"
4224
4225 #. type: Plain text
4226 #: build/C/man2/setns.2:210
4227 msgid "The program below takes two or more arguments.  The first argument specifies the pathname of a namespace file in an existing I</proc/[pid]/ns/> directory.  The remaining arguments specify a command and its arguments.  The program opens the namespace file, joins that namespace using B<setns>(), and executes the specified command inside that namespace."
4228 msgstr "以下のプログラムは 2 つ以上の引き数を取る。 最初の引き数には、 既存の I</proc/[pid]/ns/> ディレクトリの名前空間ファイルのパス名を指定する。 残りの引き数は、コマンドとその引き数を指定する。 このプログラムは名前空間ファイルをオープンし、 B<setns>() を使って名前空間に参加し、 指定されたコマンドをその名前空間内で実行する。"
4229
4230 #. type: Plain text
4231 #: build/C/man2/setns.2:220
4232 msgid "The following shell session demonstrates the use of this program (compiled as a binary named I<ns_exec>)  in conjunction with the B<CLONE_NEWUTS> example program in the B<clone>(2)  man page (complied as a binary named I<newuts>)."
4233 msgstr "以下のシェルセッションでは、 このプログラム (I<ns_exec> という名前のバイナリとしてコンパイルされている)を、 B<clone>(2) のマニュアルページの B<CLONE_NEWUTS> のサンプルプログラムと組み合わせて使っている。"
4234
4235 #. type: Plain text
4236 #: build/C/man2/setns.2:228
4237 msgid "We begin by executing the example program in B<clone>(2)  in the background.  That program creates a child in a separate UTS namespace.  The child changes the hostname in its namespace, and then both processes display the hostnames in their UTS namespaces, so that we can see that they are different."
4238 msgstr "まず、 B<clone>(2) のサンプルプログラムをバックグラウンドで実行する。 このプログラムは、 別の UTS 名前空間で子プロセスを作成する。 子プロセスは自分の名前空間内でホスト名を変更する。 それから、 親プロセスと子プロセスの両方でそれぞれの UTS 名前空間のホスト名を表示し、 2 つのホスト名が違うことが確認できる。"
4239
4240 #. type: Plain text
4241 #: build/C/man2/setns.2:240
4242 #, no-wrap
4243 msgid ""
4244 "$ B<su>                   # Need privilege for namespace operations\n"
4245 "Password:\n"
4246 "# B<./newuts bizarro &>\n"
4247 "[1] 3549\n"
4248 "clone() returned 3550\n"
4249 "uts.nodename in child:  bizarro\n"
4250 "uts.nodename in parent: antero\n"
4251 "# B<uname -n>             # Verify hostname in the shell\n"
4252 "antero\n"
4253 msgstr ""
4254 "$ B<su>                   # 名前空間の操作には特権が必要\n"
4255 "Password:\n"
4256 "# B<./newuts bizarro &>\n"
4257 "[1] 3549\n"
4258 "clone() returned 3550\n"
4259 "uts.nodename in child:  bizarro\n"
4260 "uts.nodename in parent: antero\n"
4261 "# B<uname -n>             # シェルでホスト名を確認\n"
4262 "antero\n"
4263
4264 #. type: Plain text
4265 #: build/C/man2/setns.2:247
4266 msgid "We then run the program shown below, using it to execute a shell.  Inside that shell, we verify that the hostname is the one set by the child created by the first program:"
4267 msgstr "次に、以下のプログラムを使ってシェルを実行する。 このシェルの中では、ホスト名が最初のプログラムで作成された子プロセスが設定したホスト名になっていることを確認できる。"
4268
4269 #. type: Plain text
4270 #: build/C/man2/setns.2:253
4271 #, no-wrap
4272 msgid ""
4273 "# B<./ns_exec /proc/3550/ns/uts /bin/bash>\n"
4274 "# B<uname -n>             # Executed in shell started by ns_exec\n"
4275 "bizarro\n"
4276 msgstr ""
4277 "# B<./ns_exec /proc/3550/ns/uts /bin/bash>\n"
4278 "# B<uname -n>             #  ns_exec で起動されたシェル内で実行\n"
4279 "bizarro\n"
4280
4281 #. type: Plain text
4282 #: build/C/man2/setns.2:263
4283 #, no-wrap
4284 msgid ""
4285 "#define _GNU_SOURCE\n"
4286 "#include E<lt>fcntl.hE<gt>\n"
4287 "#include E<lt>sched.hE<gt>\n"
4288 "#include E<lt>unistd.hE<gt>\n"
4289 "#include E<lt>stdlib.hE<gt>\n"
4290 "#include E<lt>stdio.hE<gt>\n"
4291 msgstr ""
4292 "#define _GNU_SOURCE\n"
4293 "#include E<lt>fcntl.hE<gt>\n"
4294 "#include E<lt>sched.hE<gt>\n"
4295 "#include E<lt>unistd.hE<gt>\n"
4296 "#include E<lt>stdlib.hE<gt>\n"
4297 "#include E<lt>stdio.hE<gt>\n"
4298
4299 #. type: Plain text
4300 #: build/C/man2/setns.2:271
4301 #, no-wrap
4302 msgid ""
4303 "int\n"
4304 "main(int argc, char *argv[])\n"
4305 "{\n"
4306 "    int fd;\n"
4307 msgstr ""
4308 "int\n"
4309 "main(int argc, char *argv[])\n"
4310 "{\n"
4311 "    int fd;\n"
4312
4313 #. type: Plain text
4314 #: build/C/man2/setns.2:276
4315 #, no-wrap
4316 msgid ""
4317 "    if (argc E<lt> 3) {\n"
4318 "        fprintf(stderr, \"%s /proc/PID/ns/FILE cmd args...\\en\", argv[0]);\n"
4319 "        exit(EXIT_FAILURE);\n"
4320 "    }\n"
4321 msgstr ""
4322 "    if (argc E<lt> 3) {\n"
4323 "        fprintf(stderr, \"%s /proc/PID/ns/FILE cmd args...\\en\", argv[0]);\n"
4324 "        exit(EXIT_FAILURE);\n"
4325 "    }\n"
4326
4327 #. type: Plain text
4328 #: build/C/man2/setns.2:280
4329 #, no-wrap
4330 msgid ""
4331 "    fd = open(argv[1], O_RDONLY);  /* Get descriptor for namespace */\n"
4332 "    if (fd == -1)\n"
4333 "        errExit(\"open\");\n"
4334 msgstr ""
4335 "    fd = open(argv[1], O_RDONLY);  /* 名前空間のディスクリプターを取得 */\n"
4336 "    if (fd == -1)\n"
4337 "        errExit(\"open\");\n"
4338
4339 #. type: Plain text
4340 #: build/C/man2/setns.2:283
4341 #, no-wrap
4342 msgid ""
4343 "    if (setns(fd, 0) == -1)        /* Join that namespace */\n"
4344 "        errExit(\"setns\");\n"
4345 msgstr ""
4346 "    if (setns(fd, 0) == -1)        /* 名前空間に参加 */\n"
4347 "        errExit(\"setns\");\n"
4348
4349 #. type: Plain text
4350 #: build/C/man2/setns.2:287
4351 #, no-wrap
4352 msgid ""
4353 "    execvp(argv[2], &argv[2]);     /* Execute a command in namespace */\n"
4354 "    errExit(\"execvp\");\n"
4355 "}\n"
4356 msgstr ""
4357 "    execvp(argv[2], &argv[2]);     /* 名前空間内でコマンドを実行 */\n"
4358 "    errExit(\"execvp\");\n"
4359 "}\n"
4360
4361 #. type: Plain text
4362 #: build/C/man2/setns.2:295
4363 msgid "B<clone>(2), B<fork>(2), B<unshare>(2), B<vfork>(2), B<namespaces>(7), B<unix>(7)"
4364 msgstr "B<clone>(2), B<fork>(2), B<unshare>(2), B<vfork>(2), B<namespaces>(7), B<unix>(7)"
4365
4366 #. type: TH
4367 #: build/C/man2/unshare.2:20
4368 #, no-wrap
4369 msgid "UNSHARE"
4370 msgstr "UNSHARE"
4371
4372 #. type: Plain text
4373 #: build/C/man2/unshare.2:23
4374 msgid "unshare - disassociate parts of the process execution context"
4375 msgstr "unshare - プロセス実行コンテキストの一部を分離する"
4376
4377 #. type: Plain text
4378 #: build/C/man2/unshare.2:28
4379 #, no-wrap
4380 msgid "B<int unshare(int >I<flags>B<);>\n"
4381 msgstr "B<int unshare(int >I<flags>B<);>\n"
4382
4383 #. type: Plain text
4384 #: build/C/man2/unshare.2:36
4385 msgid "B<unshare>():"
4386 msgstr "B<unshare>():"
4387
4388 #. type: Plain text
4389 #: build/C/man2/unshare.2:62
4390 msgid "B<unshare>()  allows a process to disassociate parts of its execution context that are currently being shared with other processes.  Part of the execution context, such as the mount namespace, is shared implicitly when a new process is created using B<fork>(2)  or B<vfork>(2), while other parts, such as virtual memory, may be shared by explicit request when creating a process using B<clone>(2)."
4391 msgstr "B<unshare>()  を使うと、プロセスは他のプロセスと現在共有している 実行コンテキストの一部を分離することができる。 実行コンテキストの一部、たとえばマウント名前空間 (mount namespace)  などは、新しいプロセスを B<fork>(2)  または B<vfork>(2)  を使って生成したときに、暗黙のうちに共有される。 一方、仮想メモリなどは、 B<clone>(2)  を使ってプロセスを生成するときに、明示的に共有することを要求できる。"
4392
4393 #. type: Plain text
4394 #: build/C/man2/unshare.2:67
4395 msgid "The main use of B<unshare>()  is to allow a process to control its shared execution context without creating a new process."
4396 msgstr "B<unshare>()  の主な利用法は、プロセスが新しいプロセスを生成することなく、 共有実行コンテキストを制御することである。"
4397
4398 #. type: Plain text
4399 #: build/C/man2/unshare.2:74
4400 msgid "The I<flags> argument is a bit mask that specifies which parts of the execution context should be unshared.  This argument is specified by ORing together zero or more of the following constants:"
4401 msgstr "I<flags> 引き数はビットマスクであり、 実行コンテキストのどの部分の共有を解除するかを表す。 この引き数は、以下の定数の 0 個以上の OR で指定する:"
4402
4403 #. type: TP
4404 #: build/C/man2/unshare.2:74
4405 #, no-wrap
4406 msgid "B<CLONE_FILES>"
4407 msgstr "B<CLONE_FILES>"
4408
4409 #. type: Plain text
4410 #: build/C/man2/unshare.2:82
4411 msgid "Reverse the effect of the B<clone>(2)  B<CLONE_FILES> flag.  Unshare the file descriptor table, so that the calling process no longer shares its file descriptors with any other process."
4412 msgstr "B<clone>(2)  B<CLONE_FILES> フラグの効果を取り消す。 ファイルディスクリプターテーブルを共有させず、 呼び出し元プロセスは他のプロセスとファイルディスクリプターを共有しなくなる。"
4413
4414 #. type: TP
4415 #: build/C/man2/unshare.2:82
4416 #, no-wrap
4417 msgid "B<CLONE_FS>"
4418 msgstr "B<CLONE_FS>"
4419
4420 #. type: Plain text
4421 #: build/C/man2/unshare.2:96
4422 msgid "Reverse the effect of the B<clone>(2)  B<CLONE_FS> flag.  Unshare filesystem attributes, so that the calling process no longer shares its root directory (B<chroot>(2)), current directory (B<chdir>(2)), or umask (B<umask>(2))  attributes with any other process."
4423 msgstr "B<clone>(2)  B<CLONE_FS> フラグの効果を取り消す。ファイルシステム属性を共有させず、呼び出し元プロセスは、ルートディレクトリ (B<chroot>(2))、カレントディレクトリ (B<chdir>(2))、 umask (B<umask>(2)) を他のプロセスと共有しなくなる。"
4424
4425 #. type: Plain text
4426 #: build/C/man2/unshare.2:113
4427 msgid "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWIPC> flag.  Unshare the System\\ V IPC namespace, so that the calling process has a private copy of the System\\ V IPC namespace which is not shared with any other process.  Specifying this flag automatically implies B<CLONE_SYSVSEM> as well.  Use of B<CLONE_NEWIPC> requires the B<CAP_SYS_ADMIN> capability."
4428 msgstr ""
4429 "このフラグは B<clone>(2) B<CLONE_NEWIPC> フラグと同じ効果を持つ。\n"
4430 "System\\ V IPC 名前空間を共有せず、呼び出し元プロセスは 他のプロセスとは\n"
4431 "共有しない固有の System\\ V IPC 名前空間のコピーを持つ。 このフラグを指定\n"
4432 "すると、 B<CLONE_SYSVSEM> も暗黙のうちに指定される。 B<CLONE_NEWIPC> を\n"
4433 "使用するには B<CAP_SYS_ADMIN> ケーパビリティが必要である。"
4434
4435 #. type: Plain text
4436 #: build/C/man2/unshare.2:128
4437 msgid "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWNET> flag.  Unshare the network namespace, so that the calling process is moved into a new network namespace which is not shared with any previously existing process.  Use of B<CLONE_NEWNET> requires the B<CAP_SYS_ADMIN> capability."
4438 msgstr ""
4439 "このフラグは B<clone>(2) B<CLONE_NEWNET> フラグと同じ効果を持つ。ネット\n"
4440 "ワーク名前空間を共有せず、呼び出し元プロセスは他のプロセスとは共有しな\n"
4441 "い固有のネットワーク名前空間のコピーを持つ。B<CLONE_NEWNET> を使用する\n"
4442 "には B<CAP_SYS_ADMIN> ケーパビリティが必要である。"
4443
4444 #. type: TP
4445 #: build/C/man2/unshare.2:128
4446 #, no-wrap
4447 msgid "B<CLONE_NEWNS>"
4448 msgstr "B<CLONE_NEWNS>"
4449
4450 #.  These flag name are inconsistent:
4451 #.  CLONE_NEWNS does the same thing in clone(), but CLONE_VM,
4452 #.  CLONE_FS, and CLONE_FILES reverse the action of the clone()
4453 #.  flags of the same name.
4454 #. type: Plain text
4455 #: build/C/man2/unshare.2:149
4456 msgid "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWNS> flag.  Unshare the mount namespace, so that the calling process has a private copy of its namespace which is not shared with any other process.  Specifying this flag automatically implies B<CLONE_FS> as well.  Use of B<CLONE_NEWNS> requires the B<CAP_SYS_ADMIN> capability."
4457 msgstr ""
4458 "このフラグは B<clone>(2) B<CLONE_NEWNS> フラグと同じ効果を持つ。 マウン\n"
4459 "ト名前空間を共有せず、呼び出し元プロセスは 他のプロセスとは共有しない固\n"
4460 "有の名前空間のコピーを持つ。 このフラグを指定すると、 B<CLONE_FS> も暗\n"
4461 "黙のうちに指定される。 B<CLONE_NEWNS> を使用するには B<CAP_SYS_ADMIN>\n"
4462 "ケーパビリティが必要である。"
4463
4464 #. type: Plain text
4465 #: build/C/man2/unshare.2:176
4466 msgid "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWPID> flag.  Unshare the PID namespace, so that the calling process has a new PID namespace for its children which is not shared with any previously existing process.  The calling process is I<not> moved into the new namespace.  The first child created by the calling process will have the process ID 1 and will assume the role of B<init>(1)  in the new namespace.  B<CLONE_NEWPID> automatically implies B<CLONE_THREAD> as well.  Use of B<CLONE_NEWPID> requires the B<CAP_SYS_ADMIN> capability.  For further information, see B<pid_namespaces>(7)."
4467 msgstr "このフラグは B<clone>(2) B<CLONE_NEWPID> フラグと同じ効果を持つ。 PID 名前空間を共有しない。 呼び出し元プロセスは、 すでに存在するどのプロセスとも共有されない新しい PID 名前空間を、 自身の子プロセス用に持つことになる。 このプロセスにより作成される最初の子プロセスはプロセス ID 1 を持ち、 この新しい名前空間において B<init>(1) の役割を持つとみなされる。 B<CLONE_NEWPID> を指定すると、自動的に B<CLONE_THREAD> も指定されたものとみなされる。 B<CLONE_NEWPID> を使用するには B<CAP_SYS_ADMIN> ケーパビリティが必要である。 詳細な情報は B<pid_namespaces>(7) を参照。"
4468
4469 #. type: Plain text
4470 #: build/C/man2/unshare.2:190
4471 msgid "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWUSER> flag.  Unshare the user namespace, so that the calling process is moved into a new user namespace which is not shared with any previously existing process.  As with the child process created by B<clone>(2)  with the B<CLONE_NEWUSER> flag, the caller obtains a full set of capabilities in the new namespace."
4472 msgstr "このフラグは B<clone>(2) B<CLONE_NEWUSER> フラグと同じ効果を持つ。 ユーザー名前空間を共有せず、 呼び出し元プロセスはすでに存在するどのプロセスとも共有されない新しいユーザー名前空間に移動される。 B<CLONE_NEWUSER> フラグを指定して B<clone>(2) で作成された子プロセスと同様に、 呼び出し元は新しい名前空間ですべてのケーパビリティを獲得する。"
4473
4474 #.  commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
4475 #.  https://lwn.net/Articles/543273/
4476 #. type: Plain text
4477 #: build/C/man2/unshare.2:206
4478 msgid "B<CLONE_NEWUSER> requires that the calling process is not threaded; specifying B<CLONE_NEWUSER> automatically implies B<CLONE_THREAD>.  Since Linux 3.9, B<CLONE_NEWUSER> also automatically implies B<CLONE_FS>.  B<CLONE_NEWUSER> requires that the user ID and group ID of the calling process are mapped to user IDs and group IDs in the user namespace of the calling process at the time of the call."
4479 msgstr "B<CLONE_NEWUSER> を使うには、呼び出し元プロセスがスレッド化されていないことが必要である。 B<CLONE_NEWUSER> を指定すると、自動的に B<CLONE_THREAD> が指定されたものとみなされる。 Linux 3.9 以降では、 B<CLONE_NEWUSER> が指定された場合 B<CLONE_FS> も指定されたとみなされる。 B<CLONE_NEWUSER> を使うには、呼び出し元プロセスのユーザー ID とグループ ID が、 呼び出した時点で、 呼び出し元プロセスのユーザー名前空間のユーザー ID とグループ ID にマッピングされている必要がある。"
4480
4481 #. type: Plain text
4482 #: build/C/man2/unshare.2:223
4483 msgid "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWUTS> flag.  Unshare the UTS IPC namespace, so that the calling process has a private copy of the UTS namespace which is not shared with any other process.  Use of B<CLONE_NEWUTS> requires the B<CAP_SYS_ADMIN> capability."
4484 msgstr ""
4485 "このフラグは B<clone>(2) B<CLONE_NEWUTS> フラグと同じ効果を持つ。 UTS\n"
4486 "IPC 名前空間を共有せず、呼び出し元プロセスは他のプロセスとは共有しない\n"
4487 "固有の UTS IPC 名前空間のコピーを持つ。 このフラグを指定すると、\n"
4488 "B<CLONE_FS> も暗黙のうちに指定される。B<CLONE_NEWUTS> を使用するには\n"
4489 "B<CAP_SYS_ADMIN> ケーパビリティが必要である。"
4490
4491 #. type: TP
4492 #: build/C/man2/unshare.2:223
4493 #, no-wrap
4494 msgid "B<CLONE_SYSVSEM> (since Linux 2.6.26)"
4495 msgstr "B<CLONE_SYSVSEM> (Linux 2.6.26 以降)"
4496
4497 #.  commit 9edff4ab1f8d82675277a04e359d0ed8bf14a7b7
4498 #.  CLONE_NEWNS If CLONE_SIGHAND is set and signals are also being shared
4499 #.  (i.e., current->signal->count > 1), force CLONE_THREAD.
4500 #. type: Plain text
4501 #: build/C/man2/unshare.2:243
4502 msgid "This flag reverses the effect of the B<clone>(2)  B<CLONE_SYSVSEM> flag.  Unshare System\\ V semaphore adjustment (I<semadj>)  values, so that the calling process has a new empty I<semadj> list that is not shared with any other process.  If this is the last process that has a reference to the process's current I<semadj> list, then the adjustments in that list are applied to the corresponding semaphores, as described in B<semop>(2)."
4503 msgstr "このフラグは B<clone>(2) B<CLONE_SYSVSEM> フラグの効果を逆転させる。 System\\ V セマフォの調整値 (I<semadj>) を共有せず、 呼び出し元プロセスは他のプロセスとは共有されない新しい空の I<semadj> リストを持つ。 そのプロセスが、自分の現在の I<semadj> リストへの参照を持つ最後のプロセスであれば、 このリストの調整値は対応するセマフォに適用される (B<semop>(2) に説明がある通り)。"
4504
4505 #
4506 #.  As at 3.9, the following forced implications also apply,
4507 #.  although the relevant flags are not yet implemented.
4508 #.  If CLONE_THREAD is set force CLONE_VM.
4509 #.  If CLONE_VM is set, force CLONE_SIGHAND.
4510 #.  See kernel/fork.c::check_unshare_flags()
4511 #. type: Plain text
4512 #: build/C/man2/unshare.2:270
4513 msgid "In addition, B<CLONE_THREAD>, B<CLONE_SIGHAND>, and B<CLONE_VM> can be specified in I<flags> if the caller is single threaded (i.e., it is not sharing its address space with another process or thread).  In this case, these flags have no effect.  (Note also that specifying B<CLONE_THREAD> automatically implies B<CLONE_VM>, and specifying B<CLONE_VM> automatically implies B<CLONE_SIGHAND>.)  If the process is multithreaded, then the use of these flags results in an error."
4514 msgstr "上記に加えて、 呼び出し元がシングルスレッドの場合 (すなわち別のプロセスやスレッドとアドレス空間を共有していない場合)、 B<CLONE_THREAD>, B<CLONE_SIGHAND>, B<CLONE_VM> を指定することができる。 この場合、 これらのフラグは効果を持たない。 (B<CLONE_THREAD> を指定すると自動的に B<CLONE_VM> が指定されたとみなされ、 B<CLONE_VM> を指定すると自動的に B<CLONE_SIGHAND> が指定されたとみなされる点に注意してほしい。) プロセスがマルチスレッドの場合、 これらのフラグを使用するとエラーとなる。"
4515
4516 #. type: Plain text
4517 #: build/C/man2/unshare.2:277
4518 msgid "If I<flags> is specified as zero, then B<unshare>()  is a no-op; no changes are made to the calling process's execution context."
4519 msgstr "I<flags> に 0 が指定された場合、 B<unshare>()  は何も行わないので、 呼び出し元プロセスの実行コンテキストは、何も変更されない。"
4520
4521 #. type: Plain text
4522 #: build/C/man2/unshare.2:282
4523 msgid "On success, zero returned.  On failure, -1 is returned and I<errno> is set to indicate the error."
4524 msgstr "成功した場合は 0 が返される。 失敗した場合は -1 が返されて、 I<errno> にはエラーを示す値が設定される。"
4525
4526 #. type: Plain text
4527 #: build/C/man2/unshare.2:287
4528 msgid "An invalid bit was specified in I<flags>."
4529 msgstr "I<flags> に不正なビットが指定された。"
4530
4531 #. type: Plain text
4532 #: build/C/man2/unshare.2:296
4533 msgid "B<CLONE_THREAD>, B<CLONE_SIGHAND>, or B<CLONE_VM> was specified in I<flags>, and the caller is multithreaded."
4534 msgstr "B<CLONE_THREAD>, B<CLONE_SIGHAND>, B<CLONE_VM> が I<flags> に指定されたが、 呼び出したプロセスはマルチスレッドである。"
4535
4536 #. type: Plain text
4537 #: build/C/man2/unshare.2:300
4538 msgid "Cannot allocate sufficient memory to copy parts of caller's context that need to be unshared."
4539 msgstr "呼び出し元のコンテキストのうち共有を解除する必要がある部分をコピーするために、 十分なメモリが確保できなかった。"
4540
4541 #. type: Plain text
4542 #: build/C/man2/unshare.2:303
4543 msgid "The calling process did not have the required privileges for this operation."
4544 msgstr "呼び出し元プロセスはこの操作を行うのに必要な特権を持っていなかった。"
4545
4546 #. type: Plain text
4547 #: build/C/man2/unshare.2:334
4548 msgid "The B<unshare>()  system call was added to Linux in kernel 2.6.16."
4549 msgstr "B<unshare>()  システムコールは Linux カーネル 2.6.16 で追加された。"
4550
4551 #. type: Plain text
4552 #: build/C/man2/unshare.2:338
4553 msgid "The B<unshare>()  system call is Linux-specific."
4554 msgstr "B<unshare>()  システムコールは Linux 固有である。"
4555
4556 #.  FIXME all of the following needs to be reviewed for the current kernel
4557 #.  However, we can do unshare(CLONE_SIGHAND) if CLONE_SIGHAND
4558 #.  was not specified when doing clone(); i.e., unsharing
4559 #.  signal handlers is permitted if we are not actually
4560 #.  sharing signal handlers.   mtk
4561 #.  However, we can do unshare(CLONE_VM) if CLONE_VM
4562 #.  was not specified when doing clone(); i.e., unsharing
4563 #.  virtual memory is permitted if we are not actually
4564 #.  sharing virtual memory.   mtk
4565 #. 9) Future Work
4566 #. --------------
4567 #. The current implementation of unshare does not allow unsharing of
4568 #. signals and signal handlers. Signals are complex to begin with and
4569 #. to unshare signals and/or signal handlers of a currently running
4570 #. process is even more complex. If in the future there is a specific
4571 #. need to allow unsharing of signals and/or signal handlers, it can
4572 #. be incrementally added to unshare without affecting legacy
4573 #. applications using unshare.
4574 #. type: Plain text
4575 #: build/C/man2/unshare.2:372
4576 msgid "Not all of the process attributes that can be shared when a new process is created using B<clone>(2)  can be unshared using B<unshare>().  In particular, as at kernel 3.8, B<unshare>()  does not implement flags that reverse the effects of B<CLONE_SIGHAND>, B<CLONE_THREAD>, or B<CLONE_VM>.  Such functionality may be added in the future, if required."
4577 msgstr "B<clone>(2)  で新しいプロセスを生成したときに共有される全てのプロセス属性を、 B<unshare>()  によって共有の解除ができるわけではない。 特に、カーネル 3.8 時点では、 B<unshare>()  に B<CLONE_SIGHAND>, B<CLONE_THREAD>, B<CLONE_VM> の効果を取り消すためのフラグが実装されていない。 これらの機能は、必要であれば将来追加されるかもしれない。"
4578
4579 #. type: Plain text
4580 #: build/C/man2/unshare.2:381
4581 msgid "The program below provides a simple implementation of the B<unshare>(1)  command, which unshares one or more namespaces and executes the command supplied in its command-line arguments.  Here's an example of the use of this program, running a shell in a new mount namespace, and verifying that the original shell and the new shell are in separate mount namespaces:"
4582 msgstr "以下のプログラムは B<unshare>(1) コマンドの簡単な実装である。 このコマンドは、1 つ以上の名前空間の unshare を行ってから、 コマンドライン引き数で指定されたコマンドを実行する。 以下はこのプログラムの使用例である。 新しいマウント名前空間でシェルを実行し、 元のシェルと新しいシェルが別のマウント名前空間にいることを確認している。"
4583
4584 #. type: Plain text
4585 #: build/C/man2/unshare.2:390
4586 #, no-wrap
4587 msgid ""
4588 "$ B<readlink /proc/$$/ns/mnt>\n"
4589 "mnt:[4026531840]\n"
4590 "$ B<sudo ./unshare -m /bin/bash>\n"
4591 "[sudo] password for cecilia:\n"
4592 "# B<readlink /proc/$$/ns/mnt>\n"
4593 "mnt:[4026532325]\n"
4594 msgstr ""
4595 "$ B<readlink /proc/$$/ns/mnt>\n"
4596 "mnt:[4026531840]\n"
4597 "$ B<sudo ./unshare -m /bin/bash>\n"
4598 "[sudo] password for cecilia:\n"
4599 "# B<readlink /proc/$$/ns/mnt>\n"
4600 "mnt:[4026532325]\n"
4601
4602 #. type: Plain text
4603 #: build/C/man2/unshare.2:396
4604 msgid "The differing output of the two B<readlink>(1)  commands shows that the two shells are in different mount namespaces."
4605 msgstr "2 つの B<readlink>(1) コマンドの出力が違うことから、 2 つのシェルは異なるマウント名前空間にいることが分かる。"
4606
4607 #. type: Plain text
4608 #: build/C/man2/unshare.2:400
4609 #, no-wrap
4610 msgid "/* unshare.c\n"
4611 msgstr "/* unshare.c\n"
4612
4613 #. type: Plain text
4614 #: build/C/man2/unshare.2:409
4615 #, no-wrap
4616 msgid ""
4617 "   A simple implementation of the unshare(1) command: unshare\n"
4618 "   namespaces and execute a command.\n"
4619 "*/\n"
4620 "#define _GNU_SOURCE\n"
4621 "#include E<lt>sched.hE<gt>\n"
4622 "#include E<lt>unistd.hE<gt>\n"
4623 "#include E<lt>stdlib.hE<gt>\n"
4624 "#include E<lt>stdio.hE<gt>\n"
4625 msgstr ""
4626 "   A simple implementation of the unshare(1) command: unshare\n"
4627 "   namespaces and execute a command.\n"
4628 "*/\n"
4629 "#define _GNU_SOURCE\n"
4630 "#include E<lt>sched.hE<gt>\n"
4631 "#include E<lt>unistd.hE<gt>\n"
4632 "#include E<lt>stdlib.hE<gt>\n"
4633 "#include E<lt>stdio.hE<gt>\n"
4634
4635 #. type: Plain text
4636 #: build/C/man2/unshare.2:412
4637 #, no-wrap
4638 msgid ""
4639 "/* A simple error-handling function: print an error message based\n"
4640 "   on the value in \\(aqerrno\\(aq and terminate the calling process */\n"
4641 msgstr ""
4642 "/* A simple error-handling function: print an error message based\n"
4643 "   on the value in \\(aqerrno\\(aq and terminate the calling process */\n"
4644
4645 #. type: Plain text
4646 #: build/C/man2/unshare.2:429
4647 #, no-wrap
4648 msgid ""
4649 "static void\n"
4650 "usage(char *pname)\n"
4651 "{\n"
4652 "    fprintf(stderr, \"Usage: %s [options] program [arg...]\\en\", pname);\n"
4653 "    fprintf(stderr, \"Options can be:\\en\");\n"
4654 "    fprintf(stderr, \"    -i   unshare IPC namespace\\en\");\n"
4655 "    fprintf(stderr, \"    -m   unshare mount namespace\\en\");\n"
4656 "    fprintf(stderr, \"    -n   unshare network namespace\\en\");\n"
4657 "    fprintf(stderr, \"    -p   unshare PID namespace\\en\");\n"
4658 "    fprintf(stderr, \"    -u   unshare UTS namespace\\en\");\n"
4659 "    fprintf(stderr, \"    -U   unshare user namespace\\en\");\n"
4660 "    exit(EXIT_FAILURE);\n"
4661 "}\n"
4662 msgstr ""
4663 "static void\n"
4664 "usage(char *pname)\n"
4665 "{\n"
4666 "    fprintf(stderr, \"Usage: %s [options] program [arg...]\\en\", pname);\n"
4667 "    fprintf(stderr, \"Options can be:\\en\");\n"
4668 "    fprintf(stderr, \"    -i   unshare IPC namespace\\en\");\n"
4669 "    fprintf(stderr, \"    -m   unshare mount namespace\\en\");\n"
4670 "    fprintf(stderr, \"    -n   unshare network namespace\\en\");\n"
4671 "    fprintf(stderr, \"    -p   unshare PID namespace\\en\");\n"
4672 "    fprintf(stderr, \"    -u   unshare UTS namespace\\en\");\n"
4673 "    fprintf(stderr, \"    -U   unshare user namespace\\en\");\n"
4674 "    exit(EXIT_FAILURE);\n"
4675 "}\n"
4676
4677 #. type: Plain text
4678 #: build/C/man2/unshare.2:434
4679 #, no-wrap
4680 msgid ""
4681 "int\n"
4682 "main(int argc, char *argv[])\n"
4683 "{\n"
4684 "    int flags, opt;\n"
4685 msgstr ""
4686 "int\n"
4687 "main(int argc, char *argv[])\n"
4688 "{\n"
4689 "    int flags, opt;\n"
4690
4691 #. type: Plain text
4692 #: build/C/man2/unshare.2:436
4693 #, no-wrap
4694 msgid "    flags = 0;\n"
4695 msgstr "    flags = 0;\n"
4696
4697 #. type: Plain text
4698 #: build/C/man2/unshare.2:448
4699 #, no-wrap
4700 msgid ""
4701 "    while ((opt = getopt(argc, argv, \"imnpuU\")) != -1) {\n"
4702 "        switch (opt) {\n"
4703 "        case \\(aqi\\(aq: flags |= CLONE_NEWIPC;        break;\n"
4704 "        case \\(aqm\\(aq: flags |= CLONE_NEWNS;         break;\n"
4705 "        case \\(aqn\\(aq: flags |= CLONE_NEWNET;        break;\n"
4706 "        case \\(aqp\\(aq: flags |= CLONE_NEWPID;        break;\n"
4707 "        case \\(aqu\\(aq: flags |= CLONE_NEWUTS;        break;\n"
4708 "        case \\(aqU\\(aq: flags |= CLONE_NEWUSER;       break;\n"
4709 "        default:  usage(argv[0]);\n"
4710 "        }\n"
4711 "    }\n"
4712 msgstr ""
4713 "    while ((opt = getopt(argc, argv, \"imnpuU\")) != -1) {\n"
4714 "        switch (opt) {\n"
4715 "        case \\(aqi\\(aq: flags |= CLONE_NEWIPC;        break;\n"
4716 "        case \\(aqm\\(aq: flags |= CLONE_NEWNS;         break;\n"
4717 "        case \\(aqn\\(aq: flags |= CLONE_NEWNET;        break;\n"
4718 "        case \\(aqp\\(aq: flags |= CLONE_NEWPID;        break;\n"
4719 "        case \\(aqu\\(aq: flags |= CLONE_NEWUTS;        break;\n"
4720 "        case \\(aqU\\(aq: flags |= CLONE_NEWUSER;       break;\n"
4721 "        default:  usage(argv[0]);\n"
4722 "        }\n"
4723 "    }\n"
4724
4725 #. type: Plain text
4726 #: build/C/man2/unshare.2:451
4727 #, no-wrap
4728 msgid ""
4729 "    if (optind E<gt>= argc)\n"
4730 "        usage(argv[0]);\n"
4731 msgstr ""
4732 "    if (optind E<gt>= argc)\n"
4733 "        usage(argv[0]);\n"
4734
4735 #. type: Plain text
4736 #: build/C/man2/unshare.2:454
4737 #, no-wrap
4738 msgid ""
4739 "    if (unshare(flags) == -1)\n"
4740 "        errExit(\"unshare\");\n"
4741 msgstr ""
4742 "    if (unshare(flags) == -1)\n"
4743 "        errExit(\"unshare\");\n"
4744
4745 #. type: Plain text
4746 #: build/C/man2/unshare.2:458
4747 #, no-wrap
4748 msgid ""
4749 "    execvp(argv[optind], &argv[optind]);\n"
4750 "    errExit(\"execvp\");\n"
4751 "}\n"
4752 msgstr ""
4753 "    execvp(argv[optind], &argv[optind]);\n"
4754 "    errExit(\"execvp\");\n"
4755 "}\n"
4756
4757 #. type: Plain text
4758 #: build/C/man2/unshare.2:467
4759 msgid "B<unshare>(1), B<clone>(2), B<fork>(2), B<kcmp>(2), B<setns>(2), B<vfork>(2), B<namespaces>(7)"
4760 msgstr "B<unshare>(1), B<clone>(2), B<fork>(2), B<kcmp>(2), B<setns>(2), B<vfork>(2), B<namespaces>(7)"
4761
4762 #. type: Plain text
4763 #: build/C/man2/unshare.2:470
4764 msgid "I<Documentation/unshare.txt> in the Linux kernel source tree"
4765 msgstr "Linux カーネルソース内の I<Documentation/unshare.txt>"