Linux read timeout. One way to do this task, is to use the select function.