[libc-commits] [libc] 36c6568 - [libc] Remove #include <signal.h> (#209433)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 14 23:53:03 PDT 2026


Author: Pavel Labath
Date: 2026-07-15T08:52:58+02:00
New Revision: 36c6568b04aff4e1cf00a60570ab4a4344692920

URL: https://github.com/llvm/llvm-project/commit/36c6568b04aff4e1cf00a60570ab4a4344692920
DIFF: https://github.com/llvm/llvm-project/commit/36c6568b04aff4e1cf00a60570ab4a4344692920.diff

LOG: [libc] Remove #include <signal.h> (#209433)

Replace it with granular includes of the appropriate type/macro proxy
headers.

Assisted by Gemini.

Added: 
    

Modified: 
    libc/src/__support/StringUtil/CMakeLists.txt
    libc/src/__support/StringUtil/signal_to_string.cpp
    libc/src/__support/StringUtil/tables/CMakeLists.txt
    libc/src/__support/StringUtil/tables/linux_extension_signals.h
    libc/src/__support/StringUtil/tables/posix_signals.h
    libc/src/__support/StringUtil/tables/stdc_signals.h
    libc/src/signal/kill.h
    libc/src/signal/linux/CMakeLists.txt
    libc/src/signal/linux/kill.cpp
    libc/src/signal/linux/sigemptyset.cpp
    libc/src/signal/raise.h
    libc/src/spawn/linux/CMakeLists.txt
    libc/src/spawn/linux/posix_spawn.cpp
    libc/src/sys/wait/linux/CMakeLists.txt
    libc/src/sys/wait/wait4Impl.h
    libc/src/unistd/linux/CMakeLists.txt
    libc/src/unistd/linux/fork.cpp
    libc/test/src/fenv/enabled_exceptions_test.cpp
    libc/test/src/signal/kill_test.cpp
    libc/test/src/signal/pthread_sigmask_test.cpp
    libc/test/src/signal/raise_test.cpp
    libc/test/src/signal/sigaddset_test.cpp
    libc/test/src/signal/sigdelset_test.cpp
    libc/test/src/signal/sigfillset_test.cpp
    libc/test/src/signal/signal_test.cpp
    libc/test/src/signal/sigprocmask_test.cpp
    libc/test/src/stdlib/abort_test.cpp
    libc/test/src/string/strsignal_test.cpp
    libc/test/src/sys/mman/linux/mprotect_test.cpp

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/StringUtil/CMakeLists.txt b/libc/src/__support/StringUtil/CMakeLists.txt
index 41b20dc2cb117..3080aa659f011 100644
--- a/libc/src/__support/StringUtil/CMakeLists.txt
+++ b/libc/src/__support/StringUtil/CMakeLists.txt
@@ -61,7 +61,7 @@ if(TARGET libc.include.signal)
     DEPENDS
       .message_mapper
       .platform_signals
-      libc.include.signal
+      libc.hdr.signal_macros
       libc.src.__support.common
       libc.src.__support.CPP.span
       libc.src.__support.CPP.string_view

diff  --git a/libc/src/__support/StringUtil/signal_to_string.cpp b/libc/src/__support/StringUtil/signal_to_string.cpp
index e5863ff1e8987..71b05a5d2f4ea 100644
--- a/libc/src/__support/StringUtil/signal_to_string.cpp
+++ b/libc/src/__support/StringUtil/signal_to_string.cpp
@@ -8,9 +8,9 @@
 
 #include "signal_to_string.h"
 
-#include <signal.h>
 #include <stddef.h>
 
+#include "hdr/signal_macros.h"
 #include "platform_signals.h"
 #include "src/__support/CPP/span.h"
 #include "src/__support/CPP/string_view.h"

