1 | .TH aio_init 3 2002-09-12 "Linux 2.4" Linux AIO" |
---|
2 | .SH NAME |
---|
3 | aio_init \- How to optimize the AIO implementation |
---|
4 | .SH SYNOPSYS |
---|
5 | .nf |
---|
6 | .B #include <errno.h> |
---|
7 | .sp |
---|
8 | .br |
---|
9 | .B #include <aio.h> |
---|
10 | .sp |
---|
11 | .br |
---|
12 | .BI "void aio_init (const struct aioinit *init)" |
---|
13 | .fi |
---|
14 | .SH DESCRIPTION |
---|
15 | |
---|
16 | The POSIX standard does not specify how the AIO functions are |
---|
17 | implemented. They could be system calls, but it is also possible to |
---|
18 | emulate them at userlevel. |
---|
19 | |
---|
20 | At the point of this writing, the available implementation is a userlevel |
---|
21 | implementation which uses threads for handling the enqueued requests. |
---|
22 | While this implementation requires making some decisions about |
---|
23 | limitations, hard limitations are something which is best avoided |
---|
24 | in the GNU C library. Therefore, the GNU C library provides a means |
---|
25 | for tuning the AIO implementation according to the individual use. |
---|
26 | |
---|
27 | .BI "struct aioinit" |
---|
28 | .PP |
---|
29 | This data type is used to pass the configuration or tunable parameters |
---|
30 | to the implementation. The program has to initialize the members of |
---|
31 | this struct and pass it to the implementation using the |
---|
32 | .IR aio_init |
---|
33 | function. |
---|
34 | .TP |
---|
35 | .B "int aio_threads" |
---|
36 | This member specifies the maximal number of threads which may be used |
---|
37 | at any one time. |
---|
38 | .TP |
---|
39 | .B "int aio_num" |
---|
40 | This number provides an estimate on the maximal number of simultaneously |
---|
41 | enqueued requests. |
---|
42 | .TP |
---|
43 | .B "int aio_locks" |
---|
44 | Unused. |
---|
45 | .TP |
---|
46 | .B "int aio_usedba" |
---|
47 | Unused. |
---|
48 | .TP |
---|
49 | .B "int aio_debug" |
---|
50 | Unused. |
---|
51 | .TP |
---|
52 | .B "int aio_numusers" |
---|
53 | Unused. |
---|
54 | .TP |
---|
55 | .B "int aio_reserved[2]" |
---|
56 | Unused. |
---|
57 | .PP |
---|
58 | This function must be called before any other AIO function. Calling it |
---|
59 | is completely voluntary, as it is only meant to help the AIO |
---|
60 | implementation perform better. |
---|
61 | |
---|
62 | Before calling the |
---|
63 | .IR aio_init |
---|
64 | , function the members of a variable of |
---|
65 | type |
---|
66 | .IR "struct aioinit" |
---|
67 | must be initialized. Then a reference to |
---|
68 | this variable is passed as the parameter to |
---|
69 | .IR aio_init |
---|
70 | which itself |
---|
71 | may or may not pay attention to the hints. |
---|
72 | |
---|
73 | It is a extension which follows a proposal from the SGI implementation in |
---|
74 | .IR Irix 6 |
---|
75 | . It is not covered by POSIX.1b or Unix98. |
---|
76 | .SH "RETURN VALUES" |
---|
77 | The function has no return value. |
---|
78 | .SH ERRORS |
---|
79 | The function has no error cases defined. |
---|
80 | .SH "SEE ALSO" |
---|
81 | .BR aio(3), |
---|
82 | .BR aio_cancel(3), |
---|
83 | .BR aio_cancel64(3), |
---|
84 | .BR aio_error(3), |
---|
85 | .BR aio_error64(3), |
---|
86 | .BR aio_fsync(3), |
---|
87 | .BR aio_fsync64(3), |
---|
88 | .BR aio_read(3), |
---|
89 | .BR aio_read64(3), |
---|
90 | .BR aio_return(3), |
---|
91 | .BR aio_return64(3), |
---|
92 | .BR aio_suspend(3), |
---|
93 | .BR aio_suspend64(3), |
---|
94 | .BR aio_write(3), |
---|
95 | .BR aio_write64(3), |
---|
96 | .BR errno(3), |
---|