[Ntp] Antw: Re: Re: Antw: [EXT] Re: New Version Notification for draft‑gruessing‑ntp‑ntpv5‑requirements‑03.txt

Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> Wed, 20 October 2021 07:09 UTC

Return-Path: <Ulrich.Windl@rz.uni-regensburg.de>
X-Original-To: ntp@ietfa.amsl.com
Delivered-To: ntp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2AA143A07F0 for <ntp@ietfa.amsl.com>; Wed, 20 Oct 2021 00:09:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rvaeJZ0z8rbV for <ntp@ietfa.amsl.com>; Wed, 20 Oct 2021 00:08:55 -0700 (PDT)
Received: from mx4.uni-regensburg.de (mx4.uni-regensburg.de [IPv6:2001:638:a05:137:165:0:4:4e7a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2177E3A05DE for <ntp@ietf.org>; Wed, 20 Oct 2021 00:08:54 -0700 (PDT)
Received: from mx4.uni-regensburg.de (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 488D36000053 for <ntp@ietf.org>; Wed, 20 Oct 2021 09:08:46 +0200 (CEST)
Received: from gwsmtp.uni-regensburg.de (gwsmtp1.uni-regensburg.de [132.199.5.51]) by mx4.uni-regensburg.de (Postfix) with ESMTP id 1E3966000051 for <ntp@ietf.org>; Wed, 20 Oct 2021 09:08:44 +0200 (CEST)
Received: from uni-regensburg-smtp1-MTA by gwsmtp.uni-regensburg.de with Novell_GroupWise; Wed, 20 Oct 2021 09:08:44 +0200
Message-Id: <616FC07C020000A1000449FF@gwsmtp.uni-regensburg.de>
X-Mailer: Novell GroupWise Internet Agent 18.3.1
Date: Wed, 20 Oct 2021 09:08:44 +0200
From: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
To: imp@bsdimp.com
Cc: "doug.arnold@meinberg-usa.com"@dmarc.ietf.org, james.ietf@gmail.com, "ntp@ietf.org" <ntp@ietf.org>
References: <163386015957.12424.6997038478834885480@ietfa.amsl.com> <CAO+dDx=6baLhf9LwSMvR1F0ieuLO6NXmExYLDvcCF2tgchHs8w@mail.gmail.com> <DB8PR02MB5772AC97BFE2D7C1139EFDC0CFB89@DB8PR02MB5772.eurprd02.prod.outlook.com> <E469D9A7-7445-49D9-A8A2-82BA7BF1FA27@gmail.com> <DB8PR02MB57726795E3AD479F0CCFA778CFB99@DB8PR02MB5772.eurprd02.prod.outlook.com> <616D0ADA020000A10004486B@gwsmtp.uni-regensburg.de> <08e60c82-5b4c-5f0f-55e4-206b0d8f18c4@pdmconsulting.net> <CANCZdfqzduC=9oxhqgNJdxUqveRp=WyO+WNXHJTJZ01EO7jTAA@mail.gmail.com> <616E7C50020000A100044925@gwsmtp.uni-regensburg.de> <CANCZdfrT8TSo9BPZajT=8j4Go81JSryGxJ70Pu7AuEBmfLL3UQ@mail.gmail.com>
In-Reply-To: <CANCZdfrT8TSo9BPZajT=8j4Go81JSryGxJ70Pu7AuEBmfLL3UQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/1uyt1BevQvU0kHqnuoF-zp_HqTU>
Subject: [Ntp] Antw: Re: Re: Antw: [EXT] Re: New Version Notification for draft‑gruessing‑ntp‑ntpv5‑requirements‑03.txt
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Network Time Protocol <ntp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ntp>, <mailto:ntp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ntp/>
List-Post: <mailto:ntp@ietf.org>
List-Help: <mailto:ntp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ntp>, <mailto:ntp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Oct 2021 07:09:01 -0000

>>> Warner Losh <imp@bsdimp.com> schrieb am 19.10.2021 um 16:18 in Nachricht
<CANCZdfrT8TSo9BPZajT=8j4Go81JSryGxJ70Pu7AuEBmfLL3UQ@mail.gmail.com>:
> On Tue, Oct 19, 2021 at 2:05 AM Ulrich Windl <
> Ulrich.Windl@rz.uni-regensburg.de> wrote:
> 
>> >>> Warner Losh <imp@bsdimp.com> schrieb am 18.10.2021 um 16:54 in
>> Nachricht
>> <CANCZdfqzduC=9oxhqgNJdxUqveRp=WyO+WNXHJTJZ01EO7jTAA@mail.gmail.com>:
>> > On Mon, Oct 18, 2021 at 8:10 AM Danny Mayer <mayer@pdmconsulting.net>
>> wrote:
>> >
>> >>
>> >> On 10/18/21 1:49 AM, Ulrich Windl wrote:
>> >> >>>> Doug Arnold <doug.arnold=40meinberg-usa.com@dmarc.ietf.org>
>> schrieb
>> >> am
>> >> > 15.10.2021 um 17:53 in Nachricht
>> >> > <
>> >>
>> >
>> 
> DB8PR02MB57726795E3AD479F0CCFA778CFB99@DB8PR02MB5772.eurprd02.prod.outlook.co 
>> > m
>> >> >
>> >> >
>> >> >> Hello James,
>> >> >>
>> >> >> I agree that leap smearing is a clumsy and dangerous way to avoid the
>> >> >> complication of correctly handling leap seconds in distributed
>> database
>> >> >> software.  And if it was up to me all IT equipment would use TAI for
>> all
>> >> >> timing except what is displayed to humans.  But it is not up to me.
>> The
>> >> >> people who are making the call tell me that they believe that leap
>> >> seconds
>> >> > is
>> >> >> less bad than either moving everything from UTC to TAI, or writing
>> and
>> >> >> debugging database software that manages leap seconds properly.
>> >> >>
>> >> >> So given that state of affairs.  What do we do?
>> >> > Hi!
>> >> >
>> >> > I guess the standard C library needs new functions to get the correct
>> >> time
>> >> > first ;-)
>> >> > time_t has a problem
>> >>
>> >
>> > Yes. The fundamental problem is that POSIX says there's no such thing
>> > as leap seconds in time_t. They don't exist, they don't have a unique
>> > encoding. And any way you represent them (there's at least 3 I know
>> > of) is ambiguous. This is the reason why smearing is a thing.
>> >
>> >
>> >> > Amazingly gettimeofday can use struct timezone, while clock_gettime()
>> >> can't.
>> >> > So adding the TAI offset to struct timezone would not help much.
>> >>
>> >
>> > Look at the 'right' timezones.
>> >
>> > But clock_gettime passes in the 'clock' that you want. You can ask for
>> > TAI time, but you still have the ambiguity.
>>
>> In my version of Linux (rather "new" regarding "industry standards") such
>> a flag does not exist.
>>
> 
> clock_gettime(CLOCK_TAI, &ts);
> 
> CLOCK_TAI isn't standardized by POSIX, but it definitely exists in Linux
> and has for 15 or 20 years.

Hi!

OK, I see that I have
/usr/include/bits/time.h:#   define CLOCK_TAI                   11
/usr/include/linux/time.h:#define CLOCK_TAI                     11

but it's not documented in "man clock_gettime", so I did not know about it.

In the kernel I found these helper functions:
/**
 * ktime_get_clocktai - Returns the TAI time of day in ktime_t format
 */
static inline ktime_t ktime_get_clocktai(void)
{
        return ktime_get_with_offset(TK_OFFS_TAI);
}

__timekeeping_set_tai_offset(struct timekeeper *tk, s32 tai_offset)

However I couldn't find out who ever sets tha toffset and how...

> 
> Whether or not the system has the requisite information to give it to you
> is another matter, but the clock is well defined and absolutely exists.
> See Documentation/core-api/timekeeping.rst for its definition.

That file does not exist in my version 8-(

Regards,
Ulrich

> 
> Warner