lkml.org 
[lkml]   [1998]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: kernel knowledge of localtime (user-level implememntation)
A sun wrotes something like that:
> ... set tz_zone to 0 and tz_west to correct value. Then inform kernel
> ... when value changes

Unfortunately, it is much more complicated than it looks. Filesystem
have to deal with every possible timestamp from past - for example
filesystem (ncpfs) has to know whether at "Apr 4, 1981" was DST
active or not. And even worse, this is NOT local time, but local time
of destination system. During testing of ncpfs over UDP I tested
it in configuration where Linux ran in U.K. and Netware here in Czech
Republic. We are GMT+0100, but U.K. is GMT+0000, so every file
was marked one hour in future (or 2 when DST). This simple example
means that:
a) every network protocol (and every filesystem) which stores timestamps
in localtime is broken
b) if you want to do it correctly, you must implement complete DST and
timezone code from libc into kernel
c) unfortunately, you must be able to set DST & TZONE per mountpoint, not
globally per kernel
b2) or you can declare that filesystem stores date/time in GMT and that
every client expecting localtime is broken... Unfortunately, in ncpfs
you have to patch NetWare server because of date for "create" is taken
from server clock (you can disable DST & TZONE on server :-) ), not from
client request.

Implementation of steps (b+c) welcomed on my @email. Timeframe is next DST
change, which is around March 27th, 1999 for me :-)
Best regards,
Petr Vandrovec
vandrove@vc.cvut.cz

P.S.: TZ code does not cause major problems for me - I have my mirror
stored on NetWare and exported through ncpfs. There is only one problem,
files mirrored when DST active are remirrored after DST ends because of
"remote file is 1 hour newer than local copy, regetting" :-( And during
summer it produces harmless message "remote file is 1 hour older than
local copy!" :-(



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.028 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site