Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Nov 1997 21:45:33 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, mike@smith.net.au
Cc:        emulation@freebsd.org, handy@sag.space.lockheed.com, wollman@freebsd.org
Subject:   Re: localtime under Linux-emu?
Message-ID:  <199711281045.VAA30008@godzilla.zeta.org.au>

next 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

and then for a zoneinfo data file:

	/usr/lib/zoneinfo/GMT
	/usr/share/zoneinfo/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.

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

>> Don't bother unless a port of a Linux program actually uses a resource.
>> This is most important for library resources.  Does locale stuff work?
>
>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.

Bruce



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