Re: POSIX message queues should not allocate memory on send

From: Jakub Jelinek
Date: Fri May 14 2004 - 04:54:10 EST


On Fri, May 14, 2004 at 11:30:53AM +0100, Martijn Sipkema wrote:
> The default mq_msgsize also seems a little large to me, but
> I don't see why defaults are needed; if I understand the standard
> correctly then creating a new message queue without mq_attr
> should create an empty queue, which thus cannot be used to
> pass messages.

No idea where you found this.

"If attr is NULL, the message queue shall be created with
implementation-defined default message queue attributes."

Empty queue means a message queue which has no messages in it, not
that mq_msgsize and/or mq_maxmsg is 0.
And mq_open with mq_msgsize 0 and/or mq_maxmsg 0 must fail (with EINVAL),
so the implementation-defined defaults IMHO must be > 0 for both
limits.

" The mq_open() function shall fail if:"
...
" [EINVAL]
O_CREAT was specified in oflag, the value of attr is not NULL,
and either mq_maxmsg or mq_msgsize was less than or equal to zero."

Jakub
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/