Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (s and S) spt_sendto(2)
NAME
spt_sendto - Initiates thread-aware sendto( ) function
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#define _XOPEN_SOURCE_EXTENDED 1
#include <spthread.h>
ssize_t spt_sendto(
int socket,
const void *buffer,
size_t length,
int flags,
const struct sockaddr *dest_addr,
size_t dest_len);
PARAMETERS
See the sendto(2) reference page.
DESCRIPTION
This is a thread-aware version of the sendto() function. The socket must be nonblocking for this
function to be thread-aware.
This function requires that the feature-test macro _XOPEN_SOURCE_EXTENDED be specified
when you compile the module.
The following macro maps spt_sendto() to sendto() and has been defined in spthread.h:
#define sendto(socket, buffer, length, flags, dest_addr, dest_len) \
spt_sendto(socket, buffer, length, flags, dest_addr, dest_len)
This macro is available only when SPT_THREAD_AWARE has been defined before including
spthread.h, as follows:
#define SPT_THREAD_AWARE
For more description and notes, see the sendto(2) reference page.
RETURN VALUES
See the sendto(2) reference page. The following information also applies:
The value of errno is never set to [EWOULDBLOCK].
If the socket becomes invalid (is closed by another thread), -1 is returned with an errno
value of [EBADF].
If a signal is received via the pthread_kill() function and is not blocked, ignored, or
handled, -1 is returned with an errno value of [EINTR].
ERRORS
See the sendto(2) reference page.
STANDARDS CONFORMANCE
This function is an extension to the XPG4 Version 2 specification. Interfaces documented on this
reference page conform to the following industry standards:
IEEE Std 1003.1c-1995, POSIX System Application Program Interface
527186-023 Hewlett-Packard Company 7401