1LIO_LISTIO(3) Linux Programmer's Manual LIO_LISTIO(3)
2
3
4
6 lio_listio - initiate a list of I/O requests
7
9 #include <aio.h>
10
11 int lio_listio(int mode, struct aiocb *restrict const aiocb_list[restrict],
12 int nitems, struct sigevent *restrict sevp);
13
14 Link with -lrt.
15
17 The lio_listio() function initiates the list of I/O operations de‐
18 scribed by the array aiocb_list.
19
20 The mode operation has one of the following values:
21
22 LIO_WAIT
23 The call blocks until all operations are complete. The sevp ar‐
24 gument is ignored.
25
26 LIO_NOWAIT
27 The I/O operations are queued for processing and the call re‐
28 turns immediately. When all of the I/O operations complete,
29 asynchronous notification occurs, as specified by the sevp argu‐
30 ment; see sigevent(7) for details. If sevp is NULL, no asyn‐
31 chronous notification occurs.
32
33 The aiocb_list argument is an array of pointers to aiocb structures
34 that describe I/O operations. These operations are executed in an un‐
35 specified order. The nitems argument specifies the size of the array
36 aiocb_list. Null pointers in aiocb_list are ignored.
37
38 In each control block in aiocb_list, the aio_lio_opcode field specifies
39 the I/O operation to be initiated, as follows:
40
41 LIO_READ
42 Initiate a read operation. The operation is queued as for a
43 call to aio_read(3) specifying this control block.
44
45 LIO_WRITE
46 Initiate a write operation. The operation is queued as for a
47 call to aio_write(3) specifying this control block.
48
49 LIO_NOP
50 Ignore this control block.
51
52 The remaining fields in each control block have the same meanings as
53 for aio_read(3) and aio_write(3). The aio_sigevent fields of each con‐
54 trol block can be used to specify notifications for the individual I/O
55 operations (see sigevent(7)).
56
58 If mode is LIO_NOWAIT, lio_listio() returns 0 if all I/O operations are
59 successfully queued. Otherwise, -1 is returned, and errno is set to
60 indicate the error.
61
62 If mode is LIO_WAIT, lio_listio() returns 0 when all of the I/O opera‐
63 tions have completed successfully. Otherwise, -1 is returned, and er‐
64 rno is set to indicate the error.
65
66 The return status from lio_listio() provides information only about the
67 call itself, not about the individual I/O operations. One or more of
68 the I/O operations may fail, but this does not prevent other operations
69 completing. The status of individual I/O operations in aiocb_list can
70 be determined using aio_error(3). When an operation has completed, its
71 return status can be obtained using aio_return(3). Individual I/O op‐
72 erations can fail for the reasons described in aio_read(3) and
73 aio_write(3).
74
76 The lio_listio() function may fail for the following reasons:
77
78 EAGAIN Out of resources.
79
80 EAGAIN The