From owner-freebsd-sparc Fri Aug 9 8:55:13 2002 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAC4237B400 for ; Fri, 9 Aug 2002 08:55:10 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 38A7E43E6E for ; Fri, 9 Aug 2002 08:53:01 -0700 (PDT) (envelope-from tmoestl@gmx.net) Received: (qmail 26239 invoked by uid 0); 9 Aug 2002 15:52:12 -0000 Received: from pd9e16db4.dip.t-dialin.net (HELO forge.local) (217.225.109.180) by mail.gmx.net (mp010-rz3) with SMTP; 9 Aug 2002 15:52:12 -0000 Received: from tmm by forge.local with local (Exim 3.36 #1) id 17dC4T-0001Fs-00; Fri, 09 Aug 2002 17:53:01 +0200 Date: Fri, 9 Aug 2002 17:52:59 +0200 From: Thomas Moestl To: Patrick Cc: sparc@FreeBSD.ORG Subject: Re: vmstat Message-ID: <20020809155258.GA341@crow.dom2ip.de> Mail-Followup-To: Patrick , sparc@FreeBSD.ORG References: <20020809145030.20772.qmail@vpop.dmv.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020809145030.20772.qmail@vpop.dmv.com> User-Agent: Mutt/1.4i Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, 2002/08/09 at 10:50:29 -0400, Patrick wrote: > I've been looking into the issue with vmstat not working properly,and I've > narrowed it down to the getuptime() routine. > > if (boottime == 0) > kread(X_BOOTTIME, &boottime, sizeof(boottime)); > > > After the kread function, boottime is equal to 0, which fails. Yes, this is a type mismatch between userland (time_t == int) and kernel (struct timeval, where the first member tv_sec, in which vmstat is interested, is a long). Since sparc64 is big-endian, retrieving the time_t would read the most significant 32 bit of boottime.tv_sec, which were of course 0. I've just fixed this in CVS, thanks for the report! - thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message