From owner-svn-src-head@freebsd.org Sun Aug 5 15:24:38 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 04E741055814 for ; Sun, 5 Aug 2018 15:24:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (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 7F0C692D12 for ; Sun, 5 Aug 2018 15:24:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id d70-v6so10056150ith.1 for ; Sun, 05 Aug 2018 08:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W6oQIsaSXnu27uL398v7l4P22nuEkOpuCRkNX5TCCts=; b=w1BKI0Y0TtxiNDgyKwS3GABH3mwx8MDkdcR8/sTvRAo95E1VFgQVUt+6MUY9AVmcf+ a7zuD5bAO1rQ+tP0ERRdQQn4IytMPZxlBj3mNHwB5HyDGTrT88jzDnu18DQBoSmhvu0h L0WJRM/j78XFbKasMXj7b83tBiJ26R6GclMmq4QwBznSMG9qz/JGgIBqLtYeJD1hoxVE b9eQPaymas7MMFVlC3P6kHp2KTIp2+Ipk7coh1IZ1QYtRBLrX5YT2tlcS6tNLJWaCZfh BSjZ2Prs0L51xW1ttD1M6xTn91nLNe22stpr3mAmcpNuVTdAun4NN5RDNBflLZnBNMhH XoRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W6oQIsaSXnu27uL398v7l4P22nuEkOpuCRkNX5TCCts=; b=EUvMvihwAPscrej7p3TdTtdX5DU8Mm5KR+QS9cD5egJwpHpyna/0qeZQm/6W7cR+DZ YVvw2djPmxACg8nzZ9IrkNvZpjtKTEgGUuoUql6t15V7cg1O758wq36+fmrQ8pUJzYxc BrTj1hannaKSRiim2DORXm1nYUtIbkVTSxM8f/vSEhzRZtObctLWGrOwjrmco1Q8x96Z N015DMXoEKYcWHPr4kYSdtHWrrWMdpXaApw+XZMtAoyhfshPsgf//PtnabUAquHLSxtT 2D1Uqp0nBjp0JEfM9It820dDYhK+inuKCsT+5Wv2WNvwn9/T1HosYptxt9P0Bz+GzMSR D9Eg== X-Gm-Message-State: AOUpUlH9ugHEY5SQeIzZHMYyJvlnD+t70OwBw2ZcZWQXZfdxPf/W6V5x +HWt62+QNpQioAzpuESHf++zeu/MEH108TS/MNsK2A== X-Google-Smtp-Source: AAOMgpcXns3FsAB3wxipbRw4HXW2sNYHa3RVB1v9rkEG0/oce+PIOgP8DoStgLkbupDpkZtaIRJCLdH5/Nl3PVD2hpA= X-Received: by 2002:a02:3344:: with SMTP id k4-v6mr10291860jak.45.1533482676535; Sun, 05 Aug 2018 08:24:36 -0700 (PDT) MIME-Version: 1.0 References: <201808042208.w74M8OmD057603@repo.freebsd.org> <201808042224.w74MOgLi095274@pdx.rh.CN85.dnsmgr.net> <1533478958.9860.18.camel@freebsd.org> In-Reply-To: <1533478958.9860.18.camel@freebsd.org> From: Warner Losh Date: Sun, 5 Aug 2018 16:24:23 +0100 Message-ID: Subject: Re: svn commit: r337334 - head/lib/libc/sys To: Ian Lepore Cc: "Rodney W. Grimes" , "Conrad E. Meyer" , 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 15:24:38 -0000 On Sun, Aug 5, 2018, 3:22 PM Ian Lepore wrote: > On Sat, 2018-08-04 at 16:39 -0600, Warner Losh wrote: > > On Sat, Aug 4, 2018 at 4:24 PM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > > > > Author: cem > > > > Date: Sat Aug 4 22:08:24 2018 > > > > New Revision: 337334 > > > > URL: https://svnweb.freebsd.org/changeset/base/337334 > > > > > > > > Log: > > > > settimeofday(2): Remove stale note about timezone > > > > > > > > Contrary to the removed comment, the kernel does appear to use the > > > timezone > > > > > > > > argument of settimeofday. The comment dates to the BSD4.4 import; > I > > > assume it > > > > > > > > is just stale. > > > In what way is the kernel using TZ? It shouldn't be. > > > Or is it using the TZ to adjust the passed in time to UTC/GMT, > > > which I would of thought is done before calling settimeofday. > > > > Specifically, for compatibility, we store minutes west of UTC on > > settimeofday and we retrieve it for settimeofday. Otherwise it's 100% > > unused by anything else at all in the system. Well, technically, we use > it > > for utc_offset, we don't really use that elsewhere (one can find > references > > in utc_offset, but usually we set this via adjkerntz, which is actively > > used in the system). tz_minuteswest likely should just be removed, and > the > > argument to settimzeofday should just be completely ignored. > > > > utc_offset is used by all RTC drivers, and by the convenience routines > that convert times to/from FAT filesystem format (which I assume are > used by FAT filesystem code, but I haven't checked that). So if the tz > info passed to settimeofday() ends up in utc_offset, how can we be sure > nobody is relying on that? > Nobody is setting that. No one else still preserves this info. It was obsoleted in BSD 4.4 with the introduction of the Olsen TZ code. I'd be highly surprised if some set this given we have no rc knob for it. It's completely undocumented. The only code that might use it is IBCS, but even that is doubtful... everybody has transitioned to the documented adjkerntz interface for that stuff. So while in theory someone might, I really doubt it given the history and what other systems are doing. Warner > One could test it with date -t, nothing does that today. That should be > > removed also. Likewise date -d. > > > > So while hyper technically, one could use this, nobody does, nor has > since > > between 4.3 and 4.4 when it was realized that storing the timezone in the > > kernel was a really stupid idea. That's what the language used in the man > > page that you removed was trying to say. > > > > Warner > > > > > > > > > > > > > > > Modified: > > > > head/lib/libc/sys/gettimeofday.2 > > > > > > > > Modified: head/lib/libc/sys/gettimeofday.2 > > > > ============================================================ > > > ================== > > > > > > > > --- head/lib/libc/sys/gettimeofday.2 Sat Aug 4 21:57:17 2018 > > > (r337333) > > > > > > > > +++ head/lib/libc/sys/gettimeofday.2 Sat Aug 4 22:08:24 2018 > > > (r337334) > > > > > > > > @@ -28,7 +28,7 @@ > > > > .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 > > > > .\" $FreeBSD$ > > > > .\" > > > > -.Dd December 27, 2015 > > > > +.Dd August 4, 2018 > > > > .Dt GETTIMEOFDAY 2 > > > > .Os > > > > .Sh NAME > > > > @@ -44,11 +44,6 @@ > > > > .Ft int > > > > .Fn settimeofday "const struct timeval *tp" "const struct timezone > *tzp" > > > > .Sh DESCRIPTION > > > > -.Bf -symbolic > > > > -Note: timezone is no longer used; this information is kept outside > > > > -the kernel. > > > > -.Ef > > > > -.Pp > > > > The system's notion of the current Greenwich time and the current > time > > > > zone is obtained with the > > > > .Fn gettimeofday > > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > > >