Re:Comparative unsafety
by cesarb on Friday April 09, 2021 @11:14AM
(#26751553)
You cannot retry close(). Quoting from https://man7.org/linux/man-pages/man2/close.2.html#NOTES
That is, once you call close(), the file descriptor is always freed (even if close() returns an error), and can be reused for an open() or similar in another thread. Retrying the close() will fail with EBADF in the best case, and close something another thread has opened in the worst case.
[ Parent
| on HN ]