xref: /llvm-project/libc/src/string/strerror.cpp (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
142bcb35cSMichael Jones //===-- Implementation of strerror ----------------------------------------===//
242bcb35cSMichael Jones //
342bcb35cSMichael Jones // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
442bcb35cSMichael Jones // See https://llvm.org/LICENSE.txt for license information.
542bcb35cSMichael Jones // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
642bcb35cSMichael Jones //
742bcb35cSMichael Jones //===----------------------------------------------------------------------===//
842bcb35cSMichael Jones 
942bcb35cSMichael Jones #include "src/string/strerror.h"
1007793f95SMichael Jones #include "src/__support/StringUtil/error_to_string.h"
1142bcb35cSMichael Jones #include "src/__support/common.h"
12*5ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
1342bcb35cSMichael Jones 
14*5ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
1542bcb35cSMichael Jones 
1642bcb35cSMichael Jones LLVM_LIBC_FUNCTION(char *, strerror, (int err_num)) {
1742bcb35cSMichael Jones   return const_cast<char *>(get_error_string(err_num).data());
1842bcb35cSMichael Jones }
1942bcb35cSMichael Jones 
20*5ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
21