Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_msgread.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_msgread.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_msgread.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_msgread.html on line 8

resmgr_msgread()

Read a message from a client

Synopsis:

#include <sys/resmgr.h>

int resmgr_msgread( resmgr_context_t * ctp,
                    void * msg,
                    int size,
                    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.
msg
A pointer to a buffer where the function can store the data.
bytes
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.
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:

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 Layers in a resource manager in the Bones of a Resource Manager chapter of Writing a Resource Manager.

Returns:

The same values as MsgRead(): 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 its connection is 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:

MsgRead(), resmgr_context_t, resmgr_msgreadv(), resmgr_msgwrite(), resmgr_msgwritev()

Layers in a resource manager in the Bones of a Resource Manager chapter of Writing a Resource Manager

Resource Managers chapter of Getting Started with QNX Neutrino


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_msgread.html on line 172

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_msgread.html on line 172