News for hackers. Stuff that matters.
Re:POSIX v. reality: A position on O_PONIES by kazinator on Thursday November 23, 2023 @07:07PM (#38399275)
fsync doesn't have to "perform", because it doesn't have to do anything. It just has to wait for some certain events to occur that will eventually occur anyway.

Now some people might not like how long it takes; maybe it's waiting for some unnecessary events that are not relevant to this file.

Re:POSIX v. reality: A position on O_PONIES by Joker_vD on Thursday November 23, 2023 @11:49PM (#38400735)
Surely fsync() should at least initiate syncing the data to the disk? Otherwise, everything FS-related could theoretically still fit in the memory cache forever, and so fsync() will never return.
Re:POSIX v. reality: A position on O_PONIES by nh2 on Friday November 24, 2023 @12:16AM (#38400839)
No. If you don't call fsync(), there's no guarantee that your data will _ever_ be written to disk.

Some file systems with some settings may write data to hardware after some delay or periodically, but others may not.

fsync() "performs" e.g. an ATA FLUSH command on the underlying hardware.