1 //===-- Definition of Linux signal number macros --------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef __LLVM_LIBC_MACROS_LINUX_SIGNUM_MACROS_H
10 #define __LLVM_LIBC_MACROS_LINUX_SIGNUM_MACROS_H
49 // SIGRTMIN is current set to the minimum usable from user mode programs. If
50 // the libc itself uses some of these signal numbers for private operations,
51 // then it has to be adjusted in future to reflect that.
56 // The kernel sigset is stored as an array of long values. Each bit of this
57 // array corresponds to a signal, adjusted by 1. That is, bit 0 corresponds
58 // to signal number 1, bit 1 corresponds to signal number 2 and so on. The
59 // below macro denotes the size of that array (in number of long words and
61 #define __NSIGSET_WORDS (NSIG / (sizeof(unsigned long) * 8))
63 #define SIG_BLOCK 0 // For blocking signals
64 #define SIG_UNBLOCK 1 // For unblocking signals
65 #define SIG_SETMASK 2 // For setting signal mask
67 // Flag values to be used for setting sigaction.sa_flags.
68 #define SA_NOCLDSTOP 0x00000001
69 #define SA_NOCLDWAIT 0x00000002
70 #define SA_SIGINFO 0x00000004
71 #define SA_RESTART 0x10000000
72 #define SA_RESTORER 0x04000000
73 #define SA_ONSTACK 0x08000000
76 #define SS_ONSTACK 0x1
77 #define SS_DISABLE 0x2
80 #define MINSIGSTKSZ 2048
82 #elif defined(__aarch64__)
83 #define MINSIGSTKSZ 5120
84 #define SIGSTKSZ 16384
85 #elif defined(__riscv)
86 #define MINSIGSTKSZ 2048
89 #error "Signal stack sizes not defined for your platform."
92 #define SIG_DFL ((__sighandler_t)0)
93 #define SIG_IGN ((__sighandler_t)1)
94 #define SIG_ERR ((__sighandler_t)-1)
97 #define CLD_EXITED 1 // child has exited
98 #define CLD_KILLED 2 // child was killed
99 #define CLD_DUMPED 3 // child terminated abnormally
100 #define CLD_TRAPPED 4 // traced child has trapped
101 #define CLD_STOPPED 5 // child has stopped
102 #define CLD_CONTINUED 6 // stopped child has continued
104 #endif // __LLVM_LIBC_MACROS_LINUX_SIGNUM_MACROS_H