[Bug fortran/43032] New: FLUSH: Document that it does not call fsync() but fflush()

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Feb 11 13:15:00 GMT 2010


http://gcc.gnu.org/onlinedocs/gfortran/FLUSH.html has:

"Flushes Fortran unit(s) currently open for output. [...] Beginning with the
Fortran 2003 standard, there is a FLUSH statement that should be preferred over
the FLUSH intrinsic"

However, it is left unclear whether fflush() or fsync() is called by the
Fortran run-time library. (Answer: fflush(); cf. also
http://gcc.gnu.org/ml/fortran/2010-02/msg00074.html)

Expected: The documentation makes clear that "only" fflush() is called and
points out that "fsync" (with the proper interface) can be called using FNUM.
Actually, the example could be enhanced.

POSIX (SUV) has for fflush:
       If  stream  points  to  an output stream or an update stream in which
the most recent
       operation was not input, fflush() shall cause any unwritten data for
that  stream  to
       be  written to the file,  and the st_ctime and st_mtime fields of the
underlying file
       shall be marked for update.
and for fsync:
       The  fsync()  function shall request that all data for the open file
descriptor named
       by fildes is to be transferred  to  the  storage  device  associated 
with  the  file
       described  by  fildes in an implementation-defined manner. The fsync()
function shall
       not return until the system has completed that action or until an error
is  detected.


-- 
           Summary: FLUSH: Document that it does not call fsync() but
                    fflush()
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: documentation
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43032



More information about the Gcc-bugs mailing list