The XFree86 xlibs code defined USE_POLL if poll was available apparently, while
the libX11 from freedesktop.org doesn't appear to.
I suspect we should use USE_POLL, but am not sure.
On Linux, however, I don't think XlibInt.c is compiled using USE_POLL;
it certainly isn't getting compiled with this set in XFree86 (I just
checked my build).
Keith, what is the right answer here? Should we be using USE_POLL
Is there any reason to prefer poll over select under Linux? Is it faster? It
seems like a lot of extra data manipulation to me.
If you want to use poll where available, it's very easy to add an autoconf test
I dunno which is preferable on Linux. I seem to remember select has some
I suppose we should ask a kernel expert...
So I called up Ted T'so....
Ted says that Poll is more efficient than select; on Linux
select is implemented in terms of poll.
Epoll is even more efficient for large numbers (thousands) of descriptors,
but we have 10-100 (in the server); in Xlib the number of descriptors is
This is probably left over from the original Linux port; Linux probably
had select before it had poll...
So a patch to use poll would be gratefully accepted; I'm happy to play victim
I'll do up a patch for this soon.
Patch committed by myself, 2003-10-31.