getgroups(2) DG/UX 4.30 getgroups(2)
NAME
getgroups - Get group access list.
SYNOPSIS
#include <sys/param.h>
#include <sys/types.h>
int getgroups (gidsetlen, gidset)
int gidsetlen;
uid_t * gidset;
PARAMETERS
gidsetlen This argument specifies the maximum number of
group-ids that may be returned by this call
and may assume any integer value greater than
0.
gidset This argument specifies an array where the
groups-ids returned by this call may be
placed.
DESCRIPTION
Getgroups gets the group access list of the calling process
and stores it in the array <gidset>. The parameter
<gidsetlen> indicates the number of entries which may be
placed in <gidset>. The number of groups actually returned
(which will never be greater than NGROUPS) is the return
value of this call.
If the value of <gidsetlen> is less than the number of
entries in the calling process's group access list, an error
is returned and <gidset> is not modified.
The ordering of the group-ids in the <gidset> array upon
completion of this call is implementation dependent and
subject to change. Note that a non-empty group list will
always contain the real-group-id and that no value is in the
group list more than once.
ACCESS CONTROL
The argument <gidset> must point to an area of the calling
process's address space that is valid and which has read and
write access. The size of the <gidset> area must be large
enough for the input value of <gidsetlen> values even though
fewer may be returned.
RETURN VALUE
number of groups
The call succeeded. The group list was
returned in <gidset>.
Licensed material--property of copyright holder(s) Page 1
getgroups(2) DG/UX 4.30 getgroups(2)
-1 An error occurred. Errno is set to indicate
the error.
EXCEPTIONS
Errno may be set to one of the following error codes:
EFAULT The argument <gidset> specifies an invalid
area of the calling process's address space
or an area which does not have read/write
access.
EINVAL The value of <gidsetlen> is less than the
number of entries in the calling process's
group access list.
SEE ALSO
The related system call: setgroups.
Licensed material--property of copyright holder(s) Page 2