From owner-freebsd-current Thu Aug 1 11:14:38 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA29084 for current-outgoing; Thu, 1 Aug 1996 11:14:38 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id LAA29079 for ; Thu, 1 Aug 1996 11:14:37 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA04278; Thu, 1 Aug 1996 11:12:52 -0700 From: Terry Lambert Message-Id: <199608011812.LAA04278@phaeton.artisoft.com> Subject: Re: Just a note that libkvm/ps/etc need to be recompiled To: wollman@lcs.mit.edu (Garrett Wollman) Date: Thu, 1 Aug 1996 11:12:52 -0700 (MST) Cc: dev@fgate.flevel.co.uk, current@freebsd.org In-Reply-To: <9608011407.AA09584@halloran-eldar.lcs.mit.edu> from "Garrett Wollman" at Aug 1, 96 10:07:51 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > I wonder if it might be an idea to have a kernel call that gets the proc > > structure size, that way libkvm/ps/w etc wouldn`t have to be re-compiled > > when the structure changed? > > The actual size of the structure makes little difference, it's where > the fields are placed in it that is of importance. (You could always > make it self-encoding for size...) Agreed... it's not simply that new fields are being added to the end of the structure; basic structure contents have changes on more than one occasion. Maybe this would work if we had "one final" change in element ordering to put the pieces necessary for ps, w, etc., in an "exposed interface" area in the structure, so that basic structure content changes would not effect the utilities. Even then, this is not a portable approach to the problem; the structure size and the array offset size are often different on many architectures because of structure alignment and packing differences. The structure size and the structure array element offset interval would both need to be read from the kernel. I wonder at the utility of treating a kernel dump as a /dev/kmem image for things like ps and w, anyway... if there is none, then a procfs soloution would seem to be the right way to go. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.