calls to open are wrapped in a loop to retry if they are interrupted (EINTR)