getgrent.3, getgrent_r.3, getgrnam.3: Refer reader for group(5) for more ino on group structure

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2010-10-21 11:52:05 +02:00
parent 7f12f11793
commit b39f3e059c
3 changed files with 38 additions and 25 deletions

View File

@ -25,7 +25,7 @@
.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\" 386BSD man pages .\" 386BSD man pages
.\" Modified Sat Jul 24 19:29:54 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Sat Jul 24 19:29:54 1993 by Rik Faith (faith@cs.unc.edu)
.TH GETGRENT 3 2010-09-20 "" "Linux Programmer's Manual" .TH GETGRENT 3 2010-10-21 "" "Linux Programmer's Manual"
.SH NAME .SH NAME
getgrent, setgrent, endgrent \- get group file entry getgrent, setgrent, endgrent \- get group file entry
.SH SYNOPSIS .SH SYNOPSIS
@ -98,6 +98,9 @@ struct group {
}; };
.fi .fi
.in .in
.PP
For more information about the fields of this structure, see
.BR group (5).
.SH "RETURN VALUE" .SH "RETURN VALUE"
The The
.BR getgrent () .BR getgrent ()
@ -155,4 +158,5 @@ SVr4, 4.3BSD, POSIX.1-2001.
.BR getgrgid (3), .BR getgrgid (3),
.BR getgrnam (3), .BR getgrnam (3),
.BR getgrouplist (3), .BR getgrouplist (3),
.BR putgrent (3) .BR putgrent (3),
.BR group (5)

View File

@ -20,7 +20,7 @@
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA. .\" USA.
.\" .\"
.TH GETGRENT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" .TH GETGRENT_R 3 2010-10-21 "GNU" "Linux Programmer's Manual"
.SH NAME .SH NAME
getgrent_r, fgetgrent_r \- get group file entry reentrantly getgrent_r, fgetgrent_r \- get group file entry reentrantly
.SH SYNOPSIS .SH SYNOPSIS
@ -75,7 +75,10 @@ struct group {
}; };
.fi .fi
.in .in
.sp .PP
For more information about the fields of this structure, see
.BR group (5).
.PP
The nonreentrant functions return a pointer to static storage, The nonreentrant functions return a pointer to static storage,
where this static storage contains further pointers to group where this static storage contains further pointers to group
name, password and members. name, password and members.

View File

@ -28,7 +28,7 @@
.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
.\" Modified 2003-11-15 by aeb .\" Modified 2003-11-15 by aeb
.\" .\"
.TH GETGRNAM 3 2009-03-30 "" "Linux Programmer's Manual" .TH GETGRNAM 3 2010-10-21 "" "Linux Programmer's Manual"
.SH NAME .SH NAME
getgrnam, getgrnam_r, getgrgid, getgrgid_r \- get group file entry getgrnam, getgrnam_r, getgrgid, getgrgid_r \- get group file entry
.SH SYNOPSIS .SH SYNOPSIS
@ -80,26 +80,6 @@ the broken-out fields of the record in the group database
that matches the group ID that matches the group ID
.IR gid . .IR gid .
.PP .PP
The
.BR getgrnam_r ()
and
.BR getgrgid_r ()
functions obtain the same information, but store the retrieved
.I group
structure
in the space pointed to by
.IR grp .
This
.I group
structure contains pointers to strings, and these strings
are stored in the buffer
.I buf
of size
.IR buflen .
A pointer to the result (in case of success) or NULL (in case no entry
was found or an error occurred) is stored in
.IR *result .
.PP
The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows: The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows:
.sp .sp
.in +4n .in +4n
@ -113,6 +93,32 @@ struct group {
.fi .fi
.in .in
.PP .PP
For more information about the fields of this structure, see
.BR group (5).
.PP
The
.BR getgrnam_r ()
and
.BR getgrgid_r ()
functions obtain the same information as
.BR getgrnam ()
and
.BR getgrgid (),
but store the retrieved
.I group
structure
in the space pointed to by
.IR grp .
The string fields pointed to by the members of the
.I group
structure are stored in the buffer
.I buf
of size
.IR buflen .
A pointer to the result (in case of success) or NULL (in case no entry
was found or an error occurred) is stored in
.IR *result .
.PP
The maximum needed size for The maximum needed size for
.I buf .I buf
can be found using can be found using