diff  --git a/libc/src/__support/StringUtil/tables/CMakeLists.txt b/libc/src/__support/StringUtil/tables/CMakeLists.txt
index a61282048eddf..8fe0e36f05f9d 100644
--- a/libc/src/__support/StringUtil/tables/CMakeLists.txt
+++ b/libc/src/__support/StringUtil/tables/CMakeLists.txt
@@ -48,7 +48,7 @@ add_header_library(
   HDRS
     stdc_signals.h
   DEPENDS
-    libc.include.signal
+    libc.hdr.signal_macros
     libc.src.__support.StringUtil.message_mapper
 )
 
@@ -57,7 +57,7 @@ add_header_library(
   HDRS
     posix_signals.h
   DEPENDS
-    libc.include.signal
+    libc.hdr.signal_macros
     libc.src.__support.StringUtil.message_mapper
 )
 
@@ -66,7 +66,7 @@ add_header_library(
   HDRS
     linux_extension_signals.h
   DEPENDS
-    libc.include.signal
+    libc.hdr.signal_macros
     libc.src.__support.StringUtil.message_mapper
 )
 

diff  --git a/libc/src/__support/StringUtil/tables/linux_extension_signals.h b/libc/src/__support/StringUtil/tables/linux_extension_signals.h
index c9cb26b785a13..7ab3771a02ba7 100644
--- a/libc/src/__support/StringUtil/tables/linux_extension_signals.h
+++ b/libc/src/__support/StringUtil/tables/linux_extension_signals.h
@@ -9,11 +9,10 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_LINUX_EXTENSION_SIGNALS_H
 #define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_LINUX_EXTENSION_SIGNALS_H
 
+#include "hdr/signal_macros.h" // For signal numbers
 #include "src/__support/StringUtil/message_mapper.h"
 #include "src/__support/macros/config.h"
 
