GETGRENT(S) XENIX System V GETGRENT(S)
Name
getgrent, getgrgid, getgrnam, setgrent, endgrent - Get group
file entry.
Syntax
#include <grp.h>
struct group *getgrent ( );
struct group *getgrgid (gid)
int gid;
struct group *getgrnam (name)
char *name;
int setgrent ( );
int endgrent ( );
Description
getgrent, getgrgid and getgrnam each return pointers. The
format of the structure is defined in /usr/include/grp.h.
The members of this structure are:
gr_name The name of the group.
gr_passwd The encrypted password of the group.
gr_gid The numerical group ID.
gr_mem Null-terminated vector of pointers to the
individual member names.
getgrent reads the next line of the file, so successive
calls may be used to search the entire file. getgrgid and
getgrnam search from the beginning of the file until a
matching gid or name is found, or end-of-file is
encountered.
A call to setgrent has the effect of rewinding the group
file to allow repeated searches. endgrent may be called to
close the group file when processing is complete.
Files
/etc/group
See Also
getlogin(S), getpwent(S), group(M)
Diagnostics
A null pointer (0) is returned on end-of-file or error.
Page 1 (printed 8/7/87)
GETGRENT(S) XENIX System V GETGRENT(S)
Notes
All information is contained in a static area, so it must be
copied if it is to be saved.
Page 2 (printed 8/7/87)