1EPOLL_CREATE(2)            Linux Programmer's Manual           EPOLL_CREATE(2)
2
3
4

NAME

6       epoll_create, epoll_create1 - open an epoll file descriptor
7

SYNOPSIS

9       #include <sys/epoll.h>
10
11       int epoll_create(int size);
12       int epoll_create1(int flags);
13

DESCRIPTION

15       epoll_create()  creates  an  epoll "instance", requesting the kernel to
16       allocate an event backing store dimensioned for size descriptors.   The
17       size  is  not  the maximum size of the backing store but just a hint to
18       the kernel about how to dimension internal structures.  (Nowadays, size
19       is ignored; see NOTES below.)
20
21       epoll_create()  returns  a  file  descriptor referring to the new epoll
22       instance.  This file descriptor is used for all the subsequent calls to
23       the  epoll  interface.   When  no  longer required, the file descriptor
24       returned by epoll_create() should be closed by  using  close(2).   When
25       all  file  descriptors referring to an epoll instance have been closed,
26       the kernel destroys the instance and releases the associated  resources
27       for reuse.
28
29       If  flags  is 0, then, other than the fact that the obsolete size argu‐
30       ment is dropped, epoll_create1() is the same  as  epoll_create().   The
31       following value can be included in flags to obtain different behavior:
32
33       EPOLL_CLOEXEC
34              Set the close-on-exec (FD_CLOEXEC) flag on the new file descrip‐
35              tor.  See the description of the O_CLOEXEC flag in  open(2)  for
36              reasons why this may be useful.
37

RETURN VALUE

39       On  success,  these  system calls return a nonnegative file descriptor.
40       On error, -1 is returned, and errno is set to indicate the error.
41

ERRORS

43       EINVAL size is not positive.
44
45       EINVAL (epoll_create1()) Invalid value specified in flags.
46
47       EMFILE The per-user limit on the number of epoll instances  imposed  by
48              /proc/sys/fs/epoll/max_user_instances   was   encountered.   See
49              epoll(7) for further details.
50
51       ENFILE The system limit on the total number  of  open  files  has  been
52              reached.
53
54       ENOMEM There was insufficient memory to create the kernel object.
55

CONFORMING TO

57       epoll_create() is Linux-specific, and was introduced in kernel 2.5.44.
58

NOTES

60       Since  Linux  2.6.8,  the size argument is unused.  (The kernel dynami‐
61       cally sizes the required data structures without needing  this  initial
62       hint.)
63

SEE ALSO

65       close(2), epoll_ctl(2), epoll_wait(2), epoll(7)
66

COLOPHON

68       This  page  is  part of release 3.25 of the Linux man-pages project.  A
69       description of the project, and information about reporting  bugs,  can
70       be found at http://www.kernel.org/doc/man-pages/.
71
72
73
74Linux                             2009-01-17                   EPOLL_CREATE(2)
Impressum