Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

resmgr_msgreadv()

Read a message from a client

Synopsis:

#include <sys/resmgr.h>

int resmgr_msgreadv( resmgr_context_t * ctp,
                     iov_t * rmsg,
                     int rparts,
                     int 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.
riov
An array of buffers where the functions can store the data.
rparts
The number of elements in the riov array.
offset
An offset into the thread's send message that indicates where you want to start reading the data.

Library:

libc

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

Description:

This resmgr_msgreadv() function is a convenience function that you should use in a resource manager instead of MsgReadv().

You'll use resmgr_msgreadv() when handling combine messages, where the offset of the rest of the message that is to be read is additionally offset by previous combine message elements. For more information, see "Combine messages" in the Writing a Resource Manager chapter of the Neutrino Programmer's Guide.

Returns:

The same values as MsgReadv(): the number of bytes read, or -1 if an error occurs (errno is set).

Errors:

EFAULT
A fault occurred in a server's address space when it tried to access the caller's message buffers.
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

See also:

MsgReadv(), resmgr_context_t, resmgr_msgread(), resmgr_msgwrite(), resmgr_msgwritev()

"Combine messages" in the Writing a Resource Manager chapter of the Neutrino Programmer's Guide

Resource Managers chapter of Getting Started with QNX Neutrino