xref: /illumos-gate/usr/src/man/man3c/epoll_create.3c (revision 13b136d3061155363c62c9f6568d25b8b27da8f6)
te
Copyright (c) 2014, Joyent, Inc. All Rights Reserved.
This file and its contents are supplied under the terms of the
Common Development and Distribution License ("CDDL"), version 1.0.
You may only use this file in accordance with the terms of version
1.0 of the CDDL.

A full copy of the text of the CDDL should have accompanied this
source. A copy of the CDDL is also available via the Internet at
http://www.illumos.org/license/CDDL.
EPOLL_CREATE 3C "April 9, 2016"
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 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.

RETURN VALUES
Upon successful 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 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(5) for compatibility details and restrictions.
SEE ALSO
epoll_ctl(3C), epoll_wait(3C), epoll(5)