Poll support for I/O

Poll Support for I/O
====================

Adds a new compile-time configurable option to use poll/ppoll as the select
mechanism.
This allows the system to use more than 1024 file descriptors.

Implementation Notes
--------------------
The poll state is maintained in __device_select_state_struct, which has
been augmented to include a pollfd array and count for the i/o selection.
The size of the array is configurable with MAX_POLLFDS, which matches
MAX_CONDVARS unless explicitly defined.

The state also has 2 bitmaps for read and write ready fds, which behave
similar to fd_set used in select -- but their size is not hard-limited
to 1024 fds as in select. Instead, it matches the configured size of the 
pollfd array.

The actual poll is implemented in __device_select.
On entry, the ready sets and fd count are cleared in the state.
File descriptors are added in ___device_select_add_fd, which for poll
pushes the file descriptor to the poll set and increments the count.
When the poll completes, the poll set is scanned updating the bitmaps for
the ready file descriptors.

Using a bitmap for marking the ready sets allows the existing device_select
code to work with minimal modifications, without incurring performance
penalty in the rediness checks.
The checks are implemented using __FD_ISSET, which has the same
interface for both select and poll.
When select is used, the macro is defined to FD_ISSET.
When poll is usde, the macro is defined to operate on a poll bitmap.

If the system has ppoll available (GNU/Linux), then ppoll will be used 
instead of plain poll, allowing high resolution timeouts.

Configuration Options
---------------------
A new configure option has been added to enable poll as the select mechanism:
--enable-poll

The maximum number of file descriptors in the poll set is controlled by
the MAX_POLLFDS parameter.
By default it matches MAX_CONDVARS (8192).
If you want to use more file descriptors, configure with 
CFLAGS="-DMAX_POLLFDS=XXX"

Using poll
----------
1. Regenerate configure by running autoconf.
2. Run configure with --enable-poll
3. make && make check && make install as usual.