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