From owner-svn-src-projects@FreeBSD.ORG Tue Jun 9 04:58:16 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AF1E106567E; Tue, 9 Jun 2009 04:58:16 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F65C8FC15; Tue, 9 Jun 2009 04:58:16 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n594wGYn056206; Tue, 9 Jun 2009 04:58:16 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n594wGZk056204; Tue, 9 Jun 2009 04:58:16 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200906090458.n594wGZk056204@svn.freebsd.org> From: Brooks Davis Date: Tue, 9 Jun 2009 04:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193806 - projects/ngroups/sys/sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2009 04:58:16 -0000 Author: brooks Date: Tue Jun 9 04:58:15 2009 New Revision: 193806 URL: http://svn.freebsd.org/changeset/base/193806 Log: Set NGROUPS_MAX to be 1023 since it should be the number of _supplemental_ groups and thus getgroups() should return up to NGROUPS_MAX+1 results on FreeBSD (ignoring for the moment the fact that NGROUPS_MAX isn't actually a maximum value under POSIX). This limits waste in naive applications to a single page. Set NGROUPS to NGROUPS_MAX+1 to properly reflect the in-kernel space requirements. Modified: projects/ngroups/sys/sys/param.h projects/ngroups/sys/sys/syslimits.h Modified: projects/ngroups/sys/sys/param.h ============================================================================== --- projects/ngroups/sys/sys/param.h Tue Jun 9 04:39:47 2009 (r193805) +++ projects/ngroups/sys/sys/param.h Tue Jun 9 04:58:15 2009 (r193806) @@ -77,7 +77,7 @@ #define MAXLOGNAME 17 /* max login name length (incl. NUL) */ #define MAXUPRC CHILD_MAX /* max simultaneous processes */ #define NCARGS ARG_MAX /* max bytes for an exec function */ -#define NGROUPS NGROUPS_MAX /* max number groups */ +#define NGROUPS NGROUPS_MAX+1 /* max number groups */ #define NOFILE OPEN_MAX /* max open files per process */ #define NOGROUP 65535 /* marker for empty group set member */ #define MAXHOSTNAMELEN 256 /* max hostname size */ Modified: projects/ngroups/sys/sys/syslimits.h ============================================================================== --- projects/ngroups/sys/sys/syslimits.h Tue Jun 9 04:39:47 2009 (r193805) +++ projects/ngroups/sys/sys/syslimits.h Tue Jun 9 04:58:15 2009 (r193806) @@ -54,7 +54,9 @@ #define MAX_CANON 255 /* max bytes in term canon input line */ #define MAX_INPUT 255 /* max bytes in terminal input */ #define NAME_MAX 255 /* max bytes in a file name */ -#define NGROUPS_MAX 32767 /* max supplemental group id's */ +#ifndef NGROUPS_MAX +#define NGROUPS_MAX 1023 /* max supplemental group id's */ +#endif #ifndef OPEN_MAX #define OPEN_MAX 64 /* max open files per process */ #endif