|This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.|
Read a message from a client
#include <sys/resmgr.h> int resmgr_msgread( resmgr_context_t * ctp, void * msg, int size, int offset );
- 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.
- A pointer to a buffer where the function can store the data.
- The number of bytes that you want to read. These functions don't let you read past the end of the thread's message; they return the number of bytes actually read.
- An offset into the thread's send message that indicates where you want to start reading the data.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The resmgr_msgread() function is a convenience function that you should in a resource manager instead of MsgRead().
You'll use resmgr_msgread() when you handle combine messages, where the offset of the rest of the message that's 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.
- A fault occurred in a server's address space when it tried to access the caller's message buffers.
- The thread indicated by ctp -> rcvid doesn't exist or its connection is detached.
- A fault occurred when the kernel tried to access the buffers provided.
"Combine messages" in the Writing a Resource Manager chapter of the Neutrino Programmer's Guide
Resource Managers chapter of Getting Started with QNX Neutrino