Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) send(2)
NAME
send - Sends a message on a connected socket
LIBRARY
G-series native OSS processes: system library
H-series and J-series OSS processes: implicit libraries
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
SYNOPSIS
#define _XOPEN_SOURCE_EXTENDED 1
#include <sys/socket.h>
ssize_t send(
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 send( ) function begins transmission of a message to a peer socket. The send( ) 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 send( ) function fails and does not transmit the
message.
Successful completion of a call to send() 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 send() 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 send() function fails
and sets errno to [EWOULDBLOCK].
To pass a 32-bit pointer from a 32-bit Guardian or OSS client, send() or send64_() may be
called.
To pass a 64-bit pointer from a 32-bit Guardian or OSS client, send64_() must be called.
527186-023 Hewlett-Packard Company 7−27