delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/18/21:44:50

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <48AA255B.7030405@mail.jpl.nasa.gov>
Date: Mon, 18 Aug 2008 18:43:55 -0700
From: Linh Phan <phan AT mail DOT jpl DOT nasa DOT gov>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: cygwin 1.7 message queues can't open more than 1 queue?
X-Source-IP: dialin-206.jpl.nasa.gov [128.149.231.206]
X-Source-Sender: phan AT mail DOT jpl DOT nasa DOT gov
X-AUTH: Authorized
X-AUTH: Authorized
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi,

  I downloaded cygwin 1.7 to use message queues but unfortunately, the 
message queues only allows me to open
1 message queue.  If I try to open a second one, it fails with 
"Permission denied".  Below is the test I used:

#include <stdio.h>
#include <mqueue.h>
#include <fcntl.h>
main()
{
  int flags = O_RDWR | O_NONBLOCK | O_CREAT | O_EXCL;
  struct mq_attr attr;
  char queue[33];
  char *e;
  mode_t mode = strtoul("644", &e, 8);
  mqd_t mqd;

  memset((void *) &attr, 0, sizeof(struct mq_attr));
  attr.mq_maxmsg = (long) 10;
  attr.mq_msgsize = (long) 24;

  strcpy(queue, "/queue0");
  mq_unlink(queue);
  mqd = mq_open(queue, flags, mode, &attr);
  strcpy(queue, "/queue1");
  mq_unlink(queue);
  mqd = mq_open(queue, flags, mode, &attr); // ALWAYS FAIL HERE WITH 
"Permission denied"
  perror("mq_open");
}

Does anyone know what I did wrong?

Thank you,

Linh


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019