diff options
author | Zachary Turner <zturner@google.com> | 2016-11-30 21:44:26 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-11-30 21:44:26 +0000 |
commit | 5abac1769f36e4f7d9d6c3a408a1356490fc76e0 (patch) | |
tree | e669c5f43b78ba2a55aae705aff4fce55581d6e6 /llvm/lib/Fuzzer/FuzzerIO.h | |
parent | b151a641aa8fe3c1bbb2ed78279ede5f1ecc0e7e (diff) | |
download | bcm5719-llvm-5abac1769f36e4f7d9d6c3a408a1356490fc76e0.tar.gz bcm5719-llvm-5abac1769f36e4f7d9d6c3a408a1356490fc76e0.zip |
[LibFuzzer] Add Windows implementations of some IO functions.
This patch moves some posix specific file i/o code into a new
file, FuzzerIOPosix.cpp, and provides implementations for these
functions on Windows in FuzzerIOWindows.cpp. This is another
incremental step towards getting libfuzzer working on Windows,
although it still should not be expected to be fully working.
Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27233
llvm-svn: 288275
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerIO.h')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerIO.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIO.h b/llvm/lib/Fuzzer/FuzzerIO.h index e3d22ad9c9a..b1ac69c8088 100644 --- a/llvm/lib/Fuzzer/FuzzerIO.h +++ b/llvm/lib/Fuzzer/FuzzerIO.h @@ -15,15 +15,11 @@ namespace fuzzer { -bool IsFile(const std::string &Path); - long GetEpoch(const std::string &Path); Unit FileToVector(const std::string &Path, size_t MaxSize = 0, bool ExitOnError = true); -void DeleteFile(const std::string &Path); - std::string FileToString(const std::string &Path); void CopyFileToErr(const std::string &Path); @@ -43,5 +39,21 @@ void CloseStdout(); void Printf(const char *Fmt, ...); +// Platform specific functions: +bool IsFile(const std::string &Path); + +void ListFilesInDirRecursive(const std::string &Dir, long *Epoch, + std::vector<std::string> *V, bool TopDir); + +char GetSeparator(); + +FILE* OpenFile(int Fd, const char *Mode); + +int CloseFile(int Fd); + +int DuplicateFile(int Fd); + +void DeleteFile(const std::string &Path); + } // namespace fuzzer #endif // LLVM_FUZZER_IO_H |