qnx std <jabir.kannath@wipro.com> wrote:
Hi,
Problem with “Message Queue Size”.
One of our applications needs to send messages of size greater than
4K over message queue. Whenever we try to do the same, it is failing
to send the message. Please help us to sort out the issue as early
as possible. Issue is described as follows:
Environment:
QNX version 6.2.1 on x86 as well as on SH4 (Biscayne)
Description:
We are able to create a message queue which can handle message size
greater than the default, but unable to send messages over the queue
with size more than the default (4K). Error we are receiving is
“Message too long”
Please find attached the code that we used to test the same.
I found no attached code.
I used the following test case on a 6.3.0 machine (no, not 6.2.1, but
I checked our PR logs, and there is no record of a bug fix/change for
this behaviour, so I would expect the same behaviour).
#include <stdio.h>
#include <string.h>
#include <mqueue.h>
#include <errno.h>
char buf[8192];
int main()
{
int mq_d;
struct mq_attr mqattr;
int ret;
memset(&mqattr, 0, sizeof(mqattr));
mqattr.mq_maxmsg = 10;
mqattr.mq_msgsize = 8192;
mqattr.mq_flags = O_NONBLOCK;
mq_d = mq_open("/myqueue", O_CREAT|O_RDWR, 0666, &mqattr);
printf(“mq_open returned %d, errno %d\n”, mq_d, errno );
ret = mq_send(mq_d, buf, 8192, 10);
printf(“send of 8192 bytes returned %d, errno %d\n”, ret, errno );
ret = mq_receive(mq_d, buf, 8192, NULL);
printf(“receive of 8192 bytes returned %d, errno %d\n”, ret, errno);
return 0;
}
Please try this, or post (cut & paste or include in the text of
your message, not as an attachment) your (simple) code that fails.
-David
QNX Training Services
http://www.qnx.com/services/training/
Please followup in this newsgroup if you have further questions.