OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.51.
[linuxjm/LDP_man-pages.git] / po4a / sched / po / sched.pot
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 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2013-04-30 20:30+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: build/C/man3/CPU_SET.3:27
21 #, no-wrap
22 msgid "CPU_SET"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man3/CPU_SET.3:27
27 #, no-wrap
28 msgid "2012-03-15"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man3/CPU_SET.3:27 build/C/man2/clone.2:45 build/C/man2/kcmp.2:28 build/C/man2/sched_get_priority_max.2:29 build/C/man3/sched_getcpu.3:26 build/C/man2/sched_rr_get_interval.2:29 build/C/man2/sched_setaffinity.2:34 build/C/man2/sched_setparam.2:30 build/C/man2/sched_setscheduler.2:46 build/C/man2/sched_yield.2:29 build/C/man2/setns.2:8 build/C/man2/unshare.2:20
33 #, no-wrap
34 msgid "Linux"
35 msgstr ""
36
37 #. type: TH
38 #: build/C/man3/CPU_SET.3:27 build/C/man2/clone.2:45 build/C/man2/kcmp.2:28 build/C/man2/sched_get_priority_max.2:29 build/C/man3/sched_getcpu.3:26 build/C/man2/sched_rr_get_interval.2:29 build/C/man2/sched_setaffinity.2:34 build/C/man2/sched_setparam.2:30 build/C/man2/sched_setscheduler.2:46 build/C/man2/sched_yield.2:29 build/C/man2/setns.2:8 build/C/man2/unshare.2:20
39 #, no-wrap
40 msgid "Linux Programmer's Manual"
41 msgstr ""
42
43 #. type: SH
44 #: build/C/man3/CPU_SET.3:28 build/C/man2/clone.2:46 build/C/man2/kcmp.2:29 build/C/man2/sched_get_priority_max.2:30 build/C/man3/sched_getcpu.3:27 build/C/man2/sched_rr_get_interval.2:30 build/C/man2/sched_setaffinity.2:35 build/C/man2/sched_setparam.2:31 build/C/man2/sched_setscheduler.2:47 build/C/man2/sched_yield.2:30 build/C/man2/setns.2:9 build/C/man2/unshare.2:21
45 #, no-wrap
46 msgid "NAME"
47 msgstr ""
48
49 #. type: Plain text
50 #: build/C/man3/CPU_SET.3:35
51 msgid ""
52 "CPU_SET, CPU_CLR, CPU_ISSET, CPU_ZERO, CPU_COUNT, CPU_AND, CPU_OR, CPU_XOR, "
53 "CPU_EQUAL, CPU_ALLOC, CPU_ALLOC_SIZE, CPU_FREE, CPU_SET_S, CPU_CLR_S, "
54 "CPU_ISSET_S, CPU_ZERO_S, CPU_COUNT_S, CPU_AND_S, CPU_OR_S, CPU_XOR_S, "
55 "CPU_EQUAL_S - macros for manipulating CPU sets"
56 msgstr ""
57
58 #. type: SH
59 #: build/C/man3/CPU_SET.3:35 build/C/man2/clone.2:48 build/C/man2/kcmp.2:31 build/C/man2/sched_get_priority_max.2:32 build/C/man3/sched_getcpu.3:29 build/C/man2/sched_rr_get_interval.2:32 build/C/man2/sched_setaffinity.2:38 build/C/man2/sched_setparam.2:33 build/C/man2/sched_setscheduler.2:50 build/C/man2/sched_yield.2:32 build/C/man2/setns.2:11 build/C/man2/unshare.2:23
60 #, no-wrap
61 msgid "SYNOPSIS"
62 msgstr ""
63
64 #. type: Plain text
65 #: build/C/man3/CPU_SET.3:39 build/C/man2/sched_setaffinity.2:42 build/C/man2/setns.2:15
66 #, no-wrap
67 msgid ""
68 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
69 "B<#include E<lt>sched.hE<gt>>\n"
70 msgstr ""
71
72 #. type: Plain text
73 #: build/C/man3/CPU_SET.3:41
74 #, no-wrap
75 msgid "B<void CPU_ZERO(cpu_set_t *>I<set>B<);>\n"
76 msgstr ""
77
78 #. type: Plain text
79 #: build/C/man3/CPU_SET.3:45
80 #, no-wrap
81 msgid ""
82 "B<void CPU_SET(int >I<cpu>B<, cpu_set_t *>I<set>B<);>\n"
83 "B<void CPU_CLR(int >I<cpu>B<, cpu_set_t *>I<set>B<);>\n"
84 "B<int  CPU_ISSET(int >I<cpu>B<, cpu_set_t *>I<set>B<);>\n"
85 msgstr ""
86
87 #. type: Plain text
88 #: build/C/man3/CPU_SET.3:47
89 #, no-wrap
90 msgid "B<int  CPU_COUNT(cpu_set_t *>I<set>B<);>\n"
91 msgstr ""
92
93 #. type: Plain text
94 #: build/C/man3/CPU_SET.3:54
95 #, no-wrap
96 msgid ""
97 "B<void CPU_AND(cpu_set_t *>I<destset>B<,>\n"
98 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
99 "B<void CPU_OR(cpu_set_t *>I<destset>B<,>\n"
100 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
101 "B<void CPU_XOR(cpu_set_t *>I<destset>B<,>\n"
102 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
103 msgstr ""
104
105 #. type: Plain text
106 #: build/C/man3/CPU_SET.3:56
107 #, no-wrap
108 msgid "B<int  CPU_EQUAL(cpu_set_t *>I<set1>B<, cpu_set_t *>I<set2>B<);>\n"
109 msgstr ""
110
111 #. type: Plain text
112 #: build/C/man3/CPU_SET.3:60
113 #, no-wrap
114 msgid ""
115 "B<cpu_set_t *CPU_ALLOC(int >I<num_cpus>B<);>\n"
116 "B<void CPU_FREE(cpu_set_t *>I<set>B<);>\n"
117 "B<size_t CPU_ALLOC_SIZE(int >I<num_cpus>B<);>\n"
118 msgstr ""
119
120 #. type: Plain text
121 #: build/C/man3/CPU_SET.3:62
122 #, no-wrap
123 msgid "B<void CPU_ZERO_S(size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
124 msgstr ""
125
126 #. type: Plain text
127 #: build/C/man3/CPU_SET.3:66
128 #, no-wrap
129 msgid ""
130 "B<void CPU_SET_S(int >I<cpu>B<, size_t >I<setsize>B<, cpu_set_t "
131 "*>I<set>B<);>\n"
132 "B<void CPU_CLR_S(int >I<cpu>B<, size_t >I<setsize>B<, cpu_set_t "
133 "*>I<set>B<);>\n"
134 "B<int  CPU_ISSET_S(int >I<cpu>B<, size_t >I<setsize>B<, cpu_set_t "
135 "*>I<set>B<);>\n"
136 msgstr ""
137
138 #. type: Plain text
139 #: build/C/man3/CPU_SET.3:68
140 #, no-wrap
141 msgid "B<int  CPU_COUNT_S(size_t >I<setsize>B<, cpu_set_t *>I<set>B<);>\n"
142 msgstr ""
143
144 #. type: Plain text
145 #: build/C/man3/CPU_SET.3:75
146 #, no-wrap
147 msgid ""
148 "B<void CPU_AND_S(size_t >I<setsize>B<, cpu_set_t *>I<destset>B<,>\n"
149 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
150 "B<void CPU_OR_S(size_t >I<setsize>B<, cpu_set_t *>I<destset>B<,>\n"
151 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
152 "B<void CPU_XOR_S(size_t >I<setsize>B<, cpu_set_t *>I<destset>B<,>\n"
153 "B<             cpu_set_t *>I<srcset1>B<, cpu_set_t *>I<srcset2>B<);>\n"
154 msgstr ""
155
156 #. type: Plain text
157 #: build/C/man3/CPU_SET.3:78
158 #, no-wrap
159 msgid ""
160 "B<int  CPU_EQUAL_S(size_t >I<setsize>B<, cpu_set_t *>I<set1>B<, cpu_set_t "
161 "*>I<set2>B<);>\n"
162 msgstr ""
163
164 #. type: SH
165 #: build/C/man3/CPU_SET.3:79 build/C/man2/clone.2:86 build/C/man2/kcmp.2:41 build/C/man2/sched_get_priority_max.2:38 build/C/man3/sched_getcpu.3:55 build/C/man2/sched_rr_get_interval.2:36 build/C/man2/sched_setaffinity.2:49 build/C/man2/sched_setparam.2:47 build/C/man2/sched_setscheduler.2:66 build/C/man2/sched_yield.2:36 build/C/man2/setns.2:18 build/C/man2/unshare.2:50
166 #, no-wrap
167 msgid "DESCRIPTION"
168 msgstr ""
169
170 #. type: Plain text
171 #: build/C/man3/CPU_SET.3:86
172 msgid ""
173 "The I<cpu_set_t> data structure represents a set of CPUs.  CPU sets are used "
174 "by B<sched_setaffinity>(2)  and similar interfaces."
175 msgstr ""
176
177 #. type: Plain text
178 #: build/C/man3/CPU_SET.3:93
179 msgid ""
180 "The I<cpu_set_t> data type is implemented as a bitset.  However, the data "
181 "structure treated as considered opaque: all manipulation of CPU sets should "
182 "be done via the macros described in this page."
183 msgstr ""
184
185 #. type: Plain text
186 #: build/C/man3/CPU_SET.3:96
187 msgid "The following macros are provided to operate on the CPU set I<set>:"
188 msgstr ""
189
190 #. type: TP
191 #: build/C/man3/CPU_SET.3:96
192 #, no-wrap
193 msgid "B<CPU_ZERO>()"
194 msgstr ""
195
196 #. type: Plain text
197 #: build/C/man3/CPU_SET.3:101
198 msgid "Clears I<set>, so that it contains no CPUs."
199 msgstr ""
200
201 #. type: TP
202 #: build/C/man3/CPU_SET.3:101
203 #, no-wrap
204 msgid "B<CPU_SET>()"
205 msgstr ""
206
207 #. type: Plain text
208 #: build/C/man3/CPU_SET.3:107
209 msgid "Add CPU I<cpu> to I<set>."
210 msgstr ""
211
212 #. type: TP
213 #: build/C/man3/CPU_SET.3:107
214 #, no-wrap
215 msgid "B<CPU_CLR>()"
216 msgstr ""
217
218 #. type: Plain text
219 #: build/C/man3/CPU_SET.3:113
220 msgid "Remove CPU I<cpu> from I<set>."
221 msgstr ""
222
223 #. type: TP
224 #: build/C/man3/CPU_SET.3:113
225 #, no-wrap
226 msgid "B<CPU_ISSET>()"
227 msgstr ""
228
229 #. type: Plain text
230 #: build/C/man3/CPU_SET.3:119
231 msgid "Test to see if CPU I<cpu> is a member of I<set>."
232 msgstr ""
233
234 #. type: TP
235 #: build/C/man3/CPU_SET.3:119
236 #, no-wrap
237 msgid "B<CPU_COUNT>()"
238 msgstr ""
239
240 #. type: Plain text
241 #: build/C/man3/CPU_SET.3:123
242 msgid "Return the number of CPUs in I<set>."
243 msgstr ""
244
245 #. type: Plain text
246 #: build/C/man3/CPU_SET.3:128
247 msgid ""
248 "Where a I<cpu> argument is specified, it should not produce side effects, "
249 "since the above macros may evaluate the argument more than once."
250 msgstr ""
251
252 #. type: Plain text
253 #: build/C/man3/CPU_SET.3:139
254 msgid ""
255 "The first available CPU on the system corresponds to a I<cpu> value of 0, "
256 "the next CPU corresponds to a I<cpu> value of 1, and so on.  The constant "
257 "B<CPU_SETSIZE> (currently 1024) specifies a value one greater than the "
258 "maximum CPU number that can be stored in I<cpu_set_t>."
259 msgstr ""
260
261 #. type: Plain text
262 #: build/C/man3/CPU_SET.3:141
263 msgid "The following macros perform logical operations on CPU sets:"
264 msgstr ""
265
266 #. type: TP
267 #: build/C/man3/CPU_SET.3:141
268 #, no-wrap
269 msgid "B<CPU_AND>()"
270 msgstr ""
271
272 #. type: Plain text
273 #: build/C/man3/CPU_SET.3:150
274 msgid ""
275 "Store the intersection of the sets I<srcset1> and I<srcset2> in I<destset> "
276 "(which may be one of the source sets)."
277 msgstr ""
278
279 #. type: TP
280 #: build/C/man3/CPU_SET.3:150
281 #, no-wrap
282 msgid "B<CPU_OR>()"
283 msgstr ""
284
285 #. type: Plain text
286 #: build/C/man3/CPU_SET.3:159
287 msgid ""
288 "Store the union of the sets I<srcset1> and I<srcset2> in I<destset> (which "
289 "may be one of the source sets)."
290 msgstr ""
291
292 #. type: TP
293 #: build/C/man3/CPU_SET.3:159
294 #, no-wrap
295 msgid "B<CPU_XOR>()"
296 msgstr ""
297
298 #. type: Plain text
299 #: build/C/man3/CPU_SET.3:173
300 msgid ""
301 "Store the XOR of the sets I<srcset1> and I<srcset2> in I<destset> (which may "
302 "be one of the source sets).  The XOR means the set of CPUs that are in "
303 "either I<srcset1> or I<srcset2>, but not both."
304 msgstr ""
305
306 #. type: TP
307 #: build/C/man3/CPU_SET.3:173
308 #, no-wrap
309 msgid "B<CPU_EQUAL>()"
310 msgstr ""
311
312 #. type: Plain text
313 #: build/C/man3/CPU_SET.3:176
314 msgid "Test whether two CPU set contain exactly the same CPUs."
315 msgstr ""
316
317 #. type: SS
318 #: build/C/man3/CPU_SET.3:176
319 #, no-wrap
320 msgid "Dynamically sized CPU sets"
321 msgstr ""
322
323 #. type: Plain text
324 #: build/C/man3/CPU_SET.3:182
325 msgid ""
326 "Because some applications may require the ability to dynamically size CPU "
327 "sets (e.g., to allocate sets larger than that defined by the standard "
328 "I<cpu_set_t> data type), glibc nowadays provides a set of macros to support "
329 "this."
330 msgstr ""
331
332 #. type: Plain text
333 #: build/C/man3/CPU_SET.3:184
334 msgid "The following macros are used to allocate and deallocate CPU sets:"
335 msgstr ""
336
337 #. type: TP
338 #: build/C/man3/CPU_SET.3:184
339 #, no-wrap
340 msgid "B<CPU_ALLOC>()"
341 msgstr ""
342
343 #. type: Plain text
344 #: build/C/man3/CPU_SET.3:189
345 msgid ""
346 "Allocate a CPU set large enough to hold CPUs in the range 0 to "
347 "I<num_cpus-1>."
348 msgstr ""
349
350 #. type: TP
351 #: build/C/man3/CPU_SET.3:189
352 #, no-wrap
353 msgid "B<CPU_ALLOC_SIZE>()"
354 msgstr ""
355
356 #. type: Plain text
357 #: build/C/man3/CPU_SET.3:199
358 msgid ""
359 "Return the size in bytes of the CPU set that would be needed to hold CPUs in "
360 "the range 0 to I<num_cpus-1>.  This macro provides the value that can be "
361 "used for the I<setsize> argument in the B<CPU_*_S>()  macros described "
362 "below."
363 msgstr ""
364
365 #. type: TP
366 #: build/C/man3/CPU_SET.3:199
367 #, no-wrap
368 msgid "B<CPU_FREE>()"
369 msgstr ""
370
371 #. type: Plain text
372 #: build/C/man3/CPU_SET.3:203
373 msgid "Free a CPU set previously allocated by B<CPU_ALLOC>()."
374 msgstr ""
375
376 #. type: Plain text
377 #: build/C/man3/CPU_SET.3:210
378 msgid ""
379 "The macros whose names end with \"_S\" are the analogs of the similarly "
380 "named macros without the suffix.  These macros perform the same tasks as "
381 "their analogs, but operate on the dynamically allocated CPU set(s) whose "
382 "size is I<setsize> bytes."
383 msgstr ""
384
385 #. type: SH
386 #: build/C/man3/CPU_SET.3:210 build/C/man2/clone.2:874 build/C/man2/kcmp.2:124 build/C/man2/sched_get_priority_max.2:86 build/C/man3/sched_getcpu.3:58 build/C/man2/sched_rr_get_interval.2:73 build/C/man2/sched_setaffinity.2:107 build/C/man2/sched_setparam.2:87 build/C/man2/sched_setscheduler.2:422 build/C/man2/sched_yield.2:41 build/C/man2/setns.2:70 build/C/man2/unshare.2:207
387 #, no-wrap
388 msgid "RETURN VALUE"
389 msgstr ""
390
391 #. type: Plain text
392 #: build/C/man3/CPU_SET.3:219
393 msgid ""
394 "B<CPU_ISSET>()  and B<CPU_ISSET_S>()  return nonzero if I<cpu> is in I<set>; "
395 "otherwise, it returns 0."
396 msgstr ""
397
398 #. type: Plain text
399 #: build/C/man3/CPU_SET.3:225
400 msgid "B<CPU_COUNT>()  and B<CPU_COUNT_S>()  return the number of CPUs in I<set>."
401 msgstr ""
402
403 #. type: Plain text
404 #: build/C/man3/CPU_SET.3:230
405 msgid ""
406 "B<CPU_EQUAL>()  and B<CPU_EQUAL_S>()  return nonzero if the two CPU sets are "
407 "equal; otherwise it returns 0."
408 msgstr ""
409
410 #. type: Plain text
411 #: build/C/man3/CPU_SET.3:235
412 msgid ""
413 "B<CPU_ALLOC>()  returns a pointer on success, or NULL on failure.  (Errors "
414 "are as for B<malloc>(3).)"
415 msgstr ""
416
417 #. type: Plain text
418 #: build/C/man3/CPU_SET.3:239
419 msgid ""
420 "B<CPU_ALLOC_SIZE>()  returns the number of bytes required to store a CPU set "
421 "of the specified cardinality."
422 msgstr ""
423
424 #. type: Plain text
425 #: build/C/man3/CPU_SET.3:241
426 msgid "The other functions do not return a value."
427 msgstr ""
428
429 #. type: SH
430 #: build/C/man3/CPU_SET.3:241 build/C/man2/clone.2:991 build/C/man2/kcmp.2:195 build/C/man3/sched_getcpu.3:70 build/C/man2/sched_setaffinity.2:148 build/C/man2/setns.2:97 build/C/man2/unshare.2:224
431 #, no-wrap
432 msgid "VERSIONS"
433 msgstr ""
434
435 #. type: Plain text
436 #: build/C/man3/CPU_SET.3:249
437 msgid ""
438 "The B<CPU_ZERO>(), B<CPU_SET>(), B<CPU_CLR>(), and B<CPU_ISSET>()  macros "
439 "were added in glibc 2.3.3."
440 msgstr ""
441
442 #. type: Plain text
443 #: build/C/man3/CPU_SET.3:252
444 msgid "B<CPU_COUNT>()  first appeared in glibc 2.6."
445 msgstr ""
446
447 #. type: Plain text
448 #: build/C/man3/CPU_SET.3:270
449 msgid ""
450 "B<CPU_AND>(), B<CPU_OR>(), B<CPU_XOR>(), B<CPU_EQUAL>(), B<CPU_ALLOC>(), "
451 "B<CPU_ALLOC_SIZE>(), B<CPU_FREE>(), B<CPU_ZERO_S>(), B<CPU_SET_S>(), "
452 "B<CPU_CLR_S>(), B<CPU_ISSET_S>(), B<CPU_AND_S>(), B<CPU_OR_S>(), "
453 "B<CPU_XOR_S>(), and B<CPU_EQUAL_S>()  first appeared in glibc 2.7."
454 msgstr ""
455
456 #. type: SH
457 #: build/C/man3/CPU_SET.3:270 build/C/man2/clone.2:998 build/C/man2/kcmp.2:199 build/C/man2/sched_get_priority_max.2:100 build/C/man3/sched_getcpu.3:72 build/C/man2/sched_rr_get_interval.2:94 build/C/man2/sched_setaffinity.2:159 build/C/man2/sched_setparam.2:110 build/C/man2/sched_setscheduler.2:444 build/C/man2/sched_yield.2:52 build/C/man2/setns.2:102 build/C/man2/unshare.2:228
458 #, no-wrap
459 msgid "CONFORMING TO"
460 msgstr ""
461
462 #. type: Plain text
463 #: build/C/man3/CPU_SET.3:272
464 msgid "These interfaces are Linux-specific."
465 msgstr ""
466
467 #. type: SH
468 #: build/C/man3/CPU_SET.3:272 build/C/man2/clone.2:1002 build/C/man2/kcmp.2:202 build/C/man3/sched_getcpu.3:75 build/C/man2/sched_rr_get_interval.2:96 build/C/man2/sched_setaffinity.2:161 build/C/man2/sched_setparam.2:112 build/C/man2/sched_setscheduler.2:447 build/C/man2/sched_yield.2:54 build/C/man2/setns.2:106 build/C/man2/unshare.2:232
469 #, no-wrap
470 msgid "NOTES"
471 msgstr ""
472
473 #. type: Plain text
474 #: build/C/man3/CPU_SET.3:275
475 msgid "To duplicate a CPU set, use B<memcpy>(3)."
476 msgstr ""
477
478 #. type: Plain text
479 #: build/C/man3/CPU_SET.3:282
480 msgid ""
481 "Since CPU sets are bitsets allocated in units of long words, the actual "
482 "number of CPUs in a dynamically allocated CPU set will be rounded up to the "
483 "next multiple of I<sizeof(unsigned long)>.  An application should consider "
484 "the contents of these extra bits to be undefined."
485 msgstr ""
486
487 #. type: Plain text
488 #: build/C/man3/CPU_SET.3:294
489 msgid ""
490 "Notwithstanding the similarity in the names, note that the constant "
491 "B<CPU_SETSIZE> indicates the number of CPUs in the I<cpu_set_t> data type "
492 "(thus, it is effectively a count of bits in the bitset), while the "
493 "I<setsize> argument of the B<CPU_*_S>()  macros is a size in bytes."
494 msgstr ""
495
496 #. type: Plain text
497 #: build/C/man3/CPU_SET.3:300
498 msgid ""
499 "The data types for arguments and return values shown in the SYNOPSIS are "
500 "hints what about is expected in each case.  However, since these interfaces "
501 "are implemented as macros, the compiler won't necessarily catch all type "
502 "errors if you violate the suggestions."
503 msgstr ""
504
505 #. type: SH
506 #: build/C/man3/CPU_SET.3:300 build/C/man2/clone.2:1027 build/C/man2/sched_setscheduler.2:530
507 #, no-wrap
508 msgid "BUGS"
509 msgstr ""
510
511 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7029
512 #. type: Plain text
513 #: build/C/man3/CPU_SET.3:312
514 msgid ""
515 "On 32-bit platforms with glibc 2.8 and earlier, B<CPU_ALLOC>()  allocates "
516 "twice as much space as is required, and B<CPU_ALLOC_SIZE>()  returns a value "
517 "twice as large as it should.  This bug should not affect the semantics of a "
518 "program, but does result in wasted memory and less efficient operation of "
519 "the macros that operate on dynamically allocated CPU sets.  These bugs are "
520 "fixed in glibc 2.9."
521 msgstr ""
522
523 #. type: SH
524 #: build/C/man3/CPU_SET.3:312 build/C/man2/clone.2:1069 build/C/man2/setns.2:112
525 #, no-wrap
526 msgid "EXAMPLE"
527 msgstr ""
528
529 #. type: Plain text
530 #: build/C/man3/CPU_SET.3:315
531 msgid ""
532 "The following program demonstrates the use of some of the macros used for "
533 "dynamically allocated CPU sets."
534 msgstr ""
535
536 #. type: Plain text
537 #: build/C/man3/CPU_SET.3:323
538 #, no-wrap
539 msgid ""
540 "#define _GNU_SOURCE\n"
541 "#include E<lt>sched.hE<gt>\n"
542 "#include E<lt>stdlib.hE<gt>\n"
543 "#include E<lt>unistd.hE<gt>\n"
544 "#include E<lt>stdio.hE<gt>\n"
545 "#include E<lt>assert.hE<gt>\n"
546 msgstr ""
547
548 #. type: Plain text
549 #: build/C/man3/CPU_SET.3:330
550 #, no-wrap
551 msgid ""
552 "int\n"
553 "main(int argc, char *argv[])\n"
554 "{\n"
555 "    cpu_set_t *cpusetp;\n"
556 "    size_t size;\n"
557 "    int num_cpus, cpu;\n"
558 msgstr ""
559
560 #. type: Plain text
561 #: build/C/man3/CPU_SET.3:335
562 #, no-wrap
563 msgid ""
564 "    if (argc E<lt> 2) {\n"
565 "        fprintf(stderr, \"Usage: %s E<lt>num-cpusE<gt>\\en\", argv[0]);\n"
566 "        exit(EXIT_FAILURE);\n"
567 "    }\n"
568 msgstr ""
569
570 #. type: Plain text
571 #: build/C/man3/CPU_SET.3:337
572 #, no-wrap
573 msgid "    num_cpus = atoi(argv[1]);\n"
574 msgstr ""
575
576 #. type: Plain text
577 #: build/C/man3/CPU_SET.3:343
578 #, no-wrap
579 msgid ""
580 "    cpusetp = CPU_ALLOC(num_cpus);\n"
581 "    if (cpusetp == NULL) {\n"
582 "        perror(\"CPU_ALLOC\");\n"
583 "        exit(EXIT_FAILURE);\n"
584 "    }\n"
585 msgstr ""
586
587 #. type: Plain text
588 #: build/C/man3/CPU_SET.3:345
589 #, no-wrap
590 msgid "    size = CPU_ALLOC_SIZE(num_cpus);\n"
591 msgstr ""
592
593 #. type: Plain text
594 #: build/C/man3/CPU_SET.3:349
595 #, no-wrap
596 msgid ""
597 "    CPU_ZERO_S(size, cpusetp);\n"
598 "    for (cpu = 0; cpu E<lt> num_cpus; cpu += 2)\n"
599 "        CPU_SET_S(cpu, size, cpusetp);\n"
600 msgstr ""
601
602 #. type: Plain text
603 #: build/C/man3/CPU_SET.3:351
604 #, no-wrap
605 msgid "    printf(\"CPU_COUNT() of set:    %d\\en\", CPU_COUNT_S(size, cpusetp));\n"
606 msgstr ""
607
608 #. type: Plain text
609 #: build/C/man3/CPU_SET.3:355
610 #, no-wrap
611 msgid ""
612 "    CPU_FREE(cpusetp);\n"
613 "    exit(EXIT_SUCCESS);\n"
614 "}\n"
615 msgstr ""
616
617 #. type: SH
618 #: build/C/man3/CPU_SET.3:356 build/C/man2/clone.2:1167 build/C/man2/kcmp.2:219 build/C/man2/sched_get_priority_max.2:102 build/C/man3/sched_getcpu.3:95 build/C/man2/sched_rr_get_interval.2:132 build/C/man2/sched_setaffinity.2:214 build/C/man2/sched_setparam.2:118 build/C/man2/sched_setscheduler.2:538 build/C/man2/sched_yield.2:78 build/C/man2/setns.2:199 build/C/man2/unshare.2:266
619 #, no-wrap
620 msgid "SEE ALSO"
621 msgstr ""
622
623 #. type: Plain text
624 #: build/C/man3/CPU_SET.3:361
625 msgid ""
626 "B<sched_setaffinity>(2), B<pthread_attr_setaffinity_np>(3), "
627 "B<pthread_setaffinity_np>(3), B<cpuset>(7)"
628 msgstr ""
629
630 #. type: SH
631 #: build/C/man3/CPU_SET.3:361 build/C/man2/clone.2:1181 build/C/man2/kcmp.2:222 build/C/man2/sched_get_priority_max.2:114 build/C/man3/sched_getcpu.3:97 build/C/man2/sched_rr_get_interval.2:138 build/C/man2/sched_setaffinity.2:233 build/C/man2/sched_setparam.2:134 build/C/man2/sched_setscheduler.2:566 build/C/man2/sched_yield.2:84 build/C/man2/setns.2:205 build/C/man2/unshare.2:275
632 #, no-wrap
633 msgid "COLOPHON"
634 msgstr ""
635
636 #. type: Plain text
637 #: build/C/man3/CPU_SET.3:368 build/C/man2/clone.2:1188 build/C/man2/kcmp.2:229 build/C/man2/sched_get_priority_max.2:121 build/C/man3/sched_getcpu.3:104 build/C/man2/sched_rr_get_interval.2:145 build/C/man2/sched_setaffinity.2:240 build/C/man2/sched_setparam.2:141 build/C/man2/sched_setscheduler.2:573 build/C/man2/sched_yield.2:91 build/C/man2/setns.2:212 build/C/man2/unshare.2:282
638 msgid ""
639 "This page is part of release 3.51 of the Linux I<man-pages> project.  A "
640 "description of the project, and information about reporting bugs, can be "
641 "found at http://www.kernel.org/doc/man-pages/."
642 msgstr ""
643
644 #. type: TH
645 #: build/C/man2/clone.2:45
646 #, no-wrap
647 msgid "CLONE"
648 msgstr ""
649
650 #. type: TH
651 #: build/C/man2/clone.2:45
652 #, no-wrap
653 msgid "2013-04-16"
654 msgstr ""
655
656 #. type: Plain text
657 #: build/C/man2/clone.2:48
658 msgid "clone, __clone2 - create a child process"
659 msgstr ""
660
661 #. type: Plain text
662 #: build/C/man2/clone.2:51
663 #, no-wrap
664 msgid "/* Prototype for the glibc wrapper function */\n"
665 msgstr ""
666
667 #. type: Plain text
668 #: build/C/man2/clone.2:53 build/C/man3/sched_getcpu.3:32 build/C/man2/sched_setparam.2:36 build/C/man2/sched_setscheduler.2:53 build/C/man2/unshare.2:26
669 #, no-wrap
670 msgid "B<#include E<lt>sched.hE<gt>>\n"
671 msgstr ""
672
673 #. type: Plain text
674 #: build/C/man2/clone.2:58
675 #, no-wrap
676 msgid ""
677 "B<int clone(int (*>I<fn>B<)(void *), void *>I<child_stack>B<,>\n"
678 "B<          int >I<flags>B<, void *>I<arg>B<, ... >\n"
679 "B<          /* pid_t *>I<ptid>B<, struct user_desc *>I<tls>B<, pid_t "
680 "*>I<ctid>B< */ );>\n"
681 msgstr ""
682
683 #. type: Plain text
684 #: build/C/man2/clone.2:60
685 #, no-wrap
686 msgid "/* Prototype for the raw system call */\n"
687 msgstr ""
688
689 #. type: Plain text
690 #: build/C/man2/clone.2:64
691 #, no-wrap
692 msgid ""
693 "B<long clone(unsigned long >I<flags>B<, void *>I<child_stack>B<,>\n"
694 "B<          void *>I<ptid>B<, void *>I<ctid>B<,>\n"
695 "B<          struct pt_regs *>I<regs>B<);>\n"
696 msgstr ""
697
698 #. type: Plain text
699 #: build/C/man2/clone.2:69
700 msgid ""
701 "Feature Test Macro Requirements for glibc wrapper function (see "
702 "B<feature_test_macros>(7)):"
703 msgstr ""
704
705 #. type: Plain text
706 #: build/C/man2/clone.2:72
707 msgid "B<clone>():"
708 msgstr ""
709
710 #. type: TP
711 #: build/C/man2/clone.2:75 build/C/man3/sched_getcpu.3:45 build/C/man2/unshare.2:39
712 #, no-wrap
713 msgid "Since glibc 2.14:"
714 msgstr ""
715
716 #. type: Plain text
717 #: build/C/man2/clone.2:78 build/C/man3/sched_getcpu.3:48 build/C/man2/unshare.2:42
718 msgid "_GNU_SOURCE"
719 msgstr ""
720
721 #.  FIXME See http://sources.redhat.com/bugzilla/show_bug.cgi?id=4749
722 #. type: TP
723 #: build/C/man2/clone.2:78 build/C/man3/sched_getcpu.3:48 build/C/man2/unshare.2:42
724 #, no-wrap
725 msgid "Before glibc 2.14:"
726 msgstr ""
727
728 #. type: Plain text
729 #: build/C/man2/clone.2:83 build/C/man3/sched_getcpu.3:52 build/C/man2/unshare.2:47
730 #, no-wrap
731 msgid ""
732 "_BSD_SOURCE || _SVID_SOURCE\n"
733 "    /* _GNU_SOURCE also suffices */\n"
734 msgstr ""
735
736 #. type: Plain text
737 #: build/C/man2/clone.2:90
738 msgid "B<clone>()  creates a new process, in a manner similar to B<fork>(2)."
739 msgstr ""
740
741 #. type: Plain text
742 #: build/C/man2/clone.2:97
743 msgid ""
744 "This page describes both the glibc B<clone>()  wrapper function and the "
745 "underlying system call on which it is based.  The main text describes the "
746 "wrapper function; the differences for the raw system call are described "
747 "toward the end of this page."
748 msgstr ""
749
750 #. type: Plain text
751 #: build/C/man2/clone.2:109
752 msgid ""
753 "Unlike B<fork>(2), B<clone>()  allows the child process to share parts of "
754 "its execution context with the calling process, such as the memory space, "
755 "the table of file descriptors, and the table of signal handlers.  (Note that "
756 "on this manual page, \"calling process\" normally corresponds to \"parent "
757 "process\".  But see the description of B<CLONE_PARENT> below.)"
758 msgstr ""
759
760 #. type: Plain text
761 #: build/C/man2/clone.2:114
762 msgid ""
763 "The main use of B<clone>()  is to implement threads: multiple threads of "
764 "control in a program that run concurrently in a shared memory space."
765 msgstr ""
766
767 #. type: Plain text
768 #: build/C/man2/clone.2:134
769 msgid ""
770 "When the child process is created with B<clone>(), it executes the function "
771 "I<fn>(I<arg>).  (This differs from B<fork>(2), where execution continues in "
772 "the child from the point of the B<fork>(2)  call.)  The I<fn> argument is a "
773 "pointer to a function that is called by the child process at the beginning "
774 "of its execution.  The I<arg> argument is passed to the I<fn> function."
775 msgstr ""
776
777 #. type: Plain text
778 #: build/C/man2/clone.2:144
779 msgid ""
780 "When the I<fn>(I<arg>)  function application returns, the child process "
781 "terminates.  The integer returned by I<fn> is the exit code for the child "
782 "process.  The child process may also terminate explicitly by calling "
783 "B<exit>(2)  or after receiving a fatal signal."
784 msgstr ""
785
786 #. type: Plain text
787 #: build/C/man2/clone.2:160
788 msgid ""
789 "The I<child_stack> argument specifies the location of the stack used by the "
790 "child process.  Since the child and calling process may share memory, it is "
791 "not possible for the child process to execute in the same stack as the "
792 "calling process.  The calling process must therefore set up memory space for "
793 "the child stack and pass a pointer to this space to B<clone>().  Stacks grow "
794 "downward on all processors that run Linux (except the HP PA processors), so "
795 "I<child_stack> usually points to the topmost address of the memory space set "
796 "up for the child stack."
797 msgstr ""
798
799 #. type: Plain text
800 #: build/C/man2/clone.2:176
801 msgid ""
802 "The low byte of I<flags> contains the number of the I<termination signal> "
803 "sent to the parent when the child dies.  If this signal is specified as "
804 "anything other than B<SIGCHLD>, then the parent process must specify the "
805 "B<__WALL> or B<__WCLONE> options when waiting for the child with "
806 "B<wait>(2).  If no signal is specified, then the parent process is not "
807 "signaled when the child terminates."
808 msgstr ""
809
810 #. type: Plain text
811 #: build/C/man2/clone.2:181
812 msgid ""
813 "I<flags> may also be bitwise-or'ed with zero or more of the following "
814 "constants, in order to specify what is shared between the calling process "
815 "and the child process:"
816 msgstr ""
817
818 #. type: TP
819 #: build/C/man2/clone.2:181
820 #, no-wrap
821 msgid "B<CLONE_CHILD_CLEARTID> (since Linux 2.5.49)"
822 msgstr ""
823
824 #. type: Plain text
825 #: build/C/man2/clone.2:191
826 msgid ""
827 "Erase child thread ID at location I<ctid> in child memory when the child "
828 "exits, and do a wakeup on the futex at that address.  The address involved "
829 "may be changed by the B<set_tid_address>(2)  system call.  This is used by "
830 "threading libraries."
831 msgstr ""
832
833 #. type: TP
834 #: build/C/man2/clone.2:191
835 #, no-wrap
836 msgid "B<CLONE_CHILD_SETTID> (since Linux 2.5.49)"
837 msgstr ""
838
839 #. type: Plain text
840 #: build/C/man2/clone.2:196
841 msgid "Store child thread ID at location I<ctid> in child memory."
842 msgstr ""
843
844 #. type: TP
845 #: build/C/man2/clone.2:196
846 #, no-wrap
847 msgid "B<CLONE_FILES> (since Linux 2.0)"
848 msgstr ""
849
850 #. type: Plain text
851 #: build/C/man2/clone.2:209
852 msgid ""
853 "If B<CLONE_FILES> is set, the calling process and the child process share "
854 "the same file descriptor table.  Any file descriptor created by the calling "
855 "process or by the child process is also valid in the other process.  "
856 "Similarly, if one of the processes closes a file descriptor, or changes its "
857 "associated flags (using the B<fcntl>(2)  B<F_SETFD> operation), the other "
858 "process is also affected."
859 msgstr ""
860
861 #. type: Plain text
862 #: build/C/man2/clone.2:223
863 msgid ""
864 "If B<CLONE_FILES> is not set, the child process inherits a copy of all file "
865 "descriptors opened in the calling process at the time of B<clone>().  (The "
866 "duplicated file descriptors in the child refer to the same open file "
867 "descriptions (see B<open>(2))  as the corresponding file descriptors in the "
868 "calling process.)  Subsequent operations that open or close file "
869 "descriptors, or change file descriptor flags, performed by either the "
870 "calling process or the child process do not affect the other process."
871 msgstr ""
872
873 #. type: TP
874 #: build/C/man2/clone.2:223
875 #, no-wrap
876 msgid "B<CLONE_FS> (since Linux 2.0)"
877 msgstr ""
878
879 #. type: Plain text
880 #: build/C/man2/clone.2:238
881 msgid ""
882 "If B<CLONE_FS> is set, the caller and the child process share the same file "
883 "system information.  This includes the root of the file system, the current "
884 "working directory, and the umask.  Any call to B<chroot>(2), B<chdir>(2), or "
885 "B<umask>(2)  performed by the calling process or the child process also "
886 "affects the other process."
887 msgstr ""
888
889 #. type: Plain text
890 #: build/C/man2/clone.2:250
891 msgid ""
892 "If B<CLONE_FS> is not set, the child process works on a copy of the file "
893 "system information of the calling process at the time of the B<clone>()  "
894 "call.  Calls to B<chroot>(2), B<chdir>(2), B<umask>(2)  performed later by "
895 "one of the processes do not affect the other process."
896 msgstr ""
897
898 #. type: TP
899 #: build/C/man2/clone.2:250
900 #, no-wrap
901 msgid "B<CLONE_IO> (since Linux 2.6.25)"
902 msgstr ""
903
904 #. type: Plain text
905 #: build/C/man2/clone.2:259
906 msgid ""
907 "If B<CLONE_IO> is set, then the new process shares an I/O context with the "
908 "calling process.  If this flag is not set, then (as with B<fork>(2))  the "
909 "new process has its own I/O context."
910 msgstr ""
911
912 #.  The following based on text from Jens Axboe
913 #.  the anticipatory and CFQ scheduler
914 #.  with CFQ and AS.
915 #. type: Plain text
916 #: build/C/man2/clone.2:276
917 msgid ""
918 "The I/O context is the I/O scope of the disk scheduler (i.e, what the I/O "
919 "scheduler uses to model scheduling of a process's I/O).  If processes share "
920 "the same I/O context, they are treated as one by the I/O scheduler.  As a "
921 "consequence, they get to share disk time.  For some I/O schedulers, if two "
922 "processes share an I/O context, they will be allowed to interleave their "
923 "disk access.  If several threads are doing I/O on behalf of the same process "
924 "(B<aio_read>(3), for instance), they should employ B<CLONE_IO> to get better "
925 "I/O performance."
926 msgstr ""
927
928 #. type: Plain text
929 #: build/C/man2/clone.2:280
930 msgid ""
931 "If the kernel is not configured with the B<CONFIG_BLOCK> option, this flag "
932 "is a no-op."
933 msgstr ""
934
935 #. type: TP
936 #: build/C/man2/clone.2:280 build/C/man2/unshare.2:96
937 #, no-wrap
938 msgid "B<CLONE_NEWIPC> (since Linux 2.6.19)"
939 msgstr ""
940
941 #. type: Plain text
942 #: build/C/man2/clone.2:290
943 msgid ""
944 "If B<CLONE_NEWIPC> is set, then create the process in a new IPC namespace.  "
945 "If this flag is not set, then (as with B<fork>(2)), the process is created "
946 "in the same IPC namespace as the calling process.  This flag is intended for "
947 "the implementation of containers."
948 msgstr ""
949
950 #.  commit 7eafd7c74c3f2e67c27621b987b28397110d643f
951 #.  https://lwn.net/Articles/312232/
952 #. type: Plain text
953 #: build/C/man2/clone.2:302
954 msgid ""
955 "An IPC namespace provides an isolated view of System V IPC objects (see "
956 "B<svipc>(7))  and (since Linux 2.6.30)  POSIX message queues (see "
957 "B<mq_overview>(7)).  The common characteristic of these IPC mechanisms is "
958 "that IPC objects are identified by mechanisms other than filesystem "
959 "pathnames."
960 msgstr ""
961
962 #. type: Plain text
963 #: build/C/man2/clone.2:306
964 msgid ""
965 "Objects created in an IPC namespace are visible to all other processes that "
966 "are members of that namespace, but are not visible to processes in other IPC "
967 "namespaces."
968 msgstr ""
969
970 #. type: Plain text
971 #: build/C/man2/clone.2:310
972 msgid ""
973 "When an IPC namespace is destroyed (i.e., when the last process that is a "
974 "member of the namespace terminates), all IPC objects in the namespace are "
975 "automatically destroyed."
976 msgstr ""
977
978 #. type: Plain text
979 #: build/C/man2/clone.2:319
980 msgid ""
981 "Use of this flag requires: a kernel configured with the B<CONFIG_SYSVIPC> "
982 "and B<CONFIG_IPC_NS> options and that the process be privileged "
983 "(B<CAP_SYS_ADMIN>).  This flag can't be specified in conjunction with "
984 "B<CLONE_SYSVSEM>."
985 msgstr ""
986
987 #. type: TP
988 #: build/C/man2/clone.2:319 build/C/man2/unshare.2:113
989 #, no-wrap
990 msgid "B<CLONE_NEWNET> (since Linux 2.6.24)"
991 msgstr ""
992
993 #.  FIXME Check when the implementation was completed
994 #. type: Plain text
995 #: build/C/man2/clone.2:324
996 msgid ""
997 "(The implementation of this flag was completed only by about kernel version "
998 "2.6.29.)"
999 msgstr ""
1000
1001 #. type: Plain text
1002 #: build/C/man2/clone.2:333
1003 msgid ""
1004 "If B<CLONE_NEWNET> is set, then create the process in a new network "
1005 "namespace.  If this flag is not set, then (as with B<fork>(2)), the process "
1006 "is created in the same network namespace as the calling process.  This flag "
1007 "is intended for the implementation of containers."
1008 msgstr ""
1009
1010 #.  FIXME Add pointer to veth(4) page when it is eventually completed
1011 #. type: Plain text
1012 #: build/C/man2/clone.2:348
1013 msgid ""
1014 "A network namespace provides an isolated view of the networking stack "
1015 "(network device interfaces, IPv4 and IPv6 protocol stacks, IP routing "
1016 "tables, firewall rules, the I</proc/net> and I</sys/class/net> directory "
1017 "trees, sockets, etc.).  A physical network device can live in exactly one "
1018 "network namespace.  A virtual network device (\"veth\") pair provides a "
1019 "pipe-like abstraction that can be used to create tunnels between network "
1020 "namespaces, and can be used to create a bridge to a physical network device "
1021 "in another namespace."
1022 msgstr ""
1023
1024 #. type: Plain text
1025 #: build/C/man2/clone.2:353
1026 msgid ""
1027 "When a network namespace is freed (i.e., when the last process in the "
1028 "namespace terminates), its physical network devices are moved back to the "
1029 "initial network namespace (not to the parent of the process)."
1030 msgstr ""
1031
1032 #. type: Plain text
1033 #: build/C/man2/clone.2:358
1034 msgid ""
1035 "Use of this flag requires: a kernel configured with the B<CONFIG_NET_NS> "
1036 "option and that the process be privileged (B<CAP_SYS_ADMIN>)."
1037 msgstr ""
1038
1039 #. type: TP
1040 #: build/C/man2/clone.2:358
1041 #, no-wrap
1042 msgid "B<CLONE_NEWNS> (since Linux 2.4.19)"
1043 msgstr ""
1044
1045 #. type: Plain text
1046 #: build/C/man2/clone.2:361
1047 msgid "Start the child in a new mount namespace."
1048 msgstr ""
1049
1050 #. type: Plain text
1051 #: build/C/man2/clone.2:382
1052 msgid ""
1053 "Every process lives in a mount namespace.  The I<namespace> of a process is "
1054 "the data (the set of mounts) describing the file hierarchy as seen by that "
1055 "process.  After a B<fork>(2)  or B<clone>()  where the B<CLONE_NEWNS> flag "
1056 "is not set, the child lives in the same mount namespace as the parent.  The "
1057 "system calls B<mount>(2)  and B<umount>(2)  change the mount namespace of "
1058 "the calling process, and hence affect all processes that live in the same "
1059 "namespace, but do not affect processes in a different mount namespace."
1060 msgstr ""
1061
1062 #. type: Plain text
1063 #: build/C/man2/clone.2:389
1064 msgid ""
1065 "After a B<clone>()  where the B<CLONE_NEWNS> flag is set, the cloned child "
1066 "is started in a new mount namespace, initialized with a copy of the "
1067 "namespace of the parent."
1068 msgstr ""
1069
1070 #. type: Plain text
1071 #: build/C/man2/clone.2:401
1072 msgid ""
1073 "Only a privileged process (one having the B<CAP_SYS_ADMIN> capability)  may "
1074 "specify the B<CLONE_NEWNS> flag.  It is not permitted to specify both "
1075 "B<CLONE_NEWNS> and B<CLONE_FS> in the same B<clone>()  call."
1076 msgstr ""
1077
1078 #. type: TP
1079 #: build/C/man2/clone.2:401
1080 #, no-wrap
1081 msgid "B<CLONE_NEWPID> (since Linux 2.6.24)"
1082 msgstr ""
1083
1084 #.  This explanation draws a lot of details from
1085 #.  http://lwn.net/Articles/259217/
1086 #.  Authors: Pavel Emelyanov <xemul@openvz.org>
1087 #.  and Kir Kolyshkin <kir@openvz.org>
1088 #
1089 #.  The primary kernel commit is 30e49c263e36341b60b735cbef5ca37912549264
1090 #.  Author: Pavel Emelyanov <xemul@openvz.org>
1091 #. type: Plain text
1092 #: build/C/man2/clone.2:418
1093 msgid ""
1094 "If B<CLONE_NEWPID> is set, then create the process in a new PID namespace.  "
1095 "If this flag is not set, then (as with B<fork>(2)), the process is created "
1096 "in the same PID namespace as the calling process.  This flag is intended for "
1097 "the implementation of containers."
1098 msgstr ""
1099
1100 #. type: Plain text
1101 #: build/C/man2/clone.2:427
1102 msgid ""
1103 "A PID namespace provides an isolated environment for PIDs: PIDs in a new "
1104 "namespace start at 1, somewhat like a standalone system, and calls to "
1105 "B<fork>(2), B<vfork>(2), or B<clone>()  will produce processes with PIDs "
1106 "that are unique within the namespace."
1107 msgstr ""
1108
1109 #. type: Plain text
1110 #: build/C/man2/clone.2:439
1111 msgid ""
1112 "The first process created in a new namespace (i.e., the process created "
1113 "using the B<CLONE_NEWPID> flag) has the PID 1, and is the \"init\" process "
1114 "for the namespace.  Children that are orphaned within the namespace will be "
1115 "reparented to this process rather than B<init>(8).  Unlike the traditional "
1116 "B<init> process, the \"init\" process of a PID namespace can terminate, and "
1117 "if it does, all of the processes in the namespace are terminated."
1118 msgstr ""
1119
1120 #. type: Plain text
1121 #: build/C/man2/clone.2:458
1122 msgid ""
1123 "PID namespaces form a hierarchy.  When a new PID namespace is created, the "
1124 "processes in that namespace are visible in the PID namespace of the process "
1125 "that created the new namespace; analogously, if the parent PID namespace is "
1126 "itself the child of another PID namespace, then processes in the child and "
1127 "parent PID namespaces will both be visible in the grandparent PID "
1128 "namespace.  Conversely, the processes in the \"child\" PID namespace do not "
1129 "see the processes in the parent namespace.  The existence of a namespace "
1130 "hierarchy means that each process may now have multiple PIDs: one for each "
1131 "namespace in which it is visible; each of these PIDs is unique within the "
1132 "corresponding namespace.  (A call to B<getpid>(2)  always returns the PID "
1133 "associated with the namespace in which the process lives.)"
1134 msgstr ""
1135
1136 #.  mount -t proc proc /proc
1137 #. type: Plain text
1138 #: build/C/man2/clone.2:474
1139 msgid ""
1140 "After creating the new namespace, it is useful for the child to change its "
1141 "root directory and mount a new procfs instance at I</proc> so that tools "
1142 "such as B<ps>(1)  work correctly.  (If B<CLONE_NEWNS> is also included in "
1143 "I<flags>, then it isn't necessary to change the root directory: a new procfs "
1144 "instance can be mounted directly over I</proc>.)"
1145 msgstr ""
1146
1147 #. type: Plain text
1148 #: build/C/man2/clone.2:481
1149 msgid ""
1150 "Use of this flag requires: a kernel configured with the B<CONFIG_PID_NS> "
1151 "option and that the process be privileged (B<CAP_SYS_ADMIN>).  This flag "
1152 "can't be specified in conjunction with B<CLONE_THREAD>."
1153 msgstr ""
1154
1155 #. type: TP
1156 #: build/C/man2/clone.2:481 build/C/man2/unshare.2:149
1157 #, no-wrap
1158 msgid "B<CLONE_NEWUTS> (since Linux 2.6.19)"
1159 msgstr ""
1160
1161 #. type: Plain text
1162 #: build/C/man2/clone.2:493
1163 msgid ""
1164 "If B<CLONE_NEWUTS> is set, then create the process in a new UTS namespace, "
1165 "whose identifiers are initialized by duplicating the identifiers from the "
1166 "UTS namespace of the calling process.  If this flag is not set, then (as "
1167 "with B<fork>(2)), the process is created in the same UTS namespace as the "
1168 "calling process.  This flag is intended for the implementation of "
1169 "containers."
1170 msgstr ""
1171
1172 #. type: Plain text
1173 #: build/C/man2/clone.2:505
1174 msgid ""
1175 "A UTS namespace is the set of identifiers returned by B<uname>(2); among "
1176 "these, the domain name and the host name can be modified by "
1177 "B<setdomainname>(2)  and B<sethostname>(2), respectively.  Changes made to "
1178 "the identifiers in a UTS namespace are visible to all other processes in the "
1179 "same namespace, but are not visible to processes in other UTS namespaces."
1180 msgstr ""
1181
1182 #. type: Plain text
1183 #: build/C/man2/clone.2:510
1184 msgid ""
1185 "Use of this flag requires: a kernel configured with the B<CONFIG_UTS_NS> "
1186 "option and that the process be privileged (B<CAP_SYS_ADMIN>)."
1187 msgstr ""
1188
1189 #. type: TP
1190 #: build/C/man2/clone.2:510
1191 #, no-wrap
1192 msgid "B<CLONE_PARENT> (since Linux 2.3.12)"
1193 msgstr ""
1194
1195 #. type: Plain text
1196 #: build/C/man2/clone.2:517
1197 msgid ""
1198 "If B<CLONE_PARENT> is set, then the parent of the new child (as returned by "
1199 "B<getppid>(2))  will be the same as that of the calling process."
1200 msgstr ""
1201
1202 #. type: Plain text
1203 #: build/C/man2/clone.2:523
1204 msgid ""
1205 "If B<CLONE_PARENT> is not set, then (as with B<fork>(2))  the child's parent "
1206 "is the calling process."
1207 msgstr ""
1208
1209 #. type: Plain text
1210 #: build/C/man2/clone.2:531
1211 msgid ""
1212 "Note that it is the parent process, as returned by B<getppid>(2), which is "
1213 "signaled when the child terminates, so that if B<CLONE_PARENT> is set, then "
1214 "the parent of the calling process, rather than the calling process itself, "
1215 "will be signaled."
1216 msgstr ""
1217
1218 #. type: TP
1219 #: build/C/man2/clone.2:531
1220 #, no-wrap
1221 msgid "B<CLONE_PARENT_SETTID> (since Linux 2.5.49)"
1222 msgstr ""
1223
1224 #. type: Plain text
1225 #: build/C/man2/clone.2:539
1226 msgid ""
1227 "Store child thread ID at location I<ptid> in parent and child memory.  (In "
1228 "Linux 2.5.32-2.5.48 there was a flag B<CLONE_SETTID> that did this.)"
1229 msgstr ""
1230
1231 #. type: TP
1232 #: build/C/man2/clone.2:539
1233 #, no-wrap
1234 msgid "B<CLONE_PID> (obsolete)"
1235 msgstr ""
1236
1237 #. type: Plain text
1238 #: build/C/man2/clone.2:550
1239 msgid ""
1240 "If B<CLONE_PID> is set, the child process is created with the same process "
1241 "ID as the calling process.  This is good for hacking the system, but "
1242 "otherwise of not much use.  Since 2.3.21 this flag can be specified only by "
1243 "the system boot process (PID 0).  It disappeared in Linux 2.5.16."
1244 msgstr ""
1245
1246 #. type: TP
1247 #: build/C/man2/clone.2:550
1248 #, no-wrap
1249 msgid "B<CLONE_PTRACE> (since Linux 2.2)"
1250 msgstr ""
1251
1252 #. type: Plain text
1253 #: build/C/man2/clone.2:557
1254 msgid ""
1255 "If B<CLONE_PTRACE> is specified, and the calling process is being traced, "
1256 "then trace the child also (see B<ptrace>(2))."
1257 msgstr ""
1258
1259 #. type: TP
1260 #: build/C/man2/clone.2:557
1261 #, no-wrap
1262 msgid "B<CLONE_SETTLS> (since Linux 2.5.32)"
1263 msgstr ""
1264
1265 #. type: Plain text
1266 #: build/C/man2/clone.2:564
1267 msgid ""
1268 "The I<newtls> argument is the new TLS (Thread Local Storage) descriptor.  "
1269 "(See B<set_thread_area>(2).)"
1270 msgstr ""
1271
1272 #. type: TP
1273 #: build/C/man2/clone.2:564
1274 #, no-wrap
1275 msgid "B<CLONE_SIGHAND> (since Linux 2.0)"
1276 msgstr ""
1277
1278 #. type: Plain text
1279 #: build/C/man2/clone.2:580
1280 msgid ""
1281 "If B<CLONE_SIGHAND> is set, the calling process and the child process share "
1282 "the same table of signal handlers.  If the calling process or child process "
1283 "calls B<sigaction>(2)  to change the behavior associated with a signal, the "
1284 "behavior is changed in the other process as well.  However, the calling "
1285 "process and child processes still have distinct signal masks and sets of "
1286 "pending signals.  So, one of them may block or unblock some signals using "
1287 "B<sigprocmask>(2)  without affecting the other process."
1288 msgstr ""
1289
1290 #. type: Plain text
1291 #: build/C/man2/clone.2:591
1292 msgid ""
1293 "If B<CLONE_SIGHAND> is not set, the child process inherits a copy of the "
1294 "signal handlers of the calling process at the time B<clone>()  is called.  "
1295 "Calls to B<sigaction>(2)  performed later by one of the processes have no "
1296 "effect on the other process."
1297 msgstr ""
1298
1299 #. type: Plain text
1300 #: build/C/man2/clone.2:599
1301 msgid ""
1302 "Since Linux 2.6.0-test6, I<flags> must also include B<CLONE_VM> if "
1303 "B<CLONE_SIGHAND> is specified"
1304 msgstr ""
1305
1306 #. type: TP
1307 #: build/C/man2/clone.2:599
1308 #, no-wrap
1309 msgid "B<CLONE_STOPPED> (since Linux 2.6.0-test2)"
1310 msgstr ""
1311
1312 #. type: Plain text
1313 #: build/C/man2/clone.2:608
1314 msgid ""
1315 "If B<CLONE_STOPPED> is set, then the child is initially stopped (as though "
1316 "it was sent a B<SIGSTOP> signal), and must be resumed by sending it a "
1317 "B<SIGCONT> signal."
1318 msgstr ""
1319
1320 #.  glibc 2.8 removed this defn from bits/sched.h
1321 #. type: Plain text
1322 #: build/C/man2/clone.2:616
1323 msgid ""
1324 "This flag was I<deprecated> from Linux 2.6.25 onward, and was I<removed> "
1325 "altogether in Linux 2.6.38."
1326 msgstr ""
1327
1328 #. type: TP
1329 #: build/C/man2/clone.2:616
1330 #, no-wrap
1331 msgid "B<CLONE_SYSVSEM> (since Linux 2.5.10)"
1332 msgstr ""
1333
1334 #. type: Plain text
1335 #: build/C/man2/clone.2:625
1336 msgid ""
1337 "If B<CLONE_SYSVSEM> is set, then the child and the calling process share a "
1338 "single list of System V semaphore undo values (see B<semop>(2)).  If this "
1339 "flag is not set, then the child has a separate undo list, which is initially "
1340 "empty."
1341 msgstr ""
1342
1343 #. type: TP
1344 #: build/C/man2/clone.2:625
1345 #, no-wrap
1346 msgid "B<CLONE_THREAD> (since Linux 2.4.0-test8)"
1347 msgstr ""
1348
1349 #. type: Plain text
1350 #: build/C/man2/clone.2:634
1351 msgid ""
1352 "If B<CLONE_THREAD> is set, the child is placed in the same thread group as "
1353 "the calling process.  To make the remainder of the discussion of "
1354 "B<CLONE_THREAD> more readable, the term \"thread\" is used to refer to the "
1355 "processes within a thread group."
1356 msgstr ""
1357
1358 #. type: Plain text
1359 #: build/C/man2/clone.2:642
1360 msgid ""
1361 "Thread groups were a feature added in Linux 2.4 to support the POSIX threads "
1362 "notion of a set of threads that share a single PID.  Internally, this shared "
1363 "PID is the so-called thread group identifier (TGID) for the thread group.  "
1364 "Since Linux 2.4, calls to B<getpid>(2)  return the TGID of the caller."
1365 msgstr ""
1366
1367 #. type: Plain text
1368 #: build/C/man2/clone.2:651
1369 msgid ""
1370 "The threads within a group can be distinguished by their (system-wide)  "
1371 "unique thread IDs (TID).  A new thread's TID is available as the function "
1372 "result returned to the caller of B<clone>(), and a thread can obtain its own "
1373 "TID using B<gettid>(2)."
1374 msgstr ""
1375
1376 #. type: Plain text
1377 #: build/C/man2/clone.2:661
1378 msgid ""
1379 "When a call is made to B<clone>()  without specifying B<CLONE_THREAD>, then "
1380 "the resulting thread is placed in a new thread group whose TGID is the same "
1381 "as the thread's TID.  This thread is the I<leader> of the new thread group."
1382 msgstr ""
1383
1384 #. type: Plain text
1385 #: build/C/man2/clone.2:683
1386 msgid ""
1387 "A new thread created with B<CLONE_THREAD> has the same parent process as the "
1388 "caller of B<clone>()  (i.e., like B<CLONE_PARENT>), so that calls to "
1389 "B<getppid>(2)  return the same value for all of the threads in a thread "
1390 "group.  When a B<CLONE_THREAD> thread terminates, the thread that created it "
1391 "using B<clone>()  is not sent a B<SIGCHLD> (or other termination) signal; "
1392 "nor can the status of such a thread be obtained using B<wait>(2).  (The "
1393 "thread is said to be I<detached>.)"
1394 msgstr ""
1395
1396 #. type: Plain text
1397 #: build/C/man2/clone.2:688
1398 msgid ""
1399 "After all of the threads in a thread group terminate the parent process of "
1400 "the thread group is sent a B<SIGCHLD> (or other termination) signal."
1401 msgstr ""
1402
1403 #. type: Plain text
1404 #: build/C/man2/clone.2:693
1405 msgid ""
1406 "If any of the threads in a thread group performs an B<execve>(2), then all "
1407 "threads other than the thread group leader are terminated, and the new "
1408 "program is executed in the thread group leader."
1409 msgstr ""
1410
1411 #. type: Plain text
1412 #: build/C/man2/clone.2:699
1413 msgid ""
1414 "If one of the threads in a thread group creates a child using B<fork>(2), "
1415 "then any thread in the group can B<wait>(2)  for that child."
1416 msgstr ""
1417
1418 #. type: Plain text
1419 #: build/C/man2/clone.2:707
1420 msgid ""
1421 "Since Linux 2.5.35, I<flags> must also include B<CLONE_SIGHAND> if "
1422 "B<CLONE_THREAD> is specified."
1423 msgstr ""
1424
1425 #. type: Plain text
1426 #: build/C/man2/clone.2:712
1427 msgid ""
1428 "Signals may be sent to a thread group as a whole (i.e., a TGID) using "
1429 "B<kill>(2), or to a specific thread (i.e., TID) using B<tgkill>(2)."
1430 msgstr ""
1431
1432 #. type: Plain text
1433 #: build/C/man2/clone.2:717
1434 msgid ""
1435 "Signal dispositions and actions are process-wide: if an unhandled signal is "
1436 "delivered to a thread, then it will affect (terminate, stop, continue, be "
1437 "ignored in)  all members of the thread group."
1438 msgstr ""
1439
1440 #. type: Plain text
1441 #: build/C/man2/clone.2:730
1442 msgid ""
1443 "Each thread has its own signal mask, as set by B<sigprocmask>(2), but "
1444 "signals can be pending either: for the whole process (i.e., deliverable to "
1445 "any member of the thread group), when sent with B<kill>(2); or for an "
1446 "individual thread, when sent with B<tgkill>(2).  A call to B<sigpending>(2)  "
1447 "returns a signal set that is the union of the signals pending for the whole "
1448 "process and the signals that are pending for the calling thread."
1449 msgstr ""
1450
1451 #. type: Plain text
1452 #: build/C/man2/clone.2:742
1453 msgid ""
1454 "If B<kill>(2)  is used to send a signal to a thread group, and the thread "
1455 "group has installed a handler for the signal, then the handler will be "
1456 "invoked in exactly one, arbitrarily selected member of the thread group that "
1457 "has not blocked the signal.  If multiple threads in a group are waiting to "
1458 "accept the same signal using B<sigwaitinfo>(2), the kernel will arbitrarily "
1459 "select one of these threads to receive a signal sent using B<kill>(2)."
1460 msgstr ""
1461
1462 #. type: TP
1463 #: build/C/man2/clone.2:742
1464 #, no-wrap
1465 msgid "B<CLONE_UNTRACED> (since Linux 2.5.46)"
1466 msgstr ""
1467
1468 #. type: Plain text
1469 #: build/C/man2/clone.2:749
1470 msgid ""
1471 "If B<CLONE_UNTRACED> is specified, then a tracing process cannot force "
1472 "B<CLONE_PTRACE> on this child process."
1473 msgstr ""
1474
1475 #. type: TP
1476 #: build/C/man2/clone.2:749
1477 #, no-wrap
1478 msgid "B<CLONE_VFORK> (since Linux 2.2)"
1479 msgstr ""
1480
1481 #. type: Plain text
1482 #: build/C/man2/clone.2:761
1483 msgid ""
1484 "If B<CLONE_VFORK> is set, the execution of the calling process is suspended "
1485 "until the child releases its virtual memory resources via a call to "
1486 "B<execve>(2)  or B<_exit>(2)  (as with B<vfork>(2))."
1487 msgstr ""
1488
1489 #. type: Plain text
1490 #: build/C/man2/clone.2:767
1491 msgid ""
1492 "If B<CLONE_VFORK> is not set then both the calling process and the child are "
1493 "schedulable after the call, and an application should not rely on execution "
1494 "occurring in any particular order."
1495 msgstr ""
1496
1497 #. type: TP
1498 #: build/C/man2/clone.2:767
1499 #, no-wrap
1500 msgid "B<CLONE_VM> (since Linux 2.0)"
1501 msgstr ""
1502
1503 #. type: Plain text
1504 #: build/C/man2/clone.2:780
1505 msgid ""
1506 "If B<CLONE_VM> is set, the calling process and the child process run in the "
1507 "same memory space.  In particular, memory writes performed by the calling "
1508 "process or by the child process are also visible in the other process.  "
1509 "Moreover, any memory mapping or unmapping performed with B<mmap>(2)  or "
1510 "B<munmap>(2)  by the child or calling process also affects the other "
1511 "process."
1512 msgstr ""
1513
1514 #. type: Plain text
1515 #: build/C/man2/clone.2:789
1516 msgid ""
1517 "If B<CLONE_VM> is not set, the child process runs in a separate copy of the "
1518 "memory space of the calling process at the time of B<clone>().  Memory "
1519 "writes or file mappings/unmappings performed by one of the processes do not "
1520 "affect the other, as with B<fork>(2)."
1521 msgstr ""
1522
1523 #. type: SS
1524 #: build/C/man2/clone.2:789
1525 #, no-wrap
1526 msgid "The raw system call interface"
1527 msgstr ""
1528
1529 #. type: Plain text
1530 #: build/C/man2/clone.2:805
1531 msgid ""
1532 "The raw B<clone>()  system call corresponds more closely to B<fork>(2)  in "
1533 "that execution in the child continues from the point of the call.  As such, "
1534 "the I<fn> and I<arg> arguments of the B<clone>()  wrapper function are "
1535 "omitted.  Furthermore, the argument order changes.  The raw system call "
1536 "interface on x86 and many other architectures is roughly:"
1537 msgstr ""
1538
1539 #. type: Plain text
1540 #: build/C/man2/clone.2:811
1541 #, no-wrap
1542 msgid ""
1543 "B<long clone(unsigned long >I<flags>B<, void *>I<child_stack>B<,>\n"
1544 "B<           void *>I<ptid>B<, void *>I<ctid>B<,>\n"
1545 "B<           struct pt_regs *>I<regs>B<);>\n"
1546 msgstr ""
1547
1548 #. type: Plain text
1549 #: build/C/man2/clone.2:822
1550 msgid ""
1551 "Another difference for the raw system call is that the I<child_stack> "
1552 "argument may be zero, in which case copy-on-write semantics ensure that the "
1553 "child gets separate copies of stack pages when either process modifies the "
1554 "stack.  In this case, for correct operation, the B<CLONE_VM> option should "
1555 "not be specified."
1556 msgstr ""
1557
1558 #. type: Plain text
1559 #: build/C/man2/clone.2:830
1560 msgid ""
1561 "For some architectures, the order of the arguments for the system call "
1562 "differs from that shown above.  On the score, microblaze, ARM, ARM 64, "
1563 "PA-RISC, arc, Power PC, xtensa, and MIPS architectures, the order of the "
1564 "fourth and fifth arguments is reversed.  On the cris and s390 architectures, "
1565 "the order of the first and second arguments is reversed."
1566 msgstr ""
1567
1568 #. type: SS
1569 #: build/C/man2/clone.2:830
1570 #, no-wrap
1571 msgid "blackfin, m68k, and sparc"
1572 msgstr ""
1573
1574 #. type: Plain text
1575 #: build/C/man2/clone.2:834
1576 msgid ""
1577 "The argument-passing conventions on blackfin, m68k, and sparc are different "
1578 "from descriptions above.  For details, see the kernel (and glibc) source."
1579 msgstr ""
1580
1581 #. type: SS
1582 #: build/C/man2/clone.2:834
1583 #, no-wrap
1584 msgid "ia64"
1585 msgstr ""
1586
1587 #. type: Plain text
1588 #: build/C/man2/clone.2:836
1589 msgid "On ia64, a different interface is used:"
1590 msgstr ""
1591
1592 #. type: Plain text
1593 #: build/C/man2/clone.2:843
1594 #, no-wrap
1595 msgid ""
1596 "B<int __clone2(int (*>I<fn>B<)(void *), >\n"
1597 "B<             void *>I<child_stack_base>B<, size_t >I<stack_size>B<,>\n"
1598 "B<             int >I<flags>B<, void *>I<arg>B<, ... >\n"
1599 "B<          /* pid_t *>I<ptid>B<, struct user_desc *>I<tls>B<, pid_t "
1600 "*>I<ctid>B< */ );>\n"
1601 msgstr ""
1602
1603 #. type: Plain text
1604 #: build/C/man2/clone.2:855
1605 msgid ""
1606 "The prototype shown above is for the glibc wrapper function; the raw system "
1607 "call interface has no I<fn> or I<arg> argument, and changes the order of the "
1608 "arguments so that I<flags> is the first argument, and I<tls> is the last "
1609 "argument."
1610 msgstr ""
1611
1612 #. type: Plain text
1613 #: build/C/man2/clone.2:866
1614 msgid ""
1615 "B<__clone2>()  operates in the same way as B<clone>(), except that "
1616 "I<child_stack_base> points to the lowest address of the child's stack area, "
1617 "and I<stack_size> specifies the size of the stack pointed to by "
1618 "I<child_stack_base>."
1619 msgstr ""
1620
1621 #. type: SS
1622 #: build/C/man2/clone.2:866
1623 #, no-wrap
1624 msgid "Linux 2.4 and earlier"
1625 msgstr ""
1626
1627 #. type: Plain text
1628 #: build/C/man2/clone.2:874
1629 msgid ""
1630 "In Linux 2.4 and earlier, B<clone>()  does not take arguments I<ptid>, "
1631 "I<tls>, and I<ctid>."
1632 msgstr ""
1633
1634 #.  gettid(2) returns current->pid;
1635 #.  getpid(2) returns current->tgid;
1636 #. type: Plain text
1637 #: build/C/man2/clone.2:883
1638 msgid ""
1639 "On success, the thread ID of the child process is returned in the caller's "
1640 "thread of execution.  On failure, -1 is returned in the caller's context, no "
1641 "child process will be created, and I<errno> will be set appropriately."
1642 msgstr ""
1643
1644 #. type: SH
1645 #: build/C/man2/clone.2:883 build/C/man2/kcmp.2:167 build/C/man2/sched_get_priority_max.2:96 build/C/man3/sched_getcpu.3:65 build/C/man2/sched_rr_get_interval.2:80 build/C/man2/sched_setaffinity.2:116 build/C/man2/sched_setparam.2:96 build/C/man2/sched_setscheduler.2:432 build/C/man2/sched_yield.2:48 build/C/man2/setns.2:77 build/C/man2/unshare.2:212
1646 #, no-wrap
1647 msgid "ERRORS"
1648 msgstr ""
1649
1650 #. type: TP
1651 #: build/C/man2/clone.2:884
1652 #, no-wrap
1653 msgid "B<EAGAIN>"
1654 msgstr ""
1655
1656 #. type: Plain text
1657 #: build/C/man2/clone.2:887
1658 msgid "Too many processes are already running."
1659 msgstr ""
1660
1661 #. type: TP
1662 #: build/C/man2/clone.2:887 build/C/man2/clone.2:894 build/C/man2/clone.2:909 build/C/man2/clone.2:917 build/C/man2/clone.2:925 build/C/man2/clone.2:933 build/C/man2/clone.2:939 build/C/man2/clone.2:949 build/C/man2/clone.2:957 build/C/man2/clone.2:965 build/C/man2/kcmp.2:178 build/C/man2/sched_get_priority_max.2:97 build/C/man2/sched_rr_get_interval.2:84 build/C/man2/sched_setaffinity.2:120 build/C/man2/sched_setaffinity.2:128 build/C/man2/sched_setparam.2:97 build/C/man2/sched_setscheduler.2:433 build/C/man2/setns.2:82 build/C/man2/unshare.2:213
1663 #, no-wrap
1664 msgid "B<EINVAL>"
1665 msgstr ""
1666
1667 #. type: Plain text
1668 #: build/C/man2/clone.2:894
1669 msgid ""
1670 "B<CLONE_SIGHAND> was specified, but B<CLONE_VM> was not.  (Since Linux "
1671 "2.6.0-test6.)"
1672 msgstr ""
1673
1674 #.  .TP
1675 #.  .B EINVAL
1676 #.  Precisely one of
1677 #.  .B CLONE_DETACHED
1678 #.  and
1679 #.  .B CLONE_THREAD
1680 #.  was specified.
1681 #.  (Since Linux 2.6.0-test6.)
1682 #. type: Plain text
1683 #: build/C/man2/clone.2:909
1684 msgid ""
1685 "B<CLONE_THREAD> was specified, but B<CLONE_SIGHAND> was not.  (Since Linux "
1686 "2.5.35.)"
1687 msgstr ""
1688
1689 #. type: Plain text
1690 #: build/C/man2/clone.2:917
1691 msgid "Both B<CLONE_FS> and B<CLONE_NEWNS> were specified in I<flags>."
1692 msgstr ""
1693
1694 #. type: Plain text
1695 #: build/C/man2/clone.2:925
1696 msgid "Both B<CLONE_NEWIPC> and B<CLONE_SYSVSEM> were specified in I<flags>."
1697 msgstr ""
1698
1699 #. type: Plain text
1700 #: build/C/man2/clone.2:933
1701 msgid "Both B<CLONE_NEWPID> and B<CLONE_THREAD> were specified in I<flags>."
1702 msgstr ""
1703
1704 #. type: Plain text
1705 #: build/C/man2/clone.2:939
1706 msgid "Returned by B<clone>()  when a zero value is specified for I<child_stack>."
1707 msgstr ""
1708
1709 #. type: Plain text
1710 #: build/C/man2/clone.2:949
1711 msgid ""
1712 "B<CLONE_NEWIPC> was specified in I<flags>, but the kernel was not configured "
1713 "with the B<CONFIG_SYSVIPC> and B<CONFIG_IPC_NS> options."
1714 msgstr ""
1715
1716 #. type: Plain text
1717 #: build/C/man2/clone.2:957
1718 msgid ""
1719 "B<CLONE_NEWNET> was specified in I<flags>, but the kernel was not configured "
1720 "with the B<CONFIG_NET_NS> option."
1721 msgstr ""
1722
1723 #. type: Plain text
1724 #: build/C/man2/clone.2:965
1725 msgid ""
1726 "B<CLONE_NEWPID> was specified in I<flags>, but the kernel was not configured "
1727 "with the B<CONFIG_PID_NS> option."
1728 msgstr ""
1729
1730 #. type: Plain text
1731 #: build/C/man2/clone.2:973
1732 msgid ""
1733 "B<CLONE_NEWUTS> was specified in I<flags>, but the kernel was not configured "
1734 "with the B<CONFIG_UTS> option."
1735 msgstr ""
1736
1737 #. type: TP
1738 #: build/C/man2/clone.2:973 build/C/man2/setns.2:89 build/C/man2/unshare.2:217
1739 #, no-wrap
1740 msgid "B<ENOMEM>"
1741 msgstr ""
1742
1743 #. type: Plain text
1744 #: build/C/man2/clone.2:978
1745 msgid ""
1746 "Cannot allocate sufficient memory to allocate a task structure for the "
1747 "child, or to copy those parts of the caller's context that need to be "
1748 "copied."
1749 msgstr ""
1750
1751 #. type: TP
1752 #: build/C/man2/clone.2:978 build/C/man2/clone.2:987 build/C/man2/kcmp.2:182 build/C/man2/sched_setaffinity.2:135 build/C/man2/sched_setparam.2:101 build/C/man2/sched_setscheduler.2:438 build/C/man2/setns.2:92 build/C/man2/unshare.2:221
1753 #, no-wrap
1754 msgid "B<EPERM>"
1755 msgstr ""
1756
1757 #. type: Plain text
1758 #: build/C/man2/clone.2:987
1759 msgid ""
1760 "B<CLONE_NEWIPC>, B<CLONE_NEWNET>, B<CLONE_NEWNS>, B<CLONE_NEWPID>, or "
1761 "B<CLONE_NEWUTS> was specified by an unprivileged process (process without "
1762 "B<CAP_SYS_ADMIN>)."
1763 msgstr ""
1764
1765 #. type: Plain text
1766 #: build/C/man2/clone.2:991
1767 msgid "B<CLONE_PID> was specified by a process other than process 0."
1768 msgstr ""
1769
1770 #. type: Plain text
1771 #: build/C/man2/clone.2:998
1772 msgid ""
1773 "There is no entry for B<clone>()  in libc5.  glibc2 provides B<clone>()  as "
1774 "described in this manual page."
1775 msgstr ""
1776
1777 #. type: Plain text
1778 #: build/C/man2/clone.2:1002
1779 msgid ""
1780 "B<clone>()  is Linux-specific and should not be used in programs intended to "
1781 "be portable."
1782 msgstr ""
1783
1784 #. type: Plain text
1785 #: build/C/man2/clone.2:1012
1786 msgid ""
1787 "In the kernel 2.4.x series, B<CLONE_THREAD> generally does not make the "
1788 "parent of the new thread the same as the parent of the calling process.  "
1789 "However, for kernel versions 2.4.7 to 2.4.18 the B<CLONE_THREAD> flag "
1790 "implied the B<CLONE_PARENT> flag (as in kernel 2.6)."
1791 msgstr ""
1792
1793 #. type: Plain text
1794 #: build/C/man2/clone.2:1022
1795 msgid ""
1796 "For a while there was B<CLONE_DETACHED> (introduced in 2.5.32): parent wants "
1797 "no child-exit signal.  In 2.6.2 the need to give this together with "
1798 "B<CLONE_THREAD> disappeared.  This flag is still defined, but has no effect."
1799 msgstr ""
1800
1801 #. type: Plain text
1802 #: build/C/man2/clone.2:1027
1803 msgid ""
1804 "On i386, B<clone>()  should not be called through vsyscall, but directly "
1805 "through I<int $0x80>."
1806 msgstr ""
1807
1808 #. type: Plain text
1809 #: build/C/man2/clone.2:1058
1810 msgid ""
1811 "Versions of the GNU C library that include the NPTL threading library "
1812 "contain a wrapper function for B<getpid>(2)  that performs caching of PIDs.  "
1813 "This caching relies on support in the glibc wrapper for B<clone>(), but as "
1814 "currently implemented, the cache may not be up to date in some "
1815 "circumstances.  In particular, if a signal is delivered to the child "
1816 "immediately after the B<clone>()  call, then a call to B<getpid>(2)  in a "
1817 "handler for the signal may return the PID of the calling process (\"the "
1818 "parent\"), if the clone wrapper has not yet had a chance to update the PID "
1819 "cache in the child.  (This discussion ignores the case where the child was "
1820 "created using B<CLONE_THREAD>, when B<getpid>(2)  I<should> return the same "
1821 "value in the child and in the process that called B<clone>(), since the "
1822 "caller and the child are in the same thread group.  The stale-cache problem "
1823 "also does not occur if the I<flags> argument includes B<CLONE_VM>.)  To get "
1824 "the truth, it may be necessary to use code such as the following:"
1825 msgstr ""
1826
1827 #. type: Plain text
1828 #: build/C/man2/clone.2:1061
1829 #, no-wrap
1830 msgid "    #include E<lt>syscall.hE<gt>\n"
1831 msgstr ""
1832
1833 #. type: Plain text
1834 #: build/C/man2/clone.2:1063
1835 #, no-wrap
1836 msgid "    pid_t mypid;\n"
1837 msgstr ""
1838
1839 #. type: Plain text
1840 #: build/C/man2/clone.2:1065
1841 #, no-wrap
1842 msgid "    mypid = syscall(SYS_getpid);\n"
1843 msgstr ""
1844
1845 #. type: SS
1846 #: build/C/man2/clone.2:1070
1847 #, no-wrap
1848 msgid "Create a child that executes in a separate UTS namespace"
1849 msgstr ""
1850
1851 #. type: Plain text
1852 #: build/C/man2/clone.2:1080
1853 msgid ""
1854 "The following program demonstrates the use of B<clone>()  to create a child "
1855 "process that executes in a separate UTS namespace.  The child changes the "
1856 "hostname in its UTS namespace.  Both parent and child then display the "
1857 "system hostname, making it possible to see that the hostname differs in the "
1858 "UTS namespaces of the parent and child.  For an example of the use of this "
1859 "program, see B<setns>(2)."
1860 msgstr ""
1861
1862 #. type: Plain text
1863 #: build/C/man2/clone.2:1090
1864 #, no-wrap
1865 msgid ""
1866 "#define _GNU_SOURCE\n"
1867 "#include E<lt>sys/wait.hE<gt>\n"
1868 "#include E<lt>sys/utsname.hE<gt>\n"
1869 "#include E<lt>sched.hE<gt>\n"
1870 "#include E<lt>string.hE<gt>\n"
1871 "#include E<lt>stdio.hE<gt>\n"
1872 "#include E<lt>stdlib.hE<gt>\n"
1873 "#include E<lt>unistd.hE<gt>\n"
1874 msgstr ""
1875
1876 #. type: Plain text
1877 #: build/C/man2/clone.2:1093 build/C/man2/setns.2:177
1878 #, no-wrap
1879 msgid ""
1880 "#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \\e\n"
1881 "                        } while (0)\n"
1882 msgstr ""
1883
1884 #. type: Plain text
1885 #: build/C/man2/clone.2:1098
1886 #, no-wrap
1887 msgid ""
1888 "static int              /* Start function for cloned child */\n"
1889 "childFunc(void *arg)\n"
1890 "{\n"
1891 "    struct utsname uts;\n"
1892 msgstr ""
1893
1894 #. type: Plain text
1895 #: build/C/man2/clone.2:1100
1896 #, no-wrap
1897 msgid "    /* Change hostname in UTS namespace of child */\n"
1898 msgstr ""
1899
1900 #. type: Plain text
1901 #: build/C/man2/clone.2:1103
1902 #, no-wrap
1903 msgid ""
1904 "    if (sethostname(arg, strlen(arg)) == -1)\n"
1905 "        errExit(\"sethostname\");\n"
1906 msgstr ""
1907
1908 #. type: Plain text
1909 #: build/C/man2/clone.2:1105
1910 #, no-wrap
1911 msgid "    /* Retrieve and display hostname */\n"
1912 msgstr ""
1913
1914 #. type: Plain text
1915 #: build/C/man2/clone.2:1109
1916 #, no-wrap
1917 msgid ""
1918 "    if (uname(&uts) == -1)\n"
1919 "        errExit(\"uname\");\n"
1920 "    printf(\"uts.nodename in child:  %s\\en\", uts.nodename);\n"
1921 msgstr ""
1922
1923 #. type: Plain text
1924 #: build/C/man2/clone.2:1113
1925 #, no-wrap
1926 msgid ""
1927 "    /* Keep the namespace open for a while, by sleeping.\n"
1928 "       This allows some experimentation--for example, another\n"
1929 "       process might join the namespace. */\n"
1930 msgstr ""
1931
1932 #. type: Plain text
1933 #: build/C/man2/clone.2:1115
1934 #, no-wrap
1935 msgid "    sleep(200);\n"
1936 msgstr ""
1937
1938 #. type: Plain text
1939 #: build/C/man2/clone.2:1118
1940 #, no-wrap
1941 msgid ""
1942 "    return 0;           /* Child terminates now */\n"
1943 "}\n"
1944 msgstr ""
1945
1946 #. type: Plain text
1947 #: build/C/man2/clone.2:1120
1948 #, no-wrap
1949 msgid "#define STACK_SIZE (1024 * 1024)    /* Stack size for cloned child */\n"
1950 msgstr ""
1951
1952 #. type: Plain text
1953 #: build/C/man2/clone.2:1128
1954 #, no-wrap
1955 msgid ""
1956 "int\n"
1957 "main(int argc, char *argv[])\n"
1958 "{\n"
1959 "    char *stack;                    /* Start of stack buffer */\n"
1960 "    char *stackTop;                 /* End of stack buffer */\n"
1961 "    pid_t pid;\n"
1962 "    struct utsname uts;\n"
1963 msgstr ""
1964
1965 #. type: Plain text
1966 #: build/C/man2/clone.2:1133
1967 #, no-wrap
1968 msgid ""
1969 "    if (argc E<lt> 2) {\n"
1970 "        fprintf(stderr, \"Usage: %s E<lt>child-hostnameE<gt>\\en\", "
1971 "argv[0]);\n"
1972 "        exit(EXIT_SUCCESS);\n"
1973 "    }\n"
1974 msgstr ""
1975
1976 #. type: Plain text
1977 #: build/C/man2/clone.2:1135
1978 #, no-wrap
1979 msgid "    /* Allocate stack for child */\n"
1980 msgstr ""
1981
1982 #. type: Plain text
1983 #: build/C/man2/clone.2:1140
1984 #, no-wrap
1985 msgid ""
1986 "    stack = malloc(STACK_SIZE);\n"
1987 "    if (stack == NULL)\n"
1988 "        errExit(\"malloc\");\n"
1989 "    stackTop = stack + STACK_SIZE;  /* Assume stack grows downward */\n"
1990 msgstr ""
1991
1992 #. type: Plain text
1993 #: build/C/man2/clone.2:1143
1994 #, no-wrap
1995 msgid ""
1996 "    /* Create child that has its own UTS namespace;\n"
1997 "       child commences execution in childFunc() */\n"
1998 msgstr ""
1999
2000 #. type: Plain text
2001 #: build/C/man2/clone.2:1148
2002 #, no-wrap
2003 msgid ""
2004 "    pid = clone(childFunc, stackTop, CLONE_NEWUTS | SIGCHLD, argv[1]);\n"
2005 "    if (pid == -1)\n"
2006 "        errExit(\"clone\");\n"
2007 "    printf(\"clone() returned %ld\\en\", (long) pid);\n"
2008 msgstr ""
2009
2010 #. type: Plain text
2011 #: build/C/man2/clone.2:1150
2012 #, no-wrap
2013 msgid "    /* Parent falls through to here */\n"
2014 msgstr ""
2015
2016 #. type: Plain text
2017 #: build/C/man2/clone.2:1152
2018 #, no-wrap
2019 msgid "    sleep(1);           /* Give child time to change its hostname */\n"
2020 msgstr ""
2021
2022 #. type: Plain text
2023 #: build/C/man2/clone.2:1155
2024 #, no-wrap
2025 msgid ""
2026 "    /* Display hostname in parent\\(aqs UTS namespace. This will be\n"
2027 "       different from hostname in child\\(aqs UTS namespace. */\n"
2028 msgstr ""
2029
2030 #. type: Plain text
2031 #: build/C/man2/clone.2:1159
2032 #, no-wrap
2033 msgid ""
2034 "    if (uname(&uts) == -1)\n"
2035 "        errExit(\"uname\");\n"
2036 "    printf(\"uts.nodename in parent: %s\\en\", uts.nodename);\n"
2037 msgstr ""
2038
2039 #. type: Plain text
2040 #: build/C/man2/clone.2:1163
2041 #, no-wrap
2042 msgid ""
2043 "    if (waitpid(pid, NULL, 0) == -1)    /* Wait for child */\n"
2044 "        errExit(\"waitpid\");\n"
2045 "    printf(\"child has terminated\\en\");\n"
2046 msgstr ""
2047
2048 #. type: Plain text
2049 #: build/C/man2/clone.2:1166
2050 #, no-wrap
2051 msgid ""
2052 "    exit(EXIT_SUCCESS);\n"
2053 "}\n"
2054 msgstr ""
2055
2056 #. type: Plain text
2057 #: build/C/man2/clone.2:1181
2058 msgid ""
2059 "B<fork>(2), B<futex>(2), B<getpid>(2), B<gettid>(2), B<kcmp>(2), "
2060 "B<set_thread_area>(2), B<set_tid_address>(2), B<setns>(2), B<tkill>(2), "
2061 "B<unshare>(2), B<wait>(2), B<capabilities>(7), B<pthreads>(7)"
2062 msgstr ""
2063
2064 #. type: TH
2065 #: build/C/man2/kcmp.2:28
2066 #, no-wrap
2067 msgid "KCMP"
2068 msgstr ""
2069
2070 #. type: TH
2071 #: build/C/man2/kcmp.2:28
2072 #, no-wrap
2073 msgid "2013-01-27"
2074 msgstr ""
2075
2076 #. type: Plain text
2077 #: build/C/man2/kcmp.2:31
2078 msgid "kcmp - compare two processes to determine if they share a kernel resource"
2079 msgstr ""
2080
2081 #. type: Plain text
2082 #: build/C/man2/kcmp.2:34
2083 #, no-wrap
2084 msgid "B<#include E<lt>linux/kcmp.hE<gt>>\n"
2085 msgstr ""
2086
2087 #. type: Plain text
2088 #: build/C/man2/kcmp.2:37
2089 #, no-wrap
2090 msgid ""
2091 "B<int kcmp(pid_t >I<pid1>B<, pid_t >I<pid2>B<, int >I<type>B<,>\n"
2092 "B<         unsigned long >I<idx1>B<, unsigned long >I<idx2>B<);>\n"
2093 msgstr ""
2094
2095 #. type: Plain text
2096 #: build/C/man2/kcmp.2:41
2097 msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
2098 msgstr ""
2099
2100 #. type: Plain text
2101 #: build/C/man2/kcmp.2:50
2102 msgid ""
2103 "The B<kcmp>()  system call can be used to check whether the two processes "
2104 "identified by I<pid1> and I<pid2> share a kernel resource such as virtual "
2105 "memory, file descriptors, and so on."
2106 msgstr ""
2107
2108 #. type: Plain text
2109 #: build/C/man2/kcmp.2:55
2110 msgid ""
2111 "The I<type> argument specifies which resource is to be compared in the two "
2112 "processes.  It has one of the following values:"
2113 msgstr ""
2114
2115 #. type: TP
2116 #: build/C/man2/kcmp.2:55
2117 #, no-wrap
2118 msgid "B<KCMP_FILE>"
2119 msgstr ""
2120
2121 #. type: Plain text
2122 #: build/C/man2/kcmp.2:67
2123 msgid ""
2124 "Check whether a file descriptor I<idx1> in the process I<pid1> refers to the "
2125 "same open file description (see B<open>(2))  as file descriptor I<idx2> in "
2126 "the process I<pid2>."
2127 msgstr ""
2128
2129 #. type: TP
2130 #: build/C/man2/kcmp.2:67
2131 #, no-wrap
2132 msgid "B<KCMP_FILES>"
2133 msgstr ""
2134
2135 #. type: Plain text
2136 #: build/C/man2/kcmp.2:75
2137 msgid ""
2138 "Check whether the process share the same set of open file descriptors.  The "
2139 "arguments I<idx1> and I<idx2> are ignored."
2140 msgstr ""
2141
2142 #. type: TP
2143 #: build/C/man2/kcmp.2:75
2144 #, no-wrap
2145 msgid "B<KCMP_FS>"
2146 msgstr ""
2147
2148 #. type: Plain text
2149 #: build/C/man2/kcmp.2:84
2150 msgid ""
2151 "Check whether the processes share the same file system information (i.e., "
2152 "file mode creation mask, working directory, and file system root).  The "
2153 "arguments I<idx1> and I<idx2> are ignored."
2154 msgstr ""
2155
2156 #. type: TP
2157 #: build/C/man2/kcmp.2:84
2158 #, no-wrap
2159 msgid "B<KCMP_IO>"
2160 msgstr ""
2161
2162 #. type: Plain text
2163 #: build/C/man2/kcmp.2:92
2164 msgid ""
2165 "Check whether the processes share I/O context.  The arguments I<idx1> and "
2166 "I<idx2> are ignored."
2167 msgstr ""
2168
2169 #. type: TP
2170 #: build/C/man2/kcmp.2:92
2171 #, no-wrap
2172 msgid "B<KCMP_SIGHAND>"
2173 msgstr ""
2174
2175 #. type: Plain text
2176 #: build/C/man2/kcmp.2:100
2177 msgid ""
2178 "Check whether the processes share the same table of signal dispositions.  "
2179 "The arguments I<idx1> and I<idx2> are ignored."
2180 msgstr ""
2181
2182 #. type: TP
2183 #: build/C/man2/kcmp.2:100
2184 #, no-wrap
2185 msgid "B<KCMP_SYSVSEM>"
2186 msgstr ""
2187
2188 #. type: Plain text
2189 #: build/C/man2/kcmp.2:109
2190 msgid ""
2191 "Check whether the processes share the same list of System V semaphore undo "
2192 "operations.  The arguments I<idx1> and I<idx2> are ignored."
2193 msgstr ""
2194
2195 #. type: TP
2196 #: build/C/man2/kcmp.2:109
2197 #, no-wrap
2198 msgid "B<KCMP_VM>"
2199 msgstr ""
2200
2201 #. type: Plain text
2202 #: build/C/man2/kcmp.2:117
2203 msgid ""
2204 "Check whether the processes share the same address space.  The arguments "
2205 "I<idx1> and I<idx2> are ignored."
2206 msgstr ""
2207
2208 #. type: Plain text
2209 #: build/C/man2/kcmp.2:124
2210 msgid ""
2211 "Note the B<kcmp>()  is not protected against false positives which may have "
2212 "place if tasks are running.  Which means one should stop tasks being "
2213 "inspected with this syscall to obtain meaningful results."
2214 msgstr ""
2215
2216 #. type: Plain text
2217 #: build/C/man2/kcmp.2:130
2218 msgid ""
2219 "The return value of a successful call to B<kcmp>()  is simply the result of "
2220 "arithmetic comparison of kernel pointers (when the kernel compares "
2221 "resources, it uses their memory addresses)."
2222 msgstr ""
2223
2224 #. type: Plain text
2225 #: build/C/man2/kcmp.2:138
2226 msgid ""
2227 "The easiest way to explain is to consider an example.  Suppose that I<v1> "
2228 "and I<v2> are the addresses of appropriate resources, then the return value "
2229 "is one of the following:"
2230 msgstr ""
2231
2232 #. type: IP
2233 #: build/C/man2/kcmp.2:139
2234 #, no-wrap
2235 msgid "0"
2236 msgstr ""
2237
2238 #. type: Plain text
2239 #: build/C/man2/kcmp.2:144
2240 msgid ""
2241 "I<v1> is equal to I<v2>; in other words, the two processes share the "
2242 "resource."
2243 msgstr ""
2244
2245 #. type: IP
2246 #: build/C/man2/kcmp.2:144
2247 #, no-wrap
2248 msgid "1"
2249 msgstr ""
2250
2251 #. type: Plain text
2252 #: build/C/man2/kcmp.2:148
2253 msgid "I<v1> is less than I<v2>."
2254 msgstr ""
2255
2256 #. type: IP
2257 #: build/C/man2/kcmp.2:148
2258 #, no-wrap
2259 msgid "2"
2260 msgstr ""
2261
2262 #. type: Plain text
2263 #: build/C/man2/kcmp.2:152
2264 msgid "I<v1> is greater than I<v2>."
2265 msgstr ""
2266
2267 #. type: IP
2268 #: build/C/man2/kcmp.2:152
2269 #, no-wrap
2270 msgid "3"
2271 msgstr ""
2272
2273 #. type: Plain text
2274 #: build/C/man2/kcmp.2:157
2275 msgid "I<v1> is not equal to I<v2>, but ordering information is unavailable."
2276 msgstr ""
2277
2278 #. type: Plain text
2279 #: build/C/man2/kcmp.2:162
2280 msgid "On error, -1 is returned, and I<errno> is set appropriately."
2281 msgstr ""
2282
2283 #. type: Plain text
2284 #: build/C/man2/kcmp.2:167
2285 msgid ""
2286 "B<kcmp ()> was designed to return values suitable for sorting.  This is "
2287 "particularly handy if one needs to compare a large number of file "
2288 "descriptors."
2289 msgstr ""
2290
2291 #. type: TP
2292 #: build/C/man2/kcmp.2:168 build/C/man2/setns.2:78
2293 #, no-wrap
2294 msgid "B<EBADF>"
2295 msgstr ""
2296
2297 #. type: Plain text
2298 #: build/C/man2/kcmp.2:178
2299 msgid "I<type> is B<KCMP_FILE> and I<fd1> or I<fd2> is not an open file descriptor."
2300 msgstr ""
2301
2302 #. type: Plain text
2303 #: build/C/man2/kcmp.2:182
2304 msgid "I<type> is invalid."
2305 msgstr ""
2306
2307 #. type: Plain text
2308 #: build/C/man2/kcmp.2:188
2309 msgid ""
2310 "Insufficient permission to inspect process resources.  The B<CAP_SYS_PTRACE> "
2311 "capability is required to inspect processes that you do not own."
2312 msgstr ""
2313
2314 #. type: TP
2315 #: build/C/man2/kcmp.2:188 build/C/man2/sched_rr_get_interval.2:90 build/C/man2/sched_setaffinity.2:145 build/C/man2/sched_setparam.2:107 build/C/man2/sched_setscheduler.2:441
2316 #, no-wrap
2317 msgid "B<ESRCH>"
2318 msgstr ""
2319
2320 #. type: Plain text
2321 #: build/C/man2/kcmp.2:195
2322 msgid "Process I<pid1> or I<pid2> does not exist."
2323 msgstr ""
2324
2325 #. type: Plain text
2326 #: build/C/man2/kcmp.2:199
2327 msgid "The B<kcmp>()  system call first appeared in Linux 3.5."
2328 msgstr ""
2329
2330 #. type: Plain text
2331 #: build/C/man2/kcmp.2:202
2332 msgid ""
2333 "B<kcmp>()  is Linux specific and should not be used in programs intended to "
2334 "be portable."
2335 msgstr ""
2336
2337 #. type: Plain text
2338 #: build/C/man2/kcmp.2:205
2339 msgid ""
2340 "Glibc does not provide a wrapper for this system call; call it using "
2341 "B<syscall>(2)."
2342 msgstr ""
2343
2344 #. type: Plain text
2345 #: build/C/man2/kcmp.2:214
2346 msgid ""
2347 "This system call is available only if the kernel was configured with "
2348 "B<CONFIG_CHECKPOINT_RESTORE>.  The main use of the system call is for the "
2349 "checkpoint/restore in user space (CRIU) feature.  The alternative to this "
2350 "system call would have been to expose suitable process information via the "
2351 "B<proc>(5)  file system; this was deemed to be unsuitable for security "
2352 "reasons."
2353 msgstr ""
2354
2355 #. type: Plain text
2356 #: build/C/man2/kcmp.2:219
2357 msgid ""
2358 "See B<clone>(2)  for some background information on the shared resources "
2359 "referred to on this page."
2360 msgstr ""
2361
2362 #. type: Plain text
2363 #: build/C/man2/kcmp.2:222
2364 msgid "B<clone>(2), B<unshare>(2)"
2365 msgstr ""
2366
2367 #. type: TH
2368 #: build/C/man2/sched_get_priority_max.2:29
2369 #, no-wrap
2370 msgid "SCHED_GET_PRIORITY_MAX"
2371 msgstr ""
2372
2373 #. type: TH
2374 #: build/C/man2/sched_get_priority_max.2:29
2375 #, no-wrap
2376 msgid "2006-03-23"
2377 msgstr ""
2378
2379 #. type: Plain text
2380 #: build/C/man2/sched_get_priority_max.2:32
2381 msgid "sched_get_priority_max, sched_get_priority_min - get static priority range"
2382 msgstr ""
2383
2384 #. type: Plain text
2385 #: build/C/man2/sched_get_priority_max.2:34 build/C/man2/sched_rr_get_interval.2:34 build/C/man2/sched_yield.2:34
2386 msgid "B<#include E<lt>sched.hE<gt>>"
2387 msgstr ""
2388
2389 #. type: Plain text
2390 #: build/C/man2/sched_get_priority_max.2:36
2391 msgid "B<int sched_get_priority_max(int >I<policy>B<);>"
2392 msgstr ""
2393
2394 #. type: Plain text
2395 #: build/C/man2/sched_get_priority_max.2:38
2396 msgid "B<int sched_get_priority_min(int >I<policy>B<);>"
2397 msgstr ""
2398
2399 #. type: Plain text
2400 #: build/C/man2/sched_get_priority_max.2:54
2401 msgid ""
2402 "B<sched_get_priority_max>()  returns the maximum priority value that can be "
2403 "used with the scheduling algorithm identified by I<policy>.  "
2404 "B<sched_get_priority_min>()  returns the minimum priority value that can be "
2405 "used with the scheduling algorithm identified by I<policy>.  Supported "
2406 "I<policy> values are B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER>, and "
2407 "B<SCHED_BATCH>.  Further details about these policies can be found in "
2408 "B<sched_setscheduler>(2)."
2409 msgstr ""
2410
2411 #. type: Plain text
2412 #: build/C/man2/sched_get_priority_max.2:63
2413 msgid ""
2414 "Processes with numerically higher priority values are scheduled before "
2415 "processes with numerically lower priority values.  Thus, the value returned "
2416 "by B<sched_get_priority_max>()  will be greater than the value returned by "
2417 "B<sched_get_priority_min>()."
2418 msgstr ""
2419
2420 #. type: Plain text
2421 #: build/C/man2/sched_get_priority_max.2:69
2422 msgid ""
2423 "Linux allows the static priority value range 1 to 99 for B<SCHED_FIFO> and "
2424 "B<SCHED_RR> and the priority 0 for B<SCHED_OTHER> and B<SCHED_BATCH>.  "
2425 "Scheduling priority ranges for the various policies are not alterable."
2426 msgstr ""
2427
2428 #. type: Plain text
2429 #: build/C/man2/sched_get_priority_max.2:78
2430 msgid ""
2431 "The range of scheduling priorities may vary on other POSIX systems, thus it "
2432 "is a good idea for portable applications to use a virtual priority range and "
2433 "map it to the interval given by B<sched_get_priority_max>()  and "
2434 "B<sched_get_priority_min>().  POSIX.1-2001 requires a spread of at least 32 "
2435 "between the maximum and the minimum values for B<SCHED_FIFO> and "
2436 "B<SCHED_RR>."
2437 msgstr ""
2438
2439 #. type: Plain text
2440 #: build/C/man2/sched_get_priority_max.2:86
2441 msgid ""
2442 "POSIX systems on which B<sched_get_priority_max>()  and "
2443 "B<sched_get_priority_min>()  are available define "
2444 "B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
2445 msgstr ""
2446
2447 #. type: Plain text
2448 #: build/C/man2/sched_get_priority_max.2:96
2449 msgid ""
2450 "On success, B<sched_get_priority_max>()  and B<sched_get_priority_min>()  "
2451 "return the maximum/minimum priority value for the named scheduling policy.  "
2452 "On error, -1 is returned, and I<errno> is set appropriately."
2453 msgstr ""
2454
2455 #. type: Plain text
2456 #: build/C/man2/sched_get_priority_max.2:100
2457 msgid "The argument I<policy> does not identify a defined scheduling policy."
2458 msgstr ""
2459
2460 #. type: Plain text
2461 #: build/C/man2/sched_get_priority_max.2:102 build/C/man2/sched_rr_get_interval.2:96 build/C/man2/sched_setparam.2:112 build/C/man2/sched_yield.2:54
2462 msgid "POSIX.1-2001."
2463 msgstr ""
2464
2465 #. type: Plain text
2466 #: build/C/man2/sched_get_priority_max.2:111
2467 msgid ""
2468 "B<sched_getaffinity>(2), B<sched_getparam>(2), B<sched_getscheduler>(2), "
2469 "B<sched_setaffinity>(2), B<sched_setparam>(2), B<sched_setscheduler>(2)"
2470 msgstr ""
2471
2472 #. type: Plain text
2473 #: build/C/man2/sched_get_priority_max.2:114 build/C/man2/sched_rr_get_interval.2:138 build/C/man2/sched_setparam.2:134 build/C/man2/sched_setscheduler.2:563 build/C/man2/sched_yield.2:84
2474 msgid ""
2475 "I<Programming for the real world - POSIX.4> by Bill O. Gallmeister, O'Reilly "
2476 "& Associates, Inc., ISBN 1-56592-074-0."
2477 msgstr ""
2478
2479 #. type: TH
2480 #: build/C/man3/sched_getcpu.3:26
2481 #, no-wrap
2482 msgid "SCHED_GETCPU"
2483 msgstr ""
2484
2485 #. type: TH
2486 #: build/C/man3/sched_getcpu.3:26 build/C/man2/unshare.2:20
2487 #, no-wrap
2488 msgid "2013-04-17"
2489 msgstr ""
2490
2491 #. type: Plain text
2492 #: build/C/man3/sched_getcpu.3:29
2493 msgid "sched_getcpu - determine CPU on which the calling thread is running"
2494 msgstr ""
2495
2496 #. type: Plain text
2497 #: build/C/man3/sched_getcpu.3:34
2498 #, no-wrap
2499 msgid "B<int sched_getcpu(void);>\n"
2500 msgstr ""
2501
2502 #. type: Plain text
2503 #: build/C/man3/sched_getcpu.3:39 build/C/man2/unshare.2:33
2504 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
2505 msgstr ""
2506
2507 #. type: Plain text
2508 #: build/C/man3/sched_getcpu.3:42
2509 msgid "B<sched_getcpu>():"
2510 msgstr ""
2511
2512 #. type: Plain text
2513 #: build/C/man3/sched_getcpu.3:58
2514 msgid ""
2515 "B<sched_getcpu>()  returns the number of the CPU on which the calling thread "
2516 "is currently executing."
2517 msgstr ""
2518
2519 #. type: Plain text
2520 #: build/C/man3/sched_getcpu.3:65
2521 msgid ""
2522 "On success, B<sched_getcpu>()  returns a nonnegative CPU number.  On error, "
2523 "-1 is returned and I<errno> is set to indicate the error."
2524 msgstr ""
2525
2526 #. type: TP
2527 #: build/C/man3/sched_getcpu.3:66 build/C/man2/sched_rr_get_interval.2:87
2528 #, no-wrap
2529 msgid "B<ENOSYS>"
2530 msgstr ""
2531
2532 #. type: Plain text
2533 #: build/C/man3/sched_getcpu.3:70
2534 msgid "This kernel does not implement B<getcpu>(2)."
2535 msgstr ""
2536
2537 #. type: Plain text
2538 #: build/C/man3/sched_getcpu.3:72
2539 msgid "This function is available since glibc 2.6."
2540 msgstr ""
2541
2542 #. type: Plain text
2543 #: build/C/man3/sched_getcpu.3:75
2544 msgid "B<sched_getcpu>()  is glibc specific."
2545 msgstr ""
2546
2547 #. type: Plain text
2548 #: build/C/man3/sched_getcpu.3:77
2549 msgid "The call"
2550 msgstr ""
2551
2552 #. type: Plain text
2553 #: build/C/man3/sched_getcpu.3:81
2554 #, no-wrap
2555 msgid "cpu = sched_getcpu();\n"
2556 msgstr ""
2557
2558 #. type: Plain text
2559 #: build/C/man3/sched_getcpu.3:87
2560 msgid "is equivalent to the following B<getcpu>(2)  call:"
2561 msgstr ""
2562
2563 #. type: Plain text
2564 #: build/C/man3/sched_getcpu.3:93
2565 #, no-wrap
2566 msgid ""
2567 "int c, s;\n"
2568 "s = getcpu(&c, NULL, NULL);\n"
2569 "cpu = (s == -1) ? s : c;\n"
2570 msgstr ""
2571
2572 #. type: Plain text
2573 #: build/C/man3/sched_getcpu.3:97
2574 msgid "B<getcpu>(2)"
2575 msgstr ""
2576
2577 #. type: TH
2578 #: build/C/man2/sched_rr_get_interval.2:29
2579 #, no-wrap
2580 msgid "SCHED_RR_GET_INTERVAL"
2581 msgstr ""
2582
2583 #. type: TH
2584 #: build/C/man2/sched_rr_get_interval.2:29
2585 #, no-wrap
2586 msgid "2013-03-18"
2587 msgstr ""
2588
2589 #. type: Plain text
2590 #: build/C/man2/sched_rr_get_interval.2:32
2591 msgid "sched_rr_get_interval - get the SCHED_RR interval for the named process"
2592 msgstr ""
2593
2594 #. type: Plain text
2595 #: build/C/man2/sched_rr_get_interval.2:36
2596 msgid "B<int sched_rr_get_interval(pid_t >I<pid>B<, struct timespec * >I<tp>B<);>"
2597 msgstr ""
2598
2599 #. type: Plain text
2600 #: build/C/man2/sched_rr_get_interval.2:47
2601 msgid ""
2602 "B<sched_rr_get_interval>()  writes into the I<timespec> structure pointed to "
2603 "by I<tp> the round-robin time quantum for the process identified by I<pid>.  "
2604 "The specified process should be running under the B<SCHED_RR> scheduling "
2605 "policy."
2606 msgstr ""
2607
2608 #. type: Plain text
2609 #: build/C/man2/sched_rr_get_interval.2:51
2610 msgid "The I<timespec> structure has the following form:"
2611 msgstr ""
2612
2613 #. type: Plain text
2614 #: build/C/man2/sched_rr_get_interval.2:58
2615 #, no-wrap
2616 msgid ""
2617 "struct timespec {\n"
2618 "    time_t tv_sec;    /* seconds */\n"
2619 "    long   tv_nsec;   /* nanoseconds */\n"
2620 "};\n"
2621 msgstr ""
2622
2623 #.  FIXME . On Linux, sched_rr_get_interval()
2624 #.  returns the timeslice for SCHED_OTHER processes -- this timeslice
2625 #.  is influenced by the nice value.
2626 #.  For SCHED_FIFO processes, this always returns 0.
2627 #
2628 #.  The round-robin time quantum value is not alterable under Linux
2629 #.  1.3.81.
2630 #. type: Plain text
2631 #: build/C/man2/sched_rr_get_interval.2:73
2632 msgid ""
2633 "If I<pid> is zero, the time quantum for the calling process is written into "
2634 "I<*tp>."
2635 msgstr ""
2636
2637 #. type: Plain text
2638 #: build/C/man2/sched_rr_get_interval.2:80
2639 msgid ""
2640 "On success, B<sched_rr_get_interval>()  returns 0.  On error, -1 is "
2641 "returned, and I<errno> is set appropriately."
2642 msgstr ""
2643
2644 #. type: TP
2645 #: build/C/man2/sched_rr_get_interval.2:81 build/C/man2/sched_setaffinity.2:117
2646 #, no-wrap
2647 msgid "B<EFAULT>"
2648 msgstr ""
2649
2650 #. type: Plain text
2651 #: build/C/man2/sched_rr_get_interval.2:84
2652 msgid "Problem with copying information to user space."
2653 msgstr ""
2654
2655 #. type: Plain text
2656 #: build/C/man2/sched_rr_get_interval.2:87
2657 msgid "Invalid pid."
2658 msgstr ""
2659
2660 #. type: Plain text
2661 #: build/C/man2/sched_rr_get_interval.2:90
2662 msgid "The system call is not yet implemented (only on rather old kernels)."
2663 msgstr ""
2664
2665 #. type: Plain text
2666 #: build/C/man2/sched_rr_get_interval.2:94
2667 msgid "Could not find a process with the ID I<pid>."
2668 msgstr ""
2669
2670 #. type: Plain text
2671 #: build/C/man2/sched_rr_get_interval.2:103
2672 msgid ""
2673 "POSIX systems on which B<sched_rr_get_interval>()  is available define "
2674 "B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
2675 msgstr ""
2676
2677 #. type: SS
2678 #: build/C/man2/sched_rr_get_interval.2:103
2679 #, no-wrap
2680 msgid "Linux notes"
2681 msgstr ""
2682
2683 #.  commit a4ec24b48ddef1e93f7578be53270f0b95ad666c
2684 #. type: Plain text
2685 #: build/C/man2/sched_rr_get_interval.2:117
2686 msgid ""
2687 "POSIX does not specify any mechanism for controlling the size of the "
2688 "round-robin time quantum.  Older Linux kernels provide a (nonportable) "
2689 "method of doing this.  The quantum can be controlled by adjusting the "
2690 "process's nice value (see B<setpriority>(2)).  Assigning a negative (i.e., "
2691 "high) nice value results in a longer quantum; assigning a positive (i.e., "
2692 "low) nice value results in a shorter quantum.  The default quantum is 0.1 "
2693 "seconds; the degree to which changing the nice value affects the quantum has "
2694 "varied somewhat across kernel versions.  This method of adjusting the "
2695 "quantum was removed starting with Linux 2.6.24."
2696 msgstr ""
2697
2698 #.  commit ce0dbbbb30aee6a835511d5be446462388ba9eee
2699 #.  .SH BUGS
2700 #.  As of Linux 1.3.81
2701 #.  .BR sched_rr_get_interval ()
2702 #.  returns with error
2703 #.  ENOSYS, because SCHED_RR has not yet been fully implemented and tested
2704 #.  properly.
2705 #. type: Plain text
2706 #: build/C/man2/sched_rr_get_interval.2:132
2707 msgid ""
2708 "Linux 3.9 added a new mechanism for adjusting (and viewing) the B<SCHED_RR> "
2709 "quantum: the I</proc/sys/kernel/sched_rr_timeslice_ms> file exposes the "
2710 "quantum as a millisecond value, whose default is 100.  Writing 0 to this "
2711 "file resets the quantum to the default value."
2712 msgstr ""
2713
2714 #. type: Plain text
2715 #: build/C/man2/sched_rr_get_interval.2:135 build/C/man2/sched_setaffinity.2:177
2716 msgid "B<sched_setscheduler>(2)  has a description of the Linux scheduling scheme."
2717 msgstr ""
2718
2719 #. type: TH
2720 #: build/C/man2/sched_setaffinity.2:34
2721 #, no-wrap
2722 msgid "SCHED_SETAFFINITY"
2723 msgstr ""
2724
2725 #. type: TH
2726 #: build/C/man2/sched_setaffinity.2:34
2727 #, no-wrap
2728 msgid "2013-02-11"
2729 msgstr ""
2730
2731 #. type: Plain text
2732 #: build/C/man2/sched_setaffinity.2:38
2733 msgid ""
2734 "sched_setaffinity, sched_getaffinity - set and get a process's CPU affinity "
2735 "mask"
2736 msgstr ""
2737
2738 #. type: Plain text
2739 #: build/C/man2/sched_setaffinity.2:45
2740 #, no-wrap
2741 msgid ""
2742 "B<int sched_setaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
2743 "B<                      cpu_set_t *>I<mask>B<);>\n"
2744 msgstr ""
2745
2746 #. type: Plain text
2747 #: build/C/man2/sched_setaffinity.2:48
2748 #, no-wrap
2749 msgid ""
2750 "B<int sched_getaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
2751 "B<                      cpu_set_t *>I<mask>B<);>\n"
2752 msgstr ""
2753
2754 #. type: Plain text
2755 #: build/C/man2/sched_setaffinity.2:63
2756 msgid ""
2757 "A process's CPU affinity mask determines the set of CPUs on which it is "
2758 "eligible to run.  On a multiprocessor system, setting the CPU affinity mask "
2759 "can be used to obtain performance benefits.  For example, by dedicating one "
2760 "CPU to a particular process (i.e., setting the affinity mask of that process "
2761 "to specify a single CPU, and setting the affinity mask of all other "
2762 "processes to exclude that CPU), it is possible to ensure maximum execution "
2763 "speed for that process.  Restricting a process to run on a single CPU also "
2764 "avoids the performance cost caused by the cache invalidation that occurs "
2765 "when a process ceases to execute on one CPU and then recommences execution "
2766 "on a different CPU."
2767 msgstr ""
2768
2769 #. type: Plain text
2770 #: build/C/man2/sched_setaffinity.2:70
2771 msgid ""
2772 "A CPU affinity mask is represented by the I<cpu_set_t> structure, a \"CPU "
2773 "set\", pointed to by I<mask>.  A set of macros for manipulating CPU sets is "
2774 "described in B<CPU_SET>(3)."
2775 msgstr ""
2776
2777 #. type: Plain text
2778 #: build/C/man2/sched_setaffinity.2:85
2779 msgid ""
2780 "B<sched_setaffinity>()  sets the CPU affinity mask of the process whose ID "
2781 "is I<pid> to the value specified by I<mask>.  If I<pid> is zero, then the "
2782 "calling process is used.  The argument I<cpusetsize> is the length (in "
2783 "bytes) of the data pointed to by I<mask>.  Normally this argument would be "
2784 "specified as I<sizeof(cpu_set_t)>."
2785 msgstr ""
2786
2787 #. type: Plain text
2788 #: build/C/man2/sched_setaffinity.2:92
2789 msgid ""
2790 "If the process specified by I<pid> is not currently running on one of the "
2791 "CPUs specified in I<mask>, then that process is migrated to one of the CPUs "
2792 "specified in I<mask>."
2793 msgstr ""
2794
2795 #. type: Plain text
2796 #: build/C/man2/sched_setaffinity.2:107
2797 msgid ""
2798 "B<sched_getaffinity>()  writes the affinity mask of the process whose ID is "
2799 "I<pid> into the I<cpu_set_t> structure pointed to by I<mask>.  The "
2800 "I<cpusetsize> argument specifies the size (in bytes) of I<mask>.  If I<pid> "
2801 "is zero, then the mask of the calling process is returned."
2802 msgstr ""
2803
2804 #. type: Plain text
2805 #: build/C/man2/sched_setaffinity.2:116
2806 msgid ""
2807 "On success, B<sched_setaffinity>()  and B<sched_getaffinity>()  return 0.  "
2808 "On error, -1 is returned, and I<errno> is set appropriately."
2809 msgstr ""
2810
2811 #. type: Plain text
2812 #: build/C/man2/sched_setaffinity.2:120
2813 msgid "A supplied memory address was invalid."
2814 msgstr ""
2815
2816 #. type: Plain text
2817 #: build/C/man2/sched_setaffinity.2:128
2818 msgid ""
2819 "The affinity bit mask I<mask> contains no processors that are currently "
2820 "physically on the system and permitted to the process according to any "
2821 "restrictions that may be imposed by the \"cpuset\" mechanism described in "
2822 "B<cpuset>(7)."
2823 msgstr ""
2824
2825 #. type: Plain text
2826 #: build/C/man2/sched_setaffinity.2:135
2827 msgid ""
2828 "(B<sched_getaffinity>()  and, in kernels before 2.6.9, "
2829 "B<sched_setaffinity>())  I<cpusetsize> is smaller than the size of the "
2830 "affinity mask used by the kernel."
2831 msgstr ""
2832
2833 #. type: Plain text
2834 #: build/C/man2/sched_setaffinity.2:145
2835 msgid ""
2836 "(B<sched_setaffinity>())  The calling process does not have appropriate "
2837 "privileges.  The caller needs an effective user ID equal to the real user ID "
2838 "or effective user ID of the process identified by I<pid>, or it must possess "
2839 "the B<CAP_SYS_NICE> capability."
2840 msgstr ""
2841
2842 #. type: Plain text
2843 #: build/C/man2/sched_setaffinity.2:148 build/C/man2/sched_setparam.2:110 build/C/man2/sched_setscheduler.2:444
2844 msgid "The process whose ID is I<pid> could not be found."
2845 msgstr ""
2846
2847 #. type: Plain text
2848 #: build/C/man2/sched_setaffinity.2:159
2849 msgid ""
2850 "The CPU affinity system calls were introduced in Linux kernel 2.5.8.  The "
2851 "system call wrappers were introduced in glibc 2.3.  Initially, the glibc "
2852 "interfaces included a I<cpusetsize> argument, typed as I<unsigned int>.  In "
2853 "glibc 2.3.3, the I<cpusetsize> argument was removed, but was then restored "
2854 "in glibc 2.3.4, with type I<size_t>."
2855 msgstr ""
2856
2857 #. type: Plain text
2858 #: build/C/man2/sched_setaffinity.2:161
2859 msgid "These system calls are Linux-specific."
2860 msgstr ""
2861
2862 #. type: Plain text
2863 #: build/C/man2/sched_setaffinity.2:174
2864 msgid ""
2865 "After a call to B<sched_setaffinity>(), the set of CPUs on which the process "
2866 "will actually run is the intersection of the set specified in the I<mask> "
2867 "argument and the set of CPUs actually present on the system.  The system may "
2868 "further restrict the set of CPUs on which the process runs if the \"cpuset\" "
2869 "mechanism described in B<cpuset>(7)  is being used.  These restrictions on "
2870 "the actual set of CPUs on which the process will run are silently imposed by "
2871 "the kernel."
2872 msgstr ""
2873
2874 #. type: Plain text
2875 #: build/C/man2/sched_setaffinity.2:194
2876 msgid ""
2877 "The affinity mask is actually a per-thread attribute that can be adjusted "
2878 "independently for each of the threads in a thread group.  The value returned "
2879 "from a call to B<gettid>(2)  can be passed in the argument I<pid>.  "
2880 "Specifying I<pid> as 0 will set the attribute for the calling thread, and "
2881 "passing the value returned from a call to B<getpid>(2)  will set the "
2882 "attribute for the main thread of the thread group.  (If you are using the "
2883 "POSIX threads API, then use B<pthread_setaffinity_np>(3)  instead of "
2884 "B<sched_setaffinity>().)"
2885 msgstr ""
2886
2887 #. type: Plain text
2888 #: build/C/man2/sched_setaffinity.2:200
2889 msgid ""
2890 "A child created via B<fork>(2)  inherits its parent's CPU affinity mask.  "
2891 "The affinity mask is preserved across an B<execve>(2)."
2892 msgstr ""
2893
2894 #. type: Plain text
2895 #: build/C/man2/sched_setaffinity.2:214
2896 msgid ""
2897 "This manual page describes the glibc interface for the CPU affinity calls.  "
2898 "The actual system call interface is slightly different, with the I<mask> "
2899 "being typed as I<unsigned long *>, reflecting the fact that the underlying "
2900 "implementation of CPU sets is a simple bit mask.  On success, the raw "
2901 "B<sched_getaffinity>()  system call returns the size (in bytes) of the "
2902 "I<cpumask_t> data type that is used internally by the kernel to represent "
2903 "the CPU set bit mask."
2904 msgstr ""
2905
2906 #. type: Plain text
2907 #: build/C/man2/sched_setaffinity.2:233
2908 msgid ""
2909 "B<taskset>(1), B<clone>(2), B<getcpu>(2), B<getpriority>(2), B<gettid>(2), "
2910 "B<nice>(2), B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), "
2911 "B<sched_getscheduler>(2), B<sched_setscheduler>(2), B<setpriority>(2), "
2912 "B<CPU_SET>(3), B<pthread_setaffinity_np>(3), B<sched_getcpu>(3), "
2913 "B<capabilities>(7), B<cpuset>(7)"
2914 msgstr ""
2915
2916 #. type: TH
2917 #: build/C/man2/sched_setparam.2:30
2918 #, no-wrap
2919 msgid "SCHED_SETPARAM"
2920 msgstr ""
2921
2922 #. type: TH
2923 #: build/C/man2/sched_setparam.2:30 build/C/man2/sched_setscheduler.2:46
2924 #, no-wrap
2925 msgid "2013-02-12"
2926 msgstr ""
2927
2928 #. type: Plain text
2929 #: build/C/man2/sched_setparam.2:33
2930 msgid "sched_setparam, sched_getparam - set and get scheduling parameters"
2931 msgstr ""
2932
2933 #. type: Plain text
2934 #: build/C/man2/sched_setparam.2:38
2935 #, no-wrap
2936 msgid ""
2937 "B<int sched_setparam(pid_t >I<pid>B<, const struct sched_param "
2938 "*>I<param>B<);>\n"
2939 msgstr ""
2940
2941 #. type: Plain text
2942 #: build/C/man2/sched_setparam.2:40
2943 #, no-wrap
2944 msgid "B<int sched_getparam(pid_t >I<pid>B<, struct sched_param *>I<param>B<);>\n"
2945 msgstr ""
2946
2947 #. type: Plain text
2948 #: build/C/man2/sched_setparam.2:46 build/C/man2/sched_setscheduler.2:65
2949 #, no-wrap
2950 msgid ""
2951 "B<struct sched_param {\n"
2952 "    ...\n"
2953 "    int >I<sched_priority>B<;\n"
2954 "    ...\n"
2955 "};>\n"
2956 msgstr ""
2957
2958 #. type: Plain text
2959 #: build/C/man2/sched_setparam.2:60
2960 msgid ""
2961 "B<sched_setparam>()  sets the scheduling parameters associated with the "
2962 "scheduling policy for the process identified by I<pid>.  If I<pid> is zero, "
2963 "then the parameters of the calling process are set.  The interpretation of "
2964 "the argument I<param> depends on the scheduling policy of the process "
2965 "identified by I<pid>.  See B<sched_setscheduler>(2)  for a description of "
2966 "the scheduling policies supported under Linux."
2967 msgstr ""
2968
2969 #. type: Plain text
2970 #: build/C/man2/sched_setparam.2:66
2971 msgid ""
2972 "B<sched_getparam>()  retrieves the scheduling parameters for the process "
2973 "identified by I<pid>.  If I<pid> is zero, then the parameters of the calling "
2974 "process are retrieved."
2975 msgstr ""
2976
2977 #. type: Plain text
2978 #: build/C/man2/sched_setparam.2:75
2979 msgid ""
2980 "B<sched_setparam>()  checks the validity of I<param> for the scheduling "
2981 "policy of the process.  The value I<param-E<gt>sched_priority> must lie "
2982 "within the range given by B<sched_get_priority_min>(2)  and "
2983 "B<sched_get_priority_max>(2)."
2984 msgstr ""
2985
2986 #. type: Plain text
2987 #: build/C/man2/sched_setparam.2:79
2988 msgid ""
2989 "For a discussion of the privileges and resource limits related to scheduling "
2990 "priority and policy, see B<sched_setscheduler>(2)."
2991 msgstr ""
2992
2993 #. type: Plain text
2994 #: build/C/man2/sched_setparam.2:87
2995 msgid ""
2996 "POSIX systems on which B<sched_setparam>()  and B<sched_getparam>()  are "
2997 "available define B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
2998 msgstr ""
2999
3000 #. type: Plain text
3001 #: build/C/man2/sched_setparam.2:96
3002 msgid ""
3003 "On success, B<sched_setparam>()  and B<sched_getparam>()  return 0.  On "
3004 "error, -1 is returned, and I<errno> is set appropriately."
3005 msgstr ""
3006
3007 #. type: Plain text
3008 #: build/C/man2/sched_setparam.2:101
3009 msgid "The argument I<param> does not make sense for the current scheduling policy."
3010 msgstr ""
3011
3012 #. type: Plain text
3013 #: build/C/man2/sched_setparam.2:107
3014 msgid ""
3015 "The calling process does not have appropriate privileges (Linux: does not "
3016 "have the B<CAP_SYS_NICE> capability)."
3017 msgstr ""
3018
3019 #. type: Plain text
3020 #: build/C/man2/sched_setparam.2:118
3021 msgid ""
3022 "Scheduling parameters are in fact per-thread attributes on Linux; see "
3023 "B<sched_setscheduler>(2)."
3024 msgstr ""
3025
3026 #. type: Plain text
3027 #: build/C/man2/sched_setparam.2:131
3028 msgid ""
3029 "B<getpriority>(2), B<nice>(2), B<sched_get_priority_max>(2), "
3030 "B<sched_get_priority_min>(2), B<sched_getaffinity>(2), "
3031 "B<sched_getscheduler>(2), B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
3032 "B<setpriority>(2), B<capabilities>(7)"
3033 msgstr ""
3034
3035 #. type: TH
3036 #: build/C/man2/sched_setscheduler.2:46
3037 #, no-wrap
3038 msgid "SCHED_SETSCHEDULER"
3039 msgstr ""
3040
3041 #. type: Plain text
3042 #: build/C/man2/sched_setscheduler.2:50
3043 msgid ""
3044 "sched_setscheduler, sched_getscheduler - set and get scheduling "
3045 "policy/parameters"
3046 msgstr ""
3047
3048 #. type: Plain text
3049 #: build/C/man2/sched_setscheduler.2:55
3050 #, no-wrap
3051 msgid "B<int sched_setscheduler(pid_t >I<pid>B<, int >I<policy>B<,>\n"
3052 msgstr ""
3053
3054 #. type: Plain text
3055 #: build/C/man2/sched_setscheduler.2:57
3056 #, no-wrap
3057 msgid "B<                       const struct sched_param *>I<param>B<);>\n"
3058 msgstr ""
3059
3060 #. type: Plain text
3061 #: build/C/man2/sched_setscheduler.2:59
3062 #, no-wrap
3063 msgid "B<int sched_getscheduler(pid_t >I<pid>B<);>\n"
3064 msgstr ""
3065
3066 #. type: Plain text
3067 #: build/C/man2/sched_setscheduler.2:76
3068 msgid ""
3069 "B<sched_setscheduler>()  sets both the scheduling policy and the associated "
3070 "parameters for the process whose ID is specified in I<pid>.  If I<pid> "
3071 "equals zero, the scheduling policy and parameters of the calling process "
3072 "will be set.  The interpretation of the argument I<param> depends on the "
3073 "selected policy.  Currently, Linux supports the following \"normal\" (i.e., "
3074 "non-real-time) scheduling policies:"
3075 msgstr ""
3076
3077 #. type: TP
3078 #: build/C/man2/sched_setscheduler.2:76
3079 #, no-wrap
3080 msgid "B<SCHED_OTHER>"
3081 msgstr ""
3082
3083 #.  In the 2.6 kernel sources, SCHED_OTHER is actually called
3084 #.  SCHED_NORMAL.
3085 #. type: Plain text
3086 #: build/C/man2/sched_setscheduler.2:81
3087 msgid "the standard round-robin time-sharing policy;"
3088 msgstr ""
3089
3090 #. type: TP
3091 #: build/C/man2/sched_setscheduler.2:81
3092 #, no-wrap
3093 msgid "B<SCHED_BATCH>"
3094 msgstr ""
3095
3096 #. type: Plain text
3097 #: build/C/man2/sched_setscheduler.2:84
3098 msgid "for \"batch\" style execution of processes; and"
3099 msgstr ""
3100
3101 #. type: TP
3102 #: build/C/man2/sched_setscheduler.2:84
3103 #, no-wrap
3104 msgid "B<SCHED_IDLE>"
3105 msgstr ""
3106
3107 #. type: Plain text
3108 #: build/C/man2/sched_setscheduler.2:89
3109 msgid "for running I<very> low priority background jobs."
3110 msgstr ""
3111
3112 #. type: Plain text
3113 #: build/C/man2/sched_setscheduler.2:93
3114 msgid ""
3115 "The following \"real-time\" policies are also supported, for special "
3116 "time-critical applications that need precise control over the way in which "
3117 "runnable processes are selected for execution:"
3118 msgstr ""
3119
3120 #. type: TP
3121 #: build/C/man2/sched_setscheduler.2:93
3122 #, no-wrap
3123 msgid "B<SCHED_FIFO>"
3124 msgstr ""
3125
3126 #. type: Plain text
3127 #: build/C/man2/sched_setscheduler.2:96
3128 msgid "a first-in, first-out policy; and"
3129 msgstr ""
3130
3131 #. type: TP
3132 #: build/C/man2/sched_setscheduler.2:96
3133 #, no-wrap
3134 msgid "B<SCHED_RR>"
3135 msgstr ""
3136
3137 #. type: Plain text
3138 #: build/C/man2/sched_setscheduler.2:99
3139 msgid "a round-robin policy."
3140 msgstr ""
3141
3142 #. type: Plain text
3143 #: build/C/man2/sched_setscheduler.2:101
3144 msgid "The semantics of each of these policies are detailed below."
3145 msgstr ""
3146
3147 #. type: Plain text
3148 #: build/C/man2/sched_setscheduler.2:108
3149 msgid ""
3150 "B<sched_getscheduler>()  queries the scheduling policy currently applied to "
3151 "the process identified by I<pid>.  If I<pid> equals zero, the policy of the "
3152 "calling process will be retrieved."
3153 msgstr ""
3154
3155 #. type: SS
3156 #: build/C/man2/sched_setscheduler.2:108
3157 #, no-wrap
3158 msgid "Scheduling policies"
3159 msgstr ""
3160
3161 #. type: Plain text
3162 #: build/C/man2/sched_setscheduler.2:117
3163 msgid ""
3164 "The scheduler is the kernel component that decides which runnable process "
3165 "will be executed by the CPU next.  Each process has an associated scheduling "
3166 "policy and a I<static> scheduling priority, I<sched_priority>; these are the "
3167 "settings that are modified by B<sched_setscheduler>().  The scheduler makes "
3168 "it decisions based on knowledge of the scheduling policy and static priority "
3169 "of all processes on the system."
3170 msgstr ""
3171
3172 #. type: Plain text
3173 #: build/C/man2/sched_setscheduler.2:122
3174 msgid ""
3175 "For processes scheduled under one of the normal scheduling policies "
3176 "(B<SCHED_OTHER>, B<SCHED_IDLE>, B<SCHED_BATCH>), I<sched_priority> is not "
3177 "used in scheduling decisions (it must be specified as 0)."
3178 msgstr ""
3179
3180 #. type: Plain text
3181 #: build/C/man2/sched_setscheduler.2:136
3182 msgid ""
3183 "Processes scheduled under one of the real-time policies (B<SCHED_FIFO>, "
3184 "B<SCHED_RR>) have a I<sched_priority> value in the range 1 (low) to 99 "
3185 "(high).  (As the numbers imply, real-time processes always have higher "
3186 "priority than normal processes.)  Note well: POSIX.1-2001 requires an "
3187 "implementation to support only a minimum 32 distinct priority levels for the "
3188 "real-time policies, and some systems supply just this minimum.  Portable "
3189 "programs should use B<sched_get_priority_min>(2)  and "
3190 "B<sched_get_priority_max>(2)  to find the range of priorities supported for "
3191 "a particular policy."
3192 msgstr ""
3193
3194 #. type: Plain text
3195 #: build/C/man2/sched_setscheduler.2:142
3196 msgid ""
3197 "Conceptually, the scheduler maintains a list of runnable processes for each "
3198 "possible I<sched_priority> value.  In order to determine which process runs "
3199 "next, the scheduler looks for the nonempty list with the highest static "
3200 "priority and selects the process at the head of this list."
3201 msgstr ""
3202
3203 #. type: Plain text
3204 #: build/C/man2/sched_setscheduler.2:146
3205 msgid ""
3206 "A process's scheduling policy determines where it will be inserted into the "
3207 "list of processes with equal static priority and how it will move inside "
3208 "this list."
3209 msgstr ""
3210
3211 #. type: Plain text
3212 #: build/C/man2/sched_setscheduler.2:154
3213 msgid ""
3214 "All scheduling is preemptive: if a process with a higher static priority "
3215 "becomes ready to run, the currently running process will be preempted and "
3216 "returned to the wait list for its static priority level.  The scheduling "
3217 "policy determines the ordering only within the list of runnable processes "
3218 "with equal static priority."
3219 msgstr ""
3220
3221 #. type: SS
3222 #: build/C/man2/sched_setscheduler.2:154
3223 #, no-wrap
3224 msgid "SCHED_FIFO: First in-first out scheduling"
3225 msgstr ""
3226
3227 #. type: Plain text
3228 #: build/C/man2/sched_setscheduler.2:163
3229 msgid ""
3230 "B<SCHED_FIFO> can be used only with static priorities higher than 0, which "
3231 "means that when a B<SCHED_FIFO> processes becomes runnable, it will always "
3232 "immediately preempt any currently running B<SCHED_OTHER>, B<SCHED_BATCH>, or "
3233 "B<SCHED_IDLE> process.  B<SCHED_FIFO> is a simple scheduling algorithm "
3234 "without time slicing.  For processes scheduled under the B<SCHED_FIFO> "
3235 "policy, the following rules apply:"
3236 msgstr ""
3237
3238 #. type: IP
3239 #: build/C/man2/sched_setscheduler.2:163 build/C/man2/sched_setscheduler.2:168 build/C/man2/sched_setscheduler.2:171 build/C/man2/sched_setscheduler.2:185 build/C/man2/sched_setscheduler.2:287 build/C/man2/sched_setscheduler.2:295 build/C/man2/sched_setscheduler.2:336 build/C/man2/sched_setscheduler.2:344 build/C/man2/sched_setscheduler.2:349 build/C/man2/sched_setscheduler.2:354
3240 #, no-wrap
3241 msgid "*"
3242 msgstr ""
3243
3244 #. type: Plain text
3245 #: build/C/man2/sched_setscheduler.2:168
3246 msgid ""
3247 "A B<SCHED_FIFO> process that has been preempted by another process of higher "
3248 "priority will stay at the head of the list for its priority and will resume "
3249 "execution as soon as all processes of higher priority are blocked again."
3250 msgstr ""
3251
3252 #. type: Plain text
3253 #: build/C/man2/sched_setscheduler.2:171
3254 msgid ""
3255 "When a B<SCHED_FIFO> process becomes runnable, it will be inserted at the "
3256 "end of the list for its priority."
3257 msgstr ""
3258
3259 #.  In 2.2.x and 2.4.x, the process is placed at the front of the queue
3260 #.  In 2.0.x, the Right Thing happened: the process went to the back -- MTK
3261 #. type: Plain text
3262 #: build/C/man2/sched_setscheduler.2:185
3263 msgid ""
3264 "A call to B<sched_setscheduler>()  or B<sched_setparam>(2)  will put the "
3265 "B<SCHED_FIFO> (or B<SCHED_RR>) process identified by I<pid> at the start of "
3266 "the list if it was runnable.  As a consequence, it may preempt the currently "
3267 "running process if it has the same priority.  (POSIX.1-2001 specifies that "
3268 "the process should go to the end of the list.)"
3269 msgstr ""
3270
3271 #. type: Plain text
3272 #: build/C/man2/sched_setscheduler.2:189
3273 msgid "A process calling B<sched_yield>(2)  will be put at the end of the list."
3274 msgstr ""
3275
3276 #. type: Plain text
3277 #: build/C/man2/sched_setscheduler.2:193
3278 msgid ""
3279 "No other events will move a process scheduled under the B<SCHED_FIFO> policy "
3280 "in the wait list of runnable processes with equal static priority."
3281 msgstr ""
3282
3283 #. type: Plain text
3284 #: build/C/man2/sched_setscheduler.2:198
3285 msgid ""
3286 "A B<SCHED_FIFO> process runs until either it is blocked by an I/O request, "
3287 "it is preempted by a higher priority process, or it calls B<sched_yield>(2)."
3288 msgstr ""
3289
3290 #. type: SS
3291 #: build/C/man2/sched_setscheduler.2:198
3292 #, no-wrap
3293 msgid "SCHED_RR: Round-robin scheduling"
3294 msgstr ""
3295
3296 #.  On Linux 2.4, the length of the RR interval is influenced
3297 #.  by the process nice value -- MTK
3298 #. type: Plain text
3299 #: build/C/man2/sched_setscheduler.2:217
3300 msgid ""
3301 "B<SCHED_RR> is a simple enhancement of B<SCHED_FIFO>.  Everything described "
3302 "above for B<SCHED_FIFO> also applies to B<SCHED_RR>, except that each "
3303 "process is allowed to run only for a maximum time quantum.  If a B<SCHED_RR> "
3304 "process has been running for a time period equal to or longer than the time "
3305 "quantum, it will be put at the end of the list for its priority.  A "
3306 "B<SCHED_RR> process that has been preempted by a higher priority process and "
3307 "subsequently resumes execution as a running process will complete the "
3308 "unexpired portion of its round-robin time quantum.  The length of the time "
3309 "quantum can be retrieved using B<sched_rr_get_interval>(2)."
3310 msgstr ""
3311
3312 #. type: SS
3313 #: build/C/man2/sched_setscheduler.2:217
3314 #, no-wrap
3315 msgid "SCHED_OTHER: Default Linux time-sharing scheduling"
3316 msgstr ""
3317
3318 #. type: Plain text
3319 #: build/C/man2/sched_setscheduler.2:233
3320 msgid ""
3321 "B<SCHED_OTHER> can be used at only static priority 0.  B<SCHED_OTHER> is the "
3322 "standard Linux time-sharing scheduler that is intended for all processes "
3323 "that do not require the special real-time mechanisms.  The process to run is "
3324 "chosen from the static priority 0 list based on a I<dynamic> priority that "
3325 "is determined only inside this list.  The dynamic priority is based on the "
3326 "nice value (set by B<nice>(2)  or B<setpriority>(2))  and increased for each "
3327 "time quantum the process is ready to run, but denied to run by the "
3328 "scheduler.  This ensures fair progress among all B<SCHED_OTHER> processes."
3329 msgstr ""
3330
3331 #. type: SS
3332 #: build/C/man2/sched_setscheduler.2:233
3333 #, no-wrap
3334 msgid "SCHED_BATCH: Scheduling batch processes"
3335 msgstr ""
3336
3337 #. type: Plain text
3338 #: build/C/man2/sched_setscheduler.2:245
3339 msgid ""
3340 "(Since Linux 2.6.16.)  B<SCHED_BATCH> can be used only at static priority "
3341 "0.  This policy is similar to B<SCHED_OTHER> in that it schedules the "
3342 "process according to its dynamic priority (based on the nice value).  The "
3343 "difference is that this policy will cause the scheduler to always assume "
3344 "that the process is CPU-intensive.  Consequently, the scheduler will apply a "
3345 "small scheduling penalty with respect to wakeup behaviour, so that this "
3346 "process is mildly disfavored in scheduling decisions."
3347 msgstr ""
3348
3349 #.  The following paragraph is drawn largely from the text that
3350 #.  accompanied Ingo Molnar's patch for the implementation of
3351 #.  SCHED_BATCH.
3352 #. type: Plain text
3353 #: build/C/man2/sched_setscheduler.2:254
3354 msgid ""
3355 "This policy is useful for workloads that are noninteractive, but do not want "
3356 "to lower their nice value, and for workloads that want a deterministic "
3357 "scheduling policy without interactivity causing extra preemptions (between "
3358 "the workload's tasks)."
3359 msgstr ""
3360
3361 #. type: SS
3362 #: build/C/man2/sched_setscheduler.2:254
3363 #, no-wrap
3364 msgid "SCHED_IDLE: Scheduling very low priority jobs"
3365 msgstr ""
3366
3367 #. type: Plain text
3368 #: build/C/man2/sched_setscheduler.2:258
3369 msgid ""
3370 "(Since Linux 2.6.23.)  B<SCHED_IDLE> can be used only at static priority 0; "
3371 "the process nice value has no influence for this policy."
3372 msgstr ""
3373
3374 #. type: Plain text
3375 #: build/C/man2/sched_setscheduler.2:266
3376 msgid ""
3377 "This policy is intended for running jobs at extremely low priority (lower "
3378 "even than a +19 nice value with the B<SCHED_OTHER> or B<SCHED_BATCH> "
3379 "policies)."
3380 msgstr ""
3381
3382 #. type: SS
3383 #: build/C/man2/sched_setscheduler.2:266
3384 #, no-wrap
3385 msgid "Resetting scheduling policy for child processes"
3386 msgstr ""
3387
3388 #. type: Plain text
3389 #: build/C/man2/sched_setscheduler.2:282
3390 msgid ""
3391 "Since Linux 2.6.32, the B<SCHED_RESET_ON_FORK> flag can be ORed in I<policy> "
3392 "when calling B<sched_setscheduler>().  As a result of including this flag, "
3393 "children created by B<fork>(2)  do not inherit privileged scheduling "
3394 "policies.  This feature is intended for media-playback applications, and can "
3395 "be used to prevent applications evading the B<RLIMIT_RTTIME> resource limit "
3396 "(see B<getrlimit>(2))  by creating multiple child processes."
3397 msgstr ""
3398
3399 #. type: Plain text
3400 #: build/C/man2/sched_setscheduler.2:287
3401 msgid ""
3402 "More precisely, if the B<SCHED_RESET_ON_FORK> flag is specified, the "
3403 "following rules apply for subsequently created children:"
3404 msgstr ""
3405
3406 #. type: Plain text
3407 #: build/C/man2/sched_setscheduler.2:295
3408 msgid ""
3409 "If the calling process has a scheduling policy of B<SCHED_FIFO> or "
3410 "B<SCHED_RR>, the policy is reset to B<SCHED_OTHER> in child processes."
3411 msgstr ""
3412
3413 #. type: Plain text
3414 #: build/C/man2/sched_setscheduler.2:298
3415 msgid ""
3416 "If the calling process has a negative nice value, the nice value is reset to "
3417 "zero in child processes."
3418 msgstr ""
3419
3420 #. type: Plain text
3421 #: build/C/man2/sched_setscheduler.2:307
3422 msgid ""
3423 "After the B<SCHED_RESET_ON_FORK> flag has been enabled, it can be reset only "
3424 "if the process has the B<CAP_SYS_NICE> capability.  This flag is disabled in "
3425 "child processes created by B<fork>(2)."
3426 msgstr ""
3427
3428 #. type: Plain text
3429 #: build/C/man2/sched_setscheduler.2:313
3430 msgid ""
3431 "The B<SCHED_RESET_ON_FORK> flag is visible in the policy value returned by "
3432 "B<sched_getscheduler>()"
3433 msgstr ""
3434
3435 #. type: SS
3436 #: build/C/man2/sched_setscheduler.2:313
3437 #, no-wrap
3438 msgid "Privileges and resource limits"
3439 msgstr ""
3440
3441 #. type: Plain text
3442 #: build/C/man2/sched_setscheduler.2:326
3443 msgid ""
3444 "In Linux kernels before 2.6.12, only privileged (B<CAP_SYS_NICE>)  processes "
3445 "can set a nonzero static priority (i.e., set a real-time scheduling "
3446 "policy).  The only change that an unprivileged process can make is to set "
3447 "the B<SCHED_OTHER> policy, and this can be done only if the effective user "
3448 "ID of the caller of B<sched_setscheduler>()  matches the real or effective "
3449 "user ID of the target process (i.e., the process specified by I<pid>)  whose "
3450 "policy is being changed."
3451 msgstr ""
3452
3453 #. type: Plain text
3454 #: build/C/man2/sched_setscheduler.2:336
3455 msgid ""
3456 "Since Linux 2.6.12, the B<RLIMIT_RTPRIO> resource limit defines a ceiling on "
3457 "an unprivileged process's static priority for the B<SCHED_RR> and "
3458 "B<SCHED_FIFO> policies.  The rules for changing scheduling policy and "
3459 "priority are as follows:"
3460 msgstr ""
3461
3462 #. type: Plain text
3463 #: build/C/man2/sched_setscheduler.2:344
3464 msgid ""
3465 "If an unprivileged process has a nonzero B<RLIMIT_RTPRIO> soft limit, then "
3466 "it can change its scheduling policy and priority, subject to the restriction "
3467 "that the priority cannot be set to a value higher than the maximum of its "
3468 "current priority and its B<RLIMIT_RTPRIO> soft limit."
3469 msgstr ""
3470
3471 #. type: Plain text
3472 #: build/C/man2/sched_setscheduler.2:349
3473 msgid ""
3474 "If the B<RLIMIT_RTPRIO> soft limit is 0, then the only permitted changes are "
3475 "to lower the priority, or to switch to a non-real-time policy."
3476 msgstr ""
3477
3478 #. type: Plain text
3479 #: build/C/man2/sched_setscheduler.2:354
3480 msgid ""
3481 "Subject to the same rules, another unprivileged process can also make these "
3482 "changes, as long as the effective user ID of the process making the change "
3483 "matches the real or effective user ID of the target process."
3484 msgstr ""
3485
3486 #.  commit c02aa73b1d18e43cfd79c2f193b225e84ca497c8
3487 #. type: Plain text
3488 #: build/C/man2/sched_setscheduler.2:372
3489 msgid ""
3490 "Special rules apply for the B<SCHED_IDLE>.  In Linux kernels before 2.6.39, "
3491 "an unprivileged process operating under this policy cannot change its "
3492 "policy, regardless of the value of its B<RLIMIT_RTPRIO> resource limit.  In "
3493 "Linux kernels since 2.6.39, an unprivileged process can switch to either the "
3494 "B<SCHED_BATCH> or the B<SCHED_NORMAL> policy so long as its nice value falls "
3495 "within the range permitted by its B<RLIMIT_NICE> resource limit (see "
3496 "B<getrlimit>(2))."
3497 msgstr ""
3498
3499 #. type: Plain text
3500 #: build/C/man2/sched_setscheduler.2:383
3501 msgid ""
3502 "Privileged (B<CAP_SYS_NICE>)  processes ignore the B<RLIMIT_RTPRIO> limit; "
3503 "as with older kernels, they can make arbitrary changes to scheduling policy "
3504 "and priority.  See B<getrlimit>(2)  for further information on "
3505 "B<RLIMIT_RTPRIO>."
3506 msgstr ""
3507
3508 #. type: SS
3509 #: build/C/man2/sched_setscheduler.2:383
3510 #, no-wrap
3511 msgid "Response time"
3512 msgstr ""
3513
3514 #.  as described in
3515 #.  .BR request_irq (9).
3516 #. type: Plain text
3517 #: build/C/man2/sched_setscheduler.2:391
3518 msgid ""
3519 "A blocked high priority process waiting for the I/O has a certain response "
3520 "time before it is scheduled again.  The device driver writer can greatly "
3521 "reduce this response time by using a \"slow interrupt\" interrupt handler."
3522 msgstr ""
3523
3524 #. type: SS
3525 #: build/C/man2/sched_setscheduler.2:391
3526 #, no-wrap
3527 msgid "Miscellaneous"
3528 msgstr ""
3529
3530 #. type: Plain text
3531 #: build/C/man2/sched_setscheduler.2:396
3532 msgid ""
3533 "Child processes inherit the scheduling policy and parameters across a "
3534 "B<fork>(2).  The scheduling policy and parameters are preserved across "
3535 "B<execve>(2)."
3536 msgstr ""
3537
3538 #. type: Plain text
3539 #: build/C/man2/sched_setscheduler.2:402
3540 msgid ""
3541 "Memory locking is usually needed for real-time processes to avoid paging "
3542 "delays; this can be done with B<mlock>(2)  or B<mlockall>(2)."
3543 msgstr ""
3544
3545 #. type: Plain text
3546 #: build/C/man2/sched_setscheduler.2:414
3547 msgid ""
3548 "Since a nonblocking infinite loop in a process scheduled under B<SCHED_FIFO> "
3549 "or B<SCHED_RR> will block all processes with lower priority forever, a "
3550 "software developer should always keep available on the console a shell "
3551 "scheduled under a higher static priority than the tested application.  This "
3552 "will allow an emergency kill of tested real-time applications that do not "
3553 "block or terminate as expected.  See also the description of the "
3554 "B<RLIMIT_RTTIME> resource limit in B<getrlimit>(2)."
3555 msgstr ""
3556
3557 #. type: Plain text
3558 #: build/C/man2/sched_setscheduler.2:422
3559 msgid ""
3560 "POSIX systems on which B<sched_setscheduler>()  and B<sched_getscheduler>()  "
3561 "are available define B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
3562 msgstr ""
3563
3564 #. type: Plain text
3565 #: build/C/man2/sched_setscheduler.2:432
3566 msgid ""
3567 "On success, B<sched_setscheduler>()  returns zero.  On success, "
3568 "B<sched_getscheduler>()  returns the policy for the process (a nonnegative "
3569 "integer).  On error, -1 is returned, and I<errno> is set appropriately."
3570 msgstr ""
3571
3572 #. type: Plain text
3573 #: build/C/man2/sched_setscheduler.2:438
3574 msgid ""
3575 "The scheduling I<policy> is not one of the recognized policies, I<param> is "
3576 "NULL, or I<param> does not make sense for the I<policy>."
3577 msgstr ""
3578
3579 #. type: Plain text
3580 #: build/C/man2/sched_setscheduler.2:441
3581 msgid "The calling process does not have appropriate privileges."
3582 msgstr ""
3583
3584 #. type: Plain text
3585 #: build/C/man2/sched_setscheduler.2:447
3586 msgid ""
3587 "POSIX.1-2001 (but see BUGS below).  The B<SCHED_BATCH> and B<SCHED_IDLE> "
3588 "policies are Linux-specific."
3589 msgstr ""
3590
3591 #. type: Plain text
3592 #: build/C/man2/sched_setscheduler.2:455
3593 msgid ""
3594 "POSIX.1 does not detail the permissions that an unprivileged process "
3595 "requires in order to call B<sched_setscheduler>(), and details vary across "
3596 "systems.  For example, the Solaris 7 manual page says that the real or "
3597 "effective user ID of the calling process must match the real user ID or the "
3598 "save set-user-ID of the target process."
3599 msgstr ""
3600
3601 #. type: Plain text
3602 #: build/C/man2/sched_setscheduler.2:476
3603 msgid ""
3604 "The scheduling policy and parameters are in fact per-thread attributes on "
3605 "Linux.  The value returned from a call to B<gettid>(2)  can be passed in the "
3606 "argument I<pid>.  Specifying I<pid> as 0 will operate on the attribute for "
3607 "the calling thread, and passing the value returned from a call to "
3608 "B<getpid>(2)  will operate on the attribute for the main thread of the "
3609 "thread group.  (If you are using the POSIX threads API, then use "
3610 "B<pthread_setschedparam>(3), B<pthread_getschedparam>(3), and "
3611 "B<pthread_setschedprio>(3), instead of the B<sched_*>(2)  system calls.)"
3612 msgstr ""
3613
3614 #. type: Plain text
3615 #: build/C/man2/sched_setscheduler.2:486
3616 msgid ""
3617 "Originally, Standard Linux was intended as a general-purpose operating "
3618 "system being able to handle background processes, interactive applications, "
3619 "and less demanding real-time applications (applications that need to usually "
3620 "meet timing deadlines).  Although the Linux kernel 2.6 allowed for kernel "
3621 "preemption and the newly introduced O(1) scheduler ensures that the time "
3622 "needed to schedule is fixed and deterministic irrespective of the number of "
3623 "active tasks, true real-time computing was not possible up to kernel version "
3624 "2.6.17."
3625 msgstr ""
3626
3627 #. type: SS
3628 #: build/C/man2/sched_setscheduler.2:486
3629 #, no-wrap
3630 msgid "Real-time features in the mainline Linux kernel"
3631 msgstr ""
3632
3633 #.  FIXME . Probably this text will need some minor tweaking
3634 #.  by about the time of 2.6.30; ask Carsten Emde about this then.
3635 #. type: Plain text
3636 #: build/C/man2/sched_setscheduler.2:500
3637 msgid ""
3638 "From kernel version 2.6.18 onward, however, Linux is gradually becoming "
3639 "equipped with real-time capabilities, most of which are derived from the "
3640 "former I<realtime-preempt> patches developed by Ingo Molnar, Thomas "
3641 "Gleixner, Steven Rostedt, and others.  Until the patches have been "
3642 "completely merged into the mainline kernel (this is expected to be around "
3643 "kernel version 2.6.30), they must be installed to achieve the best real-time "
3644 "performance.  These patches are named:"
3645 msgstr ""
3646
3647 #. type: Plain text
3648 #: build/C/man2/sched_setscheduler.2:504
3649 #, no-wrap
3650 msgid "patch-I<kernelversion>-rtI<patchversion>\n"
3651 msgstr ""
3652
3653 #. type: Plain text
3654 #: build/C/man2/sched_setscheduler.2:510
3655 msgid ""
3656 "and can be downloaded from E<.UR "
3657 "http://www.kernel.org\\:/pub\\:/linux\\:/kernel\\:/projects\\:/rt/> E<.UE .>"
3658 msgstr ""
3659
3660 #. type: Plain text
3661 #: build/C/man2/sched_setscheduler.2:519
3662 msgid ""
3663 "Without the patches and prior to their full inclusion into the mainline "
3664 "kernel, the kernel configuration offers only the three preemption classes "
3665 "B<CONFIG_PREEMPT_NONE>, B<CONFIG_PREEMPT_VOLUNTARY>, and "
3666 "B<CONFIG_PREEMPT_DESKTOP> which respectively provide no, some, and "
3667 "considerable reduction of the worst-case scheduling latency."
3668 msgstr ""
3669
3670 #. type: Plain text
3671 #: build/C/man2/sched_setscheduler.2:530
3672 msgid ""
3673 "With the patches applied or after their full inclusion into the mainline "
3674 "kernel, the additional configuration item B<CONFIG_PREEMPT_RT> becomes "
3675 "available.  If this is selected, Linux is transformed into a regular "
3676 "real-time operating system.  The FIFO and RR scheduling policies that can be "
3677 "selected using B<sched_setscheduler>()  are then used to run a process with "
3678 "true real-time priority and a minimum worst-case scheduling latency."
3679 msgstr ""
3680
3681 #. type: Plain text
3682 #: build/C/man2/sched_setscheduler.2:538
3683 msgid ""
3684 "POSIX says that on success, B<sched_setscheduler>()  should return the "
3685 "previous scheduling policy.  Linux B<sched_setscheduler>()  does not conform "
3686 "to this requirement, since it always returns 0 on success."
3687 msgstr ""
3688
3689 #. type: Plain text
3690 #: build/C/man2/sched_setscheduler.2:559
3691 msgid ""
3692 "B<chrt>(1), B<getpriority>(2), B<mlock>(2), B<mlockall>(2), B<munlock>(2), "
3693 "B<munlockall>(2), B<nice>(2), B<sched_get_priority_max>(2), "
3694 "B<sched_get_priority_min>(2), B<sched_getaffinity>(2), B<sched_getparam>(2), "
3695 "B<sched_rr_get_interval>(2), B<sched_setaffinity>(2), B<sched_setparam>(2), "
3696 "B<sched_yield>(2), B<setpriority>(2), B<capabilities>(7), B<cpuset>(7)"
3697 msgstr ""
3698
3699 #. type: Plain text
3700 #: build/C/man2/sched_setscheduler.2:566
3701 msgid "The Linux kernel source file I<Documentation/scheduler/sched-rt-group.txt>"
3702 msgstr ""
3703
3704 #. type: TH
3705 #: build/C/man2/sched_yield.2:29
3706 #, no-wrap
3707 msgid "SCHED_YIELD"
3708 msgstr ""
3709
3710 #. type: TH
3711 #: build/C/man2/sched_yield.2:29
3712 #, no-wrap
3713 msgid "2008-10-18"
3714 msgstr ""
3715
3716 #. type: Plain text
3717 #: build/C/man2/sched_yield.2:32
3718 msgid "sched_yield - yield the processor"
3719 msgstr ""
3720
3721 #. type: Plain text
3722 #: build/C/man2/sched_yield.2:36
3723 msgid "B<int sched_yield(void);>"
3724 msgstr ""
3725
3726 #. type: Plain text
3727 #: build/C/man2/sched_yield.2:41
3728 msgid ""
3729 "B<sched_yield>()  causes the calling thread to relinquish the CPU.  The "
3730 "thread is moved to the end of the queue for its static priority and a new "
3731 "thread gets to run."
3732 msgstr ""
3733
3734 #. type: Plain text
3735 #: build/C/man2/sched_yield.2:48
3736 msgid ""
3737 "On success, B<sched_yield>()  returns 0.  On error, -1 is returned, and "
3738 "I<errno> is set appropriately."
3739 msgstr ""
3740
3741 #. type: Plain text
3742 #: build/C/man2/sched_yield.2:52
3743 msgid "In the Linux implementation, B<sched_yield>()  always succeeds."
3744 msgstr ""
3745
3746 #. type: Plain text
3747 #: build/C/man2/sched_yield.2:59
3748 msgid ""
3749 "If the calling thread is the only thread in the highest priority list at "
3750 "that time, it will continue to run after a call to B<sched_yield>()."
3751 msgstr ""
3752
3753 #. type: Plain text
3754 #: build/C/man2/sched_yield.2:65
3755 msgid ""
3756 "POSIX systems on which B<sched_yield>()  is available define "
3757 "B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
3758 msgstr ""
3759
3760 #. type: Plain text
3761 #: build/C/man2/sched_yield.2:78
3762 msgid ""
3763 "Strategic calls to B<sched_yield>()  can improve performance by giving other "
3764 "threads or processes a chance to run when (heavily) contended resources "
3765 "(e.g., mutexes)  have been released by the caller.  Avoid calling "
3766 "B<sched_yield>()  unnecessarily or inappropriately (e.g., when resources "
3767 "needed by other schedulable threads are still held by the caller), since "
3768 "doing so will result in unnecessary context switches, which will degrade "
3769 "system performance."
3770 msgstr ""
3771
3772 #. type: Plain text
3773 #: build/C/man2/sched_yield.2:81
3774 msgid "B<sched_setscheduler>(2)  for a description of Linux scheduling"
3775 msgstr ""
3776
3777 #. type: TH
3778 #: build/C/man2/setns.2:8
3779 #, no-wrap
3780 msgid "SETNS"
3781 msgstr ""
3782
3783 #. type: TH
3784 #: build/C/man2/setns.2:8
3785 #, no-wrap
3786 msgid "2013-01-01"
3787 msgstr ""
3788
3789 #. type: Plain text
3790 #: build/C/man2/setns.2:11
3791 msgid "setns - reassociate thread with a namespace"
3792 msgstr ""
3793
3794 #. type: Plain text
3795 #: build/C/man2/setns.2:17
3796 #, no-wrap
3797 msgid "B<int setns(int >I<fd>B<, int >I<nstype>B<);>\n"
3798 msgstr ""
3799
3800 #. type: Plain text
3801 #: build/C/man2/setns.2:21
3802 msgid ""
3803 "Given a file descriptor referring to a namespace, reassociate the calling "
3804 "thread with that namespace."
3805 msgstr ""
3806
3807 #. type: Plain text
3808 #: build/C/man2/setns.2:34
3809 msgid ""
3810 "The I<fd> argument is a file descriptor referring to one of the namespace "
3811 "entries in a I</proc/[pid]/ns/> directory; see B<proc>(5)  for further "
3812 "information on I</proc/[pid]/ns/>.  The calling thread will be reassociated "
3813 "with the corresponding namespace, subject to any constraints imposed by the "
3814 "I<nstype> argument."
3815 msgstr ""
3816
3817 #. type: Plain text
3818 #: build/C/man2/setns.2:40
3819 msgid ""
3820 "The I<nstype> argument specifies which type of namespace the calling thread "
3821 "may be reassociated with.  This argument can have one of the following "
3822 "values:"
3823 msgstr ""
3824
3825 #. type: TP
3826 #: build/C/man2/setns.2:40
3827 #, no-wrap
3828 msgid "B<0>"
3829 msgstr ""
3830
3831 #. type: Plain text
3832 #: build/C/man2/setns.2:43
3833 msgid "Allow any type of namespace to be joined."
3834 msgstr ""
3835
3836 #. type: TP
3837 #: build/C/man2/setns.2:43
3838 #, no-wrap
3839 msgid "B<CLONE_NEWIPC>"
3840 msgstr ""
3841
3842 #. type: Plain text
3843 #: build/C/man2/setns.2:47
3844 msgid "I<fd> must refer to an IPC namespace."
3845 msgstr ""
3846
3847 #. type: TP
3848 #: build/C/man2/setns.2:47
3849 #, no-wrap
3850 msgid "B<CLONE_NEWNET>"
3851 msgstr ""
3852
3853 #. type: Plain text
3854 #: build/C/man2/setns.2:51
3855 msgid "I<fd> must refer to a network namespace."
3856 msgstr ""
3857
3858 #. type: TP
3859 #: build/C/man2/setns.2:51
3860 #, no-wrap
3861 msgid "B<CLONE_NEWUTS>"
3862 msgstr ""
3863
3864 #. type: Plain text
3865 #: build/C/man2/setns.2:55
3866 msgid "I<fd> must refer to a UTS namespace."
3867 msgstr ""
3868
3869 #. type: Plain text
3870 #: build/C/man2/setns.2:70
3871 msgid ""
3872 "Specifying I<nstype> as 0 suffices if the caller knows (or does not care)  "
3873 "what type of namespace is referred to by I<fd>.  Specifying a nonzero value "
3874 "for I<nstype> is useful if the caller does not know what type of namespace "
3875 "is referred to by I<fd> and wants to ensure that the namespace is of a "
3876 "particular type.  (The caller might not know the type of the namespace "
3877 "referred to by I<fd> if the file descriptor was opened by another process "
3878 "and, for example, passed to the caller via a UNIX domain socket.)"
3879 msgstr ""
3880
3881 #. type: Plain text
3882 #: build/C/man2/setns.2:77
3883 msgid ""
3884 "On success, I<setns>()  returns 0.  On failure, -1 is returned and I<errno> "
3885 "is set to indicate the error."
3886 msgstr ""
3887
3888 #. type: Plain text
3889 #: build/C/man2/setns.2:82
3890 msgid "I<fd> is not a valid file descriptor."
3891 msgstr ""
3892
3893 #. type: Plain text
3894 #: build/C/man2/setns.2:89
3895 msgid ""
3896 "I<fd> refers to a namespace whose type does not match that specified in "
3897 "I<nstype>, or there is problem with reassociating the the thread with the "
3898 "specified namespace."
3899 msgstr ""
3900
3901 #. type: Plain text
3902 #: build/C/man2/setns.2:92
3903 msgid "Cannot allocate sufficient memory to change the specified namespace."
3904 msgstr ""
3905
3906 #. type: Plain text
3907 #: build/C/man2/setns.2:97
3908 msgid ""
3909 "The calling thread did not have the required privilege (B<CAP_SYS_ADMIN>)  "
3910 "for this operation."
3911 msgstr ""
3912
3913 #. type: Plain text
3914 #: build/C/man2/setns.2:102
3915 msgid ""
3916 "The B<setns>()  system call first appeared in Linux in kernel 3.0; library "
3917 "support was added to glibc in version 2.14."
3918 msgstr ""
3919
3920 #. type: Plain text
3921 #: build/C/man2/setns.2:106
3922 msgid "The B<setns>()  system call is Linux-specific."
3923 msgstr ""
3924
3925 #. type: Plain text
3926 #: build/C/man2/setns.2:112
3927 msgid ""
3928 "Not all of the attributes that can be shared when a new thread is created "
3929 "using B<clone>(2)  can be changed using B<setns>()."
3930 msgstr ""
3931
3932 #. type: Plain text
3933 #: build/C/man2/setns.2:121
3934 msgid ""
3935 "The program below takes two or more arguments.  The first argument specifies "
3936 "the pathname of a namespace file in an existing I</proc/[pid]/ns/> "
3937 "directory.  The remaining arguments specify a command and its arguments.  "
3938 "The program opens the namespace file, joins that namespace using B<setns>(), "
3939 "and executes the specified command inside that namespace."
3940 msgstr ""
3941
3942 #. type: Plain text
3943 #: build/C/man2/setns.2:131
3944 msgid ""
3945 "The following shell session demonstrates the use of this program (compiled "
3946 "as a binary named I<ns_exec>)  in conjunction with the B<CLONE_NEWUTS> "
3947 "example program in the B<clone>(2)  man page (complied as a binary named "
3948 "I<newuts>)."
3949 msgstr ""
3950
3951 #. type: Plain text
3952 #: build/C/man2/setns.2:139
3953 msgid ""
3954 "We begin by executing the example program in B<clone>(2)  in the "
3955 "background.  That program creates a child in a separate UTS namespace.  The "
3956 "child changes the hostname in its namespace, and then both processes display "
3957 "the hostnames in their UTS namespaces, so that we can see that they are "
3958 "different."
3959 msgstr ""
3960
3961 #. type: Plain text
3962 #: build/C/man2/setns.2:151
3963 #, no-wrap
3964 msgid ""
3965 "$ B<su>                   # Need privilege for namespace operations\n"
3966 "Password:\n"
3967 "# B<./newuts bizarro &>\n"
3968 "[1] 3549\n"
3969 "clone() returned 3550\n"
3970 "uts.nodename in child:  bizarro\n"
3971 "uts.nodename in parent: antero\n"
3972 "# B<uname -n>             # Verify hostname in the shell\n"
3973 "antero\n"
3974 msgstr ""
3975
3976 #. type: Plain text
3977 #: build/C/man2/setns.2:158
3978 msgid ""
3979 "We then run the program shown below, using it to execute a shell.  Inside "
3980 "that shell, we verify that the hostname is the one set by the child created "
3981 "by the first program:"
3982 msgstr ""
3983
3984 #. type: Plain text
3985 #: build/C/man2/setns.2:164
3986 #, no-wrap
3987 msgid ""
3988 "# B<./ns_exec /proc/3550/ns/uts /bin/bash>\n"
3989 "# B<uname -n>             # Executed in shell started by ns_exec\n"
3990 "bizarro\n"
3991 msgstr ""
3992
3993 #. type: SS
3994 #: build/C/man2/setns.2:166
3995 #, no-wrap
3996 msgid "Program source"
3997 msgstr ""
3998
3999 #. type: Plain text
4000 #: build/C/man2/setns.2:174
4001 #, no-wrap
4002 msgid ""
4003 "#define _GNU_SOURCE\n"
4004 "#include E<lt>fcntl.hE<gt>\n"
4005 "#include E<lt>sched.hE<gt>\n"
4006 "#include E<lt>unistd.hE<gt>\n"
4007 "#include E<lt>stdlib.hE<gt>\n"
4008 "#include E<lt>stdio.hE<gt>\n"
4009 msgstr ""
4010
4011 #. type: Plain text
4012 #: build/C/man2/setns.2:182
4013 #, no-wrap
4014 msgid ""
4015 "int\n"
4016 "main(int argc, char *argv[])\n"
4017 "{\n"
4018 "    int fd;\n"
4019 msgstr ""
4020
4021 #. type: Plain text
4022 #: build/C/man2/setns.2:187
4023 #, no-wrap
4024 msgid ""
4025 "    if (argc E<lt> 3) {\n"
4026 "        fprintf(stderr, \"%s /proc/PID/ns/FILE cmd args...\\en\", "
4027 "argv[0]);\n"
4028 "        exit(EXIT_FAILURE);\n"
4029 "    }\n"
4030 msgstr ""
4031
4032 #. type: Plain text
4033 #: build/C/man2/setns.2:191
4034 #, no-wrap
4035 msgid ""
4036 "    fd = open(argv[1], O_RDONLY);   /* Get descriptor for namespace */\n"
4037 "    if (fd == -1)\n"
4038 "        errExit(\"open\");\n"
4039 msgstr ""
4040
4041 #. type: Plain text
4042 #: build/C/man2/setns.2:194
4043 #, no-wrap
4044 msgid ""
4045 "    if (setns(fd, 0) == -1)         /* Join that namespace */\n"
4046 "        errExit(\"setns\");\n"
4047 msgstr ""
4048
4049 #. type: Plain text
4050 #: build/C/man2/setns.2:198
4051 #, no-wrap
4052 msgid ""
4053 "    execvp(argv[2], &argv[2]);      /* Execute a command in namespace */\n"
4054 "    errExit(\"execvp\");\n"
4055 "}\n"
4056 msgstr ""
4057
4058 #. type: Plain text
4059 #: build/C/man2/setns.2:205
4060 msgid "B<clone>(2), B<fork>(2), B<vfork>(2), B<proc>(5), B<unix>(7)"
4061 msgstr ""
4062
4063 #. type: TH
4064 #: build/C/man2/unshare.2:20
4065 #, no-wrap
4066 msgid "UNSHARE"
4067 msgstr ""
4068
4069 #. type: Plain text
4070 #: build/C/man2/unshare.2:23
4071 msgid "unshare - disassociate parts of the process execution context"
4072 msgstr ""
4073
4074 #. type: Plain text
4075 #: build/C/man2/unshare.2:28
4076 #, no-wrap
4077 msgid "B<int unshare(int >I<flags>B<);>\n"
4078 msgstr ""
4079
4080 #. type: Plain text
4081 #: build/C/man2/unshare.2:36
4082 msgid "B<unshare>():"
4083 msgstr ""
4084
4085 #. type: Plain text
4086 #: build/C/man2/unshare.2:62
4087 msgid ""
4088 "B<unshare>()  allows a process to disassociate parts of its execution "
4089 "context that are currently being shared with other processes.  Part of the "
4090 "execution context, such as the mount namespace, is shared implicitly when a "
4091 "new process is created using B<fork>(2)  or B<vfork>(2), while other parts, "
4092 "such as virtual memory, may be shared by explicit request when creating a "
4093 "process using B<clone>(2)."
4094 msgstr ""
4095
4096 #. type: Plain text
4097 #: build/C/man2/unshare.2:67
4098 msgid ""
4099 "The main use of B<unshare>()  is to allow a process to control its shared "
4100 "execution context without creating a new process."
4101 msgstr ""
4102
4103 #. type: Plain text
4104 #: build/C/man2/unshare.2:74
4105 msgid ""
4106 "The I<flags> argument is a bit mask that specifies which parts of the "
4107 "execution context should be unshared.  This argument is specified by ORing "
4108 "together zero or more of the following constants:"
4109 msgstr ""
4110
4111 #. type: TP
4112 #: build/C/man2/unshare.2:74
4113 #, no-wrap
4114 msgid "B<CLONE_FILES>"
4115 msgstr ""
4116
4117 #. type: Plain text
4118 #: build/C/man2/unshare.2:82
4119 msgid ""
4120 "Reverse the effect of the B<clone>(2)  B<CLONE_FILES> flag.  Unshare the "
4121 "file descriptor table, so that the calling process no longer shares its file "
4122 "descriptors with any other process."
4123 msgstr ""
4124
4125 #. type: TP
4126 #: build/C/man2/unshare.2:82
4127 #, no-wrap
4128 msgid "B<CLONE_FS>"
4129 msgstr ""
4130
4131 #. type: Plain text
4132 #: build/C/man2/unshare.2:96
4133 msgid ""
4134 "Reverse the effect of the B<clone>(2)  B<CLONE_FS> flag.  Unshare file "
4135 "system attributes, so that the calling process no longer shares its root "
4136 "directory (B<chroot>(2)), current directory (B<chdir>(2)), or umask "
4137 "(B<umask>(2))  attributes with any other process."
4138 msgstr ""
4139
4140 #. type: Plain text
4141 #: build/C/man2/unshare.2:113
4142 msgid ""
4143 "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWIPC> flag.  "
4144 "Unshare the System V IPC namespace, so that the calling process has a "
4145 "private copy of the System V IPC namespace which is not shared with any "
4146 "other process.  Specifying this flag automatically implies B<CLONE_SYSVSEM> "
4147 "as well.  Use of B<CLONE_NEWIPC> requires the B<CAP_SYS_ADMIN> capability."
4148 msgstr ""
4149
4150 #. type: Plain text
4151 #: build/C/man2/unshare.2:128
4152 msgid ""
4153 "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWNET> flag.  "
4154 "Unshare the network namespace, so that the calling process is moved into a "
4155 "new network namespace which is not shared with any previously existing "
4156 "process.  Use of B<CLONE_NEWNET> requires the B<CAP_SYS_ADMIN> capability."
4157 msgstr ""
4158
4159 #. type: TP
4160 #: build/C/man2/unshare.2:128
4161 #, no-wrap
4162 msgid "B<CLONE_NEWNS>"
4163 msgstr ""
4164
4165 #.  These flag name are inconsistent:
4166 #.  CLONE_NEWNS does the same thing in clone(), but CLONE_VM,
4167 #.  CLONE_FS, and CLONE_FILES reverse the action of the clone()
4168 #.  flags of the same name.
4169 #. type: Plain text
4170 #: build/C/man2/unshare.2:149
4171 msgid ""
4172 "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWNS> flag.  "
4173 "Unshare the mount namespace, so that the calling process has a private copy "
4174 "of its namespace which is not shared with any other process.  Specifying "
4175 "this flag automatically implies B<CLONE_FS> as well.  Use of B<CLONE_NEWNS> "
4176 "requires the B<CAP_SYS_ADMIN> capability."
4177 msgstr ""
4178
4179 #. type: Plain text
4180 #: build/C/man2/unshare.2:163
4181 msgid ""
4182 "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWUTS> flag.  "
4183 "Unshare the UTS IPC namespace, so that the calling process has a private "
4184 "copy of the UTS namespace which is not shared with any other process.  Use "
4185 "of B<CLONE_NEWUTS> requires the B<CAP_SYS_ADMIN> capability."
4186 msgstr ""
4187
4188 #. type: TP
4189 #: build/C/man2/unshare.2:163
4190 #, no-wrap
4191 msgid "B<CLONE_SYSVSEM> (since Linux 2.6.26)"
4192 msgstr ""
4193
4194 #.  commit 9edff4ab1f8d82675277a04e359d0ed8bf14a7b7
4195 #.  As at 2.6.16, the following forced implications also apply,
4196 #.  although the relevant flags are not yet implemented.
4197 #.  If CLONE_THREAD is set force CLONE_VM.
4198 #.  If CLONE_VM is set, force CLONE_SIGHAND.
4199 #.  CLONE_NEWNSIf CLONE_SIGHAND is set and signals are also being shared
4200 #.  (i.e., current->signal->count > 1), force CLONE_THREAD.
4201 #
4202 #.  FIXME . CLONE_VM is not (yet, as at 2.6.16) implemented.
4203 #.  .TP
4204 #.  .B CLONE_VM
4205 #.  Reverse the effect of the
4206 #.  .BR clone (2)
4207 #.  .B CLONE_VM
4208 #.  flag.
4209 #.  .RB ( CLONE_VM
4210 #.  is also implicitly set by
4211 #.  .BR vfork (2),
4212 #.  and can be reversed using this
4213 #.  .BR unshare ()
4214 #.  flag.)
4215 #.  Unshare virtual memory, so that the calling process no
4216 #.  longer shares its virtual address space with any other process.
4217 #. type: Plain text
4218 #: build/C/man2/unshare.2:200
4219 msgid ""
4220 "This flag reverses the effect of the B<clone>(2)  B<CLONE_SYSVSEM> flag.  "
4221 "Unshare System V semaphore undo values, so that the calling process has a "
4222 "private copy which is not shared with any other process.  Use of "
4223 "B<CLONE_SYSVSEM> requires the B<CAP_SYS_ADMIN> capability."
4224 msgstr ""
4225
4226 #. type: Plain text
4227 #: build/C/man2/unshare.2:207
4228 msgid ""
4229 "If I<flags> is specified as zero, then B<unshare>()  is a no-op; no changes "
4230 "are made to the calling process's execution context."
4231 msgstr ""
4232
4233 #. type: Plain text
4234 #: build/C/man2/unshare.2:212
4235 msgid ""
4236 "On success, zero returned.  On failure, -1 is returned and I<errno> is set "
4237 "to indicate the error."
4238 msgstr ""
4239
4240 #. type: Plain text
4241 #: build/C/man2/unshare.2:217
4242 msgid "An invalid bit was specified in I<flags>."
4243 msgstr ""
4244
4245 #. type: Plain text
4246 #: build/C/man2/unshare.2:221
4247 msgid ""
4248 "Cannot allocate sufficient memory to copy parts of caller's context that "
4249 "need to be unshared."
4250 msgstr ""
4251
4252 #. type: Plain text
4253 #: build/C/man2/unshare.2:224
4254 msgid "The calling process did not have the required privileges for this operation."
4255 msgstr ""
4256
4257 #. type: Plain text
4258 #: build/C/man2/unshare.2:228
4259 msgid "The B<unshare>()  system call was added to Linux in kernel 2.6.16."
4260 msgstr ""
4261
4262 #. type: Plain text
4263 #: build/C/man2/unshare.2:232
4264 msgid "The B<unshare>()  system call is Linux-specific."
4265 msgstr ""
4266
4267 #.  FIXME all of the following needs to be reviewed for the current kernel
4268 #.  However, we can do unshare(CLONE_SIGHAND) if CLONE_SIGHAND
4269 #.  was not specified when doing clone(); i.e., unsharing
4270 #.  signal handlers is permitted if we are not actually
4271 #.  sharing signal handlers.   mtk
4272 #.  However, we can do unshare(CLONE_VM) if CLONE_VM
4273 #.  was not specified when doing clone(); i.e., unsharing
4274 #.  virtual memory is permitted if we are not actually
4275 #.  sharing virtual memory.   mtk
4276 #
4277 #. 9) Future Work
4278 #. --------------
4279 #. The current implementation of unshare does not allow unsharing of
4280 #. signals and signal handlers. Signals are complex to begin with and
4281 #. to unshare signals and/or signal handlers of a currently running
4282 #. process is even more complex. If in the future there is a specific
4283 #. need to allow unsharing of signals and/or signal handlers, it can
4284 #. be incrementally added to unshare without affecting legacy
4285 #. applications using unshare.
4286 #. type: Plain text
4287 #: build/C/man2/unshare.2:266
4288 msgid ""
4289 "Not all of the process attributes that can be shared when a new process is "
4290 "created using B<clone>(2)  can be unshared using B<unshare>().  In "
4291 "particular, as at kernel 3.8, B<unshare>()  does not implement flags that "
4292 "reverse the effects of B<CLONE_SIGHAND>, B<CLONE_THREAD>, or B<CLONE_VM>.  "
4293 "Such functionality may be added in the future, if required."
4294 msgstr ""
4295
4296 #. type: Plain text
4297 #: build/C/man2/unshare.2:272
4298 msgid "B<clone>(2), B<fork>(2), B<kcmp>(2), B<setns>(2), B<vfork>(2)"
4299 msgstr ""
4300
4301 #. type: Plain text
4302 #: build/C/man2/unshare.2:275
4303 msgid "I<Documentation/unshare.txt> in the Linux kernel source tree"
4304 msgstr ""