1IO_GETEVENTS(2)            Linux Programmer's Manual           IO_GETEVENTS(2)
2
3
4

NAME

6       io_getevents - read asynchronous I/O events from the completion queue
7

SYNOPSIS

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

DESCRIPTION

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.
21
22       The  timeout  argument specifies the amount of time to wait for events,
23       and is specified as a relative timeout in a structure of the  following
24       form:
25
26           struct timespec {
27               time_t tv_sec;      /* seconds */
28               long   tv_nsec;     /* nanoseconds [0 .. 999999999] */
29           };
30
31       The  specified  time will be rounded up to the system clock granularity
32       and is guaranteed not to expire early.
33
34       Specifying timeout as NULL means  block  indefinitely  until  at  least
35       min_nr events have been obtained.
36

RETURN VALUE

38       On success, io_getevents() returns the number of events read.  This may
39       be 0, or a value less than min_nr, if the timeout expired.  It may also
40       be  a  nonzero value less than min_nr, if the call was interrupted by a
41       signal handler.
42
43       For the failure return, see NOTES.
44

ERRORS

46       EFAULT Either events or timeout is an invalid pointer.
47
48       EINTR  Interrupted by a signal handler; see signal(7).
49
50       EINVAL ctx_id is invalid.  min_nr is out of  range  or  nr  is  out  of
51              range.
52
53       ENOSYS io_getevents() is not implemented on this architecture.
54

VERSIONS

56       The asynchronous I/O system calls first appeared in Linux 2.5.
57

CONFORMING TO

59       io_getevents()  is  Linux-specific  and  should not be used in programs
60       that are intended to be portable.
61

NOTES

63       Glibc does not provide a wrapper function for this  system  call.   You
64       could  invoke  it  using syscall(2).  But instead, you probably want to
65       use the io_getevents() wrapper function provided by libaio.
66
67       Note that the libaio wrapper function uses a  different  type  (io_con‐
68       text_t)  for  the  ctx_id  argument.  Note also that the libaio wrapper
69       does not follow the usual C library conventions for indicating  errors:
70       on  error it returns a negated error number (the negative of one of the
71       values  listed  in  ERRORS).   If  the  system  call  is  invoked   via
72       syscall(2),  then  the  return  value follows the usual conventions for
73       indicating an error: -1, with errno set  to  a  (positive)  value  that
74       indicates the error.
75

BUGS

77       An  invalid ctx_id may cause a segmentation fault instead of generating
78       the error EINVAL.
79

SEE ALSO

81       io_cancel(2), io_destroy(2), io_setup(2), io_submit(2), aio(7), time(7)
82

COLOPHON

84       This page is part of release 5.04 of the Linux  man-pages  project.   A
85       description  of  the project, information about reporting bugs, and the
86       latest    version    of    this    page,    can     be     found     at
87       https://www.kernel.org/doc/man-pages/.
88
89
90
91Linux                             2017-09-15                   IO_GETEVENTS(2)
Impressum