AIOFSYNC(3) AIOFSYNC(3)
NAME
aio_fsync, aio_fsync64 - asynchronously synchronize a file's in-memory
state with that on the physical medium
C SYNOPSIS
#include <aio.h>
void aiofsync(int op, struct aiocb *aiocbp );
void aiofsync64(int op, struct aiocb *aiocbp );
DESCRIPTION
The aiofsync() function asynchronously moves all modified data of a file
indicated by the file descriptor aiofildes member of the struct aiocb
referenced by the aiocbp argument. The functions return when the
operation is queued. If op is OSYNC then all modified data and
attributes are forced to the physical medium. If op is ODSYNC then only
all modified data is forced to the physical medium.
The iocbp argument refers to an asynchronous I/O control block. The iocbp
value may be used as an argument to aioerror and aioreturn. When the
request is queued the error status for the operation shall be
[EINPROGRESS]. When the operation is complete the error status is changed
to reflect the result of the operation.
The aiocb->aiosigevent defines how the calling process will be notified
upon I/O completion.
If sigevnotify is SIGEVNONE, then no notification will be posted to the
calling application.
If sigevnotify is SIGEVSIGNAL, then the signal specified in sigevsigno
will be sent to the calling process. If SASIGINFO is set for the signal
(see sigaction(2)) and the signal is in the range of SIGRTMIN and
SIGRTMAX then the signal will be queued to the process and the value in
sigevvalue will be the sivalue in the generated signal.
If sigevnotify is SIGEVCALLBACK then the function sigevfunc will be
called with sigevvalue as the argument. Only one callback will be called
at a time, however programs should be careful to note that a callback may
be run in parallel with the calling process.
If sigevnotify is SIGEVTHREAD then the function sigevnotifyfunction
will be called by a new thread (see pthreads(5)) with sigevvalue as the
argument. This thread is created when the event arrives with the
attributes specified in sigevnotifyattributes except that it is
automatically detached. The calling process should ensure there are
sufficient resources to create the thread.
All aiofsync() calls must supply a complete aiocb->aiosigevent
structure.
Page 1
AIOFSYNC(3) AIOFSYNC(3)
SEE ALSO
aio_write(3), lio_listio(3), aio_error(3), aio_return(3), aio_cancel(3),
pthreads(5).
DIAGNOSTICS
A value of 0 is returned to the calling process if the operation is
successfully queued; otherwise the function returns -1 and is set to
indicate the error.
[EAGAIN] The operation was not queued due to resource limitations
[EBADF] The aiofildes was not a valid file descriptor open for
writing
[EINVAL] A value other then ODSYNC or OSYNC was specified for op.
Page 2