Comtrol eCos User Manual

Page 568

Advertising
background image

Chapter 38. TCP/IP Library Reference

POLLOUT

Data can be written to the file descriptor without blocking.

POLLERR

This flag is not used in this implementation and is provided

only for source code compatibility.

POLLHUP

The file descriptor was valid before the polling process and

invalid after.

Presumably, this means that the file descrip-

tor was closed sometime during the poll.

POLLNVAL

The corresponding file descriptor is invalid.

POLLRDNORM

Same as POLLIN.

POLLRDBAND

Same as POLLIN.

POLLWRNORM

Same as POLLOUT.

POLLWRBAND

Same as POLLOUT.

POLLMSG

This flag is not used in this implementation and is provided

only for source code compatibility.

All flags except POLLIN, POLLOUT, and their synonyms are for use only in

the revents member of the pollfd structure.

An attempt to set any of

these flags in the events member will generate an error condition.

In addition to I/O multiplexing, poll() can be used to generate simple

timeouts.

This functionality may be achieved by passing a null pointer

for fds.

WARNINGS

The POLLHUP flag is only a close approximation and may not always be

accurate.

RETURN VALUES

Upon error, poll() returns a -1 and sets the global variable errno to

indicate the error.

If the timeout interval was reached before any

events occurred, a 0 is returned.

Otherwise, poll() returns the number

of file descriptors for which revents is non-zero.

ERRORS

poll() will fail if:

[EINVAL]

nfds was either a negative number or greater than the number

of available file descriptors.

[EINVAL]

An invalid flags was set in the events member of the pollfd

structure.

[EINVAL]

The timeout passed to poll() was too large.

[EAGAIN]

Resource allocation failed inside of poll().

Subsequent calls

to poll() may succeed.

[EINTR]

poll() caught a signal during the polling process.

464

Advertising