getgroups(2)

DESCRIPTION

Copies up to 16 supplementary group IDs into groups. A count of zero returns the number of groups without writing groups.

SYNOPSIS

long getgroups(int32_t count, uint32_t *groups);

RETURN VALUE

  • Returns the group count, or a negative errno.

ERRORS

  • -EINVAL
    • Count is negative or greater than 16.
  • -EFAULT
    • Groups is not writable for the returned IDs.
  • -ESRCH
    • There is no current process.

NOTES

The count and groups pointer are interpreted independently when count is zero.