From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 19 01:57:11 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 61BC637B401 for ; Thu, 19 Jun 2003 01:57:11 -0700 (PDT) Received: from peedub.jennejohn.org (p213.54.218.196.tisdip.tiscali.de [213.54.218.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24B7343FAF for ; Thu, 19 Jun 2003 01:57:10 -0700 (PDT) (envelope-from garyj@jennejohn.org) Received: from peedub.jennejohn.org (localhost [127.0.0.1]) by peedub.jennejohn.org (8.12.9/8.11.6) with ESMTP id h5J8ufPJ002065; Thu, 19 Jun 2003 10:56:58 +0200 (CEST) (envelope-from garyj@peedub.jennejohn.org) Message-Id: <200306190856.h5J8ufPJ002065@peedub.jennejohn.org> X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: Dmitry Sivachenko In-Reply-To: Message from Dmitry Sivachenko <20030618162547.GA91861@fling-wing.demos.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 19 Jun 2003 10:56:41 +0200 From: Gary Jennejohn cc: hackers@freebsd.org Subject: Re: struct ipc_perm X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jun 2003 08:57:11 -0000 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