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 1heJrg-0001CK-Ly for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jun 2019 13:46:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1heJrf-00026h-It for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jun 2019 13:46:03 +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 1heJrf-00026U-AV for pgsql-hackers@lists.postgresql.org; Fri, 21 Jun 2019 13:46:03 +0000 Received: from ping.uio.no ([2001:700:100:570::196]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heJrV-0000lb-Rt for pgsql-hackers@postgresql.org; Fri, 21 Jun 2019 13:46:02 +0000 Received: from [2001:700:100:570::211] (helo=dalvik.ping.uio.no ident=Debian-exim) by ping.uio.no with esmtp (Exim 4.72 #1 (Debian)) id 1heJrQ-0004WS-12; Fri, 21 Jun 2019 15:45:50 +0200 Received: from ilmari by dalvik.ping.uio.no with local (Exim 4.84_2) (envelope-from ) id 1heJrP-0006xA-PO; Fri, 21 Jun 2019 15:45:47 +0200 From: ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) To: Tom Lane Cc: Peter Eisentraut , pgsql-hackers Subject: Re: using explicit_bzero References: <42d26bde-5d5b-c90d-87ae-6cab875f73be@2ndquadrant.com> <27860.1561123531@sss.pgh.pa.us> Mail-Copies-To: nobody Date: Fri, 21 Jun 2019 14:45:47 +0100 In-Reply-To: <27860.1561123531@sss.pgh.pa.us> (Tom Lane's message of "Fri, 21 Jun 2019 09:25:31 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Exiscan-Spam-Score: -3.7 (---) X-Exiscan-Spam-Report: SpamAssassin 3.3.1 (2010-03-16) on pike.ping.uio.no Score Rule * -5.0 PING_UIO_MAIL_IS_INTERNAL Message has never been outside * 129.240.0.0/16 or 193.157.115.0/24 * 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane writes: > Peter Eisentraut writes: >> +#ifndef HAVE_EXPLICIT_BZERO >> +#define explicit_bzero(b, len) bzero(b, len) >> +#endif > > This presumes that every platform has bzero, which is unsafe (POSIX > doesn't specify it) and is an assumption we kicked to the curb a dozen > years ago (067a5cdb3). Please use memset() for the substitute instead. > > Also, I'm a bit suspicious of using AC_CHECK_FUNCS for this; that > generally Doesn't Work for anything that's not a vanilla out-of-line > function. Are we worried about people implementing this as a macro, > compiler built-in, etc? Also, on Linux it requires libbsd: https://libbsd.freedesktop.org/ (which seems to be down, but https://packages.debian.org/buster/libbsd-dev has a list of the functions it provides). - ilmari -- "A disappointingly low fraction of the human race is, at any given time, on fire." - Stig Sandbeck Mathisen