From owner-freebsd-arch@FreeBSD.ORG Thu Apr 19 22:27:48 2007 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B948316A407 for ; Thu, 19 Apr 2007 22:27:48 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (keira.kiwi-computer.com [63.224.10.3]) by mx1.freebsd.org (Postfix) with SMTP id 3A1DB13C43E for ; Thu, 19 Apr 2007 22:27:48 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: (qmail 64045 invoked by uid 2001); 19 Apr 2007 22:01:06 -0000 Date: Thu, 19 Apr 2007 17:01:06 -0500 From: "Rick C. Petty" To: Diomidis Spinellis Message-ID: <20070419220106.GA63814@keira.kiwi-computer.com> References: <461958CC.4040804@aueb.gr> <20070414170218.M76326@fledge.watson.org> <4621E826.6050306@aueb.gr> <20070415105157.J84174@fledge.watson.org> <46231C64.9010707@aueb.gr> <20070419101815.Y2913@fledge.watson.org> <4627A6C3.2070409@aueb.gr> <20070419212253.L2913@fledge.watson.org> <4627E311.6080500@aueb.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4627E311.6080500@aueb.gr> User-Agent: Mutt/1.4.2.1i Cc: arch@FreeBSD.org Subject: Re: Accounting changes X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd@kiwi-computer.com List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2007 22:27:48 -0000 On Fri, Apr 20, 2007 at 12:45:53AM +0300, Diomidis Spinellis wrote: > > If we follow the route of allowing the records to be read from both > ends, we'll have to think of a construct that will portably maintain > ac_flags at the same offset from the end as in the old struct acct. > Proposals welcomed! How about rearranging the struct to have the fixed-sized fields first, followed by the variable-sized fields. In fact I thought that was the recommended practice.. i.e.: > struct nacct { > u_int8_t ac_zero; /* zero identifies new version */ > u_int8_t ac_version; /* record version number */ > u_int16_t ac_len; /* record length */ > > char ac_comm[AC_COMM_LEN]; /* command name */ > u_int16_t ac_len2; /* record length */ > u_int8_t ac_flag; /* accounting flags */ > float ac_utime; /* user time */ > float ac_stime; /* system time */ > float ac_etime; /* elapsed time */ > time_t ac_btime; /* starting time */ > uid_t ac_uid; /* user id */ > gid_t ac_gid; /* group id */ > float ac_mem; /* average memory usage */ > float ac_io; /* count of IO blocks */ > __dev_t ac_tty; /* controlling tty */ -- Rick C. Petty