From: Dave Hylands <dhylands@br...> - 2004-12-17 15:08:26
> MinGW uses the msvc runtime library, and ms doesn't
> publish the source, at least not freely and publicly.
If you have a copy of Visual Studio, then almost all of the C runtime
source (with the exception of some core floating point stuff and the
exception handling stuff) comes on the CD.
You can choose to install it when you install VC++. I've never tried to
go back and install it after the fact.
I took a quick look at the fflush source, and it's basically just
checking to see if any data exists in the buffer, and if there is, it
issues a write.
Then it calls commit, which winds up calling the Win32 function
FlushFileBuffer. The commit only happens if the files was opened in
"commit mode" which means passing in the letter 'c' as one of the mode
characters when you call fopen.
The 'c' option is documented on Microsoft's fopen:
And the fflush does pretty much exactly what it says it does:
The stuff about COMMODE cause the default commit mode to set to true, so
that files opened witout the 'c' mode, will be opened as if it was
Vancouver, BC, Canada