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 .\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
22 .\" Modified 2005-04-04 by Marko Kohtala <marko.kohtala@gmail.com>
23 .\" 2008-10-10, mtk: add description of epoll_create1()
25 .TH EPOLL_CREATE 2 2009-01-17 "Linux" "Linux Programmer's Manual"
27 epoll_create, epoll_create1 \- open an epoll file descriptor
30 .B #include <sys/epoll.h>
32 .BI "int epoll_create(int " size );
33 .BI "int epoll_create1(int " flags );
37 creates an epoll "instance",
38 requesting the kernel to allocate an event backing store dimensioned for
43 is not the maximum size of the backing store but
44 just a hint to the kernel about how to dimension internal structures.
47 is ignored; see NOTES below.)
50 returns a file descriptor referring to the new epoll instance.
51 This file descriptor is used for all the subsequent calls to the
54 When no longer required, the file descriptor returned by
56 should be closed by using
58 When all file descriptors referring to an epoll instance have been closed,
59 the kernel destroys the instance
60 and releases the associated resources for reuse.
64 is 0, then, other than the fact that the obsolete
70 The following value can be included in
72 to obtain different behavior:
77 flag on the new file descriptor.
78 See the description of the
82 for reasons why this may be useful.
86 return a nonnegative file descriptor.
87 On error, \-1 is returned, and
89 is set to indicate the error.
97 .RB ( epoll_create1 ())
98 Invalid value specified in
102 The per-user limit on the number of epoll instances imposed by
103 .I /proc/sys/fs/epoll/max_user_instances
110 The system limit on the total number of open files has been reached.
113 There was insufficient memory to create the kernel object.
116 is Linux-specific, and was introduced in kernel 2.5.44.
117 .\" The interface should be finalized by Linux kernel 2.5.66.
119 Since Linux 2.6.8, the
122 (The kernel dynamically sizes the required data structures
123 without needing this initial hint.)