This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: New kernel interface for sys_tz and timewarp?
- From: Arnd Bergmann <arnd at arndb dot de>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: Paul Eggert <eggert at cs dot ucla dot edu>, Linus Torvalds <torvalds at linux-foundation dot org>, Linux Kernel Mailing List <linux-kernel at vger dot kernel dot org>, Thomas Gleixner <tglx at linutronix dot de>, John Stultz <john dot stultz at linaro dot org>, Alexandre Belloni <alexandre dot belloni at bootlin dot com>, Stephen Boyd <sboyd at kernel dot org>, Florian Weimer <fweimer at redhat dot com>, "Theodore Ts'o" <tytso at mit dot edu>, "H. Peter Anvin" <hpa at zytor dot com>, Palmer Dabbelt <palmer at dabbelt dot com>, Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>, Karel Zak <kzak at redhat dot com>, Lennart Poettering <lennart at poettering dot net>, OGAWA Hirofumi <hirofumi at mail dot parknet dot co dot jp>
- Date: Tue, 13 Aug 2019 22:04:05 +0200
- Subject: Re: New kernel interface for sys_tz and timewarp?
- References: <CAK8P3a0VxM1BkjY1D2FfHi6L-ho_NH3v3+gBu45EfpjLF5NU5w@mail.gmail.com> <CAHk-=wiO2CWONDBud4nxoPgUJN1JEewFWhHa5wAqY8G5rrTXRQ@mail.gmail.com> <ecf2742a-6cab-cc00-16ab-589fad07b8db@cs.ucla.edu> <87tvakuak6.fsf@mid.deneb.enyo.de>
On Tue, Aug 13, 2019 at 9:31 PM Florian Weimer <fw@deneb.enyo.de> wrote:
> * Paul Eggert:
> > Linus Torvalds wrote:
> >> I assume/think that glibc uses (a) environment
> >> variables and (b) a filesystem-set default (per-user file with a
> >> system-wide default? I don't know what people do).
>
> > glibc relies on the TZ environment variable, with a system-wide
> > default specified in /etc/localtime or suchlike (there is no
> > per-user default). glibc ignores the kernel's 'struct timezone'
> > settings for of this, as 'struct timezone' is obsolete/vestigial and
> > doesn't contain enough info to do proper conversions anyway.
>
> I think the configuration value that settimeofday changes is not
> actually a time zone, but an time offset used to interpret various
> things, mostly in a dual-boot environment with Windows, apparently
> (Like the default time offset for extracting timetamps from FAT
> volumes.)
>
> This data has to come from *somewhere*. The TZ variable and
> /etc/localtime cover something else entirely.
systemd and hwclock call localtime_r() when setting initial
system time an tz information at boot time, so that information
comes from /etc/localtime.
/etc/adjtime is used to determine whether to set warp the
time at boot and rtc update or not warp it.
Arnd