forked from OSchip/llvm-project
parent
3ef249c9c0
commit
df0b22c5a8
|
@ -210,7 +210,6 @@ void DisableCoreDumperIfNecessary();
|
|||
void DumpProcessMap();
|
||||
bool FileExists(const char *filename);
|
||||
const char *GetEnv(const char *name);
|
||||
bool SetEnv(const char *name, const char *value);
|
||||
const char *GetPwd();
|
||||
char *FindPathToBinary(const char *name);
|
||||
u32 GetUid();
|
||||
|
|
|
@ -120,17 +120,6 @@ void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top,
|
|||
*stack_bottom = (uptr)stackaddr;
|
||||
}
|
||||
|
||||
bool SetEnv(const char *name, const char *value) {
|
||||
void *f = dlsym(RTLD_NEXT, "setenv");
|
||||
if (f == 0)
|
||||
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;
|
||||
}
|
||||
|
||||
bool SanitizerSetThreadName(const char *name) {
|
||||
#ifdef PR_SET_NAME
|
||||
return 0 == prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); // NOLINT
|
||||
|
|
|
@ -187,14 +187,6 @@ TEST_F(ThreadListerTest, ResetMakesNewThreadsKnown) {
|
|||
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__)
|
||||
void *thread_self_offset_test_func(void *arg) {
|
||||
bool result =
|
||||
|
|
Loading…
Reference in New Issue