The chown service changes a file's owner, group, or both owner and group. The owner is identified by a user ID (UID) and a group ID (GID).
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1CHO): | 31-bit |
AMODE (BPX4CHO): | 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 BPX4CHO with the same parameters.
The name of a fullword that contains the length of the pathname of the file whose owner or group is to be changed.
The name of a field that contains the pathname of the file. This field has the length that is specified in Pathname_length.
The name of a fullword field that contains the new owner UID that is assigned to the file. If there is no change, this field contains the present value or -1. This parameter must be specified.
The name of a fullword field that contains the new owner GID that is assigned to the file. If there is no change, this field contains the present value or -1. This parameter must be specified.
The name of a fullword in which the chown service returns 0 if the request is successful, or -1 if it is not successful.
Return_code | Explanation |
---|---|
EACCES | The calling process does not have permission to search some component of the Pathname prefix. |
EINVAL | The Owner_UID or Group_ID parameter is incorrect. |
ELOOP | A loop exists in symbolic links that were encountered during resolution of the Pathname argument. This error is issued if more than 24 symbolic links are detected in the resolution of Pathname. |
ENAMETOOLONG | Pathname is longer than 1023 characters, or a component of the pathname is longer than 255 characters. |
ENOENT | No file named Pathname was found, or no pathname was specified. The following reason code can accompany the return code: JRFileNotThere. |
ENOTDIR | Some component of the Pathname prefix is not a directory. |
EPERM | The calling process does not have appropriate privileges (see Authorization). |
EROFS | Pathname is on a read-only file system. The following reason code can accompany the return code: JRReadOnlyFS. |
The name of a fullword in which the chown service stores the reason code. The chown service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
There are no restrictions on the use of the chown service.
For an example using this callable service, see BPX1CHO (chown) example.