svn commit: r218102 - stable/8/lib/libc/sys
Jilles Tjoelker
jilles at FreeBSD.org
Sun Jan 30 20:37:43 UTC 2011
Author: jilles
Date: Sun Jan 30 20:37:42 2011
New Revision: 218102
URL: http://svn.freebsd.org/changeset/base/218102
Log:
MFC r217704: getgroups(2): Remove <sys/types.h> and refer to sysconf(3).
Because {NGROUPS_MAX} may become variable, its value should be obtained
using sysconf(3).
In head, r217704 removed mention of <sys/param.h>; this was not mentioned in
stable/8.
Modified:
stable/8/lib/libc/sys/getgroups.2
Directory Properties:
stable/8/lib/libc/ (props changed)
stable/8/lib/libc/stdtime/ (props changed)
Modified: stable/8/lib/libc/sys/getgroups.2
==============================================================================
--- stable/8/lib/libc/sys/getgroups.2 Sun Jan 30 20:31:43 2011 (r218101)
+++ stable/8/lib/libc/sys/getgroups.2 Sun Jan 30 20:37:42 2011 (r218102)
@@ -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/types.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
More information about the svn-src-stable-8
mailing list