Tubetrue01 / articles

0 stars 0 forks source link

IO 多路复用(三)poll 函数 | Tubetrue01 #8

Open Tubetrue01 opened 3 years ago

Tubetrue01 commented 3 years ago

https://tubetrue01.github.io/articles/2020/12/18/c_io/IO%20%E5%A4%9A%E8%B7%AF%E5%A4%8D%E7%94%A8(%E4%B8%89)poll%20%E5%87%BD%E6%95%B0/

引言 据说 poll 函数起源于 SVR3,最初局限于流设备。而到了 SVR4 取消了这种限制,允许 poll 工作在任何描述符上。 功能与 select 类似,不过在处理流设备时,它能够提供额外的信息。 1.0 函数原型123#include <sys/poll.h>int poll(struct pollfd *fdarray, nfds_t nfds, int timeout)