MSGQ_count
Application Program Interface
2-241
C Interface
Syntax
status = MSGQ_count(msgqQueue, count);
Parameters
MSGQ_Queue
msgqQueue;
/* Message queue to count */
Uns
*count;
/* Pointer to returned count */
Return Value
Int
status;
/* status */
Reentrant
yes
Description
This API determines the number of messages in a specific message
queue. Only the processor that opened the message queue should call
this API to determine the number of messages in the reader’s message
queue. This API is not thread safe with MSGQ_get when accessing the
same message queue, so the caller of MSGQ_count must prevent any
calls to MSGQ_get.
If successful, this function returns SYS_OK.
Constraints and
Calling Context
❏
The message queue must have been returned from a MSGQ_open
call.
Example
status = MSGQ_count(readerMsgQueue, &count);
if (status != SYS_OK) {
return;
}
LOG_printf(&trace, "There are %d messages.", count);
See Also
MSGQ_count
Return the number of messages in a message queue