Debian Codegraph @

po/ru/man7/aio.7.po

raw
1 # Russian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Dmitry Bolkhovskikh <[email protected]>, 2017.
5 # Yuri Kozlov <[email protected]>, 2012-2019.
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: manpages-l10n\n"
9 "POT-Creation-Date: 2026-06-05 06:17+0200\n"
10 "PO-Revision-Date: 2024-12-21 19:50+0300\n"
11 "Last-Translator: Yuri Kozlov <[email protected]>\n"
12 "Language-Team: Russian <[email protected]>\n"
13 "Language: ru\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
18 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
19 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
20 "X-Generator: Lokalize 2.0\n"
21
22 #. type: TH
23 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
24 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
25 #, no-wrap
26 msgid "AIO"
27 msgstr "AIO"
28
29 #. type: TH
30 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
31 #: opensuse-tumbleweed
32 #, no-wrap
33 msgid "2026-02-08"
34 msgstr "8 февраля 2026 г."
35
36 #. type: TH
37 #: archlinux debian-unstable
38 #, fuzzy, no-wrap
39 #| msgid "Linux man-pages 6.17"
40 msgid "Linux man-pages 6.18"
41 msgstr "Справочные страницы Linux 6.17"
42
43 #. type: SH
44 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
45 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
46 #, no-wrap
47 msgid "NAME"
48 msgstr "НАИМЕНОВАНИЕ"
49
50 #. type: Plain text
51 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
52 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
53 msgid "aio - POSIX asynchronous I/O overview"
54 msgstr "aio - введение в асинхронный ввод-вывод POSIX"
55
56 #. type: SH
57 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
58 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
59 #, no-wrap
60 msgid "DESCRIPTION"
61 msgstr "ОПИСАНИЕ"
62
63 #. type: Plain text
64 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
65 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
66 msgid ""
67 "The POSIX asynchronous I/O (AIO) interface allows applications to initiate "
68 "one or more I/O operations that are performed asynchronously (i.e., in the "
69 "background). The application can elect to be notified of completion of the "
70 "I/O operation in a variety of ways: by delivery of a signal, by "
71 "instantiation of a thread, or no notification at all."
72 msgstr ""
73 "Интерфейс асинхронного ввода-вывода POSIX (AIO) позволяет приложениям "
74 "запускать одну или несколько операций ввода-вывода, которые выполняются "
75 "асинхронно (т. е., в фоновом режиме). Приложение может выбрать каким образом "
76 "оно будет уведомлено о завершении операции ввода-вывода: с помощью сигнала, "
77 "созданием новой нити или вообще не получать уведомления."
78
79 #. type: Plain text
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 msgid "The POSIX AIO interface consists of the following functions:"
83 msgstr "Интерфейс POSIX AIO состоит из следующих функций:"
84
85 #. type: TP
86 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
87 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
88 #, no-wrap
89 msgid "B<aio_read>(3)"
90 msgstr "B<aio_read>(3)"
91
92 #. type: Plain text
93 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
94 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
95 msgid "Enqueue a read request. This is the asynchronous analog of B<read>(2)."
96 msgstr "Ставит запрос на чтение в очередь. Это асинхронный аналог B<read>(2)."
97
98 #. type: TP
99 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
101 #, no-wrap
102 msgid "B<aio_write>(3)"
103 msgstr "B<aio_write>(3)"
104
105 #. type: Plain text
106 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
107 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
108 msgid ""
109 "Enqueue a write request. This is the asynchronous analog of B<write>(2)."
110 msgstr "Ставит запрос на запись в очередь. Это асинхронный аналог B<write>(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_fsync>(3)"
117 msgstr "B<aio_fsync>(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 sync request for the I/O operations on a file descriptor. This is "
124 "the asynchronous analog of B<fsync>(2) and B<fdatasync>(2)."
125 msgstr ""
126 "Ставит запрос синхронизации операций ввода-вывода над файловым дескриптором. "
127 "Это асинхронный аналог B<fsync>(2) и B<fdatasync>(2)."
128
129 #. type: TP
130 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
131 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
132 #, no-wrap
133 msgid "B<aio_error>(3)"
134 msgstr "B<aio_error>(3)"
135
136 #. type: Plain text
137 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
138 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
139 msgid "Obtain the error status of an enqueued I/O request."
140 msgstr ""
141 "Возвращает информацию о состоянии поставленного в очередь запроса ввода-"
142 "вывода."
143
144 #. type: TP
145 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
146 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
147 #, no-wrap
148 msgid "B<aio_return>(3)"
149 msgstr "B<aio_return>(3)"
150
151 #. type: Plain text
152 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
153 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
154 msgid "Obtain the return status of a completed I/O request."
155 msgstr "Возвращает информацию о выполненном запросе ввода-вывода."
156
157 #. type: TP
158 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
159 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
160 #, no-wrap
161 msgid "B<aio_suspend>(3)"
162 msgstr "B<aio_suspend>(3)"
163
164 #. type: Plain text
165 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
166 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
167 msgid ""
168 "Suspend the caller until one or more of a specified set of I/O requests "
169 "completes."
170 msgstr ""
171 "Приостанавливает вызывающего до тех пор, пока не выполнится один или более "
172 "указанных запросов ввода-вывода."
173
174 #. type: TP
175 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
176 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
177 #, no-wrap
178 msgid "B<aio_cancel>(3)"
179 msgstr "B<aio_cancel>(3)"
180
181 #. type: Plain text
182 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
183 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
184 msgid ""
185 "Attempt to cancel outstanding I/O requests on a specified file descriptor."
186 msgstr ""
187 "Пытается отменить ожидающие выполнения запросы ввода-вывода над заданным "
188 "файловым дескриптором."
189
190 #. type: TP
191 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
192 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
193 #, no-wrap
194 msgid "B<lio_listio>(3)"
195 msgstr "B<lio_listio>(3)"
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 "Enqueue multiple I/O requests using a single function call."
201 msgstr ""
202 "Ставит в очередь сразу несколько запросов ввода-вывода за один вызов функции."
203
204 #. type: Plain text
205 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
206 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
207 msgid ""
208 "The I<aiocb> (\"asynchronous I/O control block\") structure defines "
209 "parameters that control an I/O operation. An argument of this type is "
210 "employed with all of the functions listed above. This structure has the "
211 "following form:"
212 msgstr ""
213 "В структуре I<aiocb> («блок управления асинхронным вводом-выводом») задаются "
214 "параметры, которые управляют операцией ввода-вывода. Аргумент данного типа "
215 "передаётся во все функции, перечисленные ранее. Данная структура имеет "
216 "следующий вид:"
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 #, fuzzy, no-wrap
222 #| msgid ""
223 #| " int aio_fildes; /* File descriptor */\n"
224 #| " off_t aio_offset; /* File offset */\n"
225 #| " volatile void *aio_buf; /* Location of buffer */\n"
226 #| " size_t aio_nbytes; /* Length of transfer */\n"
227 #| " int aio_reqprio; /* Request priority */\n"
228 #| " struct sigevent aio_sigevent; /* Notification method */\n"
229 #| " int aio_lio_opcode; /* Operation to be performed;\n"
230 #| " lio_listio() only */\n"
231 msgid ""
232 "#include E<lt>aiocb.hE<gt>\n"
233 "\\&\n"
234 "struct aiocb {\n"
235 " /* The order of these fields is implementation-dependent */\n"
236 "\\&\n"
237 " int aio_fildes; /* File descriptor */\n"
238 " off_t aio_offset; /* File offset */\n"
239 " volatile void *aio_buf; /* Location of buffer */\n"
240 " size_t aio_nbytes; /* Length of transfer */\n"
241 " int aio_reqprio; /* Request priority */\n"
242 " struct sigevent aio_sigevent; /* Notification method */\n"
243 " int aio_lio_opcode; /* Operation to be performed;\n"
244 " lio_listio() only */\n"
245 "\\&\n"
246 " /* Various implementation-internal fields not shown */\n"
247 "};\n"
248 "\\&\n"
249 "/* Operation codes for \\[aq]aio_lio_opcode\\[aq]: */\n"
250 "\\&\n"
251 "enum { LIO_READ, LIO_WRITE, LIO_NOP };\n"
252 msgstr ""
253 " int aio_fildes; /* файловый дескриптор */\n"
254 " off_t aio_offset; /* файловое смещение */\n"
255 " volatile void *aio_buf; /* расположение буфера */\n"
256 " size_t aio_nbytes; /* длина передачи */\n"
257 " int aio_reqprio; /* приоритет запроса */\n"
258 " struct sigevent aio_sigevent; /* метод уведомления */\n"
259 " int aio_lio_opcode; /* выполняемая операция;\n"
260 " только в lio_listio() */\n"
261
262 #. type: Plain text
263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
265 msgid "The fields of this structure are as follows:"
266 msgstr "Поля этой структуры имеют следующее назначение:"
267
268 #. type: TP
269 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
270 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
271 #, no-wrap
272 msgid "I<aio_fildes>"
273 msgstr "I<aio_fildes>"
274
275 #. type: Plain text
276 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
277 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
278 msgid "The file descriptor on which the I/O operation is to be performed."
279 msgstr ""
280 "Файловый дескриптор, над которым будут выполняться операции ввода-вывода."
281
282 #. type: TP
283 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
284 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
285 #, no-wrap
286 msgid "I<aio_offset>"
287 msgstr "I<aio_offset>"
288
289 #. type: Plain text
290 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
291 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
292 msgid "This is the file offset at which the I/O operation is to be performed."
293 msgstr ""
294 "Файловое смещение, начиная с которого будут выполняться операции ввода-"
295 "вывода."
296
297 #. type: TP
298 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
299 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
300 #, no-wrap
301 msgid "I<aio_buf>"
302 msgstr "I<aio_buf>"
303
304 #. type: Plain text
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 msgid "This is the buffer used to transfer data for a read or write operation."
308 msgstr ""
309 "Буфер, используемый для пересылки данных при операции чтения или записи."
310
311 #. type: TP
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 #, no-wrap
315 msgid "I<aio_nbytes>"
316 msgstr "I<aio_nbytes>"
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 "This is the size of the buffer pointed to by I<aio_buf>."
322 msgstr "Размер буфера, на который указывает I<aio_buf>."
323
324 #. type: TP
325 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
326 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
327 #, no-wrap
328 msgid "I<aio_reqprio>"
329 msgstr "I<aio_reqprio>"
330
331 #. type: Plain text
332 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
333 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
334 msgid ""
335 "This field specifies a value that is subtracted from the calling thread's "
336 "real-time priority in order to determine the priority for execution of this "
337 "I/O request (see B<pthread_setschedparam>(3)). The specified value must be "
338 "between 0 and the value returned by I<sysconf(_SC_AIO_PRIO_DELTA_MAX)>. "
339 "This field is ignored for file synchronization operations."
340 msgstr ""
341 "В этом поле задаётся значение, которое вычитается из приоритета реального "
342 "времени вызывающей нити, чтобы определить приоритет выполнения данного "
343 "запроса ввода-вывода (смотрите B<pthread_setschedparam>(3)). Указываемое "
344 "значение должно быть в диапазоне от 0 и до значения, возвращаемого "
345 "I<sysconf(_SC_AIO_PRIO_DELTA_MAX)>. Данное поле игнорируется при операциях "
346 "синхронизации файла."
347
348 #. type: TP
349 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
350 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
351 #, no-wrap
352 msgid "I<aio_sigevent>"
353 msgstr "I<aio_sigevent>"
354
355 #. type: Plain text
356 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
357 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
358 #, fuzzy
359 #| msgid ""
360 #| "This field is a structure that specifies how the caller is to be notified "
361 #| "when the asynchronous I/O operation completes. Possible values for "
362 #| "I<aio_sigevent.sigev_notify> are B<SIGEV_NONE>, B<SIGEV_SIGNAL>, and "
363 #| "B<SIGEV_THREAD>. See B<sigevent>(7) for further details."
364 msgid ""
365 "This field is a structure that specifies how the caller is to be notified "
366 "when the asynchronous I/O operation completes. Possible values for "
367 "I<aio_sigevent.sigev_notify> are B<SIGEV_NONE>, B<SIGEV_SIGNAL>, and "
368 "B<SIGEV_THREAD>. See B<sigevent>(3type) for further details."
369 msgstr ""
370 "В этом поле задаётся структура, которая указывает как вызывающему должно "
371 "быть сообщено о завершении анонимной операции ввода-вывода. Возможные "
372 "значения для I<aio_sigevent.sigev_notify>: B<SIGEV_NONE>, B<SIGEV_SIGNAL> и "
373 "B<SIGEV_THREAD>. Подробности смотрите в B<sigevent>(7)."
374
375 #. type: TP
376 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
377 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
378 #, no-wrap
379 msgid "I<aio_lio_opcode>"
380 msgstr "I<aio_lio_opcode>"
381
382 #. type: Plain text
383 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
384 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
385 msgid "The type of operation to be performed; used only for B<lio_listio>(3)."
386 msgstr ""
387 "Задаёт тип операции, которая будет выполнена; используется только в "
388 "B<lio_listio>(3)."
389
390 #. type: Plain text
391 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
392 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
393 msgid ""
394 "In addition to the standard functions listed above, the GNU C library "
395 "provides the following extension to the POSIX AIO API:"
396 msgstr ""
397 "В дополнении к стандартным функциям, перечисленным ранее, в библиотеке GNU C "
398 "есть следующее расширение программного интерфейса POSIX AIO:"
399
400 #. type: TP
401 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
402 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
403 #, no-wrap
404 msgid "B<aio_init>(3)"
405 msgstr "B<aio_init>(3)"
406
407 #. type: Plain text
408 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
409 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
410 msgid ""
411 "Set parameters for tuning the behavior of the glibc POSIX AIO implementation."
412 msgstr "Позволяет изменить настройки поведения реализации glibc для POSIX AIO."
413
414 #. type: SH
415 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
416 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
417 #, no-wrap
418 msgid "ERRORS"
419 msgstr "ОШИБКИ"
420
421 #. type: TP
422 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
423 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
424 #, no-wrap
425 msgid "B<EINVAL>"
426 msgstr "B<EINVAL>"
427
428 #. type: Plain text
429 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
430 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
431 msgid ""
432 "The I<aio_reqprio> field of the I<aiocb> structure was less than 0, or was "
433 "greater than the limit returned by the call "
434 "I<sysconf(_SC_AIO_PRIO_DELTA_MAX)>."
435 msgstr ""
436 "Значение поля I<aio_reqprio> структуры I<aiocb> меньше 0 или больше, чем "
437 "значение ограничения, возвращаемое вызовом "
438 "I<sysconf(_SC_AIO_PRIO_DELTA_MAX)>."
439
440 #. type: SH
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 #, no-wrap
444 msgid "STANDARDS"
445 msgstr "СТАНДАРТЫ"
446
447 #. type: Plain text
448 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
449 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
450 msgid "POSIX.1-2008."
451 msgstr "POSIX.1-2008."
452
453 #. type: SH
454 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
455 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
456 #, no-wrap
457 msgid "HISTORY"
458 msgstr "ИСТОРИЯ"
459
460 #. type: Plain text
461 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
462 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
463 msgid "POSIX.1-2001. glibc 2.1."
464 msgstr "POSIX.1-2001. glibc 2.1."
465
466 #. type: SH
467 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
468 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
469 #, no-wrap
470 msgid "NOTES"
471 msgstr "ПРИМЕЧАНИЯ"
472
473 #. type: Plain text
474 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
475 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
476 msgid ""
477 "It is a good idea to zero out the control block buffer before use (see "
478 "B<memset>(3)). The control block buffer and the buffer pointed to by "
479 "I<aio_buf> must not be changed while the I/O operation is in progress. "
480 "These buffers must remain valid until the I/O operation completes."
481 msgstr ""
482 "Желательно обнулять буфер блока управления перед использованием (смотрите "
483 "B<memset>(3)). Буфер блока управления и буфер, который задаётся в "
484 "I<aio_buf>, не должны изменяться во время выполнения операции ввода-вывода. "
485 "Данные буферы должны оставаться рабочими до завершения операции ввода-вывода."
486
487 #. type: Plain text
488 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
489 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
490 msgid ""
491 "Simultaneous asynchronous read or write operations using the same I<aiocb> "
492 "structure yield undefined results."
493 msgstr ""
494 "Одновременное выполнение операций чтения или записи через совместно "
495 "используемую структуру I<aiocb> приводит к непредсказуемым результатам."
496
497 #. http://lse.sourceforge.net/io/aio.html
498 #. http://lse.sourceforge.net/io/aionotes.txt
499 #. http://lwn.net/Articles/148755/
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 "The current Linux POSIX AIO implementation is provided in user space by "
505 "glibc. This has a number of limitations, most notably that maintaining "
506 "multiple threads to perform I/O operations is expensive and scales poorly. "
507 "Work has been in progress for some time on a kernel state-machine-based "
508 "implementation of asynchronous I/O (see B<io_submit>(2), B<io_setup>(2), "
509 "B<io_cancel>(2), B<io_destroy>(2), B<io_getevents>(2)), but this "
510 "implementation hasn't yet matured to the point where the POSIX AIO "
511 "implementation can be completely reimplemented using the kernel system calls."
512 msgstr ""
513 "Имеющаяся реализация Linux POSIX AIO предоставляется glibc в "
514 "пользовательском пространстве. Она имеет ряд ограничений, наиболее "
515 "существенные из которых — затраты на сопровождение нескольких нитей при "
516 "операциях ввода-вывода и плохое масштабирование. Некогда для реализации "
517 "асинхронного ввода-вывода велась работа над ядерной реализацией на основе "
518 "машины состояний (смотрите B<io_submit>(2), B<io_setup>(2), "
519 "B<io_cancel>(2), B<io_destroy>(2), B<io_getevents>(2)), но эта реализация "
520 "ещё недостаточно стабильна в тех местах, где POSIX AIO можно было бы "
521 "полностью реализовать на системных вызовах ядра."
522
523 #. type: SH
524 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
525 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
526 #, no-wrap
527 msgid "EXAMPLES"
528 msgstr "ПРИМЕРЫ"
529
530 #. type: Plain text
531 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
532 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
533 msgid ""
534 "The program below opens each of the files named in its command-line "
535 "arguments and queues a request on the resulting file descriptor using "
536 "B<aio_read>(3). The program then loops, periodically monitoring each of the "
537 "I/O operations that is still in progress using B<aio_error>(3). Each of the "
538 "I/O requests is set up to provide notification by delivery of a signal. "
539 "After all I/O requests have completed, the program retrieves their status "
540 "using B<aio_return>(3)."
541 msgstr ""
542 "Представленная далее программа открывает все файлы, указанные в параметрах "
543 "командной строки и ставит в очередь запрос на полученные файловые "
544 "дескрипторы с помощью B<aio_read>(3). Затем программа входит в цикл, в "
545 "котором периодически следит за всеми выполняемыми операциями ввода-вывода с "
546 "помощью B<aio_error>(3). Для каждого запроса ввода-вывода настроено "
547 "получение уведомления посредством сигнала. После завершения всех запросов "
548 "ввода-вывода, программа возвращает их состояние с помощью B<aio_return>(3)."
549
550 #. type: Plain text
551 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
552 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
553 #, fuzzy
554 #| msgid ""
555 #| "The B<SIGQUIT> signal (generated by typing control-\\e) causes the "
556 #| "program to request cancellation of each of the outstanding requests using "
557 #| "B<aio_cancel>(3)."
558 msgid ""
559 "The B<SIGQUIT> signal (generated by typing control-\\[rs]) causes the "
560 "program to request cancelation of each of the outstanding requests using "
561 "B<aio_cancel>(3)."
562 msgstr ""
563 "Сигнал B<SIGQUIT> (генерируемый нажатием control-\\e) заставляет программу "
564 "отменить все невыполненные запросы с помощью B<aio_cancel>(3)."
565
566 #. type: Plain text
567 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
568 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
569 msgid ""
570 "Here is an example of what we might see when running this program. In this "
571 "example, the program queues two requests to standard input, and these are "
572 "satisfied by two lines of input containing \"abc\" and \"x\"."
573 msgstr ""
574 "Вот результат работы программы. В этом примере программа ставит в очередь "
575 "два запроса для стандартного ввода, и они отрабатываются двумя введёнными "
576 "строками «abc» и «x»."
577
578 #. type: Plain text
579 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
580 #: opensuse-tumbleweed
581 #, fuzzy, no-wrap
582 #| msgid ""
583 #| "$ B<./a.out /dev/stdin /dev/stdin>\n"
584 #| "opened /dev/stdin on descriptor 3\n"
585 #| "opened /dev/stdin on descriptor 4\n"
586 #| "aio_error():\n"
587 #| " for request 0 (descriptor 3): In progress\n"
588 #| " for request 1 (descriptor 4): In progress\n"
589 #| "B<abc>\n"
590 #| "I/O completion signal received\n"
591 #| "aio_error():\n"
592 #| " for request 0 (descriptor 3): I/O succeeded\n"
593 #| " for request 1 (descriptor 4): In progress\n"
594 #| "aio_error():\n"
595 #| " for request 1 (descriptor 4): In progress\n"
596 #| "B<x>\n"
597 #| "I/O completion signal received\n"
598 #| "aio_error():\n"
599 #| " for request 1 (descriptor 4): I/O succeeded\n"
600 #| "All I/O requests completed\n"
601 #| "aio_return():\n"
602 #| " for request 0 (descriptor 3): 4\n"
603 #| " for request 1 (descriptor 4): 2\n"
604 msgid ""
605 "$B< ./a.out /dev/stdin /dev/stdin>;\n"
606 "opened /dev/stdin on descriptor 3\n"
607 "opened /dev/stdin on descriptor 4\n"
608 "aio_error():\n"
609 " for request 0 (descriptor 3): In progress\n"
610 " for request 1 (descriptor 4): In progress\n"
611 "B<abc>\n"
612 "I/O completion signal received\n"
613 "aio_error():\n"
614 " for request 0 (descriptor 3): I/O succeeded\n"
615 " for request 1 (descriptor 4): In progress\n"
616 "aio_error():\n"
617 " for request 1 (descriptor 4): In progress\n"
618 "B<x>\n"
619 "I/O completion signal received\n"
620 "aio_error():\n"
621 " for request 1 (descriptor 4): I/O succeeded\n"
622 "All I/O requests completed\n"
623 "aio_return():\n"
624 " for request 0 (descriptor 3): 4\n"
625 " for request 1 (descriptor 4): 2\n"
626 msgstr ""
627 "$ B<./a.out /dev/stdin /dev/stdin>\n"
628 "открыт /dev/stdin в дескрипторе 3\n"
629 "открыт /dev/stdin в дескрипторе 4\n"
630 "aio_error():\n"
631 " запрос 0 (дескриптор 3): выполняется\n"
632 " запрос 1 (дескриптор 4): выполняется\n"
633 "B<abc>\n"
634 "Получен сигнал завершения ввода-вывода\n"
635 "aio_error():\n"
636 " запрос 0 (дескриптор 3): ввод-вывод завершён\n"
637 " запрос 1 (дескриптор 4): выполняется\n"
638 "aio_error():\n"
639 " запрос 1 (дескриптор 4): выполняется\n"
640 "B<x>\n"
641 "Получен сигнал завершения ввода-вывода\n"
642 "aio_error():\n"
643 " запрос 1 (дескриптор 4): ввод-вывод завершён\n"
644 "Завершены все запросы ввода-вывода\n"
645 "aio_return():\n"
646 " запрос 0 (дескриптор 3): 4\n"
647 " запрос 1 (дескриптор 4): 2\n"
648
649 #. type: SS
650 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
651 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
652 #, no-wrap
653 msgid "Program source"
654 msgstr "Исходный код программы"
655
656 #. type: Plain text
657 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
658 #: opensuse-tumbleweed
659 #, no-wrap
660 msgid ""
661 "#include E<lt>err.hE<gt>\n"
662 "#include E<lt>fcntl.hE<gt>\n"
663 "#include E<lt>stdlib.hE<gt>\n"
664 "#include E<lt>unistd.hE<gt>\n"
665 "#include E<lt>stdio.hE<gt>\n"
666 "#include E<lt>errno.hE<gt>\n"
667 "#include E<lt>aio.hE<gt>\n"
668 "#include E<lt>signal.hE<gt>\n"
669 "\\&\n"
670 "#define BUF_SIZE 20 /* Size of buffers for read operations */\n"
671 "\\&\n"
672 "struct ioRequest { /* Application-defined structure for tracking\n"
673 " I/O requests */\n"
674 " int reqNum;\n"
675 " int status;\n"
676 " struct aiocb *aiocbp;\n"
677 "};\n"
678 "\\&\n"
679 "static volatile sig_atomic_t gotSIGQUIT = 0;\n"
680 " /* On delivery of SIGQUIT, we attempt to\n"
681 " cancel all outstanding I/O requests */\n"
682 "\\&\n"
683 "static void /* Handler for SIGQUIT */\n"
684 "quitHandler(int sig)\n"
685 "{\n"
686 " gotSIGQUIT = 1;\n"
687 "}\n"
688 "\\&\n"
689 "#define IO_SIGNAL SIGUSR1 /* Signal used to notify I/O completion */\n"
690 "\\&\n"
691 "static void /* Handler for I/O completion signal */\n"
692 "aioSigHandler(int sig, siginfo_t *si, void *ucontext)\n"
693 "{\n"
694 " if (si-E<gt>si_code == SI_ASYNCIO) {\n"
695 " write(STDOUT_FILENO, \"I/O completion signal received\\[rs]n\", 31);\n"
696 "\\&\n"
697 " /* The corresponding ioRequest structure would be available as\n"
698 " struct ioRequest *ioReq = si-E<gt>si_value.sival_ptr;\n"
699 " and the file descriptor would then be available via\n"
700 " ioReq-E<gt>aiocbp-E<gt>aio_fildes */\n"
701 " }\n"
702 "}\n"
703 "\\&\n"
704 "int\n"
705 "main(int argc, char *argv[])\n"
706 "{\n"
707 " struct sigaction sa;\n"
708 " int s;\n"
709 " int numReqs; /* Total number of queued I/O requests */\n"
710 " int openReqs; /* Number of I/O requests still in progress */\n"
711 "\\&\n"
712 " if (argc E<lt> 2) {\n"
713 " fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt> E<lt>pathnameE<gt>...\\[rs]n\",\n"
714 " argv[0]);\n"
715 " exit(EXIT_FAILURE);\n"
716 " }\n"
717 "\\&\n"
718 " numReqs = argc - 1;\n"
719 "\\&\n"
720 " /* Allocate our arrays. */\n"
721 "\\&\n"
722 " struct ioRequest *ioList = calloc(numReqs, sizeof(*ioList));\n"
723 " if (ioList == NULL)\n"
724 " err(EXIT_FAILURE, \"calloc\");\n"
725 "\\&\n"
726 " struct aiocb *aiocbList = calloc(numReqs, sizeof(*aiocbList));\n"
727 " if (aiocbList == NULL)\n"
728 " err(EXIT_FAILURE, \"calloc\");\n"
729 "\\&\n"
730 " /* Establish handlers for SIGQUIT and the I/O completion signal. */\n"
731 "\\&\n"
732 " sa.sa_flags = SA_RESTART;\n"
733 " sigemptyset(&sa.sa_mask);\n"
734 "\\&\n"
735 " sa.sa_handler = quitHandler;\n"
736 " if (sigaction(SIGQUIT, &sa, NULL) == -1)\n"
737 " err(EXIT_FAILURE, \"sigaction\");\n"
738 "\\&\n"
739 " sa.sa_flags = SA_RESTART | SA_SIGINFO;\n"
740 " sa.sa_sigaction = aioSigHandler;\n"
741 " if (sigaction(IO_SIGNAL, &sa, NULL) == -1)\n"
742 " err(EXIT_FAILURE, \"sigaction\");\n"
743 "\\&\n"
744 " /* Open each file specified on the command line, and queue\n"
745 " a read request on the resulting file descriptor. */\n"
746 "\\&\n"
747 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
748 " ioList[j].reqNum = j;\n"
749 " ioList[j].status = EINPROGRESS;\n"
750 " ioList[j].aiocbp = &aiocbList[j];\n"
751 "\\&\n"
752 " ioList[j].aiocbp-E<gt>aio_fildes = open(argv[j + 1], O_RDONLY);\n"
753 " if (ioList[j].aiocbp-E<gt>aio_fildes == -1)\n"
754 " err(EXIT_FAILURE, \"open\");\n"
755 " printf(\"opened %s on descriptor %d\\[rs]n\", argv[j + 1],\n"
756 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
757 "\\&\n"
758 " ioList[j].aiocbp-E<gt>aio_buf = malloc(BUF_SIZE);\n"
759 " if (ioList[j].aiocbp-E<gt>aio_buf == NULL)\n"
760 " err(EXIT_FAILURE, \"malloc\");\n"
761 "\\&\n"
762 " ioList[j].aiocbp-E<gt>aio_nbytes = BUF_SIZE;\n"
763 " ioList[j].aiocbp-E<gt>aio_reqprio = 0;\n"
764 " ioList[j].aiocbp-E<gt>aio_offset = 0;\n"
765 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_notify = SIGEV_SIGNAL;\n"
766 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_signo = IO_SIGNAL;\n"
767 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_value.sival_ptr =\n"
768 " &ioList[j];\n"
769 "\\&\n"
770 " s = aio_read(ioList[j].aiocbp);\n"
771 " if (s == -1)\n"
772 " err(EXIT_FAILURE, \"aio_read\");\n"
773 " }\n"
774 "\\&\n"
775 " openReqs = numReqs;\n"
776 "\\&\n"
777 " /* Loop, monitoring status of I/O requests. */\n"
778 "\\&\n"
779 " while (openReqs E<gt> 0) {\n"
780 " sleep(3); /* Delay between each monitoring step */\n"
781 "\\&\n"
782 " if (gotSIGQUIT) {\n"
783 "\\&\n"
784 " /* On receipt of SIGQUIT, attempt to cancel each of the\n"
785 " outstanding I/O requests, and display status returned\n"
786 " from the cancelation requests. */\n"
787 "\\&\n"
788 " printf(\"got SIGQUIT; canceling I/O requests: \\[rs]n\");\n"
789 "\\&\n"
790 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
791 " if (ioList[j].status == EINPROGRESS) {\n"
792 " printf(\" Request %zu on descriptor %d:\", j,\n"
793 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
794 " s = aio_cancel(ioList[j].aiocbp-E<gt>aio_fildes,\n"
795 " ioList[j].aiocbp);\n"
796 " if (s == AIO_CANCELED)\n"
797 " printf(\"I/O canceled\\[rs]n\");\n"
798 " else if (s == AIO_NOTCANCELED)\n"
799 " printf(\"I/O not canceled\\[rs]n\");\n"
800 " else if (s == AIO_ALLDONE)\n"
801 " printf(\"I/O all done\\[rs]n\");\n"
802 " else\n"
803 " perror(\"aio_cancel\");\n"
804 " }\n"
805 " }\n"
806 "\\&\n"
807 " gotSIGQUIT = 0;\n"
808 " }\n"
809 "\\&\n"
810 " /* Check the status of each I/O request that is still\n"
811 " in progress. */\n"
812 "\\&\n"
813 " printf(\"aio_error():\\[rs]n\");\n"
814 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
815 " if (ioList[j].status == EINPROGRESS) {\n"
816 " printf(\" for request %zu (descriptor %d): \",\n"
817 " j, ioList[j].aiocbp-E<gt>aio_fildes);\n"
818 " ioList[j].status = aio_error(ioList[j].aiocbp);\n"
819 "\\&\n"
820 " switch (ioList[j].status) {\n"
821 " case 0:\n"
822 " printf(\"I/O succeeded\\[rs]n\");\n"
823 " break;\n"
824 " case EINPROGRESS:\n"
825 " printf(\"In progress\\[rs]n\");\n"
826 " break;\n"
827 " case ECANCELED:\n"
828 " printf(\"Canceled\\[rs]n\");\n"
829 " break;\n"
830 " default:\n"
831 " perror(\"aio_error\");\n"
832 " break;\n"
833 " }\n"
834 "\\&\n"
835 " if (ioList[j].status != EINPROGRESS)\n"
836 " openReqs--;\n"
837 " }\n"
838 " }\n"
839 " }\n"
840 "\\&\n"
841 " printf(\"All I/O requests completed\\[rs]n\");\n"
842 "\\&\n"
843 " /* Check status return of all I/O requests. */\n"
844 "\\&\n"
845 " printf(\"aio_return():\\[rs]n\");\n"
846 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
847 " ssize_t s;\n"
848 "\\&\n"
849 " s = aio_return(ioList[j].aiocbp);\n"
850 " printf(\" for request %zu (descriptor %d): %zd\\[rs]n\",\n"
851 " j, ioList[j].aiocbp-E<gt>aio_fildes, s);\n"
852 " }\n"
853 "\\&\n"
854 " exit(EXIT_SUCCESS);\n"
855 "}\n"
856 msgstr ""
857
858 #. type: SH
859 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
860 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
861 #, no-wrap
862 msgid "SEE ALSO"
863 msgstr "СМОТРИТЕ ТАКЖЕ"
864
865 #. type: Plain text
866 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
867 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
868 msgid ""
869 "B<io_cancel>(2), B<io_destroy>(2), B<io_getevents>(2), B<io_setup>(2), "
870 "B<io_submit>(2), B<aio_cancel>(3), B<aio_error>(3), B<aio_init>(3), "
871 "B<aio_read>(3), B<aio_return>(3), B<aio_write>(3), B<lio_listio>(3)"
872 msgstr ""
873 "B<io_cancel>(2), B<io_destroy>(2), B<io_getevents>(2), B<io_setup>(2), "
874 "B<io_submit>(2), B<aio_cancel>(3), B<aio_error>(3), B<aio_init>(3), "
875 "B<aio_read>(3), B<aio_return>(3), B<aio_write>(3), B<lio_listio>(3)"
876
877 #. type: Plain text
878 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
879 #: opensuse-tumbleweed
880 #, fuzzy
881 #| msgid ""
882 #| "\"Asynchronous I/O Support in Linux 2.5\", Bhattacharya, Pratt, "
883 #| "Pulavarty, and Morgan, Proceedings of the Linux Symposium, 2003, E<.UR "
884 #| "https://www.kernel.org/doc/ols/2003/ols2003-pages-351-366.pdf> E<.UE>"
885 msgid ""
886 "\"Asynchronous I/O Support in Linux 2.5\", Bhattacharya, Pratt, Pulavarty, "
887 "and Morgan, Proceedings of the Linux Symposium, 2003, E<.UR https:\\://"
888 "www.kernel.org/doc/ols/2003/ols2003-pages-351-366.pdf> E<.UE>"
889 msgstr ""
890 "«Asynchronous I/O Support in Linux 2.5», Bhattacharya, Pratt, Pulavarty, and "
891 "Morgan, Proceedings of the Linux Symposium, 2003, E<.UR https://"
892 "www.kernel.org/doc/ols/2003/ols2003-pages-351-366.pdf> E<.UE>"
893
894 #. type: TH
895 #: debian-trixie fedora-44 fedora-rawhide
896 #, no-wrap
897 msgid "2024-06-15"
898 msgstr "15 июня 2024 г."
899
900 #. type: TH
901 #: debian-trixie
902 #, no-wrap
903 msgid "Linux man-pages 6.9.1"
904 msgstr "Страницы руководства Linux 6.9.1"
905
906 #. type: Plain text
907 #: debian-trixie fedora-44 fedora-rawhide
908 #, no-wrap
909 msgid ""
910 "$ B<./a.out /dev/stdin /dev/stdin>\n"
911 "opened /dev/stdin on descriptor 3\n"
912 "opened /dev/stdin on descriptor 4\n"
913 "aio_error():\n"
914 " for request 0 (descriptor 3): In progress\n"
915 " for request 1 (descriptor 4): In progress\n"
916 "B<abc>\n"
917 "I/O completion signal received\n"
918 "aio_error():\n"
919 " for request 0 (descriptor 3): I/O succeeded\n"
920 " for request 1 (descriptor 4): In progress\n"
921 "aio_error():\n"
922 " for request 1 (descriptor 4): In progress\n"
923 "B<x>\n"
924 "I/O completion signal received\n"
925 "aio_error():\n"
926 " for request 1 (descriptor 4): I/O succeeded\n"
927 "All I/O requests completed\n"
928 "aio_return():\n"
929 " for request 0 (descriptor 3): 4\n"
930 " for request 1 (descriptor 4): 2\n"
931 msgstr ""
932 "$ B<./a.out /dev/stdin /dev/stdin>\n"
933 "открыт /dev/stdin в дескрипторе 3\n"
934 "открыт /dev/stdin в дескрипторе 4\n"
935 "aio_error():\n"
936 " запрос 0 (дескриптор 3): выполняется\n"
937 " запрос 1 (дескриптор 4): выполняется\n"
938 "B<abc>\n"
939 "Получен сигнал завершения ввода-вывода\n"
940 "aio_error():\n"
941 " запрос 0 (дескриптор 3): ввод-вывод завершён\n"
942 " запрос 1 (дескриптор 4): выполняется\n"
943 "aio_error():\n"
944 " запрос 1 (дескриптор 4): выполняется\n"
945 "B<x>\n"
946 "Получен сигнал завершения ввода-вывода\n"
947 "aio_error():\n"
948 " запрос 1 (дескриптор 4): ввод-вывод завершён\n"
949 "Завершены все запросы ввода-вывода\n"
950 "aio_return():\n"
951 " запрос 0 (дескриптор 3): 4\n"
952 " запрос 1 (дескриптор 4): 2\n"
953
954 #. type: Plain text
955 #: debian-trixie fedora-44 fedora-rawhide
956 #, no-wrap
957 msgid ""
958 "#include E<lt>fcntl.hE<gt>\n"
959 "#include E<lt>stdlib.hE<gt>\n"
960 "#include E<lt>unistd.hE<gt>\n"
961 "#include E<lt>stdio.hE<gt>\n"
962 "#include E<lt>errno.hE<gt>\n"
963 "#include E<lt>aio.hE<gt>\n"
964 "#include E<lt>signal.hE<gt>\n"
965 "\\&\n"
966 "#define BUF_SIZE 20 /* Size of buffers for read operations */\n"
967 "\\&\n"
968 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
969 "\\&\n"
970 "struct ioRequest { /* Application-defined structure for tracking\n"
971 " I/O requests */\n"
972 " int reqNum;\n"
973 " int status;\n"
974 " struct aiocb *aiocbp;\n"
975 "};\n"
976 "\\&\n"
977 "static volatile sig_atomic_t gotSIGQUIT = 0;\n"
978 " /* On delivery of SIGQUIT, we attempt to\n"
979 " cancel all outstanding I/O requests */\n"
980 "\\&\n"
981 "static void /* Handler for SIGQUIT */\n"
982 "quitHandler(int sig)\n"
983 "{\n"
984 " gotSIGQUIT = 1;\n"
985 "}\n"
986 "\\&\n"
987 "#define IO_SIGNAL SIGUSR1 /* Signal used to notify I/O completion */\n"
988 "\\&\n"
989 "static void /* Handler for I/O completion signal */\n"
990 "aioSigHandler(int sig, siginfo_t *si, void *ucontext)\n"
991 "{\n"
992 " if (si-E<gt>si_code == SI_ASYNCIO) {\n"
993 " write(STDOUT_FILENO, \"I/O completion signal received\\[rs]n\", 31);\n"
994 "\\&\n"
995 " /* The corresponding ioRequest structure would be available as\n"
996 " struct ioRequest *ioReq = si-E<gt>si_value.sival_ptr;\n"
997 " and the file descriptor would then be available via\n"
998 " ioReq-E<gt>aiocbp-E<gt>aio_fildes */\n"
999 " }\n"
1000 "}\n"
1001 "\\&\n"
1002 "int\n"
1003 "main(int argc, char *argv[])\n"
1004 "{\n"
1005 " struct sigaction sa;\n"
1006 " int s;\n"
1007 " int numReqs; /* Total number of queued I/O requests */\n"
1008 " int openReqs; /* Number of I/O requests still in progress */\n"
1009 "\\&\n"
1010 " if (argc E<lt> 2) {\n"
1011 " fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt> E<lt>pathnameE<gt>...\\[rs]n\",\n"
1012 " argv[0]);\n"
1013 " exit(EXIT_FAILURE);\n"
1014 " }\n"
1015 "\\&\n"
1016 " numReqs = argc - 1;\n"
1017 "\\&\n"
1018 " /* Allocate our arrays. */\n"
1019 "\\&\n"
1020 " struct ioRequest *ioList = calloc(numReqs, sizeof(*ioList));\n"
1021 " if (ioList == NULL)\n"
1022 " errExit(\"calloc\");\n"
1023 "\\&\n"
1024 " struct aiocb *aiocbList = calloc(numReqs, sizeof(*aiocbList));\n"
1025 " if (aiocbList == NULL)\n"
1026 " errExit(\"calloc\");\n"
1027 "\\&\n"
1028 " /* Establish handlers for SIGQUIT and the I/O completion signal. */\n"
1029 "\\&\n"
1030 " sa.sa_flags = SA_RESTART;\n"
1031 " sigemptyset(&sa.sa_mask);\n"
1032 "\\&\n"
1033 " sa.sa_handler = quitHandler;\n"
1034 " if (sigaction(SIGQUIT, &sa, NULL) == -1)\n"
1035 " errExit(\"sigaction\");\n"
1036 "\\&\n"
1037 " sa.sa_flags = SA_RESTART | SA_SIGINFO;\n"
1038 " sa.sa_sigaction = aioSigHandler;\n"
1039 " if (sigaction(IO_SIGNAL, &sa, NULL) == -1)\n"
1040 " errExit(\"sigaction\");\n"
1041 "\\&\n"
1042 " /* Open each file specified on the command line, and queue\n"
1043 " a read request on the resulting file descriptor. */\n"
1044 "\\&\n"
1045 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1046 " ioList[j].reqNum = j;\n"
1047 " ioList[j].status = EINPROGRESS;\n"
1048 " ioList[j].aiocbp = &aiocbList[j];\n"
1049 "\\&\n"
1050 " ioList[j].aiocbp-E<gt>aio_fildes = open(argv[j + 1], O_RDONLY);\n"
1051 " if (ioList[j].aiocbp-E<gt>aio_fildes == -1)\n"
1052 " errExit(\"open\");\n"
1053 " printf(\"opened %s on descriptor %d\\[rs]n\", argv[j + 1],\n"
1054 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
1055 "\\&\n"
1056 " ioList[j].aiocbp-E<gt>aio_buf = malloc(BUF_SIZE);\n"
1057 " if (ioList[j].aiocbp-E<gt>aio_buf == NULL)\n"
1058 " errExit(\"malloc\");\n"
1059 "\\&\n"
1060 " ioList[j].aiocbp-E<gt>aio_nbytes = BUF_SIZE;\n"
1061 " ioList[j].aiocbp-E<gt>aio_reqprio = 0;\n"
1062 " ioList[j].aiocbp-E<gt>aio_offset = 0;\n"
1063 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_notify = SIGEV_SIGNAL;\n"
1064 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_signo = IO_SIGNAL;\n"
1065 " ioList[j].aiocbp-E<gt>aio_sigevent.sigev_value.sival_ptr =\n"
1066 " &ioList[j];\n"
1067 "\\&\n"
1068 " s = aio_read(ioList[j].aiocbp);\n"
1069 " if (s == -1)\n"
1070 " errExit(\"aio_read\");\n"
1071 " }\n"
1072 "\\&\n"
1073 " openReqs = numReqs;\n"
1074 "\\&\n"
1075 " /* Loop, monitoring status of I/O requests. */\n"
1076 "\\&\n"
1077 " while (openReqs E<gt> 0) {\n"
1078 " sleep(3); /* Delay between each monitoring step */\n"
1079 "\\&\n"
1080 " if (gotSIGQUIT) {\n"
1081 "\\&\n"
1082 " /* On receipt of SIGQUIT, attempt to cancel each of the\n"
1083 " outstanding I/O requests, and display status returned\n"
1084 " from the cancelation requests. */\n"
1085 "\\&\n"
1086 " printf(\"got SIGQUIT; canceling I/O requests: \\[rs]n\");\n"
1087 "\\&\n"
1088 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1089 " if (ioList[j].status == EINPROGRESS) {\n"
1090 " printf(\" Request %zu on descriptor %d:\", j,\n"
1091 " ioList[j].aiocbp-E<gt>aio_fildes);\n"
1092 " s = aio_cancel(ioList[j].aiocbp-E<gt>aio_fildes,\n"
1093 " ioList[j].aiocbp);\n"
1094 " if (s == AIO_CANCELED)\n"
1095 " printf(\"I/O canceled\\[rs]n\");\n"
1096 " else if (s == AIO_NOTCANCELED)\n"
1097 " printf(\"I/O not canceled\\[rs]n\");\n"
1098 " else if (s == AIO_ALLDONE)\n"
1099 " printf(\"I/O all done\\[rs]n\");\n"
1100 " else\n"
1101 " perror(\"aio_cancel\");\n"
1102 " }\n"
1103 " }\n"
1104 "\\&\n"
1105 " gotSIGQUIT = 0;\n"
1106 " }\n"
1107 "\\&\n"
1108 " /* Check the status of each I/O request that is still\n"
1109 " in progress. */\n"
1110 "\\&\n"
1111 " printf(\"aio_error():\\[rs]n\");\n"
1112 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1113 " if (ioList[j].status == EINPROGRESS) {\n"
1114 " printf(\" for request %zu (descriptor %d): \",\n"
1115 " j, ioList[j].aiocbp-E<gt>aio_fildes);\n"
1116 " ioList[j].status = aio_error(ioList[j].aiocbp);\n"
1117 "\\&\n"
1118 " switch (ioList[j].status) {\n"
1119 " case 0:\n"
1120 " printf(\"I/O succeeded\\[rs]n\");\n"
1121 " break;\n"
1122 " case EINPROGRESS:\n"
1123 " printf(\"In progress\\[rs]n\");\n"
1124 " break;\n"
1125 " case ECANCELED:\n"
1126 " printf(\"Canceled\\[rs]n\");\n"
1127 " break;\n"
1128 " default:\n"
1129 " perror(\"aio_error\");\n"
1130 " break;\n"
1131 " }\n"
1132 "\\&\n"
1133 " if (ioList[j].status != EINPROGRESS)\n"
1134 " openReqs--;\n"
1135 " }\n"
1136 " }\n"
1137 " }\n"
1138 "\\&\n"
1139 " printf(\"All I/O requests completed\\[rs]n\");\n"
1140 "\\&\n"
1141 " /* Check status return of all I/O requests. */\n"
1142 "\\&\n"
1143 " printf(\"aio_return():\\[rs]n\");\n"
1144 " for (size_t j = 0; j E<lt> numReqs; j++) {\n"
1145 " ssize_t s;\n"
1146 "\\&\n"
1147 " s = aio_return(ioList[j].aiocbp);\n"
1148 " printf(\" for request %zu (descriptor %d): %zd\\[rs]n\",\n"
1149 " j, ioList[j].aiocbp-E<gt>aio_fildes, s);\n"
1150 " }\n"
1151 "\\&\n"
1152 " exit(EXIT_SUCCESS);\n"
1153 "}\n"
1154 msgstr ""
1155
1156 #. type: Plain text
1157 #: debian-trixie fedora-44 fedora-rawhide
1158 msgid ""
1159 "\"Asynchronous I/O Support in Linux 2.5\", Bhattacharya, Pratt, Pulavarty, "
1160 "and Morgan, Proceedings of the Linux Symposium, 2003, E<.UR https://"
1161 "www.kernel.org/doc/ols/2003/ols2003-pages-351-366.pdf> E<.UE>"
1162 msgstr ""
1163 "«Asynchronous I/O Support in Linux 2.5», Bhattacharya, Pratt, Pulavarty, and "
1164 "Morgan, Proceedings of the Linux Symposium, 2003, E<.UR https://"
1165 "www.kernel.org/doc/ols/2003/ols2003-pages-351-366.pdf> E<.UE>"
1166
1167 #. type: TH
1168 #: fedora-44 fedora-rawhide
1169 #, no-wrap
1170 msgid "Linux man-pages 6.13"
1171 msgstr "Страницы руководства Linux 6.13"
1172
1173 #. type: TH
1174 #: mageia-cauldron
1175 #, no-wrap
1176 msgid "Linux man-pages 6.17"
1177 msgstr "Страницы руководства Linux 6.17"
1178
1179 #. type: TH
1180 #: opensuse-leap-16-1 opensuse-tumbleweed
1181 #, no-wrap
1182 msgid "Linux man-pages (unreleased)"
1183 msgstr "Страницы руководства Linux (не выпущены)"