OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.38.
[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: 2012-04-23 07:54+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:25
21 #, no-wrap
22 msgid "CPU_SET"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man3/CPU_SET.3:25
27 #, no-wrap
28 msgid "2012-03-15"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man3/CPU_SET.3:25 build/C/man2/clone.2:43 build/C/man2/sched_get_priority_max.2:30 build/C/man3/sched_getcpu.3:24 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:4 build/C/man2/unshare.2:17
33 #, no-wrap
34 msgid "Linux"
35 msgstr ""
36
37 #. type: TH
38 #: build/C/man3/CPU_SET.3:25 build/C/man2/clone.2:43 build/C/man2/sched_get_priority_max.2:30 build/C/man3/sched_getcpu.3:24 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:4 build/C/man2/unshare.2:17
39 #, no-wrap
40 msgid "Linux Programmer's Manual"
41 msgstr ""
42
43 #. type: SH
44 #: build/C/man3/CPU_SET.3:26 build/C/man2/clone.2:44 build/C/man2/sched_get_priority_max.2:31 build/C/man3/sched_getcpu.3:25 build/C/man2/sched_rr_get_interval.2:31 build/C/man2/sched_setaffinity.2:36 build/C/man2/sched_setparam.2:32 build/C/man2/sched_setscheduler.2:48 build/C/man2/sched_yield.2:31 build/C/man2/setns.2:5 build/C/man2/unshare.2:18
45 #, no-wrap
46 msgid "NAME"
47 msgstr ""
48
49 #. type: Plain text
50 #: build/C/man3/CPU_SET.3:33
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:33 build/C/man2/clone.2:46 build/C/man2/sched_get_priority_max.2:33 build/C/man3/sched_getcpu.3:27 build/C/man2/sched_rr_get_interval.2:33 build/C/man2/sched_setaffinity.2:39 build/C/man2/sched_setparam.2:34 build/C/man2/sched_setscheduler.2:51 build/C/man2/sched_yield.2:33 build/C/man2/setns.2:7 build/C/man2/unshare.2:20
60 #, no-wrap
61 msgid "SYNOPSIS"
62 msgstr ""
63
64 #.  Actually _BSD_SOURCE || _SVID_SOURCE
65 #.  See http://sources.redhat.com/bugzilla/show_bug.cgi?id=4749
66 #. type: Plain text
67 #: build/C/man3/CPU_SET.3:37 build/C/man2/clone.2:52 build/C/man2/sched_setaffinity.2:43 build/C/man2/setns.2:11 build/C/man2/unshare.2:26
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:39
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:43
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:45
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:52
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:54
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:58
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:60
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:64
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:66
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:73
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:76
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:77 build/C/man2/clone.2:58 build/C/man2/sched_get_priority_max.2:39 build/C/man3/sched_getcpu.3:35 build/C/man2/sched_rr_get_interval.2:37 build/C/man2/sched_setaffinity.2:50 build/C/man2/sched_setparam.2:48 build/C/man2/sched_setscheduler.2:67 build/C/man2/sched_yield.2:37 build/C/man2/setns.2:14 build/C/man2/unshare.2:29
168 #, no-wrap
169 msgid "DESCRIPTION"
170 msgstr ""
171
172 #. type: Plain text
173 #: build/C/man3/CPU_SET.3:84
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:91
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:94
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:94
194 #, no-wrap
195 msgid "B<CPU_ZERO>()"
196 msgstr ""
197
198 #. type: Plain text
199 #: build/C/man3/CPU_SET.3:99
200 msgid "Clears I<set>, so that it contains no CPUs."
201 msgstr ""
202
203 #. type: TP
204 #: build/C/man3/CPU_SET.3:99
205 #, no-wrap
206 msgid "B<CPU_SET>()"
207 msgstr ""
208
209 #. type: Plain text
210 #: build/C/man3/CPU_SET.3:105
211 msgid "Add CPU I<cpu> to I<set>."
212 msgstr ""
213
214 #. type: TP
215 #: build/C/man3/CPU_SET.3:105
216 #, no-wrap
217 msgid "B<CPU_CLR>()"
218 msgstr ""
219
220 #. type: Plain text
221 #: build/C/man3/CPU_SET.3:111
222 msgid "Remove CPU I<cpu> from I<set>."
223 msgstr ""
224
225 #. type: TP
226 #: build/C/man3/CPU_SET.3:111
227 #, no-wrap
228 msgid "B<CPU_ISSET>()"
229 msgstr ""
230
231 #. type: Plain text
232 #: build/C/man3/CPU_SET.3:117
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:117
238 #, no-wrap
239 msgid "B<CPU_COUNT>()"
240 msgstr ""
241
242 #. type: Plain text
243 #: build/C/man3/CPU_SET.3:121
244 msgid "Return the number of CPUs in I<set>."
245 msgstr ""
246
247 #. type: Plain text
248 #: build/C/man3/CPU_SET.3:126
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:137
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:139
265 msgid "The following macros perform logical operations on CPU sets:"
266 msgstr ""
267
268 #. type: TP
269 #: build/C/man3/CPU_SET.3:139
270 #, no-wrap
271 msgid "B<CPU_AND>()"
272 msgstr ""
273
274 #. type: Plain text
275 #: build/C/man3/CPU_SET.3:148
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:148
283 #, no-wrap
284 msgid "B<CPU_OR>()"
285 msgstr ""
286
287 #. type: Plain text
288 #: build/C/man3/CPU_SET.3:157
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:157
296 #, no-wrap
297 msgid "B<CPU_XOR>()"
298 msgstr ""
299
300 #. type: Plain text
301 #: build/C/man3/CPU_SET.3:171
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:171
310 #, no-wrap
311 msgid "B<CPU_EQUAL>()"
312 msgstr ""
313
314 #. type: Plain text
315 #: build/C/man3/CPU_SET.3:174
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:174
321 #, no-wrap
322 msgid "Dynamically sized CPU sets"
323 msgstr ""
324
325 #. type: Plain text
326 #: build/C/man3/CPU_SET.3:180
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:182
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:182
341 #, no-wrap
342 msgid "B<CPU_ALLOC>()"
343 msgstr ""
344
345 #. type: Plain text
346 #: build/C/man3/CPU_SET.3:187
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:187
354 #, no-wrap
355 msgid "B<CPU_ALLOC_SIZE>()"
356 msgstr ""
357
358 #. type: Plain text
359 #: build/C/man3/CPU_SET.3:197
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:197
369 #, no-wrap
370 msgid "B<CPU_FREE>()"
371 msgstr ""
372
373 #. type: Plain text
374 #: build/C/man3/CPU_SET.3:201
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:208
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:208 build/C/man2/clone.2:792 build/C/man2/sched_get_priority_max.2:87 build/C/man3/sched_getcpu.3:38 build/C/man2/sched_rr_get_interval.2:74 build/C/man2/sched_setaffinity.2:108 build/C/man2/sched_setparam.2:88 build/C/man2/sched_setscheduler.2:423 build/C/man2/sched_yield.2:42 build/C/man2/setns.2:66 build/C/man2/unshare.2:183
389 #, no-wrap
390 msgid "RETURN VALUE"
391 msgstr ""
392
393 #. type: Plain text
394 #: build/C/man3/CPU_SET.3:217
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:223
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:228
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:233
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:237
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:239
428 msgid "The other functions do not return a value."
429 msgstr ""
430
431 #. type: SH
432 #: build/C/man3/CPU_SET.3:239 build/C/man2/clone.2:909 build/C/man3/sched_getcpu.3:50 build/C/man2/sched_setaffinity.2:149 build/C/man2/setns.2:93 build/C/man2/unshare.2:200
433 #, no-wrap
434 msgid "VERSIONS"
435 msgstr ""
436
437 #. type: Plain text
438 #: build/C/man3/CPU_SET.3:247
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:250
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:268
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:268 build/C/man2/clone.2:916 build/C/man2/sched_get_priority_max.2:101 build/C/man3/sched_getcpu.3:52 build/C/man2/sched_rr_get_interval.2:95 build/C/man2/sched_setaffinity.2:160 build/C/man2/sched_setparam.2:111 build/C/man2/sched_setscheduler.2:445 build/C/man2/sched_yield.2:53 build/C/man2/setns.2:97 build/C/man2/unshare.2:204
460 #, no-wrap
461 msgid "CONFORMING TO"
462 msgstr ""
463
464 #. type: Plain text
465 #: build/C/man3/CPU_SET.3:270
466 msgid "These interfaces are Linux-specific."
467 msgstr ""
468
469 #. type: SH
470 #: build/C/man3/CPU_SET.3:270 build/C/man2/clone.2:923 build/C/man3/sched_getcpu.3:55 build/C/man2/sched_rr_get_interval.2:97 build/C/man2/sched_setaffinity.2:162 build/C/man2/sched_setscheduler.2:448 build/C/man2/sched_yield.2:55 build/C/man2/setns.2:101 build/C/man2/unshare.2:208
471 #, no-wrap
472 msgid "NOTES"
473 msgstr ""
474
475 #. type: Plain text
476 #: build/C/man3/CPU_SET.3:273
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:280
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:292
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:298
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:298 build/C/man2/clone.2:970 build/C/man2/sched_setscheduler.2:509 build/C/man2/setns.2:107
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:310
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:310
527 #, no-wrap
528 msgid "EXAMPLE"
529 msgstr ""
530
531 #. type: Plain text
532 #: build/C/man3/CPU_SET.3:313
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:321
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:328
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:333
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:335
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:341
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:343
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:347
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:349
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:353
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:354 build/C/man2/clone.2:1012 build/C/man2/sched_get_priority_max.2:103 build/C/man3/sched_getcpu.3:75 build/C/man2/sched_rr_get_interval.2:126 build/C/man2/sched_setaffinity.2:215 build/C/man2/sched_setparam.2:113 build/C/man2/sched_setscheduler.2:517 build/C/man2/sched_yield.2:79 build/C/man2/setns.2:115 build/C/man2/unshare.2:244
621 #, no-wrap
622 msgid "SEE ALSO"
623 msgstr ""
624
625 #. type: Plain text
626 #: build/C/man3/CPU_SET.3:359
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:359 build/C/man2/clone.2:1024 build/C/man2/sched_get_priority_max.2:113 build/C/man3/sched_getcpu.3:77 build/C/man2/sched_rr_get_interval.2:132 build/C/man2/sched_setaffinity.2:231 build/C/man2/sched_setparam.2:127 build/C/man2/sched_setscheduler.2:542 build/C/man2/sched_yield.2:85 build/C/man2/setns.2:121 build/C/man2/unshare.2:249
634 #, no-wrap
635 msgid "COLOPHON"
636 msgstr ""
637
638 #. type: Plain text
639 #: build/C/man3/CPU_SET.3:366 build/C/man2/clone.2:1031 build/C/man2/sched_get_priority_max.2:120 build/C/man3/sched_getcpu.3:84 build/C/man2/sched_rr_get_interval.2:139 build/C/man2/sched_setaffinity.2:238 build/C/man2/sched_setparam.2:134 build/C/man2/sched_setscheduler.2:549 build/C/man2/sched_yield.2:92 build/C/man2/setns.2:128 build/C/man2/unshare.2:256
640 msgid ""
641 "This page is part of release 3.38 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:43
648 #, no-wrap
649 msgid "CLONE"
650 msgstr ""
651
652 #. type: TH
653 #: build/C/man2/clone.2:43
654 #, no-wrap
655 msgid "2011-09-08"
656 msgstr ""
657
658 #. type: Plain text
659 #: build/C/man2/clone.2:46
660 msgid "clone, __clone2 - create a child process"
661 msgstr ""
662
663 #. type: Plain text
664 #: build/C/man2/clone.2:57
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:69
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:81
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:86
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:107
701 msgid ""
702 "When the child process is created with B<clone>(), it executes the function "
703 "application I<fn>(I<arg>).  (This differs from B<fork>(2), where execution "
704 "continues in the child from the point of the B<fork>(2)  call.)  The I<fn> "
705 "argument is a pointer to a function that is called by the child process at "
706 "the beginning of its execution.  The I<arg> argument is passed to the I<fn> "
707 "function."
708 msgstr ""
709
710 #. type: Plain text
711 #: build/C/man2/clone.2:117
712 msgid ""
713 "When the I<fn>(I<arg>)  function application returns, the child process "
714 "terminates.  The integer returned by I<fn> is the exit code for the child "
715 "process.  The child process may also terminate explicitly by calling "
716 "B<exit>(2)  or after receiving a fatal signal."
717 msgstr ""
718
719 #. type: Plain text
720 #: build/C/man2/clone.2:133
721 msgid ""
722 "The I<child_stack> argument specifies the location of the stack used by the "
723 "child process.  Since the child and calling process may share memory, it is "
724 "not possible for the child process to execute in the same stack as the "
725 "calling process.  The calling process must therefore set up memory space for "
726 "the child stack and pass a pointer to this space to B<clone>().  Stacks grow "
727 "downward on all processors that run Linux (except the HP PA processors), so "
728 "I<child_stack> usually points to the topmost address of the memory space set "
729 "up for the child stack."
730 msgstr ""
731
732 #. type: Plain text
733 #: build/C/man2/clone.2:149
734 msgid ""
735 "The low byte of I<flags> contains the number of the I<termination signal> "
736 "sent to the parent when the child dies.  If this signal is specified as "
737 "anything other than B<SIGCHLD>, then the parent process must specify the "
738 "B<__WALL> or B<__WCLONE> options when waiting for the child with "
739 "B<wait>(2).  If no signal is specified, then the parent process is not "
740 "signaled when the child terminates."
741 msgstr ""
742
743 #. type: Plain text
744 #: build/C/man2/clone.2:154
745 msgid ""
746 "I<flags> may also be bitwise-or'ed with zero or more of the following "
747 "constants, in order to specify what is shared between the calling process "
748 "and the child process:"
749 msgstr ""
750
751 #. type: TP
752 #: build/C/man2/clone.2:154
753 #, no-wrap
754 msgid "B<CLONE_CHILD_CLEARTID> (since Linux 2.5.49)"
755 msgstr ""
756
757 #. type: Plain text
758 #: build/C/man2/clone.2:164
759 msgid ""
760 "Erase child thread ID at location I<ctid> in child memory when the child "
761 "exits, and do a wakeup on the futex at that address.  The address involved "
762 "may be changed by the B<set_tid_address>(2)  system call.  This is used by "
763 "threading libraries."
764 msgstr ""
765
766 #. type: TP
767 #: build/C/man2/clone.2:164
768 #, no-wrap
769 msgid "B<CLONE_CHILD_SETTID> (since Linux 2.5.49)"
770 msgstr ""
771
772 #. type: Plain text
773 #: build/C/man2/clone.2:169
774 msgid "Store child thread ID at location I<ctid> in child memory."
775 msgstr ""
776
777 #. type: TP
778 #: build/C/man2/clone.2:169 build/C/man2/unshare.2:53
779 #, no-wrap
780 msgid "B<CLONE_FILES>"
781 msgstr ""
782
783 #. type: Plain text
784 #: build/C/man2/clone.2:182
785 msgid ""
786 "If B<CLONE_FILES> is set, the calling process and the child process share "
787 "the same file descriptor table.  Any file descriptor created by the calling "
788 "process or by the child process is also valid in the other process.  "
789 "Similarly, if one of the processes closes a file descriptor, or changes its "
790 "associated flags (using the B<fcntl>(2)  B<F_SETFD> operation), the other "
791 "process is also affected."
792 msgstr ""
793
794 #. type: Plain text
795 #: build/C/man2/clone.2:196
796 msgid ""
797 "If B<CLONE_FILES> is not set, the child process inherits a copy of all file "
798 "descriptors opened in the calling process at the time of B<clone>().  (The "
799 "duplicated file descriptors in the child refer to the same open file "
800 "descriptions (see B<open>(2))  as the corresponding file descriptors in the "
801 "calling process.)  Subsequent operations that open or close file "
802 "descriptors, or change file descriptor flags, performed by either the "
803 "calling process or the child process do not affect the other process."
804 msgstr ""
805
806 #. type: TP
807 #: build/C/man2/clone.2:196 build/C/man2/unshare.2:61
808 #, no-wrap
809 msgid "B<CLONE_FS>"
810 msgstr ""
811
812 #. type: Plain text
813 #: build/C/man2/clone.2:211
814 msgid ""
815 "If B<CLONE_FS> is set, the caller and the child process share the same file "
816 "system information.  This includes the root of the file system, the current "
817 "working directory, and the umask.  Any call to B<chroot>(2), B<chdir>(2), or "
818 "B<umask>(2)  performed by the calling process or the child process also "
819 "affects the other process."
820 msgstr ""
821
822 #. type: Plain text
823 #: build/C/man2/clone.2:223
824 msgid ""
825 "If B<CLONE_FS> is not set, the child process works on a copy of the file "
826 "system information of the calling process at the time of the B<clone>()  "
827 "call.  Calls to B<chroot>(2), B<chdir>(2), B<umask>(2)  performed later by "
828 "one of the processes do not affect the other process."
829 msgstr ""
830
831 #. type: TP
832 #: build/C/man2/clone.2:223
833 #, no-wrap
834 msgid "B<CLONE_IO> (since Linux 2.6.25)"
835 msgstr ""
836
837 #. type: Plain text
838 #: build/C/man2/clone.2:232
839 msgid ""
840 "If B<CLONE_IO> is set, then the new process shares an I/O context with the "
841 "calling process.  If this flag is not set, then (as with B<fork>(2))  the "
842 "new process has its own I/O context."
843 msgstr ""
844
845 #.  The following based on text from Jens Axboe
846 #.  the anticipatory and CFQ scheduler
847 #.  with CFQ and AS.
848 #. type: Plain text
849 #: build/C/man2/clone.2:249
850 msgid ""
851 "The I/O context is the I/O scope of the disk scheduler (i.e, what the I/O "
852 "scheduler uses to model scheduling of a process's I/O).  If processes share "
853 "the same I/O context, they are treated as one by the I/O scheduler.  As a "
854 "consequence, they get to share disk time.  For some I/O schedulers, if two "
855 "processes share an I/O context, they will be allowed to interleave their "
856 "disk access.  If several threads are doing I/O on behalf of the same process "
857 "(B<aio_read>(3), for instance), they should employ B<CLONE_IO> to get better "
858 "I/O performance."
859 msgstr ""
860
861 #. type: Plain text
862 #: build/C/man2/clone.2:253
863 msgid ""
864 "If the kernel is not configured with the B<CONFIG_BLOCK> option, this flag "
865 "is a no-op."
866 msgstr ""
867
868 #. type: TP
869 #: build/C/man2/clone.2:253 build/C/man2/unshare.2:74
870 #, no-wrap
871 msgid "B<CLONE_NEWIPC> (since Linux 2.6.19)"
872 msgstr ""
873
874 #. type: Plain text
875 #: build/C/man2/clone.2:263
876 msgid ""
877 "If B<CLONE_NEWIPC> is set, then create the process in a new IPC namespace.  "
878 "If this flag is not set, then (as with B<fork>(2)), the process is created "
879 "in the same IPC namespace as the calling process.  This flag is intended for "
880 "the implementation of containers."
881 msgstr ""
882
883 #. type: Plain text
884 #: build/C/man2/clone.2:274
885 msgid ""
886 "An IPC namespace consists of the set of identifiers for System V IPC "
887 "objects.  (These objects are created using B<msgctl>(2), B<semctl>(2), and "
888 "B<shmctl>(2)).  Objects created in an IPC namespace are visible to all other "
889 "processes that are members of that namespace, but are not visible to "
890 "processes in other IPC namespaces."
891 msgstr ""
892
893 #. type: Plain text
894 #: build/C/man2/clone.2:278
895 msgid ""
896 "When an IPC namespace is destroyed (i.e, when the last process that is a "
897 "member of the namespace terminates), all IPC objects in the namespace are "
898 "automatically destroyed."
899 msgstr ""
900
901 #. type: Plain text
902 #: build/C/man2/clone.2:287
903 msgid ""
904 "Use of this flag requires: a kernel configured with the B<CONFIG_SYSVIPC> "
905 "and B<CONFIG_IPC_NS> options and that the process be privileged "
906 "(B<CAP_SYS_ADMIN>).  This flag can't be specified in conjunction with "
907 "B<CLONE_SYSVSEM>."
908 msgstr ""
909
910 #. type: TP
911 #: build/C/man2/clone.2:287 build/C/man2/unshare.2:91
912 #, no-wrap
913 msgid "B<CLONE_NEWNET> (since Linux 2.6.24)"
914 msgstr ""
915
916 #.  FIXME Check when the implementation was completed
917 #. type: Plain text
918 #: build/C/man2/clone.2:292
919 msgid ""
920 "(The implementation of this flag was only completed by about kernel version "
921 "2.6.29.)"
922 msgstr ""
923
924 #. type: Plain text
925 #: build/C/man2/clone.2:301
926 msgid ""
927 "If B<CLONE_NEWNET> is set, then create the process in a new network "
928 "namespace.  If this flag is not set, then (as with B<fork>(2)), the process "
929 "is created in the same network namespace as the calling process.  This flag "
930 "is intended for the implementation of containers."
931 msgstr ""
932
933 #. type: Plain text
934 #: build/C/man2/clone.2:315
935 msgid ""
936 "A network namespace provides an isolated view of the networking stack "
937 "(network device interfaces, IPv4 and IPv6 protocol stacks, IP routing "
938 "tables, firewall rules, the I</proc/net> and I</sys/class/net> directory "
939 "trees, sockets, etc.).  A physical network device can live in exactly one "
940 "network namespace.  A virtual network device (\"veth\") pair provides a "
941 "pipe-like abstraction that can be used to create tunnels between network "
942 "namespaces, and can be used to create a bridge to a physical network device "
943 "in another namespace."
944 msgstr ""
945
946 #. type: Plain text
947 #: build/C/man2/clone.2:320
948 msgid ""
949 "When a network namespace is freed (i.e., when the last process in the "
950 "namespace terminates), its physical network devices are moved back to the "
951 "initial network namespace (not to the parent of the process)."
952 msgstr ""
953
954 #. type: Plain text
955 #: build/C/man2/clone.2:325
956 msgid ""
957 "Use of this flag requires: a kernel configured with the B<CONFIG_NET_NS> "
958 "option and that the process be privileged (B<CAP_SYS_ADMIN>)."
959 msgstr ""
960
961 #. type: TP
962 #: build/C/man2/clone.2:325
963 #, no-wrap
964 msgid "B<CLONE_NEWNS> (since Linux 2.4.19)"
965 msgstr ""
966
967 #. type: Plain text
968 #: build/C/man2/clone.2:328
969 msgid "Start the child in a new mount namespace."
970 msgstr ""
971
972 #. type: Plain text
973 #: build/C/man2/clone.2:349
974 msgid ""
975 "Every process lives in a mount namespace.  The I<namespace> of a process is "
976 "the data (the set of mounts) describing the file hierarchy as seen by that "
977 "process.  After a B<fork>(2)  or B<clone>()  where the B<CLONE_NEWNS> flag "
978 "is not set, the child lives in the same mount namespace as the parent.  The "
979 "system calls B<mount>(2)  and B<umount>(2)  change the mount namespace of "
980 "the calling process, and hence affect all processes that live in the same "
981 "namespace, but do not affect processes in a different mount namespace."
982 msgstr ""
983
984 #. type: Plain text
985 #: build/C/man2/clone.2:356
986 msgid ""
987 "After a B<clone>()  where the B<CLONE_NEWNS> flag is set, the cloned child "
988 "is started in a new mount namespace, initialized with a copy of the "
989 "namespace of the parent."
990 msgstr ""
991
992 #. type: Plain text
993 #: build/C/man2/clone.2:368
994 msgid ""
995 "Only a privileged process (one having the B<CAP_SYS_ADMIN> capability)  may "
996 "specify the B<CLONE_NEWNS> flag.  It is not permitted to specify both "
997 "B<CLONE_NEWNS> and B<CLONE_FS> in the same B<clone>()  call."
998 msgstr ""
999
1000 #. type: TP
1001 #: build/C/man2/clone.2:368
1002 #, no-wrap
1003 msgid "B<CLONE_NEWPID> (since Linux 2.6.24)"
1004 msgstr ""
1005
1006 #.  This explanation draws a lot of details from
1007 #.  http://lwn.net/Articles/259217/
1008 #.  Authors: Pavel Emelyanov <xemul@openvz.org>
1009 #.  and Kir Kolyshkin <kir@openvz.org>
1010 #
1011 #.  The primary kernel commit is 30e49c263e36341b60b735cbef5ca37912549264
1012 #.  Author: Pavel Emelyanov <xemul@openvz.org>
1013 #. type: Plain text
1014 #: build/C/man2/clone.2:385
1015 msgid ""
1016 "If B<CLONE_NEWPID> is set, then create the process in a new PID namespace.  "
1017 "If this flag is not set, then (as with B<fork>(2)), the process is created "
1018 "in the same PID namespace as the calling process.  This flag is intended for "
1019 "the implementation of containers."
1020 msgstr ""
1021
1022 #. type: Plain text
1023 #: build/C/man2/clone.2:394
1024 msgid ""
1025 "A PID namespace provides an isolated environment for PIDs: PIDs in a new "
1026 "namespace start at 1, somewhat like a standalone system, and calls to "
1027 "B<fork>(2), B<vfork>(2), or B<clone>()  will produce processes with PIDs "
1028 "that are unique within the namespace."
1029 msgstr ""
1030
1031 #. type: Plain text
1032 #: build/C/man2/clone.2:406
1033 msgid ""
1034 "The first process created in a new namespace (i.e., the process created "
1035 "using the B<CLONE_NEWPID> flag) has the PID 1, and is the \"init\" process "
1036 "for the namespace.  Children that are orphaned within the namespace will be "
1037 "reparented to this process rather than B<init>(8).  Unlike the traditional "
1038 "B<init> process, the \"init\" process of a PID namespace can terminate, and "
1039 "if it does, all of the processes in the namespace are terminated."
1040 msgstr ""
1041
1042 #. type: Plain text
1043 #: build/C/man2/clone.2:425
1044 msgid ""
1045 "PID namespaces form a hierarchy.  When a new PID namespace is created, the "
1046 "processes in that namespace are visible in the PID namespace of the process "
1047 "that created the new namespace; analogously, if the parent PID namespace is "
1048 "itself the child of another PID namespace, then processes in the child and "
1049 "parent PID namespaces will both be visible in the grandparent PID "
1050 "namespace.  Conversely, the processes in the \"child\" PID namespace do not "
1051 "see the processes in the parent namespace.  The existence of a namespace "
1052 "hierarchy means that each process may now have multiple PIDs: one for each "
1053 "namespace in which it is visible; each of these PIDs is unique within the "
1054 "corresponding namespace.  (A call to B<getpid>(2)  always returns the PID "
1055 "associated with the namespace in which the process lives.)"
1056 msgstr ""
1057
1058 #.  mount -t proc proc /proc
1059 #. type: Plain text
1060 #: build/C/man2/clone.2:441
1061 msgid ""
1062 "After creating the new namespace, it is useful for the child to change its "
1063 "root directory and mount a new procfs instance at I</proc> so that tools "
1064 "such as B<ps>(1)  work correctly.  (If B<CLONE_NEWNS> is also included in "
1065 "I<flags>, then it isn't necessary to change the root directory: a new procfs "
1066 "instance can be mounted directly over I</proc>.)"
1067 msgstr ""
1068
1069 #. type: Plain text
1070 #: build/C/man2/clone.2:448
1071 msgid ""
1072 "Use of this flag requires: a kernel configured with the B<CONFIG_PID_NS> "
1073 "option and that the process be privileged (B<CAP_SYS_ADMIN>).  This flag "
1074 "can't be specified in conjunction with B<CLONE_THREAD>."
1075 msgstr ""
1076
1077 #. type: TP
1078 #: build/C/man2/clone.2:448 build/C/man2/unshare.2:140
1079 #, no-wrap
1080 msgid "B<CLONE_NEWUTS> (since Linux 2.6.19)"
1081 msgstr ""
1082
1083 #. type: Plain text
1084 #: build/C/man2/clone.2:460
1085 msgid ""
1086 "If B<CLONE_NEWUTS> is set, then create the process in a new UTS namespace, "
1087 "whose identifiers are initialized by duplicating the identifiers from the "
1088 "UTS namespace of the calling process.  If this flag is not set, then (as "
1089 "with B<fork>(2)), the process is created in the same UTS namespace as the "
1090 "calling process.  This flag is intended for the implementation of "
1091 "containers."
1092 msgstr ""
1093
1094 #. type: Plain text
1095 #: build/C/man2/clone.2:472
1096 msgid ""
1097 "A UTS namespace is the set of identifiers returned by B<uname>(2); among "
1098 "these, the domain name and the host name can be modified by "
1099 "B<setdomainname>(2)  and B<sethostname>(2), respectively.  Changes made to "
1100 "the identifiers in a UTS namespace are visible to all other processes in the "
1101 "same namespace, but are not visible to processes in other UTS namespaces."
1102 msgstr ""
1103
1104 #. type: Plain text
1105 #: build/C/man2/clone.2:477
1106 msgid ""
1107 "Use of this flag requires: a kernel configured with the B<CONFIG_UTS_NS> "
1108 "option and that the process be privileged (B<CAP_SYS_ADMIN>)."
1109 msgstr ""
1110
1111 #. type: TP
1112 #: build/C/man2/clone.2:477
1113 #, no-wrap
1114 msgid "B<CLONE_PARENT> (since Linux 2.3.12)"
1115 msgstr ""
1116
1117 #. type: Plain text
1118 #: build/C/man2/clone.2:484
1119 msgid ""
1120 "If B<CLONE_PARENT> is set, then the parent of the new child (as returned by "
1121 "B<getppid>(2))  will be the same as that of the calling process."
1122 msgstr ""
1123
1124 #. type: Plain text
1125 #: build/C/man2/clone.2:490
1126 msgid ""
1127 "If B<CLONE_PARENT> is not set, then (as with B<fork>(2))  the child's parent "
1128 "is the calling process."
1129 msgstr ""
1130
1131 #. type: Plain text
1132 #: build/C/man2/clone.2:498
1133 msgid ""
1134 "Note that it is the parent process, as returned by B<getppid>(2), which is "
1135 "signaled when the child terminates, so that if B<CLONE_PARENT> is set, then "
1136 "the parent of the calling process, rather than the calling process itself, "
1137 "will be signaled."
1138 msgstr ""
1139
1140 #. type: TP
1141 #: build/C/man2/clone.2:498
1142 #, no-wrap
1143 msgid "B<CLONE_PARENT_SETTID> (since Linux 2.5.49)"
1144 msgstr ""
1145
1146 #. type: Plain text
1147 #: build/C/man2/clone.2:506
1148 msgid ""
1149 "Store child thread ID at location I<ptid> in parent and child memory.  (In "
1150 "Linux 2.5.32-2.5.48 there was a flag B<CLONE_SETTID> that did this.)"
1151 msgstr ""
1152
1153 #. type: TP
1154 #: build/C/man2/clone.2:506
1155 #, no-wrap
1156 msgid "B<CLONE_PID> (obsolete)"
1157 msgstr ""
1158
1159 #. type: Plain text
1160 #: build/C/man2/clone.2:517
1161 msgid ""
1162 "If B<CLONE_PID> is set, the child process is created with the same process "
1163 "ID as the calling process.  This is good for hacking the system, but "
1164 "otherwise of not much use.  Since 2.3.21 this flag can be specified only by "
1165 "the system boot process (PID 0).  It disappeared in Linux 2.5.16."
1166 msgstr ""
1167
1168 #. type: TP
1169 #: build/C/man2/clone.2:517
1170 #, no-wrap
1171 msgid "B<CLONE_PTRACE>"
1172 msgstr ""
1173
1174 #. type: Plain text
1175 #: build/C/man2/clone.2:524
1176 msgid ""
1177 "If B<CLONE_PTRACE> is specified, and the calling process is being traced, "
1178 "then trace the child also (see B<ptrace>(2))."
1179 msgstr ""
1180
1181 #. type: TP
1182 #: build/C/man2/clone.2:524
1183 #, no-wrap
1184 msgid "B<CLONE_SETTLS> (since Linux 2.5.32)"
1185 msgstr ""
1186
1187 #. type: Plain text
1188 #: build/C/man2/clone.2:531
1189 msgid ""
1190 "The I<newtls> argument is the new TLS (Thread Local Storage) descriptor.  "
1191 "(See B<set_thread_area>(2).)"
1192 msgstr ""
1193
1194 #. type: TP
1195 #: build/C/man2/clone.2:531
1196 #, no-wrap
1197 msgid "B<CLONE_SIGHAND>"
1198 msgstr ""
1199
1200 #. type: Plain text
1201 #: build/C/man2/clone.2:547
1202 msgid ""
1203 "If B<CLONE_SIGHAND> is set, the calling process and the child process share "
1204 "the same table of signal handlers.  If the calling process or child process "
1205 "calls B<sigaction>(2)  to change the behavior associated with a signal, the "
1206 "behavior is changed in the other process as well.  However, the calling "
1207 "process and child processes still have distinct signal masks and sets of "
1208 "pending signals.  So, one of them may block or unblock some signals using "
1209 "B<sigprocmask>(2)  without affecting the other process."
1210 msgstr ""
1211
1212 #. type: Plain text
1213 #: build/C/man2/clone.2:558
1214 msgid ""
1215 "If B<CLONE_SIGHAND> is not set, the child process inherits a copy of the "
1216 "signal handlers of the calling process at the time B<clone>()  is called.  "
1217 "Calls to B<sigaction>(2)  performed later by one of the processes have no "
1218 "effect on the other process."
1219 msgstr ""
1220
1221 #. type: Plain text
1222 #: build/C/man2/clone.2:566
1223 msgid ""
1224 "Since Linux 2.6.0-test6, I<flags> must also include B<CLONE_VM> if "
1225 "B<CLONE_SIGHAND> is specified"
1226 msgstr ""
1227
1228 #. type: TP
1229 #: build/C/man2/clone.2:566
1230 #, no-wrap
1231 msgid "B<CLONE_STOPPED> (since Linux 2.6.0-test2)"
1232 msgstr ""
1233
1234 #. type: Plain text
1235 #: build/C/man2/clone.2:575
1236 msgid ""
1237 "If B<CLONE_STOPPED> is set, then the child is initially stopped (as though "
1238 "it was sent a B<SIGSTOP> signal), and must be resumed by sending it a "
1239 "B<SIGCONT> signal."
1240 msgstr ""
1241
1242 #.  glibc 2.8 removed this defn from bits/sched.h
1243 #. type: Plain text
1244 #: build/C/man2/clone.2:583
1245 msgid ""
1246 "This flag was I<deprecated> from Linux 2.6.25 onward, and was I<removed> "
1247 "altogether in Linux 2.6.38."
1248 msgstr ""
1249
1250 #. type: TP
1251 #: build/C/man2/clone.2:583
1252 #, no-wrap
1253 msgid "B<CLONE_SYSVSEM> (since Linux 2.5.10)"
1254 msgstr ""
1255
1256 #. type: Plain text
1257 #: build/C/man2/clone.2:592
1258 msgid ""
1259 "If B<CLONE_SYSVSEM> is set, then the child and the calling process share a "
1260 "single list of System V semaphore undo values (see B<semop>(2)).  If this "
1261 "flag is not set, then the child has a separate undo list, which is initially "
1262 "empty."
1263 msgstr ""
1264
1265 #. type: TP
1266 #: build/C/man2/clone.2:592
1267 #, no-wrap
1268 msgid "B<CLONE_THREAD> (since Linux 2.4.0-test8)"
1269 msgstr ""
1270
1271 #. type: Plain text
1272 #: build/C/man2/clone.2:601
1273 msgid ""
1274 "If B<CLONE_THREAD> is set, the child is placed in the same thread group as "
1275 "the calling process.  To make the remainder of the discussion of "
1276 "B<CLONE_THREAD> more readable, the term \"thread\" is used to refer to the "
1277 "processes within a thread group."
1278 msgstr ""
1279
1280 #. type: Plain text
1281 #: build/C/man2/clone.2:609
1282 msgid ""
1283 "Thread groups were a feature added in Linux 2.4 to support the POSIX threads "
1284 "notion of a set of threads that share a single PID.  Internally, this shared "
1285 "PID is the so-called thread group identifier (TGID) for the thread group.  "
1286 "Since Linux 2.4, calls to B<getpid>(2)  return the TGID of the caller."
1287 msgstr ""
1288
1289 #. type: Plain text
1290 #: build/C/man2/clone.2:618
1291 msgid ""
1292 "The threads within a group can be distinguished by their (system-wide)  "
1293 "unique thread IDs (TID).  A new thread's TID is available as the function "
1294 "result returned to the caller of B<clone>(), and a thread can obtain its own "
1295 "TID using B<gettid>(2)."
1296 msgstr ""
1297
1298 #. type: Plain text
1299 #: build/C/man2/clone.2:628
1300 msgid ""
1301 "When a call is made to B<clone>()  without specifying B<CLONE_THREAD>, then "
1302 "the resulting thread is placed in a new thread group whose TGID is the same "
1303 "as the thread's TID.  This thread is the I<leader> of the new thread group."
1304 msgstr ""
1305
1306 #. type: Plain text
1307 #: build/C/man2/clone.2:650
1308 msgid ""
1309 "A new thread created with B<CLONE_THREAD> has the same parent process as the "
1310 "caller of B<clone>()  (i.e., like B<CLONE_PARENT>), so that calls to "
1311 "B<getppid>(2)  return the same value for all of the threads in a thread "
1312 "group.  When a B<CLONE_THREAD> thread terminates, the thread that created it "
1313 "using B<clone>()  is not sent a B<SIGCHLD> (or other termination) signal; "
1314 "nor can the status of such a thread be obtained using B<wait>(2).  (The "
1315 "thread is said to be I<detached>.)"
1316 msgstr ""
1317
1318 #. type: Plain text
1319 #: build/C/man2/clone.2:655
1320 msgid ""
1321 "After all of the threads in a thread group terminate the parent process of "
1322 "the thread group is sent a B<SIGCHLD> (or other termination) signal."
1323 msgstr ""
1324
1325 #. type: Plain text
1326 #: build/C/man2/clone.2:660
1327 msgid ""
1328 "If any of the threads in a thread group performs an B<execve>(2), then all "
1329 "threads other than the thread group leader are terminated, and the new "
1330 "program is executed in the thread group leader."
1331 msgstr ""
1332
1333 #. type: Plain text
1334 #: build/C/man2/clone.2:666
1335 msgid ""
1336 "If one of the threads in a thread group creates a child using B<fork>(2), "
1337 "then any thread in the group can B<wait>(2)  for that child."
1338 msgstr ""
1339
1340 #. type: Plain text
1341 #: build/C/man2/clone.2:674
1342 msgid ""
1343 "Since Linux 2.5.35, I<flags> must also include B<CLONE_SIGHAND> if "
1344 "B<CLONE_THREAD> is specified."
1345 msgstr ""
1346
1347 #. type: Plain text
1348 #: build/C/man2/clone.2:679
1349 msgid ""
1350 "Signals may be sent to a thread group as a whole (i.e., a TGID) using "
1351 "B<kill>(2), or to a specific thread (i.e., TID) using B<tgkill>(2)."
1352 msgstr ""
1353
1354 #. type: Plain text
1355 #: build/C/man2/clone.2:684
1356 msgid ""
1357 "Signal dispositions and actions are process-wide: if an unhandled signal is "
1358 "delivered to a thread, then it will affect (terminate, stop, continue, be "
1359 "ignored in)  all members of the thread group."
1360 msgstr ""
1361
1362 #. type: Plain text
1363 #: build/C/man2/clone.2:697
1364 msgid ""
1365 "Each thread has its own signal mask, as set by B<sigprocmask>(2), but "
1366 "signals can be pending either: for the whole process (i.e., deliverable to "
1367 "any member of the thread group), when sent with B<kill>(2); or for an "
1368 "individual thread, when sent with B<tgkill>(2).  A call to B<sigpending>(2)  "
1369 "returns a signal set that is the union of the signals pending for the whole "
1370 "process and the signals that are pending for the calling thread."
1371 msgstr ""
1372
1373 #. type: Plain text
1374 #: build/C/man2/clone.2:709
1375 msgid ""
1376 "If B<kill>(2)  is used to send a signal to a thread group, and the thread "
1377 "group has installed a handler for the signal, then the handler will be "
1378 "invoked in exactly one, arbitrarily selected member of the thread group that "
1379 "has not blocked the signal.  If multiple threads in a group are waiting to "
1380 "accept the same signal using B<sigwaitinfo>(2), the kernel will arbitrarily "
1381 "select one of these threads to receive a signal sent using B<kill>(2)."
1382 msgstr ""
1383
1384 #. type: TP
1385 #: build/C/man2/clone.2:709
1386 #, no-wrap
1387 msgid "B<CLONE_UNTRACED> (since Linux 2.5.46)"
1388 msgstr ""
1389
1390 #. type: Plain text
1391 #: build/C/man2/clone.2:716
1392 msgid ""
1393 "If B<CLONE_UNTRACED> is specified, then a tracing process cannot force "
1394 "B<CLONE_PTRACE> on this child process."
1395 msgstr ""
1396
1397 #. type: TP
1398 #: build/C/man2/clone.2:716
1399 #, no-wrap
1400 msgid "B<CLONE_VFORK>"
1401 msgstr ""
1402
1403 #. type: Plain text
1404 #: build/C/man2/clone.2:728
1405 msgid ""
1406 "If B<CLONE_VFORK> is set, the execution of the calling process is suspended "
1407 "until the child releases its virtual memory resources via a call to "
1408 "B<execve>(2)  or B<_exit>(2)  (as with B<vfork>(2))."
1409 msgstr ""
1410
1411 #. type: Plain text
1412 #: build/C/man2/clone.2:734
1413 msgid ""
1414 "If B<CLONE_VFORK> is not set then both the calling process and the child are "
1415 "schedulable after the call, and an application should not rely on execution "
1416 "occurring in any particular order."
1417 msgstr ""
1418
1419 #. type: TP
1420 #: build/C/man2/clone.2:734
1421 #, no-wrap
1422 msgid "B<CLONE_VM>"
1423 msgstr ""
1424
1425 #. type: Plain text
1426 #: build/C/man2/clone.2:747
1427 msgid ""
1428 "If B<CLONE_VM> is set, the calling process and the child process run in the "
1429 "same memory space.  In particular, memory writes performed by the calling "
1430 "process or by the child process are also visible in the other process.  "
1431 "Moreover, any memory mapping or unmapping performed with B<mmap>(2)  or "
1432 "B<munmap>(2)  by the child or calling process also affects the other "
1433 "process."
1434 msgstr ""
1435
1436 #. type: Plain text
1437 #: build/C/man2/clone.2:756
1438 msgid ""
1439 "If B<CLONE_VM> is not set, the child process runs in a separate copy of the "
1440 "memory space of the calling process at the time of B<clone>().  Memory "
1441 "writes or file mappings/unmappings performed by one of the processes do not "
1442 "affect the other, as with B<fork>(2)."
1443 msgstr ""
1444
1445 #. type: SS
1446 #: build/C/man2/clone.2:756
1447 #, no-wrap
1448 msgid "sys_clone"
1449 msgstr ""
1450
1451 #. type: Plain text
1452 #: build/C/man2/clone.2:773
1453 msgid ""
1454 "The B<sys_clone> system call corresponds more closely to B<fork>(2)  in that "
1455 "execution in the child continues from the point of the call.  Thus, "
1456 "B<sys_clone> only requires the I<flags> and I<child_stack> arguments, which "
1457 "have the same meaning as for B<clone>().  (Note that the order of these "
1458 "arguments differs from B<clone>().)"
1459 msgstr ""
1460
1461 #. type: Plain text
1462 #: build/C/man2/clone.2:784
1463 msgid ""
1464 "Another difference for B<sys_clone> is that the I<child_stack> argument may "
1465 "be zero, in which case copy-on-write semantics ensure that the child gets "
1466 "separate copies of stack pages when either process modifies the stack.  In "
1467 "this case, for correct operation, the B<CLONE_VM> option should not be "
1468 "specified."
1469 msgstr ""
1470
1471 #. type: Plain text
1472 #: build/C/man2/clone.2:792
1473 msgid ""
1474 "In Linux 2.4 and earlier, B<clone>()  does not take arguments I<ptid>, "
1475 "I<tls>, and I<ctid>."
1476 msgstr ""
1477
1478 #.  gettid(2) returns current->pid;
1479 #.  getpid(2) returns current->tgid;
1480 #. type: Plain text
1481 #: build/C/man2/clone.2:801
1482 msgid ""
1483 "On success, the thread ID of the child process is returned in the caller's "
1484 "thread of execution.  On failure, -1 is returned in the caller's context, no "
1485 "child process will be created, and I<errno> will be set appropriately."
1486 msgstr ""
1487
1488 #. type: SH
1489 #: build/C/man2/clone.2:801 build/C/man2/sched_get_priority_max.2:97 build/C/man3/sched_getcpu.3:45 build/C/man2/sched_rr_get_interval.2:81 build/C/man2/sched_setaffinity.2:117 build/C/man2/sched_setparam.2:97 build/C/man2/sched_setscheduler.2:433 build/C/man2/sched_yield.2:49 build/C/man2/setns.2:73 build/C/man2/unshare.2:188
1490 #, no-wrap
1491 msgid "ERRORS"
1492 msgstr ""
1493
1494 #. type: TP
1495 #: build/C/man2/clone.2:802
1496 #, no-wrap
1497 msgid "B<EAGAIN>"
1498 msgstr ""
1499
1500 #. type: Plain text
1501 #: build/C/man2/clone.2:805
1502 msgid "Too many processes are already running."
1503 msgstr ""
1504
1505 #. type: TP
1506 #: build/C/man2/clone.2:805 build/C/man2/clone.2:812 build/C/man2/clone.2:827 build/C/man2/clone.2:835 build/C/man2/clone.2:843 build/C/man2/clone.2:851 build/C/man2/clone.2:857 build/C/man2/clone.2:867 build/C/man2/clone.2:875 build/C/man2/clone.2:883 build/C/man2/sched_get_priority_max.2:98 build/C/man2/sched_rr_get_interval.2:85 build/C/man2/sched_setaffinity.2:121 build/C/man2/sched_setaffinity.2:129 build/C/man2/sched_setparam.2:98 build/C/man2/sched_setscheduler.2:434 build/C/man2/setns.2:78 build/C/man2/unshare.2:189
1507 #, no-wrap
1508 msgid "B<EINVAL>"
1509 msgstr ""
1510
1511 #. type: Plain text
1512 #: build/C/man2/clone.2:812
1513 msgid ""
1514 "B<CLONE_SIGHAND> was specified, but B<CLONE_VM> was not.  (Since Linux "
1515 "2.6.0-test6.)"
1516 msgstr ""
1517
1518 #.  .TP
1519 #.  .B EINVAL
1520 #.  Precisely one of
1521 #.  .B CLONE_DETACHED
1522 #.  and
1523 #.  .B CLONE_THREAD
1524 #.  was specified.
1525 #.  (Since Linux 2.6.0-test6.)
1526 #. type: Plain text
1527 #: build/C/man2/clone.2:827
1528 msgid ""
1529 "B<CLONE_THREAD> was specified, but B<CLONE_SIGHAND> was not.  (Since Linux "
1530 "2.5.35.)"
1531 msgstr ""
1532
1533 #. type: Plain text
1534 #: build/C/man2/clone.2:835
1535 msgid "Both B<CLONE_FS> and B<CLONE_NEWNS> were specified in I<flags>."
1536 msgstr ""
1537
1538 #. type: Plain text
1539 #: build/C/man2/clone.2:843
1540 msgid "Both B<CLONE_NEWIPC> and B<CLONE_SYSVSEM> were specified in I<flags>."
1541 msgstr ""
1542
1543 #. type: Plain text
1544 #: build/C/man2/clone.2:851
1545 msgid "Both B<CLONE_NEWPID> and B<CLONE_THREAD> were specified in I<flags>."
1546 msgstr ""
1547
1548 #. type: Plain text
1549 #: build/C/man2/clone.2:857
1550 msgid "Returned by B<clone>()  when a zero value is specified for I<child_stack>."
1551 msgstr ""
1552
1553 #. type: Plain text
1554 #: build/C/man2/clone.2:867
1555 msgid ""
1556 "B<CLONE_NEWIPC> was specified in I<flags>, but the kernel was not configured "
1557 "with the B<CONFIG_SYSVIPC> and B<CONFIG_IPC_NS> options."
1558 msgstr ""
1559
1560 #. type: Plain text
1561 #: build/C/man2/clone.2:875
1562 msgid ""
1563 "B<CLONE_NEWNET> was specified in I<flags>, but the kernel was not configured "
1564 "with the B<CONFIG_NET_NS> option."
1565 msgstr ""
1566
1567 #. type: Plain text
1568 #: build/C/man2/clone.2:883
1569 msgid ""
1570 "B<CLONE_NEWPID> was specified in I<flags>, but the kernel was not configured "
1571 "with the B<CONFIG_PID_NS> option."
1572 msgstr ""
1573
1574 #. type: Plain text
1575 #: build/C/man2/clone.2:891
1576 msgid ""
1577 "B<CLONE_NEWUTS> was specified in I<flags>, but the kernel was not configured "
1578 "with the B<CONFIG_UTS> option."
1579 msgstr ""
1580
1581 #. type: TP
1582 #: build/C/man2/clone.2:891 build/C/man2/setns.2:85 build/C/man2/unshare.2:193
1583 #, no-wrap
1584 msgid "B<ENOMEM>"
1585 msgstr ""
1586
1587 #. type: Plain text
1588 #: build/C/man2/clone.2:896
1589 msgid ""
1590 "Cannot allocate sufficient memory to allocate a task structure for the "
1591 "child, or to copy those parts of the caller's context that need to be "
1592 "copied."
1593 msgstr ""
1594
1595 #. type: TP
1596 #: build/C/man2/clone.2:896 build/C/man2/clone.2:905 build/C/man2/sched_setaffinity.2:136 build/C/man2/sched_setparam.2:102 build/C/man2/sched_setscheduler.2:439 build/C/man2/setns.2:88 build/C/man2/unshare.2:197
1597 #, no-wrap
1598 msgid "B<EPERM>"
1599 msgstr ""
1600
1601 #. type: Plain text
1602 #: build/C/man2/clone.2:905
1603 msgid ""
1604 "B<CLONE_NEWIPC>, B<CLONE_NEWNET>, B<CLONE_NEWNS>, B<CLONE_NEWPID>, or "
1605 "B<CLONE_NEWUTS> was specified by an unprivileged process (process without "
1606 "B<CAP_SYS_ADMIN>)."
1607 msgstr ""
1608
1609 #. type: Plain text
1610 #: build/C/man2/clone.2:909
1611 msgid "B<CLONE_PID> was specified by a process other than process 0."
1612 msgstr ""
1613
1614 #. type: Plain text
1615 #: build/C/man2/clone.2:916
1616 msgid ""
1617 "There is no entry for B<clone>()  in libc5.  glibc2 provides B<clone>()  as "
1618 "described in this manual page."
1619 msgstr ""
1620
1621 #. type: Plain text
1622 #: build/C/man2/clone.2:923
1623 msgid ""
1624 "The B<clone>()  and B<sys_clone> calls are Linux-specific and should not be "
1625 "used in programs intended to be portable."
1626 msgstr ""
1627
1628 #. type: Plain text
1629 #: build/C/man2/clone.2:933
1630 msgid ""
1631 "In the kernel 2.4.x series, B<CLONE_THREAD> generally does not make the "
1632 "parent of the new thread the same as the parent of the calling process.  "
1633 "However, for kernel versions 2.4.7 to 2.4.18 the B<CLONE_THREAD> flag "
1634 "implied the B<CLONE_PARENT> flag (as in kernel 2.6)."
1635 msgstr ""
1636
1637 #. type: Plain text
1638 #: build/C/man2/clone.2:943
1639 msgid ""
1640 "For a while there was B<CLONE_DETACHED> (introduced in 2.5.32): parent wants "
1641 "no child-exit signal.  In 2.6.2 the need to give this together with "
1642 "B<CLONE_THREAD> disappeared.  This flag is still defined, but has no effect."
1643 msgstr ""
1644
1645 #. type: Plain text
1646 #: build/C/man2/clone.2:948
1647 msgid ""
1648 "On i386, B<clone>()  should not be called through vsyscall, but directly "
1649 "through I<int $0x80>."
1650 msgstr ""
1651
1652 #. type: Plain text
1653 #: build/C/man2/clone.2:950
1654 msgid "On ia64, a different system call is used:"
1655 msgstr ""
1656
1657 #. type: Plain text
1658 #: build/C/man2/clone.2:957
1659 #, no-wrap
1660 msgid ""
1661 "B<int __clone2(int (*>I<fn>B<)(void *), >\n"
1662 "B<             void *>I<child_stack_base>B<, size_t >I<stack_size>B<,>\n"
1663 "B<             int >I<flags>B<, void *>I<arg>B<, ... >\n"
1664 "B<          /* pid_t *>I<ptid>B<, struct user_desc *>I<tls>B<, pid_t "
1665 "*>I<ctid>B< */ );>\n"
1666 msgstr ""
1667
1668 #. type: Plain text
1669 #: build/C/man2/clone.2:970
1670 msgid ""
1671 "The B<__clone2>()  system call operates in the same way as B<clone>(), "
1672 "except that I<child_stack_base> points to the lowest address of the child's "
1673 "stack area, and I<stack_size> specifies the size of the stack pointed to by "
1674 "I<child_stack_base>."
1675 msgstr ""
1676
1677 #. type: Plain text
1678 #: build/C/man2/clone.2:1001
1679 msgid ""
1680 "Versions of the GNU C library that include the NPTL threading library "
1681 "contain a wrapper function for B<getpid>(2)  that performs caching of PIDs.  "
1682 "This caching relies on support in the glibc wrapper for B<clone>(), but as "
1683 "currently implemented, the cache may not be up to date in some "
1684 "circumstances.  In particular, if a signal is delivered to the child "
1685 "immediately after the B<clone>()  call, then a call to B<getpid>(2)  in a "
1686 "handler for the signal may return the PID of the calling process (\"the "
1687 "parent\"), if the clone wrapper has not yet had a chance to update the PID "
1688 "cache in the child.  (This discussion ignores the case where the child was "
1689 "created using B<CLONE_THREAD>, when B<getpid>(2)  I<should> return the same "
1690 "value in the child and in the process that called B<clone>(), since the "
1691 "caller and the child are in the same thread group.  The stale-cache problem "
1692 "also does not occur if the I<flags> argument includes B<CLONE_VM>.)  To get "
1693 "the truth, it may be necessary to use code such as the following:"
1694 msgstr ""
1695
1696 #. type: Plain text
1697 #: build/C/man2/clone.2:1004
1698 #, no-wrap
1699 msgid "    #include E<lt>syscall.hE<gt>\n"
1700 msgstr ""
1701
1702 #. type: Plain text
1703 #: build/C/man2/clone.2:1006
1704 #, no-wrap
1705 msgid "    pid_t mypid;\n"
1706 msgstr ""
1707
1708 #. type: Plain text
1709 #: build/C/man2/clone.2:1008
1710 #, no-wrap
1711 msgid "    mypid = syscall(SYS_getpid);\n"
1712 msgstr ""
1713
1714 #. type: Plain text
1715 #: build/C/man2/clone.2:1024
1716 msgid ""
1717 "B<fork>(2), B<futex>(2), B<getpid>(2), B<gettid>(2), B<set_thread_area>(2), "
1718 "B<set_tid_address>(2), B<tkill>(2), B<unshare>(2), B<wait>(2), "
1719 "B<capabilities>(7), B<pthreads>(7)"
1720 msgstr ""
1721
1722 #. type: TH
1723 #: build/C/man2/sched_get_priority_max.2:30
1724 #, no-wrap
1725 msgid "SCHED_GET_PRIORITY_MAX"
1726 msgstr ""
1727
1728 #. type: TH
1729 #: build/C/man2/sched_get_priority_max.2:30 build/C/man2/sched_setparam.2:31
1730 #, no-wrap
1731 msgid "2006-03-23"
1732 msgstr ""
1733
1734 #. type: Plain text
1735 #: build/C/man2/sched_get_priority_max.2:33
1736 msgid "sched_get_priority_max, sched_get_priority_min - get static priority range"
1737 msgstr ""
1738
1739 #. type: Plain text
1740 #: build/C/man2/sched_get_priority_max.2:35 build/C/man2/sched_rr_get_interval.2:35 build/C/man2/sched_yield.2:35
1741 msgid "B<#include E<lt>sched.hE<gt>>"
1742 msgstr ""
1743
1744 #. type: Plain text
1745 #: build/C/man2/sched_get_priority_max.2:37
1746 msgid "B<int sched_get_priority_max(int >I<policy>B<);>"
1747 msgstr ""
1748
1749 #. type: Plain text
1750 #: build/C/man2/sched_get_priority_max.2:39
1751 msgid "B<int sched_get_priority_min(int >I<policy>B<);>"
1752 msgstr ""
1753
1754 #. type: Plain text
1755 #: build/C/man2/sched_get_priority_max.2:55
1756 msgid ""
1757 "B<sched_get_priority_max>()  returns the maximum priority value that can be "
1758 "used with the scheduling algorithm identified by I<policy>.  "
1759 "B<sched_get_priority_min>()  returns the minimum priority value that can be "
1760 "used with the scheduling algorithm identified by I<policy>.  Supported "
1761 "I<policy> values are B<SCHED_FIFO>, B<SCHED_RR>, B<SCHED_OTHER>, and "
1762 "B<SCHED_BATCH>.  Further details about these policies can be found in "
1763 "B<sched_setscheduler>(2)."
1764 msgstr ""
1765
1766 #. type: Plain text
1767 #: build/C/man2/sched_get_priority_max.2:64
1768 msgid ""
1769 "Processes with numerically higher priority values are scheduled before "
1770 "processes with numerically lower priority values.  Thus, the value returned "
1771 "by B<sched_get_priority_max>()  will be greater than the value returned by "
1772 "B<sched_get_priority_min>()."
1773 msgstr ""
1774
1775 #. type: Plain text
1776 #: build/C/man2/sched_get_priority_max.2:70
1777 msgid ""
1778 "Linux allows the static priority value range 1 to 99 for B<SCHED_FIFO> and "
1779 "B<SCHED_RR> and the priority 0 for B<SCHED_OTHER> and B<SCHED_BATCH>.  "
1780 "Scheduling priority ranges for the various policies are not alterable."
1781 msgstr ""
1782
1783 #. type: Plain text
1784 #: build/C/man2/sched_get_priority_max.2:79
1785 msgid ""
1786 "The range of scheduling priorities may vary on other POSIX systems, thus it "
1787 "is a good idea for portable applications to use a virtual priority range and "
1788 "map it to the interval given by B<sched_get_priority_max>()  and "
1789 "B<sched_get_priority_min>().  POSIX.1-2001 requires a spread of at least 32 "
1790 "between the maximum and the minimum values for B<SCHED_FIFO> and "
1791 "B<SCHED_RR>."
1792 msgstr ""
1793
1794 #. type: Plain text
1795 #: build/C/man2/sched_get_priority_max.2:87
1796 msgid ""
1797 "POSIX systems on which B<sched_get_priority_max>()  and "
1798 "B<sched_get_priority_min>()  are available define "
1799 "B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
1800 msgstr ""
1801
1802 #. type: Plain text
1803 #: build/C/man2/sched_get_priority_max.2:97
1804 msgid ""
1805 "On success, B<sched_get_priority_max>()  and B<sched_get_priority_min>()  "
1806 "return the maximum/minimum priority value for the named scheduling policy.  "
1807 "On error, -1 is returned, and I<errno> is set appropriately."
1808 msgstr ""
1809
1810 #. type: Plain text
1811 #: build/C/man2/sched_get_priority_max.2:101
1812 msgid "The argument I<policy> does not identify a defined scheduling policy."
1813 msgstr ""
1814
1815 #. type: Plain text
1816 #: build/C/man2/sched_get_priority_max.2:103 build/C/man2/sched_rr_get_interval.2:97 build/C/man2/sched_setparam.2:113 build/C/man2/sched_yield.2:55
1817 msgid "POSIX.1-2001."
1818 msgstr ""
1819
1820 #. type: Plain text
1821 #: build/C/man2/sched_get_priority_max.2:110
1822 msgid ""
1823 "B<sched_getaffinity>(2), B<sched_getparam>(2), B<sched_getscheduler>(2), "
1824 "B<sched_setaffinity>(2), B<sched_setparam>(2), B<sched_setscheduler>(2)"
1825 msgstr ""
1826
1827 #. type: Plain text
1828 #: build/C/man2/sched_get_priority_max.2:113 build/C/man2/sched_rr_get_interval.2:132 build/C/man2/sched_setparam.2:127 build/C/man2/sched_setscheduler.2:538 build/C/man2/sched_yield.2:85
1829 msgid ""
1830 "I<Programming for the real world - POSIX.4> by Bill O. Gallmeister, O'Reilly "
1831 "& Associates, Inc., ISBN 1-56592-074-0"
1832 msgstr ""
1833
1834 #. type: TH
1835 #: build/C/man3/sched_getcpu.3:24
1836 #, no-wrap
1837 msgid "SCHED_GETCPU"
1838 msgstr ""
1839
1840 #. type: TH
1841 #: build/C/man3/sched_getcpu.3:24
1842 #, no-wrap
1843 msgid "2010-10-31"
1844 msgstr ""
1845
1846 #. type: Plain text
1847 #: build/C/man3/sched_getcpu.3:27
1848 msgid "sched_getcpu - determine CPU on which the calling thread is running"
1849 msgstr ""
1850
1851 #.  Really:_BSD_SOURCE || _SVID_SOURCE
1852 #. type: Plain text
1853 #: build/C/man3/sched_getcpu.3:32
1854 #, no-wrap
1855 msgid ""
1856 "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
1857 "B<#include E<lt>sched.hE<gt>>\n"
1858 msgstr ""
1859
1860 #. type: Plain text
1861 #: build/C/man3/sched_getcpu.3:34
1862 #, no-wrap
1863 msgid "B<int sched_getcpu(void);>\n"
1864 msgstr ""
1865
1866 #. type: Plain text
1867 #: build/C/man3/sched_getcpu.3:38
1868 msgid ""
1869 "B<sched_getcpu>()  returns the number of the CPU on which the calling thread "
1870 "is currently executing."
1871 msgstr ""
1872
1873 #. type: Plain text
1874 #: build/C/man3/sched_getcpu.3:45
1875 msgid ""
1876 "On success, B<sched_getcpu>()  returns a nonnegative CPU number.  On error, "
1877 "-1 is returned and I<errno> is set to indicate the error."
1878 msgstr ""
1879
1880 #. type: TP
1881 #: build/C/man3/sched_getcpu.3:46 build/C/man2/sched_rr_get_interval.2:88
1882 #, no-wrap
1883 msgid "B<ENOSYS>"
1884 msgstr ""
1885
1886 #. type: Plain text
1887 #: build/C/man3/sched_getcpu.3:50
1888 msgid "This kernel does not implement B<getcpu>(2)."
1889 msgstr ""
1890
1891 #. type: Plain text
1892 #: build/C/man3/sched_getcpu.3:52
1893 msgid "This function is available since glibc 2.6."
1894 msgstr ""
1895
1896 #. type: Plain text
1897 #: build/C/man3/sched_getcpu.3:55
1898 msgid "B<sched_getcpu>()  is glibc specific."
1899 msgstr ""
1900
1901 #. type: Plain text
1902 #: build/C/man3/sched_getcpu.3:57
1903 msgid "The call"
1904 msgstr ""
1905
1906 #. type: Plain text
1907 #: build/C/man3/sched_getcpu.3:61
1908 #, no-wrap
1909 msgid "cpu = sched_getcpu();\n"
1910 msgstr ""
1911
1912 #. type: Plain text
1913 #: build/C/man3/sched_getcpu.3:67
1914 msgid "is equivalent to the following B<getcpu>(2)  call:"
1915 msgstr ""
1916
1917 #. type: Plain text
1918 #: build/C/man3/sched_getcpu.3:73
1919 #, no-wrap
1920 msgid ""
1921 "int c, s;\n"
1922 "s = getcpu(&c, NULL, NULL);\n"
1923 "cpu = (s == -1) ? s : c;\n"
1924 msgstr ""
1925
1926 #. type: Plain text
1927 #: build/C/man3/sched_getcpu.3:77
1928 msgid "B<getcpu>(2)"
1929 msgstr ""
1930
1931 #. type: TH
1932 #: build/C/man2/sched_rr_get_interval.2:30
1933 #, no-wrap
1934 msgid "SCHED_RR_GET_INTERVAL"
1935 msgstr ""
1936
1937 #. type: TH
1938 #: build/C/man2/sched_rr_get_interval.2:30
1939 #, no-wrap
1940 msgid "2011-10-16"
1941 msgstr ""
1942
1943 #. type: Plain text
1944 #: build/C/man2/sched_rr_get_interval.2:33
1945 msgid "sched_rr_get_interval - get the SCHED_RR interval for the named process"
1946 msgstr ""
1947
1948 #. type: Plain text
1949 #: build/C/man2/sched_rr_get_interval.2:37
1950 msgid "B<int sched_rr_get_interval(pid_t >I<pid>B<, struct timespec * >I<tp>B<);>"
1951 msgstr ""
1952
1953 #. type: Plain text
1954 #: build/C/man2/sched_rr_get_interval.2:48
1955 msgid ""
1956 "B<sched_rr_get_interval>()  writes into the I<timespec> structure pointed to "
1957 "by I<tp> the round-robin time quantum for the process identified by I<pid>.  "
1958 "The specified process should be running under the B<SCHED_RR> scheduling "
1959 "policy."
1960 msgstr ""
1961
1962 #. type: Plain text
1963 #: build/C/man2/sched_rr_get_interval.2:52
1964 msgid "The I<timespec> structure has the following form:"
1965 msgstr ""
1966
1967 #. type: Plain text
1968 #: build/C/man2/sched_rr_get_interval.2:59
1969 #, no-wrap
1970 msgid ""
1971 "struct timespec {\n"
1972 "    time_t tv_sec;    /* seconds */\n"
1973 "    long   tv_nsec;   /* nanoseconds */\n"
1974 "};\n"
1975 msgstr ""
1976
1977 #.  FIXME . On Linux, sched_rr_get_interval()
1978 #.  returns the timeslice for SCHED_OTHER processes -- this timeslice
1979 #.  is influenced by the nice value.
1980 #.  For SCHED_FIFO processes, this always returns 0.
1981 #
1982 #.  The round-robin time quantum value is not alterable under Linux
1983 #.  1.3.81.
1984 #. type: Plain text
1985 #: build/C/man2/sched_rr_get_interval.2:74
1986 msgid ""
1987 "If I<pid> is zero, the time quantum for the calling process is written into "
1988 "I<*tp>."
1989 msgstr ""
1990
1991 #. type: Plain text
1992 #: build/C/man2/sched_rr_get_interval.2:81
1993 msgid ""
1994 "On success, B<sched_rr_get_interval>()  returns 0.  On error, -1 is "
1995 "returned, and I<errno> is set appropriately."
1996 msgstr ""
1997
1998 #. type: TP
1999 #: build/C/man2/sched_rr_get_interval.2:82 build/C/man2/sched_setaffinity.2:118
2000 #, no-wrap
2001 msgid "B<EFAULT>"
2002 msgstr ""
2003
2004 #. type: Plain text
2005 #: build/C/man2/sched_rr_get_interval.2:85
2006 msgid "Problem with copying information to userspace."
2007 msgstr ""
2008
2009 #. type: Plain text
2010 #: build/C/man2/sched_rr_get_interval.2:88
2011 msgid "Invalid pid."
2012 msgstr ""
2013
2014 #. type: Plain text
2015 #: build/C/man2/sched_rr_get_interval.2:91
2016 msgid "The system call is not yet implemented (only on rather old kernels)."
2017 msgstr ""
2018
2019 #. type: TP
2020 #: build/C/man2/sched_rr_get_interval.2:91 build/C/man2/sched_setaffinity.2:146 build/C/man2/sched_setparam.2:108 build/C/man2/sched_setscheduler.2:442
2021 #, no-wrap
2022 msgid "B<ESRCH>"
2023 msgstr ""
2024
2025 #. type: Plain text
2026 #: build/C/man2/sched_rr_get_interval.2:95
2027 msgid "Could not find a process with the ID I<pid>."
2028 msgstr ""
2029
2030 #. type: Plain text
2031 #: build/C/man2/sched_rr_get_interval.2:104
2032 msgid ""
2033 "POSIX systems on which B<sched_rr_get_interval>()  is available define "
2034 "B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
2035 msgstr ""
2036
2037 #. type: SS
2038 #: build/C/man2/sched_rr_get_interval.2:104
2039 #, no-wrap
2040 msgid "Linux Notes"
2041 msgstr ""
2042
2043 #.  commit a4ec24b48ddef1e93f7578be53270f0b95ad666c
2044 #.  .SH BUGS
2045 #.  As of Linux 1.3.81
2046 #.  .BR sched_rr_get_interval ()
2047 #.  returns with error
2048 #.  ENOSYS, because SCHED_RR has not yet been fully implemented and tested
2049 #.  properly.
2050 #. type: Plain text
2051 #: build/C/man2/sched_rr_get_interval.2:126
2052 msgid ""
2053 "POSIX does not specify any mechanism for controlling the size of the "
2054 "round-robin time quantum.  Older Linux kernels provide a (nonportable) "
2055 "method of doing this.  The quantum can be controlled by adjusting the "
2056 "process's nice value (see B<setpriority>(2)).  Assigning a negative (i.e., "
2057 "high) nice value results in a longer quantum; assigning a positive (i.e., "
2058 "low) nice value results in a shorter quantum.  The default quantum is 0.1 "
2059 "seconds; the degree to which changing the nice value affects the quantum has "
2060 "varied somewhat across kernel versions.  Since Linux 2.6.24, the B<SCHED_RR> "
2061 "quantum cannot be modified."
2062 msgstr ""
2063
2064 #. type: Plain text
2065 #: build/C/man2/sched_rr_get_interval.2:129 build/C/man2/sched_setaffinity.2:178
2066 msgid "B<sched_setscheduler>(2)  has a description of the Linux scheduling scheme."
2067 msgstr ""
2068
2069 #. type: TH
2070 #: build/C/man2/sched_setaffinity.2:35
2071 #, no-wrap
2072 msgid "SCHED_SETAFFINITY"
2073 msgstr ""
2074
2075 #. type: TH
2076 #: build/C/man2/sched_setaffinity.2:35
2077 #, no-wrap
2078 msgid "2010-11-06"
2079 msgstr ""
2080
2081 #. type: Plain text
2082 #: build/C/man2/sched_setaffinity.2:39
2083 msgid ""
2084 "sched_setaffinity, sched_getaffinity - set and get a process's CPU affinity "
2085 "mask"
2086 msgstr ""
2087
2088 #. type: Plain text
2089 #: build/C/man2/sched_setaffinity.2:46
2090 #, no-wrap
2091 msgid ""
2092 "B<int sched_setaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
2093 "B<                      cpu_set_t *>I<mask>B<);>\n"
2094 msgstr ""
2095
2096 #. type: Plain text
2097 #: build/C/man2/sched_setaffinity.2:49
2098 #, no-wrap
2099 msgid ""
2100 "B<int sched_getaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
2101 "B<                      cpu_set_t *>I<mask>B<);>\n"
2102 msgstr ""
2103
2104 #. type: Plain text
2105 #: build/C/man2/sched_setaffinity.2:64
2106 msgid ""
2107 "A process's CPU affinity mask determines the set of CPUs on which it is "
2108 "eligible to run.  On a multiprocessor system, setting the CPU affinity mask "
2109 "can be used to obtain performance benefits.  For example, by dedicating one "
2110 "CPU to a particular process (i.e., setting the affinity mask of that process "
2111 "to specify a single CPU, and setting the affinity mask of all other "
2112 "processes to exclude that CPU), it is possible to ensure maximum execution "
2113 "speed for that process.  Restricting a process to run on a single CPU also "
2114 "avoids the performance cost caused by the cache invalidation that occurs "
2115 "when a process ceases to execute on one CPU and then recommences execution "
2116 "on a different CPU."
2117 msgstr ""
2118
2119 #. type: Plain text
2120 #: build/C/man2/sched_setaffinity.2:71
2121 msgid ""
2122 "A CPU affinity mask is represented by the I<cpu_set_t> structure, a \"CPU "
2123 "set\", pointed to by I<mask>.  A set of macros for manipulating CPU sets is "
2124 "described in B<CPU_SET>(3)."
2125 msgstr ""
2126
2127 #. type: Plain text
2128 #: build/C/man2/sched_setaffinity.2:86
2129 msgid ""
2130 "B<sched_setaffinity>()  sets the CPU affinity mask of the process whose ID "
2131 "is I<pid> to the value specified by I<mask>.  If I<pid> is zero, then the "
2132 "calling process is used.  The argument I<cpusetsize> is the length (in "
2133 "bytes) of the data pointed to by I<mask>.  Normally this argument would be "
2134 "specified as I<sizeof(cpu_set_t)>."
2135 msgstr ""
2136
2137 #. type: Plain text
2138 #: build/C/man2/sched_setaffinity.2:93
2139 msgid ""
2140 "If the process specified by I<pid> is not currently running on one of the "
2141 "CPUs specified in I<mask>, then that process is migrated to one of the CPUs "
2142 "specified in I<mask>."
2143 msgstr ""
2144
2145 #. type: Plain text
2146 #: build/C/man2/sched_setaffinity.2:108
2147 msgid ""
2148 "B<sched_getaffinity>()  writes the affinity mask of the process whose ID is "
2149 "I<pid> into the I<cpu_set_t> structure pointed to by I<mask>.  The "
2150 "I<cpusetsize> argument specifies the size (in bytes) of I<mask>.  If I<pid> "
2151 "is zero, then the mask of the calling process is returned."
2152 msgstr ""
2153
2154 #. type: Plain text
2155 #: build/C/man2/sched_setaffinity.2:117
2156 msgid ""
2157 "On success, B<sched_setaffinity>()  and B<sched_getaffinity>()  return 0.  "
2158 "On error, -1 is returned, and I<errno> is set appropriately."
2159 msgstr ""
2160
2161 #. type: Plain text
2162 #: build/C/man2/sched_setaffinity.2:121
2163 msgid "A supplied memory address was invalid."
2164 msgstr ""
2165
2166 #. type: Plain text
2167 #: build/C/man2/sched_setaffinity.2:129
2168 msgid ""
2169 "The affinity bit mask I<mask> contains no processors that are currently "
2170 "physically on the system and permitted to the process according to any "
2171 "restrictions that may be imposed by the \"cpuset\" mechanism described in "
2172 "B<cpuset>(7)."
2173 msgstr ""
2174
2175 #. type: Plain text
2176 #: build/C/man2/sched_setaffinity.2:136
2177 msgid ""
2178 "(B<sched_getaffinity>()  and, in kernels before 2.6.9, "
2179 "B<sched_setaffinity>())  I<cpusetsize> is smaller than the size of the "
2180 "affinity mask used by the kernel."
2181 msgstr ""
2182
2183 #. type: Plain text
2184 #: build/C/man2/sched_setaffinity.2:146
2185 msgid ""
2186 "(B<sched_setaffinity>())  The calling process does not have appropriate "
2187 "privileges.  The caller needs an effective user ID equal to the real user ID "
2188 "or effective user ID of the process identified by I<pid>, or it must possess "
2189 "the B<CAP_SYS_NICE> capability."
2190 msgstr ""
2191
2192 #. type: Plain text
2193 #: build/C/man2/sched_setaffinity.2:149 build/C/man2/sched_setparam.2:111 build/C/man2/sched_setscheduler.2:445
2194 msgid "The process whose ID is I<pid> could not be found."
2195 msgstr ""
2196
2197 #. type: Plain text
2198 #: build/C/man2/sched_setaffinity.2:160
2199 msgid ""
2200 "The CPU affinity system calls were introduced in Linux kernel 2.5.8.  The "
2201 "system call wrappers were introduced in glibc 2.3.  Initially, the glibc "
2202 "interfaces included a I<cpusetsize> argument, typed as I<unsigned int>.  In "
2203 "glibc 2.3.3, the I<cpusetsize> argument was removed, but was then restored "
2204 "in glibc 2.3.4, with type I<size_t>."
2205 msgstr ""
2206
2207 #. type: Plain text
2208 #: build/C/man2/sched_setaffinity.2:162
2209 msgid "These system calls are Linux-specific."
2210 msgstr ""
2211
2212 #. type: Plain text
2213 #: build/C/man2/sched_setaffinity.2:175
2214 msgid ""
2215 "After a call to B<sched_setaffinity>(), the set of CPUs on which the process "
2216 "will actually run is the intersection of the set specified in the I<mask> "
2217 "argument and the set of CPUs actually present on the system.  The system may "
2218 "further restrict the set of CPUs on which the process runs if the \"cpuset\" "
2219 "mechanism described in B<cpuset>(7)  is being used.  These restrictions on "
2220 "the actual set of CPUs on which the process will run are silently imposed by "
2221 "the kernel."
2222 msgstr ""
2223
2224 #. type: Plain text
2225 #: build/C/man2/sched_setaffinity.2:195
2226 msgid ""
2227 "The affinity mask is actually a per-thread attribute that can be adjusted "
2228 "independently for each of the threads in a thread group.  The value returned "
2229 "from a call to B<gettid>(2)  can be passed in the argument I<pid>.  "
2230 "Specifying I<pid> as 0 will set the attribute for the calling thread, and "
2231 "passing the value returned from a call to B<getpid>(2)  will set the "
2232 "attribute for the main thread of the thread group.  (If you are using the "
2233 "POSIX threads API, then use B<pthread_setaffinity_np>(3)  instead of "
2234 "B<sched_setaffinity>().)"
2235 msgstr ""
2236
2237 #. type: Plain text
2238 #: build/C/man2/sched_setaffinity.2:201
2239 msgid ""
2240 "A child created via B<fork>(2)  inherits its parent's CPU affinity mask.  "
2241 "The affinity mask is preserved across an B<execve>(2)."
2242 msgstr ""
2243
2244 #. type: Plain text
2245 #: build/C/man2/sched_setaffinity.2:215
2246 msgid ""
2247 "This manual page describes the glibc interface for the CPU affinity calls.  "
2248 "The actual system call interface is slightly different, with the I<mask> "
2249 "being typed as I<unsigned long *>, reflecting the fact that the underlying "
2250 "implementation of CPU sets is a simple bit mask.  On success, the raw "
2251 "B<sched_getaffinity>()  system call returns the size (in bytes) of the "
2252 "I<cpumask_t> data type that is used internally by the kernel to represent "
2253 "the CPU set bit mask."
2254 msgstr ""
2255
2256 #. type: Plain text
2257 #: build/C/man2/sched_setaffinity.2:231
2258 msgid ""
2259 "B<clone>(2), B<getcpu>(2), B<getpriority>(2), B<gettid>(2), B<nice>(2), "
2260 "B<sched_get_priority_max>(2), B<sched_get_priority_min>(2), "
2261 "B<sched_getscheduler>(2), B<sched_setscheduler>(2), B<setpriority>(2), "
2262 "B<CPU_SET>(3), B<pthread_setaffinity_np>(3), B<sched_getcpu>(3), "
2263 "B<capabilities>(7), B<cpuset>(7)"
2264 msgstr ""
2265
2266 #. type: TH
2267 #: build/C/man2/sched_setparam.2:31
2268 #, no-wrap
2269 msgid "SCHED_SETPARAM"
2270 msgstr ""
2271
2272 #. type: Plain text
2273 #: build/C/man2/sched_setparam.2:34
2274 msgid "sched_setparam, sched_getparam - set and get scheduling parameters"
2275 msgstr ""
2276
2277 #. type: Plain text
2278 #: build/C/man2/sched_setparam.2:37 build/C/man2/sched_setscheduler.2:54
2279 #, no-wrap
2280 msgid "B<#include E<lt>sched.hE<gt>>\n"
2281 msgstr ""
2282
2283 #. type: Plain text
2284 #: build/C/man2/sched_setparam.2:39
2285 #, no-wrap
2286 msgid ""
2287 "B<int sched_setparam(pid_t >I<pid>B<, const struct sched_param "
2288 "*>I<param>B<);>\n"
2289 msgstr ""
2290
2291 #. type: Plain text
2292 #: build/C/man2/sched_setparam.2:41
2293 #, no-wrap
2294 msgid "B<int sched_getparam(pid_t >I<pid>B<, struct sched_param *>I<param>B<);>\n"
2295 msgstr ""
2296
2297 #. type: Plain text
2298 #: build/C/man2/sched_setparam.2:47 build/C/man2/sched_setscheduler.2:66
2299 #, no-wrap
2300 msgid ""
2301 "B<struct sched_param {\n"
2302 "    ...\n"
2303 "    int >I<sched_priority>B<;\n"
2304 "    ...\n"
2305 "};>\n"
2306 msgstr ""
2307
2308 #. type: Plain text
2309 #: build/C/man2/sched_setparam.2:61
2310 msgid ""
2311 "B<sched_setparam>()  sets the scheduling parameters associated with the "
2312 "scheduling policy for the process identified by I<pid>.  If I<pid> is zero, "
2313 "then the parameters of the calling process are set.  The interpretation of "
2314 "the argument I<param> depends on the scheduling policy of the process "
2315 "identified by I<pid>.  See B<sched_setscheduler>(2)  for a description of "
2316 "the scheduling policies supported under Linux."
2317 msgstr ""
2318
2319 #. type: Plain text
2320 #: build/C/man2/sched_setparam.2:67
2321 msgid ""
2322 "B<sched_getparam>()  retrieves the scheduling parameters for the process "
2323 "identified by I<pid>.  If I<pid> is zero, then the parameters of the calling "
2324 "process are retrieved."
2325 msgstr ""
2326
2327 #. type: Plain text
2328 #: build/C/man2/sched_setparam.2:76
2329 msgid ""
2330 "B<sched_setparam>()  checks the validity of I<param> for the scheduling "
2331 "policy of the process.  The value I<param-E<gt>sched_priority> must lie "
2332 "within the range given by B<sched_get_priority_min>(2)  and "
2333 "B<sched_get_priority_max>(2)."
2334 msgstr ""
2335
2336 #. type: Plain text
2337 #: build/C/man2/sched_setparam.2:80
2338 msgid ""
2339 "For a discussion of the privileges and resource limits related to scheduling "
2340 "priority and policy, see B<sched_setscheduler>(2)."
2341 msgstr ""
2342
2343 #. type: Plain text
2344 #: build/C/man2/sched_setparam.2:88
2345 msgid ""
2346 "POSIX systems on which B<sched_setparam>()  and B<sched_getparam>()  are "
2347 "available define B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
2348 msgstr ""
2349
2350 #. type: Plain text
2351 #: build/C/man2/sched_setparam.2:97
2352 msgid ""
2353 "On success, B<sched_setparam>()  and B<sched_getparam>()  return 0.  On "
2354 "error, -1 is returned, and I<errno> is set appropriately."
2355 msgstr ""
2356
2357 #. type: Plain text
2358 #: build/C/man2/sched_setparam.2:102
2359 msgid "The argument I<param> does not make sense for the current scheduling policy."
2360 msgstr ""
2361
2362 #. type: Plain text
2363 #: build/C/man2/sched_setparam.2:108
2364 msgid ""
2365 "The calling process does not have appropriate privileges (Linux: does not "
2366 "have the B<CAP_SYS_NICE> capability)."
2367 msgstr ""
2368
2369 #. type: Plain text
2370 #: build/C/man2/sched_setparam.2:124
2371 msgid ""
2372 "B<getpriority>(2), B<nice>(2), B<sched_get_priority_max>(2), "
2373 "B<sched_get_priority_min>(2), B<sched_getaffinity>(2), "
2374 "B<sched_getscheduler>(2), B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
2375 "B<setpriority>(2), B<capabilities>(7)"
2376 msgstr ""
2377
2378 #. type: TH
2379 #: build/C/man2/sched_setscheduler.2:47
2380 #, no-wrap
2381 msgid "SCHED_SETSCHEDULER"
2382 msgstr ""
2383
2384 #. type: TH
2385 #: build/C/man2/sched_setscheduler.2:47
2386 #, no-wrap
2387 msgid "2011-09-19"
2388 msgstr ""
2389
2390 #. type: Plain text
2391 #: build/C/man2/sched_setscheduler.2:51
2392 msgid ""
2393 "sched_setscheduler, sched_getscheduler - set and get scheduling "
2394 "policy/parameters"
2395 msgstr ""
2396
2397 #. type: Plain text
2398 #: build/C/man2/sched_setscheduler.2:56
2399 #, no-wrap
2400 msgid "B<int sched_setscheduler(pid_t >I<pid>B<, int >I<policy>B<,>\n"
2401 msgstr ""
2402
2403 #. type: Plain text
2404 #: build/C/man2/sched_setscheduler.2:58
2405 #, no-wrap
2406 msgid "B<                       const struct sched_param *>I<param>B<);>\n"
2407 msgstr ""
2408
2409 #. type: Plain text
2410 #: build/C/man2/sched_setscheduler.2:60
2411 #, no-wrap
2412 msgid "B<int sched_getscheduler(pid_t >I<pid>B<);>\n"
2413 msgstr ""
2414
2415 #. type: Plain text
2416 #: build/C/man2/sched_setscheduler.2:77
2417 msgid ""
2418 "B<sched_setscheduler>()  sets both the scheduling policy and the associated "
2419 "parameters for the process whose ID is specified in I<pid>.  If I<pid> "
2420 "equals zero, the scheduling policy and parameters of the calling process "
2421 "will be set.  The interpretation of the argument I<param> depends on the "
2422 "selected policy.  Currently, Linux supports the following \"normal\" (i.e., "
2423 "non-real-time) scheduling policies:"
2424 msgstr ""
2425
2426 #. type: TP
2427 #: build/C/man2/sched_setscheduler.2:77
2428 #, no-wrap
2429 msgid "B<SCHED_OTHER>"
2430 msgstr ""
2431
2432 #.  In the 2.6 kernel sources, SCHED_OTHER is actually called
2433 #.  SCHED_NORMAL.
2434 #. type: Plain text
2435 #: build/C/man2/sched_setscheduler.2:82
2436 msgid "the standard round-robin time-sharing policy;"
2437 msgstr ""
2438
2439 #. type: TP
2440 #: build/C/man2/sched_setscheduler.2:82
2441 #, no-wrap
2442 msgid "B<SCHED_BATCH>"
2443 msgstr ""
2444
2445 #. type: Plain text
2446 #: build/C/man2/sched_setscheduler.2:85
2447 msgid "for \"batch\" style execution of processes; and"
2448 msgstr ""
2449
2450 #. type: TP
2451 #: build/C/man2/sched_setscheduler.2:85
2452 #, no-wrap
2453 msgid "B<SCHED_IDLE>"
2454 msgstr ""
2455
2456 #. type: Plain text
2457 #: build/C/man2/sched_setscheduler.2:90
2458 msgid "for running I<very> low priority background jobs."
2459 msgstr ""
2460
2461 #. type: Plain text
2462 #: build/C/man2/sched_setscheduler.2:94
2463 msgid ""
2464 "The following \"real-time\" policies are also supported, for special "
2465 "time-critical applications that need precise control over the way in which "
2466 "runnable processes are selected for execution:"
2467 msgstr ""
2468
2469 #. type: TP
2470 #: build/C/man2/sched_setscheduler.2:94
2471 #, no-wrap
2472 msgid "B<SCHED_FIFO>"
2473 msgstr ""
2474
2475 #. type: Plain text
2476 #: build/C/man2/sched_setscheduler.2:97
2477 msgid "a first-in, first-out policy; and"
2478 msgstr ""
2479
2480 #. type: TP
2481 #: build/C/man2/sched_setscheduler.2:97
2482 #, no-wrap
2483 msgid "B<SCHED_RR>"
2484 msgstr ""
2485
2486 #. type: Plain text
2487 #: build/C/man2/sched_setscheduler.2:100
2488 msgid "a round-robin policy."
2489 msgstr ""
2490
2491 #. type: Plain text
2492 #: build/C/man2/sched_setscheduler.2:102
2493 msgid "The semantics of each of these policies are detailed below."
2494 msgstr ""
2495
2496 #. type: Plain text
2497 #: build/C/man2/sched_setscheduler.2:109
2498 msgid ""
2499 "B<sched_getscheduler>()  queries the scheduling policy currently applied to "
2500 "the process identified by I<pid>.  If I<pid> equals zero, the policy of the "
2501 "calling process will be retrieved."
2502 msgstr ""
2503
2504 #. type: SS
2505 #: build/C/man2/sched_setscheduler.2:109
2506 #, no-wrap
2507 msgid "Scheduling Policies"
2508 msgstr ""
2509
2510 #. type: Plain text
2511 #: build/C/man2/sched_setscheduler.2:118
2512 msgid ""
2513 "The scheduler is the kernel component that decides which runnable process "
2514 "will be executed by the CPU next.  Each process has an associated scheduling "
2515 "policy and a I<static> scheduling priority, I<sched_priority>; these are the "
2516 "settings that are modified by B<sched_setscheduler>().  The scheduler makes "
2517 "it decisions based on knowledge of the scheduling policy and static priority "
2518 "of all processes on the system."
2519 msgstr ""
2520
2521 #. type: Plain text
2522 #: build/C/man2/sched_setscheduler.2:123
2523 msgid ""
2524 "For processes scheduled under one of the normal scheduling policies "
2525 "(B<SCHED_OTHER>, B<SCHED_IDLE>, B<SCHED_BATCH>), I<sched_priority> is not "
2526 "used in scheduling decisions (it must be specified as 0)."
2527 msgstr ""
2528
2529 #. type: Plain text
2530 #: build/C/man2/sched_setscheduler.2:137
2531 msgid ""
2532 "Processes scheduled under one of the real-time policies (B<SCHED_FIFO>, "
2533 "B<SCHED_RR>) have a I<sched_priority> value in the range 1 (low) to 99 "
2534 "(high).  (As the numbers imply, real-time processes always have higher "
2535 "priority than normal processes.)  Note well: POSIX.1-2001 only requires an "
2536 "implementation to support a minimum 32 distinct priority levels for the "
2537 "real-time policies, and some systems supply just this minimum.  Portable "
2538 "programs should use B<sched_get_priority_min>(2)  and "
2539 "B<sched_get_priority_max>(2)  to find the range of priorities supported for "
2540 "a particular policy."
2541 msgstr ""
2542
2543 #. type: Plain text
2544 #: build/C/man2/sched_setscheduler.2:143
2545 msgid ""
2546 "Conceptually, the scheduler maintains a list of runnable processes for each "
2547 "possible I<sched_priority> value.  In order to determine which process runs "
2548 "next, the scheduler looks for the nonempty list with the highest static "
2549 "priority and selects the process at the head of this list."
2550 msgstr ""
2551
2552 #. type: Plain text
2553 #: build/C/man2/sched_setscheduler.2:147
2554 msgid ""
2555 "A process's scheduling policy determines where it will be inserted into the "
2556 "list of processes with equal static priority and how it will move inside "
2557 "this list."
2558 msgstr ""
2559
2560 #. type: Plain text
2561 #: build/C/man2/sched_setscheduler.2:155
2562 msgid ""
2563 "All scheduling is preemptive: if a process with a higher static priority "
2564 "becomes ready to run, the currently running process will be preempted and "
2565 "returned to the wait list for its static priority level.  The scheduling "
2566 "policy only determines the ordering within the list of runnable processes "
2567 "with equal static priority."
2568 msgstr ""
2569
2570 #. type: SS
2571 #: build/C/man2/sched_setscheduler.2:155
2572 #, no-wrap
2573 msgid "SCHED_FIFO: First In-First Out scheduling"
2574 msgstr ""
2575
2576 #. type: Plain text
2577 #: build/C/man2/sched_setscheduler.2:164
2578 msgid ""
2579 "B<SCHED_FIFO> can only be used with static priorities higher than 0, which "
2580 "means that when a B<SCHED_FIFO> processes becomes runnable, it will always "
2581 "immediately preempt any currently running B<SCHED_OTHER>, B<SCHED_BATCH>, or "
2582 "B<SCHED_IDLE> process.  B<SCHED_FIFO> is a simple scheduling algorithm "
2583 "without time slicing.  For processes scheduled under the B<SCHED_FIFO> "
2584 "policy, the following rules apply:"
2585 msgstr ""
2586
2587 #. type: IP
2588 #: build/C/man2/sched_setscheduler.2:164 build/C/man2/sched_setscheduler.2:169 build/C/man2/sched_setscheduler.2:172 build/C/man2/sched_setscheduler.2:186 build/C/man2/sched_setscheduler.2:288 build/C/man2/sched_setscheduler.2:296 build/C/man2/sched_setscheduler.2:337 build/C/man2/sched_setscheduler.2:345 build/C/man2/sched_setscheduler.2:350 build/C/man2/sched_setscheduler.2:355
2589 #, no-wrap
2590 msgid "*"
2591 msgstr ""
2592
2593 #. type: Plain text
2594 #: build/C/man2/sched_setscheduler.2:169
2595 msgid ""
2596 "A B<SCHED_FIFO> process that has been preempted by another process of higher "
2597 "priority will stay at the head of the list for its priority and will resume "
2598 "execution as soon as all processes of higher priority are blocked again."
2599 msgstr ""
2600
2601 #. type: Plain text
2602 #: build/C/man2/sched_setscheduler.2:172
2603 msgid ""
2604 "When a B<SCHED_FIFO> process becomes runnable, it will be inserted at the "
2605 "end of the list for its priority."
2606 msgstr ""
2607
2608 #.  In 2.2.x and 2.4.x, the process is placed at the front of the queue
2609 #.  In 2.0.x, the Right Thing happened: the process went to the back -- MTK
2610 #. type: Plain text
2611 #: build/C/man2/sched_setscheduler.2:186
2612 msgid ""
2613 "A call to B<sched_setscheduler>()  or B<sched_setparam>(2)  will put the "
2614 "B<SCHED_FIFO> (or B<SCHED_RR>) process identified by I<pid> at the start of "
2615 "the list if it was runnable.  As a consequence, it may preempt the currently "
2616 "running process if it has the same priority.  (POSIX.1-2001 specifies that "
2617 "the process should go to the end of the list.)"
2618 msgstr ""
2619
2620 #. type: Plain text
2621 #: build/C/man2/sched_setscheduler.2:190
2622 msgid "A process calling B<sched_yield>(2)  will be put at the end of the list."
2623 msgstr ""
2624
2625 #. type: Plain text
2626 #: build/C/man2/sched_setscheduler.2:194
2627 msgid ""
2628 "No other events will move a process scheduled under the B<SCHED_FIFO> policy "
2629 "in the wait list of runnable processes with equal static priority."
2630 msgstr ""
2631
2632 #. type: Plain text
2633 #: build/C/man2/sched_setscheduler.2:199
2634 msgid ""
2635 "A B<SCHED_FIFO> process runs until either it is blocked by an I/O request, "
2636 "it is preempted by a higher priority process, or it calls B<sched_yield>(2)."
2637 msgstr ""
2638
2639 #. type: SS
2640 #: build/C/man2/sched_setscheduler.2:199
2641 #, no-wrap
2642 msgid "SCHED_RR: Round Robin scheduling"
2643 msgstr ""
2644
2645 #.  On Linux 2.4, the length of the RR interval is influenced
2646 #.  by the process nice value -- MTK
2647 #. type: Plain text
2648 #: build/C/man2/sched_setscheduler.2:218
2649 msgid ""
2650 "B<SCHED_RR> is a simple enhancement of B<SCHED_FIFO>.  Everything described "
2651 "above for B<SCHED_FIFO> also applies to B<SCHED_RR>, except that each "
2652 "process is only allowed to run for a maximum time quantum.  If a B<SCHED_RR> "
2653 "process has been running for a time period equal to or longer than the time "
2654 "quantum, it will be put at the end of the list for its priority.  A "
2655 "B<SCHED_RR> process that has been preempted by a higher priority process and "
2656 "subsequently resumes execution as a running process will complete the "
2657 "unexpired portion of its round robin time quantum.  The length of the time "
2658 "quantum can be retrieved using B<sched_rr_get_interval>(2)."
2659 msgstr ""
2660
2661 #. type: SS
2662 #: build/C/man2/sched_setscheduler.2:218
2663 #, no-wrap
2664 msgid "SCHED_OTHER: Default Linux time-sharing scheduling"
2665 msgstr ""
2666
2667 #. type: Plain text
2668 #: build/C/man2/sched_setscheduler.2:234
2669 msgid ""
2670 "B<SCHED_OTHER> can only be used at static priority 0.  B<SCHED_OTHER> is the "
2671 "standard Linux time-sharing scheduler that is intended for all processes "
2672 "that do not require the special real-time mechanisms.  The process to run is "
2673 "chosen from the static priority 0 list based on a I<dynamic> priority that "
2674 "is determined only inside this list.  The dynamic priority is based on the "
2675 "nice value (set by B<nice>(2)  or B<setpriority>(2))  and increased for each "
2676 "time quantum the process is ready to run, but denied to run by the "
2677 "scheduler.  This ensures fair progress among all B<SCHED_OTHER> processes."
2678 msgstr ""
2679
2680 #. type: SS
2681 #: build/C/man2/sched_setscheduler.2:234
2682 #, no-wrap
2683 msgid "SCHED_BATCH: Scheduling batch processes"
2684 msgstr ""
2685
2686 #. type: Plain text
2687 #: build/C/man2/sched_setscheduler.2:246
2688 msgid ""
2689 "(Since Linux 2.6.16.)  B<SCHED_BATCH> can only be used at static priority "
2690 "0.  This policy is similar to B<SCHED_OTHER> in that it schedules the "
2691 "process according to its dynamic priority (based on the nice value).  The "
2692 "difference is that this policy will cause the scheduler to always assume "
2693 "that the process is CPU-intensive.  Consequently, the scheduler will apply a "
2694 "small scheduling penalty with respect to wakeup behaviour, so that this "
2695 "process is mildly disfavored in scheduling decisions."
2696 msgstr ""
2697
2698 #.  The following paragraph is drawn largely from the text that
2699 #.  accompanied Ingo Molnar's patch for the implementation of
2700 #.  SCHED_BATCH.
2701 #. type: Plain text
2702 #: build/C/man2/sched_setscheduler.2:255
2703 msgid ""
2704 "This policy is useful for workloads that are noninteractive, but do not want "
2705 "to lower their nice value, and for workloads that want a deterministic "
2706 "scheduling policy without interactivity causing extra preemptions (between "
2707 "the workload's tasks)."
2708 msgstr ""
2709
2710 #. type: SS
2711 #: build/C/man2/sched_setscheduler.2:255
2712 #, no-wrap
2713 msgid "SCHED_IDLE: Scheduling very low priority jobs"
2714 msgstr ""
2715
2716 #. type: Plain text
2717 #: build/C/man2/sched_setscheduler.2:259
2718 msgid ""
2719 "(Since Linux 2.6.23.)  B<SCHED_IDLE> can only be used at static priority 0; "
2720 "the process nice value has no influence for this policy."
2721 msgstr ""
2722
2723 #. type: Plain text
2724 #: build/C/man2/sched_setscheduler.2:267
2725 msgid ""
2726 "This policy is intended for running jobs at extremely low priority (lower "
2727 "even than a +19 nice value with the B<SCHED_OTHER> or B<SCHED_BATCH> "
2728 "policies)."
2729 msgstr ""
2730
2731 #. type: SS
2732 #: build/C/man2/sched_setscheduler.2:267
2733 #, no-wrap
2734 msgid "Resetting scheduling policy for child processes"
2735 msgstr ""
2736
2737 #. type: Plain text
2738 #: build/C/man2/sched_setscheduler.2:283
2739 msgid ""
2740 "Since Linux 2.6.32, the B<SCHED_RESET_ON_FORK> flag can be ORed in I<policy> "
2741 "when calling B<sched_setscheduler>().  As a result of including this flag, "
2742 "children created by B<fork>(2)  do not inherit privileged scheduling "
2743 "policies.  This feature is intended for media-playback applications, and can "
2744 "be used to prevent applications evading the B<RLIMIT_RTTIME> resource limit "
2745 "(see B<getrlimit>(2))  by creating multiple child processes."
2746 msgstr ""
2747
2748 #. type: Plain text
2749 #: build/C/man2/sched_setscheduler.2:288
2750 msgid ""
2751 "More precisely, if the B<SCHED_RESET_ON_FORK> flag is specified, the "
2752 "following rules apply for subsequently created children:"
2753 msgstr ""
2754
2755 #. type: Plain text
2756 #: build/C/man2/sched_setscheduler.2:296
2757 msgid ""
2758 "If the calling process has a scheduling policy of B<SCHED_FIFO> or "
2759 "B<SCHED_RR>, the policy is reset to B<SCHED_OTHER> in child processes."
2760 msgstr ""
2761
2762 #. type: Plain text
2763 #: build/C/man2/sched_setscheduler.2:299
2764 msgid ""
2765 "If the calling process has a negative nice value, the nice value is reset to "
2766 "zero in child processes."
2767 msgstr ""
2768
2769 #. type: Plain text
2770 #: build/C/man2/sched_setscheduler.2:308
2771 msgid ""
2772 "After the B<SCHED_RESET_ON_FORK> flag has been enabled, it can only be reset "
2773 "if the process has the B<CAP_SYS_NICE> capability.  This flag is disabled in "
2774 "child processes created by B<fork>(2)."
2775 msgstr ""
2776
2777 #. type: Plain text
2778 #: build/C/man2/sched_setscheduler.2:314
2779 msgid ""
2780 "The B<SCHED_RESET_ON_FORK> flag is visible in the policy value returned by "
2781 "B<sched_getscheduler>()"
2782 msgstr ""
2783
2784 #. type: SS
2785 #: build/C/man2/sched_setscheduler.2:314
2786 #, no-wrap
2787 msgid "Privileges and resource limits"
2788 msgstr ""
2789
2790 #. type: Plain text
2791 #: build/C/man2/sched_setscheduler.2:327
2792 msgid ""
2793 "In Linux kernels before 2.6.12, only privileged (B<CAP_SYS_NICE>)  processes "
2794 "can set a nonzero static priority (i.e., set a real-time scheduling "
2795 "policy).  The only change that an unprivileged process can make is to set "
2796 "the B<SCHED_OTHER> policy, and this can only be done if the effective user "
2797 "ID of the caller of B<sched_setscheduler>()  matches the real or effective "
2798 "user ID of the target process (i.e., the process specified by I<pid>)  whose "
2799 "policy is being changed."
2800 msgstr ""
2801
2802 #. type: Plain text
2803 #: build/C/man2/sched_setscheduler.2:337
2804 msgid ""
2805 "Since Linux 2.6.12, the B<RLIMIT_RTPRIO> resource limit defines a ceiling on "
2806 "an unprivileged process's static priority for the B<SCHED_RR> and "
2807 "B<SCHED_FIFO> policies.  The rules for changing scheduling policy and "
2808 "priority are as follows:"
2809 msgstr ""
2810
2811 #. type: Plain text
2812 #: build/C/man2/sched_setscheduler.2:345
2813 msgid ""
2814 "If an unprivileged process has a nonzero B<RLIMIT_RTPRIO> soft limit, then "
2815 "it can change its scheduling policy and priority, subject to the restriction "
2816 "that the priority cannot be set to a value higher than the maximum of its "
2817 "current priority and its B<RLIMIT_RTPRIO> soft limit."
2818 msgstr ""
2819
2820 #. type: Plain text
2821 #: build/C/man2/sched_setscheduler.2:350
2822 msgid ""
2823 "If the B<RLIMIT_RTPRIO> soft limit is 0, then the only permitted changes are "
2824 "to lower the priority, or to switch to a non-real-time policy."
2825 msgstr ""
2826
2827 #. type: Plain text
2828 #: build/C/man2/sched_setscheduler.2:355
2829 msgid ""
2830 "Subject to the same rules, another unprivileged process can also make these "
2831 "changes, as long as the effective user ID of the process making the change "
2832 "matches the real or effective user ID of the target process."
2833 msgstr ""
2834
2835 #.  commit c02aa73b1d18e43cfd79c2f193b225e84ca497c8
2836 #. type: Plain text
2837 #: build/C/man2/sched_setscheduler.2:373
2838 msgid ""
2839 "Special rules apply for the B<SCHED_IDLE>.  In Linux kernels before 2.6.39, "
2840 "an unprivileged process operating under this policy cannot change its "
2841 "policy, regardless of the value of its B<RLIMIT_RTPRIO> resource limit.  In "
2842 "Linux kernels since 2.6.39, an unprivileged process can switch to either the "
2843 "B<SCHED_BATCH> or the B<SCHED_NORMAL> policy so long as its nice value falls "
2844 "within the range permitted by its B<RLIMIT_NICE> resource limit (see "
2845 "B<getrlimit>(2))."
2846 msgstr ""
2847
2848 #. type: Plain text
2849 #: build/C/man2/sched_setscheduler.2:384
2850 msgid ""
2851 "Privileged (B<CAP_SYS_NICE>)  processes ignore the B<RLIMIT_RTPRIO> limit; "
2852 "as with older kernels, they can make arbitrary changes to scheduling policy "
2853 "and priority.  See B<getrlimit>(2)  for further information on "
2854 "B<RLIMIT_RTPRIO>."
2855 msgstr ""
2856
2857 #. type: SS
2858 #: build/C/man2/sched_setscheduler.2:384
2859 #, no-wrap
2860 msgid "Response time"
2861 msgstr ""
2862
2863 #.  as described in
2864 #.  .BR request_irq (9).
2865 #. type: Plain text
2866 #: build/C/man2/sched_setscheduler.2:392
2867 msgid ""
2868 "A blocked high priority process waiting for the I/O has a certain response "
2869 "time before it is scheduled again.  The device driver writer can greatly "
2870 "reduce this response time by using a \"slow interrupt\" interrupt handler."
2871 msgstr ""
2872
2873 #. type: SS
2874 #: build/C/man2/sched_setscheduler.2:392
2875 #, no-wrap
2876 msgid "Miscellaneous"
2877 msgstr ""
2878
2879 #. type: Plain text
2880 #: build/C/man2/sched_setscheduler.2:397
2881 msgid ""
2882 "Child processes inherit the scheduling policy and parameters across a "
2883 "B<fork>(2).  The scheduling policy and parameters are preserved across "
2884 "B<execve>(2)."
2885 msgstr ""
2886
2887 #. type: Plain text
2888 #: build/C/man2/sched_setscheduler.2:403
2889 msgid ""
2890 "Memory locking is usually needed for real-time processes to avoid paging "
2891 "delays; this can be done with B<mlock>(2)  or B<mlockall>(2)."
2892 msgstr ""
2893
2894 #. type: Plain text
2895 #: build/C/man2/sched_setscheduler.2:415
2896 msgid ""
2897 "Since a nonblocking infinite loop in a process scheduled under B<SCHED_FIFO> "
2898 "or B<SCHED_RR> will block all processes with lower priority forever, a "
2899 "software developer should always keep available on the console a shell "
2900 "scheduled under a higher static priority than the tested application.  This "
2901 "will allow an emergency kill of tested real-time applications that do not "
2902 "block or terminate as expected.  See also the description of the "
2903 "B<RLIMIT_RTTIME> resource limit in B<getrlimit>(2)."
2904 msgstr ""
2905
2906 #. type: Plain text
2907 #: build/C/man2/sched_setscheduler.2:423
2908 msgid ""
2909 "POSIX systems on which B<sched_setscheduler>()  and B<sched_getscheduler>()  "
2910 "are available define B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
2911 msgstr ""
2912
2913 #. type: Plain text
2914 #: build/C/man2/sched_setscheduler.2:433
2915 msgid ""
2916 "On success, B<sched_setscheduler>()  returns zero.  On success, "
2917 "B<sched_getscheduler>()  returns the policy for the process (a nonnegative "
2918 "integer).  On error, -1 is returned, and I<errno> is set appropriately."
2919 msgstr ""
2920
2921 #. type: Plain text
2922 #: build/C/man2/sched_setscheduler.2:439
2923 msgid ""
2924 "The scheduling I<policy> is not one of the recognized policies, I<param> is "
2925 "NULL, or I<param> does not make sense for the I<policy>."
2926 msgstr ""
2927
2928 #. type: Plain text
2929 #: build/C/man2/sched_setscheduler.2:442
2930 msgid "The calling process does not have appropriate privileges."
2931 msgstr ""
2932
2933 #. type: Plain text
2934 #: build/C/man2/sched_setscheduler.2:448
2935 msgid ""
2936 "POSIX.1-2001 (but see BUGS below).  The B<SCHED_BATCH> and B<SCHED_IDLE> "
2937 "policies are Linux-specific."
2938 msgstr ""
2939
2940 #. type: Plain text
2941 #: build/C/man2/sched_setscheduler.2:456
2942 msgid ""
2943 "POSIX.1 does not detail the permissions that an unprivileged process "
2944 "requires in order to call B<sched_setscheduler>(), and details vary across "
2945 "systems.  For example, the Solaris 7 manual page says that the real or "
2946 "effective user ID of the calling process must match the real user ID or the "
2947 "save set-user-ID of the target process."
2948 msgstr ""
2949
2950 #. type: Plain text
2951 #: build/C/man2/sched_setscheduler.2:466
2952 msgid ""
2953 "Originally, Standard Linux was intended as a general-purpose operating "
2954 "system being able to handle background processes, interactive applications, "
2955 "and less demanding real-time applications (applications that need to usually "
2956 "meet timing deadlines).  Although the Linux kernel 2.6 allowed for kernel "
2957 "preemption and the newly introduced O(1) scheduler ensures that the time "
2958 "needed to schedule is fixed and deterministic irrespective of the number of "
2959 "active tasks, true real-time computing was not possible up to kernel version "
2960 "2.6.17."
2961 msgstr ""
2962
2963 #. type: SS
2964 #: build/C/man2/sched_setscheduler.2:466
2965 #, no-wrap
2966 msgid "Real-time features in the mainline Linux kernel"
2967 msgstr ""
2968
2969 #.  FIXME . Probably this text will need some minor tweaking
2970 #.  by about the time of 2.6.30; ask Carsten Emde about this then.
2971 #. type: Plain text
2972 #: build/C/man2/sched_setscheduler.2:480
2973 msgid ""
2974 "From kernel version 2.6.18 onward, however, Linux is gradually becoming "
2975 "equipped with real-time capabilities, most of which are derived from the "
2976 "former I<realtime-preempt> patches developed by Ingo Molnar, Thomas "
2977 "Gleixner, Steven Rostedt, and others.  Until the patches have been "
2978 "completely merged into the mainline kernel (this is expected to be around "
2979 "kernel version 2.6.30), they must be installed to achieve the best real-time "
2980 "performance.  These patches are named:"
2981 msgstr ""
2982
2983 #. type: Plain text
2984 #: build/C/man2/sched_setscheduler.2:484
2985 #, no-wrap
2986 msgid "patch-I<kernelversion>-rtI<patchversion>\n"
2987 msgstr ""
2988
2989 #. type: Plain text
2990 #: build/C/man2/sched_setscheduler.2:489
2991 msgid ""
2992 "and can be downloaded from "
2993 "I<http://www.kernel.org/pub/linux/kernel/projects/rt/>."
2994 msgstr ""
2995
2996 #. type: Plain text
2997 #: build/C/man2/sched_setscheduler.2:498
2998 msgid ""
2999 "Without the patches and prior to their full inclusion into the mainline "
3000 "kernel, the kernel configuration offers only the three preemption classes "
3001 "B<CONFIG_PREEMPT_NONE>, B<CONFIG_PREEMPT_VOLUNTARY>, and "
3002 "B<CONFIG_PREEMPT_DESKTOP> which respectively provide no, some, and "
3003 "considerable reduction of the worst-case scheduling latency."
3004 msgstr ""
3005
3006 #. type: Plain text
3007 #: build/C/man2/sched_setscheduler.2:509
3008 msgid ""
3009 "With the patches applied or after their full inclusion into the mainline "
3010 "kernel, the additional configuration item B<CONFIG_PREEMPT_RT> becomes "
3011 "available.  If this is selected, Linux is transformed into a regular "
3012 "real-time operating system.  The FIFO and RR scheduling policies that can be "
3013 "selected using B<sched_setscheduler>()  are then used to run a process with "
3014 "true real-time priority and a minimum worst-case scheduling latency."
3015 msgstr ""
3016
3017 #. type: Plain text
3018 #: build/C/man2/sched_setscheduler.2:517
3019 msgid ""
3020 "POSIX says that on success, B<sched_setscheduler>()  should return the "
3021 "previous scheduling policy.  Linux B<sched_setscheduler>()  does not conform "
3022 "to this requirement, since it always returns 0 on success."
3023 msgstr ""
3024
3025 #. type: Plain text
3026 #: build/C/man2/sched_setscheduler.2:535
3027 msgid ""
3028 "B<getpriority>(2), B<mlock>(2), B<mlockall>(2), B<munlock>(2), "
3029 "B<munlockall>(2), B<nice>(2), B<sched_get_priority_max>(2), "
3030 "B<sched_get_priority_min>(2), B<sched_getaffinity>(2), B<sched_getparam>(2), "
3031 "B<sched_rr_get_interval>(2), B<sched_setaffinity>(2), B<sched_setparam>(2), "
3032 "B<sched_yield>(2), B<setpriority>(2), B<capabilities>(7), B<cpuset>(7)"
3033 msgstr ""
3034
3035 #. type: Plain text
3036 #: build/C/man2/sched_setscheduler.2:542
3037 msgid ""
3038 "The kernel source file I<Documentation/scheduler/sched-rt-group.txt> (since "
3039 "kernel 2.6.25)."
3040 msgstr ""
3041
3042 #. type: TH
3043 #: build/C/man2/sched_yield.2:30
3044 #, no-wrap
3045 msgid "SCHED_YIELD"
3046 msgstr ""
3047
3048 #. type: TH
3049 #: build/C/man2/sched_yield.2:30
3050 #, no-wrap
3051 msgid "2008-10-18"
3052 msgstr ""
3053
3054 #. type: Plain text
3055 #: build/C/man2/sched_yield.2:33
3056 msgid "sched_yield - yield the processor"
3057 msgstr ""
3058
3059 #. type: Plain text
3060 #: build/C/man2/sched_yield.2:37
3061 msgid "B<int sched_yield(void);>"
3062 msgstr ""
3063
3064 #. type: Plain text
3065 #: build/C/man2/sched_yield.2:42
3066 msgid ""
3067 "B<sched_yield>()  causes the calling thread to relinquish the CPU.  The "
3068 "thread is moved to the end of the queue for its static priority and a new "
3069 "thread gets to run."
3070 msgstr ""
3071
3072 #. type: Plain text
3073 #: build/C/man2/sched_yield.2:49
3074 msgid ""
3075 "On success, B<sched_yield>()  returns 0.  On error, -1 is returned, and "
3076 "I<errno> is set appropriately."
3077 msgstr ""
3078
3079 #. type: Plain text
3080 #: build/C/man2/sched_yield.2:53
3081 msgid "In the Linux implementation, B<sched_yield>()  always succeeds."
3082 msgstr ""
3083
3084 #. type: Plain text
3085 #: build/C/man2/sched_yield.2:60
3086 msgid ""
3087 "If the calling thread is the only thread in the highest priority list at "
3088 "that time, it will continue to run after a call to B<sched_yield>()."
3089 msgstr ""
3090
3091 #. type: Plain text
3092 #: build/C/man2/sched_yield.2:66
3093 msgid ""
3094 "POSIX systems on which B<sched_yield>()  is available define "
3095 "B<_POSIX_PRIORITY_SCHEDULING> in I<E<lt>unistd.hE<gt>>."
3096 msgstr ""
3097
3098 #. type: Plain text
3099 #: build/C/man2/sched_yield.2:79
3100 msgid ""
3101 "Strategic calls to B<sched_yield>()  can improve performance by giving other "
3102 "threads or processes a chance to run when (heavily) contended resources "
3103 "(e.g., mutexes)  have been released by the caller.  Avoid calling "
3104 "B<sched_yield>()  unnecessarily or inappropriately (e.g., when resources "
3105 "needed by other schedulable threads are still held by the caller), since "
3106 "doing so will result in unnecessary context switches, which will degrade "
3107 "system performance."
3108 msgstr ""
3109
3110 #. type: Plain text
3111 #: build/C/man2/sched_yield.2:82
3112 msgid "B<sched_setscheduler>(2)  for a description of Linux scheduling."
3113 msgstr ""
3114
3115 #. type: TH
3116 #: build/C/man2/setns.2:4
3117 #, no-wrap
3118 msgid "SETNS"
3119 msgstr ""
3120
3121 #. type: TH
3122 #: build/C/man2/setns.2:4
3123 #, no-wrap
3124 msgid "2011-10-04"
3125 msgstr ""
3126
3127 #. type: Plain text
3128 #: build/C/man2/setns.2:7
3129 msgid "setns - reassociate thread with a namespace"
3130 msgstr ""
3131
3132 #. type: Plain text
3133 #: build/C/man2/setns.2:13
3134 #, no-wrap
3135 msgid "B<int setns(int >I<fd>B<, int >I<nstype>B<);>\n"
3136 msgstr ""
3137
3138 #. type: Plain text
3139 #: build/C/man2/setns.2:17
3140 msgid ""
3141 "Given a file descriptor referring to a namespace, reassociate the calling "
3142 "thread with that namespace."
3143 msgstr ""
3144
3145 #. type: Plain text
3146 #: build/C/man2/setns.2:30
3147 msgid ""
3148 "The I<fd> argument is a file descriptor referring to one of the namespace "
3149 "entries in a I</proc/[pid]/ns/> directory; see B<proc>(5)  for further "
3150 "information on I</proc/[pid]/ns/>.  The calling thread will be reassociated "
3151 "with the corresponding namespace, subject to any constraints imposed by the "
3152 "I<nstype> argument."
3153 msgstr ""
3154
3155 #. type: Plain text
3156 #: build/C/man2/setns.2:36
3157 msgid ""
3158 "The I<nstype> argument specifies which type of namespace the calling thread "
3159 "may be reassociated with.  This argument can have one of the following "
3160 "values:"
3161 msgstr ""
3162
3163 #. type: TP
3164 #: build/C/man2/setns.2:36
3165 #, no-wrap
3166 msgid "B<0>"
3167 msgstr ""
3168
3169 #. type: Plain text
3170 #: build/C/man2/setns.2:39
3171 msgid "Allow any type of namespace to be joined."
3172 msgstr ""
3173
3174 #. type: TP
3175 #: build/C/man2/setns.2:39
3176 #, no-wrap
3177 msgid "B<CLONE_NEWIPC>"
3178 msgstr ""
3179
3180 #. type: Plain text
3181 #: build/C/man2/setns.2:43
3182 msgid "I<fd> must refer to an IPC namespace."
3183 msgstr ""
3184
3185 #. type: TP
3186 #: build/C/man2/setns.2:43
3187 #, no-wrap
3188 msgid "B<CLONE_NEWNET>"
3189 msgstr ""
3190
3191 #. type: Plain text
3192 #: build/C/man2/setns.2:47
3193 msgid "I<fd> must refer to a network namespace."
3194 msgstr ""
3195
3196 #. type: TP
3197 #: build/C/man2/setns.2:47
3198 #, no-wrap
3199 msgid "B<CLONE_NEWUTS>"
3200 msgstr ""
3201
3202 #. type: Plain text
3203 #: build/C/man2/setns.2:51
3204 msgid "I<fd> must refer to a UTS namespace."
3205 msgstr ""
3206
3207 #. type: Plain text
3208 #: build/C/man2/setns.2:66
3209 msgid ""
3210 "Specifying I<nstype> as 0 suffices if the caller knows (or does not care)  "
3211 "what type of namespace is referred to by I<fd>.  Specifying a nonzero value "
3212 "for I<nstype> is useful if the caller does not know what type of namespace "
3213 "is referred to by I<fd> and wants to ensure that the namespace is of a "
3214 "particular type.  (The caller might not know the type of the namespace "
3215 "referred to by I<fd> if the file descriptor was opened by another process "
3216 "and, for example, passed to the caller via a UNIX domain socket.)"
3217 msgstr ""
3218
3219 #. type: Plain text
3220 #: build/C/man2/setns.2:73
3221 msgid ""
3222 "On success, I<setns>()  returns 0.  On failure, -1 is returned and I<errno> "
3223 "is set to indicate the error."
3224 msgstr ""
3225
3226 #. type: TP
3227 #: build/C/man2/setns.2:74
3228 #, no-wrap
3229 msgid "B<EBADF>"
3230 msgstr ""
3231
3232 #. type: Plain text
3233 #: build/C/man2/setns.2:78
3234 msgid "I<fd> is not a valid file descriptor."
3235 msgstr ""
3236
3237 #. type: Plain text
3238 #: build/C/man2/setns.2:85
3239 msgid ""
3240 "I<fd> refers to a namespace whose type does not match that specified in "
3241 "I<nstype>, or there is problem with reassociating the the thread with the "
3242 "specified namespace."
3243 msgstr ""
3244
3245 #. type: Plain text
3246 #: build/C/man2/setns.2:88
3247 msgid "Cannot allocate sufficient memory to change the specified namespace."
3248 msgstr ""
3249
3250 #. type: Plain text
3251 #: build/C/man2/setns.2:93
3252 msgid ""
3253 "The calling thread did not have the required privilege (B<CAP_SYS_ADMIN>)  "
3254 "for this operation."
3255 msgstr ""
3256
3257 #. type: Plain text
3258 #: build/C/man2/setns.2:97
3259 msgid "The B<setns>()  system call first appeared in Linux in kernel 3.0"
3260 msgstr ""
3261
3262 #. type: Plain text
3263 #: build/C/man2/setns.2:101
3264 msgid "The B<setns>()  system call is Linux-specific."
3265 msgstr ""
3266
3267 #. type: Plain text
3268 #: build/C/man2/setns.2:107
3269 msgid ""
3270 "Not all of the attributes that can be shared when a new thread is created "
3271 "using B<clone>(2)  can be changed using B<setns>()."
3272 msgstr ""
3273
3274 #. type: Plain text
3275 #: build/C/man2/setns.2:115
3276 msgid ""
3277 "The PID namespace and the mount namespace are not currently supported.  (See "
3278 "the descriptions of B<CLONE_NEWPID> and B<CLONE_NEWNS> in B<clone>(2).)"
3279 msgstr ""
3280
3281 #. type: Plain text
3282 #: build/C/man2/setns.2:121
3283 msgid "B<clone>(2), B<fork>(2), B<vfork>(2), B<proc>(5), B<unix>(7)"
3284 msgstr ""
3285
3286 #. type: TH
3287 #: build/C/man2/unshare.2:17
3288 #, no-wrap
3289 msgid "UNSHARE"
3290 msgstr ""
3291
3292 #. type: TH
3293 #: build/C/man2/unshare.2:17
3294 #, no-wrap
3295 msgid "2010-10-30"
3296 msgstr ""
3297
3298 #. type: Plain text
3299 #: build/C/man2/unshare.2:20
3300 msgid "unshare - disassociate parts of the process execution context"
3301 msgstr ""
3302
3303 #. type: Plain text
3304 #: build/C/man2/unshare.2:28
3305 #, no-wrap
3306 msgid "B<int unshare(int >I<flags>B<);>\n"
3307 msgstr ""
3308
3309 #. type: Plain text
3310 #: build/C/man2/unshare.2:41
3311 msgid ""
3312 "B<unshare>()  allows a process to disassociate parts of its execution "
3313 "context that are currently being shared with other processes.  Part of the "
3314 "execution context, such as the mount namespace, is shared implicitly when a "
3315 "new process is created using B<fork>(2)  or B<vfork>(2), while other parts, "
3316 "such as virtual memory, may be shared by explicit request when creating a "
3317 "process using B<clone>(2)."
3318 msgstr ""
3319
3320 #. type: Plain text
3321 #: build/C/man2/unshare.2:46
3322 msgid ""
3323 "The main use of B<unshare>()  is to allow a process to control its shared "
3324 "execution context without creating a new process."
3325 msgstr ""
3326
3327 #. type: Plain text
3328 #: build/C/man2/unshare.2:53
3329 msgid ""
3330 "The I<flags> argument is a bit mask that specifies which parts of the "
3331 "execution context should be unshared.  This argument is specified by ORing "
3332 "together zero or more of the following constants:"
3333 msgstr ""
3334
3335 #. type: Plain text
3336 #: build/C/man2/unshare.2:61
3337 msgid ""
3338 "Reverse the effect of the B<clone>(2)  B<CLONE_FILES> flag.  Unshare the "
3339 "file descriptor table, so that the calling process no longer shares its file "
3340 "descriptors with any other process."
3341 msgstr ""
3342
3343 #. type: Plain text
3344 #: build/C/man2/unshare.2:74
3345 msgid ""
3346 "Reverse the effect of the B<clone>(2)  B<CLONE_FS> flag.  Unshare file "
3347 "system attributes, so that the calling process no longer shares its root "
3348 "directory, current directory, or umask attributes with any other process.  "
3349 "B<chroot>(2), B<chdir>(2), or B<umask>(2)"
3350 msgstr ""
3351
3352 #. type: Plain text
3353 #: build/C/man2/unshare.2:91
3354 msgid ""
3355 "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWIPC> flag.  "
3356 "Unshare the System V IPC namespace, so that the calling process has a "
3357 "private copy of the System V IPC namespace which is not shared with any "
3358 "other process.  Specifying this flag automatically implies B<CLONE_SYSVSEM> "
3359 "as well.  Use of B<CLONE_NEWIPC> requires the B<CAP_SYS_ADMIN> capability."
3360 msgstr ""
3361
3362 #. type: Plain text
3363 #: build/C/man2/unshare.2:105
3364 msgid ""
3365 "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWNET> flag.  "
3366 "Unshare the network namespace, so that the calling process is moved into a "
3367 "new network namespace which is not shared with any previously existing "
3368 "process.  B<CLONE_NEWNET> requires the B<CAP_SYS_ADMIN> capability."
3369 msgstr ""
3370
3371 #. type: TP
3372 #: build/C/man2/unshare.2:105
3373 #, no-wrap
3374 msgid "B<CLONE_NEWNS>"
3375 msgstr ""
3376
3377 #.  These flag name are inconsistent:
3378 #.  CLONE_NEWNS does the same thing in clone(), but CLONE_VM,
3379 #.  CLONE_FS, and CLONE_FILES reverse the action of the clone()
3380 #.  flags of the same name.
3381 #. type: Plain text
3382 #: build/C/man2/unshare.2:126
3383 msgid ""
3384 "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWNS> flag.  "
3385 "Unshare the mount namespace, so that the calling process has a private copy "
3386 "of its namespace which is not shared with any other process.  Specifying "
3387 "this flag automatically implies B<CLONE_FS> as well.  Use of B<CLONE_NEWNS> "
3388 "requires the B<CAP_SYS_ADMIN> capability."
3389 msgstr ""
3390
3391 #. type: TP
3392 #: build/C/man2/unshare.2:126
3393 #, no-wrap
3394 msgid "B<CLONE_SYSVSEM> (since Linux 2.6.26)"
3395 msgstr ""
3396
3397 #. type: Plain text
3398 #: build/C/man2/unshare.2:140
3399 msgid ""
3400 "This flag reverses the effect of the B<clone>(2)  B<CLONE_SYSVSEM> flag.  "
3401 "Unshare System V semaphore undo values, so that the calling process has a "
3402 "private copy which is not shared with any other process.  Use of "
3403 "B<CLONE_SYSVSEM> requires the B<CAP_SYS_ADMIN> capability."
3404 msgstr ""
3405
3406 #.  As at 2.6.16, the following forced implications also apply,
3407 #.  although the relevant flags are not yet implemented.
3408 #.  If CLONE_THREAD is set force CLONE_VM.
3409 #.  If CLONE_VM is set, force CLONE_SIGHAND.
3410 #.  CLONE_NEWNSIf CLONE_SIGHAND is set and signals are also being shared
3411 #.  (i.e., current->signal->count > 1), force CLONE_THREAD.
3412 #
3413 #.  FIXME . CLONE_VM is not (yet, as at 2.6.16) implemented.
3414 #.  .TP
3415 #.  .B CLONE_VM
3416 #.  Reverse the effect of the
3417 #.  .BR clone (2)
3418 #.  .B CLONE_VM
3419 #.  flag.
3420 #.  .RB ( CLONE_VM
3421 #.  is also implicitly set by
3422 #.  .BR vfork (2),
3423 #.  and can be reversed using this
3424 #.  .BR unshare ()
3425 #.  flag.)
3426 #.  Unshare virtual memory, so that the calling process no
3427 #.  longer shares its virtual address space with any other process.
3428 #. type: Plain text
3429 #: build/C/man2/unshare.2:176
3430 msgid ""
3431 "This flag has the same effect as the B<clone>(2)  B<CLONE_NEWUTS> flag.  "
3432 "Unshare the UTS IPC namespace, so that the calling process has a private "
3433 "copy of the UTS namespace which is not shared with any other process.  Use "
3434 "of B<CLONE_NEWUTS> requires the B<CAP_SYS_ADMIN> capability."
3435 msgstr ""
3436
3437 #. type: Plain text
3438 #: build/C/man2/unshare.2:183
3439 msgid ""
3440 "If I<flags> is specified as zero, then B<unshare>()  is a no-op; no changes "
3441 "are made to the calling process's execution context."
3442 msgstr ""
3443
3444 #. type: Plain text
3445 #: build/C/man2/unshare.2:188
3446 msgid ""
3447 "On success, zero returned.  On failure, -1 is returned and I<errno> is set "
3448 "to indicate the error."
3449 msgstr ""
3450
3451 #. type: Plain text
3452 #: build/C/man2/unshare.2:193
3453 msgid "An invalid bit was specified in I<flags>."
3454 msgstr ""
3455
3456 #. type: Plain text
3457 #: build/C/man2/unshare.2:197
3458 msgid ""
3459 "Cannot allocate sufficient memory to copy parts of caller's context that "
3460 "need to be unshared."
3461 msgstr ""
3462
3463 #. type: Plain text
3464 #: build/C/man2/unshare.2:200
3465 msgid "The calling process did not have the required privileges for this operation."
3466 msgstr ""
3467
3468 #. type: Plain text
3469 #: build/C/man2/unshare.2:204
3470 msgid "The B<unshare>()  system call was added to Linux in kernel 2.6.16."
3471 msgstr ""
3472
3473 #. type: Plain text
3474 #: build/C/man2/unshare.2:208
3475 msgid "The B<unshare>()  system call is Linux-specific."
3476 msgstr ""
3477
3478 #.  However, we can do unshare(CLONE_SIGHAND) if CLONE_SIGHAND
3479 #.  was not specified when doing clone(); i.e., unsharing
3480 #.  signal handlers is permitted if we are not actually
3481 #.  sharing signal handlers.   mtk
3482 #.  FIXME . check future kernel versions (e.g., 2.6.17)
3483 #.  to see if CLONE_VM gets implemented.
3484 #.  However, as at 2.6.16, we can do unshare(CLONE_VM) if CLONE_VM
3485 #.  was not specified when doing clone(); i.e., unsharing
3486 #.  virtual memory is permitted if we are not actually
3487 #.  sharing virtual memory.   mtk
3488 #
3489 #. 9) Future Work
3490 #. --------------
3491 #. The current implementation of unshare does not allow unsharing of
3492 #. signals and signal handlers. Signals are complex to begin with and
3493 #. to unshare signals and/or signal handlers of a currently running
3494 #. process is even more complex. If in the future there is a specific
3495 #. need to allow unsharing of signals and/or signal handlers, it can
3496 #. be incrementally added to unshare without affecting legacy
3497 #. applications using unshare.
3498 #. type: Plain text
3499 #: build/C/man2/unshare.2:244
3500 msgid ""
3501 "Not all of the process attributes that can be shared when a new process is "
3502 "created using B<clone>(2)  can be unshared using B<unshare>().  In "
3503 "particular, as at kernel 2.6.16, B<unshare>()  does not implement flags that "
3504 "reverse the effects of B<CLONE_SIGHAND>, B<CLONE_SYSVSEM>, B<CLONE_THREAD>, "
3505 "or B<CLONE_VM>.  Such functionality may be added in the future, if required."
3506 msgstr ""
3507
3508 #. type: Plain text
3509 #: build/C/man2/unshare.2:249
3510 msgid "B<clone>(2), B<fork>(2), B<vfork>(2), Documentation/unshare.txt"
3511 msgstr ""