Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/a/aio_fsync.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/a/aio_fsync.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/a/aio_fsync.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/a/aio_fsync.html on line 8
Asynchronously synchronize a file
#include <aio.h>
int aio_fsync( int op,
struct aiocb * aiocbptr );
- op
- One of the following:
- O_DSYNC — complete all queued operations as if
done by calling
fdatasync()
(i.e. as defined for synchronized I/O data integrity completion).
- O_SYNC — complete all queued operations as if
done by calling
fsync()
(i.e. as defined for synchronized I/O file integrity completion).
- aiocbptr
- A pointer to an asynchronous I/O control block of type
aiocb
for which you want to
asynchronously force all queued I/O operations to the synchronized
I/O completion state.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The aio_fsync() function asynchronously forces all I/O
operations associated with the file indicated by the file descriptor
to the synchronized I/O completion state.
If the function succeeds, only the I/O operations that were queued at the
time of the call are guaranteed to have been completed.
The completion of subsequent I/O on the file descriptor isn't guaranteed
to be completed in a synchronized fashion.
If the operation that aio_fsync() queues fails, outstanding
I/O operations aren't guaranteed to have been completed.
You can pass the aiocbptr argument to
aio_error()
or
aio_return()
to determine the error status and return status for the asynchronous
operation.
0 if the I/O operation was successfully queued, or
-1 if an error occurred
(errno is set).
- EAGAIN
- The requested asynchronous operation wasn't queued due to temporary
resource limitations.
- EBADF
- The aio_fildes member of the aiocb structure
referenced by the aiocbptr argument isn't a valid file descriptor
that's open for writing.
- EINVAL
- Synchronized I/O isn't supported for this file.
- EINVAL
- The op argument was something other than O_DSYNC
or O_SYNC.
If any of the queued I/O operations failed, aio_fsync() returns the error
condition defined for
read()
and
write().
The error is returned in the error status for the asynchronous
fsync()
operation, which you can retrieve by using
aio_error().
POSIX 1003.1 AIO
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
The first time you call an aio_* function, a thread pool
is created, making your process multithreaded if it isn't already.
The thread pool isn't destroyed until your process ends.
aio_cancel(),
aio_error(),
aio_read(),
aio_return(),
aio_suspend(),
aio_write(),
aiocb,
fdatasync(),
fsync(),
read(),
write()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/a/aio_fsync.html on line 206
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/a/aio_fsync.html on line 206