2 .\" Copyright (c) 2010 by Michael Kerrisk <mtk.manpages@gmail.com>
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.
24 .TH AIO_INIT 3 2012-04-26 "Linux" "Linux Programmer's Manual"
26 aio_init \- asynchronous I/O initialization
29 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
32 .BI "void aio_init(const struct aioinit *" init );
35 Link with \fI\-lrt\fP.
39 function allows the caller to provide tuning hints to the
40 glibc POSIX AIO implementation.
41 Use of this function is optional, but to be effective,
42 it must be called before employing any other functions in the POSIX AIO API.
44 The tuning information is provided in the buffer pointed to by the argument
46 This buffer is a structure of the following form:
51 int aio_threads; /* Maximum number of threads */
52 int aio_num; /* Number of expected simultaneous
54 int aio_locks; /* Not used */
55 int aio_usedba; /* Not used */
56 int aio_debug; /* Not used */
57 int aio_numusers; /* Not used */
58 int aio_idle_time; /* Number of seconds before idle thread
59 terminates (since glibc 2.2) */
65 The following fields are used in the
70 This field specifies the maximum number of worker threads that
71 may be used by the implementation.
72 If the number of outstanding I/O operations exceeds this limit,
73 then excess operations will be queued until a worker thread becomes free.
74 If this field is specified with a value less than 1, the value 1 is used.
75 The default value is 20.
78 This field should specify the maximum number of simultaneous I/O requests
79 that the caller expects to enqueue.
80 If a value less than 32 is specified for this field,
81 it is rounded up to 32.
82 .\" FIXME But, if aio_num > 32, the behavior looks strange. See
83 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=12083
84 The default value is 64.
87 This field specifies the amount of time in seconds that a
88 worker thread should wait for further requests before terminating,
89 after having completed a previous request.
90 The default value is 1.
94 function is available since glibc 2.1.
96 This function is a GNU extension.