I have seen code like this:
again:
if ((n = read(fd, buf, BUFFSIZE)) < 0) {
if (errno == EINTR)
goto again; /* just an interrupted system call */
/* handle other errors */
}
The idea is to retry a system call if it fails because it was interrupted. But is it a good idea? When is it a good idea and when should I not do this? Is this specific to certain platforms, or can Windows or Unix have system calls fail with EINTR?