resmgr_msgwritev()

Updated: April 19, 2023

Write a message to a client

Synopsis:

#include <sys/iofunc.h>
#include <sys/resmgr.h>

ssize_t resmgr_msgwritev( resmgr_context_t *ctp,
                          const iov_t *smsg,
                          int sparts,
                          size_t offset );

Arguments:

ctp
A pointer to a resmgr_context_t structure that the resource-manager library uses to pass context information between functions. This function extracts the rcvid from this structure.
smsg
An array of buffers that contains the data you want to write.
sparts
The number of elements in the array. This function doesn't let you write past the end of the sender's buffer; it returns the number of bytes actually written.
offset
An offset into the sender's buffer that indicates where you want to start writing the data.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The resmgr_msgwritev() function is a cover function for MsgWritev(), and performs the exact same functionality. It's provided for consistency with resmgr_msgwrite().

Note: As a client may have overlapping send and reply buffers, you must complete all MsgRead*() operations from a particular send (i.e. particular rcvid) before initiating any MsgWrite*() operations to that client.

Returns:

The number of bytes written, or -1 if an error occurred (errno is set).

Errors:

EFAULT
A fault occurred in the sender's address space when a server tried to access the sender's return message buffer.
EOVERFLOW
The sum of the IOV lengths exceeds SSIZE_MAX, or the number of parts exceeds 524288.
ESRCH
The thread indicated by ctp->rcvid doesn't exist or has had its connection detached.
ESRVRFAULT
A fault occurred when the kernel tried to access the buffers provided.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes