diff options
author | David Carlier <devnexen@gmail.com> | 2018-10-21 21:17:03 +0000 |
---|---|---|
committer | David Carlier <devnexen@gmail.com> | 2018-10-21 21:17:03 +0000 |
commit | 6b047bb4962740121cb17b9740214de9aa98256b (patch) | |
tree | 7889720e11e72c712f4f32b75b2e49b76df26d1b | |
parent | 091aff2e6a8263e99055a96ab38948ccc42d5559 (diff) |
[Sanitizer] openbsd does not have sysctlbyname call
Enabling only for FreeBSD.
Reviewers: krytarowski, vitalybuka
Reviewed By: krytarowski
Differential Revision: https://reviews.llvm.org/D53413
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@344876 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/sanitizer_common/sanitizer_linux.cc | 7 | ||||
-rw-r--r-- | lib/sanitizer_common/sanitizer_openbsd.cc | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc index cd1e46ba9..68eed1a28 100644 --- a/lib/sanitizer_common/sanitizer_linux.cc +++ b/lib/sanitizer_common/sanitizer_linux.cc @@ -796,16 +796,13 @@ int internal_sysctl(const int *name, unsigned int namelen, void *oldp, #endif } +#if SANITIZER_FREEBSD int internal_sysctlbyname(const char *sname, void *oldp, uptr *oldlenp, const void *newp, uptr newlen) { -#if SANITIZER_OPENBSD - return sysctlbyname(sname, oldp, (size_t *)oldlenp, (void *)newp, - (size_t)newlen); -#else return sysctlbyname(sname, oldp, (size_t *)oldlenp, newp, (size_t)newlen); -#endif } #endif +#endif #if SANITIZER_LINUX #define SA_RESTORER 0x04000000 diff --git a/lib/sanitizer_common/sanitizer_openbsd.cc b/lib/sanitizer_common/sanitizer_openbsd.cc index dc955109a..6ff8b0d10 100644 --- a/lib/sanitizer_common/sanitizer_openbsd.cc +++ b/lib/sanitizer_common/sanitizer_openbsd.cc @@ -51,6 +51,13 @@ int internal_mprotect(void *addr, uptr length, int prot) { return mprotect(addr, length, prot); } +int internal_sysctlbyname(const char *sname, void *oldp, uptr *oldlenp, + const void *newp, uptr newlen) { + Printf("internal_sysctlbyname not implemented for OpenBSD"); + Die(); + return 0; +} + uptr ReadBinaryName(/*out*/char *buf, uptr buf_len) { // On OpenBSD we cannot get the full path struct kinfo_proc kp; |