在《The Linux Programming Interface》的 63.2.1 The select() System Call中讲述了 select() 函数的用法
下面是原型:
1 #include <sys/time.h> /* For portability */ 2 #include <sys/select.h> 3 int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, 4 struct timeval *timeout); 5 6 Returns number of ready file descriptors, 0 on timeout, or –1 on error