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

  man pages->IRIX man pages -> standard/setgroups (2)              



NAME    [Toc]    [Back]

     setgroups - set group access list

SYNOPSIS    [Toc]    [Back]

     #include <sys/param.h>

     int setgroups(int ngroups,	gid_t *gidset);
     int setgroups(int ngroups,	int *gidset);

     To	use the	BSD version of setgroups, one must either

     1)	explicitly invoke it as	BSDsetgroups or

     2)	link with the libbsd.a library:

	  cc -o	prog prog.c -lbsd

DESCRIPTION    [Toc]    [Back]

     setgroups initializes the group access list of the	current	user process
     according to the array gidset.  The parameter ngroups indicates the
     number of entries in the array.  The sysconf(_SC_NGROUPS_MAX) system call
     may be used to determine at runtime the maximum allowable value for
     ngroups in	the particular kernel configuration (it	is an lbootable	value
     (ngroups_max) which is declared in	/var/sysgen/master.d/kernel).  If
     using the BSD version, ngroups may	never be greater than NGROUPS (as
     defined in	<sys/param.h>).

     Setting ngroups_max to zero and rebooting effectively disables multiplegroups
 system-wide.  In most cases, however, it will be set to a value
     between NGROUPS_UMIN and NGROUPS_UMAX (also defined in <sys/param.h>).

     Only the super-user may set new groups or alter the value of ngroups_max.

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 setgroups call	will fail if:

     [EPERM]	    The	caller is not the super-user.

     [EFAULT]	    The	address	specified for gidset is	outside	the process
		    address space.

     [EINVAL]	    The	ngroups	parameter is greater than NGROUPS or the
		    kernel maximum, as specified above.

									Page 1


SEE ALSO    [Toc]    [Back]

     multgrps(1), getgroups(2),	initgroups(3), sysconf(2)

CAVEATS    [Toc]    [Back]

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

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
getgroups HP-UX get group access list
getgroups NetBSD get group access list
getgroups OpenBSD get group access list
setgroups Tru64 Set the group access list
getgroups FreeBSD get group access list
initgroups IRIX initialize group access list
getgroups IRIX get supplementary group access list IDs
initgroups FreeBSD initialize group access list
getgrouplist NetBSD calculate group access list
getgrouplist OpenBSD calculate group access list
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service