I think that this answers your question:
From Richard Stevens (rstevens@noao.edu):
The basic difference is that select()'s fd_set is a bit mask and therefore has some fixed size. It would be possible for the kernel to not limit this size when the kernel is compiled, allowing the application to define FD_SETSIZE to whatever it wants (as the comments in the system header imply today) but it takes more work. 4.4BSD's kernel and the Solaris library function both have this limit. But I see that BSD/OS 2.1 has now been coded to avoid this limit, so it's doable, just a small matter of programming. :-) Someone should file a Solaris bug report on this, and see if it ever gets fixed.
With poll(), however, the user must allocate an array of pollfd structures, and pass the number of entries in this array, so there's no fundamental limit. As Casper notes, fewer systems have poll() than select, so the latter is more portable. Also, with original implementations (SVR3) you could not set the descriptor to -1 to tell the kernel to ignore an entry in the pollfd structure, which made it hard to remove entries from the array; SVR4 gets around this. Personally, I always use select() and rarely poll(), because I port my code to BSD environments too. Someone could write an implementation of poll() that uses select(), for these environments, but I've never seen one. Both select() and poll() are being standardized by POSIX 1003.1g.
The email referenced above is at least as old as 2001; the poll()
command is now (2017) supported across all modern operating systems - including BSD. In fact, some people believe that select()
should be deprecated. Opinions aside, portability issues around poll()
are no longer a concern on modern systems. Furthermore, epoll()
has since been developed (you can read the man page), and continues to rise in popularity.
For modern development you probably don't want to use select()
, although there's nothing explicitly wrong with it. poll()
, and it's more modern evolution epoll()
, provide the same features (and more) as select()
without suffering from the limitations therein.