Unix Programming - cannot open POSIXmessage queue (mq_open

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > May 2007 > cannot open POSIXmessage queue (mq_open





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author cannot open POSIXmessage queue (mq_open
yoni64@gmail.com

2007-05-21, 1:19 pm

Hi
I encounter a problem opening POSIX message queue.
I am using Red Hat Linux version 2.6.9-42.0.10.ELsmp.
I compile my code with gcc(Red Hat 3.4.6-3) with -lrt flag.
I wrote the following code to open the message queue

mqd_t msgq;
struct mq_attr mqstat;

memset(&mqstat,0,sizeof(mqstat));
mqstat.mq_maxmsg = 100;
mqstat.mq_msgsize = sizeof(DEV_MSG_T); /* = 8 */
/* create sender queue */
msgq = mq_open("/rfu3",O_CREAT | O_RDWR, 0666,&mqstat);
DM_ASSERT(msgq == (mqd_t)-1,ERROR,printf("errno = %d
\n",errno);perror("cannot open queue"))


This code always fails. msgq always return -1 and errno is 22 (EINVAL
- Invalid parameters)

Can anyone help - please?

"));

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com