summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2018-09-02 09:08:50 +0000
committerDavid Carlier <devnexen@gmail.com>2018-09-02 09:08:50 +0000
commite858aa6565c6aa330bd006fe4b3d113e75e52bc2 (patch)
treed45c38c621ae46e53cdd541b7de2558a7ba4e5d1
parent81b61a8291b50d2d945b39426806ea4076e129c6 (diff)
downloadbcm5719-llvm-e858aa6565c6aa330bd006fe4b3d113e75e52bc2.tar.gz
bcm5719-llvm-e858aa6565c6aa330bd006fe4b3d113e75e52bc2.zip
[Sanitizer] openbsd build fix
sysctl has a different signature under OpenBSD Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D51572 llvm-svn: 341285
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_linux.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
index 978dea58f17..81f0155a69a 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
@@ -69,6 +69,7 @@
#endif
#if SANITIZER_OPENBSD
#include <sys/futex.h>
+#include <sys/sysctl.h>
#endif
#include <unistd.h>
@@ -818,7 +819,12 @@ int internal_fork() {
#if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_OPENBSD
int internal_sysctl(const int *name, unsigned int namelen, void *oldp,
uptr *oldlenp, const void *newp, uptr newlen) {
+#if SANITIZER_OPENBSD
+ return sysctl(name, namelen, oldp, (size_t *)oldlenp, (void *)newp,
+ (size_t)newlen);
+#else
return sysctl(name, namelen, oldp, (size_t *)oldlenp, newp, (size_t)newlen);
+#endif
}
#endif
OpenPOWER on IntegriCloud