diff options
author | begasus <begasus@gmail.com> | 2021-04-05 11:56:04 +0000 |
---|---|---|
committer | begasus <begasus@gmail.com> | 2021-04-05 11:56:04 +0000 |
commit | a02d84a11cb28bc620bf24bda322e14701ad726f (patch) | |
tree | 309b52eb1d70f93deb01bf3db078b8d19d297b92 /instrumentation | |
parent | f2efd940358374b9693e3f4323c159a6c6e7d20a (diff) | |
download | afl++-a02d84a11cb28bc620bf24bda322e14701ad726f.tar.gz |
Fix undeclared SYS_write on Haiku
Diffstat (limited to 'instrumentation')
-rw-r--r-- | instrumentation/afl-compiler-rt.o.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/instrumentation/afl-compiler-rt.o.c b/instrumentation/afl-compiler-rt.o.c index fa53263c..9bb6114b 100644 --- a/instrumentation/afl-compiler-rt.o.c +++ b/instrumentation/afl-compiler-rt.o.c @@ -1740,7 +1740,11 @@ static int area_is_valid(void *ptr, size_t len) { if (unlikely(!ptr || __asan_region_is_poisoned(ptr, len))) { return 0; } - long r = syscall(SYS_write, __afl_dummy_fd[1], ptr, len); + #ifndef __HAIKU__ + long r = syscall(SYS_write, __afl_dummy_fd[1], ptr, len); + #else + long r = _kern_write(__afl_dummy_fd[1], -1, ptr, len); + #endif // HAIKU if (r <= 0 || r > len) return 0; |