4 ms·
Great question! Here is a better explanation than I could write: https://www.joeshaw.org/dont-defer-close-on-writable-files https://www.joeshaw.org/dont-defer-
by hu3 5y ago
Great question!
Here is a better explanation than I could write:
https://www.joeshaw.org/dont-defer-close-on-writable-files https://www.joeshaw.org/dont-defer-close-on-writable-files
In resume, man close(2), gives us the potential errors.
This is the output for Ubuntu 20.04 LTS:
EBADF fd isn't a valid open file descriptor.
EINTR The close() call was interrupted by a signal; see signal(7).
EIO An I/O error occurred.
ENOSPC, EDQUOT
On NFS, these errors are not normally reported against
the first write which exceeds the available storage space,
but instead against a subsequent write(2), fsync(2), or close().