diff options
Diffstat (limited to 'lib/profile/InstrProfilingFile.c')
-rw-r--r-- | lib/profile/InstrProfilingFile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/profile/InstrProfilingFile.c b/lib/profile/InstrProfilingFile.c index 6e6b8fac5..1299a6d8c 100644 --- a/lib/profile/InstrProfilingFile.c +++ b/lib/profile/InstrProfilingFile.c @@ -19,6 +19,7 @@ #include "WindowsMMap.h" /* For _chsize_s */ #include <io.h> +#include <process.h> #else #include <sys/file.h> #include <sys/mman.h> @@ -186,7 +187,7 @@ static int doProfileMerging(FILE *ProfileFile, int *MergeDone) { // Truncate the file in case merging of value profile did not happend to // prevent from leaving garbage data at the end of the profile file. - ftruncate(fileno(ProfileFile), __llvm_profile_get_size_for_buffer()); + COMPILER_RT_FTRUNCATE(ProfileFile, __llvm_profile_get_size_for_buffer()); (void)munmap(ProfileBuffer, ProfileFileSize); *MergeDone = 1; |