]>
Commit | Line | Data |
---|---|---|
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 | 28 | aio_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 |
37 | Link with \fI\-lrt\fP. |
38 | .SH DESCRIPTION | |
39 | The GNU-specific | |
27d47e71 | 40 | .BR aio_init () |
9d7a9f90 MK |
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. | |
847e0d88 | 45 | .PP |
9d7a9f90 MK |
46 | The tuning information is provided in the buffer pointed to by the argument |
47 | .IR init . | |
48 | This buffer is a structure of the following form: | |
49 | .PP | |
50 | .in +4n | |
b8302363 | 51 | .EX |
9d7a9f90 MK |
52 | struct 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 | |
67 | The following fields are used in the | |
68 | .I aioinit | |
69 | structure: | |
70 | .TP 15 | |
71 | .I aio_threads | |
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. | |
78 | .TP | |
79 | .I aio_num | |
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. | |
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 |
86 | The default value is 64. | |
87 | .TP | |
88 | .I aio_idle_time | |
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. | |
93 | .SH VERSIONS | |
94 | The | |
95 | .BR aio_init () | |
96 | function is available since glibc 2.1. | |
97 | .SH CONFORMING TO | |
98 | This function is a GNU extension. | |
99 | .SH SEE ALSO | |
100 | .BR aio (7) |