OSDN Git Service

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