Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jun 2003 10:56:41 +0200
From:      Gary Jennejohn <garyj@jennejohn.org>
To:        Dmitry Sivachenko <mitya@cavia.pp.ru>
Cc:        hackers@freebsd.org
Subject:   Re: struct ipc_perm 
Message-ID:  <200306190856.h5J8ufPJ002065@peedub.jennejohn.org>
In-Reply-To: Message from Dmitry Sivachenko <mitya@cavia.pp.ru>  <20030618162547.GA91861@fling-wing.demos.su> 

next in thread | previous in thread | raw e-mail | index | archive | help

Dmitry Sivachenko writes:
> On Wed, Jun 18, 2003 at 06:08:37PM +0200, Gary Jennejohn wrote:
> > 
> > Dmitry Sivachenko writes:
> > > Hello!
> > > 
> > > Is there any reason why struct ipc_perm is not protected by #ifdef _KERNE
> L
> > > in ipc.h?  Is it supposed to be used from userland?
> > > 
> > 
> > It's needed by ipcs.
> > 
> 
> Ah, I see.  It is visible via struct msqid_ds.
> 
> I developed a patch which requires addition of custom field to ipc_perm.
> I am trying to imagine which problems can it cause to userland programs.
> 
> Any ideas?
> 

The usual way to handle this sort of change is to put any new structure
elements at the end so that existing applications don't get confused.
They simply aren't aware the new elements were added.

Of course, this can cause problems when the kernel does a copyout()
using the new size but the application passed a pointer to
storage which can only hold the old, smaller structure.

---
Gary Jennejohn / garyj[at]jennejohn.org gj[at]freebsd.org gj[at]denx.de



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306190856.h5J8ufPJ002065>