diff options
-rw-r--r-- | lib/asan/asan_internal.h | 1 | ||||
-rw-r--r-- | lib/asan/asan_linux.cc | 4 | ||||
-rw-r--r-- | lib/asan/asan_mac.cc | 4 | ||||
-rw-r--r-- | lib/asan/asan_rtl.cc | 3 | ||||
-rw-r--r-- | lib/asan/asan_win.cc | 4 |
5 files changed, 2 insertions, 14 deletions
diff --git a/lib/asan/asan_internal.h b/lib/asan/asan_internal.h index fa797275e..50c0013ff 100644 --- a/lib/asan/asan_internal.h +++ b/lib/asan/asan_internal.h @@ -157,7 +157,6 @@ void OutOfMemoryMessageAndDie(const char *mem_type, uptr size); // asan_linux.cc / asan_mac.cc / asan_win.cc void *AsanDoesNotSupportStaticLinkage(); bool AsanShadowRangeIsAvailable(); -int AsanOpenReadonly(const char* filename); const char *AsanGetEnv(const char *name); void AsanDumpProcessMap(); diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc index 1577d2f52..f91310307 100644 --- a/lib/asan/asan_linux.cc +++ b/lib/asan/asan_linux.cc @@ -114,10 +114,6 @@ uptr AsanWrite(int fd, const void *buf, uptr count) { return (uptr)syscall(__NR_write, fd, buf, count); } -int AsanOpenReadonly(const char* filename) { - return syscall(__NR_open, filename, O_RDONLY); -} - // Like getenv, but reads env directly from /proc and does not use libc. // This function should be called first inside __asan_init. const char* AsanGetEnv(const char* name) { diff --git a/lib/asan/asan_mac.cc b/lib/asan/asan_mac.cc index cd87a2d31..31cee3eb9 100644 --- a/lib/asan/asan_mac.cc +++ b/lib/asan/asan_mac.cc @@ -138,10 +138,6 @@ void AsanUnmapOrDie(void *addr, size_t size) { } } -int AsanOpenReadonly(const char* filename) { - return open(filename, O_RDONLY); -} - const char *AsanGetEnv(const char *name) { char ***env_ptr = _NSGetEnviron(); CHECK(env_ptr); diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc index 5f807979f..b9603a40e 100644 --- a/lib/asan/asan_rtl.cc +++ b/lib/asan/asan_rtl.cc @@ -21,6 +21,7 @@ #include "asan_stats.h" #include "asan_thread.h" #include "asan_thread_registry.h" +#include "sanitizer_common/sanitizer_libc.h" namespace __asan { using namespace __sanitizer; @@ -86,7 +87,7 @@ uptr ReadFileToBuffer(const char *file_name, char **buff, *buff_size = 0; // The files we usually open are not seekable, so try different buffer sizes. for (uptr size = kMinFileLen; size <= max_len; size *= 2) { - int fd = AsanOpenReadonly(file_name); + fd_t fd = internal_open(file_name, /*write*/ false); if (fd < 0) return 0; AsanUnmapOrDie(*buff, *buff_size); *buff = (char*)AsanMmapSomewhereOrDie(size, __FUNCTION__); diff --git a/lib/asan/asan_win.cc b/lib/asan/asan_win.cc index eb33882a5..eadb48092 100644 --- a/lib/asan/asan_win.cc +++ b/lib/asan/asan_win.cc @@ -69,10 +69,6 @@ uptr AsanWrite(int fd, const void *buf, uptr count) { // FIXME: Looks like these functions are not needed and are linked in by the // code unreachable on Windows. We should clean this up. -int AsanOpenReadonly(const char* filename) { - UNIMPLEMENTED(); -} - uptr AsanRead(int fd, void *buf, uptr count) { UNIMPLEMENTED(); } |