Subject: Re: struct msgbuf contents.
To: Chris G. Demetriou <cgd@sibyte.com>
From: Simon Burge <simonb@NetBSD.ORG>
List: tech-kern
Date: 06/15/2000 10:11:54
Chris G. Demetriou wrote:

> Simon Burge <simonb@NetBSD.ORG> writes:
> > My plan was to add a sysctl that returns 'struct msgbuf' plus the buffer
> > after that.  Since we already have a sysctl to return the message buffer
> > length, what about a separate sysctl that returns just the contents of
> > the buffer, rearranged if the buffer currently wraps.  This way userland
> > doesn't need to know about 'strcut msgbuf' at all.
> > 
> > Does this sound like a more reasonable solution?
> 
> This is probably a good thing, yes.

Cool.

> > As for re-use of the buffer with different kernel sizes, we could
> > introduce a #define in <machine/types.h> for the type of the msgbuf
> > components.  That way most architectures stay as "long", but
> > sparc/sparc64 (and perhaps mips) can use "int64_t" or whatever they
> > fancy.
> 
> If this is desirable, i guess it makes sense.  Perhaps better would be
> a #define, which is used if defined but otherwise defaults to
> something sane.

That crossed my mind, but what if some random file included
<sys/msgbuf.h> before <sys/types.h> and then didn't see the define?
By making it a mandatory define you wouldn't get this problem...

> (I'm not that keen on proliferation of random types that most ports
> don't need, but either way probably wouldn't matter much.)

Yeah, that's a bit of a concern too...

Simon.