ppoll
- 接口定义
int ppoll(struct pollfd *fds,nfds_t nfds,const struct timespec *_Nullable tmo_p,const sigset_t *_Nullable sigmask)。
- 接口描述
- 接口约束
- 参数说明
表1 参数说明 输入参数
输入/输出
范围
数据类型
含义
版本
“fds”
I/O
valid array
struct pollfd*
文件描述符及关注事件;返回时填充实际发生的事件revents
1.0.0
“nfds”
I
>0
nfds_t
fds数组的元素个数
1.0.0
“tmo_p”
I
NULL or timespec ptr
const struct timespec*
超时时间(纳秒精度),NULL表示无限等待
1.0.0
“sigmask”
I
NULL or sigset ptr
const sigset_t*
等待期间临时使用的信号掩码,NULL表示不替换
1.0.0
- 接口返回值
表2 接口返回值 返回码
返回值
描述
HLC_ERR
“-1”
失败,并设置errno
-
“0”
超时
READY_FD_NUM
“>0”
成功:就绪描述符个数
父主题: 对外接口