OSDN Git Service

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