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

  man pages->Linux man pages -> getgrnam (3)              
Title
Content
Arch
Section
 

GETGRNAM(3)

Contents


NAME    [Toc]    [Back]

       getgrnam, getgrgid - get group file entry

SYNOPSIS    [Toc]    [Back]

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

       struct group *getgrnam(const char *name);

       struct group *getgrgid(gid_t gid);

DESCRIPTION    [Toc]    [Back]

       The getgrnam() function returns a pointer to a structure containing the
       group information from /etc/group for the entry that matches the  group
       name name.

       The getgrgid() function returns a pointer to a structure containing the
       group information from /etc/group for the entry that matches the  group
       gid gid.

       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  getgrnam()	and  getgrgid() functions return the group information
       structure, or NULL if the matching entry  is  not  found  or  an  error
       occurs.

ERRORS    [Toc]    [Back]

       ENOMEM Insufficient memory to allocate group information structure.

FILES    [Toc]    [Back]

       /etc/group
	      Group database file

CONFORMING TO    [Toc]    [Back]

       SVID 3, POSIX, BSD 4.3

SEE ALSO    [Toc]    [Back]

      
      
       fgetgrent(3), getgrent(3), setgrent(3), endgrent(3)



GNU				  1993-04-04			   GETGRNAM(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