7

glibc 仍然没有默认解决 2038 年问题

 2 years ago
source link: https://www.solidot.org/story?sid=70181
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

glibc 仍然没有默认解决 2038 年问题

WinterIsComing (31822)发表于 2021年12月29日 21时31分 星期三 新浪微博分享 豆瓣分享 来自2001太空漫游
距离 2038 年只剩下 16 年了。所谓的 2038 年问题是指类 Unix 系统的时间表示 time_t 使用的是一个 32 位整数,从1970 年 1 月 1 日开始计算秒数,到 2038 年 1 月 19 日 3 时 14 分 07 秒将超过 32 位长度,导致所有使用这种时间表示法的程序停止工作。在 64 位系统上,time_t 使用的是 64 位整数,Linux kernel 在几年前就切换到了 64 位时间表示,微软的 msvcrt 也早就默认使用 64 位 time_t。然而广泛使用的 GNU libc 库虽然从 v2.34 开始支持 64 位 time_t,但并没有默认使用,而是需要明确要求否则不会使用。这意味着今天使用 glibc 的应用在 16 年后可能会出现问题,而 16 年并不意味着天翻地覆一切都变了,如 Windows XP 在发布 16 年后仍然有很多人使用。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK