From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) by sourceware.org (Postfix) with ESMTPS id 5AEFD3858D20 for ; Sat, 25 Mar 2023 21:21:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5AEFD3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rtems.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-53d277c1834so100285147b3.10 for ; Sat, 25 Mar 2023 14:21:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679779305; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Kc31KjY7Lxg4YIsWc9TpMiTsNT6OZ5awf/heQERVRF0=; b=TvZ+oAhXclgSYYR3cCEIIw+BdQd6KwP4M0bd8k9LHQ1ZsuTXRk+RaMqm/ZPjD4uZER NkxHjDRVpoAZQMJYVZAg0n5+f6cbG1jJPUTd+44XUimsmW/+Av887zED71OWvMNJRt36 sduVW5SgQnv+X5ZsY31WGDWV5GZD0hHlwHojuKEKPLet7MNvEWENOoHQMuBnS4UWVZQA pQN+AhN5ykPf6EbqAgiJB4a6tFUKBO8VrpBaDmKghIFGiOJWlX8n+mjV6JTGvEY8vWT2 JTN2viGyuo8OwWMFYhWXNi5l1VAFSHqgjlzH55mobrQq1ENzmo0jkLjfB7+HHs+ATSnx NGHQ== X-Gm-Message-State: AAQBX9fIrcIYervdzQ4pmOap0miQ6CDNazm1R6/2IZqFfcTkwJy47dCR Xs5LWfhGfiPLWkmYdEB0FzGyV7bCv04= X-Google-Smtp-Source: AKy350Ys2jlbcTFbPp5TCZQaGepy54bN2VEhZVjPHq1AhV+PtTdtJZMox0RJqxxLpWIraWpvAD1IrA== X-Received: by 2002:a81:a04a:0:b0:545:8e8c:6c20 with SMTP id x71-20020a81a04a000000b005458e8c6c20mr6366986ywg.36.1679779305492; Sat, 25 Mar 2023 14:21:45 -0700 (PDT) Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com. [209.85.219.170]) by smtp.gmail.com with ESMTPSA id r131-20020a819a89000000b00545a08184casm1158071ywg.90.2023.03.25.14.21.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Mar 2023 14:21:45 -0700 (PDT) Received: by mail-yb1-f170.google.com with SMTP id e65so6191979ybh.10 for ; Sat, 25 Mar 2023 14:21:44 -0700 (PDT) X-Received: by 2002:a05:6902:1209:b0:b76:3b21:b1dc with SMTP id s9-20020a056902120900b00b763b21b1dcmr5691446ybu.0.1679779304738; Sat, 25 Mar 2023 14:21:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: joel@rtems.org From: Joel Sherrill Date: Sat, 25 Mar 2023 16:21:31 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: C11 timespec_get(), TIME_UTC To: gyrovorbis@gmail.com Cc: Newlib Content-Type: multipart/alternative; boundary="000000000000c2970505f7c018f6" X-Spam-Status: No, score=-3031.4 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000c2970505f7c018f6 Content-Type: text/plain; charset="UTF-8" On Sat, Mar 25, 2023, 4:00 PM Falco Girgis wrote: > Hey guys, > > I'm a big user and fan of Newlib and have really enjoyed working with it. > In addition to it being used in a bunch of the builds I target in CI, I'm > one of the maintainers of the KallistiOS indie/homebrew SDK for the Sega > Dreamcast, which has an epic amount of modern language and stdlib support > for C and C++ thanks to you guys. > > Anyway, I just encountered something today that is missing that I can't > help but feel like should really be included within the lib: support for > the C11 timespec struct, timespec_get() function, and the TIME_UTC macro, > used to simply get the current UTC time in seconds + nanoseconds: > https://en.cppreference.com/w/c/chrono/TIME_UTC > > Given the amount of non-standard POSIX time functionality that is > supported, the modern C++ chrono stuff, the rest of the C stdlib, etc, it > feels like this should fall within the scope of the project. It looks like > everybody else is just doing a tiny little wrapper for it around > clock_gettime(), so it's simple to implement as well... I also see several > threads on stack overflow with people confused as to why it's not available > to them, so I'm not the only one interested. > > I've never submitted a patch for anything like this before and wanted to > run this by you guys to make sure it fall within NewLib's scope before I > was going to give it a shot. What do you guys think? > I will go the explanation that hi one had ever wanted it enough to implement it. :) Sure feel free to implement and submit it with the proper license. > > Anyway, thanks again, sorry for the verbosity. > --000000000000c2970505f7c018f6--