Re-try read if it returns EAGAIN or EINTR