Index: lib/sanitizer_common/sanitizer_common.h =================================================================== --- lib/sanitizer_common/sanitizer_common.h +++ lib/sanitizer_common/sanitizer_common.h @@ -269,7 +269,6 @@ void DumpProcessMap(); void PrintModuleMap(); const char *GetEnv(const char *name); -bool SetEnv(const char *name, const char *value); u32 GetUid(); void ReExec(); @@ -308,13 +307,6 @@ const char *mmap_type, error_t err, bool raw_report = false); -// Set the name of the current thread to 'name', return true on succees. -// The name may be truncated to a system-dependent limit. -bool SanitizerSetThreadName(const char *name); -// Get the name of the current thread (no more than max_len bytes), -// return true on succees. name should have space for at least max_len+1 bytes. -bool SanitizerGetThreadName(char *name, int max_len); - // Specific tools may override behavior of "Die" and "CheckFailed" functions // to do tool-specific job. typedef void (*DieCallbackType)(void); Index: lib/sanitizer_common/sanitizer_linux_libcdep.cc =================================================================== --- lib/sanitizer_common/sanitizer_linux_libcdep.cc +++ lib/sanitizer_common/sanitizer_linux_libcdep.cc @@ -55,10 +55,6 @@ #include #endif -#if SANITIZER_LINUX -#include -#endif - #if SANITIZER_ANDROID #include #if !defined(CPU_COUNT) && !defined(__aarch64__) @@ -148,40 +144,6 @@ *stack_bottom = (uptr)stackaddr; } -#if !SANITIZER_GO -bool SetEnv(const char *name, const char *value) { - void *f = dlsym(RTLD_NEXT, "setenv"); - if (!f) - return false; - typedef int(*setenv_ft)(const char *name, const char *value, int overwrite); - setenv_ft setenv_f; - CHECK_EQ(sizeof(setenv_f), sizeof(f)); - internal_memcpy(&setenv_f, &f, sizeof(f)); - return setenv_f(name, value, 1) == 0; -} -#endif - -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 -} - #if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && \ !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS static uptr g_tls_size; Index: lib/sanitizer_common/tests/sanitizer_common_test.cc =================================================================== --- lib/sanitizer_common/tests/sanitizer_common_test.cc +++ lib/sanitizer_common/tests/sanitizer_common_test.cc @@ -88,23 +88,6 @@ } } -#if SANITIZER_LINUX -TEST(SanitizerCommon, SanitizerSetThreadName) { - const char *names[] = { - "0123456789012", - "01234567890123", - "012345678901234", // Larger names will be truncated on linux. - }; - - for (size_t i = 0; i < ARRAY_SIZE(names); i++) { - EXPECT_TRUE(SanitizerSetThreadName(names[i])); - char buff[100]; - EXPECT_TRUE(SanitizerGetThreadName(buff, sizeof(buff) - 1)); - EXPECT_EQ(0, internal_strcmp(buff, names[i])); - } -} -#endif - TEST(SanitizerCommon, InternalMmapVector) { InternalMmapVector vector(1); for (uptr i = 0; i < 100; i++) { Index: lib/sanitizer_common/tests/sanitizer_linux_test.cc =================================================================== --- lib/sanitizer_common/tests/sanitizer_linux_test.cc +++ lib/sanitizer_common/tests/sanitizer_linux_test.cc @@ -188,14 +188,6 @@ ASSERT_TRUE(HasElement(threads_after_extra, extra_tid)); } -TEST(SanitizerCommon, SetEnvTest) { - const char kEnvName[] = "ENV_FOO"; - SetEnv(kEnvName, "value"); - EXPECT_STREQ("value", getenv(kEnvName)); - unsetenv(kEnvName); - EXPECT_EQ(0, getenv(kEnvName)); -} - #if (defined(__x86_64__) || defined(__i386__)) && !SANITIZER_ANDROID void *thread_self_offset_test_func(void *arg) { bool result =