chromium/third_party/libc++/src/src/system_error.cpp

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include <__assert>
#include <__config>
#include <__verbose_abort>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string.h>
#include <string>
#include <system_error>

#include "include/config_elast.h"

#if defined(__ANDROID__)
#  include <android/api-level.h>
#endif

_LIBCPP_BEGIN_NAMESPACE_STD

namespace {
#if !defined(_LIBCPP_HAS_NO_THREADS)

//  GLIBC also uses 1024 as the maximum buffer size internally.
constexpr size_t strerror_buff_size =;

string do_strerror_r(int ev);

#  if defined(_LIBCPP_MSVCRT_LIKE)
string do_strerror_r(int ev) {
  char buffer[strerror_buff_size];
  if (::strerror_s(buffer, strerror_buff_size, ev) == 0)
    return string(buffer);
  std::snprintf(buffer, strerror_buff_size, "unknown error %d", ev);
  return string(buffer);
}
#  else

// Only one of the two following functions will be used, depending on
// the return type of strerror_r:

// For the GNU variant, a char* return value:
__attribute__((unused)) const char* handle_strerror_r_return(char* strerror_return, char* buffer) {}

// For the POSIX variant: an int return value.
__attribute__((unused)) const char* handle_strerror_r_return(int strerror_return, char* buffer) {}

// This function handles both GNU and POSIX variants, dispatching to
// one of the two above functions.
string do_strerror_r(int ev) {}
#  endif

#endif // !defined(_LIBCPP_HAS_NO_THREADS)

string make_error_str(const error_code& ec, string what_arg) {}

string make_error_str(const error_code& ec) {}
} // end namespace

string __do_message::message(int ev) const {}

class _LIBCPP_HIDDEN __generic_error_category : public __do_message {};

const char* __generic_error_category::name() const noexcept {}

string __generic_error_category::message(int ev) const {}

const error_category& generic_category() noexcept {}

class _LIBCPP_HIDDEN __system_error_category : public __do_message {};

const char* __system_error_category::name() const noexcept {}

string __system_error_category::message(int ev) const {}

error_condition __system_error_category::default_error_condition(int ev) const noexcept {}

const error_category& system_category() noexcept {}

// error_condition

string error_condition::message() const {}

// error_code

string error_code::message() const {}

// system_error

system_error::system_error(error_code ec, const string& what_arg)
    :{}

system_error::system_error(error_code ec, const char* what_arg)
    :{}

system_error::system_error(error_code ec) :{}

system_error::system_error(int ev, const error_category& ecat, const string& what_arg)
    :{}

system_error::system_error(int ev, const error_category& ecat, const char* what_arg)
    :{}

system_error::system_error(int ev, const error_category& ecat)
    :{}

system_error::~system_error() noexcept {}

void __throw_system_error(int ev, const char* what_arg) {}

_LIBCPP_END_NAMESPACE_STD