35 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_LINUX_EXTENSION_SIGNALS_H10#define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_LINUX_EXTENSION_SIGNALS_H11 12#include "src/__support/StringUtil/message_mapper.h"13#include "src/__support/macros/config.h"14 15#include <signal.h> // For signal numbers16 17namespace LIBC_NAMESPACE_DECL {18 19// The array being larger than necessary isn't a problem. The MsgMappings will20// be set to their default state which maps 0 to an empty string. This will get21// filtered out in the MessageMapper building stage.22LIBC_INLINE_VAR constexpr const MsgTable<3> LINUX_SIGNALS = {23#ifdef SIGSTKFLT24 MsgMapping(SIGSTKFLT, "Stack fault"), // unused25#endif26 MsgMapping(SIGWINCH, "Window changed"),27#ifdef SIGPWR28 MsgMapping(SIGPWR, "Power failure"), // ignored29#endif30};31 32} // namespace LIBC_NAMESPACE_DECL33 34#endif // LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_LINUX_EXTENSION_SIGNALS_H35