The takesocket callable service acquires a specified socket from the program that is identified in the Clientid parameter.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1TAK): | 31-bit |
AMODE (BPX4TAK): | 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 BPX4TAK with the same parameters.
An identifier for the socket that is being taken. This is supplied by the server program, and is either the socket descriptor obtained from an accept, or the socket token returned on a givesocket (BPX1GIV, BPX4GIV) service if givesocket was invoked with CIdType=CId#Close.
Return_code | Explanation |
---|---|
EBADF | The Socket_Id does not specify a valid socket that is owned by the other application; or the socket has already been taken. |
EACCES | The other application did not give the socket to your application. |
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: either the client's process cannot be found, or the client's process was found, but it has no outstanding givesockets. |
EMFILE | The socket descriptor table is already full. |
EPERM | The givesocket security label does not match the takesocket security label (JrUserNotAuthorized). |
The name of a fullword in which the takesocket service stores the reason code. The takesocket 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 takesocket service.