diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-07-23 22:05:20 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-07-23 22:05:20 +0000 |
commit | 0fbfc5fa0eb0aa0088c200e73e1003926169d162 (patch) | |
tree | d7709cfb9d32f92aa8faf63ed3fc4565414ac2c4 /lib/sanitizer_common/sanitizer_posix_libcdep.cc | |
parent | 1a7d91a09cf8756f836ef9624e6f82ce35a91c2a (diff) |
[sanitizer] Implement logging to syslog.
Previously, Android target had a logic of duplicating all sanitizer
output to logcat. This change extends it to all posix platforms via
the use of syslog, controlled by log_to_syslog flag. Enabled by
default on Android, off everywhere else.
A bit of cmake magic is required to allow Printf() to call a libc
function. I'm adding a stub implementation to support no-libc builds
like dfsan and safestack.
This is a second attempt. I believe I've fixed all the issues that
prompted the revert: Mac build, and all kinds of non-CMake builds
(there are 3 of those).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@243051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_posix_libcdep.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_posix_libcdep.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/sanitizer_common/sanitizer_posix_libcdep.cc b/lib/sanitizer_common/sanitizer_posix_libcdep.cc index 3f0a4f453..14b585649 100644 --- a/lib/sanitizer_common/sanitizer_posix_libcdep.cc +++ b/lib/sanitizer_common/sanitizer_posix_libcdep.cc @@ -30,9 +30,9 @@ #include <stdlib.h> #include <sys/mman.h> #include <sys/resource.h> +#include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> -#include <sys/stat.h> #include <unistd.h> #if SANITIZER_FREEBSD @@ -274,7 +274,6 @@ void *MmapNoAccess(uptr fixed_addr, uptr size, const char *name) { return (void *)internal_mmap((void *)fixed_addr, size, PROT_NONE, flags, fd, 0); } - -} // namespace __sanitizer +} // namespace __sanitizer #endif // SANITIZER_POSIX |