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.