0

I have a signal handler in my program that looks like this:

void signalHandler(int sig)
{
    BOOST_LOG_SEV(logger, fatal) << "Received signal " << sig;
    gQuit = true;
}

Currently this produces output like this:

Received signal 2

But what I would like to see is something like

Received signal SIGINT

I could probably replace the output of sig with strsignal(sig), which should work on POSIX.1-2008 systems. This solution was discussed in this SO question:

Signal number to name?

However, in my case I'd like to avoid the introduction of platform-specific code.

Do boost or the Standard Library provide a solution to this problem?

Community
  • 1
  • 1
quant
  • 21,507
  • 32
  • 115
  • 211

1 Answers1

0

Well it's hard to prove a negative but I didn't find anything online and haven't got an answer, so I think it's;

No

quant
  • 21,507
  • 32
  • 115
  • 211