HPlogo MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 4  POSIX/iX Library Function Descriptions

getgroups

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Gets Supplementary Group IDs.

Syntax

   #include <sys/types.h>

   int getgroups (int *gidsetsize, gid_t grouplist[]); 

Parameters

gidsetsize

The number of elements in the grouplist array.

grouplist

An array containing the supplementary group IDs of the calling process.

Return Values

Upon successful completion, the number of supplementary group IDs is returned. This value is zero if {NGROUPS_MAX} is zero. A return value of -1 indicates failure, and errno is set to indicate the error.

Description

The getgroups() function fills in the array grouplist with the supplementary group IDs of the calling process. The gidsetsize argument specifies the number of elements in the supplied grouplist array. The actual number of suplementary group IDs stored in the array is returned. The values of array entries with indices larger than or equal to the returned value are undefined.

As a special case, if the gidsetsize argument is zero, getgroups() returns the number of supplemental group IDs associated with the calling process without modifying the array pointed to by the grouplist argument.

Implementation Considerations

Supplemental group IDs are not currently supported ({NGROUPS_MAX} is 0). Therefore, this function will always return 0.

Errors

If an error occurs, errno is set to one of the following values:

EINVALCAUSEgidsetsize is not equal to zero and is less than the number of supplemental group IDs.
 ACTIONSpecify a valid and supported value.

See Also

getgid(), POSIX.1

Feedback to webmaster