Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Nov 1997 13:39:32 +1030
From:      Mike Smith <mike@smith.net.au>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        emulation@freebsd.org, erich@freebsd.org
Subject:   Re: localtime under Linux-emu? 
Message-ID:  <199711290309.NAA00495@word.smith.net.au>
In-Reply-To: Your message of "Fri, 28 Nov 1997 21:45:33 %2B1100." <199711281045.VAA30008@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
> >> It is probably actually necessary to link to or copy the whole
> >> /usr/share/zoneinfo directory.  If you link to it then you can't
> >> have a symlink in the directory :-].
> >
> >Heh.  They actually put 'localtime' *inside* that directory?  Bleugh.
> 
> 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)

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

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

> >I have no idea.  I wouldn't know a locale if it walked up and bit me on 
> >the ass.  8)
> 
> I don't know much about it either, but ktrace shows `date' attempting
> to access locale files in the following order:
> 
> 	/etc/locale/C/libc.cat
> 	/usr/share/locale/C/libc.cat
> 	/usr/share/locale/C
> 	/usr/share/locale/C/libc.cat
> 	/usr/local/share/locale/C/libc.cat
> 
> None of these is found.  This is probably just as well, since the format
> seems to be less standard than that of timezone files.

OK.  Sounds like we need to add some more baggage to the linux-lib port.

Eric H, are you still with us?

mike




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