Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
sendmsg64_(2) OSS System Calls Reference Manual
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 sendmsg64_( ) 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 sendmsg64_()
function fails and sets errno to [EWOULDBLOCK].
In the msghdr64 structure, the msg_control and msg_controllen members specify the ancillary
data buffer that can be used only by sockets in the AF_UNIX domain to pass file descriptors to
another process on the same node. The msg_control member can be a null pointer if ancillary
data is not desired or required. If the msg_control member is nonnull, it points to an ancillary
data buffer consisting of a cmsghdr structure followed by one to sixteen file descriptors. The
msg_controllen member specifies the size of the ancillary data buffer.
If sendmsg64_() is called with an ancillary data buffer, the members of the cmsghdr structure
must be set as follows:
• The cmsg_level member must be set to SOL_SOCKET.
• The cmsg_type member must be set to SCM_RIGHTS.
• The value of the cmsg_len member must be equal to the value of the msg_controllen
member of the msghdr64 structure.
To pass a 32-bit pointer from a 32-bit Guardian or OSS client, sendmsg() must be called.
To pass a 64-bit pointer from a 32-bit Guardian or OSS client, sendmsg64_() must be called.
To pass a 32-bit pointer from a 64-bit OSS client, sendmsg() must be called.
To pass a 64-bit pointer from a 64-bit OSS client, sendmsg() must be called.
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 AF_UNIX sockets:
• 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.
If a memory resource allocation error occurs while attempting this operation, the operation
succeeds but the resulting file descriptor is not usable. All subsequent file operations that attempt
to use the file descriptor fail with the error [EBADF].
For detailed information about writing multi-threaded and 64-bit applications for the Open Sys-
tem Services environment, see the Open System Services Programmer’s Guide.
RETURN VALUES
Upon successful completion, the sendmsg64_() function returns the number of normal bytes
sent. Ancillary data, if present, is not counted in the total number of bytes sent.
If the sendmsg64_() function call fails, the value -1 is returned, and errno is set to indicate the
error.
7−40 Hewlett-Packard Company 527186-023