msgop.2: Enhance description of "full queue" criteria

Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Davidlohr Bueso 2014-05-16 14:26:25 +02:00 committed by Michael Kerrisk
parent be6752b65a
commit 64190fa613
1 changed files with 19 additions and 3 deletions

View File

@ -105,13 +105,29 @@ by
If sufficient space is available in the queue,
.BR msgsnd ()
succeeds immediately.
(The queue capacity is defined by the
.I msg_qbytes
The queue capacity is governed by the
.I msg_qbytes
field in the associated data structure for the message queue.
During queue creation this field is initialized to
.B MSGMNB
bytes, but this limit can be modified using
.BR msgctl (2).)
.BR msgctl (2).
A full queue is defined by two factors :
.IP * 2
The new msg size + current size of the queue is greater than the
queue's maximum size (the
.I msg_qbytes
field).
.IP *
The current amount of messages in the queue + 1 (the new msg) is
greater than the queue's maximum size (the
.I msg_qbytes
field). This is necessary to prevent users from using infinite
amounts of locked memory (used by the kernel for headers) by
sending 0-byte messages. This is equivalent to the traditional
MSGTQL parameter present in many Unix systems. This behavior
is unique to Linux.
.PP
If insufficient space is available in the queue, then the default
behavior of
.BR msgsnd ()