source: trunk/packages/xen-3.1/xen-3.1/tools/libaio/man/io_prep_pread.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: 1.7 KB
Line 
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
13io_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
25struct 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
35is an inline convenience function designed to facilitate the initialization of
36the iocb for an asynchronous read operation.
37
38The first
39.TP
40.IR "iocb->u.c.nbytes = count"
41bytes of the file for which
42.TP
43.IR "iocb->aio_fildes = fd"
44is a descriptor are written to the buffer
45starting at
46.TP
47.IR "iocb->u.c.buf = buf"
48.
49.br
50Reading starts at the absolute position
51.TP
52.IR "ioc->u.c.offset = offset"
53in the file.
54.PP
55This function returns immediately . To schedule the operation, the
56function
57.IR io_submit
58must be called.
59.PP
60Simultaneous asynchronous operations using the same iocb produce
61undefined results.
62.SH "RETURN VALUES"
63None
64.SH ERRORS
65None
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)
Note: See TracBrowser for help on using the repository browser.