From owner-freebsd-emulation Fri Nov 28 02:51:57 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA07179 for emulation-outgoing; Fri, 28 Nov 1997 02:51:57 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id CAA07173; Fri, 28 Nov 1997 02:51:50 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.6.9) id VAA30008; Fri, 28 Nov 1997 21:45:33 +1100 Date: Fri, 28 Nov 1997 21:45:33 +1100 From: Bruce Evans Message-Id: <199711281045.VAA30008@godzilla.zeta.org.au> To: bde@zeta.org.au, mike@smith.net.au Subject: Re: localtime under Linux-emu? Cc: emulation@freebsd.org, handy@sag.space.lockheed.com, wollman@freebsd.org Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >> 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