1IO_GETEVENTS(2) Linux Programmer's Manual IO_GETEVENTS(2)
2
3
4
6 io_getevents - read asynchronous I/O events from the completion queue
7
9 #include <linux/aio_abi.h> /* Defines needed types */
10 #include <linux/time.h> /* Defines 'struct timespec' */
11
12 int io_getevents(aio_context_t ctx_id, long min_nr, long nr,
13 struct io_event *events, struct timespec *timeout);
14
15 Note: There is no glibc wrapper for this system call; see NOTES.
16
18 The io_getevents() system call attempts to read at least min_nr events
19 and up to nr events from the completion queue of the AIO context speci‐
20 fied by ctx_id. The timeout argument specifies the amount of time to
21 wait for events, where a NULL timeout waits until at least min_nr
22 events have been seen. Note that timeout is relative.
23
25 On success, io_getevents() returns the number of events read: 0 if no
26 events are available, or less than min_nr if the timeout has elapsed.
27 For the failure return, see NOTES.
28
30 EFAULT Either events or timeout is an invalid pointer.
31
32 EINVAL ctx_id is invalid. min_nr is out of range or nr is out of
33 range.
34
35 EINTR Interrupted by a signal handler; see signal(7).
36
37 ENOSYS io_getevents() is not implemented on this architecture.
38
40 The asynchronous I/O system calls first appeared in Linux 2.5.
41
43 io_getevents() is Linux-specific and should not be used in programs
44 that are intended to be portable.
45
47 Glibc does not provide a wrapper function for this system call. You
48 could invoke it using syscall(2). But instead, you probably want to
49 use the io_getevents() wrapper function provided by libaio.
50
51 Note that the libaio wrapper function uses a different type (io_con‐
52 text_t) for the ctx_id argument. Note also that the libaio wrapper
53 does not follow the usual C library conventions for indicating errors:
54 on error it returns a negated error number (the negative of one of the
55 values listed in ERRORS). If the system call is invoked via
56 syscall(2), then the return value follows the usual conventions for
57 indicating an error: -1, with errno set to a (positive) value that
58 indicates the error.
59
61 An invalid ctx_id may cause a segmentation fault instead of genenerat‐
62 ing the error EINVAL.
63
65 io_cancel(2), io_destroy(2), io_setup(2), io_submit(2), aio(7), time(7)
66
68 This page is part of release 3.53 of the Linux man-pages project. A
69 description of the project, and information about reporting bugs, can
70 be found at http://www.kernel.org/doc/man-pages/.
71
72
73
74Linux 2013-04-08 IO_GETEVENTS(2)