int(-1..1) peek() int(-1..1) peek(int|float timeout)
Check if there is data available to read, or wait some time for available data to read.
Returns 1 if there is data available to read, 0 (zero) if there is no data available, and -1 if something went wrong.
1
0
-1
errno() , read()
The function may be interrupted prematurely of the timeout (due to signals); check the timing manually if this is imporant.