Tips and tricks: What is the 2038 bug? Is my system affected? How do I fix this issue?

摘自: www.redhatmagazine.com  被阅读次数: 114


yangyi 于 2008-04-01 19:50:40 提供


by the editorial team

Saturday, January 19th 2008, will mark the 30 year countdown to the Y2K38 wraparound of regular 32-bit UNIX time. UNIX internal time is stored in a data structure using a long int, containing the number of seconds since 1970. On a 32-bit machine this value is sufficient to store time up to the 18th of January 2038. After this date 32-bit clocks will overflow and return false values.

Exposure to this bug is limited right now to 32-bit applications that rely on the time_t data type. Applications must also be calculating time 30 years in the future, so applications that run financial forecasts, or long-term mortgage interest calculations may be impacted by this limitation.

If an application that falls into this category, the immediate solution is to migrate that application to a 64-bit platform. When dealing with a 64-bit program, a time_t can hold a date and time in the future out to the year 292,000,000,000, eliminating this issue.

Red Hat’s customer service and support teams receive technical support questions from users all over the world. Red Hat technicians add the questions and answers to Red Hat Knowledgebase on a daily basis. Access to Red Hat Knowledgebase is free. Every month, Red Hat Magazine offers a preview into the Red Hat Knowledgebase by highlighting some of the most recent entries. The information provided in this article is for your information only. The origin of this information may be internal or external to Red Hat. While Red Hat attempts to verify the validity of this information before it is posted, Red Hat makes no express or implied claims to its validity.

Original link: http://www.redhatmagazine.com/20...