PostgreSQL Source Code  git master
pgstrsignal.c File Reference
#include "c.h"
Include dependency graph for pgstrsignal.c:

Go to the source code of this file.

Functions

const char * pg_strsignal (int signum)
 

Function Documentation

◆ pg_strsignal()

const char* pg_strsignal ( int  signum)

Definition at line 42 of file pgstrsignal.c.

Referenced by log_child_failure(), LogChildExit(), pgarch_archiveXlog(), and wait_result_to_str().

43 {
44  const char *result;
45 
46  /*
47  * If we have strsignal(3), use that --- but check its result for NULL.
48  */
49 #ifdef HAVE_STRSIGNAL
50  result = strsignal(signum);
51  if (result == NULL)
52  result = "unrecognized signal";
53 #else
54 
55  /*
56  * We used to have code here to try to use sys_siglist[] if available.
57  * However, it seems that all platforms with sys_siglist[] have also had
58  * strsignal() for many years now, so that was just a waste of code.
59  */
60  result = "(signal names not available on this platform)";
61 #endif
62 
63  return result;
64 }