1 //===------------- Fuchsia implementation of IO utils -----------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIBC_SRC___SUPPORT_OSUTIL_FUCHSIA_IO_H
10 #define LLVM_LIBC_SRC___SUPPORT_OSUTIL_FUCHSIA_IO_H
12 #ifndef LIBC_COPT_TEST_USE_FUCHSIA
13 #error this file should only be used by tests
16 #include "src/__support/CPP/string_view.h"
18 #include <zircon/sanitizer.h>
20 namespace LIBC_NAMESPACE
{
22 LIBC_INLINE
void write_to_stderr(cpp::string_view msg
) {
23 __sanitizer_log_write(msg
.data(), msg
.size());
26 } // namespace LIBC_NAMESPACE
28 #endif // LLVM_LIBC_SRC___SUPPORT_OSUTIL_FUCHSIA_IO_H