Berkeley variant of time zone stuff

Guy Harris seismo!sun!guy
Thu Apr 2 22:40:12 UTC 1987


	I'm sorry, but I'm not following this whole discussion.  It seems to
	me that S5 has the problem here;

Ultimately, it does, but unless and until AT&T fixes the problem
there needs to be some way of getting around it.

	S5 has no way (does it?) to do so.

You can set "TZ" to the "proper" value.  S5R3.1, and I think some of
the earlier versions, at least on the 3Bs, have a file
"/etc/TIMEZONE" that can be used to find the "proper" value.

	> That's why I suggested the "defaultzone" routine - you need some
	> portable way of setting the TZ environment variable; given existing
	> systems, removing it isn't a portable way of forcing local wall clock
	> time.

	To make this portable, you'll have to alter S5, right?

To make it portable to *all* S5 versions distributed by AT&T, you
would, but to make it portable to the later ones, you would just have
to have "defaultzone" grab the value from TZ.  We can't fix every
version of S5, but we can fix some of them.

Note that "alter(ing) S5" consist only of adding a file
"/etc/TIMEZONE" whose contents are something like "TZ=PST5PDT".  You
don't have to alter any code, you just have to add "/etc/TIMEZONE"
and the "defaultzone" routine - or throw in your own version of
"defaultzone" and #ifdef it.  (Perfect portability can't always be
achieved; I'm willing to force people to use #ifdefs on occasion if
that makes the code "more portable" in the sense that you have to
change less to make it run elsewhere.)

The notion here would be to add "defaultzone" to the P1003.1 or X3J11
standard (whichever one discusses the TZ environment variable - not
that the October 1 X3J11 draft does NOT discuss TZ, so unless they're
going to add it P1003.1 had better think about picking it up).
Systems with rational ways of handling TZ can just return a null
pointer or the string "localtime"; systems that insist that you set
TZ to something parsable can snarf the default value from some file
and return that.

Also note that this discussion is directed at vendors as well as
users; a vendor can always add "/etc/TIMEZONE" and "defaultzone" to
their system if they have to.



More information about the tz mailing list