Linux poll函数深入理解
poll函数与select函数差不多 函数原型: #include int poll(struct pollfd fd[], nfds_t nfds, int timeout); struct pollfd的结构如下: struct pollfd{ int fd; // 文件描述符 short event;// 请求的事件 short revent;// 返回的事件 } 每个pollfd结构体指定了一个被监视的文件描述符。第一个参数是一个数组,即poll函数可以监视多个文件描述符。每个结构体的events是监视该文件描述符的事件掩码,由用户来设置。
下载地址
用户评论