Date: Thu, 25 Jun 2009 05:20:42 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: John Baldwin <jhb@FreeBSD.org> Cc: svn-src-projects@FreeBSD.org, Ulf Lilleengen <lulf@FreeBSD.org>, src-committers@FreeBSD.org Subject: Re: svn commit: r194838 - projects/libprocstat/sys/sys Message-ID: <20090625050902.S33465@delplex.bde.org> In-Reply-To: <200906241122.08934.jhb@freebsd.org> References: <200906241500.n5OF0jTG017766@svn.freebsd.org> <200906241122.08934.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 24 Jun 2009, John Baldwin wrote: > On Wednesday 24 June 2009 11:00:45 am Ulf Lilleengen wrote: >> >> Log: >> - 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 <sys/_types.h>: > > 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. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090625050902.S33465>