1 | //===-- Map of POSIX signal numbers to strings ------------------*- C++ -*-===// |
2 | // |
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 |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_POSIX_SIGNALS_H |
10 | #define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_POSIX_SIGNALS_H |
11 | |
12 | #include "src/__support/CPP/array.h" |
13 | #include "src/__support/StringUtil/message_mapper.h" |
14 | |
15 | #include <signal.h> // For signal numbers |
16 | |
17 | namespace LIBC_NAMESPACE { |
18 | |
19 | LIBC_INLINE_VAR constexpr MsgTable<22> POSIX_SIGNALS = { |
20 | MsgMapping(SIGHUP, "Hangup" ), |
21 | MsgMapping(SIGQUIT, "Quit" ), |
22 | MsgMapping(SIGTRAP, "Trace/breakpoint trap" ), |
23 | MsgMapping(SIGBUS, "Bus error" ), |
24 | MsgMapping(SIGKILL, "Killed" ), |
25 | MsgMapping(SIGUSR1, "User defined signal 1" ), |
26 | MsgMapping(SIGUSR2, "User defined signal 2" ), |
27 | MsgMapping(SIGPIPE, "Broken pipe" ), |
28 | MsgMapping(SIGALRM, "Alarm clock" ), |
29 | MsgMapping(SIGCHLD, "Child exited" ), |
30 | MsgMapping(SIGCONT, "Continued" ), |
31 | MsgMapping(SIGSTOP, "Stopped (signal)" ), |
32 | MsgMapping(SIGTSTP, "Stopped" ), |
33 | MsgMapping(SIGTTIN, "Stopped (tty input)" ), |
34 | MsgMapping(SIGTTOU, "Stopped (tty output)" ), |
35 | MsgMapping(SIGURG, "Urgent I/O condition" ), |
36 | MsgMapping(SIGXCPU, "CPU time limit exceeded" ), |
37 | MsgMapping(SIGXFSZ, "File size limit exceeded" ), |
38 | MsgMapping(SIGVTALRM, "Virtual timer expired" ), |
39 | MsgMapping(SIGPROF, "Profiling timer expired" ), |
40 | MsgMapping(SIGPOLL, "I/O possible" ), |
41 | MsgMapping(SIGSYS, "Bad system call" ), |
42 | }; |
43 | |
44 | } // namespace LIBC_NAMESPACE |
45 | |
46 | #endif // LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_POSIX_SIGNALS_H |
47 | |