OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / aio_init.3
1 '\" t
2 .\" Copyright (c) 2010 by Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
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.
24 .\" %%%LICENSE_END
25 .\"
26 .TH AIO_INIT 3  2012-04-26 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 aio_init \- asynchronous I/O initialization
29 .SH SYNOPSIS
30 .nf
31 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
32 .B "#include <aio.h>"
33
34 .BI "void aio_init(const struct aioinit *" init );
35 .fi
36 .sp
37 Link with \fI\-lrt\fP.
38 .SH DESCRIPTION
39 The GNU-specific
40 .BR aio_init ()
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.
45
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
51 .nf
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 };
64 .fi
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.
84 .\" FIXME But, if aio_num > 32, the behavior looks strange. See
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)
101 .SH COLOPHON
102 This page is part of release 3.68 of the Linux
103 .I man-pages
104 project.
105 A description of the project,
106 information about reporting bugs,
107 and the latest version of this page,
108 can be found at
109 \%http://www.kernel.org/doc/man\-pages/.