• Tom Lane's avatar
    Modernize our code for looking up descriptive strings for Unix signals. · a73d0831
    Tom Lane authored
    At least as far back as the 2008 spec, POSIX has defined strsignal(3)
    for looking up descriptive strings for signal numbers.  We hadn't gotten
    the word though, and were still using the crufty old sys_siglist array,
    which is in no standard even though most Unixen provide it.
    
    Aside from not being formally standards-compliant, this was just plain
    ugly because it involved #ifdef's at every place using the code.
    
    To eliminate the #ifdef's, create a portability function pg_strsignal,
    which wraps strsignal(3) if available and otherwise falls back to
    sys_siglist[] if available.  The set of Unixen with neither API is
    probably empty these days, but on any platform with neither, you'll
    just get "unrecognized signal".  All extant callers print the numeric
    signal number too, so no need to work harder than that.
    
    Along the way, upgrade pg_basebackup's child-error-exit reporting
    to match the rest of the system.
    
    Discussion: https://postgr.es/m/25758.1544983503@sss.pgh.pa.us
    a73d0831
pg_config.h.in 30 KB