Debian Codegraph @

po/fr/man3/sem_wait.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, 2013.
16 # Denis Barbier <[email protected]>, 2006, 2010.
17 # David Prévot <[email protected]>, 2010, 2012-2014.
18 # Thomas Vincent <[email protected]>, 2019.
19 # Jean-Pierre Giraud <[email protected]>, 2023.
20 msgid ""
21 msgstr ""
22 "Project-Id-Version: manpages-l10n 4.22.0\n"
23 "POT-Creation-Date: 2026-06-05 06:42+0200\n"
24 "PO-Revision-Date: 2024-05-07 16:52+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 "sem_wait"
39 msgstr "sem_wait"
40
41 #. type: TH
42 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
43 #: opensuse-tumbleweed
44 #, no-wrap
45 msgid "2026-02-08"
46 msgstr "8 février 2026"
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 "sem_wait, sem_timedwait, sem_trywait - lock a semaphore"
65 msgstr "sem_wait, sem_timedwait, sem_trywait - Verrouiller un sémaphore"
66
67 #. type: SH
68 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
69 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
70 #, no-wrap
71 msgid "LIBRARY"
72 msgstr "BIBLIOTHÈQUE"
73
74 #. type: Plain text
75 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
76 #: opensuse-leap-16-1 opensuse-tumbleweed
77 msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)"
78 msgstr "Bibliothèque de threads POSIX (I<libpthread>,\\ I<-lpthread>)"
79
80 #. type: SH
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid "SYNOPSIS"
85 msgstr "SYNOPSIS"
86
87 #. type: Plain text
88 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
89 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
90 #, no-wrap
91 msgid "B<#include E<lt>semaphore.hE<gt>>\n"
92 msgstr "B<#include E<lt>semaphore.hE<gt>>\n"
93
94 #. type: Plain text
95 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
96 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
97 #, no-wrap
98 msgid ""
99 "B<int sem_wait(sem_t *>I<sem>B<);>\n"
100 "B<int sem_trywait(sem_t *>I<sem>B<);>\n"
101 "B<int sem_timedwait(sem_t *restrict >I<sem>B<,>\n"
102 "B< const struct timespec *restrict >I<abs_timeout>B<);>\n"
103 msgstr ""
104 "B<int sem_wait(sem_t *>I<sem>B<);>\n"
105 "B<int sem_trywait(sem_t *>I<sem>B<);>\n"
106 "B<int sem_timedwait(sem_t *restrict >I<sem>B<,>\n"
107 "B< const struct timespec *restrict >I<abs_timeout>B<);>\n"
108
109 #. type: Plain text
110 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
111 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
112 msgid ""
113 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
114 msgstr ""
115 "Exigences de macros de test de fonctionnalités pour la glibc (consulter "
116 "B<feature_test_macros>(7)) :"
117
118 #. type: Plain text
119 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
120 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
121 msgid "B<sem_timedwait>():"
122 msgstr "B<sem_timedwait>() :"
123
124 #. type: Plain text
125 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
126 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
127 #, no-wrap
128 msgid " _POSIX_C_SOURCE E<gt>= 200112L\n"
129 msgstr " _POSIX_C_SOURCE E<gt>= 200112L\n"
130
131 #. type: SH
132 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
133 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
134 #, no-wrap
135 msgid "DESCRIPTION"
136 msgstr "DESCRIPTION"
137
138 #. type: Plain text
139 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
140 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
141 msgid ""
142 "B<sem_wait>() decrements (locks) the semaphore pointed to by I<sem>. If "
143 "the semaphore's value is greater than zero, then the decrement proceeds, and "
144 "the function returns, immediately. If the semaphore currently has the value "
145 "zero, then the call blocks until either it becomes possible to perform the "
146 "decrement (i.e., the semaphore value rises above zero), or a signal handler "
147 "interrupts the call."
148 msgstr ""
149 "B<sem_wait>() décrémente (verrouille) le sémaphore pointé par I<sem>. Si la "
150 "valeur du sémaphore est plus grande que zéro, la décrémentation s'effectue "
151 "et la fonction renvoie immédiatement. Si le sémaphore vaut zéro, l'appel "
152 "bloquera jusqu'à ce qu’il devienne possible d'effectuer la décrémentation "
153 "(c'est-à-dire la valeur du sémaphore devient positive) ou qu’un gestionnaire "
154 "de signaux interrompe l'appel."
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 msgid ""
160 "B<sem_trywait>() is the same as B<sem_wait>(), except that if the decrement "
161 "cannot be immediately performed, then call returns an error (I<errno> set to "
162 "B<EAGAIN>) instead of blocking."
163 msgstr ""
164 "B<sem_trywait>() est pareil à B<sem_wait>(), excepté que si la "
165 "décrémentation ne peut pas être effectuée immédiatement, l'appel renvoie une "
166 "erreur (I<errno> vaut B<EAGAIN>) plutôt que de bloquer."
167
168 #. type: Plain text
169 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
170 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
171 msgid ""
172 "B<sem_timedwait>() is the same as B<sem_wait>(), except that I<abs_timeout> "
173 "specifies a limit on the amount of time that the call should block if the "
174 "decrement cannot be immediately performed. The I<abs_timeout> argument "
175 "points to a B<timespec>(3) structure that specifies an absolute timeout in "
176 "seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)."
177 msgstr ""
178 "B<sem_timedwait>() est pareil à B<sem_wait>() excepté que I<abs_timeout> "
179 "spécifie une limite sur le temps pendant lequel l'appel bloquera si la "
180 "décrémentation ne peut pas être effectuée immédiatement. L'argument "
181 "I<abs_timeout> pointe sur une structure B<timespec>(3) qui spécifie un temps "
182 "absolu en secondes et nanosecondes depuis l'époque, 1er\\ janvier 1970 à\\ "
183 "00:00:00 (UTC)."
184
185 #. type: Plain text
186 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
187 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
188 msgid ""
189 "If the timeout has already expired by the time of the call, and the "
190 "semaphore could not be locked immediately, then B<sem_timedwait>() fails "
191 "with a timeout error (I<errno> set to B<ETIMEDOUT>)."
192 msgstr ""
193 "Si le délai est déjà expiré à l'heure de l'appel et si le sémaphore ne peut "
194 "pas être verrouillé immédiatement, B<sem_timedwait>() échoue avec l'erreur "
195 "d'expiration de délai (I<errno> vaut B<ETIMEDOUT>)."
196
197 #. type: Plain text
198 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
199 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
200 msgid ""
201 "If the operation can be performed immediately, then B<sem_timedwait>() "
202 "never fails with a timeout error, regardless of the value of "
203 "I<abs_timeout>. Furthermore, the validity of I<abs_timeout> is not checked "
204 "in this case."
205 msgstr ""
206 "Si l'opération peut être effectuée immédiatement, B<sem_timedwait>() "
207 "n'échoue jamais avec une valeur d'expiration de délai, quelque soit la "
208 "valeur de I<abs_timeout>. De plus, la validité de I<abs_timeout> n'est pas "
209 "vérifiée dans ce cas."
210
211 #. type: SH
212 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
213 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
214 #, no-wrap
215 msgid "RETURN VALUE"
216 msgstr "VALEUR RENVOYÉE"
217
218 #. type: Plain text
219 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
220 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
221 msgid ""
222 "All of these functions return 0 on success; on error, the value of the "
223 "semaphore is left unchanged, -1 is returned, and I<errno> is set to indicate "
224 "the error."
225 msgstr ""
226 "Toutes ces fonctions renvoient B<0> si elles réussissent. Si elles échouent, "
227 "la valeur du sémaphore n'est pas modifiée, elles renvoient B<-1> et écrivent "
228 "I<errno> en conséquence."
229
230 #. type: SH
231 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
232 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
233 #, no-wrap
234 msgid "ERRORS"
235 msgstr "ERREURS"
236
237 #. type: TP
238 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
239 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
240 #, no-wrap
241 msgid "B<EAGAIN>"
242 msgstr "B<EAGAIN>"
243
244 #. type: Plain text
245 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
246 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
247 msgid ""
248 "(B<sem_trywait>()) The operation could not be performed without blocking "
249 "(i.e., the semaphore currently has the value zero)."
250 msgstr ""
251 "(B<sem_trywait>()) L'opération ne peut pas être effectuée sans bloquer "
252 "(c'est-à-dire, le sémaphore a une valeur nulle)."
253
254 #. type: TP
255 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
256 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
257 #, no-wrap
258 msgid "B<EINTR>"
259 msgstr "B<EINTR>"
260
261 #. type: Plain text
262 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
263 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
264 msgid "The call was interrupted by a signal handler; see B<signal>(7)."
265 msgstr ""
266 "L'appel a été interrompu par un gestionnaire de signal ; consultez "
267 "B<signal>(7)."
268
269 #. type: TP
270 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
271 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
272 #, no-wrap
273 msgid "B<EINVAL>"
274 msgstr "B<EINVAL>"
275
276 #. type: Plain text
277 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
278 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
279 msgid "I<sem> is not a valid semaphore."
280 msgstr "I<sem> n'est pas un sémaphore valable."
281
282 #. type: Plain text
283 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
284 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
285 msgid ""
286 "(B<sem_timedwait>()) The value of I<abs_timeout.tv_nsecs> is less than 0, "
287 "or greater than or equal to 1000 million."
288 msgstr ""
289 "(B<sem_timedwait>()) La valeur de I<abs_timeout.tv_nsecs> est plus petite "
290 "que B<0> ou supérieure ou égale à 1 milliard."
291
292 #. type: TP
293 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
294 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
295 #, no-wrap
296 msgid "B<ETIMEDOUT>"
297 msgstr "B<ETIMEDOUT>"
298
299 #. POSIX.1-2001 also allows EDEADLK -- "A deadlock condition
300 #. was detected", but this does not occur on Linux(?).
301 #. type: Plain text
302 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
303 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
304 msgid ""
305 "(B<sem_timedwait>()) The call timed out before the semaphore could be "
306 "locked."
307 msgstr ""
308 "(B<sem_timedwait>()) Le délai a expiré avant que le sémaphore ait pu être "
309 "verrouillé."
310
311 #. type: SH
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 #, no-wrap
315 msgid "ATTRIBUTES"
316 msgstr "ATTRIBUTS"
317
318 #. type: Plain text
319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
321 msgid ""
322 "For an explanation of the terms used in this section, see B<attributes>(7)."
323 msgstr ""
324 "Pour une explication des termes utilisés dans cette section, consulter "
325 "B<attributes>(7)."
326
327 #. type: tbl table
328 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
329 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
330 #, no-wrap
331 msgid "Interface"
332 msgstr "Interface"
333
334 #. type: tbl table
335 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
336 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
337 #, no-wrap
338 msgid "Attribute"
339 msgstr "Attribut"
340
341 #. type: tbl table
342 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
343 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
344 #, no-wrap
345 msgid "Value"
346 msgstr "Valeur"
347
348 #. type: tbl table
349 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
350 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
351 #, no-wrap
352 msgid ".na\n"
353 msgstr ".na\n"
354
355 #. type: tbl table
356 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
357 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
358 #, no-wrap
359 msgid ".nh\n"
360 msgstr ".nh\n"
361
362 #. type: tbl table
363 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
364 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
365 #, no-wrap
366 msgid ""
367 "B<sem_wait>(),\n"
368 "B<sem_trywait>(),\n"
369 "B<sem_timedwait>()"
370 msgstr ""
371 "B<sem_wait>(),\n"
372 "B<sem_trywait>(),\n"
373 "B<sem_timedwait>()"
374
375 #. type: tbl table
376 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
377 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
378 #, no-wrap
379 msgid "Thread safety"
380 msgstr "Sécurité des threads"
381
382 #. type: tbl table
383 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
384 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
385 #, no-wrap
386 msgid "MT-Safe"
387 msgstr "MT-Safe"
388
389 #. type: SH
390 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
391 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
392 #, no-wrap
393 msgid "STANDARDS"
394 msgstr "NORMES"
395
396 #. type: Plain text
397 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
398 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
399 msgid "POSIX.1-2008."
400 msgstr "POSIX.1-2008."
401
402 #. type: SH
403 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
404 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
405 #, no-wrap
406 msgid "HISTORY"
407 msgstr "HISTORIQUE"
408
409 #. type: Plain text
410 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
411 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
412 msgid "POSIX.1-2001."
413 msgstr "POSIX.1-2001."
414
415 #. type: SH
416 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
417 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
418 #, no-wrap
419 msgid "EXAMPLES"
420 msgstr "EXEMPLES"
421
422 #. type: Plain text
423 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
424 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
425 msgid ""
426 "The (somewhat trivial) program shown below operates on an unnamed "
427 "semaphore. The program expects two command-line arguments. The first "
428 "argument specifies a seconds value that is used to set an alarm timer to "
429 "generate a B<SIGALRM> signal. This handler performs a B<sem_post>(3) to "
430 "increment the semaphore that is being waited on in I<main()> using "
431 "B<sem_timedwait>(). The second command-line argument specifies the length "
432 "of the timeout, in seconds, for B<sem_timedwait>(). The following shows "
433 "what happens on two different runs of the program:"
434 msgstr ""
435 "Le (quelque peu trivial) programme suivant opère sur un sémaphore non nommé. "
436 "Il attend deux arguments sur la ligne de commande. Le premier argument "
437 "spécifie une valeur en secondes qui est utilisée pour configurer une alarme "
438 "pour générer un signal B<SIGALRM>. Ce gestionnaire effectue un "
439 "B<sem_post>(3) pour incrémenter le sémaphore qui est attendu dans le "
440 "I<main()> en utilisant B<sem_timedwait>(). Le second argument de la ligne de "
441 "commande spécifie la durée, en secondes, du délai d'attente pour "
442 "B<sem_timedwait>(). Ci-dessous, le résultat de deux exécutions différentes "
443 "du programme\\ :"
444
445 #. type: Plain text
446 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
447 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
448 #, no-wrap
449 msgid ""
450 "$B< ./a.out 2 3>\n"
451 "About to call sem_timedwait()\n"
452 "sem_post() from handler\n"
453 "sem_timedwait() succeeded\n"
454 "$B< ./a.out 2 1>\n"
455 "About to call sem_timedwait()\n"
456 "sem_timedwait() timed out\n"
457 msgstr ""
458 "$B< ./a.out 2 3>\n"
459 "main() est sur le point d'appeler sem_timedwait()\n"
460 "sem_post() depuis le gestionnaire\n"
461 "sem_timedwait() a réussi\n"
462 "$B< ./a.out 2 1>\n"
463 "main() est sur le point d'appeler sem_timedwait()\n"
464 "sem_timedwait() a expiré\n"
465
466 #. type: SS
467 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
468 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
469 #, no-wrap
470 msgid "Program source"
471 msgstr "Source du programme"
472
473 #. type: Plain text
474 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
475 #: opensuse-tumbleweed
476 #, fuzzy, no-wrap
477 #| msgid ""
478 #| "#include E<lt>errno.hE<gt>\n"
479 #| "#include E<lt>semaphore.hE<gt>\n"
480 #| "#include E<lt>signal.hE<gt>\n"
481 #| "#include E<lt>stdio.hE<gt>\n"
482 #| "#include E<lt>stdlib.hE<gt>\n"
483 #| "#include E<lt>time.hE<gt>\n"
484 #| "#include E<lt>unistd.hE<gt>\n"
485 #| "\\&\n"
486 #| "#include E<lt>assert.hE<gt>\n"
487 #| "\\&\n"
488 #| "sem_t sem;\n"
489 #| "\\&\n"
490 #| "#define handle_error(msg) \\[rs]\n"
491 #| " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
492 #| "\\&\n"
493 #| "static void\n"
494 #| "handler(int sig)\n"
495 #| "{\n"
496 #| " write(STDOUT_FILENO, \"sem_post() from handler\\[rs]n\", 24);\n"
497 #| " if (sem_post(&sem) == -1) {\n"
498 #| " write(STDERR_FILENO, \"sem_post() failed\\[rs]n\", 18);\n"
499 #| " _exit(EXIT_FAILURE);\n"
500 #| " }\n"
501 #| "}\n"
502 #| "\\&\n"
503 #| "int\n"
504 #| "main(int argc, char *argv[])\n"
505 #| "{\n"
506 #| " struct sigaction sa;\n"
507 #| " struct timespec ts;\n"
508 #| " int s;\n"
509 #| "\\&\n"
510 #| " if (argc != 3) {\n"
511 #| " fprintf(stderr, \"Usage: %s E<lt>alarm-secsE<gt> E<lt>wait-secsE<gt>\\[rs]n\",\n"
512 #| " argv[0]);\n"
513 #| " exit(EXIT_FAILURE);\n"
514 #| " }\n"
515 #| "\\&\n"
516 #| " if (sem_init(&sem, 0, 0) == -1)\n"
517 #| " handle_error(\"sem_init\");\n"
518 #| "\\&\n"
519 #| " /* Establish SIGALRM handler; set alarm timer using argv[1]. */\n"
520 #| "\\&\n"
521 #| " sa.sa_handler = handler;\n"
522 #| " sigemptyset(&sa.sa_mask);\n"
523 #| " sa.sa_flags = 0;\n"
524 #| " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
525 #| " handle_error(\"sigaction\");\n"
526 #| "\\&\n"
527 #| " alarm(atoi(argv[1]));\n"
528 #| "\\&\n"
529 #| " /* Calculate relative interval as current time plus\n"
530 #| " number of seconds given argv[2]. */\n"
531 #| "\\&\n"
532 #| " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
533 #| " handle_error(\"clock_gettime\");\n"
534 #| "\\&\n"
535 #| " ts.tv_sec += atoi(argv[2]);\n"
536 #| "\\&\n"
537 #| " printf(\"%s() about to call sem_timedwait()\\[rs]n\", __func__);\n"
538 #| " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
539 #| " continue; /* Restart if interrupted by handler. */\n"
540 #| "\\&\n"
541 #| " /* Check what happened. */\n"
542 #| "\\&\n"
543 #| " if (s == -1) {\n"
544 #| " if (errno == ETIMEDOUT)\n"
545 #| " printf(\"sem_timedwait() timed out\\[rs]n\");\n"
546 #| " else\n"
547 #| " perror(\"sem_timedwait\");\n"
548 #| " } else\n"
549 #| " printf(\"sem_timedwait() succeeded\\[rs]n\");\n"
550 #| "\\&\n"
551 #| " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
552 #| "}\n"
553 msgid ""
554 "#include E<lt>err.hE<gt>\n"
555 "#include E<lt>errno.hE<gt>\n"
556 "#include E<lt>semaphore.hE<gt>\n"
557 "#include E<lt>signal.hE<gt>\n"
558 "#include E<lt>stdio.hE<gt>\n"
559 "#include E<lt>stdlib.hE<gt>\n"
560 "#include E<lt>time.hE<gt>\n"
561 "#include E<lt>unistd.hE<gt>\n"
562 "\\&\n"
563 "#include E<lt>assert.hE<gt>\n"
564 "\\&\n"
565 "sem_t sem;\n"
566 "\\&\n"
567 "static void\n"
568 "handler(int sig)\n"
569 "{\n"
570 " write(STDOUT_FILENO, \"sem_post() from handler\\[rs]n\", 24);\n"
571 " if (sem_post(&sem) == -1) {\n"
572 " write(STDERR_FILENO, \"sem_post() failed\\[rs]n\", 18);\n"
573 " _exit(EXIT_FAILURE);\n"
574 " }\n"
575 "}\n"
576 "\\&\n"
577 "int\n"
578 "main(int argc, char *argv[])\n"
579 "{\n"
580 " struct sigaction sa;\n"
581 " struct timespec ts;\n"
582 " int s;\n"
583 "\\&\n"
584 " if (argc != 3) {\n"
585 " fprintf(stderr, \"Usage: %s E<lt>alarm-secsE<gt> E<lt>wait-secsE<gt>\\[rs]n\",\n"
586 " argv[0]);\n"
587 " exit(EXIT_FAILURE);\n"
588 " }\n"
589 "\\&\n"
590 " if (sem_init(&sem, 0, 0) == -1)\n"
591 " err(EXIT_FAILURE, \"sem_init\");\n"
592 "\\&\n"
593 " /* Establish SIGALRM handler; set alarm timer using argv[1]. */\n"
594 "\\&\n"
595 " sa.sa_handler = handler;\n"
596 " sigemptyset(&sa.sa_mask);\n"
597 " sa.sa_flags = 0;\n"
598 " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
599 " err(EXIT_FAILURE, \"sigaction\");\n"
600 "\\&\n"
601 " alarm(atoi(argv[1]));\n"
602 "\\&\n"
603 " /* Calculate relative interval as current time plus\n"
604 " number of seconds given argv[2]. */\n"
605 "\\&\n"
606 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
607 " err(EXIT_FAILURE, \"clock_gettime\");\n"
608 "\\&\n"
609 " ts.tv_sec += atoi(argv[2]);\n"
610 "\\&\n"
611 " printf(\"%s() about to call sem_timedwait()\\[rs]n\", __func__);\n"
612 " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
613 " continue; /* Restart if interrupted by handler. */\n"
614 "\\&\n"
615 " /* Check what happened. */\n"
616 "\\&\n"
617 " if (s == -1) {\n"
618 " if (errno == ETIMEDOUT)\n"
619 " printf(\"sem_timedwait() timed out\\[rs]n\");\n"
620 " else\n"
621 " perror(\"sem_timedwait\");\n"
622 " } else\n"
623 " printf(\"sem_timedwait() succeeded\\[rs]n\");\n"
624 "\\&\n"
625 " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
626 "}\n"
627 msgstr ""
628 "#include E<lt>errno.hE<gt>\n"
629 "#include E<lt>semaphore.hE<gt>\n"
630 "#include E<lt>signal.hE<gt>\n"
631 "#include E<lt>stdio.hE<gt>\n"
632 "#include E<lt>stdlib.hE<gt>\n"
633 "#include E<lt>time.hE<gt>\n"
634 "#include E<lt>unistd.hE<gt>\n"
635 "\\&\n"
636 "#include E<lt>assert.hE<gt>\n"
637 "\\&\n"
638 "sem_t sem;\n"
639 "\\&\n"
640 "#define handle_error(msg) \\[rs]\n"
641 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
642 "\\&\n"
643 "static void\n"
644 "handler(int sig)\n"
645 "{\n"
646 " write(STDOUT_FILENO, \"sem_post() depuis le gestionnaire\\[rs]n\", 24);\n"
647 " if (sem_post(&sem) == -1) {\n"
648 " write(STDERR_FILENO, \"sem_post() a échoué\\[rs]n\", 18);\n"
649 " _exit(EXIT_FAILURE);\n"
650 " }\n"
651 "}\n"
652 "\\&\n"
653 "int\n"
654 "main(int argc, char *argv[])\n"
655 "{\n"
656 " struct sigaction sa;\n"
657 " struct timespec ts;\n"
658 " int s;\n"
659 "\\&\n"
660 " if (argc != 3) {\n"
661 " fprintf(stderr, \"Utilisation : %s E<lt>alarme-secsE<gt> E<lt>attente-secsE<gt>\\[rs]n\",\n"
662 " argv[0]);\n"
663 " exit(EXIT_FAILURE);\n"
664 " }\n"
665 "\\&\n"
666 " if (sem_init(&sem, 0, 0) == -1)\n"
667 " handle_error(\"sem_init\");\n"
668 "\\&\n"
669 " /* Établit le gestionnaire de signal pour SIGALARM ;\n"
670 " fixe le chronomètre de l'alarme selon argv[1]. */\n"
671 "\\&\n"
672 " sa.sa_handler = handler;\n"
673 " sigemptyset(&sa.sa_mask);\n"
674 " sa.sa_flags = 0;\n"
675 " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
676 " handle_error(\"sigaction\");\n"
677 "\\&\n"
678 " alarm(atoi(argv[1]));\n"
679 "\\&\n"
680 " /* Calcule l'intervalle relatif comme l'heure actuelle plus\n"
681 " un certain nombre de secondes données dans argv[2]. */\n"
682 "\\&\n"
683 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
684 " handle_error(\"clock_gettime\");\n"
685 "\\&\n"
686 " ts.tv_sec += atoi(argv[2]);\n"
687 "\\&\n"
688 " printf(\"%s() est sur le point d'appeler sem_timedwait()\\[rs]n\");\n"
689 " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
690 " continue; /* Redémarre si interrompu par le gestionnaire. */\n"
691 "\\&\n"
692 " /* Observe ce qui s'est passé. */\n"
693 "\\&\n"
694 " if (s == -1) {\n"
695 " if (errno == ETIMEDOUT)\n"
696 " printf(\"sem_timedwait() a expiré\\[rs]n\");\n"
697 " else\n"
698 " perror(\"sem_timedwait\");\n"
699 " } else\n"
700 " printf(\"sem_timedwait() a réussi\\[rs]n\");\n"
701 "\\&\n"
702 " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
703 "}\n"
704
705 #. SRC END
706 #. type: SH
707 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
708 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
709 #, no-wrap
710 msgid "SEE ALSO"
711 msgstr "VOIR AUSSI"
712
713 #. type: Plain text
714 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
715 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
716 msgid ""
717 "B<clock_gettime>(2), B<sem_getvalue>(3), B<sem_post>(3), B<timespec>(3), "
718 "B<sem_overview>(7), B<time>(7)"
719 msgstr ""
720 "B<clock_gettime>(2), B<sem_getvalue>(3), B<sem_post>(3), B<timespec>(3), "
721 "B<sem_overview>(7), B<time>(7)"
722
723 #. type: TH
724 #: debian-trixie
725 #, no-wrap
726 msgid "2024-06-15"
727 msgstr "15 juin 2024"
728
729 #. type: TH
730 #: debian-trixie
731 #, no-wrap
732 msgid "Linux man-pages 6.9.1"
733 msgstr "Pages du manuel de Linux 6.9.1"
734
735 #. type: Plain text
736 #: debian-trixie
737 msgid "POSIX threads library (I<libpthread>, I<-lpthread>)"
738 msgstr "Bibliothèque de threads POSIX (I<libpthread>, I<-lpthread>)"
739
740 #. type: Plain text
741 #: debian-trixie fedora-44 fedora-rawhide
742 #, no-wrap
743 msgid ""
744 "#include E<lt>errno.hE<gt>\n"
745 "#include E<lt>semaphore.hE<gt>\n"
746 "#include E<lt>signal.hE<gt>\n"
747 "#include E<lt>stdio.hE<gt>\n"
748 "#include E<lt>stdlib.hE<gt>\n"
749 "#include E<lt>time.hE<gt>\n"
750 "#include E<lt>unistd.hE<gt>\n"
751 "\\&\n"
752 "#include E<lt>assert.hE<gt>\n"
753 "\\&\n"
754 "sem_t sem;\n"
755 "\\&\n"
756 "#define handle_error(msg) \\[rs]\n"
757 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
758 "\\&\n"
759 "static void\n"
760 "handler(int sig)\n"
761 "{\n"
762 " write(STDOUT_FILENO, \"sem_post() from handler\\[rs]n\", 24);\n"
763 " if (sem_post(&sem) == -1) {\n"
764 " write(STDERR_FILENO, \"sem_post() failed\\[rs]n\", 18);\n"
765 " _exit(EXIT_FAILURE);\n"
766 " }\n"
767 "}\n"
768 "\\&\n"
769 "int\n"
770 "main(int argc, char *argv[])\n"
771 "{\n"
772 " struct sigaction sa;\n"
773 " struct timespec ts;\n"
774 " int s;\n"
775 "\\&\n"
776 " if (argc != 3) {\n"
777 " fprintf(stderr, \"Usage: %s E<lt>alarm-secsE<gt> E<lt>wait-secsE<gt>\\[rs]n\",\n"
778 " argv[0]);\n"
779 " exit(EXIT_FAILURE);\n"
780 " }\n"
781 "\\&\n"
782 " if (sem_init(&sem, 0, 0) == -1)\n"
783 " handle_error(\"sem_init\");\n"
784 "\\&\n"
785 " /* Establish SIGALRM handler; set alarm timer using argv[1]. */\n"
786 "\\&\n"
787 " sa.sa_handler = handler;\n"
788 " sigemptyset(&sa.sa_mask);\n"
789 " sa.sa_flags = 0;\n"
790 " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
791 " handle_error(\"sigaction\");\n"
792 "\\&\n"
793 " alarm(atoi(argv[1]));\n"
794 "\\&\n"
795 " /* Calculate relative interval as current time plus\n"
796 " number of seconds given argv[2]. */\n"
797 "\\&\n"
798 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
799 " handle_error(\"clock_gettime\");\n"
800 "\\&\n"
801 " ts.tv_sec += atoi(argv[2]);\n"
802 "\\&\n"
803 " printf(\"%s() about to call sem_timedwait()\\[rs]n\", __func__);\n"
804 " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
805 " continue; /* Restart if interrupted by handler. */\n"
806 "\\&\n"
807 " /* Check what happened. */\n"
808 "\\&\n"
809 " if (s == -1) {\n"
810 " if (errno == ETIMEDOUT)\n"
811 " printf(\"sem_timedwait() timed out\\[rs]n\");\n"
812 " else\n"
813 " perror(\"sem_timedwait\");\n"
814 " } else\n"
815 " printf(\"sem_timedwait() succeeded\\[rs]n\");\n"
816 "\\&\n"
817 " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
818 "}\n"
819 msgstr ""
820 "#include E<lt>errno.hE<gt>\n"
821 "#include E<lt>semaphore.hE<gt>\n"
822 "#include E<lt>signal.hE<gt>\n"
823 "#include E<lt>stdio.hE<gt>\n"
824 "#include E<lt>stdlib.hE<gt>\n"
825 "#include E<lt>time.hE<gt>\n"
826 "#include E<lt>unistd.hE<gt>\n"
827 "\\&\n"
828 "#include E<lt>assert.hE<gt>\n"
829 "\\&\n"
830 "sem_t sem;\n"
831 "\\&\n"
832 "#define handle_error(msg) \\[rs]\n"
833 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
834 "\\&\n"
835 "static void\n"
836 "handler(int sig)\n"
837 "{\n"
838 " write(STDOUT_FILENO, \"sem_post() depuis le gestionnaire\\[rs]n\", 24);\n"
839 " if (sem_post(&sem) == -1) {\n"
840 " write(STDERR_FILENO, \"sem_post() a échoué\\[rs]n\", 18);\n"
841 " _exit(EXIT_FAILURE);\n"
842 " }\n"
843 "}\n"
844 "\\&\n"
845 "int\n"
846 "main(int argc, char *argv[])\n"
847 "{\n"
848 " struct sigaction sa;\n"
849 " struct timespec ts;\n"
850 " int s;\n"
851 "\\&\n"
852 " if (argc != 3) {\n"
853 " fprintf(stderr, \"Utilisation : %s E<lt>alarme-secsE<gt> E<lt>attente-secsE<gt>\\[rs]n\",\n"
854 " argv[0]);\n"
855 " exit(EXIT_FAILURE);\n"
856 " }\n"
857 "\\&\n"
858 " if (sem_init(&sem, 0, 0) == -1)\n"
859 " handle_error(\"sem_init\");\n"
860 "\\&\n"
861 " /* Établit le gestionnaire de signal pour SIGALARM ;\n"
862 " fixe le chronomètre de l'alarme selon argv[1]. */\n"
863 "\\&\n"
864 " sa.sa_handler = handler;\n"
865 " sigemptyset(&sa.sa_mask);\n"
866 " sa.sa_flags = 0;\n"
867 " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
868 " handle_error(\"sigaction\");\n"
869 "\\&\n"
870 " alarm(atoi(argv[1]));\n"
871 "\\&\n"
872 " /* Calcule l'intervalle relatif comme l'heure actuelle plus\n"
873 " un certain nombre de secondes données dans argv[2]. */\n"
874 "\\&\n"
875 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
876 " handle_error(\"clock_gettime\");\n"
877 "\\&\n"
878 " ts.tv_sec += atoi(argv[2]);\n"
879 "\\&\n"
880 " printf(\"%s() est sur le point d'appeler sem_timedwait()\\[rs]n\");\n"
881 " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
882 " continue; /* Redémarre si interrompu par le gestionnaire. */\n"
883 "\\&\n"
884 " /* Observe ce qui s'est passé. */\n"
885 "\\&\n"
886 " if (s == -1) {\n"
887 " if (errno == ETIMEDOUT)\n"
888 " printf(\"sem_timedwait() a expiré\\[rs]n\");\n"
889 " else\n"
890 " perror(\"sem_timedwait\");\n"
891 " } else\n"
892 " printf(\"sem_timedwait() a réussi\\[rs]n\");\n"
893 "\\&\n"
894 " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
895 "}\n"
896
897 #. type: TH
898 #: fedora-44 fedora-rawhide
899 #, no-wrap
900 msgid "2024-07-23"
901 msgstr "23 juillet 2024"
902
903 #. type: TH
904 #: fedora-44 fedora-rawhide
905 #, no-wrap
906 msgid "Linux man-pages 6.13"
907 msgstr "Pages du manuel de Linux 6.13"
908
909 #. type: TH
910 #: mageia-cauldron
911 #, no-wrap
912 msgid "Linux man-pages 6.17"
913 msgstr "Pages du manuel de Linux 6.17"
914
915 #. type: TH
916 #: opensuse-leap-16-1 opensuse-tumbleweed
917 #, no-wrap
918 msgid "Linux man-pages (unreleased)"
919 msgstr "Pages du manuel de Linux (non publiées)"