[PATCH] D53413: [Sanitize] openbsd does not have sysctlbyname call

David CARLIER via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 18 15:40:31 PDT 2018


devnexen created this revision.
devnexen added a reviewer: krytarowski.
devnexen created this object with visibility "All Users".
Herald added subscribers: Sanitizers, llvm-commits, kubamracek, emaste.

- Enabling only for FreeBSD.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D53413

Files:
  lib/sanitizer_common/sanitizer_linux.cc
  lib/sanitizer_common/sanitizer_posix.h


Index: lib/sanitizer_common/sanitizer_posix.h
===================================================================
--- lib/sanitizer_common/sanitizer_posix.h
+++ lib/sanitizer_common/sanitizer_posix.h
@@ -62,8 +62,10 @@
 
 int internal_sysctl(const int *name, unsigned int namelen, void *oldp,
                     uptr *oldlenp, const void *newp, uptr newlen);
+#if SANITIZER_FREEBSD
 int internal_sysctlbyname(const char *sname, void *oldp, uptr *oldlenp,
                           const void *newp, uptr newlen);
+#endif
 
 // These functions call appropriate pthread_ functions directly, bypassing
 // the interceptor. They are weak and may not be present in some tools.
Index: lib/sanitizer_common/sanitizer_linux.cc
===================================================================
--- lib/sanitizer_common/sanitizer_linux.cc
+++ lib/sanitizer_common/sanitizer_linux.cc
@@ -796,16 +796,13 @@
 #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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53413.170127.patch
Type: text/x-patch
Size: 1368 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181018/780b007b/attachment.bin>


More information about the llvm-commits mailing list