The getgroupsbyname service gets the number of supplementary group IDs (GIDs) and, optionally, gets a list of those supplementary group IDs for a specified user name.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1GUG): | 31-bit |
AMODE (BPX4GUG): | 64-bit |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
|
AMODE 64 callers use BPX4GUG with the same parameters. The Group_ID_list_pointer_address parameter is a doubleword.
The name of a fullword that contains the length of User_name.
The name of a field of length User_name_length that contains the name of the user that you want information about. The name is specified in the Resource Access Control Facility (RACF®) command that defined the user to the system.
The name of a fullword that specifies the number of fullword entries in the group ID list. This number must be at least as great as the total number of group IDs for the process, or must be 0.
If you specify 0, the program receives only a count of the actual number of group IDs for the calling process, and not a list of those IDs.
The name of a fullword (doubleword) that contains a pointer to a storage area where the getgroupsbyname service is to place the list of supplementary group IDs. If Group_ID_list_size is specified as 0, Group_ID_list_pointer_address is ignored, and does not have to be set to a valid address. When the request is successful, the storage is an array of fullwords, each containing a supplementary group ID for the calling process.
Return_code | Explanation |
---|---|
EINVAL | The Group_ID_list_size parameter was greater than 0 but less than the number of supplementary group IDs; or the User_name or User_name_length fields were incorrect. |
EMVSSAF2ERR | A system authorization facility (SAF) service had an error. |
The name of a fullword in which the getgroupsbyname service stores the reason code. The getgroupsbyname service returns Reason_code only if Number_of group_IDs is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
In the case of EMVSSAF2ERR, the reason code contains the Resource Access Control Facility (RACF) return and reason codes, respectively, in the two low-order bytes.
RACF return code | RACF reason code | Explanation |
---|---|---|
8 | 4 | Group count is less than the number of supplemental groups |
8 | 8 | Incorrect group list address |
8 | 12 | Internal error during RACF processing |
8 | 16 | Unable to establish recovery |
8 | 20 | Internal error verifying user ID. The user ID might have been revoked. |
8 | 24 | User ID is not defined to RACF |
There are no restrictions on the use of the getgroupsbyname service.
For an example using this callable service, see BPX1GUG (getgroupsbyname) example.