EPOLL_CREATE(3C)EPOLL_CREATE(3C)NAME
epoll_create, epoll_create1 - create an epoll instance
SYNOPSIS
#include <sys/epoll.h>
int epoll_create(int size);
int epoll_create1(int flags);
DESCRIPTION
The epoll_create() and epoll_create1() functions both create an
epoll(5) instance that can be operated upon via epoll_ctl(3C),
epoll_wait(3C) and epoll_pwait(3C). epoll instances are represented as
file descriptors, and should be closed via close(2).
The only difference between the two functions is their signature;
epoll_create() takes a size argument that is vestigal and is only mean‐
ingful in as much as it must be greater than zero, while epoll_cre‐
ate1() takes a flags argument that can have any of the following val‐
ues:
EPOLL_CLOEXEC
Instance should be closed upon an exec(2); see open(2)'s
description of O_CLOEXEC.
RETURN VALUES
Upon succesful completion, 0 is returned. Otherwise, -1 is returned and
errno is set to indicate the error.
ERRORS
The epoll_create() and epoll_create1() functions will fail if:
EINVAL
Either the size is zero (epoll_create()) or the flags are
invalid (epoll_create1()).
EMFILE
There are currently {OPEN_MAX} file descriptors open in the
calling process.
ENFILE
The maximum allowable number of files is currently open in
the system.
NOTES
The epoll(5) facility is implemented for purposes of offering compati‐
bility for Linux-borne applications; native applications should con‐
tinue to prefer using event ports via the port_create(3C), port_asso‐
ciate(3C) and port_get(3C) interfaces. See epoll(5) for compatibility
details and restrictions.
SEE ALSOepoll_ctl(3C), epoll_wait(3C), epoll(5)
Apr 17, 2014 EPOLL_CREATE(3C)