The getgrnam callable service gets information about a group and its members. You specify the group by name.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1GGN): | 31-bit |
AMODE (BPX4GGN): | 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 BPX4GGN with the same parameters. The address returned is a fullword (below the bar).
The name of a fullword that contains the length of Group_name.
The name of the field that contains the name of the group you want information about.
The name of a fullword where the getgrnam service returns an address, or 0. If no entry for the specified group name is found, or no GID is specified, Return_value is set to 0. If an entry is found, Return_value is set to the address of the BPXYGIDS macro structure. The first area contains the fullword length of the group name followed by the group name padded with blanks.
If an entry is found and function code ThliEP_GidNameSet was set in ThliEP_FunctionCode prior to making this call, then Return_value is set to the address of the area in the BPXYTHLI where the GID is set, as per the BPXYGIDS macro.
The address returned is 31 bits for both AMODE 31 and AMODE 64 callers. See BPXYGIDS — Map data returned for getgrnam and getgrpid.
Return_code | Explanation |
---|---|
EINVAL | Group name length is not valid. |
EMVSSAFEXTRERR | The system authorization facility (SAF) RACROUTE EXTRACT service had an error. |
EMVSSAF2ERR | The SAF Get GMAP service had an error. |
The name of a fullword where the getgrnam service stores the reason code. The getgrnam service returns Reason_code only if Return_value is 0. 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 or EMVSSAFEXTRERR contains the RACF® return and reason codes, respectively, in the two low-order bytes.
RACF Return Code | RACF Reason Code | Explanation |
---|---|---|
8 | 4 | If the search is by GID: the GID is not defined. If the search is by group name: The current group is not defined. |
8 | 8 | The group name is not defined. |
8 | 12 | There was an internal error during RACF processing. |
8 | 16 | Recovery could not be established. |
8 | 20 | The current group is incompletely defined. |
Return_value is set to the output area. This is mapped by both the ThliExtendedGIDName structure in BPXYTHLI — Thread-level information, and by BPXYGIDS — Map data returned for getgrnam and getgrpid. If no entry for the specified group ID is found, Return_value is set to 0.
The ThliEP_FunctionCode is cleared prior to returning to the caller; so, the invoker will need to set the ThliEp_FunctionCode before each invocation of the BPX1GGI/BPX4GGI service if the ThliEP_GIDNameSet function is to be used.
There are no restrictions on the use of the getgrnam service.
For an example using this callable service, see BPX1GGN (getgrnam) example.