The fchown callable service changes the owner, group, or both owner and group of a file. You identify the file by its file descriptor.
For the corresponding service using a pathname, see chown (BPX1CHO, BPX4CHO) — Change the owner or group of a file or directory.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1FCO): | 31-bit |
AMODE (BPX4FCO): | 64-bit |
ASC mode: | Primary address space control (ASC) 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 BPX4FCO with the same parameters.
The name of a fullword that contains the file descriptor of the file for which you wish to change the owner, group, or both owner and group.
The name of a fullword field that contains the new owner UID assigned to the file, or the present value or -1 if there is no change. This parameter must be specified.
The name of a fullword field that contains the new group ID (GID) to be assigned to the file, or the present value or -1 if there is no change. This parameter must be specified.
The name of a fullword to which the fchown service returns 0 if the request is successful, or -1 if it is unsuccessful.
Return_code | Explanation |
---|---|
EBADF | The File_descriptor parameter is not a valid file descriptor. |
EINVAL | The Owner_UID or Group_ID parameter is incorrect; or File_descriptor refers to an unnamed pipe, and fchown is not allowed on such a file. |
EPERM | The calling process does not have appropriate privileges (see Authorization). |
EROFS | The specified file 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 fchown service stores the reason code. The fchown service returns a Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. See z/OS UNIX System Services Messages and Codes for the reason codes.
There are no restrictions on the use of the fchown service.
See BPX1FCO (fchown) example for an example using this callable service.