Path: blob/main/contrib/llvm-project/libcxx/src/experimental/log_hardening_failure.cpp
213766 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include <__config>9#include <__log_hardening_failure>10#include <cstdio>1112#ifdef __BIONIC__13# include <syslog.h>14#endif // __BIONIC__1516_LIBCPP_BEGIN_NAMESPACE_STD1718void __log_hardening_failure(const char* message) noexcept {19// Always log the message to `stderr` in case the platform-specific system calls fail.20std::fputs(message, stderr);2122#if defined(__BIONIC__)23// Show error in logcat. The latter two arguments are ignored on Android.24openlog("libc++", 0, 0);25syslog(LOG_CRIT, "%s", message);26closelog();27#endif28}2930_LIBCPP_END_NAMESPACE_STD313233