https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67585
Janne Blomqvist <jb at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW --- Comment #2 from Janne Blomqvist <jb at gcc dot gnu.org> --- (In reply to Dominique d'Humieres from comment #1) > > libgfortran should retry system calls failing with EINTR, with the exception > > of close(). Rationale and further reading e.g. at > > https://www.python.org/dev/peps/pep-0475/ > > I don't understand what is expected. Don't worry, I know what needs to be done. I don't have time right now, so I filed this PR so I don't forget about it. And of course, if somebody else gets it done before I do it myself, all the better.. > The only place where EINTR is used is > in raw_write file io/unix.c with a comment > > /* We must write in a loop since some systems don't restart system > calls in case of a signal. */ > > For raw_read, the comment is > > /* For read we can't do I/O in a loop like raw_write does, because > that will break applications that wait for interactive I/O. */ If you look back in the commit logs, I recall I wrote those comments myself.. FWIW, raw_write does it correctly, and while raw_read can't loop due to how terminals handle short reads, it should still be fixed to handle EINTR. And then there's all the other syscalls that can fail with EINTR.