/* Durability for the restore's temp-file-then-rename. * * V 0.5's `os` has no fsync. A rename is only durable once the bytes it points * at are on disk and the folder's own entry has been synced; without both a * power cut can leave an empty or partial file behind with the restore mark * already gone. Two calls, because a file and a folder are opened the same way * but synced for different reasons. */ #ifndef KOH_FSYNC_H #define KOH_FSYNC_H /* Syncs one file's contents; returns 1 on success, 0 on failure. */ int koh_fsync_file(const char *path); /* Syncs one folder, making renames and unlinks inside it durable. */ int koh_fsync_dir(const char *path); #endif