From b006e083a0e5b486e8f78786e4933a3e9696da7e Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 7 Nov 2008 16:01:18 -0500 Subject: [PATCH] getgrnam.3: Clarify RETURN VALUE description The page was a bit fuzzy in describing the return values for various cases. In particular, it needed to be more explicit in describing what happens for the "not found" case. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504708 Signed-off-by: Michael Kerrisk Reported-by: Andreas Henriksson --- man3/getgrnam.3 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/man3/getgrnam.3 b/man3/getgrnam.3 index 030cd14ce..dfd47029e 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 2008-08-29 "" "Linux Programmer's Manual" +.TH GETGRNAM 3 2008-11-07 "" "Linux Programmer's Manual" .SH NAME getgrnam, getgrnam_r, getgrgid, getgrgid_r \- get group file entry .SH SYNOPSIS @@ -140,13 +140,19 @@ by subsequent calls to or .BR getgrnam (). .LP -The +On sucess, .BR getgrnam_r () and .BR getgrgid_r () -functions return -zero on success. -In case of error, an error number is returned. +return zero, and set +.IR *gbufp +to +.IR gbuf . +If no matching group record was found, +these functions return 0 and store NULL in +.IR *gbufp . +In case of error, an error number is returned, and NULL is stored in +.IR *gbufp . .SH ERRORS .TP .BR 0 " or " ENOENT " or " ESRCH " or " EBADF " or " EPERM " or ... "