United States-English |
|
|
HP-UX Reference > Aaio_fsync(2)HP-UX 11i Version 3: February 2007 |
|
NAMEaio_fsync() — force outstanding asynchronous operations on a file to the synchronized state DESCRIPTIONThe aio_fsync() function asynchronously forces all I/O operations that are enqueued at the time of the call for the file or device referenced by aiocbp->aio_fildes to the synchronized I/O state. The function call returns when the synchronization request has been enqueued to the file or device (even when the data cannot be synchronized immediately). Successful completion of the aio_fsync() request indicates that all modified data for aiocbp->fildes has been moved to a permanent storage device. The aio_fsync() function affects only those asynchronous I/O operations enqueued at the time of the call. Subsequently enqueued operations are not included in the synchronizing operation. The aio_fsync() function supports synchronized I/O for regular files, block special files, and character special files. If the op is O_DSYNC, all currently enqueued asynchronous I/O operations for aiocbp->fildes are completed as if by a call to fdatasync(). All data is forced to permanent storage but the meta-data (such as modification times) for the file descriptor is not necessarily updated. If the op is O_SYNC, all currently enqueued asynchronous I/O operations for aiocbp->fildes are completed as if by a call to fsync(). All data is forced to permanent storage and the file descriptor metadata is updated. If an aio_fsync() request is issued for a file when there is already a pending aio_fsync() request, the first request is treated as though it were part of the second, and the second request will not complete until the first has completed. The aio_fsync() function returns when the fsync request has been enqueued for the referenced file or device. The aio_error() and aio_return() functions must be used to retrieve the status of the synchronization operation via the aiocb referenced by aiocbp. The status returned will be EINPROGRESS until the last operation addressed by the initial request completes. If all operations complete successfully, the error status will be 0 (zero). Otherwise, the error status will be the error status that will be returned for the read or write operation that failed. If aiocbp->aio_sigevent is a valid signal event structure, then the designated signal will be delivered when the requested synchronization operation completes, either when all subject requests have completed successfully or when any one of the requests has failed. To use this function, link in the realtime library by specifying -lrt on the compiler or linker command line. RETURN VALUEIf the aio_fsync() function fails, -1 is returned and errno is set to indicate the error. ERRORSIf aio_fsync() detects one of the following error conditions, errno is set to the indicated value:
SEE ALSOaio_cancel(2), aio_error(2), aio_read(2), aio_return(2), aio_suspend(2), aio_write(2), fdatasync(2), fsync(2), lio_listio(2), read(2), write(2), aio(5). |
Printable version | ||
|