On 02/07/2018 16:41, Thomas Stüfe wrote:
Hi Alan,

Whether to repeat close() in case of EINTR seems to differ between
platforms. POSIX leaves it open:

"If close() is interrupted by a signal that is to be caught, it shall
return -1 with errno set to [EINTR] and the state of fildes is
unspecified."

Linux recommends *not* repeating the call since the file descriptor is
closed already and repeating the close may close a reopened fd
belonging to someone else.

AIX, for instance, recommends to repeat the call:

"EINTR  The state of the FileDescriptor is undetermined. Retry the
close routine to ensure that the FileDescriptor is closed."
I think we should double check macOS and Solaris too as we've been careful in other areas to not retry close when interrupted.

-Alan

Reply via email to