Line | |
---|
1 | .TH io_cancel 2 2002-09-03 "Linux 2.4" "Linux AIO" |
---|
2 | .SH NAME |
---|
3 | io_cancel \- Cancel io requests |
---|
4 | .SH SYNOPSIS |
---|
5 | .nf |
---|
6 | .B #include <errno.h> |
---|
7 | .sp |
---|
8 | .br |
---|
9 | .B #include <libaio.h> |
---|
10 | .sp |
---|
11 | .br |
---|
12 | .BI "int io_cancel(io_context_t ctx, struct iocb *iocb)" |
---|
13 | .br |
---|
14 | .sp |
---|
15 | struct iocb { |
---|
16 | void *data; /* Return in the io completion event */ |
---|
17 | unsigned key; /* For use in identifying io requests */ |
---|
18 | short aio_lio_opcode; |
---|
19 | short aio_reqprio; /* Not used */ |
---|
20 | int aio_fildes; |
---|
21 | }; |
---|
22 | .fi |
---|
23 | .SH DESCRIPTION |
---|
24 | Attempts to cancel an iocb previously passed to io_submit. If |
---|
25 | the operation is successfully cancelled, the resulting event is |
---|
26 | copied into the memory pointed to by result without being placed |
---|
27 | into the completion queue. |
---|
28 | .PP |
---|
29 | When one or more requests are asynchronously processed, it might be |
---|
30 | useful in some situations to cancel a selected operation, e.g., if it |
---|
31 | becomes obvious that the written data is no longer accurate and would |
---|
32 | have to be overwritten soon. As an example, assume an application, which |
---|
33 | writes data in files in a situation where new incoming data would have |
---|
34 | to be written in a file which will be updated by an enqueued request. |
---|
35 | .SH "RETURN VALUES" |
---|
36 | 0 is returned on success , otherwise returns Errno. |
---|
37 | .SH ERRORS |
---|
38 | .TP |
---|
39 | .B EFAULT |
---|
40 | If any of the data structures pointed to are invalid. |
---|
41 | .TP |
---|
42 | .B EINVAL |
---|
43 | If aio_context specified by ctx_id is |
---|
44 | invalid. |
---|
45 | .TP |
---|
46 | .B EAGAIN |
---|
47 | If the iocb specified was not |
---|
48 | cancelled. |
---|
49 | .TP |
---|
50 | .B ENOSYS |
---|
51 | if not implemented. |
---|
52 | .SH "SEE ALSO" |
---|
53 | .BR io(3), |
---|
54 | .BR io_fsync(3), |
---|
55 | .BR io_getevents(3), |
---|
56 | .BR io_prep_fsync(3), |
---|
57 | .BR io_prep_pread(3), |
---|
58 | .BR io_prep_pwrite(3), |
---|
59 | .BR io_queue_init(3), |
---|
60 | .BR io_queue_release(3), |
---|
61 | .BR io_queue_run(3), |
---|
62 | .BR io_queue_wait(3), |
---|
63 | .BR io_set_callback(3), |
---|
64 | .BR io_submit(3), |
---|
65 | .BR errno(3) |
---|
Note: See
TracBrowser
for help on using the repository browser.