How do I use poll()?
poll() accepts a pointer to a list of struct pollfd, in
which the descriptors and the events you wish to poll for are stored.
The events are specified via a bitwise mask in the events field of the
structure. The instance of the structure will later be filled in and
returned to you with any events which occured. Macros defined by
`poll.h' on SVR4 (probably older versions as well), are used to
specify the events in the field. A timeout may be specified in
milliseconds, only the type provided is an integer which is quite
perplexing. A timeout of 0 causes poll() to return immediately;
a value of @math{-1} will suspend poll until an event is found to be
true.