#include <sys/types.h> #include <grp.h>
struct group *getgrgid(gid_t gid);
struct group *getgrnam(const char *name);
void setgrent(void);
struct group *getgrent(void);
void endgrent(void);
The group structure is defined in the header <grp.h> and includes the following members:
The value returned points to a static area. So if the information is to be saved, it must be copied.
The BSD routines setgrent, getgrent, and endgrent permit an application to scan the groups sequentially. setgrent resets the group file to the beginning, getgrent reads the next group entry, and endgrent closes the group file when processing is complete. Calls to getgrgid or getgrnam set the current location in the group file with respect to calls to getgrent.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97