poll function

  1. @Native<Int Function(Pointer<PollFd>, UnsignedLong, Int)>(Pointer<PollFd>, UnsignedLong, Int)>()
int poll(
  1. Pointer<PollFd> fds,
  2. int count,
  3. int timeout
)

poll(2): waits for the events of count descriptors of fds, at most timeout milliseconds (-1 for ever); how many have some, 0 when the time ran out, or -1 (a signal came: EINTR).

Not a leaf call, as it blocks: the VM goes on while it waits, and errno after it can't be trusted.

Implementation

@Native<Int Function(Pointer<PollFd>, UnsignedLong, Int)>()
external int poll(Pointer<PollFd> fds, int count, int timeout);