title: Error implementing posix message queue - "Function not implemented"
body: <p>I have written this code to make a posix message queue. But I am receiving an error "Function not implemented".</p>
  
  <p>Q1. Is it a platform related issue ? [Am using Ubuntu 10.10] I read somewhere that I need to rebuild my kernel to enable message queues !?</p>
  
  <p>Q2. I also read something about starting the mqueue server before actually using message queues ?</p>
  
  <p>Can someone please explain..</p>
  
  <pre><code>#include &lt;mqueue.h&gt;     /* message queue stuff */
  #include &lt;iostream&gt;
  #include &lt;unistd.h&gt;     /* for getopt() */
  #include &lt;errno.h&gt;      /* errno and perror */
  #include &lt;fcntl.h&gt;      /* O_flags */
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  using namespace std;
  
  int main(int argc, char **argv)
  {
  
  mqd_t msgQueueDescriptor;
  mq_attr attr;
  
  char Msg[]="msg";
  
  attr.mq_maxmsg = 10;
  attr.mq_msgsize = sizeof(Msg);
  attr.mq_flags = 0;
  
  msgQueueDescriptor = mq_open("/myQueue", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH , attr );
  cout &lt;&lt; msgQueueDescriptor &lt;&lt; " " &lt;&lt; errno &lt;&lt; " " &lt;&lt; strerror(errno);
  mq_close(msgQueueDescriptor);
  
  return 0;
  }
  </code></pre>