8206145 : dbgsysSocketClose - do not restart close if errno is EINTR [linux] - was : RE: RFR : 8205959 : Do not restart close if errno is EINTR

Alan Bateman Alan.Bateman at oracle.com
Mon Jul 2 15:55:25 UTC 2018


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


More information about the serviceability-dev mailing list