The getgroups callable service gets the number of supplementary group IDs (GIDs) for the calling process. It optionally gets a list of those supplementary group IDs.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1GGR): | 31-bit |
AMODE (BPX4GGR): | 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 BPX4GGR with the same parameters. The Group_ID_list_pointer_address parameter is a doubleword.
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 in which the getgroups 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 area 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. |
EMVSSAF2ERR | System authorization facility (SAF) had an error. |
The name of a fullword in which the getgroups service stores the reason code. The getgroups 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.
The reason code in the case of EMVSSAF2ERR 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 | Invalid grouplist address |
8 | 12 | Internal error during RACF processing |
There are no restrictions on the use of the getgroups service.
For an example using this callable service, see BPX1GGR (getgroups) example.