forked from OSchip/llvm-project
[TSan] use __sanitizer::internal_open in TSan run-time
llvm-svn: 157988
This commit is contained in:
parent
f0a3c46739
commit
298dd7c361
|
@ -1,4 +1,4 @@
|
|||
//===-- sanitizer_win.cc ------------------------------------------------===//
|
||||
//===-- sanitizer_win.cc --------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
|
|
|
@ -18,7 +18,7 @@ UNIT_TEST_SRC=$(wildcard unit_tests/*_test.cc)
|
|||
UNIT_TEST_OBJ=$(patsubst %.cc,%.o,$(UNIT_TEST_SRC))
|
||||
UNIT_TEST_HDR=$(wildcard rtl/*.h)
|
||||
|
||||
INCLUDES=-Irtl $(GTEST_INCLUDE)
|
||||
INCLUDES=-Irtl -I.. $(GTEST_INCLUDE)
|
||||
|
||||
all: libtsan test
|
||||
|
||||
|
|
|
@ -78,7 +78,6 @@ void internal_start_thread(void(*func)(void*), void *arg);
|
|||
|
||||
typedef int fd_t;
|
||||
const fd_t kInvalidFd = -1;
|
||||
fd_t internal_open(const char *name, bool write);
|
||||
void internal_close(fd_t fd);
|
||||
uptr internal_filesize(fd_t fd); // -1 on error.
|
||||
uptr internal_read(fd_t fd, void *p, uptr size);
|
||||
|
|
|
@ -86,12 +86,6 @@ void internal_sleep_ms(u32 ms) {
|
|||
usleep(ms * 1000);
|
||||
}
|
||||
|
||||
fd_t internal_open(const char *name, bool write) {
|
||||
ScopedInRtl in_rtl;
|
||||
return syscall(__NR_open, name,
|
||||
write ? O_WRONLY | O_CREAT | O_CLOEXEC : O_RDONLY, 0660);
|
||||
}
|
||||
|
||||
void internal_close(fd_t fd) {
|
||||
ScopedInRtl in_rtl;
|
||||
syscall(__NR_close, fd);
|
||||
|
|
|
@ -11,12 +11,15 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "sanitizer_common/sanitizer_libc.h"
|
||||
#include "tsan_suppressions.h"
|
||||
#include "tsan_rtl.h"
|
||||
#include "tsan_flags.h"
|
||||
#include "tsan_mman.h"
|
||||
#include "tsan_platform.h"
|
||||
|
||||
using namespace __sanitizer; // NOLINT
|
||||
|
||||
namespace __tsan {
|
||||
|
||||
static Suppression *g_suppressions;
|
||||
|
|
|
@ -10,9 +10,12 @@
|
|||
// This file is a part of ThreadSanitizer (TSan), a race detector.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#include "sanitizer_common/sanitizer_libc.h"
|
||||
#include "tsan_platform.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace __sanitizer; // NOLINT
|
||||
|
||||
namespace __tsan {
|
||||
|
||||
static void TestThreadInfo(bool main) {
|
||||
|
|
Loading…
Reference in New Issue