Skip to content

Commit 6276986

Browse files
c8efdvbuka
authored andcommitted
[libc] add SIG_HOLD for linux/gpu (llvm#165007)
1 parent 703b08f commit 6276986

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

libc/include/llvm-libc-macros/gpu/signal-macros.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@
99
#ifndef LLVM_LIBC_MACROS_GPU_SIGNAL_MACROS_H
1010
#define LLVM_LIBC_MACROS_GPU_SIGNAL_MACROS_H
1111

12+
#include "__llvm-libc-common.h"
13+
1214
#define SIGINT 2
1315
#define SIGILL 4
1416
#define SIGABRT 6
1517
#define SIGFPE 8
1618
#define SIGSEGV 11
1719
#define SIGTERM 15
1820

19-
#define SIG_DFL ((void (*)(int))(0))
20-
#define SIG_IGN ((void (*)(int))(1))
21-
#define SIG_ERR ((void (*)(int))(-1))
21+
#define SIG_ERR __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), -1)
22+
#define SIG_DFL __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 0)
23+
#define SIG_IGN __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 1)
24+
#define SIG_HOLD __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 2)
2225

2326
// Max signal number
2427
#define NSIG 64

libc/include/llvm-libc-macros/linux/signal-macros.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H
1010
#define LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H
1111

12+
#include "__llvm-libc-common.h"
13+
1214
#define SIGHUP 1
1315
#define SIGINT 2
1416
#define SIGQUIT 3
@@ -86,9 +88,10 @@
8688
#error "Signal stack sizes not defined for your platform."
8789
#endif
8890

89-
#define SIG_DFL ((void (*)(int))0)
90-
#define SIG_IGN ((void (*)(int))1)
91-
#define SIG_ERR ((void (*)(int))(-1))
91+
#define SIG_ERR __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), -1)
92+
#define SIG_DFL __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 0)
93+
#define SIG_IGN __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 1)
94+
#define SIG_HOLD __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 2)
9295

9396
// SIGCHLD si_codes
9497
#define CLD_EXITED 1 // child has exited

0 commit comments

Comments
 (0)