Difference between select() and fcntl()
If
select()
times out but you go to read a blocking file descriptor that is not ready, then you will block. The call toselect()
does not affect the behaviour of the file descriptor at all.If data is ready immediately, the
select()
call will return immediately. If the data is ready after 1 second, theselect()
call will return after 1 second. It will only return after 10 seconds if no data was ready during that time (or if the data arrived just fractionally before the timeout occurred).