Yuri Chernyavsky
01/18/2010 5:11 AM
post45369
|
Hi,
I am using a Freescale i.mx35 board. I try to open a mq queue.
I first issue the "mq" command on my board. I see that the directory /dev/mq appears.
Then I execute the code below. The call to mq_open returns error code 89 (ENOSYS)
What did I do wrong?
Note that the same code works for me when run from within a io_net shim driver.
Thanks.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <mqueue.h>
#define QUEUE_MESSAGE_SIZE 2048
static mqd_t open_queue(char *name)
{
mqd_t queue;
struct mq_attr attr;
printf("OPENING QUEUE %s\n", name);
memset((void*)&attr, 0, sizeof(struct mq_attr));
attr.mq_maxmsg = 128;
attr.mq_msgsize = QUEUE_MESSAGE_SIZE;
queue = mq_open(name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR, &attr);
if (queue == -1)
printf("Couldn't open queue error is %s(%d)\n", strerror(errno), errno);
return queue;
}
int main(int argc, char **argv)
{
printf("MAIN!!!\n");
open_queue("/tmpq");
return 0;
}
|
|
|