Help needed with System V message queues

Helge Egelund Rasmussen her at compel.UUCP
Tue Aug 7 00:30:36 AEST 1990


I want to send long messages via a System V message queue. This is done by 
the msgsnd system call. Because of this, I need to determine the max length
of a single message. 

The 'msgctl' call can return a value called 'msg_qbytes' which is described
as 'the maximum number of bytes allowed on the queue'. This value is 4096 on
our system.

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.

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???

I'm using Interactive Unix v.3.2.

Questions:
   - Is MSGMAX the size of the biggest message I can send?
   - If so, what on earth do I use 'msg_qbytes' for?
   - How do I get the current value of MSGMAX in my program?

I've tried to RTFM, but it didn't help. So, PLEASE, help....

Helge
----
Helge E. Rasmussen  .  PHONE + 45 31 37 11 00  .  E-mail:  her at compel.dk
Compel A/S          .  FAX   + 45 31 37 06 44  .  
Copenhagen, Denmark



More information about the Comp.unix.wizards mailing list