diff options
| author | Kamil Rytarowski <n54@gmx.com> | 2018-01-12 17:15:05 +0000 |
|---|---|---|
| committer | Kamil Rytarowski <n54@gmx.com> | 2018-01-12 17:15:05 +0000 |
| commit | fd25fae6ea573d2d1829f4ea1f62ff018e8f557b (patch) | |
| tree | 7eee72657ae0e6be00e8460e0483a0c31c395a10 /lib/fuzzer/afl/afl_driver.cpp | |
| parent | 9ebd4e4b00d76d6744709de26f9707723a96905c (diff) | |
| download | compiler-rt-fd25fae6ea573d2d1829f4ea1f62ff018e8f557b.tar.gz | |
lib Fuzzer FreeBSD support
Summary: Patch by David CARLIER
Reviewers: vitalybuka, kcc, dim, emaste, davide, morehouse, george.karpenkov
Reviewed By: morehouse
Subscribers: george.karpenkov, kubamracek, srhines, mgorny, emaste, krytarowski
Differential Revision: https://reviews.llvm.org/D41642
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/afl/afl_driver.cpp')
| -rw-r--r-- | lib/fuzzer/afl/afl_driver.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/fuzzer/afl/afl_driver.cpp b/lib/fuzzer/afl/afl_driver.cpp index bbe5be795..616ce4d47 100644 --- a/lib/fuzzer/afl/afl_driver.cpp +++ b/lib/fuzzer/afl/afl_driver.cpp @@ -69,14 +69,22 @@ statistics from the file. If that fails then the process will quit. #define LIBFUZZER_LINUX 1 #define LIBFUZZER_APPLE 0 #define LIBFUZZER_NETBSD 0 +#define LIBFUZZER_FREEBSD 0 #elif __APPLE__ #define LIBFUZZER_LINUX 0 #define LIBFUZZER_APPLE 1 #define LIBFUZZER_NETBSD 0 +#define LIBFUZZER_FREEBSD 0 #elif __NetBSD__ #define LIBFUZZER_LINUX 0 #define LIBFUZZER_APPLE 0 #define LIBFUZZER_NETBSD 1 +#define LIBFUZZER_FREEBSD 0 +#elif __FreeBSD__ +#define LIBFUZZER_LINUX 0 +#define LIBFUZZER_APPLE 0 +#define LIBFUZZER_NETBSD 0 +#define LIBFUZZER_FREEBSD 1 #else #error "Support for your platform has not been implemented" #endif @@ -125,7 +133,7 @@ size_t GetPeakRSSMb() { struct rusage usage; if (getrusage(RUSAGE_SELF, &usage)) return 0; - if (LIBFUZZER_LINUX || LIBFUZZER_NETBSD) { + if (LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_FREEBSD) { // ru_maxrss is in KiB return usage.ru_maxrss >> 10; } else if (LIBFUZZER_APPLE) { |
