getgrent(3C) DG/UX 5.4.2 getgrent(3C)
NAME
getgrent, getgrgid, getgrnam, setgrent, endgrent, fgetgrent - get
group file entry
SYNOPSIS
#include <grp.h>
struct group *getgrent(void)
struct group *getgrgid(gidt gid)
struct group *getgrnam(const char *name)
void setgrent(void)
void endgrent(void)
struct group *fgetgrent(FILE *f)
DESCRIPTION
getgrent, getgrgid, and getgrnam each return pointers to an object
with the following structure containing the broken-out fields of a
line in the group file.
struct group {
char *grname;
char *grpasswd;
gidt grgid;
char **grmem;
};
The members of this structure are:
grname The name of the group.
grpasswd The encrypted password of the group.
grgid The numerical group-ID.
grmem Null-terminated vector of pointers to the individual
member names.
getgrent simply reads the next line while getgrgid and getgrnam
search until a matching gid or name is found (or until EOF is
encountered). Each routine picks up where the others leave off so
successive calls may be used to search the entire file.
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.
fgetgrent returns a pointer to the next group structure in the stream
f, which must refer to an open file in the same format as the group
file /etc/group.
FILES
/etc/group
Licensed material--property of copyright holder(s) 1
getgrent(3C) DG/UX 5.4.2 getgrent(3C)
DIAGNOSTICS
A null pointer (0) is returned on EOF or error.
SEE ALSO
bcscat(1M), ypserv(1M), getlogin(3C), getpwent(3C), group(4).
BUGS
All information is contained in a static area, so it must be copied
if it is to be saved.
STANDARDS
When using m88kbcs as the Software Development Environment target,
the functions mentioned above will be implemented on top of the
bcscat command. Because of this, some performance degradation may
be noticed in comparison to using these routines in /lib/libc.a.
Licensed material--property of copyright holder(s) 2