2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved.
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\" This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH LIO_LISTIO 3C "Feb 5, 2008"
14 lio_listio \- list directed I/O
20 \fBint\fR \fBlio_listio\fR(\fBint\fR \fImode\fR, \fBstruct aiocb *restrict const\fR \fIlist\fR[],
21 \fBint\fR \fInent\fR, \fBstruct sigevent *restrict\fR \fIsig\fR);
27 The \fBlio_listio()\fR function allows the calling process, LWP, or thread, to
28 initiate a list of I/O requests within a single function call.
31 The \fImode\fR argument takes one of the values \fBLIO_WAIT\fR or
32 \fBLIO_NOWAIT\fR declared in <\fBaio.h\fR> and determines whether the function
33 returns when the I/O operations have been completed, or as soon as the
34 operations have been queued. If the \fImode\fR argument is \fBLIO_WAIT\fR, the
35 function waits until all I/O is complete and the \fIsig\fR argument is ignored.
38 If the \fImode\fR argument is \fBLIO_NOWAIT\fR, the function returns
39 immediately, and asynchronous notification occurs, according to the \fIsig\fR
40 argument, when all the I/O operations complete. If \fIsig\fR is \fINULL\fR, no
41 asynchronous notification occurs. If \fIsig\fR is not \fINULL\fR, asynchronous
42 notification occurs as specified in \fBsignal.h\fR(3HEAD) when all the requests
43 in \fIlist\fR have completed.
46 The I/O requests enumerated by \fIlist\fR are submitted in an unspecified
50 The \fIlist\fR argument is an array of pointers to \fBaiocb\fR structures. The
51 array contains \fInent\fR elements. The array may contain null elements, which
55 The \fIaio_lio_opcode\fR field of each \fBaiocb\fR structure specifies the
56 operation to be performed. The supported operations are \fBLIO_READ\fR,
57 \fBLIO_WRITE\fR, and \fBLIO_NOP\fR; these symbols are defined in <\fBaio.h\fR>.
58 The \fBLIO_NOP\fR operation causes the list entry to be ignored. If the
59 \fIaio_lio_opcode\fR element is equal to \fBLIO_READ,\fR then an I/O operation
60 is submitted as if by a call to \fBaio_read\fR(3C) with the \fIaiocbp\fR equal
61 to the address of the \fBaiocb\fR structure. If the \fIaio_lio_opcode\fR
62 element is equal to \fBLIO_WRITE\fR, then an I/O operation is submitted as if
63 by a call to \fBaio_write\fR(3C) with the \fIaiocbp\fR equal to the address of
64 the \fBaiocb\fR structure.
67 The \fIaio_fildes\fR member specifies the file descriptor on which the
68 operation is to be performed.
71 The \fIaio_buf\fR member specifies the address of the buffer to or from which
72 the data is to be transferred.
75 The \fIaio_nbytes\fR member specifies the number of bytes of data to be
79 The members of the \fIaiocb\fR structure further describe the I/O operation to
80 be performed, in a manner identical to that of the corresponding \fBaiocb\fR
81 structure when used by the \fBaio_read\fR(3C) and \fBaio_write\fR(3C)
85 The \fInent\fR argument specifies how many elements are members of the list,
86 that is, the length of the array.
89 The behavior of this function is altered according to the definitions of
90 synchronized I/O data integrity completion and synchronized I/O file integrity
91 completion if synchronized I/O is enabled on the file associated with
92 \fBaio_fildes\fR. See \fBfcntl.h\fR(3HEAD) definitions of \fBO_DSYNC\fR and
96 For regular files, no data transfer will occur past the offset maximum
97 established in the open file description associated with
98 \fIaiocbp\fR\(->\fBaio_fildes\fR.
102 If the \fImode\fR argument has the value \fBLIO_NOWAIT\fR, and the I/O
103 operations are successfully queued, \fBlio_listio()\fR returns \fB0\fR;
104 otherwise, it returns \fB\(mi1\fR, and sets \fBerrno\fR to indicate the error.
107 If the \fImode\fR argument has the value \fBLIO_WAIT\fR, and all the
108 indicated I/O has completed successfully, \fBlio_listio()\fR returns \fB0\fR;
109 otherwise, it returns \fB\(mi1\fR, and sets \fBerrno\fR to indicate the error.
112 In either case, the return value only indicates the success or failure of the
113 \fBlio_listio()\fR call itself, not the status of the individual I/O requests.
114 In some cases, one or more of the I/O requests contained in the list may fail.
115 Failure of an individual request does not prevent completion of any other
116 individual request. To determine the outcome of each I/O request, the
117 application must examine the error status associated with each \fIaiocb\fR
118 control block. Each error status so returned is identical to that returned as
119 a result of an \fBaio_read\fR(3C) or \fBaio_write\fR(3C) function.
123 The \fBlio_listio()\fR function will fail if:
130 The resources necessary to queue all the I/O requests were not available. The
131 error status for each request is recorded in the \fBaio_error\fR member of the
132 corresponding \fBaiocb\fR structure, and can be retrieved using
142 The number of entries indicated by \fInent\fR would cause the system-wide limit
143 \fBAIO_MAX\fR to be exceeded.
152 The \fImode\fR argument is an improper value, or the value of \fInent\fR is
153 greater than \fBAIO_LISTIO_MAX\fR.
162 A signal was delivered while waiting for all I/O requests to complete during an
163 \fBLIO_WAIT\fR operation. Note that, since each I/O operation invoked by
164 \fBlio_listio()\fR may possibly provoke a signal when it completes, this error
165 return may be caused by the completion of one (or more) of the very I/O
166 operations being awaited. Outstanding I/O requests are not canceled, and the
167 application can use \fBaio_fsync\fR(3C) to determine if any request was
168 initiated; \fBaio_return\fR(3C) to determine if any request has completed; or
169 \fBaio_error\fR(3C) to determine if any request was canceled.
178 One or more of the individual I/O operations failed. The application can use
179 \fBaio_error\fR(3C) to check the error status for each \fBaiocb\fR structure to
180 determine the individual request(s) that failed.
185 In addition to the errors returned by the \fBlio_listio()\fR function, if the
186 \fBlio_listio()\fR function succeeds or fails with errors of \fBEAGAIN\fR,
187 \fBEINTR\fR, or \fBEIO\fR, then some of the I/O specified by the list may have
188 been initiated. If the \fBlio_listio()\fR function fails with an error code
189 other than \fBEAGAIN\fR, \fBEINTR\fR, or \fBEIO\fR, no operations from the list
190 have been initiated. The I/O operation indicated by each list element can
191 encounter errors specific to the individual read or write function being
192 performed. In this event, the error status for each \fBaiocb\fR control block
193 contains the associated error code. The error codes that can be set are the
194 same as would be set by a \fBread\fR(2) or \fBwrite\fR(2) function, with the
195 following additional error codes possible:
202 The requested I/O operation was not queued due to resource limitations.
208 \fB\fBECANCELED\fR\fR
211 The requested I/O was canceled before the I/O completed due to an explicit
212 \fBaio_cancel\fR(3C) request.
221 The \fIaiocbp\fR\(->\fBaio_lio_opcode\fR is \fBLIO_WRITE\fR, the file is a
222 regular file, \fIaiocbp\fR\(->\fBaio_nbytes\fR is greater than 0, and the
223 \fIaiocbp\fR\(->\fBaio_offset\fR is greater than or equal to the offset maximum
224 in the open file description associated with \fIaiocbp\fR\(->\fBaio_fildes.\fR
230 \fB\fBEINPROGRESS\fR\fR
233 The requested I/O is in progress.
239 \fB\fBEOVERFLOW\fR\fR
242 The \fIaiocbp\fR\(->\fBaio_lio_opcode\fR is \fBLIO_READ\fR, the file is a
243 regular file, \fIaiocbp\fR\(->\fBaio_nbytes\fR is greater than 0, and the
244 \fIaiocbp\fR\(->\fBaio_offset\fR is before the end-of-file and is greater than
245 or equal to the offset maximum in the open file description associated with
246 \fIaiocbp\fR\(->\fBaio_fildes.\fR
252 The \fBlio_listio()\fR function has a transitional interface for 64-bit file
253 offsets. See \fBlf64\fR(5).
257 See \fBattributes\fR(5) for descriptions of the following attributes:
265 ATTRIBUTE TYPE ATTRIBUTE VALUE
267 Interface Stability Committed
271 Standard See \fBstandards\fR(5).
277 \fBclose\fR(2), \fBexec\fR(2), \fBexit\fR(2), \fBfork\fR(2), \fBlseek\fR(2),
278 \fBread\fR(2), \fBwrite\fR(2), \fBaio_cancel\fR(3C), \fBaio_error\fR(3C),
279 \fBaio_fsync\fR(3C), \fBaio_read\fR(3C), \fBaio_return\fR(3C),
280 \fBaio_write\fR(3C), \fBaio.h\fR(3HEAD), \fBfcntl.h\fR(3HEAD),
281 \fBsiginfo.h\fR(3HEAD), \fBsignal.h\fR(3HEAD), \fBattributes\fR(5),
282 \fBlf64\fR(5), \fBstandards\fR(5)