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 39 of file pgstrsignal.c.

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

Referenced by log_child_failure(), LogChildExit(), pg_ctl_status(), shell_archive_file(), and wait_result_to_str().