Replies: 1 comment
-
Thank you for bringing this to my attention. I've updated https://justine.lol/cosmopolitan/functions.html so that fsync() and fdatasync() are now green on Windows, per the information you've shared. I'm also taking this as an opportunity to add notes for other platforms. For example, on XNU you really should consider doing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Regarding the page https://justine.lol/cosmopolitan/functions.html, there's a grid of Green squares, Red squares, and Brown squares.
I was looking at "fsync" on Windows, and it shows a brown square, says "Flush", and indicates that it is "implemented by calling FlushFileBuffers".
So I looked up what FlushFileBuffers does. FlushFileBuffers redirects to NtFlushBuffersFile, which causes a "IRP_MJ_FLUSH_BUFFERS" to be generated. The filesystem driver handles that request. The filesystem driver responds by flushing metadata and data to the disk cache, and will ultimately call "CcFlushCache" to perform the task of getting that buffered data to the disk.
Since this is still performing the act of getting cached data on to the disk, does this still count as a "brown" square on the grid? How is this different than what fsync would do?
Beta Was this translation helpful? Give feedback.
All reactions