If the read() system call in unix returns fewer bytes than expected, retry
it until it either returns zero or an error.