Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: Y2K



The linux kernel as such is Y2k-safe. When I studied the Y2k problem
and Linux and our app (runs on Linux) I found that the major, and I
maybe even the only, source of Y2k related problems in Linux and C/C++
base applications on Linux is the tm struct and specifically the
tm.tm_year member of the struct. 
tm.tm_year contains number of years since 1900 and it is tempting
to write code like:
   printf("Year: %2.2d",tm.tm_year); // Year w. 2 digits
or even:
   printf("Year: 19%2.2d",tm.tm_year); // Year w. 4 digits
(The correct way would of course be to add 1900 to tm.tm_year and
 then display the value).
I have grepped the Linux kernel and most common apps for tm_year and
found no bugs. I believe that there used to be a bug in older versions
of the kernel or some small app like ls but that has been fixed since
long. 
The rest is usually not a problem since it is very natural to use
time_t for time/date representation in Linux/Unix systems.

As for the PC hardware it is not Y2k-safe in the sense that there
are only 2 digits in the CMOS-clock for year. This is not a problem
for Linux (or any other OS I have tested) since any year value smaller
than 70 is assumed to mean 2000-2070 and any year greater than 70 is
assumed to mean 1971-1999. Works like a charm until most of us
are dead or at least since long retired.
The problem with the PC hardware might be the BIOS that will not
allow to set the time to a year later than 1999, but why would you
need the BIOS to do that?

I may be overconfident but I do not fear the Y2k problem and I am
responsible for a product that use Linux as OS. We have passed all
Y2k test made by us and by our customers with flying colors.

/Fredric

Yong-Ming Hua wrote:
> 
> Dear members,
> 
>     At my university, all sorts of PC related warnings and advises
> about Y2K problems are going around recently(yes, there was dead
> silence last year but so noisy right before Year 2000). Well most
> of them are about PC-OS, Microsoft applications, etc.
>     I just want to know if there is anything I have to keep my eye
> on in this Linux world. I am aware of the fact that I have to re-check
> all those scripts I have written, that is root scrips, and also
> those Java codes, cgi, that have time handling... but maybe much more
> I am not aware!!! So I am getting rather nervous. I need info.
> 
> Yong-Ming
> 
>         _____________________________________________________
> _/_/_/_/FROM THE OFFICE OF YONG-MING HUA(YMH CAL LABORATORY)_/_/_/_/
> _/e-mail: yhua@example.com                          _/
> _/Office Tel:(Jpn)(0)42-739-8132  Fax:(Jpn)(0)42-739-8847         _/
> _/A Word from YMH CAL LAB: Help those with Terminal Illness       _/
> _/They need your love. http://www.kelvin.lit.tamagawa.ac.jp       _/
> _/_/_/_/_/_/_/_/_/_/Home Tel & Fax:(Jpn)(0)3-3485-0171 /_/_/_/_/_/_/
> -------------------------------------------------------------------
> Next Nomikai: December 17 (Fri), 20:00 Tengu TokyoEkiMae 03-3275-3691
> Next Technical Meeting: January 14 (Fri) 19:00
> * Topic: "glibc - current status and future developments"
> * Guest Speaker: Ulrich Drepper (Cygnus Solutions)
> * Place: Oracle Japan HQ 12F Seminar Room (New Otani Garden Court)
> -------------------------------------------------------------------
> more info: http://www.tlug.gr.jp        Sponsor: Global Online Japan
begin:vcard 
n:Fredricson;Fredric
tel;fax:+46 8 475 55 01
tel;work:+46 8 475 55 21
x-mozilla-html:FALSE
url:www.mydata.se
org:MYDATA automation AB;Development
adr:;;Adolfsbergsvägen 11;BROMMA;Stockholm;SE-168 66;Sweden
version:2.1
email;internet:fredric@example.com
title:Manager System Software R&D
fn:Fredric Fredricson
end:vcard

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links