[compiler-rt] r341285 - [Sanitizer] openbsd build fix

David Carlier via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 2 02:08:51 PDT 2018


Author: devnexen
Date: Sun Sep  2 02:08:50 2018
New Revision: 341285

URL: http://llvm.org/viewvc/llvm-project?rev=341285&view=rev
Log:
[Sanitizer] openbsd build fix

sysctl has a different signature under OpenBSD

Reviewers: krytarowski

Reviewed By: krytarowski

Differential Revision: https://reviews.llvm.org/D51572

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=341285&r1=341284&r2=341285&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Sun Sep  2 02:08:50 2018
@@ -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
 




More information about the llvm-commits mailing list