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.
5 .\" .de Sh \" Subsection
13 .\" .de Sp \" Vertical space (when we can't use .PP)
17 .\" .de Ip \" List item
19 .\" .ie \\n(.$>=3 .ne \\$3
23 .TH IO_GETEVENTS 2 2008-07-04 "Linux" "Linux Programmer's Manual"
25 io_getevents \- read asynchronous I/O events from the completion queue
30 .B #include <linux/time.h>
31 .B #include <libaio.h>
32 .\" #include <linux/aio.h>
35 .BI "int io_getevents(aio_context_t " ctx_id ", long " min_nr ", long " nr ,
36 .BI " struct io_event *" events \
37 ", struct timespec *" timeout );
41 Link with \fI\-laio\fP.
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
52 Note that \fItimeout\fP is relative and will be updated if not NULL
53 and the operation blocks.
57 returns the number of events read: 0 if no events are
58 available, or less than \fImin_nr\fP if the \fItimeout\fP has elapsed.
59 For the failure return, see NOTES.
63 Either \fIevents\fP or \fItimeout\fP is an invalid pointer.
66 \fIctx_id\fP is invalid.
67 \fImin_nr\fP is out of range or \fInr\fP is
71 Interrupted by a signal handler; see
76 is not implemented on this architecture.
79 The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
83 is Linux-specific and should not be used in
84 programs that are intended to be portable.
86 Glibc does not provide a wrapper function for this system call.
88 The wrapper provided in
92 does not follow the usual C library conventions for indicating error:
93 on error it returns a negated error number
94 (the negative of one of the values listed in ERRORS).
95 If the system call is invoked via
97 then the return value follows the usual conventions for
98 indicating an error: \-1, with
100 set to a (positive) value that indicates the error.
111 .\" The asynchronous I/O system calls were written by Benjamin LaHaise.