Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e21HL-0004kd-7A for pgsql-committers@arkaria.postgresql.org; Tue, 10 Oct 2017 20:37:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e21HK-0002QR-QL for pgsql-committers@arkaria.postgresql.org; Tue, 10 Oct 2017 20:37:26 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e21H5-0001vt-MX for pgsql-committers@postgresql.org; Tue, 10 Oct 2017 20:37:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e21H2-0004iV-U2 for pgsql-committers@postgresql.org; Tue, 10 Oct 2017 20:37:11 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v9AKb4cO021089; Tue, 10 Oct 2017 16:37:04 -0400 From: Tom Lane To: Andres Freund cc: Andrew Dunstan , pgsql-committers@postgresql.org Subject: Re: pgsql: Add pg_strnlen() a portable implementation of strlen. In-reply-to: <20171010194818.p2hhod32ezmvhryb@alap3.anarazel.de> References: <20171009231509.nlptgdrtg2au6frn@alap3.anarazel.de> <44745881-6095-e3ba-e8eb-23b1d92bffab@dunslane.net> <20171010194818.p2hhod32ezmvhryb@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 10 Oct 2017 12:48:18 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21087.1507667824.1@sss.pgh.pa.us> Date: Tue, 10 Oct 2017 16:37:04 -0400 Message-ID: <21088.1507667824@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Andres Freund writes: > (there's definitely fixes to be made to where strnlen's replacement is > located, but regardless, this needs to be fixed too) Given that strnlen is standardized by POSIX, and has been for nigh a decade, I think it'd be all right for us to treat it as a straight port replacement function, a la strlcpy() for instance. That is, forget the pg_ prefix and just create a strnlen() function if the platform has not got it. regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers