If close(2) fails with EIO, will the file descriptor still be deleted?
问题 If a close(2) system call fails with EIO, will the file descriptor still be deleted? If yes, is it not possible to handle a spurious IO error by retrying later? If no, how should one prevent a file descriptor leak? 回答1: That's a tricky question. However, the POSIX standard does cover it in the description of close(): 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. If an I/O error occurred while