1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" This file is distributed according to the GNU General Public License.
7 .TH IO_GETEVENTS 2 2012-11-11 "Linux" "Linux Programmer's Manual"
9 io_getevents \- read asynchronous I/O events from the completion queue
12 .BR "#include <linux/aio_abi.h>" " /* Defines needed types */"
13 .BR "#include <linux/time.h>" " /* Defines 'struct timespec' */"
15 .BI "int io_getevents(aio_context_t " ctx_id ", long " min_nr ", long " nr ,
16 .BI " struct io_event *" events \
17 ", struct timespec *" timeout );
21 There is no glibc wrapper for this system call; see NOTES.
27 attempts to read at least \fImin_nr\fP events and
28 up to \fInr\fP events from the completion queue of the AIO context
29 specified by \fIctx_id\fP.
30 The \fItimeout\fP argument specifies the amount of time to wait for events,
31 where a NULL timeout waits until at least \fImin_nr\fP events
33 Note that \fItimeout\fP is relative and will be updated if not NULL
34 and the operation blocks.
38 returns the number of events read: 0 if no events are
39 available, or less than \fImin_nr\fP if the \fItimeout\fP has elapsed.
40 For the failure return, see NOTES.
44 Either \fIevents\fP or \fItimeout\fP is an invalid pointer.
47 \fIctx_id\fP is invalid.
48 \fImin_nr\fP is out of range or \fInr\fP is
52 Interrupted by a signal handler; see
57 is not implemented on this architecture.
60 The asynchronous I/O system calls first appeared in Linux 2.5.
64 is Linux-specific and should not be used in
65 programs that are intended to be portable.
67 Glibc does not provide a wrapper function for this system call.
68 You could invoke it using
70 But instead, you probably want to use the
72 wrapper function provided by
73 .\" http://git.fedorahosted.org/git/?p=libaio.git
78 wrapper function uses a different type
80 .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
87 wrapper does not follow the usual C library conventions for indicating errors:
88 on error it returns a negated error number
89 (the negative of one of the values listed in ERRORS).
90 If the system call is invoked via
92 then the return value follows the usual conventions for
93 indicating an error: \-1, with
95 set to a (positive) value that indicates the error.
99 may cause a segmentation fault instead of genenerating the error