[libc-commits] [libc] 30f9ce1 - [libc] add SIG_HOLD for linux/gpu (#165007)
via libc-commits
libc-commits at lists.llvm.org
Fri Oct 24 21:34:07 PDT 2025
Author: Connector Switch
Date: 2025-10-25T12:34:03+08:00
New Revision: 30f9ce14b439ddb14a9624705ac573d7597d6ce2
URL: https://github.com/llvm/llvm-project/commit/30f9ce14b439ddb14a9624705ac573d7597d6ce2
DIFF: https://github.com/llvm/llvm-project/commit/30f9ce14b439ddb14a9624705ac573d7597d6ce2.diff
LOG: [libc] add SIG_HOLD for linux/gpu (#165007)
Added:
Modified:
libc/include/llvm-libc-macros/gpu/signal-macros.h
libc/include/llvm-libc-macros/linux/signal-macros.h
Removed:
################################################################################
diff --git a/libc/include/llvm-libc-macros/gpu/signal-macros.h b/libc/include/llvm-libc-macros/gpu/signal-macros.h
index f0d49ea34fe0e..76488e9796fc4 100644
--- a/libc/include/llvm-libc-macros/gpu/signal-macros.h
+++ b/libc/include/llvm-libc-macros/gpu/signal-macros.h
@@ -9,6 +9,8 @@
#ifndef LLVM_LIBC_MACROS_GPU_SIGNAL_MACROS_H
#define LLVM_LIBC_MACROS_GPU_SIGNAL_MACROS_H
+#include "__llvm-libc-common.h"
+
#define SIGINT 2
#define SIGILL 4
#define SIGABRT 6
@@ -16,9 +18,10 @@
#define SIGSEGV 11
#define SIGTERM 15
-#define SIG_DFL ((void (*)(int))(0))
-#define SIG_IGN ((void (*)(int))(1))
-#define SIG_ERR ((void (*)(int))(-1))
+#define SIG_ERR __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), -1)
+#define SIG_DFL __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 0)
+#define SIG_IGN __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 1)
+#define SIG_HOLD __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 2)
// Max signal number
#define NSIG 64
diff --git a/libc/include/llvm-libc-macros/linux/signal-macros.h b/libc/include/llvm-libc-macros/linux/signal-macros.h
index d220241a38206..e7f268df87cba 100644
--- a/libc/include/llvm-libc-macros/linux/signal-macros.h
+++ b/libc/include/llvm-libc-macros/linux/signal-macros.h
@@ -9,6 +9,8 @@
#ifndef LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H
#define LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H
+#include "__llvm-libc-common.h"
+
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
@@ -86,9 +88,10 @@
#error "Signal stack sizes not defined for your platform."
#endif
-#define SIG_DFL ((void (*)(int))0)
-#define SIG_IGN ((void (*)(int))1)
-#define SIG_ERR ((void (*)(int))(-1))
+#define SIG_ERR __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), -1)
+#define SIG_DFL __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 0)
+#define SIG_IGN __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 1)
+#define SIG_HOLD __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 2)
// SIGCHLD si_codes
#define CLD_EXITED 1 // child has exited
More information about the libc-commits
mailing list