summaryrefslogtreecommitdiff
path: root/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp')
-rw-r--r--compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
index cefe7ae181e7..8048e6a8afd2 100644
--- a/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
@@ -98,7 +98,8 @@ void SetTimer(int Seconds) {
}
void SetSignalHandler(const FuzzingOptions& Options) {
- if (Options.UnitTimeoutSec > 0)
+ // setitimer is not implemented in emscripten.
+ if (Options.UnitTimeoutSec > 0 && !LIBFUZZER_EMSCRIPTEN)
SetTimer(Options.UnitTimeoutSec / 2 + 1);
if (Options.HandleInt)
SetSigaction(SIGINT, InterruptHandler);
@@ -133,7 +134,7 @@ size_t GetPeakRSSMb() {
if (getrusage(RUSAGE_SELF, &usage))
return 0;
if (LIBFUZZER_LINUX || LIBFUZZER_FREEBSD || LIBFUZZER_NETBSD ||
- LIBFUZZER_OPENBSD) {
+ LIBFUZZER_OPENBSD || LIBFUZZER_EMSCRIPTEN) {
// ru_maxrss is in KiB
return usage.ru_maxrss >> 10;
} else if (LIBFUZZER_APPLE) {