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 2013-04-08 "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.
37 returns the number of events read: 0 if no events are
38 available, or less than \fImin_nr\fP if the \fItimeout\fP has elapsed.
39 For the failure return, see NOTES.
43 Either \fIevents\fP or \fItimeout\fP is an invalid pointer.
46 \fIctx_id\fP is invalid.
47 \fImin_nr\fP is out of range or \fInr\fP is
51 Interrupted by a signal handler; see
56 is not implemented on this architecture.
59 The asynchronous I/O system calls first appeared in Linux 2.5.
63 is Linux-specific and should not be used in
64 programs that are intended to be portable.
66 Glibc does not provide a wrapper function for this system call.
67 You could invoke it using
69 But instead, you probably want to use the
71 wrapper function provided by
72 .\" http://git.fedorahosted.org/git/?p=libaio.git
77 wrapper function uses a different type
79 .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
86 wrapper does not follow the usual C library conventions for indicating errors:
87 on error it returns a negated error number
88 (the negative of one of the values listed in ERRORS).
89 If the system call is invoked via
91 then the return value follows the usual conventions for
92 indicating an error: \-1, with
94 set to a (positive) value that indicates the error.
98 may cause a segmentation fault instead of generating the error