Debian Codegraph @

po/fr/man7/aio.7.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, 2013.
18 # Thomas Vincent <[email protected]>, 2018.
19 # Jean-Pierre Giraud <[email protected]>, 2021-2024.
20 msgid ""
21 msgstr ""
22 "Project-Id-Version: manpages-l10n\n"
23 "POT-Creation-Date: 2026-06-05 06:17+0200\n"
24 "PO-Revision-Date: 2024-02-18 00:36+0100\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.1\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 "AIO"
39 msgstr "AIO"
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 "aio - POSIX asynchronous I/O overview"
65 msgstr "aio - Vue d'ensemble des entrées-sorties (E/S) asynchrones POSIX"
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 "DESCRIPTION"
72 msgstr "DESCRIPTION"
73
74 #. type: Plain text
75 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
76 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
77 msgid ""
78 "The POSIX asynchronous I/O (AIO) interface allows applications to initiate "
79 "one or more I/O operations that are performed asynchronously (i.e., in the "
80 "background). The application can elect to be notified of completion of the "
81 "I/O operation in a variety of ways: by delivery of a signal, by "
82 "instantiation of a thread, or no notification at all."
83 msgstr ""
84 "L'interface d'E/S asynchrones (AIO pour « asynchronous I/O ») POSIX permet "
85 "aux applications de déclencher une ou plusieurs opérations d'E/S réalisées "
86 "de façon asynchrone (c'est-à-dire en arrière-plan). La fin d'une opération "
87 "d'E/S peut être notifiée à l'application de différentes façons au choix : "
88 "distribution d'un signal, instanciation d'un thread ou absence de "
89 "notification."
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 msgid "The POSIX AIO interface consists of the following functions:"
95 msgstr "L'interface AIO POSIX est composée des fonctions suivantes :"
96
97 #. type: TP
98 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
99 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
100 #, no-wrap
101 msgid "B<aio_read>(3)"
102 msgstr "B<aio_read>(3)"
103
104 #. type: Plain text
105 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
106 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
107 msgid "Enqueue a read request. This is the asynchronous analog of B<read>(2)."
108 msgstr ""
109 "Placer en file d'attente une requête de lecture. C'est l'équivalent "
110 "asynchrone de B<read>(2)."
111
112 #. type: TP
113 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
114 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
115 #, no-wrap
116 msgid "B<aio_write>(3)"
117 msgstr "B<aio_write>(3)"
118
119 #. type: Plain text
120 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
121 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
122 msgid ""
123 "Enqueue a write request. This is the asynchronous analog of B<write>(2)."
124 msgstr ""
125 "Placer en file d'attente une requête d'écriture. C'est l'équivalent "
126 "asynchrone de B<write>(2)."
127
128 #. type: TP
129 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
130 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
131 #, no-wrap
132 msgid "B<aio_fsync>(3)"
133 msgstr "B<aio_fsync>(3)"
134
135 #. type: Plain text
136 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
137 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
138 msgid ""
139 "Enqueue a sync request for the I/O operations on a file descriptor. This is "
140 "the asynchronous analog of B<fsync>(2) and B<fdatasync>(2)."
141 msgstr ""
142 "Placer en file d'attente une requête de synchronisation pour des opérations "
143 "d'E/S sur un descripteur de fichier. C'est l'équivalent asynchrone de "
144 "B<fsync>(2) et B<fdatasync>(2)."
145
146 #. type: TP
147 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
148 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
149 #, no-wrap
150 msgid "B<aio_error>(3)"
151 msgstr "B<aio_error>(3)"
152
153 #. type: Plain text
154 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
155 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
156 msgid "Obtain the error status of an enqueued I/O request."
157 msgstr "Obtenir l'état d'erreur d'une requête d'E/S placée en file d'attente."
158
159 #. type: TP
160 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
161 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
162 #, no-wrap
163 msgid "B<aio_return>(3)"
164 msgstr "B<aio_return>(3)"
165
166 #. type: Plain text
167 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
168 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
169 msgid "Obtain the return status of a completed I/O request."
170 msgstr "Obtenir l'état de retour d'une requête d'E/S terminée."
171
172 #. type: TP
173 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
174 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
175 #, no-wrap
176 msgid "B<aio_suspend>(3)"
177 msgstr "B<aio_suspend>(3)"
178
179 #. type: Plain text
180 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
181 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
182 msgid ""
183 "Suspend the caller until one or more of a specified set of I/O requests "
184 "completes."
185 msgstr ""
186 "Suspendre l'appelant jusqu'à la fin d'une ou plusieurs requêtes d'E/S d'un "
187 "ensemble indiqué."
188
189 #. type: TP
190 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
191 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
192 #, no-wrap
193 msgid "B<aio_cancel>(3)"
194 msgstr "B<aio_cancel>(3)"
195
196 #. type: Plain text
197 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
198 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
199 msgid ""
200 "Attempt to cancel outstanding I/O requests on a specified file descriptor."
201 msgstr ""
202 "Essayer d'annuler des requêtes d'E/S en cours sur un descripteur de fichier "
203 "indiqué."
204
205 #. type: TP
206 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
207 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
208 #, no-wrap
209 msgid "B<lio_listio>(3)"
210 msgstr "B<lio_listio>(3)"
211
212 #. type: Plain text
213 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
214 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
215 msgid "Enqueue multiple I/O requests using a single function call."
216 msgstr ""
217 "Placer en file d'attente plusieurs requêtes d'E/S à partir d'un seul appel "
218 "de fonction."
219
220 #. type: Plain text
221 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
222 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
223 msgid ""
224 "The I<aiocb> (\"asynchronous I/O control block\") structure defines "
225 "parameters that control an I/O operation. An argument of this type is "
226 "employed with all of the functions listed above. This structure has the "
227 "following form:"
228 msgstr ""
229 "La structure I<aiocb> (« asynchronous I/O control block », ou bloc de "
230 "contrôle d'E/S asynchrones) définit les paramètres de contrôle d'une "
231 "opération d'E/S. Un argument de ce type est utilisé avec toutes les "
232 "fonctions précédentes. Cette structure est de la forme suivante :"
233
234 #. type: Plain text
235 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
236 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
237 #, no-wrap
238 msgid ""
239 "#include E<lt>aiocb.hE<gt>\n"
240 "\\&\n"
241 "struct aiocb {\n"
242 " /* The order of these fields is implementation-dependent */\n"
243 "\\&\n"
244 " int aio_fildes; /* File descriptor */\n"
245 " off_t aio_offset; /* File offset */\n"
246 " volatile void *aio_buf; /* Location of buffer */\n"
247 " size_t aio_nbytes; /* Length of transfer */\n"
248 " int aio_reqprio; /* Request priority */\n"
249 " struct sigevent aio_sigevent; /* Notification method */\n"
250 " int aio_lio_opcode; /* Operation to be performed;\n"
251 " lio_listio() only */\n"
252 "\\&\n"
253 " /* Various implementation-internal fields not shown */\n"
254 "};\n"
255 "\\&\n"
256 "/* Operation codes for \\[aq]aio_lio_opcode\\[aq]: */\n"
257 "\\&\n"
258 "enum { LIO_READ, LIO_WRITE, LIO_NOP };\n"
259 msgstr ""
260 "#include E<lt>aiocb.hE<gt>\n"
261 "\\&\n"
262 "struct aiocb {\n"
263 " /* L'ordre de ces champs dépend de l'implémentation */\n"
264 "\\&\n"
265 " int aio_fildes; /* Descripteur de fichier */\n"
266 " off_t aio_offset; /* Position dans le fichier */\n"
267 " volatile void *aio_buf; /* Emplacement du tampon */\n"
268 " size_t aio_nbytes; /* Longueur de transfert */\n"
269 " int aio_reqprio; /* Priorité de requête */\n"
270 " struct sigevent aio_sigevent; /* Méthode de notification */\n"
271 " int aio_lio_opcode; /* Opération à réaliser ;\n"
272 " lio_listio() seulement */\n"
273 "\\&\n"
274 " /* Divers champs internes à l'implémentation ne sont pas montrés */\n"
275 "};\n"
276 "\\&\n"
277 "/* Codes opératoires pour « aio_lio_opcode » : */\n"
278 "\\&\n"
279 "enum { LIO_READ, LIO_WRITE, LIO_NOP };\n"
280
281 #. type: Plain text
282 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
283 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
284 msgid "The fields of this structure are as follows:"
285 msgstr "Les membres de cette structure sont les suivants :"
286
287 #. type: TP
288 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
289 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
290 #, no-wrap
291 msgid "I<aio_fildes>"
292 msgstr "I<aio_fildes>"
293
294 #. type: Plain text
295 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
296 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
297 msgid "The file descriptor on which the I/O operation is to be performed."
298 msgstr ""
299 "Le descripteur du fichier sur lequel les opérations d'E/S sont à réaliser."
300
301 #. type: TP
302 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
303 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
304 #, no-wrap
305 msgid "I<aio_offset>"
306 msgstr "I<aio_offset>"
307
308 #. type: Plain text
309 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
310 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
311 msgid "This is the file offset at which the I/O operation is to be performed."
312 msgstr "La position dans le fichier où les opérations d'E/S sont à réaliser."
313
314 #. type: TP
315 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
316 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
317 #, no-wrap
318 msgid "I<aio_buf>"
319 msgstr "I<aio_buf>"
320
321 #. type: Plain text
322 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
323 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
324 msgid "This is the buffer used to transfer data for a read or write operation."
325 msgstr ""
326 "Le tampon utilisé pour le transfert de données des opérations de lecture ou "
327 "d'écriture."
328
329 #. type: TP
330 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
331 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
332 #, no-wrap
333 msgid "I<aio_nbytes>"
334 msgstr "I<aio_nbytes>"
335
336 #. type: Plain text
337 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
338 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
339 msgid "This is the size of the buffer pointed to by I<aio_buf>."
340 msgstr "La taille du tampon pointé par I<aio_buf>."
341
342 #. type: TP
343 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
344 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
345 #, no-wrap
346 msgid "I<aio_reqprio>"
347 msgstr "I<aio_reqprio>"
348
349 #. type: Plain text
350 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
351 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
352 msgid ""
353 "This field specifies a value that is subtracted from the calling thread's "
354 "real-time priority in order to determine the priority for execution of this "
355 "I/O request (see B<pthread_setschedparam>(3)). The specified value must be "
356 "between 0 and the value returned by I<sysconf(_SC_AIO_PRIO_DELTA_MAX)>. "
357 "This field is ignored for file synchronization operations."
358 msgstr ""
359 "Valeur à soustraire de la priorité temps-réel du thread de l'appelant pour "
360 "déterminer la priorité d'exécution de cette requête d'E/S (consultez "
361 "B<pthread_setschedparam>(3)). La valeur indiquée doit être entre 0 et la "
362 "valeur renvoyée par I<sysconf(_SC_AIO_PRIO_DELTA_MAX)>. Ce champ est ignoré "
363 "lors des opérations de synchronisation de fichier."
364
365 #. type: TP
366 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
367 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
368 #, no-wrap
369 msgid "I<aio_sigevent>"
370 msgstr "I<aio_sigevent>"
371
372 #. type: Plain text
373 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
374 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
375 msgid ""
376 "This field is a structure that specifies how the caller is to be notified "
377 "when the asynchronous I/O operation completes. Possible values for "
378 "I<aio_sigevent.sigev_notify> are B<SIGEV_NONE>, B<SIGEV_SIGNAL>, and "
379 "B<SIGEV_THREAD>. See B<sigevent>(3type) for further details."
380 msgstr ""
381 "Structure indiquant comment l'appelant sera notifié de la fin d'une "
382 "opération d'E/S asynchrone. Les valeurs de I<aio_sigevent.sigev_notify> "
383 "peuvent être B<SIGEV_NONE>, B<SIGEV_SIGNAL> et B<SIGEV_THREAD>. Consultez "
384 "B<sigevent>(3type) pour plus de précisions."
385
386 #. type: TP
387 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
388 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
389 #, no-wrap
390 msgid "I<aio_lio_opcode>"
391 msgstr "I<aio_lio_opcode>"
392
393 #. type: Plain text
394 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
395 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
396 msgid "The type of operation to be performed; used only for B<lio_listio>(3)."
397 msgstr ""
398 "Le type d'opération à réaliser, utilisé seulement pour B<lio_listio>(3)."
399
400 #. type: Plain text
401 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
402 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
403 msgid ""
404 "In addition to the standard functions listed above, the GNU C library "
405 "provides the following extension to the POSIX AIO API:"
406 msgstr ""
407 "En plus des fonctions standard précédentes, la bibliothèque C du projet GNU "
408 "fournit l'extension suivante à l'API AIO POSIX :"
409
410 #. type: TP
411 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
412 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
413 #, no-wrap
414 msgid "B<aio_init>(3)"
415 msgstr "B<aio_init>(3)"
416
417 #. type: Plain text
418 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
419 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
420 msgid ""
421 "Set parameters for tuning the behavior of the glibc POSIX AIO implementation."
422 msgstr ""
423 "Configurer les paramètres pour régler le comportement de l'implémentation "
424 "AIO POSIX de la glibc."
425
426 #. type: SH
427 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
428 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
429 #, no-wrap
430 msgid "ERRORS"
431 msgstr "ERREURS"
432
433 #. type: TP
434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
436 #, no-wrap
437 msgid "B<EINVAL>"
438 msgstr "B<EINVAL>"
439
440 #. type: Plain text
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 msgid ""
444 "The I<aio_reqprio> field of the I<aiocb> structure was less than 0, or was "
445 "greater than the limit returned by the call "
446 "I<sysconf(_SC_AIO_PRIO_DELTA_MAX)>."
447 msgstr ""
448 "Le champ I<aio_reqprio> de la structure I<aiocb> était inférieur à 0 ou "
449 "supérieur à la limite renvoyée par l'appel "
450 "I<sysconf(_SC_AIO_PRIO_DELTA_MAX)>."
451
452 #. type: SH
453 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
454 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
455 #, no-wrap
456 msgid "STANDARDS"
457 msgstr "NORMES"
458
459 #. type: Plain text
460 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
461 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
462 msgid "POSIX.1-2008."
463 msgstr "POSIX.1-2008."
464
465 #. type: SH
466 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
467 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
468 #, no-wrap
469 msgid "HISTORY"
470 msgstr "HISTORIQUE"
471
472 #. type: Plain text
473 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
474 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
475 msgid "POSIX.1-2001. glibc 2.1."
476 msgstr "POSIX.1-2001. glibc 2.1."
477
478 #. type: SH
479 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
480 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
481 #, no-wrap
482 msgid "NOTES"
483 msgstr "NOTES"
484
485 #. type: Plain text
486 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
487 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
488 msgid ""
489 "It is a good idea to zero out the control block buffer before use (see "
490 "B<memset>(3)). The control block buffer and the buffer pointed to by "
491 "I<aio_buf> must not be changed while the I/O operation is in progress. "
492 "These buffers must remain valid until the I/O operation completes."
493 msgstr ""
494 "Il est conseillé de mettre à zéro le tampon de bloc de contrôle avant "
495 "utilisation (consultez B<memset>(3)). Le tampon de bloc de contrôle et le "
496 "tampon pointé par I<aio_buf> ne doivent pas être modifiés pendant "
497 "l'exécution d'une opération d'E/S. Ces tampons doivent rester valables "
498 "jusqu'à la fin de l'opération d'E/S."
499
500 #. type: Plain text
501 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
502 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
503 msgid ""
504 "Simultaneous asynchronous read or write operations using the same I<aiocb> "
505 "structure yield undefined results."
506 msgstr ""
507 "Les opérations de lecture ou d'écriture asynchrones simultanées qui "
508 "utilisent la même structure I<aiocb> produisent des résultats indéfinis."
509
510 #. http://lse.sourceforge.net/io/aio.html
511 #. http://lse.sourceforge.net/io/aionotes.txt
512 #. http://lwn.net/Articles/148755/
513 #. type: Plain text
514 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
515 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
516 msgid ""
517 "The current Linux POSIX AIO implementation is provided in user space by "
518 "glibc. This has a number of limitations, most notably that maintaining "
519 "multiple threads to perform I/O operations is expensive and scales poorly. "
520 "Work has been in progress for some time on a kernel state-machine-based "
521 "implementation of asynchronous I/O (see B<io_submit>(2), B<io_setup>(2), "
522 "B<io_cancel>(2), B<io_destroy>(2), B<io_getevents>(2)), but this "
523 "implementation hasn't yet matured to the point where the POSIX AIO "
524 "implementation can be completely reimplemented using the kernel system calls."
525 msgstr ""
526 "L'actuelle implémentation AIO POSIX de Linux est fournie en espace "
527 "utilisateur par la glibc. De nombreuses limites existent, en particulier le "
528 "maintien de plusieurs threads pour réaliser des opérations d'E/S est très "
529 "coûteux et monte mal en charge. L'implémentation d'E/S asynchrones basée sur "
530 "l'état de la machine est en travaux depuis un moment sur le noyau (consultez "
531 "B<io_submit>(2), B<io_setup>(2), B<io_cancel>(2), B<io_destroy>(2), "
532 "B<io_getevents>(2)), mais cette implémentation n'a pas encore atteint le "
533 "niveau où l'implémentation AIO POSIX peut être entièrement réimplémentée en "
534 "utilisant les appels système du noyau."
535
536 #. type: SH
537 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
538 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
539 #, no-wrap
540 msgid "EXAMPLES"
541 msgstr "EXEMPLES"
542
543 #. type: Plain text
544 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
545 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
546 msgid ""
547 "The program below opens each of the files named in its command-line "
548 "arguments and queues a request on the resulting file descriptor using "
549 "B<aio_read>(3). The program then loops, periodically monitoring each of the "
550 "I/O operations that is still in progress using B<aio_error>(3). Each of the "
551 "I/O requests is set up to provide notification by delivery of a signal. "
552 "After all I/O requests have completed, the program retrieves their status "
553 "using B<aio_return>(3)."
554 msgstr ""
555 "Le programme suivant ouvre chaque fichier nommé en argument de sa ligne de "
556 "commande et place une requête sur le descripteur de fichier dans la file "
557 "avec B<aio_read>(3). Le programme boucle ensuite, en surveillant "
558 "périodiquement toutes les opérations d'E/S en cours avec B<aio_error>(3). "
559 "Chaque requête d'E/S est configurée pour fournir une notification en "
560 "distribuant un signal. Quand toutes les requêtes d'E/S sont terminées, le "
561 "programme récupère leur état avec B<aio_return>(3)."
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 "The B<SIGQUIT> signal (generated by typing control-\\[rs]) causes the "
568 "program to request cancelation of each of the outstanding requests using "
569 "B<aio_cancel>(3)."
570 msgstr ""
571 "Le signal B<SIGQUIT> (créé en tapant Contrôle-\\[rs]) provoque la demande "
572 "d'annulation de chaque requête en cours avec B<aio_cancel>(3)."
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 "Here is an example of what we might see when running this program. In this "
579 "example, the program queues two requests to standard input, and these are "
580 "satisfied by two lines of input containing \"abc\" and \"x\"."
581 msgstr ""
582 "Voici un exemple de ce qui pourrait être affiché lors de l'exécution de ce "
583 "programme. Dans cet exemple, le programme place en file d'attente deux "
584 "requêtes sur l'entrée standard et deux lignes de saisie contenant « abc » et "
585 "« x » y répondent."
586
587 #. type: Plain text
588 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
589 #: opensuse-tumbleweed
590 #, no-wrap
591 msgid ""
592 "$B< ./a.out /dev/stdin /dev/stdin>;\n"
593 "opened /dev/stdin on descriptor 3\n"
594 "opened /dev/stdin on descriptor 4\n"
595 "aio_error():\n"
596 " for request 0 (descriptor 3): In progress\n"
597 " for request 1 (descriptor 4): In progress\n"
598 "B<abc>\n"
599 "I/O completion signal received\n"
600 "aio_error():\n"
601 " for request 0 (descriptor 3): I/O succeeded\n"
602 " for request 1 (descriptor 4): In progress\n"
603 "aio_error():\n"
604 " for request 1 (descriptor 4): In progress\n"
605 "B<x>\n"
606 "I/O completion signal received\n"
607 "aio_error():\n"
608 " for request 1 (descriptor 4): I/O succeeded\n"
609 "All I/O requests completed\n"
610 "aio_return():\n"
611 " for request 0 (descriptor 3): 4\n"
612 " for request 1 (descriptor 4): 2\n"
613 msgstr ""
614 "$B< ./a.out /dev/stdin /dev/stdin>;\n"
615 "/dev/stdin ouvert sur le descripteur 3\n"
616 "/dev/stdin ouvert sur le descripteur 4\n"
617 "aio_error():\n"
618 " pour la requête 0 (descripteur 3) : En cours\n"
619 " pour la requête 1 (descripteur 4) : En cours\n"
620 "B<abc>\n"
621 "Signal de fin d'E/S reçu\n"
622 "aio_error():\n"
623 " pour la requête 0 (descripteur 3) : E/S réussie\n"
624 " pour la requête 1 (descripteur 4) : En cours\n"
625 "aio_error():\n"
626 " pour la requête 1 (descripteur 4) : En cours\n"
627 "B<x>\n"
628 "Signal de fin d'E/S reçu\n"
629 "aio_error():\n"
630 " pour la requête 1 (descripteur 4) : E/S réussie\n"
631 "Toutes les requêtes d'E/S sont terminées\n"
632 "aio_return():\n"
633 " pour la requête 0 (descripteur 3) : 4\n"
634 " pour la requête 1 (descripteur 4) : 2\n"
635
636 #. type: SS
637 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
638 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
639 #, no-wrap
640 msgid "Program source"
641 msgstr "Source du programme"
642
643 #. type: Plain text
644 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
645 #: opensuse-tumbleweed
646 #, fuzzy, no-wrap
647 #| msgid ""
648 #| "#include E<lt>fcntl.hE<gt>\n"
649 #| "#include E<lt>stdlib.hE<gt>\n"
650 #| "#include E<lt>unistd.hE<gt>\n"
651 #| "#include E<lt>stdio.hE<gt>\n"
652 #| "#include E<lt>errno.hE<gt>\n"
653 #| "#include E<lt>aio.hE<gt>\n"
654 #| "#include E<lt>signal.hE<gt>\n"
655 #| "\\&\n"
656 #| "#define BUF_SIZE 20 /* Size of buffers for read operations */\n"
657 #| "\\&\n"
658 #| "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
659 #| "\\&\n"
660 #| "struct ioRequest { /* Application-defined structure for tracking\n"
661 #| " I/O requests */\n"
662 #| " int reqNum;\n"
663 #| " int status;\n"
664 #| " struct aiocb *aiocbp;\n"
665 #| "};\n"
666 #| "\\&\n"
667 #| "static volatile sig_atomic_t gotSIGQUIT = 0;\n"
668 #| " /* On delivery of SIGQUIT, we attempt to\n"
669 #| " cancel all outstanding I/O requests */\n"
670 #| "\\&\n"
671 #| "static void /* Handler for SIGQUIT */\n"
672 #| "quitHandler(int sig)\n"
673 #| "{\n"
674 #| " gotSIGQUIT = 1;\n"
675 #| "}\n"
676 #| "\\&\n"
677 #| "#define IO_SIGNAL SIGUSR1 /* Signal used to notify I/O completion */\n"
678 #| "\\&\n"
679 #| "static void /* Handler for I/O completion signal */\n"
680 #| "aioSigHandler(int sig, siginfo_t *si, void *ucontext)\n"
681 #| "{\n"
682 #| " if (si-E<gt>si_code == SI_ASYNCIO) {\n"
683 #| " write(STDOUT_FILENO, \"I/O completion signal received\\[rs]n\", 31);\n"
684 #| "\\&\n"
685 #| " /* The corresponding ioRequest structure would be available as\n"
686 #| " struct ioRequest *ioReq = si-E<gt>si_value.sival_ptr;\n"
687 #| " and the file descriptor would then be available via\n"
688 #| " ioReq-E<gt>aiocbp-E<gt>aio_fildes */\n"
689 #| " }\n"
690 #| "}\n"
691 #| "\\&\n"
692 #| "int\n"
693 #| "main(int argc, char *argv[])\n"
694 #| "{\n"
695 #| " struct sigaction sa;\n"
696 #| " int s;\n"
697 #| " int numReqs; /* Total number of queued I/O requests */\n"
698 #| " int openReqs; /* Number of I/O requests still in progress */\n"
699 #| "\\&\n"
700 #| " if (argc E<lt> 2) {\n"
701 #| " fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt> E<lt>pathnameE<gt>...\\[rs]n\",\n"
702 #| " argv[0]);\n"
703 #| " exit(EXIT_FAILURE);\n"
704 #| " }\n"
705 #| "\\&\n"
706 #| " numReqs = argc - 1;\n"
707 #| "\\&\n"
708 #| " /* Allocate our arrays. */\n"
709 #| "\\&\n"
710 #| " struct ioRequest *ioList = calloc(numReqs, sizeof(*ioList));\n"
711 #| " if (ioList == NULL)\n"
712 #| " errExit(\"calloc\");\n"
713 #| "\\&\n"
714 #| " struct aiocb *aiocbList = calloc(numReqs, sizeof(*aiocbList));\n"
715 #| " if (aiocbList == NULL)\n"
716 #| " errExit(\"calloc\");\n"
717 #| "\\&\n"
718 #| " /* Establish handlers for SIGQUIT and the I/O completion signal. */\n"
719 #| "\\&\n"
720 #| " sa.sa_flags = SA_RESTART;\n"
721 #| " sigemptyset(&sa.sa_mask);\n"
722 #| "\\&\n"
723 #| " sa.sa_handler = quitHandler;\n"
724 #| " if (sigaction(SIGQUIT, &sa, NULL) == -1)\n"
725 #| " errExit(\"sigaction\");\n"
726 #| "\\&\n"
727 #| " sa.sa_flags = SA_RESTART | SA_SIGINFO;\n"
728 #| " sa.sa_sigaction = aioSigHandler;\n"
729 #| " if (sigaction(IO_SIGNAL, &sa, NULL) == -1)\n"
730 #| " errExit(\"sigaction\");\n"
731 #| "\\&\n"
732 #| " /* Open each file specified on the command line, and queue\n"
733 #| " a read request on the resulting file descriptor. */\n"
734 #| "\\&\n"
735 #| " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
736 #| " ioList[j].reqNum = j;\n"
737 #| " ioList[j].status = EINPROGRESS;\n"
738 #| " ioList[j].aiocbp = &aiocbList[j];\n"
739 #| "\\&\n"
740 #| " ioList[j].aiocbp-E<gt>aio_fildes = open(argv[j + 1], O_RDONLY);\n"
741 #| " if (ioList[j].aiocbp-E<gt>aio_fildes == -1)\n"
742 #| " errExit(\"open\");\n"
743 #| " printf(\"opened %s on descriptor %d\\[rs]n\", argv[j + 1],\n"
744 #| " ioList[j].aiocbp-E<gt>aio_fildes);\n"
745 #| "\\&\n"
746 #| " ioList[j].aiocbp-E<gt>aio_buf = malloc(BUF_SIZE);\n"
747 #| " if (ioList[j].aiocbp-E<gt>aio_buf == NULL)\n"
748 #| " errExit(\"malloc\");\n"
749 #| "\\&\n"
750 #| " ioList[j].aiocbp-E<gt>aio_nbytes = BUF_SIZE;\n"
751 #| " ioList[j].aiocbp-E<gt>aio_reqprio = 0;\n"
752 #| " ioList[j].aiocbp-E<gt>aio_offset = 0;\n"
753 #| " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_notify = SIGEV_SIGNAL;\n"
754 #| " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_signo = IO_SIGNAL;\n"
755 #| " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_value.sival_ptr =\n"
756 #| " &ioList[j];\n"
757 #| "\\&\n"
758 #| " s = aio_read(ioList[j].aiocbp);\n"
759 #| " if (s == -1)\n"
760 #| " errExit(\"aio_read\");\n"
761 #| " }\n"
762 #| "\\&\n"
763 #| " openReqs = numReqs;\n"
764 #| "\\&\n"
765 #| " /* Loop, monitoring status of I/O requests. */\n"
766 #| "\\&\n"
767 #| " while (openReqs E<gt> 0) {\n"
768 #| " sleep(3); /* Delay between each monitoring step */\n"
769 #| "\\&\n"
770 #| " if (gotSIGQUIT) {\n"
771 #| "\\&\n"
772 #| " /* On receipt of SIGQUIT, attempt to cancel each of the\n"
773 #| " outstanding I/O requests, and display status returned\n"
774 #| " from the cancelation requests. */\n"
775 #| "\\&\n"
776 #| " printf(\"got SIGQUIT; canceling I/O requests: \\[rs]n\");\n"
777 #| "\\&\n"
778 #| " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
779 #| " if (ioList[j].status == EINPROGRESS) {\n"
780 #| " printf(\" Request %zu on descriptor %d:\", j,\n"
781 #| " ioList[j].aiocbp-E<gt>aio_fildes);\n"
782 #| " s = aio_cancel(ioList[j].aiocbp-E<gt>aio_fildes,\n"
783 #| " ioList[j].aiocbp);\n"
784 #| " if (s == AIO_CANCELED)\n"
785 #| " printf(\"I/O canceled\\[rs]n\");\n"
786 #| " else if (s == AIO_NOTCANCELED)\n"
787 #| " printf(\"I/O not canceled\\[rs]n\");\n"
788 #| " else if (s == AIO_ALLDONE)\n"
789 #| " printf(\"I/O all done\\[rs]n\");\n"
790 #| " else\n"
791 #| " perror(\"aio_cancel\");\n"
792 #| " }\n"
793 #| " }\n"
794 #| "\\&\n"
795 #| " gotSIGQUIT = 0;\n"
796 #| " }\n"
797 #| "\\&\n"
798 #| " /* Check the status of each I/O request that is still\n"
799 #| " in progress. */\n"
800 #| "\\&\n"
801 #| " printf(\"aio_error():\\[rs]n\");\n"
802 #| " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
803 #| " if (ioList[j].status == EINPROGRESS) {\n"
804 #| " printf(\" for request %zu (descriptor %d): \",\n"
805 #| " j, ioList[j].aiocbp-E<gt>aio_fildes);\n"
806 #| " ioList[j].status = aio_error(ioList[j].aiocbp);\n"
807 #| "\\&\n"
808 #| " switch (ioList[j].status) {\n"
809 #| " case 0:\n"
810 #| " printf(\"I/O succeeded\\[rs]n\");\n"
811 #| " break;\n"
812 #| " case EINPROGRESS:\n"
813 #| " printf(\"In progress\\[rs]n\");\n"
814 #| " break;\n"
815 #| " case ECANCELED:\n"
816 #| " printf(\"Canceled\\[rs]n\");\n"
817 #| " break;\n"
818 #| " default:\n"
819 #| " perror(\"aio_error\");\n"
820 #| " break;\n"
821 #| " }\n"
822 #| "\\&\n"
823 #| " if (ioList[j].status != EINPROGRESS)\n"
824 #| " openReqs--;\n"
825 #| " }\n"
826 #| " }\n"
827 #| " }\n"
828 #| "\\&\n"
829 #| " printf(\"All I/O requests completed\\[rs]n\");\n"
830 #| "\\&\n"
831 #| " /* Check status return of all I/O requests. */\n"
832 #| "\\&\n"
833 #| " printf(\"aio_return():\\[rs]n\");\n"
834 #| " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
835 #| " ssize_t s;\n"
836 #| "\\&\n"
837 #| " s = aio_return(ioList[j].aiocbp);\n"
838 #| " printf(\" for request %zu (descriptor %d): %zd\\[rs]n\",\n"
839 #| " j, ioList[j].aiocbp-E<gt>aio_fildes, s);\n"
840 #| " }\n"
841 #| "\\&\n"
842 #| " exit(EXIT_SUCCESS);\n"
843 #| "}\n"
844 msgid ""
845 "#include E<lt>err.hE<gt>\n"
846 "#include E<lt>fcntl.hE<gt>\n"
847 "#include E<lt>stdlib.hE<gt>\n"
848 "#include E<lt>unistd.hE<gt>\n"
849 "#include E<lt>stdio.hE<gt>\n"
850 "#include E<lt>errno.hE<gt>\n"
851 "#include E<lt>aio.hE<gt>\n"
852 "#include E<lt>signal.hE<gt>\n"
853 "\\&\n"
854 "#define BUF_SIZE 20 /* Size of buffers for read operations */\n"
855 "\\&\n"
856 "struct ioRequest { /* Application-defined structure for tracking\n"
857 " I/O requests */\n"
858 " int reqNum;\n"
859 " int status;\n"
860 " struct aiocb *aiocbp;\n"
861 "};\n"
862 "\\&\n"
863 "static volatile sig_atomic_t gotSIGQUIT = 0;\n"
864 " /* On delivery of SIGQUIT, we attempt to\n"
865 " cancel all outstanding I/O requests */\n"
866 "\\&\n"
867 "static void /* Handler for SIGQUIT */\n"
868 "quitHandler(int sig)\n"
869 "{\n"
870 " gotSIGQUIT = 1;\n"
871 "}\n"
872 "\\&\n"
873 "#define IO_SIGNAL SIGUSR1 /* Signal used to notify I/O completion */\n"
874 "\\&\n"
875 "static void /* Handler for I/O completion signal */\n"
876 "aioSigHandler(int sig, siginfo_t *si, void *ucontext)\n"
877 "{\n"
878 " if (si-E<gt>si_code == SI_ASYNCIO) {\n"
879 " write(STDOUT_FILENO, \"I/O completion signal received\\[rs]n\", 31);\n"
880 "\\&\n"
881 " /* The corresponding ioRequest structure would be available as\n"
882 " struct ioRequest *ioReq = si-E<gt>si_value.sival_ptr;\n"
883 " and the file descriptor would then be available via\n"
884 " ioReq-E<gt>aiocbp-E<gt>aio_fildes */\n"
885 " }\n"
886 "}\n"
887 "\\&\n"
888 "int\n"
889 "main(int argc, char *argv[])\n"
890 "{\n"
891 " struct sigaction sa;\n"
892 " int s;\n"
893 " int numReqs; /* Total number of queued I/O requests */\n"
894 " int openReqs; /* Number of I/O requests still in progress */\n"
895 "\\&\n"
896 " if (argc E<lt> 2) {\n"
897 " fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt> E<lt>pathnameE<gt>...\\[rs]n\",\n"
898 " argv[0]);\n"
899 " exit(EXIT_FAILURE);\n"
900 " }\n"
901 "\\&\n"
902 " numReqs = argc - 1;\n"
903 "\\&\n"
904 " /* Allocate our arrays. */\n"
905 "\\&\n"
906 " struct ioRequest *ioList = calloc(numReqs, sizeof(*ioList));\n"
907 " if (ioList == NULL)\n"
908 " err(EXIT_FAILURE, \"calloc\");\n"
909 "\\&\n"
910 " struct aiocb *aiocbList = calloc(numReqs, sizeof(*aiocbList));\n"
911 " if (aiocbList == NULL)\n"
912 " err(EXIT_FAILURE, \"calloc\");\n"
913 "\\&\n"
914 " /* Establish handlers for SIGQUIT and the I/O completion signal. */\n"
915 "\\&\n"
916 " sa.sa_flags = SA_RESTART;\n"
917 " sigemptyset(&sa.sa_mask);\n"
918 "\\&\n"
919 " sa.sa_handler = quitHandler;\n"
920 " if (sigaction(SIGQUIT, &sa, NULL) == -1)\n"
921 " err(EXIT_FAILURE, \"sigaction\");\n"
922 "\\&\n"
923 " sa.sa_flags = SA_RESTART | SA_SIGINFO;\n"
924 " sa.sa_sigaction = aioSigHandler;\n"
925 " if (sigaction(IO_SIGNAL, &sa, NULL) == -1)\n"
926 " err(EXIT_FAILURE, \"sigaction\");\n"
927 "\\&\n"
928 " /* Open each file specified on the command line, and queue\n"
929 " a read request on the resulting file descriptor. */\n"
930 "\\&\n"
931 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
932 " ioList[j].reqNum = j;\n"
933 " ioList[j].status = EINPROGRESS;\n"
934 " ioList[j].aiocbp = &aiocbList[j];\n"
935 "\\&\n"
936 " ioList[j].aiocbp-E<gt>aio_fildes = open(argv[j + 1], O_RDONLY);\n"
937 " if (ioList[j].aiocbp-E<gt>aio_fildes == -1)\n"
938 " err(EXIT_FAILURE, \"open\");\n"
939 " printf(\"opened %s on descriptor %d\\[rs]n\", argv[j + 1],\n"
940 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
941 "\\&\n"
942 " ioList[j].aiocbp-E<gt>aio_buf = malloc(BUF_SIZE);\n"
943 " if (ioList[j].aiocbp-E<gt>aio_buf == NULL)\n"
944 " err(EXIT_FAILURE, \"malloc\");\n"
945 "\\&\n"
946 " ioList[j].aiocbp-E<gt>aio_nbytes = BUF_SIZE;\n"
947 " ioList[j].aiocbp-E<gt>aio_reqprio = 0;\n"
948 " ioList[j].aiocbp-E<gt>aio_offset = 0;\n"
949 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_notify = SIGEV_SIGNAL;\n"
950 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_signo = IO_SIGNAL;\n"
951 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_value.sival_ptr =\n"
952 " &ioList[j];\n"
953 "\\&\n"
954 " s = aio_read(ioList[j].aiocbp);\n"
955 " if (s == -1)\n"
956 " err(EXIT_FAILURE, \"aio_read\");\n"
957 " }\n"
958 "\\&\n"
959 " openReqs = numReqs;\n"
960 "\\&\n"
961 " /* Loop, monitoring status of I/O requests. */\n"
962 "\\&\n"
963 " while (openReqs E<gt> 0) {\n"
964 " sleep(3); /* Delay between each monitoring step */\n"
965 "\\&\n"
966 " if (gotSIGQUIT) {\n"
967 "\\&\n"
968 " /* On receipt of SIGQUIT, attempt to cancel each of the\n"
969 " outstanding I/O requests, and display status returned\n"
970 " from the cancelation requests. */\n"
971 "\\&\n"
972 " printf(\"got SIGQUIT; canceling I/O requests: \\[rs]n\");\n"
973 "\\&\n"
974 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
975 " if (ioList[j].status == EINPROGRESS) {\n"
976 " printf(\" Request %zu on descriptor %d:\", j,\n"
977 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
978 " s = aio_cancel(ioList[j].aiocbp-E<gt>aio_fildes,\n"
979 " ioList[j].aiocbp);\n"
980 " if (s == AIO_CANCELED)\n"
981 " printf(\"I/O canceled\\[rs]n\");\n"
982 " else if (s == AIO_NOTCANCELED)\n"
983 " printf(\"I/O not canceled\\[rs]n\");\n"
984 " else if (s == AIO_ALLDONE)\n"
985 " printf(\"I/O all done\\[rs]n\");\n"
986 " else\n"
987 " perror(\"aio_cancel\");\n"
988 " }\n"
989 " }\n"
990 "\\&\n"
991 " gotSIGQUIT = 0;\n"
992 " }\n"
993 "\\&\n"
994 " /* Check the status of each I/O request that is still\n"
995 " in progress. */\n"
996 "\\&\n"
997 " printf(\"aio_error():\\[rs]n\");\n"
998 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
999 " if (ioList[j].status == EINPROGRESS) {\n"
1000 " printf(\" for request %zu (descriptor %d): \",\n"
1001 " j, ioList[j].aiocbp-E<gt>aio_fildes);\n"
1002 " ioList[j].status = aio_error(ioList[j].aiocbp);\n"
1003 "\\&\n"
1004 " switch (ioList[j].status) {\n"
1005 " case 0:\n"
1006 " printf(\"I/O succeeded\\[rs]n\");\n"
1007 " break;\n"
1008 " case EINPROGRESS:\n"
1009 " printf(\"In progress\\[rs]n\");\n"
1010 " break;\n"
1011 " case ECANCELED:\n"
1012 " printf(\"Canceled\\[rs]n\");\n"
1013 " break;\n"
1014 " default:\n"
1015 " perror(\"aio_error\");\n"
1016 " break;\n"
1017 " }\n"
1018 "\\&\n"
1019 " if (ioList[j].status != EINPROGRESS)\n"
1020 " openReqs--;\n"
1021 " }\n"
1022 " }\n"
1023 " }\n"
1024 "\\&\n"
1025 " printf(\"All I/O requests completed\\[rs]n\");\n"
1026 "\\&\n"
1027 " /* Check status return of all I/O requests. */\n"
1028 "\\&\n"
1029 " printf(\"aio_return():\\[rs]n\");\n"
1030 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1031 " ssize_t s;\n"
1032 "\\&\n"
1033 " s = aio_return(ioList[j].aiocbp);\n"
1034 " printf(\" for request %zu (descriptor %d): %zd\\[rs]n\",\n"
1035 " j, ioList[j].aiocbp-E<gt>aio_fildes, s);\n"
1036 " }\n"
1037 "\\&\n"
1038 " exit(EXIT_SUCCESS);\n"
1039 "}\n"
1040 msgstr ""
1041 "#include E<lt>fcntl.hE<gt>\n"
1042 "#include E<lt>stdlib.hE<gt>\n"
1043 "#include E<lt>unistd.hE<gt>\n"
1044 "#include E<lt>stdio.hE<gt>\n"
1045 "#include E<lt>errno.hE<gt>\n"
1046 "#include E<lt>aio.hE<gt>\n"
1047 "#include E<lt>signal.hE<gt>\n"
1048 "\\&\n"
1049 "#define BUF_SIZE 20 /* Taille des tampons pour les opérations de lecture */\n"
1050 "\\&\n"
1051 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1052 "\\&\n"
1053 "struct ioRequest { /* Structure spécifique à l'application\n"
1054 " pour suivre les requêtes d'E/S */\n"
1055 " int reqNum;\n"
1056 " int status;\n"
1057 " struct aiocb *aiocbp;\n"
1058 "};\n"
1059 "\\&\n"
1060 "static volatile sig_atomic_t gotSIGQUIT = 0;\n"
1061 " /* Essayer d'annuler toutes les requêtes d'E/S\n"
1062 " en cours lors de la réception d'un SIGQUIT */\n"
1063 "\\&\n"
1064 "static void /* Gestionnaire pour SIGQUIT */\n"
1065 "quitHandler(int sig)\n"
1066 "{\n"
1067 " gotSIGQUIT = 1;\n"
1068 "}\n"
1069 "\\&\n"
1070 "#define IO_SIGNAL SIGUSR1 /* Signal pour notifier la fin d'E/S */\n"
1071 "\\&\n"
1072 "static void /* Gestionnaire pour le signal de fin d'E/S */\n"
1073 "aioSigHandler(int sig, siginfo_t *si, void *ucontext)\n"
1074 "{\n"
1075 " if (si-E<gt>si_code == SI_ASYNCIO) {\n"
1076 " write(STDOUT_FILENO, \"Gestionnaire pour le signal de fin d'E/S\\[rs]n\", 31);\n"
1077 "\\&\n"
1078 " /* La structure ioRequest correspondante serait disponible en\n"
1079 "\t struct ioRequest *ioReq = si-E<gt>si_value.sival_ptr;\n"
1080 "\t et le descripteur de fichier serait alors disponible via\n"
1081 " ioReq-E<gt>aiocbp-E<gt>aio_fildes */\n"
1082 " }\n"
1083 "}\n"
1084 "\\&\n"
1085 "int\n"
1086 "main(int argc, char *argv[])\n"
1087 "{\n"
1088 " struct sigaction sa;\n"
1089 " int s;\n"
1090 " int numReqs; /* Nombre total de requêtes d'E/S dans la file */\n"
1091 " int openReqs; /* Nombre de requêtes d'E/S encore en cours */\n"
1092 "\\&\n"
1093 " if (argc E<lt> 2) {\n"
1094 " fprintf(stderr, \"Utilisation : %s E<lt>cheminE<gt> E<lt>cheminE<gt>...\\en\",\n"
1095 " argv[0]);\n"
1096 " exit(EXIT_FAILURE);\n"
1097 " }\n"
1098 "\\&\n"
1099 " numReqs = argc - 1;\n"
1100 "\\&\n"
1101 " /* Allocation des tableaux. */\n"
1102 "\\&\n"
1103 " struct ioRequest *ioList = calloc(numReqs, sizeof(*ioList));\n"
1104 " if (ioList == NULL)\n"
1105 " errExit(\"calloc\");\n"
1106 "\\&\n"
1107 " struct aiocb *aiocbList = calloc(numReqs, sizeof(*aiocbList));\n"
1108 " if (aiocbList == NULL)\n"
1109 " errExit(\"calloc\");\n"
1110 "\\&\n"
1111 " /* Mise en place des gestionnaires pour SIGQUIT et le signal de fin d'E/S. */\n"
1112 "\\&\n"
1113 " sa.sa_flags = SA_RESTART;\n"
1114 " sigemptyset(&sa.sa_mask);\n"
1115 "\\&\n"
1116 " sa.sa_handler = quitHandler;\n"
1117 " if (sigaction(SIGQUIT, &sa, NULL) == -1)\n"
1118 " errExit(\"sigaction\");\n"
1119 "\\&\n"
1120 " sa.sa_flags = SA_RESTART | SA_SIGINFO;\n"
1121 " sa.sa_sigaction = aioSigHandler;\n"
1122 " if (sigaction(IO_SIGNAL, &sa, NULL) == -1)\n"
1123 " errExit(\"sigaction\");\n"
1124 "\\&\n"
1125 " /* Ouverture de chaque fichier indiqué sur la ligne de commande et mise en file\n"
1126 " d'attente d'une requête de lecture sur le descripteur de fichier correspondant. */\n"
1127 "\\&\n"
1128 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1129 " ioList[j].reqNum = j;\n"
1130 " ioList[j].status = EINPROGRESS;\n"
1131 " ioList[j].aiocbp = &aiocbList[j];\n"
1132 "\\&\n"
1133 " ioList[j].aiocbp-E<gt>aio_fildes = open(argv[j + 1], O_RDONLY);\n"
1134 " if (ioList[j].aiocbp-E<gt>aio_fildes == -1)\n"
1135 " errExit(\"open\");\n"
1136 " printf(\"%s ouvert sur le descripteur %d\\en\", argv[j + 1],\n"
1137 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
1138 "\\&\n"
1139 " ioList[j].aiocbp-E<gt>aio_buf = malloc(BUF_SIZE);\n"
1140 " if (ioList[j].aiocbp-E<gt>aio_buf == NULL)\n"
1141 " errExit(\"malloc\");\n"
1142 "\\&\n"
1143 " ioList[j].aiocbp-E<gt>aio_nbytes = BUF_SIZE;\n"
1144 " ioList[j].aiocbp-E<gt>aio_reqprio = 0;\n"
1145 " ioList[j].aiocbp-E<gt>aio_offset = 0;\n"
1146 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_notify = SIGEV_SIGNAL;\n"
1147 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_signo = IO_SIGNAL;\n"
1148 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_value.sival_ptr =\n"
1149 " &ioList[j];\n"
1150 "\\&\n"
1151 " s = aio_read(ioList[j].aiocbp);\n"
1152 " if (s == -1)\n"
1153 " errExit(\"aio_read\");\n"
1154 " }\n"
1155 "\\&\n"
1156 " openReqs = numReqs;\n"
1157 "\\&\n"
1158 " /* Boucle, surveillance de l'état des requêtes d'E/S. */\n"
1159 "\\&\n"
1160 " while (openReqs E<gt> 0) {\n"
1161 " sleep(3); /* Délai entre chaque étape de surveillance */\n"
1162 "\\&\n"
1163 " if (gotSIGQUIT) {\n"
1164 "\\&\n"
1165 " /* Lors de la réception de SIGQUIT, essayer d'annuler\n"
1166 " toutes les requêtes d'E/S en cours et afficher\n"
1167 " l'état renvoyé par les requêtes d'annulation. */\n"
1168 "\\&\n"
1169 " printf(\"réception de SIGQUIT ; annulation des requêtes d'E/S : \\en\");\n"
1170 "\\&\n"
1171 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1172 " if (ioList[j].status == EINPROGRESS) {\n"
1173 " printf(\" Request %zu on descriptor %d:\", j,\n"
1174 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
1175 " s = aio_cancel(ioList[j].aiocbp-E<gt>aio_fildes,\n"
1176 " ioList[j].aiocbp);\n"
1177 " if (s == AIO_CANCELED)\n"
1178 " printf(\"I/O canceled\\en\");\n"
1179 " else if (s == AIO_NOTCANCELED)\n"
1180 " printf(\"I/O not canceled\\en\");\n"
1181 " else if (s == AIO_ALLDONE)\n"
1182 " printf(\"I/O all done\\en\");\n"
1183 " else\n"
1184 " perror(\"aio_cancel\");\n"
1185 " }\n"
1186 " }\n"
1187 "\\&\n"
1188 " gotSIGQUIT = 0;\n"
1189 " }\n"
1190 "\\&\n"
1191 " /* Vérification de l'état de toutes les\n"
1192 " requêtes d'E/S encore en cours. */\n"
1193 "\\&\n"
1194 " printf(\"aio_error():\\en\");\n"
1195 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1196 " if (ioList[j].status == EINPROGRESS) {\n"
1197 " printf(\" pour la requête %zu (descripteur %d) : \",\n"
1198 " j, ioList[j].aiocbp-E<gt>aio_fildes);\n"
1199 " ioList[j].status = aio_error(ioList[j].aiocbp);\n"
1200 "\\&\n"
1201 " switch (ioList[j].status) {\n"
1202 " case 0:\n"
1203 " printf(\"E/S réussie\\en\");\n"
1204 " break;\n"
1205 " case EINPROGRESS:\n"
1206 " printf(\"En cours\\en\");\n"
1207 " break;\n"
1208 " case ECANCELED:\n"
1209 " printf(\"Annulée\\en\");\n"
1210 " break;\n"
1211 " default:\n"
1212 " perror(\"aio_error\");\n"
1213 " break;\n"
1214 " }\n"
1215 "\\&\n"
1216 " if (ioList[j].status != EINPROGRESS)\n"
1217 " openReqs--;\n"
1218 " }\n"
1219 " }\n"
1220 " }\n"
1221 "\\&\n"
1222 " printf(\"Toutes les requêtes d'E/S sont terminées\\en\");\n"
1223 "\\&\n"
1224 " /* Vérification de l'état de retour de toutes les requêtes d'E/S. */\n"
1225 "\\&\n"
1226 " printf(\"aio_return():\\en\");\n"
1227 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1228 " ssize_t s;\n"
1229 "\\&\n"
1230 " s = aio_return(ioList[j].aiocbp);\n"
1231 " printf(\" pour la requête %zu (descripteur %d) : %zd\\en\",\n"
1232 " j, ioList[j].aiocbp-E<gt>aio_fildes, s);\n"
1233 " }\n"
1234 "\\&\n"
1235 " exit(EXIT_SUCCESS);\n"
1236 "}\n"
1237
1238 #. type: SH
1239 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1240 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1241 #, no-wrap
1242 msgid "SEE ALSO"
1243 msgstr "VOIR AUSSI"
1244
1245 #. type: Plain text
1246 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1247 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1248 msgid ""
1249 "B<io_cancel>(2), B<io_destroy>(2), B<io_getevents>(2), B<io_setup>(2), "
1250 "B<io_submit>(2), B<aio_cancel>(3), B<aio_error>(3), B<aio_init>(3), "
1251 "B<aio_read>(3), B<aio_return>(3), B<aio_write>(3), B<lio_listio>(3)"
1252 msgstr ""
1253 "B<io_cancel>(2), B<io_destroy>(2), B<io_getevents>(2), B<io_setup>(2), "
1254 "B<io_submit>(2), B<aio_cancel>(3), B<aio_error>(3), B<aio_init>(3), "
1255 "B<aio_read>(3), B<aio_return>(3), B<aio_write>(3), B<lio_listio>(3)"
1256
1257 #. type: Plain text
1258 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1259 #: opensuse-tumbleweed
1260 #, fuzzy
1261 #| msgid ""
1262 #| "\"Asynchronous I/O Support in Linux 2.5\", Bhattacharya, Pratt, "
1263 #| "Pulavarty, and Morgan, Proceedings of the Linux Symposium, 2003, E<.UR "
1264 #| "https://www.kernel.org/doc/ols/2003/ols2003-pages-351-366.pdf> E<.UE>"
1265 msgid ""
1266 "\"Asynchronous I/O Support in Linux 2.5\", Bhattacharya, Pratt, Pulavarty, "
1267 "and Morgan, Proceedings of the Linux Symposium, 2003, E<.UR https:\\://"
1268 "www.kernel.org/doc/ols/2003/ols2003-pages-351-366.pdf> E<.UE>"
1269 msgstr ""
1270 "\"Asynchronous I/O Support in Linux 2.5\", Bhattacharya, Pratt, Pulavarty, "
1271 "and Morgan, Proceedings of the Linux Symposium, 2003, E<.UR https://"
1272 "www.kernel.org/doc/ols/2003/ols2003-pages-351-366.pdf> E<.UE>"
1273
1274 #. type: TH
1275 #: debian-trixie fedora-44 fedora-rawhide
1276 #, no-wrap
1277 msgid "2024-06-15"
1278 msgstr "15 juin 2024"
1279
1280 #. type: TH
1281 #: debian-trixie
1282 #, no-wrap
1283 msgid "Linux man-pages 6.9.1"
1284 msgstr "Pages du manuel de Linux 6.9.1"
1285
1286 #. type: Plain text
1287 #: debian-trixie fedora-44 fedora-rawhide
1288 #, no-wrap
1289 msgid ""
1290 "$ B<./a.out /dev/stdin /dev/stdin>\n"
1291 "opened /dev/stdin on descriptor 3\n"
1292 "opened /dev/stdin on descriptor 4\n"
1293 "aio_error():\n"
1294 " for request 0 (descriptor 3): In progress\n"
1295 " for request 1 (descriptor 4): In progress\n"
1296 "B<abc>\n"
1297 "I/O completion signal received\n"
1298 "aio_error():\n"
1299 " for request 0 (descriptor 3): I/O succeeded\n"
1300 " for request 1 (descriptor 4): In progress\n"
1301 "aio_error():\n"
1302 " for request 1 (descriptor 4): In progress\n"
1303 "B<x>\n"
1304 "I/O completion signal received\n"
1305 "aio_error():\n"
1306 " for request 1 (descriptor 4): I/O succeeded\n"
1307 "All I/O requests completed\n"
1308 "aio_return():\n"
1309 " for request 0 (descriptor 3): 4\n"
1310 " for request 1 (descriptor 4): 2\n"
1311 msgstr ""
1312 "$ B<./a.out /dev/stdin /dev/stdin>\n"
1313 "/dev/stdin ouvert sur le descripteur 3\n"
1314 "/dev/stdin ouvert sur le descripteur 4\n"
1315 "aio_error():\n"
1316 " pour la requête 0 (descripteur 3) : En cours\n"
1317 " pour la requête 1 (descripteur 4) : En cours\n"
1318 "B<abc>\n"
1319 "Signal de fin d'E/S reçu\n"
1320 "aio_error():\n"
1321 " pour la requête 0 (descripteur 3) : E/S réussie\n"
1322 " pour la requête 1 (descripteur 4) : En cours\n"
1323 "aio_error():\n"
1324 " pour la requête 1 (descripteur 4) : En cours\n"
1325 "B<x>\n"
1326 "Signal de fin d'E/S reçu\n"
1327 "aio_error():\n"
1328 " pour la requête 1 (descripteur 4) : E/S réussie\n"
1329 "Toutes les requêtes d'E/S sont terminées\n"
1330 "aio_return():\n"
1331 " pour la requête 0 (descripteur 3) : 4\n"
1332 " pour la requête 1 (descripteur 4) : 2\n"
1333
1334 #. type: Plain text
1335 #: debian-trixie fedora-44 fedora-rawhide
1336 #, no-wrap
1337 msgid ""
1338 "#include E<lt>fcntl.hE<gt>\n"
1339 "#include E<lt>stdlib.hE<gt>\n"
1340 "#include E<lt>unistd.hE<gt>\n"
1341 "#include E<lt>stdio.hE<gt>\n"
1342 "#include E<lt>errno.hE<gt>\n"
1343 "#include E<lt>aio.hE<gt>\n"
1344 "#include E<lt>signal.hE<gt>\n"
1345 "\\&\n"
1346 "#define BUF_SIZE 20 /* Size of buffers for read operations */\n"
1347 "\\&\n"
1348 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1349 "\\&\n"
1350 "struct ioRequest { /* Application-defined structure for tracking\n"
1351 " I/O requests */\n"
1352 " int reqNum;\n"
1353 " int status;\n"
1354 " struct aiocb *aiocbp;\n"
1355 "};\n"
1356 "\\&\n"
1357 "static volatile sig_atomic_t gotSIGQUIT = 0;\n"
1358 " /* On delivery of SIGQUIT, we attempt to\n"
1359 " cancel all outstanding I/O requests */\n"
1360 "\\&\n"
1361 "static void /* Handler for SIGQUIT */\n"
1362 "quitHandler(int sig)\n"
1363 "{\n"
1364 " gotSIGQUIT = 1;\n"
1365 "}\n"
1366 "\\&\n"
1367 "#define IO_SIGNAL SIGUSR1 /* Signal used to notify I/O completion */\n"
1368 "\\&\n"
1369 "static void /* Handler for I/O completion signal */\n"
1370 "aioSigHandler(int sig, siginfo_t *si, void *ucontext)\n"
1371 "{\n"
1372 " if (si-E<gt>si_code == SI_ASYNCIO) {\n"
1373 " write(STDOUT_FILENO, \"I/O completion signal received\\[rs]n\", 31);\n"
1374 "\\&\n"
1375 " /* The corresponding ioRequest structure would be available as\n"
1376 " struct ioRequest *ioReq = si-E<gt>si_value.sival_ptr;\n"
1377 " and the file descriptor would then be available via\n"
1378 " ioReq-E<gt>aiocbp-E<gt>aio_fildes */\n"
1379 " }\n"
1380 "}\n"
1381 "\\&\n"
1382 "int\n"
1383 "main(int argc, char *argv[])\n"
1384 "{\n"
1385 " struct sigaction sa;\n"
1386 " int s;\n"
1387 " int numReqs; /* Total number of queued I/O requests */\n"
1388 " int openReqs; /* Number of I/O requests still in progress */\n"
1389 "\\&\n"
1390 " if (argc E<lt> 2) {\n"
1391 " fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt> E<lt>pathnameE<gt>...\\[rs]n\",\n"
1392 " argv[0]);\n"
1393 " exit(EXIT_FAILURE);\n"
1394 " }\n"
1395 "\\&\n"
1396 " numReqs = argc - 1;\n"
1397 "\\&\n"
1398 " /* Allocate our arrays. */\n"
1399 "\\&\n"
1400 " struct ioRequest *ioList = calloc(numReqs, sizeof(*ioList));\n"
1401 " if (ioList == NULL)\n"
1402 " errExit(\"calloc\");\n"
1403 "\\&\n"
1404 " struct aiocb *aiocbList = calloc(numReqs, sizeof(*aiocbList));\n"
1405 " if (aiocbList == NULL)\n"
1406 " errExit(\"calloc\");\n"
1407 "\\&\n"
1408 " /* Establish handlers for SIGQUIT and the I/O completion signal. */\n"
1409 "\\&\n"
1410 " sa.sa_flags = SA_RESTART;\n"
1411 " sigemptyset(&sa.sa_mask);\n"
1412 "\\&\n"
1413 " sa.sa_handler = quitHandler;\n"
1414 " if (sigaction(SIGQUIT, &sa, NULL) == -1)\n"
1415 " errExit(\"sigaction\");\n"
1416 "\\&\n"
1417 " sa.sa_flags = SA_RESTART | SA_SIGINFO;\n"
1418 " sa.sa_sigaction = aioSigHandler;\n"
1419 " if (sigaction(IO_SIGNAL, &sa, NULL) == -1)\n"
1420 " errExit(\"sigaction\");\n"
1421 "\\&\n"
1422 " /* Open each file specified on the command line, and queue\n"
1423 " a read request on the resulting file descriptor. */\n"
1424 "\\&\n"
1425 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1426 " ioList[j].reqNum = j;\n"
1427 " ioList[j].status = EINPROGRESS;\n"
1428 " ioList[j].aiocbp = &aiocbList[j];\n"
1429 "\\&\n"
1430 " ioList[j].aiocbp-E<gt>aio_fildes = open(argv[j + 1], O_RDONLY);\n"
1431 " if (ioList[j].aiocbp-E<gt>aio_fildes == -1)\n"
1432 " errExit(\"open\");\n"
1433 " printf(\"opened %s on descriptor %d\\[rs]n\", argv[j + 1],\n"
1434 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
1435 "\\&\n"
1436 " ioList[j].aiocbp-E<gt>aio_buf = malloc(BUF_SIZE);\n"
1437 " if (ioList[j].aiocbp-E<gt>aio_buf == NULL)\n"
1438 " errExit(\"malloc\");\n"
1439 "\\&\n"
1440 " ioList[j].aiocbp-E<gt>aio_nbytes = BUF_SIZE;\n"
1441 " ioList[j].aiocbp-E<gt>aio_reqprio = 0;\n"
1442 " ioList[j].aiocbp-E<gt>aio_offset = 0;\n"
1443 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_notify = SIGEV_SIGNAL;\n"
1444 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_signo = IO_SIGNAL;\n"
1445 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_value.sival_ptr =\n"
1446 " &ioList[j];\n"
1447 "\\&\n"
1448 " s = aio_read(ioList[j].aiocbp);\n"
1449 " if (s == -1)\n"
1450 " errExit(\"aio_read\");\n"
1451 " }\n"
1452 "\\&\n"
1453 " openReqs = numReqs;\n"
1454 "\\&\n"
1455 " /* Loop, monitoring status of I/O requests. */\n"
1456 "\\&\n"
1457 " while (openReqs E<gt> 0) {\n"
1458 " sleep(3); /* Delay between each monitoring step */\n"
1459 "\\&\n"
1460 " if (gotSIGQUIT) {\n"
1461 "\\&\n"
1462 " /* On receipt of SIGQUIT, attempt to cancel each of the\n"
1463 " outstanding I/O requests, and display status returned\n"
1464 " from the cancelation requests. */\n"
1465 "\\&\n"
1466 " printf(\"got SIGQUIT; canceling I/O requests: \\[rs]n\");\n"
1467 "\\&\n"
1468 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1469 " if (ioList[j].status == EINPROGRESS) {\n"
1470 " printf(\" Request %zu on descriptor %d:\", j,\n"
1471 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
1472 " s = aio_cancel(ioList[j].aiocbp-E<gt>aio_fildes,\n"
1473 " ioList[j].aiocbp);\n"
1474 " if (s == AIO_CANCELED)\n"
1475 " printf(\"I/O canceled\\[rs]n\");\n"
1476 " else if (s == AIO_NOTCANCELED)\n"
1477 " printf(\"I/O not canceled\\[rs]n\");\n"
1478 " else if (s == AIO_ALLDONE)\n"
1479 " printf(\"I/O all done\\[rs]n\");\n"
1480 " else\n"
1481 " perror(\"aio_cancel\");\n"
1482 " }\n"
1483 " }\n"
1484 "\\&\n"
1485 " gotSIGQUIT = 0;\n"
1486 " }\n"
1487 "\\&\n"
1488 " /* Check the status of each I/O request that is still\n"
1489 " in progress. */\n"
1490 "\\&\n"
1491 " printf(\"aio_error():\\[rs]n\");\n"
1492 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1493 " if (ioList[j].status == EINPROGRESS) {\n"
1494 " printf(\" for request %zu (descriptor %d): \",\n"
1495 " j, ioList[j].aiocbp-E<gt>aio_fildes);\n"
1496 " ioList[j].status = aio_error(ioList[j].aiocbp);\n"
1497 "\\&\n"
1498 " switch (ioList[j].status) {\n"
1499 " case 0:\n"
1500 " printf(\"I/O succeeded\\[rs]n\");\n"
1501 " break;\n"
1502 " case EINPROGRESS:\n"
1503 " printf(\"In progress\\[rs]n\");\n"
1504 " break;\n"
1505 " case ECANCELED:\n"
1506 " printf(\"Canceled\\[rs]n\");\n"
1507 " break;\n"
1508 " default:\n"
1509 " perror(\"aio_error\");\n"
1510 " break;\n"
1511 " }\n"
1512 "\\&\n"
1513 " if (ioList[j].status != EINPROGRESS)\n"
1514 " openReqs--;\n"
1515 " }\n"
1516 " }\n"
1517 " }\n"
1518 "\\&\n"
1519 " printf(\"All I/O requests completed\\[rs]n\");\n"
1520 "\\&\n"
1521 " /* Check status return of all I/O requests. */\n"
1522 "\\&\n"
1523 " printf(\"aio_return():\\[rs]n\");\n"
1524 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1525 " ssize_t s;\n"
1526 "\\&\n"
1527 " s = aio_return(ioList[j].aiocbp);\n"
1528 " printf(\" for request %zu (descriptor %d): %zd\\[rs]n\",\n"
1529 " j, ioList[j].aiocbp-E<gt>aio_fildes, s);\n"
1530 " }\n"
1531 "\\&\n"
1532 " exit(EXIT_SUCCESS);\n"
1533 "}\n"
1534 msgstr ""
1535 "#include E<lt>fcntl.hE<gt>\n"
1536 "#include E<lt>stdlib.hE<gt>\n"
1537 "#include E<lt>unistd.hE<gt>\n"
1538 "#include E<lt>stdio.hE<gt>\n"
1539 "#include E<lt>errno.hE<gt>\n"
1540 "#include E<lt>aio.hE<gt>\n"
1541 "#include E<lt>signal.hE<gt>\n"
1542 "\\&\n"
1543 "#define BUF_SIZE 20 /* Taille des tampons pour les opérations de lecture */\n"
1544 "\\&\n"
1545 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1546 "\\&\n"
1547 "struct ioRequest { /* Structure spécifique à l'application\n"
1548 " pour suivre les requêtes d'E/S */\n"
1549 " int reqNum;\n"
1550 " int status;\n"
1551 " struct aiocb *aiocbp;\n"
1552 "};\n"
1553 "\\&\n"
1554 "static volatile sig_atomic_t gotSIGQUIT = 0;\n"
1555 " /* Essayer d'annuler toutes les requêtes d'E/S\n"
1556 " en cours lors de la réception d'un SIGQUIT */\n"
1557 "\\&\n"
1558 "static void /* Gestionnaire pour SIGQUIT */\n"
1559 "quitHandler(int sig)\n"
1560 "{\n"
1561 " gotSIGQUIT = 1;\n"
1562 "}\n"
1563 "\\&\n"
1564 "#define IO_SIGNAL SIGUSR1 /* Signal pour notifier la fin d'E/S */\n"
1565 "\\&\n"
1566 "static void /* Gestionnaire pour le signal de fin d'E/S */\n"
1567 "aioSigHandler(int sig, siginfo_t *si, void *ucontext)\n"
1568 "{\n"
1569 " if (si-E<gt>si_code == SI_ASYNCIO) {\n"
1570 " write(STDOUT_FILENO, \"Gestionnaire pour le signal de fin d'E/S\\[rs]n\", 31);\n"
1571 "\\&\n"
1572 " /* La structure ioRequest correspondante serait disponible en\n"
1573 "\t struct ioRequest *ioReq = si-E<gt>si_value.sival_ptr;\n"
1574 "\t et le descripteur de fichier serait alors disponible via\n"
1575 " ioReq-E<gt>aiocbp-E<gt>aio_fildes */\n"
1576 " }\n"
1577 "}\n"
1578 "\\&\n"
1579 "int\n"
1580 "main(int argc, char *argv[])\n"
1581 "{\n"
1582 " struct sigaction sa;\n"
1583 " int s;\n"
1584 " int numReqs; /* Nombre total de requêtes d'E/S dans la file */\n"
1585 " int openReqs; /* Nombre de requêtes d'E/S encore en cours */\n"
1586 "\\&\n"
1587 " if (argc E<lt> 2) {\n"
1588 " fprintf(stderr, \"Utilisation : %s E<lt>cheminE<gt> E<lt>cheminE<gt>...\\en\",\n"
1589 " argv[0]);\n"
1590 " exit(EXIT_FAILURE);\n"
1591 " }\n"
1592 "\\&\n"
1593 " numReqs = argc - 1;\n"
1594 "\\&\n"
1595 " /* Allocation des tableaux. */\n"
1596 "\\&\n"
1597 " struct ioRequest *ioList = calloc(numReqs, sizeof(*ioList));\n"
1598 " if (ioList == NULL)\n"
1599 " errExit(\"calloc\");\n"
1600 "\\&\n"
1601 " struct aiocb *aiocbList = calloc(numReqs, sizeof(*aiocbList));\n"
1602 " if (aiocbList == NULL)\n"
1603 " errExit(\"calloc\");\n"
1604 "\\&\n"
1605 " /* Mise en place des gestionnaires pour SIGQUIT et le signal de fin d'E/S. */\n"
1606 "\\&\n"
1607 " sa.sa_flags = SA_RESTART;\n"
1608 " sigemptyset(&sa.sa_mask);\n"
1609 "\\&\n"
1610 " sa.sa_handler = quitHandler;\n"
1611 " if (sigaction(SIGQUIT, &sa, NULL) == -1)\n"
1612 " errExit(\"sigaction\");\n"
1613 "\\&\n"
1614 " sa.sa_flags = SA_RESTART | SA_SIGINFO;\n"
1615 " sa.sa_sigaction = aioSigHandler;\n"
1616 " if (sigaction(IO_SIGNAL, &sa, NULL) == -1)\n"
1617 " errExit(\"sigaction\");\n"
1618 "\\&\n"
1619 " /* Ouverture de chaque fichier indiqué sur la ligne de commande et mise en file\n"
1620 " d'attente d'une requête de lecture sur le descripteur de fichier correspondant. */\n"
1621 "\\&\n"
1622 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1623 " ioList[j].reqNum = j;\n"
1624 " ioList[j].status = EINPROGRESS;\n"
1625 " ioList[j].aiocbp = &aiocbList[j];\n"
1626 "\\&\n"
1627 " ioList[j].aiocbp-E<gt>aio_fildes = open(argv[j + 1], O_RDONLY);\n"
1628 " if (ioList[j].aiocbp-E<gt>aio_fildes == -1)\n"
1629 " errExit(\"open\");\n"
1630 " printf(\"%s ouvert sur le descripteur %d\\en\", argv[j + 1],\n"
1631 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
1632 "\\&\n"
1633 " ioList[j].aiocbp-E<gt>aio_buf = malloc(BUF_SIZE);\n"
1634 " if (ioList[j].aiocbp-E<gt>aio_buf == NULL)\n"
1635 " errExit(\"malloc\");\n"
1636 "\\&\n"
1637 " ioList[j].aiocbp-E<gt>aio_nbytes = BUF_SIZE;\n"
1638 " ioList[j].aiocbp-E<gt>aio_reqprio = 0;\n"
1639 " ioList[j].aiocbp-E<gt>aio_offset = 0;\n"
1640 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_notify = SIGEV_SIGNAL;\n"
1641 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_signo = IO_SIGNAL;\n"
1642 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_value.sival_ptr =\n"
1643 " &ioList[j];\n"
1644 "\\&\n"
1645 " s = aio_read(ioList[j].aiocbp);\n"
1646 " if (s == -1)\n"
1647 " errExit(\"aio_read\");\n"
1648 " }\n"
1649 "\\&\n"
1650 " openReqs = numReqs;\n"
1651 "\\&\n"
1652 " /* Boucle, surveillance de l'état des requêtes d'E/S. */\n"
1653 "\\&\n"
1654 " while (openReqs E<gt> 0) {\n"
1655 " sleep(3); /* Délai entre chaque étape de surveillance */\n"
1656 "\\&\n"
1657 " if (gotSIGQUIT) {\n"
1658 "\\&\n"
1659 " /* Lors de la réception de SIGQUIT, essayer d'annuler\n"
1660 " toutes les requêtes d'E/S en cours et afficher\n"
1661 " l'état renvoyé par les requêtes d'annulation. */\n"
1662 "\\&\n"
1663 " printf(\"réception de SIGQUIT ; annulation des requêtes d'E/S : \\en\");\n"
1664 "\\&\n"
1665 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1666 " if (ioList[j].status == EINPROGRESS) {\n"
1667 " printf(\" Request %zu on descriptor %d:\", j,\n"
1668 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
1669 " s = aio_cancel(ioList[j].aiocbp-E<gt>aio_fildes,\n"
1670 " ioList[j].aiocbp);\n"
1671 " if (s == AIO_CANCELED)\n"
1672 " printf(\"I/O canceled\\en\");\n"
1673 " else if (s == AIO_NOTCANCELED)\n"
1674 " printf(\"I/O not canceled\\en\");\n"
1675 " else if (s == AIO_ALLDONE)\n"
1676 " printf(\"I/O all done\\en\");\n"
1677 " else\n"
1678 " perror(\"aio_cancel\");\n"
1679 " }\n"
1680 " }\n"
1681 "\\&\n"
1682 " gotSIGQUIT = 0;\n"
1683 " }\n"
1684 "\\&\n"
1685 " /* Vérification de l'état de toutes les\n"
1686 " requêtes d'E/S encore en cours. */\n"
1687 "\\&\n"
1688 " printf(\"aio_error():\\en\");\n"
1689 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1690 " if (ioList[j].status == EINPROGRESS) {\n"
1691 " printf(\" pour la requête %zu (descripteur %d) : \",\n"
1692 " j, ioList[j].aiocbp-E<gt>aio_fildes);\n"
1693 " ioList[j].status = aio_error(ioList[j].aiocbp);\n"
1694 "\\&\n"
1695 " switch (ioList[j].status) {\n"
1696 " case 0:\n"
1697 " printf(\"E/S réussie\\en\");\n"
1698 " break;\n"
1699 " case EINPROGRESS:\n"
1700 " printf(\"En cours\\en\");\n"
1701 " break;\n"
1702 " case ECANCELED:\n"
1703 " printf(\"Annulée\\en\");\n"
1704 " break;\n"
1705 " default:\n"
1706 " perror(\"aio_error\");\n"
1707 " break;\n"
1708 " }\n"
1709 "\\&\n"
1710 " if (ioList[j].status != EINPROGRESS)\n"
1711 " openReqs--;\n"
1712 " }\n"
1713 " }\n"
1714 " }\n"
1715 "\\&\n"
1716 " printf(\"Toutes les requêtes d'E/S sont terminées\\en\");\n"
1717 "\\&\n"
1718 " /* Vérification de l'état de retour de toutes les requêtes d'E/S. */\n"
1719 "\\&\n"
1720 " printf(\"aio_return():\\en\");\n"
1721 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1722 " ssize_t s;\n"
1723 "\\&\n"
1724 " s = aio_return(ioList[j].aiocbp);\n"
1725 " printf(\" pour la requête %zu (descripteur %d) : %zd\\en\",\n"
1726 " j, ioList[j].aiocbp-E<gt>aio_fildes, s);\n"
1727 " }\n"
1728 "\\&\n"
1729 " exit(EXIT_SUCCESS);\n"
1730 "}\n"
1731
1732 #. type: Plain text
1733 #: debian-trixie fedora-44 fedora-rawhide
1734 msgid ""
1735 "\"Asynchronous I/O Support in Linux 2.5\", Bhattacharya, Pratt, Pulavarty, "
1736 "and Morgan, Proceedings of the Linux Symposium, 2003, E<.UR https://"
1737 "www.kernel.org/doc/ols/2003/ols2003-pages-351-366.pdf> E<.UE>"
1738 msgstr ""
1739 "\"Asynchronous I/O Support in Linux 2.5\", Bhattacharya, Pratt, Pulavarty, "
1740 "and Morgan, Proceedings of the Linux Symposium, 2003, E<.UR https://"
1741 "www.kernel.org/doc/ols/2003/ols2003-pages-351-366.pdf> E<.UE>"
1742
1743 #. type: TH
1744 #: fedora-44 fedora-rawhide
1745 #, no-wrap
1746 msgid "Linux man-pages 6.13"
1747 msgstr "Pages du manuel de Linux 6.13"
1748
1749 #. type: TH
1750 #: mageia-cauldron
1751 #, no-wrap
1752 msgid "Linux man-pages 6.17"
1753 msgstr "Pages du manuel de Linux 6.17"
1754
1755 #. type: TH
1756 #: opensuse-leap-16-1 opensuse-tumbleweed
1757 #, no-wrap
1758 msgid "Linux man-pages (unreleased)"
1759 msgstr "Pages du manuel de Linux (non publiées)"