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.
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>
8 .\"WORD: completion queue ´°Î»¥¥å¡¼
10 .\" .de Sh \" Subsection
18 .\" .de Sp \" Vertical space (when we can't use .PP)
22 .\" .de Ip \" List item
24 .\" .ie \\n(.$>=3 .ne \\$3
28 .TH IO_GETEVENTS 2 2008-07-04 "Linux" "Linux Programmer's Manual"
31 .\"O io_getevents \- read asynchronous I/O events from the completion queue
32 io_getevents \- ´°Î»¥¥å¡¼¤«¤éÈóƱ´ü I/O ¥¤¥Ù¥ó¥È¤òÆɤ߽Ф¹
38 .B #include <linux/time.h>
39 .B #include <libaio.h>
40 .\" #include <linux/aio.h>
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 );
49 .\"O Link with \fI\-laio\fP.
50 \fI\-laio\fP ¤È¥ê¥ó¥¯¤¹¤ë¡£
52 .\"O .SH "DESCRIPTION"
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.
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
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.
72 \fItimeout\fP ¤ÏÁêÂÐŪ¤Ê»ØÄê¤Ç¤¢¤ë¡£
73 NULL ¤Ç¤Ê¤¤¾ì¹ç¹¹¿·¤µ¤ì¤ë¤³¤È¤â¤¢¤ê¤¨¤ë¡£
74 ¸Æ¤Ó½Ð¤·¸µ¤ÎÆ°ºî¤ÏÄä»ß¤¹¤ë¡£
75 .\"O .SH "RETURN VALUE"
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.
84 ¤ÏÆɤ߽Ф·¤¿¥¤¥Ù¥ó¥È¿ô¤òÊÖ¤¹¡£
85 ¥¤¥Ù¥ó¥È¤¬°ì¤Ä¤âÆɤ߽Фµ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¡¢
86 \fItimeout\fP »þ´Ö¤¬·Ð²á¤·¤¿¾ì¹ç¤Ï \fImin_nr\fP ̤Ëþ¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¡£
87 ¼ºÇÔ»þ¤ÎÊÖ¤êÃͤˤĤ¤¤Æ¤Ï¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤¹¤ë¤³¤È¡£
92 .\"O Either \fIevents\fP or \fItimeout\fP is an invalid pointer.
93 \fIevents\fP ¤Þ¤¿¤Ï \fItimeout\fP ¤¬Ìµ¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
96 .\"O \fIctx_id\fP is invalid.
97 .\"O \fImin_nr\fP is out of range or \fInr\fP is
99 \fIctx_id\fP ¤¬Ìµ¸ú¤Ç¤¢¤ë¡£¤â¤·¤¯¤Ï¡¢\fImin_nr\fP ¤Þ¤¿¤Ï \fInr\fP ¤¬
103 .\"O Interrupted by a signal handler; see
105 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£
110 .\"O .BR io_getevents ()
111 .\"O is not implemented on this architecture.
113 ¤¬¤³¤Î¥¢¡¼¥¥Æ¥¯¥Á¥ã¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
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"
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.
126 ¤Ï Linux ¸ÇͤǤ¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç
130 .\"O Glibc does not provide a wrapper function for this system call.
131 glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ëÍѤΥé¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£
133 .\"O The wrapper provided in
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
145 .\"O set to a (positive) value that indicates the error.
149 ÍѤËÄ󶡤µ¤ì¤Æ¤¤¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤ÎÄÌÃΤ¬Ä̾ï¤Î C ¥é¥¤¥Ö¥é¥ê¤Î
150 ´·½¬¤Ë¤·¤¿¤¬¤Ã¤Æ¤ª¤é¤º¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤ÏÉé¤Î¥¨¥é¡¼ÈÖ¹æ
151 (¥¨¥é¡¼¤ÎÀá¤ËÎóµó¤µ¤ì¤Æ¤¤¤ëÃͤΰì¤Ä¤òÉé¤Ë¤·¤¿¤â¤Î) ¤¬ÊÖ¤êÃͤȤʤ롣
153 ·Ðͳ¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤¹¤ë¤È¡¢ÊÖ¤êÃͤÏÄ̾ï¤Î¥¨¥é¡¼ÄÌÃΤδ·½¬¤Ë
154 ¤·¤¿¤¬¤Ã¤Æ¤â¤Î¤È¤Ê¤ê¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï \-1 ¤¬Ê֤ꡢ
156 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ (Àµ¤Î) Ãͤ¬ÀßÄꤵ¤ì¤ë¡£
168 .\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise.
169 .\" ÈóƱ´ü I/O ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Benjamin LaHaise ¤¬½ñ¤¤¤¿¡£