But 0 shouldn't be interpreted as 'unlimited', rather than
'return immediately':
The timeout argument
specifies the minimum number of milliseconds that poll()
will block. (This interval will be rounded up to the system
clock granularity, and kernel scheduling delays mean that
the blocking interval may overrun by a small amount.)
Specifying a negative value in timeoutmeans
an infinite timeout. Specifying a timeout of
zero causes poll()
to return immediately, even if no file descriptors are
ready.
It's how the system call is implemented, not specifically how poll
works.
That's why the system call modifies 0 to become 1. And that's also
why I say when it is 0, to return without the timeout.