From patchwork Mon Oct 11 11:54:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 46073 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 20DF63858006 for ; Mon, 11 Oct 2021 11:57:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20DF63858006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633953455; bh=N3gu0RB7Rgjr5d1iPqDwnj2FGRpd1mTxBZqZ6Pf2K9A=; 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=VrshgIIOTJaXWEgbPrf3CGm2Ca6mJ3y9mFt8EYfmSM6kaTAhhV0Wjeox1dMADzari JrGdG+x64SpbmdlDLyo6oXzqAKsFG+v7WkURRJLa3p3UNODGwPG2UkjuZr2LL/dzqJ eV3EffbaB9wh1mF2hlZRW1rYH10psHDcRk+RdNy8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 5E388385800E for ; Mon, 11 Oct 2021 11:57:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5E388385800E Received: by mail-wr1-x42c.google.com with SMTP id r7so55380504wrc.10 for ; Mon, 11 Oct 2021 04:57:00 -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=N3gu0RB7Rgjr5d1iPqDwnj2FGRpd1mTxBZqZ6Pf2K9A=; b=dE0tMJV5yZKDlGtHbu40EMz83x/KUleOxfKtPyEWPQFUlN0KuKad0h9JdT6R5+eZu7 +Kl5xxOADRMSB9shZto4UmZUDaxncrJ2chJStqYSHerqE7XiiLACdP0SPfAFSnc+G/5K wa5GFshoqR2uCLqXthr7cJqpeUl0zU9bM9OHwa+QDCYMXYNwjVyhl7MLdBwr/bfQKIJO /2u4LkmIGDDlrpdOOgDab0seh/lFjPht84k215YvYjyhSqBFisFdN1IlB7aRkCRi76Lm lINqQGPKSNfCGUEzG74sHNzb6kmxbUfSphgqFFoz+rbh98KJSoTH1Yyp+KOz1tQlueRy ZFxg== X-Gm-Message-State: AOAM533lZwvplW39puFlvqD4ZWGw3V5G6hTrAdZnb4Yrr8I5I3mRrKfg Gz5g9YEG7889yuVn3RYyGn0= X-Google-Smtp-Source: ABdhPJyKeOwH87qvSSib1gISD3SmlzHTBMh2JLzhcp1+3a59j2A7Pz0MfFNcEfFe4gNkx4pqW2PmDw== X-Received: by 2002:a05:600c:4fcd:: with SMTP id o13mr2199939wmq.158.1633953419476; Mon, 11 Oct 2021 04:56:59 -0700 (PDT) Received: from sqli.sqli.com ([195.53.121.100]) by smtp.googlemail.com with ESMTPSA id l16sm7912490wmj.33.2021.10.11.04.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 04:56:59 -0700 (PDT) To: mtk.manpages@gmail.com, linux-man@vger.kernel.org Subject: [PATCH v3 2/2] timegm.3: Remove recommendation against their use Date: Mon, 11 Oct 2021 13:54:08 +0200 Message-Id: <20211011115406.11430-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() 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(3). In that scenario, it is an excellent function. When porting to other systems, it is trivial to port timegm(3) using only standard C (I didn't test it; use on your own): // timegm.c #include time_t timegm(struct tm *tm) { tm->tm_isdst = 0; 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 @@ -97,7 +97,6 @@ T} Thread safety MT-Safe env locale .SH CONFORMING TO These functions are nonstandard GNU extensions that are also present on the BSDs. -Avoid their use. .SH NOTES The .BR timelocal ()