You must use unbuffered I / O for writing, in Carbon it is FSWriteFork() with kFSNoCacheBit , in BSD use fcntl() with F_NOCACHE .
Instead of using a system non-blocking IO, you might need to consider a workflow to write blocks sequentially using a queue. This will give you more control and may be easier, especially if you want to keep track of the queue to make sure that you support it or not.
See here for more details.
source share