ia64/xen-unstable

view tools/libaio/man/io_prep_pread.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 void io_prep_pread(struct iocb *iocb, int fd, void *buf, size_t count, long long offset)
2 ./" {
3 ./" memset(iocb, 0, sizeof(*iocb));
4 ./" iocb->aio_fildes = fd;
5 ./" iocb->aio_lio_opcode = IO_CMD_PREAD;
6 ./" iocb->aio_reqprio = 0;
7 ./" iocb->u.c.buf = buf;
8 ./" iocb->u.c.nbytes = count;
9 ./" iocb->u.c.offset = offset;
10 ./" }
11 .TH io_prep_pread 3 2002-09-12 "Linux 2.4" Linux AIO"
12 .SH NAME
13 io_prep_pread \- Set up asynchronous read
14 .SH SYNOPSYS
15 .nf
16 .B #include <errno.h>
17 .sp
18 .br
19 .B #include <libaio.h>
20 .br
21 .sp
22 .BI "inline void io_prep_pread(struct iocb *iocb, int fd, void *buf, size_t count, long long offset)
23 "
24 .sp
25 struct iocb {
26 void *data;
27 unsigned key;
28 short aio_lio_opcode;
29 short aio_reqprio;
30 int aio_fildes;
31 };
32 .fi
33 .SH DESCRIPTION
34 .IR io_prep_pread
35 is an inline convenience function designed to facilitate the initialization of
36 the iocb for an asynchronous read operation.
38 The first
39 .TP
40 .IR "iocb->u.c.nbytes = count"
41 bytes of the file for which
42 .TP
43 .IR "iocb->aio_fildes = fd"
44 is a descriptor are written to the buffer
45 starting at
46 .TP
47 .IR "iocb->u.c.buf = buf"
48 .
49 .br
50 Reading starts at the absolute position
51 .TP
52 .IR "ioc->u.c.offset = offset"
53 in the file.
54 .PP
55 This function returns immediately . To schedule the operation, the
56 function
57 .IR io_submit
58 must be called.
59 .PP
60 Simultaneous asynchronous operations using the same iocb produce
61 undefined results.
62 .SH "RETURN VALUES"
63 None
64 .SH ERRORS
65 None
66 .SH "SEE ALSO"
67 .BR io(3),
68 .BR io_cancel(3),
69 .BR io_fsync(3),
70 .BR io_getevents(3),
71 .BR io_prep_fsync(3),
72 .BR io_prep_pwrite(3),
73 .BR io_queue_init(3),
74 .BR io_queue_release(3),
75 .BR io_queue_run(3),
76 .BR io_queue_wait(3),
77 .BR io_set_callback(3),
78 .BR io_submit(3),
79 .BR errno(3)