From owner-freebsd-current@FreeBSD.ORG Mon Jul 12 05:50:33 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D8B516A4CE for ; Mon, 12 Jul 2004 05:50:33 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56AD543D48 for ; Mon, 12 Jul 2004 05:50:33 +0000 (GMT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 4B4B25C89B; Sun, 11 Jul 2004 22:50:33 -0700 (PDT) Date: Sun, 11 Jul 2004 22:50:33 -0700 From: Alfred Perlstein To: Garance A Drosihn Message-ID: <20040712055033.GA95729@elvis.mu.org> References: <20040712041539.GW95729@elvis.mu.org> <20040712045053.GY95729@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i cc: current@freebsd.org Subject: Re: nevermind Re: allocating a spare from kinfo_proc. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2004 05:50:33 -0000 * Garance A Drosihn [040711 22:23] wrote: > At 9:50 PM -0700 7/11/04, Alfred Perlstein wrote: > >Sorry, got this done now. > > > >tested on sparc64, alpha and i386. > > > >* Alfred Perlstein [040711 21:15] wrote: > >> I would like to allocate a void * "user pointer" from struct > >> kinfo_proc. > >> > > > This is for convience of programs that want to retrieve a > > > kinfo_proc but also compute some information and hang it > > > from the kinfo proc. > > Fwiw, /bin/ps does this by creating it's own struct which has a > 'struct kinfo_proc' as one variable inside of it. However, this > means that `ps' has to copy all the kinfo_proc's that the kernel > returns into an array of these other structs. Depending on what > the program is doing with those kinfo_proc's, this new variable > would probably make more sense. Yeah, maybe ps can be fixed now. :) > > > Are there any guidelines for adjusting this struct that I > > > should be aware of? > > It would be nice to make sure that alignment issues are not wasting > space on *any* of the platforms. When I made my recent changes to > user.h, I had a program which printed out all the variables and > their alignments. If I have time this week I will update that > program and see what it says on the different hardware platforms. I think we're ok since sizeof(long) == sizeof(void *) on all the platforms I could test. And the compiler is likely to align a new pointer in that location in the same spot as the array. At least it would make sense if it did. :) -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684