I've read couple of questions(here) related to this but I still have some confusion.
My understanding is that write system call puts the data into Buffered Cache
(OS caches as referred in that question). When the Buffered Cache
gets full it is written to the disk.
Buffered IO is further optimization on top of this. It caches in the C RTL buffers
and when they get full a write
system call issued to move the contents to Buffered Cache
. If I use fflush
then data related to this particular file that is present in the C RTL buffers
as well as Buffered Cache
is sent to the disk.
Is my understanding correct?