开发者
资源
文档评分
获取效率
正确性
完整性
易理解
在线提单
论坛求助

ppoll

  1. 接口定义
    int ppoll(struct pollfd *fds,nfds_t nfds,const struct timespec *_Nullable tmo_p,const sigset_t *_Nullable sigmask)。
  2. 接口描述

    与poll()类似,但使用timespec提供纳秒级精度,并可在等待期间临时替换信号掩码。

  3. 接口约束

    NA。

  4. 参数说明
    表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

  5. 接口返回值
    表2 接口返回值

    返回码

    返回值

    描述

    HLC_ERR

    “-1”

    失败,并设置errno

    -

    “0”

    超时

    READY_FD_NUM

    “>0”

    成功:就绪描述符个数