Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: July 2017
 
 

poll.h(3HEAD)

Name

poll.h, poll - definitions for thepoll()function

Synopsis

#include <poll.h>

Description

The <poll.h> header defines the pollfd structure, which includes the following members:

int fd

the following descriptor being polled

short events

the input event flags (see below)

short revents

the output event flags (see below)

The <poll.h> header defines the following type through typedef:

nfds_t

an unsigned integer type used for the number of file descriptors

The implementation supports one or more programming environments in which the width of nfds_t is no greater than the width of type long. The names of these programming environments can be obtained using the confstr() function or the getconf utility. See confstr(3C) and getconf(1).

The following symbolic constants are defined, zero or more of which can be OR'ed together to form the events or revents members in the pollfd structure:

POLLIN

Data other than high-priority data can be read without blocking.

POLLRDNORM

Normal data can be read without blocking.

POLLRDBAND

Priority data can be read without blocking.

POLLPRI

High priority data can be read without blocking.

POLLOUT

Normal data can be written without blocking.

POLLWRNORM

Equivalent to POLLOUT.

POLLWRBAND

Priority data can be written.

POLLERR

An error has occurred (revents only).

POLLHUP

Device has been disconnected (revents only).

POLLNVAL

Invalid fd member (revents only).

The significance and semantics of normal, priority, and high-priority data are file and device-specific.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
Standard

See Also

getconf(1), poll(2), confstr(3C), attributes(5), standards(5)