1 //===-- sanitizer_common_libcdep.cc ---------------------------------------===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is shared between AddressSanitizer and ThreadSanitizer
10 //===----------------------------------------------------------------------===//
12 #include "sanitizer_common.h"
14 namespace __sanitizer
{
17 MaybeOpenReportFile();
18 return internal_isatty(report_fd
) != 0;
21 bool PrintsToTtyCached() {
22 // FIXME: Add proper Windows support to AnsiColorDecorator and re-enable color
23 // printing on Windows.
24 if (SANITIZER_WINDOWS
)
27 static int cached
= 0;
28 static bool prints_to_tty
;
29 if (!cached
) { // Not thread-safe.
30 prints_to_tty
= PrintsToTty();
35 } // namespace __sanitizer