unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OSF1-V5.1-alpha)
Page:
Section:
Apropos / Subsearch:
optional field



setgroups(2)							 setgroups(2)



NAME
  setgroups - Sets the group access list

SYNOPSIS

  #include <&lt;unistd.h>&gt;
  #include <&lt;sys/types.h>&gt;
  int setgroups	(
	  int gidsetsize,
	  gid_t	grouplist[] );

PARAMETERS

  gidsetsize
	    Indicates the number of entries in the array pointed to by the
	    grouplist parameter.  Must not be more than	NGROUPS_MAX, as
	    defined in the limits.h header file.

  grouplist Points to the array	that contains the group	access list of the
	    current user process.  Element grouplist[0]	becomes	the new
	    effective group ID.

DESCRIPTION

  The setgroups() function sets	the group access list of the current user
  process according to the array pointed to by the grouplist parameter.	 This
  function fails unless	the invoking process has superuser privilege.

NOTES

  AES Support Level:
		 Trial use

RETURN VALUES

  Upon successful completion, a	value of 0 (zero) is returned.	If the set-
  groups() function fails, a value of -1 is returned and errno is set to
  indicate the error.

ERRORS

  If the setgroups() function fails, errno may be set to one of	the following
  values:

  [EPERM]   The	caller does not	have the appropriate system privilege.

  [EINVAL]  The	value of the gidsetsize	parameter is greater than NGROUPS_MAX
	    or an entry	in the grouplist parameter is not a valid group	ID.

  [EFAULT]  The	grouplist parameter points outside of the allocated address
	    space of the process.


RELATED	INFORMATION

  Functions: getgroups(2), initgroups(3)