FILE *fp;
if ((fp = fopen(write_filename, "wb")) == NULL) {
fprintf("can't open %s\n", write_filename);
exit(1);
}
...
fflush(fp);
int fd = fileno(fp);
fdatasync(fd);
//fsync(fd);
fclose(fp);
FILE *fp;
if ((fp = fopen(write_filename, "wb")) == NULL) {
fprintf("can't open %s\n", write_filename);
exit(1);
}
...
fflush(fp);
int fd = fileno(fp);
fdatasync(fd);
//fsync(fd);
fclose(fp);