]>
Commit | Line | Data |
---|---|---|
9d7a9f90 MK |
1 | .\" Copyright (c) 2010 by Michael Kerrisk <mtk.manpages@gmail.com> |
2 | .\" | |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
9d7a9f90 | 4 | .\" |
4c1c5274 | 5 | .TH aio_init 3 (date) "Linux man-pages (unreleased)" |
9d7a9f90 | 6 | .SH NAME |
53fdc589 | 7 | aio_init \- asynchronous I/O initialization |
a42212d0 AC |
8 | .SH LIBRARY |
9 | Real-time library | |
8fc3b2cf | 10 | .RI ( librt ", " \-lrt ) |
9d7a9f90 MK |
11 | .SH SYNOPSIS |
12 | .nf | |
b80f966b | 13 | .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
9d7a9f90 | 14 | .B "#include <aio.h>" |
dbfe9c70 | 15 | .PP |
9d7a9f90 MK |
16 | .BI "void aio_init(const struct aioinit *" init ); |
17 | .fi | |
9d7a9f90 MK |
18 | .SH DESCRIPTION |
19 | The GNU-specific | |
27d47e71 | 20 | .BR aio_init () |
9d7a9f90 MK |
21 | function allows the caller to provide tuning hints to the |
22 | glibc POSIX AIO implementation. | |
23 | Use of this function is optional, but to be effective, | |
24 | it must be called before employing any other functions in the POSIX AIO API. | |
847e0d88 | 25 | .PP |
9d7a9f90 MK |
26 | The tuning information is provided in the buffer pointed to by the argument |
27 | .IR init . | |
28 | This buffer is a structure of the following form: | |
29 | .PP | |
30 | .in +4n | |
b8302363 | 31 | .EX |
9d7a9f90 MK |
32 | struct aioinit { |
33 | int aio_threads; /* Maximum number of threads */ | |
34 | int aio_num; /* Number of expected simultaneous | |
35 | requests */ | |
36 | int aio_locks; /* Not used */ | |
37 | int aio_usedba; /* Not used */ | |
38 | int aio_debug; /* Not used */ | |
39 | int aio_numusers; /* Not used */ | |
40 | int aio_idle_time; /* Number of seconds before idle thread | |
41 | terminates (since glibc 2.2) */ | |
42 | int aio_reserved; | |
43 | }; | |
b8302363 | 44 | .EE |
9d7a9f90 MK |
45 | .in |
46 | .PP | |
47 | The following fields are used in the | |
48 | .I aioinit | |
49 | structure: | |
0019177e | 50 | .TP |
9d7a9f90 MK |
51 | .I aio_threads |
52 | This field specifies the maximum number of worker threads that | |
53 | may be used by the implementation. | |
54 | If the number of outstanding I/O operations exceeds this limit, | |
55 | then excess operations will be queued until a worker thread becomes free. | |
56 | If this field is specified with a value less than 1, the value 1 is used. | |
57 | The default value is 20. | |
58 | .TP | |
59 | .I aio_num | |
60 | This field should specify the maximum number of simultaneous I/O requests | |
61 | that the caller expects to enqueue. | |
62 | If a value less than 32 is specified for this field, | |
63 | it is rounded up to 32. | |
bea08fec | 64 | .\" FIXME . But, if aio_num > 32, the behavior looks strange. See |
9d7a9f90 MK |
65 | .\" http://sourceware.org/bugzilla/show_bug.cgi?id=12083 |
66 | The default value is 64. | |
67 | .TP | |
68 | .I aio_idle_time | |
69 | This field specifies the amount of time in seconds that a | |
70 | worker thread should wait for further requests before terminating, | |
71 | after having completed a previous request. | |
72 | The default value is 1. | |
73 | .SH VERSIONS | |
74 | The | |
75 | .BR aio_init () | |
76 | function is available since glibc 2.1. | |
3113c7f3 | 77 | .SH STANDARDS |
9d7a9f90 MK |
78 | This function is a GNU extension. |
79 | .SH SEE ALSO | |
80 | .BR aio (7) |