[gfortran] PR 20179
Paul Brook
paul@codesourcery.com
Tue May 24 13:36:00 GMT 2005
On Tuesday 24 May 2005 08:01, Janne Blomqvist wrote:
> On Tue, May 24, 2005 at 08:18:17AM +0200, FX Coudert wrote:
> > Attached patch fixes PR 20179, about mixing C and Fortran I/O. In
> > short: we don't want to close() stdout and stderr file descriptors
> > when the library exits.
>
> Uh, wouldn't the correct thing be a flush followed by close()?
> fclose() does flush before closing, but AFAIK there is no such
> guarantee for close().
According to my linux manpages close() provides exactly the same guarantees as
fclose(). They guarantee that all userspace buffers have been flushed, but do
not guarantee that the kernel has actually written the data to disk. This is
only important if you're paranoid about unexpected power outages or kernel
panics.
The difference is that C FILE* io has an extra level of buffering ontop of the
unix IO later. fclose() guarantees that this has been flushed. For close() it
doesn't exist so there's nothing to do.
Paul
More information about the Fortran
mailing list