title: POSIX4 messages queues "mq_open: No such file or directory"
body: <p>I'm trying to use POSIX4 messages queues. So I'm using <code>mq_open</code> to create the queue, and for all the options I give to it an <code>struct mq_attr</code>, that I fill.</p>
  
  <p>He can't find the queue, while I put the <code>O_CREATE</code> flag.</p>
  
  <p>Here is my code <em>(no-indented lines are debug code)</em>:</p>
  
  <pre><code>...
  /***
   * Queues' names
   */
  #define GUI_QUEUE "/guiQ"
  ...
    struct mq_attr attrAct;       /* Queue parameters */
    /***
     * Message queue to send action
     */
    attrAct.mq_maxmsg=1;
    attrAct.mq_msgsize=sizeof(gui_action);
    attrAct.mq_flags=0;
    attrAct.mq_curmsgs=0;
  
  printf("serveur first sizeof(gui_action) : %lu\tmsgsize : %lu\n", sizeof(gui_action), attrAct.mq_msgsize);
    if ((guiQue=mq_open(GUI_QUEUE, O_CREAT | O_NONBLOCK | O_WRONLY
        , S_IWUSR | S_IRUSR , &amp;attrAct))!=0) {
      perror("mq_open");
      exit(EXIT_FAILURE);
    }
  if (mq_getattr(guiQue, &amp;attrAct)!=0) {
  perror("mq_getattr");
  }
  else {
  printf("serveur second sizeof(gui_action) : %lu\tmsgsize : %lu\n", sizeof(gui_action), attrAct.mq_msgsize);
  }
  struct mq_attr new;
  new=attrAct;
  new.mq_msgsize=sizeof(gui_action);
  printf("serveur third sizeof(gui_action) : %lu\tmsgsize : %lu\n", sizeof(gui_action), new.mq_msgsize);
  if (mq_setattr(guiQue, &amp;new, &amp;attrAct)!=0) perror("mq_setattr");
  if (mq_getattr(guiQue, &amp;attrAct)!=0) {
  perror("mq_getattr");
  }
  else {
  printf("serveur fourth sizeof(gui_action) : %lu\tmsgsize : %lu\n", sizeof(gui_action), attrAct.mq_msgsize);
  }
  ...
  </code></pre>
  
  <p>And here is the output:</p>
  
  <pre><code>serveur first sizeof(gui_action) : 16   msgsize : 16
  mq_open: No such file or directory
  </code></pre>
  
  <p>What am I doing wrong?</p>