diff options
author | Kostya Serebryany <kcc@google.com> | 2013-01-15 09:03:23 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2013-01-15 09:03:23 +0000 |
commit | c4bb752e3b93f3c5db485da2dae397bf10fa5d06 (patch) | |
tree | a57fc91492ed09b1e9f19d5ab9f04c600ee42675 | |
parent | 2854326db66c54143a863d51bfec16dfc1ea4a17 (diff) | |
download | bcm5719-llvm-c4bb752e3b93f3c5db485da2dae397bf10fa5d06.tar.gz bcm5719-llvm-c4bb752e3b93f3c5db485da2dae397bf10fa5d06.zip |
[sanitizer] hide PR_SET_NAME under an ifdef (for older kernels)
llvm-svn: 172523
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_linux.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc index 3b01df14e6d..0ba80d47329 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc @@ -369,16 +369,24 @@ bool MemoryMappingLayout::GetObjectNameAndOffset(uptr addr, uptr *offset, } 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 |