From owner-freebsd-hackers Fri Aug 14 19:35:40 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA05695 for freebsd-hackers-outgoing; Fri, 14 Aug 1998 19:35:40 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA05685 for ; Fri, 14 Aug 1998 19:35:37 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id MAA06416; Sat, 15 Aug 1998 12:05:00 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.1/8.9.0) id MAA21751; Sat, 15 Aug 1998 12:04:46 +0930 (CST) Message-ID: <19980815120445.C21662@lemis.com> Date: Sat, 15 Aug 1998 12:04:45 +0930 From: Greg Lehey To: Tim Vanderhoek , Matthew Hunt , Ivan Brawley , hackers@FreeBSD.ORG Subject: Re: 64-bit time_t References: <199808131721.KAA00864@antipodes.cdrom.com> <199808140040.KAA14156@mad.ct> <19980814000605.A25012@astro.psu.edu> <19980814135919.U1921@freebie.lemis.com> <19980814114525.B4001@zappo> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <19980814114525.B4001@zappo>; from Tim Vanderhoek on Fri, Aug 14, 1998 at 11:45:25AM -0400 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Friday, 14 August 1998 at 11:45:25 -0400, Tim Vanderhoek wrote: > On Fri, Aug 14, 1998 at 01:59:19PM +0930, Greg Lehey wrote: >> >> More to the point, time_t *can* be used to represent BE (Before Epoch) >> dates. Make it unsigned and you break that. > > "time_t is a format for the system current time. As such, you're > abusing it mightily if you expect it to be a general-purpose time > value." - Mike Smith Yes, I read that. That doesn't mean that I agree with it. I don't. But even if it were true, it wouldn't be a valid argument. One problem UNIX has is that there is no standardized format for representing times. There is no sensible reason to use one format for representing system times, one (inconvenient) format for representing times more accurately (down to only 1 microsecond, when it could have been down to a nanosecond), and one format broken down into representations of the individual units of time. None are of any use when I want to know "How many seconds has it been since my grandfather was born?". time_t *will* answer the question "How many seconds has it been since my father was born?". Moving to 64 bits creates a number of opportunities to improve this situation: 1. Make it an extended time_t and you can measure time from before the big bang until after the predicted collapse of the universe. 2. Make it a merged struct timeval (i.e. tv_usec + 1000000 * tv_sec) and you have a *useful* replacement for both time_t and struct timeval which will still measure time from before the beginning of recorded history to at least the release of FreeBSD 3.0. 3. Make it (2) * 1000 and base it on the year 2000 (just to rub it in) and you can measure time to the nearest nanosecond from 1708 to 2292. Of course, for this to make *any* sense at all, it should be a format that everybody accepts. Otherwise we've just made the matter worse. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message