Help needed with System V message queues
christopher.l.kirby
clk at cbnewsl.att.com
Wed Aug 8 01:52:26 AEST 1990
In article <1169 at compel.UUCP> her at compel.UUCP (Helge Egelund Rasmussen) writes:
>
[...]
>However, if I send a message with this length, I get return status -1 and
>errno = EINVAL, indicating that the message size is too big.
>My program works with a max length of 2000 bytes.
>
>I've found a tunable parameter called MSGMAX (current value 2048), which may
>be the actual max message size.
It is.
>
>The funny thing is that the max value that I can give MSGMAX is 8192, which
>is greater than 'msg_qbytes' (4096). Does this mean that it is possible to
>send messages that are bigger than the message queue???
The max value of MSGMAX, according to the AT&T SVR3.2 SysAdmin guide,
is "64 kilobytes - 1". If you try to send a message which will
cause the queue length to be > msg_qbytes, one of the following
actions will be taken:
- If you have specified flag IPC_NOWAIT, msgsnd() will return
EAGAIN.
- Otherwise, the call will block until one of a set of conditions
is true. See the man page for msgop(2).
>
>I'm using Interactive Unix v.3.2.
>
>Questions:
> - Is MSGMAX the size of the biggest message I can send?
Yes.
> - If so, what on earth do I use 'msg_qbytes' for?
You should use the tunable MSGMNB to get the desired queue size.
Or, you can run as super-user, and use msgctl() with IPC_SET
to raise msg_qbytes for your particular queue.
> - How do I get the current value of MSGMAX in my program?
Not sure about that one.
>
>I've tried to RTFM, but it didn't help. So, PLEASE, help....
>
>Helge
=====================================================================
Chris Kirby AT&T Bell Laboratories, Summit, NJ 07901
clk at attunix.att.com
More information about the Comp.unix.wizards
mailing list