From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15624 invoked by alias); 11 Feb 2010 13:15:24 -0000 Received: (qmail 15437 invoked by uid 48); 11 Feb 2010 13:15:11 -0000 Date: Thu, 11 Feb 2010 13:15:00 -0000 Subject: [Bug fortran/43032] New: FLUSH: Document that it does not call fsync() but fflush() X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg01045.txt.bz2 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