OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / release / man2 / epoll_wait.2
1 .\"
2 .\"  epoll by Davide Libenzi ( efficient event notification retrieval )
3 .\"  Copyright (C) 2003  Davide Libenzi
4 .\"
5 .\"  This program is free software; you can redistribute it and/or modify
6 .\"  it under the terms of the GNU General Public License as published by
7 .\"  the Free Software Foundation; either version 2 of the License, or
8 .\"  (at your option) any later version.
9 .\"
10 .\"  This program is distributed in the hope that it will be useful,
11 .\"  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 .\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 .\"  GNU General Public License for more details.
14 .\"
15 .\"  You should have received a copy of the GNU General Public License
16 .\"  along with this program; if not, write to the Free Software
17 .\"  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 .\"
19 .\"  Davide Libenzi <davidel@xmailserver.org>
20 .\"
21 .\" 2007-04-30: mtk, Added description of epoll_pwait()
22 .\"
23 .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO
24 .\"         all rights reserved.
25 .\" Translated Wed Jun 16 03:05:40 JST 2004
26 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
27 .\" Updated & Modified Tue Apr 19 07:05:42 JST 2005 by Yuichi SATO
28 .\" Updated 2007-06-02, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.51
29 .\" Updated 2009-02-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.18
30 .\"
31 .TH EPOLL_WAIT 2 2009-01-17 "Linux" "Linux Programmer's Manual"
32 .SH Ì¾Á°
33 epoll_wait, epoll_pwait \- epoll ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î I/O ¥¤¥Ù¥ó¥È¤òÂÔ¤Ä
34 .SH ½ñ¼°
35 .nf
36 .B #include <sys/epoll.h>
37 .sp
38 .BI "int epoll_wait(int " epfd ", struct epoll_event *" events ,
39 .BI "               int " maxevents ", int " timeout );
40 .BI "int epoll_pwait(int " epfd ", struct epoll_event *" events ,
41 .BI "               int " maxevents ", int " timeout ,
42 .BI "               const sigset_t *" sigmask );
43 .fi
44 .SH ÀâÌÀ
45 .BR epoll_wait ()
46 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢
47 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
48 .I epfd
49 ¤Ç»²¾È¤µ¤ì¤ë
50 .B epoll
51 ¥¤¥ó¥¹¥¿¥ó¥¹¤ËÂФ¹¤ë¥¤¥Ù¥ó¥È¤òÂԤġ£
52 .I events
53 ¤¬»Ø¤¹¥á¥â¥êÎΰè¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤¬ÍøÍѲÄǽ¤Ê¥¤¥Ù¥ó¥È¤¬³ÊǼ¤µ¤ì¤ë¡£
54 ºÇÂç
55 .I maxevents
56 ¸Ä¤Î¥¤¥Ù¥ó¥È¤¬
57 .BR epoll_wait ()
58 ¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¡£
59 .I maxevents
60 °ú¤­¿ô¤Ï 0 ¤è¤êÂ礭¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
61
62 ºÇÂç¤Ç
63 .I timeout
64 ¥ß¥êÉô֥¤¥Ù¥ó¥È¤òÂԤġ£
65 .I timeout
66 ¤ò \-1 ¤Ë»ØÄꤹ¤ë¤È¡¢
67 .BR epoll_wait ()
68 ¤Ï̵¸Â¤ËÂԤġ£
69 ¤Þ¤¿
70 .I timeout
71 ¤ò 0 ¤Ë»ØÄꤹ¤ë¤È¡¢
72 .BR epoll_wait ()
73 ¤Ï¥¤¥Ù¥ó¥È¤¬ÍøÍѲÄǽ¤Ç¤Ê¤¯¤Æ¤â¡¢¤¹¤°¤ËÊÖ¤ë (ÊÖ¤êÃͤϠ0 ¤Ç¤¢¤ë)¡£
74
75 .I struct epoll_event
76 ¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë:
77 .sp
78 .in +4n
79 .nf
80 typedef union epoll_data {
81     void    *ptr;
82     int      fd;
83     uint32_t u32;
84     uint64_t u64;
85 } epoll_data_t;
86
87 struct epoll_event {
88     uint32_t     events;    /* epoll ¥¤¥Ù¥ó¥È */
89     epoll_data_t data;      /* ¥æ¡¼¥¶¥Ç¡¼¥¿ÊÑ¿ô */
90 };
91 .fi
92 .in
93
94 ÊÖ¤µ¤ì¤ë¹½Â¤ÂΤÎ
95 .I data
96 ¥á¥ó¥Ð¤Ë¤Ï¡¢¥æ¡¼¥¶¤¬
97 .BR epoll_ctl (2)
98 .RB ( EPOLL_CTL_ADD ", " EPOLL_CTL_MOD )
99 ¤Ç»ØÄꤷ¤¿¥Ç¡¼¥¿¤¬³ÊǼ¤µ¤ì¤ë¡£
100 °ìÊý¡¢
101 .I events
102 ¥á¥ó¥Ð¤Ë¤ÏÊÖ¤µ¤ì¤¿ÍøÍѲÄǽ¤Ê¥¤¥Ù¥ó¥È¤Î¥Ó¥Ã¥È¥Õ¥£¡¼¥ë¥É¤¬³ÊǼ¤µ¤ì¤ë¡£
103 .SS epoll_pwait()
104 .BR epoll_wait ()
105 ¤È
106 .BR epoll_pwait ()
107 ¤Î´Ø·¸¤Ï¡¢
108 .BR select (2)
109 ¤È
110 .BR pselect (2)
111 ¤Î´Ø·¸¤ÈƱÍͤǤ¢¤ë¡£
112 .BR pselect (2)
113 ƱÍÍ¡¢
114 .BR epoll_pwait ()
115 ¤ò»È¤¦¤È¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬½àÈ÷¤Ç¤­¤¿¾õÂ֤ˤʤ뤫¡¢
116 ¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç¡¢°ÂÁ´¤ËÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£
117
118 °Ê²¼¤Î
119 .BR epoll_pwait ()
120 ¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢
121 .nf
122
123     ready = epoll_pwait(epfd, &events, maxevents, timeout, &sigmask);
124
125 .fi
126 ¼¡¤Î¸Æ¤Ó½Ð¤·¤ò
127 .I atomic
128 ¤Ë¼Â¹Ô¤¹¤ë¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£
129 .nf
130
131     sigset_t origmask;
132
133     sigprocmask(SIG_SETMASK, &sigmask, &origmask);
134     ready = epoll_wait(epfd, &events, maxevents, timeout);
135     sigprocmask(SIG_SETMASK, &origmask, NULL);
136 .fi
137 .PP
138 .I sigmask
139 °ú¤­¿ô¤Ë¤Ï NULL ¤ò»ØÄꤷ¤Æ¤â¤è¤¤¡£
140 ¤½¤Î¾ì¹ç¤Ë¤Ï¡¢
141 .BR epoll_pwait ()
142 ¤Ï
143 .BR epoll_wait ()
144 ¤ÈÅù²Á¤È¤Ê¤ë¡£
145 .SH ÊÖ¤êÃÍ
146 À®¸ù¤·¤¿¾ì¹ç¡¢
147 .BR epoll_wait ()
148 ¤ÏÍ׵ᤵ¤ì¤¿ I/O ¤ËÂФ·¤Æ½àÈ÷¤¬¤Ç¤­¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤òÊÖ¤¹¡£
149 ¤Þ¤¿Í׵ᤵ¤ì¤¿
150 .I timeout
151 ¥ß¥êÉäδ֤˥ե¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬½àÈ÷¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¡¢0 ¤òÊÖ¤¹¡£
152 ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢
153 .BR epoll_wait ()
154 ¤Ï \-1 ¤òÊÖ¤·¡¢
155 .I errno
156 ¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£
157 .SH ¥¨¥é¡¼
158 .TP
159 .B EBADF
160 .I epfd
161 ¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
162 .TP
163 .B EFAULT
164 .I events
165 ¤Ç»Ø¤µ¤ì¤ë¥á¥â¥êÎΰè¤Ë½ñ¤­¹þ¤ß¸¢¸Â¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¡£
166 .TP
167 .B EINTR
168 Í׵ᤵ¤ì¤¿¤É¤Î¥¤¥Ù¥ó¥È¤âȯÀ¸¤»¤º¡¢¤«¤Ä
169 .I timeout
170 ¤Î´ü¸Â¤¬ÀÚ¤ì¤ëÁ°¤Ë¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¡£
171 .BR signal (7)
172 »²¾È¡£
173 .TP
174 .B EINVAL
175 .I epfd
176 ¤¬
177 .B epoll
178 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
179 ¤Þ¤¿¤Ï
180 .I maxevents
181 ¤¬ 0 °Ê²¼¤Ç¤¢¤ë¡£
182 .SH ¥Ð¡¼¥¸¥ç¥ó
183 .BR epoll_pwait ()
184 ¤Ï¥«¡¼¥Í¥ë 2.6.19 ¤Ç Linux ¤ËÄɲ䵤줿¡£
185
186 .BR epoll_pwait ()
187 ¤Î glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï glibc 2.6 °Ê¹ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£
188 .SH ½àµò
189 .BR epoll_wait ()
190 ¤Ï Linux Æȼ«¤Ç¤¢¤ê¡¢¥«¡¼¥Í¥ë 2.5.44 ¤ÇƳÆþ¤µ¤ì¤¿¡£
191 .\" ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Linux ¥«¡¼¥Í¥ë 2.5.66 ¤Ç³ÎÄꤵ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¡£
192 .SH ´ØÏ¢¹àÌÜ
193 .BR epoll_create (2),
194 .BR epoll_ctl (2),
195 .BR epoll (7)