2 .\" epoll by Davide Libenzi ( efficient event notification retrieval )
3 .\" Copyright (C) 2003 Davide Libenzi
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.
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.
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
19 .\" Davide Libenzi <davidel@xmailserver.org>
22 .TH EPOLL_WAIT 2 "23 October 2002" Linux "Linux Programmer's Manual"
24 epoll_wait \- wait for an I/O event on an epoll file descriptor
26 .B #include <sys/epoll.h>
28 .BR "int epoll_wait(int " epfd ", struct epoll_event * " events ", int " maxevents ", int " timeout)
30 Wait for events on the
36 milliseconds. The memory area pointed to by
38 will contain the events that will be available for the caller.
45 parameter must be greater than zero. Specifying a
49 wait indefinitely, while specifying a
53 to return immediately even if no events are available ( return code equal to zero ).
60 typedef union epoll_data {
68 __uint32_t events; /* Epoll events */
69 epoll_data_t data; /* User data variable */
76 of each returned structure will contain the same data the user set with a
78 .IR ( EPOLL_CTL_ADD , EPOLL_CTL_MOD )
81 member will contain the returned event bit field.
85 returns the number of file descriptors ready for the requested I/O, or zero
86 if no file descriptor became ready during the requested
88 milliseconds. When an error occurs,
97 is not a valid file descriptor.
100 The memory area pointed to by
102 is not accessible with write permissions.
105 The call was interrupted by a signal handler before any of the
106 requested events occurred or the
116 is less than or equal to zero.
119 is a new API introduced in Linux kernel 2.5.44.
120 The interface should be finalized by Linux kernel 2.5.66.
122 .BR epoll_create (2),