From owner-svn-src-head@FreeBSD.ORG Fri Jan 21 22:15:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BACEA106566C; Fri, 21 Jan 2011 22:15:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9A298FC14; Fri, 21 Jan 2011 22:15:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LMFHVV069577; Fri, 21 Jan 2011 22:15:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LMFHY0069575; Fri, 21 Jan 2011 22:15:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101212215.p0LMFHY0069575@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 21 Jan 2011 22:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217704 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 22:15:17 -0000 Author: jilles Date: Fri Jan 21 22:15:17 2011 New Revision: 217704 URL: http://svn.freebsd.org/changeset/base/217704 Log: getgroups(2): Remove mention of and refer to sysconf(3). Because {NGROUPS_MAX} may become variable, its value should be obtained using sysconf(3). If a #define is used anyway, it should be obtained by including as that is in POSIX like getgroups(2) itself is. is not in POSIX. MFC after: 1 week Modified: head/lib/libc/sys/getgroups.2 Modified: head/lib/libc/sys/getgroups.2 ============================================================================== --- head/lib/libc/sys/getgroups.2 Fri Jan 21 22:00:40 2011 (r217703) +++ head/lib/libc/sys/getgroups.2 Fri Jan 21 22:15:17 2011 (r217704) @@ -28,7 +28,7 @@ .\" @(#)getgroups.2 8.2 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd March 5, 1999 +.Dd January 21, 2011 .Dt GETGROUPS 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/param.h .In unistd.h .Ft int .Fn getgroups "int gidsetlen" "gid_t *gidset" @@ -66,6 +65,12 @@ is zero, returns the number of supplementary group IDs associated with the calling process without modifying the array pointed to by .Fa gidset . +.Pp +The value of +.Dv {NGROUPS_MAX} +should be obtained using +.Xr sysconf 3 +to avoid hard-coding it into the executable. .Sh RETURN VALUES A successful call returns the number of groups in the group set. A value of -1 indicates that an error occurred, and the error @@ -88,7 +93,8 @@ an invalid address. .El .Sh SEE ALSO .Xr setgroups 2 , -.Xr initgroups 3 +.Xr initgroups 3 , +.Xr sysconf 3 .Sh STANDARDS The .Fn getgroups