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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27203 invoked from network); 31 May 2023 09:24:41 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 31 May 2023 09:24:41 -0000 Received: (qmail 1408 invoked by uid 550); 31 May 2023 09:23:38 -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 32629 invoked from network); 31 May 2023 09:23:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=1fm3DyseaqCF5oCQwtuErcd3N7SQzVS8aXarR9JZZWM=; b=SXnt5ElQANM0+OR0nxTTVF564nFZ5S32bNAoHUI7VZkNU+ykG/HpkHbd rhLB2GTT9X65FdCFn8/xgJVtU6BibncR7z8mj8LzCqWGBEWZgtARd5RRA +PICyyn6p+NyX7LZfJ8GFfBkLYJZCggFZdSWbunI5hVLrUzgkZx2UOzOI M=; Authentication-Results: mail3-relais-sop.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,205,1681164000"; d="scan'208";a="57428736" From: Jens Gustedt To: musl@lists.openwall.com Date: Wed, 31 May 2023 11:22:51 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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