Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jan 1999 22:46:36 +1100 (EST)
From:      "Daniel O'Callaghan" <danny@hilink.com.au>
To:        "Daniel O'Callaghan" <danny@hilink.com.au>
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: Y2K 
Message-ID:  <Pine.BSF.3.96.990104223002.16026A-100000@enya.clari.net.au>
In-Reply-To: <Pine.BSF.3.96.990103105549.14678B-100000@enya.clari.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help

Well, my audit of *time() calls has turned up something curious.
inetd contains a built-in function for returning the current time in
machine-readable format, as seconds since 1900/1/1.  To convert from Unix
time to this time, 70 years of seconds must be added.  Curiously, the
value is returned as a long, although 70 years is more than 2^31 seconds.
The function still works, as the time is served as 4 bytes in network
order, and signedness is ignored.

However, it did raise the issue of just when the end of the epoch would
come.  Everyone talks about 2038, but no matter how many times I ask my
calculator, it says that 2038 is 2^31 seconds after 1970, and 2^32 seconds
takes us to 2106.  Why can't struct timeval contain long unsigned members
instead of long ints?

Should I convert the inetd machtime() function to be unsigned, for
neatness' sake?  And what about signedness in struct timeval?
Or should I just flag this in my report for fixing before 2034?

Danny


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990104223002.16026A-100000>