from: http://hi.baidu.com/makeittrue/blog/item/bb6ca4371b4941360b55a954.html
参考:http://wenku.baidu.com/view/0ea86ffdc8d376eeaeaa3198.html
select()系统调用提供一个机制来实现同步多元I/O:
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
int select (int n,
fd_set *readfds,
fd_set *writefds,
fd_set *exceptfds,
struct timeval *timeout);
FD_CLR(int fd, fd_set *set);
FD_ISSET(int fd, fd_set *set);
FD_SET(int fd, fd_set *set);
FD_ZERO(fd_set *set);