c语言 linux 中 poll 的参数

#include <sys/poll.h>
int poll(struct pollfd *ufds, unsigned int nfds, int timeout);
struct pollfd
{
int fd; /* 想查询的文件描述符. */
short int events; /* fd 上,我们感兴趣的事件*/
short int revents; /* Types of events that actually occurred. */
};

请问第二个参数unsigned int nfds的含义,它传递什么信息?
最新回答
瑾沫流年

2025-06-21 05:02:37

ufds 指向 struct pollfd 数组
nfds 指定 pollfd 数组元素的个数,也就是要监测几个 pollfd