OSDN Git Service

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