title: mq_open giving "too many open files"
body: <p>I created a message queue with following code. First few times it works properly. </p>
  
  <pre><code>int main()
  {
      mqd_t mqdes;
      char mq_name[10] = "/mq";
      int oflag = O_CREAT | O_RDWR, ret;
      struct mq_attr attr;
  
      attr.mq_maxmsg = 1024;
      attr.mq_msgsize = 2048; 
  
      mqdes = mq_open(mq_name, oflag, 0766, &amp;attr);
      if(mqdes == -1) {
              perror("mq_open");
              if(errno == EMFILE)
                      perror("EMFILE");
              exit(1);
      }
  
      printf("mqueue created, mq_descriptor: %d\n", mqdes);
  
      ret = mq_close(mqdes);
      if(ret == -1) {
              perror("mq_close");
              exit(2);
      }
      printf(" mq closed successful\n");
  
  
      return 0;
  }
  </code></pre>
  
  <p>After that, it's giving following error</p>
  
  <pre><code>mq_open: Too many open files
  EMFILE: Too many open files
  </code></pre>
  
  <p>But why i'm getting this error? How can I see possix message queues like <code>ipcs</code> is for system V?</p>