Kyle Jones writes:
stat() is relatively expensive compared to fstat(). Also, it
is surprising (to me) that close() would fiddle with the file
modtime, given that close() does no implicit flushing of data.
It is surprising to me as well, but expermental evidence shows that it
is true in several cases, in particular the case of NFS mounts where
both client and server are running Linux. And the comments in the
fileio.c show that people have been running into this misfeature on
other systems as well - Apollo, VMS and WinNT.
On a more general note, why is HAVE_FSYNC being handled the way it is
(in src/sysfile.h) instead of by the configure script? The existing
logic seems convoluted - since Linux #defines USG, sysfile decides not
to #define HAVE_FSYNC, even though Linux has fsync. Am I
misunderstanding the purpose/meaning of the HAVE_FSYNC symbol? What
does USG have to do with it?