The setpeer callable service presets the peer address that is associated with a socket.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task or SRB |
Cross memory mode: | PASN = HASN |
AMODE (BPX1SPR): | 31-bit task or SRB mode |
AMODE (BPX4SPR): | 64-bit task mode only |
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 BPX4SPR with the same parameters.
The name of a fullword that contains the socket file descriptor for which the setpeer is to be done.
The name of a field that contains the length of Sockaddr.
The name of a socket address structure that contains the peer address. See BPXYSOCK — Map SOCKADDR structure and constants for more information about the format of this field.
The name of a field that indicates the conditions of the setpeer request. See BPXYSOCK — Map SOCKADDR structure and constants for more information about this field.
Return_code | Explanation |
---|---|
EBADF | The socket descriptor is incorrect. The following reason codes can accompany the return code: JRFileDesNotInUse, JRFileNotOpen. |
ENOTSOCK | Socket_descriptor does not refer to a valid socket descriptor. The following reason code can accompany the return code: JRMustBeSocket. |
The name of a fullword in which the setpeer service stores the reason code. The setpeer 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 setpeer service.
For an example using this callable service, see BPX1SPR (setpeer) example.