Updated: April 19, 2023 |
Get the size of a message and its local and remote parts
#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 );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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.
The total size of the message, taking into account the start offset.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |