| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- list directed I/O
#include <aio.h>intlio_listio(intmode,struct aiocb *restrict constlist[],intnent,struct sigevent *restrictsig);
Thelio_listio() function allows the calling process, LWP, or thread, to initiatea list of I/O requests within a single function call.
Themode argument takes one of the valuesLIO_WAIT orLIO_NOWAIT declaredin <aio.h> and determines whether the function returns when the I/O operationshave been completed, or as soon as the operations have been queued. Ifthemode argument isLIO_WAIT, the function waits until all I/O iscomplete and thesig argument is ignored.
If themode argument isLIO_NOWAIT, the function returns immediately, and asynchronousnotification occurs, according to thesig argument, when all the I/O operationscomplete. Ifsig isNULL, no asynchronous notification occurs. Ifsig isnotNULL, asynchronous notification occurs as specified insignal.h(3HEAD) when all therequests inlist have completed.
The I/O requests enumerated bylist are submitted in an unspecified order.
Thelist argument is an array of pointers toaiocb structures. Thearray containsnent elements. The array may contain null elements, which areignored.
Theaio_lio_opcode field of eachaiocb structure specifies the operation to beperformed. The supported operations areLIO_READ,LIO_WRITE, andLIO_NOP; these symbols aredefined in <aio.h>. TheLIO_NOP operation causes the list entry to beignored. If theaio_lio_opcode element is equal toLIO_READ, then an I/Ooperation is submitted as if by a call toaio_read(3C) with theaiocbp equal to the address of theaiocb structure. If theaio_lio_opcodeelement is equal toLIO_WRITE, then an I/O operation is submitted as ifby a call toaio_write(3C) with theaiocbp equal to the addressof theaiocb structure.
Theaio_fildes member specifies the file descriptor on which the operation isto be performed.
Theaio_buf member specifies the address of the buffer to or fromwhich the data is to be transferred.
Theaio_nbytes member specifies the number of bytes of data to betransferred.
The members of theaiocb structure further describe the I/O operation tobe performed, in a manner identical to that of the correspondingaiocbstructure when used by theaio_read(3C) andaio_write(3C) functions.
Thenent argument specifies how many elements are members of the list,that is, the length of the array.
The behavior of this function is altered according to the definitions ofsynchronized I/O data integrity completion and synchronized I/O file integrity completion ifsynchronized I/O is enabled on the file associated withaio_fildes. Seefcntl.h(3HEAD)definitions ofO_DSYNC andO_SYNC.
For regular files, no data transfer will occur past the offset maximumestablished in the open file description associated withaiocbp->aio_fildes.
If themode argument has the valueLIO_NOWAIT, and the I/Ooperations are successfully queued,lio_listio() returns0; otherwise, it returns-1, andsetserrno to indicate the error.
If themode argument has the valueLIO_WAIT, and allthe indicated I/O has completed successfully,lio_listio() returns0; otherwise,it returns-1, and setserrno to indicate the error.
In either case, the return value only indicates the success or failureof thelio_listio() call itself, not the status of the individual I/Orequests. In some cases, one or more of the I/O requests containedin the list may fail. Failure of an individual request does not preventcompletion of any other individual request. To determine the outcomeof each I/O request, the application must examine the error status associatedwith eachaiocb control block. Each error status so returned isidentical to that returned as a result of anaio_read(3C) oraio_write(3C)function.
Thelio_listio() function will fail if:
The resources necessary to queue all the I/O requests were not available. The error status for each request is recorded in theaio_error member of the correspondingaiocb structure, and can be retrieved usingaio_error(3C).
The number of entries indicated bynent would cause the system-wide limitAIO_MAX to be exceeded.
Themode argument is an improper value, or the value ofnent is greater thanAIO_LISTIO_MAX.
A signal was delivered while waiting for all I/O requests to complete during anLIO_WAIT operation. Note that, since each I/O operation invoked bylio_listio() may possibly provoke a signal when it completes, this error return may be caused by the completion of one (or more) of the very I/O operations being awaited. Outstanding I/O requests are not canceled, and the application can useaio_fsync(3C) to determine if any request was initiated;aio_return(3C) to determine if any request has completed; oraio_error(3C) to determine if any request was canceled.
One or more of the individual I/O operations failed. The application can useaio_error(3C) to check the error status for eachaiocb structure to determine the individual request(s) that failed.
In addition to the errors returned by thelio_listio() function, if thelio_listio() function succeeds or fails with errors ofEAGAIN,EINTR, orEIO,then some of the I/O specified by the list may have been initiated.If thelio_listio() function fails with an error code other thanEAGAIN,EINTR, orEIO, no operations from the list have been initiated. TheI/O operation indicated by each list element can encounter errors specific to theindividual read or write function being performed. In this event, the errorstatus for eachaiocb control block contains the associated error code. Theerror codes that can be set are the same as would beset by aread(2) orwrite(2) function, with the following additional error codespossible:
The requested I/O operation was not queued due to resource limitations.
The requested I/O was canceled before the I/O completed due to an explicitaio_cancel(3C) request.
Theaiocbp->aio_lio_opcode isLIO_WRITE, the file is a regular file,aiocbp->aio_nbytes is greater than 0, and theaiocbp->aio_offset is greater than or equal to the offset maximum in the open file description associated withaiocbp->aio_fildes.
The requested I/O is in progress.
Theaiocbp->aio_lio_opcode isLIO_READ, the file is a regular file,aiocbp->aio_nbytes is greater than 0, and theaiocbp->aio_offset is before the end-of-file and is greater than or equal to the offset maximum in the open file description associated withaiocbp->aio_fildes.
Thelio_listio() function has a transitional interface for 64-bit file offsets. Seelf64(5).
Seeattributes(5) for descriptions of the following attributes:
|
close(2),exec(2),exit(2),fork(2),lseek(2),read(2),write(2),aio_cancel(3C),aio_error(3C),aio_fsync(3C),aio_read(3C),aio_return(3C),aio_write(3C),aio.h(3HEAD),fcntl.h(3HEAD),siginfo.h(3HEAD),signal.h(3HEAD),attributes(5),lf64(5),standards(5)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |