From owner-freebsd-emulation Thu Nov 20 02:18:43 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA26597 for emulation-outgoing; Thu, 20 Nov 1997 02:18:43 -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 CAA26591; Thu, 20 Nov 1997 02:18:39 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.6.9) id VAA01710; Thu, 20 Nov 1997 21:04:26 +1100 Date: Thu, 20 Nov 1997 21:04:26 +1100 From: Bruce Evans Message-Id: <199711201004.VAA01710@godzilla.zeta.org.au> To: emulation@freebsd.org, handy@sag.space.lockheed.com Subject: Re: localtime under Linux-emu? Cc: wollman@freebsd.org Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >I remember sometime back that when linux s/w attempts to find out what >time it is, it always comes back with ... what, system time? Anyway, it >comes back with what the hardware says the time is instead of localtime. Linux date (and presumably Linux libc), at least with the Linux libraries distributed with FreeBSD, searches for localtime in the following directories in the following order: /compat/linux/usr/lib/zoneinfo/ /usr/lib/zoneinfo/ /compat/linux/usr/share/zoneinfo/ /usr/share/zoneinfo/ but in FreeBSD the file is in /etc/, and libc only searches for it there. There seems to be no good standard for this. zic/THEORY says that the file is in /etc/zoneinfo/, but it is out of date. The current timezone distribution uses "localtime" (relative to the zoneinfo data directory which is /usr/local/etc/zoneinfo/), and actually documents the full path to it its version of date.3, ctime.3 and tzset.3. However, this is going backwards from FreeBSD's viewpoint. The zoneinfo data directory is shareable, so /usr/share is an ideal place for it. "localtime" is not shareable, so it doesn't belong in /usr/share, and it is not a library, so it doesn't belong in /usr/lib. It may belong in /usr/libdata instead of /etc. The FreeBSD man pages are mdoc'ified so they are hard to compare with the ones in the timezone distribution. >I seem to remember that it was non-trivial to make Linux figure out what >time it was, does this still hold true? I think it has always been trivial: mkdir /compat/linux/usr/lib/zoneinfo cp /etc/localtime /compat/linux/usr/lib/zoneinfo Linux `file' fails similarly. It looks for "magic" only in /compat/linux/usr/lib and /usr/lib/. Linux editors tend to work because FreeBSD has a backwards compatibility link /etc/termcap -> /usr/share/misc/termcap. Things should work better if /compat/linux contains a full Linux tree. Bruce