docs/65530: minor improvement to getgrent.3

Mikhail Teterin mi at aldan.algebra.com
Wed Apr 14 16:20:13 UTC 2004


>Number:         65530
>Category:       docs
>Synopsis:       minor improvement to getgrent.3
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 14 09:20:12 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Mikhail Teterin
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
Virtual Estates, Inc.
>Environment:

>Description:

	The man-page for getgrent and friends gives the layout of the
	``struct group'', but does not explicitly mention, that the list
	of group members in the gr_mem is NULL terminated.

	Since there is nothing like "gr_mem_len" anywhere, the NULL
	termination can be deduced, but explicitly documenting it
	would be useful. For example, the

	http://www.cs.vu.nl/pub/minix/2.0.0/wwwman/man3/getgrent.3.html

	offers Minix' man-page, where the gr_mem is explicitly documented
	to be NULL-terminated.

	In fact, ours was too:

	----------------------------
	revision 1.5
	date: 1996/06/20 14:13:15;  author: jmacd;  state: Exp;  lines: +2 -2
	branches:  1.5.2;
	I hate to read a man page that almost has useful information
	but falls a little short.  I added a comment on the null
	termination of struct group's gr_mem field.

	Reviewed by:    jkh
	----------------------------

	but was removed for some reason in 1.8 -- probably a
	branch/trunk misunderstanding with 1.8 overwriting the
	changes in 1.5.2...

	----------------------------
	revision 1.8
	date: 1997/01/30 23:01:47;  author: mpp;  state: Exp;  lines: +2 -2
	Update to reflect current include files.
	----------------------------


>How-To-Repeat:

>Fix:

	The exact verbiage is, probably, not important. jmacd's version
	and the Minix link above use word "null". I think, "NULL" is better,
	but don't have a strong opinion: 

===================================================================
RCS file: /home/ncvs/src/lib/libc/gen/getgrent.3,v
retrieving revision 1.23
diff -U2 -r1.23 getgrent.3
--- getgrent.3	8 Sep 2003 19:57:14 -0000	1.23
+++ getgrent.3	14 Apr 2004 16:09:58 -0000
@@ -85,5 +85,5 @@
 	char	*gr_passwd;	/* group password */
 	gid_t	gr_gid;		/* group id */
-	char	**gr_mem;	/* group members */
+	char	**gr_mem;	/* NULL-terminated list of group members */
 };
 .Ed
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list