1: /* @(#)getgrnam.c 2.1 SCCS id keyword */ 2: #include <grp.h> 3: 4: struct group * 5: getgrnam(name) 6: register char *name; 7: { 8: register struct group *p; 9: struct group *getgrent(); 10: 11: setgrent(); 12: while( (p = getgrent()) && strcmp(p->gr_name,name) ); 13: endgrent(); 14: return(p); 15: }