]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/aio_init.3
ld.so.8: srcfix
[thirdparty/man-pages.git] / man3 / aio_init.3
CommitLineData
9d7a9f90
MK
1'\" t
2.\" Copyright (c) 2010 by Michael Kerrisk <mtk.manpages@gmail.com>
3.\"
93015253 4.\" %%%LICENSE_START(VERBATIM)
9d7a9f90
MK
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.
8.\"
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.
13.\"
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
20.\" professionally.
21.\"
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 24.\" %%%LICENSE_END
9d7a9f90 25.\"
4b8c67d9 26.TH AIO_INIT 3 2017-09-15 "Linux" "Linux Programmer's Manual"
9d7a9f90 27.SH NAME
53fdc589 28aio_init \- asynchronous I/O initialization
9d7a9f90
MK
29.SH SYNOPSIS
30.nf
b80f966b 31.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
9d7a9f90 32.B "#include <aio.h>"
dbfe9c70 33.PP
9d7a9f90
MK
34.BI "void aio_init(const struct aioinit *" init );
35.fi
68e4db0a 36.PP
9d7a9f90
MK
37Link with \fI\-lrt\fP.
38.SH DESCRIPTION
39The GNU-specific
27d47e71 40.BR aio_init ()
9d7a9f90
MK
41function allows the caller to provide tuning hints to the
42glibc POSIX AIO implementation.
43Use of this function is optional, but to be effective,
44it must be called before employing any other functions in the POSIX AIO API.
847e0d88 45.PP
9d7a9f90
MK
46The tuning information is provided in the buffer pointed to by the argument
47.IR init .
48This buffer is a structure of the following form:
49.PP
50.in +4n
b8302363 51.EX
9d7a9f90
MK
52struct aioinit {
53 int aio_threads; /* Maximum number of threads */
54 int aio_num; /* Number of expected simultaneous
55 requests */
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) */
62 int aio_reserved;
63};
b8302363 64.EE
9d7a9f90
MK
65.in
66.PP
67The following fields are used in the
68.I aioinit
69structure:
70.TP 15
71.I aio_threads
72This field specifies the maximum number of worker threads that
73may be used by the implementation.
74If the number of outstanding I/O operations exceeds this limit,
75then excess operations will be queued until a worker thread becomes free.
76If this field is specified with a value less than 1, the value 1 is used.
77The default value is 20.
78.TP
79.I aio_num
80This field should specify the maximum number of simultaneous I/O requests
81that the caller expects to enqueue.
82If a value less than 32 is specified for this field,
83it is rounded up to 32.
bea08fec 84.\" FIXME . But, if aio_num > 32, the behavior looks strange. See
9d7a9f90
MK
85.\" http://sourceware.org/bugzilla/show_bug.cgi?id=12083
86The default value is 64.
87.TP
88.I aio_idle_time
89This field specifies the amount of time in seconds that a
90worker thread should wait for further requests before terminating,
91after having completed a previous request.
92The default value is 1.
93.SH VERSIONS
94The
95.BR aio_init ()
96function is available since glibc 2.1.
97.SH CONFORMING TO
98This function is a GNU extension.
99.SH SEE ALSO
100.BR aio (7)