The bind callable service binds a unique local name to a socket descriptor.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task or SRB |
Cross memory mode: | PASN = HASN |
AMODE (BPX1BND): | 31-bit task or SRB mode |
AMODE (BPX4BND): | 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 BPX4BND with the same parameters.
The name of a fullword that contains the socket file descriptor for which the bind is to be done.
The name of a field that contains the length of Sockaddr.
The name of a field that contains the name to be bound to the socket descriptor. The format of Sockaddr is determined by the domain in which the socket descriptor was created. See BPXYSOCK — Map SOCKADDR structure and constants for additional information on the format of Sockaddr.
Return_code | Explanation |
---|---|
EADDRINUSE | The specified address is already in use. The following reason code can accompany the return code: JRNameExists. |
EAFNOSUPPORT | The address family specified in the address structure is not supported. |
EBADF | The socket descriptor is incorrect. The following reason codes can accompany the return code: JRFileDesNotInUse, JRFileNotOpen. |
EINVAL | One of the input parameters was not valid. The following reason codes can accompany the return code: JRSocketCallParmError, JRSockNoname. |
EIO | There has been a network or transport failure. The following reason code can accompany the return code: JRPrevSockError. |
ENOBUFS | A buffer could not be obtained. The following reason code can accompany the return code: JROutofSocketCells. |
ENOTSOCK | Socket_descriptor does not refer to a valid socket descriptor. The following reason code can accompany the return code: JRMustBeSocket. |
EPERM | The user is not permitted to bind to the specified port. The following reason code can accompany the return code: JRUserNotPrivileged. |
The name of a fullword in which the bind service stores the reason code. The bind 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 bind service.
For an example using this callable service, see BPX1BND (bind) example.