*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> getgrent (3)              



NAME    [Toc]    [Back]

       getgrent, setgrent, endgrent - get group file entry

SYNOPSIS    [Toc]    [Back]

       #include <grp.h>
       #include <sys/types.h>

       struct group *getgrent(void);

       void setgrent(void);

       void endgrent(void);

DESCRIPTION    [Toc]    [Back]

       The getgrent() function returns a pointer to a structure containing the
       group information from /etc/group.  The first  time  it	is  called  it
       returns the first entry; thereafter, it returns successive entries.

       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 */

RETURN VALUE    [Toc]    [Back]

       The getgrent() function returns the  group  information	structure,  or
       NULL if there are no more entries or an error occurs.

ERRORS    [Toc]    [Back]

       ENOMEM Insufficient memory to allocate group information structure.

FILES    [Toc]    [Back]

	       group database file

CONFORMING TO    [Toc]    [Back]

       SVID 3, BSD 4.3

SEE ALSO    [Toc]    [Back]

       fgetgrent(3), getgrnam(3), getgrgid(3)

GNU				  1993-04-04			   GETGRENT(3)
[ Back ]
 Similar pages
Name OS Title
rpccp_add_member HP-UX Adds a member to a group in a name service entry; if the specified entry does not exist, creates the entry
rpccp_remove_group HP-UX Removes all group members and the group from the specified name service entry
setnetgrent Tru64 Get network group entry
endnetgrent Tru64 Get network group entry
getnetgrent IRIX get NIS network group entry
getnetgrent Tru64 Get network group entry
innetgr Tru64 Get network group entry
dcecp_rpcgroup HP-UX A dcecp object that manages an RPC group entry in CDS
ftpgroups HP-UX group password file for use with the SITE GROUP and SITE GPASS commands.
rpccp_add_element HP-UX Adds an element to a profile in a name service entry; if the specified entry does not exist, creates the entry
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service