The method_getgrusers Interface

int method_getgrusers (void *handlep, char *group, void *result, int type, int *size);

The handlep parameter is a handle to the load module opened with the method_open interface. The group parameter points to the requested group. The result parameter points to a storage area which will be filled with the group members. The type parameters indicates whether the result parameter is to be interpreted as a (char **) which references a user name array, or (uid_t) array. The size parameter is a pointer to the number of users in the named group. On input it is the size of the result field.

method_getgrusers retrieves group membership information given a group name. The return value may be an array of user names or identifiers.

method_getgrusers may be called by the security library to obtain the group membership information for a group.

method_getgrusers returns 0 on success. On failure a value of -1 is returned and the global variable errno is set. The value ENOENT must be used when the requested group does not exist. The value ENOSPC must be used when the list of group members does not fit in the provided array. When ENOSPC is returned the size parameter is modified to give the size of the required result array.