OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / io_getevents.2
1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
2 .\" This file is distributed according to the GNU General Public License.
3 .\" See the file COPYING in the top level source directory for details.
4 .\"
5 .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved.
6 .\" Translated Mon Mar  8 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
7 .\"
8 .\"WORD:        completion queue        ´°Î»¥­¥å¡¼
9 .\"
10 .\" .de Sh \" Subsection
11 .\" .br
12 .\" .if t .Sp
13 .\" .ne 5
14 .\" .PP
15 .\" \fB\\$1\fP
16 .\" .PP
17 .\" ..
18 .\" .de Sp \" Vertical space (when we can't use .PP)
19 .\" .if t .sp .5v
20 .\" .if n .sp
21 .\" ..
22 .\" .de Ip \" List item
23 .\" .br
24 .\" .ie \\n(.$>=3 .ne \\$3
25 .\" .el .ne 3
26 .\" .IP "\\$1" \\$2
27 .\" ..
28 .TH IO_GETEVENTS 2 2008-07-04 "Linux" "Linux Programmer's Manual"
29 .\"O .SH NAME
30 .SH Ì¾Á°
31 .\"O io_getevents \- read asynchronous I/O events from the completion queue
32 io_getevents \- ´°Î»¥­¥å¡¼¤«¤éÈóƱ´ü I/O ¥¤¥Ù¥ó¥È¤òÆɤ߽Ф¹
33 .\"O .SH "SYNOPSIS"
34 .SH ½ñ¼°
35 .nf
36 .\" .ad l
37 .\" .hy 0
38 .B #include <linux/time.h>
39 .B #include <libaio.h>
40 .\" #include <linux/aio.h>
41 .sp
42 .\" .HP 19
43 .BI "int io_getevents(aio_context_t " ctx_id ", long " min_nr ", long " nr ,
44 .BI "                 struct io_event *" events \
45 ", struct timespec *" timeout );
46 .\" .ad
47 .\" .hy
48 .sp
49 .\"O Link with \fI\-laio\fP.
50 \fI\-laio\fP ¤È¥ê¥ó¥¯¤¹¤ë¡£
51 .fi
52 .\"O .SH "DESCRIPTION"
53 .SH ÀâÌÀ
54 .PP
55 .\"O .BR io_getevents ()
56 .\"O attempts to read at least \fImin_nr\fP events and
57 .\"O up to \fInr\fP events from the completion queue of the AIO context
58 .\"O specified by \fIctx_id\fP.
59 .BR io_getevents ()
60 ¤Ï¡¢¾¯¤Ê¤¯¤È¤â \fImin_nr\fP ¤Î¡¢ºÇÂç \fInr\fP ¸Ä¤Î
61 ¥¤¥Ù¥ó¥È¤ò¡¢ \fIctx_id\fP ¤Ç»ØÄꤵ¤ì¤¿ AIO (ÈóƱ´ü I/O) ¥³¥ó¥Æ¥­¥¹¥È¤Î
62 ´°Î»¥­¥å¡¼¤«¤éÆɤ߽Ф½¤¦¤È¤¹¤ë¡£
63 .\"O \fItimeout\fP specifies the amount of time to wait for events,
64 .\"O where a NULL timeout waits until at least \fImin_nr\fP events
65 .\"O have been seen.
66 \fItimeout\fP ¤Ï¥¤¥Ù¥ó¥ÈÆɤ߽Ф·¤ÎÂÔ¤Á»þ´Ö¤Î¹ç·×¤ò»ØÄꤹ¤ë¡£
67 ¥¿¥¤¥à¥¢¥¦¥È¤Ë NULL ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¾¯¤Ê¤¯¤È¤â \fImin_nr\fP ¸Ä¤Î¥¤¥Ù¥ó¥È¤¬
68 Æɤ߽Фµ¤ì¤ë¤Þ¤ÇÂԤĤ³¤È¤ò°ÕÌ£¤¹¤ë¡£
69 .\"O Note that \fItimeout\fP is relative and will be updated if not NULL
70 .\"O and the operation blocks.
71 Ãí°ÕÅÀ¤ò°Ê²¼¤Ë¤¢¤²¤ë:
72 \fItimeout\fP ¤ÏÁêÂÐŪ¤Ê»ØÄê¤Ç¤¢¤ë¡£
73 NULL ¤Ç¤Ê¤¤¾ì¹ç¹¹¿·¤µ¤ì¤ë¤³¤È¤â¤¢¤ê¤¨¤ë¡£
74 ¸Æ¤Ó½Ð¤·¸µ¤ÎÆ°ºî¤ÏÄä»ß¤¹¤ë¡£
75 .\"O .SH "RETURN VALUE"
76 .SH ÊÖ¤êÃÍ
77 .\"O On success,
78 .\"O .BR io_getevents ()
79 .\"O returns the number of events read: 0 if no events are
80 .\"O available, or less than \fImin_nr\fP if the \fItimeout\fP has elapsed.
81 .\"O For the failure return, see NOTES.
82 À®¸ù¤¹¤ë¤È¡¢
83 .BR io_getevents ()
84 ¤ÏÆɤ߽Ф·¤¿¥¤¥Ù¥ó¥È¿ô¤òÊÖ¤¹¡£
85 ¥¤¥Ù¥ó¥È¤¬°ì¤Ä¤âÆɤ߽Фµ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¡¢
86 \fItimeout\fP »þ´Ö¤¬·Ð²á¤·¤¿¾ì¹ç¤Ï \fImin_nr\fP Ì¤Ëþ¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£
87 ¼ºÇÔ»þ¤ÎÊÖ¤êÃͤˤĤ¤¤Æ¤Ï¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤¹¤ë¤³¤È¡£
88 .\"O .SH "ERRORS"
89 .SH ¥¨¥é¡¼
90 .TP
91 .B EFAULT
92 .\"O Either \fIevents\fP or \fItimeout\fP is an invalid pointer.
93 \fIevents\fP ¤Þ¤¿¤Ï \fItimeout\fP ¤¬Ìµ¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
94 .TP
95 .B EINVAL
96 .\"O \fIctx_id\fP is invalid.
97 .\"O \fImin_nr\fP is out of range or \fInr\fP is
98 .\"O out of range.
99 \fIctx_id\fP ¤¬Ìµ¸ú¤Ç¤¢¤ë¡£¤â¤·¤¯¤Ï¡¢\fImin_nr\fP ¤Þ¤¿¤Ï \fInr\fP ¤¬
100 Èϰϳ°¤ÎÃͤǤ¢¤ë¡£
101 .TP
102 .B EINTR
103 .\"O Interrupted by a signal handler; see
104 .\"O .BR signal (7).
105 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£
106 .BR signal (7)
107 »²¾È¡£
108 .TP
109 .B ENOSYS
110 .\"O .BR io_getevents ()
111 .\"O is not implemented on this architecture.
112 .BR io_getevents ()
113 ¤¬¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
114 .\"O .SH "VERSIONS"
115 .SH ¥Ð¡¼¥¸¥ç¥ó
116 .PP
117 .\"O The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
118 ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï 2002ǯ8·î¤Ë Linux 2.5 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
119 .\"O .SH "CONFORMING TO"
120 .SH ½àµò
121 .PP
122 .\"O .BR io_getevents ()
123 .\"O is Linux-specific and should not be used in
124 .\"O programs that are intended to be portable.
125 .BR io_getevents ()
126 ¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç
127 »ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£
128 .\"O .SH NOTES
129 .SH Ãí°Õ
130 .\"O Glibc does not provide a wrapper function for this system call.
131 glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ëÍѤΥé¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£
132
133 .\"O The wrapper provided in
134 .\"O .I libaio
135 .\"O for
136 .\"O .BR io_getevents ()
137 .\"O does not follow the usual C library conventions for indicating error:
138 .\"O on error it returns a negated error number
139 .\"O (the negative of one of the values listed in ERRORS).
140 .\"O If the system call is invoked via
141 .\"O .BR syscall (2),
142 .\"O then the return value follows the usual conventions for
143 .\"O indicating an error: \-1, with
144 .\"O .I errno
145 .\"O set to a (positive) value that indicates the error.
146 .I libaio
147 ¤Ç
148 .BR io_getevents ()
149 ÍѤËÄ󶡤µ¤ì¤Æ¤¤¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤ÎÄÌÃΤ¬Ä̾ï¤Î C ¥é¥¤¥Ö¥é¥ê¤Î
150 ´·½¬¤Ë¤·¤¿¤¬¤Ã¤Æ¤ª¤é¤º¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤ÏÉé¤Î¥¨¥é¡¼ÈÖ¹æ
151 (¥¨¥é¡¼¤ÎÀá¤ËÎóµó¤µ¤ì¤Æ¤¤¤ëÃͤΰì¤Ä¤òÉé¤Ë¤·¤¿¤â¤Î) ¤¬ÊÖ¤êÃͤȤʤ롣
152 .BR syscall (2)
153 ·Ðͳ¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë¤È¡¢ÊÖ¤êÃͤÏÄ̾ï¤Î¥¨¥é¡¼ÄÌÃΤδ·½¬¤Ë
154 ¤·¤¿¤¬¤Ã¤Æ¤â¤Î¤È¤Ê¤ê¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï \-1 ¤¬Ê֤ꡢ
155 .I errno
156 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ (Àµ¤Î) Ãͤ¬ÀßÄꤵ¤ì¤ë¡£
157 .\"O .SH "SEE ALSO"
158 .SH ´ØÏ¢¹àÌÜ
159 .PP
160 .BR io_cancel (2),
161 .BR io_destroy (2),
162 .BR io_setup (2),
163 .BR io_submit (2),
164 .BR time (7)
165 .\"O .\" .SH "NOTES"
166 .\" .SH Ãí
167 .\" .PP
168 .\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise.
169 .\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£
170 .\"O .\" .SH AUTHOR
171 .\" .SH Ãø¼Ô
172 .\" Kent Yoder.