05-21-07 06: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?
"));
[ Post a follow-up to this message ]
|