In the System V UNIX environment, applications use the poll()
system call instead of select(). This call is declared
as:
struct pollfd { int fd; short events; short revents; };
int poll( struct pollfd filedes[]; unsigned int nfds; int timeout /* in milliseconds */);
The poll() API appears to have two advantages over select(): its array compactly represents only the file descriptors of interest, and it does not destroy the input fields of its in-out argument. However, the former advantage is probably illusory, since select() only copies 3 bits per file descriptor, while poll() copies 64 bits. If the number of interesting descriptors exceeds 3/64 of the highest-numbered active file descriptor, poll() does more copying than select(). In any event, it shares the same scaling problem, doing work proportional to the number of interesting descriptors rather than constant effort, per event.