| 733 | } |
| 734 | |
| 735 | void FileCommit(FILE* fileout) { |
| 736 | fflush(fileout); // harmless if redundantly called |
| 737 | #ifdef WIN32 |
| 738 | HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(fileout)); |
| 739 | FlushFileBuffers(hFile); |
| 740 | #else |
| 741 | #if defined(__linux__) || defined(__NetBSD__) |
| 742 | fdatasync(fileno(fileout)); |
| 743 | #elif defined(__APPLE__) && defined(F_FULLFSYNC) |
| 744 | fcntl(fileno(fileout), F_FULLFSYNC, 0); |
| 745 | #else |
| 746 | fsync(fileno(fileout)); |
| 747 | #endif |
| 748 | #endif |
| 749 | } |
| 750 | |
| 751 | bool TruncateFile(FILE* file, unsigned int length) { |
| 752 | #if defined(WIN32) |
no outgoing calls
no test coverage detected