I have an application made up of several tasks for managing a Time
Division Multiplexer network. One is a "mail" task. Each task creates
its own message queue and only reads its own queue. When one task wants
to send a message to another, it puts it on mail's queue and mail puts
it on the designated task queue.

This is done with msgsnd(..., ..., IPC_NOWAIT). On failure, mail sleeps
for 1 second and tries again.

There is a condition, I'm not sure what brings it on, where msgsnd()
fails with EACCESS. It may be a flood of messages from the
communication task to the UI task with network failure messages.
However I do a dump at that time to view how much data are on the
queues and how many messages.

The target queue is not near msg_qbytes. msg_qbytes is 16384 and
msg_cbytes is about 7000 to 8000 but less than 8192. On each try the
number of messages on mail's queue continues to increase. msg_cbytes
and msg_qnum decrease for the target queue but I continue to get the
EACCESS error. I have seen on occasion where one failure will occur and
then work on the next retry.

Since the total number of messages continues to increase after the
first failure, I don't think I have reached the max number of messages
for all queues system wide, although I don't know what that is. It's a
system imposed limit. The number of messages at the first failure is
about 62 and increases to about 72. It doesn't increase past this. Most
likely because mail is stuck, no send command messages are placed on
the comm task queue. Therefore no more messages from comm to process.
Other task queues decrease to 0 and mail has about 72 messages with
about 8k of data, again but less than 8192. These don't seem like like
values that would be limits. I don't see the size value being passed to
msgsnd() being corrupted to a large value. The message size at the time
is 127. Nor do I see msg_qbytes being corrupted to a small value to
prevent the send.

It appears as an O/S bug since the values I see are less than what
would cause an EACCESS error but I doubt it is. It seems like it would
occur more if it was.

Is there anything besides what's in the man page for msgsnd as to why
EACCESS would occur? What is the system imposed limit for max messages
on all queues system wide?

Thanks for any help.

Don