Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gYcf1-0002dY-07 for pgsql-hackers@arkaria.postgresql.org; Sun, 16 Dec 2018 20:05:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gYcez-0000DS-HI for pgsql-hackers@arkaria.postgresql.org; Sun, 16 Dec 2018 20:05:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gYcez-0000DL-AY for pgsql-hackers@lists.postgresql.org; Sun, 16 Dec 2018 20:05:09 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gYcew-0007Qt-Fr for pgsql-hackers@lists.postgresql.org; Sun, 16 Dec 2018 20:05:08 +0000 Received: by mail-qk1-x743.google.com with SMTP id y16so6212099qki.7 for ; Sun, 16 Dec 2018 12:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=0RDVDmXPPmh8O7ogvPv23jwHA5vEw4K0FdKl/REEJAc=; b=D1nXFbMlXjEuFz1CVR4IRJ4qXdzvUGIrGLc5WRqjTWaDp1+H5gi4Ft8tsXzILJ8+Q2 6CD4QRjF+aRfYNSFkezUZtOg5Mm8oBzs/Bv0mRouEeNIlKjsnLQPhrKcaLIPWmY6pJfV TMfkPYb+3BALeRim97KYCM151obbZm6HW7d8MfWYFR7aj7P35xc7+5OcbgreUVsK1zp8 IwtMelhCmjsjvBe8Xvjr6ctvMzJ7tHrFUsn2ABnJ1b8IUUXshn089TkHZljNe+Q549sY /+z0GS567V4ga2mCvniFqfWp6AEWd3b1R9Uv1Gn/KY4H+Cg8+D+2DkiGnp5oVFFqViSS Rm6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=0RDVDmXPPmh8O7ogvPv23jwHA5vEw4K0FdKl/REEJAc=; b=fTeodrnfX/n6HR4SFLPJIN5VWjrReZfXBrLuJZGKQTQaYZRdD/AoeLMcwc9Yo4XOqC lz+DjjWsVkVc/jx/sGaNEpCyzQ+LUwmV9X6Zt0JTou9+oiFnPrwjUVhJZ/v4rFJN4Tfh WMKe0O4vYd+UPom/L2uiiR4k+m6fCYesARdaNWS6t3HnAo15dyqHTq3rs9SaMsNT8i1G 738AgNS4QKZa865YvICnTUb5ti94fzPn4Cj0aishcwUa2zYdbLWJff6wgQ0DBOFLSdx/ VZvxpwc/aAMkso8LSKJEj9NYFrEJ1VvdQWDW+BSvoEfr4Uwfm1CXGsowkF/UXZ34NxHG bGUQ== X-Gm-Message-State: AA+aEWaAU4VgM8U114ZdCHfNX9nZlIKyMw+8Ixy5w8GfguSPcXiPj1E4 UyFfl4UqeL4k5MvDGCurLn9rCDpq4aANe9P0ahbOHIl4gUgOw3cfv/KSkrEprtoDqjaAHoj01+u VQi+6lCyzeCqKJZlJZQ9GqRLlGuJ8uKVKGa9ntQYcempNffmi9SABhmIIlLkLG5PBLjdns+fMwi wK6v2kWHm4WOBk9A== X-Google-Smtp-Source: AFSGD/X4YdpZlgn9kqf4qtZGurnGkU1rZT5ckP4cW1LS2VBPT20qTZpgbaaQvfFzk8xF5yQCnysSNw== X-Received: by 2002:a37:4a87:: with SMTP id x129mr9895265qka.142.1544990703531; Sun, 16 Dec 2018 12:05:03 -0800 (PST) Received: from alvin.alvh.no-ip.org ([179.57.110.234]) by smtp.gmail.com with ESMTPSA id a185sm5888729qkb.1.2018.12.16.12.05.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Dec 2018 12:05:02 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id BE3F56FB; Sun, 16 Dec 2018 17:04:59 -0300 (-03) Date: Sun, 16 Dec 2018 17:04:59 -0300 From: Alvaro Herrera To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Why aren't we using strsignal(3) ? Message-ID: <20181216200459.yd6dmgaz4m57s6dv@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <25758.1544983503@sss.pgh.pa.us> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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