1 //===-- Map of Linux extension 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_LINUX_EXTENSION_SIGNALS_H 10 #define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_LINUX_EXTENSION_SIGNALS_H 11 12 #include "src/__support/StringUtil/message_mapper.h" 13 14 #include <signal.h> // For signal numbers 15 16 namespace LIBC_NAMESPACE { 17 18 // The array being larger than necessary isn't a problem. The MsgMappings will 19 // be set to their default state which maps 0 to an empty string. This will get 20 // filtered out in the MessageMapper building stage. 21 LIBC_INLINE_VAR constexpr const MsgTable<3> LINUX_SIGNALS = { 22 #ifdef SIGSTKFLT 23 MsgMapping(SIGSTKFLT, "Stack fault"), // unused 24 #endif 25 MsgMapping(SIGWINCH, "Window changed"), 26 #ifdef SIGPWR 27 MsgMapping(SIGPWR, "Power failure"), // ignored 28 #endif 29 }; 30 31 } // namespace LIBC_NAMESPACE 32 33 #endif // LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_LINUX_EXTENSION_SIGNALS_H 34