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

Thomas Stüfe thomas.stuefe at gmail.com
Mon Jul 2 15:41:52 UTC 2018


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."

Best Regards, Thomas







On Mon, Jul 2, 2018 at 4:09 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> On 02/07/2018 14:44, Baesken, Matthias wrote:
>>
>> I created a bug  and a webrev  , please review .
>>
>>
>> https://bugs.openjdk.java.net/browse/JDK-8206145
>>
>> http://cr.openjdk.java.net/~mbaesken/webrevs/8206145/
>>
> Why is this Linux only? I assume the do-while should be removed completely.
>
> -Alan.


More information about the serviceability-dev mailing list