Skip to content

Commit

Permalink
fix: add marco to test SIGSTKFLT
Browse files Browse the repository at this point in the history
Signed-off-by: ComixHe <[email protected]>
  • Loading branch information
ComixHe authored and dengbo11 committed Feb 21, 2025
1 parent 0ad39c8 commit 959ce46
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions apps/ll-box/src/util/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,21 @@ int strToSig(std::string_view str) noexcept
{
// Only support standard signals for now, maybe support real-time signal in the future
static const std::unordered_map<std::string_view, int> sigMap{
{ "SIGABRT", SIGABRT }, { "SIGALRM", SIGALRM }, { "SIGBUS", SIGBUS },
{ "SIGCHLD", SIGCHLD }, { "SIGCONT", SIGCONT }, { "SIGFPE", SIGFPE },
{ "SIGHUP", SIGHUP }, { "SIGILL", SIGILL }, { "SIGINT", SIGINT },
{ "SIGKILL", SIGKILL }, { "SIGPIPE", SIGPIPE }, { "SIGPOLL", SIGPOLL },
{ "SIGPROF", SIGPROF }, { "SIGPWR", SIGPWR }, { "SIGQUIT", SIGQUIT },
{ "SIGSEGV", SIGSEGV }, { "SIGSTOP", SIGSTOP }, { "SIGSYS", SIGSYS },
{ "SIGTERM", SIGTERM }, { "SIGTRAP", SIGTRAP }, { "SIGTSTP", SIGTSTP },
{ "SIGTTIN", SIGTTIN }, { "SIGTTOU", SIGTTOU }, { "SIGURG", SIGURG },
{ "SIGUSR1", SIGUSR1 }, { "SIGUSR2", SIGUSR2 }, { "SIGVTALRM", SIGVTALRM },
{ "SIGWINCH", SIGWINCH }, { "SIGXCPU", SIGXCPU }, { "SIGXFSZ", SIGXFSZ },
{ "SIGIO", SIGIO }, { "SIGSTKFLT", SIGSTKFLT }, { "SIGIOT", SIGIOT },
{ "SIGCLD", SIGCLD },
{ "SIGABRT", SIGABRT }, { "SIGALRM", SIGALRM }, { "SIGBUS", SIGBUS },
{ "SIGCHLD", SIGCHLD }, { "SIGCONT", SIGCONT }, { "SIGFPE", SIGFPE },
{ "SIGHUP", SIGHUP }, { "SIGILL", SIGILL }, { "SIGINT", SIGINT },
{ "SIGKILL", SIGKILL }, { "SIGPIPE", SIGPIPE }, { "SIGPOLL", SIGPOLL },
{ "SIGPROF", SIGPROF }, { "SIGPWR", SIGPWR }, { "SIGQUIT", SIGQUIT },
{ "SIGSEGV", SIGSEGV }, { "SIGSTOP", SIGSTOP }, { "SIGSYS", SIGSYS },
{ "SIGTERM", SIGTERM }, { "SIGTRAP", SIGTRAP }, { "SIGTSTP", SIGTSTP },
{ "SIGTTIN", SIGTTIN }, { "SIGTTOU", SIGTTOU }, { "SIGURG", SIGURG },
{ "SIGUSR1", SIGUSR1 }, { "SIGUSR2", SIGUSR2 }, { "SIGVTALRM", SIGVTALRM },
{ "SIGWINCH", SIGWINCH }, { "SIGXCPU", SIGXCPU }, { "SIGXFSZ", SIGXFSZ },
{ "SIGIO", SIGIO }, { "SIGIOT", SIGIOT }, { "SIGCLD", SIGCLD },
// this signal is not available on sw64
#ifdef SIGSTKFLT
{ "SIGSTKFLT", SIGSTKFLT },
#endif
};

auto it = sigMap.find(str);
Expand Down

0 comments on commit 959ce46

Please sign in to comment.