I have written this code to make a posix message queue. But I am receiving an error "Function not implemented".
Q1. Is it a platform related issue ? [Am using Ubuntu 10.10] I read somewhere that I need to rebuild my kernel to enable message queues !?
Q2. I also read something about starting the mqueue server before actually using message queues ?
Can someone please explain..
#include <mqueue.h> /* message queue stuff */
#include <iostream>
#include <unistd.h> /* for getopt() */
#include <errno.h> /* errno and perror */
#include <fcntl.h> /* O_flags */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
int main(int argc, char **argv)
{
mqd_t msgQueueDescriptor;
mq_attr attr;
char Msg[]="msg";
attr.mq_maxmsg = 10;
attr.mq_msgsize = sizeof(Msg);
attr.mq_flags = 0;
msgQueueDescriptor = mq_open("/myQueue", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH , attr );
cout << msgQueueDescriptor << " " << errno << " " << strerror(errno);
mq_close(msgQueueDescriptor);
return 0;
}