EPOLL_CREATE(3C) Standard C Library Functions EPOLL_CREATE(3C)

epoll_create, epoll_create1 - create an epoll instance

#include <sys/epoll.h>
int epoll_create(int size);

int epoll_create1(int flags);

The epoll_create() and epoll_create1() functions both create an epoll(7) 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 vestigial and is only meaningful in as much as it must be greater than zero, while epoll_create1() takes a flags argument that can have any of the following values:

EPOLL_CLOEXEC

Instance should be closed upon an exec(2); see open(2)'s description of O_CLOEXEC.

Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.

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.

The epoll(7) facility is implemented for purposes of offering compatibility for Linux-borne applications; native applications should continue to prefer using event ports via the port_create(3C), port_associate(3C) and port_get(3C) interfaces. See epoll(7) for compatibility details and restrictions.

epoll_ctl(3C), epoll_wait(3C), epoll(7)

February 17, 2023 OmniOS