Re: Why aren't we using strsignal(3) ?

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2018-12-16T20:04:59Z
Lists: pgsql-hackers
On 2018-Dec-16, Tom Lane wrote:

> I propose to replace all these places with code like
> 
>         snprintf(str, sizeof(str),
>                  _("child process was terminated by signal %d: %s"),
>                  WTERMSIG(exitstatus), pg_strsignal(WTERMSIG(exitstatus)));
> 
> where pg_strsignal is a trivial wrapper around strsignal() if that
> exists, else it uses sys_siglist[] if that exists, else it just
> returns "unrecognized signal".

LGTM.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Commits

  1. Drop support for getting signal descriptions from sys_siglist[].

  2. Modernize our code for looking up descriptive strings for Unix signals.