Mailing List Archive

Support open source code!


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

Re: tlug: Y2K




"Eric S. Standlee" wrote:
> 
> Hi gang, hows'it?
> 
> I need to get my hands on some good information about the Y2K problem and
> of course how it relates to Linux, but also on a personal basis I would
> also like to know if you have seen anything mentioned anywhere about how
> it will affect those of us living in Japan when it becomes 2000.
> 
You can find several newsgroups and mailing lists on the net (search for
Y2k or "year 2000"). You will also find a lot of home pages for consultant
companies that specialize in the Y2k-problem. (Serious Hype Warning!).

This is RedHat Y2k statement:
http://www.redhat.com/legal_statement.phtml#y2k

A good page is Linux Online's page:
http://www.linux.org/help/beginner/year2000.html
(lots of technical info, not a lot of mumbo jumbo like _most_ other Y2k
sites)

I spent some time a year ago or so to investigate this and have some
hints:

* 1:
_The_ major source of errors in a UNIX/C system is the tm struct returned
by, for example, localtime(3). The tm struct contains a field tm_year that
contains the number of years since 1900. This means that:
   printf( "%d" , tm.tm_year ) ;
will behave well for 1900 -> 1999 but print: "100" for year 200. 
Another programmer might write:
   printf( "19%d" , tm.tm_year ) ; 
that will print 1999 for 1999 but 19100 for year 2000. 
The correct solution is, of course: 
   printf( "%d" , 1900 + tm.tm_year ) ;
We had one application that had the "printf("%d",tm.year)"-bug. It was very 
easy to find using find and grep.
You should be able to check all your open-source software you use in 
a few minutes.

* 2:
/sbin/clock in RedHat 4.1 (and maybe RH 4.2) is buggy and will not set the
year byte in the CMOS-ram correctly. This may or may not work anyway depending 
on your BIOS. 
The interesting part about this bug is that it does not show until you try to
set and year equal to or greater than 2001. After reboot the year will be
set to 2000 (or maybe something else on some systems).

* 3:
There are some floppies out there that claim to test if your PC hardware and
BIOS is Y2k compliant.
They don't. They all test if the BIOS updates the memory cell in the CMOS-ram
that is supposed to contain the century information. Big deal, Linux does not
care about the century byte. If the year byte is less than 70 Linux assumes
the 21:st century and if year byte is equal to or greater than 70 the 20:th 
century is assumed.

/Fredric

PS. Just in case you did not know, Linux use a 4 byte counter that
counts the number of seconds since 1/1 1970 00:00 GMT for current time, 
time stamps for files etc. The type of the counter is time_t.

===== 1999 - The Year Of The Millennium Hype =====
-------------------------------------------------------------------
Next Nomikai: 14 January 1999, 19:30 Tengu TokyoEkiMae 03-3275-3691
*** it will will be Jan 14 (Thu), as Jan 15 (Fri) is a natl holiday
Next Technical Meeting: Feb 13 (Sat), 12:30    ace: Temple Univ.
-------------------------------------------------------------------
more info: http://tlug.linux.or.jp                     Sponsor: PHT


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links