Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jun 1997 11:28:20 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        marc@bowtie.nl (Marc van Kempen)
Cc:        emulation@FreeBSD.ORG
Subject:   Re: Linux emulation doesn't recognize timezone
Message-ID:  <199706020158.LAA16749@genesis.atrad.adelaide.edu.au>
In-Reply-To: <199705301415.QAA24017@nietzsche.bowtie.nl> from Marc van Kempen at "May 30, 97 04:15:57 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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 <stdio.h>
> #include <time.h>
> 
> 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  [[



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