[libc-commits] [libc] [libc] remove errno.h includes (PR #110934)
Job Henandez Lara via libc-commits
libc-commits at lists.llvm.org
Sat Oct 5 16:22:23 PDT 2024
https://github.com/Jobhdez updated https://github.com/llvm/llvm-project/pull/110934
>From 301b4855ec134f6c7d8f7cc0116488e8fda7e139 Mon Sep 17 00:00:00 2001
From: Job Hernandez <jobhdezlara93 at gmail.com>
Date: Wed, 2 Oct 2024 15:22:25 -0700
Subject: [PATCH 1/8] remove errno includes
---
libc/src/__support/StringUtil/tables/CMakeLists.txt | 1 +
libc/src/__support/StringUtil/tables/linux_extension_errors.h | 2 +-
libc/src/__support/StringUtil/tables/posix_errors.h | 1 -
libc/src/__support/StringUtil/tables/stdc_errors.h | 1 -
libc/src/errno/libc_errno.h | 2 --
libc/src/math/generic/acosf.cpp | 1 -
libc/src/math/generic/asinf.cpp | 1 -
libc/src/math/generic/cosf.cpp | 1 -
libc/src/math/generic/exp.cpp | 1 -
libc/src/math/generic/exp10.cpp | 1 -
libc/src/math/generic/exp10f_impl.h | 1 -
libc/src/math/generic/exp2.cpp | 1 -
libc/src/math/generic/exp2f_impl.h | 1 -
libc/src/math/generic/expf.cpp | 1 -
libc/src/math/generic/explogxf.h | 1 -
libc/src/math/generic/expm1f.cpp | 1 -
libc/src/math/generic/powf.cpp | 1 -
libc/src/math/generic/sincosf.cpp | 1 -
libc/src/math/generic/sinf.cpp | 1 -
libc/src/math/generic/tanf.cpp | 1 -
libc/src/pthread/pthread_atfork.cpp | 1 -
libc/src/pthread/pthread_attr_setdetachstate.cpp | 1 -
libc/src/pthread/pthread_attr_setguardsize.cpp | 1 -
libc/src/pthread/pthread_attr_setstack.cpp | 1 -
libc/src/pthread/pthread_attr_setstacksize.cpp | 1 -
libc/src/pthread/pthread_condattr_setclock.cpp | 1 -
libc/src/pthread/pthread_condattr_setpshared.cpp | 1 -
libc/src/pthread/pthread_create.cpp | 1 -
libc/src/pthread/pthread_key_create.cpp | 1 -
libc/src/pthread/pthread_key_delete.cpp | 1 -
libc/src/pthread/pthread_mutex_init.cpp | 1 -
libc/src/pthread/pthread_mutexattr_destroy.cpp | 1 -
libc/src/pthread/pthread_mutexattr_getpshared.cpp | 1 -
libc/src/pthread/pthread_mutexattr_getrobust.cpp | 1 -
libc/src/pthread/pthread_mutexattr_gettype.cpp | 1 -
libc/src/pthread/pthread_mutexattr_setpshared.cpp | 1 -
libc/src/pthread/pthread_mutexattr_setrobust.cpp | 1 -
libc/src/pthread/pthread_mutexattr_settype.cpp | 1 -
libc/src/pthread/pthread_rwlock_destroy.cpp | 1 -
libc/src/pthread/pthread_rwlock_init.cpp | 1 -
libc/src/pthread/pthread_rwlock_rdlock.cpp | 1 -
libc/src/pthread/pthread_rwlock_timedrdlock.cpp | 1 -
libc/src/pthread/pthread_rwlock_timedwrlock.cpp | 1 -
libc/src/pthread/pthread_rwlock_tryrdlock.cpp | 1 -
libc/src/pthread/pthread_rwlock_trywrlock.cpp | 1 -
libc/src/pthread/pthread_rwlock_unlock.cpp | 1 -
libc/src/pthread/pthread_rwlock_wrlock.cpp | 1 -
libc/src/pthread/pthread_rwlockattr_setkind_np.cpp | 1 -
libc/src/pthread/pthread_rwlockattr_setpshared.cpp | 1 -
libc/src/pthread/pthread_setspecific.cpp | 1 -
libc/src/spawn/posix_spawn_file_actions_addclose.cpp | 1 -
libc/src/spawn/posix_spawn_file_actions_adddup2.cpp | 1 -
libc/src/spawn/posix_spawn_file_actions_addopen.cpp | 1 -
libc/src/spawn/posix_spawn_file_actions_destroy.cpp | 1 -
libc/src/threads/thrd_create.cpp | 1 -
libc/test/UnitTest/PrintfMatcher.h | 1 -
libc/test/UnitTest/ScanfMatcher.h | 1 -
libc/test/integration/src/pthread/pthread_name_test.cpp | 1 -
libc/test/integration/src/spawn/posix_spawn_test_binary.cpp | 1 -
libc/test/integration/src/unistd/fork_test.cpp | 1 -
libc/test/integration/src/unistd/stack_smashing_test.cpp | 1 -
libc/test/integration/startup/linux/tls_test.cpp | 1 -
libc/test/src/math/RoundToIntegerTest.h | 1 -
libc/test/src/math/acosf_test.cpp | 1 -
libc/test/src/math/acoshf_test.cpp | 1 -
libc/test/src/math/asinf_test.cpp | 1 -
libc/test/src/math/asinhf_test.cpp | 1 -
libc/test/src/math/atanf_test.cpp | 1 -
libc/test/src/math/atanhf_test.cpp | 1 -
libc/test/src/math/cosf_test.cpp | 1 -
libc/test/src/math/coshf_test.cpp | 1 -
libc/test/src/math/erff_test.cpp | 1 -
libc/test/src/math/exp10_test.cpp | 1 -
libc/test/src/math/exp2_test.cpp | 1 -
libc/test/src/math/exp_test.cpp | 1 -
libc/test/src/math/log10_test.cpp | 1 -
libc/test/src/math/log10f_test.cpp | 1 -
libc/test/src/math/log1p_test.cpp | 1 -
libc/test/src/math/log1pf_test.cpp | 1 -
libc/test/src/math/log2_test.cpp | 1 -
libc/test/src/math/log_test.cpp | 1 -
libc/test/src/math/powf_test.cpp | 1 -
libc/test/src/math/sincosf_test.cpp | 1 -
libc/test/src/math/sinf_test.cpp | 1 -
libc/test/src/math/sinhf_test.cpp | 1 -
libc/test/src/math/smoke/RoundToIntegerTest.h | 1 -
libc/test/src/math/smoke/acosf_test.cpp | 1 -
libc/test/src/math/smoke/acoshf_test.cpp | 1 -
libc/test/src/math/smoke/asinf_test.cpp | 1 -
libc/test/src/math/smoke/asinhf_test.cpp | 1 -
libc/test/src/math/smoke/atanf_test.cpp | 1 -
libc/test/src/math/smoke/atanhf_test.cpp | 1 -
libc/test/src/math/smoke/cosf_test.cpp | 1 -
libc/test/src/math/smoke/coshf_test.cpp | 1 -
libc/test/src/math/smoke/erff_test.cpp | 1 -
libc/test/src/math/smoke/exp10_test.cpp | 1 -
libc/test/src/math/smoke/exp2_test.cpp | 1 -
libc/test/src/math/smoke/exp_test.cpp | 1 -
libc/test/src/math/smoke/expm1_test.cpp | 1 -
libc/test/src/math/smoke/log10_test.cpp | 1 -
libc/test/src/math/smoke/log10f_test.cpp | 1 -
libc/test/src/math/smoke/log1p_test.cpp | 1 -
libc/test/src/math/smoke/log1pf_test.cpp | 1 -
libc/test/src/math/smoke/log2_test.cpp | 1 -
libc/test/src/math/smoke/log_test.cpp | 1 -
libc/test/src/math/smoke/powf_test.cpp | 1 -
libc/test/src/math/smoke/sincosf_test.cpp | 1 -
libc/test/src/math/smoke/sinf_test.cpp | 1 -
libc/test/src/math/smoke/sinhf_test.cpp | 1 -
libc/test/src/math/smoke/tanf_test.cpp | 1 -
libc/test/src/math/smoke/tanhf_test.cpp | 1 -
libc/test/src/math/tanf_test.cpp | 1 -
libc/test/src/math/tanhf_test.cpp | 1 -
libc/test/src/pthread/pthread_attr_test.cpp | 1 -
libc/test/src/pthread/pthread_mutexattr_test.cpp | 1 -
libc/test/src/signal/sigaddset_test.cpp | 1 -
libc/test/src/signal/sigdelset_test.cpp | 1 -
libc/test/src/signal/sigfillset_test.cpp | 1 -
libc/test/src/spawn/posix_spawn_file_actions_test.cpp | 1 -
libc/test/src/sys/prctl/linux/prctl_test.cpp | 1 -
libc/test/src/sys/select/select_failure_test.cpp | 1 -
libc/test/src/sys/utsname/uname_test.cpp | 1 -
libc/test/src/sys/wait/wait4_test.cpp | 1 -
libc/test/src/sys/wait/waitpid_test.cpp | 1 -
124 files changed, 2 insertions(+), 124 deletions(-)
diff --git a/libc/src/__support/StringUtil/tables/CMakeLists.txt b/libc/src/__support/StringUtil/tables/CMakeLists.txt
index b7bb33ee0a0fe2..fffe93592f01d2 100644
--- a/libc/src/__support/StringUtil/tables/CMakeLists.txt
+++ b/libc/src/__support/StringUtil/tables/CMakeLists.txt
@@ -23,6 +23,7 @@ add_header_library(
DEPENDS
libc.include.errno
libc.src.__support.StringUtil.message_mapper
+ libc.src.errno.libc_errno
)
add_header_library(
diff --git a/libc/src/__support/StringUtil/tables/linux_extension_errors.h b/libc/src/__support/StringUtil/tables/linux_extension_errors.h
index f6e8dea154d3be..02ac3c011b1e3a 100644
--- a/libc/src/__support/StringUtil/tables/linux_extension_errors.h
+++ b/libc/src/__support/StringUtil/tables/linux_extension_errors.h
@@ -11,8 +11,8 @@
#include "src/__support/StringUtil/message_mapper.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
-#include <errno.h> // For error macros
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/__support/StringUtil/tables/posix_errors.h b/libc/src/__support/StringUtil/tables/posix_errors.h
index 5294f85eb8d24e..65390ceade9f3b 100644
--- a/libc/src/__support/StringUtil/tables/posix_errors.h
+++ b/libc/src/__support/StringUtil/tables/posix_errors.h
@@ -12,7 +12,6 @@
#include "src/__support/StringUtil/message_mapper.h"
#include "src/__support/macros/config.h"
-#include <errno.h> // For error macros
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/__support/StringUtil/tables/stdc_errors.h b/libc/src/__support/StringUtil/tables/stdc_errors.h
index 1f0beef82001cd..f4f981785c9e1d 100644
--- a/libc/src/__support/StringUtil/tables/stdc_errors.h
+++ b/libc/src/__support/StringUtil/tables/stdc_errors.h
@@ -12,7 +12,6 @@
#include "src/__support/StringUtil/message_mapper.h"
#include "src/__support/macros/config.h"
-#include <errno.h> // For error macros
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/errno/libc_errno.h b/libc/src/errno/libc_errno.h
index 44ee2714843bab..49c9146b28c606 100644
--- a/libc/src/errno/libc_errno.h
+++ b/libc/src/errno/libc_errno.h
@@ -21,13 +21,11 @@
// 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
diff --git a/libc/src/math/generic/acosf.cpp b/libc/src/math/generic/acosf.cpp
index 95d8bc0213cba7..cf9721f8c425a3 100644
--- a/libc/src/math/generic/acosf.cpp
+++ b/libc/src/math/generic/acosf.cpp
@@ -16,7 +16,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-#include <errno.h>
#include "inv_trigf_utils.h"
diff --git a/libc/src/math/generic/asinf.cpp b/libc/src/math/generic/asinf.cpp
index d6acc3a1692bc4..f92f6368b0aa95 100644
--- a/libc/src/math/generic/asinf.cpp
+++ b/libc/src/math/generic/asinf.cpp
@@ -17,7 +17,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-#include <errno.h>
#include "inv_trigf_utils.h"
diff --git a/libc/src/math/generic/cosf.cpp b/libc/src/math/generic/cosf.cpp
index 6a59b3763b6e87..18e019ae7c4595 100644
--- a/libc/src/math/generic/cosf.cpp
+++ b/libc/src/math/generic/cosf.cpp
@@ -18,7 +18,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/exp.cpp b/libc/src/math/generic/exp.cpp
index df0c2eab7155c6..0b56770c0c3e22 100644
--- a/libc/src/math/generic/exp.cpp
+++ b/libc/src/math/generic/exp.cpp
@@ -25,7 +25,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/exp10.cpp b/libc/src/math/generic/exp10.cpp
index d01bbd8fc01c32..68d9608b379785 100644
--- a/libc/src/math/generic/exp10.cpp
+++ b/libc/src/math/generic/exp10.cpp
@@ -25,7 +25,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/exp10f_impl.h b/libc/src/math/generic/exp10f_impl.h
index fe2195c6e04739..2bdd4cd465c0ef 100644
--- a/libc/src/math/generic/exp10f_impl.h
+++ b/libc/src/math/generic/exp10f_impl.h
@@ -21,7 +21,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
namespace generic {
diff --git a/libc/src/math/generic/exp2.cpp b/libc/src/math/generic/exp2.cpp
index fbabb625af51fa..42625360284f99 100644
--- a/libc/src/math/generic/exp2.cpp
+++ b/libc/src/math/generic/exp2.cpp
@@ -25,7 +25,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/exp2f_impl.h b/libc/src/math/generic/exp2f_impl.h
index 3f1c5ee68f081e..41751c7424ca85 100644
--- a/libc/src/math/generic/exp2f_impl.h
+++ b/libc/src/math/generic/exp2f_impl.h
@@ -21,7 +21,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h"
-#include <errno.h>
#include "explogxf.h"
diff --git a/libc/src/math/generic/expf.cpp b/libc/src/math/generic/expf.cpp
index 1d7c0478eb2250..51462d59289a64 100644
--- a/libc/src/math/generic/expf.cpp
+++ b/libc/src/math/generic/expf.cpp
@@ -19,7 +19,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/explogxf.h b/libc/src/math/generic/explogxf.h
index 7daed558f74b1e..88287c703db730 100644
--- a/libc/src/math/generic/explogxf.h
+++ b/libc/src/math/generic/explogxf.h
@@ -20,7 +20,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/cpu_features.h"
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/expm1f.cpp b/libc/src/math/generic/expm1f.cpp
index b1a0fe16de0771..47dd515456a605 100644
--- a/libc/src/math/generic/expm1f.cpp
+++ b/libc/src/math/generic/expm1f.cpp
@@ -21,7 +21,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/powf.cpp b/libc/src/math/generic/powf.cpp
index e3dee678a1a70a..f13c710e78e112 100644
--- a/libc/src/math/generic/powf.cpp
+++ b/libc/src/math/generic/powf.cpp
@@ -25,7 +25,6 @@
#include "exp10f_impl.h" // Speedup for powf(10, y) = exp10f(y)
#include "exp2f_impl.h" // Speedup for powf(2, y) = exp2f(y)
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/sincosf.cpp b/libc/src/math/generic/sincosf.cpp
index 3bf8e9772231d6..449281293d2ae3 100644
--- a/libc/src/math/generic/sincosf.cpp
+++ b/libc/src/math/generic/sincosf.cpp
@@ -17,7 +17,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/sinf.cpp b/libc/src/math/generic/sinf.cpp
index 43c2c2a8d883d2..62015070b29054 100644
--- a/libc/src/math/generic/sinf.cpp
+++ b/libc/src/math/generic/sinf.cpp
@@ -19,7 +19,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-#include <errno.h>
#if defined(LIBC_TARGET_CPU_HAS_FMA)
#include "range_reduction_fma.h"
diff --git a/libc/src/math/generic/tanf.cpp b/libc/src/math/generic/tanf.cpp
index 01d8c9855d461b..105518336f8e76 100644
--- a/libc/src/math/generic/tanf.cpp
+++ b/libc/src/math/generic/tanf.cpp
@@ -19,7 +19,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_atfork.cpp b/libc/src/pthread/pthread_atfork.cpp
index d3f3c259992ec2..62846c27a83195 100644
--- a/libc/src/pthread/pthread_atfork.cpp
+++ b/libc/src/pthread/pthread_atfork.cpp
@@ -12,7 +12,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/fork_callbacks.h"
-#include <errno.h>
#include <pthread.h> // For pthread_* type definitions.
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_attr_setdetachstate.cpp b/libc/src/pthread/pthread_attr_setdetachstate.cpp
index 3aa72d217f28b3..a413abdb70af2a 100644
--- a/libc/src/pthread/pthread_attr_setdetachstate.cpp
+++ b/libc/src/pthread/pthread_attr_setdetachstate.cpp
@@ -11,7 +11,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_attr_setguardsize.cpp b/libc/src/pthread/pthread_attr_setguardsize.cpp
index 389ee773fc5db5..8fb62bef422302 100644
--- a/libc/src/pthread/pthread_attr_setguardsize.cpp
+++ b/libc/src/pthread/pthread_attr_setguardsize.cpp
@@ -11,7 +11,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <linux/param.h> // For EXEC_PAGESIZE.
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_attr_setstack.cpp b/libc/src/pthread/pthread_attr_setstack.cpp
index f4f2d1450633ea..361591d87a0f0d 100644
--- a/libc/src/pthread/pthread_attr_setstack.cpp
+++ b/libc/src/pthread/pthread_attr_setstack.cpp
@@ -13,7 +13,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h" // For STACK_ALIGNMENT
-#include <errno.h>
#include <pthread.h>
#include <stdint.h>
diff --git a/libc/src/pthread/pthread_attr_setstacksize.cpp b/libc/src/pthread/pthread_attr_setstacksize.cpp
index f327d3365b5d85..59f5921daf4e50 100644
--- a/libc/src/pthread/pthread_attr_setstacksize.cpp
+++ b/libc/src/pthread/pthread_attr_setstacksize.cpp
@@ -11,7 +11,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_condattr_setclock.cpp b/libc/src/pthread/pthread_condattr_setclock.cpp
index 5c0144523f93e6..8422b19fd5e7b5 100644
--- a/libc/src/pthread/pthread_condattr_setclock.cpp
+++ b/libc/src/pthread/pthread_condattr_setclock.cpp
@@ -11,7 +11,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h> // EINVAL
#include <pthread.h> // pthread_condattr_t
#include <sys/types.h> // clockid_t
#include <time.h> // CLOCK_MONOTONIC, CLOCK_REALTIME
diff --git a/libc/src/pthread/pthread_condattr_setpshared.cpp b/libc/src/pthread/pthread_condattr_setpshared.cpp
index 536aeadac5d446..29f8ee95b590c5 100644
--- a/libc/src/pthread/pthread_condattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_condattr_setpshared.cpp
@@ -11,7 +11,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h> // EINVAL
#include <pthread.h> // pthread_condattr_t, PTHREAD_PROCESS_SHARED, PTHREAD_PROCESS_PRIVATE
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_create.cpp b/libc/src/pthread/pthread_create.cpp
index 1fb4b50109401c..5f829d13034964 100644
--- a/libc/src/pthread/pthread_create.cpp
+++ b/libc/src/pthread/pthread_create.cpp
@@ -20,7 +20,6 @@
#include "src/__support/macros/optimization.h"
#include "src/__support/threads/thread.h"
-#include <errno.h>
#include <pthread.h> // For pthread_* type definitions.
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_key_create.cpp b/libc/src/pthread/pthread_key_create.cpp
index 0583baca22f4d4..f02fbdc782e778 100644
--- a/libc/src/pthread/pthread_key_create.cpp
+++ b/libc/src/pthread/pthread_key_create.cpp
@@ -12,7 +12,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_key_delete.cpp b/libc/src/pthread/pthread_key_delete.cpp
index 20484fa9bdf828..e77ebb99189d9c 100644
--- a/libc/src/pthread/pthread_key_delete.cpp
+++ b/libc/src/pthread/pthread_key_delete.cpp
@@ -12,7 +12,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutex_init.cpp b/libc/src/pthread/pthread_mutex_init.cpp
index 0281f732473d9d..94052e53d8c0ab 100644
--- a/libc/src/pthread/pthread_mutex_init.cpp
+++ b/libc/src/pthread/pthread_mutex_init.cpp
@@ -13,7 +13,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/mutex.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutexattr_destroy.cpp b/libc/src/pthread/pthread_mutexattr_destroy.cpp
index 3b2551afd11b55..4daf84d7cc0d89 100644
--- a/libc/src/pthread/pthread_mutexattr_destroy.cpp
+++ b/libc/src/pthread/pthread_mutexattr_destroy.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutexattr_getpshared.cpp b/libc/src/pthread/pthread_mutexattr_getpshared.cpp
index 2d83a5229e9ecd..142eb9fd3b4526 100644
--- a/libc/src/pthread/pthread_mutexattr_getpshared.cpp
+++ b/libc/src/pthread/pthread_mutexattr_getpshared.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutexattr_getrobust.cpp b/libc/src/pthread/pthread_mutexattr_getrobust.cpp
index 508b502a580087..9ce46833ecbf5f 100644
--- a/libc/src/pthread/pthread_mutexattr_getrobust.cpp
+++ b/libc/src/pthread/pthread_mutexattr_getrobust.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutexattr_gettype.cpp b/libc/src/pthread/pthread_mutexattr_gettype.cpp
index 3747bf5ce73e94..6ba3256b35f805 100644
--- a/libc/src/pthread/pthread_mutexattr_gettype.cpp
+++ b/libc/src/pthread/pthread_mutexattr_gettype.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutexattr_setpshared.cpp b/libc/src/pthread/pthread_mutexattr_setpshared.cpp
index b290de764c91b6..e1223750ec591a 100644
--- a/libc/src/pthread/pthread_mutexattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_mutexattr_setpshared.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutexattr_setrobust.cpp b/libc/src/pthread/pthread_mutexattr_setrobust.cpp
index e572827486c077..e1327e9ef1e028 100644
--- a/libc/src/pthread/pthread_mutexattr_setrobust.cpp
+++ b/libc/src/pthread/pthread_mutexattr_setrobust.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutexattr_settype.cpp b/libc/src/pthread/pthread_mutexattr_settype.cpp
index 27e8ff859ba347..e23b52736bfc5e 100644
--- a/libc/src/pthread/pthread_mutexattr_settype.cpp
+++ b/libc/src/pthread/pthread_mutexattr_settype.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_destroy.cpp b/libc/src/pthread/pthread_rwlock_destroy.cpp
index 345076aae43488..afc5622e54a003 100644
--- a/libc/src/pthread/pthread_rwlock_destroy.cpp
+++ b/libc/src/pthread/pthread_rwlock_destroy.cpp
@@ -12,7 +12,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_init.cpp b/libc/src/pthread/pthread_rwlock_init.cpp
index d1a31625d0dabd..dc5424cbc4838d 100644
--- a/libc/src/pthread/pthread_rwlock_init.cpp
+++ b/libc/src/pthread/pthread_rwlock_init.cpp
@@ -14,7 +14,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_rdlock.cpp b/libc/src/pthread/pthread_rwlock_rdlock.cpp
index 16d82301c54a9a..7dee8eb9a44b12 100644
--- a/libc/src/pthread/pthread_rwlock_rdlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_rdlock.cpp
@@ -12,7 +12,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_timedrdlock.cpp b/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
index 905541014a4a46..710fb48e49573e 100644
--- a/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
@@ -15,7 +15,6 @@
#include "src/__support/threads/linux/rwlock.h"
#include "src/__support/time/linux/abs_timeout.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_timedwrlock.cpp b/libc/src/pthread/pthread_rwlock_timedwrlock.cpp
index f77ac40f22b897..d2dc70e992e82e 100644
--- a/libc/src/pthread/pthread_rwlock_timedwrlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_timedwrlock.cpp
@@ -15,7 +15,6 @@
#include "src/__support/threads/linux/rwlock.h"
#include "src/__support/time/linux/abs_timeout.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_tryrdlock.cpp b/libc/src/pthread/pthread_rwlock_tryrdlock.cpp
index da59a576b82747..d54b57f0560908 100644
--- a/libc/src/pthread/pthread_rwlock_tryrdlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_tryrdlock.cpp
@@ -12,7 +12,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_trywrlock.cpp b/libc/src/pthread/pthread_rwlock_trywrlock.cpp
index ccd1bd49c402c6..0ebf1cb334cd07 100644
--- a/libc/src/pthread/pthread_rwlock_trywrlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_trywrlock.cpp
@@ -12,7 +12,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_unlock.cpp b/libc/src/pthread/pthread_rwlock_unlock.cpp
index 77c50a8e65fdfb..c5713922e1273a 100644
--- a/libc/src/pthread/pthread_rwlock_unlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_unlock.cpp
@@ -12,7 +12,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_wrlock.cpp b/libc/src/pthread/pthread_rwlock_wrlock.cpp
index c2561c81f4bd0e..f02fb6b5db9c09 100644
--- a/libc/src/pthread/pthread_rwlock_wrlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_wrlock.cpp
@@ -12,7 +12,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp b/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp
index 45dbb05c7ab893..ddc37d6af91180 100644
--- a/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp
+++ b/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp
@@ -11,7 +11,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <pthread.h> // pthread_rwlockattr_t
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlockattr_setpshared.cpp b/libc/src/pthread/pthread_rwlockattr_setpshared.cpp
index 8088b68fdf33f4..de953c2a52cf7b 100644
--- a/libc/src/pthread/pthread_rwlockattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_rwlockattr_setpshared.cpp
@@ -11,7 +11,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h> // EINVAL
#include <pthread.h> // pthread_rwlockattr_t, PTHREAD_PROCESS_SHARED, PTHREAD_PROCESS_PRIVATE
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_setspecific.cpp b/libc/src/pthread/pthread_setspecific.cpp
index 5587a2d937abbb..994996d63a0241 100644
--- a/libc/src/pthread/pthread_setspecific.cpp
+++ b/libc/src/pthread/pthread_setspecific.cpp
@@ -12,7 +12,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
-#include <errno.h>
#include <pthread.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/spawn/posix_spawn_file_actions_addclose.cpp b/libc/src/spawn/posix_spawn_file_actions_addclose.cpp
index e43af8f665f959..0ed9c7f69bd5a2 100644
--- a/libc/src/spawn/posix_spawn_file_actions_addclose.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_addclose.cpp
@@ -13,7 +13,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <spawn.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp b/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp
index 9f28ffa48bee04..a7f4c03528d086 100644
--- a/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp
@@ -13,7 +13,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <spawn.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/spawn/posix_spawn_file_actions_addopen.cpp b/libc/src/spawn/posix_spawn_file_actions_addopen.cpp
index 7f9286099573e2..6222ee421f8d2d 100644
--- a/libc/src/spawn/posix_spawn_file_actions_addopen.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_addopen.cpp
@@ -13,7 +13,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <spawn.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/spawn/posix_spawn_file_actions_destroy.cpp b/libc/src/spawn/posix_spawn_file_actions_destroy.cpp
index 155e4c6a3b2bee..2339cee83ddcf8 100644
--- a/libc/src/spawn/posix_spawn_file_actions_destroy.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_destroy.cpp
@@ -13,7 +13,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <errno.h>
#include <spawn.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/threads/thrd_create.cpp b/libc/src/threads/thrd_create.cpp
index 52af72b07c8a80..c790ecb787da51 100644
--- a/libc/src/threads/thrd_create.cpp
+++ b/libc/src/threads/thrd_create.cpp
@@ -11,7 +11,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
-#include <errno.h>
#include <threads.h> // For thrd_* type definitions.
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/test/UnitTest/PrintfMatcher.h b/libc/test/UnitTest/PrintfMatcher.h
index e0c16cf05f2816..4323a69e516999 100644
--- a/libc/test/UnitTest/PrintfMatcher.h
+++ b/libc/test/UnitTest/PrintfMatcher.h
@@ -13,7 +13,6 @@
#include "src/stdio/printf_core/core_structs.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
namespace testing {
diff --git a/libc/test/UnitTest/ScanfMatcher.h b/libc/test/UnitTest/ScanfMatcher.h
index d64258f3f4f2c0..d106f17734ada6 100644
--- a/libc/test/UnitTest/ScanfMatcher.h
+++ b/libc/test/UnitTest/ScanfMatcher.h
@@ -13,7 +13,6 @@
#include "src/stdio/scanf_core/core_structs.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
namespace LIBC_NAMESPACE_DECL {
namespace testing {
diff --git a/libc/test/integration/src/pthread/pthread_name_test.cpp b/libc/test/integration/src/pthread/pthread_name_test.cpp
index d341792d11d6cb..aec5ff24abfe59 100644
--- a/libc/test/integration/src/pthread/pthread_name_test.cpp
+++ b/libc/test/integration/src/pthread/pthread_name_test.cpp
@@ -19,7 +19,6 @@
#include "test/IntegrationTest/test.h"
-#include <errno.h>
#include <pthread.h>
#include <stdint.h> // uintptr_t
diff --git a/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp b/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp
index 7aec39c1929287..c1b0cd671da718 100644
--- a/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp
+++ b/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp
@@ -1,5 +1,4 @@
#include "test_binary_properties.h"
-#include <errno.h>
#include <string.h>
#include <unistd.h>
diff --git a/libc/test/integration/src/unistd/fork_test.cpp b/libc/test/integration/src/unistd/fork_test.cpp
index 87f314f305101c..010f57a7d24486 100644
--- a/libc/test/integration/src/unistd/fork_test.cpp
+++ b/libc/test/integration/src/unistd/fork_test.cpp
@@ -18,7 +18,6 @@
#include "test/IntegrationTest/test.h"
-#include <errno.h>
#include <signal.h>
#include <sys/syscall.h>
#include <sys/wait.h>
diff --git a/libc/test/integration/src/unistd/stack_smashing_test.cpp b/libc/test/integration/src/unistd/stack_smashing_test.cpp
index 89fc53dac506ac..3508b1695cfdc5 100644
--- a/libc/test/integration/src/unistd/stack_smashing_test.cpp
+++ b/libc/test/integration/src/unistd/stack_smashing_test.cpp
@@ -17,7 +17,6 @@
#include "test/IntegrationTest/test.h"
-#include <errno.h>
#include <signal.h>
#include <sys/wait.h>
#include <unistd.h>
diff --git a/libc/test/integration/startup/linux/tls_test.cpp b/libc/test/integration/startup/linux/tls_test.cpp
index 2a6385e195a496..ef9fd9fcb7ff42 100644
--- a/libc/test/integration/startup/linux/tls_test.cpp
+++ b/libc/test/integration/startup/linux/tls_test.cpp
@@ -10,7 +10,6 @@
#include "src/sys/mman/mmap.h"
#include "test/IntegrationTest/test.h"
-#include <errno.h>
#include <sys/mman.h>
constexpr int threadLocalDataSize = 101;
diff --git a/libc/test/src/math/RoundToIntegerTest.h b/libc/test/src/math/RoundToIntegerTest.h
index 910ff968c1a035..995aba7b233ec8 100644
--- a/libc/test/src/math/RoundToIntegerTest.h
+++ b/libc/test/src/math/RoundToIntegerTest.h
@@ -19,7 +19,6 @@
#include "utils/MPFRWrapper/MPFRUtils.h"
#include "hdr/math_macros.h"
-#include <errno.h>
namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
using LIBC_NAMESPACE::Sign;
diff --git a/libc/test/src/math/acosf_test.cpp b/libc/test/src/math/acosf_test.cpp
index 488058237d191e..2e4c8eb2ab9610 100644
--- a/libc/test/src/math/acosf_test.cpp
+++ b/libc/test/src/math/acosf_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
diff --git a/libc/test/src/math/acoshf_test.cpp b/libc/test/src/math/acoshf_test.cpp
index 5d7f59792b52be..18ed5a11d50a7e 100644
--- a/libc/test/src/math/acoshf_test.cpp
+++ b/libc/test/src/math/acoshf_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcAcoshfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/asinf_test.cpp b/libc/test/src/math/asinf_test.cpp
index 09dc3c960ed9ab..5197810d8bd583 100644
--- a/libc/test/src/math/asinf_test.cpp
+++ b/libc/test/src/math/asinf_test.cpp
@@ -15,7 +15,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcAsinfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/asinhf_test.cpp b/libc/test/src/math/asinhf_test.cpp
index 3e55a563879d03..ac125c3520c44d 100644
--- a/libc/test/src/math/asinhf_test.cpp
+++ b/libc/test/src/math/asinhf_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcAsinhfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/atanf_test.cpp b/libc/test/src/math/atanf_test.cpp
index 376b4724b5a3a2..575ec89bd493c4 100644
--- a/libc/test/src/math/atanf_test.cpp
+++ b/libc/test/src/math/atanf_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcAtanfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/atanhf_test.cpp b/libc/test/src/math/atanhf_test.cpp
index 488a9a942ce913..8b9db1dfdd9763 100644
--- a/libc/test/src/math/atanhf_test.cpp
+++ b/libc/test/src/math/atanhf_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcAtanhfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/cosf_test.cpp b/libc/test/src/math/cosf_test.cpp
index 82790e3a9d4809..2143c36f3d30b7 100644
--- a/libc/test/src/math/cosf_test.cpp
+++ b/libc/test/src/math/cosf_test.cpp
@@ -15,7 +15,6 @@
#include "test/src/math/sdcomp26094.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LIBC_NAMESPACE::testing::SDCOMP26094_VALUES;
diff --git a/libc/test/src/math/coshf_test.cpp b/libc/test/src/math/coshf_test.cpp
index 00bbf4b0bd9465..0d1c322b8e6222 100644
--- a/libc/test/src/math/coshf_test.cpp
+++ b/libc/test/src/math/coshf_test.cpp
@@ -15,7 +15,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcCoshfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/erff_test.cpp b/libc/test/src/math/erff_test.cpp
index 851eda4b1542fd..f9b03377daa9b1 100644
--- a/libc/test/src/math/erff_test.cpp
+++ b/libc/test/src/math/erff_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcErffTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/exp10_test.cpp b/libc/test/src/math/exp10_test.cpp
index 61ae33ecae525e..6fb1d2d9d925e6 100644
--- a/libc/test/src/math/exp10_test.cpp
+++ b/libc/test/src/math/exp10_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcExp10Test = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/exp2_test.cpp b/libc/test/src/math/exp2_test.cpp
index f218eea0b358f1..adfceceeef4b76 100644
--- a/libc/test/src/math/exp2_test.cpp
+++ b/libc/test/src/math/exp2_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcExp2Test = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/exp_test.cpp b/libc/test/src/math/exp_test.cpp
index ee674c5fe6cb52..0ab3a4e543464b 100644
--- a/libc/test/src/math/exp_test.cpp
+++ b/libc/test/src/math/exp_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcExpTest = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/log10_test.cpp b/libc/test/src/math/log10_test.cpp
index 32b84686badea7..01aa1f82ae5d87 100644
--- a/libc/test/src/math/log10_test.cpp
+++ b/libc/test/src/math/log10_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLog10Test = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/log10f_test.cpp b/libc/test/src/math/log10f_test.cpp
index 4ba118455df4dd..b2c1c283e08e5c 100644
--- a/libc/test/src/math/log10f_test.cpp
+++ b/libc/test/src/math/log10f_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLog10fTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/log1p_test.cpp b/libc/test/src/math/log1p_test.cpp
index 98486deb12c744..107e965a0d3aec 100644
--- a/libc/test/src/math/log1p_test.cpp
+++ b/libc/test/src/math/log1p_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLog1pTest = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/log1pf_test.cpp b/libc/test/src/math/log1pf_test.cpp
index b42cf3b8681b22..bb181dc5e43b04 100644
--- a/libc/test/src/math/log1pf_test.cpp
+++ b/libc/test/src/math/log1pf_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLog1pfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/log2_test.cpp b/libc/test/src/math/log2_test.cpp
index f9bd93d44e50f5..8a07991a688867 100644
--- a/libc/test/src/math/log2_test.cpp
+++ b/libc/test/src/math/log2_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLog2Test = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/log_test.cpp b/libc/test/src/math/log_test.cpp
index c0f9edfc540a1e..969a469b2e1c63 100644
--- a/libc/test/src/math/log_test.cpp
+++ b/libc/test/src/math/log_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLogTest = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/powf_test.cpp b/libc/test/src/math/powf_test.cpp
index c13231f9d83b86..448dcc0035e9b0 100644
--- a/libc/test/src/math/powf_test.cpp
+++ b/libc/test/src/math/powf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcPowfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/sincosf_test.cpp b/libc/test/src/math/sincosf_test.cpp
index 7254c3be5b75f3..2823110331f302 100644
--- a/libc/test/src/math/sincosf_test.cpp
+++ b/libc/test/src/math/sincosf_test.cpp
@@ -15,7 +15,6 @@
#include "test/src/math/sdcomp26094.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcSinCosfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/sinf_test.cpp b/libc/test/src/math/sinf_test.cpp
index 370362639490b4..8fd3ed1577ceeb 100644
--- a/libc/test/src/math/sinf_test.cpp
+++ b/libc/test/src/math/sinf_test.cpp
@@ -15,7 +15,6 @@
#include "test/src/math/sdcomp26094.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcSinfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/sinhf_test.cpp b/libc/test/src/math/sinhf_test.cpp
index 400df2f18dabc9..6867c7aec57dff 100644
--- a/libc/test/src/math/sinhf_test.cpp
+++ b/libc/test/src/math/sinhf_test.cpp
@@ -15,7 +15,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcSinhfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/RoundToIntegerTest.h b/libc/test/src/math/smoke/RoundToIntegerTest.h
index 8b5f678b32449f..6ae97ce35a0d63 100644
--- a/libc/test/src/math/smoke/RoundToIntegerTest.h
+++ b/libc/test/src/math/smoke/RoundToIntegerTest.h
@@ -17,7 +17,6 @@
#include "test/UnitTest/Test.h"
#include "hdr/math_macros.h"
-#include <errno.h>
static constexpr int ROUNDING_MODES[4] = {FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO,
FE_TONEAREST};
diff --git a/libc/test/src/math/smoke/acosf_test.cpp b/libc/test/src/math/smoke/acosf_test.cpp
index 732c29548c60d3..039d8c2013830d 100644
--- a/libc/test/src/math/smoke/acosf_test.cpp
+++ b/libc/test/src/math/smoke/acosf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcAcosfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/acoshf_test.cpp b/libc/test/src/math/smoke/acoshf_test.cpp
index 2e94216ede364b..91d433df80558d 100644
--- a/libc/test/src/math/smoke/acoshf_test.cpp
+++ b/libc/test/src/math/smoke/acoshf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcAcoshfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/asinf_test.cpp b/libc/test/src/math/smoke/asinf_test.cpp
index c67d07711cd132..450255ccd3020d 100644
--- a/libc/test/src/math/smoke/asinf_test.cpp
+++ b/libc/test/src/math/smoke/asinf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcAsinfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/asinhf_test.cpp b/libc/test/src/math/smoke/asinhf_test.cpp
index f95184676303d6..a8e54f379a1fd0 100644
--- a/libc/test/src/math/smoke/asinhf_test.cpp
+++ b/libc/test/src/math/smoke/asinhf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcAsinhfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/atanf_test.cpp b/libc/test/src/math/smoke/atanf_test.cpp
index 56bf2f951b3361..0fe11d79533810 100644
--- a/libc/test/src/math/smoke/atanf_test.cpp
+++ b/libc/test/src/math/smoke/atanf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcAtanfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/atanhf_test.cpp b/libc/test/src/math/smoke/atanhf_test.cpp
index fa07b62e9f43f5..e22926bd2f0376 100644
--- a/libc/test/src/math/smoke/atanhf_test.cpp
+++ b/libc/test/src/math/smoke/atanhf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LIBC_NAMESPACE::Sign;
diff --git a/libc/test/src/math/smoke/cosf_test.cpp b/libc/test/src/math/smoke/cosf_test.cpp
index 7000fe2f2b07de..62f7ede9cf1781 100644
--- a/libc/test/src/math/smoke/cosf_test.cpp
+++ b/libc/test/src/math/smoke/cosf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcCosfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/coshf_test.cpp b/libc/test/src/math/smoke/coshf_test.cpp
index 4d915b12dee164..ddaa19f4c392f7 100644
--- a/libc/test/src/math/smoke/coshf_test.cpp
+++ b/libc/test/src/math/smoke/coshf_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcCoshfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/erff_test.cpp b/libc/test/src/math/smoke/erff_test.cpp
index 102126ee4e23fe..8a970f3a4b7ed1 100644
--- a/libc/test/src/math/smoke/erff_test.cpp
+++ b/libc/test/src/math/smoke/erff_test.cpp
@@ -12,7 +12,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcErffTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/exp10_test.cpp b/libc/test/src/math/smoke/exp10_test.cpp
index 7154cb176038c2..282ddc987b4993 100644
--- a/libc/test/src/math/smoke/exp10_test.cpp
+++ b/libc/test/src/math/smoke/exp10_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcExp10Test = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/smoke/exp2_test.cpp b/libc/test/src/math/smoke/exp2_test.cpp
index a8ef6cfa7f6a12..d148d27fad38dc 100644
--- a/libc/test/src/math/smoke/exp2_test.cpp
+++ b/libc/test/src/math/smoke/exp2_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcExp2Test = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/smoke/exp_test.cpp b/libc/test/src/math/smoke/exp_test.cpp
index 2abaa7230831f2..5fe6f3e92f4a6a 100644
--- a/libc/test/src/math/smoke/exp_test.cpp
+++ b/libc/test/src/math/smoke/exp_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcExpTest = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/smoke/expm1_test.cpp b/libc/test/src/math/smoke/expm1_test.cpp
index d5f166d53a50eb..bafdbda8af03bd 100644
--- a/libc/test/src/math/smoke/expm1_test.cpp
+++ b/libc/test/src/math/smoke/expm1_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcExpm1Test = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/smoke/log10_test.cpp b/libc/test/src/math/smoke/log10_test.cpp
index 37baf89128f2ec..e03416ae20c8f3 100644
--- a/libc/test/src/math/smoke/log10_test.cpp
+++ b/libc/test/src/math/smoke/log10_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLog10Test = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/smoke/log10f_test.cpp b/libc/test/src/math/smoke/log10f_test.cpp
index 721045d355da8c..2524545e018123 100644
--- a/libc/test/src/math/smoke/log10f_test.cpp
+++ b/libc/test/src/math/smoke/log10f_test.cpp
@@ -12,7 +12,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLog10fTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/log1p_test.cpp b/libc/test/src/math/smoke/log1p_test.cpp
index 993dbf8001df86..63237f3259b215 100644
--- a/libc/test/src/math/smoke/log1p_test.cpp
+++ b/libc/test/src/math/smoke/log1p_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLog1pTest = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/smoke/log1pf_test.cpp b/libc/test/src/math/smoke/log1pf_test.cpp
index 6127cc89a74216..c14d6552946979 100644
--- a/libc/test/src/math/smoke/log1pf_test.cpp
+++ b/libc/test/src/math/smoke/log1pf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLog1pfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/log2_test.cpp b/libc/test/src/math/smoke/log2_test.cpp
index b59767e668eb61..89d8e565109118 100644
--- a/libc/test/src/math/smoke/log2_test.cpp
+++ b/libc/test/src/math/smoke/log2_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLog2Test = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/smoke/log_test.cpp b/libc/test/src/math/smoke/log_test.cpp
index fd527dee50847c..e7897add575fad 100644
--- a/libc/test/src/math/smoke/log_test.cpp
+++ b/libc/test/src/math/smoke/log_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcLogTest = LIBC_NAMESPACE::testing::FPTest<double>;
diff --git a/libc/test/src/math/smoke/powf_test.cpp b/libc/test/src/math/smoke/powf_test.cpp
index 6aa1ac2b661be2..bd4f98e30fbdc7 100644
--- a/libc/test/src/math/smoke/powf_test.cpp
+++ b/libc/test/src/math/smoke/powf_test.cpp
@@ -12,7 +12,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcPowfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/sincosf_test.cpp b/libc/test/src/math/smoke/sincosf_test.cpp
index 8c35953240d8da..e6896ca3dc21ac 100644
--- a/libc/test/src/math/smoke/sincosf_test.cpp
+++ b/libc/test/src/math/smoke/sincosf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcSinCosfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/sinf_test.cpp b/libc/test/src/math/smoke/sinf_test.cpp
index 9fc208dd545b2d..1bf6eaa8b78d7d 100644
--- a/libc/test/src/math/smoke/sinf_test.cpp
+++ b/libc/test/src/math/smoke/sinf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcSinfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/sinhf_test.cpp b/libc/test/src/math/smoke/sinhf_test.cpp
index 1e052988eb2862..635a10627a2109 100644
--- a/libc/test/src/math/smoke/sinhf_test.cpp
+++ b/libc/test/src/math/smoke/sinhf_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcSinhfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/tanf_test.cpp b/libc/test/src/math/smoke/tanf_test.cpp
index ab3f7c1aeb7e4e..b90c5da8741892 100644
--- a/libc/test/src/math/smoke/tanf_test.cpp
+++ b/libc/test/src/math/smoke/tanf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcTanfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/smoke/tanhf_test.cpp b/libc/test/src/math/smoke/tanhf_test.cpp
index ddae021d2bc423..748e6fe8c62693 100644
--- a/libc/test/src/math/smoke/tanhf_test.cpp
+++ b/libc/test/src/math/smoke/tanhf_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcTanhfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/tanf_test.cpp b/libc/test/src/math/tanf_test.cpp
index 9b9e1278cf5636..9061cf6fb30b82 100644
--- a/libc/test/src/math/tanf_test.cpp
+++ b/libc/test/src/math/tanf_test.cpp
@@ -15,7 +15,6 @@
#include "test/src/math/sdcomp26094.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcTanfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/math/tanhf_test.cpp b/libc/test/src/math/tanhf_test.cpp
index 2e74984ad9549f..389abe4d858979 100644
--- a/libc/test/src/math/tanhf_test.cpp
+++ b/libc/test/src/math/tanhf_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include <errno.h>
#include <stdint.h>
using LlvmLibcTanhfTest = LIBC_NAMESPACE::testing::FPTest<float>;
diff --git a/libc/test/src/pthread/pthread_attr_test.cpp b/libc/test/src/pthread/pthread_attr_test.cpp
index 1af585a003e3b0..a04c2dc05e0219 100644
--- a/libc/test/src/pthread/pthread_attr_test.cpp
+++ b/libc/test/src/pthread/pthread_attr_test.cpp
@@ -19,7 +19,6 @@
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <linux/param.h> // For EXEC_PAGESIZE.
#include <pthread.h>
diff --git a/libc/test/src/pthread/pthread_mutexattr_test.cpp b/libc/test/src/pthread/pthread_mutexattr_test.cpp
index a7acd580a6b8e5..ab4becb769220a 100644
--- a/libc/test/src/pthread/pthread_mutexattr_test.cpp
+++ b/libc/test/src/pthread/pthread_mutexattr_test.cpp
@@ -16,7 +16,6 @@
#include "src/pthread/pthread_mutexattr_settype.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <pthread.h>
TEST(LlvmLibcPThreadMutexAttrTest, InitAndDestroy) {
diff --git a/libc/test/src/signal/sigaddset_test.cpp b/libc/test/src/signal/sigaddset_test.cpp
index ac9334f4ff68c0..bc33750cf787d7 100644
--- a/libc/test/src/signal/sigaddset_test.cpp
+++ b/libc/test/src/signal/sigaddset_test.cpp
@@ -11,7 +11,6 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <signal.h>
// This tests invalid inputs and ensures errno is properly set.
diff --git a/libc/test/src/signal/sigdelset_test.cpp b/libc/test/src/signal/sigdelset_test.cpp
index aeae66f86bf886..622f1a32fbbe9a 100644
--- a/libc/test/src/signal/sigdelset_test.cpp
+++ b/libc/test/src/signal/sigdelset_test.cpp
@@ -14,7 +14,6 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <signal.h>
TEST(LlvmLibcSigdelset, Invalid) {
diff --git a/libc/test/src/signal/sigfillset_test.cpp b/libc/test/src/signal/sigfillset_test.cpp
index 7922b3a4e11902..0604bc2a95bf6f 100644
--- a/libc/test/src/signal/sigfillset_test.cpp
+++ b/libc/test/src/signal/sigfillset_test.cpp
@@ -13,7 +13,6 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <signal.h>
TEST(LlvmLibcSigfillset, Invalid) {
diff --git a/libc/test/src/spawn/posix_spawn_file_actions_test.cpp b/libc/test/src/spawn/posix_spawn_file_actions_test.cpp
index 008167e07221f4..8b5ca09bc5fb48 100644
--- a/libc/test/src/spawn/posix_spawn_file_actions_test.cpp
+++ b/libc/test/src/spawn/posix_spawn_file_actions_test.cpp
@@ -14,7 +14,6 @@
#include "src/spawn/posix_spawn_file_actions_init.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <spawn.h>
#include <stdint.h>
diff --git a/libc/test/src/sys/prctl/linux/prctl_test.cpp b/libc/test/src/sys/prctl/linux/prctl_test.cpp
index b528edc65595d8..987c35d5534707 100644
--- a/libc/test/src/sys/prctl/linux/prctl_test.cpp
+++ b/libc/test/src/sys/prctl/linux/prctl_test.cpp
@@ -9,7 +9,6 @@
#include "src/errno/libc_errno.h"
#include "src/sys/prctl/prctl.h"
#include "test/UnitTest/ErrnoSetterMatcher.h"
-#include <errno.h>
#include <sys/prctl.h>
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
diff --git a/libc/test/src/sys/select/select_failure_test.cpp b/libc/test/src/sys/select/select_failure_test.cpp
index 61df532b3e96cc..a4990bfd4b1b53 100644
--- a/libc/test/src/sys/select/select_failure_test.cpp
+++ b/libc/test/src/sys/select/select_failure_test.cpp
@@ -11,7 +11,6 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <sys/select.h>
#include <unistd.h>
diff --git a/libc/test/src/sys/utsname/uname_test.cpp b/libc/test/src/sys/utsname/uname_test.cpp
index 79822c112a5b6b..6452021bd6c358 100644
--- a/libc/test/src/sys/utsname/uname_test.cpp
+++ b/libc/test/src/sys/utsname/uname_test.cpp
@@ -12,7 +12,6 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <sys/utsname.h>
TEST(LlvmLibcUnameTest, GetMachineName) {
diff --git a/libc/test/src/sys/wait/wait4_test.cpp b/libc/test/src/sys/wait/wait4_test.cpp
index 70d4d436927e6b..c4080047ee38f8 100644
--- a/libc/test/src/sys/wait/wait4_test.cpp
+++ b/libc/test/src/sys/wait/wait4_test.cpp
@@ -10,7 +10,6 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <sys/wait.h>
// The test here is a simpl test for WNOHANG functionality. For a more
diff --git a/libc/test/src/sys/wait/waitpid_test.cpp b/libc/test/src/sys/wait/waitpid_test.cpp
index b2ace2617d2d3f..fb456bfaedc7df 100644
--- a/libc/test/src/sys/wait/waitpid_test.cpp
+++ b/libc/test/src/sys/wait/waitpid_test.cpp
@@ -10,7 +10,6 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
-#include <errno.h>
#include <sys/wait.h>
// The test here is a simpl test for WNOHANG functionality. For a more
>From f2bfcbb587d67c9173534fa656a51cc290f879ce Mon Sep 17 00:00:00 2001
From: Job Hernandez <jobhdezlara93 at gmail.com>
Date: Fri, 4 Oct 2024 13:08:37 -0700
Subject: [PATCH 2/8] address review
---
libc/include/errno.h.def | 2 +-
libc/include/llvm-libc-macros/linux/error-number-macros.h | 8 ++++++++
libc/src/__support/StringUtil/tables/posix_errors.h | 2 +-
libc/src/pthread/pthread_atfork.cpp | 1 +
libc/src/pthread/pthread_attr_setdetachstate.cpp | 1 +
libc/src/pthread/pthread_attr_setguardsize.cpp | 1 +
libc/src/pthread/pthread_attr_setstack.cpp | 1 +
libc/src/pthread/pthread_attr_setstacksize.cpp | 1 +
libc/src/pthread/pthread_condattr_setclock.cpp | 1 +
libc/src/pthread/pthread_condattr_setpshared.cpp | 1 +
libc/src/pthread/pthread_create.cpp | 1 +
libc/src/pthread/pthread_key_create.cpp | 1 +
libc/src/pthread/pthread_key_delete.cpp | 1 +
libc/src/pthread/pthread_mutexattr_setpshared.cpp | 1 +
libc/src/pthread/pthread_mutexattr_setrobust.cpp | 1 +
libc/src/pthread/pthread_mutexattr_settype.cpp | 1 +
libc/src/pthread/pthread_rwlock_timedrdlock.cpp | 2 +-
libc/src/pthread/pthread_rwlock_trywrlock.cpp | 1 +
libc/src/pthread/pthread_rwlock_unlock.cpp | 1 +
libc/src/pthread/pthread_rwlockattr_setkind_np.cpp | 1 +
libc/src/pthread/pthread_rwlockattr_setpshared.cpp | 1 +
libc/src/pthread/pthread_setspecific.cpp | 1 +
libc/src/spawn/posix_spawn_file_actions_addclose.cpp | 1 +
libc/src/spawn/posix_spawn_file_actions_adddup2.cpp | 1 +
libc/src/spawn/posix_spawn_file_actions_addopen.cpp | 1 +
libc/src/spawn/posix_spawn_file_actions_destroy.cpp | 2 ++
libc/src/threads/thrd_create.cpp | 1 +
libc/test/integration/src/pthread/pthread_name_test.cpp | 1 +
28 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/libc/include/errno.h.def b/libc/include/errno.h.def
index aa1f6c9e484444..9a8a2692d1a09b 100644
--- a/libc/include/errno.h.def
+++ b/libc/include/errno.h.def
@@ -18,7 +18,7 @@
#ifndef ENOTSUP
#define ENOTSUP EOPNOTSUPP
#endif // ENOTSUP
-
+
#include "llvm-libc-macros/linux/error-number-macros.h"
#else // __linux__
diff --git a/libc/include/llvm-libc-macros/linux/error-number-macros.h b/libc/include/llvm-libc-macros/linux/error-number-macros.h
index 1643a70918da49..9a7304fa161ad0 100644
--- a/libc/include/llvm-libc-macros/linux/error-number-macros.h
+++ b/libc/include/llvm-libc-macros/linux/error-number-macros.h
@@ -21,4 +21,12 @@
#define EHWPOISON 133
#endif // EHWPOISON
+#ifndef EOPNOTSUPP
+#define EOPNOTSUPP 95
+#endif
+
+#ifndef ENOTSUP
+#define ENOTSUP EOPNOTSUPP
+#endif
+
#endif // LLVM_LIBC_MACROS_LINUX_ERROR_NUMBER_MACROS_H
diff --git a/libc/src/__support/StringUtil/tables/posix_errors.h b/libc/src/__support/StringUtil/tables/posix_errors.h
index 65390ceade9f3b..5e487298642a1e 100644
--- a/libc/src/__support/StringUtil/tables/posix_errors.h
+++ b/libc/src/__support/StringUtil/tables/posix_errors.h
@@ -11,7 +11,7 @@
#include "src/__support/StringUtil/message_mapper.h"
#include "src/__support/macros/config.h"
-
+#include "hdr/errno_macros.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_atfork.cpp b/libc/src/pthread/pthread_atfork.cpp
index 62846c27a83195..f5e5cf177bafea 100644
--- a/libc/src/pthread/pthread_atfork.cpp
+++ b/libc/src/pthread/pthread_atfork.cpp
@@ -8,6 +8,7 @@
#include "pthread_atfork.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/fork_callbacks.h"
diff --git a/libc/src/pthread/pthread_attr_setdetachstate.cpp b/libc/src/pthread/pthread_attr_setdetachstate.cpp
index a413abdb70af2a..cdfa8dc4708162 100644
--- a/libc/src/pthread/pthread_attr_setdetachstate.cpp
+++ b/libc/src/pthread/pthread_attr_setdetachstate.cpp
@@ -8,6 +8,7 @@
#include "pthread_attr_setdetachstate.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_attr_setguardsize.cpp b/libc/src/pthread/pthread_attr_setguardsize.cpp
index 8fb62bef422302..29726b3146f2e3 100644
--- a/libc/src/pthread/pthread_attr_setguardsize.cpp
+++ b/libc/src/pthread/pthread_attr_setguardsize.cpp
@@ -8,6 +8,7 @@
#include "pthread_attr_setguardsize.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_attr_setstack.cpp b/libc/src/pthread/pthread_attr_setstack.cpp
index 361591d87a0f0d..79a2cc0ca9fc55 100644
--- a/libc/src/pthread/pthread_attr_setstack.cpp
+++ b/libc/src/pthread/pthread_attr_setstack.cpp
@@ -9,6 +9,7 @@
#include "pthread_attr_setstack.h"
#include "pthread_attr_setstacksize.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h" // For STACK_ALIGNMENT
diff --git a/libc/src/pthread/pthread_attr_setstacksize.cpp b/libc/src/pthread/pthread_attr_setstacksize.cpp
index 59f5921daf4e50..d1ad116104e964 100644
--- a/libc/src/pthread/pthread_attr_setstacksize.cpp
+++ b/libc/src/pthread/pthread_attr_setstacksize.cpp
@@ -8,6 +8,7 @@
#include "pthread_attr_setstacksize.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_condattr_setclock.cpp b/libc/src/pthread/pthread_condattr_setclock.cpp
index 8422b19fd5e7b5..5e794938148e67 100644
--- a/libc/src/pthread/pthread_condattr_setclock.cpp
+++ b/libc/src/pthread/pthread_condattr_setclock.cpp
@@ -8,6 +8,7 @@
#include "pthread_condattr_setclock.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_condattr_setpshared.cpp b/libc/src/pthread/pthread_condattr_setpshared.cpp
index 29f8ee95b590c5..b85b0b5ea11314 100644
--- a/libc/src/pthread/pthread_condattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_condattr_setpshared.cpp
@@ -8,6 +8,7 @@
#include "pthread_condattr_setpshared.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_create.cpp b/libc/src/pthread/pthread_create.cpp
index 5f829d13034964..daccc031d420f9 100644
--- a/libc/src/pthread/pthread_create.cpp
+++ b/libc/src/pthread/pthread_create.cpp
@@ -15,6 +15,7 @@
#include "pthread_attr_getguardsize.h"
#include "pthread_attr_getstack.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h"
diff --git a/libc/src/pthread/pthread_key_create.cpp b/libc/src/pthread/pthread_key_create.cpp
index f02fbdc782e778..9ea6983beea904 100644
--- a/libc/src/pthread/pthread_key_create.cpp
+++ b/libc/src/pthread/pthread_key_create.cpp
@@ -8,6 +8,7 @@
#include "pthread_key_create.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
diff --git a/libc/src/pthread/pthread_key_delete.cpp b/libc/src/pthread/pthread_key_delete.cpp
index e77ebb99189d9c..463a29dcf207e4 100644
--- a/libc/src/pthread/pthread_key_delete.cpp
+++ b/libc/src/pthread/pthread_key_delete.cpp
@@ -8,6 +8,7 @@
#include "pthread_key_delete.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
diff --git a/libc/src/pthread/pthread_mutexattr_setpshared.cpp b/libc/src/pthread/pthread_mutexattr_setpshared.cpp
index e1223750ec591a..f84343ce4c64ef 100644
--- a/libc/src/pthread/pthread_mutexattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_mutexattr_setpshared.cpp
@@ -9,6 +9,7 @@
#include "pthread_mutexattr_setpshared.h"
#include "pthread_mutexattr.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_mutexattr_setrobust.cpp b/libc/src/pthread/pthread_mutexattr_setrobust.cpp
index e1327e9ef1e028..08c94595c34f88 100644
--- a/libc/src/pthread/pthread_mutexattr_setrobust.cpp
+++ b/libc/src/pthread/pthread_mutexattr_setrobust.cpp
@@ -9,6 +9,7 @@
#include "pthread_mutexattr_setrobust.h"
#include "pthread_mutexattr.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_mutexattr_settype.cpp b/libc/src/pthread/pthread_mutexattr_settype.cpp
index e23b52736bfc5e..93a477644476d9 100644
--- a/libc/src/pthread/pthread_mutexattr_settype.cpp
+++ b/libc/src/pthread/pthread_mutexattr_settype.cpp
@@ -9,6 +9,7 @@
#include "pthread_mutexattr_settype.h"
#include "pthread_mutexattr.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_rwlock_timedrdlock.cpp b/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
index 710fb48e49573e..9b3a8354b15796 100644
--- a/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/pthread/pthread_rwlock_timedrdlock.h"
-
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/libc_assert.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_rwlock_trywrlock.cpp b/libc/src/pthread/pthread_rwlock_trywrlock.cpp
index 0ebf1cb334cd07..0a2c3fabdce103 100644
--- a/libc/src/pthread/pthread_rwlock_trywrlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_trywrlock.cpp
@@ -8,6 +8,7 @@
#include "src/pthread/pthread_rwlock_trywrlock.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
diff --git a/libc/src/pthread/pthread_rwlock_unlock.cpp b/libc/src/pthread/pthread_rwlock_unlock.cpp
index c5713922e1273a..95ad084cc3965d 100644
--- a/libc/src/pthread/pthread_rwlock_unlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_unlock.cpp
@@ -8,6 +8,7 @@
#include "src/pthread/pthread_rwlock_unlock.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
diff --git a/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp b/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp
index ddc37d6af91180..69a156842043fe 100644
--- a/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp
+++ b/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp
@@ -8,6 +8,7 @@
#include "pthread_rwlockattr_setkind_np.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_rwlockattr_setpshared.cpp b/libc/src/pthread/pthread_rwlockattr_setpshared.cpp
index de953c2a52cf7b..697cb76cc83068 100644
--- a/libc/src/pthread/pthread_rwlockattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_rwlockattr_setpshared.cpp
@@ -8,6 +8,7 @@
#include "pthread_rwlockattr_setpshared.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/pthread/pthread_setspecific.cpp b/libc/src/pthread/pthread_setspecific.cpp
index 994996d63a0241..d22ec6706197b1 100644
--- a/libc/src/pthread/pthread_setspecific.cpp
+++ b/libc/src/pthread/pthread_setspecific.cpp
@@ -8,6 +8,7 @@
#include "pthread_setspecific.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
diff --git a/libc/src/spawn/posix_spawn_file_actions_addclose.cpp b/libc/src/spawn/posix_spawn_file_actions_addclose.cpp
index 0ed9c7f69bd5a2..bea48a9b2c211f 100644
--- a/libc/src/spawn/posix_spawn_file_actions_addclose.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_addclose.cpp
@@ -9,6 +9,7 @@
#include "posix_spawn_file_actions_addclose.h"
#include "file_actions.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp b/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp
index a7f4c03528d086..d70c183bc08ffe 100644
--- a/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp
@@ -9,6 +9,7 @@
#include "posix_spawn_file_actions_adddup2.h"
#include "file_actions.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/spawn/posix_spawn_file_actions_addopen.cpp b/libc/src/spawn/posix_spawn_file_actions_addopen.cpp
index 6222ee421f8d2d..23f648c4a63771 100644
--- a/libc/src/spawn/posix_spawn_file_actions_addopen.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_addopen.cpp
@@ -9,6 +9,7 @@
#include "posix_spawn_file_actions_addopen.h"
#include "file_actions.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/spawn/posix_spawn_file_actions_destroy.cpp b/libc/src/spawn/posix_spawn_file_actions_destroy.cpp
index 2339cee83ddcf8..1406e05c106416 100644
--- a/libc/src/spawn/posix_spawn_file_actions_destroy.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_destroy.cpp
@@ -9,6 +9,8 @@
#include "posix_spawn_file_actions_destroy.h"
#include "file_actions.h"
+
+#include "src/errno/libc_errno.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
diff --git a/libc/src/threads/thrd_create.cpp b/libc/src/threads/thrd_create.cpp
index c790ecb787da51..94d96b3f2e777b 100644
--- a/libc/src/threads/thrd_create.cpp
+++ b/libc/src/threads/thrd_create.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/threads/thrd_create.h"
+#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
diff --git a/libc/test/integration/src/pthread/pthread_name_test.cpp b/libc/test/integration/src/pthread/pthread_name_test.cpp
index aec5ff24abfe59..e3befc77abff40 100644
--- a/libc/test/integration/src/pthread/pthread_name_test.cpp
+++ b/libc/test/integration/src/pthread/pthread_name_test.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include "src/errno/libc_errno.h"
#include "src/__support/CPP/string_view.h"
#include "src/pthread/pthread_create.h"
#include "src/pthread/pthread_getname_np.h"
>From 8711b1e8fbf9cd8a55e341fa7f0432b8b989a579 Mon Sep 17 00:00:00 2001
From: Job Hernandez <jobhdezlara93 at gmail.com>
Date: Fri, 4 Oct 2024 13:09:00 -0700
Subject: [PATCH 3/8] format code
---
libc/src/__support/StringUtil/tables/linux_extension_errors.h | 1 -
libc/src/__support/StringUtil/tables/posix_errors.h | 2 +-
libc/src/__support/StringUtil/tables/stdc_errors.h | 1 -
libc/src/math/generic/acosf.cpp | 1 -
libc/src/math/generic/asinf.cpp | 1 -
libc/src/math/generic/cosf.cpp | 1 -
libc/src/math/generic/exp.cpp | 1 -
libc/src/math/generic/exp10.cpp | 1 -
libc/src/math/generic/exp10f_impl.h | 1 -
libc/src/math/generic/exp2.cpp | 1 -
libc/src/math/generic/exp2f_impl.h | 1 -
libc/src/math/generic/expf.cpp | 1 -
libc/src/math/generic/explogxf.h | 1 -
libc/src/math/generic/expm1f.cpp | 1 -
libc/src/math/generic/powf.cpp | 1 -
libc/src/math/generic/sincosf.cpp | 1 -
libc/src/math/generic/sinf.cpp | 1 -
libc/src/math/generic/tanf.cpp | 1 -
libc/src/pthread/pthread_atfork.cpp | 2 +-
libc/src/pthread/pthread_attr_setdetachstate.cpp | 2 +-
libc/src/pthread/pthread_attr_setguardsize.cpp | 2 +-
libc/src/pthread/pthread_attr_setstack.cpp | 2 +-
libc/src/pthread/pthread_attr_setstacksize.cpp | 2 +-
libc/src/pthread/pthread_condattr_setclock.cpp | 2 +-
libc/src/pthread/pthread_condattr_setpshared.cpp | 2 +-
libc/src/pthread/pthread_create.cpp | 2 +-
libc/src/pthread/pthread_key_create.cpp | 2 +-
libc/src/pthread/pthread_key_delete.cpp | 2 +-
libc/src/pthread/pthread_mutexattr_destroy.cpp | 1 -
libc/src/pthread/pthread_mutexattr_getpshared.cpp | 1 -
libc/src/pthread/pthread_mutexattr_getrobust.cpp | 1 -
libc/src/pthread/pthread_mutexattr_gettype.cpp | 1 -
libc/src/pthread/pthread_mutexattr_setpshared.cpp | 2 +-
libc/src/pthread/pthread_mutexattr_setrobust.cpp | 2 +-
libc/src/pthread/pthread_mutexattr_settype.cpp | 2 +-
libc/src/pthread/pthread_rwlock_timedrdlock.cpp | 2 +-
libc/src/pthread/pthread_rwlock_trywrlock.cpp | 2 +-
libc/src/pthread/pthread_rwlock_unlock.cpp | 2 +-
libc/src/pthread/pthread_rwlockattr_setkind_np.cpp | 2 +-
libc/src/pthread/pthread_rwlockattr_setpshared.cpp | 2 +-
libc/src/pthread/pthread_setspecific.cpp | 2 +-
libc/src/spawn/posix_spawn_file_actions_addclose.cpp | 2 +-
libc/src/spawn/posix_spawn_file_actions_adddup2.cpp | 2 +-
libc/src/spawn/posix_spawn_file_actions_addopen.cpp | 2 +-
libc/src/spawn/posix_spawn_file_actions_destroy.cpp | 2 +-
libc/src/threads/thrd_create.cpp | 2 +-
libc/test/UnitTest/PrintfMatcher.h | 1 -
libc/test/UnitTest/ScanfMatcher.h | 1 -
libc/test/integration/src/pthread/pthread_name_test.cpp | 2 +-
49 files changed, 26 insertions(+), 49 deletions(-)
diff --git a/libc/src/__support/StringUtil/tables/linux_extension_errors.h b/libc/src/__support/StringUtil/tables/linux_extension_errors.h
index 02ac3c011b1e3a..425590f6e91c9b 100644
--- a/libc/src/__support/StringUtil/tables/linux_extension_errors.h
+++ b/libc/src/__support/StringUtil/tables/linux_extension_errors.h
@@ -13,7 +13,6 @@
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
-
namespace LIBC_NAMESPACE_DECL {
constexpr MsgTable<52> LINUX_ERRORS = {
diff --git a/libc/src/__support/StringUtil/tables/posix_errors.h b/libc/src/__support/StringUtil/tables/posix_errors.h
index 5e487298642a1e..b21f28f0b1321c 100644
--- a/libc/src/__support/StringUtil/tables/posix_errors.h
+++ b/libc/src/__support/StringUtil/tables/posix_errors.h
@@ -9,9 +9,9 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_POSIX_ERRORS_H
#define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_POSIX_ERRORS_H
+#include "hdr/errno_macros.h"
#include "src/__support/StringUtil/message_mapper.h"
#include "src/__support/macros/config.h"
-#include "hdr/errno_macros.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/__support/StringUtil/tables/stdc_errors.h b/libc/src/__support/StringUtil/tables/stdc_errors.h
index f4f981785c9e1d..b2a0d36a53637c 100644
--- a/libc/src/__support/StringUtil/tables/stdc_errors.h
+++ b/libc/src/__support/StringUtil/tables/stdc_errors.h
@@ -12,7 +12,6 @@
#include "src/__support/StringUtil/message_mapper.h"
#include "src/__support/macros/config.h"
-
namespace LIBC_NAMESPACE_DECL {
LIBC_INLINE_VAR constexpr const MsgTable<4> STDC_ERRORS = {
diff --git a/libc/src/math/generic/acosf.cpp b/libc/src/math/generic/acosf.cpp
index cf9721f8c425a3..3c097a7871380d 100644
--- a/libc/src/math/generic/acosf.cpp
+++ b/libc/src/math/generic/acosf.cpp
@@ -16,7 +16,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-
#include "inv_trigf_utils.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/asinf.cpp b/libc/src/math/generic/asinf.cpp
index f92f6368b0aa95..3a89def8f6e0c1 100644
--- a/libc/src/math/generic/asinf.cpp
+++ b/libc/src/math/generic/asinf.cpp
@@ -17,7 +17,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-
#include "inv_trigf_utils.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/cosf.cpp b/libc/src/math/generic/cosf.cpp
index 18e019ae7c4595..972ffa923aedf8 100644
--- a/libc/src/math/generic/cosf.cpp
+++ b/libc/src/math/generic/cosf.cpp
@@ -18,7 +18,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-
namespace LIBC_NAMESPACE_DECL {
// Exceptional cases for cosf.
diff --git a/libc/src/math/generic/exp.cpp b/libc/src/math/generic/exp.cpp
index 0b56770c0c3e22..38b683aa011664 100644
--- a/libc/src/math/generic/exp.cpp
+++ b/libc/src/math/generic/exp.cpp
@@ -25,7 +25,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-
namespace LIBC_NAMESPACE_DECL {
using fputil::DoubleDouble;
diff --git a/libc/src/math/generic/exp10.cpp b/libc/src/math/generic/exp10.cpp
index 68d9608b379785..748c8a22b23688 100644
--- a/libc/src/math/generic/exp10.cpp
+++ b/libc/src/math/generic/exp10.cpp
@@ -25,7 +25,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-
namespace LIBC_NAMESPACE_DECL {
using fputil::DoubleDouble;
diff --git a/libc/src/math/generic/exp10f_impl.h b/libc/src/math/generic/exp10f_impl.h
index 2bdd4cd465c0ef..d741318382e1f2 100644
--- a/libc/src/math/generic/exp10f_impl.h
+++ b/libc/src/math/generic/exp10f_impl.h
@@ -21,7 +21,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-
namespace LIBC_NAMESPACE_DECL {
namespace generic {
diff --git a/libc/src/math/generic/exp2.cpp b/libc/src/math/generic/exp2.cpp
index 42625360284f99..935548b538b94f 100644
--- a/libc/src/math/generic/exp2.cpp
+++ b/libc/src/math/generic/exp2.cpp
@@ -25,7 +25,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-
namespace LIBC_NAMESPACE_DECL {
using fputil::DoubleDouble;
diff --git a/libc/src/math/generic/exp2f_impl.h b/libc/src/math/generic/exp2f_impl.h
index 41751c7424ca85..ae2d0628c12051 100644
--- a/libc/src/math/generic/exp2f_impl.h
+++ b/libc/src/math/generic/exp2f_impl.h
@@ -21,7 +21,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h"
-
#include "explogxf.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/expf.cpp b/libc/src/math/generic/expf.cpp
index 51462d59289a64..ee5c2a32b6c6ba 100644
--- a/libc/src/math/generic/expf.cpp
+++ b/libc/src/math/generic/expf.cpp
@@ -19,7 +19,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, expf, (float x)) {
diff --git a/libc/src/math/generic/explogxf.h b/libc/src/math/generic/explogxf.h
index 88287c703db730..f3f50c21aacce7 100644
--- a/libc/src/math/generic/explogxf.h
+++ b/libc/src/math/generic/explogxf.h
@@ -20,7 +20,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/cpu_features.h"
-
namespace LIBC_NAMESPACE_DECL {
struct ExpBase {
diff --git a/libc/src/math/generic/expm1f.cpp b/libc/src/math/generic/expm1f.cpp
index 47dd515456a605..d5e9e85ed4bd35 100644
--- a/libc/src/math/generic/expm1f.cpp
+++ b/libc/src/math/generic/expm1f.cpp
@@ -21,7 +21,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, expm1f, (float x)) {
diff --git a/libc/src/math/generic/powf.cpp b/libc/src/math/generic/powf.cpp
index f13c710e78e112..8ce2465ba229cb 100644
--- a/libc/src/math/generic/powf.cpp
+++ b/libc/src/math/generic/powf.cpp
@@ -25,7 +25,6 @@
#include "exp10f_impl.h" // Speedup for powf(10, y) = exp10f(y)
#include "exp2f_impl.h" // Speedup for powf(2, y) = exp2f(y)
-
namespace LIBC_NAMESPACE_DECL {
using fputil::DoubleDouble;
diff --git a/libc/src/math/generic/sincosf.cpp b/libc/src/math/generic/sincosf.cpp
index 449281293d2ae3..ccaa29c10c4c68 100644
--- a/libc/src/math/generic/sincosf.cpp
+++ b/libc/src/math/generic/sincosf.cpp
@@ -17,7 +17,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-
namespace LIBC_NAMESPACE_DECL {
// Exceptional values
diff --git a/libc/src/math/generic/sinf.cpp b/libc/src/math/generic/sinf.cpp
index 62015070b29054..cea267d4c683e5 100644
--- a/libc/src/math/generic/sinf.cpp
+++ b/libc/src/math/generic/sinf.cpp
@@ -19,7 +19,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-
#if defined(LIBC_TARGET_CPU_HAS_FMA)
#include "range_reduction_fma.h"
#else
diff --git a/libc/src/math/generic/tanf.cpp b/libc/src/math/generic/tanf.cpp
index 105518336f8e76..6fd5f9a103676c 100644
--- a/libc/src/math/generic/tanf.cpp
+++ b/libc/src/math/generic/tanf.cpp
@@ -19,7 +19,6 @@
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
-
namespace LIBC_NAMESPACE_DECL {
// Exceptional cases for tanf.
diff --git a/libc/src/pthread/pthread_atfork.cpp b/libc/src/pthread/pthread_atfork.cpp
index f5e5cf177bafea..b2c67c78e5d94e 100644
--- a/libc/src/pthread/pthread_atfork.cpp
+++ b/libc/src/pthread/pthread_atfork.cpp
@@ -8,10 +8,10 @@
#include "pthread_atfork.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.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.
diff --git a/libc/src/pthread/pthread_attr_setdetachstate.cpp b/libc/src/pthread/pthread_attr_setdetachstate.cpp
index cdfa8dc4708162..872f694e01f3ae 100644
--- a/libc/src/pthread/pthread_attr_setdetachstate.cpp
+++ b/libc/src/pthread/pthread_attr_setdetachstate.cpp
@@ -8,9 +8,9 @@
#include "pthread_attr_setdetachstate.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_attr_setguardsize.cpp b/libc/src/pthread/pthread_attr_setguardsize.cpp
index 29726b3146f2e3..fa4375e915ab47 100644
--- a/libc/src/pthread/pthread_attr_setguardsize.cpp
+++ b/libc/src/pthread/pthread_attr_setguardsize.cpp
@@ -8,9 +8,9 @@
#include "pthread_attr_setguardsize.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <linux/param.h> // For EXEC_PAGESIZE.
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_attr_setstack.cpp b/libc/src/pthread/pthread_attr_setstack.cpp
index 79a2cc0ca9fc55..1154055a63a7ef 100644
--- a/libc/src/pthread/pthread_attr_setstack.cpp
+++ b/libc/src/pthread/pthread_attr_setstack.cpp
@@ -9,10 +9,10 @@
#include "pthread_attr_setstack.h"
#include "pthread_attr_setstacksize.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.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>
diff --git a/libc/src/pthread/pthread_attr_setstacksize.cpp b/libc/src/pthread/pthread_attr_setstacksize.cpp
index d1ad116104e964..0a5d1af661abfa 100644
--- a/libc/src/pthread/pthread_attr_setstacksize.cpp
+++ b/libc/src/pthread/pthread_attr_setstacksize.cpp
@@ -8,9 +8,9 @@
#include "pthread_attr_setstacksize.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_condattr_setclock.cpp b/libc/src/pthread/pthread_condattr_setclock.cpp
index 5e794938148e67..37fbd6b27143dd 100644
--- a/libc/src/pthread/pthread_condattr_setclock.cpp
+++ b/libc/src/pthread/pthread_condattr_setclock.cpp
@@ -8,9 +8,9 @@
#include "pthread_condattr_setclock.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h> // pthread_condattr_t
#include <sys/types.h> // clockid_t
diff --git a/libc/src/pthread/pthread_condattr_setpshared.cpp b/libc/src/pthread/pthread_condattr_setpshared.cpp
index b85b0b5ea11314..433b2dc1d2d931 100644
--- a/libc/src/pthread/pthread_condattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_condattr_setpshared.cpp
@@ -8,9 +8,9 @@
#include "pthread_condattr_setpshared.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.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
diff --git a/libc/src/pthread/pthread_create.cpp b/libc/src/pthread/pthread_create.cpp
index daccc031d420f9..e1b1f3b325d1cb 100644
--- a/libc/src/pthread/pthread_create.cpp
+++ b/libc/src/pthread/pthread_create.cpp
@@ -15,11 +15,11 @@
#include "pthread_attr_getguardsize.h"
#include "pthread_attr_getstack.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.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.
diff --git a/libc/src/pthread/pthread_key_create.cpp b/libc/src/pthread/pthread_key_create.cpp
index 9ea6983beea904..383762f273e7a7 100644
--- a/libc/src/pthread/pthread_key_create.cpp
+++ b/libc/src/pthread/pthread_key_create.cpp
@@ -8,10 +8,10 @@
#include "pthread_key_create.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_key_delete.cpp b/libc/src/pthread/pthread_key_delete.cpp
index 463a29dcf207e4..b54db821ab05a8 100644
--- a/libc/src/pthread/pthread_key_delete.cpp
+++ b/libc/src/pthread/pthread_key_delete.cpp
@@ -8,10 +8,10 @@
#include "pthread_key_delete.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_mutexattr_destroy.cpp b/libc/src/pthread/pthread_mutexattr_destroy.cpp
index 4daf84d7cc0d89..bddeb8b75acd15 100644
--- a/libc/src/pthread/pthread_mutexattr_destroy.cpp
+++ b/libc/src/pthread/pthread_mutexattr_destroy.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, pthread_mutexattr_destroy, (pthread_mutexattr_t *)) {
diff --git a/libc/src/pthread/pthread_mutexattr_getpshared.cpp b/libc/src/pthread/pthread_mutexattr_getpshared.cpp
index 142eb9fd3b4526..0ea5d428346183 100644
--- a/libc/src/pthread/pthread_mutexattr_getpshared.cpp
+++ b/libc/src/pthread/pthread_mutexattr_getpshared.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, pthread_mutexattr_getpshared,
diff --git a/libc/src/pthread/pthread_mutexattr_getrobust.cpp b/libc/src/pthread/pthread_mutexattr_getrobust.cpp
index 9ce46833ecbf5f..b2359e0ac8c9c2 100644
--- a/libc/src/pthread/pthread_mutexattr_getrobust.cpp
+++ b/libc/src/pthread/pthread_mutexattr_getrobust.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, pthread_mutexattr_getrobust,
diff --git a/libc/src/pthread/pthread_mutexattr_gettype.cpp b/libc/src/pthread/pthread_mutexattr_gettype.cpp
index 6ba3256b35f805..0bd226ef89e5ed 100644
--- a/libc/src/pthread/pthread_mutexattr_gettype.cpp
+++ b/libc/src/pthread/pthread_mutexattr_gettype.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, pthread_mutexattr_gettype,
diff --git a/libc/src/pthread/pthread_mutexattr_setpshared.cpp b/libc/src/pthread/pthread_mutexattr_setpshared.cpp
index f84343ce4c64ef..deeae15be23035 100644
--- a/libc/src/pthread/pthread_mutexattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_mutexattr_setpshared.cpp
@@ -9,9 +9,9 @@
#include "pthread_mutexattr_setpshared.h"
#include "pthread_mutexattr.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_mutexattr_setrobust.cpp b/libc/src/pthread/pthread_mutexattr_setrobust.cpp
index 08c94595c34f88..9fd46f4c928d70 100644
--- a/libc/src/pthread/pthread_mutexattr_setrobust.cpp
+++ b/libc/src/pthread/pthread_mutexattr_setrobust.cpp
@@ -9,9 +9,9 @@
#include "pthread_mutexattr_setrobust.h"
#include "pthread_mutexattr.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_mutexattr_settype.cpp b/libc/src/pthread/pthread_mutexattr_settype.cpp
index 93a477644476d9..c7e78271f9c38b 100644
--- a/libc/src/pthread/pthread_mutexattr_settype.cpp
+++ b/libc/src/pthread/pthread_mutexattr_settype.cpp
@@ -9,9 +9,9 @@
#include "pthread_mutexattr_settype.h"
#include "pthread_mutexattr.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_rwlock_timedrdlock.cpp b/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
index 9b3a8354b15796..112ff5c9cdad35 100644
--- a/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
@@ -7,13 +7,13 @@
//===----------------------------------------------------------------------===//
#include "src/pthread/pthread_rwlock_timedrdlock.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/libc_assert.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>
diff --git a/libc/src/pthread/pthread_rwlock_trywrlock.cpp b/libc/src/pthread/pthread_rwlock_trywrlock.cpp
index 0a2c3fabdce103..a63dc893e7169c 100644
--- a/libc/src/pthread/pthread_rwlock_trywrlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_trywrlock.cpp
@@ -8,10 +8,10 @@
#include "src/pthread/pthread_rwlock_trywrlock.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_rwlock_unlock.cpp b/libc/src/pthread/pthread_rwlock_unlock.cpp
index 95ad084cc3965d..e61290179bd629 100644
--- a/libc/src/pthread/pthread_rwlock_unlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_unlock.cpp
@@ -8,10 +8,10 @@
#include "src/pthread/pthread_rwlock_unlock.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/linux/rwlock.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h>
diff --git a/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp b/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp
index 69a156842043fe..80d34a35c717ad 100644
--- a/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp
+++ b/libc/src/pthread/pthread_rwlockattr_setkind_np.cpp
@@ -8,9 +8,9 @@
#include "pthread_rwlockattr_setkind_np.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h> // pthread_rwlockattr_t
diff --git a/libc/src/pthread/pthread_rwlockattr_setpshared.cpp b/libc/src/pthread/pthread_rwlockattr_setpshared.cpp
index 697cb76cc83068..5a7191aefd3d0d 100644
--- a/libc/src/pthread/pthread_rwlockattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_rwlockattr_setpshared.cpp
@@ -8,9 +8,9 @@
#include "pthread_rwlockattr_setpshared.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.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
diff --git a/libc/src/pthread/pthread_setspecific.cpp b/libc/src/pthread/pthread_setspecific.cpp
index d22ec6706197b1..70c29c16708411 100644
--- a/libc/src/pthread/pthread_setspecific.cpp
+++ b/libc/src/pthread/pthread_setspecific.cpp
@@ -8,10 +8,10 @@
#include "pthread_setspecific.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
+#include "src/errno/libc_errno.h"
#include <pthread.h>
diff --git a/libc/src/spawn/posix_spawn_file_actions_addclose.cpp b/libc/src/spawn/posix_spawn_file_actions_addclose.cpp
index bea48a9b2c211f..bb8504f655c4a2 100644
--- a/libc/src/spawn/posix_spawn_file_actions_addclose.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_addclose.cpp
@@ -9,10 +9,10 @@
#include "posix_spawn_file_actions_addclose.h"
#include "file_actions.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <spawn.h>
diff --git a/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp b/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp
index d70c183bc08ffe..710063d52e74dd 100644
--- a/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_adddup2.cpp
@@ -9,10 +9,10 @@
#include "posix_spawn_file_actions_adddup2.h"
#include "file_actions.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <spawn.h>
diff --git a/libc/src/spawn/posix_spawn_file_actions_addopen.cpp b/libc/src/spawn/posix_spawn_file_actions_addopen.cpp
index 23f648c4a63771..028d6e895f3c44 100644
--- a/libc/src/spawn/posix_spawn_file_actions_addopen.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_addopen.cpp
@@ -9,10 +9,10 @@
#include "posix_spawn_file_actions_addopen.h"
#include "file_actions.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <spawn.h>
diff --git a/libc/src/spawn/posix_spawn_file_actions_destroy.cpp b/libc/src/spawn/posix_spawn_file_actions_destroy.cpp
index 1406e05c106416..168118da249d1e 100644
--- a/libc/src/spawn/posix_spawn_file_actions_destroy.cpp
+++ b/libc/src/spawn/posix_spawn_file_actions_destroy.cpp
@@ -10,10 +10,10 @@
#include "file_actions.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/CPP/new.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
#include <spawn.h>
diff --git a/libc/src/threads/thrd_create.cpp b/libc/src/threads/thrd_create.cpp
index 94d96b3f2e777b..4680944c2eee09 100644
--- a/libc/src/threads/thrd_create.cpp
+++ b/libc/src/threads/thrd_create.cpp
@@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//
#include "src/threads/thrd_create.h"
-#include "src/errno/libc_errno.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/threads/thread.h"
+#include "src/errno/libc_errno.h"
#include <threads.h> // For thrd_* type definitions.
diff --git a/libc/test/UnitTest/PrintfMatcher.h b/libc/test/UnitTest/PrintfMatcher.h
index 4323a69e516999..4f79832ab59fac 100644
--- a/libc/test/UnitTest/PrintfMatcher.h
+++ b/libc/test/UnitTest/PrintfMatcher.h
@@ -13,7 +13,6 @@
#include "src/stdio/printf_core/core_structs.h"
#include "test/UnitTest/Test.h"
-
namespace LIBC_NAMESPACE_DECL {
namespace testing {
diff --git a/libc/test/UnitTest/ScanfMatcher.h b/libc/test/UnitTest/ScanfMatcher.h
index d106f17734ada6..cb9d13f7572b75 100644
--- a/libc/test/UnitTest/ScanfMatcher.h
+++ b/libc/test/UnitTest/ScanfMatcher.h
@@ -13,7 +13,6 @@
#include "src/stdio/scanf_core/core_structs.h"
#include "test/UnitTest/Test.h"
-
namespace LIBC_NAMESPACE_DECL {
namespace testing {
diff --git a/libc/test/integration/src/pthread/pthread_name_test.cpp b/libc/test/integration/src/pthread/pthread_name_test.cpp
index e3befc77abff40..37ceceee880de2 100644
--- a/libc/test/integration/src/pthread/pthread_name_test.cpp
+++ b/libc/test/integration/src/pthread/pthread_name_test.cpp
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#include "src/errno/libc_errno.h"
#include "src/__support/CPP/string_view.h"
+#include "src/errno/libc_errno.h"
#include "src/pthread/pthread_create.h"
#include "src/pthread/pthread_getname_np.h"
#include "src/pthread/pthread_join.h"
>From eeeca87c4d0878111b9002b17fff43707fa6f23d Mon Sep 17 00:00:00 2001
From: Job Hernandez <jobhdezlara93 at gmail.com>
Date: Fri, 4 Oct 2024 14:44:37 -0700
Subject: [PATCH 4/8] revert some files
---
libc/include/errno.h.def | 2 +-
libc/src/errno/libc_errno.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/libc/include/errno.h.def b/libc/include/errno.h.def
index 9a8a2692d1a09b..aa1f6c9e484444 100644
--- a/libc/include/errno.h.def
+++ b/libc/include/errno.h.def
@@ -18,7 +18,7 @@
#ifndef ENOTSUP
#define ENOTSUP EOPNOTSUPP
#endif // ENOTSUP
-
+
#include "llvm-libc-macros/linux/error-number-macros.h"
#else // __linux__
diff --git a/libc/src/errno/libc_errno.h b/libc/src/errno/libc_errno.h
index 49c9146b28c606..44ee2714843bab 100644
--- a/libc/src/errno/libc_errno.h
+++ b/libc/src/errno/libc_errno.h
@@ -21,11 +21,13 @@
// 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
>From 78d81d9434f44d7a087722ca91854e898f302653 Mon Sep 17 00:00:00 2001
From: Job Hernandez <jobhdezlara93 at gmail.com>
Date: Fri, 4 Oct 2024 18:04:36 -0700
Subject: [PATCH 5/8] address review
---
libc/src/pthread/CMakeLists.txt | 29 ++++++++++++-------
libc/src/spawn/CMakeLists.txt | 8 ++---
libc/src/threads/CMakeLists.txt | 1 +
.../integration/src/pthread/CMakeLists.txt | 1 -
4 files changed, 24 insertions(+), 15 deletions(-)
diff --git a/libc/src/pthread/CMakeLists.txt b/libc/src/pthread/CMakeLists.txt
index e7e92e5b60dc2a..1eb1d271e2847d 100644
--- a/libc/src/pthread/CMakeLists.txt
+++ b/libc/src/pthread/CMakeLists.txt
@@ -36,6 +36,7 @@ add_entrypoint_object(
pthread_attr_setdetachstate.h
DEPENDS
libc.include.pthread
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -56,6 +57,7 @@ add_entrypoint_object(
pthread_attr_setguardsize.h
DEPENDS
libc.include.pthread
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -76,6 +78,7 @@ add_entrypoint_object(
pthread_attr_setstacksize.h
DEPENDS
libc.include.pthread
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -98,6 +101,7 @@ add_entrypoint_object(
DEPENDS
libc.include.pthread
libc.src.pthread.pthread_attr_setstacksize
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -149,10 +153,10 @@ add_entrypoint_object(
HDRS
pthread_condattr_setclock.h
DEPENDS
- libc.include.errno
libc.include.pthread
libc.include.sys_types
libc.include.time
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -163,6 +167,7 @@ add_entrypoint_object(
pthread_condattr_setpshared.h
DEPENDS
libc.include.pthread
+ libc.src.errno.errno
)
add_header_library(
@@ -205,6 +210,7 @@ add_entrypoint_object(
DEPENDS
.pthread_mutexattr
libc.include.pthread
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -238,8 +244,8 @@ add_entrypoint_object(
pthread_mutexattr_setrobust.h
DEPENDS
.pthread_mutexattr
- libc.include.errno
libc.include.pthread
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -261,8 +267,8 @@ add_entrypoint_object(
pthread_mutexattr_setpshared.h
DEPENDS
.pthread_mutexattr
- libc.include.errno
libc.include.pthread
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -318,7 +324,6 @@ add_entrypoint_object(
HDRS
pthread_create.h
DEPENDS
- libc.include.errno
libc.include.pthread
libc.src.__support.threads.thread
libc.src.pthread.pthread_attr_destroy
@@ -326,6 +331,7 @@ add_entrypoint_object(
libc.src.pthread.pthread_attr_getdetachstate
libc.src.pthread.pthread_attr_getguardsize
libc.src.pthread.pthread_attr_getstack
+ libc.src.errno.errno
COMPILE_OPTIONS
-O3
-fno-omit-frame-pointer
@@ -419,9 +425,9 @@ add_entrypoint_object(
HDRS
pthread_key_create.h
DEPENDS
- libc.include.errno
libc.include.pthread
libc.src.__support.threads.thread
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -431,9 +437,9 @@ add_entrypoint_object(
HDRS
pthread_key_delete.h
DEPENDS
- libc.include.errno
libc.include.pthread
libc.src.__support.threads.thread
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -455,9 +461,9 @@ add_entrypoint_object(
HDRS
pthread_setspecific.h
DEPENDS
- libc.include.errno
libc.include.pthread
libc.src.__support.threads.thread
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -508,7 +514,7 @@ add_entrypoint_object(
pthread_rwlockattr_setkind_np.h
DEPENDS
libc.include.pthread
- libc.include.errno
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -519,7 +525,7 @@ add_entrypoint_object(
pthread_rwlockattr_setpshared.h
DEPENDS
libc.include.pthread
- libc.include.errno
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -554,6 +560,7 @@ add_entrypoint_object(
DEPENDS
libc.include.pthread
libc.src.__support.threads.linux.rwlock
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -587,6 +594,7 @@ add_entrypoint_object(
DEPENDS
libc.include.pthread
libc.src.__support.threads.linux.rwlock
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -631,6 +639,7 @@ add_entrypoint_object(
DEPENDS
libc.include.pthread
libc.src.__support.threads.linux.rwlock
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -727,7 +736,7 @@ add_entrypoint_object(
HDRS
pthread_atfork.h
DEPENDS
- libc.include.errno
libc.include.pthread
libc.src.__support.threads.fork_callbacks
+ libc.src.errno.errno
)
diff --git a/libc/src/spawn/CMakeLists.txt b/libc/src/spawn/CMakeLists.txt
index 4fbbaacb10d265..11621da782ed12 100644
--- a/libc/src/spawn/CMakeLists.txt
+++ b/libc/src/spawn/CMakeLists.txt
@@ -28,9 +28,9 @@ add_entrypoint_object(
posix_spawn_file_actions_destroy.h
DEPENDS
.file_actions
- libc.include.errno
libc.include.spawn
libc.src.__support.CPP.new
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -41,9 +41,9 @@ add_entrypoint_object(
posix_spawn_file_actions_adddup2.h
DEPENDS
.file_actions
- libc.include.errno
libc.include.spawn
libc.src.__support.CPP.new
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -54,9 +54,9 @@ add_entrypoint_object(
posix_spawn_file_actions_addopen.h
DEPENDS
.file_actions
- libc.include.errno
libc.include.spawn
libc.src.__support.CPP.new
+ libc.src.errno.errno
)
add_entrypoint_object(
@@ -67,9 +67,9 @@ add_entrypoint_object(
posix_spawn_file_actions_addclose.h
DEPENDS
.file_actions
- libc.include.errno
libc.include.spawn
libc.src.__support.CPP.new
+ libc.src.errno.errno
)
add_entrypoint_object(
diff --git a/libc/src/threads/CMakeLists.txt b/libc/src/threads/CMakeLists.txt
index b3b22e7f5c735a..c33be265369fec 100644
--- a/libc/src/threads/CMakeLists.txt
+++ b/libc/src/threads/CMakeLists.txt
@@ -22,6 +22,7 @@ add_entrypoint_object(
DEPENDS
libc.src.__support.threads.thread
libc.include.threads
+ libc.src.errno.errno
COMPILE_OPTIONS
-O3
-fno-omit-frame-pointer # This allows us to sniff out the thread args from
diff --git a/libc/test/integration/src/pthread/CMakeLists.txt b/libc/test/integration/src/pthread/CMakeLists.txt
index 48d4368df156d8..f1088cc4f907d1 100644
--- a/libc/test/integration/src/pthread/CMakeLists.txt
+++ b/libc/test/integration/src/pthread/CMakeLists.txt
@@ -115,7 +115,6 @@ add_integration_test(
SRCS
pthread_name_test.cpp
DEPENDS
- libc.include.errno
libc.include.pthread
libc.src.errno.errno
libc.src.pthread.pthread_create
>From a5c26ace0db17b369b104927ba02bfa025e6a564 Mon Sep 17 00:00:00 2001
From: Job Hernandez <jobhdezlara93 at gmail.com>
Date: Fri, 4 Oct 2024 21:01:13 -0700
Subject: [PATCH 6/8] address review
---
libc/src/__support/StringUtil/tables/CMakeLists.txt | 3 +--
libc/src/pthread/CMakeLists.txt | 6 +++---
libc/test/src/pthread/CMakeLists.txt | 6 +++---
libc/test/src/pthread/pthread_attr_test.cpp | 1 +
libc/test/src/pthread/pthread_mutexattr_test.cpp | 2 +-
libc/test/src/spawn/CMakeLists.txt | 2 +-
libc/test/src/spawn/posix_spawn_file_actions_test.cpp | 1 +
7 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/libc/src/__support/StringUtil/tables/CMakeLists.txt b/libc/src/__support/StringUtil/tables/CMakeLists.txt
index fffe93592f01d2..bfade85d8f441a 100644
--- a/libc/src/__support/StringUtil/tables/CMakeLists.txt
+++ b/libc/src/__support/StringUtil/tables/CMakeLists.txt
@@ -21,9 +21,8 @@ add_header_library(
HDRS
linux_extension_errors.h
DEPENDS
- libc.include.errno
libc.src.__support.StringUtil.message_mapper
- libc.src.errno.libc_errno
+ libc.src.errno.errno
)
add_header_library(
diff --git a/libc/src/pthread/CMakeLists.txt b/libc/src/pthread/CMakeLists.txt
index 1eb1d271e2847d..8480fd89422223 100644
--- a/libc/src/pthread/CMakeLists.txt
+++ b/libc/src/pthread/CMakeLists.txt
@@ -221,7 +221,7 @@ add_entrypoint_object(
pthread_mutexattr_destroy.h
DEPENDS
.pthread_mutexattr
- libc.include.errno
+ libc.src.errno.errno
libc.include.pthread
)
@@ -279,7 +279,7 @@ add_entrypoint_object(
pthread_mutex_init.h
DEPENDS
.pthread_mutexattr
- libc.include.errno
+ libc.src.errno.errno
libc.include.pthread
libc.src.__support.threads.mutex
)
@@ -449,8 +449,8 @@ add_entrypoint_object(
HDRS
pthread_getspecific.h
DEPENDS
- libc.include.errno
libc.include.pthread
+ libc.src.errno.errno
libc.src.__support.threads.thread
)
diff --git a/libc/test/src/pthread/CMakeLists.txt b/libc/test/src/pthread/CMakeLists.txt
index 0eeec445d5f49c..2cb80e2b6ae2e9 100644
--- a/libc/test/src/pthread/CMakeLists.txt
+++ b/libc/test/src/pthread/CMakeLists.txt
@@ -7,7 +7,6 @@ add_libc_unittest(
SRCS
pthread_attr_test.cpp
DEPENDS
- libc.include.errno
libc.include.pthread
libc.src.pthread.pthread_attr_destroy
libc.src.pthread.pthread_attr_init
@@ -19,6 +18,7 @@ add_libc_unittest(
libc.src.pthread.pthread_attr_setguardsize
libc.src.pthread.pthread_attr_setstacksize
libc.src.pthread.pthread_attr_setstack
+ libc.hdr.errno_macros
)
add_libc_unittest(
@@ -28,7 +28,6 @@ add_libc_unittest(
SRCS
pthread_mutexattr_test.cpp
DEPENDS
- libc.include.errno
libc.include.pthread
libc.src.pthread.pthread_mutexattr_destroy
libc.src.pthread.pthread_mutexattr_init
@@ -38,6 +37,7 @@ add_libc_unittest(
libc.src.pthread.pthread_mutexattr_setpshared
libc.src.pthread.pthread_mutexattr_setrobust
libc.src.pthread.pthread_mutexattr_settype
+ libc.hdr.errno_macros
)
add_libc_unittest(
@@ -65,8 +65,8 @@ add_libc_unittest(
SRCS
pthread_rwlockattr_test.cpp
DEPENDS
- libc.include.errno
libc.include.pthread
+ libc.src.errno.errno
libc.src.pthread.pthread_rwlockattr_destroy
libc.src.pthread.pthread_rwlockattr_getkind_np
libc.src.pthread.pthread_rwlockattr_getpshared
diff --git a/libc/test/src/pthread/pthread_attr_test.cpp b/libc/test/src/pthread/pthread_attr_test.cpp
index a04c2dc05e0219..bee9a1ca4f893a 100644
--- a/libc/test/src/pthread/pthread_attr_test.cpp
+++ b/libc/test/src/pthread/pthread_attr_test.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/errno_macros.h"
#include "src/pthread/pthread_attr_destroy.h"
#include "src/pthread/pthread_attr_getdetachstate.h"
#include "src/pthread/pthread_attr_getguardsize.h"
diff --git a/libc/test/src/pthread/pthread_mutexattr_test.cpp b/libc/test/src/pthread/pthread_mutexattr_test.cpp
index ab4becb769220a..7b01d401a34d34 100644
--- a/libc/test/src/pthread/pthread_mutexattr_test.cpp
+++ b/libc/test/src/pthread/pthread_mutexattr_test.cpp
@@ -15,7 +15,7 @@
#include "src/pthread/pthread_mutexattr_setrobust.h"
#include "src/pthread/pthread_mutexattr_settype.h"
#include "test/UnitTest/Test.h"
-
+#include "hdr/errno_macros.h"
#include <pthread.h>
TEST(LlvmLibcPThreadMutexAttrTest, InitAndDestroy) {
diff --git a/libc/test/src/spawn/CMakeLists.txt b/libc/test/src/spawn/CMakeLists.txt
index 39b63df1908494..ce246d4a1b7749 100644
--- a/libc/test/src/spawn/CMakeLists.txt
+++ b/libc/test/src/spawn/CMakeLists.txt
@@ -7,7 +7,6 @@ add_libc_unittest(
SRCS
posix_spawn_file_actions_test.cpp
DEPENDS
- libc.include.errno
libc.include.spawn
libc.src.spawn.file_actions
libc.src.spawn.posix_spawn_file_actions_addclose
@@ -15,4 +14,5 @@ add_libc_unittest(
libc.src.spawn.posix_spawn_file_actions_addopen
libc.src.spawn.posix_spawn_file_actions_destroy
libc.src.spawn.posix_spawn_file_actions_init
+ libc.src.errno.errno
)
diff --git a/libc/test/src/spawn/posix_spawn_file_actions_test.cpp b/libc/test/src/spawn/posix_spawn_file_actions_test.cpp
index 8b5ca09bc5fb48..c1edf56bdbd87c 100644
--- a/libc/test/src/spawn/posix_spawn_file_actions_test.cpp
+++ b/libc/test/src/spawn/posix_spawn_file_actions_test.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include "src/errno/libc_errno.h"
#include "src/spawn/file_actions.h"
#include "src/spawn/posix_spawn_file_actions_addclose.h"
#include "src/spawn/posix_spawn_file_actions_adddup2.h"
>From be9b3f5ccefe261eb9a9c2224764250fd6f99994 Mon Sep 17 00:00:00 2001
From: Job Hernandez <jobhdezlara93 at gmail.com>
Date: Fri, 4 Oct 2024 21:01:38 -0700
Subject: [PATCH 7/8] format code
---
libc/test/src/pthread/pthread_mutexattr_test.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/test/src/pthread/pthread_mutexattr_test.cpp b/libc/test/src/pthread/pthread_mutexattr_test.cpp
index 7b01d401a34d34..7fbdd2efd9858e 100644
--- a/libc/test/src/pthread/pthread_mutexattr_test.cpp
+++ b/libc/test/src/pthread/pthread_mutexattr_test.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/errno_macros.h"
#include "src/pthread/pthread_mutexattr_destroy.h"
#include "src/pthread/pthread_mutexattr_getpshared.h"
#include "src/pthread/pthread_mutexattr_getrobust.h"
@@ -15,7 +16,6 @@
#include "src/pthread/pthread_mutexattr_setrobust.h"
#include "src/pthread/pthread_mutexattr_settype.h"
#include "test/UnitTest/Test.h"
-#include "hdr/errno_macros.h"
#include <pthread.h>
TEST(LlvmLibcPThreadMutexAttrTest, InitAndDestroy) {
>From 1e134e8229c2f547c4d63ed064e8cc40c5c3b08d Mon Sep 17 00:00:00 2001
From: Job Hernandez <jobhdezlara93 at gmail.com>
Date: Sat, 5 Oct 2024 16:21:59 -0700
Subject: [PATCH 8/8] address review
---
.../StringUtil/tables/CMakeLists.txt | 4 ++--
libc/src/math/generic/CMakeLists.txt | 10 ---------
.../integration/src/pthread/CMakeLists.txt | 4 ++--
.../integration/src/unistd/CMakeLists.txt | 8 +++----
.../integration/startup/linux/CMakeLists.txt | 1 -
libc/test/src/__support/File/CMakeLists.txt | 2 +-
libc/test/src/signal/CMakeLists.txt | 6 +++---
libc/test/src/sys/prctl/linux/CMakeLists.txt | 1 -
libc/test/src/sys/resource/CMakeLists.txt | 2 +-
libc/test/src/sys/select/CMakeLists.txt | 4 ++--
libc/test/src/sys/sendfile/CMakeLists.txt | 2 +-
libc/test/src/sys/utsname/CMakeLists.txt | 2 +-
libc/test/src/sys/wait/CMakeLists.txt | 4 ++--
libc/test/src/unistd/CMakeLists.txt | 21 +------------------
14 files changed, 20 insertions(+), 51 deletions(-)
diff --git a/libc/src/__support/StringUtil/tables/CMakeLists.txt b/libc/src/__support/StringUtil/tables/CMakeLists.txt
index bfade85d8f441a..ad4007f494749e 100644
--- a/libc/src/__support/StringUtil/tables/CMakeLists.txt
+++ b/libc/src/__support/StringUtil/tables/CMakeLists.txt
@@ -3,7 +3,7 @@ add_header_library(
HDRS
stdc_errors.h
DEPENDS
- libc.include.errno
+ libc.src.errno.errno
libc.src.__support.StringUtil.message_mapper
)
@@ -12,7 +12,7 @@ add_header_library(
HDRS
posix_errors.h
DEPENDS
- libc.include.errno
+ libc.src.errno.errno
libc.src.__support.StringUtil.message_mapper
)
diff --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt
index 93e632c38af238..627168ee136997 100644
--- a/libc/src/math/generic/CMakeLists.txt
+++ b/libc/src/math/generic/CMakeLists.txt
@@ -1372,7 +1372,6 @@ add_entrypoint_object(
DEPENDS
.common_constants
.explogxf
- libc.include.errno
libc.src.__support.CPP.bit
libc.src.__support.CPP.optional
libc.src.__support.FPUtil.dyadic_float
@@ -1406,7 +1405,6 @@ add_entrypoint_object(
libc.src.__support.FPUtil.polyeval
libc.src.__support.FPUtil.rounding_mode
libc.src.__support.macros.optimization
- libc.include.errno
libc.src.errno.errno
COMPILE_OPTIONS
-O3
@@ -1445,7 +1443,6 @@ add_entrypoint_object(
DEPENDS
.common_constants
.explogxf
- libc.include.errno
libc.src.__support.CPP.bit
libc.src.__support.CPP.optional
libc.src.__support.FPUtil.dyadic_float
@@ -1478,7 +1475,6 @@ add_header_library(
libc.src.__support.FPUtil.rounding_mode
libc.src.__support.macros.optimization
libc.src.__support.common
- libc.include.errno
libc.src.errno.errno
)
@@ -1548,7 +1544,6 @@ add_entrypoint_object(
DEPENDS
.common_constants
.explogxf
- libc.include.errno
libc.src.__support.CPP.bit
libc.src.__support.CPP.optional
libc.src.__support.FPUtil.dyadic_float
@@ -1580,7 +1575,6 @@ add_header_library(
libc.src.__support.FPUtil.rounding_mode
libc.src.__support.macros.optimization
libc.src.__support.common
- libc.include.errno
libc.src.errno.errno
COMPILE_OPTIONS
-O3
@@ -1632,7 +1626,6 @@ add_entrypoint_object(
DEPENDS
.common_constants
.explogxf
- libc.include.errno
libc.src.__support.CPP.bit
libc.src.__support.CPP.optional
libc.src.__support.FPUtil.dyadic_float
@@ -1666,7 +1659,6 @@ add_entrypoint_object(
libc.src.__support.FPUtil.polyeval
libc.src.__support.FPUtil.rounding_mode
libc.src.__support.macros.optimization
- libc.include.errno
libc.src.errno.errno
COMPILE_OPTIONS
-O3
@@ -1705,7 +1697,6 @@ add_entrypoint_object(
.exp10f_impl
.exp2f_impl
.explogxf
- libc.include.errno
libc.src.__support.CPP.bit
libc.src.__support.CPP.optional
libc.src.__support.FPUtil.fenv_impl
@@ -4144,7 +4135,6 @@ add_object_library(
libc.src.__support.FPUtil.nearest_integer
libc.src.__support.FPUtil.polyeval
libc.src.__support.common
- libc.include.errno
libc.src.errno.errno
COMPILE_OPTIONS
-O3
diff --git a/libc/test/integration/src/pthread/CMakeLists.txt b/libc/test/integration/src/pthread/CMakeLists.txt
index f1088cc4f907d1..208ba3fd435079 100644
--- a/libc/test/integration/src/pthread/CMakeLists.txt
+++ b/libc/test/integration/src/pthread/CMakeLists.txt
@@ -184,8 +184,8 @@ add_integration_test(
pthread_join_test.cpp
DEPENDS
libc.include.pthread
- libc.include.errno
libc.include.stdio
+ libc.src.errno.errno
libc.src.pthread.pthread_create
libc.src.pthread.pthread_join
)
@@ -198,7 +198,7 @@ add_integration_test(
pthread_create_test.cpp
DEPENDS
libc.include.pthread
- libc.include.errno
+ libc.src.errno.errno
libc.src.pthread.pthread_create
libc.src.pthread.pthread_join
libc.src.pthread.pthread_attr_getdetachstate
diff --git a/libc/test/integration/src/unistd/CMakeLists.txt b/libc/test/integration/src/unistd/CMakeLists.txt
index 644f16fa46347a..5bcb712dd56d37 100644
--- a/libc/test/integration/src/unistd/CMakeLists.txt
+++ b/libc/test/integration/src/unistd/CMakeLists.txt
@@ -21,10 +21,10 @@ add_integration_test(
SRCS
fork_test.cpp
DEPENDS
- libc.include.errno
libc.include.signal
libc.include.sys_wait
libc.include.unistd
+ libc.src.errno.errno
libc.src.pthread.pthread_atfork
libc.src.signal.raise
libc.src.sys.wait.wait
@@ -45,11 +45,11 @@ if((${LIBC_TARGET_OS} STREQUAL "linux") AND (${LIBC_TARGET_ARCHITECTURE_IS_X86})
SRCS
stack_smashing_test.cpp
DEPENDS
- libc.include.errno
libc.include.signal
libc.include.sys_wait
libc.include.unistd
libc.src.compiler.__stack_chk_fail
+ libc.src.errno.errno
libc.src.pthread.pthread_atfork
libc.src.signal.raise
libc.src.sys.wait.wait
@@ -94,7 +94,7 @@ add_integration_test(
DEPENDS
libc_execv_test_normal_exit
libc_execv_test_signal_exit
- libc.include.errno
+ libc.src.errno.errno
libc.src.sys.wait.waitpid
libc.src.unistd.execv
libc.src.unistd.fork
@@ -111,7 +111,7 @@ add_integration_test(
DEPENDS
libc_execv_test_normal_exit
libc_execv_test_signal_exit
- libc.include.errno
+ libc.errno.errno
libc.src.sys.wait.waitpid
libc.src.unistd.execve
libc.src.unistd.fork
diff --git a/libc/test/integration/startup/linux/CMakeLists.txt b/libc/test/integration/startup/linux/CMakeLists.txt
index 6f0517a832d200..511b16d6130261 100644
--- a/libc/test/integration/startup/linux/CMakeLists.txt
+++ b/libc/test/integration/startup/linux/CMakeLists.txt
@@ -38,7 +38,6 @@ add_integration_test(
SRCS
tls_test.cpp
DEPENDS
- libc.include.errno
libc.include.sys_mman
libc.src.errno.errno
libc.src.sys.mman.mmap
diff --git a/libc/test/src/__support/File/CMakeLists.txt b/libc/test/src/__support/File/CMakeLists.txt
index 9191469b4927c2..9fa3b518421ccb 100644
--- a/libc/test/src/__support/File/CMakeLists.txt
+++ b/libc/test/src/__support/File/CMakeLists.txt
@@ -14,9 +14,9 @@ add_libc_test(
LINK_LIBRARIES
LibcMemoryHelpers
DEPENDS
- libc.include.errno
libc.include.stdio
libc.include.stdlib
+ libc.src.errno.errno
libc.src.__support.CPP.new
libc.src.__support.File.file
)
diff --git a/libc/test/src/signal/CMakeLists.txt b/libc/test/src/signal/CMakeLists.txt
index f7923204eaf499..87aa42faae8e5f 100644
--- a/libc/test/src/signal/CMakeLists.txt
+++ b/libc/test/src/signal/CMakeLists.txt
@@ -61,8 +61,8 @@ add_libc_unittest(
SRCS
sigaddset_test.cpp
DEPENDS
- libc.include.errno
libc.include.signal
+ libc.src.errno.errno
libc.src.signal.sigaddset
libc.test.UnitTest.ErrnoSetterMatcher
)
@@ -88,8 +88,8 @@ add_libc_unittest(
SRCS
sigfillset_test.cpp
DEPENDS
- libc.include.errno
libc.include.signal
+ libc.src.errno.errno
libc.src.signal.raise
libc.src.signal.sigfillset
libc.src.signal.sigprocmask
@@ -103,8 +103,8 @@ add_libc_unittest(
SRCS
sigdelset_test.cpp
DEPENDS
- libc.include.errno
libc.include.signal
+ libc.src.errno.errno
libc.src.signal.raise
libc.src.signal.sigdelset
libc.src.signal.sigfillset
diff --git a/libc/test/src/sys/prctl/linux/CMakeLists.txt b/libc/test/src/sys/prctl/linux/CMakeLists.txt
index 25e9b8fd8a0070..845452c9099eb1 100644
--- a/libc/test/src/sys/prctl/linux/CMakeLists.txt
+++ b/libc/test/src/sys/prctl/linux/CMakeLists.txt
@@ -8,7 +8,6 @@ add_libc_unittest(
prctl_test.cpp
DEPENDS
libc.include.sys_prctl
- libc.include.errno
libc.src.sys.prctl.prctl
libc.src.errno.errno
)
diff --git a/libc/test/src/sys/resource/CMakeLists.txt b/libc/test/src/sys/resource/CMakeLists.txt
index 90dc0e846df6d9..32186de4b111be 100644
--- a/libc/test/src/sys/resource/CMakeLists.txt
+++ b/libc/test/src/sys/resource/CMakeLists.txt
@@ -9,9 +9,9 @@ add_libc_unittest(
SRCS
getrlimit_setrlimit_test.cpp
DEPENDS
- libc.include.errno
libc.include.fcntl
libc.include.sys_resource
+ libc.src.errno.errno
libc.src.fcntl.open
libc.src.sys.resource.getrlimit
libc.src.sys.resource.setrlimit
diff --git a/libc/test/src/sys/select/CMakeLists.txt b/libc/test/src/sys/select/CMakeLists.txt
index c2d57052c38376..2b465d32c2c33e 100644
--- a/libc/test/src/sys/select/CMakeLists.txt
+++ b/libc/test/src/sys/select/CMakeLists.txt
@@ -8,8 +8,8 @@ add_libc_unittest(
SRCS
select_ui_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
+ libc.src.errno.errno
libc.src.sys.select.select
libc.src.unistd.read
)
@@ -21,8 +21,8 @@ add_libc_unittest(
SRCS
select_failure_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
+ libc.src.errno.errno
libc.src.sys.select.select
libc.src.unistd.read
libc.test.UnitTest.ErrnoSetterMatcher
diff --git a/libc/test/src/sys/sendfile/CMakeLists.txt b/libc/test/src/sys/sendfile/CMakeLists.txt
index 57dac4accd8286..82efaa147bd89d 100644
--- a/libc/test/src/sys/sendfile/CMakeLists.txt
+++ b/libc/test/src/sys/sendfile/CMakeLists.txt
@@ -9,9 +9,9 @@ add_libc_unittest(
SRCS
sendfile_test.cpp
DEPENDS
- libc.include.errno
libc.include.fcntl
libc.include.sys_stat
+ libc.src.errno.errno
libc.src.fcntl.open
libc.src.sys.sendfile.sendfile
libc.src.unistd.close
diff --git a/libc/test/src/sys/utsname/CMakeLists.txt b/libc/test/src/sys/utsname/CMakeLists.txt
index 435c190cc6212d..3640fc3bc5e251 100644
--- a/libc/test/src/sys/utsname/CMakeLists.txt
+++ b/libc/test/src/sys/utsname/CMakeLists.txt
@@ -7,8 +7,8 @@ add_libc_unittest(
SRCS
uname_test.cpp
DEPENDS
- libc.include.errno
libc.include.sys_utsname
+ libc.src.errno.errno
libc.src.__support.common
libc.src.sys.utsname.uname
libc.test.UnitTest.ErrnoSetterMatcher
diff --git a/libc/test/src/sys/wait/CMakeLists.txt b/libc/test/src/sys/wait/CMakeLists.txt
index 4ba1a939d6a8e5..db737a46f0d0f3 100644
--- a/libc/test/src/sys/wait/CMakeLists.txt
+++ b/libc/test/src/sys/wait/CMakeLists.txt
@@ -7,8 +7,8 @@ add_libc_unittest(
SRCS
waitpid_test.cpp
DEPENDS
- libc.include.errno
libc.include.sys_wait
+ libc.src.errno.errno
libc.src.sys.wait.waitpid
)
@@ -19,7 +19,7 @@ add_libc_unittest(
SRCS
wait4_test.cpp
DEPENDS
- libc.include.errno
libc.include.sys_wait
+ libc.src.errno.errno
libc.src.sys.wait.wait4
)
diff --git a/libc/test/src/unistd/CMakeLists.txt b/libc/test/src/unistd/CMakeLists.txt
index 332455b791aee5..e03e56b3cf8ad7 100644
--- a/libc/test/src/unistd/CMakeLists.txt
+++ b/libc/test/src/unistd/CMakeLists.txt
@@ -39,7 +39,6 @@ add_libc_unittest(
SRCS
dup_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -58,7 +57,6 @@ add_libc_unittest(
SRCS
dup2_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -77,7 +75,6 @@ add_libc_unittest(
SRCS
dup3_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -96,7 +93,6 @@ add_libc_unittest(
SRCS
fchdir_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -112,7 +108,6 @@ add_libc_unittest(
SRCS
ftruncate_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -131,7 +126,6 @@ add_libc_unittest(
SRCS
pread_pwrite_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -151,7 +145,6 @@ add_libc_unittest(
SRCS
read_write_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -170,7 +163,6 @@ add_libc_unittest(
SRCS
link_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -186,7 +178,6 @@ add_libc_unittest(
SRCS
linkat_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -202,7 +193,6 @@ add_libc_unittest(
SRCS
lseek_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -219,7 +209,6 @@ add_libc_unittest(
SRCS
pipe_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.unistd.close
@@ -234,7 +223,6 @@ add_libc_unittest(
SRCS
rmdir_test.cpp
DEPENDS
- libc.include.errno
libc.include.fcntl
libc.src.errno.errno
libc.src.sys.stat.mkdir
@@ -258,7 +246,6 @@ add_libc_unittest(
SRCS
readlink_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.unistd.readlink
@@ -275,7 +262,6 @@ add_libc_unittest(
SRCS
readlinkat_test.cpp
DEPENDS
- libc.include.errno
libc.include.fcntl
libc.include.unistd
libc.src.errno.errno
@@ -293,7 +279,6 @@ add_libc_unittest(
SRCS
symlink_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -309,7 +294,6 @@ add_libc_unittest(
SRCS
symlinkat_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -325,7 +309,6 @@ add_libc_unittest(
SRCS
truncate_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -344,7 +327,6 @@ add_libc_unittest(
SRCS
unlink_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -359,7 +341,6 @@ add_libc_unittest(
SRCS
unlinkat_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
@@ -428,10 +409,10 @@ add_libc_unittest(
SRCS
syscall_test.cpp
DEPENDS
- libc.include.errno
libc.include.unistd
libc.include.fcntl
libc.include.sys_syscall
+ libc.src.errno.errno
libc.src.unistd.__llvm_libc_syscall
libc.test.UnitTest.ErrnoSetterMatcher
)
More information about the libc-commits
mailing list