unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (HP-UX-11.11)
Page:
Section:
Apropos / Subsearch:
optional field



 setgroups(2)							setgroups(2)




 NAME
      setgroups - set group access list

 SYNOPSIS
      #include <&lt&lt&lt;unistd.h>&gt&gt&gt;

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

 DESCRIPTION
      setgroups() sets 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 and must be no more than NGROUPS_MAX,
      as defined in <&lt&lt&lt;limits.h>&gt&gt&gt;.

      Only super-user can set new groups by adding to the group access list
      of the current user process; any user can delete groups from it.

 RETURN VALUE
      Upon successful completion, setgroups() returns 0; otherwise it
      returns -1 and sets errno to indicate the error.

 ERRORS
      setgroups() fails if any of the following conditions are encountered:

	   [EPERM]	  The caller is not super-user and has attempted to
			  set new groups.

	   [EFAULT]	  The address specified for gidset is outside the
			  process address space.  The reliable detection of
			  this error is implementation dependent.

	   [EINVAL]	  ngroups is greater than NGROUPS_MAX or not
			  positive.

	   [EINVAL]	  An entry in gidset is not a valid group ID.

 AUTHOR
      setgroups() was developed by the University of California, Berkeley.

 SEE ALSO
      getgroups(2), initgroups(3C).

 STANDARDS CONFORMANCE
      setgroups(): AES, SVID3










 Hewlett-Packard Company	    - 1 -   HP-UX Release 11i: November 2000