From patchwork Tue Oct 1 12:15:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1991449 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Im6FNyF8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XHxkx2lNHz1xtY for ; Tue, 1 Oct 2024 22:16:57 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 28655386D626 for ; Tue, 1 Oct 2024 12:16:55 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id D0084386D600 for ; Tue, 1 Oct 2024 12:15:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D0084386D600 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D0084386D600 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727784921; cv=none; b=Z3/t1KRx6V9dFJfaoFka/a3Yd4/MT5o9zYBsO+8yJJod+HDDxrRoFeUr58Tga2v2AGThi+mfIMCvBQuGsUP4VLhagevJVJo12qavqfGpJqKWXyzlSLP65Ah0Bf98+v/C9yipj+nruktFtqiEoIXxMF7kumYp1qNL6RHqory1aXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727784921; c=relaxed/simple; bh=6/spxjblpTA7VSuxy1n2UbYR4JpjZFNe/0XAqjR3uRg=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=cmz7mgyso54y+6iYfKX+tmOA5D+cLSIRCqvuk/xANnBjON+tA3LN7p9UIy+Uq9SAmXsu0VeKOqzfRoaRV2xERcY9JbkpXkRG+kYYjLSu83fBLMw1eU2K2ObbtNYz/KGR3MpG6j5ahVTVnZ8l5anCduVQX1j5k6plmgm9zLZ6q+Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727784917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m4KjOQYzUegdv8iQVSs4eNw4ehmznF5atY4DiTEmoo8=; b=Im6FNyF85Adv1cPZlYjzH5ZdbrwqxOzlzsbniIhM/4bdl5TFuapxZKwMSkLAEHb6RN+Nba 7WpNcohu962ZNz+2Aqb98EPDOTbXVGJ3ELRT3kUhyzAc45AM+A2QZphDXAi+x1otKgtPlY lttbou/v/eAXmeKE4Og3RXNfcEPgeoQ= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-606-QPAlzWCjPpqEGCDIfX4Flg-1; Tue, 01 Oct 2024 08:15:15 -0400 X-MC-Unique: QPAlzWCjPpqEGCDIfX4Flg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1CA3C1943CCC for ; Tue, 1 Oct 2024 12:15:15 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3A7321944B2B for ; Tue, 1 Oct 2024 12:15:13 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 4/4] time: Implement the glibc.time.mktime_dst_adjustment tunable In-Reply-To: Message-ID: <4b54ff2cd98520b5e1bf31da5b3ec0a2713ad3b3.1727784647.git.fweimer@redhat.com> References: X-From-Line: 4b54ff2cd98520b5e1bf31da5b3ec0a2713ad3b3 Mon Sep 17 00:00:00 2001 Date: Tue, 01 Oct 2024 14:15:11 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org It helps with upgrades from older glibc versions (prior to 2.29) which performed DST adjustments in fewer cases. --- elf/dl-tunables.list | 9 ++ elf/libc_early_init.c | 3 + manual/time.texi | 3 +- manual/tunables.texi | 12 +++ time/Makefile | 7 +- time/mktime.c | 8 +- time/time-tunables.c | 29 +++++++ time/tst-mktime-dst-adjust-0.c | 154 +++++++++++++++++++++++++++++++++ time/tst-mktime-dst-adjust-1.c | 2 + time/tzset.h | 6 ++ 10 files changed, 228 insertions(+), 5 deletions(-) create mode 100644 time/time-tunables.c create mode 100644 time/tst-mktime-dst-adjust-0.c create mode 100644 time/tst-mktime-dst-adjust-1.c diff --git a/elf/dl-tunables.list b/elf/dl-tunables.list index 40ac5b3776..af3eb4a37c 100644 --- a/elf/dl-tunables.list +++ b/elf/dl-tunables.list @@ -84,6 +84,15 @@ glibc { } } + time { + mktime_dst_adjustment { + type: INT_32 + minval: 0 + maxval: 1 + default: 1 + } + } + elision { enable { type: INT_32 diff --git a/elf/libc_early_init.c b/elf/libc_early_init.c index 575b837f8f..f99f12b6c8 100644 --- a/elf/libc_early_init.c +++ b/elf/libc_early_init.c @@ -23,6 +23,7 @@ #include #include #include +#include