1GETGROUPS(2)                  System Calls Manual                 GETGROUPS(2)
2
3
4

NAME

6       getgroups - get group access list
7

SYNOPSIS

9       #include <sys/param.h>
10
11       ngroups = getgroups(gidsetlen, gidset)
12       int ngroups, gidsetlen, *gidset;
13

DESCRIPTION

15       Getgroups  gets  the  current group access list of the user process and
16       stores it in the array gidset.  The parameter gidsetlen  indicates  the
17       number  of entries that may be placed in gidset.  Getgroups returns the
18       actual number of groups returned in gidset.  No more than  NGROUPS,  as
19       defined in <sys/param.h>, will ever be returned.
20

RETURN VALUE

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

ERRORS

27       The possible errors for getgroup are:
28
29       [EINVAL]       The  argument  gidsetlen  is  smaller than the number of
30                      groups in the group set.
31
32       [EFAULT]       The argument gidset specifies an invalid address.
33

SEE ALSO

35       setgroups(2), initgroups(3X)
36

BUGS

38       The gidset array should be of type gid_t, but remains integer for  com‐
39       patibility with earlier systems.
40
41
42
434.2 Berkeley Distribution        May 13, 1986                     GETGROUPS(2)
Impressum