source: trunk/packages/xen-3.1/xen-3.1/tools/libaio/man/io_prep_fsync.3 @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 2.4 KB
Line 
1./" static inline void io_prep_fsync(struct iocb *iocb, int fd)
2./" {
3./"     memset(iocb, 0, sizeof(*iocb));
4./"     iocb->aio_fildes = fd;
5./"     iocb->aio_lio_opcode = IO_CMD_FSYNC;
6./"     iocb->aio_reqprio = 0;
7./" }
8.TH io_prep_fsync 3 2002-09-12 "Linux 2.4" Linux AIO"
9.SH NAME
10io_prep_fsync \- Synchronize a file's complete in-core state with that on disk
11.SH SYNOPSYS
12.nf
13.B #include <errno.h>
14.br
15.sp
16.B #include <libaio.h>
17.br
18.sp
19.BI "static inline void io_prep_fsync(struct iocb *iocb, int fd)"
20.sp
21struct iocb {
22        void            *data;
23        unsigned        key;
24        short           aio_lio_opcode;
25        short           aio_reqprio;
26        int             aio_fildes;
27};
28.sp
29.fi
30.SH DESCRIPTION
31This is an inline convenience function for setting up an iocbv for a FSYNC request.
32.br
33The file for which
34.TP
35.IR "iocb->aio_fildes = fd"
36is a descriptor is set up with
37the command
38.TP
39.IR "iocb->aio_lio_opcode = IO_CMD_FSYNC:
40.
41.PP
42The io_prep_fsync() function shall set up an IO_CMD_FSYNC operation
43to asynchronously force all I/O
44operations associated with the file indicated by the file
45descriptor aio_fildes member of the iocb structure referenced by
46the iocb argument and queued at the time of the call to
47io_submit() to the synchronized I/O completion state. The function
48call shall return when the synchronization request has been
49initiated or queued to the file or device (even when the data
50cannot be synchronized immediately).
51
52All currently queued I/O operations shall be completed as if by a call
53to fsync(); that is, as defined for synchronized I/O file
54integrity completion. If the
55operation queued by io_prep_fsync() fails, then, as for fsync(),
56outstanding I/O operations are not guaranteed to have
57been completed.
58
59If io_prep_fsync() succeeds, then it is only the I/O that was queued
60at the time of the call to io_submit() that is guaranteed to be
61forced to the relevant completion state. The completion of
62subsequent I/O on the file descriptor is not guaranteed to be
63completed in a synchronized fashion.
64.PP
65This function returns immediately . To schedule the operation, the
66function
67.IR io_submit
68must be called.
69.PP
70Simultaneous asynchronous operations using the same iocb produce
71undefined results.
72.SH "RETURN VALUES"
73None
74.SH ERRORS
75None
76.SH "SEE ALSO"
77.BR io(3),
78.BR io_cancel(3),
79.BR io_fsync(3),
80.BR io_getevents(3),
81.BR io_prep_pread(3),
82.BR io_prep_pwrite(3),
83.BR io_queue_init(3),
84.BR io_queue_release(3),
85.BR io_queue_run(3),
86.BR io_queue_wait(3),
87.BR io_set_callback(3),
88.BR io_submit(3),
89.BR errno(3)
Note: See TracBrowser for help on using the repository browser.