If you are keeping up to date on my blogging then you will know I have a program that opens a file, pulls the file's contents into memory (pulls a full block), gets a pointer to the file's contents, and then reads or overwrites at that location. The problem is that I need to get the data that is overwritten back down to the disk.
The procedure to do this has to be: 1. Mark the buffer (page?) dirty, then 2. Flush the buffer. Marking the buffer is the easy part, flushing is the harder part for some reason. I can successfully do this; however, it takes a full reboot. This isn't acceptable. Once I find the right function(s) to write my content back down to disk. I will have a way to write directly into slack space of a file.
fsync()? O_DIRECT? O_SYNC?
fsync()? O_DIRECT? O_SYNC?
Fsync
From your question I am assuming you are asking if I attempted to use fsync or a function there of. I have attempted to use fysnc directly from the command line as root; it had no effect.
As far as
O_DIRECTandO_SYNC, I will begin researching them. They look promising. I will post what I find. Thanks for the help.