If only.... on many operating systems, you shouldn't retry close on EINTR, e.g. From [linux man page](http://man7.org/linux/man-pages/man2/close.2.html):
> In particular close() should not be retried after an EINTR since this may cause a reused descriptor from another thread to be closed.
Worse, it's different per operating system!
- HP-UX you must try again
- Linux, Solaris and AIX you don't want to try again
- OSX is ill-defined and hence unsafe, you should use `close$nocancel` instead of `close` and _not_ try again.
Related links:
- http://austingroupbugs.net/view.php?id=529
- http://alobbs.com/post/54503240599/close-and-eintr
- http://www.daemonology.net/blog/2011-12-17-POSIX-close-is-br...
- https://code.google.com/p/chromium/issues/detail?id=269623
- https://github.com/wahern/cqueues/issues/56
- https://github.com/ziglang/zig/issues/2425
If only.... on many operating systems, you shouldn't retry close on EINTR, e.g. From [linux man page](http://man7.org/linux/man-pages/man2/close.2.html):
> In particular close() should not be retried after an EINTR since this may cause a reused descriptor from another thread to be closed.
Worse, it's different per operating system!
- HP-UX you must try again
- Linux, Solaris and AIX you don't want to try again
- OSX is ill-defined and hence unsafe, you should use `close$nocancel` instead of `close` and _not_ try again.
Related links:
- http://austingroupbugs.net/view.php?id=529
- http://alobbs.com/post/54503240599/close-and-eintr
- http://www.daemonology.net/blog/2011-12-17-POSIX-close-is-br...
- https://code.google.com/p/chromium/issues/detail?id=269623
- https://github.com/wahern/cqueues/issues/56
- https://github.com/ziglang/zig/issues/2425