From b39f3e059c5772f79dcf6dc7442ce65a72f427f4 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 21 Oct 2010 11:52:05 +0200 Subject: [PATCH] getgrent.3, getgrent_r.3, getgrnam.3: Refer reader for group(5) for more ino on group structure Signed-off-by: Michael Kerrisk --- man3/getgrent.3 | 8 ++++++-- man3/getgrent_r.3 | 7 +++++-- man3/getgrnam.3 | 48 ++++++++++++++++++++++++++--------------------- 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/man3/getgrent.3 b/man3/getgrent.3 index 9ae1b05a7..956b7fab2 100644 --- a/man3/getgrent.3 +++ b/man3/getgrent.3 @@ -25,7 +25,7 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" 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 getgrent, setgrent, endgrent \- get group file entry .SH SYNOPSIS @@ -98,6 +98,9 @@ struct group { }; .fi .in +.PP +For more information about the fields of this structure, see +.BR group (5). .SH "RETURN VALUE" The .BR getgrent () @@ -155,4 +158,5 @@ SVr4, 4.3BSD, POSIX.1-2001. .BR getgrgid (3), .BR getgrnam (3), .BR getgrouplist (3), -.BR putgrent (3) +.BR putgrent (3), +.BR group (5) diff --git a/man3/getgrent_r.3 b/man3/getgrent_r.3 index 974656689..87d7a8615 100644 --- a/man3/getgrent_r.3 +++ b/man3/getgrent_r.3 @@ -20,7 +20,7 @@ .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" 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 getgrent_r, fgetgrent_r \- get group file entry reentrantly .SH SYNOPSIS @@ -75,7 +75,10 @@ struct group { }; .fi .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, where this static storage contains further pointers to group name, password and members. diff --git a/man3/getgrnam.3 b/man3/getgrnam.3 index 6410839e0..e4afa3e09 100644 --- a/man3/getgrnam.3 +++ b/man3/getgrnam.3 @@ -28,7 +28,7 @@ .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" 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 getgrnam, getgrnam_r, getgrgid, getgrgid_r \- get group file entry .SH SYNOPSIS @@ -80,26 +80,6 @@ the broken-out fields of the record in the group database that matches the group ID .IR gid . .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\fP as follows: .sp .in +4n @@ -113,6 +93,32 @@ struct group { .fi .in .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 .I buf can be found using