]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (C) 2003 Free Software Foundation, Inc. |
2 | .\" This file is distributed according to the GNU General Public License. | |
3 | .\" See the file COPYING in the top level source directory for details. | |
4 | .\" | |
d12c1424 MK |
5 | .\" .de Sh \" Subsection |
6 | .\" .br | |
7 | .\" .if t .Sp | |
8 | .\" .ne 5 | |
9 | .\" .PP | |
a8d55537 | 10 | .\" \fB\\$1\fP |
d12c1424 MK |
11 | .\" .PP |
12 | .\" .. | |
13 | .\" .de Sp \" Vertical space (when we can't use .PP) | |
14 | .\" .if t .sp .5v | |
15 | .\" .if n .sp | |
16 | .\" .. | |
17 | .\" .de Ip \" List item | |
18 | .\" .br | |
19 | .\" .ie \\n(.$>=3 .ne \\$3 | |
20 | .\" .el .ne 3 | |
21 | .\" .IP "\\$1" \\$2 | |
22 | .\" .. | |
d9343c5c | 23 | .TH IO_GETEVENTS 2 2003-02-21 "Linux" "Linux Programmer's Manual" |
fea681da | 24 | .SH NAME |
d12c1424 | 25 | io_getevents \- read asynchronous I/O events from the completion queue |
fea681da | 26 | .SH "SYNOPSIS" |
d12c1424 MK |
27 | .nf |
28 | .\" .ad l | |
29 | .\" .hy 0 | |
30 | .B #include <linux/time.h> | |
31 | .B #include <libaio.h> | |
e2b013ad | 32 | .\" #include <linux/aio.h> |
fea681da | 33 | .sp |
d12c1424 | 34 | .\" .HP 19 |
c13182ef | 35 | .BI "int io_getevents(aio_context_t " ctx_id ", long " min_nr ", long " nr , |
d12c1424 MK |
36 | .BI " struct io_event *" events \ |
37 | ", struct timespec *" timeout ); | |
38 | .\" .ad | |
39 | .\" .hy | |
bb54fa02 | 40 | .sp |
20c58d70 | 41 | Link with \fI\-laio\fP. |
d12c1424 | 42 | .fi |
fea681da | 43 | .SH "DESCRIPTION" |
fea681da | 44 | .PP |
60a90ecd | 45 | .BR io_getevents () |
a8d55537 MK |
46 | attempts to read at least \fImin_nr\fP events and |
47 | up to \fInr\fP events from the completion queue of the AIO context | |
48 | specified by \fIctx_id\fP. | |
49 | \fItimeout\fP specifies the amount of time to wait for events, | |
50 | where a NULL timeout waits until at least \fImin_nr\fP events | |
c13182ef | 51 | have been seen. |
a8d55537 | 52 | Note that \fItimeout\fP is relative and will be updated if not NULL |
fea681da | 53 | and the operation blocks. |
fea681da | 54 | .SH "RETURN VALUE" |
fea681da | 55 | .PP |
c13182ef | 56 | On success, |
60a90ecd MK |
57 | .BR io_getevents () |
58 | returns the number of events read: 0 if no events are | |
04af291f | 59 | available, or less than \fImin_nr\fP if the \fItimeout\fP has elapsed; |
d12c1424 | 60 | on failure, it returns one of the errors listed under ERRORS. |
fea681da | 61 | .SH "ERRORS" |
fea681da | 62 | .TP |
c4e45390 MK |
63 | .B EFAULT |
64 | Either \fIevents\fP or \fItimeout\fP is an invalid pointer. | |
65 | .TP | |
d12c1424 | 66 | .B EINVAL |
a8d55537 MK |
67 | \fIctx_id\fP is invalid. |
68 | \fImin_nr\fP is out of range or \fInr\fP is | |
fea681da | 69 | out of range. |
fea681da | 70 | .TP |
d12c1424 | 71 | .B ENOSYS |
60a90ecd MK |
72 | .BR io_getevents () |
73 | is not implemented on this architecture. | |
a1d5f77c MK |
74 | .SH "VERSIONS" |
75 | .PP | |
76 | The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. | |
fea681da | 77 | .SH "CONFORMING TO" |
fea681da | 78 | .PP |
60a90ecd | 79 | .BR io_getevents () |
8382f16d | 80 | is Linux-specific and should not be used in |
75b48e9d | 81 | programs that are intended to be portable. |
fea681da | 82 | .SH "SEE ALSO" |
fea681da | 83 | .PP |
60a90ecd | 84 | .BR io_cancel (2), |
c4e45390 MK |
85 | .BR io_destroy (2), |
86 | .BR io_setup (2), | |
87 | .BR io_submit (2) | |
d12c1424 | 88 | .\" .SH "NOTES" |
c13182ef | 89 | .\" |
d12c1424 MK |
90 | .\" .PP |
91 | .\" The asynchronous I/O system calls were written by Benjamin LaHaise. | |
c13182ef | 92 | .\" |
d12c1424 MK |
93 | .\" .SH AUTHOR |
94 | .\" Kent Yoder. |