'how to get number of elements in POSIX message queue

I have a program where I use APIs like msgget, msgsnd, msgrcv etc. from <sys/msg.h> to create, access, write in, read from message queue. Is there a way to know the number of entries in the queue?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source