The sendto callable service sends data on 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 (BPX1STO): | 31-bit task or SRB mode |
AMODE (BPX4STO): | 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 BPX4STO with the same parameters.
The name of a fullword that contains the socket file descriptor for which the sendto is to be done.
The name of a field that contains the length of Buffer.
The name of a field from which the data is to be sent.
The name of a field that contains the ALET for Buffer. You should specify a Buffer_alet of 0 for the normal case of a buffer in the user's address space (current primary address space). If a value other than 0 is specified for the Buffer_alet, the value must represent a valid entry in the dispatchable unit access list (DUAL).
The name of a field that contains information about how the data is to be sent. See BPXYMSGF — Map the message flags for more information about the format of this field.
The name of a field that contains the length of Sockaddr. The size of this field should be less than 4096 bytes (4KB) in length. The size of the buffer that is specified should be the maximum length that the sockaddr could be on output.
The name of a socket address structure to which the data is to be sent. See BPXYSOCK — Map SOCKADDR structure and constants for more information about the format of this field.
Return_code | Explanation |
---|---|
EACCES | For AF_UNIX sockets, search permission is denied for a component of the path prefix or write access to the named socket is denied. |
EAFNOSUPPORT | The address family that was specified in the sockaddr is not the same address family as the socket. |
EBADF | A file descriptor that was not valid was specified.The following reason codes can accompany the return code: JRFileDesNotInUse, JRFileNotOpen. |
ECONNRESET | Connection reset by peer. The following reason code can accompany the return code: JRSocketNotCon. |
EINTR | A signal interrupted the sendto service before any data was written. The following reason code can accompany the return code: JRSocketRdwrSignal. |
EINVAL | An input parameter was incorrect. The following reason codes can accompany the return code: JRSocketCallParmError, JRSockNoName. |
EIO | There has been a network or transport failure.The following reason codes can accompany the return code: JRInetRecycled, JrPrevSockError. |
EMSGSIZE | The message is too large to be sent all at once, as the socket requires. The following reason code can accompany the return code: JRSockBufMax. |
ENOBUFS | A buffer could not be obtained. The following reason code can accompany the return code: JROutofSocketCells. |
ENOTCONN | The socket was not connected. The following reason code can accompany the return code: JRSocketNotCon. |
ENOTSOCK | Socket_descriptor does not refer to a valid socket descriptor. The following reason code can accompany the return code: JRMustBeSocket. |
EPIPE | An attempt was made to send to a socket that is shut down or closed. The following reason code can accompany the return code: JRSocketClosed. This error also generates a SIGPIPE signal. |
EPROTOTYPE | The address specifies a socket that is not the correct type for this request. |
EWOULDBLOCK |
The following reason codes can accompany the return code: JRWouldBlock, JRTimeout. |
The name of a fullword in which the sendto service stores the reason code. The sendto 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 sendto service.
See BPX1STO (sendto) example for an example using this callable service.