Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) sendto(2)
dest_len Specifies the length of the sockaddr structure pointed to by the dest_addr
parameter.
DESCRIPTION
The sendto( ) function sends a message through a connection-oriented or connectionless socket.
If the socket is connectionless, the message is sent to the address specified in the sockaddr struc-
ture pointed to by the dest_addr parameter. If the socket is connection-oriented, the dest_addr
parameter is ignored.
Successful completion of a call to sendto() does not imply successful delivery of the message. A
return value of -1 indicates only locally detected errors.
If the sending socket has no space to hold the message to be transmitted and the socket’s file
descriptor is blocking (O_NONBLOCK is not set), the sendto() function blocks until space is
available. If the sending socket has no space to hold the message to be transmitted and the
socket’s file descriptor is marked nonblocking (O_NONBLOCK is set), the sendto( ) function
fails and sets errno to [EWOULDBLOCK].
To pass a 32-bit pointer from a 32-bit Guardian or OSS client, sendto() or sendto64_() may be
called.
To pass a 64-bit pointer from a 32-bit Guardian or OSS client, sendto64_() must be called.
32-bit Guardian and 64-bit OSS clients can pass 32-bit pointers and 64-bit pointers to
sendto64_().
NOTES
This function requires that the feature-test macro _XOPEN_SOURCE_EXTENDED be specified
when you compile the module.
When data can be sent, a call to the select() function indicates that the file descriptor for the
socket is ready for writing.
For systems running AF_UNIX Release 2 software:
• Sockets created in compatibility mode can communicate with each other but cannot
communicate with sockets in portability mode.
• Sockets created in portability mode can communicate with each other but cannot com-
municate with sockets created in compatibility mode.
To use the sendto() functionality in a threaded application that uses the Standard POSIX Threads
library, see spt_sendtox(2).
To use this function in a threaded application that uses the POSIX User Thread Model library on
systems running J06.10 or later RVUs or H06.21 or later RVUs, you must perform all of the fol-
lowing tasks to make the function thread-aware in a multi-threaded application:
• Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
• Link the application to the zputdll library (/G/system/zdllnnn/zputdll).
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit OSS applications.
To use this function in a 32-bit threaded application that uses the POSIX User Thread Model
library on systems running H06.24 or later RVUs or J06.13 or later RVUs, perform the same
tasks (described above) used to enable the function on systems running H06.21/J06.10 or later
RVUs.
527186-023 Hewlett-Packard Company 7−45