resmgr_msggetsize()

Updated: April 19, 2023

Get the size of a message and its local and remote parts

Synopsis:

#include <sys/resmgr.h>

size_t resmgr_msggetsize( resmgr_context_t * const ctp,
                           size_t start_offset,
                           size_t * const local_size,
                           size_t * const remote_size );

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 message-related parameters from the resmgr_context_t.
start_offset
An offset into the current message that the local and remote sizes are relative to. The value of offset referenced by ctp cannot be included in this parameter.
local_size
A pointer to the location where the function can store the size of the message's local part, or NULL if there is no local part.
remote_size
A pointer to the location where the function can store the size of the message's remote part, or NULL if there is no remote part.

Library:

libc

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

Description:

The resmgr_msggetsize() function is a convenience function that you can use in a resource manager to get the total, local, and remote sizes of a received message. For combined messages, it always takes into account the offset that ctp references. The passed in offset is just the offset from the start of the message that is currently being processed.

For combine messages (those with the _IO_COMBINE_FLAG set), the size returned to the caller is limited to that found in the size parameter that ctp references. This size might be smaller than the info.srcmsglen less offset in the resmgr_context_t referenced by ctp, because any data past size is part of a subsequent message.

For more information, see Layers in a resource manager in the Bones of a Resource Manager chapter of Writing a Resource Manager.

Returns:

The total size of the message, taking into account the start offset.

Classification:

QNX Neutrino

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