From owner-svn-src-all@freebsd.org Thu Oct 4 21:55:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B388710BBF70; Thu, 4 Oct 2018 21:55:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6747E86B5C; Thu, 4 Oct 2018 21:55:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6249644FE; Thu, 4 Oct 2018 21:55:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w94Ltxwf096298; Thu, 4 Oct 2018 21:55:59 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w94LtxEN096297; Thu, 4 Oct 2018 21:55:59 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201810042155.w94LtxEN096297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 4 Oct 2018 21:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339184 - head/include X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 339184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Oct 2018 21:55:59 -0000 Author: brooks Date: Thu Oct 4 21:55:58 2018 New Revision: 339184 URL: https://svnweb.freebsd.org/changeset/base/339184 Log: Reduce NL_ARGMAX to 4096 to match Linux. NL_ARGMAX is the maximum number of positional arguments supported by printf(3). Prior to r308145 it was declared as 99 and not enforced. r308145 added enforcement and increased the value to 64k. Unfortunately, development versions of PostgreSQL used the system definition to allocate and zero an NL_ARGMAX * 4 sized array on the stack of its snprintf implementation with measurable performance impacts. This has been fixed in new PostgreSQL versions, but it is possible that other programs suffer from this problem. A value of 4096 puts us on par with Linux and is certainly large enough for any reasonable program. Reviewed by: mjg Reported by: mjg Approved by: re (gjb) Differential revision: https://reviews.freebsd.org/D17387 Differential revision: https://reviews.freebsd.org/D8286 Modified: head/include/limits.h Modified: head/include/limits.h ============================================================================== --- head/include/limits.h Thu Oct 4 20:01:48 2018 (r339183) +++ head/include/limits.h Thu Oct 4 21:55:58 2018 (r339184) @@ -122,7 +122,7 @@ #endif #if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809 -#define NL_ARGMAX 65536 /* max # of position args for printf */ +#define NL_ARGMAX 4096 /* max # of position args for printf */ #define NL_MSGMAX 32767 #define NL_SETMAX 255 #define NL_TEXTMAX 2048