Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 688 Bytes

synchronous-io.md

File metadata and controls

11 lines (6 loc) · 688 Bytes

Synchronous I/O

I learned from this page.

O_SYNC

O_SYNC flag guarantees that the call will not return before all data has been transferred to the disk. This still does not guarantee that the data isn't somewhere in the harddisk write cache, but it is as much as the OS can guarantee.

fsync()

fsync() flushes all modified data of the file referred to by the file descriptor fd to the disk device (or other permanent storage device). This includes writing through or flushing a disk cache if present. It also flushes metadata information associated with the file.