Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Aug 2018 20:41:17 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        "Conrad E. Meyer" <cem@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r337334 - head/lib/libc/sys
Message-ID:  <CANCZdfrzJAVtMiJ8JwZB4vv1tXwnQ1HHiW1MpKGpivjWcq7pTA@mail.gmail.com>
In-Reply-To: <CANCZdfqSiJ0n_pBykO7y7gXmo3LA1ai5G_ZzJQ_M712f5rAbBQ@mail.gmail.com>
References:  <201808042208.w74M8OmD057603@repo.freebsd.org> <CANCZdfo1g_j=RibNv6xb2UC8LvqzcobKHjdUo7%2B9CQdbCa5uXA@mail.gmail.com> <CAG6CVpU9Rp7Rav8yGZ_2VDvrwyc-jFRNRYvgtemYO3n2MDzTjQ@mail.gmail.com> <CANCZdfqSiJ0n_pBykO7y7gXmo3LA1ai5G_ZzJQ_M712f5rAbBQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 4, 2018 at 5:01 PM, Warner Losh <imp@bsdimp.com> wrote:

>
>
> On Sat, Aug 4, 2018, 11:48 PM Conrad Meyer <cem@freebsd.org> wrote:
>
>> If not stale, it was inaccurate as-is.  It seems to be used by a bunch
>> of different clock-related drivers and routines, e.g.,
>>
>> $ rg '(tz_minuteswest|tz_dst|utc_offset)' | wc -l
>>       36
>>
>
> Right. Nothings sets it any more though and hasn't in 30 years. Adjkerntz
> is what is used today. The other code was left for still lingering legacy
> uses in the early 1990s...
>

Amplifying a bit, This was introduced around 4.2BSD, along with a compiled
in default TIMEZONE to replace the older ftime from Version 7 which itself
was an improvement on Verison 6's gtime routines (etc, there's been a lot
of churn in this area unlike 'open' or 'read'). It was used by localtime()
to offset the system time by this value to get local time. You could
compile it into the kernel, or set it with date -t. troff also used it in
one place. Otherwise, the kernel just provided an interface for userland to
get this value (gettimeofday) and set it (settimeofday). This continued in
4.3BSD pretty much the same. Then in 4.4BSD David Olson's TZ stuff went in,
and it became obsolete (so with FreeBSD 1.0).

NetBSD has eliminated the variable, and returns 0's. This is what I'm
advocating that FreeBSD do.

phk introduced utc_offset() in r62962 (12 years ago) to consolidate people
doing the adjkerntz stuff all over the tree. As part of this work, he moved
tz_minuteswest and tz_dsttime from sys/kernel.h to sys/clock.h. This itself
is an earlier cleanup which broke part tz into tz_minueswest and tz_dsttime
in r110299 (15 years ago). This appears to have been inspired by getting
them out from under Giant. tz itself originated with the 4.4 import at the
dawn of the project. Why phk didn't just delete them at any number of these
weigh points, I can only speculate. They were kinda sorta in use in FreeBSD
since early days for various RTC things. TIMEZONE (from 4.x BSD days) was
eliminated from config in 1995 by dg with the introduction of adjkerntz
which was supposed to be controlling for this offset.

This is a longer way of saying, we can kill it, along with way too much
historical detail.

Warner



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