Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Dec 1997 16:58:32 +1030
From:      Mike Smith <mike@smith.net.au>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        mike@smith.net.au, emulation@freebsd.org, erich@freebsd.org, v@godzilla.zeta.org.au
Subject:   Re: localtime under Linux-emu? 
Message-ID:  <199712060628.QAA02228@word.smith.net.au>
In-Reply-To: Your message of "Sun, 30 Nov 1997 16:26:54 %2B1100." <199711300526.QAA30424@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help

Sorry for the continuity break here.  8(

> >> The search order is (omitting /compat/linux):
> >> 
> >> 	/usr/lib/zoneinfo/localtime
> >> 	/usr/share/zoneinfo/localtime
> >
> >Ok.  Linking localtime into usr/lib/zoneinfo will work then.
> >
> >> and then for a zoneinfo data file:
> >> 
> >> 	/usr/lib/zoneinfo/GMT
> >> 	/usr/share/zoneinfo/GMT
> >
> >Er.  That's sufficiently different from our POV that it's not going to 
> >work.  (ie. we have it in /usr/share/zoneinfo/Etc/GMT)
> 
> It looks like a compatibility hack or a bad old way of doing things.  In
> an old version of RedHat Linux, GMT has 18 hard links, one in Etc.
> zoneinfo used to be more cluttered here too.

In the above, "it" is ambiguous.  Are you referring to the Linux 
behaviour, or ours?

> >> Putting `localtime' in lib/zoneinfo is OK, especially if you don't
> >> put the shareable zoneinfo files there.  At least in glibc-2.0.3,
> >> and in the timezone distribution, searching for `localtime' in the
> >> same directory as the shareable zoneinfo files is caused by forming
> >> the path from TZDIR and TZDEFAULT (unless TZDEFAULT is an absolute
> >> pathname, as it is in FreeBSD).  These distributions don't seem to
> >> support multiple paths in TZDIR, but glibc supports overrinding it
> >> using the TZDIR environment variable.
> >
> >I can't parse that.  You've just said that the code searches the same 
> >places for both localtime and the shared data files, but now you are 
> >saying that putting them in the same directory would actually be bad, 
> >without explaining why.
> 
> Read what I wrote, or UTSL.  Apparently only nonstandard code searches
> both places.

I did read what you wrote, which is why I said "I can't parse that".  
TSL isn't immediately available, nor is the context from which you are 
operating.  Rather, I rely on your ability to communicate same in a 
fashion from which I can draw inferences as to correct actions.

At this point, the contents of the FreeBSD /usr/share/zoneinfo 
directory are symlinked into /compat/linux/usr/lib/zoneinfo.  From your 
comments above, it appears that this is redundant due to /usr/share/
zoneinfo being part of the default search path.  It also appears that 
/usr/share/zoneinfo is not laid out in a fashion which is likely to be 
similar to that expected by Linux applications.  Can you confirm these 
points?

Is the layout of the zoneinfo directory important to the average 
application, or is it more relevant to the format of the timezone value?

> >> >How about a more correct solution:
> >> >
> >> >	mkdir /compat/linux/usr/lib/zoneinfo
> >> >	ln -s /usr/share/zoneinfo/* /compat/linux/usr/lib/zoneinfo
> >> >	ln -sf /etc/localtime /compat/linux/usr/lib/localtime
> >> 
> >> This probably fails with glibc.
> >
> >Because it uses a diferent path layout for the shared datafiles?  Would
> >
> >	for i in find /usr/share/zoneinfo/ -type file;
> >		ln -s $i /compat/linux/usr/lib/zoneinfo/
> >
> >get closer, or do they have their own, variant directory layout?
> 
> Something like that.  It needs to actually work for subdirectories.

The inference I initially drew from your earlier comments was that 
Linux did not use subdirectories under the zoneinfo directory.  Was 
this a poor assumption based on your example?  A much simpler approach 
to the above would just have been to let the Linux code eventually find 
/usr/share/zoneinfo by itsef.

> I hope will follow the layout in the timezone distribution, and that
> FreeBSD users won't be interested in running old Linux libraries so that
> the Linux library package won't need to contain old shared libraries.

You hope *what* will follow the layout in the timezone distribution?

There is no hope that FreeBSD users will not want to run old binaries.  
Nobody I know of runs libraries by themselves; they're boring. 8)

mike





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712060628.QAA02228>