From owner-freebsd-arch@FreeBSD.ORG Wed Jan 5 02:58:33 2005 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 79FFA16A4CE; Wed, 5 Jan 2005 02:58:33 +0000 (GMT) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6660543D55; Wed, 5 Jan 2005 02:58:33 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id 5833372DD4; Tue, 4 Jan 2005 18:58:33 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id 5359172DCB; Tue, 4 Jan 2005 18:58:33 -0800 (PST) Date: Tue, 4 Jan 2005 18:58:33 -0800 (PST) From: Doug White To: Pawel Jakub Dawidek In-Reply-To: <20050104224043.GM784@darkness.comp.waw.pl> Message-ID: <20050104183627.O20855@carver.gumbysoft.com> References: <20050104224043.GM784@darkness.comp.waw.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org cc: scottl@freebsd.org Subject: Re: BigDisk project: du(1) 64bit clean. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2005 02:58:33 -0000 On Tue, 4 Jan 2005, Pawel Jakub Dawidek wrote: > I want you to look at two patches which makes du(1) 64bit clean. > This work is part of the BigDisk project: > > http://www.freebsd.org/projects/bigdisk/ > > The main problem here is that du(1) uses fts(3) and fts_number field from > one of its structures to store size. > This field is defined as 'long' so it doesn't give us what we want > (on 32bit archs). No offense intended, but can we avoid introducing LP64 bugs, please? Particularly when the goal is "ABI compatibility."* dwlab3,ttyp1,~,24>uname -m i386 dwlab3,ttyp1,~,25>./test sizeof(long) [4] + sizeof(void *) [4] == 8 == sizeof(int64_t) [8] ok .. but: dwlab4,ttyp1,~,20>uname -m amd64 dwlab4,ttyp1,~,21>./test sizeof(long) [8] + sizeof(void *) [8] == 16 != sizeof(int64_t) [8] oops! The struct just grew by 8 bytes! (*) On the same platform, obviously. -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org