OSDN Git Service

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