What does poll() do with a timeout of 0?

前端 未结 3 2517
自闭症患者
自闭症患者 2021-02-19 21:02

I\'m looking at the poll() man page, and it tells me the behavior of poll() when positive and negative values are passed in for the timeout parameter.

3条回答
  •  梦毁少年i
    2021-02-19 21:51

    From the Ubuntu man pages:

    The timeout argument specifies an upper limit on the time for which poll() will block, in milliseconds. Specifying a negative value in timeout means an infinite timeout.

    Because there is no special case for 0, I would assume that poll() will block for 0 milliseconds.

提交回复
热议问题