93 lines
3.1 KiB
Groff
93 lines
3.1 KiB
Groff
'\"macro stdmacro
|
|
.TH AIO_FSYNC 3
|
|
.SH NAME
|
|
aio_fsync, aio_fsync64 \- asynchronously synchronize a file's in-memory state with that on the physical medium
|
|
.Op c p a
|
|
.SH C SYNOPSIS
|
|
.nf
|
|
.B #include <aio.h>
|
|
.PP
|
|
.B "void aio_fsync(int op, struct aiocb *aiocbp );
|
|
.PP
|
|
.B "void aio_fsync64(int op, struct aiocb *aiocbp );
|
|
.fi
|
|
.PP
|
|
.Op
|
|
.SH DESCRIPTION
|
|
.PP
|
|
The
|
|
\f4aio_fsync()\f1
|
|
function asynchronously moves all modified data of a
|
|
file indicated by the file descriptor \f4aio_fildes\f1 member of the
|
|
\f4struct aiocb\f1 referenced by the \f4aiocbp\f1 argument. The
|
|
functions return when the operation is queued. If \f4op\f1 is
|
|
\f4O_SYNC\f1 then all modified data and attributes are forced to the
|
|
physical medium. If \f4op\f1 is
|
|
\f4O_DSYNC\f1 then only all modified data is forced to the
|
|
physical medium.
|
|
.P
|
|
The \aiocbp\f1 argument refers to an asynchronous I/O control
|
|
block. The \aiocbp\f1 value may be used as an argument to
|
|
\f4aio_error\f1 and \f4aio_return\f1. When the request is queued the
|
|
error status for the operation shall be \f4[EINPROGRESS]\f1. When the
|
|
operation is complete the error status is changed to reflect the
|
|
result of the operation.
|
|
.P
|
|
The \f3aiocb->aio_sigevent\f1 defines how the calling process will be
|
|
notified upon I/O completion.
|
|
.P
|
|
If \f3sigev_notify\f1
|
|
is \f3SIGEV_NONE\f1, then no notification will be posted to the calling
|
|
application.
|
|
.P
|
|
If \f3sigev_notify\f1 is
|
|
\f3SIGEV_SIGNAL\f1, then the signal specified in
|
|
\f3sigev_signo\f1 will be sent to the calling
|
|
process. If \f3SA_SIGINFO\f1 is set for the signal (see
|
|
\f3sigaction(2)\f1) and the signal is in the range of \f3SIGRTMIN\f1
|
|
and \f3SIGRTMAX\f1 then the signal will be queued to the process and
|
|
the value in \f3sigev_value\f1 will be the \f3si_value\f1
|
|
in the generated signal.
|
|
.P
|
|
If \f3sigev_notify\f1 is \f3SIGEV_CALLBACK\f1 then
|
|
the function \f3sigev_func\f1 will be called
|
|
with \f3sigev_value\f1 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.
|
|
.P
|
|
If \f3sigev_notify\f1 is \f3SIGEV_THREAD\f1 then
|
|
the function \f3sigev_notify_function\f1 will be called
|
|
by a new thread (see \f3pthreads(5)\f1)
|
|
with \f3sigev_value\f1 as the argument.
|
|
This thread is created when the event arrives with the attributes
|
|
specified in \f3sigev_notify_attributes\f1 except that
|
|
it is automatically detached.
|
|
The calling process should ensure there are sufficient resources to
|
|
create the thread.
|
|
.P
|
|
All \f3aio_fsync()\f1 calls must supply a complete
|
|
\f3aiocb->aio_sigevent\f1 structure.
|
|
.P
|
|
.SH "SEE ALSO"
|
|
aio_write(3), lio_listio(3), aio_error(3), aio_return(3), aio_cancel(3),
|
|
pthreads(5).
|
|
.SH "DIAGNOSTICS"
|
|
.PP
|
|
A value of 0 is returned to the calling process if the operation is
|
|
successfully queued; otherwise the function returns -1 and
|
|
.Ierrno
|
|
is set to indicate the error.
|
|
.TP 15
|
|
.SM
|
|
\%[EAGAIN]
|
|
The operation was not queued due to resource limitations
|
|
.TP 15
|
|
.SM
|
|
\%[EBADF]
|
|
The \f4aio_fildes\f1 was not a valid file descriptor open for writing
|
|
.TP 15
|
|
.SM
|
|
\%[EINVAL]
|
|
A value other then \f4O_DSYNC\f1 or \f4O_SYNC\f1 was specified for \f4op\f1.
|
|
|