| 1 |
.\" Copyright 2010, Michael Kerrisk <[email protected]> |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 5 |
.\" |
| 6 |
.TH aio_init 3 2026-02-08 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
aio_init \- asynchronous I/O initialization |
| 9 |
.SH LIBRARY |
| 10 |
Real-time library |
| 11 |
.RI ( librt ,\~ \-lrt ) |
| 12 |
.SH SYNOPSIS |
| 13 |
.nf |
| 14 |
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
| 15 |
.B "#include <aio.h>" |
| 16 |
.P |
| 17 |
.BI "void aio_init(const struct aioinit *" init ); |
| 18 |
.fi |
| 19 |
.SH DESCRIPTION |
| 20 |
The GNU-specific |
| 21 |
.BR aio_init () |
| 22 |
function allows the caller to provide tuning hints to the |
| 23 |
glibc POSIX AIO implementation. |
| 24 |
Use of this function is optional, but to be effective, |
| 25 |
it must be called before employing any other functions in the POSIX AIO API. |
| 26 |
.P |
| 27 |
The tuning information is provided in the buffer pointed to by the argument |
| 28 |
.IR init . |
| 29 |
This buffer is a structure of the following form: |
| 30 |
.P |
| 31 |
.in +4n |
| 32 |
.EX |
| 33 |
struct aioinit { |
| 34 |
int aio_threads; /* Maximum number of threads */ |
| 35 |
int aio_num; /* Number of expected simultaneous |
| 36 |
requests */ |
| 37 |
int aio_locks; /* Not used */ |
| 38 |
int aio_usedba; /* Not used */ |
| 39 |
int aio_debug; /* Not used */ |
| 40 |
int aio_numusers; /* Not used */ |
| 41 |
int aio_idle_time; /* Number of seconds before idle thread |
| 42 |
terminates (since glibc 2.2) */ |
| 43 |
int aio_reserved; |
| 44 |
}; |
| 45 |
.EE |
| 46 |
.in |
| 47 |
.P |
| 48 |
The following fields are used in the |
| 49 |
.I aioinit |
| 50 |
structure: |
| 51 |
.TP |
| 52 |
.I aio_threads |
| 53 |
This field specifies the maximum number of worker threads that |
| 54 |
may be used by the implementation. |
| 55 |
If the number of outstanding I/O operations exceeds this limit, |
| 56 |
then excess operations will be queued until a worker thread becomes free. |
| 57 |
If this field is specified with a value less than 1, the value 1 is used. |
| 58 |
The default value is 20. |
| 59 |
.TP |
| 60 |
.I aio_num |
| 61 |
This field should specify the maximum number of simultaneous I/O requests |
| 62 |
that the caller expects to enqueue. |
| 63 |
If a value less than 32 is specified for this field, |
| 64 |
it is rounded up to 32. |
| 65 |
.\" FIXME . But, if aio_num > 32, the behavior looks strange. See |
| 66 |
.\" http://sourceware.org/bugzilla/show_bug.cgi?id=12083 |
| 67 |
The default value is 64. |
| 68 |
.TP |
| 69 |
.I aio_idle_time |
| 70 |
This field specifies the amount of time in seconds that a |
| 71 |
worker thread should wait for further requests before terminating, |
| 72 |
after having completed a previous request. |
| 73 |
The default value is 1. |
| 74 |
.SH STANDARDS |
| 75 |
GNU. |
| 76 |
.SH HISTORY |
| 77 |
glibc 2.1. |
| 78 |
.SH SEE ALSO |
| 79 |
.BR aio (7) |