20 #include <sys/types.h>
28 if (stat(Path.c_str(), &St))
34 std::ifstream
T(Path);
35 if (ExitOnError && !T) {
36 Printf(
"No such directory: %s; exiting\n", Path.c_str());
41 size_t FileLen = T.tellg();
43 FileLen =
std::min(FileLen, MaxSize);
47 T.read(reinterpret_cast<char *>(Res.data()), FileLen);
52 std::ifstream
T(Path);
53 return std::string((std::istreambuf_iterator<char>(T)),
54 std::istreambuf_iterator<char>());
63 FILE *Out = fopen(Path.c_str(),
"w");
65 fwrite(U.data(),
sizeof(U[0]), U.size(), Out);
70 long *Epoch,
size_t MaxSize,
bool ExitOnError) {
71 long E = Epoch ? *Epoch : 0;
72 std::vector<std::string> Files;
75 for (
size_t i = 0;
i < Files.size();
i++) {
79 if ((NumLoaded & (NumLoaded - 1)) == 0 && NumLoaded >= 1024)
80 Printf(
"Loaded %zd/%zd files from %s\n", NumLoaded, Files.size(), Path);
88 const std::string &FileName) {
95 FILE *NewOutputFile =
OpenFile(OutputFd,
"w");
98 if (
EF->__sanitizer_set_report_fd)
99 EF->__sanitizer_set_report_fd(reinterpret_cast<void *>(OutputFd));
int DuplicateFile(int Fd)
void ListFilesInDirRecursive(const std::string &Dir, long *Epoch, std::vector< std::string > *V, bool TopDir)
std::string FileToString(const std::string &Path)
void ReadDirToVectorOfUnits(const char *Path, std::vector< Unit > *V, long *Epoch, size_t MaxSize, bool ExitOnError)
long GetEpoch(const std::string &Path)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with etc Experimental Use value profile to guide fuzzing Number of simultaneous worker processes to run the jobs If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
void Printf(const char *Fmt,...)
FILE * OpenFile(int Fd, const char *Mode)
std::string DirPlusFile(const std::string &DirPath, const std::string &FileName)
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
void CopyFileToErr(const std::string &Path)
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
void WriteToFile(const Unit &U, const std::string &Path)
Unit FileToVector(const std::string &Path, size_t MaxSize, bool ExitOnError)
std::vector< uint8_t > Unit