From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 1B2BB21380 for ; Wed, 27 Mar 2024 03:45:24 +0100 (CET) Received: (qmail 18429 invoked by uid 550); 27 Mar 2024 02:40:33 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 18397 invoked from network); 27 Mar 2024 02:40:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1711507509; x=1711766709; bh=v2DblOBDQfS5WJYq1/U2JrKHxPDoMfWZ7WkNcdD/dXI=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=hOjRskSPCeRBt3Br1NA+qz/rhNBVqovKjhvNpJB3dmZJ6XBtXnGe1k2gUVfjmJbF1 3zTWdIa8C7/P0txoVhIshTsJvqYfGRpUfXszePUT20RWGR1GyJHiJfvinTvlpc5Rxb M6KO66Oi5/IosG0jSYk2dQGqYYifaFaUnY8FyTIHcwTsCuJGhXRMDjwZNrS+ndhNJ5 IDFfsAoRLNCIHQFiIcQa2DPZEwZC2PZN/+XyqxFf1dwc5pddV1Oc7h3xC8wZpbr/Oj jFqwQqZh/JEGg3PzGu8aZ/1zZeLt5E+32wXJUomf0Pb7iuVoJppN5wNvdHUNGHQmCb v4gUfCr/YEDQA== Date: Wed, 27 Mar 2024 02:45:00 +0000 To: musl@lists.openwall.com From: Alexander Weps Message-ID: In-Reply-To: References: Feedback-ID: 20507743:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [musl] Broken mktime calculations when crossing DST boundary On Wednesday, March 27th, 2024 at 02:35, Thorsten Glaser wro= te: > Alexander Weps dixit: > > > But mktime can return -1 if and when it deems that struct tm cannot be > > represented in epoch seconds. > > > But it CAN be represented in epoch seconds. > > It can only not be represented in epoch seconds if it=E2=80=99s > outside of the range of time_t, e.g. [LONG_MIN; LONG_MAX]. > > POSIX even explicitly documents how these discontinuities > are mapped, which I already quoted: > > | If a geographical timezone changes its UTC offset such that =E2=80= =9Cold > | 00:00=E2=80=9D becomes =E2=80=9Cnew 00:30=E2=80=9D and mktime() is give= n 00:20, it treats that > | as either 20 minutes after =E2=80=9Cold 00:00=E2=80=9D or 10 minutes be= fore =E2=80=9Cnew > | 00:30=E2=80=9D, and gives back appropriately altered struct tm fields. Provide source. > > This makes it clear that there are two ways the struct tm can > be represented in time_t, and that the implementation must > choose one of them. > > bye, > //mirabilos > -- > [...] if maybe ext3fs wasn't a better pick, or jfs, or maybe reiserfs, oh= but > what about xfs, and if only i had waited until reiser4 was ready... in th= e be- > ginning, there was ffs, and in the middle, there was ffs, and at the end,= there > was still ffs, and the sys admins knew it was good. :) -- Ted Unangst = =C3=BCber *fs