From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8624C433FF for ; Tue, 13 Aug 2019 17:55:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC9A320679 for ; Tue, 13 Aug 2019 17:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728136AbfHMRz2 (ORCPT ); Tue, 13 Aug 2019 13:55:28 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:33280 "EHLO zimbra.cs.ucla.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727491AbfHMRz1 (ORCPT ); Tue, 13 Aug 2019 13:55:27 -0400 X-Greylist: delayed 381 seconds by postgrey-1.27 at vger.kernel.org; Tue, 13 Aug 2019 13:55:26 EDT Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A263716272D; Tue, 13 Aug 2019 10:49:04 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Avtv7kHLBo3l; Tue, 13 Aug 2019 10:49:03 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D6F6316272F; Tue, 13 Aug 2019 10:49:03 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id B3FBW389qoKq; Tue, 13 Aug 2019 10:49:03 -0700 (PDT) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 4DC3F16272D; Tue, 13 Aug 2019 10:49:03 -0700 (PDT) Subject: Re: New kernel interface for sys_tz and timewarp? To: Linus Torvalds , Arnd Bergmann Cc: Linux Kernel Mailing List , Thomas Gleixner , John Stultz , Alexandre Belloni , Stephen Boyd , Florian Weimer , Theodore Ts'o , "H. Peter Anvin" , Palmer Dabbelt , Alistair Francis , GNU C Library , Karel Zak , Lennart Poettering , OGAWA Hirofumi References: From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Tue, 13 Aug 2019 10:49:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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've been thinking of adding NetBSD's localtime_rz etc. functions to glibc. These functions let user programs specify the time zone for each conversion between time_t and local time, and simplify and/or speed up applications dealing with many requests coming from different time zones. These functions also ignore 'struct timezone'. There's no need to put any of this stuff into the kernel.