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

System Functions (s and S) spt_sendx(2)
NAME
spt_sendx - Sends a message on a connected socket (thread-aware version)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series and J series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <sys/socket.h>]
#include <spthread.h>
ssize_t spt_sendx(
int socket,
const void *buffer,
size_t length,
int flags
);
PARAMETERS
socket Specifies the file descriptor of the socket.
buffer Points to the buffer containing the message to send.
length Specifies the length in bytes of the message to send.
flags Is a value that controls message transmission. The value of the flags parameter
is formed by bitwise ORing zero or more of the following values:
MSG_DONTROUTE
Sends without using routing tables. (Not recommended, use for
debugging only.)
MSG_OOB Sends out-of-band data on sockets that support out-of-band com-
munications.
DESCRIPTION
The spt_sendx() function is a thread-aware version of the send() function.
The spt_sendx() function begins transmission of a message to a peer socket. The spt_sendx()
function sends a message only when the socket is connected.
The length of the message to be sent is specified by the length parameter. If the message is too
long to pass through the underlying protocol, the spt_sendx() function fails and does not
transmit the message.
Successful completion of a call to spt_sendx() does not imply successful delivery of the mes-
sage. 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 spt_sendx() 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 spt_sendx() func-
tion fails and sets errno to [EWOULDBLOCK].
NOTES
The macro to map send() to spt_sendx() is available in C applications when
SPT_THREAD_AWARE_NONBLOCK has been defined in the following manner before
including spthread.h:
#define SPT_THREAD_AWARE_NONBLOCK
527186-023 Hewlett-Packard Company 7407