-#include <signal.h> // For signal numbers
-
 namespace LIBC_NAMESPACE_DECL {
 
 // The array being larger than necessary isn't a problem. The MsgMappings will

diff  --git a/libc/src/__support/StringUtil/tables/posix_signals.h b/libc/src/__support/StringUtil/tables/posix_signals.h
index 7c70f71837e27..3e896e48822c5 100644
--- a/libc/src/__support/StringUtil/tables/posix_signals.h
+++ b/libc/src/__support/StringUtil/tables/posix_signals.h
@@ -9,12 +9,11 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_POSIX_SIGNALS_H
 #define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_POSIX_SIGNALS_H
 
+#include "hdr/signal_macros.h" // For signal numbers
 #include "src/__support/CPP/array.h"
 #include "src/__support/StringUtil/message_mapper.h"
 #include "src/__support/macros/config.h"
 
-#include <signal.h> // For signal numbers
-
 namespace LIBC_NAMESPACE_DECL {
 
 LIBC_INLINE_VAR constexpr MsgTable<22> POSIX_SIGNALS = {

diff  --git a/libc/src/__support/StringUtil/tables/stdc_signals.h b/libc/src/__support/StringUtil/tables/stdc_signals.h
index 094b59b4ba641..7f238388105f6 100644
--- a/libc/src/__support/StringUtil/tables/stdc_signals.h
+++ b/libc/src/__support/StringUtil/tables/stdc_signals.h
@@ -9,8 +9,7 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_STDC_SIGNALS_H
 #define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_STDC_SIGNALS_H
 
-#include <signal.h> // For signal numbers
-
+#include "hdr/signal_macros.h" // For signal numbers
 #include "src/__support/StringUtil/message_mapper.h"
 #include "src/__support/macros/config.h"
 

diff  --git a/libc/src/signal/kill.h b/libc/src/signal/kill.h
index 46048f2dbe044..cadbbe965e7c0 100644
--- a/libc/src/signal/kill.h
+++ b/libc/src/signal/kill.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_SIGNAL_KILL_H
 #define LLVM_LIBC_SRC_SIGNAL_KILL_H
 
+#include "hdr/types/pid_t.h"
 #include "src/__support/macros/config.h"
-#include <signal.h>
 
 namespace LIBC_NAMESPACE_DECL {
 

diff  --git a/libc/src/signal/linux/CMakeLists.txt b/libc/src/signal/linux/CMakeLists.txt
index 9820276735aed..5d7c8c25dccb6 100644
--- a/libc/src/signal/linux/CMakeLists.txt
+++ b/libc/src/signal/linux/CMakeLists.txt
@@ -22,7 +22,7 @@ add_entrypoint_object(
   HDRS
     ../kill.h
   DEPENDS
-    libc.include.signal
+    libc.hdr.types.pid_t
     libc.src.errno.errno
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil

diff  --git a/libc/src/signal/linux/kill.cpp b/libc/src/signal/linux/kill.cpp
index 0f5e88757acb8..f6b6c3c052a5b 100644
--- a/libc/src/signal/linux/kill.cpp
+++ b/libc/src/signal/linux/kill.cpp
@@ -14,7 +14,6 @@
 #include "src/__support/macros/config.h"
 #include "src/signal/linux/signal_utils.h"
 
-#include <signal.h>
 #include <sys/syscall.h> // For syscall numbers.
 
 namespace LIBC_NAMESPACE_DECL {

diff  --git a/libc/src/signal/linux/sigemptyset.cpp b/libc/src/signal/linux/sigemptyset.cpp
index 034a9e2cbe15e..788983f429baa 100644
--- a/libc/src/signal/linux/sigemptyset.cpp
+++ b/libc/src/signal/linux/sigemptyset.cpp
@@ -7,14 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/signal/sigemptyset.h"
+#include "src/__support/common.h"
 #include "src/__support/libc_errno.h"
 #include "src/__support/macros/config.h"
 #include "src/signal/linux/signal_utils.h"
 
-#include "src/__support/common.h"
-
-#include <signal.h>
-
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(int, sigemptyset, (sigset_t * set)) {

diff  --git a/libc/src/signal/raise.h b/libc/src/signal/raise.h
index 8e6894c1a9053..f6b9b48e8010b 100644
--- a/libc/src/signal/raise.h
+++ b/libc/src/signal/raise.h
@@ -10,7 +10,6 @@
 #define LLVM_LIBC_SRC_SIGNAL_RAISE_H
 
 #include "src/__support/macros/config.h"
-#include <signal.h>
 
 namespace LIBC_NAMESPACE_DECL {
 

diff  --git a/libc/src/spawn/linux/CMakeLists.txt b/libc/src/spawn/linux/CMakeLists.txt
index 910705af85b3d..5b3d09a82ff33 100644
--- a/libc/src/spawn/linux/CMakeLists.txt
+++ b/libc/src/spawn/linux/CMakeLists.txt
@@ -7,9 +7,9 @@ add_entrypoint_object(
   DEPENDS
     libc.hdr.types.mode_t
     libc.hdr.fcntl_macros
+    libc.hdr.signal_macros
     libc.include.spawn
     libc.include.sys_syscall
-    libc.include.signal
     libc.src.__support.OSUtil.osutil
     libc.src.__support.OSUtil.linux.syscall_wrappers.dup2
     libc.src.__support.OSUtil.linux.syscall_wrappers.open

diff  --git a/libc/src/spawn/linux/posix_spawn.cpp b/libc/src/spawn/linux/posix_spawn.cpp
index 2961dd5c6b82c..dcdb14d90d7a7 100644
--- a/libc/src/spawn/linux/posix_spawn.cpp
+++ b/libc/src/spawn/linux/posix_spawn.cpp
@@ -15,9 +15,9 @@
 #include "src/spawn/file_actions.h"
 
 #include "hdr/fcntl_macros.h"
+#include "hdr/signal_macros.h" // For SIGCHLD
 #include "hdr/types/mode_t.h"
 #include "src/signal/linux/signal_utils.h"
-#include <signal.h> // For SIGCHLD
 #include <spawn.h>
 #include <sys/syscall.h> // For syscall numbers.
 

diff  --git a/libc/src/sys/wait/linux/CMakeLists.txt b/libc/src/sys/wait/linux/CMakeLists.txt
index 49517ced71d1d..24a799f1dabb1 100644
--- a/libc/src/sys/wait/linux/CMakeLists.txt
+++ b/libc/src/sys/wait/linux/CMakeLists.txt
@@ -5,6 +5,8 @@ add_entrypoint_object(
   HDRS
     ../wait.h
   DEPENDS
+    libc.hdr.signal_macros
+    libc.hdr.types.siginfo_t
     libc.include.sys_wait
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
@@ -18,6 +20,8 @@ add_entrypoint_object(
   HDRS
     ../wait4.h
   DEPENDS
+    libc.hdr.signal_macros
+    libc.hdr.types.siginfo_t
     libc.include.sys_wait
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
@@ -31,6 +35,8 @@ add_entrypoint_object(
   HDRS
     ../waitpid.h
   DEPENDS
+    libc.hdr.signal_macros
+    libc.hdr.types.siginfo_t
     libc.include.sys_wait
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil

diff  --git a/libc/src/sys/wait/wait4Impl.h b/libc/src/sys/wait/wait4Impl.h
index 77ed3ad22f148..dfc1ee86356a2 100644
--- a/libc/src/sys/wait/wait4Impl.h
+++ b/libc/src/sys/wait/wait4Impl.h
@@ -15,7 +15,8 @@
 #include "src/__support/libc_errno.h"
 #include "src/__support/macros/config.h"
 
-#include <signal.h>
+#include "hdr/signal_macros.h"
+#include "hdr/types/siginfo_t.h"
 #include <sys/syscall.h> // For syscall numbers.
 #include <sys/wait.h>
 

diff  --git a/libc/src/unistd/linux/CMakeLists.txt b/libc/src/unistd/linux/CMakeLists.txt
index 168b61bede853..ef51f20f62a77 100644
--- a/libc/src/unistd/linux/CMakeLists.txt
+++ b/libc/src/unistd/linux/CMakeLists.txt
@@ -138,6 +138,7 @@ add_entrypoint_object(
   DEPENDS
     libc.hdr.types.pid_t
     libc.hdr.fcntl_macros
+    libc.hdr.signal_macros
     libc.include.unistd
     libc.include.sys_syscall
     libc.src.__support.threads.fork_callbacks

diff  --git a/libc/src/unistd/linux/fork.cpp b/libc/src/unistd/linux/fork.cpp
index 75a76fdea50b2..a7529415fa873 100644
--- a/libc/src/unistd/linux/fork.cpp
+++ b/libc/src/unistd/linux/fork.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/unistd/fork.h"
-
+#include "hdr/signal_macros.h"            // For SIGCHLD
 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
@@ -16,7 +16,6 @@
 #include "src/__support/threads/thread.h" // For thread self object
 
 #include "src/__support/libc_errno.h"
-#include <signal.h>      // For SIGCHLD
 #include <sys/syscall.h> // For syscall numbers.
 
 namespace LIBC_NAMESPACE_DECL {

diff  --git a/libc/test/src/fenv/enabled_exceptions_test.cpp b/libc/test/src/fenv/enabled_exceptions_test.cpp
index a742c240a120b..8a1643953f883 100644
--- a/libc/test/src/fenv/enabled_exceptions_test.cpp
+++ b/libc/test/src/fenv/enabled_exceptions_test.cpp
@@ -12,15 +12,14 @@
 #include "src/fenv/feraiseexcept.h"
 #include "src/fenv/fetestexcept.h"
 
+#include "hdr/fenv_macros.h"
+#include "hdr/signal_macros.h"
 #include "src/__support/FPUtil/FEnvImpl.h"
 #include "src/__support/macros/properties/architectures.h"
 #include "test/UnitTest/FEnvSafeTest.h"
 #include "test/UnitTest/FPExceptMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include "hdr/fenv_macros.h"
-#include <signal.h>
-
 #include "excepts.h"
 
 using LlvmLibcExceptionStatusTest = LIBC_NAMESPACE::testing::FEnvSafeTest;

diff  --git a/libc/test/src/signal/kill_test.cpp b/libc/test/src/signal/kill_test.cpp
index 2033543c97a2b..02f745f841d18 100644
--- a/libc/test/src/signal/kill_test.cpp
+++ b/libc/test/src/signal/kill_test.cpp
@@ -12,7 +12,7 @@
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include <signal.h>
+#include "hdr/signal_macros.h"
 #include <sys/syscall.h> // For syscall numbers.
 
 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;

diff  --git a/libc/test/src/signal/pthread_sigmask_test.cpp b/libc/test/src/signal/pthread_sigmask_test.cpp
index 02eaa83c80846..57bd70ea61727 100644
--- a/libc/test/src/signal/pthread_sigmask_test.cpp
+++ b/libc/test/src/signal/pthread_sigmask_test.cpp
@@ -11,6 +11,8 @@
 ///
 //===----------------------------------------------------------------------===//
 
+#include "hdr/signal_macros.h"
+#include "hdr/types/sigset_t.h"
 #include "src/signal/pthread_sigmask.h"
 #include "src/signal/raise.h"
 #include "src/signal/sigaddset.h"
@@ -18,8 +20,6 @@
 #include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/Test.h"
 
-#include <signal.h>
-
 class LlvmLibcPthreadSigmaskTest
     : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
   sigset_t old_set;

diff  --git a/libc/test/src/signal/raise_test.cpp b/libc/test/src/signal/raise_test.cpp
index a114ac5e8379c..cb9f7abd8bb89 100644
--- a/libc/test/src/signal/raise_test.cpp
+++ b/libc/test/src/signal/raise_test.cpp
@@ -6,12 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/signal_macros.h"
 #include "src/signal/raise.h"
-
 #include "test/UnitTest/Test.h"
 
-#include <signal.h>
-
 TEST(LlvmLibcSignalTest, Raise) {
   // SIGCONT is ingored unless stopped, so we can use it to check the return
   // value of raise without needing to block.

diff  --git a/libc/test/src/signal/sigaddset_test.cpp b/libc/test/src/signal/sigaddset_test.cpp
index bc33750cf787d..6456aa8f570d0 100644
--- a/libc/test/src/signal/sigaddset_test.cpp
+++ b/libc/test/src/signal/sigaddset_test.cpp
@@ -8,11 +8,11 @@
 
 #include "src/signal/sigaddset.h"
 
+#include "hdr/signal_macros.h"
+#include "hdr/types/sigset_t.h"
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include <signal.h>
-
 // This tests invalid inputs and ensures errno is properly set.
 TEST(LlvmLibcSignalTest, SigaddsetInvalid) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;

diff  --git a/libc/test/src/signal/sigdelset_test.cpp b/libc/test/src/signal/sigdelset_test.cpp
index 622f1a32fbbe9..3789879855016 100644
--- a/libc/test/src/signal/sigdelset_test.cpp
+++ b/libc/test/src/signal/sigdelset_test.cpp
@@ -6,16 +6,15 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/signal_macros.h"
+#include "hdr/types/sigset_t.h"
 #include "src/signal/raise.h"
 #include "src/signal/sigdelset.h"
 #include "src/signal/sigfillset.h"
 #include "src/signal/sigprocmask.h"
-
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include <signal.h>
-
 TEST(LlvmLibcSigdelset, Invalid) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
   // Invalid set.

diff  --git a/libc/test/src/signal/sigfillset_test.cpp b/libc/test/src/signal/sigfillset_test.cpp
index 0604bc2a95bf6..1f69734404e18 100644
--- a/libc/test/src/signal/sigfillset_test.cpp
+++ b/libc/test/src/signal/sigfillset_test.cpp
@@ -6,15 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/signal_macros.h"
+#include "hdr/types/sigset_t.h"
 #include "src/signal/raise.h"
 #include "src/signal/sigfillset.h"
 #include "src/signal/sigprocmask.h"
-
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include <signal.h>
-
 TEST(LlvmLibcSigfillset, Invalid) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
   EXPECT_THAT(LIBC_NAMESPACE::sigfillset(nullptr), Fails(EINVAL));

diff  --git a/libc/test/src/signal/signal_test.cpp b/libc/test/src/signal/signal_test.cpp
index cfcab0c7676b0..266b0e46c1931 100644
--- a/libc/test/src/signal/signal_test.cpp
+++ b/libc/test/src/signal/signal_test.cpp
@@ -6,6 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/signal_macros.h"
 #include "src/signal/raise.h"
 #include "src/signal/signal.h"
 #include "test/UnitTest/ErrnoCheckingTest.h"

diff  --git a/libc/test/src/signal/sigprocmask_test.cpp b/libc/test/src/signal/sigprocmask_test.cpp
index 54de8f7a8683f..60664eb63aa3c 100644
--- a/libc/test/src/signal/sigprocmask_test.cpp
+++ b/libc/test/src/signal/sigprocmask_test.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/signal_macros.h"
+#include "hdr/types/sigset_t.h"
 #include "src/signal/raise.h"
 #include "src/signal/sigaddset.h"
 #include "src/signal/sigemptyset.h"
@@ -14,8 +16,6 @@
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include <signal.h>
-
 class LlvmLibcSigprocmaskTest
     : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
   sigset_t oldSet;

diff  --git a/libc/test/src/stdlib/abort_test.cpp b/libc/test/src/stdlib/abort_test.cpp
index 8c5fd0c97abbc..c11d921e73f78 100644
--- a/libc/test/src/stdlib/abort_test.cpp
+++ b/libc/test/src/stdlib/abort_test.cpp
@@ -6,11 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/signal_macros.h"
 #include "src/stdlib/abort.h"
 #include "test/UnitTest/Test.h"
 
-#include <signal.h>
-
 TEST(LlvmLibcStdlib, abort) {
   // -1 matches against any signal, which is necessary for now until
   // LIBC_NAMESPACE::abort() unblocks SIGABRT.

diff  --git a/libc/test/src/string/strsignal_test.cpp b/libc/test/src/string/strsignal_test.cpp
index 48b5d17f85c46..1b13dda66f3f9 100644
--- a/libc/test/src/string/strsignal_test.cpp
+++ b/libc/test/src/string/strsignal_test.cpp
@@ -6,11 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/signal_macros.h"
 #include "src/string/strsignal.h"
 #include "test/UnitTest/Test.h"
 
-#include <signal.h>
-
 TEST(LlvmLibcStrSignalTest, KnownSignals) {
   ASSERT_STREQ(LIBC_NAMESPACE::strsignal(1), "Hangup");
 

diff  --git a/libc/test/src/sys/mman/linux/mprotect_test.cpp b/libc/test/src/sys/mman/linux/mprotect_test.cpp
index 07d0f7375f6ec..e34c21d8e0446 100644
--- a/libc/test/src/sys/mman/linux/mprotect_test.cpp
+++ b/libc/test/src/sys/mman/linux/mprotect_test.cpp
@@ -6,6 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/signal_macros.h"
 #include "hdr/sys_mman_macros.h"
 #include "src/sys/mman/mmap.h"
 #include "src/sys/mman/mprotect.h"
@@ -14,7 +15,6 @@
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include <signal.h>
 #include <sys/mman.h>
 
 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;


        


More information about the libc-commits mailing list