[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] where to fetch local time



On Wed, 13 Dec 2000, Guido Flohr wrote:

> > > Tgettimeofday (MiNT) always returns the time in UTC (as
> > > seconds since the epoch). 
> > 
> > I just noticed that the library function settimeofday (MINTLIB
> > seems to build it as a wrapper to Tsettimeofday) ends up altering
> > localtime, instead of UTC.
> 
> I consider the current tzinit approach a failed experiment.  
> Setting date and time always causes problems.

Hold on!  Don't consider your code a failure just yet!

tzinit itself might be fine; the problem may be in the progamming
library or the kernel's Tsettimeofday implementation.

For instance, when compiling K9 over a variety of platforms all
implementing Tsettimeofday(), myself and Pahartik found that just
about every Unix out there behaves differently for the same call.

> That's why I supposed a different approach, either the Linux
> way or the (Free)BSD way.

Personally, the OpenBSD approach is the cleanest.  

Either way, implementing any other Unix's approach would be fine,
as long as the documentation is updated to explicitely tell which
model is implemented.

> maybe a matter of replacing the call to tzinit by a call to some
> other tool in mint.cnf.

I'm just wondering, what if the MiNT kernel would be upgraded to
initialize itself according to a variable called TZ in MINT.CNF,
following the POSIX zonename?  For example:

TZ=Europe/Helsinki

right into MINT.CNF would allow initializing the string even
before the filesystems are checked, which would also keep correct
timestamps on any filesystem repairs.  

Alternately, /etc/timezone as used in Debian is also good, but
cannot be read until the root filesystem has been checked.

-- 
Martin-Éric Racine, IT Consultant * http://funkyware.atari.org/  
* May the Funk be with Q! * Author of the Atari TT030 Homepage.