mq_open fails when message queue attributes are set

Erich Dollansky erichsfreebsdlist at alogt.com
Tue Sep 16 03:32:54 UTC 2014


Hi,

I try to use message queues but do not have much luck yet.

I initialised Attributes like this:

char Message [1024];

memset (&Attributes, 0, sizeof (Attributes));
Attributes.mq_maxmsg = 1024;
Attributes.mq_msgsize = sizeof (Message);

The following code fails:

Queue = mq_open ("/testqueue", O_RDWR | O_CREAT | O_EXCL, 644,
&Attributes);

errno is set to 22 (Invalid argument).

When I replace &Attributes with NULL, it will work.

The size of Message does not matter.

My old error not having the message queues in the kernel is corrected.

What do I miss?

Erich


More information about the freebsd-stable mailing list