[PATCH] D19027: [sanitizer] remove PS_STRINGS fallback on FreeBSD

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 07:23:21 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL266305: [sanitizer] remove FreeBSD PS_STRINGS fallback (authored by emaste).

Changed prior to commit:
  http://reviews.llvm.org/D19027?vs=53443&id=53704#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19027

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

Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
@@ -490,12 +490,13 @@
 #else
   // On FreeBSD, retrieving the argument and environment arrays is done via the
   // kern.ps_strings sysctl, which returns a pointer to a structure containing
-  // this information.  If the sysctl is not available, a "hardcoded" address,
-  // PS_STRINGS, must be used instead.  See also <sys/exec.h>.
+  // this information. See also <sys/exec.h>.
   ps_strings *pss;
   size_t sz = sizeof(pss);
-  if (sysctlbyname("kern.ps_strings", &pss, &sz, NULL, 0) == -1)
-    pss = (ps_strings*)PS_STRINGS;
+  if (sysctlbyname("kern.ps_strings", &pss, &sz, NULL, 0) == -1) {
+    Printf("sysctl kern.ps_strings failed\n");
+    Die();
+  }
   *argv = pss->ps_argvstr;
   *envp = pss->ps_envstr;
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19027.53704.patch
Type: text/x-patch
Size: 984 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160414/487fbe6f/attachment.bin>


More information about the llvm-commits mailing list