title: Is it possible to determine how many messages are in a POSIX message queue?
body: <p>I am working with POSIX running on a RHEL machine. Is there a way to check the number of messages that are remaining in a message queue (System V Preferably)?</p>
  <p>The purpose of this is simply a desire to know which queues have the most messages at a given time so that I can make a &quot;managing&quot; thread receive the messages in a Longest-Queue-First manner.</p>
  <p>I didn't see anything about this in the man pages (that were C/C++-specific and not tied to IPCs).</p>
  <p>Does anyone have an idea of how to do this?</p>