title: mq_receive returning EAGAIN when data is present
body: <p>I have an mqueue which has 2 messages in it but the call to mq_receive will not pull data. I don't have any previous experience with this message queue so forgive my ignorance. I believe the send side is working fine as echoing the "file" does show information.</p>
  
  <pre><code>QSIZE:48 NOTIFY:1 SIGNO:0 NOTIFY_PID:5741
  </code></pre>
  
  <p>This is 2 messages without a message signal being generated. The PID is the process that will be calling mq_receive.</p>
  
  <p>For reference, here is the open code.</p>
  
  <pre><code>msgq_attr.mq_maxmsg  = MAX_NUM_MESSAGES; // 20
  msgq_attr.mq_msgsize = MAX_MSG_SIZE; // 256
  
  mqrcv_id = mq_open(queue_name, O_RDONLY | O_NONBLOCK, 
                    S_IRWXU | S_IRWXO, msgq_attr);
  
  notify.sigev_notify = SIGEV_NONE;    
  notify.sigev_notify_attributes = NULL;          
  mq_notify(mqrcv_id, &amp;notify);
  </code></pre>
  
  <p>And here is the receive.</p>
  
  <pre><code>int msgSize = mq_receive(mqrcv_id, buffer,
                          MAX_MSG_SIZE, &amp;msgprio);
  </code></pre>
  
  <p>msgSize always returns -1 with errno EAGAIN. From the documentation, this should mean that the queue has no messages in it. Note that it is NONBLOCKING.</p>