Most of my readers are potentially responsive to the Y2038 field by now. If not, it refers to three: 14: 07 UTC on January 19, 2038, when 32-bit time_t will overflow. The Linux kernel has internally switched to 64-bit timekeeping a lot of years within the past, and Alpine made the soar to 64-bit time_t with the unlock of Alpine 3.13.

Within the GNU/Linux world, the GNU libc began to provide a grab to 64-bit time_t in model 2.34. Sadly for the leisure of us, the system they’ve frail to provide a grab to 64-bit time_t is technically deficient, following within the footsteps of different by no system-entirely-performed transitions.

the honest system to transition to new ABIs

Within the musl C library, which Alpine uses, and in a lot of different UNIX C library implementations, time_t is always 64-bit in new code, and compatibility stubs are equipped for code requiring the archaic 32-bit functions. As code is rebuilt over time, it automatically turns into Y2038-compliant with out any effort.

Microsoft went one other step extra in msvcrt: you net 64-bit time_t by default, but whenever you bring on the side of the _USE_32BIT_TIME_T macro defined, you would possibly well presumably presumably composed net correct of entry to the archaic 32-bit functions.

It wants to be properly-known that both approaches described above introduce zero friction to net the honest thing.

how GNU handles transitions in GNU libc

The system the GNU accomplishing hang taken for transitioning to new ABIs is the honest opposite: it is vital to explicitly query for the brand new performance, or you would possibly well presumably not ever net it. This style leaves launch the chance for changing the defaults within the damage, but they’ve by no system ever completed this thus a long way.

This would possibly well be seen with the sparkling file give a grab to extension, which is wished to handle files elevated than 2GiB, it is vital to always create your code with -D_FILE_OFFSET_BITS=64. And, similarly, whenever you’re on a 32-bit arrangement, and also you attain not create your app with -D_TIME_BITS=64, it are not built utilizing an ABI that is Y2038-compliant.

Right here is the worst imaginable system to attain this. Accept as true with in thoughts libraries: what if a dependency is built with -D_TIME_BITS=64, and one other dependency is built with out, and so they ought to change struct timespec or identical with every other? Successfully, in this case, your program will doubtless rupture or hang outlandish habits, as you’re not repeatedly utilizing the identical struct timespec in this intention you’ve compiled.

Happily, whenever you are concentrated on 32-bit programs, and also you’d love to manipulate files elevated than 2GiB or hang self perception that your code will continue to work within the twelve months 2038, there are Linux distributions which would possibly well presumably presumably be built on musl, love Alpine, which is able to imply you would possibly well presumably presumably not make a choice on to handle the idiosyncrasies of the GNU libc.