From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98285 invoked by alias); 11 Feb 2020 15:34:34 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 98276 invoked by uid 89); 11 Feb 2020 15:34:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.1 spammy=simultaneously, boot, personal X-HELO: mout.gmx.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1581435268; bh=PBuLoTjfnIsAcHd+HgzP9e29If21FaPcqzXhViZYE5Y=; h=X-UI-Sender-Class:Date:From:To:Subject; b=WMmi9u7KyT0JHvRYMF/otGstvqt2M3FMoYujva754z/4V/ydWtFHpjZ45q1tHgLLx r+6puKQGCyAEjxk0g46zcqmsTJNfp55fK+jmiOqRDJdneA4EK2nHjwJQmUQQoqJMW6 naQfZZbxTtNMdEiPOh/+zDvnXVYWE//ZwKLh7O9M= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Date: Tue, 11 Feb 2020 15:34:00 -0000 From: J William Piggott To: libc-alpha@sourceware.org Subject: settimeofday breakage Message-ID: MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-SW-Source: 2020-02/txt/msg00391.txt.bz2 > NEWS Version 2.31 > Deprecated and removed features, and other changes affecting compatibility: > > However, to reduce the odds of this offset being set by accident, > settimeofday can no longer be used to set the time and the offset > simultaneously. If both of its two arguments are non-null, the call > will fail (setting errno to EINVAL). I do not know who wrote this and my comment is not personal, but I question the stated justification for this breakage. The behavior of this function when called with two args has been in place for nearly 30 years; I have never see a report of the kernel time zone being set by 'accident'. Then there is this recent comment: > Date: Thu, 6 Feb 2020 21:41:06 +0000 > From: Joseph Myers > > On Wed, 5 Feb 2020, Adhemerval Zanella wrote: > > > Once POSIX does remove the symbol, we can remove its definition from > > default visibility > > I don't see that being appropriate for a very long time. > That was regarding gettimeofday, but should apply equally to settimeofday. I don't see how these two positions are reconciled: * get/settimeofday will be supported for the foreseeable future * settimeofday will be intentionally broken to prevent an 'accident' when using the 28 year old expected behavior. Below is a table that I wrote for hwclock(8) to aid source readers in understanding the block of code that follows it: * * +-------------------------------------------------------------------+ * | settimeofday(tv, tz) | * |-------------------------------------------------------------------| * | Arguments | System Time | PCIL | | warp_clock | * | tv | tz | set | warped | set | firsttime | locked | * |---------|---------|---------------|------|-----------|------------| * | pointer | NULL | yes | no | no | 1 | no | * | pointer | pointer | yes | no | no | 0 | yes | * | NULL | ptr2utc | no | no | no | 0 | yes | * | NULL | pointer | no | yes | yes | 0 | yes | * +-------------------------------------------------------------------+ * ptr2utc: tz.tz_minuteswest is zero (UTC). * PCIL: persistent_clock_is_local, sets the "11 minute mode" timescale. * firsttime: locks the warp_clock function (initialized to 1 at boot). * Note the unique behavior when called with two arguments which cannot be easily reproduced. What I used to accomplish in hwclock(8) with one call, now takes *three*!