From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 19 02:02:09 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 BDD7A37B401 for ; Thu, 19 Jun 2003 02:02:09 -0700 (PDT) Received: from demos.su (mx.demos.su [194.87.0.32]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6697043FAF for ; Thu, 19 Jun 2003 02:02:08 -0700 (PDT) (envelope-from mitya@fling-wing.demos.su) Received: from [194.87.5.69] (HELO fling-wing.demos.su) by demos.su (CommuniGate Pro SMTP 4.1b7/D) with ESMTP-TLS id 76547816; Thu, 19 Jun 2003 13:02:07 +0400 Received: from fling-wing.demos.su (localhost [127.0.0.1]) by fling-wing.demos.su (8.12.9/8.12.6) with ESMTP id h5J9275R098907; Thu, 19 Jun 2003 13:02:07 +0400 (MSD) (envelope-from mitya@fling-wing.demos.su) Received: (from mitya@localhost) by fling-wing.demos.su (8.12.9/8.12.6/Submit) id h5J926YO098906; Thu, 19 Jun 2003 13:02:06 +0400 (MSD) Date: Thu, 19 Jun 2003 13:02:06 +0400 From: Dmitry Sivachenko To: Gary Jennejohn Message-ID: <20030619090206.GC94651@fling-wing.demos.su> References: <20030618162547.GA91861@fling-wing.demos.su> <200306190856.h5J8ufPJ002065@peedub.jennejohn.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200306190856.h5J8ufPJ002065@peedub.jennejohn.org> WWW-Home-Page: http://mitya.pp.ru/ X-PGP-Key: http://mitya.pp.ru/mitya.asc User-Agent: Mutt/1.5.4i 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 09:02:10 -0000 On Thu, Jun 19, 2003 at 10:56:41AM +0200, Gary Jennejohn wrote: > > 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. Yes, that is exactly how I did it. > > 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. I didn't guess that. Probably this is why X-server crashed on my machine after that change. Recompilation fixed the problem. Thank you.