Debian Codegraph @

po/fr/man3/pthread_setschedparam.3.po

raw
1 # French translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Christophe Blaess <https://www.blaess.fr/christophe/>, 1996-2003.
5 # Stéphan Rafin <[email protected]>, 2002.
6 # Thierry Vignaud <[email protected]>, 1999, 2002.
7 # François Micaux, 2002.
8 # Alain Portal <[email protected]>, 2003-2008.
9 # Jean-Philippe Guérard <[email protected]>, 2005-2006.
10 # Jean-Luc Coulon (f5ibh) <[email protected]>, 2006-2007.
11 # Julien Cristau <[email protected]>, 2006-2007.
12 # Thomas Huriaux <[email protected]>, 2006-2008.
13 # Nicolas François <[email protected]>, 2006-2008.
14 # Florentin Duneau <[email protected]>, 2006-2010.
15 # Simon Paillard <[email protected]>, 2006.
16 # Denis Barbier <[email protected]>, 2006, 2010.
17 # David Prévot <[email protected]>, 2010, 2012.
18 # Frédéric Hantrais <[email protected]>, 2013, 2014.
19 # Jean-Pierre Giraud <[email protected]>, 2023.
20 msgid ""
21 msgstr ""
22 "Project-Id-Version: perkamon\n"
23 "POT-Creation-Date: 2026-06-05 06:38+0200\n"
24 "PO-Revision-Date: 2023-07-01 11:08+0200\n"
25 "Last-Translator: Jean-Pierre Giraud <[email protected]>\n"
26 "Language-Team: French <[email protected]>\n"
27 "Language: fr\n"
28 "MIME-Version: 1.0\n"
29 "Content-Type: text/plain; charset=UTF-8\n"
30 "Content-Transfer-Encoding: 8bit\n"
31 "Plural-Forms: nplurals=2; plural=n > 1;\n"
32 "X-Generator: Lokalize 22.12.3\n"
33
34 #. type: TH
35 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
36 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
37 #, no-wrap
38 msgid "pthread_setschedparam"
39 msgstr "pthread_setschedparam"
40
41 #. type: TH
42 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
43 #: opensuse-tumbleweed
44 #, no-wrap
45 msgid "2025-09-21"
46 msgstr "21 septembre 2025"
47
48 #. type: TH
49 #: archlinux debian-unstable
50 #, no-wrap
51 msgid "Linux man-pages 6.18"
52 msgstr "Pages du manuel de Linux 6.18"
53
54 #. type: SH
55 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
56 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
57 #, no-wrap
58 msgid "NAME"
59 msgstr "NOM"
60
61 #. type: Plain text
62 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
63 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
64 msgid ""
65 "pthread_setschedparam, pthread_getschedparam - set/get scheduling policy and "
66 "parameters of a thread"
67 msgstr ""
68 "pthread_setschedparam, pthread_getschedparam — Définir ou obtenir la "
69 "politique et les paramètres d'ordonnancement d'un thread"
70
71 #. type: SH
72 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
73 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
74 #, no-wrap
75 msgid "LIBRARY"
76 msgstr "BIBLIOTHÈQUE"
77
78 #. type: Plain text
79 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
80 #: opensuse-leap-16-1 opensuse-tumbleweed
81 msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)"
82 msgstr "Bibliothèque de threads POSIX (I<libpthread>,\\ I<-lpthread>)"
83
84 #. type: SH
85 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
86 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
87 #, no-wrap
88 msgid "SYNOPSIS"
89 msgstr "SYNOPSIS"
90
91 #. type: Plain text
92 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
93 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
94 #, no-wrap
95 msgid "B<#include E<lt>pthread.hE<gt>>\n"
96 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
97
98 #. type: Plain text
99 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
101 #, no-wrap
102 msgid ""
103 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<policy>B<,>\n"
104 "B< const struct sched_param *>I<param>B<);>\n"
105 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *restrict >I<policy>B<,>\n"
106 "B< struct sched_param *restrict >I<param>B<);>\n"
107 msgstr ""
108 "B<int pthread_setschedparam(pthread_t >I<thread>B<, int >I<politique>B<,>\n"
109 "B< const struct sched_param *>I<param>B<);>\n"
110 "B<int pthread_getschedparam(pthread_t >I<thread>B<, int *restrict >I<politique>B<,>\n"
111 "B< struct sched_param *restrict >I<param>B<);>\n"
112
113 #. type: SH
114 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
115 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
116 #, no-wrap
117 msgid "DESCRIPTION"
118 msgstr "DESCRIPTION"
119
120 #. type: Plain text
121 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
122 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
123 msgid ""
124 "The B<pthread_setschedparam>() function sets the scheduling policy and "
125 "parameters of the thread I<thread>."
126 msgstr ""
127 "La fonction B<pthread_setschedparam>() définit la politique et les "
128 "paramètres d'ordonnancement du thread I<thread>."
129
130 #. FIXME . pthread_setschedparam() places no restriction on the policy,
131 #. but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
132 #. http://sourceware.org/bugzilla/show_bug.cgi?id=7013
133 #. type: Plain text
134 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
135 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
136 msgid ""
137 "I<policy> specifies the new scheduling policy for I<thread>. The supported "
138 "values for I<policy>, and their semantics, are described in B<sched>(7)."
139 msgstr ""
140 "L'argument I<politique> spécifie la politique d'ordonnancement pour "
141 "I<thread>. Les valeurs possibles, ainsi que leur signification, sont "
142 "décrites dans B<sched>(7)."
143
144 #. type: Plain text
145 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
146 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
147 msgid ""
148 "The structure pointed to by I<param> specifies the new scheduling parameters "
149 "for I<thread>. Scheduling parameters are maintained in the following "
150 "structure:"
151 msgstr ""
152 "La structure vers laquelle pointe I<param> spécifie les nouveaux paramètres "
153 "d'ordonnancement pour I<thread>. Les paramètres d'ordonnancement sont gérés "
154 "dans la structure suivante\\ :"
155
156 #. type: Plain text
157 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
158 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
159 #, no-wrap
160 msgid ""
161 "struct sched_param {\n"
162 " int sched_priority; /* Scheduling priority */\n"
163 "};\n"
164 msgstr ""
165 "struct sched_param {\n"
166 " int sched_priority; /* Priorité d'ordonnancement */\n"
167 "};\n"
168
169 #. type: Plain text
170 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
171 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
172 msgid ""
173 "As can be seen, only one scheduling parameter is supported. For details of "
174 "the permitted ranges for scheduling priorities in each scheduling policy, "
175 "see B<sched>(7)."
176 msgstr ""
177 "Comme on peut le voir, un seul paramètre d'ordonnancement est pris en "
178 "charge. Veuillez consulter B<sched>(7) pour plus de détails sur les valeurs "
179 "possibles des priorités d'ordonnancement en fonction de chaque politique "
180 "d'ordonnancement."
181
182 #. #-#-#-#-# archlinux: pthread_setschedparam.3.pot (PACKAGE VERSION) #-#-#-#-#
183 #. FIXME . nptl/pthread_setschedparam.c has the following
184 #. /* If the thread should have higher priority because of some
185 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
186 #. Eventually (perhaps after writing the mutexattr pages), we
187 #. may want to add something on the topic to this page.
188 #. type: Plain text
189 #. #-#-#-#-# debian-trixie: pthread_setschedparam.3.pot (PACKAGE VERSION) #-#-#-#-#
190 #. FIXME . nptl/pthread_setschedparam.c has the following
191 #. /* If the thread should have higher priority because of some
192 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
193 #. Eventually (perhaps after writing the mutexattr pages), we
194 #. may want to add something on the topic to this page.
195 #. type: Plain text
196 #. #-#-#-#-# debian-unstable: pthread_setschedparam.3.pot (PACKAGE VERSION) #-#-#-#-#
197 #. FIXME . nptl/pthread_setschedparam.c has the following
198 #. /* If the thread should have higher priority because of some
199 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
200 #. Eventually (perhaps after writing the mutexattr pages), we
201 #. may want to add something on the topic to this page.
202 #. type: Plain text
203 #. #-#-#-#-# fedora-44: pthread_setschedparam.3.pot (PACKAGE VERSION) #-#-#-#-#
204 #. FIXME . nptl/pthread_setschedparam.c has the following
205 #. /* If the thread should have higher priority because of some
206 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
207 #. Eventually (perhaps after writing the mutexattr pages), we
208 #. may want to add something on the topic to this page.
209 #. type: Plain text
210 #. #-#-#-#-# fedora-rawhide: pthread_setschedparam.3.pot (PACKAGE VERSION) #-#-#-#-#
211 #. FIXME . nptl/pthread_setschedparam.c has the following
212 #. /* If the thread should have higher priority because of some
213 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
214 #. Eventually (perhaps after writing the mutexattr pages), we
215 #. may want to add something on the topic to this page.
216 #. type: Plain text
217 #. #-#-#-#-# mageia-cauldron: pthread_setschedparam.3.pot (PACKAGE VERSION) #-#-#-#-#
218 #. FIXME . nptl/pthread_setschedparam.c has the following
219 #. /* If the thread should have higher priority because of some
220 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
221 #. Eventually (perhaps after writing the mutexattr pages), we
222 #. may want to add something on the topic to this page.
223 #. type: Plain text
224 #. #-#-#-#-# opensuse-leap-16-1: pthread_setschedparam.3.pot (PACKAGE VERSION) #-#-#-#-#
225 #. FIXME . nptl/pthread_setschedparam.c has the following
226 #. /* If the thread should have higher priority because of some
227 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
228 #. Eventually (perhaps after writing the mutexattr pages), we
229 #. may want to add something on the topic to this page.
230 #. type: Plain text
231 #. #-#-#-#-# opensuse-tumbleweed: pthread_setschedparam.3.pot (PACKAGE VERSION) #-#-#-#-#
232 #. FIXME . nptl/pthread_setschedparam.c has the following
233 #. /* If the thread should have higher priority because of some
234 #. PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
235 #. Eventually (perhaps after writing the mutexattr pages), we
236 #. may want to add something on the topic to this page.
237 #. type: Plain text
238 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
239 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
240 msgid ""
241 "The B<pthread_getschedparam>() function returns the scheduling policy and "
242 "parameters of the thread I<thread>, in the buffers pointed to by I<policy> "
243 "and I<param>, respectively. The returned priority value is that set by the "
244 "most recent B<pthread_setschedparam>(), B<pthread_setschedprio>(3), or "
245 "B<pthread_create>(3) call that affected I<thread>. The returned priority "
246 "does not reflect any temporary priority adjustments as a result of calls to "
247 "any priority inheritance or priority ceiling functions (see, for example, "
248 "B<pthread_mutexattr_setprioceiling>(3) and "
249 "B<pthread_mutexattr_setprotocol>(3))."
250 msgstr ""
251 "La fonction B<pthread_getschedparam>() renvoie, dans les tampons pointés par "
252 "I<politique> et I<param>, respectivement la politique et les paramètres "
253 "d'ordonnancement du thread I<thread>. La valeur de priorité renvoyée est "
254 "celle utilisée lors de l'appel le plus récent à B<pthread_setschedparam>(), "
255 "B<pthread_setschedprio>(3) ou B<pthread_create>(3) qui touchait I<thread>. "
256 "La priorité renvoyée ne reflète pas des ajustements de priorité temporaires "
257 "qui peuvent résulter d'appels à une fonction qui modifie l'héritage ou "
258 "plafonne la priorité d'ordonnancement (voir, par exemple, "
259 "B<pthread_mutexattr_setprioceiling>(3) et "
260 "B<pthread_mutexattr_setprotocol>(3))."
261
262 #. type: SH
263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
265 #, no-wrap
266 msgid "RETURN VALUE"
267 msgstr "VALEUR RENVOYÉE"
268
269 #. type: Plain text
270 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
271 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
272 msgid ""
273 "On success, these functions return 0; on error, they return a nonzero error "
274 "number. If B<pthread_setschedparam>() fails, the scheduling policy and "
275 "parameters of I<thread> are not changed."
276 msgstr ""
277 "En cas de réussite, ces fonctions renvoient B<0> ; en cas d'erreur, elles "
278 "renvoient un numéro d'erreur non nul. Si B<pthread_setschedparam>() échoue, "
279 "la politique et les paramètres d'ordonnancement du thread ne sont pas "
280 "modifiés."
281
282 #. type: SH
283 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
284 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
285 #, no-wrap
286 msgid "ERRORS"
287 msgstr "ERREURS"
288
289 #. type: Plain text
290 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
291 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
292 msgid "Both of these functions can fail with the following error:"
293 msgstr "Ces deux fonctions peuvent échouer avec l'erreur suivante :"
294
295 #. type: TP
296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
298 #, no-wrap
299 msgid "B<ESRCH>"
300 msgstr "B<ESRCH>"
301
302 #. type: Plain text
303 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
304 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
305 msgid "No thread with the ID I<thread> could be found."
306 msgstr ""
307 "Aucun fil d’exécution avec pour identifiant I<thread> n'a pu être trouvé."
308
309 #. type: Plain text
310 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
311 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
312 msgid ""
313 "B<pthread_setschedparam>() may additionally fail with the following errors:"
314 msgstr ""
315 "B<pthread_setschedparam>() peut également échouer avec les erreurs "
316 "suivantes\\ :"
317
318 #. type: TP
319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
321 #, no-wrap
322 msgid "B<EINVAL>"
323 msgstr "B<EINVAL>"
324
325 #. type: Plain text
326 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
327 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
328 msgid ""
329 "I<policy> is not a recognized policy, or I<param> does not make sense for "
330 "the I<policy>."
331 msgstr ""
332 "I<politique> n'est pas une politique reconnue, ou I<param> n'a pas de sens "
333 "pour cette valeur de I<politique>."
334
335 #. type: TP
336 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
337 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
338 #, no-wrap
339 msgid "B<EPERM>"
340 msgstr "B<EPERM>"
341
342 #. type: Plain text
343 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
344 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
345 msgid ""
346 "The caller does not have appropriate privileges to set the specified "
347 "scheduling policy and parameters."
348 msgstr ""
349 "L'appelant n'a pas les privilèges suffisants pour définir la politique et "
350 "les paramètres d'ordonnancement indiqués."
351
352 #. type: Plain text
353 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
354 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
355 msgid ""
356 "POSIX.1 also documents an B<ENOTSUP> (\"attempt was made to set the policy "
357 "or scheduling parameters to an unsupported value\") error for "
358 "B<pthread_setschedparam>()."
359 msgstr ""
360 "POSIX.1 documente également une erreur B<ENOTSUP> (tentative de définition "
361 "de la politique ou de paramètres d'ordonnancement à une valeur non prise en "
362 "charge) pour B<pthread_setschedparam>()."
363
364 #. type: SH
365 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
366 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
367 #, no-wrap
368 msgid "ATTRIBUTES"
369 msgstr "ATTRIBUTS"
370
371 #. type: Plain text
372 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
373 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
374 msgid ""
375 "For an explanation of the terms used in this section, see B<attributes>(7)."
376 msgstr ""
377 "Pour une explication des termes utilisés dans cette section, consulter "
378 "B<attributes>(7)."
379
380 #. type: tbl table
381 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
382 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
383 #, no-wrap
384 msgid "Interface"
385 msgstr "Interface"
386
387 #. type: tbl table
388 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
389 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
390 #, no-wrap
391 msgid "Attribute"
392 msgstr "Attribut"
393
394 #. type: tbl table
395 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
396 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
397 #, no-wrap
398 msgid "Value"
399 msgstr "Valeur"
400
401 #. type: tbl table
402 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
403 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
404 #, no-wrap
405 msgid ".na\n"
406 msgstr ".na\n"
407
408 #. type: tbl table
409 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
410 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
411 #, no-wrap
412 msgid ".nh\n"
413 msgstr ".nh\n"
414
415 #. type: tbl table
416 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
417 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
418 #, no-wrap
419 msgid ""
420 "B<pthread_setschedparam>(),\n"
421 "B<pthread_getschedparam>()"
422 msgstr ""
423 "B<pthread_setschedparam>(),\n"
424 "B<pthread_getschedparam>()"
425
426 #. type: tbl table
427 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
428 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
429 #, no-wrap
430 msgid "Thread safety"
431 msgstr "Sécurité des threads"
432
433 #. type: tbl table
434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
436 #, no-wrap
437 msgid "MT-Safe"
438 msgstr "MT-Safe"
439
440 #. type: SH
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 #, no-wrap
444 msgid "STANDARDS"
445 msgstr "NORMES"
446
447 #. type: Plain text
448 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
449 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
450 msgid "POSIX.1-2008."
451 msgstr "POSIX.1-2008."
452
453 #. type: SH
454 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
455 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
456 #, no-wrap
457 msgid "HISTORY"
458 msgstr "HISTORIQUE"
459
460 #. type: Plain text
461 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
462 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
463 msgid "glibc 2.0 POSIX.1-2001."
464 msgstr "glibc 2.0 POSIX.1-2001."
465
466 #. type: SH
467 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
468 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
469 #, no-wrap
470 msgid "NOTES"
471 msgstr "NOTES"
472
473 #. type: Plain text
474 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
475 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
476 msgid ""
477 "For a description of the permissions required to, and the effect of, "
478 "changing a thread's scheduling policy and priority, and details of the "
479 "permitted ranges for priorities in each scheduling policy, see B<sched>(7)."
480 msgstr ""
481 "Pour une description des permissions nécessaires pour modifier la politique "
482 "et la priorité d'ordonnancement d'un thread (et leur effet), et les détails "
483 "sur les valeurs possibles de priorités pour chacune des politiques "
484 "d'ordonnancement, consultez B<sched>(7)."
485
486 #. type: SH
487 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
488 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
489 #, no-wrap
490 msgid "EXAMPLES"
491 msgstr "EXEMPLES"
492
493 #. type: Plain text
494 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
495 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
496 msgid ""
497 "The program below demonstrates the use of B<pthread_setschedparam>() and "
498 "B<pthread_getschedparam>(), as well as the use of a number of other "
499 "scheduling-related pthreads functions."
500 msgstr ""
501 "Le programme ci-dessous montre l'utilisation de B<pthread_setschedparam>() "
502 "et B<pthread_getschedparam>(), ainsi que d'un certain nombre d'autres "
503 "fonctions de pthreads relatives à l'ordonnancement."
504
505 #. type: Plain text
506 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
507 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
508 msgid ""
509 "In the following run, the main thread sets its scheduling policy to "
510 "B<SCHED_FIFO> with a priority of 10, and initializes a thread attributes "
511 "object with a scheduling policy attribute of B<SCHED_RR> and a scheduling "
512 "priority attribute of 20. The program then sets (using "
513 "B<pthread_attr_setinheritsched>(3)) the inherit scheduler attribute of the "
514 "thread attributes object to B<PTHREAD_EXPLICIT_SCHED>, meaning that threads "
515 "created using this attributes object should take their scheduling attributes "
516 "from the thread attributes object. The program then creates a thread using "
517 "the thread attributes object, and that thread displays its scheduling policy "
518 "and priority."
519 msgstr ""
520 "Lors de l'exécution suivante, le thread principal définit sa politique "
521 "d'ordonnancement à B<SCHED_FIFO> avec une priorité de 10 et initialise un "
522 "objet d'attributs de thread avec un attribut de politique d'ordonnancement "
523 "mis à B<SCHED_RR> et un attribut de priorité d'ordonnancement de 20. Le "
524 "programme appelle alors B<pthread_attr_setinheritsched>(3) pour définir à "
525 "B<PTHREAD_EXPLICIT_SCHED> l'attribut d'héritage de l'ordonnancement de "
526 "l'objets d'attributs de thread, ce qui signifie que les threads créés avec "
527 "cet objet d'attributs prendront les attributs d'ordonnancement dans l'objet "
528 "d'attributs de thread. Le programme crée alors un thread en utilisant "
529 "l'objets d'attributs de thread et ce thread affiche sa politique et sa "
530 "priorité d'ordonnancement."
531
532 #. type: Plain text
533 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
534 #: opensuse-tumbleweed
535 #, fuzzy, no-wrap
536 #| msgid ""
537 #| "$ B<su> # Need privilege to set real-time scheduling policies\n"
538 #| "Password:\n"
539 #| "# B<./a.out -mf10 -ar20 -i e>\n"
540 #| "Scheduler settings of main thread\n"
541 #| " policy=SCHED_FIFO, priority=10\n"
542 msgid ""
543 "$B< su>; # Need privilege to set real-time scheduling policies\n"
544 "Password:\n"
545 "#B< ./a.out -mf10 -ar20 -i e>;\n"
546 "Scheduler settings of main thread\n"
547 " policy=SCHED_FIFO, priority=10\n"
548 "\\&\n"
549 "Scheduler settings in \\[aq]attr\\[aq]\n"
550 " policy=SCHED_RR, priority=20\n"
551 " inheritsched is EXPLICIT\n"
552 "\\&\n"
553 "Scheduler attributes of new thread\n"
554 " policy=SCHED_RR, priority=20\n"
555 msgstr ""
556 "$ B<su> # Privilège requis pour définir les politiques\n"
557 " # d'ordonnancement en temps réel\n"
558 "Password:\n"
559 "# B<./a.out -mf10 -ar20 -i e>\n"
560 "Scheduler settings of main thread\n"
561 " policy=SCHED_FIFO, priority=10\n"
562
563 #. type: Plain text
564 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
565 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
566 msgid ""
567 "In the above output, one can see that the scheduling policy and priority "
568 "were taken from the values specified in the thread attributes object."
569 msgstr ""
570 "Nous pouvons voir dans l'affichage ci-dessus que les politique et priorité "
571 "d'ordonnancement ont pris comme valeurs celles de l'objets d'attributs de "
572 "thread."
573
574 #. type: Plain text
575 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
576 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
577 msgid ""
578 "The next run is the same as the previous, except that the inherit scheduler "
579 "attribute is set to B<PTHREAD_INHERIT_SCHED>, meaning that threads created "
580 "using the thread attributes object should ignore the scheduling attributes "
581 "specified in the attributes object and instead take their scheduling "
582 "attributes from the creating thread."
583 msgstr ""
584 "L'exécution suivante est identique, sauf que l'attribut d'héritage "
585 "d'ordonnancement est mis à B<PTHREAD_INHERIT_SCHED>, ce qui signifie que les "
586 "threads créés avec cet objet d'attributs devront ignorer les attributs "
587 "d'ordonnancement de l'objets d'attributs de thread et prendre à la place les "
588 "valeurs héritées du thread appelant."
589
590 #. type: Plain text
591 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
592 #: opensuse-tumbleweed
593 #, fuzzy, no-wrap
594 #| msgid ""
595 #| "$ B<su> # Need privilege to set real-time scheduling policies\n"
596 #| "Password:\n"
597 #| "# B<./a.out -mf10 -ar20 -i e>\n"
598 #| "Scheduler settings of main thread\n"
599 #| " policy=SCHED_FIFO, priority=10\n"
600 msgid ""
601 "#B< ./a.out -mf10 -ar20 -i i>;\n"
602 "Scheduler settings of main thread\n"
603 " policy=SCHED_FIFO, priority=10\n"
604 "\\&\n"
605 "Scheduler settings in \\[aq]attr\\[aq]\n"
606 " policy=SCHED_RR, priority=20\n"
607 " inheritsched is INHERIT\n"
608 "\\&\n"
609 "Scheduler attributes of new thread\n"
610 " policy=SCHED_FIFO, priority=10\n"
611 msgstr ""
612 "$ B<su> # Privilège requis pour définir les politiques\n"
613 " # d'ordonnancement en temps réel\n"
614 "Password:\n"
615 "# B<./a.out -mf10 -ar20 -i e>\n"
616 "Scheduler settings of main thread\n"
617 " policy=SCHED_FIFO, priority=10\n"
618
619 #. type: Plain text
620 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
621 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
622 msgid ""
623 "In the above output, one can see that the scheduling policy and priority "
624 "were taken from the creating thread, rather than the thread attributes "
625 "object."
626 msgstr ""
627 "Nous pouvons voir dans l'affichage ci-dessus que les politique et priorité "
628 "d'ordonnancement ont pris comme valeurs celles du thread appelant et non de "
629 "l'objets d'attributs de thread."
630
631 #. type: Plain text
632 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
633 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
634 #, fuzzy
635 #| msgid ""
636 #| "Note that if we had omitted the I<-i\\~i> option, the output would have "
637 #| "been the same, since B<PTHREAD_INHERIT_SCHED> is the default for the "
638 #| "inherit scheduler attribute."
639 msgid ""
640 "Note that if we had omitted the I<-i\\ i> option, the output would have been "
641 "the same, since B<PTHREAD_INHERIT_SCHED> is the default for the inherit "
642 "scheduler attribute."
643 msgstr ""
644 "Veuillez noter que si l'option I<-i\\~i> n'avait pas été présente, "
645 "l'affichage aurait été identique, car B<PTHREAD_INHERIT_SCHED> est la valeur "
646 "par défaut pour l'attribut d'héritage d'ordonnancement."
647
648 #. type: SS
649 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
650 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
651 #, no-wrap
652 msgid "Program source"
653 msgstr "Source du programme"
654
655 #. type: Plain text
656 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
657 #: opensuse-tumbleweed
658 #, no-wrap
659 msgid ""
660 "/* pthreads_sched_test.c */\n"
661 "\\&\n"
662 "#include E<lt>err.hE<gt>\n"
663 "#include E<lt>errno.hE<gt>\n"
664 "#include E<lt>pthread.hE<gt>\n"
665 "#include E<lt>stdio.hE<gt>\n"
666 "#include E<lt>stdlib.hE<gt>\n"
667 "#include E<lt>unistd.hE<gt>\n"
668 "\\&\n"
669 "[[noreturn]]\n"
670 "static void\n"
671 "usage(char *prog_name, char *msg)\n"
672 "{\n"
673 " if (msg != NULL)\n"
674 " fputs(msg, stderr);\n"
675 "\\&\n"
676 " fprintf(stderr, \"Usage: %s [options]\\[rs]n\", prog_name);\n"
677 " fprintf(stderr, \"Options are:\\[rs]n\");\n"
678 "#define fpe(msg) fprintf(stderr, \"\\[rs]t%s\", msg) /* Shorter */\n"
679 " fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\[rs]n\");\n"
680 " fpe(\" thread attributes object\\[rs]n\");\n"
681 " fpe(\" E<lt>policyE<gt> can be\\[rs]n\");\n"
682 " fpe(\" f SCHED_FIFO\\[rs]n\");\n"
683 " fpe(\" r SCHED_RR\\[rs]n\");\n"
684 " fpe(\" o SCHED_OTHER\\[rs]n\");\n"
685 " fpe(\"-A Use default thread attributes object\\[rs]n\");\n"
686 " fpe(\"-i {e|i} Set inherit scheduler attribute to\\[rs]n\");\n"
687 " fpe(\" \\[aq]explicit\\[aq] or \\[aq]inherit\\[aq]\\[rs]n\");\n"
688 " fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\[rs]n\");\n"
689 " fpe(\" main thread before pthread_create() call\\[rs]n\");\n"
690 " exit(EXIT_FAILURE);\n"
691 "}\n"
692 "\\&\n"
693 "static int\n"
694 "get_policy(char p, int *policy)\n"
695 "{\n"
696 " switch (p) {\n"
697 " case \\[aq]f\\[aq]: *policy = SCHED_FIFO; return 1;\n"
698 " case \\[aq]r\\[aq]: *policy = SCHED_RR; return 1;\n"
699 " case \\[aq]o\\[aq]: *policy = SCHED_OTHER; return 1;\n"
700 " default: return 0;\n"
701 " }\n"
702 "}\n"
703 "\\&\n"
704 "static void\n"
705 "display_sched_attr(int policy, const struct sched_param *param)\n"
706 "{\n"
707 " printf(\" policy=%s, priority=%d\\[rs]n\",\n"
708 " (policy == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
709 " (policy == SCHED_RR) ? \"SCHED_RR\" :\n"
710 " (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
711 " \"???\",\n"
712 " param-E<gt>sched_priority);\n"
713 "}\n"
714 "\\&\n"
715 "static void\n"
716 "display_thread_sched_attr(char *msg)\n"
717 "{\n"
718 " int policy, s;\n"
719 " struct sched_param param;\n"
720 "\\&\n"
721 " s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
722 " if (s != 0)\n"
723 " errc(EXIT_FAILURE, s, \"pthread_getschedparam\");\n"
724 "\\&\n"
725 " printf(\"%s\\[rs]n\", msg);\n"
726 " display_sched_attr(policy, &param);\n"
727 "}\n"
728 "\\&\n"
729 "static void *\n"
730 "thread_start(void *arg)\n"
731 "{\n"
732 " display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
733 "\\&\n"
734 " return NULL;\n"
735 "}\n"
736 "\\&\n"
737 "int\n"
738 "main(int argc, char *argv[])\n"
739 "{\n"
740 " int s, opt, inheritsched, use_null_attrib, policy;\n"
741 " pthread_t thread;\n"
742 " pthread_attr_t attr;\n"
743 " pthread_attr_t *attrp;\n"
744 " char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
745 " struct sched_param param;\n"
746 "\\&\n"
747 " /* Process command-line options. */\n"
748 "\\&\n"
749 " use_null_attrib = 0;\n"
750 " attr_sched_str = NULL;\n"
751 " main_sched_str = NULL;\n"
752 " inheritsched_str = NULL;\n"
753 "\\&\n"
754 " while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
755 " switch (opt) {\n"
756 " case \\[aq]a\\[aq]: attr_sched_str = optarg; break;\n"
757 " case \\[aq]A\\[aq]: use_null_attrib = 1; break;\n"
758 " case \\[aq]i\\[aq]: inheritsched_str = optarg; break;\n"
759 " case \\[aq]m\\[aq]: main_sched_str = optarg; break;\n"
760 " default: usage(argv[0], \"Unrecognized option\\[rs]n\");\n"
761 " }\n"
762 " }\n"
763 "\\&\n"
764 " if (use_null_attrib\n"
765 " && (inheritsched_str != NULL || attr_sched_str != NULL))\n"
766 " {\n"
767 " usage(argv[0], \"Can\\[aq]t specify -A with -i or -a\\[rs]n\");\n"
768 " }\n"
769 "\\&\n"
770 " /* Optionally set scheduling attributes of main thread,\n"
771 " and display the attributes. */\n"
772 "\\&\n"
773 " if (main_sched_str != NULL) {\n"
774 " if (!get_policy(main_sched_str[0], &policy))\n"
775 " usage(argv[0], \"Bad policy for main thread (-m)\\[rs]n\");\n"
776 " param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
777 "\\&\n"
778 " s = pthread_setschedparam(pthread_self(), policy, &param);\n"
779 " if (s != 0)\n"
780 " errc(EXIT_FAILURE, s, \"pthread_setschedparam\");\n"
781 " }\n"
782 "\\&\n"
783 " display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
784 " printf(\"\\[rs]n\");\n"
785 "\\&\n"
786 " /* Initialize thread attributes object according to options. */\n"
787 "\\&\n"
788 " attrp = NULL;\n"
789 "\\&\n"
790 " if (!use_null_attrib) {\n"
791 " s = pthread_attr_init(&attr);\n"
792 " if (s != 0)\n"
793 " errc(EXIT_FAILURE, s, \"pthread_attr_init\");\n"
794 " attrp = &attr;\n"
795 " }\n"
796 "\\&\n"
797 " if (inheritsched_str != NULL) {\n"
798 " if (inheritsched_str[0] == \\[aq]e\\[aq])\n"
799 " inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
800 " else if (inheritsched_str[0] == \\[aq]i\\[aq])\n"
801 " inheritsched = PTHREAD_INHERIT_SCHED;\n"
802 " else\n"
803 " usage(argv[0], \"Value for -i must be \\[aq]e\\[aq] or \\[aq]i\\[aq]\\[rs]n\");\n"
804 "\\&\n"
805 " s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
806 " if (s != 0)\n"
807 " errc(EXIT_FAILURE, s, \"pthread_attr_setinheritsched\");\n"
808 " }\n"
809 "\\&\n"
810 " if (attr_sched_str != NULL) {\n"
811 " if (!get_policy(attr_sched_str[0], &policy))\n"
812 " usage(argv[0], \"Bad policy for \\[aq]attr\\[aq] (-a)\\[rs]n\");\n"
813 " param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
814 "\\&\n"
815 " s = pthread_attr_setschedpolicy(&attr, policy);\n"
816 " if (s != 0)\n"
817 " errc(EXIT_FAILURE, s, \"pthread_attr_setschedpolicy\");\n"
818 " s = pthread_attr_setschedparam(&attr, &param);\n"
819 " if (s != 0)\n"
820 " errc(EXIT_FAILURE, s, \"pthread_attr_setschedparam\");\n"
821 " }\n"
822 "\\&\n"
823 " /* If we initialized a thread attributes object, display\n"
824 " the scheduling attributes that were set in the object. */\n"
825 "\\&\n"
826 " if (attrp != NULL) {\n"
827 " s = pthread_attr_getschedparam(&attr, &param);\n"
828 " if (s != 0)\n"
829 " errc(EXIT_FAILURE, s, \"pthread_attr_getschedparam\");\n"
830 " s = pthread_attr_getschedpolicy(&attr, &policy);\n"
831 " if (s != 0)\n"
832 " errc(EXIT_FAILURE, s, \"pthread_attr_getschedpolicy\");\n"
833 "\\&\n"
834 " printf(\"Scheduler settings in \\[aq]attr\\[aq]\\[rs]n\");\n"
835 " display_sched_attr(policy, &param);\n"
836 "\\&\n"
837 " pthread_attr_getinheritsched(&attr, &inheritsched);\n"
838 " printf(\" inheritsched is %s\\[rs]n\",\n"
839 " (inheritsched == PTHREAD_INHERIT_SCHED) ? \"INHERIT\" :\n"
840 " (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
841 " \"???\");\n"
842 " printf(\"\\[rs]n\");\n"
843 " }\n"
844 "\\&\n"
845 " /* Create a thread that will display its scheduling attributes. */\n"
846 "\\&\n"
847 " s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
848 " if (s != 0)\n"
849 " errc(EXIT_FAILURE, s, \"pthread_create\");\n"
850 "\\&\n"
851 " /* Destroy unneeded thread attributes object. */\n"
852 "\\&\n"
853 " if (!use_null_attrib) {\n"
854 " s = pthread_attr_destroy(&attr);\n"
855 " if (s != 0)\n"
856 " errc(EXIT_FAILURE, s, \"pthread_attr_destroy\");\n"
857 " }\n"
858 "\\&\n"
859 " s = pthread_join(thread, NULL);\n"
860 " if (s != 0)\n"
861 " errc(EXIT_FAILURE, s, \"pthread_join\");\n"
862 "\\&\n"
863 " exit(EXIT_SUCCESS);\n"
864 "}\n"
865 msgstr ""
866
867 #. SRC END
868 #. type: SH
869 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
870 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
871 #, no-wrap
872 msgid "SEE ALSO"
873 msgstr "VOIR AUSSI"
874
875 #. type: Plain text
876 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
877 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
878 msgid ""
879 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
880 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
881 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
882 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
883 msgstr ""
884 "B<getrlimit>(2), B<sched_get_priority_min>(2), B<pthread_attr_init>(3), "
885 "B<pthread_attr_setinheritsched>(3), B<pthread_attr_setschedparam>(3), "
886 "B<pthread_attr_setschedpolicy>(3), B<pthread_create>(3), B<pthread_self>(3), "
887 "B<pthread_setschedprio>(3), B<pthreads>(7), B<sched>(7)"
888
889 #. type: TH
890 #: debian-trixie
891 #, no-wrap
892 msgid "2024-06-15"
893 msgstr "15 juin 2024"
894
895 #. type: TH
896 #: debian-trixie
897 #, no-wrap
898 msgid "Linux man-pages 6.9.1"
899 msgstr "Pages du manuel de Linux 6.9.1"
900
901 #. type: Plain text
902 #: debian-trixie
903 msgid "POSIX threads library (I<libpthread>, I<-lpthread>)"
904 msgstr "Bibliothèque de threads POSIX (I<libpthread>, I<-lpthread>)"
905
906 #. type: Plain text
907 #: debian-trixie fedora-44 fedora-rawhide
908 #, fuzzy, no-wrap
909 #| msgid ""
910 #| "$ B<su> # Need privilege to set real-time scheduling policies\n"
911 #| "Password:\n"
912 #| "# B<./a.out -mf10 -ar20 -i e>\n"
913 #| "Scheduler settings of main thread\n"
914 #| " policy=SCHED_FIFO, priority=10\n"
915 msgid ""
916 "$ B<su> # Need privilege to set real-time scheduling policies\n"
917 "Password:\n"
918 "# B<./a.out -mf10 -ar20 -i e>\n"
919 "Scheduler settings of main thread\n"
920 " policy=SCHED_FIFO, priority=10\n"
921 "\\&\n"
922 "Scheduler settings in \\[aq]attr\\[aq]\n"
923 " policy=SCHED_RR, priority=20\n"
924 " inheritsched is EXPLICIT\n"
925 "\\&\n"
926 "Scheduler attributes of new thread\n"
927 " policy=SCHED_RR, priority=20\n"
928 msgstr ""
929 "$ B<su> # Privilège requis pour définir les politiques\n"
930 " # d'ordonnancement en temps réel\n"
931 "Password:\n"
932 "# B<./a.out -mf10 -ar20 -i e>\n"
933 "Scheduler settings of main thread\n"
934 " policy=SCHED_FIFO, priority=10\n"
935
936 #. type: Plain text
937 #: debian-trixie fedora-44 fedora-rawhide
938 #, no-wrap
939 msgid ""
940 "# B<./a.out -mf10 -ar20 -i i>\n"
941 "Scheduler settings of main thread\n"
942 " policy=SCHED_FIFO, priority=10\n"
943 "\\&\n"
944 "Scheduler settings in \\[aq]attr\\[aq]\n"
945 " policy=SCHED_RR, priority=20\n"
946 " inheritsched is INHERIT\n"
947 "\\&\n"
948 "Scheduler attributes of new thread\n"
949 " policy=SCHED_FIFO, priority=10\n"
950 msgstr ""
951
952 #. type: Plain text
953 #: debian-trixie fedora-44 fedora-rawhide
954 #, no-wrap
955 msgid ""
956 "/* pthreads_sched_test.c */\n"
957 "\\&\n"
958 "#include E<lt>errno.hE<gt>\n"
959 "#include E<lt>pthread.hE<gt>\n"
960 "#include E<lt>stdio.hE<gt>\n"
961 "#include E<lt>stdlib.hE<gt>\n"
962 "#include E<lt>unistd.hE<gt>\n"
963 "\\&\n"
964 "#define handle_error_en(en, msg) \\[rs]\n"
965 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
966 "\\&\n"
967 "[[noreturn]]\n"
968 "static void\n"
969 "usage(char *prog_name, char *msg)\n"
970 "{\n"
971 " if (msg != NULL)\n"
972 " fputs(msg, stderr);\n"
973 "\\&\n"
974 " fprintf(stderr, \"Usage: %s [options]\\[rs]n\", prog_name);\n"
975 " fprintf(stderr, \"Options are:\\[rs]n\");\n"
976 "#define fpe(msg) fprintf(stderr, \"\\[rs]t%s\", msg) /* Shorter */\n"
977 " fpe(\"-aE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority in\\[rs]n\");\n"
978 " fpe(\" thread attributes object\\[rs]n\");\n"
979 " fpe(\" E<lt>policyE<gt> can be\\[rs]n\");\n"
980 " fpe(\" f SCHED_FIFO\\[rs]n\");\n"
981 " fpe(\" r SCHED_RR\\[rs]n\");\n"
982 " fpe(\" o SCHED_OTHER\\[rs]n\");\n"
983 " fpe(\"-A Use default thread attributes object\\[rs]n\");\n"
984 " fpe(\"-i {e|i} Set inherit scheduler attribute to\\[rs]n\");\n"
985 " fpe(\" \\[aq]explicit\\[aq] or \\[aq]inherit\\[aq]\\[rs]n\");\n"
986 " fpe(\"-mE<lt>policyE<gt>E<lt>prioE<gt> Set scheduling policy and priority on\\[rs]n\");\n"
987 " fpe(\" main thread before pthread_create() call\\[rs]n\");\n"
988 " exit(EXIT_FAILURE);\n"
989 "}\n"
990 "\\&\n"
991 "static int\n"
992 "get_policy(char p, int *policy)\n"
993 "{\n"
994 " switch (p) {\n"
995 " case \\[aq]f\\[aq]: *policy = SCHED_FIFO; return 1;\n"
996 " case \\[aq]r\\[aq]: *policy = SCHED_RR; return 1;\n"
997 " case \\[aq]o\\[aq]: *policy = SCHED_OTHER; return 1;\n"
998 " default: return 0;\n"
999 " }\n"
1000 "}\n"
1001 "\\&\n"
1002 "static void\n"
1003 "display_sched_attr(int policy, const struct sched_param *param)\n"
1004 "{\n"
1005 " printf(\" policy=%s, priority=%d\\[rs]n\",\n"
1006 " (policy == SCHED_FIFO) ? \"SCHED_FIFO\" :\n"
1007 " (policy == SCHED_RR) ? \"SCHED_RR\" :\n"
1008 " (policy == SCHED_OTHER) ? \"SCHED_OTHER\" :\n"
1009 " \"???\",\n"
1010 " param-E<gt>sched_priority);\n"
1011 "}\n"
1012 "\\&\n"
1013 "static void\n"
1014 "display_thread_sched_attr(char *msg)\n"
1015 "{\n"
1016 " int policy, s;\n"
1017 " struct sched_param param;\n"
1018 "\\&\n"
1019 " s = pthread_getschedparam(pthread_self(), &policy, &param);\n"
1020 " if (s != 0)\n"
1021 " handle_error_en(s, \"pthread_getschedparam\");\n"
1022 "\\&\n"
1023 " printf(\"%s\\[rs]n\", msg);\n"
1024 " display_sched_attr(policy, &param);\n"
1025 "}\n"
1026 "\\&\n"
1027 "static void *\n"
1028 "thread_start(void *arg)\n"
1029 "{\n"
1030 " display_thread_sched_attr(\"Scheduler attributes of new thread\");\n"
1031 "\\&\n"
1032 " return NULL;\n"
1033 "}\n"
1034 "\\&\n"
1035 "int\n"
1036 "main(int argc, char *argv[])\n"
1037 "{\n"
1038 " int s, opt, inheritsched, use_null_attrib, policy;\n"
1039 " pthread_t thread;\n"
1040 " pthread_attr_t attr;\n"
1041 " pthread_attr_t *attrp;\n"
1042 " char *attr_sched_str, *main_sched_str, *inheritsched_str;\n"
1043 " struct sched_param param;\n"
1044 "\\&\n"
1045 " /* Process command-line options. */\n"
1046 "\\&\n"
1047 " use_null_attrib = 0;\n"
1048 " attr_sched_str = NULL;\n"
1049 " main_sched_str = NULL;\n"
1050 " inheritsched_str = NULL;\n"
1051 "\\&\n"
1052 " while ((opt = getopt(argc, argv, \"a:Ai:m:\")) != -1) {\n"
1053 " switch (opt) {\n"
1054 " case \\[aq]a\\[aq]: attr_sched_str = optarg; break;\n"
1055 " case \\[aq]A\\[aq]: use_null_attrib = 1; break;\n"
1056 " case \\[aq]i\\[aq]: inheritsched_str = optarg; break;\n"
1057 " case \\[aq]m\\[aq]: main_sched_str = optarg; break;\n"
1058 " default: usage(argv[0], \"Unrecognized option\\[rs]n\");\n"
1059 " }\n"
1060 " }\n"
1061 "\\&\n"
1062 " if (use_null_attrib\n"
1063 " && (inheritsched_str != NULL || attr_sched_str != NULL))\n"
1064 " {\n"
1065 " usage(argv[0], \"Can\\[aq]t specify -A with -i or -a\\[rs]n\");\n"
1066 " }\n"
1067 "\\&\n"
1068 " /* Optionally set scheduling attributes of main thread,\n"
1069 " and display the attributes. */\n"
1070 "\\&\n"
1071 " if (main_sched_str != NULL) {\n"
1072 " if (!get_policy(main_sched_str[0], &policy))\n"
1073 " usage(argv[0], \"Bad policy for main thread (-m)\\[rs]n\");\n"
1074 " param.sched_priority = strtol(&main_sched_str[1], NULL, 0);\n"
1075 "\\&\n"
1076 " s = pthread_setschedparam(pthread_self(), policy, &param);\n"
1077 " if (s != 0)\n"
1078 " handle_error_en(s, \"pthread_setschedparam\");\n"
1079 " }\n"
1080 "\\&\n"
1081 " display_thread_sched_attr(\"Scheduler settings of main thread\");\n"
1082 " printf(\"\\[rs]n\");\n"
1083 "\\&\n"
1084 " /* Initialize thread attributes object according to options. */\n"
1085 "\\&\n"
1086 " attrp = NULL;\n"
1087 "\\&\n"
1088 " if (!use_null_attrib) {\n"
1089 " s = pthread_attr_init(&attr);\n"
1090 " if (s != 0)\n"
1091 " handle_error_en(s, \"pthread_attr_init\");\n"
1092 " attrp = &attr;\n"
1093 " }\n"
1094 "\\&\n"
1095 " if (inheritsched_str != NULL) {\n"
1096 " if (inheritsched_str[0] == \\[aq]e\\[aq])\n"
1097 " inheritsched = PTHREAD_EXPLICIT_SCHED;\n"
1098 " else if (inheritsched_str[0] == \\[aq]i\\[aq])\n"
1099 " inheritsched = PTHREAD_INHERIT_SCHED;\n"
1100 " else\n"
1101 " usage(argv[0], \"Value for -i must be \\[aq]e\\[aq] or \\[aq]i\\[aq]\\[rs]n\");\n"
1102 "\\&\n"
1103 " s = pthread_attr_setinheritsched(&attr, inheritsched);\n"
1104 " if (s != 0)\n"
1105 " handle_error_en(s, \"pthread_attr_setinheritsched\");\n"
1106 " }\n"
1107 "\\&\n"
1108 " if (attr_sched_str != NULL) {\n"
1109 " if (!get_policy(attr_sched_str[0], &policy))\n"
1110 " usage(argv[0], \"Bad policy for \\[aq]attr\\[aq] (-a)\\[rs]n\");\n"
1111 " param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);\n"
1112 "\\&\n"
1113 " s = pthread_attr_setschedpolicy(&attr, policy);\n"
1114 " if (s != 0)\n"
1115 " handle_error_en(s, \"pthread_attr_setschedpolicy\");\n"
1116 " s = pthread_attr_setschedparam(&attr, &param);\n"
1117 " if (s != 0)\n"
1118 " handle_error_en(s, \"pthread_attr_setschedparam\");\n"
1119 " }\n"
1120 "\\&\n"
1121 " /* If we initialized a thread attributes object, display\n"
1122 " the scheduling attributes that were set in the object. */\n"
1123 "\\&\n"
1124 " if (attrp != NULL) {\n"
1125 " s = pthread_attr_getschedparam(&attr, &param);\n"
1126 " if (s != 0)\n"
1127 " handle_error_en(s, \"pthread_attr_getschedparam\");\n"
1128 " s = pthread_attr_getschedpolicy(&attr, &policy);\n"
1129 " if (s != 0)\n"
1130 " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n"
1131 "\\&\n"
1132 " printf(\"Scheduler settings in \\[aq]attr\\[aq]\\[rs]n\");\n"
1133 " display_sched_attr(policy, &param);\n"
1134 "\\&\n"
1135 " pthread_attr_getinheritsched(&attr, &inheritsched);\n"
1136 " printf(\" inheritsched is %s\\[rs]n\",\n"
1137 " (inheritsched == PTHREAD_INHERIT_SCHED) ? \"INHERIT\" :\n"
1138 " (inheritsched == PTHREAD_EXPLICIT_SCHED) ? \"EXPLICIT\" :\n"
1139 " \"???\");\n"
1140 " printf(\"\\[rs]n\");\n"
1141 " }\n"
1142 "\\&\n"
1143 " /* Create a thread that will display its scheduling attributes. */\n"
1144 "\\&\n"
1145 " s = pthread_create(&thread, attrp, &thread_start, NULL);\n"
1146 " if (s != 0)\n"
1147 " handle_error_en(s, \"pthread_create\");\n"
1148 "\\&\n"
1149 " /* Destroy unneeded thread attributes object. */\n"
1150 "\\&\n"
1151 " if (!use_null_attrib) {\n"
1152 " s = pthread_attr_destroy(&attr);\n"
1153 " if (s != 0)\n"
1154 " handle_error_en(s, \"pthread_attr_destroy\");\n"
1155 " }\n"
1156 "\\&\n"
1157 " s = pthread_join(thread, NULL);\n"
1158 " if (s != 0)\n"
1159 " handle_error_en(s, \"pthread_join\");\n"
1160 "\\&\n"
1161 " exit(EXIT_SUCCESS);\n"
1162 "}\n"
1163 msgstr ""
1164
1165 #. type: TH
1166 #: fedora-44 fedora-rawhide
1167 #, no-wrap
1168 msgid "2024-07-23"
1169 msgstr "23 juillet 2024"
1170
1171 #. type: TH
1172 #: fedora-44 fedora-rawhide
1173 #, no-wrap
1174 msgid "Linux man-pages 6.13"
1175 msgstr "Pages du manuel de Linux 6.13"
1176
1177 #. type: TH
1178 #: mageia-cauldron
1179 #, no-wrap
1180 msgid "Linux man-pages 6.17"
1181 msgstr "Pages du manuel de Linux 6.17"
1182
1183 #. type: TH
1184 #: opensuse-leap-16-1 opensuse-tumbleweed
1185 #, no-wrap
1186 msgid "Linux man-pages (unreleased)"
1187 msgstr "Pages du manuel de Linux (non publiées)"