Re: XFS: how to NOT null files on fsck?

H. Peter Anvin
2004-07-12T18:00:06Z

Followup to: <20040711215446.GA21443@hh.idb.hist.no>
By author: Helge Hafting <helgehaf@aitel.hist.no>
In newsgroup: linux.dev.kernel
> >
> No, it doesn't.
>
> close() will flush the C library buffer. That means the data
> moves from theose buffers to the pagacache. The program crashing
> after that will have no effect on the file. It can still
> be lost if the _kernel_ crashes though.
> If you want the pagecache flushed to disk, use fsync (or sync)
>

No it won't, since if you're using file descriptors there *is* no C
library buffer. fclose() will, though, and then call close().

-hpa