18269e767SBrooks Davis.\" Copyright (c) 2003 Tim J. Robbins 28269e767SBrooks Davis.\" All rights reserved. 38269e767SBrooks Davis.\" 48269e767SBrooks Davis.\" Redistribution and use in source and binary forms, with or without 58269e767SBrooks Davis.\" modification, are permitted provided that the following conditions 68269e767SBrooks Davis.\" are met: 78269e767SBrooks Davis.\" 1. Redistributions of source code must retain the above copyright 88269e767SBrooks Davis.\" notice, this list of conditions and the following disclaimer. 98269e767SBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright 108269e767SBrooks Davis.\" notice, this list of conditions and the following disclaimer in the 118269e767SBrooks Davis.\" documentation and/or other materials provided with the distribution. 128269e767SBrooks Davis.\" 138269e767SBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 148269e767SBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 158269e767SBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 168269e767SBrooks Davis.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 178269e767SBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 188269e767SBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 198269e767SBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 208269e767SBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 218269e767SBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 228269e767SBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 238269e767SBrooks Davis.\" SUCH DAMAGE. 248269e767SBrooks Davis.\" 25*e4b7bbd6SKonstantin Belousov.Dd January 13, 2024 268269e767SBrooks Davis.Dt LIO_LISTIO 2 278269e767SBrooks Davis.Os 288269e767SBrooks Davis.Sh NAME 298269e767SBrooks Davis.Nm lio_listio 308269e767SBrooks Davis.Nd "list directed I/O (REALTIME)" 318269e767SBrooks Davis.Sh LIBRARY 328269e767SBrooks Davis.Lb libc 338269e767SBrooks Davis.Sh SYNOPSIS 348269e767SBrooks Davis.In aio.h 358269e767SBrooks Davis.Ft int 368269e767SBrooks Davis.Fo lio_listio 378269e767SBrooks Davis.Fa "int mode" 388269e767SBrooks Davis.Fa "struct aiocb * const list[]" 398269e767SBrooks Davis.Fa "int nent" 408269e767SBrooks Davis.Fa "struct sigevent *sig" 418269e767SBrooks Davis.Fc 428269e767SBrooks Davis.Sh DESCRIPTION 438269e767SBrooks DavisThe 448269e767SBrooks Davis.Fn lio_listio 458269e767SBrooks Davisfunction initiates a list of I/O requests with a single function call. 468269e767SBrooks DavisThe 478269e767SBrooks Davis.Fa list 488269e767SBrooks Davisargument is an array of pointers to 498269e767SBrooks Davis.Vt aiocb 508269e767SBrooks Davisstructures describing each operation to perform, 518269e767SBrooks Daviswith 528269e767SBrooks Davis.Fa nent 538269e767SBrooks Daviselements. 548269e767SBrooks Davis.Dv NULL 558269e767SBrooks Daviselements are ignored. 568269e767SBrooks Davis.Pp 578269e767SBrooks DavisThe 588269e767SBrooks Davis.Va aio_lio_opcode 598269e767SBrooks Davisfield of each 608269e767SBrooks Davis.Vt aiocb 618269e767SBrooks Davisspecifies the operation to be performed. 628269e767SBrooks DavisThe following operations are supported: 638269e767SBrooks Davis.Bl -tag -width ".Dv LIO_WRITE" 648269e767SBrooks Davis.It Dv LIO_READ 658269e767SBrooks DavisRead data as if by a call to 668269e767SBrooks Davis.Xr aio_read 2 . 678269e767SBrooks Davis.It Dv LIO_READV 688269e767SBrooks DavisRead data as if by a call to 698269e767SBrooks Davis.Xr aio_readv 2 . 708269e767SBrooks Davis.It Dv LIO_NOP 718269e767SBrooks DavisNo operation. 728269e767SBrooks Davis.It Dv LIO_WRITE 738269e767SBrooks DavisWrite data as if by a call to 748269e767SBrooks Davis.Xr aio_write 2 . 758269e767SBrooks Davis.It Dv LIO_WRITEV 768269e767SBrooks DavisWrite data as if by a call to 778269e767SBrooks Davis.Xr aio_writev 2 . 788269e767SBrooks Davis.El 798269e767SBrooks Davis.Pp 808269e767SBrooks DavisIf the 81*e4b7bbd6SKonstantin Belousov.Dv LIO_READ , 82*e4b7bbd6SKonstantin Belousov.Dv LIO_READV , 83*e4b7bbd6SKonstantin Belousov.Dv LIO_WRITE , 84*e4b7bbd6SKonstantin Belousov.Dv LIO_WRITEV 85*e4b7bbd6SKonstantin Belousovopcodes are or-ed with the 86*e4b7bbd6SKonstantin Belousov.Dv LIO_FOFFSET 87*e4b7bbd6SKonstantin Belousovflag, the corresponding read or write operation uses the current file 88*e4b7bbd6SKonstantin Belousovdescriptor offset instead of 89*e4b7bbd6SKonstantin Belousov.Va aio_offset 90*e4b7bbd6SKonstantin Belousovfrom 91*e4b7bbd6SKonstantin Belousov.Vt aiocb . 92*e4b7bbd6SKonstantin Belousov.Pp 93*e4b7bbd6SKonstantin BelousovIf the 948269e767SBrooks Davis.Fa mode 958269e767SBrooks Davisargument is 968269e767SBrooks Davis.Dv LIO_WAIT , 978269e767SBrooks Davis.Fn lio_listio 988269e767SBrooks Davisdoes not return until all the requested operations have been completed. 998269e767SBrooks DavisIf 1008269e767SBrooks Davis.Fa mode 1018269e767SBrooks Davisis 1028269e767SBrooks Davis.Dv LIO_NOWAIT , 1038269e767SBrooks Davis.Fa sig 1048269e767SBrooks Daviscan be used to request asynchronous notification when all operations have 1058269e767SBrooks Daviscompleted. 1068269e767SBrooks DavisIf 1078269e767SBrooks Davis.Fa sig 1088269e767SBrooks Davisis 1098269e767SBrooks Davis.Dv NULL , 1108269e767SBrooks Davisno notification is sent. 1118269e767SBrooks Davis.Pp 1128269e767SBrooks DavisFor 1138269e767SBrooks Davis.Dv SIGEV_KEVENT 1148269e767SBrooks Davisnotifications, 1158269e767SBrooks Davisthe posted kevent will contain: 1168269e767SBrooks Davis.Bl -column ".Va filter" 1178269e767SBrooks Davis.It Sy Member Ta Sy Value 1188269e767SBrooks Davis.It Va ident Ta Fa list 1198269e767SBrooks Davis.It Va filter Ta Dv EVFILT_LIO 1208269e767SBrooks Davis.It Va udata Ta 1218269e767SBrooks Davisvalue stored in 1228269e767SBrooks Davis.Fa sig->sigev_value 1238269e767SBrooks Davis.El 1248269e767SBrooks Davis.Pp 1258269e767SBrooks DavisFor 1268269e767SBrooks Davis.Dv SIGEV_SIGNO 1278269e767SBrooks Davisand 1288269e767SBrooks Davis.Dv SIGEV_THREAD_ID 1298269e767SBrooks Davisnotifications, 1308269e767SBrooks Davisthe information for the queued signal will include 1318269e767SBrooks Davis.Dv SI_ASYNCIO 1328269e767SBrooks Davisin the 1338269e767SBrooks Davis.Va si_code 1348269e767SBrooks Davisfield and the value stored in 1358269e767SBrooks Davis.Fa sig->sigev_value 1368269e767SBrooks Davisin the 1378269e767SBrooks Davis.Va si_value 1388269e767SBrooks Davisfield. 1398269e767SBrooks Davis.Pp 1408269e767SBrooks DavisFor 1418269e767SBrooks Davis.Dv SIGEV_THREAD 1428269e767SBrooks Davisnotifications, 1438269e767SBrooks Davisthe value stored in 1448269e767SBrooks Davis.Fa sig->sigev_value 1458269e767SBrooks Davisis passed to the 1468269e767SBrooks Davis.Fa sig->sigev_notify_function 1478269e767SBrooks Davisas described in 1488269e767SBrooks Davis.Xr sigevent 3 . 1498269e767SBrooks Davis.Pp 1508269e767SBrooks DavisThe order in which the requests are carried out is not specified; 1518269e767SBrooks Davisin particular, there is no guarantee that they will be executed in 1528269e767SBrooks Davisthe order 0, 1, ..., 1538269e767SBrooks Davis.Fa nent Ns \-1 . 1548269e767SBrooks Davis.Sh RETURN VALUES 1558269e767SBrooks DavisIf 1568269e767SBrooks Davis.Fa mode 1578269e767SBrooks Davisis 1588269e767SBrooks Davis.Dv LIO_WAIT , 1598269e767SBrooks Davisthe 1608269e767SBrooks Davis.Fn lio_listio 1618269e767SBrooks Davisfunction returns 0 if the operations completed successfully, 1628269e767SBrooks Davisotherwise \-1. 1638269e767SBrooks Davis.Pp 1648269e767SBrooks DavisIf 1658269e767SBrooks Davis.Fa mode 1668269e767SBrooks Davisis 1678269e767SBrooks Davis.Dv LIO_NOWAIT , 1688269e767SBrooks Davisthe 1698269e767SBrooks Davis.Fn lio_listio 1708269e767SBrooks Davisfunction returns 0 if the operations are successfully queued, 1718269e767SBrooks Davisotherwise \-1. 1728269e767SBrooks Davis.Sh ERRORS 1738269e767SBrooks DavisThe 1748269e767SBrooks Davis.Fn lio_listio 1758269e767SBrooks Davisfunction will fail if: 1768269e767SBrooks Davis.Bl -tag -width Er 1778269e767SBrooks Davis.It Bq Er EAGAIN 1788269e767SBrooks DavisThere are not enough resources to enqueue the requests. 1798269e767SBrooks Davis.It Bq Er EAGAIN 1808269e767SBrooks DavisThe request would cause the system-wide limit 1818269e767SBrooks Davis.Dv {AIO_MAX} 1828269e767SBrooks Davisto be exceeded. 1838269e767SBrooks Davis.It Bq Er EINVAL 1848269e767SBrooks DavisThe 1858269e767SBrooks Davis.Fa mode 1868269e767SBrooks Davisargument is neither 1878269e767SBrooks Davis.Dv LIO_WAIT 1888269e767SBrooks Davisnor 1898269e767SBrooks Davis.Dv LIO_NOWAIT , 1908269e767SBrooks Davisor 1918269e767SBrooks Davis.Fa nent 1928269e767SBrooks Davisis greater than 1938269e767SBrooks Davis.Dv {AIO_LISTIO_MAX} . 1948269e767SBrooks Davis.It Bq Er EINVAL 1958269e767SBrooks DavisThe asynchronous notification method in 1968269e767SBrooks Davis.Fa sig->sigev_notify 1978269e767SBrooks Davisis invalid or not supported. 1988269e767SBrooks Davis.It Bq Er EINTR 1998269e767SBrooks DavisA signal interrupted the system call before it could be completed. 2008269e767SBrooks Davis.It Bq Er EIO 2018269e767SBrooks DavisOne or more requests failed. 2028269e767SBrooks Davis.El 2038269e767SBrooks Davis.Pp 2048269e767SBrooks DavisIn addition, the 2058269e767SBrooks Davis.Fn lio_listio 2068269e767SBrooks Davisfunction may fail for any of the reasons listed for 2078269e767SBrooks Davis.Xr aio_read 2 2088269e767SBrooks Davisand 2098269e767SBrooks Davis.Xr aio_write 2 . 2108269e767SBrooks Davis.Pp 2118269e767SBrooks DavisIf 2128269e767SBrooks Davis.Fn lio_listio 2138269e767SBrooks Davissucceeds, or fails with an error code of 2148269e767SBrooks Davis.Er EAGAIN , EINTR , 2158269e767SBrooks Davisor 2168269e767SBrooks Davis.Er EIO , 2178269e767SBrooks Davissome of the requests may have been initiated. 2188269e767SBrooks DavisThe caller should check the error status of each 2198269e767SBrooks Davis.Vt aiocb 2208269e767SBrooks Davisstructure individually by calling 2218269e767SBrooks Davis.Xr aio_error 2 . 2228269e767SBrooks Davis.Sh SEE ALSO 2238269e767SBrooks Davis.Xr aio_error 2 , 2248269e767SBrooks Davis.Xr aio_read 2 , 2258269e767SBrooks Davis.Xr aio_readv 2 , 2268269e767SBrooks Davis.Xr aio_write 2 , 2278269e767SBrooks Davis.Xr aio_writev 2 , 2288269e767SBrooks Davis.Xr read 2 , 2298269e767SBrooks Davis.Xr write 2 , 2308269e767SBrooks Davis.Xr sigevent 3 , 2318269e767SBrooks Davis.Xr siginfo 3 , 2328269e767SBrooks Davis.Xr aio 4 2338269e767SBrooks Davis.Sh STANDARDS 2348269e767SBrooks DavisThe 2358269e767SBrooks Davis.Fn lio_listio 2368269e767SBrooks Davisfunction is expected to conform to 2378269e767SBrooks Davis.St -p1003.1-2001 . 2388269e767SBrooks DavisThe 2398269e767SBrooks Davis.Dv LIO_READV 2408269e767SBrooks Davisand 2418269e767SBrooks Davis.Dv LIO_WRITEV 2428269e767SBrooks Davisoperations are 2438269e767SBrooks Davis.Fx extensions, and should not be used in portable code. 2448269e767SBrooks Davis.Sh HISTORY 2458269e767SBrooks DavisThe 2468269e767SBrooks Davis.Fn lio_listio 2478269e767SBrooks Davissystem call first appeared in 2488269e767SBrooks Davis.Fx 3.0 . 249