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>
21 .\" FIXME . 2.6.17 is likely to get POLLRDHUP (and its analogue
24 .TH EPOLL_CTL 2 "2002-10-23" Linux "Linux Programmer's Manual"
26 epoll_ctl \- control interface for an epoll descriptor
28 .B #include <sys/epoll.h>
30 .BI "int epoll_ctl(int " epfd ", int " op ", int " fd ", struct epoll_event *" event )
36 by requesting that the operation
38 be performed on the target file descriptor,
42 describes the object linked to the file descriptor
49 typedef union epoll_data {
57 __uint32_t events; /* Epoll events */
58 epoll_data_t data; /* User data variable */
64 member is a bit set composed using the following available event
68 The associated file is available for
73 The associated file is available for
78 There is urgent data available for
83 Error condition happened on the associated file descriptor.
85 will always wait for this event; it is not necessary to set it in
89 Hang up happened on the associated file descriptor.
91 will always wait for this event; it is not necessary to set it in
95 Sets the Edge Triggered behaviour for the associated file descriptor.
96 The default behaviour for
98 is Level Triggered. See
100 for more detailed information about Edge and Level Triggered event
101 distribution architectures.
103 .BR EPOLLONESHOT " (since kernel 2.6.2)"
104 Sets the one-shot behaviour for the associated file descriptor.
105 This means that after an event is pulled out with
107 the associated file descriptor is internally disabled and no other events
108 will be reported by the
110 interface. The user must call
114 to re-enable the file descriptor with a new event mask.
118 interface supports all file descriptors that support
126 Add the target file descriptor
132 and associate the event
134 with the internal file linked to
140 associated with the target file descriptor
144 Remove the target file descriptor
152 is ignored and can be NULL (but see BUGS below).
157 returns zero. When an error occurs,
161 is set appropriately.
166 is not a valid file descriptor.
170 was EPOLL_CTL_ADD, and the supplied file descriptor
184 or the requested operation
186 is not supported by this interface.
190 was EPOLL_CTL_MOD or EPOLL_CTL_DEL, and
196 There was insufficient memory to handle the requested
207 is a new API introduced in Linux kernel 2.5.44.
208 The interface should be finalized by Linux kernel 2.5.66.
210 In kernel versions before 2.6.9, the
212 operation required a non-NULL pointer in
214 even though this argument is ignored.
217 can be specified as NULL
221 .BR epoll_create (2),