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 |
---|
13 | io_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 |
---|
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 | io_prep_write is a convenicence function for setting up parallel writes. |
---|
35 | |
---|
36 | The first |
---|
37 | .TP |
---|
38 | .IR "iocb->u.c.nbytes = count" |
---|
39 | bytes of the file for which |
---|
40 | .TP |
---|
41 | .IR "iocb->aio_fildes = fd" |
---|
42 | is a descriptor are written from the buffer |
---|
43 | starting at |
---|
44 | .TP |
---|
45 | .IR "iocb->u.c.buf = buf" |
---|
46 | . |
---|
47 | .br |
---|
48 | Writing starts at the absolute position |
---|
49 | .TP |
---|
50 | .IR "ioc->u.c.offset = offset" |
---|
51 | in the file. |
---|
52 | .PP |
---|
53 | This function returns immediately . To schedule the operation, the |
---|
54 | function |
---|
55 | .IR io_submit |
---|
56 | must be called. |
---|
57 | .PP |
---|
58 | Simultaneous asynchronous operations using the same iocb produce |
---|
59 | undefined results. |
---|
60 | .SH "RETURN VALUES" |
---|
61 | None |
---|
62 | .SH ERRORS |
---|
63 | None |
---|
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) |
---|