| 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)
- read or write asynchronous I/O operations
#include <sys/types.h>#include <sys/asynch.h>intaioread(intfildes,char *bufp,intbufs,off_toffset,intwhence,aio_result_t *resultp);
intaiowrite(intfildes,const char *bufp,intbufs,off_toffset,intwhence,aio_result_t *resultp);
Theaioread() function initiates one asynchronousread(2) and returns control to thecalling program. The read continues concurrently with other activity of the process. Anattempt is made to readbufs bytes of data from the objectreferenced by the descriptorfildes into the buffer pointed to bybufp.
Theaiowrite() function initiates one asynchronouswrite(2) and returns control to thecalling program. The write continues concurrently with other activity of the process. Anattempt is made to writebufs bytes of data from the bufferpointed to bybufp to the object referenced by the descriptorfildes.
On objects capable of seeking, the I/O operation starts at the positionspecified bywhence andoffset. These parameters have the same meaning asthe corresponding parameters to thellseek(2) function. On objects not capable ofseeking the I/O operation always start from the current position and theparameterswhence andoffset are ignored. The seek pointer for objects capable ofseeking is not updated byaioread() oraiowrite(). Sequential asynchronous operations onthese devices must be managed by the application using thewhence andoffset parameters.
The result of the asynchronous operation is stored in the structure pointedto byresultp:
int aio_return; /* return value of read() or write() */int aio_errno; /* value of errno for read() or write() */
Upon completion of the operation bothaio_return andaio_errno are set toreflect the result of the operation. SinceAIO_INPROGRESS is not a valueused by the system, the client can detect a change in stateby initializingaio_return to this value.
The application-supplied bufferbufp should not be referenced by the application untilafter the operation has completed. While the operation is in progress, thisbuffer is in use by the operating system.
Notification of the completion of an asynchronous I/O operation can beobtained synchronously through theaiowait(3C) function, or asynchronously by installing a signalhandler for theSIGIO signal. Asynchronous notification is accomplished by sendingthe process aSIGIO signal. If a signal handler is not installedfor theSIGIO signal, asynchronous notification is disabled. The delivery of this instanceof theSIGIO signal is reliable in that a signal delivered whilethe handler is executing is not lost. If the client ensures thataiowait() returns nothing (using a polling timeout) before returning from the signalhandler, no asynchronous I/O notifications are lost. Theaiowait() function is the onlyway to dequeue an asynchronous notification. TheSIGIO signal can have severalmeanings simultaneously. For example, it can signify that a descriptor generatedSIGIOand an asynchronous operation completed. Further, issuing an asynchronous request successfully guarantees thatspace exists to queue the completion notification.
Theclose(2),exit(2) andexecve(2)) functions block until all pending asynchronous I/Ooperations can be canceled by the system.
It is an error to use the same result buffer in morethan one outstanding request. These structures can be reused only after thesystem has completed the operation.
Upon successful completion,aioread() andaiowrite() return0. Upon failure,aioread()andaiowrite() return-1 and seterrno to indicate the error.
Theaioread() andaiowrite() functions will fail if:
The number of asynchronous requests that the system can handle at any one time has been exceeded
Thefildes argument is not a valid file descriptor open for reading.
At least one ofbufp orresultp points to an address outside the address space of the requesting process. This condition is reported only if detected by the application process.
Theresultp argument is currently being used by an outstanding asynchronous request.
Theoffset argument is not a valid offset for this file system type.
Memory resources are unavailable to initiate request.
Theaioread() andaiowrite() functions have transitional interfaces for 64-bit file offsets. Seelf64(5).
Seeattributes(5) for descriptions of the following attributes:
|
close(2),execve(2),exit(2),llseek(2),lseek(2),open(2),read(2),write(2),aiocancel(3C),aiowait(3C),attributes(5),lf64(5)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |