> There is no reason to "protect" reads against EINTR because EINTR > cannot happen unless the application specifically chooses for it to > happen (by installing a non-restarting signal handler). EINTR does not > just randomly happen.
It can, if you take the standard literally. IĀ agree that you *should* be able to assume that unblockable signals have SA_RESTART behaviour, that would simplify Unix programming a whole lot. But as of today, you can't, and I'd rather be on the safe side. > My claim is that code doing such protection is wrong and harmful to > begin with. I disagree, because it has its uses. But I think we can agree that it is wrong to do it *in the libc*. The programmer should have the choice to handle EINTR himself. > Think of programs that do something like: > alarm(1); > fgets(buf, sizeof buf, f); SIGALRM is raised. SIGALRM isn't caught. SIGALRM kills the process, even if it was blocking on a safe_read() function. Where's the problem? -- Laurent _______________________________________________ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc