sanitizer_common.cc revision 230c3be6cdd094a187f48e27ba0961dbeee70344
1//===-- sanitizer_common.cc -----------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is shared between AddressSanitizer and ThreadSanitizer
11// run-time libraries.
12//===----------------------------------------------------------------------===//
13
14#include "sanitizer_common.h"
15#include "sanitizer_libc.h"
16
17namespace __sanitizer {
18
19void RawWrite(const char *buffer) {
20  static const char *kRawWriteError = "RawWrite can't output requested buffer!";
21  uptr length = (uptr)internal_strlen(buffer);
22  if (length != internal_write(2, buffer, length)) {
23    internal_write(2, kRawWriteError, internal_strlen(kRawWriteError));
24    Die();
25  }
26}
27
28}  // namespace __sanitizer
29