[ASan] use internal_{close,read,write} in ASan runtime.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157991 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_posix.cc b/lib/asan/asan_posix.cc
index b5e8107..14f172d 100644
--- a/lib/asan/asan_posix.cc
+++ b/lib/asan/asan_posix.cc
@@ -19,6 +19,7 @@
 #include "asan_procmaps.h"
 #include "asan_stack.h"
 #include "asan_thread_registry.h"
+#include "sanitizer_common/sanitizer_libc.h"
 
 #include <pthread.h>
 #include <signal.h>
@@ -35,6 +36,8 @@
 // since most of the stuff here is inlinable.
 #include <algorithm>
 
+using namespace __sanitizer;
+
 static const uptr kAltStackSize = SIGSTKSZ * 4;  // SIGSTKSZ is not enough.
 
 namespace __asan {
@@ -82,7 +85,7 @@
 static void     ASAN_OnSIGSEGV(int, siginfo_t *siginfo, void *context) {
   uptr addr = (uptr)siginfo->si_addr;
   // Write the first message using the bullet-proof write.
-  if (13 != AsanWrite(2, "ASAN:SIGSEGV\n", 13)) AsanDie();
+  if (13 != internal_write(2, "ASAN:SIGSEGV\n", 13)) AsanDie();
   uptr pc, sp, bp;
   GetPcSpBp(context, &pc, &sp, &bp);
   Report("ERROR: AddressSanitizer crashed on unknown address %p"