I wrote:
> Any theories about what is happening?
Hah --- the AIX failures, at least, are explained at
http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/fsync.htm
which says
Error Codes
The fsync or fsync_range subroutine is unsuccessful if one or more of the following are true:
EIO An I/O error occurred while reading from or writing to the file system.
EBADF The FileDescriptor parameter is not a valid file descriptor open for writing.
EINVAL The file is not a regular file.
EINTR The subroutine was interrupted by a signal.
So the problem is that fsync_fname is trying to fsync a file it's opened
O_RDONLY. I don't know whether Windows is similarly picky, but we'll
soon find out.
Now, this doesn't mean that all is fine and dandy. I believe that a
majority of Unixen will reject attempts to open directories for writing,
so this solution puts us even further away from being able to fsync the
directories. I would bet however that the platforms that reject this
are ones that don't need fsync on directories. Maybe we just have to
have two different code paths depending on platform :-(
regards, tom lane