[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187)

This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
This commit is contained in:
lntue
2025-06-11 16:25:27 -04:00
committed by GitHub
parent fb761aa38b
commit d87eea35fa
397 changed files with 829 additions and 783 deletions

View File

@@ -106,6 +106,10 @@ function(_get_compile_options_from_config output_var)
list(APPEND config_options "-DLIBC_MATH=${LIBC_CONF_MATH_OPTIMIZATIONS}")
endif()
if(LIBC_CONF_ERRNO_MODE)
set(APPEND config_options "-DLIBC_ERRNO_MODE=${LIBC_CONF_ERRNO_MODE}")
endif()
set(${output_var} ${config_options} PARENT_SCOPE)
endfunction(_get_compile_options_from_config)

View File

@@ -2,7 +2,7 @@
"errno": {
"LIBC_CONF_ERRNO_MODE": {
"value": "LIBC_ERRNO_MODE_DEFAULT",
"doc": "The implementation used for errno, acceptable values are LIBC_ERRNO_MODE_DEFAULT, LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, and LIBC_ERRNO_MODE_SYSTEM."
"doc": "The implementation used for errno, acceptable values are LIBC_ERRNO_MODE_DEFAULT, LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, LIBC_ERRNO_MODE_SYSTEM, and LIBC_ERRNO_MODE_SYSTEM_INLINE."
}
},
"printf": {

View File

@@ -101,7 +101,7 @@ test infrastructure itself can be affected. To avoid perturbing the unit test
infrastructure around the setting of ``errno``, the following rules are to be
followed:
#. A special macro named ``libc_errno`` defined in ``src/errno/libc_errno.h``
#. A special macro named ``libc_errno`` defined in ``src/__support/libc_errno.h``
should be used when setting ``errno`` from libc runtime code. For example,
code to set ``errno`` to ``EINVAL`` should be:
@@ -117,7 +117,7 @@ followed:
`ErrorOr <https://github.com/llvm/llvm-project/blob/main/libc/src/__support/error_or.h>`_
to return error values.
#. The header file ``src/errno/libc_errno.h`` is shipped as part of the target
#. The header file ``src/__support/libc_errno.h`` is shipped as part of the target
corresponding to the ``errno`` entrypoint ``libc.src.errno.errno``. We do
not in general allow dependencies between entrypoints. However, the ``errno``
entrypoint is the only exceptional entrypoint on which other entrypoints

View File

@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_SHARED_FP_BITS_H
#define LLVM_LIBC_SHARED_FP_BITS_H
#include "libc_common.h"
#include "src/__support/FPUtil/FPBits.h"
namespace LIBC_NAMESPACE_DECL {

26
libc/shared/libc_common.h Normal file
View File

@@ -0,0 +1,26 @@
//===-- Common defines for sharing LLVM libc with LLVM projects -*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SHARED_LIBC_COMMON_H
#define LLVM_LIBC_SHARED_LIBC_COMMON_H
// Use system errno.
#ifdef LIBC_ERRNO_MODE
#if LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM_INLINE
#error \
"LIBC_ERRNO_MODE was set to something different from LIBC_ERRNO_MODE_SYSTEM_INLINE."
#endif // LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM_INLINE
#else
#define LIBC_ERRNO_MODE LIBC_ERRNO_MODE_SYSTEM_INLINE
#endif // LIBC_ERRNO_MODE
#ifndef LIBC_NAMESPACE
#define LIBC_NAMESPACE __llvm_libc
#endif // LIBC_NAMESPACE
#endif // LLVM_LIBC_SHARED_LIBC_COMMON_H

View File

@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_SHARED_RPC_SERVER_H
#define LLVM_LIBC_SHARED_RPC_SERVER_H
#include "libc_common.h"
#include "src/__support/RPC/rpc_server.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_SHARED_STR_TO_FLOAT_H
#define LLVM_LIBC_SHARED_STR_TO_FLOAT_H
#include "libc_common.h"
#include "src/__support/str_to_float.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_SHARED_STR_TO_INTEGER_H
#define LLVM_LIBC_SHARED_STR_TO_INTEGER_H
#include "libc_common.h"
#include "src/__support/str_to_integer.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -1,6 +1,15 @@
add_subdirectory(CPP)
add_subdirectory(macros)
add_header_library(
libc_errno
HDRS
libc_errno.h
DEPENDS
libc.hdr.errno_macros
libc.src.__support.macros.config
)
add_header_library(
block
HDRS

View File

@@ -12,10 +12,10 @@
#include "hdr/fenv_macros.h"
#include "hdr/math_macros.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
#include "src/errno/libc_errno.h"
#if defined(LIBC_TARGET_ARCH_IS_AARCH64) && defined(__ARM_FP)
#if defined(__APPLE__)

View File

@@ -11,8 +11,8 @@
#include "src/__support/CPP/mutex.h" // lock_guard
#include "src/__support/CPP/new.h"
#include "src/__support/error_or.h"
#include "src/__support/libc_errno.h" // For error macros
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h" // For error macros
namespace LIBC_NAMESPACE_DECL {

View File

@@ -13,8 +13,8 @@
#include "hdr/types/off_t.h"
#include "src/__support/CPP/new.h"
#include "src/__support/CPP/span.h"
#include "src/__support/libc_errno.h" // For error macros
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h" // For error macros
namespace LIBC_NAMESPACE_DECL {

View File

@@ -15,8 +15,8 @@
#include "src/__support/File/linux/lseekImpl.h"
#include "src/__support/OSUtil/fcntl.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/libc_errno.h" // For error macros
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h" // For error macros
#include "hdr/fcntl_macros.h" // For mode_t and other flags to the open syscall
#include <sys/stat.h> // For S_IS*, S_IF*, and S_IR* flags.

View File

@@ -13,8 +13,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/error_or.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <stdint.h> // For uint64_t.
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -14,7 +14,7 @@
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#if defined(LIBC_HASHTABLE_USE_GETRANDOM)
#include "src/errno/libc_errno.h"
#include "src/__support/libc_errno.h"
#include "src/sys/random/getrandom.h"
#endif

View File

@@ -15,8 +15,8 @@
#include "hdr/types/struct_flock64.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <stdarg.h>
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -11,9 +11,9 @@
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/optional.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/libc_errno.h"
#include "src/__support/threads/callonce.h"
#include "src/__support/threads/linux/futex_word.h"
#include "src/errno/libc_errno.h"
#include "src/sys/auxv/getauxval.h"
#include <linux/auxvec.h>

View File

@@ -10,8 +10,8 @@
#define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_LINUX_EXTENSION_ERRORS_H
#include "src/__support/StringUtil/message_mapper.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -0,0 +1,108 @@
//===-- Implementation header for libc_errno --------------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SRC___SUPPORT_LIBC_ERRNO_H
#define LLVM_LIBC_SRC___SUPPORT_LIBC_ERRNO_H
// This header is to be consumed by internal implementations, in which all of
// them should refer to `libc_errno` instead of using `errno` directly from
// <errno.h> header.
// Unit and hermetic tests should:
// - #include "src/__support/libc_errno.h"
// - NOT #include <errno.h>
// - Only use `libc_errno` in the code
// - Depend on libc.src.errno.errno
// Integration tests should:
// - NOT #include "src/__support/libc_errno.h"
// - #include <errno.h>
// - Use regular `errno` in the code
// - Still depend on libc.src.errno.errno
// libc uses a fallback default value, either system or thread local.
#define LIBC_ERRNO_MODE_DEFAULT 0
// libc never stores a value; `errno` macro uses get link-time failure.
#define LIBC_ERRNO_MODE_UNDEFINED 1
// libc maintains per-thread state (requires C++ `thread_local` support).
#define LIBC_ERRNO_MODE_THREAD_LOCAL 2
// libc maintains shared state used by all threads, contrary to standard C
// semantics unless always single-threaded; nothing prevents data races.
#define LIBC_ERRNO_MODE_SHARED 3
// libc doesn't maintain any internal state, instead the embedder must define
// `int *__llvm_libc_errno(void);` C function.
#define LIBC_ERRNO_MODE_EXTERNAL 4
// libc uses system `<errno.h>` `errno` macro directly in the overlay mode; in
// fullbuild mode, effectively the same as `LIBC_ERRNO_MODE_EXTERNAL`.
// In this mode, the public C++ symbol `LIBC_NAMESPACE::libc_errno ` is still
// exported and get redirected to the system `errno` inside its implementation.
// TODO: Investigate deprecating LIBC_ERRNO_MODE_SYSTEM in favor of
// LIBC_ERRNO_MODE_SYSTEM_INLINE.
// https://github.com/llvm/llvm-project/issues/143454
#define LIBC_ERRNO_MODE_SYSTEM 5
// In this mode, the libc_errno is simply a macro resolved to `errno` from the
// system header <errno.h>. There is no need to link against the
// `libc.src.errno.errno` object.
#define LIBC_ERRNO_MODE_SYSTEM_INLINE 6
#if !defined(LIBC_ERRNO_MODE) || LIBC_ERRNO_MODE == LIBC_ERRNO_MODE_DEFAULT
#undef LIBC_ERRNO_MODE
#if defined(LIBC_FULL_BUILD) || !defined(LIBC_COPT_PUBLIC_PACKAGING)
#define LIBC_ERRNO_MODE LIBC_ERRNO_MODE_THREAD_LOCAL
#else
#define LIBC_ERRNO_MODE LIBC_ERRNO_MODE_SYSTEM
#endif
#endif // LIBC_ERRNO_MODE
#if LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_DEFAULT && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_UNDEFINED && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_THREAD_LOCAL && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SHARED && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_EXTERNAL && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM_INLINE
#error LIBC_ERRNO_MODE must be one of the following values: \
LIBC_ERRNO_MODE_DEFAULT, \
LIBC_ERRNO_MODE_UNDEFINED, \
LIBC_ERRNO_MODE_THREAD_LOCAL, \
LIBC_ERRNO_MODE_SHARED, \
LIBC_ERRNO_MODE_EXTERNAL, \
LIBC_ERRNO_MODE_SYSTEM, \
LIBC_ERRNO_MODE_SYSTEM_INLINE.
#endif
#if LIBC_ERRNO_MODE == LIBC_ERRNO_MODE_SYSTEM_INLINE
#include <errno.h>
#define libc_errno errno
#else // !LIBC_ERRNO_MODE_SYSTEM_INLINE
#include "hdr/errno_macros.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
extern "C" int *__llvm_libc_errno() noexcept;
struct Errno {
void operator=(int);
operator int();
};
extern Errno libc_errno;
} // namespace LIBC_NAMESPACE_DECL
using LIBC_NAMESPACE::libc_errno;
#endif // LIBC_ERRNO_MODE_SYSTEM_INLINE
#endif // LLVM_LIBC_SRC___SUPPORT_LIBC_ERRNO_H

View File

@@ -14,9 +14,9 @@
#include "src/__support/OSUtil/syscall.h" // For syscall functions.
#include "src/__support/common.h"
#include "src/__support/error_or.h"
#include "src/__support/libc_errno.h" // For error macros
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/futex_utils.h" // For FutexWordType
#include "src/errno/libc_errno.h" // For error macros
#ifdef LIBC_TARGET_ARCH_IS_AARCH64
#include <arm_acle.h>

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/dir.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <dirent.h>

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/dir.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <dirent.h>

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/dir.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <dirent.h>

View File

@@ -1,28 +1,16 @@
# If we are in full build mode, we will provide the errno definition ourselves,
# and if we are in overlay mode, we will just re-use the system's errno.
# We are passing LIBC_FULL_BUILD flag in full build mode so that the
# implementation of libc_errno will know if we are in full build mode or not.
# TODO: Move LIBC_FULL_BUILD flag to _get_common_compile_options.
set(full_build_flag "")
if(LLVM_LIBC_FULL_BUILD)
set(full_build_flag "-DLIBC_FULL_BUILD")
endif()
if(LIBC_CONF_ERRNO_MODE)
set(errno_config_copts "-DLIBC_ERRNO_MODE=${LIBC_CONF_ERRNO_MODE}")
endif()
add_entrypoint_object(
errno
SRCS
libc_errno.cpp
HDRS
libc_errno.h # Include this
COMPILE_OPTIONS
${full_build_flag}
${errno_config_copts}
../__support/libc_errno.h
DEPENDS
libc.hdr.errno_macros
libc.src.__support.common
libc.src.__support.libc_errno
libc.src.__support.macros.attributes
libc.src.__support.macros.config
)

View File

@@ -6,51 +6,14 @@
//
//===----------------------------------------------------------------------===//
#include "libc_errno.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
// libc uses a fallback default value, either system or thread local.
#define LIBC_ERRNO_MODE_DEFAULT 0
// libc never stores a value; `errno` macro uses get link-time failure.
#define LIBC_ERRNO_MODE_UNDEFINED 1
// libc maintains per-thread state (requires C++ `thread_local` support).
#define LIBC_ERRNO_MODE_THREAD_LOCAL 2
// libc maintains shared state used by all threads, contrary to standard C
// semantics unless always single-threaded; nothing prevents data races.
#define LIBC_ERRNO_MODE_SHARED 3
// libc doesn't maintain any internal state, instead the embedder must define
// `int *__llvm_libc_errno(void);` C function.
#define LIBC_ERRNO_MODE_EXTERNAL 4
// libc uses system `<errno.h>` `errno` macro directly in the overlay mode; in
// fullbuild mode, effectively the same as `LIBC_ERRNO_MODE_EXTERNAL`.
#define LIBC_ERRNO_MODE_SYSTEM 5
#if !defined(LIBC_ERRNO_MODE) || LIBC_ERRNO_MODE == LIBC_ERRNO_MODE_DEFAULT
#undef LIBC_ERRNO_MODE
#if defined(LIBC_FULL_BUILD) || !defined(LIBC_COPT_PUBLIC_PACKAGING)
#define LIBC_ERRNO_MODE LIBC_ERRNO_MODE_THREAD_LOCAL
#else
#define LIBC_ERRNO_MODE LIBC_ERRNO_MODE_SYSTEM
#endif
#endif // LIBC_ERRNO_MODE
#if LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_DEFAULT && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_UNDEFINED && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_THREAD_LOCAL && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SHARED && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_EXTERNAL && \
LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM
#error LIBC_ERRNO_MODE must be one of the following values: \
LIBC_ERRNO_MODE_DEFAULT, \
LIBC_ERRNO_MODE_UNDEFINED, \
LIBC_ERRNO_MODE_THREAD_LOCAL, \
LIBC_ERRNO_MODE_SHARED, \
LIBC_ERRNO_MODE_EXTERNAL, \
LIBC_ERRNO_MODE_SYSTEM
#endif
namespace LIBC_NAMESPACE_DECL {
#if LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM_INLINE
#if LIBC_ERRNO_MODE == LIBC_ERRNO_MODE_UNDEFINED
void Errno::operator=(int) {}
@@ -93,4 +56,6 @@ Errno::operator int() { return errno; }
// Define the global `libc_errno` instance.
Errno libc_errno;
#endif // LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM_INLINE
} // namespace LIBC_NAMESPACE_DECL

View File

@@ -1,47 +0,0 @@
//===-- Implementation header for libc_errno --------------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SRC_ERRNO_LIBC_ERRNO_H
#define LLVM_LIBC_SRC_ERRNO_LIBC_ERRNO_H
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
#include "hdr/errno_macros.h"
// This header is to be consumed by internal implementations, in which all of
// them should refer to `libc_errno` instead of using `errno` directly from
// <errno.h> header.
// Unit and hermetic tests should:
// - #include "src/errno/libc_errno.h"
// - NOT #include <errno.h>
// - Only use `libc_errno` in the code
// - Depend on libc.src.errno.errno
// Integration tests should:
// - NOT #include "src/errno/libc_errno.h"
// - #include <errno.h>
// - Use regular `errno` in the code
// - Still depend on libc.src.errno.errno
namespace LIBC_NAMESPACE_DECL {
extern "C" int *__llvm_libc_errno() noexcept;
struct Errno {
void operator=(int);
operator int();
};
extern Errno libc_errno;
} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_ERRNO_LIBC_ERRNO_H

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "hdr/fcntl_macros.h"
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "hdr/fcntl_macros.h"
#include "hdr/types/mode_t.h"

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "hdr/types/mode_t.h"
#include <stdarg.h>

View File

@@ -8,9 +8,9 @@
#include "src/inttypes/strtoimax.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/str_to_integer.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -8,9 +8,9 @@
#include "src/inttypes/strtoumax.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/str_to_integer.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -14,9 +14,9 @@
#include "src/__support/FPUtil/multiply_add.h"
#include "src/__support/FPUtil/rounding_mode.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h"
#include "src/errno/libc_errno.h"
#include "explogxf.h"

View File

@@ -14,10 +14,10 @@
#include "src/__support/FPUtil/multiply_add.h"
#include "src/__support/FPUtil/rounding_mode.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h"
#include "src/__support/macros/properties/cpu_features.h"
#include "src/errno/libc_errno.h"
#include "explogxf.h"

View File

@@ -8,9 +8,9 @@
#include "src/math/nan.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/str_to_float.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -8,9 +8,9 @@
#include "src/math/nanf.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/str_to_float.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -8,9 +8,9 @@
#include "src/math/nanf128.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/str_to_float.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -8,9 +8,9 @@
#include "src/math/nanf16.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/str_to_float.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -8,9 +8,9 @@
#include "src/math/nanl.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/str_to_float.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -13,8 +13,8 @@
#include "hdr/types/struct_timespec.h"
#include "src/__support/OSUtil/syscall.h" // syscall_impl
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // SYS_poll, SYS_ppoll

View File

@@ -9,9 +9,9 @@
#include "pthread_atfork.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/fork_callbacks.h"
#include "src/errno/libc_errno.h"
#include <pthread.h> // For pthread_* type definitions.

View File

@@ -9,8 +9,8 @@
#include "pthread_attr_setdetachstate.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -9,8 +9,8 @@
#include "pthread_attr_setguardsize.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <linux/param.h> // For EXEC_PAGESIZE.
#include <pthread.h>

View File

@@ -10,9 +10,9 @@
#include "pthread_attr_setstacksize.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h" // For STACK_ALIGNMENT
#include "src/errno/libc_errno.h"
#include <pthread.h>
#include <stdint.h>

View File

@@ -9,8 +9,8 @@
#include "pthread_attr_setstacksize.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -9,8 +9,8 @@
#include "pthread_condattr_setclock.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "hdr/time_macros.h" // CLOCK_MONOTONIC, CLOCK_REALTIME
#include <pthread.h> // pthread_condattr_t

View File

@@ -9,8 +9,8 @@
#include "pthread_condattr_setpshared.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <pthread.h> // pthread_condattr_t, PTHREAD_PROCESS_SHARED, PTHREAD_PROCESS_PRIVATE

View File

@@ -16,10 +16,10 @@
#include "pthread_attr_getstack.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h"
#include "src/__support/threads/thread.h"
#include "src/errno/libc_errno.h"
#include <pthread.h> // For pthread_* type definitions.

View File

@@ -9,9 +9,9 @@
#include "pthread_key_create.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -9,9 +9,9 @@
#include "pthread_key_delete.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -10,8 +10,8 @@
#include "pthread_mutexattr.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -10,8 +10,8 @@
#include "pthread_mutexattr.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -10,8 +10,8 @@
#include "pthread_mutexattr.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -9,11 +9,11 @@
#include "src/pthread/pthread_rwlock_timedrdlock.h"
#include "src/__support/common.h"
#include "src/__support/libc_assert.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h"
#include "src/__support/threads/linux/rwlock.h"
#include "src/__support/time/linux/abs_timeout.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -9,9 +9,9 @@
#include "src/pthread/pthread_rwlock_trywrlock.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -9,9 +9,9 @@
#include "src/pthread/pthread_rwlock_unlock.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -9,8 +9,8 @@
#include "pthread_rwlockattr_setkind_np.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <pthread.h> // pthread_rwlockattr_t

View File

@@ -9,8 +9,8 @@
#include "pthread_rwlockattr_setpshared.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <pthread.h> // pthread_rwlockattr_t, PTHREAD_PROCESS_SHARED, PTHREAD_PROCESS_PRIVATE

View File

@@ -9,9 +9,9 @@
#include "pthread_setspecific.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
#include "src/errno/libc_errno.h"
#include <pthread.h>

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sched.h>
#include <stdint.h>

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sched.h>
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -9,8 +9,8 @@
#include "src/search/hcreate.h"
#include "src/__support/HashTable/randomness.h"
#include "src/__support/HashTable/table.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/search/hsearch/global.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -9,8 +9,8 @@
#include "src/search/hcreate_r.h"
#include "src/__support/HashTable/randomness.h"
#include "src/__support/HashTable/table.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, hcreate_r,

View File

@@ -8,8 +8,8 @@
#include "src/search/hdestroy_r.h"
#include "src/__support/HashTable/table.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(void, hdestroy_r, (struct hsearch_data * htab)) {

View File

@@ -9,8 +9,8 @@
#include "src/search/hsearch.h"
#include "src/__support/HashTable/randomness.h"
#include "src/__support/HashTable/table.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/search/hsearch/global.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -8,8 +8,8 @@
#include "src/search/hsearch_r.h"
#include "src/__support/HashTable/table.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, hsearch_r,

View File

@@ -10,8 +10,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/signal/linux/signal_utils.h"
#include <signal.h>

View File

@@ -10,8 +10,8 @@
#include "hdr/types/sigset_t.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/signal/linux/signal_utils.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -10,8 +10,8 @@
#include "hdr/types/sigset_t.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/signal/linux/signal_utils.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -8,8 +8,8 @@
#include "src/signal/sigaltstack.h"
#include "hdr/types/stack_t.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/signal/linux/signal_utils.h"
#include "src/__support/common.h"

View File

@@ -10,8 +10,8 @@
#include "hdr/types/sigset_t.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/signal/linux/signal_utils.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
#include "src/signal/sigemptyset.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/signal/linux/signal_utils.h"
#include "src/__support/common.h"

View File

@@ -10,8 +10,8 @@
#include "hdr/types/sigset_t.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/signal/linux/signal_utils.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -11,8 +11,8 @@
#include "hdr/types/sigset_t.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/signal/linux/signal_utils.h"
#include <sys/syscall.h> // For syscall numbers.

View File

@@ -11,8 +11,8 @@
#include "file_actions.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <spawn.h>

View File

@@ -11,8 +11,8 @@
#include "file_actions.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <spawn.h>

View File

@@ -11,8 +11,8 @@
#include "file_actions.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <spawn.h>

View File

@@ -12,8 +12,8 @@
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <spawn.h>

View File

@@ -14,8 +14,8 @@
#include "src/__support/CPP/new.h"
#include "src/__support/File/file.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/file.h"
#include "hdr/types/FILE.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/file.h"
#include "hdr/types/FILE.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/file.h"
#include "hdr/types/FILE.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <stddef.h>
namespace LIBC_NAMESPACE_DECL {

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/file.h"
#include "hdr/types/FILE.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <stddef.h>
namespace LIBC_NAMESPACE_DECL {

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/file.h"
#include "hdr/types/FILE.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <stddef.h>
namespace LIBC_NAMESPACE_DECL {

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/file.h"
#include "hdr/types/FILE.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/file.h"
#include "hdr/types/FILE.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <stddef.h>
namespace LIBC_NAMESPACE_DECL {

View File

@@ -11,8 +11,8 @@
#include "src/__support/File/file.h"
#include "hdr/types/FILE.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <stddef.h>
namespace LIBC_NAMESPACE_DECL {

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/file.h"
#include "hdr/types/FILE.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <stddef.h>
namespace LIBC_NAMESPACE_DECL {

View File

@@ -10,8 +10,8 @@
#include "src/__support/File/file.h"
#include "hdr/types/FILE.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <stddef.h>
namespace LIBC_NAMESPACE_DECL {

View File

@@ -9,8 +9,8 @@
#include "src/stdio/fseek.h"
#include "src/__support/File/file.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -9,8 +9,8 @@
#include "src/stdio/fseeko.h"
#include "src/__support/File/file.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -9,8 +9,8 @@
#include "src/stdio/ftell.h"
#include "src/__support/File/file.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

View File

@@ -9,8 +9,8 @@
#include "src/stdio/ftello.h"
#include "src/__support/File/file.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
namespace LIBC_NAMESPACE_DECL {

Some files were not shown because too many files have changed in this diff Show More