The epoll_wait prototype is:
int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout);
The select prototype is:
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
Note that epoll_wait has one special fd as the first argument and the other file descriptors are in the "events" array.
Note that select does not single out any fd; all them them are identified in the *fds arguments.
Why did epoll_wait choose to have one file descriptor as "special", rather than making it just another element in the events array.
The context of this question is I am studying epoll trying to decide if I should recode existing programs using select.
One of the programs listens to two network sockets at the same time. How would I decide which one gets the honor of being "epfd"?