From owner-freebsd-emulation Sun Jun 1 18:58:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id SAA18947 for emulation-outgoing; Sun, 1 Jun 1997 18:58:42 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id SAA18934 for ; Sun, 1 Jun 1997 18:58:36 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id LAA16749; Mon, 2 Jun 1997 11:28:21 +0930 (CST) From: Michael Smith Message-Id: <199706020158.LAA16749@genesis.atrad.adelaide.edu.au> Subject: Re: Linux emulation doesn't recognize timezone In-Reply-To: <199705301415.QAA24017@nietzsche.bowtie.nl> from Marc van Kempen at "May 30, 97 04:15:57 pm" To: marc@bowtie.nl (Marc van Kempen) Date: Mon, 2 Jun 1997 11:28:20 +0930 (CST) Cc: emulation@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-emulation@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Marc van Kempen stands accused of saying: > > Output from FreeBSD binary: > > 30 May 1997, 16:10h <-- this is GMT+1 and summertime > > Output from Linux binary: > > 30 May 1997, 14:10h <-- this is GMT > > the testprogram is as follows: > > #include > #include > > void > main(void) > { > char d[100]; > time_t secs; > > secs = time(NULL); > strftime(d, 100, "%d %B %Y, %Rh", localtime(&secs)); > > printf("%s\n", d); > > return; > } > > I tried copying the /etc/localtime to /compat/linux/etc, > but this didn't work. What must I do to make the linux emulation > recognize my timezone? It appears that Linux systems keep the timezone in the kernel, wheras FreeBSD doesn't. The Linux gettimeofday syscall is just mapped directly to the FreeBSD syscall, so as far as Linux programs are concerned it's always GMT. Unfortunately, the emulator has no way of finding timezone information in order to fudge this; I can't see a simple solution, sorry. > Marc. -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[