From owner-svn-src-projects@FreeBSD.ORG Wed Jun 24 19:35:32 2009 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3F7A106568B; Wed, 24 Jun 2009 19:35:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BAA948FC21; Wed, 24 Jun 2009 19:35:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 764AA46B8B; Wed, 24 Jun 2009 15:35:32 -0400 (EDT) Date: Wed, 24 Jun 2009 20:35:32 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Bruce Evans In-Reply-To: <20090625050902.S33465@delplex.bde.org> Message-ID: References: <200906241500.n5OF0jTG017766@svn.freebsd.org> <200906241122.08934.jhb@freebsd.org> <20090625050902.S33465@delplex.bde.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-projects@FreeBSD.org, Ulf Lilleengen , src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r194838 - projects/libprocstat/sys/sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 19:35:36 -0000 On Thu, 25 Jun 2009, Bruce Evans wrote: >>> - Use the spare fields instead of expanding the struct. >>> - Use types with known size. >> >> Note that mode_t and dev_t have fixed sizes already and are fine to use, >> same with off_t for the file size. >> >>> From : >> >> typedef __uint16_t __mode_t; /* permissions */ >> typedef __int64_t __off_t; /* file offset */ >> typedef __uint32_t __dev_t; /* device number */ > > I don't agree with using fixed-width types, but it would be difficult to map > opaque types and their padding into the int spares. Only fields of type int > can be mapped properly. struct kinfo_proc also has long and pointer spares > so that more fields can be mapped properly. I've been pondering defining a kptr_t that's 64-bit on all platforms, and adding a sysctl so that userspace can ask what the actual width of a kernel pointer is so that it can render correctly. This woud allow 32-bit userspace tools to print 64-bit kernel pointers as opaque names in situations where that is useful -- both to name kernel objects, and for use with debugging. (For example, for pipe endpoint names). Robert N M Watson Computer Laboratory University of Cambridge