[TUHS] The 2038 bug...

Warner Losh imp at bsdimp.com
Tue Jan 5 07:56:46 AEST 2021


On Mon, Jan 4, 2021 at 2:50 PM Dave Horsfall <dave at horsfall.org> wrote:

> On Mon, 4 Jan 2021, Peter Jeremy wrote:
>
> > Alternatively, my understanding is that the Unix epoch changed on
> > several occasions in the early days.  Presumably the knowledge of how to
> > achieve this hasn't been lost.  (Though actually performing an epoch
> > rollover may be more difficult today).
>
> My understanding is that it's been 1st Jan 1970 since at least Ed5, if not
> Ed6.
>

It's been that way since the 4th edition.

In the 3rd edition it was the number of 60Hz ticks since 1972, along with
this note: "This guarantees a crisis every 2.26 years."

Rebasing the epoch would be...  tricky... lots of math is done assuming an
origin of 1970, and not all of it is obvious to even concerted analysis.

Less ugly would be to declare time_t to be unsigned instead of signed...
It would break less code... Making time_t 64 bits also breaks code, even if
you declare you don't care about binary compat since many older apps know
time_t is 32-bits.

Warner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20210104/8eecce78/attachment-0001.htm>


More information about the TUHS mailing list