mq_open fails after upgrade from cygwin 1.7.17 with gcc 3.4.4 to cygwin 1.7.20 and gcc 4.7.3

stevetarr@bouldersystemsdesign.com stevetarr@bouldersystemsdesign.com
Mon Jul 8 19:29:00 GMT 2013


The following program fails after the upgrade:

#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <errno.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <mqueue.h>

int main(int argc, char **argv)
{
     mqd_t t;
     struct mq_attr p;
         char *name = "/stuff";
         if ( mq_unlink(name) < 0 ) {
                 if ( errno != ENOENT ) {
                         printf("Unink failed - errno = %d\n");
                 }
         }
     t = mq_open(name,O_RDWR|O_CREAT,0666,NULL);
     if ( t  < 0 ) {
         printf("Failed to create %s queue - %d\n",name,errno);
         return -1;
     }
     if ( mq_getattr(t,&p) < 0 ) {
         printf("Failed to get queue attributes - %d\n",errno);
                 mq_close(t);
         return -1;
     }

         printf("Queue %d can take %d messages of %d 
length\n",t,p.mq_maxmsg,
         p.mq_msgsize);
         mq_close(t);

         return 0;
}

Program output is as follows:
tarr@BSDINC-16W>> ./qtest.exe
Failed to create /stuff queue - 2

See if the queue entry was created:
tarr@BSDINC-16W>> ls -al /dev/mqueue/stuff
-rw-rw-rw- 1 tarr None 82176 Jul  8 12:04 /dev/mqueue/stuff

Try again:
tarr@BSDINC-16W>> ./qtest.exe
Failed to create /stuff queue - 0

Note - 1: Machine is a 64 bit running 64bit Windows 7
tarr@BSDINC-16W>> uname -a
CYGWIN_NT-6.1-WOW64 BSDINC-16W 1.7.20(0.266/5/3) 2013-06-07 11:11 i686 
Cygwin
Note - 1: Worked fine on cygwin 1.7.17 using gcc 3.4.4-999
Note - 2: Works fine on 64 bit machine running 32 bit Windows 7 with 
cygwin 1.7.20 and gcc 4.7.3
tarr@BSDINC-5>> uname -a
CYGWIN_NT-6.1 BSDINC-5 1.7.20(0.266/5/3) 2013-06-07 11:11 i686 Cygwin

I have attached a cygcheckout.out as requested.

Any help would be greatly appreciated.

cheers -
Steve Tarr




-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheckout.out
Type: application/octet-stream
Size: 36105 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20130708/667d547d/attachment.obj>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list