source: trunk/packages/xen-3.1/xen-3.1/tools/libaio/man/io_prep_pwrite.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.6 KB
Line 
1./" static inline void io_prep_pwrite(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_PWRITE;
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_pwrite 3 2002-09-12 "Linux 2.4" Linux AIO"
12.SH NAME
13io_prep_pwrite \- Set up iocb for asynchronous writes
14.SH SYNOPSYS
15.nf
16.B #include <errno.h>
17.br
18.sp
19.B #include <libaio.h>
20.br
21.sp
22.BI "inline void io_prep_pwrite(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
34io_prep_write is a convenicence function for setting up parallel writes.
35
36The first
37.TP
38.IR "iocb->u.c.nbytes = count"
39bytes of the file for which
40.TP
41.IR "iocb->aio_fildes = fd"
42is a descriptor are written from the buffer
43starting at
44.TP
45.IR "iocb->u.c.buf = buf"
46.
47.br
48Writing starts at the absolute position
49.TP
50.IR "ioc->u.c.offset = offset"
51in the file.
52.PP
53This function returns immediately . To schedule the operation, the
54function
55.IR io_submit
56must be called.
57.PP
58Simultaneous asynchronous operations using the same iocb produce
59undefined results.
60.SH "RETURN VALUES"
61None
62.SH ERRORS
63None
64.SH "SEE ALSO"
65.BR io(3),
66.BR io_cancel(3),
67.BR io_fsync(3),
68.BR io_getevents(3),
69.BR io_prep_fsync(3),
70.BR io_prep_pread(3),
71.BR io_queue_init(3),
72.BR io_queue_release(3),
73.BR io_queue_run(3),
74.BR io_queue_wait(3),
75.BR io_set_callback(3),
76.BR io_submit(3),
77.BR errno(3)
Note: See TracBrowser for help on using the repository browser.