I have written this code to make a POSIX message queue, but I am receiving an error:
"Function not implemented".
This platform, QNX, is supposed to support message queues.
Can someone please explain?
#include <fcntl.h>
#include <mqueue.h>
#define DIAG_CLIENT "/DIAG_CLIENT"
#define MAX_MSG_SIZE 4096
#define MAX_MSGS 1024
mqd_t msg_queue = -1;
struct mq_attr attrs;
void
message_init()
{
memset(&attrs, 0, sizeof(attrs));
attrs.mq_maxmsg = MAX_MSGS;
attrs.mq_msgsize = MAX_MSG_SIZE;
msg_queue = mq_open(
DIAG_CLIENT, O_RDWR | O_CREAT | O_NONBLOCK, S_IRWXU | S_IRWXG, &attrs);
LOG("create or open msg_queue_log msg_queue:%d", msg_queue);
if (msg_queue == -1) {
ERR("create or open msg_queue failed! err=%d", errno);
}
}
And use this setting in my common.mk file:
LIBS += mq