From owner-svn-src-head@freebsd.org Sun Aug 5 02:41:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF687105F277 for ; Sun, 5 Aug 2018 02:41:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5593A74DD1 for ; Sun, 5 Aug 2018 02:41:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id w11-v6so8226501iob.2 for ; Sat, 04 Aug 2018 19:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=tAGX+eNLsn0zENwkH7MP5QHXxorJt6D5MOWW3UlL9bs=; b=CA3rJaYUIAQWcyDpn7yDG5zprgSNl0tBmt1kNvB4ga0lFmScfgQWmNmdOlpoy+V4RT HDK56suwuzhyZPDDeMKGe9FYmdU1nHiPx4e0oTbL067BkFIyL1GDPXczJbSxCYMXd2wX 3Vb7AX4XFerrv7/dEx8YQb6iax+Tm7SnU3fpSBAGiEdcIFlmJBB1Ag6l82tqZcottjIn 2LEUypiXA3Co1XQbls3q8CIqRFDAZxxi1fNIYzS73jU8/BpCRGt+VLBXTotmy8Id+wsJ RKadv2sxiVAfucv8o6jOTJOK/psDFBeUrHvkY77omDU71N32p0nhMbKF1Z7kCMbPNz6k Dgsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=tAGX+eNLsn0zENwkH7MP5QHXxorJt6D5MOWW3UlL9bs=; b=SZcIi9Y8Du/EIocHfK9lc4f3+EuzFoM9TXYqytigSHr7nUczUWa0pwEkeSVWt9uyn1 qufVTw+7LduZSBuD5qRiMVP41vYsLroeOzBEyYDVzUsz0KDjKKrGpzgGf5ImGp8/cv17 /qVzwH2RZBPRdyZ0opvPNCjLWXPAwzbODJZNe3PuKYvLLUi+AaYqm536eWcMAI1AYvi+ f40DVSGwj2H0m9NqA9aoXEj5JS0G18NYk17E21YRD9v9hLh3lZhcJDLUfHeq1DW/Yotx oHblKitAEzZ8/qlRNgIY1keQxMFsGMnS/puuOatO+2DEFk042LwUqvDzPnb3H2OiC4I0 RQnw== X-Gm-Message-State: AOUpUlEWp0h6miQupKczg/yfrkHmc0M4HUyNm8t2p9UoZUY8tJskDdKe 0KGbTFV7nUeSAzpxnGoavO4ZIE4FH6rKEuUcqij6qx5EIsbVOQ== X-Google-Smtp-Source: AA+uWPzmrx2NC1CMHRrWltrzZK24oCDHWgNiaVuUwza5vIQin6TzJ9p85vyK8/M8ergJ3a2p4ACpKF38RgVonwhPGtE= X-Received: by 2002:a6b:3902:: with SMTP id g2-v6mr10942135ioa.168.1533436878188; Sat, 04 Aug 2018 19:41:18 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:4485:0:0:0:0:0 with HTTP; Sat, 4 Aug 2018 19:41:17 -0700 (PDT) X-Originating-IP: [86.153.210.77] In-Reply-To: References: <201808042208.w74M8OmD057603@repo.freebsd.org> From: Warner Losh Date: Sat, 4 Aug 2018 20:41:17 -0600 X-Google-Sender-Auth: FneHxHEE--m4n3_OlVEGuN48a9I Message-ID: Subject: Re: svn commit: r337334 - head/lib/libc/sys To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 02:41:20 -0000 On Sat, Aug 4, 2018 at 5:01 PM, Warner Losh wrote: > > > On Sat, Aug 4, 2018, 11:48 PM Conrad Meyer 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