Where are POSIX message queues located (Linux)?
<p><code>man 7 mq_overview</code> says that the POSIX "...message queues on the system can  be  viewed  and  manipulated using the commands usually used for files (e.g., ls(1) and rm(1))."
For example I was able to read using a mqd_t as a file descriptor as follows:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;fcntl.h&gt;
#include &lt;mqueue.h&gt;
#include &lt;unistd.h&gt;
#include &lt;stdlib.h&gt;

int main(int argc, char **argv) {
  if (argc != 2) {
    std::cout &lt;&lt; "Usage: mqgetinfo &lt;/mq_name&gt;\n";
    exit(1);
  }
  mqd_t mqd = mq_open(argv[1], O_RDONLY);

  struct mq_attr attr;
  mq_getattr(mqd, &amp;attr);
  std::cout &lt;&lt; argv[1] &lt;&lt; " attributes:"
        &lt;&lt; "\nflag: " &lt;&lt; attr.mq_flags
        &lt;&lt; "\nMax # of msgs: " &lt;&lt; attr.mq_maxmsg
        &lt;&lt; "\nMax msg size: " &lt;&lt; attr.mq_msgsize
        &lt;&lt; "\nmsgs now in queue: " &lt;&lt; attr.mq_curmsgs &lt;&lt; '\n';

  // Get the queue size in bytes, and any notification info:
  char buf[1024];
  int n = read(mqd, buf, 1023);
  buf[n] = '\0';
  std::cout &lt;&lt; "\nFile /dev/mqueue" &lt;&lt; argv[1] &lt;&lt; ":\n"
        &lt;&lt; buf &lt;&lt; '\n';

  mq_close(mqd);
}
</code></pre>

<p>Running this on msg queue /myq when it contains 5 msgs, 549 bytes gives:</p>

<pre><code>$ g++ mqgetinfo.cc  -o mqgetinfo -lrt
$ ./mqgetinfo /myq
/myq attributes:
flag: 0
Max # of msgs: 10
Max msg size: 8192
msgs now in queue: 5

File /dev/mqueue/myq:
QSIZE:549        NOTIFY:0     SIGNO:0     NOTIFY_PID:0     

$
</code></pre>

<p>Also:</p>

<pre><code>$ !cat
cat /dev/mqueue/myq
QSIZE:549        NOTIFY:0     SIGNO:0     NOTIFY_PID:0 
</code></pre>

<p>So the file /dev/mqueue/myq has some info associated with the msg queue. </p>

<p>My question is: Where is the queue itself, i.e., where are the 549 bytes? I'm guessing they are in some list-type data structure internal to the kernel, but I don't see this mentioned in the man pages etc, and wondering how to find out about that..</p>