GETGRENTSection: Linux Programmer's Manual (3)Updated: 1993-04-04 |
GETGRENTSection: Linux Programmer's Manual (3)Updated: 1993-04-04 |
#include <sys/types.h> #include <grp.h> struct group *getgrent(void); void setgrent(void); void endgrent(void);
The setgrent() function rewinds the file pointer to the beginning of the /etc/group file.
The endgrent() function closes the /etc/group file.
The group structure is defined in <grp.h> as follows:
struct group {
char *gr_name; /* group name */
char *gr_passwd; /* group password */
gid_t gr_gid; /* group id */
char **gr_mem; /* group members */
};
Upon error, errno may be set. If you want to check its value, set it to zero before the call.