TCP/IP Programming Manual

INT(32) sockaddr_length;
INT(32) tag;
error
return value; if the call is successful, a zero is returned. If the call is not successful, —1 is
returned. If the call failed, the external variable errno is set as indicated in Errors (page 181).
socket
input value; specifies the socket number for the socket, as returned by the call to socket_nw.
buffer_ptr
input value; points to the data to be sent.
buffer_length
input value; the size of the buffer pointed to by buffer_ptr.
flags
input value; specifies whether the outgoing data should be sent to the destination if routing is
required. This parameter can be one of the following messages:
Send this message only if the destination is located on the local network; do not send
the message through a gateway.
MSG_DONTROUTE
No flag; send the message to the destination, even if the message must be routed.0
sockaddr_ptr
input value; points to the remote address and port number to which the data is to be sent. (See
the sockaddr_in (page 78), sockaddr_in6 (page 78), and sockaddr_storage (page 79)
descriptions.)
sockaddr_length
input value; specifies the length of the sockaddr or sockaddr_in6 structure.
tag
input value; the tag parameter to be used for the nowait operation initiated by sendto_nw.
Errors
If an error occurs, the return value is set to -1 and the external variable errno is set to one of the
following values:
Permission denied for broadcast because SO_BROADCAST is not set.EACCES
The message was too large to be sent atomically, as required by the socket options.EMSGSIZE
The specified socket was connected.EISCONN
The specified socket was shut down.ESHUTDOWN
The destination network was unreachable.ENETUNREACH
An invalid argument was specified.EINVAL
Usage Guidelines
This is a nowait call; it must be completed with a call to the AWAITIOX procedure. For a
waited call, use sendto.
The parameters of the sendto_nw function are not compatible with those of the sendto
function in the 4.3 BSD UNIX operating system.
sendto_nw 181