1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
3 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .TH io_getevents 2 (date) "Linux man-pages (unreleased)"
7 io_getevents \- read asynchronous I/O events from the completion queue
10 .RI ( libc ", " \-lc )
12 Alternatively, Asynchronous I/O library
13 .RI ( libaio ", " \-laio );
17 .BR "#include <linux/aio_abi.h>" " /* Definition of " *io_* " types */"
18 .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
19 .B #include <unistd.h>
21 .BI "int syscall(SYS_io_getevents, aio_context_t " ctx_id ,
22 .BI " long " min_nr ", long " nr ", struct io_event *" events ,
23 .BI " struct timespec *" timeout );
27 glibc provides no wrapper for
29 necessitating the use of
33 this page describes the raw Linux system call interface.
34 The wrapper function provided by
36 uses a different type for the
44 attempts to read at least \fImin_nr\fP events and
45 up to \fInr\fP events from the completion queue of the AIO context
46 specified by \fIctx_id\fP.
48 The \fItimeout\fP argument specifies the amount of time to wait for events,
49 and is specified as a relative timeout in a
53 The specified time will be rounded up to the system clock granularity
54 and is guaranteed not to expire early.
58 as NULL means block indefinitely until at least
60 events have been obtained.
64 returns the number of events read.
65 This may be 0, or a value less than
70 It may also be a nonzero value less than
72 if the call was interrupted by a signal handler.
74 For the failure return, see VERSIONS.
78 Either \fIevents\fP or \fItimeout\fP is an invalid pointer.
81 Interrupted by a signal handler; see
85 \fIctx_id\fP is invalid.
86 \fImin_nr\fP is out of range or \fInr\fP is
91 is not implemented on this architecture.
93 You probably want to use the
95 wrapper function provided by
96 .\" http://git.fedorahosted.org/git/?p=libaio.git
101 wrapper function uses a different type
103 .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
110 wrapper does not follow the usual C library conventions for indicating errors:
111 on error it returns a negated error number
112 (the negative of one of the values listed in ERRORS).
113 If the system call is invoked via
115 then the return value follows the usual conventions for
116 indicating an error: \-1, with
118 set to a (positive) value that indicates the error.
126 may cause a segmentation fault instead of generating the error