ia64/xen-unstable

view tools/libaio/man/io_fsync.3 @ 10736:2937703f0ed0

Added blktap support. Includes kernel driver (enabled as CONFIG_XEN_BLKDEV_TAP=y) and userspace tools. The userspace deamon (blktapctrl) is enabled by default when xend is activated. For further information on using and configuring blktap see tools/blktap/README.
author jchesterfield@dhcp92.uk.xensource.com
date Thu Jul 13 10:13:26 2006 +0100 (2006-07-13)
parents
children
line source
1 ./" static inline int io_fsync(io_context_t ctx, struct iocb *iocb, io_callback_t cb, int fd)
2 ./" {
3 ./" io_prep_fsync(iocb, fd);
4 ./" io_set_callback(iocb, cb);
5 ./" return io_submit(ctx, 1, &iocb);
6 ./" }
7 .TH io_fsync 3 2002-09-12 "Linux 2.4" Linux AIO"
8 .SH NAME
9 io_fsync \- Synchronize a file's complete in-core state with that on disk
10 .SH SYNOPSYS
11 .nf
12 .B #include <errno.h>
13 .sp
14 .br
15 .B #include <libaio.h>
16 .sp
17 .br
18 .BI "int io_fsync(io_context_t ctx, struct iocb *iocb, io_callback_t cb, int fd)"
19 .sp
20 struct iocb {
21 void *data;
22 unsigned key;
23 short aio_lio_opcode;
24 short aio_reqprio;
25 int aio_fildes;
26 };
27 .sp
28 typedef void (*io_callback_t)(io_context_t ctx, struct iocb *iocb, long res, long res2);
29 .sp
30 .fi
31 .SH DESCRIPTION
32 When dealing with asynchronous operations it is sometimes necessary to
33 get into a consistent state. This would mean for AIO that one wants to
34 know whether a certain request or a group of request were processed.
35 This could be done by waiting for the notification sent by the system
36 after the operation terminated, but this sometimes would mean wasting
37 resources (mainly computation time).
38 .PP
39 Calling this function forces all I/O operations operating queued at the
40 time of the function call operating on the file descriptor
41 .IR "iocb->io_fildes"
42 into the synchronized I/O completion state . The
43 .IR "io_fsync"
44 function returns
45 immediately but the notification through the method described in
46 .IR "io_callback"
47 will happen only after all requests for this
48 file descriptor have terminated and the file is synchronized. This also
49 means that requests for this very same file descriptor which are queued
50 after the synchronization request are not affected.
51 .SH "RETURN VALUES"
52 Returns 0, otherwise returns errno.
53 .SH ERRORS
54 .TP
55 .B EFAULT
56 .I iocbs
57 referenced data outside of the program's accessible address space.
58 .TP
59 .B EINVAL
60 .I ctx
61 refers to an unitialized aio context, the iocb pointed to by
62 .I iocbs
63 contains an improperly initialized iocb,
64 .TP
65 .B EBADF
66 The iocb contains a file descriptor that does not exist.
67 .TP
68 .B EINVAL
69 The file specified in the iocb does not support the given io operation.
70 .SH "SEE ALSO"
71 .BR io(3),
72 .BR io_cancel(3),
73 .BR io_getevents(3),
74 .BR io_prep_pread(3),
75 .BR io_prep_pwrite(3),
76 .BR io_queue_init(3),
77 .BR io_queue_release(3),
78 .BR io_queue_run(3),
79 .BR io_queue_wait(3),
80 .BR io_set_callback(3),
81 .BR io_submit(3),
82 .BR errno(3)