MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / FileCommit

Function FileCommit

src/util.cpp:601–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

599}
600
601void FileCommit(FILE *fileout)
602{
603 fflush(fileout); // harmless if redundantly called
604#ifdef WIN32
605 HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(fileout));
606 FlushFileBuffers(hFile);
607#else
608 #if defined(__linux__) || defined(__NetBSD__)
609 fdatasync(fileno(fileout));
610 #elif defined(__APPLE__) && defined(F_FULLFSYNC)
611 fcntl(fileno(fileout), F_FULLFSYNC, 0);
612 #else
613 fsync(fileno(fileout));
614 #endif
615#endif
616}
617
618bool TruncateFile(FILE *file, unsigned int length) {
619#if defined(WIN32)

Callers 2

FlushBlockFileFunction · 0.85
WriteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected