SYNOPSIS
#include <poll.h>
int poll(struct pollfd fds[], nfds_t nfds, int timeout);
DESCRIPTION
The
The fds array specified the file descriptors to be examined and the events of interest for each file descriptor. It is a pointer to an array with one member for each open file descriptor of interest. The array's members are pollfd structures within which the fd member specifies an open file descriptor, and the events and revents members are bitmasks constructed by ORing a combination of the following event flags:
- POLLIN
-
Data other than high-priority data may be read without blocking.
- POLLRDNORM
-
Normal data (priority band equals 0) may be read without blocking.
- POLLRDBAND
-
Data from a non-zero priority band may be read without blocking.
- POLLPRI
-
High-priority data may be received without blocking.
- POLLOUT
-
Normal data (priority band equals 0) may be written without blocking
- POLLWRNORM
-
Same as POLLOUT.
- POLLWRBAND
-
Priority data (priority band greater than 0) may be written.
- POLLERR
-
An error has occurred on the device. This flag is only valid in the revents bitmask; it is ignored in the events member.
- POLLHUP
-
The device has been disconnected. This event and POLLOUT are mutually exclusive; a device can never be writable once a hangup has occurred. However, this event and POLLIN, POLLRDNORM, POLLRDBAND, or POLLPRI are not mutually exclusive. This flag is only valid in the revents bitmask; it is ignored in the events member.
- POLLNVAL
-
The value specified in the fd member is invalid. This flag is only valid in the revents bitmask; it is ignored in the events member.
If the value of the fd member is less than 0,
the events member is ignored and the revents member
of that entry is set to 0 on return from
In each pollfd structure,
If none of the defined events has occurred on any of the selected file
descriptors,
The
PARAMETERS
- fds
-
Is an array describing the file descriptors and I/O operations to return status on. The revents member of each entry is updated on successful return.
- nfds
-
Is the number of entries in fds.
- timeout
-
Is the minimum number of milliseconds to wait for results. If this is 0, the call returns immediately. If it is -1, the call blocks indefinitely, returning only after results are available or the call is interrupted.
RETURN VALUES
On success,
- EAGAIN
-
The allocation of internal data structures failed but a subsequent request may succeed.
- EBADF
-
One or more of the file descriptors is not a valid open file descriptor or does not support selection.
- EINTR
-
A signal was caught during
poll() . - EINVAL
-
The nfds argument is greater than OPEN_MAX.
CONFORMANCE
UNIX 98, with exceptions
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
The POLLRDNORM, POLLRDBAND, and POLLWRBAND events only apply to STREAMS devices. Since the NuTCRACKER Platform does not support STREAMS, these flags are silently ignored.
The
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.4 Documentation Build 39.