From owner-freebsd-current@FreeBSD.ORG Thu Mar 18 17:56:39 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1AA1216A4CF for ; Thu, 18 Mar 2004 17:56:39 -0800 (PST) Received: from mgr2.xmission.com (mgr2.xmission.com [198.60.22.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9D1443D1D for ; Thu, 18 Mar 2004 17:56:38 -0800 (PST) (envelope-from llewelly@xmission.com) Received: from [198.60.22.201] (helo=mgr1.xmission.com) by mgr2.xmission.com with esmtp (Exim 3.35 #1) id 1B49FW-00054C-02; Thu, 18 Mar 2004 18:56:38 -0700 Received: from [198.60.22.20] (helo=xmission.xmission.com) by mgr1.xmission.com with esmtp (Exim 4.30) id 1B49FV-0001S3-Sk; Thu, 18 Mar 2004 18:56:37 -0700 Received: from llewelly by xmission.xmission.com with local (Exim 3.35 #1 (Debian)) id 1B49FV-0004fY-00; Thu, 18 Mar 2004 18:56:37 -0700 To: Garance A Drosihn References: <40594A35.6060303@exeter.ac.uk> <200403190005.22811.wmmh@identd.net> <200403190057.36638.wmmh@identd.net> From: llewelly@xmission.com Date: 18 Mar 2004 18:56:37 -0700 In-Reply-To: Message-ID: Lines: 35 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Sender: Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on mgr1.xmission.com X-Spam-Level: X-Spam-Status: No, hits=0.3 required=8.0 tests=NO_REAL_NAME autolearn=no version=2.63 X-SA-Exim-Mail-From: llewelly@xmission.com X-SA-Exim-Version: 3.1 (built Wed Aug 20 09:38:54 PDT 2003) X-SA-Exim-Scanned: Yes cc: freebsd-current@FreeBSD.org cc: "Wafa M. Hadidi" Subject: Re: Updating sparc64 time_t, hostname not found X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2004 01:56:39 -0000 Garance A Drosihn writes: [snip] > Programs only know the time_t they were compiled with, so you > would need to recompile them to get a 64-bTT version. Besides, > if you had a 32-bTT kernel with 64-bTT applications, then I > suspect you would see timestamps VERY different than 1970. > (I guess I could check that...). [snip] sparc is big-endian. Most significant bytes are stored at lower addresses. so - let's say we have this date: Thu Mar 18 18:31:39 2004 In 64 bTT hex, it looks like this: 00 00 00 00 40 5a 4d ea The bytes at the low addresses are all 0. If a pointer points to this time_t, but is of type pointer to 32 bTT, only the first 4 bytes of the value will be fetched from memory when the pointer is dereferenced. Those first 4 bytes are all 0, resulting in a date of Jan 1, 1970. At least that's my reasoning - but endians always confuse me. (also, 64 bTT might result in things being in such different places that the pointers point to the wrong thing entirely - so, even if the above reasoning is correct, it's only a possibility.)