OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / poll.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
4 .\" and Copyright (C) 2006, Michael Kerrisk <mtk.manpages@gmail.com>
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .\" Additions from Richard Gooch <rgooch@atnf.CSIRO.AU> and aeb, 971207
27 .\" 2006-03-13, mtk, Added ppoll() + various other rewordings
28 .\" 2006-07-01, mtk, Added POLLRDHUP + various other wording and
29 .\"     formatting changes.
30 .\"
31 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
32 .\"         all rights reserved.
33 .\" Translated 1997-12-11, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
34 .\" Updated & Modified 2004-05-22, Yuichi SATO <ysato444@yahoo.co.jp>
35 .\" Updated & Modified 2005-01-03, Yuichi SATO
36 .\" Updated & Modified 2005-10-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
37 .\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16
38 .\" Updated 2006-04-16, Akihiro MOTOKI, Catch up to LDP man-pages 2.28
39 .\" Updated 2006-07-23, Akihiro MOTOKI, Catch up to LDP man-pages 2.36
40 .\"
41 .\"WORD:        descriptor              ¥Ç¥£¥¹¥¯¥ê¥×¥¿
42 .\"
43 .TH POLL 2 2009-09-15 "Linux" "Linux Programmer's Manual"
44 .\"O .SH NAME
45 .SH Ì¾Á°
46 .\"O poll, ppoll \- wait for some event on a file descriptor
47 poll, ppoll \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤ª¤±¤ë¥¤¥Ù¥ó¥È¤òÂÔ¤Ä
48 .\"O .SH SYNOPSIS
49 .SH ½ñ¼°
50 .nf
51 .B #include <poll.h>
52 .sp
53 .BI "int poll(struct pollfd *" fds ", nfds_t " nfds ", int " timeout );
54 .sp
55 .B #define _GNU_SOURCE
56 .B #include <poll.h>
57 .sp
58 .BI "int ppoll(struct pollfd *" fds ", nfds_t " nfds ", "
59 .BI "        const struct timespec *" timeout ", const sigset_t *" sigmask );
60 .fi
61 .\"O .SH DESCRIPTION
62 .SH ÀâÌÀ
63 .\"O .BR poll ()
64 .\"O performs a similar task to
65 .\"O .BR select (2):
66 .\"O it waits for one of a set of file descriptors to become ready
67 .\"O to perform I/O.
68 .BR poll ()
69 ¤Ï
70 .BR select (2)
71 ¤ÈƱÍͤλŻö¤ò¹Ô¤¦¡¢¤Ä¤Þ¤ê¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Î¤¤¤º¤ì¤«°ì¤Ä¤¬
72 I/O ¤ò¼Â¹Ô²Äǽ¤Ê¾õÂ֤ˤʤë¤Î¤òÂԤġ£
73
74 .\"O The set of file descriptors to be monitored is specified in the
75 .\"O .I fds
76 .\"O argument, which is an array of structures of the following form:
77 ´Æ»ë¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Ï¡¢
78 .I fds
79 °ú¤­¿ô¤Ç»ØÄꤹ¤ë¡£
80 .I fds
81 ¤Ï¡¢°Ê²¼¤Î·¿¤Î¹½Â¤ÂΤÎÇÛÎó¤Ç¤¢¤ë¡£
82 .in +4n
83 .nf
84
85 struct pollfd {
86     int   fd;         /* file descriptor */
87     short events;     /* requested events */
88     short revents;    /* returned events */
89 };
90 .in
91 .fi
92 .PP
93 .\"O The caller should specify the number of items in the
94 .\"O .I fds
95 .\"O array in
96 .\"O .IR nfds .
97 .I nfds
98 ¤Ë¤Ï¡¢
99 .I fds
100 ÇÛÎó¤ÎÍ×ÁÇ¿ô¤ò»ØÄꤹ¤ë¡£
101
102 .\"O The field
103 .\"O .I fd
104 .\"O contains a file descriptor for an open file.
105 ¹½Â¤ÂΤÎ
106 .I fd
107 ¤Ë¤Ï¥ª¡¼¥×¥ó¤·¤¿¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÆþ¤ì¤ë¡£
108
109 .\"O The field
110 .\"O .I events
111 .\"O is an input parameter, a bit mask specifying the events the application
112 .\"O is interested in.
113 ¹½Â¤ÂΤÎ
114 .I events
115 Í×ÁǤÏÆþÎϥѥé¥á¡¼¥¿¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¶½Ì£¤ò»ý¤Ã¤Æ¤¤¤ë¥¤¥Ù¥ó¥È¤Î
116 ¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò»ØÄꤹ¤ë¡£
117
118 .\"O The field
119 .\"O .I revents
120 .\"O is an output parameter, filled by the kernel with the events that
121 .\"O actually occurred.
122 .\"O The bits returned in
123 .\"O .I revents
124 .\"O can include any of those specified in
125 .\"O .IR events ,
126 .\"O or one of the values
127 .\"O .BR POLLERR ,
128 .\"O .BR POLLHUP ,
129 .\"O or
130 .\"O .BR POLLNVAL .
131 .\"O (These three bits are meaningless in the
132 .\"O .I events
133 .\"O field, and will be set in the
134 .\"O .I revents
135 .\"O field whenever the corresponding condition is true.)
136 .I revents
137 Í×ÁǤϽÐÎϥѥé¥á¡¼¥¿¤Ç¡¢¼ÂºÝ¤Ëµ¯¤³¤Ã¤¿¥¤¥Ù¥ó¥È¤¬¥«¡¼¥Í¥ë¤Ë¤è¤êÀßÄꤵ¤ì¤ë¡£
138 .I revents
139 ¤ÇÊÖ¤µ¤ì¤ë¥Ó¥Ã¥ÈÎó¤Ë¤Ï¡¢
140 .I events
141 ¤Ç»ØÄꤷ¤¿¤â¤Î¤Î¤É¤ì¤«¡¢¤â¤·¤¯¤Ï
142 .BR POLLERR ,
143 .BR POLLHUP ,
144 .B POLLNVAL
145 ¤Î¤¦¤Á¤Î°ì¤Ä¤¬´Þ¤Þ¤ì¤ë
146 .RB ( POLLERR ,
147 .BR POLLHUP ,
148 .B POLLNVAL
149 ¤Î 3¤Ä¤Î¥Ó¥Ã¥È¤Ï
150 .I events
151 ¤Ë»ØÄꤷ¤Æ¤â°ÕÌ£¤¬¤Ê¤¯¡¢Âбþ¤·¤¿¾õÂÖ¤¬¿¿¤Î¾ì¹ç¤Ë
152 .I revents
153 ¤ËÀßÄꤵ¤ì¤ë)¡£
154
155 .\"O If none of the events requested (and no error) has occurred for any
156 .\"O of the file descriptors, then
157 .\"O .BR poll ()
158 .\"O blocks until one of the events occurs.
159 ¤É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤âÍ׵ᤷ¤¿¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤Æ¤ª¤é¤º¡¢
160 ¥¨¥é¡¼¤âµ¯¤³¤é¤Ê¤¤¾ì¹ç¡¢
161 .BR poll ()
162 ¤Ï¥¤¥Ù¥ó¥È¤Î¤¦¤Á¤¤¤º¤ì¤«°ì¤Ä¤¬È¯À¸¤¹¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£
163
164 .\"O The
165 .\"O .I timeout
166 .\"O argument specifies an upper limit on the time for which
167 .\"O .BR poll ()
168 .\"O will block, in milliseconds.
169 .\"O Specifying a negative value in
170 .\"O .I timeout
171 .\"O means an infinite timeout.
172 .I timeout
173 °ú¤­¿ô¤Ï
174 .BR poll ()
175 ¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤òÀßÄꤹ¤ë¤â¤Î¤Ç¡¢¥ß¥êÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£
176 .I timeout
177 ¤ËÉé¤ÎÃͤò»ØÄꤹ¤ë¤È¡¢¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤¬Ìµ¸Â¤È¤Ê¤ë¡£
178
179 .\"O The bits that may be set/returned in
180 .\"O .I events
181 .\"O and
182 .\"O .I revents
183 .\"O are defined in \fI<poll.h>\fP:
184 .I events
185 ¤Ë»ØÄꤷ¤¿¤ê¡¢
186 .I revents
187 ¤ÇÊÖ¤µ¤ì¤ë¥Ó¥Ã¥È¤Ï \fI<poll.h>\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
188 .RS
189 .TP
190 .B POLLIN
191 .\"O There is data to read.
192 Æɤ߽Ф·²Äǽ¤Ê¥Ç¡¼¥¿¤¬¤¢¤ë¡£
193 .TP
194 .B POLLPRI
195 .\"O There is urgent data to read (e.g., out-of-band data on TCP socket;
196 .\"O pseudo-terminal master in packet mode has seen state change in slave).
197 Æɤ߽Ф·²Äǽ¤Ê¶ÛµÞ¥Ç¡¼¥¿ (urgent data) ¤¬¤¢¤ë
198 (Î㤨¤Ð¡¢TCP ¥½¥±¥Ã¥È¤ÎÂÓ°è³° (out-of-band data) ¥Ç¡¼¥¿¤ò¼õ¿®¤·¤¿¾ì¹ç¤ä¡¢
199 ¥Ñ¥±¥Ã¥È¥â¡¼¥É¤Îµ¼»÷üËö¤Î¥Þ¥¹¥¿¤¬¥¹¥ì¡¼¥Ö¦¤ÎÊѲ½¤ò¸«¤Ä¤±¤¿¤È¤­)¡£
200 .TP
201 .B POLLOUT
202 .\"O Writing now will not block.
203 ½ñ¤­¹þ¤ß¤¬Ää»ß (block) ¤·¤Ê¤¤¾õÂ֤Ǥ¢¤ë¡£
204 .TP
205 .\"O .BR POLLRDHUP " (since Linux 2.6.17)"
206 .BR POLLRDHUP " (Linux 2.6.17 °Ê¹ß)"
207 .\"O Stream socket peer closed connection,
208 .\"O or shut down writing half of connection.
209 .\"O The
210 .\"O .B _GNU_SOURCE
211 .\"O feature test macro must be defined in order to obtain this definition.
212 ¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤Î¾ü¤¬¡¢¥³¥Í¥¯¥·¥ç¥ó¤ò close ¤·¤¿¤«¡¢
213 ¥³¥Í¥¯¥·¥ç¥ó¤Î½ñ¤­¹þ¤ß¦¤ò shutdown ¤·¤¿¡£
214 ¤³¤ÎÄêµÁ¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢
215 .B _GNU_SOURCE
216 µ¡Ç½¸¡ºº¥Þ¥¯¥í¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
217 .TP
218 .B POLLERR
219 .\"O Error condition (output only).
220 ¥¨¥é¡¼¾õÂÖ (½ÐÎϤξì¹ç¤Î¤ß)¡£
221 .TP
222 .B POLLHUP
223 .\"O Hang up (output only).
224 ¥Ï¥ó¥°¥¢¥Ã¥×¤·¤¿ (½ÐÎϤξì¹ç¤Î¤ß)¡£
225 .TP
226 .B POLLNVAL
227 .\"O Invalid request:
228 .\"O .I fd
229 .\"O not open (output only).
230 ÉÔÀµ¤ÊÍ×µá:
231 .I fd
232 ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤ (½ÐÎϤξì¹ç¤Î¤ß)¡£
233 .RE
234 .PP
235 .\"O When compiling with
236 .\"O .B _XOPEN_SOURCE
237 .\"O defined, one also has the following,
238 .\"O which convey no further information beyond the bits listed above:
239 .B _XOPEN_SOURCE
240 ¤òÄêµÁ¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿¾ì¹ç¤Ë¤Ï¡¢°Ê²¼¤ÎÄêµÁ¤â¹Ô¤ï¤ì¤ë¡£
241 ¤¿¤À¤·¡¢¾åµ­¤Î¥ê¥¹¥È¤Ë¤¢¤ë¥Ó¥Ã¥È°Ê¾å¤Î¾ðÊó¤¬ÆÀ¤é¤ì¤ëÌõ¤Ç¤Ï¤Ê¤¤¡£
242 .RS
243 .TP
244 .B POLLRDNORM
245 .\"O Equivalent to
246 .\"O .BR POLLIN .
247 .B POLLIN
248 ¤ÈƱ¤¸¡£
249 .TP
250 .B POLLRDBAND
251 .\"O Priority band data can be read (generally unused on Linux).
252 Í¥ÀèÂÓ°è¥Ç¡¼¥¿ (priority band data) ¤¬Æɤ߽Ф·²Äǽ¤Ç¤¢¤ë
253 (ÉáÄ̤ϠLinux ¤Ç¤Ï»ÈÍѤµ¤ì¤Ê¤¤)¡£
254 .\" POLLRDBAND is used in the DECnet protocol.
255 .TP
256 .B POLLWRNORM
257 .\"O Equivalent to
258 .\"O .BR POLLOUT .
259 .B POLLOUT
260 ¤ÈƱ¤¸¡£
261 .TP
262 .B POLLWRBAND
263 .\"O Priority data may be written.
264 Í¥ÀèÂÓ°è¥Ç¡¼¥¿ (priority data) ¤¬½ñ¤­¹þ¤ß²Äǽ¤Ç¤¢¤ë¡£
265 .RE
266 .PP
267 .\"O Linux also knows about, but does not use
268 .\"O .BR POLLMSG .
269 Linux ¤Ç¤Ï
270 .B POLLMSG
271 ¤âÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¡£
272 .SS ppoll()
273 .\"O The relationship between
274 .\"O .BR poll ()
275 .\"O and
276 .\"O .BR ppoll ()
277 .\"O is analogous to the relationship between
278 .\"O .BR select (2)
279 .\"O and
280 .\"O .BR pselect (2):
281 .\"O like
282 .\"O .BR pselect (2),
283 .\"O .BR ppoll ()
284 .\"O allows an application to safely wait until either a file descriptor
285 .\"O becomes ready or until a signal is caught.
286 .BR poll ()
287 ¤È
288 .BR ppoll ()
289 ¤Î´Ø·¸¤Ï
290 .BR select (2)
291 ¤È
292 .BR pselect (2)
293 ¤Î´Ø·¸¤ÈƱ¤¸¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë:
294 .BR pselect (2)
295 ¤ÈƱÍͤˡ¢
296 .BR ppoll ()
297 ¤ò»È¤¦¤È¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¾õÂÖÊѲ½
298 ¤â¤·¤¯¤Ï¥·¥°¥Ê¥ë¤ÎÊ᪤ò°ÂÁ´¤ËÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£
299 .PP
300 .\"O Other than the difference in the
301 .\"O .I timeout
302 .\"O argument, the following
303 .\"O .BR ppoll ()
304 .\"O call:
305 .I timeout
306 °ú¤­¿ô¤Î°ã¤¤¤ò½ü¤¯¤È¡¢°Ê²¼¤Î
307 .BR ppoll ()
308 ¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢
309 .nf
310
311     ready = ppoll(&fds, nfds, timeout, &sigmask);
312
313 .fi
314 .\"O is equivalent to
315 .\"O .I atomically
316 .\"O executing the following calls:
317 ¼¡¤Î¥³¡¼¥ë¤ò
318 .I atomic
319 ¤Ë¼Â¹Ô¤¹¤ë¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£
320 .nf
321
322     sigset_t origmask;
323
324     sigprocmask(SIG_SETMASK, &sigmask, &origmask);
325     ready = poll(&fds, nfds, timeout);
326     sigprocmask(SIG_SETMASK, &origmask, NULL);
327 .fi
328 .PP
329 .\"O See the description of
330 .\"O .BR pselect (2)
331 .\"O for an explanation of why
332 .\"O .BR ppoll ()
333 .\"O is necessary.
334 ¤Ê¤¼
335 .BR ppoll ()
336 ¤¬É¬ÍפʤΤ«¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¤Ï
337 .BR pselect (2)
338 ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£
339
340 .\"O If the
341 .\"O .I sigmask
342 .\"O argument is specified as NULL, then
343 .\"O no signal mask manipulation is performed
344 .\"O (and thus
345 .\"O .BR ppoll ()
346 .\"O differs from
347 .\"O .BR poll ()
348 .\"O only in the precision of the
349 .\"O .I timeout
350 .\"O argument).
351 .I sigmask
352 °ú¤­¿ô¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÁàºî¤Ï¹Ô¤ï¤ì¤Ê¤¤
353 (¤·¤¿¤¬¤Ã¤Æ¡¢
354 .BR ppoll ()
355 ¤Î
356 .BR poll ()
357 ¤È¤Î°ã¤¤¤Ï
358 .I timeout
359 °ú¤­¿ô¤ÎÀºÅÙ¤À¤±¤È¤Ê¤ë)¡£
360
361 .\"O The
362 .\"O .I timeout
363 .\"O argument specifies an upper limit on the amount of time that
364 .\"O .BR ppoll ()
365 .\"O will block.
366 .\"O This argument is a pointer to a structure of the following form:
367 .I timeout
368 °ú¤­¿ô¤Ï
369 .BR ppoll ()
370 ¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£
371 ¤³¤Î°ú¤­¿ô¤Ë¤Ï°Ê²¼¤Î·¿¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò»ØÄꤹ¤ë¡£
372 .in +4n
373 .nf
374
375 struct timespec {
376     long    tv_sec;         /* seconds */
377     long    tv_nsec;        /* nanoseconds */
378 };
379 .fi
380 .in
381
382 .\"O If
383 .\"O .I timeout
384 .\"O is specified as NULL, then
385 .\"O .BR ppoll ()
386 .\"O can block indefinitely.
387 .I timeout
388 ¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
389 .B ppoll
390 ¤Ï̵¸Â¤ËÄä»ß¤¹¤ë¤³¤È¤¬¤¢¤êÆÀ¤ë¡£
391 .\"O .SH "RETURN VALUE"
392 .SH ÊÖ¤êÃÍ
393 .\"O On success, a positive number is returned; this is
394 .\"O the number of structures which have nonzero
395 .\"O .I revents
396 .\"O fields (in other words, those descriptors with events or errors reported).
397 .\"O A value of 0 indicates that the call timed out and no file
398 .\"O descriptors were ready.
399 .\"O On error, \-1 is returned, and
400 .\"O .I errno
401 .\"O is set appropriately.
402 À®¸ù¤·¤¿¾ì¹ç¤ÏÀµ¤Î¿ô¤òÊÖ¤¹¡£¤³¤Î¿ô¤Ï 0 °Ê³°¤Î
403 .I revents
404 Í×ÁǤò»ý¤Ä¹½Â¤ÂΤοô¤Ç¤¢¤ë (Ê̤θÀ¤¤Êý¤ò¤¹¤ë¤È¡¢¤³¤ì¤é¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿
405 ¤Ë¤Ï¥¤¥Ù¥ó¥È¤«¥¨¥é¡¼Êó¹ð¤¬¤¢¤ë)¡£
406 ÃÍ 0 ¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È¤È¤Ê¤ê¡¢¤É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤â¥¤¥Ù¥ó¥È¤¬
407 ȯÀ¸¤·¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
408 .I errno
409 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
410 .\"O .SH ERRORS
411 .SH ¥¨¥é¡¼
412 .TP
413 .B EFAULT
414 .\"O The array given as argument was not contained in the calling program's
415 .\"O address space.
416 °ú¤­¿ô¤È¤·¤Æ»ØÄꤷ¤¿ÇÛÎ󤬡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë
417 ´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£
418 .TP
419 .B EINTR
420 .\"O A signal occurred before any requested event; see
421 .\"O .BR signal (7).
422 Í׵ᤵ¤ì¤¿¥¤¥Ù¥ó¥È¤Î¤É¤ì¤«¤¬µ¯¤³¤ëÁ°¤Ë¥·¥°¥Ê¥ë¤¬È¯À¸¤·¤¿¡£
423 .BR signal (7)
424 »²¾È¡£
425 .TP
426 .B EINVAL
427 .\"O The
428 .\"O .I nfds
429 .\"O value exceeds the
430 .\"O .B RLIMIT_NOFILE
431 .\"O value.
432 .I nfds
433 ¤ÎÃͤ¬
434 .B RLIMIT_NOFILE
435 ¤òĶ¤¨¤¿¡£
436 .TP
437 .B ENOMEM
438 .\"O There was no space to allocate file descriptor tables.
439 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë¤ò³ÎÊݤ¹¤ë¤¿¤á¤Î¥á¥â¥ê¤¬¤Ê¤¤¡£
440 .\"O .SH VERSIONS
441 .SH ¥Ð¡¼¥¸¥ç¥ó
442 .\"O The
443 .\"O .BR poll ()
444 .\"O system call was introduced in Linux 2.1.23.
445 .\"O The
446 .\"O .BR poll ()
447 .\"O library call was introduced in libc 5.4.28
448 .\"O (and provides emulation using select(2) if your kernel does not
449 .\"O have a
450 .\"O .BR poll ()
451 .\"O system call).
452 .BR poll ()
453 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.1.23 ¤ÇƳÆþ¤µ¤ì¤¿¡£
454 .BR poll ()
455 ¥é¥¤¥Ö¥é¥ê¡¦¥³¡¼¥ë¤Ï libc 5.4.28 ¤«¤éƳÆþ¤µ¤ì¤¿
456 (¤³¤ì¤Ï¥«¡¼¥Í¥ë¤¬
457 .BR poll ()
458 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë
459 .BR select (2)
460 ¤ò»ÈÍѤ·¤Æ¥¨¥ß¥å¥ì¡¼¥È¤ò¹Ô¤¦)¡£
461
462 .\"O The
463 .\"O .BR ppoll ()
464 .\"O system call was added to Linux in kernel 2.6.16.
465 .\"O The
466 .\"O .BR ppoll ()
467 .\"O library call was added in glibc 2.4.
468 .BR ppoll ()
469 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï ¥«¡¼¥Í¥ë 2.6.16 ¤Ç Linux ¤ËÄɲ䵤줿¡£
470 .BR ppoll ()
471 ¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤Ï glibc 2.4 ¤ËÄɲ䵤줿¡£
472 .\"O .SH "CONFORMING TO"
473 .SH ½àµò
474 .\"O .BR poll ()
475 .\"O conforms to POSIX.1-2001.
476 .\"O .BR ppoll ()
477 .\"O is Linux-specific.
478 .\"O .\" NetBSD 3.0 has a pollts() which is like Linux ppoll().
479 .BR poll ()
480 ¤Ï POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£
481 .BR ppoll ()
482 ¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£
483 .\" NetBSD 3.0 ¤Ë¤Ï pollts() ¤¬¤¢¤ë¡£
484 .\" pollts() ¤Ï Linux ppoll () ¤ÈƱ¤¸¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£
485 .\"O .SH NOTES
486 .SH Ãí°Õ
487 .\"O Some implementations define the nonstandard constant
488 .\"O .B INFTIM
489 .\"O with the value \-1 for use as a
490 .\"O .IR timeout .
491 .\"O This constant is not provided in glibc.
492 ¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤Ï¡¢ÃÍ \-1 ¤ò»ý¤Ã¤¿Èóɸ½à¤ÎÄê¿ô
493 .B INFTIM
494 ¤¬ÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢
495 .I timeout
496 ¤Î»ØÄê¤Ë»ÈÍѤǤ­¤ë¡£
497 ¤³¤ÎÄê¿ô¤Ï glibc ¤Ç¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
498 .\"O .SS "LINUX NOTES"
499 .SS "Linux ¤Ç¤ÎÃí°Õ"
500 .\"O The Linux
501 .\"O .BR ppoll ()
502 .\"O system call modifies its
503 .\"O .I timeout
504 .\"O argument.
505 .\"O However, the glibc wrapper function hides this behavior
506 .\"O by using a local variable for the timeout argument that
507 .\"O is passed to the system call.
508 .\"O Thus, the glibc
509 .\"O .BR ppoll ()
510 .\"O function does not modify its
511 .\"O .I timeout
512 .\"O argument.
513 Linux ¤Î
514 .BR ppoll ()
515 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
516 .I timeout
517 °ú¤­¿ô¤òÊѹ¹¤¹¤ë¡£
518 ¤·¤«¤·¡¢glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ timeout °ú¤­¿ô
519 ¤È¤·¤Æ¥í¡¼¥«¥ëÊÑ¿ô¤ò»È¤¦¤³¤È¤Ç¤³¤ÎÆ°ºî¤ò±£Ê䷤Ƥ¤¤ë¡£
520 ¤³¤Î¤¿¤á¡¢glibc ¤Î
521 .BR ppoll ()
522 ´Ø¿ô¤Ï
523 .I timeout
524 °ú¤­¿ô¤òÊѹ¹¤·¤Ê¤¤¡£
525 .\"O .SH BUGS
526 .SH ¥Ð¥°
527 .\"O See the discussion of spurious readiness notifications under the
528 .\"O BUGS section of
529 .\"O .BR select (2).
530 .BR select (2)
531 ¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡¢¸í¤Ã¤¿½àÈ÷´°Î»ÄÌÃΠ(spurious readiness
532 notifications) ¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤ò»²¾È¤Î¤³¤È¡£
533 .\"O .SH "SEE ALSO"
534 .SH ´ØÏ¢¹àÌÜ
535 .BR select (2),
536 .BR select_tut (2),
537 .BR feature_test_macros (7),
538 .BR time (7)