| Message ID | 20260706023027.28665-1-sebastian.huber@embedded-brains.de |
|---|---|
| State | New |
| Headers |
Return-Path: <newlib-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 799A34BA2E12 for <patchwork@sourceware.org>; Mon, 6 Jul 2026 02:30:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 799A34BA2E12 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=embedded-brains.de header.i=@embedded-brains.de header.a=rsa-sha256 header.s=34EE5404-8E36-11F0-B577-2ECCAB4968F5 header.b=SpkMrUDh X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 8F7C44BA2E09 for <newlib@sourceware.org>; Mon, 6 Jul 2026 02:30:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F7C44BA2E09 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8F7C44BA2E09 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=85.10.215.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783305036; cv=none; b=Nk7AtUvhWtOp17lBmzxoFGoGugYtG/S2rOWbQN4kPtrQtuhnS128ur0cEiQ+6D93F1bDlU7mME4cdj46PbcG58YggkzXgOcvwTiFtdtaIcWFQJdi65xlLak+z3ayL7+3WPdUrHNpxrNIpEdFfIpGaRCYrLIFeDQqY+DV5e4qQY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783305036; c=relaxed/simple; bh=+VufYMEn5B0lZUfigRA+H+wDZNlt2Vy4A4HHHrgNC08=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=OH+Hbyp/9lXmXdoChJVhMd1KSJ29N1UEkrJ+O3RWcMaK5RI0Y33kr+1DDcDU+DwVCzx2cp9hvTBjssrWULG6KLDRxJgPflDzOt7HE45jJv1gRtxRFLKTAcuzkyOx4IC4SNvXzihCJiBYpGaw0Rq23CeXcQVCVwmzZXS3IIYez/E= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=embedded-brains.de header.i=@embedded-brains.de header.a=rsa-sha256 header.s=34EE5404-8E36-11F0-B577-2ECCAB4968F5 header.b=SpkMrUDh DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F7C44BA2E09 Received: from sslproxy07.your-server.de ([78.47.199.104]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from <sebastian.huber@embedded-brains.de>) id 1wgZ6Q-000OvK-2l for newlib@sourceware.org; Mon, 06 Jul 2026 04:30:34 +0200 Received: from localhost ([127.0.0.1]) by sslproxy07.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <sebastian.huber@embedded-brains.de>) id 1wgZ6Q-000LjI-2b for newlib@sourceware.org; Mon, 06 Jul 2026 04:30:34 +0200 Received: from localhost (localhost.eb.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 4BA36480024 for <newlib@sourceware.org>; Mon, 6 Jul 2026 04:30:34 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id nMH5rtLUROPl for <newlib@sourceware.org>; Mon, 6 Jul 2026 04:30:33 +0200 (CEST) Received: from localhost (localhost.eb.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 9E01C480151 for <newlib@sourceware.org>; Mon, 6 Jul 2026 04:30:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.embedded-brains.de 9E01C480151 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embedded-brains.de; s=34EE5404-8E36-11F0-B577-2ECCAB4968F5; t=1783305033; bh=pIzePW38oFVGfnak7hyBXGvVYNV8N26WWEDcpQETrk8=; h=From:To:Date:Message-ID:MIME-Version; b=SpkMrUDhgjnpVQWVUHQ7p9KVo5iBqDYxus5V2GDI5gwU3JkvgJQRsv+w2Osz2Ezzg AYxwhukyDl+q5X8kCFsOMc668bzg+kEesVFUPVB+Xrujm9ARlhmZRr85B+L+lfVznb qKAnUzY59JCzKsxuGHkp10pVyjdMxqQgqwgPnRmc3gnh37GTOrcdOrV9pVvUI0NvJ+ NoncxCVBREfQa1EnoRz2XgOroX78K9ZFnXp5kQcdJGcPCQlylV4e3ApAvHindtwfgo KeJ8HVBP5w0wIhkMm4bhKWMo2Lu6Q9Yes857gmtIBzDn9jQWSaQLAsYQWpeU/vFLZu T917/hWJi03kQ== X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id iLb1VvER7B6E for <newlib@sourceware.org>; Mon, 6 Jul 2026 04:30:33 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [10.10.171.14]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 04295480024 for <newlib@sourceware.org>; Mon, 6 Jul 2026 04:30:32 +0200 (CEST) From: Sebastian Huber <sebastian.huber@embedded-brains.de> To: newlib@sourceware.org Subject: [PATCH] libc/time: Add C23 timespec_getres() and timegm() Date: Mon, 6 Jul 2026 04:30:27 +0200 Message-ID: <20260706023027.28665-1-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-DKIM-Status: pass [(embedded-brains.de) - 78.47.199.104] X-Virus-Scanned: Clear (ClamAV 1.4.3/28051/Sun Jul 5 08:24:23 2026) X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list <newlib.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/newlib>, <mailto:newlib-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/newlib/> List-Post: <mailto:newlib@sourceware.org> List-Help: <mailto:newlib-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/newlib>, <mailto:newlib-request@sourceware.org?subject=subscribe> Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
libc/time: Add C23 timespec_getres() and timegm()
|
|
Commit Message
Sebastian Huber
July 6, 2026, 2:30 a.m. UTC
Add also TIME_MONOTONIC. These interfaces are defined in the C23
standard.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
newlib/libc/include/time.h | 5 +++++
1 file changed, 5 insertions(+)
Comments
----- Am 6. Jul 2026 um 4:30 schrieb Sebastian Huber sebastian.huber@embedded-brains.de: > Add also TIME_MONOTONIC. These interfaces are defined in the C23 > standard. > > Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de> > --- > newlib/libc/include/time.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h > index 58c5066ed..072aca4ef 100644 > --- a/newlib/libc/include/time.h > +++ b/newlib/libc/include/time.h > @@ -62,6 +62,11 @@ time_t time (time_t *_timer); > > int timespec_get(struct timespec *ts, int base); > #endif > +#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2023 > +#define TIME_MONOTONIC 2 > +int timespec_getres(struct timespec *, int); > +time_t timegm(struct tm * const); > +#endif > #ifndef _REENT_ONLY > char *asctime (const struct tm *_tblock); > char *ctime (const time_t *_time); > -- > 2.51.0 Any comments with respect to this change?
diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h index 58c5066ed..072aca4ef 100644 --- a/newlib/libc/include/time.h +++ b/newlib/libc/include/time.h @@ -62,6 +62,11 @@ time_t time (time_t *_timer); int timespec_get(struct timespec *ts, int base); #endif +#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2023 +#define TIME_MONOTONIC 2 +int timespec_getres(struct timespec *, int); +time_t timegm(struct tm * const); +#endif #ifndef _REENT_ONLY char *asctime (const struct tm *_tblock); char *ctime (const time_t *_time);