Expand description of return value.

Remove bug about incorrect sizing calculation; it seems to DTRT for me.
Also reference group(5).
This commit is contained in:
lukem 2004-09-28 10:49:22 +00:00
parent 3608f5c3e9
commit 159aa790f6
1 changed files with 10 additions and 12 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: getgrouplist.3,v 1.10 2003/08/07 16:42:49 agc Exp $
.\" $NetBSD: getgrouplist.3,v 1.11 2004/09/28 10:49:22 lukem Exp $
.\"
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -29,7 +29,7 @@
.\"
.\" @(#)getgrouplist.3 8.1 (Berkeley) 6/9/93
.\"
.Dd April 25, 1999
.Dd September 28, 2004
.Dt GETGROUPLIST 3
.Os
.Sh NAME
@ -67,9 +67,14 @@ Duplicate group ids will be suppressed from the result.
The
.Fn getgrouplist
function
returns 0 if successful, and
returns \-1 if the size of the group list is too small to
hold all the user's groups.
Here, the group array will be filled with as many groups as will fit.
In the latter case, the
.Fa groups
array will be filled with as many groups as will fit and
.Fa ngroups
will contain the total number of groups found.
.Sh FILES
.Bl -tag -width /etc/group -compact
.It Pa /etc/group
@ -77,7 +82,8 @@ group membership list
.El
.Sh SEE ALSO
.Xr setgroups 2 ,
.Xr initgroups 3
.Xr initgroups 3 ,
.Xr group 5 .
.Sh HISTORY
The
.Fn getgrouplist
@ -93,11 +99,3 @@ If the invoking program uses any of these routines,
the group structure will
be overwritten in the call to
.Fn getgrouplist .
.Pp
In the case where the group array is too small and duplicate gids
have been suppressed, the returned
.Fa ngroups
will be too large by a factor of the difference between the given
size and the number of matches.
This is not considered to be a major problem, since it's still going
to be a smaller figure than when duplicates were not suppressed.