When the programmer is forced to handle return codes
Posted Dec 6, 2009 0:05 UTC (Sun) by
nix (subscriber, #2304)
In reply to:
When the programmer is forced to handle return codes by cras
Parent article:
On the importance of return codes
So I guess you know what happens in Linux when close() fails with EINTR
(with NFS)? It won't close the fd and it should be retried?
The EINTR happens if a signal arrives while pending writes are being
flushed. At this point, the FD is not yet closed. (But if it were, you
could retry it anyway, and you'd get EBADF and would know that it had been
closed last time around.)
Since you have to loop for write()/read() anyway, looping for close() as
well is hardly a killer. (And, yes, I would rather that -EINTR would die
die die as fast as possible, but unfortunately it is not dead so we have
to deal with it.)
(
Log in to post comments)