> It's simple. open(),write(),close(),rename() and open(),write(),fsync(),close(),rename(), are not semantically equivalent. One is "give me either the original data or the new data". The other is "always give me the new data". This is an important distinction. fsync() means that we've sent the data to the disk. And, in general, that means that we've had to spin the disk up.
Yeah, it would be nice if the semantics of rename were defined that way, wouldn't it? Alas, they are not.
I vote for having rename2(), which would do exactly that. Easy to detect in configure, so if the system has it, use it. Otherwise, fsync() and then rename().