1 EPOLL_CREATE(3C)         Standard C Library Functions         EPOLL_CREATE(3C)
   2 
   3 
   4 
   5 NAME
   6        epoll_create, epoll_create1 - create an epoll instance
   7 
   8 SYNOPSIS
   9        #include <sys/epoll.h>
  10 
  11        int epoll_create(int size);
  12 
  13 
  14        int epoll_create1(int flags);
  15 
  16 
  17 DESCRIPTION
  18        The epoll_create() and epoll_create1() functions both create an
  19        epoll(5) instance that can be operated upon via epoll_ctl(3C),
  20        epoll_wait(3C) and epoll_pwait(3C).  epoll instances are represented as
  21        file descriptors, and should be closed via close(2).
  22 
  23        The only difference between the two functions is their signature;
  24        epoll_create() takes a size argument that is vestigal and is only
  25        meaningful in as much as it must be greater than zero, while
  26        epoll_create1() takes a flags argument that can have any of the
  27        following values:
  28 
  29 
  30        EPOLL_CLOEXEC
  31                    Instance should be closed upon an exec(2); see open(2)'s
  32                    description of O_CLOEXEC.
  33 
  34 
  35 RETURN VALUES
  36        Upon successful completion, 0 is returned. Otherwise, -1 is returned
  37        and errno is set to indicate the error.
  38 
  39 ERRORS
  40        The epoll_create() and epoll_create1() functions will fail if:
  41 
  42        EINVAL
  43                  Either the size is zero (epoll_create()) or the flags are
  44                  invalid (epoll_create1()).
  45 
  46 
  47        EMFILE
  48                  There are currently {OPEN_MAX} file descriptors open in the
  49                  calling process.
  50 
  51 
  52        ENFILE
  53                  The maximum allowable number of files is currently open in
  54                  the system.
  55 
  56 
  57 
  58 NOTES
  59        The epoll(5) facility is implemented for purposes of offering
  60        compatibility for Linux-borne applications; native applications should
  61        continue to prefer using event ports via the port_create(3C),
  62        port_associate(3C) and port_get(3C) interfaces.  See epoll(5) for
  63        compatibility details and restrictions.
  64 
  65 
  66 SEE ALSO
  67        epoll_ctl(3C), epoll_wait(3C), epoll(5)
  68 
  69 
  70 
  71                                  April 9, 2016                EPOLL_CREATE(3C)