delorie.com/djgpp/doc/libc/libc_396.html | search |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <grp.h> struct group *getgrent(void); |
This function returns the next available group entry. Note that for
MS-DOS, this is simulated. If the environment variable GROUP
is set,
that is the name of the only group returned, else the only group is
"dos". Thus, under DOS, getgrent
will always fail on the
second and subsequent calls.
The return type of this and related function is as follows:
struct group { gid_t gr_gid; /* result of getgid() */ char ** gr_mem; /* gr_mem[0] points to getenv("USER"/"LOGNAME") or "user" */ char * gr_name; /* getenv("GROUP") or "dos" */ char * gr_passwd; /* "" */ }; |
The next structure, or NULL
at the end of the list.
ANSI/ISO C | No |
POSIX | No |
struct group *g; setgrent(); while ((g = getgrent()) != NULL) { printf("group %s gid %d\n", g->gr_name, g->gr_gid); } endgrent(); |
webmaster | delorie software privacy |
Copyright © 2004 | Updated Apr 2004 |