相对于select来说,poll 也是在指定时间内论询一定数量的文件描述符,来测试其中是否有就绪的,不过,poll 提供了一个易用的方法,来实现 i/o 复用. 声明如下: #include <poll.h> int poll(struct pollfd *fds, nfds_t nfds, int timeout); 其中,struct pollfd 定义为: struct pollfd { int fd; /* file descriptor */ short events; /* req…