[compiler-rt] r344876 - [Sanitizer] openbsd does not have sysctlbyname call

David Carlier via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 21 14:17:03 PDT 2018


Author: devnexen
Date: Sun Oct 21 14:17:03 2018
New Revision: 344876

URL: http://llvm.org/viewvc/llvm-project?rev=344876&view=rev
Log:
[Sanitizer] openbsd does not have sysctlbyname call

Enabling only for FreeBSD.

Reviewers: krytarowski, vitalybuka

Reviewed By: krytarowski

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

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_openbsd.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=344876&r1=344875&r2=344876&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Sun Oct 21 14:17:03 2018
@@ -796,16 +796,13 @@ int internal_sysctl(const int *name, uns
 #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

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_openbsd.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_openbsd.cc?rev=344876&r1=344875&r2=344876&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_openbsd.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_openbsd.cc Sun Oct 21 14:17:03 2018
@@ -51,6 +51,13 @@ int internal_mprotect(void *addr, uptr l
   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;




More information about the llvm-commits mailing list