can't find file to patch at input line 126 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From patchwork Mon Oct 11 11:12:37 2021 |Content-Type: text/plain; charset="utf-8" |MIME-Version: 1.0 |Content-Transfer-Encoding: 7bit |X-Patchwork-Submitter: Alejandro Colomar |X-Patchwork-Id: 46069 |Return-Path: |X-Original-To: patchwork@sourceware.org |Delivered-To: patchwork@sourceware.org |Received: from server2.sourceware.org (localhost [IPv6:::1]) | by sourceware.org (Postfix) with ESMTP id B43FF385800E | for ; Mon, 11 Oct 2021 11:14:22 +0000 (GMT) |DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B43FF385800E |DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; | s=default; t=1633950862; | bh=FavOfjqhpgqKuDJNPO3xb2CZQhpGYoxtLCiCHCkGnfk=; | h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: | List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: | From; | b=BbptQTcDpYYHAXTJXy+Vraf/8qjg4VAm/WIij7+3W20m6NVkP/uaB15ybIVt5u0V3 | OlgtHCO3KWQ04LY2SZGCp0Jmjc6LJYRoUCr9HNgtFOH42/El/ucLJT9zovQnC+9dWJ | zg5DDFuKmWuqckzfsaAMoQ2DlJNgwNyhJ5l7lKoI= |X-Original-To: libc-alpha@sourceware.org |Delivered-To: libc-alpha@sourceware.org |Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com | [IPv6:2a00:1450:4864:20::430]) | by sourceware.org (Postfix) with ESMTPS id 186A83858D28 | for ; Mon, 11 Oct 2021 11:14:02 +0000 (GMT) |DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 186A83858D28 |Received: by mail-wr1-x430.google.com with SMTP id r7so54984586wrc.10 | for ; Mon, 11 Oct 2021 04:14:02 -0700 (PDT) |X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; | d=1e100.net; s=20210112; | h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to | :references:mime-version:content-transfer-encoding; | bh=FavOfjqhpgqKuDJNPO3xb2CZQhpGYoxtLCiCHCkGnfk=; | b=MFHx93PwGp4DFTcFCYBcRKyQhut7i0Kbbvjys7EREujrl8YlsYbuhntznrL0jwKls1 | JZMNPg2v+9xt+Uku8j+yNdbJlh1F3lo6LbpS6rbqKy+VG7AXl/i4mofGOeQAnlI5QXj/ | iokWIUITsIBOJ2GPf4CcAPTD8T4U7THJR5qZd8p158GCGCM1aaDqF4AGoxRrb057C6dJ | vJztKtsl6Z/vNz83iACoVFnYC8kLOcN3CutJ7SG2V2MkeqA/o9odF2wedzVSPjrGRZ+c | ybYz+HNBwEGI0sLVdbMsO/0QU7LzZ9vhYcPJEylQmSomJzBh0Gp33zFHwBHWPpWQthxE | L7iw== |X-Gm-Message-State: AOAM530ji4lomr4Cs7eXi9HQcY9Fe2qvEPcGDv/rLPY1PebBQ9SHRH/7 | KC10hPVbc6j9zyHfdwpZCHM= |X-Google-Smtp-Source: | ABdhPJxoqSPCnxx8sziYRzpTQLlrMfXCtKkrMsvUWtQt22WiDoo1salDUr5YWHMZjSTJVOD8L6yOiQ== |X-Received: by 2002:adf:bbc8:: with SMTP id z8mr24436143wrg.281.1633950841182; | Mon, 11 Oct 2021 04:14:01 -0700 (PDT) |Received: from sqli.sqli.com ([195.53.121.100]) | by smtp.googlemail.com with ESMTPSA id p17sm1215746wrx.33.2021.10.11.04.13.59 | (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); | Mon, 11 Oct 2021 04:14:00 -0700 (PDT) |To: mtk.manpages@gmail.com, | linux-man@vger.kernel.org |Subject: [PATCH v2 1/2] ctime.3: mktime() may modify tm_hour due to tm_isdst |Date: Mon, 11 Oct 2021 13:12:37 +0200 |Message-Id: <20211011111237.9414-1-alx.manpages@gmail.com> |X-Mailer: git-send-email 2.33.0 |In-Reply-To: |References: |MIME-Version: 1.0 |X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, | DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, | RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, | TXREP autolearn=ham autolearn_force=no version=3.4.4 |X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on | server2.sourceware.org |X-BeenThere: libc-alpha@sourceware.org |X-Mailman-Version: 2.1.29 |Precedence: list |List-Id: Libc-alpha mailing list |List-Unsubscribe: , | |List-Archive: |List-Post: |List-Help: |List-Subscribe: , | |X-Patchwork-Original-From: Alejandro Colomar via Libc-alpha | |From: Alejandro Colomar |Reply-To: Alejandro Colomar |Cc: Alejandro Colomar , libc-alpha@sourceware.org |Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org |Sender: "Libc-alpha" | | |If the input DST value is the opposite of the one that mktime() |uses, which comes from the current system timezone (see tzset(3)), |mktime() will modify the hour (and if it's in a day limit, it may |carry up to modify other fields) to normalize the time to the |correct DST. | |If a user wants to avoid this, the user probably wants to use UTC |time. mktime(3) uses local time, so it's not suitable for that |(by default). Consider the following solutions: | |For that, the recommended solution is to use timegm(3), which |sadly is non-portable (it is present in Linux and the BSDs, but |not in POSIX). | |A portable solution (untested) might be to implement your own |timegm(3): | time_t portable_timegm(struct tm *tm) | { | tm->tm_isdst = 0; | return mktime(tm) - timezone; | } |and assuming no other thread will change the current timezone |during this call. | |Another portable solution would involve setting the timezone |explicitly to UTC+0 with setenv() (see tzset(3)). But this forces |all of the program to use UTC time, which might not be desirable. | |Cc: Paul Eggert |Signed-off-by: Alejandro Colomar |--- | man3/ctime.3 | 7 +++++++ | 1 file changed, 7 insertions(+) | |diff --git a/man3/ctime.3 b/man3/ctime.3 |index 0e2068a09..7a5714be8 100644 |--- a/man3/ctime.3 |+++ b/man3/ctime.3 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 271 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | |From patchwork Mon Oct 11 11:12:39 2021 |Content-Type: text/plain; charset="utf-8" |MIME-Version: 1.0 |Content-Transfer-Encoding: 7bit |X-Patchwork-Submitter: Alejandro Colomar |X-Patchwork-Id: 46070 |Return-Path: |X-Original-To: patchwork@sourceware.org |Delivered-To: patchwork@sourceware.org |Received: from server2.sourceware.org (localhost [IPv6:::1]) | by sourceware.org (Postfix) with ESMTP id D9D893858D28 | for ; Mon, 11 Oct 2021 11:16:07 +0000 (GMT) |DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9D893858D28 |DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; | s=default; t=1633950967; | bh=VoGUuaLKP6nSUCSXd+TdR0iGu3vR93KZ6ekICR1otZg=; | h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: | List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: | From; | b=SqswLDD7MXfaUsGTfWfSqBbzt9KmZy1q1ft7DErAoDNVVpS6KhIZlarPm5mF48K/c | rcUZN7SmnYm2QBjzD9auoLc6KuW2Du5bylNI9ov+4Ejc9/D6uSKc7SQRu2C6nxxDEz | 87M6DTfaj0g/OUxoN3z2q3bY3TtdXXH+z1uLFnUo= |X-Original-To: libc-alpha@sourceware.org |Delivered-To: libc-alpha@sourceware.org |Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com | [IPv6:2a00:1450:4864:20::42f]) | by sourceware.org (Postfix) with ESMTPS id C6C073858D28 | for ; Mon, 11 Oct 2021 11:15:42 +0000 (GMT) |DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C6C073858D28 |Received: by mail-wr1-x42f.google.com with SMTP id o20so54892381wro.3 | for ; Mon, 11 Oct 2021 04:15:42 -0700 (PDT) |X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; | d=1e100.net; s=20210112; | h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to | :references:mime-version:content-transfer-encoding; | bh=VoGUuaLKP6nSUCSXd+TdR0iGu3vR93KZ6ekICR1otZg=; | b=uM4LVzQ6UbndPeqzqRxyNshO9K3xpjzJ/b1bc5Qn/t7jZwbvZylpmAJyVA0ZF/0Irg | W4RYq2pSz/dwLbcVZqFwP29w9xvaWmI044kmlfIZd4S1E0Kh6nC5J/WG9pdO8S1vr7RI | 0/nuiNW08+UpMvEIVBCPNeeYoLEY9azH2emNSr48jUnACi6oDRqoMgeSvOAycBOLhFNw | IGrGA8hS53GPvKs0AVOvx1KcN8oe0kntdnMd9mDW3DRhdn8Qy385jt38jJ6DKWx+Tlnp | TDR3Le+6s0oMNjtTNESR4WjkYlUpn2PrzZZEm5awhzJvqeUMHacvltkAYsS1Cr8MsOXP | 24CQ== |X-Gm-Message-State: AOAM530KxTUQPPSvsdOZexWG9tm0oYZ2ny09Fxtc02BL9P9VtoYeJY+h | 3ILfK54MFRvsXT1HG2tq7oU= |X-Google-Smtp-Source: | ABdhPJy+thS3Kp6AzgoTQwqIrx4TdJOaJPHxVqz+0//heeSeESqIAfZZJ9nDgFk5WuM0DnW8WYR54A== |X-Received: by 2002:adf:de0e:: with SMTP id | b14mr16791412wrm.271.1633950941945; | Mon, 11 Oct 2021 04:15:41 -0700 (PDT) |Received: from sqli.sqli.com ([195.53.121.100]) | by smtp.googlemail.com with ESMTPSA id p17sm1215746wrx.33.2021.10.11.04.15.40 | (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); | Mon, 11 Oct 2021 04:15:41 -0700 (PDT) |To: mtk.manpages@gmail.com, | linux-man@vger.kernel.org |Subject: [PATCH v2 2/2] timegm.3: Remove recommendation against use of | timegm() |Date: Mon, 11 Oct 2021 13:12:39 +0200 |Message-Id: <20211011111237.9414-2-alx.manpages@gmail.com> |X-Mailer: git-send-email 2.33.0 |In-Reply-To: |References: |MIME-Version: 1.0 |X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, | DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, | RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, | TXREP autolearn=ham autolearn_force=no version=3.4.4 |X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on | server2.sourceware.org |X-BeenThere: libc-alpha@sourceware.org |X-Mailman-Version: 2.1.29 |Precedence: list |List-Id: Libc-alpha mailing list |List-Unsubscribe: , | |List-Archive: |List-Post: |List-Help: |List-Subscribe: , | |X-Patchwork-Original-From: Alejandro Colomar via Libc-alpha | |From: Alejandro Colomar |Reply-To: Alejandro Colomar |Cc: Alejandro Colomar , libc-alpha@sourceware.org |Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org |Sender: "Libc-alpha" | | |It was straight after a note that they are nonstandard functions, |which already tells the user that if portability is in mind, they |shouldn't be used, so this recommendation adds nothing in that |sense. | |Also, there's a note that timelocal() should _never_ be used, due |to mktime(3) being identical and in the POSIX standard (it is also |in C99), so this note would also add nothing in that sense. | |So the only uses not covered by those other notes are non-portable |uses of timegm(). In that scenario, it is an excellent function, |since it avoids races, which a home-made timegm(3) implementation |by means of standard functions would have. | |A trivial implementation of timegm(3) using only standard C could |be (I didn't test it; use on your own): | |// portable_timegm.c | #include | |time_t portable_timegm(struct tm *tm) |{ | tm->tm_isdst = 0; | /* | * If another thread modifies the timezone during the | * execution of the line below, it will produce undefined | * behavior. | */ | return mktime(tm) - timezone; |} | |Cc: Paul Eggert |Signed-off-by: Alejandro Colomar |--- | man3/timegm.3 | 1 - | 1 file changed, 1 deletion(-) | |diff --git a/man3/timegm.3 b/man3/timegm.3 |index b848e83e1..0e8528b26 100644 |--- a/man3/timegm.3 |+++ b/man3/timegm.3 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored