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

  man pages->IRIX man pages -> standard/getgroups (2)              
Title
Content
Arch
Section
 

Contents


getgroups(2)							  getgroups(2)


NAME    [Toc]    [Back]

     getgroups - get supplementary group access	list IDs

SYNOPSIS    [Toc]    [Back]

     #include <unistd.h>

     int ngrps;

   POSIX:
     ngrps = getgroups(int setlen, gid_t *gidset);

   BSD:
     ngrps = getgroups(int setlen, int *gidset);

     To	use the	BSD version of getgroups one must either

     1)	explicitly invoke it as	BSDgetgroups or

     2)	link with the libbsd.a library:

	  cc -o	prog prog.c -lbsd

DESCRIPTION    [Toc]    [Back]

     getgroups retrieves the current group access list of the user process and
     stores it in the array gidset.  The parameter setlen indicates the	number
     of	entries	that may be placed in gidset.  The return value	is the actual
     number of groups placed in	gidset,	and this will never be greater than
     NGROUPS_UMAX for the POSIX	version, and NGROUPS for the BSD version, as
     defined in	<sys/param.h>.

     As	a special case,	if the setlen parameter	is zero, getgroups returns the
     number of supplemental group IDs associated with the calling process
     without modifying the array pointed to by the gidset argument.

RETURN VALUE    [Toc]    [Back]

     A successful call returns the number of groups in the group set.  A value
     of	-1 indicates that an error occurred, and the error code	is stored in
     the global	variable errno.

ERRORS    [Toc]    [Back]

     The possible errors for getgroups are:

     [EINVAL]	    The	argument setlen	is smaller than	the number of groups
		    in the group set.

     [EFAULT]	    The	argument gidset	specifies an invalid address.

SEE ALSO    [Toc]    [Back]

      
      
     multgrps(1), setgroups(2),	initgroups(3)





									Page 1






getgroups(2)							  getgroups(2)


CAVEATS    [Toc]    [Back]

     The POSIX and 4.3BSD versions differ in the types of their	gidset
     parameter.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
initgroups Linux initialize the supplementary group access list
getgroups Linux get/set list of supplementary group IDs
pxfgetgroups IRIX Gets supplementary group IDs
initgroups OpenBSD initialize supplementary group IDs
initgroups NetBSD initialize supplementary group IDs
getgroups Tru64 Get the supplementary group IDs of the current process
getgroups NetBSD get group access list
setgroups FreeBSD set group access list
setgroups Tru64 Set the group access list
setgroups OpenBSD set group access list
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service