groupmember, groupmember_cr Subroutines

Purpose

Determines if the named group is a member of a credential group set.

Syntax

#include <sys/types.h>
#include <sys/cred.h>

int groupmember (gid)
gid_t gid;

int groupmember_cr (gid, cred)
gid_t gid;
cred_t * cred;

Parameters

Item Description
gid Specifies an identifier for a group.
cred Points to a ucred structure.

Description

The groupmember subroutines determine if a group is included in the group set of a credential structure. The groupmember subroutine queries the credential associated with the current thread. The groupmember_cr subroutine checks for the group within the specified ucred structure.

Return Values

The groupmember subroutines return TRUE if the ucred structure contains the specified gid parameter or if the specified gid parameter is the current effective group ID for the thread. Otherwise, these routines return FALSE.

Error Codes

The groupmember subroutines return no error codes.