1

I have an application with thousands of files being updated. Periodically the application needs to commit the changes to the disk, and currently I am calling fdatasync(), which takes significant amount of time (minutes). [Reducing the number of files being written is not an option for me.]

At the same time, I noticed that if I ran the sync command from the command line, it would return significantly faster. From the documentation it seems like it would guarantee that all pending writes reached the disk.

The question is: does the sync() system call give the same (or stronger) durability guarantees as multiple fdatasync() calls? If not, is there a way to fsync() multiple file descriptors in one call?

Alexey
  • 406
  • 3
  • 6

0 Answers0