From: Falco Girgis <gyrovorbis@gmail.com>
To: newlib@sourceware.org
Subject: C11 timespec_get(), TIME_UTC
Date: Sat, 25 Mar 2023 16:59:44 -0400 [thread overview]
Message-ID: <CAB4=puLVf1WMraT9OpgvHyTnkCZJpovHE=Qy2ONn+OskO+FX5g@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]
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?
Anyway, thanks again, sorry for the verbosity.
next reply other threads:[~2023-03-25 20:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-25 20:59 Falco Girgis [this message]
2023-03-25 21:21 ` Joel Sherrill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAB4=puLVf1WMraT9OpgvHyTnkCZJpovHE=Qy2ONn+OskO+FX5g@mail.gmail.com' \
--to=gyrovorbis@gmail.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).