The givesocket callable service makes a specified socket available to a takesocket call to be issued by another program.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1GIV): | 31-bit |
AMODE (BPX4GIV): | 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 BPX4GIV with the same parameters.
The name of a fullword that contains the socket file descriptor for which the givesocket is to be done.
The Clientid is a returned parameter only if the CIdType field in the CIdReserved area is set to CId#Close. A unique token for the given socket is then returned in the CIdToken field of the CIdReserved area. This token, instead of the socket descriptor, is to be passed to the slave program to be used on the takesocket service. The token must be used, rather than the socket descriptor, because the socket being given will be closed, and the socket descriptor may be reused. See BPXYCID — Map the returning structure for getclientid() for more information about the format of this field.
Return_code | Explanation |
---|---|
EBADF | The Socket_descriptor is not valid, or the socket has already been given. |
EFAULT | Using the Clientid parameter as specified would result in an attempt to access storage that is outside the caller's address space. |
EINVAL | The Clientid parameter does not specify a valid client identifier; or the CIdDomain in the Clientid parameter does not match the actual domain of the input Socket_descriptor. |
The name of a fullword in which the givesocket service stores the reason code. The givesocket 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 givesocket service.