From b6eace8a2fb09384e348ec442d08b7e5c88dc67f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 20 Mar 2013 10:28:36 +0000 Subject: [PATCH] tsan: add internal_unlink() function llvm-svn: 177510 --- compiler-rt/lib/sanitizer_common/sanitizer_libc.h | 1 + compiler-rt/lib/sanitizer_common/sanitizer_linux.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_libc.h b/compiler-rt/lib/sanitizer_common/sanitizer_libc.h index 7c2a1b8574f6..9f4088e02af8 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_libc.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_libc.h @@ -79,6 +79,7 @@ int internal_lstat(const char *path, void *buf); int internal_fstat(fd_t fd, void *buf); int internal_dup2(int oldfd, int newfd); uptr internal_readlink(const char *path, char *buf, uptr bufsize); +int internal_unlink(const char *path); void NORETURN internal__exit(int exitcode); OFF_T internal_lseek(fd_t fd, OFF_T offset, int whence); diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc index 6256d845c80d..3c9ae418af73 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc @@ -145,6 +145,10 @@ uptr internal_readlink(const char *path, char *buf, uptr bufsize) { return (uptr)syscall(__NR_readlink, path, buf, bufsize); } +int internal_unlink(const char *path) { + return syscall(__NR_unlink, path); +} + int internal_sched_yield() { return syscall(__NR_sched_yield); }