From owner-freebsd-stable Fri Jun 1 16:18:20 2001 Delivered-To: freebsd-stable@freebsd.org Received: from bunrab.catwhisker.org (adsl-63-193-123-122.dsl.snfc21.pacbell.net [63.193.123.122]) by hub.freebsd.org (Postfix) with ESMTP id 5AEF037B422 for ; Fri, 1 Jun 2001 16:18:17 -0700 (PDT) (envelope-from david@catwhisker.org) Received: (from david@localhost) by bunrab.catwhisker.org (8.10.0/8.10.0) id f51NI8w38590 for stable@freebsd.org; Fri, 1 Jun 2001 16:18:08 -0700 (PDT) Date: Fri, 1 Jun 2001 16:18:08 -0700 (PDT) From: David Wolfskill Message-Id: <200106012318.f51NI8w38590@bunrab.catwhisker.org> To: stable@freebsd.org Subject: Re: time_t definition is worng In-Reply-To: <200106012300.f51N0VT90830@earth.backplane.com> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >Date: Fri, 1 Jun 2001 16:00:31 -0700 (PDT) >From: Matt Dillon >:I never understood why it isn't at _least_ made unsigned. This at least >:puts off the 2038 issue until 2106. I may live to see the former, but >:certainly not the latter. :-) > Historically people compared time stamps by subtracting one from > another. Which is a practice that the difftime() function was invented to replace. > If they are unsigned, that breaks horribly (you never get > a negative result). Ummm. With respect, I think the excerpt from "man 3 time" that reads: Upon successful completion, time() returns the value of time. Otherwise a value of ((time_t) -1) is returned and the global variable errno is set to indicate the error. is probably a more significant restriction: both could be gotten around if time_t were unsigned, but in the mean time (no pun intended!), I suspect that a lot of naively-coded applications would break mysteriously. > Internally there is nothing preventing us from > treating time_t as an unsigned, er, long. Well, I don't write much code (and never have written a lot of it), so please feel free to take what I wrote with an appropriately-sized "grain of salt". But it may be worth noting (iin this context) that the result of difftime() is a double. :-} Cheers, david -- David H. Wolfskill david@catwhisker.org As a computing professional, I believe it would be unethical for me to advise, recommend, or support the use (save possibly for personal amusement) of any product that is or depends on any Microsoft product. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message