1 .\" Copyright (c) 2010 by Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH AIO_INIT 3 2020-08-13 "Linux" "Linux Programmer's Manual"
27 aio_init \- asynchronous I/O initialization
30 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
33 .BI "void aio_init(const struct aioinit *" init );
36 Link with \fI\-lrt\fP.
40 function allows the caller to provide tuning hints to the
41 glibc POSIX AIO implementation.
42 Use of this function is optional, but to be effective,
43 it must be called before employing any other functions in the POSIX AIO API.
45 The tuning information is provided in the buffer pointed to by the argument
47 This buffer is a structure of the following form:
52 int aio_threads; /* Maximum number of threads */
53 int aio_num; /* Number of expected simultaneous
55 int aio_locks; /* Not used */
56 int aio_usedba; /* Not used */
57 int aio_debug; /* Not used */
58 int aio_numusers; /* Not used */
59 int aio_idle_time; /* Number of seconds before idle thread
60 terminates (since glibc 2.2) */
66 The following fields are used in the
71 This field specifies the maximum number of worker threads that
72 may be used by the implementation.
73 If the number of outstanding I/O operations exceeds this limit,
74 then excess operations will be queued until a worker thread becomes free.
75 If this field is specified with a value less than 1, the value 1 is used.
76 The default value is 20.
79 This field should specify the maximum number of simultaneous I/O requests
80 that the caller expects to enqueue.
81 If a value less than 32 is specified for this field,
82 it is rounded up to 32.
83 .\" FIXME . But, if aio_num > 32, the behavior looks strange. See
84 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=12083
85 The default value is 64.
88 This field specifies the amount of time in seconds that a
89 worker thread should wait for further requests before terminating,
90 after having completed a previous request.
91 The default value is 1.
95 function is available since glibc 2.1.
97 This function is a GNU extension.