[PATCH] D51572: [Sanitizer] openbsd build fix

David CARLIER via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 1 14:14:56 PDT 2018


devnexen updated this revision to Diff 163628.

https://reviews.llvm.org/D51572

Files:
  lib/sanitizer_common/sanitizer_linux.cc


Index: lib/sanitizer_common/sanitizer_linux.cc
===================================================================
--- lib/sanitizer_common/sanitizer_linux.cc
+++ 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 @@
 #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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51572.163628.patch
Type: text/x-patch
Size: 779 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180901/6a4bc630/attachment.bin>


More information about the llvm-commits mailing list