fdatasync is not exported. Fallback on fsync.
*/
fflush (file); /* Flush from run-time */
#ifndef WIN32
*/
fflush (file); /* Flush from run-time */
#ifndef WIN32
+#ifdef __APPLE__
+ fsync (fd); /* Flush from OS */
+#else
fdatasync (fd); /* Flush from OS */
fdatasync (fd); /* Flush from OS */
/* Atomically replace the file... */
if (utf8_rename (temporary, permanent))
utf8_unlink (temporary);
/* Atomically replace the file... */
if (utf8_rename (temporary, permanent))
utf8_unlink (temporary);