int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
struct pollfd { int fd; //文件描述符 short events; //要求检测的事件掩码 short revents; //返回的事件掩码 } typedef unsigned long nfds_t; int poll(struct pollfd *fds, nfds_t nfds, int timeout);
原文地址:http://blog.csdn.net/shltsh/article/details/39323603