xref: /csrg-svn/lib/libc/gen/getgrgid.c (revision 26556)
1*26556Sdonn #if defined(LIBC_SCCS) && !defined(lint)
2*26556Sdonn static char sccsid[] = "@(#)getgrgid.c	5.2 (Berkeley) 03/09/86";
3*26556Sdonn #endif LIBC_SCCS and not lint
422092Smckusick 
52015Swnj #include <grp.h>
62015Swnj 
72015Swnj struct group *
getgrgid(gid)82015Swnj getgrgid(gid)
92015Swnj register gid;
102015Swnj {
112015Swnj 	register struct group *p;
122015Swnj 	struct group *getgrent();
132015Swnj 
142015Swnj 	setgrent();
152015Swnj 	while( (p = getgrent()) && p->gr_gid != gid );
162015Swnj 	endgrent();
172015Swnj 	return(p);
182015Swnj }
19