From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20233 invoked from network); 24 May 2023 14:05:44 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 24 May 2023 14:05:44 -0000 Received: (qmail 3690 invoked by uid 550); 24 May 2023 14:02:08 -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 3547 invoked from network); 24 May 2023 14:02:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=message-id:in-reply-to:references:from:date:to: resent-date:resent-from:subject:resent-message-id: resent-to; bh=1fm3DyseaqCF5oCQwtuErcd3N7SQzVS8aXarR9JZZWM=; b=RAWgYFqWd1GodRY/830ajmInS/vWkBoTtu01QC/N/d3+KhL7fbJVN3iS 0D5829w0DhN8n0+dc6wfoAcC9qbdPx6M0Y/9Q1W+Bz06yRrwSHbh6Wbqy 5Dn0lDCdDP3B28MgrmQRjV/5YaQQBb0li0Yo9LSPbwJ+EeuWJ67cxtpf/ g=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=jens.gustedt@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.00,189,1681164000"; d="scan'208";a="109477929" Message-Id: <0111b904cf0a9f67184c105055867b49f04a48dc.1684932861.git.Jens.Gustedt@inria.fr> In-Reply-To: References: From: Jens Gustedt Date: Mon, 17 Apr 2023 21:52:41 +0200 To: musl@lists.openwall.com Resent-Date: Wed, 24 May 2023 16:01:50 +0200 Resent-From: =?UTF-8?B?SuKCkeKCmeKCmw==?= Gustedt Resent-Message-ID: <20230524160150.049b5cad@inria.fr> Resent-To: musl@lists.openwall.com Subject: [musl] [C23 divers headers 04/17] C23: add timegm, gmtime_r and localtime_r to time.h in C23 mode These are already present in musl, only they had been protected under some POSIX or BSD macros. Make them available generally. Their names were not reserved previously, so there are potential naming conflicts with application code. --- include/time.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/time.h b/include/time.h index 3d948372..e94b3a01 100644 --- a/include/time.h +++ b/include/time.h @@ -66,14 +66,16 @@ int timespec_get(struct timespec *, int); #define TIME_UTC 1 +struct tm *gmtime_r (const time_t *__restrict, struct tm *__restrict); +struct tm *localtime_r (const time_t *__restrict, struct tm *__restrict); +time_t timegm(struct tm *); + #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) size_t strftime_l (char * __restrict, size_t, const char * __restrict, const struct tm * __restrict, locale_t); -struct tm *gmtime_r (const time_t *__restrict, struct tm *__restrict); -struct tm *localtime_r (const time_t *__restrict, struct tm *__restrict); char *asctime_r (const struct tm *__restrict, char *__restrict); char *ctime_r (const time_t *, char *); @@ -129,7 +131,6 @@ struct tm *getdate (const char *); #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) int stime(const time_t *); -time_t timegm(struct tm *); #endif #if _REDIR_TIME64 -- 2.34.1