[libFuzzer] move the implementation of the fork mode into a separate file
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/fuzzer@353891 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/FuzzerIO.cpp b/FuzzerIO.cpp
index ba4153b..91e1d20 100644
--- a/FuzzerIO.cpp
+++ b/FuzzerIO.cpp
@@ -8,9 +8,10 @@
// IO functions.
//===----------------------------------------------------------------------===//
-#include "FuzzerIO.h"
#include "FuzzerDefs.h"
#include "FuzzerExtFunctions.h"
+#include "FuzzerIO.h"
+#include "FuzzerUtil.h"
#include <algorithm>
#include <cstdarg>
#include <fstream>
@@ -141,4 +142,9 @@
RemoveFile(F);
}
+std::string TempPath(const char *Extension) {
+ return DirPlusFile(TmpDir(),
+ "libFuzzerTemp." + std::to_string(GetPid()) + Extension);
+}
+
} // namespace fuzzer