Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Joe Mario <mario@zk3.dec.com>
To: Burkhard Schultheis <bschultheis@tde-online.de>
Subject: Re: Help: Big problems with messaage queues
Date: 1999/05/03	[thread overview]
Message-ID: <372DABD2.15FB@zk3.dec.com> (raw)
In-Reply-To: 372AE3EE.41E19C09@tde-online.de

Burkhard Schultheis wrote:
> 
> we ported our software from AIX to DEC UNIX (until now 4.0B), 
> and now we have big problems with our message queues. 
> Sometimes no program can write to an empty queue. The first 
> few writes are OK, and then the writing program is blocked. 
> On AIX we had never such a problem with message queues. 
> Any ideas?
> Thank you in advance!

Make sure your 'msgsz' buffer is properly specified.  The msgrcv() 
manpage is not clear on the size to specify and unfortunately this
has led to problems.  (The manpage is much clearer in V4.0E).

The 'msgsz' parameter CANNOT be the size of the structure
pointed to by the 'msgp' parameter.  The msgsz parameter is only 
used to specify the size of the msgbuf.mtext field.  It cannot 
include the msgbuf.mtype field or else the msgbuf buffer will
be overwritten.  This is because the kernel first zero-fills the
msgbuf.mtext field.  If the 'msgsz' parameter is the size of 
the (msgbuf.mtext + msgbuf.mtype) fields, then the zero-filling
will go eight bytes beyond the end of the msgbuf.mtext buffer - 
corrupting any data located there.

Joe Mario
Compaq Tru64 Development Environment



           reply	other threads:[~1999-05-03  4:00 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <372AE3EE.41E19C09@tde-online.de>]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox