Subj : Re: Operating Systems To : Digital Man From : tenser Date : Wed Apr 17 2024 02:43 am On 12 Apr 2024 at 11:29a, Digital Man pondered and said... DM> Re: Re: Operating Systems DM> By: tenser to claw on Sat Apr 13 2024 02:39 am DM> DM> > There's a lot of software out there, written 20 or 30 years DM> > ago, that made a lot of assumptions about the state of the DM> > world; there were a lot of programmers who thought to DM> > themselves in 1991, "Gee, the year 2038 is a long time from DM> > now..." and took shortcuts. DM> DM> Speaking for myself at least, I started using time_t types for storing DM> dates and times in C programs in 1988 and wasn't even aware that it DM> would ever roll-over (go negative) at any point. I don't think I DM> actually realized that most time_t's are signed (can go negative) and DM> that for those systems (C libraries), dates before Jan-1-1970 are DM> *suppoosed* to representable in that way (as negative valeus). [libraies DM> that use unsigned time_t's cannot represent dates before Jan-1-1970] And DM> I'm pretty sure it was 1992 when I did the math and realized that 2038 DM> and 2106 are going to be problematic years for 32-bit time_t-based DM> libraries/programs. It was certainly not discussed in the programming DM> books or among C programmers of the era. We weren't taking shortcuts, we DM> were just following the norms. Use of 64-bit integers for most things DM> seemed excessive/wasteful and in many environments (e.g. 16-bit systems) DM> not practical or even possible. -- Using time_t was less the "shortcut" issue that I was thinking of, and more people doing things like casting back and forth between various int types. Disciplined use of `time_t`, and not making a lot of assumptions about size of that type, makes the problem tractable in programs for which one has the source. The VMS people warned us about this a long time ago; certainly in the 80s. DEC engineering famously had a bug that they kept open that said something like, "VMS dates won't work after the year 9999." I distinctly remember people talking about 2038 in the runup to Y2K and the consensus was mostly, "meh, we'll fix it before then." In the 32-bit era, we had more pressing issues, like running out of address space, or the UID space rolling over on big installations. --- Mystic BBS v1.12 A48 (Linux/64) * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101) .