Re: kernel knowledge of localtime (user-level implememntation)

a sun (asun@saul9.u.washington.edu)
Tue, 24 Nov 1998 10:39:58 -0800 (PST)


[much info on how broken using localtime is for cross-timezone stuff]

okay, here's my perspective on this issue and why i chose the
simpleminded approach:

a) every network protocol (and every filesystem) which stores timestamps
in localtime is broken

i'm looking at this from the perspective of local filesystems only
(network filesystems are inherently broken). in that situation, doing
something simple should work reasonably well. when you switch daylight
savings or timezones, everything just gets shifted by the timezone or
daylight savings delta. i think that's a perfectly reasonable thing to
do. when you deal with local time, you really do gain/lose hours when
you switch time zones or go into daylight savings mode (think about
all that wall clock re-setting you have to do).

b) if you want to do it correctly, you must implement complete DST and
timezone code from libc into kernel

i don't think this is a good idea. the time code has to be pretty
bloated given all the politics that are involved with daylight savings
designations and such. the digital unix man page for settimeofday
states that the kernel knowledge of timezone isn't as good as the
user-level knowledge of it. i think we should follow the same policy
and have people live with momentary difficulties.

c) unfortunately, you must be able to set DST & TZONE per mountpoint, not
globally per kernel

a bigger problem here is with network filesystems that assume local
time. while i think living with momentary time warps is the
appropriate response to local time braindamage, having inconsistent
representations of time on client and server probably isn't. one
solution is to have the various network filesystems that use local
time calculate a delta between server and client time representations
and use that to convert between server/client timestamps.

so, do ncpfs and smbfs (any others?) provide an easy means of getting
the time from the other machine?

-a
asun@u.washington.edu


-
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/