You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simply looping ans checking for the EINTR return code may lead to weird things in multithread environment. You can double-close a socket descriptor: the first time your own, and the next time allocated for another thread (with the same descriptor value). The problem is specifically unpleasant on some systems which may return with EINTR without actually closing a socket descriptor.
There is no general way to handle the close() call on all operating systems, so we need to do some checks.
Simply looping ans checking for the EINTR return code may lead to weird things in multithread environment. You can double-close a socket descriptor: the first time your own, and the next time allocated for another thread (with the same descriptor value). The problem is specifically unpleasant on some systems which may return with EINTR without actually closing a socket descriptor.
There is no general way to handle the close() call on all operating systems, so we need to do some checks.
Some related links:
http://alobbs.com/post/54503240599/close-and-eintr
https://bugs.chromium.org/p/chromium/issues/detail?id=269623
http://austingroupbugs.net/view.php?id=529
http://www.daemonology.net/blog/2011-12-17-POSIX-close-is-broken.html
The text was updated successfully, but these errors were encountered: