This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/55989] [4.8 regresion] build failure in libsanitizer
- From: "kcc at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Jan 2013 08:49:42 +0000
- Subject: [Bug sanitizer/55989] [4.8 regresion] build failure in libsanitizer
- Auto-submitted: auto-generated
- References: <bug-55989-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55989
--- Comment #1 from Kostya Serebryany <kcc at gcc dot gnu.org> 2013-01-15 08:49:42 UTC ---
Will the following patch work?
Index: sanitizer_common/sanitizer_linux.cc
===================================================================
--- sanitizer_common/sanitizer_linux.cc (revision 172519)
+++ sanitizer_common/sanitizer_linux.cc (working copy)
@@ -369,16 +369,24 @@
}
bool SanitizerSetThreadName(const char *name) {
+#ifdef PR_SET_NAME
return 0 == prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); // NOLINT
+#else
+ return false;
+#endif
}
bool SanitizerGetThreadName(char *name, int max_len) {
+#ifdef PR_GET_NAME
char buff[17];
if (prctl(PR_GET_NAME, (unsigned long)buff, 0, 0, 0)) // NOLINT
return false;
internal_strncpy(name, buff, max_len);
name[max_len] = 0;
return true;
+#else
+ return false;
+#endif
}
#ifndef SANITIZER_GO